View the data of packets being send and received over a network interface.
More...
|
int | snoopCapture (struct snoop *cap, struct packet *pkt) |
|
int | snoopClose (struct snoop *cap) |
|
bool | snoopFilter (struct snoop *s, struct packet *pkt) |
|
int | snoopOpen (struct snoop *cap, char *devname) |
|
int | snoopPrint (struct packet *pkt, char dump, char verbose) |
|
int | snoopPrintArp (struct arpPkt *arp, char verbose) |
|
int | snoopPrintEthernet (struct etherPkt *ether, char verbose) |
|
int | snoopPrintIpv4 (struct ipv4Pkt *ip, char verbose) |
|
int | snoopPrintTcp (struct tcpPkt *tcp, char verbose) |
|
int | snoopPrintUdp (struct udpPkt *udp, char verbose) |
|
struct packet * | snoopRead (struct snoop *cap) |
|
View the data of packets being send and received over a network interface.
int snoopCapture |
( |
struct snoop * |
cap, |
|
|
struct packet * |
pkt |
|
) |
| |
Captures a network packet from a network interface.
- Returns
- OK if capture was successful, otherwise SYSERR
int snoopClose |
( |
struct snoop * |
cap | ) |
|
Closes a capture from a network device or file.
- Parameters
-
cap | pointer to capture structure |
- Returns
- OK if close was successful, otherwise SYSERR
bool snoopFilter |
( |
struct snoop * |
s, |
|
|
struct packet * |
pkt |
|
) |
| |
Determine if a packet matches the filter.
- Returns
- TRUE if packet matches filter, otherwise FALSE
int snoopOpen |
( |
struct snoop * |
cap, |
|
|
char * |
devname |
|
) |
| |
Opens a capture from a network device.
- Parameters
-
cap | pointer to capture structure |
name | of underlying device, ALL for all network devices |
- Returns
- OK if open was successful, otherwise SYSERR
- Precondition
- -condition filter settings should already be setup in cap
int snoopPrint |
( |
struct packet * |
pkt, |
|
|
char |
dump, |
|
|
char |
verbose |
|
) |
| |
Outputs snoop information for a packet.
- Parameters
-
pkt | packet |
dump | dump level |
verbose | verbosity level |
- Returns
- OK, SYSERR if error occurs
int snoopPrintArp |
( |
struct arpPkt * |
arp, |
|
|
char |
verbose |
|
) |
| |
Print contents of ARP packet
- Parameters
-
- Returns
- OK if print successful, SYSERR if error occurs
int snoopPrintEthernet |
( |
struct etherPkt * |
ether, |
|
|
char |
verbose |
|
) |
| |
Print contents of Ethernet packet
- Parameters
-
- Returns
- OK if print successful, SYSERR if error occurs
int snoopPrintIpv4 |
( |
struct ipv4Pkt * |
ip, |
|
|
char |
verbose |
|
) |
| |
Print contents of an IPv4 packet
- Parameters
-
- Returns
- OK if print successful, SYSERR if error occurs
int snoopPrintTcp |
( |
struct tcpPkt * |
tcp, |
|
|
char |
verbose |
|
) |
| |
Print contents of an TCP packet
- Parameters
-
- Returns
- OK if print successful, SYSERR if error occurs
int snoopPrintUdp |
( |
struct udpPkt * |
udp, |
|
|
char |
verbose |
|
) |
| |
Print contents of an UDP packet
- Parameters
-
- Returns
- OK if print successful, SYSERR if error occurs
struct packet* snoopRead |
( |
struct snoop * |
cap | ) |
|
Returns a packet captured from a network interface.
- Returns
- a packet if read was successful, otherwise SYSERR