Permalink
Browse files

fixed a problem with extern C methods

  • Loading branch information...
1 parent 900f2c3 commit 48aad434489afc84a41b1f770dc4280bb2102a46 @joeferner committed Jan 25, 2012
Showing with 40 additions and 31 deletions.
  1. +1 −2 examples/package.json
  2. +1 −1 examples/print.js
  3. +14 −12 src/dissector.h
  4. +7 −5 src/dissectorNode.h
  5. +7 −5 src/lazyDataSource.h
  6. +6 −4 src/lazyDissectorNode.h
  7. +4 −2 src/nodeshark.h
@@ -4,7 +4,6 @@
"private": true,
"dependencies": {
"optimist": "~0.3.1",
- "pcap-parser": "~0.0.3",
- "nodeshark": "~0.0.1"
+ "pcap-parser": "~0.0.3"
}
}
View
@@ -1,7 +1,7 @@
#!/usr/bin/env node
var optimist = require('optimist');
-var nodeshark = require("nodeshark");
+var nodeshark = require("../");
var pcapp = require("pcap-parser");
var argv = optimist
View
@@ -11,18 +11,20 @@
#include <ctype.h>
#include <locale.h>
#include <limits.h>
-#include <config.h>
-#include <epan/epan.h>
-#include <wsutil/privileges.h>
-#include <epan/epan_dissect.h>
-#include <epan/to_str.h>
-#include <epan/timestamp.h>
-#include <epan/prefs.h>
-#include <epan/column.h>
-#include <epan/packet.h>
-#include <epan/plugins.h>
-#include <cfile.h>
-#include <log.h>
+extern "C" {
+ #include <config.h>
+ #include <epan/epan.h>
+ #include <wsutil/privileges.h>
+ #include <epan/epan_dissect.h>
+ #include <epan/to_str.h>
+ #include <epan/timestamp.h>
+ #include <epan/prefs.h>
+ #include <epan/column.h>
+ #include <epan/packet.h>
+ #include <epan/plugins.h>
+ #include <cfile.h>
+ #include <log.h>
+}
#include <glib.h>
#include <string>
View
@@ -4,19 +4,21 @@
#include <v8.h>
#include <node.h>
-#include <config.h>
-#include <epan/epan.h>
+extern "C" {
+ #include <config.h>
+ #include <epan/epan.h>
+}
class DissectorNode : node::ObjectWrap {
public:
static void Init(v8::Handle<v8::Object> target);
static v8::Local<v8::Object> New(DissectorNode *root, frame_data *fdata, epan_dissect_t *edt, proto_node *node);
bool isRoot() { return this == m_root; }
-
+
private:
DissectorNode(DissectorNode *root, frame_data *fdata, epan_dissect_t *edt, proto_node *node);
~DissectorNode();
-
+
static void NotImplementedSetter(v8::Local<v8::String> property, v8::Local<v8::Value> value, const v8::AccessorInfo& info);
static v8::Handle<v8::Value> AbbreviationGetter(v8::Local<v8::String> property, const v8::AccessorInfo& info);
static int getPositionInPacket(proto_node *node, field_info *fi);
@@ -36,7 +38,7 @@ class DissectorNode : node::ObjectWrap {
static void rawDataSetter(v8::Local<v8::String> property, v8::Local<v8::Value> value, const v8::AccessorInfo& info);
v8::Handle<v8::Value> getAbbreviation(proto_node *node);
static v8::Handle<v8::Value> getRepresentation(proto_node *node);
-
+
static v8::Persistent<v8::FunctionTemplate> s_ct;
DissectorNode *m_root;
frame_data *m_fdata;
View
@@ -4,8 +4,10 @@
#include <v8.h>
#include <node.h>
-#include <config.h>
-#include <epan/epan.h>
+extern "C" {
+ #include <config.h>
+ #include <epan/epan.h>
+}
#include <node_buffer.h>
class DissectorNode;
@@ -15,12 +17,12 @@ class LazyDataSource : node::ObjectWrap {
static void Init(v8::Handle<v8::Object> target);
static v8::Local<v8::Object> New(DissectorNode *parent, tvbuff_t *tvb);
node::Buffer* createBuffer();
- DissectorNode* getParent() { return m_parent; }
-
+ DissectorNode* getParent() { return m_parent; }
+
private:
LazyDataSource(DissectorNode *parent, tvbuff_t *tvb);
~LazyDataSource();
-
+
static v8::Persistent<v8::FunctionTemplate> s_ct;
DissectorNode *m_parent;
tvbuff_t *m_tvb;
@@ -4,19 +4,21 @@
#include <v8.h>
#include <node.h>
-#include <config.h>
-#include <epan/epan.h>
+extern "C" {
+ #include <config.h>
+ #include <epan/epan.h>
+}
class LazyDissectorNode : node::ObjectWrap {
public:
static void Init(v8::Handle<v8::Object> target);
static v8::Local<v8::Object> New(frame_data *fdata, epan_dissect_t *edt, proto_node *node);
proto_node* getProtoNode() { return m_node; }
-
+
private:
LazyDissectorNode(frame_data *fdata, epan_dissect_t *edt, proto_node *node);
~LazyDissectorNode();
-
+
static v8::Persistent<v8::FunctionTemplate> s_ct;
frame_data *m_fdata;
epan_dissect_t *m_edt;
View
@@ -11,8 +11,10 @@
#include <ctype.h>
#include <locale.h>
#include <limits.h>
-#include <config.h>
-#include <epan/epan.h>
+extern "C" {
+ #include <config.h>
+ #include <epan/epan.h>
+}
class NodeShark : node::ObjectWrap {
public:

0 comments on commit 48aad43

Please sign in to comment.