00001 #ifndef _HLBR_PACKET_H_ 00002 #define _HLBR_PACKET_H_ 00003 00004 #include "../config.h" 00005 #include "../engine/hlbr.h" 00006 00007 #define MAX_IDLE_PACKETS 150 00008 00009 /********************************** 00010 * These define each possible 00011 * packet type and proto 00012 **********************************/ 00013 #define PACKET_TYPE_NONE 0 00014 #define PACKET_TYPE_LINUX_RAW 1 00015 #define PACKET_TYPE_PCAP 2 00016 #define PACKET_TYPE_OBSD_BPF 3 00017 #define PACKET_TYPE_OSX_BPF 4 00018 #define PACKET_TYPE_TCPDUMP 5 00019 #define PACKET_TYPE_SOLARIS_DLPI 6 00020 00021 #define PACKET_PROTO_NONE 0 00022 #define PACKET_PROTO_IP 1 00023 #define PACKET_PROTO_ETHERNET 2 00024 00025 #define MAX_KEY_LEN 128 00026 00027 #define INTERFACE_NONE -1 00028 #define INTERFACE_BROADCAST 99 00029 00030 #define PACKET_STATUS_IDLE 0 00031 #define PACKET_STATUS_PENDING 1 00032 #define PACKET_STATUS_SAVED 2 00033 #define PACKET_STATUS_ALLOCATED 3 00034 #define PACKET_STATUS_PROCESSING 4 00035 #define PACKET_STATUS_BLOCKED 5 00036 00037 #define PACKET_ROLE_NORMAL 0 00038 #define PACKET_ROLE_EXTERNAL 1 00039 #define PACKET_ROLE_INTERNAL 2 00040 #define PACKET_ROLE_HONEY 3 00041 00042 #define PACKET_NONE -1 00043 00044 int GetPacketTypeByName(char* Name); 00045 int GetPacketProtoByName(char* Name); 00046 int GetPacketRoleByName(char* Name); 00047 int OpenInterface(int InterfaceID); 00048 int OpenInterfaces(); 00049 int ReadPacket(int InterfaceID); 00050 int WritePacket(int PacketSlot); 00051 int AddPacketToPending(int PacketSlot); 00052 int PopFromPending(); 00053 int GetEmptyPacket(); 00054 void ReturnEmptyPacket(int PacketSlot); 00055 int StartInterfaceThread(int InterfaceID); 00056 int RuleIsActive(int PacketSlot, int RuleNum); 00057 int SetRuleInactive(int PacketSlot, int RuleNum); 00058 int GetInterfaceByName(char* Name); 00059 int BlockPacket(int PacketSlot); // used by TCP session remounting 00060 00061 #endif