The Assimilation Project
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
pcap_GSource.h
Go to the documentation of this file.
1 
27 #ifndef _PCAP_GSOURCE_H
28 #define _PCAP_GSOURCE_H
29 #include <projectcommon.h>
30 #include <glib.h>
31 #include <pcap_min.h>
32 #include <frameset.h>
34 
38 struct _GSource_pcap {
39  GSource gs;
40  GPollFD gfd;
41  pcap_t* capture;
42  struct bpf_program pcprog;
43  int capturefd;
44  char* capturedev;
45  unsigned listenmask;
46  gint gsourceid;
47  gpointer userdata;
48  gboolean (*dispatch)(GSource_pcap_t* gsource,
50  pcap_t* capstruct,
51  gconstpointer pkt,
52  gconstpointer pend,
53  const struct pcap_pkthdr* pkthdr,
54  const char * capturedev,
55  gpointer userdata);
56  GDestroyNotify destroynote;
58 };
59 
60 WINEXPORT GSource* g_source_pcap_new(const char * dev,
61  unsigned listenmask,
62  gboolean (*dispatch)
63  (GSource_pcap_t* gsource,
64  pcap_t* capstruct,
65  gconstpointer pkt,
66  gconstpointer pend,
67  const struct pcap_pkthdr* pkthdr,
68  const char * capturedev,
69  gpointer userdata
70  ),
71  GDestroyNotify notify,
72  gint priority,
73  gboolean can_recurse,
74  GMainContext* context,
75  gsize objectsize,
76  gpointer userdata
77  );
78 WINEXPORT void g_source_pcap_finalize(GSource* src); // Here to work around some Glib bugs/misunderstandings...
79 WINEXPORT FrameSet* construct_pcap_frameset(guint16 framesettype, gconstpointer pkt, gconstpointer pktend,
80  const struct pcap_pkthdr* pkthdr, const char * interfacep);
81 #endif /* _PCAP_GSOURCE_H */