Azinix

pktNet.c File Reference

Routines for reading and writing packets to the network. More...

#include "pkt.h"

Go to the source code of this file.

Functions

Pkt_LibNet_tPkt_InitLibNet (char *interfaceName)
 Routine for creating an encapsulation of the libnet data structures.
int Pkt_LibNetFinish (Pkt_LibNet_t *obj)
 Finish using a Pkt_LibNet_t struct.
int Pkt_EthPktWrite (Pkt_EthernetHdr_t *anEth, int anEthLength, Pkt_LibNet_t *aNetObj)
 Transmit a raw ethernet frame.
array_tPkt_InitLibPcapArray (array_t *inArray)
 Initialize an array of pcap objects, one per array entry.
array_tPkt_InitLibNetArray (array_t *outArray)
 Initialize an array of libnet objects, one per array entry.
Pkt_LibPcap_tPkt_InitLibPcap (char *interfaceName)
 Initialize our encapsulation of a pcap_t.
int Pkt_LibPcapFinish (Pkt_LibPcap_t *obj)
 Finish using a Pkt_LibPcap_t struct.


Detailed Description

Routines for reading and writing packets to the network.

Definition in file pktNet.c.


Function Documentation

int Pkt_EthPktWrite ( Pkt_EthernetHdr_t anEth,
int  anEthLength,
Pkt_LibNet_t aNetObj 
)

Transmit a raw ethernet frame.

Exits on fail, returns number of bytes written on success.

Definition at line 72 of file pktNet.c.

Pkt_LibNet_t* Pkt_InitLibNet ( char *  interfaceName  ) 

Routine for creating an encapsulation of the libnet data structures.

If the interface name passed in is null, default to "eth0".

Definition at line 27 of file pktNet.c.

array_t* Pkt_InitLibNetArray ( array_t outArray  ) 

Initialize an array of libnet objects, one per array entry.

Definition at line 117 of file pktNet.c.

Pkt_LibPcap_t* Pkt_InitLibPcap ( char *  interfaceName  ) 

Initialize our encapsulation of a pcap_t.

Definition at line 136 of file pktNet.c.

array_t* Pkt_InitLibPcapArray ( array_t inArray  ) 

Initialize an array of pcap objects, one per array entry.

Definition at line 98 of file pktNet.c.

int Pkt_LibNetFinish ( Pkt_LibNet_t obj  ) 

Finish using a Pkt_LibNet_t struct.

Definition at line 56 of file pktNet.c.

int Pkt_LibPcapFinish ( Pkt_LibPcap_t obj  ) 

Finish using a Pkt_LibPcap_t struct.

Definition at line 255 of file pktNet.c.