print-chdlc.c (276788) | print-chdlc.c (285275) |
---|---|
1/* 2 * Copyright (c) 1990, 1991, 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 --- 42 unchanged lines hidden (view full) --- 51 if (caplen < CHDLC_HDRLEN) { 52 ND_PRINT((ndo, "[|chdlc]")); 53 return (caplen); 54 } 55 return (chdlc_print(ndo, p,length)); 56} 57 58u_int | 1/* 2 * Copyright (c) 1990, 1991, 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 --- 42 unchanged lines hidden (view full) --- 51 if (caplen < CHDLC_HDRLEN) { 52 ND_PRINT((ndo, "[|chdlc]")); 53 return (caplen); 54 } 55 return (chdlc_print(ndo, p,length)); 56} 57 58u_int |
59chdlc_print(netdissect_options *ndo, register const u_char *p, u_int length) { | 59chdlc_print(netdissect_options *ndo, register const u_char *p, u_int length) 60{ |
60 u_int proto; 61 62 proto = EXTRACT_16BITS(&p[2]); 63 if (ndo->ndo_eflag) { 64 ND_PRINT((ndo, "%s, ethertype %s (0x%04x), length %u: ", 65 tok2str(chdlc_cast_values, "0x%02x", p[0]), 66 tok2str(ethertype_values, "Unknown", proto), 67 proto, 68 length)); 69 } 70 71 length -= CHDLC_HDRLEN; 72 p += CHDLC_HDRLEN; 73 74 switch (proto) { 75 case ETHERTYPE_IP: 76 ip_print(ndo, p, length); 77 break; | 61 u_int proto; 62 63 proto = EXTRACT_16BITS(&p[2]); 64 if (ndo->ndo_eflag) { 65 ND_PRINT((ndo, "%s, ethertype %s (0x%04x), length %u: ", 66 tok2str(chdlc_cast_values, "0x%02x", p[0]), 67 tok2str(ethertype_values, "Unknown", proto), 68 proto, 69 length)); 70 } 71 72 length -= CHDLC_HDRLEN; 73 p += CHDLC_HDRLEN; 74 75 switch (proto) { 76 case ETHERTYPE_IP: 77 ip_print(ndo, p, length); 78 break; |
78#ifdef INET6 | |
79 case ETHERTYPE_IPV6: 80 ip6_print(ndo, p, length); 81 break; | 79 case ETHERTYPE_IPV6: 80 ip6_print(ndo, p, length); 81 break; |
82#endif | |
83 case CHDLC_TYPE_SLARP: 84 chdlc_slarp_print(ndo, p, length); 85 break; 86#if 0 87 case CHDLC_TYPE_CDP: 88 chdlc_cdp_print(p, length); 89 break; 90#endif --- 116 unchanged lines hidden --- | 82 case CHDLC_TYPE_SLARP: 83 chdlc_slarp_print(ndo, p, length); 84 break; 85#if 0 86 case CHDLC_TYPE_CDP: 87 chdlc_cdp_print(p, length); 88 break; 89#endif --- 116 unchanged lines hidden --- |