Changeset 925 for trunk/lib/format_erf.c
- Timestamp:
- 08/21/06 22:10:42 (7 years ago)
- File:
-
- 1 edited
-
trunk/lib/format_erf.c (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/lib/format_erf.c
r924 r925 900 900 return 0; 901 901 } 902 903 static bool find_compatible_linktype(libtrace_packet_t *packet) 904 { 905 /* Keep trying to simplify the packet until we can find 906 * something we can do with it */ 907 do { 908 char type=libtrace_to_erf_type(trace_get_link_type(packet)); 909 910 /* Success */ 911 if (type != (char)-1) 912 return true; 913 914 if (!demote_packet(packet)) { 915 trace_set_err_out(packet->trace, 916 TRACE_ERR_NO_CONVERSION, 917 "No erf type for packet (%i)", 918 trace_get_link_type(packet)); 919 return false; 920 } 921 922 } while(1); 923 924 return true; 925 } 902 926 903 927 static int erf_write_packet(libtrace_out_t *libtrace, … … 940 964 } else { 941 965 dag_record_t erfhdr; 942 int type;943 966 /* convert format - build up a new erf header */ 944 967 /* Timestamp */ … … 950 973 erfhdr.flags.iface = trace_get_direction(packet); 951 974 952 /* Keep trying to simplify the packet until we can find 953 * something we can do with it */ 954 do { 955 type=libtrace_to_erf_type(trace_get_link_type(packet)); 956 } while(type==(char)-1 && demote_packet((libtrace_packet_t *)packet)); 957 /* We just don't support this link type sorry */ 958 if (type==(char)-1) { 959 trace_set_err_out(libtrace, 960 TRACE_ERR_NO_CONVERSION, 961 "No erf type for packet"); 975 if (!find_compatible_linktype(packet)) 962 976 return -1; 963 } 964 erfhdr.type = type; 977 978 erfhdr.type = libtrace_to_erf_type(trace_get_link_type(packet)); 979 965 980 /* Packet length (rlen includes format overhead) */ 966 981 assert(trace_get_capture_length(packet)>0
Note: See TracChangeset
for help on using the changeset viewer.
