Deleted Added
full compact
print-ppp.c (26183) print-ppp.c (32149)
1/*
2 * Copyright (c) 1990, 1991, 1993, 1994, 1995, 1996
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

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

59 char *name;
60};
61
62static struct protonames protonames[] = {
63 /*
64 * Protocol field values.
65 */
66 PPP_IP, "IP", /* Internet Protocol */
1/*
2 * Copyright (c) 1990, 1991, 1993, 1994, 1995, 1996
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

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

59 char *name;
60};
61
62static struct protonames protonames[] = {
63 /*
64 * Protocol field values.
65 */
66 PPP_IP, "IP", /* Internet Protocol */
67#ifndef PPP_ISO
68#define PPP_ISO 0x23
69#endif
70 PPP_ISO, "ISO", /* ISO 8473 */
67 PPP_XNS, "XNS", /* Xerox NS */
68 PPP_IPX, "IPX", /* IPX Datagram (RFC1552) */
69 PPP_VJC_COMP, "VJC_UNCOMP", /* VJ compressed TCP */
70 PPP_VJC_UNCOMP, "VJC_UNCOMP", /* VJ uncompressed TCP */
71 PPP_COMP, "COMP", /* compressed packet */
72 PPP_IPCP, "IPCP", /* IP Control Protocol */
73 PPP_IPXCP, "IPXCP", /* IPX Control Protocol (RFC1552) */
74 PPP_CCP, "CCP", /* Compression Control Protocol */

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

98
99void
100ppp_if_print(u_char *user, const struct pcap_pkthdr *h,
101 register const u_char *p)
102{
103 register u_int length = h->len;
104 register u_int caplen = h->caplen;
105
71 PPP_XNS, "XNS", /* Xerox NS */
72 PPP_IPX, "IPX", /* IPX Datagram (RFC1552) */
73 PPP_VJC_COMP, "VJC_UNCOMP", /* VJ compressed TCP */
74 PPP_VJC_UNCOMP, "VJC_UNCOMP", /* VJ uncompressed TCP */
75 PPP_COMP, "COMP", /* compressed packet */
76 PPP_IPCP, "IPCP", /* IP Control Protocol */
77 PPP_IPXCP, "IPXCP", /* IPX Control Protocol (RFC1552) */
78 PPP_CCP, "CCP", /* Compression Control Protocol */

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

102
103void
104ppp_if_print(u_char *user, const struct pcap_pkthdr *h,
105 register const u_char *p)
106{
107 register u_int length = h->len;
108 register u_int caplen = h->caplen;
109
110 int frame_relay = 0;
111 int proto = PPP_CONTROL(p);
112
113 if(caplen > length) caplen = length;
114
115 /*
116 * Check to see if this is a frame-relay, we have to do this
117 * because BPF could not differentiate between PPP and Framerelay
118 * link types.
119 */
120
121 frame_relay = (fr_addr_len(p) >= 2);
122
123 if(frame_relay) {
124 fr_if_print(user, h, p);
125 return;
126 }
127
106 ts_print(&h->ts);
107
108 if (caplen < PPP_HDRLEN) {
109 printf("[|ppp]");
110 goto out;
111 }
112
113 /*

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

127 case PPP_IP:
128 case ETHERTYPE_IP:
129 ip_print((const u_char *)(p + PPP_HDRLEN), length);
130 break;
131 case PPP_IPX:
132 case ETHERTYPE_IPX:
133 ipx_print((const u_char *)(p + PPP_HDRLEN), length);
134 break;
128 ts_print(&h->ts);
129
130 if (caplen < PPP_HDRLEN) {
131 printf("[|ppp]");
132 goto out;
133 }
134
135 /*

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

149 case PPP_IP:
150 case ETHERTYPE_IP:
151 ip_print((const u_char *)(p + PPP_HDRLEN), length);
152 break;
153 case PPP_IPX:
154 case ETHERTYPE_IPX:
155 ipx_print((const u_char *)(p + PPP_HDRLEN), length);
156 break;
135
157
158 case PPP_ISO:
159 isoclns_print((const u_char *)(p + PPP_HDRLEN), length,
160 caplen, "000000", "000000");
161 break;
136 default:
162 default:
137 if(!eflag)
138 ppp_hdlc_print(p, length);
163 if(!eflag) {
164 if (frame_relay)
165 fr_hdlc_print(p, length);
166 else
167 ppp_hdlc_print(p, length);
168 }
139 if(!xflag)
140 default_print((const u_char *)(p + PPP_HDRLEN),
141 caplen - PPP_HDRLEN);
142 }
143
144 if (xflag)
145 default_print((const u_char *)(p + PPP_HDRLEN),
146 caplen - PPP_HDRLEN);

--- 17 unchanged lines hidden ---
169 if(!xflag)
170 default_print((const u_char *)(p + PPP_HDRLEN),
171 caplen - PPP_HDRLEN);
172 }
173
174 if (xflag)
175 default_print((const u_char *)(p + PPP_HDRLEN),
176 caplen - PPP_HDRLEN);

--- 17 unchanged lines hidden ---