Main Page | Modules | Class List | Directories | File List | Class Members | File Members | Related Pages

flow_packet.h File Reference

interface for packet structures between snort and flow More...

#include "decode.h"
#include "common_defs.h"
#include <string.h>

Go to the source code of this file.

Typedefs

typedef Packet FLOWPACKET

Functions

static int INLINE IsIPv4Packet (FLOWPACKET *p)
static int INLINE IsTcpPacket (FLOWPACKET *p)
static u_int8_t INLINE GetTcpFlags (FLOWPACKET *p)
static u_int16_t INLINE GetIPv4SrcPort (FLOWPACKET *p)
static u_int16_t INLINE GetIPv4DstPort (FLOWPACKET *p)
static u_int8_t INLINE GetIPv4Proto (FLOWPACKET *p)
static u_int32_t INLINE GetIPv4SrcIp (FLOWPACKET *p)
static u_int32_t INLINE GetIPv4DstIp (FLOWPACKET *p)
static int INLINE GetIPv4Len (FLOWPACKET *p)


Detailed Description

interface for packet structures between snort and flow

Author:
Chris Green <cmg@sourcefire.com>
Date:
Wed Jun 25 09:20:41 2003
Camel Hump notation for cleaner integration w/ snort

Definition in file flow_packet.h.


Typedef Documentation

typedef Packet FLOWPACKET
 

Definition at line 21 of file flow_packet.h.


Function Documentation

static u_int32_t INLINE GetIPv4DstIp FLOWPACKET p  )  [static]
 

Returns the DIP portion of a packet.

This function assumes that there this packet is has been properly identified to contain an IPv4 Header.

This performs memcpy's incase the IPH is not aligned in snort.

Parameters:
p packet
Returns:
the sport || 0

Definition at line 174 of file flow_packet.h.

References FLOWASSERT, _IPHdr::ip_dst, and _Packet::iph.

Referenced by flowkey_make(), and flowps_mkpacket().

static u_int16_t INLINE GetIPv4DstPort FLOWPACKET p  )  [static]
 

Returns the Destination Port portion of a packet in host byte order.

This function assumes that there this packet is has been properly identified to contain an IPv4 Header.

Parameters:
p packet
Returns:
the sport || 0

Definition at line 108 of file flow_packet.h.

References _Packet::dp, and FLOWASSERT.

Referenced by flowkey_make().

static int INLINE GetIPv4Len FLOWPACKET p  )  [static]
 

Get the IP length of a packet.

Parameters:
p packet to operate on
Returns:
size of the packet

Definition at line 192 of file flow_packet.h.

References _Packet::dsize, FLOWASSERT, _IPHdr::ip_len, and _Packet::iph.

Referenced by flowstat_callback().

static u_int8_t INLINE GetIPv4Proto FLOWPACKET p  )  [static]
 

Returns the IP Protocol portion of a packet.

This function assumes that there this packet is has been properly identified to contain an IPv4 Header.

Parameters:
p packet
Returns:
the sport || 0

Definition at line 129 of file flow_packet.h.

References FLOWASSERT, _IPHdr::ip_proto, and _Packet::iph.

Referenced by flowkey_make().

static u_int32_t INLINE GetIPv4SrcIp FLOWPACKET p  )  [static]
 

Returns the SIP portion of a packet.

This function assumes that there this packet is has been properly identified to contain an IPv4 Header.

This performs memcpy's incase the IPH is not aligned in snort.

Parameters:
p packet
Returns:
the sport || 0

Definition at line 151 of file flow_packet.h.

References FLOWASSERT, _IPHdr::ip_src, and _Packet::iph.

Referenced by flowkey_make().

static u_int16_t INLINE GetIPv4SrcPort FLOWPACKET p  )  [static]
 

Returns the Source Port portion of a packet in host byte order.

This function assumes that there this packet is has been properly identified to contain an IPv4 Header.

Parameters:
p packet
Returns:
the sport || 0

Definition at line 86 of file flow_packet.h.

References FLOWASSERT, and _Packet::sp.

Referenced by flowkey_make().

static u_int8_t INLINE GetTcpFlags FLOWPACKET p  )  [static]
 

Determine if this is an Tcp packet

Parameters:
p packet to determine if it's tcp
Returns:
1 if it is an tcp Packet, 0 otherwise

Definition at line 64 of file flow_packet.h.

References FLOWASSERT, _Packet::tcph, and _TCPHdr::th_flags.

Referenced by flowps_newflow_callback().

static int INLINE IsIPv4Packet FLOWPACKET p  )  [static]
 

Determine if this is an IPV4 packet

Parameters:
p packet to determine if it's ipv4
Returns:
1 if it is an IPv4 Packet, 0 otherwise

Definition at line 30 of file flow_packet.h.

References FLOWASSERT, and _Packet::iph.

Referenced by flow_classifier(), and flowkey_make().

static int INLINE IsTcpPacket FLOWPACKET p  )  [static]
 

Determine if this is an Tcp packet

Parameters:
p packet to determine if it's tcp
Returns:
1 if it is an tcp Packet, 0 otherwise

Definition at line 47 of file flow_packet.h.

References FLOWASSERT, and _Packet::tcph.

Referenced by flowps_newflow_callback().


Generated on Sun May 14 14:51:24 2006 by  doxygen 1.4.2