1 diff -ruN tcpdump_3_5rel2.old/Makefile.in tcpdump_3_5rel2/Makefile.in
2 --- tcpdump_3_5rel2.old/Makefile.in Fri Jul 14 14:13:34 2000
3 +++ tcpdump_3_5rel2/Makefile.in Fri Jul 14 14:23:20 2000
6 print-arp.c print-atalk.c print-atm.c print-bootp.c \
7 print-decnet.c print-domain.c print-dvmrp.c print-egp.c \
8 - print-ether.c print-fddi.c print-gre.c print-icmp.c \
9 + print-ether.c print-fddi.c print-giop.c print-gre.c print-icmp.c \
10 print-igrp.c print-ip.c print-ipx.c print-isoclns.c print-krb.c \
11 print-llc.c print-nfs.c print-ntp.c print-null.c print-ospf.c \
12 print-pim.c print-ppp.c print-raw.c print-rip.c print-sl.c \
13 diff -ruN tcpdump_3_5rel2.old/interface.h tcpdump_3_5rel2/interface.h
14 --- tcpdump_3_5rel2.old/interface.h Wed Dec 22 16:44:09 1999
15 +++ tcpdump_3_5rel2/interface.h Fri Jul 14 14:28:18 2000
17 extern int dflag; /* print filter code */
18 extern int eflag; /* print ethernet header */
19 extern int fflag; /* don't translate "foreign" IP address */
20 +extern int gflag; /* decode GIOP */
21 extern int nflag; /* leave addresses as numbers */
22 extern int Nflag; /* remove domains from printed host names */
23 extern int qflag; /* quick (shorter) output */
25 extern void dhcp6_print(const u_char *, u_int, u_short, u_short);
27 extern u_short in_cksum(const u_short *addr, register int len, u_short csum);
28 +extern void giop_print(const u_char *, u_int);
29 diff -ruN tcpdump_3_5rel2.old/print-giop.c tcpdump_3_5rel2/print-giop.c
30 --- tcpdump_3_5rel2.old/print-giop.c Thu Jan 1 01:00:00 1970
31 +++ tcpdump_3_5rel2/print-giop.c Fri Jul 14 14:23:20 2000
36 +#include <netinet/in.h>
37 +#include "interface.h"
42 + GIOP_CANCEL_REQUEST,
43 + GIOP_LOCATE_REQUEST,
45 + GIOP_CLOSE_CONNECTION,
50 +static struct tok type2str[] = {
51 + {GIOP_REQUEST, "Request"},
52 + {GIOP_REPLY, "Reply"},
53 + {GIOP_CANCEL_REQUEST, "Cancel Request"},
54 + {GIOP_LOCATE_REQUEST, "Locate Request"},
55 + {GIOP_LOCATE_REPLY, "Locate Reply"},
56 + {GIOP_CLOSE_CONNECTION, "Close Connection"},
57 + {GIOP_MESSAGE_ERROR, "Message Error"},
58 + {GIOP_FRAGMENT, "Fragment"},
62 +static const u_char *
63 +giop_get(const u_char *bp, void *val, int octets, int convert)
68 + if(bp>snapend || bp==NULL)
71 + align=(u_char *)(((long)bp+(octets-1))&~(octets-1));
75 + ((u_char *)val)[i]=(u_char)align[(octets-1)-i];
77 + ((u_char *)val)[i]=(u_char)align[i];
79 + return(align+octets);
82 +static const u_char *
83 +giop_get_string(const u_char *bp, u_char *buf, int maxlen, int convert)
87 + if(bp>snapend || bp==NULL)
90 + bp=giop_get(bp, &len, 4, convert);
96 + memcpy(buf, bp, maxlen);
98 + memcpy(buf, bp, len);
104 +giop_print_request(const u_char *bp, u_int length, int version, int convert)
107 + u_int32_t seqlen, request_id;
110 + /* IOP_ServiceContextList service context */
111 + /* sequence<IOP_ServiceContext> */
112 + bp=giop_get(bp, &seqlen, 4, convert);
114 + printf(" [|request]");
119 + printf(" context items: %d", seqlen);
121 + /* unsigned long context id */
122 + /* sequence<octet> data */
124 + u_int32_t context_id, datalen;
126 + bp=giop_get(bp, &context_id, 4, convert);
128 + printf(" [|request]");
132 + printf(" ID: %d", context_id);
134 + bp=giop_get_string(bp, buf, 255, convert);
136 + printf(" [|request]");
139 + printf(" data {%s}", buf);
143 + /* unsigned long request ID */
145 + bp=giop_get(bp, &request_id, 4, convert);
147 + printf(" [|request]");
150 + printf(" request ID: %d", request_id);
152 + /* boolean response expected */
154 + bp=giop_get(bp, &response, 1, convert);
156 + printf(" [|request]");
159 + printf("%sresponse expected", response?" ":" no ");
161 + /* in GIOP 1.1 there is an array "octet reserved[3]" here now. */
162 + /* Alignment checks will skip it automatically */
164 + /* sequence<octet> object key */
165 + bp=giop_get_string(bp, buf, 255, convert);
167 + printf(" [|request]");
170 + printf(" %s", buf);
172 + /* char * operation */
173 + bp=giop_get_string(bp, buf, 255, convert);
175 + printf(" [|request]");
178 + printf("/%s", buf);
180 + /* principal requesting principal */
181 + /* is there anything interesting to print here? skip for now */
182 + bp=giop_get_string(bp, NULL, 0, convert);
184 + printf(" [|request]");
188 + /* Now come the parameters, but we need to IDL (or IR) to know how to
193 + GIOP_REPLY_NO_EXCEPTION,
194 + GIOP_REPLY_USER_EXCEPTION,
195 + GIOP_REPLY_SYSTEM_EXCEPTION,
196 + GIOP_REPLY_LOCATION_FORWARD
199 +static struct tok reply2str[] = {
200 + {GIOP_REPLY_NO_EXCEPTION, "No Exception"},
201 + {GIOP_REPLY_USER_EXCEPTION, "User Exception"},
202 + {GIOP_REPLY_SYSTEM_EXCEPTION, "System Exception"},
203 + {GIOP_REPLY_LOCATION_FORWARD, "Location Forward"},
208 + GIOP_COMPLETION_YES,
209 + GIOP_COMPLETION_NO,
210 + GIOP_COMPLETION_MAYBE
213 +static struct tok completion2str[] = {
214 + {GIOP_COMPLETION_YES, "Yes"},
215 + {GIOP_COMPLETION_NO, "No"},
216 + {GIOP_COMPLETION_MAYBE, "Maybe"},
221 +giop_print_reply(const u_char *bp, u_int length, int version, int convert)
224 + u_int32_t seqlen, request_id, type;
226 + /* IOP_ServiceContextList service context */
227 + /* sequence<IOP_ServiceContext> */
228 + bp=giop_get(bp, &seqlen, 4, convert);
230 + printf(" [|reply]");
235 + printf(" context items: %d", seqlen);
237 + /* unsigned long context id */
238 + /* sequence<octet> data */
240 + u_int32_t context_id, datalen;
242 + bp=giop_get(bp, &context_id, 4, convert);
244 + printf(" [|reply]");
248 + printf(" ID: %d", context_id);
250 + bp=giop_get_string(bp, buf, 255, convert);
252 + printf(" [|reply]");
255 + printf(" data {%s}", buf);
260 + /* unsigned long request id */
262 + bp=giop_get(bp, &request_id, 4, convert);
264 + printf(" [|reply]");
267 + printf(" request ID: %d", request_id);
271 + bp=giop_get(bp, &type, 4, convert);
273 + printf(" [|reply]");
276 + printf(" status: %s", tok2str(reply2str, NULL, type));
278 + /* for "no exception" returns, the encoded parameters come next */
279 + /* for "user exception" and "system exception", the exception code
281 + if(type==GIOP_REPLY_SYSTEM_EXCEPTION) {
282 + u_int32_t completion, minor;
284 + bp=giop_get_string(bp, buf, 255, convert);
286 + printf(" [|reply]");
289 + printf(" System Exception {%s}", buf);
291 + bp=giop_get(bp, &minor, 4, convert);
292 + bp=giop_get(bp, &completion, 4, convert);
294 + printf(" [|reply]");
298 + printf(" minor code %d", minor);
299 + printf(" Completion: %s", tok2str(completion2str, NULL, completion));
300 + } else if(type==GIOP_REPLY_LOCATION_FORWARD) {
301 + bp=giop_get_string(bp, buf, 255, convert);
303 + printf(" [|reply]");
306 + printf(" Location: %s", buf);
311 +giop_print_cancel_request(const u_char *bp, u_int length, int version, int convert)
313 + u_int32_t request_id;
315 + /* unsigned long request id */
317 + bp=giop_get(bp, &request_id, 4, convert);
319 + printf(" [|cancel request]");
322 + printf(" request ID: %d", request_id);
326 +giop_print_locate_request(const u_char *bp, u_int length, int version, int convert)
329 + u_int32_t request_id;
331 + /* unsigned long request id */
333 + bp=giop_get(bp, &request_id, 4, convert);
335 + printf(" [|locate request]");
338 + printf(" request ID: %d", request_id);
340 + /* sequence<octet> object key */
342 + bp=giop_get_string(bp, buf, 255, convert);
344 + printf(" [|locate request]");
347 + printf(" %s", buf);
351 + GIOP_LOCATE_UNKNOWN_OBJECT,
352 + GIOP_LOCATE_OBJECT_HERE,
353 + GIOP_LOCATE_OBJECT_FORWARD
356 +static struct tok locate2str[] = {
357 + {GIOP_LOCATE_UNKNOWN_OBJECT, "Unknown Object"},
358 + {GIOP_LOCATE_OBJECT_HERE, "Object Here"},
359 + {GIOP_LOCATE_OBJECT_FORWARD, "Object Forward"},
364 +giop_print_locate_reply(const u_char *bp, u_int length, int version, int convert)
367 + u_int32_t request_id, status;
369 + /* unsigned long request id */
371 + bp=giop_get(bp, &request_id, 4, convert);
373 + printf(" [|locate reply]");
376 + printf(" request ID: %d", request_id);
378 + /* locate status */
380 + bp=giop_get(bp, &status, 4, convert);
382 + printf(" [|locate reply]");
385 + printf(" status: %s", tok2str(locate2str, NULL, status));
387 + /* if status is "object forward", a objref follows here */
388 + if(status==GIOP_LOCATE_OBJECT_FORWARD) {
389 + bp=giop_get_string(bp, buf, 255, convert);
391 + printf(" [|locate reply]");
394 + printf(" Location: %s", buf);
399 +giop_print_close_connection(const u_char *bp, u_int length, int version, int convert)
405 +giop_print_message_error(const u_char *bp, u_int length, int version, int convert)
411 +giop_print_fragment(const u_char *bp, u_int length, int version, int convert)
413 + /* not implemented yet */
416 +struct _GIOP_header {
418 + u_int8_t version[2];
425 +giop_print(const u_char *bp, u_int length)
427 + struct _GIOP_header *gp;
428 + int version, byteorder, fragments;
429 +#ifdef WORDS_BIGENDIAN
430 + int hostbyteorder=0;
432 + int hostbyteorder=1;
435 + if(bp + sizeof(struct _GIOP_header) > snapend) {
436 + printf(" [|GIOP]");
441 + gp=(struct _GIOP_header *)bp;
442 + version=gp->version[0]*100 + gp->version[1];
444 + printf(" v%d.%d", gp->version[0], gp->version[1]);
445 + if(version!=100 && version!=101)
448 + printf(" %s", tok2str(type2str, "Type %d", gp->type));
450 + if(version==100 && gp->type==GIOP_FRAGMENT)
454 + byteorder=gp->flags;
456 + } else if(version==101) {
457 + byteorder=gp->flags&0x1;
458 + fragments=gp->flags&0x2;
475 + giop_print_request((u_char *)(bp+sizeof(struct _GIOP_header)), gp->size, version, byteorder!=hostbyteorder);
479 + giop_print_reply((u_char *)(bp+sizeof(struct _GIOP_header)), gp->size, version, byteorder!=hostbyteorder);
482 + case GIOP_CANCEL_REQUEST:
483 + giop_print_cancel_request((u_char *)(bp+sizeof(struct _GIOP_header)), gp->size, version, byteorder!=hostbyteorder);
486 + case GIOP_LOCATE_REQUEST:
487 + giop_print_locate_request((u_char *)(bp+sizeof(struct _GIOP_header)), gp->size, version, byteorder!=hostbyteorder);
490 + case GIOP_LOCATE_REPLY:
491 + giop_print_locate_reply((u_char *)(bp+sizeof(struct _GIOP_header)), gp->size, version, byteorder!=hostbyteorder);
494 + case GIOP_CLOSE_CONNECTION:
495 + giop_print_close_connection((u_char *)(bp+sizeof(struct _GIOP_header)), gp->size, version, byteorder!=hostbyteorder);
498 + case GIOP_MESSAGE_ERROR:
499 + giop_print_message_error((u_char *)(bp+sizeof(struct _GIOP_header)), gp->size, version, byteorder!=hostbyteorder);
502 + case GIOP_FRAGMENT:
503 + giop_print_fragment((u_char *)(bp+sizeof(struct _GIOP_header)), gp->size, version, byteorder!=hostbyteorder);
510 diff -ruN tcpdump_3_5rel2.old/print-tcp.c tcpdump_3_5rel2/print-tcp.c
511 --- tcpdump_3_5rel2.old/print-tcp.c Wed Dec 22 16:44:10 1999
512 +++ tcpdump_3_5rel2/print-tcp.c Fri Jul 14 14:32:18 2000
514 bgp_print(bp, length);
515 else if (sport == NETBIOS_SSN_PORT || dport == NETBIOS_SSN_PORT)
516 nbt_tcp_print(bp, length);
519 + hlen = tp->th_off * 4;
520 + if(length > 4 && !strncmp((u_char *)(bp + hlen), "GIOP", 4)) {
521 + giop_print((u_char *)(bp + hlen), length);
526 fputs("[bad opt]", stdout);
527 diff -ruN tcpdump_3_5rel2.old/tcpdump.1 tcpdump_3_5rel2/tcpdump.1
528 --- tcpdump_3_5rel2.old/tcpdump.1 Thu Jul 13 07:53:47 2000
529 +++ tcpdump_3_5rel2/tcpdump.1 Fri Jul 14 14:28:47 2000
534 -.B \-adeflnNOpqRStvxX
535 +.B \-adefglnNOpqRStvxX
541 Use \fIfile\fP as input for the filter expression.
542 An additional expression given on the command line is ignored.
548 Listen on \fIinterface\fP.
549 diff -ruN tcpdump_3_5rel2.old/tcpdump.c tcpdump_3_5rel2/tcpdump.c
550 --- tcpdump_3_5rel2.old/tcpdump.c Tue Jan 11 08:34:00 2000
551 +++ tcpdump_3_5rel2/tcpdump.c Fri Jul 14 14:23:20 2000
553 int dflag; /* print filter code */
554 int eflag; /* print ethernet header */
555 int fflag; /* don't translate "foreign" IP address */
556 +int gflag; /* decode GIOP */
557 int nflag; /* leave addresses as numbers */
558 int Nflag; /* remove domains from printed host names */
559 int Oflag = 1; /* run filter code optimizer */