|
Data Structures |
| struct | Pkt_EthernetHdr_t |
| | Ethernet Packet Header. More...
|
| struct | Pkt_WifiHdr_t |
| | use for wlan detection More...
|
| struct | Pkt_IpHdr_t |
| | IP Packet header. More...
|
| struct | Pkt_TcpHdr_t |
| | TCP Packet header. More...
|
| struct | Pkt_UdpHdr_t |
| | UDP Packet header. More...
|
| struct | Pkt_IcmpHdr_t |
| | ICMP packet header. More...
|
| struct | Pkt_IpFlags_t |
| | Packed bit-fields for ip frag flags, offset. More...
|
| struct | Pkt_TcpResDoffFlags_t |
| | Packed bit-fields for tcp flags, offset, etc. More...
|
| struct | Pkt_L4Flow_t |
| | Layer 4 flow captured by 4 fields - source/dest IP, source/dest TCP ports. More...
|
| struct | Pkt_LibNet_t |
| | An encapsulation of the libnet_t structure. More...
|
| struct | Pkt_LibPcap_t |
| | An encapsulation of the libpcap_t structure. More...
|
| struct | Pkt_VectorBuff_t |
| | Useful for passing sets of packets around. More...
|
| struct | Pkt_ProcessPkt_t |
| | Packet and rules that are to be applied. More...
|
| struct | Pkt_TfcMode_t |
| | Structure encapsulating settings for Pkt_CreateRandEthPktArray. More...
|
Typedefs |
| typedef Pkt_EthernetHdr_t | Pkt_EthernetHdr_t |
| typedef Pkt_WifiHdr_t | Pkt_WifiHdr_t |
| typedef Pkt_IpHdr_t | Pkt_IpHdr_t |
| typedef Pkt_TcpHdr_t | Pkt_TcpHdr_t |
| typedef Pkt_UdpHdr_t | Pkt_UdpHdr_t |
| typedef Pkt_IcmpHdr_t | Pkt_IcmpHdr_t |
| typedef Pkt_L4Flow_t | Pkt_L4Flow_t |
| typedef Pkt_LibNet_t | Pkt_LibNet_t |
| typedef Pkt_LibPcap_t | Pkt_LibPcap_t |
| typedef Pkt_VectorBuff_t | Pkt_VectorBuff_t |
| typedef Pkt_ProcessPkt_t | Pkt_ProcessPkt_t |
| typedef Pkt_TfcMode_t | Pkt_TfcMode_t |
Enumerations |
| enum | Pkt_L3ProtType_t {
Pkt_L3ProtIp_c = 0x0008,
Pkt_L3ProtComp_c = 0x0009,
Pkt_L3ProtArp_c = 0x0608,
Pkt_L3ProtRarp_c = 0x3580,
Pkt_L3ProtUndef_c = 0x0000
} |
| | Types of layer 3 protocols in host order. More...
|
| enum | Pkt_L4ProtType_t {
Pkt_L4ProtTcp_c = 6,
Pkt_L4ProtUdp_c = 17,
Pkt_L4ProtIcmp_c = 1,
Pkt_L4ProtIgmp_c = 2,
Pkt_L4ProtRsvp_c = 46,
Pkt_L4ProtIPv6_c = 41,
Pkt_L4ProtPIM_c = 103,
Pkt_L4ProtRaw_c = 255,
Pkt_L4ProtUndef_c = 0
} |
| | Types of layer 4 protocols. More...
|
| enum | Pkt_FlowType_t {
Pkt_SrcIpFlow_c,
Pkt_DestIpFlow_c,
Pkt_SrcDestIpFlow_c,
Pkt_SrcDestTcpIpFlow_c,
Pkt_DestTcpIpFlow_c
} |
| | Types of flows. More...
|
| enum | Pkt_ByteOrder_t { Pkt_HostByteOrder_c,
Pkt_NetworkByteOrder_c
} |
| | Types of byte-orders. More...
|
| enum | Pkt_TcpFlags_t {
Pkt_TcpFin_c,
Pkt_TcpSyn_c,
Pkt_TcpRst_c,
Pkt_TcpPsh_c,
Pkt_TcpAck_c,
Pkt_TcpUrg_c,
Pkt_TcpEce_c,
Pkt_TcpCwr_c
} |
| | Types of TCP flags. More...
|
Functions |
| Pkt_IpHdr_t * | Pkt_EthernetExtractIp (Pkt_EthernetHdr_t *ethPkt) |
| | Extract the Ip component from an Ethernet packet.
|
| int | Pkt_EthernetPktHdrReadLengthNetworkOrder (Pkt_EthernetHdr_t *pkt) |
| | Return the length of the Ethernet packet, including header.
|
| int | Pkt_EthernetPktHdrReadLength (Pkt_EthernetHdr_t *pkt) |
| | Return the length of the Ethernet packet, including header.
|
| int | Pkt_EthernetHdrFree (Pkt_EthernetHdr_t *pkt) |
| | Free an Ethernet packet.
|
| int | Pkt_ProcessPktFree (Pkt_ProcessPkt_t *pp) |
| | Free an ProcessPkt structure.
|
| Pkt_IcmpHdr_t * | Pkt_IpExtractIcmp (Pkt_IpHdr_t *anIpPkt) |
| | Extract the Icmp component from an Ip packet.
|
| Pkt_UdpHdr_t * | Pkt_IpExtractUdp (Pkt_IpHdr_t *anIpPkt) |
| | Extract the Udp component from an Ip packet.
|
| Pkt_TcpHdr_t * | Pkt_IpExtractTcp (Pkt_IpHdr_t *anIpPkt) |
| | Extract the Tcp component from an Ip packet.
|
| char * | Pkt_IpExtractPayload (Pkt_IpHdr_t *anIpPkt) |
| | Extract the payload component from an Ip packet.
|
| Pkt_UdpHdr_t * | Pkt_EthernetExtractUdp (Pkt_EthernetHdr_t *aEthernetPkt) |
| | Extract the Tcp component from an Ethernet packet.
|
| Pkt_TcpHdr_t * | Pkt_EthernetExtractTcp (Pkt_EthernetHdr_t *aEthernetPkt) |
| | Extract the Tcp component from an Ethernet packet.
|
| Pkt_IcmpHdr_t * | Pkt_EthernetExtractIcmp (Pkt_EthernetHdr_t *aEthernetPkt) |
| | Extract the Icmp component from an Ethernet packet.
|
| char * | Pkt_UdpHdrReadPayload (Pkt_UdpHdr_t *aUdpPkt) |
| | Returns a pointer to the payload of a UDP packet.
|
| char * | Pkt_TcpHdrReadPayload (Pkt_TcpHdr_t *aTcpPkt) |
| | Returns a pointer to the payload of a TCP packet.
|
| int | Pkt_SrcIpFlowCmp (Pkt_EthernetHdr_t *pkt1, Pkt_EthernetHdr_t *pkt2) |
| | Compare two src ip flows Returns -1, 0, 1 a la strcmp.
|
| int | Pkt_DestIpFlowCmp (Pkt_EthernetHdr_t *pkt1, Pkt_EthernetHdr_t *pkt2) |
| | Compare two dest ip flows Returns -1, 0 , 1.
|
| int | Pkt_SrcDestIpFlowCmp (Pkt_EthernetHdr_t *pkt1, Pkt_EthernetHdr_t *pkt2) |
| | Compare two src-dest ip flows Returns -1,0,1 a la strcmp.
|
| int | Pkt_DestTcpIpFlowCmp (Pkt_EthernetHdr_t *pkt1, Pkt_EthernetHdr_t *pkt2) |
| | Compare two dest tcp-Ip flows. Returns -1, 0, 1 a la strcmp.
|
| int | Pkt_SrcIpFlowHash (Pkt_EthernetHdr_t *pkt1, int modulus) |
| | Hash a src-ip flow.
|
| int | Pkt_DestIpFlowHash (Pkt_EthernetHdr_t *pkt1, int modulus) |
| | Hash a dest-ip.
|
| int | Pkt_SrcDestIpFlowHash (Pkt_EthernetHdr_t *pkt1, int modulus) |
| | Hash a src-dest ip flow.
|
| int | Pkt_DestTcpIpFlowHash (Pkt_EthernetHdr_t *pkt1, int modulus) |
| | Hash a dest tcp-Ip flow.
|
| int | Pkt_SrcDestTcpIpFlowHash (Pkt_EthernetHdr_t *pkt1, int modulus) |
| | Hash a tcp-Ip flow.
|
| int | Pkt_SrcDestTcpIpFlowCmp (Pkt_EthernetHdr_t *pkt1, Pkt_EthernetHdr_t *pkt2) |
| | Compare two Tcp-Ip flows. Returns -1, 0, 1 a la strcmp.
|
| int | Pkt_L4FlowCompareForSt (Pkt_L4Flow_t *foo, Pkt_L4Flow_t *bar) |
| | Compare function for an L4 flow struct for the st package, returns 0 for equal, 1 for unequal.
|
| int | Pkt_L4FlowCompare (Pkt_L4Flow_t *foo, Pkt_L4Flow_t *bar) |
| | Compare function for an L4 flow struct - 1 for equal, 0 for unequal.
|
| int | Pkt_L4FlowHashForSt (Pkt_L4Flow_t *anL4Flow_t, int modulus) |
| | Hash function for an L4 flow struct with modulus argument.
|
| unsigned int | Pkt_L4FlowHash (Pkt_L4Flow_t *anL4Flow_t) |
| | Hash function for an L4 flow struct.
|
| Pkt_L4Flow_t * | Pkt_EthPktToL4Flow (Pkt_EthernetHdr_t *anEthPkt) |
| | Create a L4 flow structure from an Ethernet packet.
|
| Pkt_L4Flow_t * | Pkt_IpPktToL4Flow (Pkt_IpHdr_t *anIpPkt) |
| | Create a L4 flow structure from an Ip packet.
|
| int | Pkt_EthernetReadL3Type (Pkt_EthernetHdr_t *anEth) |
| | Return the L3 type of an ethernet packet.
|
| int | Pkt_PrintEthernet (Pkt_EthernetHdr_t *anEthPkt, int length) |
| | Print an Ethernet packet.
|
| int | Pkt_PrintWifi (Pkt_WifiHdr_t *aWifiPkt) |
| | Print a Wifi packet.
|
| int | Pkt_PrintIp (Pkt_IpHdr_t *anIpPkt) |
| | Print an Ip Pkt, given in network order.
|
| void | Pkt_PrintIpAddressDotted (u_int32_t aNumIp) |
| | Print an Ip address in 1.2.3.4 format.
|
| void | Pkt_PrintIpAddressDottedGeneral (char *, u_int32_t aNumIp) |
| | Print an Ip address in 1.2.3.4 format.
|
| Pkt_ProcessPkt_t * | Pkt_AllocateProcessPacket (Pkt_EthernetHdr_t *pkt, array_t *applicableRules) |
| | Allocate a process-packet structure.
|
| int | Pkt_DeviceSkb () |
| Pkt_VectorBuff_t * | Pkt_SocketVectorWrite (int count) |
| int | Pkt_EthPacketWriteToFile (int fd, Pkt_EthernetHdr_t *anEthPkt, unsigned int length) |
| | Write an ethernet frame to file. File is assumed to be open and writable. Format: length followed by sequence of bytes.
|
| int | Pkt_EthPacketReadFromFile (int fd, Pkt_EthernetHdr_t **anEthPktPtr) |
| | Read an Ethernet frame from a file Returns NIL if the file is empty, and otherwise a pointer to the frame. Caller is responsible for freeing the memory allocated for the frame.
|
| array_t * | Pkt_CreatePktsFromString (char *pktFile) |
| | Create a packets from a textual description.
|
| Pkt_EthernetHdr_t * | Pkt_CreatePktFromString (char *pktString) |
| | Create single packet from string.
|
| int | Pkt_Init (char *ifName, int numRounds, int markPoint) |
| Pkt_LibNet_t * | Pkt_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_t * | Pkt_InitLibPcapArray (array_t *inArray) |
| | Initialize an array of pcap objects, one per array entry.
|
| array_t * | Pkt_InitLibNetArray (array_t *outArray) |
| | Initialize an array of libnet objects, one per array entry.
|
| Pkt_LibPcap_t * | Pkt_InitLibPcap (char *interfaceName) |
| | Initialize our encapsulation of a pcap_t.
|
| int | Pkt_LibPcapFinish (Pkt_LibPcap_t *obj) |
| | Finish using a Pkt_LibPcap_t struct.
|
| util_byte_array_t * | Pkt_CreateIcmpPkt (array_t *typeArray, array_t *codeArray, array_t *idArray, array_t *seqArray) |
| | Create an ICMP packet.
|
| util_byte_array_t * | Pkt_CreateUdpPkt (array_t *srcPorts, array_t *destPorts, array_t *sizes, array_t *byteStrings) |
| | Create a UDP packet.
|
| util_byte_array_t * | Pkt_CreateTcpPkt (array_t *srcPorts, array_t *destPorts, array_t *seqNums, array_t *ackNums, st_table *flags, array_t *sizes, array_t *byteStrings) |
| | Create a TCP packet.
|
| util_byte_array_t * | Pkt_CreateIpPkt (array_t *srcIps, array_t *destIps, st_table *ipFlagsTable, array_t *offsets, array_t *ids, st_table *ipOptions, array_t *ttls, util_byte_array_t *l4Payload, int l4Protocol) |
| | Create a IP packet.
|
| Pkt_EthernetHdr_t * | Pkt_CreateEthPkt (char *srcMac, char *destMac, util_byte_array_t *l3Payload, u_int16_t l3Protocol) |
| | Create Ethernet packet with given params.
|
| Pkt_EthernetHdr_t * | Pkt_CreateRandEthPkt (array_t *tmpArray) |
| | Create a random ethernet packet.
|
| array_t * | Pkt_SeedRandEthPktArray (Pkt_ByteOrder_t byteOrder, int numSeeds, Pkt_TfcMode_t *tfcMode) |
| | Create a random ethernet packet; only tcp for now.
|
| void | Pkt_HTON (Pkt_EthernetHdr_t *anEth) |
| | Take an ethernet packet and convert it to network order.
|
| void | Pkt_NTOH (Pkt_EthernetHdr_t *anEth) |
| | Take an ethernet packet and convert it to host order.
|
| int | Rlp_UpdateDefineTable (st_table *aTable, char *anEntry) |
| | Adds a mapping from a macro name to definition.
|
| array_t * | Rlp_L7StringParse (char *l7Rule) |
| | Parse a string encoding a Layer 7 formula.
|
| u_int32_t | Rlp_DotToInt (char *) |
| | Convert a string in dotted decimal notation to an unsigned 32 bit int.
|
| array_t* Pkt_CreatePktsFromString |
( |
char * |
pktFile |
) |
|
Create a packets from a textual description.
- See also:
- Pkt_CreateRandIpPkt
Format
protocol: ip, udp, tcp, icmp
offset is from 0 to 2^13 - 1
ttl is from 0 to 255
ipflag:RB,DF,MF (one of)
tcpflag:fin,syn,rst,psh,ack,urg,ece,cwr (one of)
ipoptions:EOOL,NOP,SEC,LSR,TS,E-SEC,CIPSO,RR,SID,SSR,ZSU,
MTUP,MTUR,FINN,VISA,ENCODE,IMITD,EIP,TR,ADDEXT,RTRALT,SDB,NSAPA,DPS,UMP
size is size of ENTIRE packet, including header (but not ethernet part)
content:"foo" --- use escapes, etc. appropriately
Ex.
srcip:192.168.1.1; destip:1.2.3.4; ipflags:MF; ipoptions:EOOL; offset:1234; id:100; ttl:255; protocol:tcp; srcport:80;
destport:80; seq:100; ack:100; tcpflag:fin; size:100; content:"foo";
Definition at line 134 of file pktFile.c.