Embedded Xinu Operating System
An ongoing research project and educational operating system.
 All Data Structures Files Functions Variables Typedefs Enumerations Macros Groups Pages
Functions
Packet snooping

View the data of packets being send and received over a network interface. More...

Functions

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)
 

Detailed Description

View the data of packets being send and received over a network interface.

Function Documentation

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
cappointer 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
cappointer to capture structure
nameof 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
pktpacket
dumpdump level
verboseverbosity level
Returns
OK, SYSERR if error occurs
int snoopPrintArp ( struct arpPkt *  arp,
char  verbose 
)

Print contents of ARP packet

Parameters
arpARP packet
Returns
OK if print successful, SYSERR if error occurs
int snoopPrintEthernet ( struct etherPkt *  ether,
char  verbose 
)

Print contents of Ethernet packet

Parameters
etherEthernet packet
Returns
OK if print successful, SYSERR if error occurs
int snoopPrintIpv4 ( struct ipv4Pkt *  ip,
char  verbose 
)

Print contents of an IPv4 packet

Parameters
ipIPv4 packet
Returns
OK if print successful, SYSERR if error occurs
int snoopPrintTcp ( struct tcpPkt *  tcp,
char  verbose 
)

Print contents of an TCP packet

Parameters
tcpTCP packet
Returns
OK if print successful, SYSERR if error occurs
int snoopPrintUdp ( struct udpPkt *  udp,
char  verbose 
)

Print contents of an UDP packet

Parameters
pktthe packet
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