print-sll.c (9b3ece1c2eb92a881cb2553271e123382bfe31c1) print-sll.c (39e421e8cedb2a1e819ab3f703a22b4c3da76b61)
1/*
2 * Copyright (c) 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997
3 * The Regents of the University of California. All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that: (1) source code distributions
7 * retain the above copyright notice and this paragraph in its entirety, (2)
8 * distributions including binary code include the above copyright notice and

--- 184 unchanged lines hidden (view full) ---

193 * is the number of bytes actually captured.
194 */
195u_int
196sll_if_print(netdissect_options *ndo, const struct pcap_pkthdr *h, const u_char *p)
197{
198 u_int caplen = h->caplen;
199 u_int length = h->len;
200 register const struct sll_header *sllp;
1/*
2 * Copyright (c) 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997
3 * The Regents of the University of California. All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that: (1) source code distributions
7 * retain the above copyright notice and this paragraph in its entirety, (2)
8 * distributions including binary code include the above copyright notice and

--- 184 unchanged lines hidden (view full) ---

193 * is the number of bytes actually captured.
194 */
195u_int
196sll_if_print(netdissect_options *ndo, const struct pcap_pkthdr *h, const u_char *p)
197{
198 u_int caplen = h->caplen;
199 u_int length = h->len;
200 register const struct sll_header *sllp;
201 u_short hatype;
201 u_short ether_type;
202 int llc_hdrlen;
203 u_int hdrlen;
204
205 if (caplen < SLL_HDR_LEN) {
206 /*
207 * XXX - this "can't happen" because "pcap-linux.c" always
208 * adds this many bytes of header to every packet in a

--- 11 unchanged lines hidden (view full) ---

220 /*
221 * Go past the cooked-mode header.
222 */
223 length -= SLL_HDR_LEN;
224 caplen -= SLL_HDR_LEN;
225 p += SLL_HDR_LEN;
226 hdrlen = SLL_HDR_LEN;
227
202 u_short ether_type;
203 int llc_hdrlen;
204 u_int hdrlen;
205
206 if (caplen < SLL_HDR_LEN) {
207 /*
208 * XXX - this "can't happen" because "pcap-linux.c" always
209 * adds this many bytes of header to every packet in a

--- 11 unchanged lines hidden (view full) ---

221 /*
222 * Go past the cooked-mode header.
223 */
224 length -= SLL_HDR_LEN;
225 caplen -= SLL_HDR_LEN;
226 p += SLL_HDR_LEN;
227 hdrlen = SLL_HDR_LEN;
228
229 hatype = EXTRACT_16BITS(&sllp->sll_hatype);
230 switch (hatype) {
231
232 case 803:
233 /*
234 * This is an packet with a radiotap header;
235 * just dissect the payload as such.
236 */
237 return (SLL_HDR_LEN + ieee802_11_radio_print(ndo, p, length, caplen));
238 }
228 ether_type = EXTRACT_16BITS(&sllp->sll_protocol);
229
230recurse:
231 /*
232 * Is it (gag) an 802.3 encapsulation, or some non-Ethernet
233 * packet type?
234 */
235 if (ether_type <= ETHERMTU) {

--- 75 unchanged lines hidden ---
239 ether_type = EXTRACT_16BITS(&sllp->sll_protocol);
240
241recurse:
242 /*
243 * Is it (gag) an 802.3 encapsulation, or some non-Ethernet
244 * packet type?
245 */
246 if (ether_type <= ETHERMTU) {

--- 75 unchanged lines hidden ---