The Assimilation Project  based on Assimilation version 1.1.2.1454725746
pcap_min.h File Reference

Simple libpcap interface definitions. More...

#include <projectcommon.h>
#include <pcap.h>
Include dependency graph for pcap_min.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  pcap_capture_iter
 

Macros

#define ENABLE_LLDP   0x1
 Enable LLDP protocol. More...
 
#define ENABLE_CDP   0x2
 Enable CDP protocol. More...
 
#define ENABLE_ARP   0x4
 Enable ARP protocol. More...
 

Functions

WINEXPORT pcap_t * create_pcap_listener (const char *dev, gboolean blocking, unsigned listenmask, struct bpf_program *)
 Set up pcap listener for the given interfaces and protocols. More...
 
WINEXPORT void close_pcap_listener (pcap_t *, const char *dev, unsigned listenmask)
 Close this pcap_listener, and undo listens for multicast addresses. More...
 
WINEXPORT struct pcap_capture_iterpcap_capture_iter_new (const char *capture_filename)
 
WINEXPORT void pcap_capture_iter_del (struct pcap_capture_iter *iter)
 
WINEXPORT const guint8 * pcap_capture_iter_next (struct pcap_capture_iter *iter, const guint8 **pktend, guint *pktlen)
 

Detailed Description

Simple libpcap interface definitions.

Creates a libpcap pcap_t listener for the given set of protocols. This is a much higher level, but much less flexible approach than the native libpcap interface.

This file is part of the Assimilation Project.

Author
Copyright © 2011, 2012 - Alan Robertson alanr.nosp@m.@uni.nosp@m.x.sh
The Assimilation software is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

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_min.h.

Function Documentation

WINEXPORT void close_pcap_listener ( pcap_t *  ,
const char *  dev,
unsigned  listenmask 
)

Close this pcap_listener, and undo listens for multicast addresses.

Parameters
devdevice that this is opened on
listenmaskThe 'listenmask' given to create_pcap_listener

Definition at line 197 of file pcap_min.c.

References _enable_mcast_address(), and DIMOF.

Referenced by create_pcap_listener(), and g_source_pcap_finalize().

Here is the call graph for this function:

Here is the caller graph for this function:

WINEXPORT pcap_t* create_pcap_listener ( const char *  dev,
gboolean  blocking,
unsigned  listenmask,
struct bpf_program *  prog 
)

Set up pcap listener for the given interfaces and protocols.

Returns
a properly configured pcap_t* object for listening for the given protocols - NULL on error
See also
Protocols known to (supported by) create_pcap_listener().
Todo:
deal with pcap_set_timeout() call here.
Parameters
[in]devDevice name to listen on
[in]blockingTRUE if this is a blocking connection
[in]listenmaskBit mask of protocols to listen for (see list of valid bits)
[out]progCompiled PCAP program

Definition at line 66 of file pcap_min.c.

References __FUNCTION__, _enable_mcast_address(), BINDDEBUG, close_pcap_listener(), DEBUGMSG1, DIMOF, and g_info.

Referenced by g_source_pcap_new().

Here is the call graph for this function:

Here is the caller graph for this function:

WINEXPORT void pcap_capture_iter_del ( struct pcap_capture_iter iter)

Definition at line 273 of file pcap_min.c.

References FREE, and pcap_capture_iter::pcfd.

WINEXPORT struct pcap_capture_iter* pcap_capture_iter_new ( const char *  capture_filename)

Definition at line 254 of file pcap_min.c.

References __FUNCTION__, MALLOCTYPE, and pcap_capture_iter::pcfd.

Referenced by cma.AssimCclasses.pyPcapCapture::__init__().

Here is the caller graph for this function:

WINEXPORT const guint8* pcap_capture_iter_next ( struct pcap_capture_iter iter,
const guint8 **  pktend,
guint *  pktlen 
)

Definition at line 285 of file pcap_min.c.

References pcap_capture_iter::pcfd.

Referenced by cma.AssimCclasses.pyPcapCapture::__iter__().

Here is the caller graph for this function: