Changeset c37ab9f
- Timestamp:
- 05/02/06 00:58:09 (16 years ago)
- Branches:
- 4.0.1-hotfixes, cachetimestamps, develop, dpdk-ndag, etsilive, getfragoff, help, libtrace4, master, ndag_format, pfring, rc-4.0.1, rc-4.0.2, rc-4.0.3, rc-4.0.4, ringdecrementfix, ringperformance, ringtimestampfixes
- Children:
- 998bee5
- Parents:
- ca2887e
- Location:
- lib
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
lib/libtrace.h
re093e5c rc37ab9f 194 194 } libtrace_dlt_t ; 195 195 196 /** Link layer types 197 * This enumates the various different link types that libtrace understands 198 */ 199 typedef enum { 200 TRACE_TYPE_HDLC_POS = 1, 201 TRACE_TYPE_ETH, /**< 802.3 style Ethernet */ 202 TRACE_TYPE_ATM, 203 TRACE_TYPE_AAL5, 204 TRACE_TYPE_80211, /**< 802.11 frames */ 205 TRACE_TYPE_NONE, /**< Raw IP frames */ 206 TRACE_TYPE_LINUX_SLL, /**< Linux "null" framing */ 207 TRACE_TYPE_PFLOG, /**< FreeBSD's PFlug */ 208 TRACE_TYPE_POS, 209 TRACE_TYPE_80211_PRISM = 12 210 } libtrace_linktype_t; 211 212 /** Trace directions 213 * Note that these are the directions used by convention, more directions 214 * are possible, not just these 3, and that they may not conform to this 215 * convention. 216 */ 217 typedef enum { 218 TRACE_DIR_OUTGOING = 0, /**< Packets originating "outside" */ 219 TRACE_DIR_INCOMING = 1, /**< Packets originating "inside" */ 220 TRACE_DIR_OTHER = 2 /**< Packets with an unknown direction, or one that's unknown */ 221 } libtrace_direction_t; 196 222 197 223 /** @name Protocol structures … … 1054 1080 1055 1081 1056 /** Link layer types1057 * This enumates the various different link types that libtrace understands1058 */1059 typedef enum {1060 TRACE_TYPE_HDLC_POS = 1,1061 TRACE_TYPE_ETH, /**< 802.3 style Ethernet */1062 TRACE_TYPE_ATM,1063 TRACE_TYPE_AAL5,1064 TRACE_TYPE_80211, /**< 802.11 frames */1065 TRACE_TYPE_NONE,1066 TRACE_TYPE_LINUX_SLL, /**< Linux "null" framing */1067 TRACE_TYPE_PFLOG, /**< FreeBSD's PFlug */1068 TRACE_TYPE_POS,1069 TRACE_TYPE_80211_PRISM = 121070 } libtrace_linktype_t;1071 1072 1082 /** Get the type of the link layer 1073 1083 * @param packet the packet opaque pointer … … 1081 1091 /** Set the direction flag, if it has one 1082 1092 * @param packet the packet opaque pointer 1083 * @param direction the new direction (0,1,2,3) 1084 * @return a signed value containing the direction flag, or -1 if this is not supported 1085 * @author Daniel Lawson 1086 */ 1087 DLLEXPORT int8_t trace_set_direction(libtrace_packet_t *packet, int8_t direction); 1093 * @param direction the new direction 1094 * @returns -1 on error, or the direction that was set. 1095 */ 1096 DLLEXPORT libtrace_direction_t trace_set_direction(libtrace_packet_t *packet, libtrace_direction_t direction); 1088 1097 1089 1098 /** Get the direction flag, if it has one 1090 1099 * @param packet the packet opaque pointer 1091 * @return a signedvalue containing the direction flag, or -1 if this is not supported1100 * @return a value containing the direction flag, or -1 if this is not supported 1092 1101 * The direction is defined as 0 for packets originating locally (ie, outbound) 1093 1102 * and 1 for packets originating remotely (ie, inbound). … … 1097 1106 */ 1098 1107 DLLEXPORT SIMPLE_FUNCTION 1099 int8_t trace_get_direction(const libtrace_packet_t *packet);1108 libtrace_direction_t trace_get_direction(const libtrace_packet_t *packet); 1100 1109 1101 1110 /** @name BPF -
lib/trace.c
re6d963c rc37ab9f 1031 1031 * @param direction the new direction (0,1,2,3) 1032 1032 * @returns a signed value containing the direction flag, or -1 if this is not supported 1033 * @author Daniel Lawson 1034 */ 1035 DLLEXPORT int8_t trace_set_direction(libtrace_packet_t *packet, int8_t direction) { 1033 */ 1034 DLLEXPORT libtrace_direction_t trace_set_direction(libtrace_packet_t *packet, 1035 libtrace_direction_t direction) 1036 { 1036 1037 assert(packet); 1037 1038 assert(packet->size>0 && packet->size<65536); … … 1051 1052 * @author Daniel Lawson 1052 1053 */ 1053 DLLEXPORT int8_t trace_get_direction(const libtrace_packet_t *packet) { 1054 DLLEXPORT libtrace_direction_t trace_get_direction(const libtrace_packet_t *packet) 1055 { 1054 1056 assert(packet); 1055 1057 assert(packet->size>0 && packet->size<65536);
Note: See TracChangeset
for help on using the changeset viewer.