Changeset 1ab9849
- Timestamp:
- 10/11/06 16:09:48 (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:
- 99ff3d9
- Parents:
- 30d4bd3
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
lib/linktypes.c
r40d0efc r1ab9849 128 128 libtrace_sll_header_t *hdr; 129 129 130 if (pcap_dlt_to_libtrace(rt_to_pcap_dlt(packet->type)) 131 == TRACE_TYPE_LINUX_SLL) { 132 /* This is already been promoted, so ignore it */ 133 return; 134 } 135 136 /* This should be easy, just prepend the header */ 137 tmpbuffer= (char*)malloc( 138 sizeof(libtrace_sll_header_t) 139 +trace_get_capture_length(packet) 140 +trace_get_framing_length(packet) 141 ); 142 143 hdr=(libtrace_sll_header_t*)((char*)tmpbuffer 144 +trace_get_framing_length(packet)); 145 146 hdr->halen=htons(6); 147 hdr->pkttype=TRACE_SLL_OUTGOING; 148 130 149 switch(pcap_dlt_to_libtrace(rt_to_pcap_dlt(packet->type))) { 131 case TRACE_TYPE_LINUX_SLL:132 return; /* Unnecessary */133 134 150 case TRACE_TYPE_NONE: 135 case TRACE_TYPE_ETH:136 /* This should be easy, just prepend the header */137 tmpbuffer= (char*)malloc(138 sizeof(libtrace_sll_header_t)139 +trace_get_capture_length(packet)140 +trace_get_framing_length(packet)141 );142 143 hdr=(libtrace_sll_header_t*)((char*)tmpbuffer144 +trace_get_framing_length(packet));145 146 hdr->pkttype=TRACE_SLL_OUTGOING;147 if (pcap_dlt_to_libtrace(rt_to_pcap_dlt(packet->type))==TRACE_TYPE_ETH)148 hdr->hatype = htons(ARPHRD_ETHER);149 else150 hdr->hatype = htons(ARPHRD_PPP);151 151 trace_get_payload_from_link( 152 152 trace_get_link(packet), … … 154 154 &hdr->protocol, 155 155 NULL); 156 /* Linux SLL appears to have the protocol 157 * field in /host/ byte order. 158 */ 159 hdr->protocol=ntohs(hdr->protocol); 156 hdr->hatype = htons(ARPHRD_PPP); 157 hdr->protocol=htons(hdr->protocol); 158 break; 159 case TRACE_TYPE_ETH: 160 hdr->hatype = htons(ARPHRD_ETHER); 161 hdr->protocol=htons(0x0060); /* ETH_P_LOOP */ 160 162 break; 161 163 default:
Note: See TracChangeset
for help on using the changeset viewer.