Changeset 0ff6ddf for lib/linktypes.c
- Timestamp:
- 06/06/06 17:32:24 (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:
- b0acff7
- Parents:
- 41f22e4
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
lib/linktypes.c
r77285d9 r0ff6ddf 154 154 } 155 155 } 156 157 /* Try and simplify the packet one step, kinda the opposite to promote_packet 158 * 159 * returns true if demotion was possible, false if not. 160 */ 161 bool demote_packet(libtrace_packet_t *packet) 162 { 163 switch(trace_get_link_type(packet)) { 164 case TRACE_TYPE_LINUX_SLL: 165 switch(((libtrace_sll_header_t*)packet->payload) 166 ->hatype) { 167 case ARPHRD_PPP: 168 packet->type=pcap_dlt_to_rt(DLT_NULL); 169 break; 170 case ARPHRD_ETHER: 171 packet->type=pcap_dlt_to_rt(DLT_EN10MB); 172 break; 173 default: 174 /* Dunno how to demote this packet */ 175 return false; 176 } 177 packet->payload=(void*)((char*)packet->payload 178 +sizeof(libtrace_sll_header_t)); 179 trace_set_capture_length(packet, 180 trace_get_capture_length(packet) 181 -sizeof(libtrace_sll_header_t)); 182 break; 183 default: 184 return false; 185 } 186 }
Note: See TracChangeset
for help on using the changeset viewer.