The Assimilation Project based on Assimilation version 0.5.1427325140
libpcap Packet capture Gsource module. More...
|FSTATIC gboolean||g_source_pcap_prepare (GSource *source,gint *timeout)|
|The GMainLoop prepare function for libpcap packet capturing. More...|
|FSTATIC gboolean||g_source_pcap_check (GSource *src)|
|The GMainLoop check function for libpcap packet capturing. More...|
|FSTATIC gboolean||g_source_pcap_dispatch (GSource *src,GSourceFunc callback,gpointer user_data)|
|The GMainLoop dispatch function for libpcap packet capturing. More...|
|FSTATIC void||g_source_pcap_finalize (GSource *src)|
|The GMainLoop finalize function for libpcap packet capturing Called when this object is 'finalized' (destroyed) More...|
|FSTATIC guint64||proj_timeval_to_g_real_time (const struct timeval *tv)|
|Convert struct timeval to g_get_real_time() style value. More...|
|GSource *||g_source_pcap_new (const char *dev, unsigned listenmask, gboolean(*dispatch)(GSource_pcap_t *gsource, pcap_t *capstruct, gconstpointer pkt, gconstpointer pend, const struct pcap_pkthdr *pkthdr, const char *capturedev, gpointer userdata), GDestroyNotify notify, gint priority, gboolean can_recurse, GMainContext *context, gsize objectsize, gpointer userdata)|
|Construct new GSource from a newly constructed pcap capture object. More...|
|FrameSet *||construct_pcap_frameset (guint16 framesettype, gconstpointer pkt, gconstpointer pktend, const struct pcap_pkthdr *pkthdr, const char *interfacep)|
|Construct a PCAP capture FrameSet from a PCAP packet. More...|
libpcap Packet capture Gsource module.
This code is based on (and meets the API expectations of) the the Glib main event loop (g_main_loop) event scheduler/dispatcher concept. We set things up so that when a libpcap packet arrives that we get invoked. It's a little complicated to set up, but really pretty nice, and quite easy to use once set up. The main function defined in this file is g_source_pcap_new(). We supply four key functions in order to meet the Glib main event loop API:
The main types we use from Glib are:
This file is part of the Assimilation Project.
The Assimilation software is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with the Assimilation Project software. If not, see http://www.gnu.org/licenses/
Definition in file pcap_GSource.c.