Changeset e6d963c for lib/format_legacy.c
- Timestamp:
- 05/02/06 00:08:58 (15 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:
- e093e5c
- Parents:
- ddd01fb
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
lib/format_legacy.c
r088533a re6d963c 75 75 }; 76 76 77 static int legacyeth_get_framing_length(const structlibtrace_packet_t *packet UNUSED)77 static int legacyeth_get_framing_length(const libtrace_packet_t *packet UNUSED) 78 78 { 79 79 return sizeof(legacy_ether_t); 80 80 } 81 81 82 static int legacypos_get_framing_length(const structlibtrace_packet_t *packet UNUSED)82 static int legacypos_get_framing_length(const libtrace_packet_t *packet UNUSED) 83 83 { 84 84 return sizeof(legacy_pos_t); 85 85 } 86 86 87 static int legacyatm_get_framing_length(const structlibtrace_packet_t *packet UNUSED)87 static int legacyatm_get_framing_length(const libtrace_packet_t *packet UNUSED) 88 88 { 89 89 return sizeof(legacy_cell_t); 90 90 } 91 91 92 static int erf_init_input( structlibtrace_t *libtrace)92 static int erf_init_input(libtrace_t *libtrace) 93 93 { 94 94 libtrace->format_data = malloc(sizeof(struct legacy_format_data_t)); … … 107 107 } 108 108 109 static int erf_fin_input( structlibtrace_t *libtrace) {109 static int erf_fin_input(libtrace_t *libtrace) { 110 110 libtrace_io_close(INPUT.file); 111 111 free(libtrace->format_data); … … 113 113 } 114 114 115 static int legacy_read_packet( struct libtrace_t *libtrace, structlibtrace_packet_t *packet) {115 static int legacy_read_packet(libtrace_t *libtrace, libtrace_packet_t *packet) { 116 116 int numbytes; 117 117 void *buffer; … … 152 152 } 153 153 154 static libtrace_linktype_t legacypos_get_link_type(const structlibtrace_packet_t *packet UNUSED) {154 static libtrace_linktype_t legacypos_get_link_type(const libtrace_packet_t *packet UNUSED) { 155 155 return TRACE_TYPE_POS; 156 156 } 157 157 158 static libtrace_linktype_t legacyatm_get_link_type(const structlibtrace_packet_t *packet UNUSED) {158 static libtrace_linktype_t legacyatm_get_link_type(const libtrace_packet_t *packet UNUSED) { 159 159 return TRACE_TYPE_ATM; 160 160 } 161 161 162 static libtrace_linktype_t legacyeth_get_link_type(const structlibtrace_packet_t *packet UNUSED) {162 static libtrace_linktype_t legacyeth_get_link_type(const libtrace_packet_t *packet UNUSED) { 163 163 return TRACE_TYPE_ETH; 164 164 } 165 165 166 static int legacy_get_capture_length(const structlibtrace_packet_t *packet UNUSED) {166 static int legacy_get_capture_length(const libtrace_packet_t *packet UNUSED) { 167 167 return 64; 168 168 } 169 169 170 static int legacypos_get_wire_length(const structlibtrace_packet_t *packet) {170 static int legacypos_get_wire_length(const libtrace_packet_t *packet) { 171 171 legacy_pos_t *lpos = (legacy_pos_t *)packet->header; 172 172 return ntohs(lpos->wlen); 173 173 } 174 174 175 static int legacyatm_get_wire_length(const structlibtrace_packet_t *packet UNUSED) {175 static int legacyatm_get_wire_length(const libtrace_packet_t *packet UNUSED) { 176 176 return 53; 177 177 } 178 178 179 static int legacyeth_get_wire_length(const structlibtrace_packet_t *packet) {179 static int legacyeth_get_wire_length(const libtrace_packet_t *packet) { 180 180 legacy_ether_t *leth = (legacy_ether_t *)packet->header; 181 181 return ntohs(leth->wlen); 182 182 } 183 183 184 static uint64_t legacy_get_erf_timestamp(const structlibtrace_packet_t *packet)184 static uint64_t legacy_get_erf_timestamp(const libtrace_packet_t *packet) 185 185 { 186 186 legacy_ether_t *legacy = (legacy_ether_t*)packet->header;
Note: See TracChangeset
for help on using the changeset viewer.