Changeset 1296
- Timestamp:
- 11/02/07 15:49:32 (6 years ago)
- File:
-
- 1 edited
-
trunk/lib/libtrace.h.in (modified) (18 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/lib/libtrace.h.in
r1286 r1296 940 940 * @param packet the packet pointer 941 941 * @param[out] linktype the linktype of the returned pointer 942 * @param[out] remaining the capture length ( number of valid bytes from the943 * pointer)942 * @param[out] remaining the capture length (the number of captured bytes from 943 * the returned pointer) 944 944 * @return a pointer to the first byte of the packet 945 945 */ … … 964 964 * 965 965 * @return a pointer to the IPv4 header, or NULL if there is no IPv4 header 966 * 967 * You should consider using \ref trace_get_layer3 instead of this function. 966 968 */ 967 969 DLLEXPORT SIMPLE_FUNCTION … … 972 974 * 973 975 * @return a pointer to the IPv6 header, or NULL if there is no IPv6 header 976 * 977 * You should consider using \ref trace_get_layer3 instead of this function. 974 978 */ 975 979 DLLEXPORT SIMPLE_FUNCTION … … 991 995 * @param packet the libtrace packet 992 996 * @param[out] linktype the linktype of the returned metadata header 993 * @param[out] remaining the amount of space availabled after this header 994 * @return a pointer to the first metadata header, or NULL if there are no metadata headers present. 997 * @param[out] remaining the number of bytes captured after the returned 998 * pointer. 999 * @return a pointer to the first metadata header, or NULL if there are no 1000 * metadata headers present. 995 1001 * 996 1002 * remaining may be NULL, however linktype must be provided. … … 1065 1071 * 1066 1072 * Remaining may be NULL. If Remaining is not NULL it must point to the number 1067 * of bytes captured of the layer2 header and beyond. It will be updated after 1068 * this function to the number of bytes remaining after the layer2 header 1069 * was removed. 1073 * of bytes captured of the layer2 header and beyond. It will be decremented 1074 * by the number of bytes skipped to find the payload. 1070 1075 * 1071 1076 */ … … 1083 1088 * 1084 1089 * @return a pointer to the layer 3 header. 1085 * remaining may be NULL, otherwise it will be filled in by the remaining size1086 * of the captured packet.1090 * remaining may be NULL, otherwise it will be set to the number of captured 1091 * bytes after the pointer returned. 1087 1092 */ 1088 1093 DLLEXPORT SIMPLE_FUNCTION … … 1094 1099 * @param[out] proto transport layer protocol 1095 1100 * 1096 * @return a pointer to the transport layer header, or NULL if there is no header 1101 * @return a pointer to the transport layer header, or NULL if there is no 1102 * header 1097 1103 * 1098 1104 * @note proto may be NULL if proto is unneeded. 1099 1105 */ 1100 DLLEXPORT void *trace_get_transport(const libtrace_packet_t *packet, uint8_t *proto,1101 uint 32_t *remaining);1106 DLLEXPORT void *trace_get_transport(const libtrace_packet_t *packet, 1107 uint8_t *proto, uint32_t *remaining); 1102 1108 1103 1109 /** Gets a pointer to the payload given a pointer to the IP header … … 1106 1112 * @param[in,out] remaining Updated with the number of bytes remaining 1107 1113 * 1108 * @return a pointer to the transport layer header, or NULL if header isn't present. 1114 * @return a pointer to the transport layer header, or NULL if header isn't 1115 * present. 1109 1116 * 1110 1117 * Remaining may be NULL. If Remaining is not NULL it must point to the number 1111 * of bytes captured of the IP header and beyond. It will be updated after this 1112 * function to the number of bytes remaining after the IP header (and any IP options) 1113 * have been removed. 1118 * of bytes captured of the IP header and beyond. It will be decremented by 1119 * the length of the IPv4 header (including any options). 1114 1120 * 1115 1121 * proto may be NULL if not needed. … … 1125 1131 * @param[in,out] remaining Updated with the number of bytes remaining 1126 1132 * 1127 * @return a pointer to the transport layer header, or NULL if the IPv6 header isn't complete. 1133 * @return a pointer to the transport layer header, or NULL if the IPv6 header 1134 * isn't complete. 1128 1135 * 1129 1136 * Remaining may be NULL. If Remaining is not NULL it must point to the number 1130 * of bytes captured of the IP header and beyond. It will be updated after this 1131 * function to the number of bytes remaining after the IP header (and any IP options) 1132 * have been removed. 1137 * of bytes captured of the IP header and beyond. It will be decremented by 1138 * this function by the length of the IPV6 header. 1133 1139 * 1134 1140 * proto may be NULL if not needed. … … 1159 1165 1160 1166 /** Skips over any 802.1q headers, if present. 1161 * @param ethernet A pointer to the payload following an ethernet header -usually the result of calling trace_get_payload_from_link 1167 * @param ethernet A pointer to the payload following an ethernet header 1168 * -usually the result of calling trace_get_payload_from_link 1162 1169 * @param[in,out] type The ethernet type, replaced with the vlan ether type 1163 1170 * @param[in,out] remaining Updated with the number of bytes remaining … … 1167 1174 * 1168 1175 * Remaining may be NULL. If Remaining is not NULL it must point to the number 1169 * of bytes captured past (but not including) the link layer. It will be 1170 * updated after this function to the number of bytes remaining after the 1171 * vlan header. If it is unchanged then no vlan header exists. 1176 * of bytes captured past (but not including) the link layer. This function 1177 * will decrement it by the length of the 802.1q headers if present. 1172 1178 * 1173 1179 * Type must point to the value of the ethernet type. Libtrace will assert … … 1185 1191 * 1186 1192 * Remaining may be NULL. If remaining is not NULL it must point to the number 1187 * of bytes captured of the TCP header and beyond. It will be updated after 1188 * this function to the number of bytes remaining after the TCP header (and any 1189 * TCP options) have been removed. 1193 * of bytes captured of the TCP header and beyond. It will be decremented by 1194 * this function by the length of the TCP header (including any options). 1190 1195 * 1191 1196 */ … … 1200 1205 * 1201 1206 * Remaining may be NULL. If Remaining is not NULL it must point to the number 1202 * of bytes captured of the UDP header and beyond. It will be updated after1207 * of bytes captured of the UDP header and beyond. It will be decremented by 1203 1208 * this function to the number of bytes remaining after the UDP header. 1204 1209 * … … 1213 1218 * 1214 1219 * Remaining may be NULL. If remaining is not NULL it must point to the number 1215 * of bytes captured of the ICMP header and beyond. It will be updated after1216 * this function to the number of bytes remaining afterthe ICMP header.1220 * of bytes captured of the ICMP header and beyond. It will be decremented 1221 * by the number of bytes in the ICMP header. 1217 1222 * 1218 1223 */ … … 1224 1229 * 1225 1230 * @return a pointer to the TCP header, or NULL if there is not a TCP packet 1231 * 1232 * @note you should probably use trace_get_transport() 1226 1233 */ 1227 1234 DLLEXPORT SIMPLE_FUNCTION … … 1235 1242 * 1236 1243 * Remaining may be NULL. If Remaining is not NULL it must point to the number 1237 * of bytes captured of the TCP header and beyond. It will be updated after 1238 * this function to the number of bytes remaining after the TCP header (and any 1239 * TCP options) have been removed. 1244 * of bytes captured of the TCP header and beyond. It will be decremented by 1245 * the number of bytes in the TCP header (including any TCP options). 1240 1246 * 1241 1247 * @note The last parameter has changed from libtrace2 … … 1259 1265 * 1260 1266 * Remaining may be NULL. If Remaining is not NULL it must point to the number 1261 * of bytes captured of the UDP header and beyond. It will be updated after 1262 * this function to the number of bytes remaining after the UDP header have 1263 * been removed. 1267 * of bytes captured of the UDP header and beyond. This function will 1268 * decremented it by the length of the UDP header. 1264 1269 * 1265 1270 * @note Beware the change from libtrace2 from skipped to remaining … … 1283 1288 * 1284 1289 * Remaining may be NULL. If Remaining is not NULL it must point to the number 1285 * of bytes captured of the ICMP header and beyond. It will be updated after1286 * th is function to the number of bytes remaining after the ICMP header.1290 * of bytes captured of the ICMP header and beyond. It will be decremented by 1291 * the length of the ICMP head in bytes. 1287 1292 * 1288 1293 * @note Beware the change from libtrace2 from skipped to remaining
Note: See TracChangeset
for help on using the changeset viewer.
