tcpdump-3.9.8/./0000755000026300017500000000000010676340704011475 5ustar mcrmcrtcpdump-3.9.8/./print-atm.c0000644000026300017500000002024410504040014013533 0ustar mcrmcr/* * Copyright (c) 1994, 1995, 1996, 1997 * The Regents of the University of California. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that: (1) source code distributions * retain the above copyright notice and this paragraph in its entirety, (2) * distributions including binary code include the above copyright notice and * this paragraph in its entirety in the documentation or other materials * provided with the distribution, and (3) all advertising materials mentioning * features or use of this software display the following acknowledgement: * ``This product includes software developed by the University of California, * Lawrence Berkeley Laboratory and its contributors.'' Neither the name of * the University nor the names of its contributors may be used to endorse * or promote products derived from this software without specific prior * written permission. * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. */ #ifndef lint static const char rcsid[] _U_ = "@(#) $Header: /tcpdump/master/tcpdump/print-atm.c,v 1.38.2.6 2006/01/25 13:27:24 hannes Exp $ (LBL)"; #endif #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include #include #include "interface.h" #include "extract.h" #include "addrtoname.h" #include "ethertype.h" #include "atm.h" #include "atmuni31.h" #include "llc.h" #include "ether.h" struct tok oam_f_values[] = { { OAMF4SC, "OAM F4 (segment)" }, { OAMF4EC, "OAM F4 (end)" }, { 0, NULL } }; struct tok oam_celltype_values[] = { { 0x1, "Fault Management" }, { 0x2, "Performance Management" }, { 0x8, "activate/deactivate" }, { 0xf, "System Management" }, { 0, NULL } }; struct tok oam_fm_functype_values[] = { { 0x0, "AIS" }, { 0x1, "RDI" }, { 0x4, "Continuity Check" }, { 0x8, "Loopback" }, { 0, NULL } }; struct tok oam_pm_functype_values[] = { { 0x0, "Forward Monitoring" }, { 0x1, "Backward Reporting" }, { 0x2, "Monitoring and Reporting" }, { 0, NULL } }; struct tok oam_ad_functype_values[] = { { 0x0, "Performance Monitoring" }, { 0x1, "Continuity Check" }, { 0, NULL } }; static const struct tok *oam_functype_values[16] = { NULL, oam_fm_functype_values, /* 1 */ oam_pm_functype_values, /* 2 */ NULL, NULL, NULL, NULL, NULL, oam_ad_functype_values, /* 8 */ NULL, NULL, NULL, NULL, NULL, NULL, NULL }; /* * Print an RFC 1483 LLC-encapsulated ATM frame. */ static void atm_llc_print(const u_char *p, int length, int caplen) { u_short extracted_ethertype; if (!llc_print(p, length, caplen, NULL, NULL, &extracted_ethertype)) { /* ether_type not known, print raw packet */ if (extracted_ethertype) { printf("(LLC %s) ", etherproto_string(htons(extracted_ethertype))); } if (!suppress_default_print) default_print(p, caplen); } } /* * Given a SAP value, generate the LLC header value for a UI packet * with that SAP as the source and destination SAP. */ #define LLC_UI_HDR(sap) ((sap)<<16 | (sap<<8) | 0x03) /* * This is the top level routine of the printer. 'p' points * to the LLC/SNAP header of the packet, 'h->ts' is the timestamp, * 'h->len' is the length of the packet off the wire, and 'h->caplen' * is the number of bytes actually captured. */ u_int atm_if_print(const struct pcap_pkthdr *h, const u_char *p) { u_int caplen = h->caplen; u_int length = h->len; u_int32_t llchdr; u_int hdrlen = 0; if (caplen < 8) { printf("[|atm]"); return (caplen); } /* Cisco Style NLPID ? */ if (*p == LLC_UI) { if (eflag) printf("CNLPID "); isoclns_print(p+1, length-1, caplen-1); return hdrlen; } /* * Extract the presumed LLC header into a variable, for quick * testing. * Then check for a header that's neither a header for a SNAP * packet nor an RFC 2684 routed NLPID-formatted PDU nor * an 802.2-but-no-SNAP IP packet. */ llchdr = EXTRACT_24BITS(p); if (llchdr != LLC_UI_HDR(LLCSAP_SNAP) && llchdr != LLC_UI_HDR(LLCSAP_ISONS) && llchdr != LLC_UI_HDR(LLCSAP_IP)) { /* * XXX - assume 802.6 MAC header from Fore driver. * * Unfortunately, the above list doesn't check for * all known SAPs, doesn't check for headers where * the source and destination SAP aren't the same, * and doesn't check for non-UI frames. It also * runs the risk of an 802.6 MAC header that happens * to begin with one of those values being * incorrectly treated as an 802.2 header. * * So is that Fore driver still around? And, if so, * is it still putting 802.6 MAC headers on ATM * packets? If so, could it be changed to use a * new DLT_IEEE802_6 value if we added it? */ if (eflag) printf("%08x%08x %08x%08x ", EXTRACT_32BITS(p), EXTRACT_32BITS(p+4), EXTRACT_32BITS(p+8), EXTRACT_32BITS(p+12)); p += 20; length -= 20; caplen -= 20; hdrlen += 20; } atm_llc_print(p, length, caplen); return (hdrlen); } /* * ATM signalling. */ static struct tok msgtype2str[] = { { CALL_PROCEED, "Call_proceeding" }, { CONNECT, "Connect" }, { CONNECT_ACK, "Connect_ack" }, { SETUP, "Setup" }, { RELEASE, "Release" }, { RELEASE_DONE, "Release_complete" }, { RESTART, "Restart" }, { RESTART_ACK, "Restart_ack" }, { STATUS, "Status" }, { STATUS_ENQ, "Status_enquiry" }, { ADD_PARTY, "Add_party" }, { ADD_PARTY_ACK, "Add_party_ack" }, { ADD_PARTY_REJ, "Add_party_reject" }, { DROP_PARTY, "Drop_party" }, { DROP_PARTY_ACK, "Drop_party_ack" }, { 0, NULL } }; static void sig_print(const u_char *p, int caplen) { bpf_u_int32 call_ref; if (caplen < PROTO_POS) { printf("[|atm]"); return; } if (p[PROTO_POS] == Q2931) { /* * protocol:Q.2931 for User to Network Interface * (UNI 3.1) signalling */ printf("Q.2931"); if (caplen < MSG_TYPE_POS) { printf(" [|atm]"); return; } printf(":%s ", tok2str(msgtype2str, "msgtype#%d", p[MSG_TYPE_POS])); if (caplen < CALL_REF_POS+3) { printf("[|atm]"); return; } call_ref = EXTRACT_24BITS(&p[CALL_REF_POS]); printf("CALL_REF:0x%06x", call_ref); } else { /* SCCOP with some unknown protocol atop it */ printf("SSCOP, proto %d ", p[PROTO_POS]); } } /* * Print an ATM PDU (such as an AAL5 PDU). */ void atm_print(u_int vpi, u_int vci, u_int traftype, const u_char *p, u_int length, u_int caplen) { if (eflag) printf("VPI:%u VCI:%u ", vpi, vci); if (vpi == 0) { switch (vci) { case PPC: sig_print(p, caplen); return; case BCC: printf("broadcast sig: "); return; case OAMF4SC: /* fall through */ case OAMF4EC: oam_print(p, length, ATM_OAM_HEC); return; case METAC: printf("meta: "); return; case ILMIC: printf("ilmi: "); snmp_print(p, length); return; } } switch (traftype) { case ATM_LLC: default: /* * Assumes traffic is LLC if unknown. */ atm_llc_print(p, length, caplen); break; case ATM_LANE: lane_print(p, length, caplen); break; } } int oam_print (const u_char *p, u_int length, u_int hec) { u_int32_t cell_header; u_int16_t cell_type, func_type,vpi,vci,payload,clp; cell_header = EXTRACT_32BITS(p+hec); cell_type = ((*(p+4+hec))>>4) & 0x0f; func_type = *(p+4+hec) & 0x0f; vpi = (cell_header>>20)&0xff; vci = (cell_header>>4)&0xffff; payload = (cell_header>>1)&0x7; clp = cell_header&0x1; printf("%s, vpi %u, vci %u, payload %u, clp %u, ", tok2str(oam_f_values, "OAM F5", vci), vpi, vci, payload, clp); printf("cell-type %s (%u)", tok2str(oam_celltype_values, "unknown", cell_type), cell_type); if (oam_functype_values[cell_type] == NULL) printf(", func-type unknown (%u)", func_type); else printf(", func-type %s (%u)", bittok2str(oam_functype_values[cell_type],"none",func_type), func_type); printf(", length %u",length); return 1; } tcpdump-3.9.8/./nfsfh.h0000644000026300017500000000524107461450071012751 0ustar mcrmcr/* @(#) $Header: /tcpdump/master/tcpdump/nfsfh.h,v 1.13 2002/04/24 06:27:05 guy Exp $ (LBL) */ /* * Copyright (c) 1993, 1994 Jeffrey C. Mogul, Digital Equipment Corporation, * Western Research Laboratory. All rights reserved. * Copyright (c) 2001 Compaq Computer Corporation. All rights reserved. * * Permission to use, copy, and modify this software and its * documentation is hereby granted only under the following terms and * conditions. Both the above copyright notice and this permission * notice must appear in all copies of the software, derivative works * or modified versions, and any portions thereof, and both notices * must appear in supporting documentation. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in * the documentation and/or other materials provided with the * distribution. * * THE SOFTWARE IS PROVIDED "AS IS" AND COMPAQ COMPUTER CORPORATION * DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO * EVENT SHALL COMPAQ COMPUTER CORPORATION BE LIABLE FOR ANY * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN * AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS * SOFTWARE. */ /* * nfsfh.h - NFS file handle definitions (for portable use) * * Jeffrey C. Mogul * Digital Equipment Corporation * Western Research Laboratory */ /* * Internal representation of dev_t, because different NFS servers * that we might be spying upon use different external representations. */ typedef struct { u_int32_t Minor; /* upper case to avoid clashing with macro names */ u_int32_t Major; } my_devt; #define dev_eq(a,b) ((a.Minor == b.Minor) && (a.Major == b.Major)) /* * Many file servers now use a large file system ID. This is * our internal representation of that. */ typedef struct { my_devt Fsid_dev; /* XXX avoid name conflict with AIX */ char Opaque_Handle[2 * 32 + 1]; u_int32_t fsid_code; } my_fsid; #define fsid_eq(a,b) ((a.fsid_code == b.fsid_code) &&\ dev_eq(a.Fsid_dev, b.Fsid_dev)) extern void Parse_fh(const unsigned char *, int, my_fsid *, ino_t *, const char **, const char **, int); tcpdump-3.9.8/./missing/0000755000026300017500000000000010245647657013157 5ustar mcrmcrtcpdump-3.9.8/./missing/strlcat.c0000644000026300017500000000510607755642463015003 0ustar mcrmcr/* $NetBSD: strlcat.c,v 1.5 1999/09/20 04:39:47 lukem Exp $ */ /* from OpenBSD: strlcat.c,v 1.2 1999/06/17 16:28:58 millert Exp */ /* * Copyright (c) 1998 Todd C. Miller * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. The name of the author may not be used to endorse or promote products * derived from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL * THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #ifndef lint static const char rcsid[] _U_ = "@(#) $Header: /tcpdump/master/tcpdump/missing/strlcat.c,v 1.5 2003/11/16 09:36:51 guy Exp $ (LBL)"; #endif #ifdef HAVE_CONFIG_H #include #endif #include #include /* * Appends src to string dst of size siz (unlike strncat, siz is the * full size of dst, not space left). At most siz-1 characters * will be copied. Always NUL terminates (unless siz == 0). * Returns strlen(src); if retval >= siz, truncation occurred. */ size_t strlcat(char *dst, const char *src, size_t siz) { register char *d = dst; register const char *s = src; register size_t n = siz; size_t dlen; /* Find the end of dst and adjust bytes left but don't go past end */ while (*d != '\0' && n-- != 0) d++; dlen = d - dst; n = siz - dlen; if (n == 0) return(dlen + strlen(s)); while (*s != '\0') { if (n != 1) { *d++ = *s; n--; } s++; } *d = '\0'; return(dlen + (s - src)); /* count does not include NUL */ } tcpdump-3.9.8/./missing/sockstorage.h0000644000026300017500000000333007501430064015632 0ustar mcrmcr/* * Copyright (C) 1999 WIDE Project. * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. Neither the name of the project nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ struct sockaddr_storage { #ifdef HAVE_SOCKADDR_SA_LEN u_int8_t ss_len; u_int8_t ss_family; u_int8_t fill[126]; #else u_int8_t ss_family; u_int8_t fill[127]; #endif /* HAVE_SOCKADDR_SA_LEN */ }; tcpdump-3.9.8/./missing/getnameinfo.c0000644000026300017500000001633007755642461015622 0ustar mcrmcr/* * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project. * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. Neither the name of the project nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ /* * Issues to be discussed: * - Thread safe-ness must be checked * - Return values. There seems to be no standard for return value (RFC2553) * but INRIA implementation returns EAI_xxx defined for getaddrinfo(). * - RFC2553 says that we should raise error on short buffer. X/Open says * we need to truncate the result. We obey RFC2553 (and X/Open should be * modified). */ #ifdef HAVE_CONFIG_H #include #endif #ifndef lint static const char rcsid[] _U_ = "@(#) $Header: /tcpdump/master/tcpdump/missing/getnameinfo.c,v 1.11 2003/11/16 09:36:49 guy Exp $"; #endif #include #include #include #include #include #include #include #include #include #include #include #ifdef NEED_ADDRINFO_H #include "addrinfo.h" #endif #define SUCCESS 0 #define ANY 0 #define YES 1 #define NO 0 static struct afd { int a_af; int a_addrlen; int a_socklen; int a_off; } afdl [] = { #ifdef INET6 {PF_INET6, sizeof(struct in6_addr), sizeof(struct sockaddr_in6), offsetof(struct sockaddr_in6, sin6_addr)}, #endif {PF_INET, sizeof(struct in_addr), sizeof(struct sockaddr_in), offsetof(struct sockaddr_in, sin_addr)}, {0, 0, 0}, }; struct sockinet { u_char si_len; u_char si_family; u_short si_port; }; #define ENI_NOSOCKET 0 #define ENI_NOSERVNAME 1 #define ENI_NOHOSTNAME 2 #define ENI_MEMORY 3 #define ENI_SYSTEM 4 #define ENI_FAMILY 5 #define ENI_SALEN 6 int getnameinfo(sa, salen, host, hostlen, serv, servlen, flags) const struct sockaddr *sa; size_t salen; char *host; size_t hostlen; char *serv; size_t servlen; int flags; { struct afd *afd; struct servent *sp; struct hostent *hp; u_short port; int family, i; char *addr, *p; u_int32_t v4a; int h_error; char numserv[512]; char numaddr[512]; if (sa == NULL) return ENI_NOSOCKET; #ifdef HAVE_SA_LEN /*XXX*/ if (sa->sa_len != salen) return ENI_SALEN; #endif family = sa->sa_family; for (i = 0; afdl[i].a_af; i++) if (afdl[i].a_af == family) { afd = &afdl[i]; goto found; } return ENI_FAMILY; found: if (salen != afd->a_socklen) return ENI_SALEN; port = ((struct sockinet *)sa)->si_port; /* network byte order */ addr = (char *)sa + afd->a_off; if (serv == NULL || servlen == 0) { /* * do nothing in this case. * in case you are wondering if "&&" is more correct than * "||" here: RFC2553 says that serv == NULL OR servlen == 0 * means that the caller does not want the result. */ } else { if (flags & NI_NUMERICSERV) sp = NULL; else { sp = getservbyport(port, (flags & NI_DGRAM) ? "udp" : "tcp"); } if (sp) { if (strlen(sp->s_name) + 1 > servlen) return ENI_MEMORY; strcpy(serv, sp->s_name); } else { snprintf(numserv, sizeof(numserv), "%d", ntohs(port)); if (strlen(numserv) + 1 > servlen) return ENI_MEMORY; strcpy(serv, numserv); } } switch (sa->sa_family) { case AF_INET: v4a = (u_int32_t) ntohl(((struct sockaddr_in *)sa)->sin_addr.s_addr); if (IN_MULTICAST(v4a) || IN_EXPERIMENTAL(v4a)) flags |= NI_NUMERICHOST; v4a >>= IN_CLASSA_NSHIFT; if (v4a == 0) flags |= NI_NUMERICHOST; break; #ifdef INET6 case AF_INET6: { struct sockaddr_in6 *sin6; sin6 = (struct sockaddr_in6 *)sa; switch (sin6->sin6_addr.s6_addr[0]) { case 0x00: if (IN6_IS_ADDR_V4MAPPED(&sin6->sin6_addr)) ; else if (IN6_IS_ADDR_LOOPBACK(&sin6->sin6_addr)) ; else flags |= NI_NUMERICHOST; break; default: if (IN6_IS_ADDR_LINKLOCAL(&sin6->sin6_addr)) { flags |= NI_NUMERICHOST; } else if (IN6_IS_ADDR_MULTICAST(&sin6->sin6_addr)) flags |= NI_NUMERICHOST; break; } } break; #endif } if (host == NULL || hostlen == 0) { /* * do nothing in this case. * in case you are wondering if "&&" is more correct than * "||" here: RFC2553 says that host == NULL OR hostlen == 0 * means that the caller does not want the result. */ } else if (flags & NI_NUMERICHOST) { /* NUMERICHOST and NAMEREQD conflicts with each other */ if (flags & NI_NAMEREQD) return ENI_NOHOSTNAME; if (inet_ntop(afd->a_af, addr, numaddr, sizeof(numaddr)) == NULL) return ENI_SYSTEM; if (strlen(numaddr) + 1 > hostlen) return ENI_MEMORY; strcpy(host, numaddr); #if defined(INET6) && defined(NI_WITHSCOPEID) if (afd->a_af == AF_INET6 && (IN6_IS_ADDR_LINKLOCAL((struct in6_addr *)addr) || IN6_IS_ADDR_MULTICAST((struct in6_addr *)addr)) && ((struct sockaddr_in6 *)sa)->sin6_scope_id) { #ifndef ALWAYS_WITHSCOPE if (flags & NI_WITHSCOPEID) #endif /* !ALWAYS_WITHSCOPE */ { char *ep = strchr(host, '\0'); unsigned int ifindex = ((struct sockaddr_in6 *)sa)->sin6_scope_id; *ep = SCOPE_DELIMITER; if ((if_indextoname(ifindex, ep + 1)) == NULL) /* XXX what should we do? */ strncpy(ep + 1, "???", 3); } } #endif /* INET6 */ } else { #ifdef USE_GETIPNODEBY hp = getipnodebyaddr(addr, afd->a_addrlen, afd->a_af, &h_error); #else hp = gethostbyaddr(addr, afd->a_addrlen, afd->a_af); #ifdef HAVE_H_ERRNO h_error = h_errno; #else h_error = EINVAL; #endif #endif if (hp) { if (flags & NI_NOFQDN) { p = strchr(hp->h_name, '.'); if (p) *p = '\0'; } if (strlen(hp->h_name) + 1 > hostlen) { #ifdef USE_GETIPNODEBY freehostent(hp); #endif return ENI_MEMORY; } strcpy(host, hp->h_name); #ifdef USE_GETIPNODEBY freehostent(hp); #endif } else { if (flags & NI_NAMEREQD) return ENI_NOHOSTNAME; if (inet_ntop(afd->a_af, addr, numaddr, sizeof(numaddr)) == NULL) return ENI_NOHOSTNAME; if (strlen(numaddr) + 1 > hostlen) return ENI_MEMORY; strcpy(host, numaddr); } } return SUCCESS; } tcpdump-3.9.8/./missing/bittypes.h0000644000026300017500000000655510123371201015154 0ustar mcrmcr/* * Copyright (C) 1999 WIDE Project. * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. Neither the name of the project nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ #ifndef HAVE_U_INT8_T #if SIZEOF_CHAR == 1 typedef unsigned char u_int8_t; #elif SIZEOF_INT == 1 typedef unsigned int u_int8_t; #else /* XXX */ #error "there's no appropriate type for u_int8_t" #endif #endif /* HAVE_U_INT8_T */ #ifndef HAVE_U_INT16_T #if SIZEOF_SHORT == 2 typedef unsigned short u_int16_t; #elif SIZEOF_INT == 2 typedef unsigned int u_int16_t; #elif SIZEOF_CHAR == 2 typedef unsigned char u_int16_t; #else /* XXX */ #error "there's no appropriate type for u_int16_t" #endif #endif /* HAVE_U_INT16_T */ #ifndef HAVE_U_INT32_T #if SIZEOF_INT == 4 typedef unsigned int u_int32_t; #elif SIZEOF_LONG == 4 typedef unsigned long u_int32_t; #elif SIZEOF_SHORT == 4 typedef unsigned short u_int32_t; #else /* XXX */ #error "there's no appropriate type for u_int32_t" #endif #endif /* HAVE_U_INT32_T */ #ifndef HAVE_U_INT64_T #if SIZEOF_LONG_LONG == 8 typedef unsigned long long u_int64_t; #elif defined(_MSC_EXTENSIONS) typedef unsigned _int64 u_int64_t; #elif SIZEOF_INT == 8 typedef unsigned int u_int64_t; #elif SIZEOF_LONG == 8 typedef unsigned long u_int64_t; #elif SIZEOF_SHORT == 8 typedef unsigned short u_int64_t; #else /* XXX */ #error "there's no appropriate type for u_int64_t" #endif #endif /* HAVE_U_INT64_T */ #ifndef PRId64 #ifdef _MSC_EXTENSIONS #define PRId64 "I64d" #else /* _MSC_EXTENSIONS */ #define PRId64 "lld" #endif /* _MSC_EXTENSIONS */ #endif /* PRId64 */ #ifndef PRIo64 #ifdef _MSC_EXTENSIONS #define PRIo64 "I64o" #else /* _MSC_EXTENSIONS */ #define PRIo64 "llo" #endif /* _MSC_EXTENSIONS */ #endif /* PRIo64 */ #ifndef PRIx64 #ifdef _MSC_EXTENSIONS #define PRIx64 "I64x" #else /* _MSC_EXTENSIONS */ #define PRIx64 "llx" #endif /* _MSC_EXTENSIONS */ #endif /* PRIx64 */ #ifndef PRIu64 #ifdef _MSC_EXTENSIONS #define PRIu64 "I64u" #else /* _MSC_EXTENSIONS */ #define PRIu64 "llu" #endif /* _MSC_EXTENSIONS */ #endif /* PRIu64 */ tcpdump-3.9.8/./missing/snprintf.c0000644000026300017500000003144007755642463015172 0ustar mcrmcr/* * Copyright (c) 1995-1999 Kungliga Tekniska Högskolan * (Royal Institute of Technology, Stockholm, Sweden). * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * 3. Neither the name of the Institute nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ /* $Id: snprintf.c,v 1.8 2003/11/16 09:36:51 guy Exp $ */ #ifdef HAVE_CONFIG_H #include #endif #ifndef lint static const char rcsid[] _U_ = "@(#) $Header: /tcpdump/master/tcpdump/missing/snprintf.c,v 1.8 2003/11/16 09:36:51 guy Exp $"; #endif #include #include #include #include #include #include #include enum format_flags { minus_flag = 1, plus_flag = 2, space_flag = 4, alternate_flag = 8, zero_flag = 16 }; /* * Common state */ struct state { unsigned char *str; unsigned char *s; unsigned char *theend; size_t sz; size_t max_sz; int (*append_char)(struct state *, unsigned char); int (*reserve)(struct state *, size_t); /* XXX - methods */ }; #ifndef HAVE_VSNPRINTF static int sn_reserve (struct state *state, size_t n) { return state->s + n > state->theend; } static int sn_append_char (struct state *state, unsigned char c) { if (sn_reserve (state, 1)) { return 1; } else { *state->s++ = c; return 0; } } #endif #if 0 static int as_reserve (struct state *state, size_t n) { if (state->s + n > state->theend) { int off = state->s - state->str; unsigned char *tmp; if (state->max_sz && state->sz >= state->max_sz) return 1; state->sz = max(state->sz * 2, state->sz + n); if (state->max_sz) state->sz = min(state->sz, state->max_sz); tmp = realloc (state->str, state->sz); if (tmp == NULL) return 1; state->str = tmp; state->s = state->str + off; state->theend = state->str + state->sz - 1; } return 0; } static int as_append_char (struct state *state, unsigned char c) { if(as_reserve (state, 1)) return 1; else { *state->s++ = c; return 0; } } #endif static int append_number(struct state *state, unsigned long num, unsigned base, char *rep, int width, int prec, int flags, int minusp) { int len = 0; int i; /* given precision, ignore zero flag */ if(prec != -1) flags &= ~zero_flag; else prec = 1; /* zero value with zero precision -> "" */ if(prec == 0 && num == 0) return 0; do{ if((*state->append_char)(state, rep[num % base])) return 1; len++; num /= base; }while(num); prec -= len; /* pad with prec zeros */ while(prec-- > 0){ if((*state->append_char)(state, '0')) return 1; len++; } /* add length of alternate prefix (added later) to len */ if(flags & alternate_flag && (base == 16 || base == 8)) len += base / 8; /* pad with zeros */ if(flags & zero_flag){ width -= len; if(minusp || (flags & space_flag) || (flags & plus_flag)) width--; while(width-- > 0){ if((*state->append_char)(state, '0')) return 1; len++; } } /* add alternate prefix */ if(flags & alternate_flag && (base == 16 || base == 8)){ if(base == 16) if((*state->append_char)(state, rep[10] + 23)) /* XXX */ return 1; if((*state->append_char)(state, '0')) return 1; } /* add sign */ if(minusp){ if((*state->append_char)(state, '-')) return 1; len++; } else if(flags & plus_flag) { if((*state->append_char)(state, '+')) return 1; len++; } else if(flags & space_flag) { if((*state->append_char)(state, ' ')) return 1; len++; } if(flags & minus_flag) /* swap before padding with spaces */ for(i = 0; i < len / 2; i++){ char c = state->s[-i-1]; state->s[-i-1] = state->s[-len+i]; state->s[-len+i] = c; } width -= len; while(width-- > 0){ if((*state->append_char)(state, ' ')) return 1; len++; } if(!(flags & minus_flag)) /* swap after padding with spaces */ for(i = 0; i < len / 2; i++){ char c = state->s[-i-1]; state->s[-i-1] = state->s[-len+i]; state->s[-len+i] = c; } return 0; } static int append_string (struct state *state, unsigned char *arg, int width, int prec, int flags) { if(prec != -1) width -= prec; else width -= strlen((char *)arg); if(!(flags & minus_flag)) while(width-- > 0) if((*state->append_char) (state, ' ')) return 1; if (prec != -1) { while (*arg && prec--) if ((*state->append_char) (state, *arg++)) return 1; } else { while (*arg) if ((*state->append_char) (state, *arg++)) return 1; } if(flags & minus_flag) while(width-- > 0) if((*state->append_char) (state, ' ')) return 1; return 0; } static int append_char(struct state *state, unsigned char arg, int width, int flags) { while(!(flags & minus_flag) && --width > 0) if((*state->append_char) (state, ' ')) return 1; if((*state->append_char) (state, arg)) return 1; while((flags & minus_flag) && --width > 0) if((*state->append_char) (state, ' ')) return 1; return 0; } /* * This can't be made into a function... */ #define PARSE_INT_FORMAT(res, arg, unsig) \ if (long_flag) \ res = (unsig long)va_arg(arg, unsig long); \ else if (short_flag) \ res = (unsig short)va_arg(arg, unsig int); \ else \ res = (unsig int)va_arg(arg, unsig int) /* * zyxprintf - return 0 or -1 */ static int xyzprintf (struct state *state, const char *char_format, va_list ap) { const unsigned char *format = (const unsigned char *)char_format; unsigned char c; while((c = *format++)) { if (c == '%') { int flags = 0; int width = 0; int prec = -1; int long_flag = 0; int short_flag = 0; /* flags */ while((c = *format++)){ if(c == '-') flags |= minus_flag; else if(c == '+') flags |= plus_flag; else if(c == ' ') flags |= space_flag; else if(c == '#') flags |= alternate_flag; else if(c == '0') flags |= zero_flag; else break; } if((flags & space_flag) && (flags & plus_flag)) flags ^= space_flag; if((flags & minus_flag) && (flags & zero_flag)) flags ^= zero_flag; /* width */ if (isdigit(c)) do { width = width * 10 + c - '0'; c = *format++; } while(isdigit(c)); else if(c == '*') { width = va_arg(ap, int); c = *format++; } /* precision */ if (c == '.') { prec = 0; c = *format++; if (isdigit(c)) do { prec = prec * 10 + c - '0'; c = *format++; } while(isdigit(c)); else if (c == '*') { prec = va_arg(ap, int); c = *format++; } } /* size */ if (c == 'h') { short_flag = 1; c = *format++; } else if (c == 'l') { long_flag = 1; c = *format++; } switch (c) { case 'c' : if(append_char(state, va_arg(ap, int), width, flags)) return -1; break; case 's' : if (append_string(state, va_arg(ap, unsigned char*), width, prec, flags)) return -1; break; case 'd' : case 'i' : { long arg; unsigned long num; int minusp = 0; PARSE_INT_FORMAT(arg, ap, signed); if (arg < 0) { minusp = 1; num = -arg; } else num = arg; if (append_number (state, num, 10, "0123456789", width, prec, flags, minusp)) return -1; break; } case 'u' : { unsigned long arg; PARSE_INT_FORMAT(arg, ap, unsigned); if (append_number (state, arg, 10, "0123456789", width, prec, flags, 0)) return -1; break; } case 'o' : { unsigned long arg; PARSE_INT_FORMAT(arg, ap, unsigned); if (append_number (state, arg, 010, "01234567", width, prec, flags, 0)) return -1; break; } case 'x' : { unsigned long arg; PARSE_INT_FORMAT(arg, ap, unsigned); if (append_number (state, arg, 0x10, "0123456789abcdef", width, prec, flags, 0)) return -1; break; } case 'X' :{ unsigned long arg; PARSE_INT_FORMAT(arg, ap, unsigned); if (append_number (state, arg, 0x10, "0123456789ABCDEF", width, prec, flags, 0)) return -1; break; } case 'p' : { unsigned long arg = (unsigned long)va_arg(ap, void*); if (append_number (state, arg, 0x10, "0123456789ABCDEF", width, prec, flags, 0)) return -1; break; } case 'n' : { int *arg = va_arg(ap, int*); *arg = state->s - state->str; break; } case '\0' : --format; /* FALLTHROUGH */ case '%' : if ((*state->append_char)(state, c)) return -1; break; default : if ( (*state->append_char)(state, '%') || (*state->append_char)(state, c)) return -1; break; } } else if ((*state->append_char) (state, c)) return -1; } return 0; } #ifndef HAVE_SNPRINTF int snprintf (char *str, size_t sz, const char *format, ...) { va_list args; int ret; va_start(args, format); ret = vsnprintf (str, sz, format, args); #ifdef PARANOIA { int ret2; char *tmp; tmp = malloc (sz); if (tmp == NULL) abort (); ret2 = vsprintf (tmp, format, args); if (ret != ret2 || strcmp(str, tmp)) abort (); free (tmp); } #endif va_end(args); return ret; } #endif #if 0 #ifndef HAVE_ASPRINTF int asprintf (char **ret, const char *format, ...) { va_list args; int val; va_start(args, format); val = vasprintf (ret, format, args); #ifdef PARANOIA { int ret2; char *tmp; tmp = malloc (val + 1); if (tmp == NULL) abort (); ret2 = vsprintf (tmp, format, args); if (val != ret2 || strcmp(*ret, tmp)) abort (); free (tmp); } #endif va_end(args); return val; } #endif #ifndef HAVE_ASNPRINTF int asnprintf (char **ret, size_t max_sz, const char *format, ...) { va_list args; int val; va_start(args, format); val = vasnprintf (ret, max_sz, format, args); #ifdef PARANOIA { int ret2; char *tmp; tmp = malloc (val + 1); if (tmp == NULL) abort (); ret2 = vsprintf (tmp, format, args); if (val != ret2 || strcmp(*ret, tmp)) abort (); free (tmp); } #endif va_end(args); return val; } #endif #ifndef HAVE_VASPRINTF int vasprintf (char **ret, const char *format, va_list args) { return vasnprintf (ret, 0, format, args); } #endif #ifndef HAVE_VASNPRINTF int vasnprintf (char **ret, size_t max_sz, const char *format, va_list args) { int st; size_t len; struct state state; state.max_sz = max_sz; state.sz = 1; state.str = malloc(state.sz); if (state.str == NULL) { *ret = NULL; return -1; } state.s = state.str; state.theend = state.s + state.sz - 1; state.append_char = as_append_char; state.reserve = as_reserve; st = xyzprintf (&state, format, args); if (st) { free (state.str); *ret = NULL; return -1; } else { char *tmp; *state.s = '\0'; len = state.s - state.str; tmp = realloc (state.str, len+1); if (tmp == NULL) { free (state.str); *ret = NULL; return -1; } *ret = tmp; return len; } } #endif #endif #ifndef HAVE_VSNPRINTF int vsnprintf (char *str, size_t sz, const char *format, va_list args) { struct state state; int ret; unsigned char *ustr = (unsigned char *)str; state.max_sz = 0; state.sz = sz; state.str = ustr; state.s = ustr; state.theend = ustr + sz - 1; state.append_char = sn_append_char; state.reserve = sn_reserve; ret = xyzprintf (&state, format, args); *state.s = '\0'; if (ret) return sz; else return state.s - state.str; } #endif tcpdump-3.9.8/./missing/strsep.c0000644000026300017500000000565107640012154014631 0ustar mcrmcr/*- * Copyright (c) 1990, 1993 * The Regents of the University of California. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. All advertising materials mentioning features or use of this software * must display the following acknowledgement: * This product includes software developed by the University of * California, Berkeley and its contributors. * 4. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ #if defined(LIBC_SCCS) && !defined(lint) static const char rcsid[] = "@(#) $Header: /tcpdump/master/tcpdump/missing/strsep.c,v 1.3 2003/03/25 08:33:48 guy Exp $ (LBL)"; #endif /* LIBC_SCCS and not lint */ #ifdef HAVE_CONFIG_H #include #endif #include #include /* * Get next token from string *stringp, where tokens are possibly-empty * strings separated by characters from delim. * * Writes NULs into the string at *stringp to end tokens. * delim need not remain constant from call to call. * On return, *stringp points past the last NUL written (if there might * be further tokens), or is NULL (if there are definitely no more tokens). * * If *stringp is NULL, strsep returns NULL. */ char * strsep(char **stringp, const char *delim) { register char *s; register const char *spanp; register int c, sc; char *tok; if ((s = *stringp) == NULL) return (NULL); for (tok = s;;) { c = *s++; spanp = delim; do { if ((sc = *spanp++) == c) { if (c == 0) s = NULL; else s[-1] = 0; *stringp = s; return (tok); } } while (sc != 0); } /* NOTREACHED */ } tcpdump-3.9.8/./missing/addrsize.h0000644000026300017500000000321607501427701015122 0ustar mcrmcr/* * Copyright (C) 1999 WIDE Project. * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. Neither the name of the project nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ #ifndef INADDRSZ #define INADDRSZ 4 /* IPv4 T_A */ #endif #ifndef IN6ADDRSZ #define IN6ADDRSZ 16 /* IPv6 T_AAAA */ #endif tcpdump-3.9.8/./missing/resolv_ext.h0000644000026300017500000000367407501427703015521 0ustar mcrmcr/* * Copyright (C) 1999 WIDE Project. * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. Neither the name of the project nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ #ifndef MAXRESOLVSORT /* XXX */ #define MAXRESOLVSORT 10 /* number of net to sort on */ #endif #ifndef HAVE_RES_STATE_EXT struct __res_state_ext { struct sockaddr_storage nsaddr_list[MAXNS]; struct { int af; /* address family for addr, mask */ union { struct in_addr ina; #ifdef INET6 struct in6_addr in6a; #endif } addr, mask; } sort_list[MAXRESOLVSORT]; }; #endif extern struct __res_state_ext _res_ext; tcpdump-3.9.8/./missing/addrinfo.h0000644000026300017500000001120507501427700015077 0ustar mcrmcr/* * Copyright (C) 1995, 1996, 1997, 1998, and 1999 WIDE Project. * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. Neither the name of the project nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ /* $Id: addrinfo.h,v 1.4 2002/06/11 17:13:36 itojun Exp $ */ #ifndef HAVE_ADDRINFO /* * Error return codes from getaddrinfo() */ #define EAI_ADDRFAMILY 1 /* address family for hostname not supported */ #define EAI_AGAIN 2 /* temporary failure in name resolution */ #define EAI_BADFLAGS 3 /* invalid value for ai_flags */ #define EAI_FAIL 4 /* non-recoverable failure in name resolution */ #define EAI_FAMILY 5 /* ai_family not supported */ #define EAI_MEMORY 6 /* memory allocation failure */ #define EAI_NODATA 7 /* no address associated with hostname */ #define EAI_NONAME 8 /* hostname nor servname provided, or not known */ #define EAI_SERVICE 9 /* servname not supported for ai_socktype */ #define EAI_SOCKTYPE 10 /* ai_socktype not supported */ #define EAI_SYSTEM 11 /* system error returned in errno */ #define EAI_BADHINTS 12 #define EAI_PROTOCOL 13 #define EAI_MAX 14 /* internal error */ #define NETDB_INTERNAL -1 /* see errno */ /* * Flag values for getaddrinfo() */ #define AI_PASSIVE 0x00000001 /* get address to use bind() */ #define AI_CANONNAME 0x00000002 /* fill ai_canonname */ #define AI_NUMERICHOST 0x00000004 /* prevent name resolution */ /* valid flags for addrinfo */ #define AI_MASK (AI_PASSIVE | AI_CANONNAME | AI_NUMERICHOST) #define AI_ALL 0x00000100 /* IPv6 and IPv4-mapped (with AI_V4MAPPED) */ #define AI_V4MAPPED_CFG 0x00000200 /* accept IPv4-mapped if kernel supports */ #define AI_ADDRCONFIG 0x00000400 /* only if any address is assigned */ #define AI_V4MAPPED 0x00000800 /* accept IPv4-mapped IPv6 address */ /* special recommended flags for getipnodebyname */ #define AI_DEFAULT (AI_V4MAPPED_CFG | AI_ADDRCONFIG) struct addrinfo { int ai_flags; /* AI_PASSIVE, AI_CANONNAME */ int ai_family; /* PF_xxx */ int ai_socktype; /* SOCK_xxx */ int ai_protocol; /* 0 or IPPROTO_xxx for IPv4 and IPv6 */ size_t ai_addrlen; /* length of ai_addr */ char *ai_canonname; /* canonical name for hostname */ struct sockaddr *ai_addr; /* binary address */ struct addrinfo *ai_next; /* next structure in linked list */ }; extern void freeaddrinfo (struct addrinfo *); extern void freehostent (struct hostent *); extern char *gai_strerror (int); extern int getaddrinfo (const char *, const char *, const struct addrinfo *, struct addrinfo **); extern int getnameinfo (const struct sockaddr *, size_t, char *, size_t, char *, size_t, int); extern struct hostent *getipnodebyaddr (const void *, size_t, int, int *); extern struct hostent *getipnodebyname (const char *, int, int, int *); extern int inet_pton (int, const char *, void *); extern const char *inet_ntop (int, const void *, char *, size_t); #endif /* HAVE_ADDRINFO */ /* * Constants for getnameinfo() */ #ifndef NI_MAXHOST #define NI_MAXHOST 1025 #endif #ifndef NI_MAXSERV #define NI_MAXSERV 32 #endif /* * Flag values for getnameinfo() */ #ifndef NI_NOFQDN #define NI_NOFQDN 0x00000001 #endif #ifndef NI_NUMERICHOST #define NI_NUMERICHOST 0x00000002 #endif #ifndef NI_NAMEREQD #define NI_NAMEREQD 0x00000004 #endif #ifndef NI_NUMERICSERV #define NI_NUMERICSERV 0x00000008 #endif #ifndef NI_DGRAM #define NI_DGRAM 0x00000010 #endif tcpdump-3.9.8/./missing/CVS/0000755000026300017500000000000010245647657013612 5ustar mcrmcrtcpdump-3.9.8/./missing/CVS/Entries0000644000026300017500000000175110245647657015152 0ustar mcrmcr/addrinfo.h/1.4/Tue Jun 11 17:13:36 2002//Ttcpdump_3_9 /addrsize.h/1.2/Tue Jun 11 17:13:37 2002//Ttcpdump_3_9 /bittypes.h/1.6/Sun Sep 19 20:56:33 2004//Ttcpdump_3_9 /datalinks.c/1.3/Sun Nov 16 09:36:47 2003//Ttcpdump_3_9 /dlnames.c/1.5/Tue Nov 18 23:09:43 2003//Ttcpdump_3_9 /getaddrinfo.c/1.13/Sun Nov 16 09:36:48 2003//Ttcpdump_3_9 /getnameinfo.c/1.11/Sun Nov 16 09:36:49 2003//Ttcpdump_3_9 /inet_aton.c/1.6/Sun Nov 16 09:36:49 2003//Ttcpdump_3_9 /inet_ntop.c/1.8/Wed Feb 9 02:25:46 2005//Ttcpdump_3_9 /inet_pton.c/1.6/Sun Nov 16 09:36:51 2003//Ttcpdump_3_9 /resolv6.h/1.2/Tue Jun 11 17:13:38 2002//Ttcpdump_3_9 /resolv_ext.h/1.2/Tue Jun 11 17:13:39 2002//Ttcpdump_3_9 /snprintf.c/1.8/Sun Nov 16 09:36:51 2003//Ttcpdump_3_9 /sockstorage.h/1.3/Tue Jun 11 17:15:32 2002//Ttcpdump_3_9 /strdup.c/1.1/Sat Jan 20 07:26:08 2001//Ttcpdump_3_9 /strlcat.c/1.5/Sun Nov 16 09:36:51 2003//Ttcpdump_3_9 /strlcpy.c/1.5/Sun Nov 16 09:36:52 2003//Ttcpdump_3_9 /strsep.c/1.3/Tue Mar 25 08:33:48 2003//Ttcpdump_3_9 D tcpdump-3.9.8/./missing/CVS/Root0000644000026300017500000000004010245647656014451 0ustar mcrmcrcvs.tcpdump.org:/tcpdump/master tcpdump-3.9.8/./missing/CVS/Repository0000644000026300017500000000002010245647656015703 0ustar mcrmcrtcpdump/missing tcpdump-3.9.8/./missing/CVS/Tag0000644000026300017500000000001510245647657014244 0ustar mcrmcrTtcpdump_3_9 tcpdump-3.9.8/./missing/inet_aton.c0000644000026300017500000000461507755642461015311 0ustar mcrmcr/* * Copyright (c) 1995, 1996, 1997 Kungliga Tekniska Högskolan * (Royal Institute of Technology, Stockholm, Sweden). * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * 3. All advertising materials mentioning features or use of this software * must display the following acknowledgement: * This product includes software developed by the Kungliga Tekniska * Högskolan and its contributors. * * 4. Neither the name of the Institute nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ /* $Id: inet_aton.c,v 1.6 2003/11/16 09:36:49 guy Exp $ */ #ifndef lint static const char rcsid[] _U_ = "@(#) $Header: /tcpdump/master/tcpdump/missing/inet_aton.c,v 1.6 2003/11/16 09:36:49 guy Exp $"; #endif #include /* Minimal implementation of inet_aton. * Cannot distinguish between failure and a local broadcast address. */ #ifndef INADDR_NONE #define INADDR_NONE 0xffffffff #endif int inet_aton(const char *cp, struct in_addr *addr) { addr->s_addr = inet_addr(cp); return (addr->s_addr == INADDR_NONE) ? 0 : 1; } tcpdump-3.9.8/./missing/datalinks.c0000644000026300017500000000504007755642457015301 0ustar mcrmcr/* * Copyright (c) 1993, 1994, 1995, 1996, 1997, 1998 * The Regents of the University of California. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. All advertising materials mentioning features or use of this software * must display the following acknowledgement: * This product includes software developed by the Computer Systems * Engineering Group at Lawrence Berkeley Laboratory. * 4. Neither the name of the University nor of the Laboratory may be used * to endorse or promote products derived from this software without * specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ #ifndef lint static const char rcsid[] _U_ = "@(#) $Header: /tcpdump/master/tcpdump/missing/datalinks.c,v 1.3 2003/11/16 09:36:47 guy Exp $ (LBL)"; #endif #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include #include #include "pcap-missing.h" /* * Stub versions for platforms that don't support them. */ int pcap_list_datalinks(pcap_t *p, int **dlt_buffer) { /* * This platform doesn't support changing the DLT for an * interface. Return a list of DLTs containing only the * DLT this device supports. */ *dlt_buffer = (int*)malloc(sizeof(**dlt_buffer)); if (*dlt_buffer == NULL) return (-1); **dlt_buffer = pcap_datalink(p); return (1); } tcpdump-3.9.8/./missing/dlnames.c0000644000026300017500000001172607756523267014760 0ustar mcrmcr/* * Copyright (c) 1993, 1994, 1995, 1996, 1997, 1998 * The Regents of the University of California. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. All advertising materials mentioning features or use of this software * must display the following acknowledgement: * This product includes software developed by the Computer Systems * Engineering Group at Lawrence Berkeley Laboratory. * 4. Neither the name of the University nor of the Laboratory may be used * to endorse or promote products derived from this software without * specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ #ifndef lint static const char rcsid[] _U_ = "@(#) $Header: /tcpdump/master/tcpdump/missing/dlnames.c,v 1.5 2003/11/18 23:09:43 guy Exp $ (LBL)"; #endif #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include #include "pcap-missing.h" struct dlt_choice { const char *name; const char *description; int dlt; }; #define DLT_CHOICE(code, description) { #code, description, code } #define DLT_CHOICE_SENTINEL { NULL, NULL, 0 } static struct dlt_choice dlt_choices[] = { DLT_CHOICE(DLT_NULL, "BSD loopback"), DLT_CHOICE(DLT_EN10MB, "Ethernet"), DLT_CHOICE(DLT_IEEE802, "Token ring"), DLT_CHOICE(DLT_ARCNET, "ARCNET"), DLT_CHOICE(DLT_SLIP, "SLIP"), DLT_CHOICE(DLT_PPP, "PPP"), DLT_CHOICE(DLT_FDDI, "FDDI"), DLT_CHOICE(DLT_ATM_RFC1483, "RFC 1483 IP-over-ATM"), DLT_CHOICE(DLT_RAW, "Raw IP"), #ifdef DLT_SLIP_BSDOS DLT_CHOICE(DLT_SLIP_BSDOS, "BSD/OS SLIP"), #endif #ifdef DLT_PPP_BSDOS DLT_CHOICE(DLT_PPP_BSDOS, "BSD/OS PPP"), #endif #ifdef DLT_ATM_CLIP DLT_CHOICE(DLT_ATM_CLIP, "Linux Classical IP-over-ATM"), #endif #ifdef DLT_PPP_SERIAL DLT_CHOICE(DLT_PPP_SERIAL, "PPP over serial"), #endif #ifdef DLT_PPP_ETHER DLT_CHOICE(DLT_PPP_ETHER, "PPPoE"), #endif #ifdef DLT_C_HDLC DLT_CHOICE(DLT_C_HDLC, "Cisco HDLC"), #endif #ifdef DLT_IEEE802_11 DLT_CHOICE(DLT_IEEE802_11, "802.11"), #endif #ifdef DLT_FRELAY DLT_CHOICE(DLT_FRELAY, "Frame Relay"), #endif #ifdef DLT_LOOP DLT_CHOICE(DLT_LOOP, "OpenBSD loopback"), #endif #ifdef DLT_ENC DLT_CHOICE(DLT_ENC, "OpenBSD encapsulated IP"), #endif #ifdef DLT_LINUX_SLL DLT_CHOICE(DLT_LINUX_SLL, "Linux cooked"), #endif #ifdef DLT_LTALK DLT_CHOICE(DLT_LTALK, "Localtalk"), #endif #ifdef DLT_PFLOG DLT_CHOICE(DLT_PFLOG, "OpenBSD pflog file"), #endif #ifdef DLT_PRISM_HEADER DLT_CHOICE(DLT_PRISM_HEADER, "802.11 plus Prism header"), #endif #ifdef DLT_IP_OVER_FC DLT_CHOICE(DLT_IP_OVER_FC, "RFC 2625 IP-over-Fibre Channel"), #endif #ifdef DLT_SUNATM DLT_CHOICE(DLT_SUNATM, "Sun raw ATM"), #endif #ifdef DLT_IEEE802_11_RADIO DLT_CHOICE(DLT_IEEE802_11_RADIO, "802.11 plus radio information header"), #endif #ifdef DLT_ARCNET_LINUX DLT_CHOICE(DLT_ARCNET_LINUX, "Linux ARCNET"), #endif #ifdef DLT_LINUX_IRDA DLT_CHOICE(DLT_LINUX_IRDA, "Linux IrDA"), #endif #ifdef DLT_LANE8023 DLT_CHOICE(DLT_LANE8023, "Linux 802.3 LANE"), #endif #ifdef DLT_CIP DLT_CHOICE(DLT_CIP, "Linux Classical IP-over-ATM"), #endif #ifdef DLT_HDLC DLT_CHOICE(DLT_HDLC, "Cisco HDLC"), #endif DLT_CHOICE_SENTINEL }; #ifndef HAVE_PCAP_DATALINK_NAME_TO_VAL int pcap_datalink_name_to_val(const char *name) { int i; for (i = 0; dlt_choices[i].name != NULL; i++) { if (strcasecmp(dlt_choices[i].name + sizeof("DLT_") - 1, name) == 0) return (dlt_choices[i].dlt); } return (-1); } const char * pcap_datalink_val_to_name(int dlt) { int i; for (i = 0; dlt_choices[i].name != NULL; i++) { if (dlt_choices[i].dlt == dlt) return (dlt_choices[i].name + sizeof("DLT_") - 1); } return (NULL); } #endif const char * pcap_datalink_val_to_description(int dlt) { int i; for (i = 0; dlt_choices[i].name != NULL; i++) { if (dlt_choices[i].dlt == dlt) return (dlt_choices[i].description); } return (NULL); } tcpdump-3.9.8/./missing/strlcpy.c0000644000026300017500000000500407755642464015025 0ustar mcrmcr/* $NetBSD: strlcpy.c,v 1.5 1999/09/20 04:39:47 lukem Exp $ */ /* from OpenBSD: strlcpy.c,v 1.4 1999/05/01 18:56:41 millert Exp */ /* * Copyright (c) 1998 Todd C. Miller * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. The name of the author may not be used to endorse or promote products * derived from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL * THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #ifndef lint static const char rcsid[] _U_ = "@(#) $Header: /tcpdump/master/tcpdump/missing/strlcpy.c,v 1.5 2003/11/16 09:36:52 guy Exp $ (LBL)"; #endif #ifdef HAVE_CONFIG_H #include #endif #include #include /* * Copy src to string dst of size siz. At most siz-1 characters * will be copied. Always NUL terminates (unless siz == 0). * Returns strlen(src); if retval >= siz, truncation occurred. */ size_t strlcpy(char *dst, const char *src, size_t siz) { register char *d = dst; register const char *s = src; register size_t n = siz; /* Copy as many bytes as will fit */ if (n != 0 && --n != 0) { do { if ((*d++ = *s++) == 0) break; } while (--n != 0); } /* Not enough room in dst, add NUL and traverse rest of src */ if (n == 0) { if (siz != 0) *d = '\0'; /* NUL-terminate dst */ while (*s++) ; } return(s - src - 1); /* count does not include NUL */ } tcpdump-3.9.8/./missing/getaddrinfo.c0000644000026300017500000006140507755642460015616 0ustar mcrmcr/* * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project. * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. Neither the name of the project nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ /* * "#ifdef FAITH" part is local hack for supporting IPv4-v6 translator. * * Issues to be discussed: * - Thread safe-ness must be checked. * - Return values. There are nonstandard return values defined and used * in the source code. This is because RFC2553 is silent about which error * code must be returned for which situation. * Note: * - We use getipnodebyname() just for thread-safeness. There's no intent * to let it do PF_UNSPEC (actually we never pass PF_UNSPEC to * getipnodebyname(). * - The code filters out AFs that are not supported by the kernel, * when globbing NULL hostname (to loopback, or wildcard). Is it the right * thing to do? What is the relationship with post-RFC2553 AI_ADDRCONFIG * in ai_flags? */ #ifdef HAVE_CONFIG_H #include #endif #ifndef lint static const char rcsid[] _U_ = "@(#) $Header: /tcpdump/master/tcpdump/missing/getaddrinfo.c,v 1.13 2003/11/16 09:36:48 guy Exp $"; #endif #include #include #if 0 #include #endif #include #include #include #include #include #include #include #include #include #include #include #include #include #include #ifndef HAVE_U_INT32_T #include "bittypes.h" #endif #ifndef HAVE_SOCKADDR_STORAGE #include "sockstorage.h" #endif #ifdef NEED_ADDRINFO_H #include "addrinfo.h" #endif #if defined(__KAME__) && defined(INET6) # define FAITH #endif #define SUCCESS 0 #define ANY 0 #define YES 1 #define NO 0 #ifdef FAITH static int translate = NO; static struct in6_addr faith_prefix = IN6ADDR_ANY_INIT; #endif static const char in_addrany[] = { 0, 0, 0, 0 }; static const char in6_addrany[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; static const char in_loopback[] = { 127, 0, 0, 1 }; static const char in6_loopback[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1 }; struct sockinet { u_char si_len; u_char si_family; u_short si_port; u_int32_t si_scope_id; }; static const struct afd { int a_af; int a_addrlen; int a_socklen; int a_off; const char *a_addrany; const char *a_loopback; int a_scoped; } afdl [] = { #ifdef INET6 {PF_INET6, sizeof(struct in6_addr), sizeof(struct sockaddr_in6), offsetof(struct sockaddr_in6, sin6_addr), in6_addrany, in6_loopback, 1}, #endif {PF_INET, sizeof(struct in_addr), sizeof(struct sockaddr_in), offsetof(struct sockaddr_in, sin_addr), in_addrany, in_loopback, 0}, {0, 0, 0, 0, NULL, NULL, 0}, }; struct explore { int e_af; int e_socktype; int e_protocol; const char *e_protostr; int e_wild; #define WILD_AF(ex) ((ex)->e_wild & 0x01) #define WILD_SOCKTYPE(ex) ((ex)->e_wild & 0x02) #define WILD_PROTOCOL(ex) ((ex)->e_wild & 0x04) }; static const struct explore explore[] = { #if 0 { PF_LOCAL, 0, ANY, ANY, NULL, 0x01 }, #endif #ifdef INET6 { PF_INET6, SOCK_DGRAM, IPPROTO_UDP, "udp", 0x07 }, { PF_INET6, SOCK_STREAM, IPPROTO_TCP, "tcp", 0x07 }, { PF_INET6, SOCK_RAW, ANY, NULL, 0x05 }, #endif { PF_INET, SOCK_DGRAM, IPPROTO_UDP, "udp", 0x07 }, { PF_INET, SOCK_STREAM, IPPROTO_TCP, "tcp", 0x07 }, { PF_INET, SOCK_RAW, ANY, NULL, 0x05 }, { -1, 0, 0, NULL, 0 }, }; #ifdef INET6 #define PTON_MAX 16 #else #define PTON_MAX 4 #endif static int str_isnumber (const char *); static int explore_fqdn (const struct addrinfo *, const char *, const char *, struct addrinfo **); static int explore_null (const struct addrinfo *, const char *, const char *, struct addrinfo **); static int explore_numeric (const struct addrinfo *, const char *, const char *, struct addrinfo **); static int explore_numeric_scope (const struct addrinfo *, const char *, const char *, struct addrinfo **); static int get_name (const char *, const struct afd *, struct addrinfo **, char *, const struct addrinfo *, const char *); static int get_canonname (const struct addrinfo *, struct addrinfo *, const char *); static struct addrinfo *get_ai (const struct addrinfo *, const struct afd *, const char *); static int get_portmatch (const struct addrinfo *, const char *); static int get_port (struct addrinfo *, const char *, int); static const struct afd *find_afd (int); static char *ai_errlist[] = { "Success", "Address family for hostname not supported", /* EAI_ADDRFAMILY */ "Temporary failure in name resolution", /* EAI_AGAIN */ "Invalid value for ai_flags", /* EAI_BADFLAGS */ "Non-recoverable failure in name resolution", /* EAI_FAIL */ "ai_family not supported", /* EAI_FAMILY */ "Memory allocation failure", /* EAI_MEMORY */ "No address associated with hostname", /* EAI_NODATA */ "hostname nor servname provided, or not known", /* EAI_NONAME */ "servname not supported for ai_socktype", /* EAI_SERVICE */ "ai_socktype not supported", /* EAI_SOCKTYPE */ "System error returned in errno", /* EAI_SYSTEM */ "Invalid value for hints", /* EAI_BADHINTS */ "Resolved protocol is unknown", /* EAI_PROTOCOL */ "Unknown error", /* EAI_MAX */ }; /* XXX macros that make external reference is BAD. */ #define GET_AI(ai, afd, addr) \ do { \ /* external reference: pai, error, and label free */ \ (ai) = get_ai(pai, (afd), (addr)); \ if ((ai) == NULL) { \ error = EAI_MEMORY; \ goto free; \ } \ } while (0) #define GET_PORT(ai, serv) \ do { \ /* external reference: error and label free */ \ error = get_port((ai), (serv), 0); \ if (error != 0) \ goto free; \ } while (0) #define GET_CANONNAME(ai, str) \ do { \ /* external reference: pai, error and label free */ \ error = get_canonname(pai, (ai), (str)); \ if (error != 0) \ goto free; \ } while (0) #define ERR(err) \ do { \ /* external reference: error, and label bad */ \ error = (err); \ goto bad; \ } while (0) #define MATCH_FAMILY(x, y, w) \ ((x) == (y) || ((w) && ((x) == PF_UNSPEC || (y) == PF_UNSPEC))) #define MATCH(x, y, w) \ ((x) == (y) || ((w) && ((x) == ANY || (y) == ANY))) char * gai_strerror(ecode) int ecode; { if (ecode < 0 || ecode > EAI_MAX) ecode = EAI_MAX; return ai_errlist[ecode]; } void freeaddrinfo(ai) struct addrinfo *ai; { struct addrinfo *next; do { next = ai->ai_next; if (ai->ai_canonname) free(ai->ai_canonname); /* no need to free(ai->ai_addr) */ free(ai); } while ((ai = next) != NULL); } static int str_isnumber(p) const char *p; { char *q = (char *)p; while (*q) { if (! isdigit(*q)) return NO; q++; } return YES; } int getaddrinfo(hostname, servname, hints, res) const char *hostname, *servname; const struct addrinfo *hints; struct addrinfo **res; { struct addrinfo sentinel; struct addrinfo *cur; int error = 0; struct addrinfo ai; struct addrinfo ai0; struct addrinfo *pai; const struct afd *afd; const struct explore *ex; #ifdef FAITH static int firsttime = 1; if (firsttime) { /* translator hack */ char *q = getenv("GAI"); if (q && inet_pton(AF_INET6, q, &faith_prefix) == 1) translate = YES; firsttime = 0; } #endif sentinel.ai_next = NULL; cur = &sentinel; pai = &ai; pai->ai_flags = 0; pai->ai_family = PF_UNSPEC; pai->ai_socktype = ANY; pai->ai_protocol = ANY; pai->ai_addrlen = 0; pai->ai_canonname = NULL; pai->ai_addr = NULL; pai->ai_next = NULL; if (hostname == NULL && servname == NULL) return EAI_NONAME; if (hints) { /* error check for hints */ if (hints->ai_addrlen || hints->ai_canonname || hints->ai_addr || hints->ai_next) ERR(EAI_BADHINTS); /* xxx */ if (hints->ai_flags & ~AI_MASK) ERR(EAI_BADFLAGS); switch (hints->ai_family) { case PF_UNSPEC: case PF_INET: #ifdef INET6 case PF_INET6: #endif break; default: ERR(EAI_FAMILY); } memcpy(pai, hints, sizeof(*pai)); /* * if both socktype/protocol are specified, check if they * are meaningful combination. */ if (pai->ai_socktype != ANY && pai->ai_protocol != ANY) { for (ex = explore; ex->e_af >= 0; ex++) { if (pai->ai_family != ex->e_af) continue; if (ex->e_socktype == ANY) continue; if (ex->e_protocol == ANY) continue; if (pai->ai_socktype == ex->e_socktype && pai->ai_protocol != ex->e_protocol) { ERR(EAI_BADHINTS); } } } } /* * check for special cases. (1) numeric servname is disallowed if * socktype/protocol are left unspecified. (2) servname is disallowed * for raw and other inet{,6} sockets. */ if (MATCH_FAMILY(pai->ai_family, PF_INET, 1) #ifdef PF_INET6 || MATCH_FAMILY(pai->ai_family, PF_INET6, 1) #endif ) { ai0 = *pai; if (pai->ai_family == PF_UNSPEC) { #ifdef PF_INET6 pai->ai_family = PF_INET6; #else pai->ai_family = PF_INET; #endif } error = get_portmatch(pai, servname); if (error) ERR(error); *pai = ai0; } ai0 = *pai; /* NULL hostname, or numeric hostname */ for (ex = explore; ex->e_af >= 0; ex++) { *pai = ai0; if (!MATCH_FAMILY(pai->ai_family, ex->e_af, WILD_AF(ex))) continue; if (!MATCH(pai->ai_socktype, ex->e_socktype, WILD_SOCKTYPE(ex))) continue; if (!MATCH(pai->ai_protocol, ex->e_protocol, WILD_PROTOCOL(ex))) continue; if (pai->ai_family == PF_UNSPEC) pai->ai_family = ex->e_af; if (pai->ai_socktype == ANY && ex->e_socktype != ANY) pai->ai_socktype = ex->e_socktype; if (pai->ai_protocol == ANY && ex->e_protocol != ANY) pai->ai_protocol = ex->e_protocol; if (hostname == NULL) error = explore_null(pai, hostname, servname, &cur->ai_next); else error = explore_numeric_scope(pai, hostname, servname, &cur->ai_next); if (error) goto free; while (cur && cur->ai_next) cur = cur->ai_next; } /* * XXX * If numreic representation of AF1 can be interpreted as FQDN * representation of AF2, we need to think again about the code below. */ if (sentinel.ai_next) goto good; if (pai->ai_flags & AI_NUMERICHOST) ERR(EAI_NONAME); if (hostname == NULL) ERR(EAI_NONAME); /* * hostname as alphabetical name. * we would like to prefer AF_INET6 than AF_INET, so we'll make a * outer loop by AFs. */ for (afd = afdl; afd->a_af; afd++) { *pai = ai0; if (!MATCH_FAMILY(pai->ai_family, afd->a_af, 1)) continue; for (ex = explore; ex->e_af >= 0; ex++) { *pai = ai0; if (pai->ai_family == PF_UNSPEC) pai->ai_family = afd->a_af; if (!MATCH_FAMILY(pai->ai_family, ex->e_af, WILD_AF(ex))) continue; if (!MATCH(pai->ai_socktype, ex->e_socktype, WILD_SOCKTYPE(ex))) { continue; } if (!MATCH(pai->ai_protocol, ex->e_protocol, WILD_PROTOCOL(ex))) { continue; } if (pai->ai_family == PF_UNSPEC) pai->ai_family = ex->e_af; if (pai->ai_socktype == ANY && ex->e_socktype != ANY) pai->ai_socktype = ex->e_socktype; if (pai->ai_protocol == ANY && ex->e_protocol != ANY) pai->ai_protocol = ex->e_protocol; error = explore_fqdn(pai, hostname, servname, &cur->ai_next); while (cur && cur->ai_next) cur = cur->ai_next; } } /* XXX */ if (sentinel.ai_next) error = 0; if (error) goto free; if (error == 0) { if (sentinel.ai_next) { good: *res = sentinel.ai_next; return SUCCESS; } else error = EAI_FAIL; } free: bad: if (sentinel.ai_next) freeaddrinfo(sentinel.ai_next); *res = NULL; return error; } /* * FQDN hostname, DNS lookup */ static int explore_fqdn(pai, hostname, servname, res) const struct addrinfo *pai; const char *hostname; const char *servname; struct addrinfo **res; { struct hostent *hp; int h_error; int af; char **aplist = NULL, *apbuf = NULL; char *ap; struct addrinfo sentinel, *cur; int i; #ifndef USE_GETIPNODEBY int naddrs; #endif const struct afd *afd; int error; *res = NULL; sentinel.ai_next = NULL; cur = &sentinel; /* * Do not filter unsupported AFs here. We need to honor content of * databases (/etc/hosts, DNS and others). Otherwise we cannot * replace gethostbyname() by getaddrinfo(). */ /* * if the servname does not match socktype/protocol, ignore it. */ if (get_portmatch(pai, servname) != 0) return 0; afd = find_afd(pai->ai_family); /* * post-RFC2553: should look at (pai->ai_flags & AI_ADDRCONFIG) * rather than hardcoding it. we may need to add AI_ADDRCONFIG * handling code by ourselves in case we don't have getipnodebyname(). */ #ifdef USE_GETIPNODEBY hp = getipnodebyname(hostname, pai->ai_family, AI_ADDRCONFIG, &h_error); #else #ifdef HAVE_GETHOSTBYNAME2 hp = gethostbyname2(hostname, pai->ai_family); #else if (pai->ai_family != AF_INET) return 0; hp = gethostbyname(hostname); #ifdef HAVE_H_ERRNO h_error = h_errno; #else h_error = EINVAL; #endif #endif /*HAVE_GETHOSTBYNAME2*/ #endif /*USE_GETIPNODEBY*/ if (hp == NULL) { switch (h_error) { case HOST_NOT_FOUND: case NO_DATA: error = EAI_NODATA; break; case TRY_AGAIN: error = EAI_AGAIN; break; case NO_RECOVERY: case NETDB_INTERNAL: default: error = EAI_FAIL; break; } } else if ((hp->h_name == NULL) || (hp->h_name[0] == 0) || (hp->h_addr_list[0] == NULL)) { #ifdef USE_GETIPNODEBY freehostent(hp); #endif hp = NULL; error = EAI_FAIL; } if (hp == NULL) goto free; #ifdef USE_GETIPNODEBY aplist = hp->h_addr_list; #else /* * hp will be overwritten if we use gethostbyname2(). * always deep copy for simplification. */ for (naddrs = 0; hp->h_addr_list[naddrs] != NULL; naddrs++) ; naddrs++; aplist = (char **)malloc(sizeof(aplist[0]) * naddrs); apbuf = (char *)malloc(hp->h_length * naddrs); if (aplist == NULL || apbuf == NULL) { error = EAI_MEMORY; goto free; } memset(aplist, 0, sizeof(aplist[0]) * naddrs); for (i = 0; i < naddrs; i++) { if (hp->h_addr_list[i] == NULL) { aplist[i] = NULL; continue; } memcpy(&apbuf[i * hp->h_length], hp->h_addr_list[i], hp->h_length); aplist[i] = &apbuf[i * hp->h_length]; } #endif for (i = 0; aplist[i] != NULL; i++) { af = hp->h_addrtype; ap = aplist[i]; #ifdef AF_INET6 if (af == AF_INET6 && IN6_IS_ADDR_V4MAPPED((struct in6_addr *)ap)) { af = AF_INET; ap = ap + sizeof(struct in6_addr) - sizeof(struct in_addr); } #endif if (af != pai->ai_family) continue; if ((pai->ai_flags & AI_CANONNAME) == 0) { GET_AI(cur->ai_next, afd, ap); GET_PORT(cur->ai_next, servname); } else { /* * if AI_CANONNAME and if reverse lookup * fail, return ai anyway to pacify * calling application. * * XXX getaddrinfo() is a name->address * translation function, and it looks * strange that we do addr->name * translation here. */ get_name(ap, afd, &cur->ai_next, ap, pai, servname); } while (cur && cur->ai_next) cur = cur->ai_next; } *res = sentinel.ai_next; return 0; free: #ifdef USE_GETIPNODEBY if (hp) freehostent(hp); #endif if (aplist) free(aplist); if (apbuf) free(apbuf); if (sentinel.ai_next) freeaddrinfo(sentinel.ai_next); return error; } /* * hostname == NULL. * passive socket -> anyaddr (0.0.0.0 or ::) * non-passive socket -> localhost (127.0.0.1 or ::1) */ static int explore_null(pai, hostname, servname, res) const struct addrinfo *pai; const char *hostname; const char *servname; struct addrinfo **res; { int s; const struct afd *afd; struct addrinfo *cur; struct addrinfo sentinel; int error; *res = NULL; sentinel.ai_next = NULL; cur = &sentinel; /* * filter out AFs that are not supported by the kernel * XXX errno? */ s = socket(pai->ai_family, SOCK_DGRAM, 0); if (s < 0) { if (errno != EMFILE) return 0; } else close(s); /* * if the servname does not match socktype/protocol, ignore it. */ if (get_portmatch(pai, servname) != 0) return 0; afd = find_afd(pai->ai_family); if (pai->ai_flags & AI_PASSIVE) { GET_AI(cur->ai_next, afd, afd->a_addrany); /* xxx meaningless? * GET_CANONNAME(cur->ai_next, "anyaddr"); */ GET_PORT(cur->ai_next, servname); } else { GET_AI(cur->ai_next, afd, afd->a_loopback); /* xxx meaningless? * GET_CANONNAME(cur->ai_next, "localhost"); */ GET_PORT(cur->ai_next, servname); } cur = cur->ai_next; *res = sentinel.ai_next; return 0; free: if (sentinel.ai_next) freeaddrinfo(sentinel.ai_next); return error; } /* * numeric hostname */ static int explore_numeric(pai, hostname, servname, res) const struct addrinfo *pai; const char *hostname; const char *servname; struct addrinfo **res; { const struct afd *afd; struct addrinfo *cur; struct addrinfo sentinel; int error; char pton[PTON_MAX]; int flags; *res = NULL; sentinel.ai_next = NULL; cur = &sentinel; /* * if the servname does not match socktype/protocol, ignore it. */ if (get_portmatch(pai, servname) != 0) return 0; afd = find_afd(pai->ai_family); flags = pai->ai_flags; if (inet_pton(afd->a_af, hostname, pton) == 1) { u_int32_t v4a; #ifdef INET6 u_char pfx; #endif switch (afd->a_af) { case AF_INET: v4a = (u_int32_t)ntohl(((struct in_addr *)pton)->s_addr); if (IN_MULTICAST(v4a) || IN_EXPERIMENTAL(v4a)) flags &= ~AI_CANONNAME; v4a >>= IN_CLASSA_NSHIFT; if (v4a == 0 || v4a == IN_LOOPBACKNET) flags &= ~AI_CANONNAME; break; #ifdef INET6 case AF_INET6: pfx = ((struct in6_addr *)pton)->s6_addr[0]; if (pfx == 0 || pfx == 0xfe || pfx == 0xff) flags &= ~AI_CANONNAME; break; #endif } if (pai->ai_family == afd->a_af || pai->ai_family == PF_UNSPEC /*?*/) { if ((flags & AI_CANONNAME) == 0) { GET_AI(cur->ai_next, afd, pton); GET_PORT(cur->ai_next, servname); } else { /* * if AI_CANONNAME and if reverse lookup * fail, return ai anyway to pacify * calling application. * * XXX getaddrinfo() is a name->address * translation function, and it looks * strange that we do addr->name * translation here. */ get_name(pton, afd, &cur->ai_next, pton, pai, servname); } while (cur && cur->ai_next) cur = cur->ai_next; } else ERR(EAI_FAMILY); /*xxx*/ } *res = sentinel.ai_next; return 0; free: bad: if (sentinel.ai_next) freeaddrinfo(sentinel.ai_next); return error; } /* * numeric hostname with scope */ static int explore_numeric_scope(pai, hostname, servname, res) const struct addrinfo *pai; const char *hostname; const char *servname; struct addrinfo **res; { #ifndef SCOPE_DELIMITER return explore_numeric(pai, hostname, servname, res); #else const struct afd *afd; struct addrinfo *cur; int error; char *cp, *hostname2 = NULL; int scope; struct sockaddr_in6 *sin6; /* * if the servname does not match socktype/protocol, ignore it. */ if (get_portmatch(pai, servname) != 0) return 0; afd = find_afd(pai->ai_family); if (!afd->a_scoped) return explore_numeric(pai, hostname, servname, res); cp = strchr(hostname, SCOPE_DELIMITER); if (cp == NULL) return explore_numeric(pai, hostname, servname, res); /* * Handle special case of */ hostname2 = strdup(hostname); if (hostname2 == NULL) return EAI_MEMORY; /* terminate at the delimiter */ hostname2[cp - hostname] = '\0'; cp++; switch (pai->ai_family) { #ifdef INET6 case AF_INET6: scope = if_nametoindex(cp); if (scope == 0) { free(hostname2); return (EAI_NONAME); } break; #endif } error = explore_numeric(pai, hostname2, servname, res); if (error == 0) { for (cur = *res; cur; cur = cur->ai_next) { if (cur->ai_family != AF_INET6) continue; sin6 = (struct sockaddr_in6 *)cur->ai_addr; if (IN6_IS_ADDR_LINKLOCAL(&sin6->sin6_addr) || IN6_IS_ADDR_MC_LINKLOCAL(&sin6->sin6_addr)) sin6->sin6_scope_id = scope; } } free(hostname2); return error; #endif } static int get_name(addr, afd, res, numaddr, pai, servname) const char *addr; const struct afd *afd; struct addrinfo **res; char *numaddr; const struct addrinfo *pai; const char *servname; { struct hostent *hp = NULL; struct addrinfo *cur = NULL; int error = 0; char *ap = NULL, *cn = NULL; #ifdef USE_GETIPNODEBY int h_error; hp = getipnodebyaddr(addr, afd->a_addrlen, afd->a_af, &h_error); #else hp = gethostbyaddr(addr, afd->a_addrlen, afd->a_af); #endif if (hp && hp->h_name && hp->h_name[0] && hp->h_addr_list[0]) { #ifdef USE_GETIPNODEBY GET_AI(cur, afd, hp->h_addr_list[0]); GET_PORT(cur, servname); GET_CANONNAME(cur, hp->h_name); #else /* hp will be damaged if we use gethostbyaddr() */ if ((ap = (char *)malloc(hp->h_length)) == NULL) { error = EAI_MEMORY; goto free; } memcpy(ap, hp->h_addr_list[0], hp->h_length); if ((cn = strdup(hp->h_name)) == NULL) { error = EAI_MEMORY; goto free; } GET_AI(cur, afd, ap); GET_PORT(cur, servname); GET_CANONNAME(cur, cn); free(ap); ap = NULL; free(cn); cn = NULL; #endif } else { GET_AI(cur, afd, numaddr); GET_PORT(cur, servname); } #ifdef USE_GETIPNODEBY if (hp) freehostent(hp); #endif *res = cur; return SUCCESS; free: if (cur) freeaddrinfo(cur); if (ap) free(ap); if (cn) free(cn); #ifdef USE_GETIPNODEBY if (hp) freehostent(hp); #endif *res = NULL; return error; } static int get_canonname(pai, ai, str) const struct addrinfo *pai; struct addrinfo *ai; const char *str; { if ((pai->ai_flags & AI_CANONNAME) != 0) { ai->ai_canonname = (char *)malloc(strlen(str) + 1); if (ai->ai_canonname == NULL) return EAI_MEMORY; strcpy(ai->ai_canonname, str); } return 0; } static struct addrinfo * get_ai(pai, afd, addr) const struct addrinfo *pai; const struct afd *afd; const char *addr; { char *p; struct addrinfo *ai; ai = (struct addrinfo *)malloc(sizeof(struct addrinfo) + (afd->a_socklen)); if (ai == NULL) return NULL; memcpy(ai, pai, sizeof(struct addrinfo)); ai->ai_addr = (struct sockaddr *)(ai + 1); memset(ai->ai_addr, 0, afd->a_socklen); #ifdef HAVE_SOCKADDR_SA_LEN ai->ai_addr->sa_len = afd->a_socklen; #endif ai->ai_addrlen = afd->a_socklen; ai->ai_addr->sa_family = ai->ai_family = afd->a_af; p = (char *)(ai->ai_addr); memcpy(p + afd->a_off, addr, afd->a_addrlen); return ai; } static int get_portmatch(ai, servname) const struct addrinfo *ai; const char *servname; { /* get_port does not touch first argument. when matchonly == 1. */ return get_port((struct addrinfo *)ai, servname, 1); } static int get_port(ai, servname, matchonly) struct addrinfo *ai; const char *servname; int matchonly; { const char *proto; struct servent *sp; int port; int allownumeric; if (servname == NULL) return 0; switch (ai->ai_family) { case AF_INET: #ifdef AF_INET6 case AF_INET6: #endif break; default: return 0; } switch (ai->ai_socktype) { case SOCK_RAW: return EAI_SERVICE; case SOCK_DGRAM: case SOCK_STREAM: allownumeric = 1; break; case ANY: allownumeric = 0; break; default: return EAI_SOCKTYPE; } if (str_isnumber(servname)) { if (!allownumeric) return EAI_SERVICE; port = htons(atoi(servname)); if (port < 0 || port > 65535) return EAI_SERVICE; } else { switch (ai->ai_socktype) { case SOCK_DGRAM: proto = "udp"; break; case SOCK_STREAM: proto = "tcp"; break; default: proto = NULL; break; } if ((sp = getservbyname(servname, proto)) == NULL) return EAI_SERVICE; port = sp->s_port; } if (!matchonly) { switch (ai->ai_family) { case AF_INET: ((struct sockaddr_in *)ai->ai_addr)->sin_port = port; break; #ifdef INET6 case AF_INET6: ((struct sockaddr_in6 *)ai->ai_addr)->sin6_port = port; break; #endif } } return 0; } static const struct afd * find_afd(af) int af; { const struct afd *afd; if (af == PF_UNSPEC) return NULL; for (afd = afdl; afd->a_af; afd++) { if (afd->a_af == af) return afd; } return NULL; } tcpdump-3.9.8/./missing/inet_ntop.c0000644000026300017500000001342110202272252015275 0ustar mcrmcr/* * Copyright (c) 1999 Kungliga Tekniska Högskolan * (Royal Institute of Technology, Stockholm, Sweden). * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * 3. All advertising materials mentioning features or use of this software * must display the following acknowledgement: * This product includes software developed by the Kungliga Tekniska * Högskolan and its contributors. * * 4. Neither the name of the Institute nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ /* $Id: inet_ntop.c,v 1.8 2005/02/09 02:25:46 guy Exp $ */ #ifndef lint static const char rcsid[] _U_ = "@(#) $Header: /tcpdump/master/tcpdump/missing/inet_ntop.c,v 1.8 2005/02/09 02:25:46 guy Exp $"; #endif #include #include #include /* * */ #ifndef IN6ADDRSZ #define IN6ADDRSZ 16 /* IPv6 T_AAAA */ #endif #ifndef INT16SZ #define INT16SZ 2 /* word size */ #endif static const char * inet_ntop_v4 (const void *src, char *dst, size_t size) { const char digits[] = "0123456789"; int i; struct in_addr *addr = (struct in_addr *)src; u_long a = ntohl(addr->s_addr); const char *orig_dst = dst; if (size < INET_ADDRSTRLEN) { errno = ENOSPC; return NULL; } for (i = 0; i < 4; ++i) { int n = (a >> (24 - i * 8)) & 0xFF; int non_zerop = 0; if (non_zerop || n / 100 > 0) { *dst++ = digits[n / 100]; n %= 100; non_zerop = 1; } if (non_zerop || n / 10 > 0) { *dst++ = digits[n / 10]; n %= 10; non_zerop = 1; } *dst++ = digits[n]; if (i != 3) *dst++ = '.'; } *dst++ = '\0'; return orig_dst; } #ifdef INET6 /* * Convert IPv6 binary address into presentation (printable) format. */ static const char * inet_ntop_v6 (const u_char *src, char *dst, size_t size) { /* * Note that int32_t and int16_t need only be "at least" large enough * to contain a value of the specified size. On some systems, like * Crays, there is no such thing as an integer variable with 16 bits. * Keep this in mind if you think this function should have been coded * to use pointer overlays. All the world's not a VAX. */ char tmp [INET6_ADDRSTRLEN+1]; char *tp; struct { long base; long len; } best, cur; u_long words [IN6ADDRSZ / INT16SZ]; int i; /* Preprocess: * Copy the input (bytewise) array into a wordwise array. * Find the longest run of 0x00's in src[] for :: shorthanding. */ memset (words, 0, sizeof(words)); for (i = 0; i < IN6ADDRSZ; i++) words[i/2] |= (src[i] << ((1 - (i % 2)) << 3)); best.base = -1; cur.base = -1; for (i = 0; i < (IN6ADDRSZ / INT16SZ); i++) { if (words[i] == 0) { if (cur.base == -1) cur.base = i, cur.len = 1; else cur.len++; } else if (cur.base != -1) { if (best.base == -1 || cur.len > best.len) best = cur; cur.base = -1; } } if ((cur.base != -1) && (best.base == -1 || cur.len > best.len)) best = cur; if (best.base != -1 && best.len < 2) best.base = -1; /* Format the result. */ tp = tmp; for (i = 0; i < (IN6ADDRSZ / INT16SZ); i++) { /* Are we inside the best run of 0x00's? */ if (best.base != -1 && i >= best.base && i < (best.base + best.len)) { if (i == best.base) *tp++ = ':'; continue; } /* Are we following an initial run of 0x00s or any real hex? */ if (i != 0) *tp++ = ':'; /* Is this address an encapsulated IPv4? */ if (i == 6 && best.base == 0 && (best.len == 6 || (best.len == 5 && words[5] == 0xffff))) { if (!inet_ntop_v4(src+12, tp, sizeof(tmp) - (tp - tmp))) { errno = ENOSPC; return (NULL); } tp += strlen(tp); break; } tp += sprintf (tp, "%lX", words[i]); } /* Was it a trailing run of 0x00's? */ if (best.base != -1 && (best.base + best.len) == (IN6ADDRSZ / INT16SZ)) *tp++ = ':'; *tp++ = '\0'; /* Check for overflow, copy, and we're done. */ if ((size_t)(tp - tmp) > size) { errno = ENOSPC; return (NULL); } return strcpy (dst, tmp); return (NULL); } #endif /* INET6 */ const char * inet_ntop(int af, const void *src, char *dst, size_t size) { switch (af) { case AF_INET : return inet_ntop_v4 (src, dst, size); #ifdef INET6 case AF_INET6: return inet_ntop_v6 ((const u_char*)src, dst, size); #endif default : errno = EAFNOSUPPORT; return NULL; } } tcpdump-3.9.8/./missing/strdup.c0000644000026300017500000000441007232236620014625 0ustar mcrmcr/* * Copyright (c) 1988, 1993 * The Regents of the University of California. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. All advertising materials mentioning features or use of this software * must display the following acknowledgement: * This product includes software developed by the University of * California, Berkeley and its contributors. * 4. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ #if defined(LIBC_SCCS) && !defined(lint) static const char rcsid[] = "@(#) $Header: /tcpdump/master/tcpdump/missing/strdup.c,v 1.1 2001/01/20 07:26:08 guy Exp $ (LBL)"; #endif /* LIBC_SCCS and not lint */ #include #include #include #include "interface.h" char * strdup(str) const char *str; { size_t len; char *copy; len = strlen(str) + 1; if ((copy = malloc(len)) == NULL) return (NULL); memcpy(copy, str, len); return (copy); } tcpdump-3.9.8/./missing/inet_pton.c0000644000026300017500000000437207755642463015332 0ustar mcrmcr/* * Copyright (c) 1999 Kungliga Tekniska Högskolan * (Royal Institute of Technology, Stockholm, Sweden). * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * 3. All advertising materials mentioning features or use of this software * must display the following acknowledgement: * This product includes software developed by the Kungliga Tekniska * Högskolan and its contributors. * * 4. Neither the name of the Institute nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ /* $Id: inet_pton.c,v 1.6 2003/11/16 09:36:51 guy Exp $ */ #ifndef lint static const char rcsid[] _U_ = "@(#) $Header: /tcpdump/master/tcpdump/missing/inet_pton.c,v 1.6 2003/11/16 09:36:51 guy Exp $"; #endif #include #include int inet_pton(int af, const char *src, void *dst) { if (af != AF_INET) { errno = EAFNOSUPPORT; return -1; } return inet_aton (src, dst); } tcpdump-3.9.8/./missing/resolv6.h0000644000026300017500000000335507501427702014722 0ustar mcrmcr/* * Copyright (C) 1999 WIDE Project. * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. Neither the name of the project nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ /* * Resolver options for IPv6. * XXX: this should be in an offical include file. There may be conflicts... */ #ifndef HAVE_RES_USE_INET6 #define RES_USE_INET6 0x80000000 /* use/map IPv6 in gethostbyname() */ #endif tcpdump-3.9.8/./ieee802_11_radio.h0000644000026300017500000002037510504040014014452 0ustar mcrmcr/* $FreeBSD: src/sys/net80211/ieee80211_radiotap.h,v 1.5 2005/01/22 20:12:05 sam Exp $ */ /* $NetBSD: ieee802_11_radio.h,v 1.2 2006/02/26 03:04:03 dyoung Exp $ */ /* $Header: /tcpdump/master/tcpdump/ieee802_11_radio.h,v 1.1.2.1 2006/06/13 22:24:45 guy Exp $ */ /*- * Copyright (c) 2003, 2004 David Young. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. The name of David Young may not be used to endorse or promote * products derived from this software without specific prior * written permission. * * THIS SOFTWARE IS PROVIDED BY DAVID YOUNG ``AS IS'' AND ANY * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL DAVID * YOUNG BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY * OF SUCH DAMAGE. */ #ifndef _NET_IF_IEEE80211RADIOTAP_H_ #define _NET_IF_IEEE80211RADIOTAP_H_ /* A generic radio capture format is desirable. There is one for * Linux, but it is neither rigidly defined (there were not even * units given for some fields) nor easily extensible. * * I suggest the following extensible radio capture format. It is * based on a bitmap indicating which fields are present. * * I am trying to describe precisely what the application programmer * should expect in the following, and for that reason I tell the * units and origin of each measurement (where it applies), or else I * use sufficiently weaselly language ("is a monotonically nondecreasing * function of...") that I cannot set false expectations for lawyerly * readers. */ #if defined(__KERNEL__) || defined(_KERNEL) #ifndef DLT_IEEE802_11_RADIO #define DLT_IEEE802_11_RADIO 127 /* 802.11 plus WLAN header */ #endif #endif /* defined(__KERNEL__) || defined(_KERNEL) */ /* The radio capture header precedes the 802.11 header. */ struct ieee80211_radiotap_header { u_int8_t it_version; /* Version 0. Only increases * for drastic changes, * introduction of compatible * new fields does not count. */ u_int8_t it_pad; u_int16_t it_len; /* length of the whole * header in bytes, including * it_version, it_pad, * it_len, and data fields. */ u_int32_t it_present; /* A bitmap telling which * fields are present. Set bit 31 * (0x80000000) to extend the * bitmap by another 32 bits. * Additional extensions are made * by setting bit 31. */ } __attribute__((__packed__)); /* Name Data type Units * ---- --------- ----- * * IEEE80211_RADIOTAP_TSFT u_int64_t microseconds * * Value in microseconds of the MAC's 64-bit 802.11 Time * Synchronization Function timer when the first bit of the * MPDU arrived at the MAC. For received frames, only. * * IEEE80211_RADIOTAP_CHANNEL 2 x u_int16_t MHz, bitmap * * Tx/Rx frequency in MHz, followed by flags (see below). * * IEEE80211_RADIOTAP_FHSS u_int16_t see below * * For frequency-hopping radios, the hop set (first byte) * and pattern (second byte). * * IEEE80211_RADIOTAP_RATE u_int8_t 500kb/s * * Tx/Rx data rate * * IEEE80211_RADIOTAP_DBM_ANTSIGNAL int8_t decibels from * one milliwatt (dBm) * * RF signal power at the antenna, decibel difference from * one milliwatt. * * IEEE80211_RADIOTAP_DBM_ANTNOISE int8_t decibels from * one milliwatt (dBm) * * RF noise power at the antenna, decibel difference from one * milliwatt. * * IEEE80211_RADIOTAP_DB_ANTSIGNAL u_int8_t decibel (dB) * * RF signal power at the antenna, decibel difference from an * arbitrary, fixed reference. * * IEEE80211_RADIOTAP_DB_ANTNOISE u_int8_t decibel (dB) * * RF noise power at the antenna, decibel difference from an * arbitrary, fixed reference point. * * IEEE80211_RADIOTAP_LOCK_QUALITY u_int16_t unitless * * Quality of Barker code lock. Unitless. Monotonically * nondecreasing with "better" lock strength. Called "Signal * Quality" in datasheets. (Is there a standard way to measure * this?) * * IEEE80211_RADIOTAP_TX_ATTENUATION u_int16_t unitless * * Transmit power expressed as unitless distance from max * power set at factory calibration. 0 is max power. * Monotonically nondecreasing with lower power levels. * * IEEE80211_RADIOTAP_DB_TX_ATTENUATION u_int16_t decibels (dB) * * Transmit power expressed as decibel distance from max power * set at factory calibration. 0 is max power. Monotonically * nondecreasing with lower power levels. * * IEEE80211_RADIOTAP_DBM_TX_POWER int8_t decibels from * one milliwatt (dBm) * * Transmit power expressed as dBm (decibels from a 1 milliwatt * reference). This is the absolute power level measured at * the antenna port. * * IEEE80211_RADIOTAP_FLAGS u_int8_t bitmap * * Properties of transmitted and received frames. See flags * defined below. * * IEEE80211_RADIOTAP_ANTENNA u_int8_t antenna index * * Unitless indication of the Rx/Tx antenna for this packet. * The first antenna is antenna 0. * * IEEE80211_RADIOTAP_FCS u_int32_t data * * FCS from frame in network byte order. */ enum ieee80211_radiotap_type { IEEE80211_RADIOTAP_TSFT = 0, IEEE80211_RADIOTAP_FLAGS = 1, IEEE80211_RADIOTAP_RATE = 2, IEEE80211_RADIOTAP_CHANNEL = 3, IEEE80211_RADIOTAP_FHSS = 4, IEEE80211_RADIOTAP_DBM_ANTSIGNAL = 5, IEEE80211_RADIOTAP_DBM_ANTNOISE = 6, IEEE80211_RADIOTAP_LOCK_QUALITY = 7, IEEE80211_RADIOTAP_TX_ATTENUATION = 8, IEEE80211_RADIOTAP_DB_TX_ATTENUATION = 9, IEEE80211_RADIOTAP_DBM_TX_POWER = 10, IEEE80211_RADIOTAP_ANTENNA = 11, IEEE80211_RADIOTAP_DB_ANTSIGNAL = 12, IEEE80211_RADIOTAP_DB_ANTNOISE = 13, IEEE80211_RADIOTAP_EXT = 31 }; #ifndef _KERNEL /* Channel flags. */ #define IEEE80211_CHAN_TURBO 0x0010 /* Turbo channel */ #define IEEE80211_CHAN_CCK 0x0020 /* CCK channel */ #define IEEE80211_CHAN_OFDM 0x0040 /* OFDM channel */ #define IEEE80211_CHAN_2GHZ 0x0080 /* 2 GHz spectrum channel. */ #define IEEE80211_CHAN_5GHZ 0x0100 /* 5 GHz spectrum channel */ #define IEEE80211_CHAN_PASSIVE 0x0200 /* Only passive scan allowed */ #define IEEE80211_CHAN_DYN 0x0400 /* Dynamic CCK-OFDM channel */ #define IEEE80211_CHAN_GFSK 0x0800 /* GFSK channel (FHSS PHY) */ #endif /* !_KERNEL */ /* For IEEE80211_RADIOTAP_FLAGS */ #define IEEE80211_RADIOTAP_F_CFP 0x01 /* sent/received * during CFP */ #define IEEE80211_RADIOTAP_F_SHORTPRE 0x02 /* sent/received * with short * preamble */ #define IEEE80211_RADIOTAP_F_WEP 0x04 /* sent/received * with WEP encryption */ #define IEEE80211_RADIOTAP_F_FRAG 0x08 /* sent/received * with fragmentation */ #define IEEE80211_RADIOTAP_F_FCS 0x10 /* frame includes FCS */ #define IEEE80211_RADIOTAP_F_DATAPAD 0x20 /* frame has padding between * 802.11 header and payload * (to 32-bit boundary) */ #define IEEE80211_RADIOTAP_F_BADFCS 0x40 /* does not pass FCS check */ #endif /* _NET_IF_IEEE80211RADIOTAP_H_ */ tcpdump-3.9.8/./mib.h0000644000026300017500000006451407002440607012417 0ustar mcrmcr/* * This file was generated by tcpdump/makemib on Wed Sep 26 12:12:31 EDT 1990 * You probably don't want to edit this by hand! * * struct mib somename = { desc, oid-octet, type, child-pointer, next-pointer }; */ /* parse problem: new name "mib" for mgmt.mib(1) ignored */ /* parse problem: no parent for 0.nullSpecific(0) */ struct obj _proteon_obj = { "proteon", 1, 0, NULL, NULL }, _ibm_obj = { "ibm", 2, 0, NULL, &_proteon_obj }, _cmu_obj = { "cmu", 3, 0, NULL, &_ibm_obj }, _unix_obj = { "unix", 4, 0, NULL, &_cmu_obj }, _acc_obj = { "acc", 5, 0, NULL, &_unix_obj }, _twg_obj = { "twg", 6, 0, NULL, &_acc_obj }, _cayman_obj = { "cayman", 7, 0, NULL, &_twg_obj }, _nysernet_obj = { "nysernet", 8, 0, NULL, &_cayman_obj }, _cisco_obj = { "cisco", 9, 0, NULL, &_nysernet_obj }, _nsc_obj = { "nsc", 10, 0, NULL, &_cisco_obj }, _hp_obj = { "hp", 11, 0, NULL, &_nsc_obj }, _epilogue_obj = { "epilogue", 12, 0, NULL, &_hp_obj }, _utennessee_obj = { "utennessee", 13, 0, NULL, &_epilogue_obj }, _bbn_obj = { "bbn", 14, 0, NULL, &_utennessee_obj }, _xylogics_obj = { "xylogics", 15, 0, NULL, &_bbn_obj }, _unisys_obj = { "unisys", 16, 0, NULL, &_xylogics_obj }, _canstar_obj = { "canstar", 17, 0, NULL, &_unisys_obj }, _wellfleet_obj = { "wellfleet", 18, 0, NULL, &_canstar_obj }, _trw_obj = { "trw", 19, 0, NULL, &_wellfleet_obj }, _mit_obj = { "mit", 20, 0, NULL, &_trw_obj }, _eon_obj = { "eon", 21, 0, NULL, &_mit_obj }, _spartacus_obj = { "spartacus", 22, 0, NULL, &_eon_obj }, _excelan_obj = { "excelan", 23, 0, NULL, &_spartacus_obj }, _spider_obj = { "spider", 24, 0, NULL, &_excelan_obj }, _nsfnet_obj = { "nsfnet", 25, 0, NULL, &_spider_obj }, _sytek_obj = { "sytek", 26, 0, NULL, &_nsfnet_obj }, _intergraph_obj = { "intergraph", 27, 0, NULL, &_sytek_obj }, _interlan_obj = { "interlan", 28, 0, NULL, &_intergraph_obj }, _vitalink_obj = { "vitalink", 29, 0, NULL, &_interlan_obj }, _ulana_obj = { "ulana", 30, 0, NULL, &_vitalink_obj }, _nswc_obj = { "nswc", 31, 0, NULL, &_ulana_obj }, _santacruzoperation_obj = { "santacruzoperation", 32, 0, NULL, &_nswc_obj }, _xyplex_obj = { "xyplex", 33, 0, NULL, &_santacruzoperation_obj }, _cray_obj = { "cray", 34, 0, NULL, &_xyplex_obj }, _bellnorthernresearch_obj = { "bellnorthernresearch", 35, 0, NULL, &_cray_obj }, _dec_obj = { "dec", 36, 0, NULL, &_bellnorthernresearch_obj }, _touch_obj = { "touch", 37, 0, NULL, &_dec_obj }, _networkresearchcorp_obj = { "networkresearchcorp", 38, 0, NULL, &_touch_obj }, _baylor_obj = { "baylor", 39, 0, NULL, &_networkresearchcorp_obj }, _nmfeccllnl_obj = { "nmfeccllnl", 40, 0, NULL, &_baylor_obj }, _sri_obj = { "sri", 41, 0, NULL, &_nmfeccllnl_obj }, _sun_obj = { "sun", 42, 0, NULL, &_sri_obj }, _3com_obj = { "3com", 43, 0, NULL, &_sun_obj }, _cmc_obj = { "cmc", 44, 0, NULL, &_3com_obj }, _synoptics_obj = { "synoptics", 45, 0, NULL, &_cmc_obj }, _cheyenne_obj = { "cheyenne", 46, 0, NULL, &_synoptics_obj }, _prime_obj = { "prime", 47, 0, NULL, &_cheyenne_obj }, _mcnc_obj = { "mcnc", 48, 0, NULL, &_prime_obj }, _chipcom_obj = { "chipcom", 49, 0, NULL, &_mcnc_obj }, _opticaldatasystems_obj = { "opticaldatasystems", 50, 0, NULL, &_chipcom_obj }, _gated_obj = { "gated", 51, 0, NULL, &_opticaldatasystems_obj }, _cabletron_obj = { "cabletron", 52, 0, NULL, &_gated_obj }, _apollo_obj = { "apollo", 53, 0, NULL, &_cabletron_obj }, _desktalksystems_obj = { "desktalksystems", 54, 0, NULL, &_apollo_obj }, _ssds_obj = { "ssds", 55, 0, NULL, &_desktalksystems_obj }, _castlerock_obj = { "castlerock", 56, 0, NULL, &_ssds_obj }, _mips_obj = { "mips", 57, 0, NULL, &_castlerock_obj }, _tgv_obj = { "tgv", 58, 0, NULL, &_mips_obj }, _silicongraphics_obj = { "silicongraphics", 59, 0, NULL, &_tgv_obj }, _ubc_obj = { "ubc", 60, 0, NULL, &_silicongraphics_obj }, _merit_obj = { "merit", 61, 0, NULL, &_ubc_obj }, _fibercom_obj = { "fibercom", 62, 0, NULL, &_merit_obj }, _apple_obj = { "apple", 63, 0, NULL, &_fibercom_obj }, _gandalf_obj = { "gandalf", 64, 0, NULL, &_apple_obj }, _dartmouth_obj = { "dartmouth", 65, 0, NULL, &_gandalf_obj }, _davidsystems_obj = { "davidsystems", 66, 0, NULL, &_dartmouth_obj }, _reuter_obj = { "reuter", 67, 0, NULL, &_davidsystems_obj }, _cornell_obj = { "cornell", 68, 0, NULL, &_reuter_obj }, _tmac_obj = { "tmac", 69, 0, NULL, &_cornell_obj }, _locus_obj = { "locus", 70, 0, NULL, &_tmac_obj }, _nasa_obj = { "nasa", 71, 0, NULL, &_locus_obj }, _retix_obj = { "retix", 72, 0, NULL, &_nasa_obj }, _boeing_obj = { "boeing", 73, 0, NULL, &_retix_obj }, _att_obj = { "att", 74, 0, NULL, &_boeing_obj }, _ungermannbass_obj = { "ungermannbass", 75, 0, NULL, &_att_obj }, _digitalanalysis_obj = { "digitalanalysis", 76, 0, NULL, &_ungermannbass_obj }, _hplanman_obj = { "hplanman", 77, 0, NULL, &_digitalanalysis_obj }, _netlabs_obj = { "netlabs", 78, 0, NULL, &_hplanman_obj }, _icl_obj = { "icl", 79, 0, NULL, &_netlabs_obj }, _auspex_obj = { "auspex", 80, 0, NULL, &_icl_obj }, _lannet_obj = { "lannet", 81, 0, NULL, &_auspex_obj }, _ncd_obj = { "ncd", 82, 0, NULL, &_lannet_obj }, _raycom_obj = { "raycom", 83, 0, NULL, &_ncd_obj }, _pirellifocom_obj = { "pirellifocom", 84, 0, NULL, &_raycom_obj }, _datability_obj = { "datability", 85, 0, NULL, &_pirellifocom_obj }, _networkappltech_obj = { "networkappltech", 86, 0, NULL, &_datability_obj }, _link_obj = { "link", 87, 0, NULL, &_networkappltech_obj }, _nyu_obj = { "nyu", 88, 0, NULL, &_link_obj }, _rnd_obj = { "rnd", 89, 0, NULL, &_nyu_obj }, _intercon_obj = { "intercon", 90, 0, NULL, &_rnd_obj }, _learningtree_obj = { "learningtree", 91, 0, NULL, &_intercon_obj }, _webstercomputer_obj = { "webstercomputer", 92, 0, NULL, &_learningtree_obj }, _frontier_obj = { "frontier", 93, 0, NULL, &_webstercomputer_obj }, _nokia_obj = { "nokia", 94, 0, NULL, &_frontier_obj }, _allenbradley_obj = { "allenbradley", 95, 0, NULL, &_nokia_obj }, _cern_obj = { "cern", 96, 0, NULL, &_allenbradley_obj }, _sigma_obj = { "sigma", 97, 0, NULL, &_cern_obj }, _emergingtech_obj = { "emergingtech", 98, 0, NULL, &_sigma_obj }, _snmpresearch_obj = { "snmpresearch", 99, 0, NULL, &_emergingtech_obj }, _ohiostate_obj = { "ohiostate", 100, 0, NULL, &_snmpresearch_obj }, _ultra_obj = { "ultra", 101, 0, NULL, &_ohiostate_obj }, _ccur_obj = { "ccur", 136, 0, NULL, &_ultra_obj }, _enterprises_obj = { "enterprises", 1, 0, &_ccur_obj, NULL }, _snmpInPkts_obj = { "snmpInPkts", 1, 0, NULL, NULL }, _snmpOutPkts_obj = { "snmpOutPkts", 2, 0, NULL, &_snmpInPkts_obj }, _snmpInBadVersions_obj = { "snmpInBadVersions", 3, 0, NULL, &_snmpOutPkts_obj }, _snmpInBadCommunityNames_obj = { "snmpInBadCommunityNames", 4, 0, NULL, &_snmpInBadVersions_obj }, _snmpInBadCommunityUses_obj = { "snmpInBadCommunityUses", 5, 0, NULL, &_snmpInBadCommunityNames_obj }, _snmpInASNParseErrs_obj = { "snmpInASNParseErrs", 6, 0, NULL, &_snmpInBadCommunityUses_obj }, _snmpInBadTypes_obj = { "snmpInBadTypes", 7, 0, NULL, &_snmpInASNParseErrs_obj }, _snmpInTooBigs_obj = { "snmpInTooBigs", 8, 0, NULL, &_snmpInBadTypes_obj }, _snmpInNoSuchNames_obj = { "snmpInNoSuchNames", 9, 0, NULL, &_snmpInTooBigs_obj }, _snmpInBadValues_obj = { "snmpInBadValues", 10, 0, NULL, &_snmpInNoSuchNames_obj }, _snmpInReadOnlys_obj = { "snmpInReadOnlys", 11, 0, NULL, &_snmpInBadValues_obj }, _snmpInGenErrs_obj = { "snmpInGenErrs", 12, 0, NULL, &_snmpInReadOnlys_obj }, _snmpInTotalReqVars_obj = { "snmpInTotalReqVars", 13, 0, NULL, &_snmpInGenErrs_obj }, _snmpInTotalSetVars_obj = { "snmpInTotalSetVars", 14, 0, NULL, &_snmpInTotalReqVars_obj }, _snmpInGetRequests_obj = { "snmpInGetRequests", 15, 0, NULL, &_snmpInTotalSetVars_obj }, _snmpInGetNexts_obj = { "snmpInGetNexts", 16, 0, NULL, &_snmpInGetRequests_obj }, _snmpInSetRequests_obj = { "snmpInSetRequests", 17, 0, NULL, &_snmpInGetNexts_obj }, _snmpInGetResponses_obj = { "snmpInGetResponses", 18, 0, NULL, &_snmpInSetRequests_obj }, _snmpInTraps_obj = { "snmpInTraps", 19, 0, NULL, &_snmpInGetResponses_obj }, _snmpOutTooBigs_obj = { "snmpOutTooBigs", 20, 0, NULL, &_snmpInTraps_obj }, _snmpOutNoSuchNames_obj = { "snmpOutNoSuchNames", 21, 0, NULL, &_snmpOutTooBigs_obj }, _snmpOutBadValues_obj = { "snmpOutBadValues", 22, 0, NULL, &_snmpOutNoSuchNames_obj }, _snmpOutReadOnlys_obj = { "snmpOutReadOnlys", 23, 0, NULL, &_snmpOutBadValues_obj }, _snmpOutGenErrs_obj = { "snmpOutGenErrs", 24, 0, NULL, &_snmpOutReadOnlys_obj }, _snmpOutGetRequests_obj = { "snmpOutGetRequests", 25, 0, NULL, &_snmpOutGenErrs_obj }, _snmpOutGetNexts_obj = { "snmpOutGetNexts", 26, 0, NULL, &_snmpOutGetRequests_obj }, _snmpOutSetRequests_obj = { "snmpOutSetRequests", 27, 0, NULL, &_snmpOutGetNexts_obj }, _snmpOutGetResponses_obj = { "snmpOutGetResponses", 28, 0, NULL, &_snmpOutSetRequests_obj }, _snmpOutTraps_obj = { "snmpOutTraps", 29, 0, NULL, &_snmpOutGetResponses_obj }, _snmpEnableAuthTraps_obj = { "snmpEnableAuthTraps", 30, 0, NULL, &_snmpOutTraps_obj }, _egpNeighState_obj = { "egpNeighState", 1, 0, NULL, NULL }, _egpNeighAddr_obj = { "egpNeighAddr", 2, 0, NULL, &_egpNeighState_obj }, _egpNeighAs_obj = { "egpNeighAs", 3, 0, NULL, &_egpNeighAddr_obj }, _egpNeighInMsgs_obj = { "egpNeighInMsgs", 4, 0, NULL, &_egpNeighAs_obj }, _egpNeighInErrs_obj = { "egpNeighInErrs", 5, 0, NULL, &_egpNeighInMsgs_obj }, _egpNeighOutMsgs_obj = { "egpNeighOutMsgs", 6, 0, NULL, &_egpNeighInErrs_obj }, _egpNeighOutErrs_obj = { "egpNeighOutErrs", 7, 0, NULL, &_egpNeighOutMsgs_obj }, _egpNeighInErrMsgs_obj = { "egpNeighInErrMsgs", 8, 0, NULL, &_egpNeighOutErrs_obj }, _egpNeighOutErrMsgs_obj = { "egpNeighOutErrMsgs", 9, 0, NULL, &_egpNeighInErrMsgs_obj }, _egpNeighStateUps_obj = { "egpNeighStateUps", 10, 0, NULL, &_egpNeighOutErrMsgs_obj }, _egpNeighStateDowns_obj = { "egpNeighStateDowns", 11, 0, NULL, &_egpNeighStateUps_obj }, _egpNeighIntervalHello_obj = { "egpNeighIntervalHello", 12, 0, NULL, &_egpNeighStateDowns_obj }, _egpNeighIntervalPoll_obj = { "egpNeighIntervalPoll", 13, 0, NULL, &_egpNeighIntervalHello_obj }, _egpNeighMode_obj = { "egpNeighMode", 14, 0, NULL, &_egpNeighIntervalPoll_obj }, _egpNeighEventTrigger_obj = { "egpNeighEventTrigger", 15, 0, NULL, &_egpNeighMode_obj }, _egpNeighEntry_obj = { "egpNeighEntry", 1, 0, &_egpNeighEventTrigger_obj, NULL }, _egpInMsgs_obj = { "egpInMsgs", 1, 0, NULL, NULL }, _egpInErrors_obj = { "egpInErrors", 2, 0, NULL, &_egpInMsgs_obj }, _egpOutMsgs_obj = { "egpOutMsgs", 3, 0, NULL, &_egpInErrors_obj }, _egpOutErrors_obj = { "egpOutErrors", 4, 0, NULL, &_egpOutMsgs_obj }, _egpNeighTable_obj = { "egpNeighTable", 5, 0, &_egpNeighEntry_obj, &_egpOutErrors_obj }, _egpAs_obj = { "egpAs", 6, 0, NULL, &_egpNeighTable_obj }, _udpLocalAddress_obj = { "udpLocalAddress", 1, 0, NULL, NULL }, _udpLocalPort_obj = { "udpLocalPort", 2, 0, NULL, &_udpLocalAddress_obj }, _udpEntry_obj = { "udpEntry", 1, 0, &_udpLocalPort_obj, NULL }, _udpInDatagrams_obj = { "udpInDatagrams", 1, 0, NULL, NULL }, _udpNoPorts_obj = { "udpNoPorts", 2, 0, NULL, &_udpInDatagrams_obj }, _udpInErrors_obj = { "udpInErrors", 3, 0, NULL, &_udpNoPorts_obj }, _udpOutDatagrams_obj = { "udpOutDatagrams", 4, 0, NULL, &_udpInErrors_obj }, _udpTable_obj = { "udpTable", 5, 0, &_udpEntry_obj, &_udpOutDatagrams_obj }, _tcpConnState_obj = { "tcpConnState", 1, 0, NULL, NULL }, _tcpConnLocalAddress_obj = { "tcpConnLocalAddress", 2, 0, NULL, &_tcpConnState_obj }, _tcpConnLocalPort_obj = { "tcpConnLocalPort", 3, 0, NULL, &_tcpConnLocalAddress_obj }, _tcpConnRemAddress_obj = { "tcpConnRemAddress", 4, 0, NULL, &_tcpConnLocalPort_obj }, _tcpConnRemPort_obj = { "tcpConnRemPort", 5, 0, NULL, &_tcpConnRemAddress_obj }, _tcpConnEntry_obj = { "tcpConnEntry", 1, 0, &_tcpConnRemPort_obj, NULL }, _tcpRtoAlgorithm_obj = { "tcpRtoAlgorithm", 1, 0, NULL, NULL }, _tcpRtoMin_obj = { "tcpRtoMin", 2, 0, NULL, &_tcpRtoAlgorithm_obj }, _tcpRtoMax_obj = { "tcpRtoMax", 3, 0, NULL, &_tcpRtoMin_obj }, _tcpMaxConn_obj = { "tcpMaxConn", 4, 0, NULL, &_tcpRtoMax_obj }, _tcpActiveOpens_obj = { "tcpActiveOpens", 5, 0, NULL, &_tcpMaxConn_obj }, _tcpPassiveOpens_obj = { "tcpPassiveOpens", 6, 0, NULL, &_tcpActiveOpens_obj }, _tcpAttemptFails_obj = { "tcpAttemptFails", 7, 0, NULL, &_tcpPassiveOpens_obj }, _tcpEstabResets_obj = { "tcpEstabResets", 8, 0, NULL, &_tcpAttemptFails_obj }, _tcpCurrEstab_obj = { "tcpCurrEstab", 9, 0, NULL, &_tcpEstabResets_obj }, _tcpInSegs_obj = { "tcpInSegs", 10, 0, NULL, &_tcpCurrEstab_obj }, _tcpOutSegs_obj = { "tcpOutSegs", 11, 0, NULL, &_tcpInSegs_obj }, _tcpRetransSegs_obj = { "tcpRetransSegs", 12, 0, NULL, &_tcpOutSegs_obj }, _tcpConnTable_obj = { "tcpConnTable", 13, 0, &_tcpConnEntry_obj, &_tcpRetransSegs_obj }, _tcpInErrs_obj = { "tcpInErrs", 14, 0, NULL, &_tcpConnTable_obj }, _tcpOutRsts_obj = { "tcpOutRsts", 15, 0, NULL, &_tcpInErrs_obj }, _icmpInMsgs_obj = { "icmpInMsgs", 1, 0, NULL, NULL }, _icmpInErrors_obj = { "icmpInErrors", 2, 0, NULL, &_icmpInMsgs_obj }, _icmpInDestUnreachs_obj = { "icmpInDestUnreachs", 3, 0, NULL, &_icmpInErrors_obj }, _icmpInTimeExcds_obj = { "icmpInTimeExcds", 4, 0, NULL, &_icmpInDestUnreachs_obj }, _icmpInParmProbs_obj = { "icmpInParmProbs", 5, 0, NULL, &_icmpInTimeExcds_obj }, _icmpInSrcQuenchs_obj = { "icmpInSrcQuenchs", 6, 0, NULL, &_icmpInParmProbs_obj }, _icmpInRedirects_obj = { "icmpInRedirects", 7, 0, NULL, &_icmpInSrcQuenchs_obj }, _icmpInEchos_obj = { "icmpInEchos", 8, 0, NULL, &_icmpInRedirects_obj }, _icmpInEchoReps_obj = { "icmpInEchoReps", 9, 0, NULL, &_icmpInEchos_obj }, _icmpInTimestamps_obj = { "icmpInTimestamps", 10, 0, NULL, &_icmpInEchoReps_obj }, _icmpInTimestampReps_obj = { "icmpInTimestampReps", 11, 0, NULL, &_icmpInTimestamps_obj }, _icmpInAddrMasks_obj = { "icmpInAddrMasks", 12, 0, NULL, &_icmpInTimestampReps_obj }, _icmpInAddrMaskReps_obj = { "icmpInAddrMaskReps", 13, 0, NULL, &_icmpInAddrMasks_obj }, _icmpOutMsgs_obj = { "icmpOutMsgs", 14, 0, NULL, &_icmpInAddrMaskReps_obj }, _icmpOutErrors_obj = { "icmpOutErrors", 15, 0, NULL, &_icmpOutMsgs_obj }, _icmpOutDestUnreachs_obj = { "icmpOutDestUnreachs", 16, 0, NULL, &_icmpOutErrors_obj }, _icmpOutTimeExcds_obj = { "icmpOutTimeExcds", 17, 0, NULL, &_icmpOutDestUnreachs_obj }, _icmpOutParmProbs_obj = { "icmpOutParmProbs", 18, 0, NULL, &_icmpOutTimeExcds_obj }, _icmpOutSrcQuenchs_obj = { "icmpOutSrcQuenchs", 19, 0, NULL, &_icmpOutParmProbs_obj }, _icmpOutRedirects_obj = { "icmpOutRedirects", 20, 0, NULL, &_icmpOutSrcQuenchs_obj }, _icmpOutEchos_obj = { "icmpOutEchos", 21, 0, NULL, &_icmpOutRedirects_obj }, _icmpOutEchoReps_obj = { "icmpOutEchoReps", 22, 0, NULL, &_icmpOutEchos_obj }, _icmpOutTimestamps_obj = { "icmpOutTimestamps", 23, 0, NULL, &_icmpOutEchoReps_obj }, _icmpOutTimestampReps_obj = { "icmpOutTimestampReps", 24, 0, NULL, &_icmpOutTimestamps_obj }, _icmpOutAddrMasks_obj = { "icmpOutAddrMasks", 25, 0, NULL, &_icmpOutTimestampReps_obj }, _icmpOutAddrMaskReps_obj = { "icmpOutAddrMaskReps", 26, 0, NULL, &_icmpOutAddrMasks_obj }, _ipNetToMediaIfIndex_obj = { "ipNetToMediaIfIndex", 1, 0, NULL, NULL }, _ipNetToMediaPhysAddress_obj = { "ipNetToMediaPhysAddress", 2, 0, NULL, &_ipNetToMediaIfIndex_obj }, _ipNetToMediaNetAddress_obj = { "ipNetToMediaNetAddress", 3, 0, NULL, &_ipNetToMediaPhysAddress_obj }, _ipNetToMediaType_obj = { "ipNetToMediaType", 4, 0, NULL, &_ipNetToMediaNetAddress_obj }, _ipNetToMediaEntry_obj = { "ipNetToMediaEntry", 1, 0, &_ipNetToMediaType_obj, NULL }, _ipRouteDest_obj = { "ipRouteDest", 1, 0, NULL, NULL }, _ipRouteIfIndex_obj = { "ipRouteIfIndex", 2, 0, NULL, &_ipRouteDest_obj }, _ipRouteMetric1_obj = { "ipRouteMetric1", 3, 0, NULL, &_ipRouteIfIndex_obj }, _ipRouteMetric2_obj = { "ipRouteMetric2", 4, 0, NULL, &_ipRouteMetric1_obj }, _ipRouteMetric3_obj = { "ipRouteMetric3", 5, 0, NULL, &_ipRouteMetric2_obj }, _ipRouteMetric4_obj = { "ipRouteMetric4", 6, 0, NULL, &_ipRouteMetric3_obj }, _ipRouteNextHop_obj = { "ipRouteNextHop", 7, 0, NULL, &_ipRouteMetric4_obj }, _ipRouteType_obj = { "ipRouteType", 8, 0, NULL, &_ipRouteNextHop_obj }, _ipRouteProto_obj = { "ipRouteProto", 9, 0, NULL, &_ipRouteType_obj }, _ipRouteAge_obj = { "ipRouteAge", 10, 0, NULL, &_ipRouteProto_obj }, _ipRouteMask_obj = { "ipRouteMask", 11, 0, NULL, &_ipRouteAge_obj }, _ipRouteEntry_obj = { "ipRouteEntry", 1, 0, &_ipRouteMask_obj, NULL }, _ipAdEntAddr_obj = { "ipAdEntAddr", 1, 0, NULL, NULL }, _ipAdEntIfIndex_obj = { "ipAdEntIfIndex", 2, 0, NULL, &_ipAdEntAddr_obj }, _ipAdEntNetMask_obj = { "ipAdEntNetMask", 3, 0, NULL, &_ipAdEntIfIndex_obj }, _ipAdEntBcastAddr_obj = { "ipAdEntBcastAddr", 4, 0, NULL, &_ipAdEntNetMask_obj }, _ipAdEntReasmMaxSize_obj = { "ipAdEntReasmMaxSize", 5, 0, NULL, &_ipAdEntBcastAddr_obj }, _ipAddrEntry_obj = { "ipAddrEntry", 1, 0, &_ipAdEntReasmMaxSize_obj, NULL }, _ipForwarding_obj = { "ipForwarding", 1, 0, NULL, NULL }, _ipDefaultTTL_obj = { "ipDefaultTTL", 2, 0, NULL, &_ipForwarding_obj }, _ipInReceives_obj = { "ipInReceives", 3, 0, NULL, &_ipDefaultTTL_obj }, _ipInHdrErrors_obj = { "ipInHdrErrors", 4, 0, NULL, &_ipInReceives_obj }, _ipInAddrErrors_obj = { "ipInAddrErrors", 5, 0, NULL, &_ipInHdrErrors_obj }, _ipForwDatagrams_obj = { "ipForwDatagrams", 6, 0, NULL, &_ipInAddrErrors_obj }, _ipInUnknownProtos_obj = { "ipInUnknownProtos", 7, 0, NULL, &_ipForwDatagrams_obj }, _ipInDiscards_obj = { "ipInDiscards", 8, 0, NULL, &_ipInUnknownProtos_obj }, _ipInDelivers_obj = { "ipInDelivers", 9, 0, NULL, &_ipInDiscards_obj }, _ipOutRequests_obj = { "ipOutRequests", 10, 0, NULL, &_ipInDelivers_obj }, _ipOutDiscards_obj = { "ipOutDiscards", 11, 0, NULL, &_ipOutRequests_obj }, _ipOutNoRoutes_obj = { "ipOutNoRoutes", 12, 0, NULL, &_ipOutDiscards_obj }, _ipReasmTimeout_obj = { "ipReasmTimeout", 13, 0, NULL, &_ipOutNoRoutes_obj }, _ipReasmReqds_obj = { "ipReasmReqds", 14, 0, NULL, &_ipReasmTimeout_obj }, _ipReasmOKs_obj = { "ipReasmOKs", 15, 0, NULL, &_ipReasmReqds_obj }, _ipReasmFails_obj = { "ipReasmFails", 16, 0, NULL, &_ipReasmOKs_obj }, _ipFragOKs_obj = { "ipFragOKs", 17, 0, NULL, &_ipReasmFails_obj }, _ipFragFails_obj = { "ipFragFails", 18, 0, NULL, &_ipFragOKs_obj }, _ipFragCreates_obj = { "ipFragCreates", 19, 0, NULL, &_ipFragFails_obj }, _ipAddrTable_obj = { "ipAddrTable", 20, 0, &_ipAddrEntry_obj, &_ipFragCreates_obj }, _ipRoutingTable_obj = { "ipRoutingTable", 21, 0, &_ipRouteEntry_obj, &_ipAddrTable_obj }, _ipNetToMediaTable_obj = { "ipNetToMediaTable", 22, 0, &_ipNetToMediaEntry_obj, &_ipRoutingTable_obj }, _atIfIndex_obj = { "atIfIndex", 1, 0, NULL, NULL }, _atPhysAddress_obj = { "atPhysAddress", 2, 0, NULL, &_atIfIndex_obj }, _atNetAddress_obj = { "atNetAddress", 3, 0, NULL, &_atPhysAddress_obj }, _atEntry_obj = { "atEntry", 1, 0, &_atNetAddress_obj, NULL }, _atTable_obj = { "atTable", 1, 0, &_atEntry_obj, NULL }, _ifIndex_obj = { "ifIndex", 1, 0, NULL, NULL }, _ifDescr_obj = { "ifDescr", 2, 0, NULL, &_ifIndex_obj }, _ifType_obj = { "ifType", 3, 0, NULL, &_ifDescr_obj }, _ifMtu_obj = { "ifMtu", 4, 0, NULL, &_ifType_obj }, _ifSpeed_obj = { "ifSpeed", 5, 0, NULL, &_ifMtu_obj }, _ifPhysAddress_obj = { "ifPhysAddress", 6, 0, NULL, &_ifSpeed_obj }, _ifAdminStatus_obj = { "ifAdminStatus", 7, 0, NULL, &_ifPhysAddress_obj }, _ifOperStatus_obj = { "ifOperStatus", 8, 0, NULL, &_ifAdminStatus_obj }, _ifLastChange_obj = { "ifLastChange", 9, 0, NULL, &_ifOperStatus_obj }, _ifInOctets_obj = { "ifInOctets", 10, 0, NULL, &_ifLastChange_obj }, _ifInUcastPkts_obj = { "ifInUcastPkts", 11, 0, NULL, &_ifInOctets_obj }, _ifInNUcastPkts_obj = { "ifInNUcastPkts", 12, 0, NULL, &_ifInUcastPkts_obj }, _ifInDiscards_obj = { "ifInDiscards", 13, 0, NULL, &_ifInNUcastPkts_obj }, _ifInErrors_obj = { "ifInErrors", 14, 0, NULL, &_ifInDiscards_obj }, _ifInUnknownProtos_obj = { "ifInUnknownProtos", 15, 0, NULL, &_ifInErrors_obj }, _ifOutOctets_obj = { "ifOutOctets", 16, 0, NULL, &_ifInUnknownProtos_obj }, _ifOutUcastPkts_obj = { "ifOutUcastPkts", 17, 0, NULL, &_ifOutOctets_obj }, _ifOutNUcastPkts_obj = { "ifOutNUcastPkts", 18, 0, NULL, &_ifOutUcastPkts_obj }, _ifOutDiscards_obj = { "ifOutDiscards", 19, 0, NULL, &_ifOutNUcastPkts_obj }, _ifOutErrors_obj = { "ifOutErrors", 20, 0, NULL, &_ifOutDiscards_obj }, _ifOutQLen_obj = { "ifOutQLen", 21, 0, NULL, &_ifOutErrors_obj }, _ifSpecific_obj = { "ifSpecific", 22, 0, NULL, &_ifOutQLen_obj }, _ifEntry_obj = { "ifEntry", 1, 0, &_ifSpecific_obj, NULL }, _ifNumber_obj = { "ifNumber", 1, 0, NULL, NULL }, _ifTable_obj = { "ifTable", 2, 0, &_ifEntry_obj, &_ifNumber_obj }, _sysDescr_obj = { "sysDescr", 1, 0, NULL, NULL }, _sysObjectID_obj = { "sysObjectID", 2, 0, NULL, &_sysDescr_obj }, _sysUpTime_obj = { "sysUpTime", 3, 0, NULL, &_sysObjectID_obj }, _sysContact_obj = { "sysContact", 4, 0, NULL, &_sysUpTime_obj }, _sysName_obj = { "sysName", 5, 0, NULL, &_sysContact_obj }, _sysLocation_obj = { "sysLocation", 6, 0, NULL, &_sysName_obj }, _sysServices_obj = { "sysServices", 7, 0, NULL, &_sysLocation_obj }, _system_obj = { "system", 1, 0, &_sysServices_obj, NULL }, _interfaces_obj = { "interfaces", 2, 0, &_ifTable_obj, &_system_obj }, _at_obj = { "at", 3, 0, &_atTable_obj, &_interfaces_obj }, _ip_obj = { "ip", 4, 0, &_ipNetToMediaTable_obj, &_at_obj }, _icmp_obj = { "icmp", 5, 0, &_icmpOutAddrMaskReps_obj, &_ip_obj }, _tcp_obj = { "tcp", 6, 0, &_tcpOutRsts_obj, &_icmp_obj }, _udp_obj = { "udp", 7, 0, &_udpTable_obj, &_tcp_obj }, _egp_obj = { "egp", 8, 0, &_egpAs_obj, &_udp_obj }, _transmission_obj = { "transmission", 10, 0, NULL, &_egp_obj }, _snmp_obj = { "snmp", 11, 0, &_snmpEnableAuthTraps_obj, &_transmission_obj }, _usmMIBCompliances_obj = { "usmMIBCompliances", 1, 0, NULL, NULL }, _usmMIBGroups_obj = { "usmMIBGroups", 2, 0, NULL, &_usmMIBCompliances_obj }, _usmUserEngineID_obj = { "usmUserEngineID", 1, 0, NULL, NULL }, _usmUserName_obj = { "usmUserName", 2, 0, NULL, &_usmUserEngineID_obj }, _usmUserSecurityName_obj = { "usmUserSecurityName", 3, 0, NULL, &_usmUserName_obj }, _usmUserCloneFrom_obj = { "usmUserCloneFrom", 4, 0, NULL, &_usmUserSecurityName_obj }, _usmUserAuthProtocol_obj = { "usmUserAuthProtocol", 5, 0, NULL, &_usmUserCloneFrom_obj }, _usmUserAuthKeyChange_obj = { "usmUserAuthKeyChange", 6, 0, NULL, &_usmUserAuthProtocol_obj }, _usmUserOwnAuthKeyChange_obj = { "usmUserOwnAuthKeyChange", 7, 0, NULL, &_usmUserAuthKeyChange_obj }, _usmUserPrivProtocol_obj = { "usmUserPrivProtocol", 8, 0, NULL, &_usmUserOwnAuthKeyChange_obj }, _usmUserPrivKeyChange_obj = { "usmUserPrivKeyChange", 9, 0, NULL, &_usmUserPrivProtocol_obj }, _usmUserOwnPrivKeyChange_obj = { "usmUserOwnPrivKeyChange", 10, 0, NULL, &_usmUserPrivKeyChange_obj }, _usmUserPublic_obj = { "usmUserPublic", 11, 0, NULL, &_usmUserOwnPrivKeyChange_obj }, _usmUserStorageType_obj = { "usmUserStorageType", 12, 0, NULL, &_usmUserPublic_obj }, _usmUserStatus_obj = { "usmUserStatus", 13, 0, NULL, &_usmUserStorageType_obj }, _usmUserEntry_obj = { "usmUserEntry", 1, 0, &_usmUserStatus_obj, NULL }, _usmUserSpinLock_obj = { "usmUserSpinLock", 1, 0, NULL, NULL }, _usmUserTable_obj = { "usmUserTable", 2, 0, &_usmUserEntry_obj, &_usmUserSpinLock_obj }, _usmStatsUnsupportedSecLevels_obj = { "usmStatsUnsupportedSecLevels", 1, 0, NULL, NULL }, _usmStatsNotInTimeWindows_obj = { "usmStatsNotInTimeWindows", 2, 0, NULL, &_usmStatsUnsupportedSecLevels_obj }, _usmStatsUnknownUserNames_obj = { "usmStatsUnknownUserNames", 3, 0, NULL, &_usmStatsNotInTimeWindows_obj }, _usmStatsUnknownEngineIDs_obj = { "usmStatsUnknownEngineIDs", 4, 0, NULL, &_usmStatsUnknownUserNames_obj }, _usmStatsWrongDigests_obj = { "usmStatsWrongDigests", 5, 0, NULL, &_usmStatsUnknownEngineIDs_obj }, _usmStatsDecryptionErrors_obj = { "usmStatsDecryptionErrors", 6, 0, NULL, &_usmStatsWrongDigests_obj }, _usmStats_obj = { "usmStats", 1, 0, &_usmStatsDecryptionErrors_obj, NULL }, _usmUser_obj = { "usmUser", 2, 0, &_usmUserTable_obj, &_usmStats_obj }, _usmMIBObjects_obj = { "usmMIBObjects", 1, 0, &_usmUser_obj, NULL }, _usmMIBConformance_obj = { "usmMIBConformance", 2, 0, &_usmMIBGroups_obj, &_usmMIBObjects_obj }, _snmpMPDMIBCompliances_obj = { "snmpMPDMIBCompliances", 1, 0, NULL, NULL }, _snmpMPDMIBGroups_obj = { "snmpMPDMIBGroups", 2, 0, NULL, &_snmpMPDMIBCompliances_obj }, _snmpUnknownSecurityModels_obj = { "snmpUnknownSecurityModels", 1, 0, NULL, NULL }, _snmpInvalidMsgs_obj = { "snmpInvalidMsgs", 2, 0, NULL, &_snmpUnknownSecurityModels_obj }, _snmpUnknownPDUHandlers_obj = { "snmpUnknownPDUHandlers", 3, 0, NULL, &_snmpInvalidMsgs_obj }, _snmpMPDStats_obj = { "snmpMPDStats", 1, 0, &_snmpUnknownPDUHandlers_obj, NULL }, _snmpMPDAdmin_obj = { "snmpMPDAdmin", 1, 0, NULL, NULL }, _snmpMPDMIBObjects_obj = { "snmpMPDMIBObjects", 2, 0, &_snmpMPDStats_obj, &_snmpMPDAdmin_obj }, _snmpMPDMIBConformance_obj = { "snmpMPDMIBConformance", 3, 0, &_snmpMPDMIBGroups_obj, &_snmpMPDMIBObjects_obj }, _snmpEngineID_obj = { "snmpEngineID", 1, 0, NULL, NULL }, _snmpEngineBoots_obj = { "snmpEngineBoots", 2, 0, NULL, &_snmpEngineID_obj }, _snmpEngineTime_obj = { "snmpEngineTime", 3, 0, NULL, &_snmpEngineBoots_obj }, _snmpEngineMaxMessageSize_obj = { "snmpEngineMaxMessageSize", 4, 0, NULL, &_snmpEngineTime_obj }, _snmpEngine_obj = { "snmpEngine", 1, 0, &_snmpEngineMaxMessageSize_obj, NULL }, _snmpFrameworkAdmin_obj = { "snmpFrameworkAdmin", 1, 0, NULL, NULL }, _snmpFrameworkMIBObjects_obj = { "snmpFrameworkMIBObjects", 2, 0, &_snmpEngine_obj, &_snmpFrameworkAdmin_obj }, _snmpFrameworkMIBConformance_obj = { "snmpFrameworkMIBConformance", 3, 0, NULL, &_snmpFrameworkMIBObjects_obj }, _snmpFrameworkMIB_obj = { "snmpFrameworkMIB", 10, 0, &_snmpFrameworkMIBConformance_obj, NULL }, _snmpMPDMIB_obj = { "snmpMPDMIB", 11, 0, &_snmpMPDMIBConformance_obj, &_snmpFrameworkMIB_obj }, _snmpUsmMIB_obj = { "snmpUsmMIB", 15, 0, &_usmMIBConformance_obj, &_snmpMPDMIB_obj }, _snmpModules_obj = { "snmpModules", 3, 0, &_snmpUsmMIB_obj, NULL }, _mib_obj = { "mib", 1, 0, &_snmp_obj, NULL }, _directory_obj = { "directory", 1, 0, NULL, NULL }, _mgmt_obj = { "mgmt", 2, 0, &_mib_obj, &_directory_obj }, _experimental_obj = { "experimental", 3, 0, NULL, &_mgmt_obj }, _private_obj = { "private", 4, 0, &_enterprises_obj, &_experimental_obj }, _security_obj = { "security", 5, 0, NULL, &_private_obj }, _snmpV2_obj = { "snmpV2", 6, 0, &_snmpModules_obj, &_security_obj }, _internet_obj = { "internet", 1, 0, &_snmpV2_obj, NULL }, _dod_obj = { "dod", 6, 0, &_internet_obj, NULL }, _org_obj = { "org", 3, 0, &_dod_obj, NULL }, _iso_obj = { "iso", 1, 0, &_org_obj, NULL }, *mibroot = &_iso_obj; tcpdump-3.9.8/./print-hsrp.c0000644000026300017500000001065510236621535013752 0ustar mcrmcr/* * Copyright (C) 2001 Julian Cowley * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. Neither the name of the project nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ /* Cisco Hot Standby Router Protocol (HSRP). */ #ifndef lint static const char rcsid[] _U_ = "@(#) $Header: /tcpdump/master/tcpdump/print-hsrp.c,v 1.9.2.1 2005/05/06 07:57:17 guy Exp $"; #endif #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include "interface.h" #include "addrtoname.h" /* HSRP op code types. */ static const char *op_code_str[] = { "hello", "coup", "resign" }; /* HSRP states and associated names. */ static struct tok states[] = { { 0, "initial" }, { 1, "learn" }, { 2, "listen" }, { 4, "speak" }, { 8, "standby" }, { 16, "active" }, { 0, NULL } }; /* * RFC 2281: * * 0 1 2 3 * 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * | Version | Op Code | State | Hellotime | * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * | Holdtime | Priority | Group | Reserved | * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * | Authentication Data | * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * | Authentication Data | * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * | Virtual IP Address | * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ */ #define HSRP_AUTH_SIZE 8 /* HSRP protocol header. */ struct hsrp { u_int8_t hsrp_version; u_int8_t hsrp_op_code; u_int8_t hsrp_state; u_int8_t hsrp_hellotime; u_int8_t hsrp_holdtime; u_int8_t hsrp_priority; u_int8_t hsrp_group; u_int8_t hsrp_reserved; u_int8_t hsrp_authdata[HSRP_AUTH_SIZE]; struct in_addr hsrp_virtaddr; }; void hsrp_print(register const u_int8_t *bp, register u_int len) { struct hsrp *hp = (struct hsrp *) bp; TCHECK(hp->hsrp_version); printf("HSRPv%d", hp->hsrp_version); if (hp->hsrp_version != 0) return; TCHECK(hp->hsrp_op_code); printf("-"); printf("%s ", tok2strary(op_code_str, "unknown (%d)", hp->hsrp_op_code)); printf("%d: ", len); TCHECK(hp->hsrp_state); printf("state=%s ", tok2str(states, "Unknown (%d)", hp->hsrp_state)); TCHECK(hp->hsrp_group); printf("group=%d ", hp->hsrp_group); TCHECK(hp->hsrp_reserved); if (hp->hsrp_reserved != 0) { printf("[reserved=%d!] ", hp->hsrp_reserved); } TCHECK(hp->hsrp_virtaddr); printf("addr=%s", ipaddr_string(&hp->hsrp_virtaddr)); if (vflag) { printf(" hellotime="); relts_print(hp->hsrp_hellotime); printf(" holdtime="); relts_print(hp->hsrp_holdtime); printf(" priority=%d", hp->hsrp_priority); printf(" auth=\""); if (fn_printn(hp->hsrp_authdata, sizeof(hp->hsrp_authdata), snapend)) { printf("\""); goto trunc; } printf("\""); } return; trunc: printf("[|hsrp]"); } tcpdump-3.9.8/./print-mobility.c0000644000026300017500000002052510231552734014622 0ustar mcrmcr/* * Copyright (C) 2002 WIDE Project. * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. Neither the name of the project nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #ifndef lint static const char rcsid[] _U_ = "@(#) $Header: /tcpdump/master/tcpdump/print-mobility.c,v 1.11.2.1 2005/04/20 22:21:16 guy Exp $"; #endif #ifdef INET6 #include #include #include "ip6.h" #include "interface.h" #include "addrtoname.h" #include "extract.h" /* must come after interface.h */ /* Mobility header */ struct ip6_mobility { u_int8_t ip6m_pproto; /* following payload protocol (for PG) */ u_int8_t ip6m_len; /* length in units of 8 octets */ u_int8_t ip6m_type; /* message type */ u_int8_t reserved; /* reserved */ u_int16_t ip6m_cksum; /* sum of IPv6 pseudo-header and MH */ union { u_int16_t ip6m_un_data16[1]; /* type-specific field */ u_int8_t ip6m_un_data8[2]; /* type-specific fiedl */ } ip6m_dataun; }; #define ip6m_data16 ip6m_dataun.ip6m_un_data16 #define ip6m_data8 ip6m_dataun.ip6m_un_data8 #define IP6M_MINLEN 8 /* message type */ #define IP6M_BINDING_REQUEST 0 /* Binding Refresh Request */ #define IP6M_HOME_TEST_INIT 1 /* Home Test Init */ #define IP6M_CAREOF_TEST_INIT 2 /* Care-of Test Init */ #define IP6M_HOME_TEST 3 /* Home Test */ #define IP6M_CAREOF_TEST 4 /* Care-of Test */ #define IP6M_BINDING_UPDATE 5 /* Binding Update */ #define IP6M_BINDING_ACK 6 /* Binding Acknowledgement */ #define IP6M_BINDING_ERROR 7 /* Binding Error */ /* Mobility Header Options */ #define IP6MOPT_MINLEN 2 #define IP6MOPT_PAD1 0x0 /* Pad1 */ #define IP6MOPT_PADN 0x1 /* PadN */ #define IP6MOPT_REFRESH 0x2 /* Binding Refresh Advice */ #define IP6MOPT_REFRESH_MINLEN 4 #define IP6MOPT_ALTCOA 0x3 /* Alternate Care-of Address */ #define IP6MOPT_ALTCOA_MINLEN 18 #define IP6MOPT_NONCEID 0x4 /* Nonce Indices */ #define IP6MOPT_NONCEID_MINLEN 6 #define IP6MOPT_AUTH 0x5 /* Binding Authorization Data */ #define IP6MOPT_AUTH_MINLEN 12 static void mobility_opt_print(const u_char *bp, int len) { int i; int optlen; for (i = 0; i < len; i += optlen) { if (bp[i] == IP6MOPT_PAD1) optlen = 1; else { if (i + 1 < len) optlen = bp[i + 1] + 2; else goto trunc; } if (i + optlen > len) goto trunc; switch (bp[i]) { case IP6MOPT_PAD1: printf("(pad1)"); break; case IP6MOPT_PADN: if (len - i < IP6MOPT_MINLEN) { printf("(padn: trunc)"); goto trunc; } printf("(padn)"); break; case IP6MOPT_REFRESH: if (len - i < IP6MOPT_REFRESH_MINLEN) { printf("(refresh: trunc)"); goto trunc; } /* units of 4 secs */ printf("(refresh: %d)", EXTRACT_16BITS(&bp[i+2]) << 2); break; case IP6MOPT_ALTCOA: if (len - i < IP6MOPT_ALTCOA_MINLEN) { printf("(altcoa: trunc)"); goto trunc; } printf("(alt-CoA: %s)", ip6addr_string(&bp[i+2])); break; case IP6MOPT_NONCEID: if (len - i < IP6MOPT_NONCEID_MINLEN) { printf("(ni: trunc)"); goto trunc; } printf("(ni: ho=0x%04x co=0x%04x)", EXTRACT_16BITS(&bp[i+2]), EXTRACT_16BITS(&bp[i+4])); break; case IP6MOPT_AUTH: if (len - i < IP6MOPT_AUTH_MINLEN) { printf("(auth: trunc)"); goto trunc; } printf("(auth)"); break; default: if (len - i < IP6MOPT_MINLEN) { printf("(sopt_type %d: trunc)", bp[i]); goto trunc; } printf("(type-0x%02x: len=%d)", bp[i], bp[i + 1]); break; } } return; trunc: printf("[trunc] "); } /* * Mobility Header */ int mobility_print(const u_char *bp, const u_char *bp2 _U_) { const struct ip6_mobility *mh; const u_char *ep; int mhlen, hlen, type; mh = (struct ip6_mobility *)bp; /* 'ep' points to the end of available data. */ ep = snapend; if (!TTEST(mh->ip6m_len)) { /* * There's not enough captured data to include the * mobility header length. * * Our caller expects us to return the length, however, * so return a value that will run to the end of the * captured data. * * XXX - "ip6_print()" doesn't do anything with the * returned length, however, as it breaks out of the * header-processing loop. */ mhlen = ep - bp; goto trunc; } mhlen = (int)((mh->ip6m_len + 1) << 3); /* XXX ip6m_cksum */ TCHECK(mh->ip6m_type); type = mh->ip6m_type; switch (type) { case IP6M_BINDING_REQUEST: printf("mobility: BRR"); hlen = IP6M_MINLEN; break; case IP6M_HOME_TEST_INIT: case IP6M_CAREOF_TEST_INIT: printf("mobility: %soTI", type == IP6M_HOME_TEST_INIT ? "H" : "C"); hlen = IP6M_MINLEN; if (vflag) { TCHECK2(*mh, hlen + 8); printf(" %s Init Cookie=%08x:%08x", type == IP6M_HOME_TEST_INIT ? "Home" : "Care-of", EXTRACT_32BITS(&bp[hlen]), EXTRACT_32BITS(&bp[hlen + 4])); } hlen += 8; break; case IP6M_HOME_TEST: case IP6M_CAREOF_TEST: printf("mobility: %soT", type == IP6M_HOME_TEST ? "H" : "C"); TCHECK(mh->ip6m_data16[0]); printf(" nonce id=0x%x", EXTRACT_16BITS(&mh->ip6m_data16[0])); hlen = IP6M_MINLEN; if (vflag) { TCHECK2(*mh, hlen + 8); printf(" %s Init Cookie=%08x:%08x", type == IP6M_HOME_TEST ? "Home" : "Care-of", EXTRACT_32BITS(&bp[hlen]), EXTRACT_32BITS(&bp[hlen + 4])); } hlen += 8; if (vflag) { TCHECK2(*mh, hlen + 8); printf(" %s Keygen Token=%08x:%08x", type == IP6M_HOME_TEST ? "Home" : "Care-of", EXTRACT_32BITS(&bp[hlen]), EXTRACT_32BITS(&bp[hlen + 4])); } hlen += 8; break; case IP6M_BINDING_UPDATE: printf("mobility: BU"); TCHECK(mh->ip6m_data16[0]); printf(" seq#=%d", EXTRACT_16BITS(&mh->ip6m_data16[0])); hlen = IP6M_MINLEN; TCHECK2(*mh, hlen + 1); if (bp[hlen] & 0xf0) printf(" "); if (bp[hlen] & 0x80) printf("A"); if (bp[hlen] & 0x40) printf("H"); if (bp[hlen] & 0x20) printf("L"); if (bp[hlen] & 0x10) printf("K"); /* Reserved (4bits) */ hlen += 1; /* Reserved (8bits) */ hlen += 1; TCHECK2(*mh, hlen + 2); /* units of 4 secs */ printf(" lifetime=%d", EXTRACT_16BITS(&bp[hlen]) << 2); hlen += 2; break; case IP6M_BINDING_ACK: printf("mobility: BA"); TCHECK(mh->ip6m_data8[0]); printf(" status=%d", mh->ip6m_data8[0]); if (mh->ip6m_data8[1] & 0x80) printf(" K"); /* Reserved (7bits) */ hlen = IP6M_MINLEN; TCHECK2(*mh, hlen + 2); printf(" seq#=%d", EXTRACT_16BITS(&bp[hlen])); hlen += 2; TCHECK2(*mh, hlen + 2); /* units of 4 secs */ printf(" lifetime=%d", EXTRACT_16BITS(&bp[hlen]) << 2); hlen += 2; break; case IP6M_BINDING_ERROR: printf("mobility: BE"); TCHECK(mh->ip6m_data8[0]); printf(" status=%d", mh->ip6m_data8[0]); /* Reserved */ hlen = IP6M_MINLEN; TCHECK2(*mh, hlen + 16); printf(" homeaddr %s", ip6addr_string(&bp[hlen])); hlen += 16; break; default: printf("mobility: type-#%d len=%d", type, mh->ip6m_len); return(mhlen); break; } if (vflag) mobility_opt_print(&bp[hlen], mhlen - hlen); return(mhlen); trunc: fputs("[|MOBILITY]", stdout); return(mhlen); } #endif /* INET6 */ tcpdump-3.9.8/./Makefile-devel-adds0000644000026300017500000000113307747357750015157 0ustar mcrmcr# # Auto-regenerate configure script or Makefile when things change. # From autoconf.info . Works best with GNU Make. # ${srcdir}/configure: configure.in cd ${srcdir} && autoconf # autoheader might not change config.h.in, so touch a stamp file. ${srcdir}/config.h.in: ${srcdir}/stamp-h.in ${srcdir}/stamp-h.in: configure.in acconfig.h cd ${srcdir} && autoheader echo timestamp > ${srcdir}/stamp-h.in config.h: stamp-h stamp-h: ${srcdir}/config.h.in config.status ./config.status Makefile: Makefile.in config.status ./config.status config.status: ${srcdir}/configure ./config.status --recheck tcpdump-3.9.8/./cpack.h0000644000026300017500000000420710124637666012736 0ustar mcrmcr/*- * Copyright (c) 2003, 2004 David Young. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. The name of David Young may not be used to endorse or promote * products derived from this software without specific prior * written permission. * * THIS SOFTWARE IS PROVIDED BY DAVID YOUNG ``AS IS'' AND ANY * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL DAVID * YOUNG BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY * OF SUCH DAMAGE. */ #ifndef _CPACK_H #define _CPACK_H struct cpack_state { u_int8_t *c_buf; u_int8_t *c_next; size_t c_len; }; int cpack_init(struct cpack_state *, u_int8_t *, size_t); int cpack_uint8(struct cpack_state *, u_int8_t *); int cpack_uint16(struct cpack_state *, u_int16_t *); int cpack_uint32(struct cpack_state *, u_int32_t *); int cpack_uint64(struct cpack_state *, u_int64_t *); #define cpack_int8(__s, __p) cpack_uint8((__s), (u_int8_t*)(__p)) #define cpack_int16(__s, __p) cpack_uint16((__s), (u_int16_t*)(__p)) #define cpack_int32(__s, __p) cpack_uint32((__s), (u_int32_t*)(__p)) #define cpack_int64(__s, __p) cpack_uint64((__s), (u_int64_t*)(__p)) #endif /* _CPACK_H */ tcpdump-3.9.8/./print-pim.c0000644000026300017500000007277610504040015013561 0ustar mcrmcr/* * Copyright (c) 1995, 1996 * The Regents of the University of California. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that: (1) source code distributions * retain the above copyright notice and this paragraph in its entirety, (2) * distributions including binary code include the above copyright notice and * this paragraph in its entirety in the documentation or other materials * provided with the distribution, and (3) all advertising materials mentioning * features or use of this software display the following acknowledgement: * ``This product includes software developed by the University of California, * Lawrence Berkeley Laboratory and its contributors.'' Neither the name of * the University nor the names of its contributors may be used to endorse * or promote products derived from this software without specific prior * written permission. * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. */ #ifndef lint static const char rcsid[] _U_ = "@(#) $Header: /tcpdump/master/tcpdump/print-pim.c,v 1.45.2.4 2006/02/13 01:32:34 hannes Exp $ (LBL)"; #endif #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include "interface.h" #define PIMV2_TYPE_HELLO 0 #define PIMV2_TYPE_REGISTER 1 #define PIMV2_TYPE_REGISTER_STOP 2 #define PIMV2_TYPE_JOIN_PRUNE 3 #define PIMV2_TYPE_BOOTSTRAP 4 #define PIMV2_TYPE_ASSERT 5 #define PIMV2_TYPE_GRAFT 6 #define PIMV2_TYPE_GRAFT_ACK 7 #define PIMV2_TYPE_CANDIDATE_RP 8 #define PIMV2_TYPE_PRUNE_REFRESH 9 static struct tok pimv2_type_values[] = { { PIMV2_TYPE_HELLO, "Hello" }, { PIMV2_TYPE_REGISTER, "Register" }, { PIMV2_TYPE_REGISTER_STOP, "Register Stop" }, { PIMV2_TYPE_JOIN_PRUNE, "Join / Prune" }, { PIMV2_TYPE_BOOTSTRAP, "Bootstrap" }, { PIMV2_TYPE_ASSERT, "Assert" }, { PIMV2_TYPE_GRAFT, "Graft" }, { PIMV2_TYPE_GRAFT_ACK, "Graft Acknowledgement" }, { PIMV2_TYPE_CANDIDATE_RP, "Candidate RP Advertisement" }, { PIMV2_TYPE_PRUNE_REFRESH, "Prune Refresh" }, { 0, NULL} }; #define PIMV2_HELLO_OPTION_HOLDTIME 1 #define PIMV2_HELLO_OPTION_LANPRUNEDELAY 2 #define PIMV2_HELLO_OPTION_DR_PRIORITY_OLD 18 #define PIMV2_HELLO_OPTION_DR_PRIORITY 19 #define PIMV2_HELLO_OPTION_GENID 20 #define PIMV2_HELLO_OPTION_REFRESH_CAP 21 #define PIMV2_HELLO_OPTION_BIDIR_CAP 22 #define PIMV2_HELLO_OPTION_ADDRESS_LIST 24 #define PIMV2_HELLO_OPTION_ADDRESS_LIST_OLD 65001 static struct tok pimv2_hello_option_values[] = { { PIMV2_HELLO_OPTION_HOLDTIME, "Hold Time" }, { PIMV2_HELLO_OPTION_LANPRUNEDELAY, "LAN Prune Delay" }, { PIMV2_HELLO_OPTION_DR_PRIORITY_OLD, "DR Priority (Old)" }, { PIMV2_HELLO_OPTION_DR_PRIORITY, "DR Priority" }, { PIMV2_HELLO_OPTION_GENID, "Generation ID" }, { PIMV2_HELLO_OPTION_REFRESH_CAP, "State Refresh Capability" }, { PIMV2_HELLO_OPTION_BIDIR_CAP, "Bi-Directional Capability" }, { PIMV2_HELLO_OPTION_ADDRESS_LIST, "Address List" }, { PIMV2_HELLO_OPTION_ADDRESS_LIST_OLD, "Address List (Old)" }, { 0, NULL} }; #define PIMV2_REGISTER_FLAG_LEN 4 #define PIMV2_REGISTER_FLAG_BORDER 0x80000000 #define PIMV2_REGISTER_FLAG_NULL 0x40000000 static struct tok pimv2_register_flag_values[] = { { PIMV2_REGISTER_FLAG_BORDER, "Border" }, { PIMV2_REGISTER_FLAG_NULL, "Null" }, { 0, NULL} }; /* * XXX: We consider a case where IPv6 is not ready yet for portability, * but PIM dependent defintions should be independent of IPv6... */ struct pim { u_int8_t pim_typever; /* upper 4bit: PIM version number; 2 for PIMv2 */ /* lower 4bit: the PIM message type, currently they are: * Hello, Register, Register-Stop, Join/Prune, * Bootstrap, Assert, Graft (PIM-DM only), * Graft-Ack (PIM-DM only), C-RP-Adv */ #define PIM_VER(x) (((x) & 0xf0) >> 4) #define PIM_TYPE(x) ((x) & 0x0f) u_char pim_rsv; /* Reserved */ u_short pim_cksum; /* IP style check sum */ }; #include #include #include "interface.h" #include "addrtoname.h" #include "extract.h" #include "ip.h" static void pimv2_print(register const u_char *bp, register u_int len); static void pimv1_join_prune_print(register const u_char *bp, register u_int len) { int maddrlen, addrlen, ngroups, njoin, nprune; int njp; /* If it's a single group and a single source, use 1-line output. */ if (TTEST2(bp[0], 30) && bp[11] == 1 && ((njoin = EXTRACT_16BITS(&bp[20])) + EXTRACT_16BITS(&bp[22])) == 1) { int hold; (void)printf(" RPF %s ", ipaddr_string(bp)); hold = EXTRACT_16BITS(&bp[6]); if (hold != 180) { (void)printf("Hold "); relts_print(hold); } (void)printf("%s (%s/%d, %s", njoin ? "Join" : "Prune", ipaddr_string(&bp[26]), bp[25] & 0x3f, ipaddr_string(&bp[12])); if (EXTRACT_32BITS(&bp[16]) != 0xffffffff) (void)printf("/%s", ipaddr_string(&bp[16])); (void)printf(") %s%s %s", (bp[24] & 0x01) ? "Sparse" : "Dense", (bp[25] & 0x80) ? " WC" : "", (bp[25] & 0x40) ? "RP" : "SPT"); return; } TCHECK2(bp[0], sizeof(struct in_addr)); if (vflag > 1) (void)printf("\n"); (void)printf(" Upstream Nbr: %s", ipaddr_string(bp)); TCHECK2(bp[6], 2); if (vflag > 1) (void)printf("\n"); (void)printf(" Hold time: "); relts_print(EXTRACT_16BITS(&bp[6])); if (vflag < 2) return; bp += 8; len -= 8; TCHECK2(bp[0], 4); maddrlen = bp[1]; addrlen = bp[2]; ngroups = bp[3]; bp += 4; len -= 4; while (ngroups--) { /* * XXX - does the address have length "addrlen" and the * mask length "maddrlen"? */ TCHECK2(bp[0], sizeof(struct in_addr)); (void)printf("\n\tGroup: %s", ipaddr_string(bp)); TCHECK2(bp[4], sizeof(struct in_addr)); if (EXTRACT_32BITS(&bp[4]) != 0xffffffff) (void)printf("/%s", ipaddr_string(&bp[4])); TCHECK2(bp[8], 4); njoin = EXTRACT_16BITS(&bp[8]); nprune = EXTRACT_16BITS(&bp[10]); (void)printf(" joined: %d pruned: %d", njoin, nprune); bp += 12; len -= 12; for (njp = 0; njp < (njoin + nprune); njp++) { const char *type; if (njp < njoin) type = "Join "; else type = "Prune"; TCHECK2(bp[0], 6); (void)printf("\n\t%s %s%s%s%s/%d", type, (bp[0] & 0x01) ? "Sparse " : "Dense ", (bp[1] & 0x80) ? "WC " : "", (bp[1] & 0x40) ? "RP " : "SPT ", ipaddr_string(&bp[2]), bp[1] & 0x3f); bp += 6; len -= 6; } } return; trunc: (void)printf("[|pim]"); return; } void pimv1_print(register const u_char *bp, register u_int len) { register const u_char *ep; register u_char type; ep = (const u_char *)snapend; if (bp >= ep) return; TCHECK(bp[1]); type = bp[1]; switch (type) { case 0: (void)printf(" Query"); if (TTEST(bp[8])) { switch (bp[8] >> 4) { case 0: (void)printf(" Dense-mode"); break; case 1: (void)printf(" Sparse-mode"); break; case 2: (void)printf(" Sparse-Dense-mode"); break; default: (void)printf(" mode-%d", bp[8] >> 4); break; } } if (vflag) { TCHECK2(bp[10],2); (void)printf(" (Hold-time "); relts_print(EXTRACT_16BITS(&bp[10])); (void)printf(")"); } break; case 1: (void)printf(" Register"); TCHECK2(bp[8], 20); /* ip header */ (void)printf(" for %s > %s", ipaddr_string(&bp[20]), ipaddr_string(&bp[24])); break; case 2: (void)printf(" Register-Stop"); TCHECK2(bp[12], sizeof(struct in_addr)); (void)printf(" for %s > %s", ipaddr_string(&bp[8]), ipaddr_string(&bp[12])); break; case 3: (void)printf(" Join/Prune"); if (vflag) pimv1_join_prune_print(&bp[8], len - 8); break; case 4: (void)printf(" RP-reachable"); if (vflag) { TCHECK2(bp[22], 2); (void)printf(" group %s", ipaddr_string(&bp[8])); if (EXTRACT_32BITS(&bp[12]) != 0xffffffff) (void)printf("/%s", ipaddr_string(&bp[12])); (void)printf(" RP %s hold ", ipaddr_string(&bp[16])); relts_print(EXTRACT_16BITS(&bp[22])); } break; case 5: (void)printf(" Assert"); TCHECK2(bp[16], sizeof(struct in_addr)); (void)printf(" for %s > %s", ipaddr_string(&bp[16]), ipaddr_string(&bp[8])); if (EXTRACT_32BITS(&bp[12]) != 0xffffffff) (void)printf("/%s", ipaddr_string(&bp[12])); TCHECK2(bp[24], 4); (void)printf(" %s pref %d metric %d", (bp[20] & 0x80) ? "RP-tree" : "SPT", EXTRACT_32BITS(&bp[20]) & 0x7fffffff, EXTRACT_32BITS(&bp[24])); break; case 6: (void)printf(" Graft"); if (vflag) pimv1_join_prune_print(&bp[8], len - 8); break; case 7: (void)printf(" Graft-ACK"); if (vflag) pimv1_join_prune_print(&bp[8], len - 8); break; case 8: (void)printf(" Mode"); break; default: (void)printf(" [type %d]", type); break; } if ((bp[4] >> 4) != 1) (void)printf(" [v%d]", bp[4] >> 4); return; trunc: (void)printf("[|pim]"); return; } /* * auto-RP is a cisco protocol, documented at * ftp://ftpeng.cisco.com/ipmulticast/specs/pim-autorp-spec01.txt * * This implements version 1+, dated Sept 9, 1998. */ void cisco_autorp_print(register const u_char *bp, register u_int len) { int type; int numrps; int hold; TCHECK(bp[0]); (void)printf(" auto-rp "); type = bp[0]; switch (type) { case 0x11: (void)printf("candidate-advert"); break; case 0x12: (void)printf("mapping"); break; default: (void)printf("type-0x%02x", type); break; } TCHECK(bp[1]); numrps = bp[1]; TCHECK2(bp[2], 2); (void)printf(" Hold "); hold = EXTRACT_16BITS(&bp[2]); if (hold) relts_print(EXTRACT_16BITS(&bp[2])); else printf("FOREVER"); /* Next 4 bytes are reserved. */ bp += 8; len -= 8; /*XXX skip unless -v? */ /* * Rest of packet: * numrps entries of the form: * 32 bits: RP * 6 bits: reserved * 2 bits: PIM version supported, bit 0 is "supports v1", 1 is "v2". * 8 bits: # of entries for this RP * each entry: 7 bits: reserved, 1 bit: negative, * 8 bits: mask 32 bits: source * lather, rinse, repeat. */ while (numrps--) { int nentries; char s; TCHECK2(bp[0], 4); (void)printf(" RP %s", ipaddr_string(bp)); TCHECK(bp[4]); switch (bp[4] & 0x3) { case 0: printf(" PIMv?"); break; case 1: printf(" PIMv1"); break; case 2: printf(" PIMv2"); break; case 3: printf(" PIMv1+2"); break; } if (bp[4] & 0xfc) (void)printf(" [rsvd=0x%02x]", bp[4] & 0xfc); TCHECK(bp[5]); nentries = bp[5]; bp += 6; len -= 6; s = ' '; for (; nentries; nentries--) { TCHECK2(bp[0], 6); (void)printf("%c%s%s/%d", s, bp[0] & 1 ? "!" : "", ipaddr_string(&bp[2]), bp[1]); if (bp[0] & 0xfe) (void)printf("[rsvd=0x%02x]", bp[0] & 0xfe); s = ','; bp += 6; len -= 6; } } return; trunc: (void)printf("[|autorp]"); return; } void pim_print(register const u_char *bp, register u_int len) { register const u_char *ep; register struct pim *pim = (struct pim *)bp; ep = (const u_char *)snapend; if (bp >= ep) return; #ifdef notyet /* currently we see only version and type */ TCHECK(pim->pim_rsv); #endif switch (PIM_VER(pim->pim_typever)) { case 2: if (!vflag) { printf("PIMv%u, %s, length %u", PIM_VER(pim->pim_typever), tok2str(pimv2_type_values,"Unknown Type",PIM_TYPE(pim->pim_typever)), len); return; } else { printf("PIMv%u, length %u\n\t%s", PIM_VER(pim->pim_typever), len, tok2str(pimv2_type_values,"Unknown Type",PIM_TYPE(pim->pim_typever))); pimv2_print(bp, len); } break; default: printf("PIMv%u, length %u", PIM_VER(pim->pim_typever), len); break; } return; } /* * PIMv2 uses encoded address representations. * * The last PIM-SM I-D before RFC2117 was published specified the * following representation for unicast addresses. However, RFC2117 * specified no encoding for unicast addresses with the unicast * address length specified in the header. Therefore, we have to * guess which encoding is being used (Cisco's PIMv2 implementation * uses the non-RFC encoding). RFC2117 turns a previously "Reserved" * field into a 'unicast-address-length-in-bytes' field. We guess * that it's the draft encoding if this reserved field is zero. * * RFC2362 goes back to the encoded format, and calls the addr length * field "reserved" again. * * The first byte is the address family, from: * * 0 Reserved * 1 IP (IP version 4) * 2 IP6 (IP version 6) * 3 NSAP * 4 HDLC (8-bit multidrop) * 5 BBN 1822 * 6 802 (includes all 802 media plus Ethernet "canonical format") * 7 E.163 * 8 E.164 (SMDS, Frame Relay, ATM) * 9 F.69 (Telex) * 10 X.121 (X.25, Frame Relay) * 11 IPX * 12 Appletalk * 13 Decnet IV * 14 Banyan Vines * 15 E.164 with NSAP format subaddress * * In addition, the second byte is an "Encoding". 0 is the default * encoding for the address family, and no other encodings are currently * specified. * */ static int pimv2_addr_len; enum pimv2_addrtype { pimv2_unicast, pimv2_group, pimv2_source }; /* 0 1 2 3 * 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * | Addr Family | Encoding Type | Unicast Address | * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+++++++ * 0 1 2 3 * 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * | Addr Family | Encoding Type | Reserved | Mask Len | * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * | Group multicast Address | * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * 0 1 2 3 * 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * | Addr Family | Encoding Type | Rsrvd |S|W|R| Mask Len | * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * | Source Address | * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ */ static int pimv2_addr_print(const u_char *bp, enum pimv2_addrtype at, int silent) { int af; int len, hdrlen; TCHECK(bp[0]); if (pimv2_addr_len == 0) { TCHECK(bp[1]); switch (bp[0]) { case 1: af = AF_INET; len = sizeof(struct in_addr); break; #ifdef INET6 case 2: af = AF_INET6; len = sizeof(struct in6_addr); break; #endif default: return -1; } if (bp[1] != 0) return -1; hdrlen = 2; } else { switch (pimv2_addr_len) { case sizeof(struct in_addr): af = AF_INET; break; #ifdef INET6 case sizeof(struct in6_addr): af = AF_INET6; break; #endif default: return -1; break; } len = pimv2_addr_len; hdrlen = 0; } bp += hdrlen; switch (at) { case pimv2_unicast: TCHECK2(bp[0], len); if (af == AF_INET) { if (!silent) (void)printf("%s", ipaddr_string(bp)); } #ifdef INET6 else if (af == AF_INET6) { if (!silent) (void)printf("%s", ip6addr_string(bp)); } #endif return hdrlen + len; case pimv2_group: case pimv2_source: TCHECK2(bp[0], len + 2); if (af == AF_INET) { if (!silent) { (void)printf("%s", ipaddr_string(bp + 2)); if (bp[1] != 32) (void)printf("/%u", bp[1]); } } #ifdef INET6 else if (af == AF_INET6) { if (!silent) { (void)printf("%s", ip6addr_string(bp + 2)); if (bp[1] != 128) (void)printf("/%u", bp[1]); } } #endif if (bp[0] && !silent) { if (at == pimv2_group) { (void)printf("(0x%02x)", bp[0]); } else { (void)printf("(%s%s%s", bp[0] & 0x04 ? "S" : "", bp[0] & 0x02 ? "W" : "", bp[0] & 0x01 ? "R" : ""); if (bp[0] & 0xf8) { (void) printf("+0x%02x", bp[0] & 0xf8); } (void)printf(")"); } } return hdrlen + 2 + len; default: return -1; } trunc: return -1; } static void pimv2_print(register const u_char *bp, register u_int len) { register const u_char *ep; register struct pim *pim = (struct pim *)bp; int advance; ep = (const u_char *)snapend; if (bp >= ep) return; if (ep > bp + len) ep = bp + len; TCHECK(pim->pim_rsv); pimv2_addr_len = pim->pim_rsv; if (pimv2_addr_len != 0) (void)printf(", RFC2117-encoding"); printf(", cksum 0x%04x ", EXTRACT_16BITS(&pim->pim_cksum)); if (EXTRACT_16BITS(&pim->pim_cksum) == 0) { printf("(unverified)"); } else { printf("(%scorrect)", TTEST2(bp[0], len) && in_cksum((const u_short*)bp, len, 0) ? "in" : "" ); } switch (PIM_TYPE(pim->pim_typever)) { case PIMV2_TYPE_HELLO: { u_int16_t otype, olen; bp += 4; while (bp < ep) { TCHECK2(bp[0], 4); otype = EXTRACT_16BITS(&bp[0]); olen = EXTRACT_16BITS(&bp[2]); TCHECK2(bp[0], 4 + olen); printf("\n\t %s Option (%u), length %u, Value: ", tok2str( pimv2_hello_option_values,"Unknown",otype), otype, olen); bp += 4; switch (otype) { case PIMV2_HELLO_OPTION_HOLDTIME: relts_print(EXTRACT_16BITS(bp)); break; case PIMV2_HELLO_OPTION_LANPRUNEDELAY: if (olen != 4) { (void)printf("ERROR: Option Lenght != 4 Bytes (%u)", olen); } else { char t_bit; u_int16_t lan_delay, override_interval; lan_delay = EXTRACT_16BITS(bp); override_interval = EXTRACT_16BITS(bp+2); t_bit = (lan_delay & 0x8000)? 1 : 0; lan_delay &= ~0x8000; (void)printf("\n\t T-bit=%d, LAN delay %dms, Override interval %dms", t_bit, lan_delay, override_interval); } break; case PIMV2_HELLO_OPTION_DR_PRIORITY_OLD: case PIMV2_HELLO_OPTION_DR_PRIORITY: switch (olen) { case 0: printf("Bi-Directional Capability (Old)"); break; case 4: printf("%u", EXTRACT_32BITS(bp)); break; default: printf("ERROR: Option Lenght != 4 Bytes (%u)", olen); break; } break; case PIMV2_HELLO_OPTION_GENID: (void)printf("0x%08x", EXTRACT_32BITS(bp)); break; case PIMV2_HELLO_OPTION_REFRESH_CAP: (void)printf("v%d", *bp); if (*(bp+1) != 0) { (void)printf(", interval "); relts_print(*(bp+1)); } if (EXTRACT_16BITS(bp+2) != 0) { (void)printf(" ?0x%04x?", EXTRACT_16BITS(bp+2)); } break; case PIMV2_HELLO_OPTION_BIDIR_CAP: break; case PIMV2_HELLO_OPTION_ADDRESS_LIST_OLD: case PIMV2_HELLO_OPTION_ADDRESS_LIST: if (vflag > 1) { const u_char *ptr = bp; while (ptr < (bp+olen)) { int advance; printf("\n\t "); advance = pimv2_addr_print(ptr, pimv2_unicast, 0); if (advance < 0) { printf("..."); break; } ptr += advance; } } break; default: if (vflag <= 1) print_unknown_data(bp,"\n\t ",olen); break; } /* do we want to see an additionally hexdump ? */ if (vflag> 1) print_unknown_data(bp,"\n\t ",olen); bp += olen; } break; } case PIMV2_TYPE_REGISTER: { struct ip *ip; if (!TTEST2(*(bp+4), PIMV2_REGISTER_FLAG_LEN)) goto trunc; printf(", Flags [ %s ]\n\t", tok2str(pimv2_register_flag_values, "none", EXTRACT_32BITS(bp+4))); bp += 8; len -= 8; /* encapsulated multicast packet */ ip = (struct ip *)bp; switch (IP_V(ip)) { case 0: /* Null header */ (void)printf("IP-Null-header %s > %s", ipaddr_string(&ip->ip_src), ipaddr_string(&ip->ip_dst)); break; case 4: /* IPv4 */ ip_print(gndo, bp, len); break; #ifdef INET6 case 6: /* IPv6 */ ip6_print(bp, len); break; #endif default: (void)printf("IP ver %d", IP_V(ip)); break; } break; } case PIMV2_TYPE_REGISTER_STOP: bp += 4; len -= 4; if (bp >= ep) break; (void)printf(" group="); if ((advance = pimv2_addr_print(bp, pimv2_group, 0)) < 0) { (void)printf("..."); break; } bp += advance; len -= advance; if (bp >= ep) break; (void)printf(" source="); if ((advance = pimv2_addr_print(bp, pimv2_unicast, 0)) < 0) { (void)printf("..."); break; } bp += advance; len -= advance; break; case PIMV2_TYPE_JOIN_PRUNE: case PIMV2_TYPE_GRAFT: case PIMV2_TYPE_GRAFT_ACK: /* * 0 1 2 3 * 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * |PIM Ver| Type | Addr length | Checksum | * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * | Unicast-Upstream Neighbor Address | * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * | Reserved | Num groups | Holdtime | * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * | Encoded-Multicast Group Address-1 | * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * | Number of Joined Sources | Number of Pruned Sources | * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * | Encoded-Joined Source Address-1 | * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * | . | * | . | * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * | Encoded-Joined Source Address-n | * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * | Encoded-Pruned Source Address-1 | * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * | . | * | . | * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * | Encoded-Pruned Source Address-n | * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * | . | * | . | * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * | Encoded-Multicast Group Address-n | * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ */ { u_int8_t ngroup; u_int16_t holdtime; u_int16_t njoin; u_int16_t nprune; int i, j; bp += 4; len -= 4; if (PIM_TYPE(pim->pim_typever) != 7) { /*not for Graft-ACK*/ if (bp >= ep) break; (void)printf(", upstream-neighbor: "); if ((advance = pimv2_addr_print(bp, pimv2_unicast, 0)) < 0) { (void)printf("..."); break; } bp += advance; len -= advance; } if (bp + 4 > ep) break; ngroup = bp[1]; holdtime = EXTRACT_16BITS(&bp[2]); (void)printf("\n\t %u group(s)", ngroup); if (PIM_TYPE(pim->pim_typever) != 7) { /*not for Graft-ACK*/ (void)printf(", holdtime: "); if (holdtime == 0xffff) (void)printf("infinite"); else relts_print(holdtime); } bp += 4; len -= 4; for (i = 0; i < ngroup; i++) { if (bp >= ep) goto jp_done; (void)printf("\n\t group #%u: ", i+1); if ((advance = pimv2_addr_print(bp, pimv2_group, 0)) < 0) { (void)printf("...)"); goto jp_done; } bp += advance; len -= advance; if (bp + 4 > ep) { (void)printf("...)"); goto jp_done; } njoin = EXTRACT_16BITS(&bp[0]); nprune = EXTRACT_16BITS(&bp[2]); (void)printf(", joined sources: %u, pruned sources: %u", njoin,nprune); bp += 4; len -= 4; for (j = 0; j < njoin; j++) { (void)printf("\n\t joined source #%u: ",j+1); if ((advance = pimv2_addr_print(bp, pimv2_source, 0)) < 0) { (void)printf("...)"); goto jp_done; } bp += advance; len -= advance; } for (j = 0; j < nprune; j++) { (void)printf("\n\t pruned source #%u: ",j+1); if ((advance = pimv2_addr_print(bp, pimv2_source, 0)) < 0) { (void)printf("...)"); goto jp_done; } bp += advance; len -= advance; } } jp_done: break; } case PIMV2_TYPE_BOOTSTRAP: { int i, j, frpcnt; bp += 4; /* Fragment Tag, Hash Mask len, and BSR-priority */ if (bp + sizeof(u_int16_t) >= ep) break; (void)printf(" tag=%x", EXTRACT_16BITS(bp)); bp += sizeof(u_int16_t); if (bp >= ep) break; (void)printf(" hashmlen=%d", bp[0]); if (bp + 1 >= ep) break; (void)printf(" BSRprio=%d", bp[1]); bp += 2; /* Encoded-Unicast-BSR-Address */ if (bp >= ep) break; (void)printf(" BSR="); if ((advance = pimv2_addr_print(bp, pimv2_unicast, 0)) < 0) { (void)printf("..."); break; } bp += advance; for (i = 0; bp < ep; i++) { /* Encoded-Group Address */ (void)printf(" (group%d: ", i); if ((advance = pimv2_addr_print(bp, pimv2_group, 0)) < 0) { (void)printf("...)"); goto bs_done; } bp += advance; /* RP-Count, Frag RP-Cnt, and rsvd */ if (bp >= ep) { (void)printf("...)"); goto bs_done; } (void)printf(" RPcnt=%d", bp[0]); if (bp + 1 >= ep) { (void)printf("...)"); goto bs_done; } (void)printf(" FRPcnt=%d", frpcnt = bp[1]); bp += 4; for (j = 0; j < frpcnt && bp < ep; j++) { /* each RP info */ (void)printf(" RP%d=", j); if ((advance = pimv2_addr_print(bp, pimv2_unicast, 0)) < 0) { (void)printf("...)"); goto bs_done; } bp += advance; if (bp + 1 >= ep) { (void)printf("...)"); goto bs_done; } (void)printf(",holdtime="); relts_print(EXTRACT_16BITS(bp)); if (bp + 2 >= ep) { (void)printf("...)"); goto bs_done; } (void)printf(",prio=%d", bp[2]); bp += 4; } (void)printf(")"); } bs_done: break; } case PIMV2_TYPE_ASSERT: bp += 4; len -= 4; if (bp >= ep) break; (void)printf(" group="); if ((advance = pimv2_addr_print(bp, pimv2_group, 0)) < 0) { (void)printf("..."); break; } bp += advance; len -= advance; if (bp >= ep) break; (void)printf(" src="); if ((advance = pimv2_addr_print(bp, pimv2_unicast, 0)) < 0) { (void)printf("..."); break; } bp += advance; len -= advance; if (bp + 8 > ep) break; if (bp[0] & 0x80) (void)printf(" RPT"); (void)printf(" pref=%u", EXTRACT_32BITS(&bp[0]) & 0x7fffffff); (void)printf(" metric=%u", EXTRACT_32BITS(&bp[4])); break; case PIMV2_TYPE_CANDIDATE_RP: { int i, pfxcnt; bp += 4; /* Prefix-Cnt, Priority, and Holdtime */ if (bp >= ep) break; (void)printf(" prefix-cnt=%d", bp[0]); pfxcnt = bp[0]; if (bp + 1 >= ep) break; (void)printf(" prio=%d", bp[1]); if (bp + 3 >= ep) break; (void)printf(" holdtime="); relts_print(EXTRACT_16BITS(&bp[2])); bp += 4; /* Encoded-Unicast-RP-Address */ if (bp >= ep) break; (void)printf(" RP="); if ((advance = pimv2_addr_print(bp, pimv2_unicast, 0)) < 0) { (void)printf("..."); break; } bp += advance; /* Encoded-Group Addresses */ for (i = 0; i < pfxcnt && bp < ep; i++) { (void)printf(" Group%d=", i); if ((advance = pimv2_addr_print(bp, pimv2_group, 0)) < 0) { (void)printf("..."); break; } bp += advance; } break; } case PIMV2_TYPE_PRUNE_REFRESH: (void)printf(" src="); if ((advance = pimv2_addr_print(bp, pimv2_unicast, 0)) < 0) { (void)printf("..."); break; } bp += advance; (void)printf(" grp="); if ((advance = pimv2_addr_print(bp, pimv2_group, 0)) < 0) { (void)printf("..."); break; } bp += advance; (void)printf(" forwarder="); if ((advance = pimv2_addr_print(bp, pimv2_unicast, 0)) < 0) { (void)printf("..."); break; } bp += advance; TCHECK2(bp[0], 2); (void)printf(" TUNR "); relts_print(EXTRACT_16BITS(bp)); break; default: (void)printf(" [type %d]", PIM_TYPE(pim->pim_typever)); break; } return; trunc: (void)printf("[|pim]"); } /* * Local Variables: * c-style: whitesmith * c-basic-offset: 8 * End: */ tcpdump-3.9.8/./ipproto.h0000644000026300017500000001127210320053323013325 0ustar mcrmcr/* * Copyright (c) 1982, 1986, 1990, 1993 * The Regents of the University of California. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. All advertising materials mentioning features or use of this software * must display the following acknowledgement: * This product includes software developed by the University of * California, Berkeley and its contributors. * 4. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * * @(#) $Header: /tcpdump/master/tcpdump/ipproto.h,v 1.4.2.2 2005/09/20 06:05:37 guy Exp $ (LBL) * * From: * @(#)in.h 8.3 (Berkeley) 1/3/94 * $FreeBSD: src/sys/netinet/in.h,v 1.38.2.3 1999/08/29 16:29:34 peter Exp $ */ extern struct tok ipproto_values[]; #ifndef IPPROTO_IP #define IPPROTO_IP 0 /* dummy for IP */ #endif #ifndef IPPROTO_HOPOPTS #define IPPROTO_HOPOPTS 0 /* IPv6 hop-by-hop options */ #endif #ifndef IPPROTO_ICMP #define IPPROTO_ICMP 1 /* control message protocol */ #endif #ifndef IPPROTO_IGMP #define IPPROTO_IGMP 2 /* group mgmt protocol */ #endif #ifndef IPPROTO_IPV4 #define IPPROTO_IPV4 4 #endif #ifndef IPPROTO_TCP #define IPPROTO_TCP 6 /* tcp */ #endif #ifndef IPPROTO_EGP #define IPPROTO_EGP 8 /* exterior gateway protocol */ #endif #ifndef IPPROTO_PIGP #define IPPROTO_PIGP 9 #endif #ifndef IPPROTO_UDP #define IPPROTO_UDP 17 /* user datagram protocol */ #endif #ifndef IPPROTO_DCCP #define IPPROTO_DCCP 33 /* datagram congestion control protocol */ #endif #ifndef IPPROTO_IPV6 #define IPPROTO_IPV6 41 #endif #ifndef IPPROTO_ROUTING #define IPPROTO_ROUTING 43 /* IPv6 routing header */ #endif #ifndef IPPROTO_FRAGMENT #define IPPROTO_FRAGMENT 44 /* IPv6 fragmentation header */ #endif #ifndef IPPROTO_RSVP #define IPPROTO_RSVP 46 /* resource reservation */ #endif #ifndef IPPROTO_GRE #define IPPROTO_GRE 47 /* General Routing Encap. */ #endif #ifndef IPPROTO_ESP #define IPPROTO_ESP 50 /* SIPP Encap Sec. Payload */ #endif #ifndef IPPROTO_AH #define IPPROTO_AH 51 /* SIPP Auth Header */ #endif #ifndef IPPROTO_MOBILE #define IPPROTO_MOBILE 55 #endif #ifndef IPPROTO_ICMPV6 #define IPPROTO_ICMPV6 58 /* ICMPv6 */ #endif #ifndef IPPROTO_NONE #define IPPROTO_NONE 59 /* IPv6 no next header */ #endif #ifndef IPPROTO_DSTOPTS #define IPPROTO_DSTOPTS 60 /* IPv6 destination options */ #endif #ifndef IPPROTO_MOBILITY_OLD /* * The current Protocol Numbers list says that the IP protocol number for * mobility headers is 135; it cites draft-ietf-mobileip-ipv6-24, but * that draft doesn't actually give a number. * * It appears that 62 used to be used, even though that's assigned to * a protocol called CFTP; however, the only reference for CFTP is a * Network Message from BBN back in 1982, so, for now, we support 62, * aas well as 135, as a protocol number for mobility headers. */ #define IPPROTO_MOBILITY_OLD 62 #endif #ifndef IPPROTO_ND #define IPPROTO_ND 77 /* Sun net disk proto (temp.) */ #endif #ifndef IPPROTO_EIGRP #define IPPROTO_EIGRP 88 /* Cisco/GXS IGRP */ #endif #ifndef IPPROTO_OSPF #define IPPROTO_OSPF 89 #endif #ifndef IPPROTO_PIM #define IPPROTO_PIM 103 #endif #ifndef IPPROTO_IPCOMP #define IPPROTO_IPCOMP 108 #endif #ifndef IPPROTO_VRRP #define IPPROTO_VRRP 112 #endif #ifndef IPPROTO_PGM #define IPPROTO_PGM 113 #endif #ifndef IPPROTO_SCTP #define IPPROTO_SCTP 132 #endif #ifndef IPPROTO_MOBILITY #define IPPROTO_MOBILITY 135 #endif tcpdump-3.9.8/./print-rip.c0000644000026300017500000001771707755642442013612 0ustar mcrmcr/* * Copyright (c) 1989, 1990, 1991, 1993, 1994, 1996 * The Regents of the University of California. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that: (1) source code distributions * retain the above copyright notice and this paragraph in its entirety, (2) * distributions including binary code include the above copyright notice and * this paragraph in its entirety in the documentation or other materials * provided with the distribution, and (3) all advertising materials mentioning * features or use of this software display the following acknowledgement: * ``This product includes software developed by the University of California, * Lawrence Berkeley Laboratory and its contributors.'' Neither the name of * the University nor the names of its contributors may be used to endorse * or promote products derived from this software without specific prior * written permission. * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. */ #ifndef lint static const char rcsid[] _U_ = "@(#) $Header: /tcpdump/master/tcpdump/print-rip.c,v 1.57 2003/11/16 09:36:34 guy Exp $ (LBL)"; #endif #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include #include "interface.h" #include "addrtoname.h" #include "extract.h" /* must come after interface.h */ struct rip { u_int8_t rip_cmd; /* request/response */ u_int8_t rip_vers; /* protocol version # */ u_int8_t unused[2]; /* unused */ }; #define RIPCMD_REQUEST 1 /* want info */ #define RIPCMD_RESPONSE 2 /* responding to request */ #define RIPCMD_TRACEON 3 /* turn tracing on */ #define RIPCMD_TRACEOFF 4 /* turn it off */ #define RIPCMD_POLL 5 /* want info from everybody */ #define RIPCMD_POLLENTRY 6 /* poll for entry */ static const struct tok rip_cmd_values[] = { { RIPCMD_REQUEST, "Request" }, { RIPCMD_RESPONSE, "Response" }, { RIPCMD_TRACEON, "Trace on" }, { RIPCMD_TRACEOFF, "Trace off" }, { RIPCMD_POLL, "Poll" }, { RIPCMD_POLLENTRY, "Poll Entry" }, { 0, NULL} }; #define RIP_AUTHLEN 16 #define RIP_ROUTELEN 20 /* * rfc 1723 * * 0 1 2 3 3 * 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * | Command (1) | Version (1) | unused | * +---------------+---------------+-------------------------------+ * | Address Family Identifier (2) | Route Tag (2) | * +-------------------------------+-------------------------------+ * | IP Address (4) | * +---------------------------------------------------------------+ * | Subnet Mask (4) | * +---------------------------------------------------------------+ * | Next Hop (4) | * +---------------------------------------------------------------+ * | Metric (4) | * +---------------------------------------------------------------+ * */ struct rip_netinfo { u_int16_t rip_family; u_int16_t rip_tag; u_int32_t rip_dest; u_int32_t rip_dest_mask; u_int32_t rip_router; u_int32_t rip_metric; /* cost of route */ }; static void rip_entry_print_v1(register const struct rip_netinfo *ni) { register u_short family; /* RFC 1058 */ family = EXTRACT_16BITS(&ni->rip_family); if (family != AF_INET) { printf("\n\t AFI: %u:", family); print_unknown_data((u_int8_t *)&ni->rip_family,"\n\t ",RIP_ROUTELEN); return; } if (EXTRACT_16BITS(&ni->rip_tag) || EXTRACT_32BITS(&ni->rip_dest_mask) || EXTRACT_32BITS(&ni->rip_router)) { /* MBZ fields not zero */ print_unknown_data((u_int8_t *)&ni->rip_family,"\n\t ",RIP_ROUTELEN); return; } /* AF_INET */ printf("\n\t %s, metric: %u", ipaddr_string(&ni->rip_dest), EXTRACT_32BITS(&ni->rip_metric)); } static void rip_entry_print_v2(register const struct rip_netinfo *ni) { register u_char *p; register u_short family; u_char buf[RIP_AUTHLEN]; family = EXTRACT_16BITS(&ni->rip_family); if (family == 0xFFFF) { /* 16 bytes authentication ? */ if (EXTRACT_16BITS(&ni->rip_tag) == 2) { /* simple text authentication ? */ memcpy(buf, &ni->rip_dest, sizeof(buf)); buf[sizeof(buf)-1] = '\0'; for (p = buf; *p; p++) { if (!isprint(*p)) break; } printf("\n\t Simple Text Authentication data: %s", buf); } else { printf("\n\t Unknown (%u) Authentication data:", EXTRACT_16BITS(&ni->rip_tag)); print_unknown_data((u_int8_t *)&ni->rip_dest,"\n\t ",RIP_AUTHLEN); } } else if (family != AF_INET) { printf("\n\t AFI: %u", family); print_unknown_data((u_int8_t *)&ni->rip_tag,"\n\t ",RIP_ROUTELEN-2); return; } else { /* AF_INET */ printf("\n\t AFI: IPv4: %15s/%-2d, tag 0x%04x, metric: %u, next-hop: ", ipaddr_string(&ni->rip_dest), mask2plen(EXTRACT_32BITS(&ni->rip_dest_mask)), EXTRACT_16BITS(&ni->rip_tag), EXTRACT_32BITS(&ni->rip_metric)); if (EXTRACT_32BITS(&ni->rip_router)) printf("%s", ipaddr_string(&ni->rip_router)); else printf("self"); } } void rip_print(const u_char *dat, u_int length) { register const struct rip *rp; register const struct rip_netinfo *ni; register u_int i, j; register int trunc; if (snapend < dat) { printf(" [|rip]"); return; } i = snapend - dat; if (i > length) i = length; if (i < sizeof(*rp)) { printf(" [|rip]"); return; } i -= sizeof(*rp); rp = (struct rip *)dat; printf("%sRIPv%u", (vflag >= 1) ? "\n\t" : "", rp->rip_vers); switch (rp->rip_vers) { case 0: /* * RFC 1058. * * XXX - RFC 1058 says * * 0 Datagrams whose version number is zero are to be ignored. * These are from a previous version of the protocol, whose * packet format was machine-specific. * * so perhaps we should just dump the packet, in hex. */ print_unknown_data((u_int8_t *)&rp->rip_cmd,"\n\t",length); break; default: /* dump version and lets see if we know the commands name*/ printf(", %s, length: %u", tok2str(rip_cmd_values, "unknown command (%u)", rp->rip_cmd), length); if (vflag < 1) return; switch (rp->rip_cmd) { case RIPCMD_RESPONSE: j = length / sizeof(*ni); printf(", routes: %u",j); trunc = (i / sizeof(*ni)) != j; ni = (struct rip_netinfo *)(rp + 1); for (; i >= sizeof(*ni); ++ni) { if (rp->rip_vers == 1) rip_entry_print_v1(ni); else if (rp->rip_vers == 2) rip_entry_print_v2(ni); else break; i -= sizeof(*ni); } if (trunc) printf("[|rip]"); break; case RIPCMD_REQUEST: case RIPCMD_TRACEOFF: case RIPCMD_POLL: case RIPCMD_POLLENTRY: break; case RIPCMD_TRACEON: /* fall through */ default: if (vflag <= 1) { if(!print_unknown_data((u_int8_t *)rp,"\n\t",length)) return; } break; } /* do we want to see an additionally hexdump ? */ if (vflag> 1) { if(!print_unknown_data((u_int8_t *)rp,"\n\t",length)) return; } } } tcpdump-3.9.8/./smb.h0000644000026300017500000001266310164357130012430 0ustar mcrmcr/* @(#) $Header: /tcpdump/master/tcpdump/smb.h,v 1.9 2004/12/28 22:29:44 guy Exp $ (LBL) */ /* * Copyright (C) Andrew Tridgell 1995-1999 * * This software may be distributed either under the terms of the * BSD-style license that accompanies tcpdump or the GNU GPL version 2 * or later */ #define SMBMIN(a,b) ((a)<(b)?(a):(b)) /* the complete */ #define SMBmkdir 0x00 /* create directory */ #define SMBrmdir 0x01 /* delete directory */ #define SMBopen 0x02 /* open file */ #define SMBcreate 0x03 /* create file */ #define SMBclose 0x04 /* close file */ #define SMBflush 0x05 /* flush file */ #define SMBunlink 0x06 /* delete file */ #define SMBmv 0x07 /* rename file */ #define SMBgetatr 0x08 /* get file attributes */ #define SMBsetatr 0x09 /* set file attributes */ #define SMBread 0x0A /* read from file */ #define SMBwrite 0x0B /* write to file */ #define SMBlock 0x0C /* lock byte range */ #define SMBunlock 0x0D /* unlock byte range */ #define SMBctemp 0x0E /* create temporary file */ #define SMBmknew 0x0F /* make new file */ #define SMBchkpth 0x10 /* check directory path */ #define SMBexit 0x11 /* process exit */ #define SMBlseek 0x12 /* seek */ #define SMBtcon 0x70 /* tree connect */ #define SMBtconX 0x75 /* tree connect and X*/ #define SMBtdis 0x71 /* tree disconnect */ #define SMBnegprot 0x72 /* negotiate protocol */ #define SMBdskattr 0x80 /* get disk attributes */ #define SMBsearch 0x81 /* search directory */ #define SMBsplopen 0xC0 /* open print spool file */ #define SMBsplwr 0xC1 /* write to print spool file */ #define SMBsplclose 0xC2 /* close print spool file */ #define SMBsplretq 0xC3 /* return print queue */ #define SMBsends 0xD0 /* send single block message */ #define SMBsendb 0xD1 /* send broadcast message */ #define SMBfwdname 0xD2 /* forward user name */ #define SMBcancelf 0xD3 /* cancel forward */ #define SMBgetmac 0xD4 /* get machine name */ #define SMBsendstrt 0xD5 /* send start of multi-block message */ #define SMBsendend 0xD6 /* send end of multi-block message */ #define SMBsendtxt 0xD7 /* send text of multi-block message */ /* Core+ protocol */ #define SMBlockread 0x13 /* Lock a range and read */ #define SMBwriteunlock 0x14 /* Unlock a range then write */ #define SMBreadbraw 0x1a /* read a block of data with no smb header */ #define SMBwritebraw 0x1d /* write a block of data with no smb header */ #define SMBwritec 0x20 /* secondary write request */ #define SMBwriteclose 0x2c /* write a file then close it */ /* dos extended protocol */ #define SMBreadBraw 0x1A /* read block raw */ #define SMBreadBmpx 0x1B /* read block multiplexed */ #define SMBreadBs 0x1C /* read block (secondary response) */ #define SMBwriteBraw 0x1D /* write block raw */ #define SMBwriteBmpx 0x1E /* write block multiplexed */ #define SMBwriteBs 0x1F /* write block (secondary request) */ #define SMBwriteC 0x20 /* write complete response */ #define SMBsetattrE 0x22 /* set file attributes expanded */ #define SMBgetattrE 0x23 /* get file attributes expanded */ #define SMBlockingX 0x24 /* lock/unlock byte ranges and X */ #define SMBtrans 0x25 /* transaction - name, bytes in/out */ #define SMBtranss 0x26 /* transaction (secondary request/response) */ #define SMBioctl 0x27 /* IOCTL */ #define SMBioctls 0x28 /* IOCTL (secondary request/response) */ #define SMBcopy 0x29 /* copy */ #define SMBmove 0x2A /* move */ #define SMBecho 0x2B /* echo */ #define SMBopenX 0x2D /* open and X */ #define SMBreadX 0x2E /* read and X */ #define SMBwriteX 0x2F /* write and X */ #define SMBsesssetupX 0x73 /* Session Set Up & X (including User Logon) */ #define SMBffirst 0x82 /* find first */ #define SMBfunique 0x83 /* find unique */ #define SMBfclose 0x84 /* find close */ #define SMBinvalid 0xFE /* invalid command */ /* Extended 2.0 protocol */ #define SMBtrans2 0x32 /* TRANS2 protocol set */ #define SMBtranss2 0x33 /* TRANS2 protocol set, secondary command */ #define SMBfindclose 0x34 /* Terminate a TRANSACT2_FINDFIRST */ #define SMBfindnclose 0x35 /* Terminate a TRANSACT2_FINDNOTIFYFIRST */ #define SMBulogoffX 0x74 /* user logoff */ /* NT SMB extensions. */ #define SMBnttrans 0xA0 /* NT transact */ #define SMBnttranss 0xA1 /* NT transact secondary */ #define SMBntcreateX 0xA2 /* NT create and X */ #define SMBntcancel 0xA4 /* NT cancel */ /* pathworks special */ #define pSETDIR '\377' /* these are the TRANS2 sub commands */ #define TRANSACT2_OPEN 0 #define TRANSACT2_FINDFIRST 1 #define TRANSACT2_FINDNEXT 2 #define TRANSACT2_QFSINFO 3 #define TRANSACT2_SETFSINFO 4 #define TRANSACT2_QPATHINFO 5 #define TRANSACT2_SETPATHINFO 6 #define TRANSACT2_QFILEINFO 7 #define TRANSACT2_SETFILEINFO 8 #define TRANSACT2_FSCTL 9 #define TRANSACT2_IOCTL 10 #define TRANSACT2_FINDNOTIFYFIRST 11 #define TRANSACT2_FINDNOTIFYNEXT 12 #define TRANSACT2_MKDIR 13 #define PTR_DIFF(p1, p2) ((size_t)(((char *)(p1)) - (char *)(p2))) /* some protos */ const u_char *smb_fdata(const u_char *, const char *, const u_char *, int); tcpdump-3.9.8/./print-eap.c0000644000026300017500000000377610042264213013540 0ustar mcrmcr/* * Copyright (c) 2004 - Michael Richardson * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that: (1) source code distributions * retain the above copyright notice and this paragraph in its entirety, (2) * distributions including binary code include the above copyright notice and * this paragraph in its entirety in the documentation or other materials * provided with the distribution, and (3) all advertising materials mentioning * features or use of this software display the following acknowledgement: * ``This product includes software developed by the University of California, * Lawrence Berkeley Laboratory and its contributors.'' Neither the name of * the University nor the names of its contributors may be used to endorse * or promote products derived from this software without specific prior * written permission. * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * * Format and print bootp packets. */ #ifndef lint static const char rcsid[] _U_ = "@(#) $Header: /tcpdump/master/tcpdump/print-eap.c,v 1.3 2004/04/23 19:03:39 mcr Exp $"; #endif #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include #include "netdissect.h" #include "addrtoname.h" #include "extract.h" #include "ether.h" struct eap_packet_t { unsigned char code; unsigned char id; unsigned char length[2]; unsigned char data[1]; }; /* * Print bootp requests */ void eap_print(netdissect_options *ndo, register const u_char *cp, u_int length _U_) { const struct eap_packet_t *eap; eap = (const struct eap_packet_t *)cp; ND_TCHECK(eap->data); ND_PRINT((ndo, "EAP code=%u id=%u length=%u ", eap->code, eap->id, (eap->length[0]<<8) + eap->length[1])); if (!ndo->ndo_vflag) return; trunc: ; } tcpdump-3.9.8/./bootp.h0000644000026300017500000001771310676336430013003 0ustar mcrmcr/* @(#) $Header: /tcpdump/master/tcpdump/bootp.h,v 1.15.4.3 2007/08/21 22:02:08 guy Exp $ (LBL) */ /* * Bootstrap Protocol (BOOTP). RFC951 and RFC1048. * * This file specifies the "implementation-independent" BOOTP protocol * information which is common to both client and server. * * Copyright 1988 by Carnegie Mellon. * * Permission to use, copy, modify, and distribute this program for any * purpose and without fee is hereby granted, provided that this copyright * and permission notice appear on all copies and supporting documentation, * the name of Carnegie Mellon not be used in advertising or publicity * pertaining to distribution of the program without specific prior * permission, and notice be given in supporting documentation that copying * and distribution is by permission of Carnegie Mellon and Stanford * University. Carnegie Mellon makes no representations about the * suitability of this software for any purpose. It is provided "as is" * without express or implied warranty. */ struct bootp { u_int8_t bp_op; /* packet opcode type */ u_int8_t bp_htype; /* hardware addr type */ u_int8_t bp_hlen; /* hardware addr length */ u_int8_t bp_hops; /* gateway hops */ u_int32_t bp_xid; /* transaction ID */ u_int16_t bp_secs; /* seconds since boot began */ u_int16_t bp_flags; /* flags - see bootp_flag_values[] in print-bootp.c */ struct in_addr bp_ciaddr; /* client IP address */ struct in_addr bp_yiaddr; /* 'your' IP address */ struct in_addr bp_siaddr; /* server IP address */ struct in_addr bp_giaddr; /* gateway IP address */ u_int8_t bp_chaddr[16]; /* client hardware address */ u_int8_t bp_sname[64]; /* server host name */ u_int8_t bp_file[128]; /* boot file name */ u_int8_t bp_vend[64]; /* vendor-specific area */ }; /* * UDP port numbers, server and client. */ #define IPPORT_BOOTPS 67 #define IPPORT_BOOTPC 68 #define BOOTPREPLY 2 #define BOOTPREQUEST 1 /* * Vendor magic cookie (v_magic) for CMU */ #define VM_CMU "CMU" /* * Vendor magic cookie (v_magic) for RFC1048 */ #define VM_RFC1048 { 99, 130, 83, 99 } /* * RFC1048 tag values used to specify what information is being supplied in * the vendor field of the packet. */ #define TAG_PAD ((u_int8_t) 0) #define TAG_SUBNET_MASK ((u_int8_t) 1) #define TAG_TIME_OFFSET ((u_int8_t) 2) #define TAG_GATEWAY ((u_int8_t) 3) #define TAG_TIME_SERVER ((u_int8_t) 4) #define TAG_NAME_SERVER ((u_int8_t) 5) #define TAG_DOMAIN_SERVER ((u_int8_t) 6) #define TAG_LOG_SERVER ((u_int8_t) 7) #define TAG_COOKIE_SERVER ((u_int8_t) 8) #define TAG_LPR_SERVER ((u_int8_t) 9) #define TAG_IMPRESS_SERVER ((u_int8_t) 10) #define TAG_RLP_SERVER ((u_int8_t) 11) #define TAG_HOSTNAME ((u_int8_t) 12) #define TAG_BOOTSIZE ((u_int8_t) 13) #define TAG_END ((u_int8_t) 255) /* RFC1497 tags */ #define TAG_DUMPPATH ((u_int8_t) 14) #define TAG_DOMAINNAME ((u_int8_t) 15) #define TAG_SWAP_SERVER ((u_int8_t) 16) #define TAG_ROOTPATH ((u_int8_t) 17) #define TAG_EXTPATH ((u_int8_t) 18) /* RFC2132 */ #define TAG_IP_FORWARD ((u_int8_t) 19) #define TAG_NL_SRCRT ((u_int8_t) 20) #define TAG_PFILTERS ((u_int8_t) 21) #define TAG_REASS_SIZE ((u_int8_t) 22) #define TAG_DEF_TTL ((u_int8_t) 23) #define TAG_MTU_TIMEOUT ((u_int8_t) 24) #define TAG_MTU_TABLE ((u_int8_t) 25) #define TAG_INT_MTU ((u_int8_t) 26) #define TAG_LOCAL_SUBNETS ((u_int8_t) 27) #define TAG_BROAD_ADDR ((u_int8_t) 28) #define TAG_DO_MASK_DISC ((u_int8_t) 29) #define TAG_SUPPLY_MASK ((u_int8_t) 30) #define TAG_DO_RDISC ((u_int8_t) 31) #define TAG_RTR_SOL_ADDR ((u_int8_t) 32) #define TAG_STATIC_ROUTE ((u_int8_t) 33) #define TAG_USE_TRAILERS ((u_int8_t) 34) #define TAG_ARP_TIMEOUT ((u_int8_t) 35) #define TAG_ETH_ENCAP ((u_int8_t) 36) #define TAG_TCP_TTL ((u_int8_t) 37) #define TAG_TCP_KEEPALIVE ((u_int8_t) 38) #define TAG_KEEPALIVE_GO ((u_int8_t) 39) #define TAG_NIS_DOMAIN ((u_int8_t) 40) #define TAG_NIS_SERVERS ((u_int8_t) 41) #define TAG_NTP_SERVERS ((u_int8_t) 42) #define TAG_VENDOR_OPTS ((u_int8_t) 43) #define TAG_NETBIOS_NS ((u_int8_t) 44) #define TAG_NETBIOS_DDS ((u_int8_t) 45) #define TAG_NETBIOS_NODE ((u_int8_t) 46) #define TAG_NETBIOS_SCOPE ((u_int8_t) 47) #define TAG_XWIN_FS ((u_int8_t) 48) #define TAG_XWIN_DM ((u_int8_t) 49) #define TAG_NIS_P_DOMAIN ((u_int8_t) 64) #define TAG_NIS_P_SERVERS ((u_int8_t) 65) #define TAG_MOBILE_HOME ((u_int8_t) 68) #define TAG_SMPT_SERVER ((u_int8_t) 69) #define TAG_POP3_SERVER ((u_int8_t) 70) #define TAG_NNTP_SERVER ((u_int8_t) 71) #define TAG_WWW_SERVER ((u_int8_t) 72) #define TAG_FINGER_SERVER ((u_int8_t) 73) #define TAG_IRC_SERVER ((u_int8_t) 74) #define TAG_STREETTALK_SRVR ((u_int8_t) 75) #define TAG_STREETTALK_STDA ((u_int8_t) 76) /* DHCP options */ #define TAG_REQUESTED_IP ((u_int8_t) 50) #define TAG_IP_LEASE ((u_int8_t) 51) #define TAG_OPT_OVERLOAD ((u_int8_t) 52) #define TAG_TFTP_SERVER ((u_int8_t) 66) #define TAG_BOOTFILENAME ((u_int8_t) 67) #define TAG_DHCP_MESSAGE ((u_int8_t) 53) #define TAG_SERVER_ID ((u_int8_t) 54) #define TAG_PARM_REQUEST ((u_int8_t) 55) #define TAG_MESSAGE ((u_int8_t) 56) #define TAG_MAX_MSG_SIZE ((u_int8_t) 57) #define TAG_RENEWAL_TIME ((u_int8_t) 58) #define TAG_REBIND_TIME ((u_int8_t) 59) #define TAG_VENDOR_CLASS ((u_int8_t) 60) #define TAG_CLIENT_ID ((u_int8_t) 61) /* RFC 2241 */ #define TAG_NDS_SERVERS ((u_int8_t) 85) #define TAG_NDS_TREE_NAME ((u_int8_t) 86) #define TAG_NDS_CONTEXT ((u_int8_t) 87) /* RFC 2242 */ #define TAG_NDS_IPDOMAIN ((u_int8_t) 62) #define TAG_NDS_IPINFO ((u_int8_t) 63) /* RFC 2485 */ #define TAG_OPEN_GROUP_UAP ((u_int8_t) 98) /* RFC 2563 */ #define TAG_DISABLE_AUTOCONF ((u_int8_t) 116) /* RFC 2610 */ #define TAG_SLP_DA ((u_int8_t) 78) #define TAG_SLP_SCOPE ((u_int8_t) 79) /* RFC 2937 */ #define TAG_NS_SEARCH ((u_int8_t) 117) /* RFC 3011 */ #define TAG_IP4_SUBNET_SELECT ((u_int8_t) 118) /* RFC 3442 */ #define TAG_CLASSLESS_STATIC_RT ((u_int8_t) 121) #define TAG_CLASSLESS_STA_RT_MS ((u_int8_t) 249) /* ftp://ftp.isi.edu/.../assignments/bootp-dhcp-extensions */ #define TAG_USER_CLASS ((u_int8_t) 77) #define TAG_SLP_NAMING_AUTH ((u_int8_t) 80) #define TAG_CLIENT_FQDN ((u_int8_t) 81) #define TAG_AGENT_CIRCUIT ((u_int8_t) 82) #define TAG_AGENT_REMOTE ((u_int8_t) 83) #define TAG_AGENT_MASK ((u_int8_t) 84) #define TAG_TZ_STRING ((u_int8_t) 88) #define TAG_FQDN_OPTION ((u_int8_t) 89) #define TAG_AUTH ((u_int8_t) 90) #define TAG_VINES_SERVERS ((u_int8_t) 91) #define TAG_SERVER_RANK ((u_int8_t) 92) #define TAG_CLIENT_ARCH ((u_int8_t) 93) #define TAG_CLIENT_NDI ((u_int8_t) 94) #define TAG_CLIENT_GUID ((u_int8_t) 97) #define TAG_LDAP_URL ((u_int8_t) 95) #define TAG_6OVER4 ((u_int8_t) 96) #define TAG_PRINTER_NAME ((u_int8_t) 100) #define TAG_MDHCP_SERVER ((u_int8_t) 101) #define TAG_IPX_COMPAT ((u_int8_t) 110) #define TAG_NETINFO_PARENT ((u_int8_t) 112) #define TAG_NETINFO_PARENT_TAG ((u_int8_t) 113) #define TAG_URL ((u_int8_t) 114) #define TAG_FAILOVER ((u_int8_t) 115) #define TAG_EXTENDED_REQUEST ((u_int8_t) 126) #define TAG_EXTENDED_OPTION ((u_int8_t) 127) /* DHCP Message types (values for TAG_DHCP_MESSAGE option) */ #define DHCPDISCOVER 1 #define DHCPOFFER 2 #define DHCPREQUEST 3 #define DHCPDECLINE 4 #define DHCPACK 5 #define DHCPNAK 6 #define DHCPRELEASE 7 #define DHCPINFORM 8 /* * "vendor" data permitted for CMU bootp clients. */ struct cmu_vend { u_int8_t v_magic[4]; /* magic number */ u_int32_t v_flags; /* flags/opcodes, etc. */ struct in_addr v_smask; /* Subnet mask */ struct in_addr v_dgate; /* Default gateway */ struct in_addr v_dns1, v_dns2; /* Domain name servers */ struct in_addr v_ins1, v_ins2; /* IEN-116 name servers */ struct in_addr v_ts1, v_ts2; /* Time servers */ u_int8_t v_unused[24]; /* currently unused */ }; /* v_flags values */ #define VF_SMASK 1 /* Subnet mask field contains valid data */ /* RFC 4702 DHCP Client FQDN Option */ #define CLIENT_FQDN_FLAGS_S 0x01 #define CLIENT_FQDN_FLAGS_O 0x02 #define CLIENT_FQDN_FLAGS_E 0x04 #define CLIENT_FQDN_FLAGS_N 0x08 tcpdump-3.9.8/./rpc_auth.h0000644000026300017500000000553710234003647013455 0ustar mcrmcr/* @(#) $Header: /tcpdump/master/tcpdump/rpc_auth.h,v 1.1.2.1 2005/04/27 21:44:07 guy Exp $ (LBL) */ /* * Sun RPC is a product of Sun Microsystems, Inc. and is provided for * unrestricted use provided that this legend is included on all tape * media and as a part of the software program in whole or part. Users * may copy or modify Sun RPC without charge, but are not authorized * to license or distribute it to anyone else except as part of a product or * program developed by the user. * * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE * WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE. * * Sun RPC is provided with no support and without any obligation on the * part of Sun Microsystems, Inc. to assist in its use, correction, * modification or enhancement. * * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC * OR ANY PART THEREOF. * * In no event will Sun Microsystems, Inc. be liable for any lost revenue * or profits or other special, indirect and consequential damages, even if * Sun has been advised of the possibility of such damages. * * Sun Microsystems, Inc. * 2550 Garcia Avenue * Mountain View, California 94043 * * from: @(#)auth.h 1.17 88/02/08 SMI * from: @(#)auth.h 2.3 88/08/07 4.0 RPCSRC * $FreeBSD: src/include/rpc/auth.h,v 1.14.2.1 1999/08/29 14:39:02 peter Exp $ */ /* * auth.h, Authentication interface. * * Copyright (C) 1984, Sun Microsystems, Inc. * * The data structures are completely opaque to the client. The client * is required to pass a AUTH * to routines that create rpc * "sessions". */ /* * Status returned from authentication check */ enum sunrpc_auth_stat { SUNRPC_AUTH_OK=0, /* * failed at remote end */ SUNRPC_AUTH_BADCRED=1, /* bogus credentials (seal broken) */ SUNRPC_AUTH_REJECTEDCRED=2, /* client should begin new session */ SUNRPC_AUTH_BADVERF=3, /* bogus verifier (seal broken) */ SUNRPC_AUTH_REJECTEDVERF=4, /* verifier expired or was replayed */ SUNRPC_AUTH_TOOWEAK=5, /* rejected due to security reasons */ /* * failed locally */ SUNRPC_AUTH_INVALIDRESP=6, /* bogus response verifier */ SUNRPC_AUTH_FAILED=7 /* some unknown reason */ }; /* * Authentication info. Opaque to client. */ struct sunrpc_opaque_auth { u_int32_t oa_flavor; /* flavor of auth */ u_int32_t oa_len; /* length of opaque body */ /* zero or more bytes of body */ }; #define SUNRPC_AUTH_NONE 0 /* no authentication */ #define SUNRPC_AUTH_NULL 0 /* backward compatibility */ #define SUNRPC_AUTH_UNIX 1 /* unix style (uid, gids) */ #define SUNRPC_AUTH_SYS 1 /* forward compatibility */ #define SUNRPC_AUTH_SHORT 2 /* short hand unix style */ #define SUNRPC_AUTH_DES 3 /* des style (encrypted timestamps) */ tcpdump-3.9.8/./print-beep.c0000644000026300017500000000320407755642415013715 0ustar mcrmcr/* * Copyright (C) 2000, Richard Sharpe * * This software may be distributed either under the terms of the * BSD-style licence that accompanies tcpdump or under the GNU GPL * version 2 or later. * * print-beep.c * */ #ifndef lint static const char rcsid[] _U_ = "@(#) $Header: /tcpdump/master/tcpdump/print-beep.c,v 1.6 2003/11/16 09:36:13 guy Exp $"; #endif #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #ifdef HAVE_MEMORY_H #include #endif #include #include #include #include "interface.h" #include "extract.h" /* Check for a string but not go beyond length * Return TRUE on match, FALSE otherwise * * Looks at the first few chars up to tl1 ... */ static int l_strnstart(const char *, u_int, const char *, u_int); static int l_strnstart(const char *tstr1, u_int tl1, const char *str2, u_int l2) { if (tl1 > l2) return 0; return (strncmp(tstr1, str2, tl1) == 0 ? 1 : 0); } void beep_print(const u_char *bp, u_int length) { if (l_strnstart("MSG", 4, (const char *)bp, length)) /* A REQuest */ printf(" BEEP MSG"); else if (l_strnstart("RPY ", 4, (const char *)bp, length)) printf(" BEEP RPY"); else if (l_strnstart("ERR ", 4, (const char *)bp, length)) printf(" BEEP ERR"); else if (l_strnstart("ANS ", 4, (const char *)bp, length)) printf(" BEEP ANS"); else if (l_strnstart("NUL ", 4, (const char *)bp, length)) printf(" BEEP NUL"); else if (l_strnstart("SEQ ", 4, (const char *)bp, length)) printf(" BEEP SEQ"); else if (l_strnstart("END", 4, (const char *)bp, length)) printf(" BEEP END"); else printf(" BEEP (payload or undecoded)"); } tcpdump-3.9.8/./pmap_prot.h0000644000026300017500000000665510234003646013652 0ustar mcrmcr/* @(#) $Header: /tcpdump/master/tcpdump/pmap_prot.h,v 1.1.2.2 2005/04/27 21:44:06 guy Exp $ (LBL) */ /* * Sun RPC is a product of Sun Microsystems, Inc. and is provided for * unrestricted use provided that this legend is included on all tape * media and as a part of the software program in whole or part. Users * may copy or modify Sun RPC without charge, but are not authorized * to license or distribute it to anyone else except as part of a product or * program developed by the user. * * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE * WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE. * * Sun RPC is provided with no support and without any obligation on the * part of Sun Microsystems, Inc. to assist in its use, correction, * modification or enhancement. * * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC * OR ANY PART THEREOF. * * In no event will Sun Microsystems, Inc. be liable for any lost revenue * or profits or other special, indirect and consequential damages, even if * Sun has been advised of the possibility of such damages. * * Sun Microsystems, Inc. * 2550 Garcia Avenue * Mountain View, California 94043 * * from: @(#)pmap_prot.h 1.14 88/02/08 SMI * from: @(#)pmap_prot.h 2.1 88/07/29 4.0 RPCSRC * $FreeBSD: src/include/rpc/pmap_prot.h,v 1.9.2.1 1999/08/29 14:39:05 peter Exp $ */ /* * pmap_prot.h * Protocol for the local binder service, or pmap. * * Copyright (C) 1984, Sun Microsystems, Inc. * * The following procedures are supported by the protocol: * * PMAPPROC_NULL() returns () * takes nothing, returns nothing * * PMAPPROC_SET(struct pmap) returns (bool_t) * TRUE is success, FALSE is failure. Registers the tuple * [prog, vers, prot, port]. * * PMAPPROC_UNSET(struct pmap) returns (bool_t) * TRUE is success, FALSE is failure. Un-registers pair * [prog, vers]. prot and port are ignored. * * PMAPPROC_GETPORT(struct pmap) returns (long unsigned). * 0 is failure. Otherwise returns the port number where the pair * [prog, vers] is registered. It may lie! * * PMAPPROC_DUMP() RETURNS (struct pmaplist *) * * PMAPPROC_CALLIT(unsigned, unsigned, unsigned, string<>) * RETURNS (port, string<>); * usage: encapsulatedresults = PMAPPROC_CALLIT(prog, vers, proc, encapsulatedargs); * Calls the procedure on the local machine. If it is not registered, * this procedure is quite; ie it does not return error information!!! * This procedure only is supported on rpc/udp and calls via * rpc/udp. This routine only passes null authentication parameters. * This file has no interface to xdr routines for PMAPPROC_CALLIT. * * The service supports remote procedure calls on udp/ip or tcp/ip socket 111. */ #define SUNRPC_PMAPPORT ((u_int16_t)111) #define SUNRPC_PMAPPROG ((u_int32_t)100000) #define SUNRPC_PMAPVERS ((u_int32_t)2) #define SUNRPC_PMAPVERS_PROTO ((u_int32_t)2) #define SUNRPC_PMAPVERS_ORIG ((u_int32_t)1) #define SUNRPC_PMAPPROC_NULL ((u_int32_t)0) #define SUNRPC_PMAPPROC_SET ((u_int32_t)1) #define SUNRPC_PMAPPROC_UNSET ((u_int32_t)2) #define SUNRPC_PMAPPROC_GETPORT ((u_int32_t)3) #define SUNRPC_PMAPPROC_DUMP ((u_int32_t)4) #define SUNRPC_PMAPPROC_CALLIT ((u_int32_t)5) struct sunrpc_pmap { u_int32_t pm_prog; u_int32_t pm_vers; u_int32_t pm_prot; u_int32_t pm_port; }; tcpdump-3.9.8/./parsenfsfh.c0000644000026300017500000003116310643174114013776 0ustar mcrmcr/* * Copyright (c) 1993, 1994 Jeffrey C. Mogul, Digital Equipment Corporation, * Western Research Laboratory. All rights reserved. * Copyright (c) 2001 Compaq Computer Corporation. All rights reserved. * * Permission to use, copy, and modify this software and its * documentation is hereby granted only under the following terms and * conditions. Both the above copyright notice and this permission * notice must appear in all copies of the software, derivative works * or modified versions, and any portions thereof, and both notices * must appear in supporting documentation. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in * the documentation and/or other materials provided with the * distribution. * * THE SOFTWARE IS PROVIDED "AS IS" AND COMPAQ COMPUTER CORPORATION * DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO * EVENT SHALL COMPAQ COMPUTER CORPORATION BE LIABLE FOR ANY * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN * AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS * SOFTWARE. */ /* * parsenfsfh.c - portable parser for NFS file handles * uses all sorts of heuristics * * Jeffrey C. Mogul * Digital Equipment Corporation * Western Research Laboratory */ #ifndef lint static const char rcsid[] _U_ = "@(#) $Header: /tcpdump/master/tcpdump/parsenfsfh.c,v 1.28.2.1 2007/06/15 19:15:04 guy Exp $ (LBL)"; #endif #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include #include "interface.h" #include "nfsfh.h" /* * This routine attempts to parse a file handle (in network byte order), * using heuristics to guess what kind of format it is in. See the * file "fhandle_layouts" for a detailed description of the various * patterns we know about. * * The file handle is parsed into our internal representation of a * file-system id, and an internal representation of an inode-number. */ #define FHT_UNKNOWN 0 #define FHT_AUSPEX 1 #define FHT_DECOSF 2 #define FHT_IRIX4 3 #define FHT_IRIX5 4 #define FHT_SUNOS3 5 #define FHT_SUNOS4 6 #define FHT_ULTRIX 7 #define FHT_VMSUCX 8 #define FHT_SUNOS5 9 #define FHT_AIX32 10 #define FHT_HPUX9 11 #define FHT_BSD44 12 #ifdef ultrix /* Nasty hack to keep the Ultrix C compiler from emitting bogus warnings */ #define XFF(x) ((u_int32_t)(x)) #else #define XFF(x) (x) #endif #define make_uint32(msb,b,c,lsb)\ (XFF(lsb) + (XFF(c)<<8) + (XFF(b)<<16) + (XFF(msb)<<24)) #define make_uint24(msb,b, lsb)\ (XFF(lsb) + (XFF(b)<<8) + (XFF(msb)<<16)) #define make_uint16(msb,lsb)\ (XFF(lsb) + (XFF(msb)<<8)) #ifdef __alpha /* or other 64-bit systems */ #define make_uint48(msb,b,c,d,e,lsb)\ ((lsb) + ((e)<<8) + ((d)<<16) + ((c)<<24) + ((b)<<32) + ((msb)<<40)) #else /* on 32-bit systems ignore high-order bits */ #define make_uint48(msb,b,c,d,e,lsb)\ ((lsb) + ((e)<<8) + ((d)<<16) + ((c)<<24)) #endif static int is_UCX(const unsigned char *); void Parse_fh(fh, len, fsidp, inop, osnamep, fsnamep, ourself) register const unsigned char *fh; int len _U_; my_fsid *fsidp; ino_t *inop; const char **osnamep; /* if non-NULL, return OS name here */ const char **fsnamep; /* if non-NULL, return server fs name here (for VMS) */ int ourself; /* true if file handle was generated on this host */ { register const unsigned char *fhp = fh; u_int32_t temp; int fhtype = FHT_UNKNOWN; int i; if (ourself) { /* File handle generated on this host, no need for guessing */ #if defined(IRIX40) fhtype = FHT_IRIX4; #endif #if defined(IRIX50) fhtype = FHT_IRIX5; #endif #if defined(IRIX51) fhtype = FHT_IRIX5; #endif #if defined(SUNOS4) fhtype = FHT_SUNOS4; #endif #if defined(SUNOS5) fhtype = FHT_SUNOS5; #endif #if defined(ultrix) fhtype = FHT_ULTRIX; #endif #if defined(__osf__) fhtype = FHT_DECOSF; #endif #if defined(__NetBSD__) || defined(__FreeBSD__) || defined(__DragonFly__) \ || defined(__OpenBSD__) fhtype = FHT_BSD44; #endif } /* * This is basically a big decision tree */ else if ((fhp[0] == 0) && (fhp[1] == 0)) { /* bytes[0,1] == (0,0); rules out Ultrix, IRIX5, SUNOS5 */ /* probably rules out HP-UX, AIX unless they allow major=0 */ if ((fhp[2] == 0) && (fhp[3] == 0)) { /* bytes[2,3] == (0,0); must be Auspex */ /* XXX or could be Ultrix+MASSBUS "hp" disk? */ fhtype = FHT_AUSPEX; } else { /* * bytes[2,3] != (0,0); rules out Auspex, could be * DECOSF, SUNOS4, or IRIX4 */ if ((fhp[4] != 0) && (fhp[5] == 0) && (fhp[8] == 12) && (fhp[9] == 0)) { /* seems to be DECOSF, with minor == 0 */ fhtype = FHT_DECOSF; } else { /* could be SUNOS4 or IRIX4 */ /* XXX the test of fhp[5] == 8 could be wrong */ if ((fhp[4] == 0) && (fhp[5] == 8) && (fhp[6] == 0) && (fhp[7] == 0)) { /* looks like a length, not a file system typecode */ fhtype = FHT_IRIX4; } else { /* by elimination */ fhtype = FHT_SUNOS4; } } } } else { /* * bytes[0,1] != (0,0); rules out Auspex, IRIX4, SUNOS4 * could be IRIX5, DECOSF, UCX, Ultrix, SUNOS5 * could be AIX, HP-UX */ if ((fhp[2] == 0) && (fhp[3] == 0)) { /* * bytes[2,3] == (0,0); rules out OSF, probably not UCX * (unless the exported device name is just one letter!), * could be Ultrix, IRIX5, AIX, or SUNOS5 * might be HP-UX (depends on their values for minor devs) */ if ((fhp[6] == 0) && (fhp[7] == 0)) { fhtype = FHT_BSD44; } /*XXX we probably only need to test of these two bytes */ else if ((fhp[21] == 0) && (fhp[23] == 0)) { fhtype = FHT_ULTRIX; } else { /* Could be SUNOS5/IRIX5, maybe AIX */ /* XXX no obvious difference between SUNOS5 and IRIX5 */ if (fhp[9] == 10) fhtype = FHT_SUNOS5; /* XXX what about AIX? */ } } else { /* * bytes[2,3] != (0,0); rules out Ultrix, could be * DECOSF, SUNOS5, IRIX5, AIX, HP-UX, or UCX */ if ((fhp[8] == 12) && (fhp[9] == 0)) { fhtype = FHT_DECOSF; } else if ((fhp[8] == 0) && (fhp[9] == 10)) { /* could be SUNOS5/IRIX5, AIX, HP-UX */ if ((fhp[7] == 0) && (fhp[6] == 0) && (fhp[5] == 0) && (fhp[4] == 0)) { /* XXX is this always true of HP-UX? */ fhtype = FHT_HPUX9; } else if (fhp[7] == 2) { /* This would be MNT_NFS on AIX, which is impossible */ fhtype = FHT_SUNOS5; /* or maybe IRIX5 */ } else { /* * XXX Could be SUNOS5/IRIX5 or AIX. I don't * XXX see any way to disambiguate these, so * XXX I'm going with the more likely guess. * XXX Sorry, Big Blue. */ fhtype = FHT_SUNOS5; /* or maybe IRIX5 */ } } else { if (is_UCX(fhp)) { fhtype = FHT_VMSUCX; } else { fhtype = FHT_UNKNOWN; } } } } /* XXX still needs to handle SUNOS3 */ switch (fhtype) { case FHT_AUSPEX: fsidp->Fsid_dev.Minor = fhp[7]; fsidp->Fsid_dev.Major = fhp[6]; fsidp->fsid_code = 0; temp = make_uint32(fhp[12], fhp[13], fhp[14], fhp[15]); *inop = temp; if (osnamep) *osnamep = "Auspex"; break; case FHT_BSD44: fsidp->Fsid_dev.Minor = fhp[0]; fsidp->Fsid_dev.Major = fhp[1]; fsidp->fsid_code = 0; temp = make_uint32(fhp[15], fhp[14], fhp[13], fhp[12]); *inop = temp; if (osnamep) *osnamep = "BSD 4.4"; break; case FHT_DECOSF: fsidp->fsid_code = make_uint32(fhp[7], fhp[6], fhp[5], fhp[4]); /* XXX could ignore 3 high-order bytes */ temp = make_uint32(fhp[3], fhp[2], fhp[1], fhp[0]); fsidp->Fsid_dev.Minor = temp & 0xFFFFF; fsidp->Fsid_dev.Major = (temp>>20) & 0xFFF; temp = make_uint32(fhp[15], fhp[14], fhp[13], fhp[12]); *inop = temp; if (osnamep) *osnamep = "OSF"; break; case FHT_IRIX4: fsidp->Fsid_dev.Minor = fhp[3]; fsidp->Fsid_dev.Major = fhp[2]; fsidp->fsid_code = 0; temp = make_uint32(fhp[8], fhp[9], fhp[10], fhp[11]); *inop = temp; if (osnamep) *osnamep = "IRIX4"; break; case FHT_IRIX5: fsidp->Fsid_dev.Minor = make_uint16(fhp[2], fhp[3]); fsidp->Fsid_dev.Major = make_uint16(fhp[0], fhp[1]); fsidp->fsid_code = make_uint32(fhp[4], fhp[5], fhp[6], fhp[7]); temp = make_uint32(fhp[12], fhp[13], fhp[14], fhp[15]); *inop = temp; if (osnamep) *osnamep = "IRIX5"; break; #ifdef notdef case FHT_SUNOS3: /* * XXX - none of the heuristics above return this. * Are there any SunOS 3.x systems around to care about? */ if (osnamep) *osnamep = "SUNOS3"; break; #endif case FHT_SUNOS4: fsidp->Fsid_dev.Minor = fhp[3]; fsidp->Fsid_dev.Major = fhp[2]; fsidp->fsid_code = make_uint32(fhp[4], fhp[5], fhp[6], fhp[7]); temp = make_uint32(fhp[12], fhp[13], fhp[14], fhp[15]); *inop = temp; if (osnamep) *osnamep = "SUNOS4"; break; case FHT_SUNOS5: temp = make_uint16(fhp[0], fhp[1]); fsidp->Fsid_dev.Major = (temp>>2) & 0x3FFF; temp = make_uint24(fhp[1], fhp[2], fhp[3]); fsidp->Fsid_dev.Minor = temp & 0x3FFFF; fsidp->fsid_code = make_uint32(fhp[4], fhp[5], fhp[6], fhp[7]); temp = make_uint32(fhp[12], fhp[13], fhp[14], fhp[15]); *inop = temp; if (osnamep) *osnamep = "SUNOS5"; break; case FHT_ULTRIX: fsidp->fsid_code = 0; fsidp->Fsid_dev.Minor = fhp[0]; fsidp->Fsid_dev.Major = fhp[1]; temp = make_uint32(fhp[7], fhp[6], fhp[5], fhp[4]); *inop = temp; if (osnamep) *osnamep = "Ultrix"; break; case FHT_VMSUCX: /* No numeric file system ID, so hash on the device-name */ if (sizeof(*fsidp) >= 14) { if (sizeof(*fsidp) > 14) memset((char *)fsidp, 0, sizeof(*fsidp)); /* just use the whole thing */ memcpy((char *)fsidp, (char *)fh, 14); } else { u_int32_t tempa[4]; /* at least 16 bytes, maybe more */ memset((char *)tempa, 0, sizeof(tempa)); memcpy((char *)tempa, (char *)fh, 14); /* ensure alignment */ fsidp->Fsid_dev.Minor = tempa[0] + (tempa[1]<<1); fsidp->Fsid_dev.Major = tempa[2] + (tempa[3]<<1); fsidp->fsid_code = 0; } /* VMS file ID is: (RVN, FidHi, FidLo) */ *inop = make_uint32(fhp[26], fhp[27], fhp[23], fhp[22]); /* Caller must save (and null-terminate?) this value */ if (fsnamep) *fsnamep = (char *)&(fhp[1]); if (osnamep) *osnamep = "VMS"; break; case FHT_AIX32: fsidp->Fsid_dev.Minor = make_uint16(fhp[2], fhp[3]); fsidp->Fsid_dev.Major = make_uint16(fhp[0], fhp[1]); fsidp->fsid_code = make_uint32(fhp[4], fhp[5], fhp[6], fhp[7]); temp = make_uint32(fhp[12], fhp[13], fhp[14], fhp[15]); *inop = temp; if (osnamep) *osnamep = "AIX32"; break; case FHT_HPUX9: fsidp->Fsid_dev.Major = fhp[0]; temp = make_uint24(fhp[1], fhp[2], fhp[3]); fsidp->Fsid_dev.Minor = temp; fsidp->fsid_code = make_uint32(fhp[4], fhp[5], fhp[6], fhp[7]); temp = make_uint32(fhp[12], fhp[13], fhp[14], fhp[15]); *inop = temp; if (osnamep) *osnamep = "HPUX9"; break; case FHT_UNKNOWN: #ifdef DEBUG /* XXX debugging */ for (i = 0; i < 32; i++) (void)fprintf(stderr, "%x.", fhp[i]); (void)fprintf(stderr, "\n"); #endif /* Save the actual handle, so it can be display with -u */ for (i = 0; i < 32; i++) (void)snprintf(&(fsidp->Opaque_Handle[i*2]), 3, "%.2X", fhp[i]); /* XXX for now, give "bogus" values to aid debugging */ fsidp->fsid_code = 0; fsidp->Fsid_dev.Minor = 257; fsidp->Fsid_dev.Major = 257; *inop = 1; /* display will show this string instead of (257,257) */ if (fsnamep) *fsnamep = "Unknown"; if (osnamep) *osnamep = "Unknown"; break; } } /* * Is this a VMS UCX file handle? * Check for: * (1) leading code byte [XXX not yet] * (2) followed by string of printing chars & spaces * (3) followed by string of nulls */ static int is_UCX(fhp) const unsigned char *fhp; { register int i; int seen_null = 0; for (i = 1; i < 14; i++) { if (isprint(fhp[i])) { if (seen_null) return(0); else continue; } else if (fhp[i] == 0) { seen_null = 1; continue; } else return(0); } return(1); } tcpdump-3.9.8/./LICENSE0000644000026300017500000000155107170444340012500 0ustar mcrmcrLicense: BSD Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 3. The names of the authors may not be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. tcpdump-3.9.8/./sctpConstants.h0000644000026300017500000004121607667232003014516 0ustar mcrmcr/* @(#) $Header: /tcpdump/master/tcpdump/sctpConstants.h,v 1.4 2003/06/03 23:49:23 guy Exp $ (LBL) */ /* SCTP reference Implementation Copyright (C) 1999 Cisco And Motorola * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * 3. Neither the name of Cisco nor of Motorola may be used * to endorse or promote products derived from this software without * specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * * This file is part of the SCTP reference Implementation * * * Please send any bug reports or fixes you make to one of the following email * addresses: * * rstewar1@email.mot.com * kmorneau@cisco.com * qxie1@email.mot.com * * Any bugs reported given to us we will try to fix... any fixes shared will * be incorperated into the next SCTP release. */ #ifndef __sctpConstants_h__ #define __sctpConstants_h__ /* If you wish to use MD5 instead of SLA uncomment the line * below. Why you would like to do this: * a) There may be IPR on SHA-1, or so the FIP-180-1 page says, * b) MD5 is 3 times faster (has coded here). * * The disadvantage is, it is thought that MD5 has been * cracked... see RFC2104. */ /*#define USE_MD5 1*/ /* the SCTP protocol signature * this includes the version number * encoded in the last 4 bits of the * signature. */ #define PROTO_SIGNATURE_A 0x30000000 #define SCTP_VERSION_NUMBER 0x3 #define MAX_TSN 0xffffffff #define MAX_SEQ 0xffff /* option: * If you comment out the following you will * receive the old behavior of obeying cwnd for * the fast retransmit algorithm. With this defined * a FR happens right away with-out waiting for the * flightsize to drop below the cwnd value (which * is reduced by the FR to 1/2 the inflight packets). */ #define SCTP_IGNORE_CWND_ON_FR 1 /* default max I can burst out after a fast retransmit */ #define SCTP_DEF_MAX_BURST 4 /* Packet transmit states in the sent * field in the SCTP_transmitOnQueue struct */ #define SCTP_DATAGRAM_UNSENT 0 #define SCTP_DATAGRAM_SENT 1 #define SCTP_DATAGRAM_RESEND1 2 /* not used */ #define SCTP_DATAGRAM_RESEND2 3 /* not used */ #define SCTP_DATAGRAM_RESEND3 4 /* not used */ #define SCTP_DATAGRAM_RESEND 5 #define SCTP_DATAGRAM_ACKED 10010 #define SCTP_DATAGRAM_INBOUND 10011 #define SCTP_READY_TO_TRANSMIT 10012 #define SCTP_DATAGRAM_MARKED 20010 #define MAX_FSID 64 /* debug 5 ints used for cc dynamic tracking */ /* The valid defines for all message * types know to SCTP. 0 is reserved */ #define SCTP_MSGTYPE_MASK 0xff #define SCTP_DATA 0x00 #define SCTP_INITIATION 0x01 #define SCTP_INITIATION_ACK 0x02 #define SCTP_SELECTIVE_ACK 0x03 #define SCTP_HEARTBEAT_REQUEST 0x04 #define SCTP_HEARTBEAT_ACK 0x05 #define SCTP_ABORT_ASSOCIATION 0x06 #define SCTP_SHUTDOWN 0x07 #define SCTP_SHUTDOWN_ACK 0x08 #define SCTP_OPERATION_ERR 0x09 #define SCTP_COOKIE_ECHO 0x0a #define SCTP_COOKIE_ACK 0x0b #define SCTP_ECN_ECHO 0x0c #define SCTP_ECN_CWR 0x0d #define SCTP_SHUTDOWN_COMPLETE 0x0e #define SCTP_FORWARD_CUM_TSN 0xc0 #define SCTP_RELIABLE_CNTL 0xc1 #define SCTP_RELIABLE_CNTL_ACK 0xc2 /* ABORT and SHUTDOWN COMPLETE FLAG */ #define SCTP_HAD_NO_TCB 0x01 /* Data Chuck Specific Flags */ #define SCTP_DATA_FRAG_MASK 0x03 #define SCTP_DATA_MIDDLE_FRAG 0x00 #define SCTP_DATA_LAST_FRAG 0x01 #define SCTP_DATA_FIRST_FRAG 0x02 #define SCTP_DATA_NOT_FRAG 0x03 #define SCTP_DATA_UNORDERED 0x04 #define SCTP_CRC_ENABLE_BIT 0x01 /* lower bit of reserved */ #define isSCTPControl(a) (a->chunkID != SCTP_DATA) #define isSCTPData(a) (a->chunkID == SCTP_DATA) /* sctp parameter types for init/init-ack */ #define SCTP_IPV4_PARAM_TYPE 0x0005 #define SCTP_IPV6_PARAM_TYPE 0x0006 #define SCTP_RESPONDER_COOKIE 0x0007 #define SCTP_UNRECOG_PARAM 0x0008 #define SCTP_COOKIE_PRESERVE 0x0009 #define SCTP_HOSTNAME_VIA_DNS 0x000b #define SCTP_RESTRICT_ADDR_TO 0x000c #define SCTP_ECN_I_CAN_DO_ECN 0x8000 #define SCTP_OPERATION_SUCCEED 0x4001 #define SCTP_ERROR_NOT_EXECUTED 0x4002 #define SCTP_UNRELIABLE_STRM 0xc000 #define SCTP_ADD_IP_ADDRESS 0xc001 #define SCTP_DEL_IP_ADDRESS 0xc002 #define SCTP_STRM_FLOW_LIMIT 0xc003 #define SCTP_PARTIAL_CSUM 0xc004 #define SCTP_ERROR_CAUSE_TLV 0xc005 #define SCTP_MIT_STACK_NAME 0xc006 #define SCTP_SETADDRESS_PRIMARY 0xc007 /* bits for TOS field */ #define SCTP_ECT_BIT 0x02 #define SCTP_CE_BIT 0x01 /* error codes */ #define SCTP_OP_ERROR_NO_ERROR 0x0000 #define SCTP_OP_ERROR_INV_STRM 0x0001 #define SCTP_OP_ERROR_MISS_PARAM 0x0002 #define SCTP_OP_ERROR_STALE_COOKIE 0x0003 #define SCTP_OP_ERROR_NO_RESOURCE 0x0004 #define SCTP_OP_ERROR_DNS_FAILED 0x0005 #define SCTP_OP_ERROR_UNK_CHUNK 0x0006 #define SCTP_OP_ERROR_INV_PARAM 0x0007 #define SCTP_OP_ERROR_UNK_PARAM 0x0008 #define SCTP_OP_ERROR_NO_USERD 0x0009 #define SCTP_OP_ERROR_COOKIE_SHUT 0x000a #define SCTP_OP_ERROR_DELETE_LAST 0x000b #define SCTP_OP_ERROR_RESOURCE_SHORT 0x000c #define SCTP_MAX_ERROR_CAUSE 12 /* empty error causes i.e. nothing but the cause * are SCTP_OP_ERROR_NO_RESOURCE, SCTP_OP_ERROR_INV_PARAM, * SCTP_OP_ERROR_COOKIE_SHUT. */ /* parameter for Heart Beat */ #define HEART_BEAT_PARAM 0x0001 /* send options for SCTP */ #define SCTP_ORDERED_DELIVERY 0x01 #define SCTP_NON_ORDERED_DELIVERY 0x02 #define SCTP_DO_CRC16 0x08 #define SCTP_MY_ADDRESS_ONLY 0x10 /* below turns off above */ #define SCTP_FLEXIBLE_ADDRESS 0x20 #define SCTP_NO_HEARTBEAT 0x40 /* mask to get sticky */ #define SCTP_STICKY_OPTIONS_MASK 0x0c /* MTU discovery flags */ #define SCTP_DONT_FRAGMENT 0x0100 #define SCTP_FRAGMENT_OK 0x0200 /* SCTP state defines for internal state machine */ #define SCTP_STATE_EMPTY 0x0000 #define SCTP_STATE_INUSE 0x0001 #define SCTP_STATE_COOKIE_WAIT 0x0002 #define SCTP_STATE_COOKIE_SENT 0x0004 #define SCTP_STATE_OPEN 0x0008 #define SCTP_STATE_SHUTDOWN 0x0010 #define SCTP_STATE_SHUTDOWN_RECV 0x0020 #define SCTP_STATE_SHUTDOWN_ACK_SENT 0x0040 #define SCTP_STATE_SHUTDOWN_PEND 0x0080 #define SCTP_STATE_MASK 0x007f /* SCTP reachability state for each address */ #define SCTP_ADDR_NOT_REACHABLE 1 #define SCTP_ADDR_REACHABLE 2 #define SCTP_ADDR_NOHB 4 #define SCTP_ADDR_BEING_DELETED 8 /* How long a cookie lives */ #define SCTP_DEFAULT_COOKIE_LIFE 60 /* seconds */ /* resource limit of streams */ #define MAX_SCTP_STREAMS 2048 /* guess at how big to make the TSN mapping array */ #define SCTP_STARTING_MAPARRAY 10000 /* Here we define the timer types used * by the implementation has * arguments in the set/get timer type calls. */ #define SCTP_TIMER_INIT 0 #define SCTP_TIMER_RECV 1 #define SCTP_TIMER_SEND 2 #define SCTP_TIMER_SHUTDOWN 3 #define SCTP_TIMER_HEARTBEAT 4 #define SCTP_TIMER_PMTU 5 /* number of timer types in the base SCTP * structure used in the set/get and has * the base default. */ #define SCTP_NUM_TMRS 6 #define SCTP_IPV4_ADDRESS 2 #define SCTP_IPV6_ADDRESS 4 /* timer types */ #define SctpTimerTypeNone 0 #define SctpTimerTypeSend 1 #define SctpTimerTypeInit 2 #define SctpTimerTypeRecv 3 #define SctpTimerTypeShutdown 4 #define SctpTimerTypeHeartbeat 5 #define SctpTimerTypeCookie 6 #define SctpTimerTypeNewCookie 7 #define SctpTimerTypePathMtuRaise 8 #define SctpTimerTypeShutdownAck 9 #define SctpTimerTypeRelReq 10 /* Here are the timer directives given to the * user provided function */ #define SCTP_TIMER_START 1 #define SCTP_TIMER_STOP 2 /* running flag states in timer structure */ #define SCTP_TIMER_IDLE 0x0 #define SCTP_TIMER_EXPIRED 0x1 #define SCTP_TIMER_RUNNING 0x2 /* number of simultaneous timers running */ #define SCTP_MAX_NET_TIMERS 6 /* base of where net timers start */ #define SCTP_NUMBER_TIMERS 12 /* allows up to 6 destinations */ /* Of course we really don't collect stale cookies, being * folks of decerning taste. However we do count them, if * we get to many before the association comes up.. we * give up. Below is the constant that dictates when * we give it up...this is a implemenation dependant * treatment. In ours we do not ask for a extension of * time, but just retry this many times... */ #define SCTP_MAX_STALE_COOKIES_I_COLLECT 10 /* max number of TSN's dup'd that I will hold */ #define SCTP_MAX_DUP_TSNS 20 /* Here we define the types used when * setting the retry ammounts. */ /* constants for type of set */ #define SCTP_MAXATTEMPT_INIT 2 #define SCTP_MAXATTEMPT_SEND 3 /* Here we define the default timers and the * default number of attemts we make for * each respective side (send/init). */ /* init timer def = 3sec */ #define SCTP_INIT_SEC 3 #define SCTP_INIT_NSEC 0 /* send timer def = 3 seconds */ #define SCTP_SEND_SEC 1 #define SCTP_SEND_NSEC 0 /* recv timer def = 200ms (in nsec) */ #define SCTP_RECV_SEC 0 #define SCTP_RECV_NSEC 200000000 /* 30 seconds + RTO */ #define SCTP_HB_SEC 30 #define SCTP_HB_NSEC 0 /* 300 ms */ #define SCTP_SHUTDOWN_SEC 0 #define SCTP_SHUTDOWN_NSEC 300000000 #define SCTP_RTO_UPPER_BOUND 60000000 /* 60 sec in micro-second's */ #define SCTP_RTO_UPPER_BOUND_SEC 60 /* for the init timer */ #define SCTP_RTO_LOWER_BOUND 1000000 /* 1 sec in micro-sec's */ #define SCTP_DEF_MAX_INIT 8 #define SCTP_DEF_MAX_SEND 10 #define SCTP_DEF_PMTU_RAISE 600 /* 10 Minutes between raise attempts */ #define SCTP_DEF_PMTU_MIN 600 #define SCTP_MSEC_IN_A_SEC 1000 #define SCTP_USEC_IN_A_SEC 1000000 #define SCTP_NSEC_IN_A_SEC 1000000000 /* Events that SCTP will look for, these * are or'd together to declare what SCTP * wants. Each select mask/poll list should be * set for the fd, if the bit is on. */ #define SCTP_EVENT_READ 0x000001 #define SCTP_EVENT_WRITE 0x000002 #define SCTP_EVENT_EXCEPT 0x000004 /* The following constant is a value for this * particular implemenation. It is quite arbitrary and * is used to limit how much data will be queued up to * a sender, waiting for cwnd to be larger than flightSize. * All implementations will need this protection is some * way due to buffer size constraints. */ #define SCTP_MAX_OUTSTANDING_DG 10000 /* This constant (SCTP_MAX_READBUFFER) define * how big the read/write buffer is * when we enter the fd event notification * the buffer is put on the stack, so the bigger * it is the more stack you chew up, however it * has got to be big enough to handle the bigest * message this O/S will send you. In solaris * with sockets (not TLI) we end up at a value * of 64k. In TLI we could do partial reads to * get it all in with less hassel.. but we * write to sockets for generality. */ #define SCTP_MAX_READBUFFER 65536 #define SCTP_ADDRMAX 60 /* amount peer is obligated to have in rwnd or * I will abort */ #define SCTP_MIN_RWND 1500 #define SCTP_WINDOW_MIN 1500 /* smallest rwnd can be */ #define SCTP_WINDOW_MAX 1048576 /* biggest I can grow rwnd to * My playing around suggests a * value greater than 64k does not * do much, I guess via the kernel * limitations on the stream/socket. */ #define SCTP_MAX_BUNDLE_UP 256 /* max number of chunks I can bundle */ /* I can handle a 1meg re-assembly */ #define SCTP_DEFAULT_MAXMSGREASM 1048576 #define SCTP_DEFAULT_MAXWINDOW 32768 /* default rwnd size */ #define SCTP_DEFAULT_MAXSEGMENT 1500 /* MTU size, this is the default * to which we set the smallestMTU * size to. This governs what is the * largest size we will use, of course * PMTU will raise this up to * the largest interface MTU or the * ceiling below if there is no * SIOCGIFMTU. */ #ifdef LYNX #define DEFAULT_MTU_CEILING 1500 /* Since Lynx O/S is brain dead * in the way it handles the * raw IP socket, insisting * on makeing its own IP * header, we limit the growth * to that of the e-net size */ #else #define DEFAULT_MTU_CEILING 2048 /* If no SIOCGIFMTU, highest value * to raise the PMTU to, i.e. * don't try to raise above this * value. Tune this per your * largest MTU interface if your * system does not support the * SIOCGIFMTU ioctl. */ #endif #define SCTP_DEFAULT_MINSEGMENT 512 /* MTU size ... if no mtu disc */ #define SCTP_HOW_MANY_SECRETS 2 /* how many secrets I keep */ /* This is how long a secret lives, NOT how long a cookie lives */ #define SCTP_HOW_LONG_COOKIE_LIVE 3600 /* how many seconds the current secret will live */ #define SCTP_NUMBER_OF_SECRETS 8 /* or 8 * 4 = 32 octets */ #define SCTP_SECRET_SIZE 32 /* number of octets in a 256 bits */ #ifdef USE_MD5 #define SCTP_SIGNATURE_SIZE 16 /* size of a MD5 signature */ #else #define SCTP_SIGNATURE_SIZE 20 /* size of a SLA-1 signature */ #endif /* Here are the notification constants * that the code and upper layer will get */ /* association is up */ #define SCTP_NOTIFY_ASSOC_UP 1 /* association is down */ #define SCTP_NOTIFY_ASSOC_DOWN 2 /* interface on a association is down * and out of consideration for selection. */ #define SCTP_NOTIFY_INTF_DOWN 3 /* interface on a association is up * and now back in consideration for selection. */ #define SCTP_NOTIFY_INTF_UP 4 /* The given datagram cannot be delivered * to the peer, this will probably be followed * by a SCTP_NOTFIY_ASSOC_DOWN. */ #define SCTP_NOTIFY_DG_FAIL 5 /* Sent dg on non-open stream extreme code error! */ #define SCTP_NOTIFY_STRDATA_ERR 6 #define SCTP_NOTIFY_ASSOC_ABORTED 7 /* The stream ones are not used yet, but could * be when a association opens. */ #define SCTP_NOTIFY_PEER_OPENED_STR 8 #define SCTP_NOTIFY_STREAM_OPENED_OK 9 /* association sees a restart event */ #define SCTP_NOTIFY_ASSOC_RESTART 10 /* a user requested HB returned */ #define SCTP_NOTIFY_HB_RESP 11 /* a result from a REL-REQ */ #define SCTP_NOTIFY_RELREQ_RESULT_OK 12 #define SCTP_NOTIFY_RELREQ_RESULT_FAILED 13 /* clock variance is 10ms or 10,000 us's */ #define SCTP_CLOCK_GRAINULARITY 10000 #define IP_HDR_SIZE 40 /* we use the size of a IP6 header here * this detracts a small amount for ipv4 * but it simplifies the ipv6 addition */ #define SCTP_NUM_FDS 3 /* raw IP filedescriptor */ #define SCTP_FD_IP 0 /* raw ICMP filedescriptor */ #define SCTP_FD_ICMP 1 /* processes contact me for requests here */ #define SCTP_REQUEST 2 #define SCTP_DEAMON_PORT 9899 /* Deamon registration message types/responses */ #define DEAMON_REGISTER 0x01 #define DEAMON_REGISTER_ACK 0x02 #define DEAMON_DEREGISTER 0x03 #define DEAMON_DEREGISTER_ACK 0x04 #define DEAMON_CHECKADDR_LIST 0x05 #define DEAMON_MAGIC_VER_LEN 0xff /* max times I will attempt to send a message to deamon */ #define SCTP_MAX_ATTEMPTS_AT_DEAMON 5 #define SCTP_TIMEOUT_IN_POLL_FOR_DEAMON 1500 /* 1.5 seconds */ /* modular comparison */ /* True if a > b (mod = M) */ #define compare_with_wrap(a, b, M) ((a > b) && ((a - b) < (M >> 1))) || \ ((b > a) && ((b - a) > (M >> 1))) #ifndef TIMEVAL_TO_TIMESPEC #define TIMEVAL_TO_TIMESPEC(tv, ts) \ { \ (ts)->tv_sec = (tv)->tv_sec; \ (ts)->tv_nsec = (tv)->tv_usec * 1000; \ } #endif /* pegs */ #define SCTP_NUMBER_OF_PEGS 21 /* peg index's */ #define SCTP_PEG_SACKS_SEEN 0 #define SCTP_PEG_SACKS_SENT 1 #define SCTP_PEG_TSNS_SENT 2 #define SCTP_PEG_TSNS_RCVD 3 #define SCTP_DATAGRAMS_SENT 4 #define SCTP_DATAGRAMS_RCVD 5 #define SCTP_RETRANTSN_SENT 6 #define SCTP_DUPTSN_RECVD 7 #define SCTP_HBR_RECV 8 #define SCTP_HBA_RECV 9 #define SCTP_HB_SENT 10 #define SCTP_DATA_DG_SENT 11 #define SCTP_DATA_DG_RECV 12 #define SCTP_TMIT_TIMER 13 #define SCTP_RECV_TIMER 14 #define SCTP_HB_TIMER 15 #define SCTP_FAST_RETRAN 16 #define SCTP_PEG_TSNS_READ 17 #define SCTP_NONE_LFT_TO 18 #define SCTP_NONE_LFT_RWND 19 #define SCTP_NONE_LFT_CWND 20 #endif tcpdump-3.9.8/./print-ntp.c0000644000026300017500000001662110236621536013577 0ustar mcrmcr/* * Copyright (c) 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997 * The Regents of the University of California. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that: (1) source code distributions * retain the above copyright notice and this paragraph in its entirety, (2) * distributions including binary code include the above copyright notice and * this paragraph in its entirety in the documentation or other materials * provided with the distribution, and (3) all advertising materials mentioning * features or use of this software display the following acknowledgement: * ``This product includes software developed by the University of California, * Lawrence Berkeley Laboratory and its contributors.'' Neither the name of * the University nor the names of its contributors may be used to endorse * or promote products derived from this software without specific prior * written permission. * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * * Format and print ntp packets. * By Jeffrey Mogul/DECWRL * loosely based on print-bootp.c */ #ifndef lint static const char rcsid[] _U_ = "@(#) $Header: /tcpdump/master/tcpdump/print-ntp.c,v 1.41.2.1 2005/05/06 07:57:18 guy Exp $ (LBL)"; #endif #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include #ifdef HAVE_STRFTIME #include #endif #include "interface.h" #include "addrtoname.h" #include "extract.h" #ifdef MODEMASK #undef MODEMASK /* Solaris sucks */ #endif #include "ntp.h" static void p_sfix(const struct s_fixedpt *); static void p_ntp_time(const struct l_fixedpt *); static void p_ntp_delta(const struct l_fixedpt *, const struct l_fixedpt *); static struct tok ntp_mode_values[] = { { MODE_UNSPEC, "unspecified" }, { MODE_SYM_ACT, "symmetric active" }, { MODE_SYM_PAS, "symmetric passive" }, { MODE_CLIENT, "Client" }, { MODE_SERVER, "Server" }, { MODE_BROADCAST, "Broadcast" }, { MODE_RES1, "Reserved" }, { MODE_RES2, "Reserved" }, { 0, NULL } }; static struct tok ntp_leapind_values[] = { { NO_WARNING, "" }, { PLUS_SEC, "+1s" }, { MINUS_SEC, "-1s" }, { ALARM, "clock unsynchronized" }, { 0, NULL } }; /* * Print ntp requests */ void ntp_print(register const u_char *cp, u_int length) { register const struct ntpdata *bp; int mode, version, leapind; bp = (struct ntpdata *)cp; TCHECK(bp->status); version = (int)(bp->status & VERSIONMASK) >> 3; printf("NTPv%d", version); mode = bp->status & MODEMASK; if (!vflag) { printf (", %s, length %u", tok2str(ntp_mode_values, "Unknown mode", mode), length); return; } printf (", length %u\n\t%s", length, tok2str(ntp_mode_values, "Unknown mode", mode)); leapind = bp->status & LEAPMASK; printf (", Leap indicator: %s (%u)", tok2str(ntp_leapind_values, "Unknown", leapind), leapind); TCHECK(bp->stratum); printf(", Stratum %u", bp->stratum); TCHECK(bp->ppoll); printf(", poll %us", bp->ppoll); /* Can't TCHECK bp->precision bitfield so bp->distance + 0 instead */ TCHECK2(bp->root_delay, 0); printf(", precision %d", bp->precision); TCHECK(bp->root_delay); fputs("\n\tRoot Delay: ", stdout); p_sfix(&bp->root_delay); TCHECK(bp->root_dispersion); fputs(", Root dispersion: ", stdout); p_sfix(&bp->root_dispersion); TCHECK(bp->refid); fputs(", Reference-ID: ", stdout); /* Interpretation depends on stratum */ switch (bp->stratum) { case UNSPECIFIED: printf("(unspec)"); break; case PRIM_REF: if (fn_printn((u_char *)&(bp->refid), 4, snapend)) goto trunc; break; case INFO_QUERY: printf("%s INFO_QUERY", ipaddr_string(&(bp->refid))); /* this doesn't have more content */ return; case INFO_REPLY: printf("%s INFO_REPLY", ipaddr_string(&(bp->refid))); /* this is too complex to be worth printing */ return; default: printf("%s", ipaddr_string(&(bp->refid))); break; } TCHECK(bp->ref_timestamp); fputs("\n\t Reference Timestamp: ", stdout); p_ntp_time(&(bp->ref_timestamp)); TCHECK(bp->org_timestamp); fputs("\n\t Originator Timestamp: ", stdout); p_ntp_time(&(bp->org_timestamp)); TCHECK(bp->rec_timestamp); fputs("\n\t Receive Timestamp: ", stdout); p_ntp_time(&(bp->rec_timestamp)); TCHECK(bp->xmt_timestamp); fputs("\n\t Transmit Timestamp: ", stdout); p_ntp_time(&(bp->xmt_timestamp)); fputs("\n\t Originator - Receive Timestamp: ", stdout); p_ntp_delta(&(bp->org_timestamp), &(bp->rec_timestamp)); fputs("\n\t Originator - Transmit Timestamp: ", stdout); p_ntp_delta(&(bp->org_timestamp), &(bp->xmt_timestamp)); /* FIXME key-id, authentication */ return; trunc: fputs(" [|ntp]", stdout); } static void p_sfix(register const struct s_fixedpt *sfp) { register int i; register int f; register float ff; i = EXTRACT_16BITS(&sfp->int_part); f = EXTRACT_16BITS(&sfp->fraction); ff = f / 65536.0; /* shift radix point by 16 bits */ f = ff * 1000000.0; /* Treat fraction as parts per million */ printf("%d.%06d", i, f); } #define FMAXINT (4294967296.0) /* floating point rep. of MAXINT */ static void p_ntp_time(register const struct l_fixedpt *lfp) { register int32_t i; register u_int32_t uf; register u_int32_t f; register float ff; i = EXTRACT_32BITS(&lfp->int_part); uf = EXTRACT_32BITS(&lfp->fraction); ff = uf; if (ff < 0.0) /* some compilers are buggy */ ff += FMAXINT; ff = ff / FMAXINT; /* shift radix point by 32 bits */ f = ff * 1000000000.0; /* treat fraction as parts per billion */ printf("%u.%09d", i, f); #ifdef HAVE_STRFTIME /* * print the time in human-readable format. */ if (i) { time_t seconds = i - JAN_1970; struct tm *tm; char time_buf[128]; tm = localtime(&seconds); strftime(time_buf, sizeof (time_buf), "%Y/%m/%d %H:%M:%S", tm); printf (" (%s)", time_buf); } #endif } /* Prints time difference between *lfp and *olfp */ static void p_ntp_delta(register const struct l_fixedpt *olfp, register const struct l_fixedpt *lfp) { register int32_t i; register u_int32_t u, uf; register u_int32_t ou, ouf; register u_int32_t f; register float ff; int signbit; u = EXTRACT_32BITS(&lfp->int_part); ou = EXTRACT_32BITS(&olfp->int_part); uf = EXTRACT_32BITS(&lfp->fraction); ouf = EXTRACT_32BITS(&olfp->fraction); if (ou == 0 && ouf == 0) { p_ntp_time(lfp); return; } i = u - ou; if (i > 0) { /* new is definitely greater than old */ signbit = 0; f = uf - ouf; if (ouf > uf) /* must borrow from high-order bits */ i -= 1; } else if (i < 0) { /* new is definitely less than old */ signbit = 1; f = ouf - uf; if (uf > ouf) /* must carry into the high-order bits */ i += 1; i = -i; } else { /* int_part is zero */ if (uf > ouf) { signbit = 0; f = uf - ouf; } else { signbit = 1; f = ouf - uf; } } ff = f; if (ff < 0.0) /* some compilers are buggy */ ff += FMAXINT; ff = ff / FMAXINT; /* shift radix point by 32 bits */ f = ff * 1000000000.0; /* treat fraction as parts per billion */ if (signbit) putchar('-'); else putchar('+'); printf("%d.%09d", i, f); } tcpdump-3.9.8/./nlpid.h0000644000026300017500000000252010135231173012740 0ustar mcrmcr/* @(#) $Header: /tcpdump/master/tcpdump/nlpid.h,v 1.4 2004/10/19 15:27:55 hannes Exp $ (LBL) */ /* * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that: (1) source code * distributions retain the above copyright notice and this paragraph * in its entirety, and (2) distributions including binary code include * the above copyright notice and this paragraph in its entirety in * the documentation or other materials provided with the distribution. * THIS SOFTWARE IS PROVIDED ``AS IS'' AND * WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT * LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * FOR A PARTICULAR PURPOSE. * * Original code by Hannes Gredler (hannes@juniper.net) */ extern struct tok nlpid_values[]; #define NLPID_NULLNS 0x00 #define NLPID_Q933 0x08 /* ANSI T1.617 Annex D or ITU-T Q.933 Annex A */ #define NLPID_LMI 0x09 /* The original, aka Cisco, aka Gang of Four */ #define NLPID_SNAP 0x80 #define NLPID_CLNP 0x81 /* iso9577 */ #define NLPID_ESIS 0x82 /* iso9577 */ #define NLPID_ISIS 0x83 /* iso9577 */ #define NLPID_CONS 0x84 #define NLPID_IDRP 0x85 #define NLPID_MFR 0xb1 /* FRF.15 */ #define NLPID_IP 0xcc #define NLPID_PPP 0xcf #define NLPID_X25_ESIS 0x8a #define NLPID_IP6 0x8e tcpdump-3.9.8/./print-olsr.c0000644000026300017500000002753410602416452013756 0ustar mcrmcr/* * Copyright (c) 1998-2007 The TCPDUMP project * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that: (1) source code * distributions retain the above copyright notice and this paragraph * in its entirety, and (2) distributions including binary code include * the above copyright notice and this paragraph in its entirety in * the documentation or other materials provided with the distribution. * THIS SOFTWARE IS PROVIDED ``AS IS'' AND * WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT * LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * FOR A PARTICULAR PURPOSE. * * Optimized Link State Protocl (OLSR) as per rfc3626 * * Original code by Hannes Gredler */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include #include "interface.h" #include "addrtoname.h" #include "extract.h" #include "ip.h" /* * RFC 3626 common header * * 0 1 2 3 * 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * | Packet Length | Packet Sequence Number | * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * | Message Type | Vtime | Message Size | * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * | Originator Address | * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * | Time To Live | Hop Count | Message Sequence Number | * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * | | * : MESSAGE : * | | * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * | Message Type | Vtime | Message Size | * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * | Originator Address | * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * | Time To Live | Hop Count | Message Sequence Number | * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * | | * : MESSAGE : * | | * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * : : */ struct olsr_common { u_int8_t packet_len[2]; u_int8_t packet_seq[2]; }; #define OLSR_HELLO_MSG 1 /* rfc3626 */ #define OLSR_TC_MSG 2 /* rfc3626 */ #define OLSR_MID_MSG 3 /* rfc3626 */ #define OLSR_HNA_MSG 4 /* rfc3626 */ #define OLSR_POWERINFO_MSG 128 #define OLSR_NAMESERVICE_MSG 130 #define OLSR_HELLO_LQ_MSG 201 /* LQ extensions olsr.org */ #define OLSR_TC_LQ_MSG 202 /* LQ extensions olsr.org */ static struct tok olsr_msg_values[] = { { OLSR_HELLO_MSG, "Hello" }, { OLSR_TC_MSG, "TC" }, { OLSR_MID_MSG, "MID" }, { OLSR_HNA_MSG, "HNA" }, { OLSR_POWERINFO_MSG, "Powerinfo" }, { OLSR_NAMESERVICE_MSG, "Nameservice" }, { OLSR_HELLO_LQ_MSG, "Hello-LQ" }, { OLSR_TC_LQ_MSG, "TC-LQ" }, { 0, NULL} }; struct olsr_msg { u_int8_t msg_type; u_int8_t vtime; u_int8_t msg_len[2]; u_int8_t originator[4]; u_int8_t ttl; u_int8_t hopcount; u_int8_t msg_seq[2]; }; struct olsr_hello { u_int8_t res[2]; u_int8_t htime; u_int8_t will; }; struct olsr_hello_link { u_int8_t link_code; u_int8_t res; u_int8_t len[2]; }; struct olsr_tc { u_int8_t ans_seq[2]; u_int8_t res[2]; }; struct olsr_hna { u_int8_t network[4]; u_int8_t mask[4]; }; #define OLSR_EXTRACT_LINK_TYPE(link_code) (link_code & 0x3) #define OLSR_EXTRACT_NEIGHBOR_TYPE(link_code) (link_code >> 2) static struct tok olsr_link_type_values[] = { { 0, "Unspecified" }, { 1, "Asymmetric" }, { 2, "Symmetric" }, { 3, "Lost" }, { 0, NULL} }; static struct tok olsr_neighbor_type_values[] = { { 0, "Not-Neighbor" }, { 1, "Symmetric" }, { 2, "Symmetric-MPR" }, { 0, NULL} }; struct olsr_lq_neighbor { u_int8_t neighbor[4]; u_int8_t link_quality; u_int8_t neighbor_link_quality; u_int8_t res[2]; }; /* * macro to convert the 8-bit mantissa/exponent to a double float * taken from olsr.org. */ #define VTIME_SCALE_FACTOR 0.0625 #define ME_TO_DOUBLE(me) \ (double)(VTIME_SCALE_FACTOR*(1+(double)(me>>4)/16)*(double)(1<<(me&0x0F))) /* * print a neighbor list with LQ extensions. */ static void olsr_print_lq_neighbor (const u_char *msg_data, u_int hello_len) { struct olsr_lq_neighbor *lq_neighbor; while (hello_len >= sizeof(struct olsr_lq_neighbor)) { lq_neighbor = (struct olsr_lq_neighbor *)msg_data; printf("\n\t neighbor %s, link-quality %.2lf%%" ", neighbor-link-quality %.2lf%%", ipaddr_string(lq_neighbor->neighbor), ((double)lq_neighbor->link_quality/2.55), ((double)lq_neighbor->neighbor_link_quality/2.55)); msg_data += sizeof(struct olsr_lq_neighbor); hello_len -= sizeof(struct olsr_lq_neighbor); } } /* * print a neighbor list. */ static void olsr_print_neighbor (const u_char *msg_data, u_int hello_len) { int neighbor; printf("\n\t neighbor\n\t\t"); neighbor = 1; while (hello_len >= sizeof(struct in_addr)) { /* print 4 neighbors per line */ printf("%s%s", ipaddr_string(msg_data), neighbor % 4 == 0 ? "\n\t\t" : " "); msg_data += sizeof(struct in_addr); hello_len -= sizeof(struct in_addr); } } void olsr_print (const u_char *pptr, u_int length) { union { const struct olsr_common *common; const struct olsr_msg *msg; const struct olsr_hello *hello; const struct olsr_hello_link *hello_link; const struct olsr_lq_neighbor *lq_neighbor; const struct olsr_tc *tc; const struct olsr_hna *hna; } ptr; u_int msg_type, msg_len, msg_tlen, hello_len, prefix; u_int8_t link_type, neighbor_type; const u_char *tptr, *msg_data; tptr = pptr; if (length < sizeof(struct olsr_common)) { goto trunc; } if (!TTEST2(*tptr, sizeof(struct olsr_common))) { goto trunc; } ptr.common = (struct olsr_common *)tptr; length = MIN(length, EXTRACT_16BITS(ptr.common->packet_len)); printf("OLSR, seq 0x%04x, length %u", EXTRACT_16BITS(ptr.common->packet_seq), length); tptr += sizeof(struct olsr_common); /* * In non-verbose mode, just print version. */ if (vflag < 1) { return; } while (tptr < (pptr+length)) { if (!TTEST2(*tptr, sizeof(struct olsr_msg))) goto trunc; ptr.msg = (struct olsr_msg *)tptr; msg_type = ptr.msg->msg_type; msg_len = EXTRACT_16BITS(ptr.msg->msg_len); /* infinite loop check */ if (msg_type == 0 || msg_len == 0) { return; } printf("\n\t%s Message (%u), originator %s, ttl %u, hop %u" "\n\t vtime %.3lfs, msg-seq 0x%04x, length %u", tok2str(olsr_msg_values, "Unknown", msg_type), msg_type, ipaddr_string(ptr.msg->originator), ptr.msg->ttl, ptr.msg->hopcount, ME_TO_DOUBLE(ptr.msg->vtime), EXTRACT_16BITS(ptr.msg->msg_seq), msg_len); msg_tlen = msg_len - sizeof(struct olsr_msg); msg_data = tptr + sizeof(struct olsr_msg); switch (msg_type) { case OLSR_HELLO_MSG: case OLSR_HELLO_LQ_MSG: if (!TTEST2(*msg_data, sizeof(struct olsr_hello))) goto trunc; ptr.hello = (struct olsr_hello *)msg_data; printf("\n\t hello-time %.3lfs, MPR willingness %u", ME_TO_DOUBLE(ptr.hello->htime), ptr.hello->will); msg_data += sizeof(struct olsr_hello); msg_tlen -= sizeof(struct olsr_hello); while (msg_tlen >= sizeof(struct olsr_hello_link)) { /* * link-type. */ if (!TTEST2(*msg_data, sizeof(struct olsr_hello_link))) goto trunc; ptr.hello_link = (struct olsr_hello_link *)msg_data; hello_len = EXTRACT_16BITS(ptr.hello_link->len); link_type = OLSR_EXTRACT_LINK_TYPE(ptr.hello_link->link_code); neighbor_type = OLSR_EXTRACT_NEIGHBOR_TYPE(ptr.hello_link->link_code); printf("\n\t link-type %s, neighbor-type %s, len %u", tok2str(olsr_link_type_values, "Unknown", link_type), tok2str(olsr_neighbor_type_values, "Unknown", neighbor_type), hello_len); msg_data += sizeof(struct olsr_hello_link); msg_tlen -= sizeof(struct olsr_hello_link); hello_len -= sizeof(struct olsr_hello_link); if (msg_type == OLSR_HELLO_MSG) { olsr_print_neighbor(msg_data, hello_len); } else { olsr_print_lq_neighbor(msg_data, hello_len); } msg_data += hello_len; msg_tlen -= hello_len; } break; case OLSR_TC_MSG: case OLSR_TC_LQ_MSG: if (!TTEST2(*msg_data, sizeof(struct olsr_tc))) goto trunc; ptr.tc = (struct olsr_tc *)msg_data; printf("\n\t advertised neighbor seq 0x%04x", EXTRACT_16BITS(ptr.tc->ans_seq)); msg_data += sizeof(struct olsr_tc); msg_tlen -= sizeof(struct olsr_tc); if (msg_type == OLSR_TC_MSG) { olsr_print_neighbor(msg_data, msg_tlen); } else { olsr_print_lq_neighbor(msg_data, msg_tlen); } break; case OLSR_MID_MSG: if (!TTEST2(*msg_data, sizeof(struct in_addr))) goto trunc; while (msg_tlen >= sizeof(struct in_addr)) { printf("\n\t interface address %s", ipaddr_string(msg_data)); msg_data += sizeof(struct in_addr); msg_tlen -= sizeof(struct in_addr); } break; case OLSR_HNA_MSG: prefix = 1; printf("\n\t advertised networks\n\t "); while (msg_tlen >= sizeof(struct olsr_hna)) { if (!TTEST2(*msg_data, sizeof(struct olsr_hna))) goto trunc; ptr.hna = (struct olsr_hna *)msg_data; /* print 4 prefixes per line */ printf("%s/%u%s", ipaddr_string(ptr.hna->network), mask2plen(EXTRACT_32BITS(ptr.hna->mask)), prefix % 4 == 0 ? "\n\t " : " "); msg_data += sizeof(struct olsr_hna); msg_tlen -= sizeof(struct olsr_hna); prefix ++; } break; /* * FIXME those are the defined messages that lack a decoder * you are welcome to contribute code ;-) */ case OLSR_POWERINFO_MSG: case OLSR_NAMESERVICE_MSG: default: print_unknown_data(msg_data, "\n\t ", msg_tlen); break; } tptr += msg_len; } return; trunc: printf("[|olsr]"); } /* * Local Variables: * c-style: whitesmith * c-basic-offset: 4 * End: */ tcpdump-3.9.8/./print-rt6.c0000644000026300017500000000543010231554437013505 0ustar mcrmcr/* * Copyright (c) 1988, 1989, 1990, 1991, 1993, 1994 * The Regents of the University of California. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that: (1) source code distributions * retain the above copyright notice and this paragraph in its entirety, (2) * distributions including binary code include the above copyright notice and * this paragraph in its entirety in the documentation or other materials * provided with the distribution, and (3) all advertising materials mentioning * features or use of this software display the following acknowledgement: * ``This product includes software developed by the University of California, * Lawrence Berkeley Laboratory and its contributors.'' Neither the name of * the University nor the names of its contributors may be used to endorse * or promote products derived from this software without specific prior * written permission. * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. */ #ifndef lint static const char rcsid[] _U_ = "@(#) $Header: /tcpdump/master/tcpdump/print-rt6.c,v 1.26.2.1 2005/04/20 22:35:11 guy Exp $"; #endif #ifdef HAVE_CONFIG_H #include "config.h" #endif #ifdef INET6 #include #include #include "ip6.h" #include "interface.h" #include "addrtoname.h" #include "extract.h" int rt6_print(register const u_char *bp, const u_char *bp2 _U_) { register const struct ip6_rthdr *dp; register const struct ip6_rthdr0 *dp0; register const u_char *ep; int i, len; register const struct in6_addr *addr; dp = (struct ip6_rthdr *)bp; len = dp->ip6r_len; /* 'ep' points to the end of available data. */ ep = snapend; TCHECK(dp->ip6r_segleft); printf("srcrt (len=%d", dp->ip6r_len); /*)*/ printf(", type=%d", dp->ip6r_type); printf(", segleft=%d", dp->ip6r_segleft); switch (dp->ip6r_type) { #ifndef IPV6_RTHDR_TYPE_0 #define IPV6_RTHDR_TYPE_0 0 #endif #ifndef IPV6_RTHDR_TYPE_2 #define IPV6_RTHDR_TYPE_2 2 #endif case IPV6_RTHDR_TYPE_0: case IPV6_RTHDR_TYPE_2: /* Mobile IPv6 ID-20 */ dp0 = (struct ip6_rthdr0 *)dp; TCHECK(dp0->ip6r0_reserved); if (dp0->ip6r0_reserved || vflag) { printf(", rsv=0x%0x", EXTRACT_32BITS(&dp0->ip6r0_reserved)); } if (len % 2 == 1) goto trunc; len >>= 1; addr = &dp0->ip6r0_addr[0]; for (i = 0; i < len; i++) { if ((u_char *)(addr + 1) > ep) goto trunc; printf(", [%d]%s", i, ip6addr_string(addr)); addr++; } /*(*/ printf(") "); return((dp0->ip6r0_len + 1) << 3); break; default: goto trunc; break; } trunc: fputs("[|srcrt]", stdout); return -1; } #endif /* INET6 */ tcpdump-3.9.8/./oui.c0000644000026300017500000000674410230334770012440 0ustar mcrmcr/* * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that: (1) source code * distributions retain the above copyright notice and this paragraph * in its entirety, and (2) distributions including binary code include * the above copyright notice and this paragraph in its entirety in * the documentation or other materials provided with the distribution. * THIS SOFTWARE IS PROVIDED ``AS IS'' AND * WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT * LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * FOR A PARTICULAR PURPOSE. * * Original code by Hannes Gredler (hannes@juniper.net) */ #ifndef lint static const char rcsid[] _U_ = "@(#) $Header: /tcpdump/master/tcpdump/oui.c,v 1.4.2.1 2005/04/17 01:20:56 guy Exp $ (LBL)"; #endif #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include "interface.h" #include "oui.h" /* FIXME complete OUI list using a script */ struct tok oui_values[] = { { OUI_ENCAP_ETHER, "Ethernet" }, { OUI_CISCO, "Cisco" }, { OUI_NORTEL, "Nortel Networks SONMP" }, { OUI_CISCO_90, "Cisco bridged" }, { OUI_RFC2684, "Ethernet bridged" }, { OUI_ATM_FORUM, "ATM Forum" }, { OUI_CABLE_BPDU, "DOCSIS Spanning Tree" }, { OUI_APPLETALK, "Appletalk" }, { OUI_JUNIPER, "Juniper" }, { OUI_HP, "Hewlett-Packard" }, { 0, NULL } }; /* * SMI Network Management Private Enterprise Codes for organizations. * * XXX - these also appear in FreeRadius dictionary files, with items such * as * * VENDOR Cisco 9 * * List taken from Ethereal's epan/sminmpec.c. */ struct tok smi_values[] = { { SMI_IETF, "IETF (reserved)"}, { SMI_ACC, "ACC"}, { SMI_CISCO, "Cisco"}, { SMI_HEWLETT_PACKARD, "Hewlett Packard"}, { SMI_SUN_MICROSYSTEMS, "Sun Microsystems"}, { SMI_MERIT, "Merit"}, { SMI_SHIVA, "Shiva"}, { SMI_ERICSSON, "Ericsson AB"}, { SMI_CISCO_VPN5000, "Cisco VPN 5000"}, { SMI_LIVINGSTON, "Livingston"}, { SMI_MICROSOFT, "Microsoft"}, { SMI_3COM, "3Com"}, { SMI_ASCEND, "Ascend"}, { SMI_BAY, "Bay Networks"}, { SMI_FOUNDRY, "Foundry"}, { SMI_VERSANET, "Versanet"}, { SMI_REDBACK, "Redback"}, { SMI_JUNIPER, "Juniper Networks"}, { SMI_APTIS, "Aptis"}, { SMI_CISCO_VPN3000, "Cisco VPN 3000"}, { SMI_COSINE, "CoSine Communications"}, { SMI_NETSCREEN, "Netscreen"}, { SMI_SHASTA, "Shasta"}, { SMI_NOMADIX, "Nomadix"}, { SMI_SIEMENS, "Siemens"}, { SMI_CABLELABS, "CableLabs"}, { SMI_UNISPHERE, "Unisphere Networks"}, { SMI_CISCO_BBSM, "Cisco BBSM"}, { SMI_THE3GPP2, "3rd Generation Partnership Project 2 (3GPP2)"}, { SMI_IP_UNPLUGGED, "ipUnplugged"}, { SMI_ISSANNI, "Issanni Communications"}, { SMI_QUINTUM, "Quintum"}, { SMI_INTERLINK, "Interlink"}, { SMI_COLUBRIS, "Colubris"}, { SMI_COLUMBIA_UNIVERSITY, "Columbia University"}, { SMI_THE3GPP, "3GPP"}, { SMI_GEMTEK_SYSTEMS, "Gemtek-Systems"}, { SMI_WIFI_ALLIANCE, "Wi-Fi Alliance"}, { 0, NULL} }; tcpdump-3.9.8/./print-smb.c0000644000026300017500000012027410651260273013555 0ustar mcrmcr/* * Copyright (C) Andrew Tridgell 1995-1999 * * This software may be distributed either under the terms of the * BSD-style license that accompanies tcpdump or the GNU GPL version 2 * or later */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #ifndef lint static const char rcsid[] _U_ = "@(#) $Header: /tcpdump/master/tcpdump/print-smb.c,v 1.41.2.4 2007/07/14 22:29:05 guy Exp $"; #endif #include #include #include #include "interface.h" #include "extract.h" #include "smb.h" static int request = 0; static int unicodestr = 0; const u_char *startbuf = NULL; struct smbdescript { const char *req_f1; const char *req_f2; const char *rep_f1; const char *rep_f2; void (*fn)(const u_char *, const u_char *, const u_char *, const u_char *); }; struct smbdescriptint { const char *req_f1; const char *req_f2; const char *rep_f1; const char *rep_f2; void (*fn)(const u_char *, const u_char *, int, int); }; struct smbfns { int id; const char *name; int flags; struct smbdescript descript; }; struct smbfnsint { int id; const char *name; int flags; struct smbdescriptint descript; }; #define DEFDESCRIPT { NULL, NULL, NULL, NULL, NULL } #define FLG_CHAIN (1 << 0) static struct smbfns * smbfind(int id, struct smbfns *list) { int sindex; for (sindex = 0; list[sindex].name; sindex++) if (list[sindex].id == id) return(&list[sindex]); return(&list[0]); } static struct smbfnsint * smbfindint(int id, struct smbfnsint *list) { int sindex; for (sindex = 0; list[sindex].name; sindex++) if (list[sindex].id == id) return(&list[sindex]); return(&list[0]); } static void trans2_findfirst(const u_char *param, const u_char *data, int pcnt, int dcnt) { const char *fmt; if (request) fmt = "Attribute=[A]\nSearchCount=[d]\nFlags=[w]\nLevel=[dP4]\nFile=[S]\n"; else fmt = "Handle=[w]\nCount=[d]\nEOS=[w]\nEoffset=[d]\nLastNameOfs=[w]\n"; smb_fdata(param, fmt, param + pcnt, unicodestr); if (dcnt) { printf("data:\n"); print_data(data, dcnt); } } static void trans2_qfsinfo(const u_char *param, const u_char *data, int pcnt, int dcnt) { static int level = 0; const char *fmt=""; if (request) { TCHECK2(*param, 2); level = EXTRACT_LE_16BITS(param); fmt = "InfoLevel=[d]\n"; smb_fdata(param, fmt, param + pcnt, unicodestr); } else { switch (level) { case 1: fmt = "idFileSystem=[W]\nSectorUnit=[D]\nUnit=[D]\nAvail=[D]\nSectorSize=[d]\n"; break; case 2: fmt = "CreationTime=[T2]VolNameLength=[lb]\nVolumeLabel=[c]\n"; break; case 0x105: fmt = "Capabilities=[W]\nMaxFileLen=[D]\nVolNameLen=[lD]\nVolume=[C]\n"; break; default: fmt = "UnknownLevel\n"; break; } smb_fdata(data, fmt, data + dcnt, unicodestr); } if (dcnt) { printf("data:\n"); print_data(data, dcnt); } return; trunc: printf("[|SMB]"); return; } struct smbfnsint trans2_fns[] = { { 0, "TRANSACT2_OPEN", 0, { "Flags2=[w]\nMode=[w]\nSearchAttrib=[A]\nAttrib=[A]\nTime=[T2]\nOFun=[w]\nSize=[D]\nRes=([w, w, w, w, w])\nPath=[S]", NULL, "Handle=[d]\nAttrib=[A]\nTime=[T2]\nSize=[D]\nAccess=[w]\nType=[w]\nState=[w]\nAction=[w]\nInode=[W]\nOffErr=[d]\n|EALength=[d]\n", NULL, NULL }}, { 1, "TRANSACT2_FINDFIRST", 0, { NULL, NULL, NULL, NULL, trans2_findfirst }}, { 2, "TRANSACT2_FINDNEXT", 0, DEFDESCRIPT }, { 3, "TRANSACT2_QFSINFO", 0, { NULL, NULL, NULL, NULL, trans2_qfsinfo }}, { 4, "TRANSACT2_SETFSINFO", 0, DEFDESCRIPT }, { 5, "TRANSACT2_QPATHINFO", 0, DEFDESCRIPT }, { 6, "TRANSACT2_SETPATHINFO", 0, DEFDESCRIPT }, { 7, "TRANSACT2_QFILEINFO", 0, DEFDESCRIPT }, { 8, "TRANSACT2_SETFILEINFO", 0, DEFDESCRIPT }, { 9, "TRANSACT2_FSCTL", 0, DEFDESCRIPT }, { 10, "TRANSACT2_IOCTL", 0, DEFDESCRIPT }, { 11, "TRANSACT2_FINDNOTIFYFIRST", 0, DEFDESCRIPT }, { 12, "TRANSACT2_FINDNOTIFYNEXT", 0, DEFDESCRIPT }, { 13, "TRANSACT2_MKDIR", 0, DEFDESCRIPT }, { -1, NULL, 0, DEFDESCRIPT } }; static void print_trans2(const u_char *words, const u_char *dat, const u_char *buf, const u_char *maxbuf) { u_int bcc; static struct smbfnsint *fn = &trans2_fns[0]; const u_char *data, *param; const u_char *w = words + 1; const char *f1 = NULL, *f2 = NULL; int pcnt, dcnt; TCHECK(words[0]); if (request) { TCHECK2(w[14 * 2], 2); pcnt = EXTRACT_LE_16BITS(w + 9 * 2); param = buf + EXTRACT_LE_16BITS(w + 10 * 2); dcnt = EXTRACT_LE_16BITS(w + 11 * 2); data = buf + EXTRACT_LE_16BITS(w + 12 * 2); fn = smbfindint(EXTRACT_LE_16BITS(w + 14 * 2), trans2_fns); } else { if (words[0] == 0) { printf("%s\n", fn->name); printf("Trans2Interim\n"); return; } TCHECK2(w[7 * 2], 2); pcnt = EXTRACT_LE_16BITS(w + 3 * 2); param = buf + EXTRACT_LE_16BITS(w + 4 * 2); dcnt = EXTRACT_LE_16BITS(w + 6 * 2); data = buf + EXTRACT_LE_16BITS(w + 7 * 2); } printf("%s param_length=%d data_length=%d\n", fn->name, pcnt, dcnt); if (request) { if (words[0] == 8) { smb_fdata(words + 1, "Trans2Secondary\nTotParam=[d]\nTotData=[d]\nParamCnt=[d]\nParamOff=[d]\nParamDisp=[d]\nDataCnt=[d]\nDataOff=[d]\nDataDisp=[d]\nHandle=[d]\n", maxbuf, unicodestr); return; } else { smb_fdata(words + 1, "TotParam=[d]\nTotData=[d]\nMaxParam=[d]\nMaxData=[d]\nMaxSetup=[b][P1]\nFlags=[w]\nTimeOut=[D]\nRes1=[w]\nParamCnt=[d]\nParamOff=[d]\nDataCnt=[d]\nDataOff=[d]\nSetupCnt=[b][P1]\n", words + 1 + 14 * 2, unicodestr); } f1 = fn->descript.req_f1; f2 = fn->descript.req_f2; } else { smb_fdata(words + 1, "TotParam=[d]\nTotData=[d]\nRes1=[w]\nParamCnt=[d]\nParamOff=[d]\nParamDisp[d]\nDataCnt=[d]\nDataOff=[d]\nDataDisp=[d]\nSetupCnt=[b][P1]\n", words + 1 + 10 * 2, unicodestr); f1 = fn->descript.rep_f1; f2 = fn->descript.rep_f2; } TCHECK2(*dat, 2); bcc = EXTRACT_LE_16BITS(dat); printf("smb_bcc=%u\n", bcc); if (fn->descript.fn) (*fn->descript.fn)(param, data, pcnt, dcnt); else { smb_fdata(param, f1 ? f1 : "Parameters=\n", param + pcnt, unicodestr); smb_fdata(data, f2 ? f2 : "Data=\n", data + dcnt, unicodestr); } return; trunc: printf("[|SMB]"); return; } static void print_browse(const u_char *param, int paramlen, const u_char *data, int datalen) { const u_char *maxbuf = data + datalen; int command; TCHECK(data[0]); command = data[0]; smb_fdata(param, "BROWSE PACKET\n|Param ", param+paramlen, unicodestr); switch (command) { case 0xF: data = smb_fdata(data, "BROWSE PACKET:\nType=[B] (LocalMasterAnnouncement)\nUpdateCount=[w]\nRes1=[B]\nAnnounceInterval=[d]\nName=[n2]\nMajorVersion=[B]\nMinorVersion=[B]\nServerType=[W]\nElectionVersion=[w]\nBrowserConstant=[w]\n", maxbuf, unicodestr); break; case 0x1: data = smb_fdata(data, "BROWSE PACKET:\nType=[B] (HostAnnouncement)\nUpdateCount=[w]\nRes1=[B]\nAnnounceInterval=[d]\nName=[n2]\nMajorVersion=[B]\nMinorVersion=[B]\nServerType=[W]\nElectionVersion=[w]\nBrowserConstant=[w]\n", maxbuf, unicodestr); break; case 0x2: data = smb_fdata(data, "BROWSE PACKET:\nType=[B] (AnnouncementRequest)\nFlags=[B]\nReplySystemName=[S]\n", maxbuf, unicodestr); break; case 0xc: data = smb_fdata(data, "BROWSE PACKET:\nType=[B] (WorkgroupAnnouncement)\nUpdateCount=[w]\nRes1=[B]\nAnnounceInterval=[d]\nName=[n2]\nMajorVersion=[B]\nMinorVersion=[B]\nServerType=[W]\nCommentPointer=[W]\nServerName=[S]\n", maxbuf, unicodestr); break; case 0x8: data = smb_fdata(data, "BROWSE PACKET:\nType=[B] (ElectionFrame)\nElectionVersion=[B]\nOSSummary=[W]\nUptime=[(W, W)]\nServerName=[S]\n", maxbuf, unicodestr); break; case 0xb: data = smb_fdata(data, "BROWSE PACKET:\nType=[B] (BecomeBackupBrowser)\nName=[S]\n", maxbuf, unicodestr); break; case 0x9: data = smb_fdata(data, "BROWSE PACKET:\nType=[B] (GetBackupList)\nListCount?=[B]\nToken=[W]\n", maxbuf, unicodestr); break; case 0xa: data = smb_fdata(data, "BROWSE PACKET:\nType=[B] (BackupListResponse)\nServerCount?=[B]\nToken=[W]\n*Name=[S]\n", maxbuf, unicodestr); break; case 0xd: data = smb_fdata(data, "BROWSE PACKET:\nType=[B] (MasterAnnouncement)\nMasterName=[S]\n", maxbuf, unicodestr); break; case 0xe: data = smb_fdata(data, "BROWSE PACKET:\nType=[B] (ResetBrowser)\nOptions=[B]\n", maxbuf, unicodestr); break; default: data = smb_fdata(data, "Unknown Browser Frame ", maxbuf, unicodestr); break; } return; trunc: printf("[|SMB]"); return; } static void print_ipc(const u_char *param, int paramlen, const u_char *data, int datalen) { if (paramlen) smb_fdata(param, "Command=[w]\nStr1=[S]\nStr2=[S]\n", param + paramlen, unicodestr); if (datalen) smb_fdata(data, "IPC ", data + datalen, unicodestr); } static void print_trans(const u_char *words, const u_char *data1, const u_char *buf, const u_char *maxbuf) { u_int bcc; const char *f1, *f2, *f3, *f4; const u_char *data, *param; const u_char *w = words + 1; int datalen, paramlen; if (request) { TCHECK2(w[12 * 2], 2); paramlen = EXTRACT_LE_16BITS(w + 9 * 2); param = buf + EXTRACT_LE_16BITS(w + 10 * 2); datalen = EXTRACT_LE_16BITS(w + 11 * 2); data = buf + EXTRACT_LE_16BITS(w + 12 * 2); f1 = "TotParamCnt=[d] \nTotDataCnt=[d] \nMaxParmCnt=[d] \nMaxDataCnt=[d]\nMaxSCnt=[d] \nTransFlags=[w] \nRes1=[w] \nRes2=[w] \nRes3=[w]\nParamCnt=[d] \nParamOff=[d] \nDataCnt=[d] \nDataOff=[d] \nSUCnt=[d]\n"; f2 = "|Name=[S]\n"; f3 = "|Param "; f4 = "|Data "; } else { TCHECK2(w[7 * 2], 2); paramlen = EXTRACT_LE_16BITS(w + 3 * 2); param = buf + EXTRACT_LE_16BITS(w + 4 * 2); datalen = EXTRACT_LE_16BITS(w + 6 * 2); data = buf + EXTRACT_LE_16BITS(w + 7 * 2); f1 = "TotParamCnt=[d] \nTotDataCnt=[d] \nRes1=[d]\nParamCnt=[d] \nParamOff=[d] \nRes2=[d] \nDataCnt=[d] \nDataOff=[d] \nRes3=[d]\nLsetup=[d]\n"; f2 = "|Unknown "; f3 = "|Param "; f4 = "|Data "; } smb_fdata(words + 1, f1, SMBMIN(words + 1 + 2 * words[0], maxbuf), unicodestr); TCHECK2(*data1, 2); bcc = EXTRACT_LE_16BITS(data1); printf("smb_bcc=%u\n", bcc); if (bcc > 0) { smb_fdata(data1 + 2, f2, maxbuf - (paramlen + datalen), unicodestr); if (strcmp((const char *)(data1 + 2), "\\MAILSLOT\\BROWSE") == 0) { print_browse(param, paramlen, data, datalen); return; } if (strcmp((const char *)(data1 + 2), "\\PIPE\\LANMAN") == 0) { print_ipc(param, paramlen, data, datalen); return; } if (paramlen) smb_fdata(param, f3, SMBMIN(param + paramlen, maxbuf), unicodestr); if (datalen) smb_fdata(data, f4, SMBMIN(data + datalen, maxbuf), unicodestr); } return; trunc: printf("[|SMB]"); return; } static void print_negprot(const u_char *words, const u_char *data, const u_char *buf _U_, const u_char *maxbuf) { u_int wct, bcc; const char *f1 = NULL, *f2 = NULL; TCHECK(words[0]); wct = words[0]; if (request) f2 = "*|Dialect=[Y]\n"; else { if (wct == 1) f1 = "Core Protocol\nDialectIndex=[d]"; else if (wct == 17) f1 = "NT1 Protocol\nDialectIndex=[d]\nSecMode=[B]\nMaxMux=[d]\nNumVcs=[d]\nMaxBuffer=[D]\nRawSize=[D]\nSessionKey=[W]\nCapabilities=[W]\nServerTime=[T3]TimeZone=[d]\nCryptKey="; else if (wct == 13) f1 = "Coreplus/Lanman1/Lanman2 Protocol\nDialectIndex=[d]\nSecMode=[w]\nMaxXMit=[d]\nMaxMux=[d]\nMaxVcs=[d]\nBlkMode=[w]\nSessionKey=[W]\nServerTime=[T1]TimeZone=[d]\nRes=[W]\nCryptKey="; } if (f1) smb_fdata(words + 1, f1, SMBMIN(words + 1 + wct * 2, maxbuf), unicodestr); else print_data(words + 1, SMBMIN(wct * 2, PTR_DIFF(maxbuf, words + 1))); TCHECK2(*data, 2); bcc = EXTRACT_LE_16BITS(data); printf("smb_bcc=%u\n", bcc); if (bcc > 0) { if (f2) smb_fdata(data + 2, f2, SMBMIN(data + 2 + EXTRACT_LE_16BITS(data), maxbuf), unicodestr); else print_data(data + 2, SMBMIN(EXTRACT_LE_16BITS(data), PTR_DIFF(maxbuf, data + 2))); } return; trunc: printf("[|SMB]"); return; } static void print_sesssetup(const u_char *words, const u_char *data, const u_char *buf _U_, const u_char *maxbuf) { u_int wct, bcc; const char *f1 = NULL, *f2 = NULL; TCHECK(words[0]); wct = words[0]; if (request) { if (wct == 10) f1 = "Com2=[w]\nOff2=[d]\nBufSize=[d]\nMpxMax=[d]\nVcNum=[d]\nSessionKey=[W]\nPassLen=[d]\nCryptLen=[d]\nCryptOff=[d]\nPass&Name=\n"; else f1 = "Com2=[B]\nRes1=[B]\nOff2=[d]\nMaxBuffer=[d]\nMaxMpx=[d]\nVcNumber=[d]\nSessionKey=[W]\nCaseInsensitivePasswordLength=[d]\nCaseSensitivePasswordLength=[d]\nRes=[W]\nCapabilities=[W]\nPass1&Pass2&Account&Domain&OS&LanMan=\n"; } else { if (wct == 3) { f1 = "Com2=[w]\nOff2=[d]\nAction=[w]\n"; } else if (wct == 13) { f1 = "Com2=[B]\nRes=[B]\nOff2=[d]\nAction=[w]\n"; f2 = "NativeOS=[S]\nNativeLanMan=[S]\nPrimaryDomain=[S]\n"; } } if (f1) smb_fdata(words + 1, f1, SMBMIN(words + 1 + wct * 2, maxbuf), unicodestr); else print_data(words + 1, SMBMIN(wct * 2, PTR_DIFF(maxbuf, words + 1))); TCHECK2(*data, 2); bcc = EXTRACT_LE_16BITS(data); printf("smb_bcc=%u\n", bcc); if (bcc > 0) { if (f2) smb_fdata(data + 2, f2, SMBMIN(data + 2 + EXTRACT_LE_16BITS(data), maxbuf), unicodestr); else print_data(data + 2, SMBMIN(EXTRACT_LE_16BITS(data), PTR_DIFF(maxbuf, data + 2))); } return; trunc: printf("[|SMB]"); return; } static void print_lockingandx(const u_char *words, const u_char *data, const u_char *buf _U_, const u_char *maxbuf) { u_int wct, bcc; const u_char *maxwords; const char *f1 = NULL, *f2 = NULL; TCHECK(words[0]); wct = words[0]; if (request) { f1 = "Com2=[w]\nOff2=[d]\nHandle=[d]\nLockType=[w]\nTimeOut=[D]\nUnlockCount=[d]\nLockCount=[d]\n"; TCHECK(words[7]); if (words[7] & 0x10) f2 = "*Process=[d]\n[P2]Offset=[M]\nLength=[M]\n"; else f2 = "*Process=[d]\nOffset=[D]\nLength=[D]\n"; } else { f1 = "Com2=[w]\nOff2=[d]\n"; } maxwords = SMBMIN(words + 1 + wct * 2, maxbuf); if (wct) smb_fdata(words + 1, f1, maxwords, unicodestr); TCHECK2(*data, 2); bcc = EXTRACT_LE_16BITS(data); printf("smb_bcc=%u\n", bcc); if (bcc > 0) { if (f2) smb_fdata(data + 2, f2, SMBMIN(data + 2 + EXTRACT_LE_16BITS(data), maxbuf), unicodestr); else print_data(data + 2, SMBMIN(EXTRACT_LE_16BITS(data), PTR_DIFF(maxbuf, data + 2))); } return; trunc: printf("[|SMB]"); return; } static struct smbfns smb_fns[] = { { -1, "SMBunknown", 0, DEFDESCRIPT }, { SMBtcon, "SMBtcon", 0, { NULL, "Path=[Z]\nPassword=[Z]\nDevice=[Z]\n", "MaxXmit=[d]\nTreeId=[d]\n", NULL, NULL } }, { SMBtdis, "SMBtdis", 0, DEFDESCRIPT }, { SMBexit, "SMBexit", 0, DEFDESCRIPT }, { SMBioctl, "SMBioctl", 0, DEFDESCRIPT }, { SMBecho, "SMBecho", 0, { "ReverbCount=[d]\n", NULL, "SequenceNum=[d]\n", NULL, NULL } }, { SMBulogoffX, "SMBulogoffX", FLG_CHAIN, DEFDESCRIPT }, { SMBgetatr, "SMBgetatr", 0, { NULL, "Path=[Z]\n", "Attribute=[A]\nTime=[T2]Size=[D]\nRes=([w,w,w,w,w])\n", NULL, NULL } }, { SMBsetatr, "SMBsetatr", 0, { "Attribute=[A]\nTime=[T2]Res=([w,w,w,w,w])\n", "Path=[Z]\n", NULL, NULL, NULL } }, { SMBchkpth, "SMBchkpth", 0, { NULL, "Path=[Z]\n", NULL, NULL, NULL } }, { SMBsearch, "SMBsearch", 0, { "Count=[d]\nAttrib=[A]\n", "Path=[Z]\nBlkType=[B]\nBlkLen=[d]\n|Res1=[B]\nMask=[s11]\nSrv1=[B]\nDirIndex=[d]\nSrv2=[w]\nRes2=[W]\n", "Count=[d]\n", "BlkType=[B]\nBlkLen=[d]\n*\nRes1=[B]\nMask=[s11]\nSrv1=[B]\nDirIndex=[d]\nSrv2=[w]\nRes2=[W]\nAttrib=[a]\nTime=[T1]Size=[D]\nName=[s13]\n", NULL } }, { SMBopen, "SMBopen", 0, { "Mode=[w]\nAttribute=[A]\n", "Path=[Z]\n", "Handle=[d]\nOAttrib=[A]\nTime=[T2]Size=[D]\nAccess=[w]\n", NULL, NULL } }, { SMBcreate, "SMBcreate", 0, { "Attrib=[A]\nTime=[T2]", "Path=[Z]\n", "Handle=[d]\n", NULL, NULL } }, { SMBmknew, "SMBmknew", 0, { "Attrib=[A]\nTime=[T2]", "Path=[Z]\n", "Handle=[d]\n", NULL, NULL } }, { SMBunlink, "SMBunlink", 0, { "Attrib=[A]\n", "Path=[Z]\n", NULL, NULL, NULL } }, { SMBread, "SMBread", 0, { "Handle=[d]\nByteCount=[d]\nOffset=[D]\nCountLeft=[d]\n", NULL, "Count=[d]\nRes=([w,w,w,w])\n", NULL, NULL } }, { SMBwrite, "SMBwrite", 0, { "Handle=[d]\nByteCount=[d]\nOffset=[D]\nCountLeft=[d]\n", NULL, "Count=[d]\n", NULL, NULL } }, { SMBclose, "SMBclose", 0, { "Handle=[d]\nTime=[T2]", NULL, NULL, NULL, NULL } }, { SMBmkdir, "SMBmkdir", 0, { NULL, "Path=[Z]\n", NULL, NULL, NULL } }, { SMBrmdir, "SMBrmdir", 0, { NULL, "Path=[Z]\n", NULL, NULL, NULL } }, { SMBdskattr, "SMBdskattr", 0, { NULL, NULL, "TotalUnits=[d]\nBlocksPerUnit=[d]\nBlockSize=[d]\nFreeUnits=[d]\nMedia=[w]\n", NULL, NULL } }, { SMBmv, "SMBmv", 0, { "Attrib=[A]\n", "OldPath=[Z]\nNewPath=[Z]\n", NULL, NULL, NULL } }, /* * this is a Pathworks specific call, allowing the * changing of the root path */ { pSETDIR, "SMBsetdir", 0, { NULL, "Path=[Z]\n", NULL, NULL, NULL } }, { SMBlseek, "SMBlseek", 0, { "Handle=[d]\nMode=[w]\nOffset=[D]\n", "Offset=[D]\n", NULL, NULL, NULL } }, { SMBflush, "SMBflush", 0, { "Handle=[d]\n", NULL, NULL, NULL, NULL } }, { SMBsplopen, "SMBsplopen", 0, { "SetupLen=[d]\nMode=[w]\n", "Ident=[Z]\n", "Handle=[d]\n", NULL, NULL } }, { SMBsplclose, "SMBsplclose", 0, { "Handle=[d]\n", NULL, NULL, NULL, NULL } }, { SMBsplretq, "SMBsplretq", 0, { "MaxCount=[d]\nStartIndex=[d]\n", NULL, "Count=[d]\nIndex=[d]\n", "*Time=[T2]Status=[B]\nJobID=[d]\nSize=[D]\nRes=[B]Name=[s16]\n", NULL } }, { SMBsplwr, "SMBsplwr", 0, { "Handle=[d]\n", NULL, NULL, NULL, NULL } }, { SMBlock, "SMBlock", 0, { "Handle=[d]\nCount=[D]\nOffset=[D]\n", NULL, NULL, NULL, NULL } }, { SMBunlock, "SMBunlock", 0, { "Handle=[d]\nCount=[D]\nOffset=[D]\n", NULL, NULL, NULL, NULL } }, /* CORE+ PROTOCOL FOLLOWS */ { SMBreadbraw, "SMBreadbraw", 0, { "Handle=[d]\nOffset=[D]\nMaxCount=[d]\nMinCount=[d]\nTimeOut=[D]\nRes=[d]\n", NULL, NULL, NULL, NULL } }, { SMBwritebraw, "SMBwritebraw", 0, { "Handle=[d]\nTotalCount=[d]\nRes=[w]\nOffset=[D]\nTimeOut=[D]\nWMode=[w]\nRes2=[W]\n|DataSize=[d]\nDataOff=[d]\n", NULL, "WriteRawAck", NULL, NULL } }, { SMBwritec, "SMBwritec", 0, { NULL, NULL, "Count=[d]\n", NULL, NULL } }, { SMBwriteclose, "SMBwriteclose", 0, { "Handle=[d]\nCount=[d]\nOffset=[D]\nTime=[T2]Res=([w,w,w,w,w,w])", NULL, "Count=[d]\n", NULL, NULL } }, { SMBlockread, "SMBlockread", 0, { "Handle=[d]\nByteCount=[d]\nOffset=[D]\nCountLeft=[d]\n", NULL, "Count=[d]\nRes=([w,w,w,w])\n", NULL, NULL } }, { SMBwriteunlock, "SMBwriteunlock", 0, { "Handle=[d]\nByteCount=[d]\nOffset=[D]\nCountLeft=[d]\n", NULL, "Count=[d]\n", NULL, NULL } }, { SMBreadBmpx, "SMBreadBmpx", 0, { "Handle=[d]\nOffset=[D]\nMaxCount=[d]\nMinCount=[d]\nTimeOut=[D]\nRes=[w]\n", NULL, "Offset=[D]\nTotCount=[d]\nRemaining=[d]\nRes=([w,w])\nDataSize=[d]\nDataOff=[d]\n", NULL, NULL } }, { SMBwriteBmpx, "SMBwriteBmpx", 0, { "Handle=[d]\nTotCount=[d]\nRes=[w]\nOffset=[D]\nTimeOut=[D]\nWMode=[w]\nRes2=[W]\nDataSize=[d]\nDataOff=[d]\n", NULL, "Remaining=[d]\n", NULL, NULL } }, { SMBwriteBs, "SMBwriteBs", 0, { "Handle=[d]\nTotCount=[d]\nOffset=[D]\nRes=[W]\nDataSize=[d]\nDataOff=[d]\n", NULL, "Count=[d]\n", NULL, NULL } }, { SMBsetattrE, "SMBsetattrE", 0, { "Handle=[d]\nCreationTime=[T2]AccessTime=[T2]ModifyTime=[T2]", NULL, NULL, NULL, NULL } }, { SMBgetattrE, "SMBgetattrE", 0, { "Handle=[d]\n", NULL, "CreationTime=[T2]AccessTime=[T2]ModifyTime=[T2]Size=[D]\nAllocSize=[D]\nAttribute=[A]\n", NULL, NULL } }, { SMBtranss, "SMBtranss", 0, DEFDESCRIPT }, { SMBioctls, "SMBioctls", 0, DEFDESCRIPT }, { SMBcopy, "SMBcopy", 0, { "TreeID2=[d]\nOFun=[w]\nFlags=[w]\n", "Path=[S]\nNewPath=[S]\n", "CopyCount=[d]\n", "|ErrStr=[S]\n", NULL } }, { SMBmove, "SMBmove", 0, { "TreeID2=[d]\nOFun=[w]\nFlags=[w]\n", "Path=[S]\nNewPath=[S]\n", "MoveCount=[d]\n", "|ErrStr=[S]\n", NULL } }, { SMBopenX, "SMBopenX", FLG_CHAIN, { "Com2=[w]\nOff2=[d]\nFlags=[w]\nMode=[w]\nSearchAttrib=[A]\nAttrib=[A]\nTime=[T2]OFun=[w]\nSize=[D]\nTimeOut=[D]\nRes=[W]\n", "Path=[S]\n", "Com2=[w]\nOff2=[d]\nHandle=[d]\nAttrib=[A]\nTime=[T2]Size=[D]\nAccess=[w]\nType=[w]\nState=[w]\nAction=[w]\nFileID=[W]\nRes=[w]\n", NULL, NULL } }, { SMBreadX, "SMBreadX", FLG_CHAIN, { "Com2=[w]\nOff2=[d]\nHandle=[d]\nOffset=[D]\nMaxCount=[d]\nMinCount=[d]\nTimeOut=[D]\nCountLeft=[d]\n", NULL, "Com2=[w]\nOff2=[d]\nRemaining=[d]\nRes=[W]\nDataSize=[d]\nDataOff=[d]\nRes=([w,w,w,w])\n", NULL, NULL } }, { SMBwriteX, "SMBwriteX", FLG_CHAIN, { "Com2=[w]\nOff2=[d]\nHandle=[d]\nOffset=[D]\nTimeOut=[D]\nWMode=[w]\nCountLeft=[d]\nRes=[w]\nDataSize=[d]\nDataOff=[d]\n", NULL, "Com2=[w]\nOff2=[d]\nCount=[d]\nRemaining=[d]\nRes=[W]\n", NULL, NULL } }, { SMBffirst, "SMBffirst", 0, { "Count=[d]\nAttrib=[A]\n", "Path=[Z]\nBlkType=[B]\nBlkLen=[d]\n|Res1=[B]\nMask=[s11]\nSrv1=[B]\nDirIndex=[d]\nSrv2=[w]\n", "Count=[d]\n", "BlkType=[B]\nBlkLen=[d]\n*\nRes1=[B]\nMask=[s11]\nSrv1=[B]\nDirIndex=[d]\nSrv2=[w]\nRes2=[W]\nAttrib=[a]\nTime=[T1]Size=[D]\nName=[s13]\n", NULL } }, { SMBfunique, "SMBfunique", 0, { "Count=[d]\nAttrib=[A]\n", "Path=[Z]\nBlkType=[B]\nBlkLen=[d]\n|Res1=[B]\nMask=[s11]\nSrv1=[B]\nDirIndex=[d]\nSrv2=[w]\n", "Count=[d]\n", "BlkType=[B]\nBlkLen=[d]\n*\nRes1=[B]\nMask=[s11]\nSrv1=[B]\nDirIndex=[d]\nSrv2=[w]\nRes2=[W]\nAttrib=[a]\nTime=[T1]Size=[D]\nName=[s13]\n", NULL } }, { SMBfclose, "SMBfclose", 0, { "Count=[d]\nAttrib=[A]\n", "Path=[Z]\nBlkType=[B]\nBlkLen=[d]\n|Res1=[B]\nMask=[s11]\nSrv1=[B]\nDirIndex=[d]\nSrv2=[w]\n", "Count=[d]\n", "BlkType=[B]\nBlkLen=[d]\n*\nRes1=[B]\nMask=[s11]\nSrv1=[B]\nDirIndex=[d]\nSrv2=[w]\nRes2=[W]\nAttrib=[a]\nTime=[T1]Size=[D]\nName=[s13]\n", NULL } }, { SMBfindnclose, "SMBfindnclose", 0, { "Handle=[d]\n", NULL, NULL, NULL, NULL } }, { SMBfindclose, "SMBfindclose", 0, { "Handle=[d]\n", NULL, NULL, NULL, NULL } }, { SMBsends, "SMBsends", 0, { NULL, "Source=[Z]\nDest=[Z]\n", NULL, NULL, NULL } }, { SMBsendstrt, "SMBsendstrt", 0, { NULL, "Source=[Z]\nDest=[Z]\n", "GroupID=[d]\n", NULL, NULL } }, { SMBsendend, "SMBsendend", 0, { "GroupID=[d]\n", NULL, NULL, NULL, NULL } }, { SMBsendtxt, "SMBsendtxt", 0, { "GroupID=[d]\n", NULL, NULL, NULL, NULL } }, { SMBsendb, "SMBsendb", 0, { NULL, "Source=[Z]\nDest=[Z]\n", NULL, NULL, NULL } }, { SMBfwdname, "SMBfwdname", 0, DEFDESCRIPT }, { SMBcancelf, "SMBcancelf", 0, DEFDESCRIPT }, { SMBgetmac, "SMBgetmac", 0, DEFDESCRIPT }, { SMBnegprot, "SMBnegprot", 0, { NULL, NULL, NULL, NULL, print_negprot } }, { SMBsesssetupX, "SMBsesssetupX", FLG_CHAIN, { NULL, NULL, NULL, NULL, print_sesssetup } }, { SMBtconX, "SMBtconX", FLG_CHAIN, { "Com2=[w]\nOff2=[d]\nFlags=[w]\nPassLen=[d]\nPasswd&Path&Device=\n", NULL, "Com2=[w]\nOff2=[d]\n", "ServiceType=[R]\n", NULL } }, { SMBlockingX, "SMBlockingX", FLG_CHAIN, { NULL, NULL, NULL, NULL, print_lockingandx } }, { SMBtrans2, "SMBtrans2", 0, { NULL, NULL, NULL, NULL, print_trans2 } }, { SMBtranss2, "SMBtranss2", 0, DEFDESCRIPT }, { SMBctemp, "SMBctemp", 0, DEFDESCRIPT }, { SMBreadBs, "SMBreadBs", 0, DEFDESCRIPT }, { SMBtrans, "SMBtrans", 0, { NULL, NULL, NULL, NULL, print_trans } }, { SMBnttrans, "SMBnttrans", 0, DEFDESCRIPT }, { SMBnttranss, "SMBnttranss", 0, DEFDESCRIPT }, { SMBntcreateX, "SMBntcreateX", FLG_CHAIN, { "Com2=[w]\nOff2=[d]\nRes=[b]\nNameLen=[ld]\nFlags=[W]\nRootDirectoryFid=[D]\nAccessMask=[W]\nAllocationSize=[L]\nExtFileAttributes=[W]\nShareAccess=[W]\nCreateDisposition=[W]\nCreateOptions=[W]\nImpersonationLevel=[W]\nSecurityFlags=[b]\n", "Path=[C]\n", "Com2=[w]\nOff2=[d]\nOplockLevel=[b]\nFid=[d]\nCreateAction=[W]\nCreateTime=[T3]LastAccessTime=[T3]LastWriteTime=[T3]ChangeTime=[T3]ExtFileAttributes=[W]\nAllocationSize=[L]\nEndOfFile=[L]\nFileType=[w]\nDeviceState=[w]\nDirectory=[b]\n", NULL, NULL } }, { SMBntcancel, "SMBntcancel", 0, DEFDESCRIPT }, { -1, NULL, 0, DEFDESCRIPT } }; /* * print a SMB message */ static void print_smb(const u_char *buf, const u_char *maxbuf) { u_int16_t flags2; int nterrcodes; int command; u_int32_t nterror; const u_char *words, *maxwords, *data; struct smbfns *fn; const char *fmt_smbheader = "[P4]SMB Command = [B]\nError class = [BP1]\nError code = [d]\nFlags1 = [B]\nFlags2 = [B][P13]\nTree ID = [d]\nProc ID = [d]\nUID = [d]\nMID = [d]\nWord Count = [b]\n"; int smboffset; TCHECK(buf[9]); request = (buf[9] & 0x80) ? 0 : 1; flags2 = EXTRACT_LE_16BITS(&buf[10]); unicodestr = flags2 & 0x8000; nterrcodes = flags2 & 0x4000; startbuf = buf; command = buf[4]; fn = smbfind(command, smb_fns); if (vflag > 1) printf("\n"); printf("SMB PACKET: %s (%s)\n", fn->name, request ? "REQUEST" : "REPLY"); if (vflag < 2) return; /* print out the header */ smb_fdata(buf, fmt_smbheader, buf + 33, unicodestr); if (nterrcodes) { nterror = EXTRACT_LE_32BITS(&buf[5]); if (nterror) printf("NTError = %s\n", nt_errstr(nterror)); } else { if (buf[5]) printf("SMBError = %s\n", smb_errstr(buf[5], EXTRACT_LE_16BITS(&buf[7]))); } smboffset = 32; for (;;) { const char *f1, *f2; int wct; u_int bcc; int newsmboffset; words = buf + smboffset; TCHECK(words[0]); wct = words[0]; data = words + 1 + wct * 2; maxwords = SMBMIN(data, maxbuf); if (request) { f1 = fn->descript.req_f1; f2 = fn->descript.req_f2; } else { f1 = fn->descript.rep_f1; f2 = fn->descript.rep_f2; } if (fn->descript.fn) (*fn->descript.fn)(words, data, buf, maxbuf); else { if (wct) { if (f1) smb_fdata(words + 1, f1, words + 1 + wct * 2, unicodestr); else { int i; int v; for (i = 0; &words[1 + 2 * i] < maxwords; i++) { TCHECK2(words[1 + 2 * i], 2); v = EXTRACT_LE_16BITS(words + 1 + 2 * i); printf("smb_vwv[%d]=%d (0x%X)\n", i, v, v); } } } TCHECK2(*data, 2); bcc = EXTRACT_LE_16BITS(data); printf("smb_bcc=%u\n", bcc); if (f2) { if (bcc > 0) smb_fdata(data + 2, f2, data + 2 + bcc, unicodestr); } else { if (bcc > 0) { printf("smb_buf[]=\n"); print_data(data + 2, SMBMIN(bcc, PTR_DIFF(maxbuf, data + 2))); } } } if ((fn->flags & FLG_CHAIN) == 0) break; if (wct == 0) break; TCHECK(words[1]); command = words[1]; if (command == 0xFF) break; TCHECK2(words[3], 2); newsmboffset = EXTRACT_LE_16BITS(words + 3); fn = smbfind(command, smb_fns); printf("\nSMB PACKET: %s (%s) (CHAINED)\n", fn->name, request ? "REQUEST" : "REPLY"); if (newsmboffset <= smboffset) { printf("Bad andX offset: %u <= %u\n", newsmboffset, smboffset); break; } smboffset = newsmboffset; } printf("\n"); return; trunc: printf("[|SMB]"); return; } /* * print a NBT packet received across tcp on port 139 */ void nbt_tcp_print(const u_char *data, int length) { int caplen; int type; u_int nbt_len; const u_char *maxbuf; if (length < 4) goto trunc; if (snapend < data) goto trunc; caplen = snapend - data; if (caplen < 4) goto trunc; maxbuf = data + caplen; type = data[0]; nbt_len = EXTRACT_16BITS(data + 2); length -= 4; caplen -= 4; startbuf = data; if (vflag < 2) { printf(" NBT Session Packet: "); switch (type) { case 0x00: printf("Session Message"); break; case 0x81: printf("Session Request"); break; case 0x82: printf("Session Granted"); break; case 0x83: { int ecode; if (nbt_len < 4) goto trunc; if (length < 4) goto trunc; if (caplen < 4) goto trunc; ecode = data[4]; printf("Session Reject, "); switch (ecode) { case 0x80: printf("Not listening on called name"); break; case 0x81: printf("Not listening for calling name"); break; case 0x82: printf("Called name not present"); break; case 0x83: printf("Called name present, but insufficient resources"); break; default: printf("Unspecified error 0x%X", ecode); break; } } break; case 0x85: printf("Session Keepalive"); break; default: data = smb_fdata(data, "Unknown packet type [rB]", maxbuf, 0); break; } } else { printf ("\n>>> NBT Session Packet\n"); switch (type) { case 0x00: data = smb_fdata(data, "[P1]NBT Session Message\nFlags=[B]\nLength=[rd]\n", data + 4, 0); if (data == NULL) break; if (nbt_len >= 4 && caplen >= 4 && memcmp(data,"\377SMB",4) == 0) { if ((int)nbt_len > caplen) { if ((int)nbt_len > length) printf("WARNING: Packet is continued in later TCP segments\n"); else printf("WARNING: Short packet. Try increasing the snap length by %d\n", nbt_len - caplen); } print_smb(data, maxbuf > data + nbt_len ? data + nbt_len : maxbuf); } else printf("Session packet:(raw data or continuation?)\n"); break; case 0x81: data = smb_fdata(data, "[P1]NBT Session Request\nFlags=[B]\nLength=[rd]\nDestination=[n1]\nSource=[n1]\n", maxbuf, 0); break; case 0x82: data = smb_fdata(data, "[P1]NBT Session Granted\nFlags=[B]\nLength=[rd]\n", maxbuf, 0); break; case 0x83: { const u_char *origdata; int ecode; origdata = data; data = smb_fdata(data, "[P1]NBT SessionReject\nFlags=[B]\nLength=[rd]\nReason=[B]\n", maxbuf, 0); if (data == NULL) break; if (nbt_len >= 1 && caplen >= 1) { ecode = origdata[4]; switch (ecode) { case 0x80: printf("Not listening on called name\n"); break; case 0x81: printf("Not listening for calling name\n"); break; case 0x82: printf("Called name not present\n"); break; case 0x83: printf("Called name present, but insufficient resources\n"); break; default: printf("Unspecified error 0x%X\n", ecode); break; } } } break; case 0x85: data = smb_fdata(data, "[P1]NBT Session Keepalive\nFlags=[B]\nLength=[rd]\n", maxbuf, 0); break; default: data = smb_fdata(data, "NBT - Unknown packet type\nType=[B]\n", maxbuf, 0); break; } printf("\n"); fflush(stdout); } return; trunc: printf("[|SMB]"); return; } /* * print a NBT packet received across udp on port 137 */ void nbt_udp137_print(const u_char *data, int length) { const u_char *maxbuf = data + length; int name_trn_id, response, opcode, nm_flags, rcode; int qdcount, ancount, nscount, arcount; const char *opcodestr; const u_char *p; int total, i; TCHECK2(data[10], 2); name_trn_id = EXTRACT_16BITS(data); response = (data[2] >> 7); opcode = (data[2] >> 3) & 0xF; nm_flags = ((data[2] & 0x7) << 4) + (data[3] >> 4); rcode = data[3] & 0xF; qdcount = EXTRACT_16BITS(data + 4); ancount = EXTRACT_16BITS(data + 6); nscount = EXTRACT_16BITS(data + 8); arcount = EXTRACT_16BITS(data + 10); startbuf = data; if (maxbuf <= data) return; if (vflag > 1) printf("\n>>> "); printf("NBT UDP PACKET(137): "); switch (opcode) { case 0: opcodestr = "QUERY"; break; case 5: opcodestr = "REGISTRATION"; break; case 6: opcodestr = "RELEASE"; break; case 7: opcodestr = "WACK"; break; case 8: opcodestr = "REFRESH(8)"; break; case 9: opcodestr = "REFRESH"; break; case 15: opcodestr = "MULTIHOMED REGISTRATION"; break; default: opcodestr = "OPUNKNOWN"; break; } printf("%s", opcodestr); if (response) { if (rcode) printf("; NEGATIVE"); else printf("; POSITIVE"); } if (response) printf("; RESPONSE"); else printf("; REQUEST"); if (nm_flags & 1) printf("; BROADCAST"); else printf("; UNICAST"); if (vflag < 2) return; printf("\nTrnID=0x%X\nOpCode=%d\nNmFlags=0x%X\nRcode=%d\nQueryCount=%d\nAnswerCount=%d\nAuthorityCount=%d\nAddressRecCount=%d\n", name_trn_id, opcode, nm_flags, rcode, qdcount, ancount, nscount, arcount); p = data + 12; total = ancount + nscount + arcount; if (qdcount > 100 || total > 100) { printf("Corrupt packet??\n"); return; } if (qdcount) { printf("QuestionRecords:\n"); for (i = 0; i < qdcount; i++) { p = smb_fdata(p, "|Name=[n1]\nQuestionType=[rw]\nQuestionClass=[rw]\n#", maxbuf, 0); if (p == NULL) goto out; } } if (total) { printf("\nResourceRecords:\n"); for (i = 0; i < total; i++) { int rdlen; int restype; p = smb_fdata(p, "Name=[n1]\n#", maxbuf, 0); if (p == NULL) goto out; restype = EXTRACT_16BITS(p); p = smb_fdata(p, "ResType=[rw]\nResClass=[rw]\nTTL=[rD]\n", p + 8, 0); if (p == NULL) goto out; rdlen = EXTRACT_16BITS(p); printf("ResourceLength=%d\nResourceData=\n", rdlen); p += 2; if (rdlen == 6) { p = smb_fdata(p, "AddrType=[rw]\nAddress=[b.b.b.b]\n", p + rdlen, 0); if (p == NULL) goto out; } else { if (restype == 0x21) { int numnames; TCHECK(*p); numnames = p[0]; p = smb_fdata(p, "NumNames=[B]\n", p + 1, 0); if (p == NULL) goto out; while (numnames--) { p = smb_fdata(p, "Name=[n2]\t#", maxbuf, 0); if (p == NULL) goto out; TCHECK(*p); if (p[0] & 0x80) printf(" "); switch (p[0] & 0x60) { case 0x00: printf("B "); break; case 0x20: printf("P "); break; case 0x40: printf("M "); break; case 0x60: printf("_ "); break; } if (p[0] & 0x10) printf(" "); if (p[0] & 0x08) printf(" "); if (p[0] & 0x04) printf(" "); if (p[0] & 0x02) printf(" "); printf("\n"); p += 2; } } else { print_data(p, min(rdlen, length - (p - data))); p += rdlen; } } } } if (p < maxbuf) smb_fdata(p, "AdditionalData:\n", maxbuf, 0); out: printf("\n"); fflush(stdout); return; trunc: printf("[|SMB]"); return; } /* * print a NBT packet received across udp on port 138 */ void nbt_udp138_print(const u_char *data, int length) { const u_char *maxbuf = data + length; if (maxbuf > snapend) maxbuf = snapend; if (maxbuf <= data) return; startbuf = data; if (vflag < 2) { printf("NBT UDP PACKET(138)"); return; } data = smb_fdata(data, "\n>>> NBT UDP PACKET(138) Res=[rw] ID=[rw] IP=[b.b.b.b] Port=[rd] Length=[rd] Res2=[rw]\nSourceName=[n1]\nDestName=[n1]\n#", maxbuf, 0); if (data != NULL) { /* If there isn't enough data for "\377SMB", don't check for it. */ if (&data[3] >= maxbuf) goto out; if (memcmp(data, "\377SMB",4) == 0) print_smb(data, maxbuf); } out: printf("\n"); fflush(stdout); } /* print netbeui frames */ struct nbf_strings { const char *name; const char *nonverbose; const char *verbose; } nbf_strings[0x20] = { { "Add Group Name Query", ", [P23]Name to add=[n2]#", "[P5]ResponseCorrelator=[w]\n[P16]Name to add=[n2]\n" }, { "Add Name Query", ", [P23]Name to add=[n2]#", "[P5]ResponseCorrelator=[w]\n[P16]Name to add=[n2]\n" }, { "Name In Conflict", NULL, NULL }, { "Status Query", NULL, NULL }, { NULL, NULL, NULL }, /* not used */ { NULL, NULL, NULL }, /* not used */ { NULL, NULL, NULL }, /* not used */ { "Terminate Trace", NULL, NULL }, { "Datagram", NULL, "[P7]Destination=[n2]\nSource=[n2]\n" }, { "Broadcast Datagram", NULL, "[P7]Destination=[n2]\nSource=[n2]\n" }, { "Name Query", ", [P7]Name=[n2]#", "[P1]SessionNumber=[B]\nNameType=[B][P2]\nResponseCorrelator=[w]\nName=[n2]\nName of sender=[n2]\n" }, { NULL, NULL, NULL }, /* not used */ { NULL, NULL, NULL }, /* not used */ { "Add Name Response", ", [P1]GroupName=[w] [P4]Destination=[n2] Source=[n2]#", "AddNameInProcess=[B]\nGroupName=[w]\nTransmitCorrelator=[w][P2]\nDestination=[n2]\nSource=[n2]\n" }, { "Name Recognized", NULL, "[P1]Data2=[w]\nTransmitCorrelator=[w]\nResponseCorelator=[w]\nDestination=[n2]\nSource=[n2]\n" }, { "Status Response", NULL, NULL }, { NULL, NULL, NULL }, /* not used */ { NULL, NULL, NULL }, /* not used */ { NULL, NULL, NULL }, /* not used */ { "Terminate Trace", NULL, NULL }, { "Data Ack", NULL, "[P3]TransmitCorrelator=[w][P2]\nRemoteSessionNumber=[B]\nLocalSessionNumber=[B]\n" }, { "Data First/Middle", NULL, "Flags=[{RECEIVE_CONTINUE|NO_ACK||PIGGYBACK_ACK_INCLUDED|}]\nResyncIndicator=[w][P2]\nResponseCorelator=[w]\nRemoteSessionNumber=[B]\nLocalSessionNumber=[B]\n" }, { "Data Only/Last", NULL, "Flags=[{|NO_ACK|PIGGYBACK_ACK_ALLOWED|PIGGYBACK_ACK_INCLUDED|}]\nResyncIndicator=[w][P2]\nResponseCorelator=[w]\nRemoteSessionNumber=[B]\nLocalSessionNumber=[B]\n" }, { "Session Confirm", NULL, "Data1=[B]\nData2=[w]\nTransmitCorrelator=[w]\nResponseCorelator=[w]\nRemoteSessionNumber=[B]\nLocalSessionNumber=[B]\n" }, { "Session End", NULL, "[P1]Data2=[w][P4]\nRemoteSessionNumber=[B]\nLocalSessionNumber=[B]\n" }, { "Session Initialize", NULL, "Data1=[B]\nData2=[w]\nTransmitCorrelator=[w]\nResponseCorelator=[w]\nRemoteSessionNumber=[B]\nLocalSessionNumber=[B]\n" }, { "No Receive", NULL, "Flags=[{|SEND_NO_ACK}]\nDataBytesAccepted=[b][P4]\nRemoteSessionNumber=[B]\nLocalSessionNumber=[B]\n" }, { "Receive Outstanding", NULL, "[P1]DataBytesAccepted=[b][P4]\nRemoteSessionNumber=[B]\nLocalSessionNumber=[B]\n" }, { "Receive Continue", NULL, "[P2]TransmitCorrelator=[w]\n[P2]RemoteSessionNumber=[B]\nLocalSessionNumber=[B]\n" }, { NULL, NULL, NULL }, /* not used */ { NULL, NULL, NULL }, /* not used */ { "Session Alive", NULL, NULL } }; void netbeui_print(u_short control, const u_char *data, int length) { const u_char *maxbuf = data + length; int len; int command; const u_char *data2; int is_truncated = 0; if (maxbuf > snapend) maxbuf = snapend; TCHECK(data[4]); len = EXTRACT_LE_16BITS(data); command = data[4]; data2 = data + len; if (data2 >= maxbuf) { data2 = maxbuf; is_truncated = 1; } startbuf = data; if (vflag < 2) { printf("NBF Packet: "); data = smb_fdata(data, "[P5]#", maxbuf, 0); } else { printf("\n>>> NBF Packet\nType=0x%X ", control); data = smb_fdata(data, "Length=[d] Signature=[w] Command=[B]\n#", maxbuf, 0); } if (data == NULL) goto out; if (command > 0x1f || nbf_strings[command].name == NULL) { if (vflag < 2) data = smb_fdata(data, "Unknown NBF Command#", data2, 0); else data = smb_fdata(data, "Unknown NBF Command\n", data2, 0); } else { if (vflag < 2) { printf("%s", nbf_strings[command].name); if (nbf_strings[command].nonverbose != NULL) data = smb_fdata(data, nbf_strings[command].nonverbose, data2, 0); } else { printf("%s:\n", nbf_strings[command].name); if (nbf_strings[command].verbose != NULL) data = smb_fdata(data, nbf_strings[command].verbose, data2, 0); else printf("\n"); } } if (vflag < 2) return; if (data == NULL) goto out; if (is_truncated) { /* data2 was past the end of the buffer */ goto out; } /* If this isn't a command that would contain an SMB message, quit. */ if (command != 0x08 && command != 0x09 && command != 0x15 && command != 0x16) goto out; /* If there isn't enough data for "\377SMB", don't look for it. */ if (&data2[3] >= maxbuf) goto out; if (memcmp(data2, "\377SMB",4) == 0) print_smb(data2, maxbuf); else { int i; for (i = 0; i < 128; i++) { if (&data2[i + 3] >= maxbuf) break; if (memcmp(&data2[i], "\377SMB", 4) == 0) { printf("found SMB packet at %d\n", i); print_smb(&data2[i], maxbuf); break; } } } out: printf("\n"); return; trunc: printf("[|SMB]"); return; } /* * print IPX-Netbios frames */ void ipx_netbios_print(const u_char *data, u_int length) { /* * this is a hack till I work out how to parse the rest of the * NetBIOS-over-IPX stuff */ int i; const u_char *maxbuf; maxbuf = data + length; /* Don't go past the end of the captured data in the packet. */ if (maxbuf > snapend) maxbuf = snapend; startbuf = data; for (i = 0; i < 128; i++) { if (&data[i + 4] > maxbuf) break; if (memcmp(&data[i], "\377SMB", 4) == 0) { smb_fdata(data, "\n>>> IPX transport ", &data[i], 0); if (data != NULL) print_smb(&data[i], maxbuf); printf("\n"); fflush(stdout); break; } } if (i == 128) smb_fdata(data, "\n>>> Unknown IPX ", maxbuf, 0); } tcpdump-3.9.8/./PLATFORMS0000644000026300017500000000025107422774220012764 0ustar mcrmcr== Tested platforms == NetBSD 1.5/i386 (mcr - 2002/1/1) Debian Linux (woody/i386) (mcr - 2002/1/1) --- RedHat Linux 6.1/i386 (assar) FreeBSD 2.2.8/i386 (itojun) tcpdump-3.9.8/./config.h.in0000644000026300017500000002220610676336430013523 0ustar mcrmcr/* config.h.in. Generated from configure.in by autoheader. */ /* "generated automatically" means DO NOT MAKE CHANGES TO config.h.in -- * make them to acconfig.h and rerun autoheader */ /* Define if you have SSLeay 0.9.0b with the buggy cast128. */ #undef HAVE_BUGGY_CAST128 /* Define if you enable IPv6 support */ #undef INET6 /* Define if you enable support for the libsmi. */ #undef LIBSMI /* Define if you have the header file. */ #undef HAVE_SMI_H /* define if you have struct __res_state_ext */ #undef HAVE_RES_STATE_EXT /* define if your struct __res_state has the nsort member */ #undef HAVE_NEW_RES_STATE /* * define if struct ether_header.ether_dhost is a struct with ether_addr_octet */ #undef ETHER_HEADER_HAS_EA /* define if struct ether_arp contains arp_xsha */ #undef ETHER_ARP_HAS_X /* define if you have the addrinfo function. */ #undef HAVE_ADDRINFO /* define if you need to include missing/addrinfoh.h. */ #undef NEED_ADDRINFO_H /* define ifyou have the h_errno variable. */ #undef HAVE_H_ERRNO /* define if IN6ADDRSZ is defined (XXX not used!) */ #undef HAVE_IN6ADDRSZ /* define if INADDRSZ is defined (XXX not used!) */ #undef HAVE_INADDRSZ /* define if this is a development version, to use additional prototypes. */ #undef HAVE_OS_PROTO_H /* define if defines __P() */ #undef HAVE_PORTABLE_PROTOTYPE /* define if RES_USE_INET6 is defined */ #undef HAVE_RES_USE_INET6 /* define if struct sockaddr has the sa_len member */ #undef HAVE_SOCKADDR_SA_LEN /* define if you have struct sockaddr_storage */ #undef HAVE_SOCKADDR_STORAGE /* define if you have both getipnodebyname() and getipnodebyaddr() */ #undef USE_GETIPNODEBY /* define if you have ether_ntohost() and it works */ #undef USE_ETHER_NTOHOST /* define if libpcap has pcap_version */ #undef HAVE_PCAP_VERSION /* define if libpcap has pcap_debug */ #undef HAVE_PCAP_DEBUG /* define if libpcap has yydebug */ #undef HAVE_YYDEBUG /* define if libpcap has pcap_list_datalinks() */ #undef HAVE_PCAP_LIST_DATALINKS /* define if libpcap has pcap_set_datalink() */ #undef HAVE_PCAP_SET_DATALINK /* define if libpcap has pcap_datalink_name_to_val() */ #undef HAVE_PCAP_DATALINK_NAME_TO_VAL /* define if libpcap has pcap_datalink_val_to_description() */ #undef HAVE_PCAP_DATALINK_VAL_TO_DESCRIPTION /* define if libpcap has pcap_dump_ftell() */ #undef HAVE_PCAP_DUMP_FTELL /* define if you have getrpcbynumber() */ #undef HAVE_GETRPCBYNUMBER /* define if unaligned memory accesses fail */ #undef LBL_ALIGN /* The successful return value from signal (?)XXX */ #undef RETSIGVAL /* Define this on IRIX */ #undef _BSD_SIGNALS /* For HP/UX ANSI compiler? */ #undef _HPUX_SOURCE /* AIX hack. */ #undef _SUN /* Workaround for missing 64-bit formats */ #undef PRId64 #undef PRIo64 #undef PRIx64 #undef PRIu64 /* Whether or not to include the possibly-buggy SMB printer */ #undef TCPDUMP_DO_SMB /* Long story short: aclocal.m4 depends on autoconf 2.13 * implementation details wrt "const"; newer versions * have different implementation details so for now we * put "const" here. This may cause duplicate definitions * in config.h but that should be OK since they're the same. */ #undef const /* Define if you have the dnet_htoa function. */ #undef HAVE_DNET_HTOA /* Define if you have a dnet_htoa declaration in . */ #undef HAVE_NETDNET_DNETDB_H_DNET_HTOA /* define if should drop privileges by default */ #undef WITH_USER /* define if should chroot when dropping privileges */ #undef WITH_CHROOT /* Define to 1 if you have the `alarm' function. */ #undef HAVE_ALARM /* Define to 1 if you have the `bpf_dump' function. */ #undef HAVE_BPF_DUMP /* Define to 1 if you have the declaration of `ether_ntohost', and to 0 if you don't. */ #undef HAVE_DECL_ETHER_NTOHOST /* Define to 1 if you have the `ether_ntohost' function. */ #undef HAVE_ETHER_NTOHOST /* Define to 1 if you have the header file. */ #undef HAVE_FCNTL_H /* Define to 1 if you have the `getaddrinfo' function. */ #undef HAVE_GETADDRINFO /* Define to 1 if you have the `getnameinfo' function. */ #undef HAVE_GETNAMEINFO /* Define to 1 if you have the header file. */ #undef HAVE_INTTYPES_H /* Define to 1 if you have the `crypto' library (-lcrypto). */ #undef HAVE_LIBCRYPTO /* Define to 1 if you have the `rpc' library (-lrpc). */ #undef HAVE_LIBRPC /* Define to 1 if you have the `smi' library (-lsmi). */ #undef HAVE_LIBSMI /* Define to 1 if you have the header file. */ #undef HAVE_MEMORY_H /* Define to 1 if you have the header file. */ #undef HAVE_NETDNET_DNETDB_H /* Define to 1 if you have the header file. */ #undef HAVE_NETINET_ETHER_H /* Define to 1 if you have the header file. */ #undef HAVE_NETINET_IF_ETHER_H /* Define to 1 if you have the header file. */ #undef HAVE_NET_PFVAR_H /* Define to 1 if you have the header file. */ #undef HAVE_OPENSSL_EVP_H /* Define to 1 if you have the `pcap_breakloop' function. */ #undef HAVE_PCAP_BREAKLOOP /* Define to 1 if you have the `pcap_dump_flush' function. */ #undef HAVE_PCAP_DUMP_FLUSH /* Define to 1 if you have the `pcap_findalldevs' function. */ #undef HAVE_PCAP_FINDALLDEVS /* Define to 1 if the system has the type `pcap_if_t'. */ #undef HAVE_PCAP_IF_T /* Define to 1 if you have the `pcap_lib_version' function. */ #undef HAVE_PCAP_LIB_VERSION /* Define to 1 if you have the `pfopen' function. */ #undef HAVE_PFOPEN /* Define to 1 if you have the header file. */ #undef HAVE_RPC_RPCENT_H /* Define to 1 if you have the `setlinebuf' function. */ #undef HAVE_SETLINEBUF /* Define to 1 if you have the `sigaction' function. */ #undef HAVE_SIGACTION /* Define to 1 if you have the `sigset' function. */ #undef HAVE_SIGSET /* Define to 1 if you have the header file. */ #undef HAVE_SMI_H /* Define to 1 if you have the `snprintf' function. */ #undef HAVE_SNPRINTF /* Define to 1 if you have the header file. */ #undef HAVE_STDINT_H /* Define to 1 if you have the header file. */ #undef HAVE_STDLIB_H /* Define to 1 if you have the `strcasecmp' function. */ #undef HAVE_STRCASECMP /* Define to 1 if you have the `strdup' function. */ #undef HAVE_STRDUP /* Define to 1 if you have the `strftime' function. */ #undef HAVE_STRFTIME /* Define to 1 if you have the header file. */ #undef HAVE_STRINGS_H /* Define to 1 if you have the header file. */ #undef HAVE_STRING_H /* Define to 1 if you have the `strlcat' function. */ #undef HAVE_STRLCAT /* Define to 1 if you have the `strlcpy' function. */ #undef HAVE_STRLCPY /* Define to 1 if you have the `strsep' function. */ #undef HAVE_STRSEP /* Define to 1 if the system has the type `struct ether_addr'. */ #undef HAVE_STRUCT_ETHER_ADDR /* Define to 1 if you have the header file. */ #undef HAVE_SYS_BITYPES_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_STAT_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_TYPES_H /* Define to 1 if you have the header file. */ #undef HAVE_UNISTD_H /* Define to 1 if you have the `vfprintf' function. */ #undef HAVE_VFPRINTF /* Define to 1 if you have the `vsnprintf' function. */ #undef HAVE_VSNPRINTF /* define if your compiler has __attribute__ */ #undef HAVE___ATTRIBUTE__ /* Define to 1 if netinet/ether.h declares `ether_ntohost' */ #undef NETINET_ETHER_H_DECLARES_ETHER_NTOHOST /* Define to 1 if netinet/if_ether.h declares `ether_ntohost' */ #undef NETINET_IF_ETHER_H_DECLARES_ETHER_NTOHOST /* Define to the address where bug reports for this package should be sent. */ #undef PACKAGE_BUGREPORT /* Define to the full name of this package. */ #undef PACKAGE_NAME /* Define to the full name and version of this package. */ #undef PACKAGE_STRING /* Define to the one symbol short name of this package. */ #undef PACKAGE_TARNAME /* Define to the version of this package. */ #undef PACKAGE_VERSION /* Define as the return type of signal handlers (`int' or `void'). */ #undef RETSIGTYPE /* The size of `char', as computed by sizeof. */ #undef SIZEOF_CHAR /* The size of `int', as computed by sizeof. */ #undef SIZEOF_INT /* The size of `long', as computed by sizeof. */ #undef SIZEOF_LONG /* The size of `long long', as computed by sizeof. */ #undef SIZEOF_LONG_LONG /* The size of `short', as computed by sizeof. */ #undef SIZEOF_SHORT /* Define to 1 if you have the ANSI C header files. */ #undef STDC_HEADERS /* Define to 1 if you can safely include both and . */ #undef TIME_WITH_SYS_TIME /* Define as token for inline if inlining supported */ #undef inline /* Define to `short' if int16_t not defined. */ #undef int16_t /* Define to `int' if int32_t not defined. */ #undef int32_t /* Define to `long long' if int64_t not defined. */ #undef int64_t /* Define to `signed char' if int8_t not defined. */ #undef int8_t /* Define to `unsigned short' if u_int16_t not defined. */ #undef u_int16_t /* Define to `unsigned int' if u_int32_t not defined. */ #undef u_int32_t /* Define to `unsigned long long' if u_int64_t not defined. */ #undef u_int64_t /* Define to `unsigned char' if u_int8_t not defined. */ #undef u_int8_t tcpdump-3.9.8/./.cvsignore0000644000026300017500000000020510026157132013460 0ustar mcrmcrversion.c Makefile Makefile-devel.in config.status config.log config.cache config.h .devel stamp-h stamp-h.in tcpdump autom4te.cache tcpdump-3.9.8/./print-icmp6.c0000644000026300017500000010156310320053324014000 0ustar mcrmcr/* * Copyright (c) 1988, 1989, 1990, 1991, 1993, 1994 * The Regents of the University of California. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that: (1) source code distributions * retain the above copyright notice and this paragraph in its entirety, (2) * distributions including binary code include the above copyright notice and * this paragraph in its entirety in the documentation or other materials * provided with the distribution, and (3) all advertising materials mentioning * features or use of this software display the following acknowledgement: * ``This product includes software developed by the University of California, * Lawrence Berkeley Laboratory and its contributors.'' Neither the name of * the University nor the names of its contributors may be used to endorse * or promote products derived from this software without specific prior * written permission. * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. */ #ifndef lint static const char rcsid[] _U_ = "@(#) $Header: /tcpdump/master/tcpdump/print-icmp6.c,v 1.79.2.6 2005/09/05 09:29:28 guy Exp $"; #endif #ifdef HAVE_CONFIG_H #include "config.h" #endif #ifdef INET6 #include #include #include #include "interface.h" #include "addrtoname.h" #include "extract.h" #include "ip6.h" #include "icmp6.h" #include "ipproto.h" #include "udp.h" #include "ah.h" static const char *get_rtpref(u_int); static const char *get_lifetime(u_int32_t); static void print_lladdr(const u_char *, size_t); static void icmp6_opt_print(const u_char *, int); static void mld6_print(const u_char *); static void mldv2_report_print(const u_char *, u_int); static void mldv2_query_print(const u_char *, u_int); static struct udphdr *get_upperlayer(u_char *, u_int *); static void dnsname_print(const u_char *, const u_char *); static void icmp6_nodeinfo_print(u_int, const u_char *, const u_char *); static void icmp6_rrenum_print(const u_char *, const u_char *); #ifndef abs #define abs(a) ((0 < (a)) ? (a) : -(a)) #endif static struct tok icmp6_type_values[] = { { ICMP6_DST_UNREACH, "destination unreachable"}, { ICMP6_PACKET_TOO_BIG, "packet too big"}, { ICMP6_TIME_EXCEEDED, "time exceeded in-transit"}, { ICMP6_PARAM_PROB, "parameter problem"}, { ICMP6_ECHO_REQUEST, "echo request"}, { ICMP6_ECHO_REPLY, "echo reply"}, { MLD6_LISTENER_QUERY, "multicast listener query"}, { MLD6_LISTENER_REPORT, "multicast listener report"}, { MLD6_LISTENER_DONE, "multicast listener done"}, { ND_ROUTER_SOLICIT, "router solicitation"}, { ND_ROUTER_ADVERT, "router advertisement"}, { ND_NEIGHBOR_SOLICIT, "neighbor solicitation"}, { ND_NEIGHBOR_ADVERT, "neighbor advertisement"}, { ND_REDIRECT, "redirect"}, { ICMP6_ROUTER_RENUMBERING, "router renumbering"}, { IND_SOLICIT, "inverse neighbor solicitation"}, { IND_ADVERT, "inverse neighbor advertisement"}, { MLDV2_LISTENER_REPORT, "multicast listener report v2"}, { ICMP6_HADISCOV_REQUEST, "ha discovery request"}, { ICMP6_HADISCOV_REPLY, "ha discovery reply"}, { ICMP6_MOBILEPREFIX_SOLICIT, "mobile router solicitation"}, { ICMP6_MOBILEPREFIX_ADVERT, "mobile router advertisement"}, { ICMP6_WRUREQUEST, "who-are-you request"}, { ICMP6_WRUREPLY, "who-are-you reply"}, { ICMP6_NI_QUERY, "node information query"}, { ICMP6_NI_REPLY, "node information reply"}, { MLD6_MTRACE, "mtrace message"}, { MLD6_MTRACE_RESP, "mtrace response"}, { 0, NULL } }; static struct tok icmp6_dst_unreach_code_values[] = { { ICMP6_DST_UNREACH_NOROUTE, "unreachable route" }, { ICMP6_DST_UNREACH_ADMIN, " unreachable prohibited"}, { ICMP6_DST_UNREACH_BEYONDSCOPE, "beyond scope"}, { ICMP6_DST_UNREACH_ADDR, "unreachable address"}, { ICMP6_DST_UNREACH_NOPORT, "unreachable port"}, { 0, NULL } }; static struct tok icmp6_opt_pi_flag_values[] = { { ND_OPT_PI_FLAG_ONLINK, "onlink" }, { ND_OPT_PI_FLAG_AUTO, "auto" }, { ND_OPT_PI_FLAG_ROUTER, "router" }, { 0, NULL } }; static struct tok icmp6_opt_ra_flag_values[] = { { ND_RA_FLAG_MANAGED, "managed" }, { ND_RA_FLAG_OTHER, "other stateful"}, { ND_RA_FLAG_HOME_AGENT, "home agent"}, { 0, NULL } }; static struct tok icmp6_nd_na_flag_values[] = { { ND_NA_FLAG_ROUTER, "router" }, { ND_NA_FLAG_SOLICITED, "solicited" }, { ND_NA_FLAG_OVERRIDE, "override" }, { 0, NULL } }; static struct tok icmp6_opt_values[] = { { ND_OPT_SOURCE_LINKADDR, "source link-address"}, { ND_OPT_TARGET_LINKADDR, "destination link-address"}, { ND_OPT_PREFIX_INFORMATION, "prefix info"}, { ND_OPT_REDIRECTED_HEADER, "redirected header"}, { ND_OPT_MTU, "mtu"}, { ND_OPT_ADVINTERVAL, "advertisement interval"}, { ND_OPT_HOMEAGENT_INFO, "homeagent information"}, { ND_OPT_ROUTE_INFO, "route info"}, { 0, NULL } }; /* mldv2 report types */ static struct tok mldv2report2str[] = { { 1, "is_in" }, { 2, "is_ex" }, { 3, "to_in" }, { 4, "to_ex" }, { 5, "allow" }, { 6, "block" }, { 0, NULL } }; static const char * get_rtpref(u_int v) { static const char *rtpref_str[] = { "medium", /* 00 */ "high", /* 01 */ "rsv", /* 10 */ "low" /* 11 */ }; return rtpref_str[((v & ND_RA_FLAG_RTPREF_MASK) >> 3) & 0xff]; } static const char * get_lifetime(u_int32_t v) { static char buf[20]; if (v == (u_int32_t)~0UL) return "infinity"; else { snprintf(buf, sizeof(buf), "%u", v); return buf; } } static void print_lladdr(const u_int8_t *p, size_t l) { const u_int8_t *ep, *q; q = p; ep = p + l; while (l > 0 && q < ep) { if (q > p) printf(":"); printf("%02x", *q++); l--; } } static int icmp6_cksum(const struct ip6_hdr *ip6, const struct icmp6_hdr *icp, u_int len) { size_t i; register const u_int16_t *sp; u_int32_t sum; union { struct { struct in6_addr ph_src; struct in6_addr ph_dst; u_int32_t ph_len; u_int8_t ph_zero[3]; u_int8_t ph_nxt; } ph; u_int16_t pa[20]; } phu; /* pseudo-header */ memset(&phu, 0, sizeof(phu)); phu.ph.ph_src = ip6->ip6_src; phu.ph.ph_dst = ip6->ip6_dst; phu.ph.ph_len = htonl(len); phu.ph.ph_nxt = IPPROTO_ICMPV6; sum = 0; for (i = 0; i < sizeof(phu.pa) / sizeof(phu.pa[0]); i++) sum += phu.pa[i]; sp = (const u_int16_t *)icp; for (i = 0; i < (len & ~1); i += 2) sum += *sp++; if (len & 1) sum += htons((*(const u_int8_t *)sp) << 8); while (sum > 0xffff) sum = (sum & 0xffff) + (sum >> 16); sum = ~sum & 0xffff; return (sum); } void icmp6_print(const u_char *bp, u_int length, const u_char *bp2, int fragmented) { const struct icmp6_hdr *dp; const struct ip6_hdr *ip; const struct ip6_hdr *oip; const struct udphdr *ouh; int dport; const u_char *ep; u_int prot; dp = (struct icmp6_hdr *)bp; ip = (struct ip6_hdr *)bp2; oip = (struct ip6_hdr *)(dp + 1); /* 'ep' points to the end of available data. */ ep = snapend; TCHECK(dp->icmp6_cksum); if (vflag && !fragmented) { int sum = dp->icmp6_cksum; if (TTEST2(bp[0], length)) { sum = icmp6_cksum(ip, dp, length); if (sum != 0) (void)printf("[bad icmp6 cksum %x!] ", sum); else (void)printf("[icmp6 sum ok] "); } } printf("ICMP6, %s", tok2str(icmp6_type_values,"unknown icmp6 type (%u)",dp->icmp6_type)); /* display cosmetics: print the packet length for printer that use the vflag now */ if (vflag && (dp->icmp6_type == ND_ROUTER_SOLICIT || ND_ROUTER_ADVERT || ND_NEIGHBOR_ADVERT || ND_NEIGHBOR_SOLICIT || ND_REDIRECT || ICMP6_HADISCOV_REPLY || ICMP6_MOBILEPREFIX_ADVERT )) printf(", length %u", length); switch (dp->icmp6_type) { case ICMP6_DST_UNREACH: TCHECK(oip->ip6_dst); printf(", %s", tok2str(icmp6_dst_unreach_code_values,"unknown unreach code (%u)",dp->icmp6_code)); switch (dp->icmp6_code) { case ICMP6_DST_UNREACH_NOROUTE: /* fall through */ case ICMP6_DST_UNREACH_ADMIN: case ICMP6_DST_UNREACH_ADDR: printf(" %s",ip6addr_string(&oip->ip6_dst)); break; case ICMP6_DST_UNREACH_BEYONDSCOPE: printf(" %s, source address %s", ip6addr_string(&oip->ip6_dst), ip6addr_string(&oip->ip6_src)); break; case ICMP6_DST_UNREACH_NOPORT: if ((ouh = get_upperlayer((u_char *)oip, &prot)) == NULL) goto trunc; dport = EXTRACT_16BITS(&ouh->uh_dport); switch (prot) { case IPPROTO_TCP: printf(", %s tcp port %s", ip6addr_string(&oip->ip6_dst), tcpport_string(dport)); break; case IPPROTO_UDP: printf(", %s udp port %s", ip6addr_string(&oip->ip6_dst), udpport_string(dport)); break; default: printf(", %s protocol %d port %d unreachable", ip6addr_string(&oip->ip6_dst), oip->ip6_nxt, dport); break; } break; default: if (vflag <= 1) { print_unknown_data(bp,"\n\t",length); return; } break; } break; case ICMP6_PACKET_TOO_BIG: TCHECK(dp->icmp6_mtu); printf(", mtu %u", EXTRACT_32BITS(&dp->icmp6_mtu)); break; case ICMP6_TIME_EXCEEDED: TCHECK(oip->ip6_dst); switch (dp->icmp6_code) { case ICMP6_TIME_EXCEED_TRANSIT: printf(" for %s", ip6addr_string(&oip->ip6_dst)); break; case ICMP6_TIME_EXCEED_REASSEMBLY: printf(" (reassembly)"); break; default: printf(", unknown code (%u)", dp->icmp6_code); break; } break; case ICMP6_PARAM_PROB: TCHECK(oip->ip6_dst); switch (dp->icmp6_code) { case ICMP6_PARAMPROB_HEADER: printf(", errorneous - octet %u", EXTRACT_32BITS(&dp->icmp6_pptr)); break; case ICMP6_PARAMPROB_NEXTHEADER: printf(", next header - octet %u", EXTRACT_32BITS(&dp->icmp6_pptr)); break; case ICMP6_PARAMPROB_OPTION: printf(", option - octet %u", EXTRACT_32BITS(&dp->icmp6_pptr)); break; default: printf(", code-#%d", dp->icmp6_code); break; } break; case ICMP6_ECHO_REQUEST: case ICMP6_ECHO_REPLY: TCHECK(dp->icmp6_seq); printf(", seq %u", EXTRACT_16BITS(&dp->icmp6_seq)); break; case ICMP6_MEMBERSHIP_QUERY: if (length == MLD_MINLEN) { mld6_print((const u_char *)dp); } else if (length >= MLDV2_MINLEN) { printf("v2 "); mldv2_query_print((const u_char *)dp, length); } else { printf(" unknown-version (len %u) ", length); } break; case ICMP6_MEMBERSHIP_REPORT: mld6_print((const u_char *)dp); break; case ICMP6_MEMBERSHIP_REDUCTION: mld6_print((const u_char *)dp); break; case ND_ROUTER_SOLICIT: #define RTSOLLEN 8 if (vflag) { icmp6_opt_print((const u_char *)dp + RTSOLLEN, length - RTSOLLEN); } break; case ND_ROUTER_ADVERT: #define RTADVLEN 16 if (vflag) { struct nd_router_advert *p; p = (struct nd_router_advert *)dp; TCHECK(p->nd_ra_retransmit); printf("\n\thop limit %u, Flags [%s]" \ ", pref %s, router lifetime %us, reachable time %us, retrans time %us", (u_int)p->nd_ra_curhoplimit, bittok2str(icmp6_opt_ra_flag_values,"none",(p->nd_ra_flags_reserved)), get_rtpref(p->nd_ra_flags_reserved), EXTRACT_16BITS(&p->nd_ra_router_lifetime), EXTRACT_32BITS(&p->nd_ra_reachable), EXTRACT_32BITS(&p->nd_ra_retransmit)); icmp6_opt_print((const u_char *)dp + RTADVLEN, length - RTADVLEN); } break; case ND_NEIGHBOR_SOLICIT: { struct nd_neighbor_solicit *p; p = (struct nd_neighbor_solicit *)dp; TCHECK(p->nd_ns_target); printf(", who has %s", ip6addr_string(&p->nd_ns_target)); if (vflag) { #define NDSOLLEN 24 icmp6_opt_print((const u_char *)dp + NDSOLLEN, length - NDSOLLEN); } } break; case ND_NEIGHBOR_ADVERT: { struct nd_neighbor_advert *p; p = (struct nd_neighbor_advert *)dp; TCHECK(p->nd_na_target); printf(", tgt is %s", ip6addr_string(&p->nd_na_target)); if (vflag) { printf(", Flags [%s]", bittok2str(icmp6_nd_na_flag_values, "none", EXTRACT_32BITS(&p->nd_na_flags_reserved))); #define NDADVLEN 24 icmp6_opt_print((const u_char *)dp + NDADVLEN, length - NDADVLEN); #undef NDADVLEN } } break; case ND_REDIRECT: #define RDR(i) ((struct nd_redirect *)(i)) TCHECK(RDR(dp)->nd_rd_dst); printf(", %s", getname6((const u_char *)&RDR(dp)->nd_rd_dst)); TCHECK(RDR(dp)->nd_rd_target); printf(" to %s", getname6((const u_char*)&RDR(dp)->nd_rd_target)); #define REDIRECTLEN 40 if (vflag) { icmp6_opt_print((const u_char *)dp + REDIRECTLEN, length - REDIRECTLEN); } break; #undef REDIRECTLEN #undef RDR case ICMP6_ROUTER_RENUMBERING: icmp6_rrenum_print(bp, ep); break; case ICMP6_NI_QUERY: case ICMP6_NI_REPLY: icmp6_nodeinfo_print(length, bp, ep); break; case IND_SOLICIT: case IND_ADVERT: break; case ICMP6_V2_MEMBERSHIP_REPORT: mldv2_report_print((const u_char *) dp, length); break; case ICMP6_MOBILEPREFIX_SOLICIT: /* fall through */ case ICMP6_HADISCOV_REQUEST: TCHECK(dp->icmp6_data16[0]); printf(", id 0x%04x", EXTRACT_16BITS(&dp->icmp6_data16[0])); break; case ICMP6_HADISCOV_REPLY: if (vflag) { struct in6_addr *in6; u_char *cp; TCHECK(dp->icmp6_data16[0]); printf(", id 0x%04x", EXTRACT_16BITS(&dp->icmp6_data16[0])); cp = (u_char *)dp + length; in6 = (struct in6_addr *)(dp + 1); for (; (u_char *)in6 < cp; in6++) { TCHECK(*in6); printf(", %s", ip6addr_string(in6)); } } break; case ICMP6_MOBILEPREFIX_ADVERT: if (vflag) { TCHECK(dp->icmp6_data16[0]); printf(", id 0x%04x", EXTRACT_16BITS(&dp->icmp6_data16[0])); if (dp->icmp6_data16[1] & 0xc0) printf(" "); if (dp->icmp6_data16[1] & 0x80) printf("M"); if (dp->icmp6_data16[1] & 0x40) printf("O"); #define MPADVLEN 8 icmp6_opt_print((const u_char *)dp + MPADVLEN, length - MPADVLEN); } break; default: printf(", length %u", length); if (vflag <= 1) print_unknown_data(bp,"\n\t", length); return; } if (!vflag) printf(", length %u", length); return; trunc: fputs("[|icmp6]", stdout); } static struct udphdr * get_upperlayer(u_char *bp, u_int *prot) { const u_char *ep; struct ip6_hdr *ip6 = (struct ip6_hdr *)bp; struct udphdr *uh; struct ip6_hbh *hbh; struct ip6_frag *fragh; struct ah *ah; u_int nh; int hlen; /* 'ep' points to the end of available data. */ ep = snapend; if (!TTEST(ip6->ip6_nxt)) return NULL; nh = ip6->ip6_nxt; hlen = sizeof(struct ip6_hdr); while (bp < ep) { bp += hlen; switch(nh) { case IPPROTO_UDP: case IPPROTO_TCP: uh = (struct udphdr *)bp; if (TTEST(uh->uh_dport)) { *prot = nh; return(uh); } else return(NULL); /* NOTREACHED */ case IPPROTO_HOPOPTS: case IPPROTO_DSTOPTS: case IPPROTO_ROUTING: hbh = (struct ip6_hbh *)bp; if (!TTEST(hbh->ip6h_len)) return(NULL); nh = hbh->ip6h_nxt; hlen = (hbh->ip6h_len + 1) << 3; break; case IPPROTO_FRAGMENT: /* this should be odd, but try anyway */ fragh = (struct ip6_frag *)bp; if (!TTEST(fragh->ip6f_offlg)) return(NULL); /* fragments with non-zero offset are meaningless */ if ((EXTRACT_16BITS(&fragh->ip6f_offlg) & IP6F_OFF_MASK) != 0) return(NULL); nh = fragh->ip6f_nxt; hlen = sizeof(struct ip6_frag); break; case IPPROTO_AH: ah = (struct ah *)bp; if (!TTEST(ah->ah_len)) return(NULL); nh = ah->ah_nxt; hlen = (ah->ah_len + 2) << 2; break; default: /* unknown or undecodable header */ *prot = nh; /* meaningless, but set here anyway */ return(NULL); } } return(NULL); /* should be notreached, though */ } static void icmp6_opt_print(const u_char *bp, int resid) { const struct nd_opt_hdr *op; const struct nd_opt_hdr *opl; /* why there's no struct? */ const struct nd_opt_prefix_info *opp; const struct icmp6_opts_redirect *opr; const struct nd_opt_mtu *opm; const struct nd_opt_advinterval *opa; const struct nd_opt_homeagent_info *oph; const struct nd_opt_route_info *opri; const u_char *cp, *ep; struct in6_addr in6, *in6p; size_t l; #define ECHECK(var) if ((u_char *)&(var) > ep - sizeof(var)) return cp = bp; /* 'ep' points to the end of available data. */ ep = snapend; while (cp < ep) { op = (struct nd_opt_hdr *)cp; ECHECK(op->nd_opt_len); if (resid <= 0) return; if (op->nd_opt_len == 0) goto trunc; if (cp + (op->nd_opt_len << 3) > ep) goto trunc; printf("\n\t %s option (%u), length %u (%u): ", tok2str(icmp6_opt_values, "unknown", op->nd_opt_type), op->nd_opt_type, op->nd_opt_len << 3, op->nd_opt_len); switch (op->nd_opt_type) { case ND_OPT_SOURCE_LINKADDR: opl = (struct nd_opt_hdr *)op; l = (op->nd_opt_len << 3) - 2; print_lladdr(cp + 2, l); break; case ND_OPT_TARGET_LINKADDR: opl = (struct nd_opt_hdr *)op; l = (op->nd_opt_len << 3) - 2; print_lladdr(cp + 2, l); break; case ND_OPT_PREFIX_INFORMATION: opp = (struct nd_opt_prefix_info *)op; TCHECK(opp->nd_opt_pi_prefix); printf("%s/%u%s, Flags [%s], valid time %ss", ip6addr_string(&opp->nd_opt_pi_prefix), opp->nd_opt_pi_prefix_len, (op->nd_opt_len != 4) ? "badlen" : "", bittok2str(icmp6_opt_pi_flag_values, "none", opp->nd_opt_pi_flags_reserved), get_lifetime(EXTRACT_32BITS(&opp->nd_opt_pi_valid_time))); printf(", pref. time %ss", get_lifetime(EXTRACT_32BITS(&opp->nd_opt_pi_preferred_time))); break; case ND_OPT_REDIRECTED_HEADER: opr = (struct icmp6_opts_redirect *)op; print_unknown_data(bp,"\n\t ",op->nd_opt_len<<3); /* xxx */ break; case ND_OPT_MTU: opm = (struct nd_opt_mtu *)op; TCHECK(opm->nd_opt_mtu_mtu); printf(" %u%s", EXTRACT_32BITS(&opm->nd_opt_mtu_mtu), (op->nd_opt_len != 1) ? "bad option length" : "" ); break; case ND_OPT_ADVINTERVAL: opa = (struct nd_opt_advinterval *)op; TCHECK(opa->nd_opt_adv_interval); printf(" %us", EXTRACT_32BITS(&opa->nd_opt_adv_interval)); break; case ND_OPT_HOMEAGENT_INFO: oph = (struct nd_opt_homeagent_info *)op; TCHECK(oph->nd_opt_hai_lifetime); printf(" preference %u, lifetime %u", EXTRACT_16BITS(&oph->nd_opt_hai_preference), EXTRACT_16BITS(&oph->nd_opt_hai_lifetime)); break; case ND_OPT_ROUTE_INFO: opri = (struct nd_opt_route_info *)op; TCHECK(opri->nd_opt_rti_lifetime); memset(&in6, 0, sizeof(in6)); in6p = (struct in6_addr *)(opri + 1); switch (op->nd_opt_len) { case 1: break; case 2: TCHECK2(*in6p, 8); memcpy(&in6, opri + 1, 8); break; case 3: TCHECK(*in6p); memcpy(&in6, opri + 1, sizeof(in6)); break; default: goto trunc; } printf(" %s/%u", ip6addr_string(&in6), opri->nd_opt_rti_prefixlen); printf(", pref=%s", get_rtpref(opri->nd_opt_rti_flags)); printf(", lifetime=%s", get_lifetime(EXTRACT_32BITS(&opri->nd_opt_rti_lifetime))); break; default: if (vflag <= 1) { print_unknown_data(cp+2,"\n\t ", (op->nd_opt_len << 3) - 2); /* skip option header */ return; } break; } /* do we want to see an additional hexdump ? */ if (vflag> 1) print_unknown_data(cp+2,"\n\t ", (op->nd_opt_len << 3) - 2); /* skip option header */ cp += op->nd_opt_len << 3; resid -= op->nd_opt_len << 3; } return; trunc: fputs("[ndp opt]", stdout); return; #undef ECHECK } static void mld6_print(const u_char *bp) { struct mld6_hdr *mp = (struct mld6_hdr *)bp; const u_char *ep; /* 'ep' points to the end of available data. */ ep = snapend; if ((u_char *)mp + sizeof(*mp) > ep) return; printf("max resp delay: %d ", EXTRACT_16BITS(&mp->mld6_maxdelay)); printf("addr: %s", ip6addr_string(&mp->mld6_addr)); } static void mldv2_report_print(const u_char *bp, u_int len) { struct icmp6_hdr *icp = (struct icmp6_hdr *) bp; u_int group, nsrcs, ngroups; u_int i, j; /* Minimum len is 8 */ if (len < 8) { printf(" [invalid len %d]", len); return; } TCHECK(icp->icmp6_data16[1]); ngroups = ntohs(icp->icmp6_data16[1]); printf(", %d group record(s)", ngroups); if (vflag > 0) { /* Print the group records */ group = 8; for (i = 0; i < ngroups; i++) { /* type(1) + auxlen(1) + numsrc(2) + grp(16) */ if (len < group + 20) { printf(" [invalid number of groups]"); return; } TCHECK2(bp[group + 4], sizeof(struct in6_addr)); printf(" [gaddr %s", ip6addr_string(&bp[group + 4])); printf(" %s", tok2str(mldv2report2str, " [v2-report-#%d]", bp[group])); nsrcs = (bp[group + 2] << 8) + bp[group + 3]; /* Check the number of sources and print them */ if (len < group + 20 + (nsrcs * sizeof(struct in6_addr))) { printf(" [invalid number of sources %d]", nsrcs); return; } if (vflag == 1) printf(", %d source(s)", nsrcs); else { /* Print the sources */ (void)printf(" {"); for (j = 0; j < nsrcs; j++) { TCHECK2(bp[group + 20 + j * sizeof(struct in6_addr)], sizeof(struct in6_addr)); printf(" %s", ip6addr_string(&bp[group + 20 + j * sizeof(struct in6_addr)])); } (void)printf(" }"); } /* Next group record */ group += 20 + nsrcs * sizeof(struct in6_addr); printf("]"); } } return; trunc: (void)printf("[|icmp6]"); return; } static void mldv2_query_print(const u_char *bp, u_int len) { struct icmp6_hdr *icp = (struct icmp6_hdr *) bp; u_int mrc; int mrt, qqi; u_int nsrcs; register u_int i; /* Minimum len is 28 */ if (len < 28) { printf(" [invalid len %d]", len); return; } TCHECK(icp->icmp6_data16[0]); mrc = ntohs(icp->icmp6_data16[0]); if (mrc < 32768) { mrt = mrc; } else { mrt = ((mrc & 0x0fff) | 0x1000) << (((mrc & 0x7000) >> 12) + 3); } if (vflag) { (void)printf(" [max resp delay=%d]", mrt); } TCHECK2(bp[8], sizeof(struct in6_addr)); printf(" [gaddr %s", ip6addr_string(&bp[8])); if (vflag) { TCHECK(bp[25]); if (bp[24] & 0x08) { printf(" sflag"); } if (bp[24] & 0x07) { printf(" robustness=%d", bp[24] & 0x07); } if (bp[25] < 128) { qqi = bp[25]; } else { qqi = ((bp[25] & 0x0f) | 0x10) << (((bp[25] & 0x70) >> 4) + 3); } printf(" qqi=%d", qqi); } TCHECK2(bp[26], 2); nsrcs = ntohs(*(u_short *)&bp[26]); if (nsrcs > 0) { if (len < 28 + nsrcs * sizeof(struct in6_addr)) printf(" [invalid number of sources]"); else if (vflag > 1) { printf(" {"); for (i = 0; i < nsrcs; i++) { TCHECK2(bp[28 + i * sizeof(struct in6_addr)], sizeof(struct in6_addr)); printf(" %s", ip6addr_string(&bp[28 + i * sizeof(struct in6_addr)])); } printf(" }"); } else printf(", %d source(s)", nsrcs); } printf("]"); return; trunc: (void)printf("[|icmp6]"); return; } void dnsname_print(const u_char *cp, const u_char *ep) { int i; /* DNS name decoding - no decompression */ printf(", \""); while (cp < ep) { i = *cp++; if (i) { if (i > ep - cp) { printf("???"); break; } while (i-- && cp < ep) { safeputchar(*cp); cp++; } if (cp + 1 < ep && *cp) printf("."); } else { if (cp == ep) { /* FQDN */ printf("."); } else if (cp + 1 == ep && *cp == '\0') { /* truncated */ } else { /* invalid */ printf("???"); } break; } } printf("\""); } static void icmp6_nodeinfo_print(u_int icmp6len, const u_char *bp, const u_char *ep) { struct icmp6_nodeinfo *ni6; struct icmp6_hdr *dp; const u_char *cp; size_t siz, i; int needcomma; if (ep < bp) return; dp = (struct icmp6_hdr *)bp; ni6 = (struct icmp6_nodeinfo *)bp; siz = ep - bp; switch (ni6->ni_type) { case ICMP6_NI_QUERY: if (siz == sizeof(*dp) + 4) { /* KAME who-are-you */ printf(" who-are-you request"); break; } printf(" node information query"); TCHECK2(*dp, sizeof(*ni6)); ni6 = (struct icmp6_nodeinfo *)dp; printf(" ("); /*)*/ switch (EXTRACT_16BITS(&ni6->ni_qtype)) { case NI_QTYPE_NOOP: printf("noop"); break; case NI_QTYPE_SUPTYPES: printf("supported qtypes"); i = EXTRACT_16BITS(&ni6->ni_flags); if (i) printf(" [%s]", (i & 0x01) ? "C" : ""); break; break; case NI_QTYPE_FQDN: printf("DNS name"); break; case NI_QTYPE_NODEADDR: printf("node addresses"); i = ni6->ni_flags; if (!i) break; /* NI_NODEADDR_FLAG_TRUNCATE undefined for query */ printf(" [%s%s%s%s%s%s]", (i & NI_NODEADDR_FLAG_ANYCAST) ? "a" : "", (i & NI_NODEADDR_FLAG_GLOBAL) ? "G" : "", (i & NI_NODEADDR_FLAG_SITELOCAL) ? "S" : "", (i & NI_NODEADDR_FLAG_LINKLOCAL) ? "L" : "", (i & NI_NODEADDR_FLAG_COMPAT) ? "C" : "", (i & NI_NODEADDR_FLAG_ALL) ? "A" : ""); break; default: printf("unknown"); break; } if (ni6->ni_qtype == NI_QTYPE_NOOP || ni6->ni_qtype == NI_QTYPE_SUPTYPES) { if (siz != sizeof(*ni6)) if (vflag) printf(", invalid len"); /*(*/ printf(")"); break; } /* XXX backward compat, icmp-name-lookup-03 */ if (siz == sizeof(*ni6)) { printf(", 03 draft"); /*(*/ printf(")"); break; } switch (ni6->ni_code) { case ICMP6_NI_SUBJ_IPV6: if (!TTEST2(*dp, sizeof(*ni6) + sizeof(struct in6_addr))) break; if (siz != sizeof(*ni6) + sizeof(struct in6_addr)) { if (vflag) printf(", invalid subject len"); break; } printf(", subject=%s", getname6((const u_char *)(ni6 + 1))); break; case ICMP6_NI_SUBJ_FQDN: printf(", subject=DNS name"); cp = (const u_char *)(ni6 + 1); if (cp[0] == ep - cp - 1) { /* icmp-name-lookup-03, pascal string */ if (vflag) printf(", 03 draft"); cp++; printf(", \""); while (cp < ep) { safeputchar(*cp); cp++; } printf("\""); } else dnsname_print(cp, ep); break; case ICMP6_NI_SUBJ_IPV4: if (!TTEST2(*dp, sizeof(*ni6) + sizeof(struct in_addr))) break; if (siz != sizeof(*ni6) + sizeof(struct in_addr)) { if (vflag) printf(", invalid subject len"); break; } printf(", subject=%s", getname((const u_char *)(ni6 + 1))); break; default: printf(", unknown subject"); break; } /*(*/ printf(")"); break; case ICMP6_NI_REPLY: if (icmp6len > siz) { printf("[|icmp6: node information reply]"); break; } needcomma = 0; ni6 = (struct icmp6_nodeinfo *)dp; printf(" node information reply"); printf(" ("); /*)*/ switch (ni6->ni_code) { case ICMP6_NI_SUCCESS: if (vflag) { printf("success"); needcomma++; } break; case ICMP6_NI_REFUSED: printf("refused"); needcomma++; if (siz != sizeof(*ni6)) if (vflag) printf(", invalid length"); break; case ICMP6_NI_UNKNOWN: printf("unknown"); needcomma++; if (siz != sizeof(*ni6)) if (vflag) printf(", invalid length"); break; } if (ni6->ni_code != ICMP6_NI_SUCCESS) { /*(*/ printf(")"); break; } switch (EXTRACT_16BITS(&ni6->ni_qtype)) { case NI_QTYPE_NOOP: if (needcomma) printf(", "); printf("noop"); if (siz != sizeof(*ni6)) if (vflag) printf(", invalid length"); break; case NI_QTYPE_SUPTYPES: if (needcomma) printf(", "); printf("supported qtypes"); i = EXTRACT_16BITS(&ni6->ni_flags); if (i) printf(" [%s]", (i & 0x01) ? "C" : ""); break; case NI_QTYPE_FQDN: if (needcomma) printf(", "); printf("DNS name"); cp = (const u_char *)(ni6 + 1) + 4; if (cp[0] == ep - cp - 1) { /* icmp-name-lookup-03, pascal string */ if (vflag) printf(", 03 draft"); cp++; printf(", \""); while (cp < ep) { safeputchar(*cp); cp++; } printf("\""); } else dnsname_print(cp, ep); if ((EXTRACT_16BITS(&ni6->ni_flags) & 0x01) != 0) printf(" [TTL=%u]", *(u_int32_t *)(ni6 + 1)); break; case NI_QTYPE_NODEADDR: if (needcomma) printf(", "); printf("node addresses"); i = sizeof(*ni6); while (i < siz) { if (i + sizeof(struct in6_addr) + sizeof(int32_t) > siz) break; printf(" %s", getname6(bp + i)); i += sizeof(struct in6_addr); printf("(%d)", (int32_t)EXTRACT_32BITS(bp + i)); i += sizeof(int32_t); } i = ni6->ni_flags; if (!i) break; printf(" [%s%s%s%s%s%s%s]", (i & NI_NODEADDR_FLAG_ANYCAST) ? "a" : "", (i & NI_NODEADDR_FLAG_GLOBAL) ? "G" : "", (i & NI_NODEADDR_FLAG_SITELOCAL) ? "S" : "", (i & NI_NODEADDR_FLAG_LINKLOCAL) ? "L" : "", (i & NI_NODEADDR_FLAG_COMPAT) ? "C" : "", (i & NI_NODEADDR_FLAG_ALL) ? "A" : "", (i & NI_NODEADDR_FLAG_TRUNCATE) ? "T" : ""); break; default: if (needcomma) printf(", "); printf("unknown"); break; } /*(*/ printf(")"); break; } return; trunc: fputs("[|icmp6]", stdout); } static void icmp6_rrenum_print(const u_char *bp, const u_char *ep) { struct icmp6_router_renum *rr6; const char *cp; struct rr_pco_match *match; struct rr_pco_use *use; char hbuf[NI_MAXHOST]; int n; if (ep < bp) return; rr6 = (struct icmp6_router_renum *)bp; cp = (const char *)(rr6 + 1); TCHECK(rr6->rr_reserved); switch (rr6->rr_code) { case ICMP6_ROUTER_RENUMBERING_COMMAND: printf("router renum: command"); break; case ICMP6_ROUTER_RENUMBERING_RESULT: printf("router renum: result"); break; case ICMP6_ROUTER_RENUMBERING_SEQNUM_RESET: printf("router renum: sequence number reset"); break; default: printf("router renum: code-#%d", rr6->rr_code); break; } printf(", seq=%u", EXTRACT_32BITS(&rr6->rr_seqnum)); if (vflag) { #define F(x, y) ((rr6->rr_flags) & (x) ? (y) : "") printf("["); /*]*/ if (rr6->rr_flags) { printf("%s%s%s%s%s,", F(ICMP6_RR_FLAGS_TEST, "T"), F(ICMP6_RR_FLAGS_REQRESULT, "R"), F(ICMP6_RR_FLAGS_FORCEAPPLY, "A"), F(ICMP6_RR_FLAGS_SPECSITE, "S"), F(ICMP6_RR_FLAGS_PREVDONE, "P")); } printf("seg=%u,", rr6->rr_segnum); printf("maxdelay=%u", rr6->rr_maxdelay); if (rr6->rr_reserved) printf("rsvd=0x%x", EXTRACT_16BITS(&rr6->rr_reserved)); /*[*/ printf("]"); #undef F } if (rr6->rr_code == ICMP6_ROUTER_RENUMBERING_COMMAND) { match = (struct rr_pco_match *)cp; cp = (const char *)(match + 1); TCHECK(match->rpm_prefix); if (vflag > 1) printf("\n\t"); else printf(" "); printf("match("); /*)*/ switch (match->rpm_code) { case RPM_PCO_ADD: printf("add"); break; case RPM_PCO_CHANGE: printf("change"); break; case RPM_PCO_SETGLOBAL: printf("setglobal"); break; default: printf("#%u", match->rpm_code); break; } if (vflag) { printf(",ord=%u", match->rpm_ordinal); printf(",min=%u", match->rpm_minlen); printf(",max=%u", match->rpm_maxlen); } if (inet_ntop(AF_INET6, &match->rpm_prefix, hbuf, sizeof(hbuf))) printf(",%s/%u", hbuf, match->rpm_matchlen); else printf(",?/%u", match->rpm_matchlen); /*(*/ printf(")"); n = match->rpm_len - 3; if (n % 4) goto trunc; n /= 4; while (n-- > 0) { use = (struct rr_pco_use *)cp; cp = (const char *)(use + 1); TCHECK(use->rpu_prefix); if (vflag > 1) printf("\n\t"); else printf(" "); printf("use("); /*)*/ if (use->rpu_flags) { #define F(x, y) ((use->rpu_flags) & (x) ? (y) : "") printf("%s%s,", F(ICMP6_RR_PCOUSE_FLAGS_DECRVLTIME, "V"), F(ICMP6_RR_PCOUSE_FLAGS_DECRPLTIME, "P")); #undef F } if (vflag) { printf("mask=0x%x,", use->rpu_ramask); printf("raflags=0x%x,", use->rpu_raflags); if (~use->rpu_vltime == 0) printf("vltime=infty,"); else printf("vltime=%u,", EXTRACT_32BITS(&use->rpu_vltime)); if (~use->rpu_pltime == 0) printf("pltime=infty,"); else printf("pltime=%u,", EXTRACT_32BITS(&use->rpu_pltime)); } if (inet_ntop(AF_INET6, &use->rpu_prefix, hbuf, sizeof(hbuf))) printf("%s/%u/%u", hbuf, use->rpu_uselen, use->rpu_keeplen); else printf("?/%u/%u", use->rpu_uselen, use->rpu_keeplen); /*(*/ printf(")"); } } return; trunc: fputs("[|icmp6]", stdout); } #endif /* INET6 */ tcpdump-3.9.8/./machdep.c0000644000026300017500000000444107767230061013246 0ustar mcrmcr/* * Copyright (c) 1996, 1997 * The Regents of the University of California. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that: (1) source code distributions * retain the above copyright notice and this paragraph in its entirety, (2) * distributions including binary code include the above copyright notice and * this paragraph in its entirety in the documentation or other materials * provided with the distribution, and (3) all advertising materials mentioning * features or use of this software display the following acknowledgement: * ``This product includes software developed by the University of California, * Lawrence Berkeley Laboratory and its contributors.'' Neither the name of * the University nor the names of its contributors may be used to endorse * or promote products derived from this software without specific prior * written permission. * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. */ #ifndef lint static const char rcsid[] _U_ = "@(#) $Header: /tcpdump/master/tcpdump/machdep.c,v 1.13 2003/12/15 03:53:21 guy Exp $ (LBL)"; #endif #ifdef HAVE_CONFIG_H #include "config.h" #endif /* * XXX - all we need, on platforms other than DEC OSF/1 (a/k/a Digital UNIX, * a/k/a Tru64 UNIX), is "size_t", which is a standard C type; what do we * need to do to get it defined? This is clearly wrong, as we shouldn't * have to include UNIX or Windows system header files to get it. */ #include #ifndef HAVE___ATTRIBUTE__ #define __attribute__(x) #endif /* HAVE___ATTRIBUTE__ */ #ifdef __osf__ #include #include #if !defined(HAVE_SNPRINTF) int snprintf(char *, size_t, const char *, ...) __attribute__((format(printf, 3, 4))); #endif /* !defined(HAVE_SNPRINTF) */ #endif /* __osf__ */ #include "machdep.h" int abort_on_misalignment(char *ebuf _U_, size_t ebufsiz _U_) { #ifdef __osf__ static int buf[2] = { SSIN_UACPROC, UAC_SIGBUS }; if (setsysinfo(SSI_NVPAIRS, (caddr_t)buf, 1, 0, 0) < 0) { (void)snprintf(ebuf, ebufsiz, "setsysinfo: errno %d", errno); return (-1); } #endif return (0); } tcpdump-3.9.8/./print-ip.c0000644000026300017500000004335710676336432013422 0ustar mcrmcr/* * Copyright (c) 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997 * The Regents of the University of California. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that: (1) source code distributions * retain the above copyright notice and this paragraph in its entirety, (2) * distributions including binary code include the above copyright notice and * this paragraph in its entirety in the documentation or other materials * provided with the distribution, and (3) all advertising materials mentioning * features or use of this software display the following acknowledgement: * ``This product includes software developed by the University of California, * Lawrence Berkeley Laboratory and its contributors.'' Neither the name of * the University nor the names of its contributors may be used to endorse * or promote products derived from this software without specific prior * written permission. * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. */ #ifndef lint static const char rcsid[] _U_ = "@(#) $Header: /tcpdump/master/tcpdump/print-ip.c,v 1.149.2.9 2007/09/14 01:30:02 guy Exp $ (LBL)"; #endif #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include #include #include "addrtoname.h" #include "interface.h" #include "extract.h" /* must come after interface.h */ #include "ip.h" #include "ipproto.h" struct tok ip_option_values[] = { { IPOPT_EOL, "EOL" }, { IPOPT_NOP, "NOP" }, { IPOPT_TS, "timestamp" }, { IPOPT_SECURITY, "security" }, { IPOPT_RR, "RR" }, { IPOPT_SSRR, "SSRR" }, { IPOPT_LSRR, "LSRR" }, { IPOPT_RA, "RA" }, { IPOPT_RFC1393, "traceroute" }, { 0, NULL } }; /* * print the recorded route in an IP RR, LSRR or SSRR option. */ static void ip_printroute(register const u_char *cp, u_int length) { register u_int ptr; register u_int len; if (length < 3) { printf(" [bad length %u]", length); return; } if ((length + 1) & 3) printf(" [bad length %u]", length); ptr = cp[2] - 1; if (ptr < 3 || ((ptr + 1) & 3) || ptr > length + 1) printf(" [bad ptr %u]", cp[2]); for (len = 3; len < length; len += 4) { printf(" %s", ipaddr_string(&cp[len])); if (ptr > len) printf(","); } } /* * If source-routing is present and valid, return the final destination. * Otherwise, return IP destination. * * This is used for UDP and TCP pseudo-header in the checksum * calculation. */ u_int32_t ip_finddst(const struct ip *ip) { int length; int len; const u_char *cp; u_int32_t retval; cp = (const u_char *)(ip + 1); length = (IP_HL(ip) << 2) - sizeof(struct ip); for (; length > 0; cp += len, length -= len) { int tt; TCHECK(*cp); tt = *cp; if (tt == IPOPT_EOL) break; else if (tt == IPOPT_NOP) len = 1; else { TCHECK(cp[1]); len = cp[1]; if (len < 2) break; } TCHECK2(*cp, len); switch (tt) { case IPOPT_SSRR: case IPOPT_LSRR: if (len < 7) break; memcpy(&retval, cp + len - 4, 4); return retval; } } trunc: memcpy(&retval, &ip->ip_dst.s_addr, sizeof(u_int32_t)); return retval; } static void ip_printts(register const u_char *cp, u_int length) { register u_int ptr; register u_int len; int hoplen; const char *type; if (length < 4) { printf("[bad length %u]", length); return; } printf(" TS{"); hoplen = ((cp[3]&0xF) != IPOPT_TS_TSONLY) ? 8 : 4; if ((length - 4) & (hoplen-1)) printf("[bad length %u]", length); ptr = cp[2] - 1; len = 0; if (ptr < 4 || ((ptr - 4) & (hoplen-1)) || ptr > length + 1) printf("[bad ptr %u]", cp[2]); switch (cp[3]&0xF) { case IPOPT_TS_TSONLY: printf("TSONLY"); break; case IPOPT_TS_TSANDADDR: printf("TS+ADDR"); break; /* * prespecified should really be 3, but some ones might send 2 * instead, and the IPOPT_TS_PRESPEC constant can apparently * have both values, so we have to hard-code it here. */ case 2: printf("PRESPEC2.0"); break; case 3: /* IPOPT_TS_PRESPEC */ printf("PRESPEC"); break; default: printf("[bad ts type %d]", cp[3]&0xF); goto done; } type = " "; for (len = 4; len < length; len += hoplen) { if (ptr == len) type = " ^ "; printf("%s%d@%s", type, EXTRACT_32BITS(&cp[len+hoplen-4]), hoplen!=8 ? "" : ipaddr_string(&cp[len])); type = " "; } done: printf("%s", ptr == len ? " ^ " : ""); if (cp[3]>>4) printf(" [%d hops not recorded]} ", cp[3]>>4); else printf("}"); } /* * print IP options. */ static void ip_optprint(register const u_char *cp, u_int length) { register u_int option_len; const char *sep = ""; for (; length > 0; cp += option_len, length -= option_len) { u_int option_code; printf("%s", sep); sep = ","; TCHECK(*cp); option_code = *cp; printf("%s", tok2str(ip_option_values,"unknown %u",option_code)); if (option_code == IPOPT_NOP || option_code == IPOPT_EOL) option_len = 1; else { TCHECK(cp[1]); option_len = cp[1]; if (option_len < 2) { printf(" [bad length %u]", option_len); return; } } if (option_len > length) { printf(" [bad length %u]", option_len); return; } TCHECK2(*cp, option_len); switch (option_code) { case IPOPT_EOL: return; case IPOPT_TS: ip_printts(cp, option_len); break; case IPOPT_RR: /* fall through */ case IPOPT_SSRR: case IPOPT_LSRR: ip_printroute(cp, option_len); break; case IPOPT_RA: if (option_len < 4) { printf(" [bad length %u]", option_len); break; } TCHECK(cp[3]); if (EXTRACT_16BITS(&cp[2]) != 0) printf(" value %u", EXTRACT_16BITS(&cp[2])); break; case IPOPT_NOP: /* nothing to print - fall through */ case IPOPT_SECURITY: default: break; } } return; trunc: printf("[|ip]"); } /* * compute an IP header checksum. * don't modifiy the packet. */ u_short in_cksum(const u_short *addr, register u_int len, int csum) { int nleft = len; const u_short *w = addr; u_short answer; int sum = csum; /* * Our algorithm is simple, using a 32 bit accumulator (sum), * we add sequential 16 bit words to it, and at the end, fold * back all the carry bits from the top 16 bits into the lower * 16 bits. */ while (nleft > 1) { sum += *w++; nleft -= 2; } if (nleft == 1) sum += htons(*(u_char *)w<<8); /* * add back carry outs from top 16 bits to low 16 bits */ sum = (sum >> 16) + (sum & 0xffff); /* add hi 16 to low 16 */ sum += (sum >> 16); /* add carry */ answer = ~sum; /* truncate to 16 bits */ return (answer); } /* * Given the host-byte-order value of the checksum field in a packet * header, and the network-byte-order computed checksum of the data * that the checksum covers (including the checksum itself), compute * what the checksum field *should* have been. */ u_int16_t in_cksum_shouldbe(u_int16_t sum, u_int16_t computed_sum) { u_int32_t shouldbe; /* * The value that should have gone into the checksum field * is the negative of the value gotten by summing up everything * *but* the checksum field. * * We can compute that by subtracting the value of the checksum * field from the sum of all the data in the packet, and then * computing the negative of that value. * * "sum" is the value of the checksum field, and "computed_sum" * is the negative of the sum of all the data in the packets, * so that's -(-computed_sum - sum), or (sum + computed_sum). * * All the arithmetic in question is one's complement, so the * addition must include an end-around carry; we do this by * doing the arithmetic in 32 bits (with no sign-extension), * and then adding the upper 16 bits of the sum, which contain * the carry, to the lower 16 bits of the sum, and then do it * again in case *that* sum produced a carry. * * As RFC 1071 notes, the checksum can be computed without * byte-swapping the 16-bit words; summing 16-bit words * on a big-endian machine gives a big-endian checksum, which * can be directly stuffed into the big-endian checksum fields * in protocol headers, and summing words on a little-endian * machine gives a little-endian checksum, which must be * byte-swapped before being stuffed into a big-endian checksum * field. * * "computed_sum" is a network-byte-order value, so we must put * it in host byte order before subtracting it from the * host-byte-order value from the header; the adjusted checksum * will be in host byte order, which is what we'll return. */ shouldbe = sum; shouldbe += ntohs(computed_sum); shouldbe = (shouldbe & 0xFFFF) + (shouldbe >> 16); shouldbe = (shouldbe & 0xFFFF) + (shouldbe >> 16); return shouldbe; } #define IP_RES 0x8000 static struct tok ip_frag_values[] = { { IP_MF, "+" }, { IP_DF, "DF" }, { IP_RES, "rsvd" }, /* The RFC3514 evil ;-) bit */ { 0, NULL } }; struct ip_print_demux_state { const struct ip *ip; const u_char *cp; u_int len, off; u_char nh; int advance; }; static void ip_print_demux(netdissect_options *ndo, struct ip_print_demux_state *ipds) { struct protoent *proto; again: switch (ipds->nh) { case IPPROTO_AH: ipds->nh = *ipds->cp; ipds->advance = ah_print(ipds->cp); if (ipds->advance <= 0) break; ipds->cp += ipds->advance; ipds->len -= ipds->advance; goto again; case IPPROTO_ESP: { int enh, padlen; ipds->advance = esp_print(ndo, ipds->cp, ipds->len, (const u_char *)ipds->ip, &enh, &padlen); if (ipds->advance <= 0) break; ipds->cp += ipds->advance; ipds->len -= ipds->advance + padlen; ipds->nh = enh & 0xff; goto again; } case IPPROTO_IPCOMP: { int enh; ipds->advance = ipcomp_print(ipds->cp, &enh); if (ipds->advance <= 0) break; ipds->cp += ipds->advance; ipds->len -= ipds->advance; ipds->nh = enh & 0xff; goto again; } case IPPROTO_SCTP: sctp_print(ipds->cp, (const u_char *)ipds->ip, ipds->len); break; case IPPROTO_DCCP: dccp_print(ipds->cp, (const u_char *)ipds->ip, ipds->len); break; case IPPROTO_TCP: /* pass on the MF bit plus the offset to detect fragments */ tcp_print(ipds->cp, ipds->len, (const u_char *)ipds->ip, ipds->off & (IP_MF|IP_OFFMASK)); break; case IPPROTO_UDP: /* pass on the MF bit plus the offset to detect fragments */ udp_print(ipds->cp, ipds->len, (const u_char *)ipds->ip, ipds->off & (IP_MF|IP_OFFMASK)); break; case IPPROTO_ICMP: /* pass on the MF bit plus the offset to detect fragments */ icmp_print(ipds->cp, ipds->len, (const u_char *)ipds->ip, ipds->off & (IP_MF|IP_OFFMASK)); break; case IPPROTO_PIGP: /* * XXX - the current IANA protocol number assignments * page lists 9 as "any private interior gateway * (used by Cisco for their IGRP)" and 88 as * "EIGRP" from Cisco. * * Recent BSD headers define * IP_PROTO_PIGP as 9 and IP_PROTO_IGRP as 88. * We define IP_PROTO_PIGP as 9 and * IP_PROTO_EIGRP as 88; those names better * match was the current protocol number * assignments say. */ igrp_print(ipds->cp, ipds->len, (const u_char *)ipds->ip); break; case IPPROTO_EIGRP: eigrp_print(ipds->cp, ipds->len); break; case IPPROTO_ND: ND_PRINT((ndo, " nd %d", ipds->len)); break; case IPPROTO_EGP: egp_print(ipds->cp, ipds->len); break; case IPPROTO_OSPF: ospf_print(ipds->cp, ipds->len, (const u_char *)ipds->ip); break; case IPPROTO_IGMP: igmp_print(ipds->cp, ipds->len); break; case IPPROTO_IPV4: /* DVMRP multicast tunnel (ip-in-ip encapsulation) */ ip_print(gndo, ipds->cp, ipds->len); if (! vflag) { ND_PRINT((ndo, " (ipip-proto-4)")); return; } break; #ifdef INET6 case IPPROTO_IPV6: /* ip6-in-ip encapsulation */ ip6_print(ipds->cp, ipds->len); break; #endif /*INET6*/ case IPPROTO_RSVP: rsvp_print(ipds->cp, ipds->len); break; case IPPROTO_GRE: /* do it */ gre_print(ipds->cp, ipds->len); break; case IPPROTO_MOBILE: mobile_print(ipds->cp, ipds->len); break; case IPPROTO_PIM: pim_print(ipds->cp, ipds->len); break; case IPPROTO_VRRP: vrrp_print(ipds->cp, ipds->len, ipds->ip->ip_ttl); break; case IPPROTO_PGM: pgm_print(ipds->cp, ipds->len, (const u_char *)ipds->ip); break; default: if ((proto = getprotobynumber(ipds->nh)) != NULL) ND_PRINT((ndo, " %s", proto->p_name)); else ND_PRINT((ndo, " ip-proto-%d", ipds->nh)); ND_PRINT((ndo, " %d", ipds->len)); break; } } void ip_print_inner(netdissect_options *ndo, const u_char *bp, u_int length, u_int nh, const u_char *bp2) { struct ip_print_demux_state ipd; ipd.ip = (const struct ip *)bp2; ipd.cp = bp; ipd.len = length; ipd.off = 0; ipd.nh = nh; ipd.advance = 0; ip_print_demux(ndo, &ipd); } /* * print an IP datagram. */ void ip_print(netdissect_options *ndo, const u_char *bp, u_int length) { struct ip_print_demux_state ipd; struct ip_print_demux_state *ipds=&ipd; const u_char *ipend; u_int hlen; u_int16_t sum, ip_sum; struct protoent *proto; ipds->ip = (const struct ip *)bp; if (IP_V(ipds->ip) != 4) { /* print version if != 4 */ printf("IP%u ", IP_V(ipds->ip)); if (IP_V(ipds->ip) == 6) printf(", wrong link-layer encapsulation"); } else if (!eflag) printf("IP "); if ((u_char *)(ipds->ip + 1) > snapend) { printf("[|ip]"); return; } if (length < sizeof (struct ip)) { (void)printf("truncated-ip %u", length); return; } hlen = IP_HL(ipds->ip) * 4; if (hlen < sizeof (struct ip)) { (void)printf("bad-hlen %u", hlen); return; } ipds->len = EXTRACT_16BITS(&ipds->ip->ip_len); if (length < ipds->len) (void)printf("truncated-ip - %u bytes missing! ", ipds->len - length); if (ipds->len < hlen) { #ifdef GUESS_TSO if (ipds->len) { (void)printf("bad-len %u", ipds->len); return; } else { /* we guess that it is a TSO send */ ipds->len = length; } #else (void)printf("bad-len %u", ipds->len); return; #endif /* GUESS_TSO */ } /* * Cut off the snapshot length to the end of the IP payload. */ ipend = bp + ipds->len; if (ipend < snapend) snapend = ipend; ipds->len -= hlen; ipds->off = EXTRACT_16BITS(&ipds->ip->ip_off); if (vflag) { (void)printf("(tos 0x%x", (int)ipds->ip->ip_tos); /* ECN bits */ if (ipds->ip->ip_tos & 0x03) { switch (ipds->ip->ip_tos & 0x03) { case 1: (void)printf(",ECT(1)"); break; case 2: (void)printf(",ECT(0)"); break; case 3: (void)printf(",CE"); } } if (ipds->ip->ip_ttl >= 1) (void)printf(", ttl %u", ipds->ip->ip_ttl); /* * for the firewall guys, print id, offset. * On all but the last stick a "+" in the flags portion. * For unfragmented datagrams, note the don't fragment flag. */ (void)printf(", id %u, offset %u, flags [%s], proto %s (%u)", EXTRACT_16BITS(&ipds->ip->ip_id), (ipds->off & 0x1fff) * 8, bittok2str(ip_frag_values, "none", ipds->off&0xe000), tok2str(ipproto_values,"unknown",ipds->ip->ip_p), ipds->ip->ip_p); (void)printf(", length %u", EXTRACT_16BITS(&ipds->ip->ip_len)); if ((hlen - sizeof(struct ip)) > 0) { printf(", options ("); ip_optprint((u_char *)(ipds->ip + 1), hlen - sizeof(struct ip)); printf(")"); } if ((u_char *)ipds->ip + hlen <= snapend) { sum = in_cksum((const u_short *)ipds->ip, hlen, 0); if (sum != 0) { ip_sum = EXTRACT_16BITS(&ipds->ip->ip_sum); (void)printf(", bad cksum %x (->%x)!", ip_sum, in_cksum_shouldbe(ip_sum, sum)); } } printf(") "); } /* * If this is fragment zero, hand it to the next higher * level protocol. */ if ((ipds->off & 0x1fff) == 0) { ipds->cp = (const u_char *)ipds->ip + hlen; ipds->nh = ipds->ip->ip_p; if (ipds->nh != IPPROTO_TCP && ipds->nh != IPPROTO_UDP && ipds->nh != IPPROTO_SCTP && ipds->nh != IPPROTO_DCCP) { (void)printf("%s > %s: ", ipaddr_string(&ipds->ip->ip_src), ipaddr_string(&ipds->ip->ip_dst)); } ip_print_demux(ndo, ipds); } else { /* Ultra quiet now means that all this stuff should be suppressed */ if (qflag > 1) return; /* * if this isn't the first frag, we're missing the * next level protocol header. print the ip addr * and the protocol. */ if (ipds->off & 0x1fff) { (void)printf("%s > %s:", ipaddr_string(&ipds->ip->ip_src), ipaddr_string(&ipds->ip->ip_dst)); if ((proto = getprotobynumber(ipds->ip->ip_p)) != NULL) (void)printf(" %s", proto->p_name); else (void)printf(" ip-proto-%d", ipds->ip->ip_p); } } } void ipN_print(register const u_char *bp, register u_int length) { struct ip *ip, hdr; ip = (struct ip *)bp; if (length < 4) { (void)printf("truncated-ip %d", length); return; } memcpy (&hdr, (char *)ip, 4); switch (IP_V(&hdr)) { case 4: ip_print (gndo, bp, length); return; #ifdef INET6 case 6: ip6_print (bp, length); return; #endif default: (void)printf("unknown ip %d", IP_V(&hdr)); return; } } /* * Local Variables: * c-style: whitesmith * c-basic-offset: 8 * End: */ tcpdump-3.9.8/./CHANGES~0000644000026300017500000007515610634111730012671 0ustar mcrmcr$Header: /tcpdump/master/tcpdump/CHANGES,v 1.87.2.13 2007/04/23 21:22:56 ken Exp $ Wed. April 25, 2007. ken@xelerance.com. Summary for 3.9.6 tcpdump release Update man page to reflect changes to libpcap Changes to both TCP and IP Printer Output Fix a potential buffer overflow in the 802.11 printer Print basic info about a few more Cisco LAN protocols. mDNS cleanup ICMP MPLS rework of the extension code bugfix: use the correct codepoint for the OSPF simple text auth token entry, and use safeputs to print the password. Add support in pflog for additional values Add support for OIF RSVP Extensions UNI 1.0 Rev. 2 and additional RSVP objects Add support for the Message-id NACK c-type. Add support for 802.3ah loopback ctrl msg Add support for Multiple-STP as per 802.1s Add support for rapid-SPT as per 802.1w Add support for CFM Link-trace msg, Link-trace-Reply msg, Sender-ID tlv, private tlv, port, interface status Add support for unidirectional link detection as per http://www.ietf.org/internet-drafts/draft-foschiano-udld-02.txt Add support for the olsr protocol as per RFC 3626 plus the LQ extensions from olsr.org Add support for variable-length checksum in DCCP, as per section 9 of RFC 4340. Add support for per-VLAN spanning tree and per-VLAN rapid spanning tree Add support for Multiple-STP as per 802.1s Add support for the cisco propriatry 'dynamic trunking protocol' Add support for the cisco proprietary VTP protocol Update dhcp6 options table as per IETF standardization activities Tue. September 19, 2006. ken@xelerance.com. Summary for 3.9.5 tcpdump release Fix compiling on AIX (, at end of ENUM) Updated list of DNS RR typecodes Use local Ethernet defs on WIN32 Add support for Frame-Relay ARP Fixes for compiling under MSVC++ Add support for parsing Juniper .pcap files Add support for FRF.16 Multilink Frame-Relay (DLT_MFR) Rework the OSPFv3 printer Fix printing for 4.4BSD/NetBSD NFS Filehandles Add support for Cisco style NLPID encapsulation Add cisco prop. eigrp related, extended communities Add support for BGP signaled VPLS Cleanup the bootp printer Add support for PPP over Frame-Relay Add some bounds checking to the IP options code, and clean up the options output a bit. Add additional modp groups to ISAKMP printer Add support for Address-Withdraw and Label-Withdraw Msgs Add support for the BFD Discriminator TLV Fixes for 64bit compiling Add support for PIMv2 checksum verification Add support for further dissection of the IPCP Compression Option Add support for Cisco's proposed VQP protocol Add basic support for keyed authentication TCP option Lots of minor cosmetic changes to output printers Mon. September 19, 2005. ken@xelerance.com. Summary for 3.9.4 tcpdump release Decoder support for more Juniper link-layer types Fix a potential buffer overflow (although it can't occur in practice). Fix the handling of unknown management frame types in the 802.11 printer. Add FRF.16 support, fix various Frame Relay bugs. Add support for RSVP integrity objects, update fast-reroute object printer to latest spec. Clean up documentation of vlan filter expression, document mpls filter expression. Document new pppoed and pppoes filter expressions. Update diffserver-TE codepoints as per RFC 4124. Spelling fixes in ICMPv6. Don't require any fields other than flags to be present in IS-IS restart signaling TLVs, and only print the system ID in those TLVs as system IDs, not as node IDs. Support for DCCP. Tue. July 5, 2005. ken@xelerance.com. Summary for 3.9.3 tcpdump release Option to chroot() when dropping privs Fixes for compiling on nearly every platform, including improved 64bit support Many new testcases Support for sending packets Many compliation fixes on most platforms Fixes for recent version of GCC to eliminate warnings Improved Unicode support Decoders & DLT Changes, Updates and New: AES ESP support Juniper ATM, FRF.15, FRF.16, PPPoE, ML-FR, ML-PIC, ML-PPP, PL-PPP, LS-PIC GGSN,ES,MONITOR,SERVICES L2VPN Axent Raptor/Symantec Firewall TCP-MD5 (RFC 2385) ESP-in-UDP (RFC 3948) ATM OAM LMP, LMP Service Discovery IP over FC IP over IEEE 1394 BACnet MS/TP SS7 LDP over TCP LACP, MARKER as per 802.3ad PGM (RFC 3208) LSP-PING G.7041/Y.1303 Generic Framing Procedure EIGRP-IP, EIGRP-IPX ICMP6 Radio - via radiotap DHCPv6 HDLC over PPP Tue. March 30, 2004. mcr@sandelman.ottawa.on.ca. Summary for 3.8.3 release No changes from 3.8.2. Version bumped only to maintain consistency with libpcap 0.8.3. Mon. March 29, 2004. mcr@sandelman.ottawa.on.ca. Summary for 3.8.2 release Fixes for print-isakmp.c CVE: CAN-2004-0183, CAN-2004-0184 http://www.rapid7.com/advisories/R7-0017.html IP-over-IEEE1394 printing. some MINGW32 changes. updates for autoconf 2.5 fixes for print-aodv.c - check for too short packets formatting changes to print-ascii for hex output. check for too short packets: print-bgp.c, print-bootp.c, print-cdp.c, print-chdlc.c, print-domain.c, print-icmp.c, print-icmp6.c, print-ip.c, print-lwres.c, print-ospf.c, print-pim.c, print-ppp.c,print-pppoe.c, print-rsvp.c, print-wb.c print-ether.c - better handling of unknown types. print-isoclns.c - additional decoding of types. print-llc.c - strings for LLC names added. print-pfloc.c - various enhancements print-radius.c - better decoding to strings. Wed. November 12, 2003. mcr@sandelman.ottawa.on.ca. Summary for 3.8 release changed syntax of -E argument so that multiple SAs can be decrypted fixes for Digital Unix headers and Documentation __attribute__ fixes CDP changes from Terry Kennedy . IPv6 mobility updates from Kazushi Sugyo Fixes for ASN.1 decoder for 2.100.3 forms. Added a count of packets received and processed to clarify numbers. Incorporated WinDUMP patches for Win32 builds. PPPoE payload length headers. Fixes for HP C compiler builds. Use new pcap_breakloop() and pcap_findalldevs() if we can. BGP output split into multiple lines. Fixes to 802.11 decoding. Fixes to PIM decoder. SuperH is a CPU that can't handle unaligned access. Many fixes for unaligned access work. Fixes to Frame-Relay decoder for Q.933/922 frames. Clarified when Solaris can do captures as non-root. Added tests/ subdir for examples/regression tests. New -U flag. -flush stdout after every packet New -A flag -print ascii only support for decoding IS-IS inside Cisco HDLC Frames more verbosity for tftp decoder mDNS decoder new BFD decoder cross compilation patches RFC 3561 AODV support. UDP/TCP pseudo-checksum properly for source-route options. sanitized all files to modified BSD license Add support for RFC 2625 IP-over-Fibre Channel. fixes for DECnet support. Support RFC 2684 bridging of Ethernet, 802.5 Token Ring, and FDDI. RFC 2684 encapsulation of BPDUs. Tuesday, February 25, 2003. fenner@research.att.com. 3.7.2 release Fixed infinite loop when parsing malformed isakmp packets. (reported by iDefense; already fixed in CVS) Fixed infinite loop when parsing malformed BGP packets. Fixed buffer overflow with certain malformed NFS packets. Pretty-print unprintable network names in 802.11 printer. Handle truncated nbp (appletalk) packets. Updated DHCPv6 printer to match draft-ietf-dhc-dhcpv6-22.txt Print IP protocol name even if we don't have a printer for it. Print IP protocol name or number for fragments. Print the whole MPLS label stack, not just the top label. Print request header and file handle for NFS v3 FSINFO and PATHCONF requests. Fix NFS packet truncation checks. Handle "old" DR-Priority and Bidir-Capable PIM HELLO options. Handle unknown RADIUS attributes properly. Fix an ASN.1 parsing error that would cause e.g. the OID 2.100.3 to be misrepresented as 4.20.3 . Monday, January 21, 2002. mcr@sandelman.ottawa.on.ca. Summary for 3.7 release see http://www.tcpdump.org/cvs-log/2002-01-21.10:16:48.html for commit log. keyword "ipx" added. Better OSI/802.2 support on Linux. IEEE 802.11 support, from clenahan@fortresstech.com, achirica@ttd.net. LLC SAP support for FDDI/token ring/RFC-1483 style ATM BXXP protocol was replaced by the BEEP protocol; improvements to SNAP demux. Changes to "any" interface documentation. Documentation on pcap_stats() counters. Fix a memory leak found by Miklos Szeredi - pcap_ether_aton(). Added MPLS encapsulation decoding per RFC3032. DNS dissector handles TKEY, TSIG and IXFR. adaptive SLIP interface patch from Igor Khristophorov SMB printing has much improved bounds checks OUI 0x0000f8 decoded as encapsulated ethernet for Cisco-custom bridging Zephyr support, from Nickolai Zeldovich . Solaris - devices with digits in them. Stefan Hudson IPX socket 0x85be is for Cisco EIGRP over IPX. Improvements to fragmented ESP handling. SCTP support from Armando L. Caro Jr. Linux ARPHDR_ATM support fixed. Added a "netbeui" keyword, which selects NetBEUI packets. IPv6 ND improvements, MobileIP dissector, 2292bis-02 for RA option. Handle ARPHDR_HDLC from Marcus Felipe Pereira . Handle IPX socket 0x553 -> NetBIOS-over-IPX socket, "nwlink-dgm" Better Linux libc5 compat. BIND9 lwres dissector added. MIPS and SPARC get strict alignment macros (affects print-bgp.c) Apple LocalTalk LINKTYPE_ reserved. New time stamp formats documented. DHCP6 updated to draft-22.txt spec. ICMP types/codes now accept symbolic names. Add SIGINFO handler from LBL encrypted CIPE tunnels in IRIX, from Franz Schaefer . now we are -Wstrict-prototype clean. NetBSD DLT_PPP_ETHER; adapted from Martin Husemann . PPPoE dissector cleaned up. Support for LocalTalk hardware, from Uns Lider . In dissector, now the caller prints the IP addresses rather than proto. cjclark@alum.mit.edu: print the IP proto for non-initial fragments. LLC frames with a DSAP and LSAP of 0xe0 are IPX frames. Linux cooked frames with a type value of LINUX_SLL_P_802_3 are IPX. captures on the "any" device won't be done in promiscuous mode Token Ring support on DLPI - Onno van der Linden ARCNet support, from NetBSD. HSRP dissector, from Julian Cowley . Handle (GRE-encapsulated) PPTP added -C option to rotate save file every optarg * 1,000,000 bytes. support for "vrrp" name - NetBSD, by Klaus Klein . PPTP support, from Motonori Shindo . IS-IS over PPP support, from Hannes Gredler . CNFP support for IPv6,format. Harry Raaymakers . ESP printing updated to RFC2406. HP-UX can now handle large number of PPAs. MSDP printer added. L2TP dissector improvements from Motonori Shindo. Tuesday January 9, 2001. mcr@sandelman.ottawa.on.ca. Summary for 3.6 release Cleaned up documentation. Promisc mode fixes for Linux IPsec changes/cleanups. Alignment fixes for picky architectures Removed dependency on native headers for packet dissectors. Removed Linux specific headers that were shipped libpcap changes provide for exchanging capture files between systems. Save files now have well known PACKET_ values instead of depending upon system dependant mappings of DLT_* types. Support for computing/checking IP and UDP/TCP checksums. Updated autoconf stock files. IPv6 improvements: dhcp (draft-15), mobile-ip6, ppp, ospf6, Added dissector support for: ISOCLNS, Token Ring, IGMPv3, bxxp, timed, vrrp, radius, chdlc, cnfp, cdp, IEEE802.1d, raw-AppleTalk Added filtering support for: VLANs, ESIS, ISIS Improvements to: print-telnet, IPTalk, bootp/dhcp, ECN, PPP, L2TP, PPPoE HP-UX 11.0 -- find the right dlpi device. Solaris 8 - IPv6 works Linux - Added support for an "any" device to capture on all interfaces Security fixes: buffer overrun audit done. Strcpy replaced with strlcpy, sprintf replaced with snprintf. Look for lex problems, and warn about them. v3.5 Fri Jan 28 18:00:00 PST 2000 Bill Fenner - switch to config.h for autoconf - unify RCSID strings - Updated PIMv1, PIMv2, DVMRP, IGMP parsers, add Cisco Auto-RP parser - Really fix the RIP printer - Fix MAC address -> name translation. - some -Wall -Wformat fixes - update makemib to parse much of SMIv2 - Print TCP sequence # with -vv even if you normally wouldn't - Print as much of IP/TCP/UDP headers as possible even if truncated. itojun@iijlab.net - -X will make a ascii dump. from netbsd. - telnet command sequence decoder (ff xx xx). from netbsd. - print-bgp.c: improve options printing. ugly code exists for unaligned option parsing (need some fix). - const poisoning in SMB decoder. - -Wall -Werror clean checks. - bring in KAME IPv6/IPsec decoding code. Assar Westerlund - SNMPv2 and SNMPv3 printer - If compiled with libsmi, tcpdump can load MIBs on the fly to decode SNMP packets. - Incorporate NFS parsing code from NetBSD. Adds support for nfsv3. - portability fixes - permit building in different directories. Ken Hornstein - bring in code at /afs/transarc.com/public/afs-contrib/tools/tcpdump for parsing AFS3 packets Andrew Tridgell - SMB printing code Love - print-rx.c: add code for printing MakeDir and StoreStatus. Also change date format to the right one. Michael C. Richardson - Created tcpdump.org repository v3.4 Sat Jul 25 12:40:55 PDT 1998 - Hardwire Linux slip support since it's too hard to detect. - Redo configuration of "network" libraries (-lsocket and -lnsl) to deal with IRIX. Thanks to John Hawkinson (jhawk@mit.edu) - Added -a which tries to translate network and broadcast addresses to names. Suggested by Rob van Nieuwkerk (robn@verdi.et.tudelft.nl) - Added a configure option to disable gcc. - Added a "raw" packet printer. - Not having an interface address is no longer fatal. Requested by John Hawkinson. - Rework signal setup to accommodate Linux. - OSPF truncation check fix. Also display the type of OSPF packets using MD5 authentication. Thanks to Brian Wellington (bwelling@tis.com) - Fix truncation check bugs in the Kerberos printer. Reported by Ezra Peisach (epeisach@mit.edu) - Don't catch SIGHUP when invoked with nohup(1). Thanks to Dave Plonka (plonka@mfa.com) - Specify full install target as a way of detecting if install directory does not exist. Thanks to Dave Plonka. - Bit-swap FDDI addresses for BSD/OS too. Thanks to Paul Vixie (paul@vix.com) - Fix off-by-one bug when testing size of ethernet packets. Thanks to Marty Leisner (leisner@sdsp.mc.xerox.com) - Add a local autoconf macro to check for routines in libraries; the autoconf version is broken (it only puts the library name in the cache variable name). Thanks to John Hawkinson. - Add a local autoconf macro to check for types; the autoconf version is broken (it uses grep instead of actually compiling a code fragment). - Modified to support the new BSD/OS 2.1 PPP and SLIP link layer header formats. - Extend OSF ip header workaround to versions 1 and 2. - Fix some signed problems in the nfs printer. As reported by David Sacerdote (davids@silence.secnet.com) - Detect group wheel and use it as the default since BSD/OS' install can't hack numeric groups. Reported by David Sacerdote. - AIX needs special loader options. Thanks to Jonathan I. Kamens (jik@cam.ov.com) - Fixed the nfs printer to print port numbers in decimal. Thanks to Kent Vander Velden (graphix@iastate.edu) - Find installed libpcap in /usr/local/lib when not using gcc. - Disallow network masks with non-network bits set. - Attempt to detect "egcs" versions of gcc. - Add missing closing double quotes when displaying bootp strings. Reported by Viet-Trung Luu (vluu@picard.math.uwaterloo.ca) v3.3 Sat Nov 30 20:56:27 PST 1996 - Added Linux support. - GRE encapsulated packet printer thanks to John Hawkinson (jhawk@mit.edu) - Rewrite gmt2local() to avoid problematic os dependencies. - Suppress nfs truncation message on errors. - Add missing m4 quoting in AC_LBL_UNALIGNED_ACCESS autoconf macro. Reported by Joachim Ott (ott@ardala.han.de) - Enable "ip_hl vs. ip_vhl" workaround for OSF4 too. - Print arp hardware type in host order. Thanks to Onno van der Linden (onno@simplex.nl) - Avoid solaris compiler warnings. Thanks to Bruce Barnett (barnett@grymoire.crd.ge.com) - Fix rip printer to not print one more route than is actually in the packet. Thanks to Jean-Luc Richier (Jean-Luc.Richier@imag.fr) and Bill Fenner (fenner@parc.xerox.com) - Use autoconf endian detection since BYTE_ORDER isn't defined on all systems. - Fix dvmrp printer truncation checks and add a dvmrp probe printer. Thanks to Danny J. Mitzel (mitzel@ipsilon.com) - Rewrite ospf printer to improve truncation checks. - Don't parse tcp options past the EOL. As noted by David Sacerdote (davids@secnet.com). Also, check tcp options to make sure they ar actually in the tcp header (in addition to the normal truncation checks). Fix the SACK code to print the N blocks (instead of the first block N times). - Don't say really small UDP packets are truncated just because they aren't big enough to be a RPC. As noted by David Sacerdote. v3.2.1 Sun Jul 14 03:02:26 PDT 1996 - Added rfc1716 icmp codes as suggested by Martin Fredriksson (martin@msp.se) - Print mtu for icmp unreach need frag packets. Thanks to John Hawkinson (jhawk@mit.edu) - Decode icmp router discovery messages. Thanks to Jeffrey Honig (jch@bsdi.com) - Added a printer entry for DLT_IEEE802 as suggested by Tak Kushida (kushida@trl.ibm.co.jp) - Check igmp checksum if possible. Thanks to John Hawkinson. - Made changes for SINIX. Thanks to Andrej Borsenkow (borsenkow.msk@sni.de) - Use autoconf's idea of the top level directory in install targets. Thanks to John Hawkinson. - Avoid infinite loop in tcp options printing code. Thanks to Jeffrey Mogul (mogul@pa.dec.com) - Avoid using -lsocket in IRIX 5.2 and earlier since it breaks snoop. Thanks to John Hawkinson. - Added some more packet truncation checks. - On systems that have it, use sigset() instead of signal() since signal() has different semantics on these systems. - Fixed some more alignment problems on the alpha. - Add code to massage unprintable characters in the domain and ipx printers. Thanks to John Hawkinson. - Added explicit netmask support. Thanks to Steve Nuchia (steve@research.oknet.com) - Add "sca" keyword (for DEC cluster services) as suggested by Terry Kennedy (terry@spcvxa.spc.edu) - Add "atalk" keyword as suggested by John Hawkinson. - Added an igrp printer. Thanks to Francis Dupont (francis.dupont@inria.fr) - Print IPX net numbers in hex a la Novell Netware. Thanks to Terry Kennedy (terry@spcvxa.spc.edu) - Fixed snmp extended tag field parsing bug. Thanks to Pascal Hennequin (pascal.hennequin@hugo.int-evry.fr) - Added some ETHERTYPEs missing on some systems. - Added truncated packet macros and various checks. - Fixed endian problems with the DECnet printer. - Use $CC when checking gcc version. Thanks to Carl Lindberg (carl_lindberg@blacksmith.com) - Fixes for AIX (although this system is not yet supported). Thanks to John Hawkinson. - Fix bugs in the autoconf misaligned accesses code fragment. - Include sys/param.h to get BYTE_ORDER in a few places. Thanks to Pavlin Ivanov Radoslavov (pavlin@cs.titech.ac.jp) v3.2 Sun Jun 23 02:28:10 PDT 1996 - Print new icmp unreachable codes as suggested by Martin Fredriksson (martin@msp.se). Also print code value when unknown for icmp redirect and time exceeded. - Fix an alignment endian bug in getname(). Thanks to John Hawkinson. - Define "new" domain record types if not found in arpa/nameserv.h. Resulted from a suggestion from John Hawkinson (jhawk@mit.edu). Also fixed an endian bug when printing mx record and added some new record types. - Added RIP V2 support. Thanks to Jeffrey Honig (jch@bsdi.com) - Added T/TCP options printing. As suggested by Richard Stevens (rstevens@noao.edu) - Use autoconf to detect architectures that can't handle misaligned accesses. v3.1 Thu Jun 13 20:59:32 PDT 1996 - Changed u_int32/int32 to u_int32_t/int32_t to be consistent with bsd and bind (as suggested by Charles Hannum). - Port to GNU autoconf. - Add support for printing DVMRP and PIM traffic thanks to Havard Eidnes (Havard.Eidnes@runit.sintef.no). - Fix AppleTalk, IPX and DECnet byte order problems due to wrong endian define being referenced. Reported by Terry Kennedy. - Minor fixes to the man page thanks to Mark Andrews. - Endian fixes to RTP and vat packet dumpers, thanks to Bruce Mah (bmah@cs.berkeley.edu). - Added support for new dns types, thanks to Rainer Orth. - Fixed tftp_print() to print the block number for ACKs. - Document -dd and -ddd. Resulted from a bug report from Charlie Slater (cslater@imatek.com). - Check return status from malloc/calloc/etc. - Check return status from pcap_loop() so we can print an error and exit with a bad status if there were problems. - Bail if ip option length is <= 0. Resulted from a bug report from Darren Reed (darrenr@vitruvius.arbld.unimelb.edu.au). - Print out a little more information for sun rpc packets. - Add suport for Kerberos 4 thanks to John Hawkinson (jhawk@mit.edu). - Fixed the Fix EXTRACT_SHORT() and EXTRACT_LONG() macros (which were wrong on little endian machines). - Fixed alignment bug in ipx_decode(). Thanks to Matt Crawford (crawdad@fnal.gov). - Fix ntp_print() to not print garbage when the stratum is "unspecified." Thanks to Deus Ex Machina (root@belle.bork.com). - Rewrote tcp options printer code to check for truncation. Added selective acknowledgment case. - Fixed an endian bug in the ospf printer. Thanks to Jeffrey C Honig (jch@bsdi.com) - Fix rip printer to handle 4.4 BSD sockaddr struct which only uses one octet for the sa_family member. Thanks to Yoshitaka Tokugawa (toku@dit.co.jp) - Don't checksum ip header if we don't have all of it. Thanks to John Hawkinson (jhawk@mit.edu). - Print out hostnames if possible in egp printer. Thanks to Jeffrey Honig (jhc@bsdi.com) v3.1a1 Wed May 3 19:21:11 PDT 1995 - Include time.h when SVR4 is defined to avoid problems under Solaris 2.3. - Fix etheraddr_string() in the ETHER_SERVICE to return the saved strings, not the local buffer. Thanks to Stefan Petri (petri@ibr.cs.tu-bs.de). - Detect when pcap raises the snaplen (e.g. with snit). Print a warning that the selected value was not used. Thanks to Pascal Hennequin (Pascal.Hennequin@hugo.int-evry.fr). - Add a truncated packet test to print-nfs.c. Thanks to Pascal Hennequin. - BYTEORDER -> BYTE_ORDER Thanks to Terry Kennedy (terry@spcvxa.spc.edu). v3.0.3 Sun Oct 1 18:35:00 GMT 1995 - Although there never was a 3.0.3 release, the linux boys cleverly "released" one in late 1995. v3.0.2 Thu Apr 20 21:28:16 PDT 1995 - Change configuration to not use gcc v2 flags with gcc v1. - Redo gmt2local() so that it works under BSDI (which seems to return an empty timezone struct from gettimeofday()). Based on report from Terry Kennedy (terry@spcvxa.spc.edu). - Change configure to recognize IP[0-9]* as "mips" SGI hardware. Based on report from Mark Andrews (mandrews@alias.com). - Don't pass cc flags to gcc. Resulted from a bug report from Rainer Orth (ro@techfak.uni-bielefeld.de). - Fixed printout of connection id for uncompressed tcp slip packets. Resulted from a bug report from Richard Stevens (rstevens@noao.edu). - Hack around deficiency in Ultrix's make. - Add ETHERTYPE_TRAIL define which is missing from irix5. v3.0.1 Wed Aug 31 22:42:26 PDT 1994 - Fix problems with gcc2 vs. malloc() and read() prototypes under SunOS 4. v3.0 Mon Jun 20 19:23:27 PDT 1994 - Added support for printing tcp option timestamps thanks to Mark Andrews (mandrews@alias.com). - Reorganize protocol dumpers to take const pointers to packets so they never change the contents (i.e., they used to do endian conversions in place). Previously, whenever more than one pass was taken over the packet, the packet contents would be dumped incorrectly (i.e., the output form -x would be wrong on little endian machines because the protocol dumpers would modify the data). Thanks to Charles Hannum (mycroft@gnu.ai.mit.edu) for reporting this problem. - Added support for decnet protocol dumping thanks to Jeff Mogul (mogul@pa.dec.com). - Fix bug that caused length of packet to be incorrectly printed (off by ether header size) for unknown ethernet types thanks to Greg Miller (gmiller@kayak.mitre.org). - Added support for IPX protocol dumping thanks to Brad Parker (brad@fcr.com). - Added check to verify IP header checksum under -v thanks to Brad Parker (brad@fcr.com). - Move packet capture code to new libpcap library (which is packaged separately). - Prototype everything and assume an ansi compiler. - print-arp.c: Print hardware ethernet addresses if they're not what we expect. - print-bootp.c: Decode the cmu vendor field. Add RFC1497 tags. Many helpful suggestions from Gordon Ross (gwr@jericho.mc.com). - print-fddi.c: Improvements. Thanks to Jeffrey Mogul (mogul@pa.dec.com). - print-icmp.c: Byte swap netmask before printing. Thanks to Richard Stevens (rstevens@noao.edu). Print icmp type when unknown. - print-ip.c: Print the inner ip datagram of ip-in-ip encapsulated packets. By default, only the inner packet is dumped, appended with the token "(encap)". Under -v, both the inner and output packets are dumped (on the same line). Note that the filter applies to the original packet, not the encapsulated packet. So if you run tcpdump on a net with an IP Multicast tunnel, you cannot filter out the datagrams using the conventional syntax. (You can filter away all the ip-in-ip traffic with "not ip proto 4".) - print-nfs.c: Keep pending rpc's in circular table. Add generic nfs header and remove os dependences. Thanks to Jeffrey Mogul. - print-ospf.c: Improvements. Thanks to Jeffrey Mogul. - tcpdump.c: Add -T flag allows interpretation of "vat", "wb", "rpc" (sunrpc) and rtp packets. Added "inbound" and "outbound" keywords Add && and || operators v2.2.1 Tue Jun 6 17:57:22 PDT 1992 - Fix bug with -c flag. v2.2 Fri May 22 17:19:41 PDT 1992 - savefile.c: Remove hack that shouldn't have been exported. Add truncate checks. - Added the 'icmp' keyword. For example, 'icmp[0] != 8 and icmp[0] != 0' matches non-echo/reply ICMP packets. - Many improvements to filter code optimizer. - Added 'multicast' keyword and extended the 'broadcast' keyword can now be so that protocol qualifications are allowed. For example, "ip broadcast" and "ether multicast" are valid filters. - Added support for monitoring the loopback interface (i.e. 'tcpdump -i lo'). Jeffrey Honig (jch@MITCHELL.CIT.CORNELL.EDU) contributed the kernel patches to netinet/if_loop.c. - Added support for the Ungermann-Bass Ethernet on IBM/PC-RTs running AOS. Contact Jeffrey Honig (jch@MITCHELL.CIT.CORNELL.EDU) for the diffs. - Added EGP and OSPF printers, thanks to Jeffrey Honig. v2.1 Tue Jan 28 11:00:14 PST 1992 - Internal release (never publically exported). v2.0.1 Sun Jan 26 21:10:10 PDT - Various byte ordering fixes. - Add truncation checks. - inet.c: Support BSD style SIOCGIFCONF. - nametoaddr.c: Handle multi addresses for single host. - optimize.c: Rewritten. - pcap-bpf.c: don't choke when we get ptraced. only set promiscuous for broadcast nets. - print-atal.c: Fix an alignment bug (thanks to stanonik@nprdc.navy.mil) Add missing printf() argument. - print-bootp.c: First attempt at decoding the vendor buffer. - print-domain.c: Fix truncation checks. - print-icmp.c: Calculate length of packets from the ip header. - print-ip.c: Print frag id in decimal (so it's easier to match up with non-frags). Add support for ospf, egp and igmp. - print-nfs.c: Lots of changes. - print-ntp.c: Make some verbose output depend on -v. - print-snmp.c: New version from John LoVerso. - print-tcp.c: Print rfc1072 tcp options. - tcpdump.c: Print "0x" prefix for %x formats. Always print 6 digits (microseconds) worth of precision. Fix uid bugs. - A packet dumper has been added (thanks to Jeff Mogul of DECWRL). With this option, you can create an architecture independent binary trace file in real time, without the overhead of the packet printer. At a later time, the packets can be filtered (again) and printed. - BSD is supported. You must have BPF in your kernel. Since the filtering is now done in the kernel, fewer packets are dropped. In fact, with BPF and the packet dumper option, a measly Sun 3/50 can keep up with a busy network. - Compressed SLIP packets can now be dumped, provided you use our SLIP software and BPF. These packets are dumped as any other IP packet; the compressed headers are dumped with the '-e' option. - Machines with little-endian byte ordering are supported (thanks to Jeff Mogul). - Ultrix 4.0 is supported (also thanks to Jeff Mogul). - IBM RT and Stanford Enetfilter support has been added by Rayan Zachariassen . Tcpdump has been tested under both the vanilla Enetfilter interface, and the extended interface (#ifdef'd by IBMRTPC) present in the MERIT version of the Enetfilter. - TFTP packets are now printed (requests only). - BOOTP packets are now printed. - SNMP packets are now printed. (thanks to John LoVerso of Xylogics). - Sparc architectures, including the Sparcstation-1, are now supported thanks to Steve McCanne and Craig Leres. - SunOS 4 is now supported thanks to Micky Liu of Columbia University (micky@cunixc.cc.columbia.edu). - IP options are now printed. - RIP packets are now printed. - There's a -v flag that prints out more information than the default (e.g., it will enable printing of IP ttl, tos and id) and -q flag that prints out less (e.g., it will disable interpretation of AppleTalk-in-UDP). - The grammar has undergone substantial changes (if you have an earlier version of tcpdump, you should re-read the manual entry). The most useful change is the addition of an expression syntax that lets you filter on arbitrary fields or values in the packet. E.g., "ip[0] > 0x45" would print only packets with IP options, "tcp[13] & 3 != 0" would print only TCP SYN and FIN packets. The most painful change is that concatenation no longer means "and" -- e.g., you have to say "host foo and port bar" instead of "host foo port bar". The up side to this down is that repeated qualifiers can be omitted, making most filter expressions shorter. E.g., you can now say "ip host foo and (bar or baz)" to look at ip traffic between hosts foo and bar or between hosts foo and baz. [The old way of saying this was "ip host foo and (ip host bar or ip host baz)".] v2.0 Sun Jan 13 12:20:40 PST 1991 - Initial public release. tcpdump-3.9.8/./l2vpn.c0000755000026300017500000000410210063542220012665 0ustar mcrmcr/* * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that: (1) source code * distributions retain the above copyright notice and this paragraph * in its entirety, and (2) distributions including binary code include * the above copyright notice and this paragraph in its entirety in * the documentation or other materials provided with the distribution. * THIS SOFTWARE IS PROVIDED ``AS IS'' AND * WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT * LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * FOR A PARTICULAR PURPOSE. * * Original code by Hannes Gredler (hannes@juniper.net) */ #ifndef lint static const char rcsid[] _U_ = "@(#) $Header: /tcpdump/master/tcpdump/l2vpn.c,v 1.1 2004/06/15 09:42:40 hannes Exp $ (LBL)"; #endif #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include "interface.h" #include "l2vpn.h" /* draft-ietf-pwe3-iana-allocation-04 */ struct tok l2vpn_encaps_values[] = { { 0x00, "Reserved"}, { 0x01, "Frame Relay"}, { 0x02, "ATM AAL5 VCC transport"}, { 0x03, "ATM transparent cell transport"}, { 0x04, "Ethernet VLAN"}, { 0x05, "Ethernet"}, { 0x06, "Cisco-HDLC"}, { 0x07, "PPP"}, { 0x08, "SONET/SDH Circuit Emulation Service over MPLS"}, { 0x09, "ATM n-to-one VCC cell transport"}, { 0x0a, "ATM n-to-one VPC cell transport"}, { 0x0b, "IP Layer2 Transport"}, { 0x0c, "ATM one-to-one VCC Cell Mode"}, { 0x0d, "ATM one-to-one VPC Cell Mode"}, { 0x0e, "ATM AAL5 PDU VCC transport"}, { 0x0f, "Frame-Relay Port mode"}, { 0x10, "SONET/SDH Circuit Emulation over Packet"}, { 0x11, "Structure-agnostic E1 over Packet"}, { 0x12, "Structure-agnostic T1 (DS1) over Packet"}, { 0x13, "Structure-agnostic E3 over Packet"}, { 0x14, "Structure-agnostic T3 (DS3) over Packet"}, { 0x15, "CESoPSN basic mode"}, { 0x16, "TDMoIP basic mode"}, { 0x17, "CESoPSN TDM with CAS"}, { 0x18, "TDMoIP TDM with CAS"}, { 0x40, "IP-interworking"}, { 0, NULL} }; tcpdump-3.9.8/./ieee802_11.h0000644000026300017500000001737010651260273013313 0ustar mcrmcr/* @(#) $Header: /tcpdump/master/tcpdump/ieee802_11.h,v 1.9.4.3 2007/07/22 20:01:16 guy Exp $ (LBL) */ /* * Copyright (c) 2001 * Fortress Technologies * Charlie Lenahan ( clenahan@fortresstech.com ) * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that: (1) source code distributions * retain the above copyright notice and this paragraph in its entirety, (2) * distributions including binary code include the above copyright notice and * this paragraph in its entirety in the documentation or other materials * provided with the distribution, and (3) all advertising materials mentioning * features or use of this software display the following acknowledgement: * ``This product includes software developed by the University of California, * Lawrence Berkeley Laboratory and its contributors.'' Neither the name of * the University nor the names of its contributors may be used to endorse * or promote products derived from this software without specific prior * written permission. * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. */ /* Lengths of 802.11 header components. */ #define IEEE802_11_FC_LEN 2 #define IEEE802_11_DUR_LEN 2 #define IEEE802_11_DA_LEN 6 #define IEEE802_11_SA_LEN 6 #define IEEE802_11_BSSID_LEN 6 #define IEEE802_11_RA_LEN 6 #define IEEE802_11_TA_LEN 6 #define IEEE802_11_SEQ_LEN 2 #define IEEE802_11_IV_LEN 3 #define IEEE802_11_KID_LEN 1 /* Frame check sequence length. */ #define IEEE802_11_FCS_LEN 4 /* Lengths of beacon components. */ #define IEEE802_11_TSTAMP_LEN 8 #define IEEE802_11_BCNINT_LEN 2 #define IEEE802_11_CAPINFO_LEN 2 #define IEEE802_11_LISTENINT_LEN 2 #define IEEE802_11_AID_LEN 2 #define IEEE802_11_STATUS_LEN 2 #define IEEE802_11_REASON_LEN 2 /* Length of previous AP in reassocation frame */ #define IEEE802_11_AP_LEN 6 #define T_MGMT 0x0 /* management */ #define T_CTRL 0x1 /* control */ #define T_DATA 0x2 /* data */ #define T_RESV 0x3 /* reserved */ #define ST_ASSOC_REQUEST 0x0 #define ST_ASSOC_RESPONSE 0x1 #define ST_REASSOC_REQUEST 0x2 #define ST_REASSOC_RESPONSE 0x3 #define ST_PROBE_REQUEST 0x4 #define ST_PROBE_RESPONSE 0x5 /* RESERVED 0x6 */ /* RESERVED 0x7 */ #define ST_BEACON 0x8 #define ST_ATIM 0x9 #define ST_DISASSOC 0xA #define ST_AUTH 0xB #define ST_DEAUTH 0xC /* RESERVED 0xD */ /* RESERVED 0xE */ /* RESERVED 0xF */ #define CTRL_PS_POLL 0xA #define CTRL_RTS 0xB #define CTRL_CTS 0xC #define CTRL_ACK 0xD #define CTRL_CF_END 0xE #define CTRL_END_ACK 0xF #define DATA_DATA 0x0 #define DATA_DATA_CF_ACK 0x1 #define DATA_DATA_CF_POLL 0x2 #define DATA_DATA_CF_ACK_POLL 0x3 #define DATA_NODATA 0x4 #define DATA_NODATA_CF_ACK 0x5 #define DATA_NODATA_CF_POLL 0x6 #define DATA_NODATA_CF_ACK_POLL 0x7 #define DATA_QOS_DATA 0x8 #define DATA_QOS_DATA_CF_ACK 0x9 #define DATA_QOS_DATA_CF_POLL 0xA #define DATA_QOS_DATA_CF_ACK_POLL 0xB #define DATA_QOS_NODATA 0xC #define DATA_QOS_CF_POLL_NODATA 0xE #define DATA_QOS_CF_ACK_POLL_NODATA 0xF /* * The subtype field of a data frame is, in effect, composed of 4 flag * bits - CF-Ack, CF-Poll, Null (means the frame doesn't actually have * any data), and QoS. */ #define DATA_FRAME_IS_CF_ACK(x) ((x) & 0x01) #define DATA_FRAME_IS_CF_POLL(x) ((x) & 0x02) #define DATA_FRAME_IS_NULL(x) ((x) & 0x04) #define DATA_FRAME_IS_QOS(x) ((x) & 0x08) /* * Bits in the frame control field. */ #define FC_VERSION(fc) ((fc) & 0x3) #define FC_TYPE(fc) (((fc) >> 2) & 0x3) #define FC_SUBTYPE(fc) (((fc) >> 4) & 0xF) #define FC_TO_DS(fc) ((fc) & 0x0100) #define FC_FROM_DS(fc) ((fc) & 0x0200) #define FC_MORE_FLAG(fc) ((fc) & 0x0400) #define FC_RETRY(fc) ((fc) & 0x0800) #define FC_POWER_MGMT(fc) ((fc) & 0x1000) #define FC_MORE_DATA(fc) ((fc) & 0x2000) #define FC_WEP(fc) ((fc) & 0x4000) #define FC_ORDER(fc) ((fc) & 0x8000) struct mgmt_header_t { u_int16_t fc; u_int16_t duration; u_int8_t da[6]; u_int8_t sa[6]; u_int8_t bssid[6]; u_int16_t seq_ctrl; }; #define MGMT_HDRLEN (IEEE802_11_FC_LEN+IEEE802_11_DUR_LEN+\ IEEE802_11_DA_LEN+IEEE802_11_SA_LEN+\ IEEE802_11_BSSID_LEN+IEEE802_11_SEQ_LEN) #define CAPABILITY_ESS(cap) ((cap) & 0x0001) #define CAPABILITY_IBSS(cap) ((cap) & 0x0002) #define CAPABILITY_CFP(cap) ((cap) & 0x0004) #define CAPABILITY_CFP_REQ(cap) ((cap) & 0x0008) #define CAPABILITY_PRIVACY(cap) ((cap) & 0x0010) typedef enum { NOT_PRESENT, PRESENT, TRUNCATED } elem_status_t; struct ssid_t { u_int8_t element_id; u_int8_t length; u_char ssid[33]; /* 32 + 1 for null */ }; struct rates_t { u_int8_t element_id; u_int8_t length; u_int8_t rate[16]; }; struct challenge_t { u_int8_t element_id; u_int8_t length; u_int8_t text[254]; /* 1-253 + 1 for null */ }; struct fh_t { u_int8_t element_id; u_int8_t length; u_int16_t dwell_time; u_int8_t hop_set; u_int8_t hop_pattern; u_int8_t hop_index; }; struct ds_t { u_int8_t element_id; u_int8_t length; u_int8_t channel; }; struct cf_t { u_int8_t element_id; u_int8_t length; u_int8_t count; u_int8_t period; u_int16_t max_duration; u_int16_t dur_remaing; }; struct tim_t { u_int8_t element_id; u_int8_t length; u_int8_t count; u_int8_t period; u_int8_t bitmap_control; u_int8_t bitmap[251]; }; #define E_SSID 0 #define E_RATES 1 #define E_FH 2 #define E_DS 3 #define E_CF 4 #define E_TIM 5 #define E_IBSS 6 /* reserved 7 */ /* reserved 8 */ /* reserved 9 */ /* reserved 10 */ /* reserved 11 */ /* reserved 12 */ /* reserved 13 */ /* reserved 14 */ /* reserved 15 */ /* reserved 16 */ #define E_CHALLENGE 16 /* reserved 17 */ /* reserved 18 */ /* reserved 19 */ /* reserved 16 */ /* reserved 16 */ struct mgmt_body_t { u_int8_t timestamp[IEEE802_11_TSTAMP_LEN]; u_int16_t beacon_interval; u_int16_t listen_interval; u_int16_t status_code; u_int16_t aid; u_char ap[IEEE802_11_AP_LEN]; u_int16_t reason_code; u_int16_t auth_alg; u_int16_t auth_trans_seq_num; elem_status_t challenge_status; struct challenge_t challenge; u_int16_t capability_info; elem_status_t ssid_status; struct ssid_t ssid; elem_status_t rates_status; struct rates_t rates; elem_status_t ds_status; struct ds_t ds; elem_status_t cf_status; struct cf_t cf; elem_status_t fh_status; struct fh_t fh; elem_status_t tim_status; struct tim_t tim; }; struct ctrl_rts_t { u_int16_t fc; u_int16_t duration; u_int8_t ra[6]; u_int8_t ta[6]; u_int8_t fcs[4]; }; #define CTRL_RTS_HDRLEN (IEEE802_11_FC_LEN+IEEE802_11_DUR_LEN+\ IEEE802_11_RA_LEN+IEEE802_11_TA_LEN) struct ctrl_cts_t { u_int16_t fc; u_int16_t duration; u_int8_t ra[6]; u_int8_t fcs[4]; }; #define CTRL_CTS_HDRLEN (IEEE802_11_FC_LEN+IEEE802_11_DUR_LEN+IEEE802_11_RA_LEN) struct ctrl_ack_t { u_int16_t fc; u_int16_t duration; u_int8_t ra[6]; u_int8_t fcs[4]; }; #define CTRL_ACK_HDRLEN (IEEE802_11_FC_LEN+IEEE802_11_DUR_LEN+IEEE802_11_RA_LEN) struct ctrl_ps_poll_t { u_int16_t fc; u_int16_t aid; u_int8_t bssid[6]; u_int8_t ta[6]; u_int8_t fcs[4]; }; #define CTRL_PS_POLL_HDRLEN (IEEE802_11_FC_LEN+IEEE802_11_AID_LEN+\ IEEE802_11_BSSID_LEN+IEEE802_11_TA_LEN) struct ctrl_end_t { u_int16_t fc; u_int16_t duration; u_int8_t ra[6]; u_int8_t bssid[6]; u_int8_t fcs[4]; }; #define CTRL_END_HDRLEN (IEEE802_11_FC_LEN+IEEE802_11_DUR_LEN+\ IEEE802_11_RA_LEN+IEEE802_11_BSSID_LEN) struct ctrl_end_ack_t { u_int16_t fc; u_int16_t duration; u_int8_t ra[6]; u_int8_t bssid[6]; u_int8_t fcs[4]; }; #define CTRL_END_ACK_HDRLEN (IEEE802_11_FC_LEN+IEEE802_11_DUR_LEN+\ IEEE802_11_RA_LEN+IEEE802_11_BSSID_LEN) #define IV_IV(iv) ((iv) & 0xFFFFFF) #define IV_PAD(iv) (((iv) >> 24) & 0x3F) #define IV_KEYID(iv) (((iv) >> 30) & 0x03) tcpdump-3.9.8/./ether.h0000644000026300017500000000475007575562657013004 0ustar mcrmcr/* @(#) $Header: /tcpdump/master/tcpdump/ether.h,v 1.8 2002/12/11 07:13:51 guy Exp $ (LBL) */ /* * Copyright (c) 1982, 1986, 1993 * The Regents of the University of California. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. All advertising materials mentioning features or use of this software * must display the following acknowledgement: * This product includes software developed by the University of * California, Berkeley and its contributors. * 4. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * * @(#)if_ether.h 8.3 (Berkeley) 5/2/95 */ #define ETHERMTU 1500 /* * The number of bytes in an ethernet (MAC) address. */ #define ETHER_ADDR_LEN 6 /* * Structure of a DEC/Intel/Xerox or 802.3 Ethernet header. */ struct ether_header { u_int8_t ether_dhost[ETHER_ADDR_LEN]; u_int8_t ether_shost[ETHER_ADDR_LEN]; u_int16_t ether_type; }; /* * Length of a DEC/Intel/Xerox or 802.3 Ethernet header; note that some * compilers may pad "struct ether_header" to a multiple of 4 bytes, * for example, so "sizeof (struct ether_header)" may not give the right * answer. */ #define ETHER_HDRLEN 14 tcpdump-3.9.8/./print-telnet.c0000644000026300017500000001432007774005146014271 0ustar mcrmcr/* $NetBSD: print-telnet.c,v 1.2 1999/10/11 12:40:12 sjg Exp $ */ /*- * Copyright (c) 1997, 1998 The NetBSD Foundation, Inc. * All rights reserved. * * This code is derived from software contributed to The NetBSD Foundation * by Simon J. Gerraty. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. All advertising materials mentioning features or use of this software * must display the following acknowledgement: * This product includes software developed by the NetBSD * Foundation, Inc. and its contributors. * 4. Neither the name of The NetBSD Foundation nor the names of its * contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. */ /* * @(#)Copyright (c) 1994, Simon J. Gerraty. * * This is free software. It comes with NO WARRANTY. * Permission to use, modify and distribute this source code * is granted subject to the following conditions. * 1/ that the above copyright notice and this notice * are preserved in all copies. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #ifndef lint static const char rcsid[] _U_ = "@(#) $Header: /tcpdump/master/tcpdump/print-telnet.c,v 1.24 2003/12/29 11:05:10 hannes Exp $"; #endif #include #include #include #include #include "interface.h" #include "addrtoname.h" #define TELCMDS #define TELOPTS #include "telnet.h" /* normal */ static const char *cmds[] = { "IS", "SEND", "INFO", }; /* 37: Authentication */ static const char *authcmd[] = { "IS", "SEND", "REPLY", "NAME", }; static const char *authtype[] = { "NULL", "KERBEROS_V4", "KERBEROS_V5", "SPX", "MINK", "SRP", "RSA", "SSL", NULL, NULL, "LOKI", "SSA", "KEA_SJ", "KEA_SJ_INTEG", "DSS", "NTLM", }; /* 38: Encryption */ static const char *enccmd[] = { "IS", "SUPPORT", "REPLY", "START", "END", "REQUEST-START", "REQUEST-END", "END_KEYID", "DEC_KEYID", }; static const char *enctype[] = { "NULL", "DES_CFB64", "DES_OFB64", "DES3_CFB64", "DES3_OFB64", NULL, "CAST5_40_CFB64", "CAST5_40_OFB64", "CAST128_CFB64", "CAST128_OFB64", }; #define STR_OR_ID(x, tab) \ (((x) < sizeof(tab)/sizeof(tab[0]) && tab[(x)]) ? tab[(x)] : numstr(x)) static char * numstr(int x) { static char buf[20]; snprintf(buf, sizeof(buf), "%#x", x); return buf; } /* sp points to IAC byte */ static int telnet_parse(const u_char *sp, u_int length, int print) { int i, x; u_int c; const u_char *osp, *p; #define FETCH(c, sp, length) \ do { \ if (length < 1) \ goto pktend; \ TCHECK(*sp); \ c = *sp++; \ length--; \ } while (0) osp = sp; FETCH(c, sp, length); if (c != IAC) goto pktend; FETCH(c, sp, length); if (c == IAC) { /* ! */ if (print) printf("IAC IAC"); goto done; } i = c - TELCMD_FIRST; if (i < 0 || i > IAC - TELCMD_FIRST) goto pktend; switch (c) { case DONT: case DO: case WONT: case WILL: case SB: /* DONT/DO/WONT/WILL x */ FETCH(x, sp, length); if (x >= 0 && x < NTELOPTS) { if (print) (void)printf("%s %s", telcmds[i], telopts[x]); } else { if (print) (void)printf("%s %#x", telcmds[i], x); } if (c != SB) break; /* IAC SB .... IAC SE */ p = sp; while (length > (u_int)(p + 1 - sp)) { if (p[0] == IAC && p[1] == SE) break; p++; } if (*p != IAC) goto pktend; switch (x) { case TELOPT_AUTHENTICATION: if (p <= sp) break; FETCH(c, sp, length); if (print) (void)printf(" %s", STR_OR_ID(c, authcmd)); if (p <= sp) break; FETCH(c, sp, length); if (print) (void)printf(" %s", STR_OR_ID(c, authtype)); break; case TELOPT_ENCRYPT: if (p <= sp) break; FETCH(c, sp, length); if (print) (void)printf(" %s", STR_OR_ID(c, enccmd)); if (p <= sp) break; FETCH(c, sp, length); if (print) (void)printf(" %s", STR_OR_ID(c, enctype)); break; default: if (p <= sp) break; FETCH(c, sp, length); if (print) (void)printf(" %s", STR_OR_ID(c, cmds)); break; } while (p > sp) { FETCH(x, sp, length); if (print) (void)printf(" %#x", x); } /* terminating IAC SE */ if (print) (void)printf(" SE"); sp += 2; length -= 2; break; default: if (print) (void)printf("%s", telcmds[i]); goto done; } done: return sp - osp; trunc: (void)printf("[|telnet]"); pktend: return -1; #undef FETCH } void telnet_print(const u_char *sp, u_int length) { int first = 1; const u_char *osp; int l; osp = sp; while (length > 0 && *sp == IAC) { l = telnet_parse(sp, length, 0); if (l < 0) break; /* * now print it */ if (Xflag && 2 < vflag) { if (first) printf("\nTelnet:"); hex_print_with_offset("\n", sp, l, sp - osp); if (l > 8) printf("\n\t\t\t\t"); else printf("%*s\t", (8 - l) * 3, ""); } else printf("%s", (first) ? " [telnet " : ", "); (void)telnet_parse(sp, length, 1); first = 0; sp += l; length -= l; } if (!first) { if (Xflag && 2 < vflag) printf("\n"); else printf("]"); } } tcpdump-3.9.8/./ospf.h0000644000026300017500000002414310634111730012606 0ustar mcrmcr/* @(#) $Header: /tcpdump/master/tcpdump/ospf.h,v 1.16.2.2 2006/12/13 08:24:27 hannes Exp $ (LBL) */ /* * Copyright (c) 1991, 1993, 1994, 1995, 1996, 1997 * The Regents of the University of California. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that: (1) source code distributions * retain the above copyright notice and this paragraph in its entirety, (2) * distributions including binary code include the above copyright notice and * this paragraph in its entirety in the documentation or other materials * provided with the distribution, and (3) all advertising materials mentioning * features or use of this software display the following acknowledgement: * ``This product includes software developed by the University of California, * Lawrence Berkeley Laboratory and its contributors.'' Neither the name of * the University nor the names of its contributors may be used to endorse * or promote products derived from this software without specific prior * written permission. * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * * OSPF support contributed by Jeffrey Honig (jch@mitchell.cit.cornell.edu) */ #define OSPF_TYPE_UMD 0 /* UMd's special monitoring packets */ #define OSPF_TYPE_HELLO 1 /* Hello */ #define OSPF_TYPE_DD 2 /* Database Description */ #define OSPF_TYPE_LS_REQ 3 /* Link State Request */ #define OSPF_TYPE_LS_UPDATE 4 /* Link State Update */ #define OSPF_TYPE_LS_ACK 5 /* Link State Ack */ /* Options field * * +------------------------------------+ * | * | O | DC | EA | N/P | MC | E | T | * +------------------------------------+ * */ #define OSPF_OPTION_T 0x01 /* T bit: TOS support */ #define OSPF_OPTION_E 0x02 /* E bit: External routes advertised */ #define OSPF_OPTION_MC 0x04 /* MC bit: Multicast capable */ #define OSPF_OPTION_NP 0x08 /* N/P bit: NSSA capable */ #define OSPF_OPTION_EA 0x10 /* EA bit: External Attribute capable */ #define OSPF_OPTION_DC 0x20 /* DC bit: Demand circuit capable */ #define OSPF_OPTION_O 0x40 /* O bit: Opaque LSA capable */ #define OSPF_OPTION_DN 0x80 /* DN bit: Up/Down Bit capable - draft-ietf-ospf-2547-dnbit-04 */ /* ospf_authtype */ #define OSPF_AUTH_NONE 0 /* No auth-data */ #define OSPF_AUTH_SIMPLE 1 /* Simple password */ #define OSPF_AUTH_SIMPLE_LEN 8 /* max length of simple authentication */ #define OSPF_AUTH_MD5 2 /* MD5 authentication */ #define OSPF_AUTH_MD5_LEN 16 /* length of MD5 authentication */ /* db_flags */ #define OSPF_DB_INIT 0x04 /* */ #define OSPF_DB_MORE 0x02 #define OSPF_DB_MASTER 0x01 /* ls_type */ #define LS_TYPE_ROUTER 1 /* router link */ #define LS_TYPE_NETWORK 2 /* network link */ #define LS_TYPE_SUM_IP 3 /* summary link */ #define LS_TYPE_SUM_ABR 4 /* summary area link */ #define LS_TYPE_ASE 5 /* ASE */ #define LS_TYPE_GROUP 6 /* Group membership (multicast */ /* extensions 23 July 1991) */ #define LS_TYPE_NSSA 7 /* rfc3101 - Not so Stubby Areas */ #define LS_TYPE_OPAQUE_LL 9 /* rfc2370 - Opaque Link Local */ #define LS_TYPE_OPAQUE_AL 10 /* rfc2370 - Opaque Link Local */ #define LS_TYPE_OPAQUE_DW 11 /* rfc2370 - Opaque Domain Wide */ #define LS_OPAQUE_TYPE_TE 1 /* rfc3630 */ #define LS_OPAQUE_TYPE_GRACE 3 /* rfc3623 */ #define LS_OPAQUE_TYPE_RI 4 /* draft-ietf-ospf-cap-03 */ #define LS_OPAQUE_TE_TLV_ROUTER 1 /* rfc3630 */ #define LS_OPAQUE_TE_TLV_LINK 2 /* rfc3630 */ #define LS_OPAQUE_TE_LINK_SUBTLV_LINK_TYPE 1 /* rfc3630 */ #define LS_OPAQUE_TE_LINK_SUBTLV_LINK_ID 2 /* rfc3630 */ #define LS_OPAQUE_TE_LINK_SUBTLV_LOCAL_IP 3 /* rfc3630 */ #define LS_OPAQUE_TE_LINK_SUBTLV_REMOTE_IP 4 /* rfc3630 */ #define LS_OPAQUE_TE_LINK_SUBTLV_TE_METRIC 5 /* rfc3630 */ #define LS_OPAQUE_TE_LINK_SUBTLV_MAX_BW 6 /* rfc3630 */ #define LS_OPAQUE_TE_LINK_SUBTLV_MAX_RES_BW 7 /* rfc3630 */ #define LS_OPAQUE_TE_LINK_SUBTLV_UNRES_BW 8 /* rfc3630 */ #define LS_OPAQUE_TE_LINK_SUBTLV_ADMIN_GROUP 9 /* rfc3630 */ #define LS_OPAQUE_TE_LINK_SUBTLV_LINK_LOCAL_REMOTE_ID 11 /* draft-ietf-ccamp-ospf-gmpls-extensions */ #define LS_OPAQUE_TE_LINK_SUBTLV_LINK_PROTECTION_TYPE 14 /* draft-ietf-ccamp-ospf-gmpls-extensions */ #define LS_OPAQUE_TE_LINK_SUBTLV_INTF_SW_CAP_DESCR 15 /* draft-ietf-ccamp-ospf-gmpls-extensions */ #define LS_OPAQUE_TE_LINK_SUBTLV_SHARED_RISK_GROUP 16 /* draft-ietf-ccamp-ospf-gmpls-extensions */ #define LS_OPAQUE_TE_LINK_SUBTLV_BW_CONSTRAINTS 17 /* rfc4124 */ #define LS_OPAQUE_TE_LINK_SUBTLV_LINK_TYPE_PTP 1 /* rfc3630 */ #define LS_OPAQUE_TE_LINK_SUBTLV_LINK_TYPE_MA 2 /* rfc3630 */ #define LS_OPAQUE_GRACE_TLV_PERIOD 1 /* rfc3623 */ #define LS_OPAQUE_GRACE_TLV_REASON 2 /* rfc3623 */ #define LS_OPAQUE_GRACE_TLV_INT_ADDRESS 3 /* rfc3623 */ #define LS_OPAQUE_GRACE_TLV_REASON_UNKNOWN 0 /* rfc3623 */ #define LS_OPAQUE_GRACE_TLV_REASON_SW_RESTART 1 /* rfc3623 */ #define LS_OPAQUE_GRACE_TLV_REASON_SW_UPGRADE 2 /* rfc3623 */ #define LS_OPAQUE_GRACE_TLV_REASON_CP_SWITCH 3 /* rfc3623 */ #define LS_OPAQUE_RI_TLV_CAP 1 /* draft-ietf-ospf-cap-03 */ /************************************************* * * is the above a bug in the documentation? * *************************************************/ /* rla_link.link_type */ #define RLA_TYPE_ROUTER 1 /* point-to-point to another router */ #define RLA_TYPE_TRANSIT 2 /* connection to transit network */ #define RLA_TYPE_STUB 3 /* connection to stub network */ #define RLA_TYPE_VIRTUAL 4 /* virtual link */ /* rla_flags */ #define RLA_FLAG_B 0x01 #define RLA_FLAG_E 0x02 #define RLA_FLAG_W1 0x04 #define RLA_FLAG_W2 0x08 /* sla_tosmetric breakdown */ #define SLA_MASK_TOS 0x7f000000 #define SLA_MASK_METRIC 0x00ffffff #define SLA_SHIFT_TOS 24 /* asla_tosmetric breakdown */ #define ASLA_FLAG_EXTERNAL 0x80000000 #define ASLA_MASK_TOS 0x7f000000 #define ASLA_SHIFT_TOS 24 #define ASLA_MASK_METRIC 0x00ffffff /* multicast vertex type */ #define MCLA_VERTEX_ROUTER 1 #define MCLA_VERTEX_NETWORK 2 /* link state advertisement header */ struct lsa_hdr { u_int16_t ls_age; u_int8_t ls_options; u_int8_t ls_type; union { struct in_addr lsa_id; struct { /* opaque LSAs change the LSA-ID field */ u_int8_t opaque_type; u_int8_t opaque_id[3]; } opaque_field; } un_lsa_id; struct in_addr ls_router; u_int32_t ls_seq; u_int16_t ls_chksum; u_int16_t ls_length; }; /* link state advertisement */ struct lsa { struct lsa_hdr ls_hdr; /* Link state types */ union { /* Router links advertisements */ struct { u_int8_t rla_flags; u_int8_t rla_zero[1]; u_int16_t rla_count; struct rlalink { struct in_addr link_id; struct in_addr link_data; u_int8_t link_type; u_int8_t link_toscount; u_int16_t link_tos0metric; } rla_link[1]; /* may repeat */ } un_rla; /* Network links advertisements */ struct { struct in_addr nla_mask; struct in_addr nla_router[1]; /* may repeat */ } un_nla; /* Summary links advertisements */ struct { struct in_addr sla_mask; u_int32_t sla_tosmetric[1]; /* may repeat */ } un_sla; /* AS external links advertisements */ struct { struct in_addr asla_mask; struct aslametric { u_int32_t asla_tosmetric; struct in_addr asla_forward; struct in_addr asla_tag; } asla_metric[1]; /* may repeat */ } un_asla; /* Multicast group membership */ struct mcla { u_int32_t mcla_vtype; struct in_addr mcla_vid; } un_mcla[1]; /* Opaque TE LSA */ struct { u_int16_t type; u_int16_t length; u_int8_t data[1]; /* may repeat */ } un_te_lsa_tlv; /* Opaque Grace LSA */ struct { u_int16_t type; u_int16_t length; u_int8_t data[1]; /* may repeat */ } un_grace_tlv; /* Opaque Router information LSA */ struct { u_int16_t type; u_int16_t length; u_int8_t data[1]; /* may repeat */ } un_ri_tlv; /* Unknown LSA */ struct unknown { u_int8_t data[1]; /* may repeat */ } un_unknown[1]; } lsa_un; }; /* * TOS metric struct (will be 0 or more in router links update) */ struct tos_metric { u_int8_t tos_type; u_int8_t tos_zero; u_int16_t tos_metric; }; #define OSPF_AUTH_SIZE 8 /* * the main header */ struct ospfhdr { u_int8_t ospf_version; u_int8_t ospf_type; u_int16_t ospf_len; struct in_addr ospf_routerid; struct in_addr ospf_areaid; u_int16_t ospf_chksum; u_int16_t ospf_authtype; u_int8_t ospf_authdata[OSPF_AUTH_SIZE]; union { /* Hello packet */ struct { struct in_addr hello_mask; u_int16_t hello_helloint; u_int8_t hello_options; u_int8_t hello_priority; u_int32_t hello_deadint; struct in_addr hello_dr; struct in_addr hello_bdr; struct in_addr hello_neighbor[1]; /* may repeat */ } un_hello; /* Database Description packet */ struct { u_int8_t db_zero[2]; u_int8_t db_options; u_int8_t db_flags; u_int32_t db_seq; struct lsa_hdr db_lshdr[1]; /* may repeat */ } un_db; /* Link State Request */ struct lsr { u_int8_t ls_type[4]; union { struct in_addr ls_stateid; struct { /* opaque LSAs change the LSA-ID field */ u_int8_t opaque_type; u_int8_t opaque_id[3]; } opaque_field; } un_ls_stateid; struct in_addr ls_router; } un_lsr[1]; /* may repeat */ /* Link State Update */ struct { u_int32_t lsu_count; struct lsa lsu_lsa[1]; /* may repeat */ } un_lsu; /* Link State Acknowledgement */ struct { struct lsa_hdr lsa_lshdr[1]; /* may repeat */ } un_lsa ; } ospf_un ; }; #define ospf_hello ospf_un.un_hello #define ospf_db ospf_un.un_db #define ospf_lsr ospf_un.un_lsr #define ospf_lsu ospf_un.un_lsu #define ospf_lsa ospf_un.un_lsa tcpdump-3.9.8/./tftp.h0000644000026300017500000000610610672356720012627 0ustar mcrmcr/* @(#) $Header: /tcpdump/master/tcpdump/tftp.h,v 1.1.2.1 2007/09/14 01:03:12 guy Exp $ (LBL) */ /* * Copyright (c) 1983, 1993 * The Regents of the University of California. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. All advertising materials mentioning features or use of this software * must display the following acknowledgement: * This product includes software developed by the University of * California, Berkeley and its contributors. * 4. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * * @(#)tftp.h 8.1 (Berkeley) 6/2/93 */ #ifndef _TFTP_H_ #define _TFTP_H_ /* * Trivial File Transfer Protocol (IEN-133) */ #define SEGSIZE 512 /* data segment size */ /* * Packet types. */ #define RRQ 01 /* read request */ #define WRQ 02 /* write request */ #define DATA 03 /* data packet */ #define ACK 04 /* acknowledgement */ #define ERROR 05 /* error code */ #define OACK 06 /* option acknowledgement */ struct tftphdr { unsigned short th_opcode; /* packet type */ union { unsigned short tu_block; /* block # */ unsigned short tu_code; /* error code */ char tu_stuff[1]; /* request packet stuff */ } th_u; char th_data[1]; /* data or error string */ }; #define th_block th_u.tu_block #define th_code th_u.tu_code #define th_stuff th_u.tu_stuff #define th_msg th_data /* * Error codes. */ #define EUNDEF 0 /* not defined */ #define ENOTFOUND 1 /* file not found */ #define EACCESS 2 /* access violation */ #define ENOSPACE 3 /* disk full or allocation exceeded */ #define EBADOP 4 /* illegal TFTP operation */ #define EBADID 5 /* unknown transfer ID */ #define EEXISTS 6 /* file already exists */ #define ENOUSER 7 /* no such user */ #endif /* !_TFTP_H_ */ tcpdump-3.9.8/./print-ipx.c0000644000026300017500000001260110236625124013565 0ustar mcrmcr/* * Copyright (c) 1994, 1995, 1996 * The Regents of the University of California. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that: (1) source code distributions * retain the above copyright notice and this paragraph in its entirety, (2) * distributions including binary code include the above copyright notice and * this paragraph in its entirety in the documentation or other materials * provided with the distribution, and (3) all advertising materials mentioning * features or use of this software display the following acknowledgement: * ``This product includes software developed by the University of California, * Lawrence Berkeley Laboratory and its contributors.'' Neither the name of * the University nor the names of its contributors may be used to endorse * or promote products derived from this software without specific prior * written permission. * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * * Format and print Novell IPX packets. * Contributed by Brad Parker (brad@fcr.com). */ #ifndef lint static const char rcsid[] _U_ = "@(#) $Header: /tcpdump/master/tcpdump/print-ipx.c,v 1.40.2.2 2005/05/06 08:27:00 guy Exp $"; #endif #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include #include #include "interface.h" #include "addrtoname.h" #include "ipx.h" #include "extract.h" static const char *ipxaddr_string(u_int32_t, const u_char *); void ipx_decode(const struct ipxHdr *, const u_char *, u_int); void ipx_sap_print(const u_short *, u_int); void ipx_rip_print(const u_short *, u_int); /* * Print IPX datagram packets. */ void ipx_print(const u_char *p, u_int length) { const struct ipxHdr *ipx = (const struct ipxHdr *)p; if (!eflag) printf("IPX "); TCHECK(ipx->srcSkt); (void)printf("%s.%04x > ", ipxaddr_string(EXTRACT_32BITS(ipx->srcNet), ipx->srcNode), EXTRACT_16BITS(&ipx->srcSkt)); (void)printf("%s.%04x: ", ipxaddr_string(EXTRACT_32BITS(ipx->dstNet), ipx->dstNode), EXTRACT_16BITS(&ipx->dstSkt)); /* take length from ipx header */ TCHECK(ipx->length); length = EXTRACT_16BITS(&ipx->length); ipx_decode(ipx, (u_char *)ipx + ipxSize, length - ipxSize); return; trunc: printf("[|ipx %d]", length); } static const char * ipxaddr_string(u_int32_t net, const u_char *node) { static char line[256]; snprintf(line, sizeof(line), "%08x.%02x:%02x:%02x:%02x:%02x:%02x", net, node[0], node[1], node[2], node[3], node[4], node[5]); return line; } void ipx_decode(const struct ipxHdr *ipx, const u_char *datap, u_int length) { register u_short dstSkt; dstSkt = EXTRACT_16BITS(&ipx->dstSkt); switch (dstSkt) { case IPX_SKT_NCP: (void)printf("ipx-ncp %d", length); break; case IPX_SKT_SAP: ipx_sap_print((u_short *)datap, length); break; case IPX_SKT_RIP: ipx_rip_print((u_short *)datap, length); break; case IPX_SKT_NETBIOS: (void)printf("ipx-netbios %d", length); #ifdef TCPDUMP_DO_SMB ipx_netbios_print(datap, length); #endif break; case IPX_SKT_DIAGNOSTICS: (void)printf("ipx-diags %d", length); break; case IPX_SKT_NWLINK_DGM: (void)printf("ipx-nwlink-dgm %d", length); #ifdef TCPDUMP_DO_SMB ipx_netbios_print(datap, length); #endif break; case IPX_SKT_EIGRP: eigrp_print(datap, length); break; default: (void)printf("ipx-#%x %d", dstSkt, length); break; } } void ipx_sap_print(const u_short *ipx, u_int length) { int command, i; TCHECK(ipx[0]); command = EXTRACT_16BITS(ipx); ipx++; length -= 2; switch (command) { case 1: case 3: if (command == 1) (void)printf("ipx-sap-req"); else (void)printf("ipx-sap-nearest-req"); TCHECK(ipx[0]); (void)printf(" %s", ipxsap_string(htons(EXTRACT_16BITS(&ipx[0])))); break; case 2: case 4: if (command == 2) (void)printf("ipx-sap-resp"); else (void)printf("ipx-sap-nearest-resp"); for (i = 0; i < 8 && length > 0; i++) { TCHECK(ipx[0]); (void)printf(" %s '", ipxsap_string(htons(EXTRACT_16BITS(&ipx[0])))); if (fn_printzp((u_char *)&ipx[1], 48, snapend)) { printf("'"); goto trunc; } TCHECK2(ipx[25], 10); printf("' addr %s", ipxaddr_string(EXTRACT_32BITS(&ipx[25]), (u_char *)&ipx[27])); ipx += 32; length -= 64; } break; default: (void)printf("ipx-sap-?%x", command); break; } return; trunc: printf("[|ipx %d]", length); } void ipx_rip_print(const u_short *ipx, u_int length) { int command, i; TCHECK(ipx[0]); command = EXTRACT_16BITS(ipx); ipx++; length -= 2; switch (command) { case 1: (void)printf("ipx-rip-req"); if (length > 0) { TCHECK(ipx[3]); (void)printf(" %u/%d.%d", EXTRACT_32BITS(&ipx[0]), EXTRACT_16BITS(&ipx[2]), EXTRACT_16BITS(&ipx[3])); } break; case 2: (void)printf("ipx-rip-resp"); for (i = 0; i < 50 && length > 0; i++) { TCHECK(ipx[3]); (void)printf(" %u/%d.%d", EXTRACT_32BITS(&ipx[0]), EXTRACT_16BITS(&ipx[2]), EXTRACT_16BITS(&ipx[3])); ipx += 4; length -= 8; } break; default: (void)printf("ipx-rip-?%x", command); break; } return; trunc: printf("[|ipx %d]", length); } tcpdump-3.9.8/./oakley.h0000644000026300017500000001274607575562664013163 0ustar mcrmcr/* * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project. * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. Neither the name of the project nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ /* YIPS @(#)$Id: oakley.h,v 1.4 2002/12/11 07:13:56 guy Exp $ */ /* refer to RFC 2409 */ #if !defined(_ISAKMP_OAKLEY_H_) #define _ISAKMP_OAKLEY_H_ /* Attribute Classes */ #define OAKLEY_ATTR_ENC_ALG 1 /* B */ #define OAKLEY_ATTR_ENC_ALG_DES 1 #define OAKLEY_ATTR_ENC_ALG_IDEA 2 #define OAKLEY_ATTR_ENC_ALG_BL 3 #define OAKLEY_ATTR_ENC_ALG_RC5 4 #define OAKLEY_ATTR_ENC_ALG_3DES 5 #define OAKLEY_ATTR_ENC_ALG_CAST 6 #define OAKLEY_ATTR_HASH_ALG 2 /* B */ #define OAKLEY_ATTR_HASH_ALG_MD5 1 #define OAKLEY_ATTR_HASH_ALG_SHA 2 #define OAKLEY_ATTR_HASH_ALG_TIGER 3 #define OAKLEY_ATTR_AUTH_METHOD 3 /* B */ #define OAKLEY_ATTR_AUTH_METHOD_PSKEY 1 #define OAKLEY_ATTR_AUTH_METHOD_DSS 2 #define OAKLEY_ATTR_AUTH_METHOD_RSA 3 #define OAKLEY_ATTR_AUTH_METHOD_RSAENC 4 #define OAKLEY_ATTR_AUTH_METHOD_RSAREV 5 #define OAKLEY_ATTR_GRP_DESC 4 /* B */ #define OAKLEY_ATTR_GRP_DESC_MODP768 1 #define OAKLEY_ATTR_GRP_DESC_MODP1024 2 #define OAKLEY_ATTR_GRP_DESC_EC2N155 3 #define OAKLEY_ATTR_GRP_DESC_EC2N185 4 #define OAKLEY_ATTR_GRP_TYPE 5 /* B */ #define OAKLEY_ATTR_GRP_TYPE_MODP 1 #define OAKLEY_ATTR_GRP_TYPE_ECP 2 #define OAKLEY_ATTR_GRP_TYPE_EC2N 3 #define OAKLEY_ATTR_GRP_PI 6 /* V */ #define OAKLEY_ATTR_GRP_GEN_ONE 7 /* V */ #define OAKLEY_ATTR_GRP_GEN_TWO 8 /* V */ #define OAKLEY_ATTR_GRP_CURVE_A 9 /* V */ #define OAKLEY_ATTR_GRP_CURVE_B 10 /* V */ #define OAKLEY_ATTR_SA_LTYPE 11 /* B */ #define OAKLEY_ATTR_SA_LTYPE_DEFAULT 1 #define OAKLEY_ATTR_SA_LTYPE_SEC 1 #define OAKLEY_ATTR_SA_LTYPE_KB 2 #define OAKLEY_ATTR_SA_LDUR 12 /* V */ #define OAKLEY_ATTR_SA_LDUR_DEFAULT 28800 /* 8 hours */ #define OAKLEY_ATTR_PRF 13 /* B */ #define OAKLEY_ATTR_KEY_LEN 14 /* B */ #define OAKLEY_ATTR_FIELD_SIZE 15 /* B */ #define OAKLEY_ATTR_GRP_ORDER 16 /* V */ #define OAKLEY_ID_IPV4_ADDR 0 #define OAKLEY_ID_IPV4_ADDR_SUBNET 1 #define OAKLEY_ID_IPV6_ADDR 2 #define OAKLEY_ID_IPV6_ADDR_SUBNET 3 /* Additional Exchange Type */ #define ISAKMP_ETYPE_QUICK 32 #define ISAKMP_ETYPE_NEWGRP 33 /* The use for checking proposal payload. This is not exchange type. */ #define OAKLEY_MAIN_MODE 0 #define OAKLEY_QUICK_MODE 1 #define OAKLEY_PRIME_MODP768 "\ FFFFFFFF FFFFFFFF C90FDAA2 2168C234 C4C6628B 80DC1CD1 \ 29024E08 8A67CC74 020BBEA6 3B139B22 514A0879 8E3404DD \ EF9519B3 CD3A431B 302B0A6D F25F1437 4FE1356D 6D51C245 \ E485B576 625E7EC6 F44C42E9 A63A3620 FFFFFFFF FFFFFFFF" #define OAKLEY_PRIME_MODP1024 "\ FFFFFFFF FFFFFFFF C90FDAA2 2168C234 C4C6628B 80DC1CD1 \ 29024E08 8A67CC74 020BBEA6 3B139B22 514A0879 8E3404DD \ EF9519B3 CD3A431B 302B0A6D F25F1437 4FE1356D 6D51C245 \ E485B576 625E7EC6 F44C42E9 A637ED6B 0BFF5CB6 F406B7ED \ EE386BFB 5A899FA5 AE9F2411 7C4B1FE6 49286651 ECE65381 \ FFFFFFFF FFFFFFFF" #define DEFAULTSECRETSIZE ( 128 / 8 ) /* 128 bits */ #define DEFAULTNONCESIZE ( 128 / 8 ) /* 128 bits */ #define MAXPADLWORD 20 #if 0 /* isakmp sa structure */ struct oakley_sa { u_int8_t proto_id; /* OAKLEY */ vchar_t *spi; /* spi */ u_int8_t dhgrp; /* DH; group */ u_int8_t auth_t; /* method of authentication */ u_int8_t prf_t; /* type of prf */ u_int8_t hash_t; /* type of hash */ u_int8_t enc_t; /* type of cipher */ u_int8_t life_t; /* type of duration of lifetime */ u_int32_t ldur; /* life duration */ }; #endif #endif /* !defined(_ISAKMP_OAKLEY_H_) */ tcpdump-3.9.8/./print-cip.c0000644000026300017500000000524010264535440013543 0ustar mcrmcr/* * Marko Kiiskila carnil@cs.tut.fi * * Tampere University of Technology - Telecommunications Laboratory * * Permission to use, copy, modify and distribute this * software and its documentation is hereby granted, * provided that both the copyright notice and this * permission notice appear in all copies of the software, * derivative works or modified versions, and any portions * thereof, that both notices appear in supporting * documentation, and that the use of this software is * acknowledged in any publications resulting from using * the software. * * TUT ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" * CONDITION AND DISCLAIMS ANY LIABILITY OF ANY KIND FOR * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS * SOFTWARE. * */ #ifndef lint static const char rcsid[] _U_ = "@(#) $Header: /tcpdump/master/tcpdump/print-cip.c,v 1.25.2.1 2005/07/07 01:24:34 guy Exp $ (LBL)"; #endif #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include #include #include "interface.h" #include "addrtoname.h" #include "ethertype.h" #include "ether.h" #define RFC1483LLC_LEN 8 static unsigned char rfcllc[] = { 0xaa, /* DSAP: non-ISO */ 0xaa, /* SSAP: non-ISO */ 0x03, /* Ctrl: Unnumbered Information Command PDU */ 0x00, /* OUI: EtherType */ 0x00, 0x00 }; static inline void cip_print(int length) { /* * There is no MAC-layer header, so just print the length. */ printf("%d: ", length); } /* * This is the top level routine of the printer. 'p' points * to the LLC/SNAP or raw header of the packet, 'h->ts' is the timestamp, * 'h->len' is the length of the packet off the wire, and 'h->caplen' * is the number of bytes actually captured. */ u_int cip_if_print(const struct pcap_pkthdr *h, const u_char *p) { u_int caplen = h->caplen; u_int length = h->len; u_short extracted_ethertype; if (memcmp(rfcllc, p, sizeof(rfcllc))==0 && caplen < RFC1483LLC_LEN) { printf("[|cip]"); return (0); } if (eflag) cip_print(length); if (memcmp(rfcllc, p, sizeof(rfcllc)) == 0) { /* * LLC header is present. Try to print it & higher layers. */ if (llc_print(p, length, caplen, NULL, NULL, &extracted_ethertype) == 0) { /* ether_type not known, print raw packet */ if (!eflag) cip_print(length); if (extracted_ethertype) { printf("(LLC %s) ", etherproto_string(htons(extracted_ethertype))); } if (!suppress_default_print) default_print(p, caplen); } } else { /* * LLC header is absent; treat it as just IP. */ ip_print(gndo, p, length); } return (0); } /* * Local Variables: * c-style: whitesmith * c-basic-offset: 8 * End: */ tcpdump-3.9.8/./print-aodv.c0000644000026300017500000003041610030153233013707 0ustar mcrmcr/* * Copyright (c) 2003 Bruce M. Simpson * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. All advertising materials mentioning features or use of this software * must display the following acknowledgement: * This product includes software developed by Bruce M. Simpson. * 4. Neither the name of Bruce M. Simpson nor the names of co- * contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY Bruce M. Simpson AND CONTRIBUTORS * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL Bruce M. Simpson OR CONTRIBUTORS * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. */ #ifndef lint static const char rcsid[] _U_ = "@(#) $Header: /tcpdump/master/tcpdump/print-aodv.c,v 1.11 2004/03/24 00:30:19 guy Exp $ (LBL)"; #endif #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include #include #include #include "interface.h" #include "addrtoname.h" #include "extract.h" /* must come after interface.h */ #include "aodv.h" static void aodv_extension(const struct aodv_ext *ep, u_int length) { u_int i; const struct aodv_hello *ah; switch (ep->type) { case AODV_EXT_HELLO: if (snapend < (u_char *) ep) { printf(" [|hello]"); return; } i = min(length, (u_int)(snapend - (u_char *)ep)); if (i < sizeof(struct aodv_hello)) { printf(" [|hello]"); return; } i -= sizeof(struct aodv_hello); ah = (void *)ep; printf("\n\text HELLO %ld ms", (unsigned long)EXTRACT_32BITS(&ah->interval)); break; default: printf("\n\text %u %u", ep->type, ep->length); break; } } static void aodv_rreq(const union aodv *ap, const u_char *dat, u_int length) { u_int i; if (snapend < dat) { printf(" [|aodv]"); return; } i = min(length, (u_int)(snapend - dat)); if (i < sizeof(ap->rreq)) { printf(" [|rreq]"); return; } i -= sizeof(ap->rreq); printf(" rreq %u %s%s%s%s%shops %u id 0x%08lx\n" "\tdst %s seq %lu src %s seq %lu", length, ap->rreq.rreq_type & RREQ_JOIN ? "[J]" : "", ap->rreq.rreq_type & RREQ_REPAIR ? "[R]" : "", ap->rreq.rreq_type & RREQ_GRAT ? "[G]" : "", ap->rreq.rreq_type & RREQ_DEST ? "[D]" : "", ap->rreq.rreq_type & RREQ_UNKNOWN ? "[U] " : " ", ap->rreq.rreq_hops, (unsigned long)EXTRACT_32BITS(&ap->rreq.rreq_id), ipaddr_string(&ap->rreq.rreq_da), (unsigned long)EXTRACT_32BITS(&ap->rreq.rreq_ds), ipaddr_string(&ap->rreq.rreq_oa), (unsigned long)EXTRACT_32BITS(&ap->rreq.rreq_os)); if (i >= sizeof(struct aodv_ext)) aodv_extension((void *)(&ap->rreq + 1), i); } static void aodv_rrep(const union aodv *ap, const u_char *dat, u_int length) { u_int i; if (snapend < dat) { printf(" [|aodv]"); return; } i = min(length, (u_int)(snapend - dat)); if (i < sizeof(ap->rrep)) { printf(" [|rrep]"); return; } i -= sizeof(ap->rrep); printf(" rrep %u %s%sprefix %u hops %u\n" "\tdst %s dseq %lu src %s %lu ms", length, ap->rrep.rrep_type & RREP_REPAIR ? "[R]" : "", ap->rrep.rrep_type & RREP_ACK ? "[A] " : " ", ap->rrep.rrep_ps & RREP_PREFIX_MASK, ap->rrep.rrep_hops, ipaddr_string(&ap->rrep.rrep_da), (unsigned long)EXTRACT_32BITS(&ap->rrep.rrep_ds), ipaddr_string(&ap->rrep.rrep_oa), (unsigned long)EXTRACT_32BITS(&ap->rrep.rrep_life)); if (i >= sizeof(struct aodv_ext)) aodv_extension((void *)(&ap->rrep + 1), i); } static void aodv_rerr(const union aodv *ap, const u_char *dat, u_int length) { u_int i; const struct rerr_unreach *dp = NULL; int n, trunc; if (snapend < dat) { printf(" [|aodv]"); return; } i = min(length, (u_int)(snapend - dat)); if (i < offsetof(struct aodv_rerr, r)) { printf(" [|rerr]"); return; } i -= offsetof(struct aodv_rerr, r); dp = &ap->rerr.r.dest[0]; n = ap->rerr.rerr_dc * sizeof(ap->rerr.r.dest[0]); printf(" rerr %s [items %u] [%u]:", ap->rerr.rerr_flags & RERR_NODELETE ? "[D]" : "", ap->rerr.rerr_dc, length); trunc = n - (i/sizeof(ap->rerr.r.dest[0])); for (; i >= sizeof(ap->rerr.r.dest[0]); ++dp, i -= sizeof(ap->rerr.r.dest[0])) { printf(" {%s}(%ld)", ipaddr_string(&dp->u_da), (unsigned long)EXTRACT_32BITS(&dp->u_ds)); } if (trunc) printf("[|rerr]"); } static void #ifdef INET6 aodv_v6_rreq(const union aodv *ap, const u_char *dat, u_int length) #else aodv_v6_rreq(const union aodv *ap _U_, const u_char *dat _U_, u_int length) #endif { #ifdef INET6 u_int i; if (snapend < dat) { printf(" [|aodv]"); return; } i = min(length, (u_int)(snapend - dat)); if (i < sizeof(ap->rreq6)) { printf(" [|rreq6]"); return; } i -= sizeof(ap->rreq6); printf(" v6 rreq %u %s%s%s%s%shops %u id 0x%08lx\n" "\tdst %s seq %lu src %s seq %lu", length, ap->rreq6.rreq_type & RREQ_JOIN ? "[J]" : "", ap->rreq6.rreq_type & RREQ_REPAIR ? "[R]" : "", ap->rreq6.rreq_type & RREQ_GRAT ? "[G]" : "", ap->rreq6.rreq_type & RREQ_DEST ? "[D]" : "", ap->rreq6.rreq_type & RREQ_UNKNOWN ? "[U] " : " ", ap->rreq6.rreq_hops, (unsigned long)EXTRACT_32BITS(&ap->rreq6.rreq_id), ip6addr_string(&ap->rreq6.rreq_da), (unsigned long)EXTRACT_32BITS(&ap->rreq6.rreq_ds), ip6addr_string(&ap->rreq6.rreq_oa), (unsigned long)EXTRACT_32BITS(&ap->rreq6.rreq_os)); if (i >= sizeof(struct aodv_ext)) aodv_extension((void *)(&ap->rreq6 + 1), i); #else printf(" v6 rreq %u", length); #endif } static void #ifdef INET6 aodv_v6_rrep(const union aodv *ap, const u_char *dat, u_int length) #else aodv_v6_rrep(const union aodv *ap _U_, const u_char *dat _U_, u_int length) #endif { #ifdef INET6 u_int i; if (snapend < dat) { printf(" [|aodv]"); return; } i = min(length, (u_int)(snapend - dat)); if (i < sizeof(ap->rrep6)) { printf(" [|rrep6]"); return; } i -= sizeof(ap->rrep6); printf(" rrep %u %s%sprefix %u hops %u\n" "\tdst %s dseq %lu src %s %lu ms", length, ap->rrep6.rrep_type & RREP_REPAIR ? "[R]" : "", ap->rrep6.rrep_type & RREP_ACK ? "[A] " : " ", ap->rrep6.rrep_ps & RREP_PREFIX_MASK, ap->rrep6.rrep_hops, ip6addr_string(&ap->rrep6.rrep_da), (unsigned long)EXTRACT_32BITS(&ap->rrep6.rrep_ds), ip6addr_string(&ap->rrep6.rrep_oa), (unsigned long)EXTRACT_32BITS(&ap->rrep6.rrep_life)); if (i >= sizeof(struct aodv_ext)) aodv_extension((void *)(&ap->rrep6 + 1), i); #else printf(" rrep %u", length); #endif } static void #ifdef INET6 aodv_v6_rerr(const union aodv *ap, u_int length) #else aodv_v6_rerr(const union aodv *ap _U_, u_int length) #endif { #ifdef INET6 const struct rerr_unreach6 *dp6 = NULL; int i, j, n, trunc; i = length - offsetof(struct aodv_rerr, r); j = sizeof(ap->rerr.r.dest6[0]); dp6 = &ap->rerr.r.dest6[0]; n = ap->rerr.rerr_dc * j; printf(" rerr %s [items %u] [%u]:", ap->rerr.rerr_flags & RERR_NODELETE ? "[D]" : "", ap->rerr.rerr_dc, length); trunc = n - (i/j); for (; i -= j >= 0; ++dp6) { printf(" {%s}(%ld)", ip6addr_string(&dp6->u_da), (unsigned long)EXTRACT_32BITS(&dp6->u_ds)); } if (trunc) printf("[|rerr]"); #else printf(" rerr %u", length); #endif } static void #ifdef INET6 aodv_v6_draft_01_rreq(const union aodv *ap, const u_char *dat, u_int length) #else aodv_v6_draft_01_rreq(const union aodv *ap _U_, const u_char *dat _U_, u_int length) #endif { #ifdef INET6 u_int i; if (snapend < dat) { printf(" [|aodv]"); return; } i = min(length, (u_int)(snapend - dat)); if (i < sizeof(ap->rreq6_draft_01)) { printf(" [|rreq6]"); return; } i -= sizeof(ap->rreq6_draft_01); printf(" rreq %u %s%s%s%s%shops %u id 0x%08lx\n" "\tdst %s seq %lu src %s seq %lu", length, ap->rreq6_draft_01.rreq_type & RREQ_JOIN ? "[J]" : "", ap->rreq6_draft_01.rreq_type & RREQ_REPAIR ? "[R]" : "", ap->rreq6_draft_01.rreq_type & RREQ_GRAT ? "[G]" : "", ap->rreq6_draft_01.rreq_type & RREQ_DEST ? "[D]" : "", ap->rreq6_draft_01.rreq_type & RREQ_UNKNOWN ? "[U] " : " ", ap->rreq6_draft_01.rreq_hops, (unsigned long)EXTRACT_32BITS(&ap->rreq6_draft_01.rreq_id), ip6addr_string(&ap->rreq6_draft_01.rreq_da), (unsigned long)EXTRACT_32BITS(&ap->rreq6_draft_01.rreq_ds), ip6addr_string(&ap->rreq6_draft_01.rreq_oa), (unsigned long)EXTRACT_32BITS(&ap->rreq6_draft_01.rreq_os)); if (i >= sizeof(struct aodv_ext)) aodv_extension((void *)(&ap->rreq6_draft_01 + 1), i); #else printf(" rreq %u", length); #endif } static void #ifdef INET6 aodv_v6_draft_01_rrep(const union aodv *ap, const u_char *dat, u_int length) #else aodv_v6_draft_01_rrep(const union aodv *ap _U_, const u_char *dat _U_, u_int length) #endif { #ifdef INET6 u_int i; if (snapend < dat) { printf(" [|aodv]"); return; } i = min(length, (u_int)(snapend - dat)); if (i < sizeof(ap->rrep6_draft_01)) { printf(" [|rrep6]"); return; } i -= sizeof(ap->rrep6_draft_01); printf(" rrep %u %s%sprefix %u hops %u\n" "\tdst %s dseq %lu src %s %lu ms", length, ap->rrep6_draft_01.rrep_type & RREP_REPAIR ? "[R]" : "", ap->rrep6_draft_01.rrep_type & RREP_ACK ? "[A] " : " ", ap->rrep6_draft_01.rrep_ps & RREP_PREFIX_MASK, ap->rrep6_draft_01.rrep_hops, ip6addr_string(&ap->rrep6_draft_01.rrep_da), (unsigned long)EXTRACT_32BITS(&ap->rrep6_draft_01.rrep_ds), ip6addr_string(&ap->rrep6_draft_01.rrep_oa), (unsigned long)EXTRACT_32BITS(&ap->rrep6_draft_01.rrep_life)); if (i >= sizeof(struct aodv_ext)) aodv_extension((void *)(&ap->rrep6_draft_01 + 1), i); #else printf(" rrep %u", length); #endif } static void #ifdef INET6 aodv_v6_draft_01_rerr(const union aodv *ap, u_int length) #else aodv_v6_draft_01_rerr(const union aodv *ap _U_, u_int length) #endif { #ifdef INET6 const struct rerr_unreach6_draft_01 *dp6 = NULL; int i, j, n, trunc; i = length - offsetof(struct aodv_rerr, r); j = sizeof(ap->rerr.r.dest6_draft_01[0]); dp6 = &ap->rerr.r.dest6_draft_01[0]; n = ap->rerr.rerr_dc * j; printf(" rerr %s [items %u] [%u]:", ap->rerr.rerr_flags & RERR_NODELETE ? "[D]" : "", ap->rerr.rerr_dc, length); trunc = n - (i/j); for (; i -= j >= 0; ++dp6) { printf(" {%s}(%ld)", ip6addr_string(&dp6->u_da), (unsigned long)EXTRACT_32BITS(&dp6->u_ds)); } if (trunc) printf("[|rerr]"); #else printf(" rerr %u", length); #endif } void aodv_print(const u_char *dat, u_int length, int is_ip6) { const union aodv *ap; ap = (union aodv *)dat; if (snapend < dat) { printf(" [|aodv]"); return; } if (min(length, (u_int)(snapend - dat)) < sizeof(ap->rrep_ack)) { printf(" [|aodv]"); return; } printf(" aodv"); switch (ap->rerr.rerr_type) { case AODV_RREQ: if (is_ip6) aodv_v6_rreq(ap, dat, length); else aodv_rreq(ap, dat, length); break; case AODV_RREP: if (is_ip6) aodv_v6_rrep(ap, dat, length); else aodv_rrep(ap, dat, length); break; case AODV_RERR: if (is_ip6) aodv_v6_rerr(ap, length); else aodv_rerr(ap, dat, length); break; case AODV_RREP_ACK: printf(" rrep-ack %u", length); break; case AODV_V6_DRAFT_01_RREQ: aodv_v6_draft_01_rreq(ap, dat, length); break; case AODV_V6_DRAFT_01_RREP: aodv_v6_draft_01_rrep(ap, dat, length); break; case AODV_V6_DRAFT_01_RERR: aodv_v6_draft_01_rerr(ap, length); break; case AODV_V6_DRAFT_01_RREP_ACK: printf(" rrep-ack %u", length); break; default: printf(" %u %u", ap->rreq.rreq_type, length); } } tcpdump-3.9.8/./nfs.h0000644000026300017500000003343507575562663012462 0ustar mcrmcr/* @(#) $Header: /tcpdump/master/tcpdump/nfs.h,v 1.7 2002/12/11 07:13:55 guy Exp $ (LBL) */ /* $NetBSD: nfs.h,v 1.1 1996/05/23 22:49:53 fvdl Exp $ */ /* * Copyright (c) 1989, 1993 * The Regents of the University of California. All rights reserved. * * This code is derived from software contributed to Berkeley by * Rick Macklem at The University of Guelph. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. All advertising materials mentioning features or use of this software * must display the following acknowledgement: * This product includes software developed by the University of * California, Berkeley and its contributors. * 4. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * * @(#)nfsproto.h 8.2 (Berkeley) 3/30/95 */ /* * nfs definitions as per the Version 2 and 3 specs */ /* * Constants as defined in the Sun NFS Version 2 and 3 specs. * "NFS: Network File System Protocol Specification" RFC1094 * and in the "NFS: Network File System Version 3 Protocol * Specification" */ #define NFS_PORT 2049 #define NFS_PROG 100003 #define NFS_VER2 2 #define NFS_VER3 3 #define NFS_V2MAXDATA 8192 #define NFS_MAXDGRAMDATA 16384 #define NFS_MAXDATA 32768 #define NFS_MAXPATHLEN 1024 #define NFS_MAXNAMLEN 255 #define NFS_MAXPKTHDR 404 #define NFS_MAXPACKET (NFS_MAXPKTHDR + NFS_MAXDATA) #define NFS_MINPACKET 20 #define NFS_FABLKSIZE 512 /* Size in bytes of a block wrt fa_blocks */ /* Stat numbers for rpc returns (version 2 and 3) */ #define NFS_OK 0 #define NFSERR_PERM 1 #define NFSERR_NOENT 2 #define NFSERR_IO 5 #define NFSERR_NXIO 6 #define NFSERR_ACCES 13 #define NFSERR_EXIST 17 #define NFSERR_XDEV 18 /* Version 3 only */ #define NFSERR_NODEV 19 #define NFSERR_NOTDIR 20 #define NFSERR_ISDIR 21 #define NFSERR_INVAL 22 /* Version 3 only */ #define NFSERR_FBIG 27 #define NFSERR_NOSPC 28 #define NFSERR_ROFS 30 #define NFSERR_MLINK 31 /* Version 3 only */ #define NFSERR_NAMETOL 63 #define NFSERR_NOTEMPTY 66 #define NFSERR_DQUOT 69 #define NFSERR_STALE 70 #define NFSERR_REMOTE 71 /* Version 3 only */ #define NFSERR_WFLUSH 99 /* Version 2 only */ #define NFSERR_BADHANDLE 10001 /* The rest Version 3 only */ #define NFSERR_NOT_SYNC 10002 #define NFSERR_BAD_COOKIE 10003 #define NFSERR_NOTSUPP 10004 #define NFSERR_TOOSMALL 10005 #define NFSERR_SERVERFAULT 10006 #define NFSERR_BADTYPE 10007 #define NFSERR_JUKEBOX 10008 #define NFSERR_TRYLATER NFSERR_JUKEBOX #define NFSERR_STALEWRITEVERF 30001 /* Fake return for nfs_commit() */ #define NFSERR_RETVOID 0x20000000 /* Return void, not error */ #define NFSERR_AUTHERR 0x40000000 /* Mark an authentication error */ #define NFSERR_RETERR 0x80000000 /* Mark an error return for V3 */ /* Sizes in bytes of various nfs rpc components */ #define NFSX_UNSIGNED 4 /* specific to NFS Version 2 */ #define NFSX_V2FH 32 #define NFSX_V2FATTR 68 #define NFSX_V2SATTR 32 #define NFSX_V2COOKIE 4 #define NFSX_V2STATFS 20 /* specific to NFS Version 3 */ #if 0 #define NFSX_V3FH (sizeof (fhandle_t)) /* size this server uses */ #endif #define NFSX_V3FHMAX 64 /* max. allowed by protocol */ #define NFSX_V3FATTR 84 #define NFSX_V3SATTR 60 /* max. all fields filled in */ #define NFSX_V3SRVSATTR (sizeof (struct nfsv3_sattr)) #define NFSX_V3POSTOPATTR (NFSX_V3FATTR + NFSX_UNSIGNED) #define NFSX_V3WCCDATA (NFSX_V3POSTOPATTR + 8 * NFSX_UNSIGNED) #define NFSX_V3COOKIEVERF 8 #define NFSX_V3WRITEVERF 8 #define NFSX_V3CREATEVERF 8 #define NFSX_V3STATFS 52 #define NFSX_V3FSINFO 48 #define NFSX_V3PATHCONF 24 /* variants for both versions */ #define NFSX_FH(v3) ((v3) ? (NFSX_V3FHMAX + NFSX_UNSIGNED) : \ NFSX_V2FH) #define NFSX_SRVFH(v3) ((v3) ? NFSX_V3FH : NFSX_V2FH) #define NFSX_FATTR(v3) ((v3) ? NFSX_V3FATTR : NFSX_V2FATTR) #define NFSX_PREOPATTR(v3) ((v3) ? (7 * NFSX_UNSIGNED) : 0) #define NFSX_POSTOPATTR(v3) ((v3) ? (NFSX_V3FATTR + NFSX_UNSIGNED) : 0) #define NFSX_POSTOPORFATTR(v3) ((v3) ? (NFSX_V3FATTR + NFSX_UNSIGNED) : \ NFSX_V2FATTR) #define NFSX_WCCDATA(v3) ((v3) ? NFSX_V3WCCDATA : 0) #define NFSX_WCCORFATTR(v3) ((v3) ? NFSX_V3WCCDATA : NFSX_V2FATTR) #define NFSX_SATTR(v3) ((v3) ? NFSX_V3SATTR : NFSX_V2SATTR) #define NFSX_COOKIEVERF(v3) ((v3) ? NFSX_V3COOKIEVERF : 0) #define NFSX_WRITEVERF(v3) ((v3) ? NFSX_V3WRITEVERF : 0) #define NFSX_READDIR(v3) ((v3) ? (5 * NFSX_UNSIGNED) : \ (2 * NFSX_UNSIGNED)) #define NFSX_STATFS(v3) ((v3) ? NFSX_V3STATFS : NFSX_V2STATFS) /* nfs rpc procedure numbers (before version mapping) */ #define NFSPROC_NULL 0 #define NFSPROC_GETATTR 1 #define NFSPROC_SETATTR 2 #define NFSPROC_LOOKUP 3 #define NFSPROC_ACCESS 4 #define NFSPROC_READLINK 5 #define NFSPROC_READ 6 #define NFSPROC_WRITE 7 #define NFSPROC_CREATE 8 #define NFSPROC_MKDIR 9 #define NFSPROC_SYMLINK 10 #define NFSPROC_MKNOD 11 #define NFSPROC_REMOVE 12 #define NFSPROC_RMDIR 13 #define NFSPROC_RENAME 14 #define NFSPROC_LINK 15 #define NFSPROC_READDIR 16 #define NFSPROC_READDIRPLUS 17 #define NFSPROC_FSSTAT 18 #define NFSPROC_FSINFO 19 #define NFSPROC_PATHCONF 20 #define NFSPROC_COMMIT 21 /* And leasing (nqnfs) procedure numbers (must be last) */ #define NQNFSPROC_GETLEASE 22 #define NQNFSPROC_VACATED 23 #define NQNFSPROC_EVICTED 24 #define NFSPROC_NOOP 25 #define NFS_NPROCS 26 /* Actual Version 2 procedure numbers */ #define NFSV2PROC_NULL 0 #define NFSV2PROC_GETATTR 1 #define NFSV2PROC_SETATTR 2 #define NFSV2PROC_NOOP 3 #define NFSV2PROC_ROOT NFSV2PROC_NOOP /* Obsolete */ #define NFSV2PROC_LOOKUP 4 #define NFSV2PROC_READLINK 5 #define NFSV2PROC_READ 6 #define NFSV2PROC_WRITECACHE NFSV2PROC_NOOP /* Obsolete */ #define NFSV2PROC_WRITE 8 #define NFSV2PROC_CREATE 9 #define NFSV2PROC_REMOVE 10 #define NFSV2PROC_RENAME 11 #define NFSV2PROC_LINK 12 #define NFSV2PROC_SYMLINK 13 #define NFSV2PROC_MKDIR 14 #define NFSV2PROC_RMDIR 15 #define NFSV2PROC_READDIR 16 #define NFSV2PROC_STATFS 17 /* * Constants used by the Version 3 protocol for various RPCs */ #define NFSV3SATTRTIME_DONTCHANGE 0 #define NFSV3SATTRTIME_TOSERVER 1 #define NFSV3SATTRTIME_TOCLIENT 2 #define NFSV3ATTRTIME_NMODES 3 #define NFSV3ACCESS_READ 0x01 #define NFSV3ACCESS_LOOKUP 0x02 #define NFSV3ACCESS_MODIFY 0x04 #define NFSV3ACCESS_EXTEND 0x08 #define NFSV3ACCESS_DELETE 0x10 #define NFSV3ACCESS_EXECUTE 0x20 #define NFSV3WRITE_UNSTABLE 0 #define NFSV3WRITE_DATASYNC 1 #define NFSV3WRITE_FILESYNC 2 #define NFSV3WRITE_NMODES 3 #define NFSV3CREATE_UNCHECKED 0 #define NFSV3CREATE_GUARDED 1 #define NFSV3CREATE_EXCLUSIVE 2 #define NFSV3CREATE_NMODES 3 #define NFSV3FSINFO_LINK 0x01 #define NFSV3FSINFO_SYMLINK 0x02 #define NFSV3FSINFO_HOMOGENEOUS 0x08 #define NFSV3FSINFO_CANSETTIME 0x10 /* Conversion macros */ #define vtonfsv2_mode(t,m) \ txdr_unsigned(((t) == VFIFO) ? MAKEIMODE(VCHR, (m)) : \ MAKEIMODE((t), (m))) #define vtonfsv3_mode(m) txdr_unsigned((m) & 07777) #define nfstov_mode(a) (fxdr_unsigned(u_int16_t, (a))&07777) #define vtonfsv2_type(a) txdr_unsigned(nfsv2_type[((int32_t)(a))]) #define vtonfsv3_type(a) txdr_unsigned(nfsv3_type[((int32_t)(a))]) #define nfsv2tov_type(a) nv2tov_type[fxdr_unsigned(u_int32_t,(a))&0x7] #define nfsv3tov_type(a) nv3tov_type[fxdr_unsigned(u_int32_t,(a))&0x7] /* File types */ typedef enum { NFNON=0, NFREG=1, NFDIR=2, NFBLK=3, NFCHR=4, NFLNK=5, NFSOCK=6, NFFIFO=7 } nfs_type; /* Structs for common parts of the rpc's */ /* * File Handle (32 bytes for version 2), variable up to 64 for version 3. * File Handles of up to NFS_SMALLFH in size are stored directly in the * nfs node, whereas larger ones are malloc'd. (This never happens when * NFS_SMALLFH is set to 64.) * NFS_SMALLFH should be in the range of 32 to 64 and be divisible by 4. */ #ifndef NFS_SMALLFH #define NFS_SMALLFH 64 #endif union nfsfh { /* fhandle_t fh_generic; */ u_char fh_bytes[NFS_SMALLFH]; }; typedef union nfsfh nfsfh_t; struct nfsv2_time { u_int32_t nfsv2_sec; u_int32_t nfsv2_usec; }; typedef struct nfsv2_time nfstime2; struct nfsv3_time { u_int32_t nfsv3_sec; u_int32_t nfsv3_nsec; }; typedef struct nfsv3_time nfstime3; /* * Quads are defined as arrays of 2 longs to ensure dense packing for the * protocol and to facilitate xdr conversion. */ struct nfs_uquad { u_int32_t nfsuquad[2]; }; typedef struct nfs_uquad nfsuint64; #if 0 /* XXX - this doesn't seemed to be used and it doesn't work * with non-gcc, so comment it out for now. */ /* * Used to convert between two u_longs and a u_quad_t. */ union nfs_quadconvert { u_int32_t lval[2]; u_int64_t qval; }; typedef union nfs_quadconvert nfsquad_t; #endif /* * NFS Version 3 special file number. */ struct nfsv3_spec { u_int32_t specdata1; u_int32_t specdata2; }; typedef struct nfsv3_spec nfsv3spec; /* * File attributes and setable attributes. These structures cover both * NFS version 2 and the version 3 protocol. Note that the union is only * used so that one pointer can refer to both variants. These structures * go out on the wire and must be densely packed, so no quad data types * are used. (all fields are longs or u_longs or structures of same) * NB: You can't do sizeof(struct nfs_fattr), you must use the * NFSX_FATTR(v3) macro. */ struct nfs_fattr { u_int32_t fa_type; u_int32_t fa_mode; u_int32_t fa_nlink; u_int32_t fa_uid; u_int32_t fa_gid; union { struct { u_int32_t nfsv2fa_size; u_int32_t nfsv2fa_blocksize; u_int32_t nfsv2fa_rdev; u_int32_t nfsv2fa_blocks; u_int32_t nfsv2fa_fsid; u_int32_t nfsv2fa_fileid; nfstime2 nfsv2fa_atime; nfstime2 nfsv2fa_mtime; nfstime2 nfsv2fa_ctime; } fa_nfsv2; struct { nfsuint64 nfsv3fa_size; nfsuint64 nfsv3fa_used; nfsv3spec nfsv3fa_rdev; nfsuint64 nfsv3fa_fsid; nfsuint64 nfsv3fa_fileid; nfstime3 nfsv3fa_atime; nfstime3 nfsv3fa_mtime; nfstime3 nfsv3fa_ctime; } fa_nfsv3; } fa_un; }; /* and some ugly defines for accessing union components */ #define fa2_size fa_un.fa_nfsv2.nfsv2fa_size #define fa2_blocksize fa_un.fa_nfsv2.nfsv2fa_blocksize #define fa2_rdev fa_un.fa_nfsv2.nfsv2fa_rdev #define fa2_blocks fa_un.fa_nfsv2.nfsv2fa_blocks #define fa2_fsid fa_un.fa_nfsv2.nfsv2fa_fsid #define fa2_fileid fa_un.fa_nfsv2.nfsv2fa_fileid #define fa2_atime fa_un.fa_nfsv2.nfsv2fa_atime #define fa2_mtime fa_un.fa_nfsv2.nfsv2fa_mtime #define fa2_ctime fa_un.fa_nfsv2.nfsv2fa_ctime #define fa3_size fa_un.fa_nfsv3.nfsv3fa_size #define fa3_used fa_un.fa_nfsv3.nfsv3fa_used #define fa3_rdev fa_un.fa_nfsv3.nfsv3fa_rdev #define fa3_fsid fa_un.fa_nfsv3.nfsv3fa_fsid #define fa3_fileid fa_un.fa_nfsv3.nfsv3fa_fileid #define fa3_atime fa_un.fa_nfsv3.nfsv3fa_atime #define fa3_mtime fa_un.fa_nfsv3.nfsv3fa_mtime #define fa3_ctime fa_un.fa_nfsv3.nfsv3fa_ctime struct nfsv2_sattr { u_int32_t sa_mode; u_int32_t sa_uid; u_int32_t sa_gid; u_int32_t sa_size; nfstime2 sa_atime; nfstime2 sa_mtime; }; /* * NFS Version 3 sattr structure for the new node creation case. */ struct nfsv3_sattr { u_int32_t sa_modeset; u_int32_t sa_mode; u_int32_t sa_uidset; u_int32_t sa_uid; u_int32_t sa_gidset; u_int32_t sa_gid; u_int32_t sa_sizeset; u_int32_t sa_size; u_int32_t sa_atimetype; nfstime3 sa_atime; u_int32_t sa_mtimetype; nfstime3 sa_mtime; }; struct nfs_statfs { union { struct { u_int32_t nfsv2sf_tsize; u_int32_t nfsv2sf_bsize; u_int32_t nfsv2sf_blocks; u_int32_t nfsv2sf_bfree; u_int32_t nfsv2sf_bavail; } sf_nfsv2; struct { nfsuint64 nfsv3sf_tbytes; nfsuint64 nfsv3sf_fbytes; nfsuint64 nfsv3sf_abytes; nfsuint64 nfsv3sf_tfiles; nfsuint64 nfsv3sf_ffiles; nfsuint64 nfsv3sf_afiles; u_int32_t nfsv3sf_invarsec; } sf_nfsv3; } sf_un; }; #define sf_tsize sf_un.sf_nfsv2.nfsv2sf_tsize #define sf_bsize sf_un.sf_nfsv2.nfsv2sf_bsize #define sf_blocks sf_un.sf_nfsv2.nfsv2sf_blocks #define sf_bfree sf_un.sf_nfsv2.nfsv2sf_bfree #define sf_bavail sf_un.sf_nfsv2.nfsv2sf_bavail #define sf_tbytes sf_un.sf_nfsv3.nfsv3sf_tbytes #define sf_fbytes sf_un.sf_nfsv3.nfsv3sf_fbytes #define sf_abytes sf_un.sf_nfsv3.nfsv3sf_abytes #define sf_tfiles sf_un.sf_nfsv3.nfsv3sf_tfiles #define sf_ffiles sf_un.sf_nfsv3.nfsv3sf_ffiles #define sf_afiles sf_un.sf_nfsv3.nfsv3sf_afiles #define sf_invarsec sf_un.sf_nfsv3.nfsv3sf_invarsec struct nfsv3_fsinfo { u_int32_t fs_rtmax; u_int32_t fs_rtpref; u_int32_t fs_rtmult; u_int32_t fs_wtmax; u_int32_t fs_wtpref; u_int32_t fs_wtmult; u_int32_t fs_dtpref; nfsuint64 fs_maxfilesize; nfstime3 fs_timedelta; u_int32_t fs_properties; }; struct nfsv3_pathconf { u_int32_t pc_linkmax; u_int32_t pc_namemax; u_int32_t pc_notrunc; u_int32_t pc_chownrestricted; u_int32_t pc_caseinsensitive; u_int32_t pc_casepreserving; }; tcpdump-3.9.8/./config.sub0000755000026300017500000007413407756336165013504 0ustar mcrmcr#! /bin/sh # Configuration validation subroutine script. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, # 2000, 2001, 2002, 2003 Free Software Foundation, Inc. timestamp='2003-11-03' # This file is (in principle) common to ALL GNU software. # The presence of a machine in this file suggests that SOME GNU software # can handle that machine. It does not imply ALL GNU software can. # # This file is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, # Boston, MA 02111-1307, USA. # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # Please send patches to . Submit a context # diff and a properly formatted ChangeLog entry. # # Configuration subroutine to validate and canonicalize a configuration type. # Supply the specified configuration type as an argument. # If it is invalid, we print an error message on stderr and exit with code 1. # Otherwise, we print the canonical config type on stdout and succeed. # This file is supposed to be the same for all GNU packages # and recognize all the CPU types, system types and aliases # that are meaningful with *any* GNU software. # Each package is responsible for reporting which valid configurations # it does not support. The user should be able to distinguish # a failure to support a valid configuration from a meaningless # configuration. # The goal of this file is to map all the various variations of a given # machine specification into a single specification in the form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM # or in some cases, the newer four-part form: # CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM # It is wrong to echo any other type of specification. me=`echo "$0" | sed -e 's,.*/,,'` usage="\ Usage: $0 [OPTION] CPU-MFR-OPSYS $0 [OPTION] ALIAS Canonicalize a configuration name. Operation modes: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit Report bugs and patches to ." version="\ GNU config.sub ($timestamp) Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." help=" Try \`$me --help' for more information." # Parse command line while test $# -gt 0 ; do case $1 in --time-stamp | --time* | -t ) echo "$timestamp" ; exit 0 ;; --version | -v ) echo "$version" ; exit 0 ;; --help | --h* | -h ) echo "$usage"; exit 0 ;; -- ) # Stop option processing shift; break ;; - ) # Use stdin as input. break ;; -* ) echo "$me: invalid option $1$help" exit 1 ;; *local*) # First pass through any local machine types. echo $1 exit 0;; * ) break ;; esac done case $# in 0) echo "$me: missing argument$help" >&2 exit 1;; 1) ;; *) echo "$me: too many arguments$help" >&2 exit 1;; esac # Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any). # Here we must recognize all the valid KERNEL-OS combinations. maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` case $maybe_os in nto-qnx* | linux-gnu* | linux-dietlibc | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | \ kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | storm-chaos* | os2-emx* | rtmk-nova*) os=-$maybe_os basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` ;; *) basic_machine=`echo $1 | sed 's/-[^-]*$//'` if [ $basic_machine != $1 ] then os=`echo $1 | sed 's/.*-/-/'` else os=; fi ;; esac ### Let's recognize common machines as not being operating systems so ### that things like config.sub decstation-3100 work. We also ### recognize some manufacturers as not being operating systems, so we ### can provide default operating systems below. case $os in -sun*os*) # Prevent following clause from handling this invalid input. ;; -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \ -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \ -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \ -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ -apple | -axis) os= basic_machine=$1 ;; -sim | -cisco | -oki | -wec | -winbond) os= basic_machine=$1 ;; -scout) ;; -wrs) os=-vxworks basic_machine=$1 ;; -chorusos*) os=-chorusos basic_machine=$1 ;; -chorusrdb) os=-chorusrdb basic_machine=$1 ;; -hiux*) os=-hiuxwe2 ;; -sco5) os=-sco3.2v5 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco4) os=-sco3.2v4 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco3.2.[4-9]*) os=`echo $os | sed -e 's/sco3.2./sco3.2v/'` basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco3.2v[4-9]*) # Don't forget version if it is 3.2v4 or newer. basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco*) os=-sco3.2v2 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -udk*) basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -isc) os=-isc2.2 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -clix*) basic_machine=clipper-intergraph ;; -isc*) basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -lynx*) os=-lynxos ;; -ptx*) basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'` ;; -windowsnt*) os=`echo $os | sed -e 's/windowsnt/winnt/'` ;; -psos*) os=-psos ;; -mint | -mint[0-9]*) basic_machine=m68k-atari os=-mint ;; esac # Decode aliases for certain CPU-COMPANY combinations. case $basic_machine in # Recognize the basic CPU types without company name. # Some are omitted here because they have special meanings below. 1750a | 580 \ | a29k \ | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ | am33_2.0 \ | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr \ | c4x | clipper \ | d10v | d30v | dlx | dsp16xx \ | fr30 | frv \ | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ | i370 | i860 | i960 | ia64 \ | ip2k | iq2000 \ | m32r | m68000 | m68k | m88k | mcore \ | mips | mipsbe | mipseb | mipsel | mipsle \ | mips16 \ | mips64 | mips64el \ | mips64vr | mips64vrel \ | mips64orion | mips64orionel \ | mips64vr4100 | mips64vr4100el \ | mips64vr4300 | mips64vr4300el \ | mips64vr5000 | mips64vr5000el \ | mipsisa32 | mipsisa32el \ | mipsisa32r2 | mipsisa32r2el \ | mipsisa64 | mipsisa64el \ | mipsisa64r2 | mipsisa64r2el \ | mipsisa64sb1 | mipsisa64sb1el \ | mipsisa64sr71k | mipsisa64sr71kel \ | mipstx39 | mipstx39el \ | mn10200 | mn10300 \ | msp430 \ | ns16k | ns32k \ | openrisc | or32 \ | pdp10 | pdp11 | pj | pjl \ | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \ | pyramid \ | sh | sh[1234] | sh[23]e | sh[34]eb | shbe | shle | sh[1234]le | sh3ele \ | sh64 | sh64le \ | sparc | sparc64 | sparc86x | sparclet | sparclite | sparcv9 | sparcv9b \ | strongarm \ | tahoe | thumb | tic4x | tic80 | tron \ | v850 | v850e \ | we32k \ | x86 | xscale | xstormy16 | xtensa \ | z8k) basic_machine=$basic_machine-unknown ;; m6811 | m68hc11 | m6812 | m68hc12) # Motorola 68HC11/12. basic_machine=$basic_machine-unknown os=-none ;; m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k) ;; # We use `pc' rather than `unknown' # because (1) that's what they normally are, and # (2) the word "unknown" tends to confuse beginning users. i*86 | x86_64) basic_machine=$basic_machine-pc ;; # Object if more than one company name word. *-*-*) echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 exit 1 ;; # Recognize the basic CPU types with company name. 580-* \ | a29k-* \ | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \ | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ | avr-* \ | bs2000-* \ | c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \ | clipper-* | cydra-* \ | d10v-* | d30v-* | dlx-* \ | elxsi-* \ | f30[01]-* | f700-* | fr30-* | frv-* | fx80-* \ | h8300-* | h8500-* \ | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ | i*86-* | i860-* | i960-* | ia64-* \ | ip2k-* | iq2000-* \ | m32r-* \ | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ | m88110-* | m88k-* | mcore-* \ | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ | mips16-* \ | mips64-* | mips64el-* \ | mips64vr-* | mips64vrel-* \ | mips64orion-* | mips64orionel-* \ | mips64vr4100-* | mips64vr4100el-* \ | mips64vr4300-* | mips64vr4300el-* \ | mips64vr5000-* | mips64vr5000el-* \ | mipsisa32-* | mipsisa32el-* \ | mipsisa32r2-* | mipsisa32r2el-* \ | mipsisa64-* | mipsisa64el-* \ | mipsisa64r2-* | mipsisa64r2el-* \ | mipsisa64sb1-* | mipsisa64sb1el-* \ | mipsisa64sr71k-* | mipsisa64sr71kel-* \ | mipstx39-* | mipstx39el-* \ | msp430-* \ | none-* | np1-* | nv1-* | ns16k-* | ns32k-* \ | orion-* \ | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \ | pyramid-* \ | romp-* | rs6000-* \ | sh-* | sh[1234]-* | sh[23]e-* | sh[34]eb-* | shbe-* \ | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ | sparc-* | sparc64-* | sparc86x-* | sparclet-* | sparclite-* \ | sparcv9-* | sparcv9b-* | strongarm-* | sv1-* | sx?-* \ | tahoe-* | thumb-* \ | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ | tron-* \ | v850-* | v850e-* | vax-* \ | we32k-* \ | x86-* | x86_64-* | xps100-* | xscale-* | xstormy16-* \ | xtensa-* \ | ymp-* \ | z8k-*) ;; # Recognize the various machine names and aliases which stand # for a CPU type and a company and sometimes even an OS. 386bsd) basic_machine=i386-unknown os=-bsd ;; 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) basic_machine=m68000-att ;; 3b*) basic_machine=we32k-att ;; a29khif) basic_machine=a29k-amd os=-udi ;; adobe68k) basic_machine=m68010-adobe os=-scout ;; alliant | fx80) basic_machine=fx80-alliant ;; altos | altos3068) basic_machine=m68k-altos ;; am29k) basic_machine=a29k-none os=-bsd ;; amd64) basic_machine=x86_64-pc ;; amdahl) basic_machine=580-amdahl os=-sysv ;; amiga | amiga-*) basic_machine=m68k-unknown ;; amigaos | amigados) basic_machine=m68k-unknown os=-amigaos ;; amigaunix | amix) basic_machine=m68k-unknown os=-sysv4 ;; apollo68) basic_machine=m68k-apollo os=-sysv ;; apollo68bsd) basic_machine=m68k-apollo os=-bsd ;; aux) basic_machine=m68k-apple os=-aux ;; balance) basic_machine=ns32k-sequent os=-dynix ;; c90) basic_machine=c90-cray os=-unicos ;; convex-c1) basic_machine=c1-convex os=-bsd ;; convex-c2) basic_machine=c2-convex os=-bsd ;; convex-c32) basic_machine=c32-convex os=-bsd ;; convex-c34) basic_machine=c34-convex os=-bsd ;; convex-c38) basic_machine=c38-convex os=-bsd ;; cray | j90) basic_machine=j90-cray os=-unicos ;; crds | unos) basic_machine=m68k-crds ;; cris | cris-* | etrax*) basic_machine=cris-axis ;; da30 | da30-*) basic_machine=m68k-da30 ;; decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn) basic_machine=mips-dec ;; decsystem10* | dec10*) basic_machine=pdp10-dec os=-tops10 ;; decsystem20* | dec20*) basic_machine=pdp10-dec os=-tops20 ;; delta | 3300 | motorola-3300 | motorola-delta \ | 3300-motorola | delta-motorola) basic_machine=m68k-motorola ;; delta88) basic_machine=m88k-motorola os=-sysv3 ;; dpx20 | dpx20-*) basic_machine=rs6000-bull os=-bosx ;; dpx2* | dpx2*-bull) basic_machine=m68k-bull os=-sysv3 ;; ebmon29k) basic_machine=a29k-amd os=-ebmon ;; elxsi) basic_machine=elxsi-elxsi os=-bsd ;; encore | umax | mmax) basic_machine=ns32k-encore ;; es1800 | OSE68k | ose68k | ose | OSE) basic_machine=m68k-ericsson os=-ose ;; fx2800) basic_machine=i860-alliant ;; genix) basic_machine=ns32k-ns ;; gmicro) basic_machine=tron-gmicro os=-sysv ;; go32) basic_machine=i386-pc os=-go32 ;; h3050r* | hiux*) basic_machine=hppa1.1-hitachi os=-hiuxwe2 ;; h8300hms) basic_machine=h8300-hitachi os=-hms ;; h8300xray) basic_machine=h8300-hitachi os=-xray ;; h8500hms) basic_machine=h8500-hitachi os=-hms ;; harris) basic_machine=m88k-harris os=-sysv3 ;; hp300-*) basic_machine=m68k-hp ;; hp300bsd) basic_machine=m68k-hp os=-bsd ;; hp300hpux) basic_machine=m68k-hp os=-hpux ;; hp3k9[0-9][0-9] | hp9[0-9][0-9]) basic_machine=hppa1.0-hp ;; hp9k2[0-9][0-9] | hp9k31[0-9]) basic_machine=m68000-hp ;; hp9k3[2-9][0-9]) basic_machine=m68k-hp ;; hp9k6[0-9][0-9] | hp6[0-9][0-9]) basic_machine=hppa1.0-hp ;; hp9k7[0-79][0-9] | hp7[0-79][0-9]) basic_machine=hppa1.1-hp ;; hp9k78[0-9] | hp78[0-9]) # FIXME: really hppa2.0-hp basic_machine=hppa1.1-hp ;; hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893) # FIXME: really hppa2.0-hp basic_machine=hppa1.1-hp ;; hp9k8[0-9][13679] | hp8[0-9][13679]) basic_machine=hppa1.1-hp ;; hp9k8[0-9][0-9] | hp8[0-9][0-9]) basic_machine=hppa1.0-hp ;; hppa-next) os=-nextstep3 ;; hppaosf) basic_machine=hppa1.1-hp os=-osf ;; hppro) basic_machine=hppa1.1-hp os=-proelf ;; i370-ibm* | ibm*) basic_machine=i370-ibm ;; # I'm not sure what "Sysv32" means. Should this be sysv3.2? i*86v32) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv32 ;; i*86v4*) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv4 ;; i*86v) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv ;; i*86sol2) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-solaris2 ;; i386mach) basic_machine=i386-mach os=-mach ;; i386-vsta | vsta) basic_machine=i386-unknown os=-vsta ;; iris | iris4d) basic_machine=mips-sgi case $os in -irix*) ;; *) os=-irix4 ;; esac ;; isi68 | isi) basic_machine=m68k-isi os=-sysv ;; m88k-omron*) basic_machine=m88k-omron ;; magnum | m3230) basic_machine=mips-mips os=-sysv ;; merlin) basic_machine=ns32k-utek os=-sysv ;; mingw32) basic_machine=i386-pc os=-mingw32 ;; miniframe) basic_machine=m68000-convergent ;; *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*) basic_machine=m68k-atari os=-mint ;; mips3*-*) basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'` ;; mips3*) basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown ;; mmix*) basic_machine=mmix-knuth os=-mmixware ;; monitor) basic_machine=m68k-rom68k os=-coff ;; morphos) basic_machine=powerpc-unknown os=-morphos ;; msdos) basic_machine=i386-pc os=-msdos ;; mvs) basic_machine=i370-ibm os=-mvs ;; ncr3000) basic_machine=i486-ncr os=-sysv4 ;; netbsd386) basic_machine=i386-unknown os=-netbsd ;; netwinder) basic_machine=armv4l-rebel os=-linux ;; news | news700 | news800 | news900) basic_machine=m68k-sony os=-newsos ;; news1000) basic_machine=m68030-sony os=-newsos ;; news-3600 | risc-news) basic_machine=mips-sony os=-newsos ;; necv70) basic_machine=v70-nec os=-sysv ;; next | m*-next ) basic_machine=m68k-next case $os in -nextstep* ) ;; -ns2*) os=-nextstep2 ;; *) os=-nextstep3 ;; esac ;; nh3000) basic_machine=m68k-harris os=-cxux ;; nh[45]000) basic_machine=m88k-harris os=-cxux ;; nindy960) basic_machine=i960-intel os=-nindy ;; mon960) basic_machine=i960-intel os=-mon960 ;; nonstopux) basic_machine=mips-compaq os=-nonstopux ;; np1) basic_machine=np1-gould ;; nv1) basic_machine=nv1-cray os=-unicosmp ;; nsr-tandem) basic_machine=nsr-tandem ;; op50n-* | op60c-*) basic_machine=hppa1.1-oki os=-proelf ;; or32 | or32-*) basic_machine=or32-unknown os=-coff ;; os400) basic_machine=powerpc-ibm os=-os400 ;; OSE68000 | ose68000) basic_machine=m68000-ericsson os=-ose ;; os68k) basic_machine=m68k-none os=-os68k ;; pa-hitachi) basic_machine=hppa1.1-hitachi os=-hiuxwe2 ;; paragon) basic_machine=i860-intel os=-osf ;; pbd) basic_machine=sparc-tti ;; pbb) basic_machine=m68k-tti ;; pc532 | pc532-*) basic_machine=ns32k-pc532 ;; pentium | p5 | k5 | k6 | nexgen | viac3) basic_machine=i586-pc ;; pentiumpro | p6 | 6x86 | athlon | athlon_*) basic_machine=i686-pc ;; pentiumii | pentium2 | pentiumiii | pentium3) basic_machine=i686-pc ;; pentium4) basic_machine=i786-pc ;; pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*) basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentiumpro-* | p6-* | 6x86-* | athlon-*) basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*) basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentium4-*) basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pn) basic_machine=pn-gould ;; power) basic_machine=power-ibm ;; ppc) basic_machine=powerpc-unknown ;; ppc-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppcle | powerpclittle | ppc-le | powerpc-little) basic_machine=powerpcle-unknown ;; ppcle-* | powerpclittle-*) basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppc64) basic_machine=powerpc64-unknown ;; ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppc64le | powerpc64little | ppc64-le | powerpc64-little) basic_machine=powerpc64le-unknown ;; ppc64le-* | powerpc64little-*) basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ps2) basic_machine=i386-ibm ;; pw32) basic_machine=i586-unknown os=-pw32 ;; rom68k) basic_machine=m68k-rom68k os=-coff ;; rm[46]00) basic_machine=mips-siemens ;; rtpc | rtpc-*) basic_machine=romp-ibm ;; s390 | s390-*) basic_machine=s390-ibm ;; s390x | s390x-*) basic_machine=s390x-ibm ;; sa29200) basic_machine=a29k-amd os=-udi ;; sb1) basic_machine=mipsisa64sb1-unknown ;; sb1el) basic_machine=mipsisa64sb1el-unknown ;; sei) basic_machine=mips-sei os=-seiux ;; sequent) basic_machine=i386-sequent ;; sh) basic_machine=sh-hitachi os=-hms ;; sh64) basic_machine=sh64-unknown ;; sparclite-wrs | simso-wrs) basic_machine=sparclite-wrs os=-vxworks ;; sps7) basic_machine=m68k-bull os=-sysv2 ;; spur) basic_machine=spur-unknown ;; st2000) basic_machine=m68k-tandem ;; stratus) basic_machine=i860-stratus os=-sysv4 ;; sun2) basic_machine=m68000-sun ;; sun2os3) basic_machine=m68000-sun os=-sunos3 ;; sun2os4) basic_machine=m68000-sun os=-sunos4 ;; sun3os3) basic_machine=m68k-sun os=-sunos3 ;; sun3os4) basic_machine=m68k-sun os=-sunos4 ;; sun4os3) basic_machine=sparc-sun os=-sunos3 ;; sun4os4) basic_machine=sparc-sun os=-sunos4 ;; sun4sol2) basic_machine=sparc-sun os=-solaris2 ;; sun3 | sun3-*) basic_machine=m68k-sun ;; sun4) basic_machine=sparc-sun ;; sun386 | sun386i | roadrunner) basic_machine=i386-sun ;; sv1) basic_machine=sv1-cray os=-unicos ;; symmetry) basic_machine=i386-sequent os=-dynix ;; t3e) basic_machine=alphaev5-cray os=-unicos ;; t90) basic_machine=t90-cray os=-unicos ;; tic54x | c54x*) basic_machine=tic54x-unknown os=-coff ;; tic55x | c55x*) basic_machine=tic55x-unknown os=-coff ;; tic6x | c6x*) basic_machine=tic6x-unknown os=-coff ;; tx39) basic_machine=mipstx39-unknown ;; tx39el) basic_machine=mipstx39el-unknown ;; toad1) basic_machine=pdp10-xkl os=-tops20 ;; tower | tower-32) basic_machine=m68k-ncr ;; tpf) basic_machine=s390x-ibm os=-tpf ;; udi29k) basic_machine=a29k-amd os=-udi ;; ultra3) basic_machine=a29k-nyu os=-sym1 ;; v810 | necv810) basic_machine=v810-nec os=-none ;; vaxv) basic_machine=vax-dec os=-sysv ;; vms) basic_machine=vax-dec os=-vms ;; vpp*|vx|vx-*) basic_machine=f301-fujitsu ;; vxworks960) basic_machine=i960-wrs os=-vxworks ;; vxworks68) basic_machine=m68k-wrs os=-vxworks ;; vxworks29k) basic_machine=a29k-wrs os=-vxworks ;; w65*) basic_machine=w65-wdc os=-none ;; w89k-*) basic_machine=hppa1.1-winbond os=-proelf ;; xps | xps100) basic_machine=xps100-honeywell ;; ymp) basic_machine=ymp-cray os=-unicos ;; z8k-*-coff) basic_machine=z8k-unknown os=-sim ;; none) basic_machine=none-none os=-none ;; # Here we handle the default manufacturer of certain CPU types. It is in # some cases the only manufacturer, in others, it is the most popular. w89k) basic_machine=hppa1.1-winbond ;; op50n) basic_machine=hppa1.1-oki ;; op60c) basic_machine=hppa1.1-oki ;; romp) basic_machine=romp-ibm ;; rs6000) basic_machine=rs6000-ibm ;; vax) basic_machine=vax-dec ;; pdp10) # there are many clones, so DEC is not a safe bet basic_machine=pdp10-unknown ;; pdp11) basic_machine=pdp11-dec ;; we32k) basic_machine=we32k-att ;; sh3 | sh4 | sh[34]eb | sh[1234]le | sh[23]ele) basic_machine=sh-unknown ;; sh64) basic_machine=sh64-unknown ;; sparc | sparcv9 | sparcv9b) basic_machine=sparc-sun ;; cydra) basic_machine=cydra-cydrome ;; orion) basic_machine=orion-highlevel ;; orion105) basic_machine=clipper-highlevel ;; mac | mpw | mac-mpw) basic_machine=m68k-apple ;; pmac | pmac-mpw) basic_machine=powerpc-apple ;; *-unknown) # Make sure to match an already-canonicalized machine name. ;; *) echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 exit 1 ;; esac # Here we canonicalize certain aliases for manufacturers. case $basic_machine in *-digital*) basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'` ;; *-commodore*) basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'` ;; *) ;; esac # Decode manufacturer-specific aliases for certain operating systems. if [ x"$os" != x"" ] then case $os in # First match some system type aliases # that might get confused with valid system types. # -solaris* is a basic system type, with this one exception. -solaris1 | -solaris1.*) os=`echo $os | sed -e 's|solaris1|sunos4|'` ;; -solaris) os=-solaris2 ;; -svr4*) os=-sysv4 ;; -unixware*) os=-sysv4.2uw ;; -gnu/linux*) os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'` ;; # First accept the basic system types. # The portable systems comes first. # Each alternative MUST END IN A *, to match a version number. # -sysv* is not here because it comes later, after sysvr4. -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ | -*vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[34]*\ | -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \ | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ | -aos* \ | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ | -hiux* | -386bsd* | -knetbsd* | -netbsd* | -openbsd* | -kfreebsd* | -freebsd* | -riscix* \ | -lynxos* | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ | -chorusos* | -chorusrdb* \ | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ | -mingw32* | -linux-gnu* | -linux-uclibc* | -uxpv* | -beos* | -mpeix* | -udk* \ | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly*) # Remember, each alternative MUST END IN *, to match a version number. ;; -qnx*) case $basic_machine in x86-* | i*86-*) ;; *) os=-nto$os ;; esac ;; -nto-qnx*) ;; -nto*) os=`echo $os | sed -e 's|nto|nto-qnx|'` ;; -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \ | -windows* | -osx | -abug | -netware* | -os9* | -beos* \ | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*) ;; -mac*) os=`echo $os | sed -e 's|mac|macos|'` ;; -linux-dietlibc) os=-linux-dietlibc ;; -linux*) os=`echo $os | sed -e 's|linux|linux-gnu|'` ;; -sunos5*) os=`echo $os | sed -e 's|sunos5|solaris2|'` ;; -sunos6*) os=`echo $os | sed -e 's|sunos6|solaris3|'` ;; -opened*) os=-openedition ;; -os400*) os=-os400 ;; -wince*) os=-wince ;; -osfrose*) os=-osfrose ;; -osf*) os=-osf ;; -utek*) os=-bsd ;; -dynix*) os=-bsd ;; -acis*) os=-aos ;; -atheos*) os=-atheos ;; -386bsd) os=-bsd ;; -ctix* | -uts*) os=-sysv ;; -nova*) os=-rtmk-nova ;; -ns2 ) os=-nextstep2 ;; -nsk*) os=-nsk ;; # Preserve the version number of sinix5. -sinix5.*) os=`echo $os | sed -e 's|sinix|sysv|'` ;; -sinix*) os=-sysv4 ;; -tpf*) os=-tpf ;; -triton*) os=-sysv3 ;; -oss*) os=-sysv3 ;; -svr4) os=-sysv4 ;; -svr3) os=-sysv3 ;; -sysvr4) os=-sysv4 ;; # This must come after -sysvr4. -sysv*) ;; -ose*) os=-ose ;; -es1800*) os=-ose ;; -xenix) os=-xenix ;; -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) os=-mint ;; -aros*) os=-aros ;; -kaos*) os=-kaos ;; -none) ;; *) # Get rid of the `-' at the beginning of $os. os=`echo $os | sed 's/[^-]*-//'` echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2 exit 1 ;; esac else # Here we handle the default operating systems that come with various machines. # The value should be what the vendor currently ships out the door with their # machine or put another way, the most popular os provided with the machine. # Note that if you're going to try to match "-MANUFACTURER" here (say, # "-sun"), then you have to tell the case statement up towards the top # that MANUFACTURER isn't an operating system. Otherwise, code above # will signal an error saying that MANUFACTURER isn't an operating # system, and we'll never get to this point. case $basic_machine in *-acorn) os=-riscix1.2 ;; arm*-rebel) os=-linux ;; arm*-semi) os=-aout ;; c4x-* | tic4x-*) os=-coff ;; # This must come before the *-dec entry. pdp10-*) os=-tops20 ;; pdp11-*) os=-none ;; *-dec | vax-*) os=-ultrix4.2 ;; m68*-apollo) os=-domain ;; i386-sun) os=-sunos4.0.2 ;; m68000-sun) os=-sunos3 # This also exists in the configure program, but was not the # default. # os=-sunos4 ;; m68*-cisco) os=-aout ;; mips*-cisco) os=-elf ;; mips*-*) os=-elf ;; or32-*) os=-coff ;; *-tti) # must be before sparc entry or we get the wrong os. os=-sysv3 ;; sparc-* | *-sun) os=-sunos4.1.1 ;; *-be) os=-beos ;; *-ibm) os=-aix ;; *-wec) os=-proelf ;; *-winbond) os=-proelf ;; *-oki) os=-proelf ;; *-hp) os=-hpux ;; *-hitachi) os=-hiux ;; i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent) os=-sysv ;; *-cbm) os=-amigaos ;; *-dg) os=-dgux ;; *-dolphin) os=-sysv3 ;; m68k-ccur) os=-rtu ;; m88k-omron*) os=-luna ;; *-next ) os=-nextstep ;; *-sequent) os=-ptx ;; *-crds) os=-unos ;; *-ns) os=-genix ;; i370-*) os=-mvs ;; *-next) os=-nextstep3 ;; *-gould) os=-sysv ;; *-highlevel) os=-bsd ;; *-encore) os=-bsd ;; *-sgi) os=-irix ;; *-siemens) os=-sysv4 ;; *-masscomp) os=-rtu ;; f30[01]-fujitsu | f700-fujitsu) os=-uxpv ;; *-rom68k) os=-coff ;; *-*bug) os=-coff ;; *-apple) os=-macos ;; *-atari*) os=-mint ;; *) os=-none ;; esac fi # Here we handle the case where we know the os, and the CPU type, but not the # manufacturer. We pick the logical manufacturer. vendor=unknown case $basic_machine in *-unknown) case $os in -riscix*) vendor=acorn ;; -sunos*) vendor=sun ;; -aix*) vendor=ibm ;; -beos*) vendor=be ;; -hpux*) vendor=hp ;; -mpeix*) vendor=hp ;; -hiux*) vendor=hitachi ;; -unos*) vendor=crds ;; -dgux*) vendor=dg ;; -luna*) vendor=omron ;; -genix*) vendor=ns ;; -mvs* | -opened*) vendor=ibm ;; -os400*) vendor=ibm ;; -ptx*) vendor=sequent ;; -tpf*) vendor=ibm ;; -vxsim* | -vxworks* | -windiss*) vendor=wrs ;; -aux*) vendor=apple ;; -hms*) vendor=hitachi ;; -mpw* | -macos*) vendor=apple ;; -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) vendor=atari ;; -vos*) vendor=stratus ;; esac basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"` ;; esac echo $basic_machine$os exit 0 # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" # End: tcpdump-3.9.8/./ip6.h0000644000026300017500000001650710231424465012347 0ustar mcrmcr/* @(#) $Header: /tcpdump/master/tcpdump/ip6.h,v 1.6.4.1 2005/04/20 10:04:37 guy Exp $ (LBL) */ /* $NetBSD: ip6.h,v 1.9 2000/07/13 05:34:21 itojun Exp $ */ /* $KAME: ip6.h,v 1.9 2000/07/02 21:01:32 itojun Exp $ */ /* * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project. * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. Neither the name of the project nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ /* * Copyright (c) 1982, 1986, 1993 * The Regents of the University of California. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. All advertising materials mentioning features or use of this software * must display the following acknowledgement: * This product includes software developed by the University of * California, Berkeley and its contributors. * 4. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * * @(#)ip.h 8.1 (Berkeley) 6/10/93 */ #ifndef _NETINET_IP6_H_ #define _NETINET_IP6_H_ /* * Definition for internet protocol version 6. * RFC 2460 */ struct ip6_hdr { union { struct ip6_hdrctl { u_int32_t ip6_un1_flow; /* 20 bits of flow-ID */ u_int16_t ip6_un1_plen; /* payload length */ u_int8_t ip6_un1_nxt; /* next header */ u_int8_t ip6_un1_hlim; /* hop limit */ } ip6_un1; u_int8_t ip6_un2_vfc; /* 4 bits version, top 4 bits class */ } ip6_ctlun; struct in6_addr ip6_src; /* source address */ struct in6_addr ip6_dst; /* destination address */ }; #define ip6_vfc ip6_ctlun.ip6_un2_vfc #define ip6_flow ip6_ctlun.ip6_un1.ip6_un1_flow #define ip6_plen ip6_ctlun.ip6_un1.ip6_un1_plen #define ip6_nxt ip6_ctlun.ip6_un1.ip6_un1_nxt #define ip6_hlim ip6_ctlun.ip6_un1.ip6_un1_hlim #define ip6_hops ip6_ctlun.ip6_un1.ip6_un1_hlim /* in network endian */ #define IPV6_FLOWINFO_MASK ((u_int32_t)htonl(0x0fffffff)) /* flow info (28 bits) */ #define IPV6_FLOWLABEL_MASK ((u_int32_t)htonl(0x000fffff)) /* flow label (20 bits) */ #if 1 /* ECN bits proposed by Sally Floyd */ #define IP6TOS_CE 0x01 /* congestion experienced */ #define IP6TOS_ECT 0x02 /* ECN-capable transport */ #endif /* * Extension Headers */ struct ip6_ext { u_char ip6e_nxt; u_char ip6e_len; }; /* Hop-by-Hop options header */ /* XXX should we pad it to force alignment on an 8-byte boundary? */ struct ip6_hbh { u_int8_t ip6h_nxt; /* next header */ u_int8_t ip6h_len; /* length in units of 8 octets */ /* followed by options */ }; /* Destination options header */ /* XXX should we pad it to force alignment on an 8-byte boundary? */ struct ip6_dest { u_int8_t ip6d_nxt; /* next header */ u_int8_t ip6d_len; /* length in units of 8 octets */ /* followed by options */ }; /* Option types and related macros */ #define IP6OPT_PAD1 0x00 /* 00 0 00000 */ #define IP6OPT_PADN 0x01 /* 00 0 00001 */ #define IP6OPT_JUMBO 0xC2 /* 11 0 00010 = 194 */ #define IP6OPT_JUMBO_LEN 6 #define IP6OPT_ROUTER_ALERT 0x05 /* 00 0 00101 */ #define IP6OPT_RTALERT_LEN 4 #define IP6OPT_RTALERT_MLD 0 /* Datagram contains an MLD message */ #define IP6OPT_RTALERT_RSVP 1 /* Datagram contains an RSVP message */ #define IP6OPT_RTALERT_ACTNET 2 /* contains an Active Networks msg */ #define IP6OPT_MINLEN 2 #define IP6OPT_BINDING_UPDATE 0xc6 /* 11 0 00110 */ #define IP6OPT_BINDING_ACK 0x07 /* 00 0 00111 */ #define IP6OPT_BINDING_REQ 0x08 /* 00 0 01000 */ #define IP6OPT_HOME_ADDRESS 0xc9 /* 11 0 01001 */ #define IP6OPT_EID 0x8a /* 10 0 01010 */ #define IP6OPT_TYPE(o) ((o) & 0xC0) #define IP6OPT_TYPE_SKIP 0x00 #define IP6OPT_TYPE_DISCARD 0x40 #define IP6OPT_TYPE_FORCEICMP 0x80 #define IP6OPT_TYPE_ICMP 0xC0 #define IP6OPT_MUTABLE 0x20 /* Routing header */ struct ip6_rthdr { u_int8_t ip6r_nxt; /* next header */ u_int8_t ip6r_len; /* length in units of 8 octets */ u_int8_t ip6r_type; /* routing type */ u_int8_t ip6r_segleft; /* segments left */ /* followed by routing type specific data */ }; /* Type 0 Routing header */ struct ip6_rthdr0 { u_int8_t ip6r0_nxt; /* next header */ u_int8_t ip6r0_len; /* length in units of 8 octets */ u_int8_t ip6r0_type; /* always zero */ u_int8_t ip6r0_segleft; /* segments left */ u_int8_t ip6r0_reserved; /* reserved field */ u_int8_t ip6r0_slmap[3]; /* strict/loose bit map */ struct in6_addr ip6r0_addr[1]; /* up to 23 addresses */ }; /* Fragment header */ struct ip6_frag { u_int8_t ip6f_nxt; /* next header */ u_int8_t ip6f_reserved; /* reserved field */ u_int16_t ip6f_offlg; /* offset, reserved, and flag */ u_int32_t ip6f_ident; /* identification */ }; #define IP6F_OFF_MASK 0xfff8 /* mask out offset from ip6f_offlg */ #define IP6F_RESERVED_MASK 0x0006 /* reserved bits in ip6f_offlg */ #define IP6F_MORE_FRAG 0x0001 /* more-fragments flag */ #endif /* not _NETINET_IP6_H_ */ tcpdump-3.9.8/./rpc_msg.h0000644000026300017500000000643710234003647013302 0ustar mcrmcr/* @(#) $Header: /tcpdump/master/tcpdump/rpc_msg.h,v 1.1.2.1 2005/04/27 21:44:07 guy Exp $ (LBL) */ /* * Sun RPC is a product of Sun Microsystems, Inc. and is provided for * unrestricted use provided that this legend is included on all tape * media and as a part of the software program in whole or part. Users * may copy or modify Sun RPC without charge, but are not authorized * to license or distribute it to anyone else except as part of a product or * program developed by the user. * * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE * WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE. * * Sun RPC is provided with no support and without any obligation on the * part of Sun Microsystems, Inc. to assist in its use, correction, * modification or enhancement. * * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC * OR ANY PART THEREOF. * * In no event will Sun Microsystems, Inc. be liable for any lost revenue * or profits or other special, indirect and consequential damages, even if * Sun has been advised of the possibility of such damages. * * Sun Microsystems, Inc. * 2550 Garcia Avenue * Mountain View, California 94043 * * from: @(#)rpc_msg.h 1.7 86/07/16 SMI * from: @(#)rpc_msg.h 2.1 88/07/29 4.0 RPCSRC * $FreeBSD: src/include/rpc/rpc_msg.h,v 1.11.2.1 1999/08/29 14:39:07 peter Exp $ */ /* * rpc_msg.h * rpc message definition * * Copyright (C) 1984, Sun Microsystems, Inc. */ #define SUNRPC_MSG_VERSION ((u_int32_t) 2) /* * Bottom up definition of an rpc message. * NOTE: call and reply use the same overall stuct but * different parts of unions within it. */ enum sunrpc_msg_type { SUNRPC_CALL=0, SUNRPC_REPLY=1 }; enum sunrpc_reply_stat { SUNRPC_MSG_ACCEPTED=0, SUNRPC_MSG_DENIED=1 }; enum sunrpc_accept_stat { SUNRPC_SUCCESS=0, SUNRPC_PROG_UNAVAIL=1, SUNRPC_PROG_MISMATCH=2, SUNRPC_PROC_UNAVAIL=3, SUNRPC_GARBAGE_ARGS=4, SUNRPC_SYSTEM_ERR=5 }; enum sunrpc_reject_stat { SUNRPC_RPC_MISMATCH=0, SUNRPC_AUTH_ERROR=1 }; /* * Reply part of an rpc exchange */ /* * Reply to an rpc request that was rejected by the server. */ struct sunrpc_rejected_reply { u_int32_t rj_stat; /* enum reject_stat */ union { struct { u_int32_t low; u_int32_t high; } RJ_versions; u_int32_t RJ_why; /* enum auth_stat - why authentication did not work */ } ru; #define rj_vers ru.RJ_versions #define rj_why ru.RJ_why }; /* * Body of a reply to an rpc request. */ struct sunrpc_reply_body { u_int32_t rp_stat; /* enum reply_stat */ struct sunrpc_rejected_reply rp_reject; /* if rejected */ }; /* * Body of an rpc request call. */ struct sunrpc_call_body { u_int32_t cb_rpcvers; /* must be equal to two */ u_int32_t cb_prog; u_int32_t cb_vers; u_int32_t cb_proc; struct sunrpc_opaque_auth cb_cred; /* followed by opaque verifier */ }; /* * The rpc message */ struct sunrpc_msg { u_int32_t rm_xid; u_int32_t rm_direction; /* enum msg_type */ union { struct sunrpc_call_body RM_cmb; struct sunrpc_reply_body RM_rmb; } ru; #define rm_call ru.RM_cmb #define rm_reply ru.RM_rmb }; #define acpted_rply ru.RM_rmb.ru.RP_ar #define rjcted_rply ru.RM_rmb.ru.RP_dr tcpdump-3.9.8/./sctpHeader.h0000644000026300017500000001653407575562703013752 0ustar mcrmcr/* @(#) $Header: /tcpdump/master/tcpdump/sctpHeader.h,v 1.6 2002/12/11 07:14:11 guy Exp $ (LBL) */ /* SCTP reference Implementation Copyright (C) 1999 Cisco And Motorola * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * 4. Neither the name of Cisco nor of Motorola may be used * to endorse or promote products derived from this software without * specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * * This file is part of the SCTP reference Implementation * * * Please send any bug reports or fixes you make to one of the following email * addresses: * * rstewar1@email.mot.com * kmorneau@cisco.com * qxie1@email.mot.com * * Any bugs reported given to us we will try to fix... any fixes shared will * be incorperated into the next SCTP release. */ #ifndef __sctpHeader_h__ #define __sctpHeader_h__ #include #ifdef __cplusplus extern "C" { #endif /* the sctp common header */ #ifdef TRU64 #define _64BITS 1 #endif struct sctpHeader{ u_int16_t source; u_int16_t destination; u_int32_t verificationTag; u_int32_t adler32; }; /* various descriptor parsers */ struct sctpChunkDesc{ u_int8_t chunkID; u_int8_t chunkFlg; u_int16_t chunkLength; }; struct sctpParamDesc{ u_int16_t paramType; u_int16_t paramLength; }; struct sctpRelChunkDesc{ struct sctpChunkDesc chk; u_int32_t serialNumber; }; struct sctpVendorSpecificParam { struct sctpParamDesc p; /* type must be 0xfffe */ u_int32_t vendorId; /* vendor ID from RFC 1700 */ u_int16_t vendorSpecificType; u_int16_t vendorSpecificLen; }; /* Structures for the control parts */ /* Sctp association init request/ack */ /* this is used for init ack, too */ struct sctpInitiation{ u_int32_t initTag; /* tag of mine */ u_int32_t rcvWindowCredit; /* rwnd */ u_int16_t NumPreopenStreams; /* OS */ u_int16_t MaxInboundStreams; /* MIS */ u_int32_t initialTSN; /* optional param's follow in sctpParamDesc form */ }; struct sctpV4IpAddress{ struct sctpParamDesc p; /* type is set to SCTP_IPV4_PARAM_TYPE, len=10 */ u_int32_t ipAddress; }; struct sctpV6IpAddress{ struct sctpParamDesc p; /* type is set to SCTP_IPV6_PARAM_TYPE, len=22 */ u_int8_t ipAddress[16]; }; struct sctpDNSName{ struct sctpParamDesc param; u_int8_t name[1]; }; struct sctpCookiePreserve{ struct sctpParamDesc p; /* type is set to SCTP_COOKIE_PRESERVE, len=8 */ u_int32_t extraTime; }; struct sctpTimeStamp{ u_int32_t ts_sec; u_int32_t ts_usec; }; /* wire structure of my cookie */ struct cookieMessage{ u_int32_t TieTag_curTag; /* copied from assoc if present */ u_int32_t TieTag_hisTag; /* copied from assoc if present */ int32_t cookieLife; /* life I will award this cookie */ struct sctpTimeStamp timeEnteringState; /* the time I built cookie */ struct sctpInitiation initAckISent; /* the INIT-ACK that I sent to my peer */ u_int32_t addressWhereISent[4]; /* I make this 4 ints so I get 128bits for future */ int32_t addrtype; /* address type */ u_int16_t locScope; /* V6 local scope flag */ u_int16_t siteScope; /* V6 site scope flag */ /* at the end is tacked on the INIT chunk sent in * its entirety and of course our * signature. */ }; /* this guy is for use when * I have a initiate message gloming the * things together. */ struct sctpUnifiedInit{ struct sctpChunkDesc uh; struct sctpInitiation initm; }; struct sctpSendableInit{ struct sctpHeader mh; struct sctpUnifiedInit msg; }; /* Selective Acknowledgement * has the following structure with * a optional ammount of trailing int's * on the last part (based on the numberOfDesc * field). */ struct sctpSelectiveAck{ u_int32_t highestConseqTSN; u_int32_t updatedRwnd; u_int16_t numberOfdesc; u_int16_t numDupTsns; }; struct sctpSelectiveFrag{ u_int16_t fragmentStart; u_int16_t fragmentEnd; }; struct sctpUnifiedSack{ struct sctpChunkDesc uh; struct sctpSelectiveAck sack; }; /* for both RTT request/response the * following is sent */ struct sctpHBrequest { u_int32_t time_value_1; u_int32_t time_value_2; }; /* here is what I read and respond with to. */ struct sctpHBunified{ struct sctpChunkDesc hdr; struct sctpParamDesc hb; }; /* here is what I send */ struct sctpHBsender{ struct sctpChunkDesc hdr; struct sctpParamDesc hb; struct sctpHBrequest rtt; int8_t addrFmt[SCTP_ADDRMAX]; u_int16_t userreq; }; /* for the abort and shutdown ACK * we must carry the init tag in the common header. Just the * common header is all that is needed with a chunk descriptor. */ struct sctpUnifiedAbort{ struct sctpChunkDesc uh; }; struct sctpUnifiedAbortLight{ struct sctpHeader mh; struct sctpChunkDesc uh; }; struct sctpUnifiedAbortHeavy{ struct sctpHeader mh; struct sctpChunkDesc uh; u_int16_t causeCode; u_int16_t causeLen; }; /* For the graceful shutdown we must carry * the tag (in common header) and the highest consequitive acking value */ struct sctpShutdown { u_int32_t TSN_Seen; }; struct sctpUnifiedShutdown{ struct sctpChunkDesc uh; struct sctpShutdown shut; }; /* in the unified message we add the trailing * stream id since it is the only message * that is defined as a operation error. */ struct sctpOpErrorCause{ u_int16_t cause; u_int16_t causeLen; }; struct sctpUnifiedOpError{ struct sctpChunkDesc uh; struct sctpOpErrorCause c; }; struct sctpUnifiedStreamError{ struct sctpHeader mh; struct sctpChunkDesc uh; struct sctpOpErrorCause c; u_int16_t strmNum; u_int16_t reserved; }; struct staleCookieMsg{ struct sctpHeader mh; struct sctpChunkDesc uh; struct sctpOpErrorCause c; u_int32_t moretime; }; /* the following is used in all sends * where nothing is needed except the * chunk/type i.e. shutdownAck Abort */ struct sctpUnifiedSingleMsg{ struct sctpHeader mh; struct sctpChunkDesc uh; }; struct sctpDataPart{ u_int32_t TSN; u_int16_t streamId; u_int16_t sequence; u_int32_t payloadtype; }; struct sctpUnifiedDatagram{ struct sctpChunkDesc uh; struct sctpDataPart dp; }; struct sctpECN_echo{ struct sctpChunkDesc uh; u_int32_t Lowest_TSN; }; struct sctpCWR{ struct sctpChunkDesc uh; u_int32_t TSN_reduced_at; }; #ifdef __cplusplus } #endif #endif tcpdump-3.9.8/./gmt2local.c0000644000026300017500000000423407755642411013534 0ustar mcrmcr/* * Copyright (c) 1997 * The Regents of the University of California. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that: (1) source code distributions * retain the above copyright notice and this paragraph in its entirety, (2) * distributions including binary code include the above copyright notice and * this paragraph in its entirety in the documentation or other materials * provided with the distribution, and (3) all advertising materials mentioning * features or use of this software display the following acknowledgement: * ``This product includes software developed by the University of California, * Lawrence Berkeley Laboratory and its contributors.'' Neither the name of * the University nor the names of its contributors may be used to endorse * or promote products derived from this software without specific prior * written permission. * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. */ #ifndef lint static const char rcsid[] _U_ = "@(#) $Header: /tcpdump/master/tcpdump/gmt2local.c,v 1.9 2003/11/16 09:36:09 guy Exp $ (LBL)"; #endif #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #ifdef HAVE_OS_PROTO_H #include "os-proto.h" #endif #include "gmt2local.h" /* * Returns the difference between gmt and local time in seconds. * Use gmtime() and localtime() to keep things simple. */ int32_t gmt2local(time_t t) { register int dt, dir; register struct tm *gmt, *loc; struct tm sgmt; if (t == 0) t = time(NULL); gmt = &sgmt; *gmt = *gmtime(&t); loc = localtime(&t); dt = (loc->tm_hour - gmt->tm_hour) * 60 * 60 + (loc->tm_min - gmt->tm_min) * 60; /* * If the year or julian day is different, we span 00:00 GMT * and must add or subtract a day. Check the year first to * avoid problems when the julian day wraps. */ dir = loc->tm_year - gmt->tm_year; if (dir == 0) dir = loc->tm_yday - gmt->tm_yday; dt += dir * 24 * 60 * 60; return (dt); } tcpdump-3.9.8/./extract.h0000644000026300017500000001272610172075272013324 0ustar mcrmcr/* * Copyright (c) 1992, 1993, 1994, 1995, 1996 * The Regents of the University of California. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that: (1) source code distributions * retain the above copyright notice and this paragraph in its entirety, (2) * distributions including binary code include the above copyright notice and * this paragraph in its entirety in the documentation or other materials * provided with the distribution, and (3) all advertising materials mentioning * features or use of this software display the following acknowledgement: * ``This product includes software developed by the University of California, * Lawrence Berkeley Laboratory and its contributors.'' Neither the name of * the University nor the names of its contributors may be used to endorse * or promote products derived from this software without specific prior * written permission. * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * * @(#) $Header: /tcpdump/master/tcpdump/extract.h,v 1.24 2005/01/15 02:06:50 guy Exp $ (LBL) */ /* * Macros to extract possibly-unaligned big-endian integral values. */ #ifdef LBL_ALIGN /* * The processor doesn't natively handle unaligned loads. */ #ifdef HAVE___ATTRIBUTE__ /* * We have __attribute__; we assume that means we have __attribute__((packed)). * Declare packed structures containing a u_int16_t and a u_int32_t, * cast the pointer to point to one of those, and fetch through it; * the GCC manual doesn't appear to explicitly say that * __attribute__((packed)) causes the compiler to generate unaligned-safe * code, but it apppears to do so. * * We do this in case the compiler can generate, for this instruction set, * better code to do an unaligned load and pass stuff to "ntohs()" or * "ntohl()" than the code to fetch the bytes one at a time and * assemble them. (That might not be the case on a little-endian platform, * where "ntohs()" and "ntohl()" might not be done inline.) */ typedef struct { u_int16_t val; } __attribute__((packed)) unaligned_u_int16_t; typedef struct { u_int32_t val; } __attribute__((packed)) unaligned_u_int32_t; #define EXTRACT_16BITS(p) \ ((u_int16_t)ntohs(((const unaligned_u_int16_t *)(p))->val)) #define EXTRACT_32BITS(p) \ ((u_int32_t)ntohl(((const unaligned_u_int32_t *)(p))->val)) #define EXTRACT_64BITS(p) \ ((u_int64_t)(((u_int64_t)ntohl(((const unaligned_u_int32_t *)(p) + 0)->val)) << 32 | \ ((u_int64_t)ntohl(((const unaligned_u_int32_t *)(p) + 1)->val)) << 0)) #else /* HAVE___ATTRIBUTE__ */ /* * We don't have __attribute__, so do unaligned loads of big-endian * quantities the hard way - fetch the bytes one at a time and * assemble them. */ #define EXTRACT_16BITS(p) \ ((u_int16_t)((u_int16_t)*((const u_int8_t *)(p) + 0) << 8 | \ (u_int16_t)*((const u_int8_t *)(p) + 1))) #define EXTRACT_32BITS(p) \ ((u_int32_t)((u_int32_t)*((const u_int8_t *)(p) + 0) << 24 | \ (u_int32_t)*((const u_int8_t *)(p) + 1) << 16 | \ (u_int32_t)*((const u_int8_t *)(p) + 2) << 8 | \ (u_int32_t)*((const u_int8_t *)(p) + 3))) #define EXTRACT_64BITS(p) \ ((u_int64_t)((u_int64_t)*((const u_int8_t *)(p) + 0) << 56 | \ (u_int64_t)*((const u_int8_t *)(p) + 1) << 48 | \ (u_int64_t)*((const u_int8_t *)(p) + 2) << 40 | \ (u_int64_t)*((const u_int8_t *)(p) + 3) << 32 | \ (u_int64_t)*((const u_int8_t *)(p) + 4) << 24 | \ (u_int64_t)*((const u_int8_t *)(p) + 5) << 16 | \ (u_int64_t)*((const u_int8_t *)(p) + 6) << 8 | \ (u_int64_t)*((const u_int8_t *)(p) + 7))) #endif /* HAVE___ATTRIBUTE__ */ #else /* LBL_ALIGN */ /* * The processor natively handles unaligned loads, so we can just * cast the pointer and fetch through it. */ #define EXTRACT_16BITS(p) \ ((u_int16_t)ntohs(*(const u_int16_t *)(p))) #define EXTRACT_32BITS(p) \ ((u_int32_t)ntohl(*(const u_int32_t *)(p))) #define EXTRACT_64BITS(p) \ ((u_int64_t)(((u_int64_t)ntohl(*((const u_int32_t *)(p) + 0))) << 32 | \ ((u_int64_t)ntohl(*((const u_int32_t *)(p) + 1))) << 0)) #endif /* LBL_ALIGN */ #define EXTRACT_24BITS(p) \ ((u_int32_t)((u_int32_t)*((const u_int8_t *)(p) + 0) << 16 | \ (u_int32_t)*((const u_int8_t *)(p) + 1) << 8 | \ (u_int32_t)*((const u_int8_t *)(p) + 2))) /* * Macros to extract possibly-unaligned little-endian integral values. * XXX - do loads on little-endian machines that support unaligned loads? */ #define EXTRACT_LE_8BITS(p) (*(p)) #define EXTRACT_LE_16BITS(p) \ ((u_int16_t)((u_int16_t)*((const u_int8_t *)(p) + 1) << 8 | \ (u_int16_t)*((const u_int8_t *)(p) + 0))) #define EXTRACT_LE_32BITS(p) \ ((u_int32_t)((u_int32_t)*((const u_int8_t *)(p) + 3) << 24 | \ (u_int32_t)*((const u_int8_t *)(p) + 2) << 16 | \ (u_int32_t)*((const u_int8_t *)(p) + 1) << 8 | \ (u_int32_t)*((const u_int8_t *)(p) + 0))) #define EXTRACT_LE_64BITS(p) \ ((u_int64_t)((u_int64_t)*((const u_int8_t *)(p) + 7) << 56 | \ (u_int64_t)*((const u_int8_t *)(p) + 6) << 48 | \ (u_int64_t)*((const u_int8_t *)(p) + 5) << 40 | \ (u_int64_t)*((const u_int8_t *)(p) + 4) << 32 | \ (u_int64_t)*((const u_int8_t *)(p) + 3) << 24 | \ (u_int64_t)*((const u_int8_t *)(p) + 2) << 16 | \ (u_int64_t)*((const u_int8_t *)(p) + 1) << 8 | \ (u_int64_t)*((const u_int8_t *)(p) + 0))) tcpdump-3.9.8/./enc.h0000644000026300017500000000344507632330005012410 0ustar mcrmcr/* @(#) $Header: /tcpdump/master/tcpdump/enc.h,v 1.1 2003/03/08 08:55:33 guy Exp $ (LBL) */ /* From $OpenBSD: if_enc.h,v 1.8 2001/06/25 05:14:00 angelos Exp $ */ /* * The authors of this code are John Ioannidis (ji@tla.org), * Angelos D. Keromytis (kermit@csd.uch.gr) and * Niels Provos (provos@physnet.uni-hamburg.de). * * This code was written by John Ioannidis for BSD/OS in Athens, Greece, * in November 1995. * * Ported to OpenBSD and NetBSD, with additional transforms, in December 1996, * by Angelos D. Keromytis. * * Additional transforms and features in 1997 and 1998 by Angelos D. Keromytis * and Niels Provos. * * Copyright (C) 1995, 1996, 1997, 1998 by John Ioannidis, Angelos D. Keromytis * and Niels Provos. * Copyright (c) 2001, Angelos D. Keromytis. * * Permission to use, copy, and modify this software with or without fee * is hereby granted, provided that this entire notice is included in * all copies of any software which is or includes a copy or * modification of this software. * You may use this code under the GNU public license if you so wish. Please * contribute changes back to the authors under this freer than GPL license * so that we may further the use of strong encryption without limitations to * all. * * THIS SOFTWARE IS BEING PROVIDED "AS IS", WITHOUT ANY EXPRESS OR * IMPLIED WARRANTY. IN PARTICULAR, NONE OF THE AUTHORS MAKES ANY * REPRESENTATION OR WARRANTY OF ANY KIND CONCERNING THE * MERCHANTABILITY OF THIS SOFTWARE OR ITS FITNESS FOR ANY PARTICULAR * PURPOSE. */ #define ENC_HDRLEN 12 /* From $OpenBSD: mbuf.h,v 1.56 2002/01/25 15:50:23 art Exp $ */ #define M_CONF 0x0400 /* packet was encrypted (ESP-transport) */ #define M_AUTH 0x0800 /* packet was authenticated (AH) */ struct enchdr { u_int32_t af; u_int32_t spi; u_int32_t flags; }; tcpdump-3.9.8/./Readme.Win320000644000026300017500000000202607524744354013525 0ustar mcrmcrTo build tcpdump under Windows, you need: - version 6 (or higher) of Microsoft Visual Studio or the Cygnus gnu C compiler. - The November 2001 (or later) edition of Microsoft Platform Software Development Kit (SDK), that contains some necessary includes for IPv6 support. You can download it from http://www.microsoft.com/sdk - the WinPcap source code, that includes libpcap for win32. Download it from http://winpcap.polito.it or download libpcap sources from http://www.tcpdump.org and follow the instructions in the README.Win32 file. First, extract tcpdump and WinPcap in the same folder, and build WinPcap. The Visual Studio project and the cygwin makefile are in the Win32\prj folder. From Visual Studio, open windump.dsw and build the program. The release version of the WinDump.exe executable file will be created in the windump\win32\prj\release directory . The debug version will be generated in windump\win32\prj\debug. From cygnus, go to windump\win32\prj\ and type "make". WinDump.exe will be created in the same directory.tcpdump-3.9.8/./tcpdump-stdinc.h0000644000026300017500000001174210504040015014567 0ustar mcrmcr/* * Copyright (c) 2002 - 2003 * NetGroup, Politecnico di Torino (Italy) * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. Neither the name of the Politecnico di Torino nor the names of its * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * * @(#) $Header: /tcpdump/master/tcpdump/tcpdump-stdinc.h,v 1.12.2.5 2006/06/23 02:07:27 hannes Exp $ (LBL) */ /* * Include the appropriate OS header files on Windows and various flavors * of UNIX, and also define some additional items and include various * non-OS header files on Windows, and; this isolates most of the platform * differences to this one file. */ #ifndef tcpdump_stdinc_h #define tcpdump_stdinc_h #ifdef WIN32 #include #include #include #include "bittypes.h" #include #include #include #include #include #include /* in wpcap's Win32/include */ #if !defined(__MINGW32__) && !defined(__WATCOMC__) #undef toascii #define isascii __isascii #define toascii __toascii #define stat _stat #define open _open #define fstat _fstat #define read _read #define close _close #define O_RDONLY _O_RDONLY typedef short ino_t; #endif /* __MINGW32__ */ #ifdef __MINGW32__ #include #endif /* Protos for missing/x.c functions (ideally * should be used, but it clashes with ). */ extern const char *inet_ntop (int, const void *, char *, size_t); extern int inet_pton (int, const char *, void *); extern int inet_aton (const char *cp, struct in_addr *addr); #ifndef INET6_ADDRSTRLEN #define INET6_ADDRSTRLEN 46 #endif #ifndef toascii #define toascii(c) ((c) & 0x7f) #endif #ifndef caddr_t typedef char* caddr_t; #endif /* caddr_t */ #define MAXHOSTNAMELEN 64 #define NI_MAXHOST 1025 #define snprintf _snprintf #define vsnprintf _vsnprintf #define RETSIGTYPE void #else /* WIN32 */ #include #include #include #if HAVE_INTTYPES_H #include #else #if HAVE_STDINT_H #include #endif #endif #ifdef HAVE_SYS_BITYPES_H #include #endif #include #include /* concession to AIX */ #include #include #include #ifdef TIME_WITH_SYS_TIME #include #endif #include #endif /* WIN32 */ #ifdef INET6 #include "ip6.h" #endif #if defined(WIN32) || defined(MSDOS) #define FOPEN_READ_TXT "rt" #define FOPEN_READ_BIN "rb" #define FOPEN_WRITE_TXT "wt" #define FOPEN_WRITE_BIN "wb" #else #define FOPEN_READ_TXT "r" #define FOPEN_READ_BIN FOPEN_READ_TXT #define FOPEN_WRITE_TXT "w" #define FOPEN_WRITE_BIN FOPEN_WRITE_TXT #endif #if defined(__GNUC__) && defined(__i386__) && !defined(__ntohl) #undef ntohl #undef ntohs #undef htonl #undef htons extern __inline__ unsigned long __ntohl (unsigned long x); extern __inline__ unsigned short __ntohs (unsigned short x); #define ntohl(x) __ntohl(x) #define ntohs(x) __ntohs(x) #define htonl(x) __ntohl(x) #define htons(x) __ntohs(x) extern __inline__ unsigned long __ntohl (unsigned long x) { __asm__ ("xchgb %b0, %h0\n\t" /* swap lower bytes */ "rorl $16, %0\n\t" /* swap words */ "xchgb %b0, %h0" /* swap higher bytes */ : "=q" (x) : "0" (x)); return (x); } extern __inline__ unsigned short __ntohs (unsigned short x) { __asm__ ("xchgb %b0, %h0" /* swap bytes */ : "=q" (x) : "0" (x)); return (x); } #endif #ifndef INET_ADDRSTRLEN #define INET_ADDRSTRLEN 16 #endif #ifndef TRUE #define TRUE 1 #endif #ifndef FALSE #define FALSE 0 #endif #endif /* tcpdump_stdinc_h */ tcpdump-3.9.8/./ipx.h0000644000026300017500000000173407575562662012470 0ustar mcrmcr/* * IPX protocol formats * * @(#) $Header: /tcpdump/master/tcpdump/ipx.h,v 1.8 2002/12/11 07:13:54 guy Exp $ */ /* well-known sockets */ #define IPX_SKT_NCP 0x0451 #define IPX_SKT_SAP 0x0452 #define IPX_SKT_RIP 0x0453 #define IPX_SKT_NETBIOS 0x0455 #define IPX_SKT_DIAGNOSTICS 0x0456 #define IPX_SKT_NWLINK_DGM 0x0553 /* NWLink datagram, may contain SMB */ #define IPX_SKT_EIGRP 0x85be /* Cisco EIGRP over IPX */ /* IPX transport header */ struct ipxHdr { u_int16_t cksum; /* Checksum */ u_int16_t length; /* Length, in bytes, including header */ u_int8_t tCtl; /* Transport Control (i.e. hop count) */ u_int8_t pType; /* Packet Type (i.e. level 2 protocol) */ u_int16_t dstNet[2]; /* destination net */ u_int8_t dstNode[6]; /* destination node */ u_int16_t dstSkt; /* destination socket */ u_int16_t srcNet[2]; /* source net */ u_int8_t srcNode[6]; /* source node */ u_int16_t srcSkt; /* source socket */ }; #define ipxSize 30 tcpdump-3.9.8/./ip.h0000644000026300017500000001350510676336432012265 0ustar mcrmcr/* @(#) $Header: /tcpdump/master/tcpdump/ip.h,v 1.11.2.1 2007/09/14 01:30:02 guy Exp $ (LBL) */ /* * Copyright (c) 1982, 1986, 1993 * The Regents of the University of California. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. All advertising materials mentioning features or use of this software * must display the following acknowledgement: * This product includes software developed by the University of * California, Berkeley and its contributors. * 4. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * * @(#)ip.h 8.2 (Berkeley) 6/1/94 */ /* * Definitions for internet protocol version 4. * Per RFC 791, September 1981. */ #define IPVERSION 4 /* * Structure of an internet header, naked of options. * * We declare ip_len and ip_off to be short, rather than u_short * pragmatically since otherwise unsigned comparisons can result * against negative integers quite easily, and fail in subtle ways. */ struct ip { u_int8_t ip_vhl; /* header length, version */ #define IP_V(ip) (((ip)->ip_vhl & 0xf0) >> 4) #define IP_HL(ip) ((ip)->ip_vhl & 0x0f) u_int8_t ip_tos; /* type of service */ u_int16_t ip_len; /* total length */ u_int16_t ip_id; /* identification */ u_int16_t ip_off; /* fragment offset field */ #define IP_DF 0x4000 /* dont fragment flag */ #define IP_MF 0x2000 /* more fragments flag */ #define IP_OFFMASK 0x1fff /* mask for fragmenting bits */ u_int8_t ip_ttl; /* time to live */ u_int8_t ip_p; /* protocol */ u_int16_t ip_sum; /* checksum */ struct in_addr ip_src,ip_dst; /* source and dest address */ }; #define IP_MAXPACKET 65535 /* maximum packet size */ /* * Definitions for IP type of service (ip_tos) */ #define IPTOS_LOWDELAY 0x10 #define IPTOS_THROUGHPUT 0x08 #define IPTOS_RELIABILITY 0x04 /* * Definitions for IP precedence (also in ip_tos) (hopefully unused) */ #define IPTOS_PREC_NETCONTROL 0xe0 #define IPTOS_PREC_INTERNETCONTROL 0xc0 #define IPTOS_PREC_CRITIC_ECP 0xa0 #define IPTOS_PREC_FLASHOVERRIDE 0x80 #define IPTOS_PREC_FLASH 0x60 #define IPTOS_PREC_IMMEDIATE 0x40 #define IPTOS_PREC_PRIORITY 0x20 #define IPTOS_PREC_ROUTINE 0x00 /* * Definitions for options. */ #define IPOPT_COPIED(o) ((o)&0x80) #define IPOPT_CLASS(o) ((o)&0x60) #define IPOPT_NUMBER(o) ((o)&0x1f) #define IPOPT_CONTROL 0x00 #define IPOPT_RESERVED1 0x20 #define IPOPT_DEBMEAS 0x40 #define IPOPT_RESERVED2 0x60 #define IPOPT_EOL 0 /* end of option list */ #define IPOPT_NOP 1 /* no operation */ #define IPOPT_RR 7 /* record packet route */ #define IPOPT_TS 68 /* timestamp */ #define IPOPT_RFC1393 82 /* traceroute RFC 1393 */ #define IPOPT_SECURITY 130 /* provide s,c,h,tcc */ #define IPOPT_LSRR 131 /* loose source route */ #define IPOPT_SATID 136 /* satnet id */ #define IPOPT_SSRR 137 /* strict source route */ #define IPOPT_RA 148 /* router-alert, rfc2113 */ /* * Offsets to fields in options other than EOL and NOP. */ #define IPOPT_OPTVAL 0 /* option ID */ #define IPOPT_OLEN 1 /* option length */ #define IPOPT_OFFSET 2 /* offset within option */ #define IPOPT_MINOFF 4 /* min value of above */ /* * Time stamp option structure. */ struct ip_timestamp { u_int8_t ipt_code; /* IPOPT_TS */ u_int8_t ipt_len; /* size of structure (variable) */ u_int8_t ipt_ptr; /* index of current entry */ u_int8_t ipt_oflwflg; /* flags, overflow counter */ #define IPTS_OFLW(ip) (((ipt)->ipt_oflwflg & 0xf0) >> 4) #define IPTS_FLG(ip) ((ipt)->ipt_oflwflg & 0x0f) union ipt_timestamp { u_int32_t ipt_time[1]; struct ipt_ta { struct in_addr ipt_addr; u_int32_t ipt_time; } ipt_ta[1]; } ipt_timestamp; }; /* flag bits for ipt_flg */ #define IPOPT_TS_TSONLY 0 /* timestamps only */ #define IPOPT_TS_TSANDADDR 1 /* timestamps and addresses */ #define IPOPT_TS_PRESPEC 3 /* specified modules only */ /* bits for security (not byte swapped) */ #define IPOPT_SECUR_UNCLASS 0x0000 #define IPOPT_SECUR_CONFID 0xf135 #define IPOPT_SECUR_EFTO 0x789a #define IPOPT_SECUR_MMMM 0xbc4d #define IPOPT_SECUR_RESTR 0xaf13 #define IPOPT_SECUR_SECRET 0xd788 #define IPOPT_SECUR_TOPSECRET 0x6bc5 /* * Internet implementation parameters. */ #define MAXTTL 255 /* maximum time to live (seconds) */ #define IPDEFTTL 64 /* default ttl, from RFC 1340 */ #define IPFRAGTTL 60 /* time to live for frags, slowhz */ #define IPTTLDEC 1 /* subtracted when forwarding */ #define IP_MSS 576 /* default maximum segment size */ /* in print-ip.c */ extern u_int32_t ip_finddst(const struct ip *); tcpdump-3.9.8/./print-sunatm.c0000644000026300017500000000663710026157066014312 0ustar mcrmcr/* * Copyright (c) 1997 Yen Yen Lim and North Dakota State University * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. All advertising materials mentioning features or use of this software * must display the following acknowledgement: * This product includes software developed by Yen Yen Lim and North Dakota State University * 4. The name of the author may not be used to endorse or promote products * derived from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. */ #ifndef lint static const char rcsid[] _U_ = "@(#) $Header: /tcpdump/master/tcpdump/print-sunatm.c,v 1.8 2004/03/17 23:24:38 guy Exp $ (LBL)"; #endif #ifdef HAVE_CONFIG_H #include "config.h" #endif #include struct mbuf; struct rtentry; #include #include #include "interface.h" #include "extract.h" #include "addrtoname.h" #include "atm.h" #include "atmuni31.h" /* SunATM header for ATM packet */ #define DIR_POS 0 /* Direction (0x80 = transmit, 0x00 = receive) */ #define VPI_POS 1 /* VPI */ #define VCI_POS 2 /* VCI */ #define PKT_BEGIN_POS 4 /* Start of the ATM packet */ /* Protocol type values in the bottom for bits of the byte at SUNATM_DIR_POS. */ #define PT_LANE 0x01 /* LANE */ #define PT_LLC 0x02 /* LLC encapsulation */ /* * This is the top level routine of the printer. 'p' points * to the SunATM pseudo-header for the packet, 'h->ts' is the timestamp, * 'h->len' is the length of the packet off the wire, and 'h->caplen' * is the number of bytes actually captured. */ u_int sunatm_if_print(const struct pcap_pkthdr *h, const u_char *p) { u_int caplen = h->caplen; u_int length = h->len; u_short vci; u_char vpi; u_int traftype; if (caplen < PKT_BEGIN_POS) { printf("[|atm]"); return (caplen); } if (eflag) { if (p[DIR_POS] & 0x80) printf("Tx: "); else printf("Rx: "); } switch (p[DIR_POS] & 0x0f) { case PT_LANE: traftype = ATM_LANE; break; case PT_LLC: traftype = ATM_LLC; break; default: traftype = ATM_UNKNOWN; break; } vci = EXTRACT_16BITS(&p[VCI_POS]); vpi = p[VPI_POS]; p += PKT_BEGIN_POS; caplen -= PKT_BEGIN_POS; length -= PKT_BEGIN_POS; atm_print(vpi, vci, traftype, p, length, caplen); return (PKT_BEGIN_POS); } tcpdump-3.9.8/./print-frag6.c0000644000026300017500000000501110231554261013765 0ustar mcrmcr/* * Copyright (c) 1988, 1989, 1990, 1991, 1993, 1994 * The Regents of the University of California. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that: (1) source code distributions * retain the above copyright notice and this paragraph in its entirety, (2) * distributions including binary code include the above copyright notice and * this paragraph in its entirety in the documentation or other materials * provided with the distribution, and (3) all advertising materials mentioning * features or use of this software display the following acknowledgement: * ``This product includes software developed by the University of California, * Lawrence Berkeley Laboratory and its contributors.'' Neither the name of * the University nor the names of its contributors may be used to endorse * or promote products derived from this software without specific prior * written permission. * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. */ #ifndef lint static const char rcsid[] _U_ = "@(#) $Header: /tcpdump/master/tcpdump/print-frag6.c,v 1.19.2.1 2005/04/20 22:33:21 guy Exp $"; #endif #ifdef HAVE_CONFIG_H #include "config.h" #endif #ifdef INET6 #include #include #include "ip6.h" #include "interface.h" #include "addrtoname.h" #include "extract.h" int frag6_print(register const u_char *bp, register const u_char *bp2) { register const struct ip6_frag *dp; register const struct ip6_hdr *ip6; dp = (const struct ip6_frag *)bp; ip6 = (const struct ip6_hdr *)bp2; TCHECK(dp->ip6f_offlg); if (vflag) { printf("frag (0x%08x:%d|%ld)", EXTRACT_32BITS(&dp->ip6f_ident), EXTRACT_16BITS(&dp->ip6f_offlg) & IP6F_OFF_MASK, sizeof(struct ip6_hdr) + EXTRACT_16BITS(&ip6->ip6_plen) - (long)(bp - bp2) - sizeof(struct ip6_frag)); } else { printf("frag (%d|%ld)", EXTRACT_16BITS(&dp->ip6f_offlg) & IP6F_OFF_MASK, sizeof(struct ip6_hdr) + EXTRACT_16BITS(&ip6->ip6_plen) - (long)(bp - bp2) - sizeof(struct ip6_frag)); } #if 1 /* it is meaningless to decode non-first fragment */ if ((EXTRACT_16BITS(&dp->ip6f_offlg) & IP6F_OFF_MASK) != 0) return -1; else #endif { fputs(" ", stdout); return sizeof(struct ip6_frag); } trunc: fputs("[|frag]", stdout); return -1; #undef TCHECK } #endif /* INET6 */ tcpdump-3.9.8/./setsignal.h0000644000026300017500000000252706777230401013644 0ustar mcrmcr/* * Copyright (c) 1997 * The Regents of the University of California. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that: (1) source code distributions * retain the above copyright notice and this paragraph in its entirety, (2) * distributions including binary code include the above copyright notice and * this paragraph in its entirety in the documentation or other materials * provided with the distribution, and (3) all advertising materials mentioning * features or use of this software display the following acknowledgement: * ``This product includes software developed by the University of California, * Lawrence Berkeley Laboratory and its contributors.'' Neither the name of * the University nor the names of its contributors may be used to endorse * or promote products derived from this software without specific prior * written permission. * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * * @(#) $Header: /tcpdump/master/tcpdump/setsignal.h,v 1.2.1.1 1999/10/07 23:47:13 mcr Exp $ (LBL) */ #ifndef setsignal_h #define setsignal_h RETSIGTYPE (*setsignal(int, RETSIGTYPE (*)(int)))(int); #endif tcpdump-3.9.8/./send-ack.awk0000644000026300017500000000307606777230400013672 0ustar mcrmcrBEGIN { # we need the number of bytes in a packet to do the output # in packet numbers rather than byte numbers. if (packetsize <= 0) packetsize = 512 expectNext = 1 lastwin = -1 } { # convert tcp trace to send/ack form. n = split ($1,t,":") tim = t[1]*3600 + t[2]*60 + t[3] if (NR <= 1) { tzero = tim ltim = tim OFS = "\t" } if ($6 != "ack") { # we have a data packet record: # ignore guys with syn, fin or reset 'cause we # can't handle their sequence numbers. Try to # detect and add a flag character for 'anomalies': # * -> re-sent packet # - -> packet after hole (missing packet(s)) # # -> odd size packet if ($5 !~ /[SFR]/) { i = index($6,":") j = index($6,"(") strtSeq = substr($6,1,i-1) endSeq = substr($6,i+1,j-i-1) len = endSeq - strtSeq id = endSeq if (! timeOf[id]) timeOf[id] = tim if (endSeq - expectNext < 0) flag = "*" else { if (strtSeq - expectNext > 0) flag = "-" else if (len != packetsize) flag = "#" else flag = " " expectNext = endSeq } printf "%7.2f\t%7.2f\t%s send %s %d", tim-tzero, tim-ltim,\ flag, $5, strtSeq if (++timesSent[id] > 1) printf " (%.2f) [%d]", tim - timeOf[id], timesSent[id] if (len != packetsize) printf " <%d>", len } } else { id = $7 printf "%7.2f\t%7.2f\t%s ack %s %d", tim-tzero, tim-ltim,\ flag, $5, id if ($9 != lastwin) { printf " win %d", $9 lastwin = $9 } printf " (%.2f)", tim - timeOf[id] if (++timesAcked[id] > 1) printf " [%d]", timesAcked[id] } printf "\n" ltim = tim } tcpdump-3.9.8/./print-chdlc.c0000644000026300017500000001340610504040014014031 0ustar mcrmcr/* * Copyright (c) 1990, 1991, 1993, 1994, 1995, 1996, 1997 * The Regents of the University of California. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that: (1) source code distributions * retain the above copyright notice and this paragraph in its entirety, (2) * distributions including binary code include the above copyright notice and * this paragraph in its entirety in the documentation or other materials * provided with the distribution, and (3) all advertising materials mentioning * features or use of this software display the following acknowledgement: * ``This product includes software developed by the University of California, * Lawrence Berkeley Laboratory and its contributors.'' Neither the name of * the University nor the names of its contributors may be used to endorse * or promote products derived from this software without specific prior * written permission. * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. */ #ifndef lint static const char rcsid[] _U_ = "@(#) $Header: /tcpdump/master/tcpdump/print-chdlc.c,v 1.32.2.11 2005/11/29 08:57:10 hannes Exp $ (LBL)"; #endif #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include #include "interface.h" #include "addrtoname.h" #include "ethertype.h" #include "extract.h" #include "ppp.h" #include "chdlc.h" static void chdlc_slarp_print(const u_char *, u_int); const struct tok chdlc_cast_values[] = { { CHDLC_UNICAST, "unicast" }, { CHDLC_BCAST, "bcast" }, { 0, NULL} }; /* Standard CHDLC printer */ u_int chdlc_if_print(const struct pcap_pkthdr *h, register const u_char *p) { register u_int length = h->len; register u_int caplen = h->caplen; if (caplen < CHDLC_HDRLEN) { printf("[|chdlc]"); return (caplen); } return (chdlc_print(p,length)); } u_int chdlc_print(register const u_char *p, u_int length) { u_int proto; proto = EXTRACT_16BITS(&p[2]); if (eflag) { printf("%s, ethertype %s (0x%04x), length %u: ", tok2str(chdlc_cast_values, "0x%02x", p[0]), tok2str(ethertype_values, "Unknown", proto), proto, length); } length -= CHDLC_HDRLEN; p += CHDLC_HDRLEN; switch (proto) { case ETHERTYPE_IP: ip_print(gndo, p, length); break; #ifdef INET6 case ETHERTYPE_IPV6: ip6_print(p, length); break; #endif case CHDLC_TYPE_SLARP: chdlc_slarp_print(p, length); break; #if 0 case CHDLC_TYPE_CDP: chdlc_cdp_print(p, length); break; #endif case ETHERTYPE_MPLS: case ETHERTYPE_MPLS_MULTI: mpls_print(p, length); break; case ETHERTYPE_ISO: /* is the fudge byte set ? lets verify by spotting ISO headers */ if (*(p+1) == 0x81 || *(p+1) == 0x82 || *(p+1) == 0x83) isoclns_print(p+1, length-1, length-1); else isoclns_print(p, length, length); break; default: if (!eflag) printf("unknown CHDLC protocol (0x%04x)", proto); break; } return (CHDLC_HDRLEN); } /* * The fixed-length portion of a SLARP packet. */ struct cisco_slarp { u_int8_t code[4]; #define SLARP_REQUEST 0 #define SLARP_REPLY 1 #define SLARP_KEEPALIVE 2 union { struct { u_int8_t addr[4]; u_int8_t mask[4]; } addr; struct { u_int8_t myseq[4]; u_int8_t yourseq[4]; u_int8_t rel[2]; } keep; } un; }; #define SLARP_MIN_LEN 14 #define SLARP_MAX_LEN 18 static void chdlc_slarp_print(const u_char *cp, u_int length) { const struct cisco_slarp *slarp; u_int sec,min,hrs,days; printf("SLARP (length: %u), ",length); if (length < SLARP_MIN_LEN) goto trunc; slarp = (const struct cisco_slarp *)cp; TCHECK2(*slarp, SLARP_MIN_LEN); switch (EXTRACT_32BITS(&slarp->code)) { case SLARP_REQUEST: printf("request"); /* * At least according to William "Chops" Westfield's * message in * * http://www.nethelp.no/net/cisco-hdlc.txt * * the address and mask aren't used in requests - * they're just zero. */ break; case SLARP_REPLY: printf("reply %s/%s", ipaddr_string(&slarp->un.addr.addr), ipaddr_string(&slarp->un.addr.mask)); break; case SLARP_KEEPALIVE: printf("keepalive: mineseen=0x%08x, yourseen=0x%08x, reliability=0x%04x", EXTRACT_32BITS(&slarp->un.keep.myseq), EXTRACT_32BITS(&slarp->un.keep.yourseq), EXTRACT_16BITS(&slarp->un.keep.rel)); if (length >= SLARP_MAX_LEN) { /* uptime-stamp is optional */ cp += SLARP_MIN_LEN; if (!TTEST2(*cp, 4)) goto trunc; sec = EXTRACT_32BITS(cp) / 1000; min = sec / 60; sec -= min * 60; hrs = min / 60; min -= hrs * 60; days = hrs / 24; hrs -= days * 24; printf(", link uptime=%ud%uh%um%us",days,hrs,min,sec); } break; default: printf("0x%02x unknown", EXTRACT_32BITS(&slarp->code)); if (vflag <= 1) print_unknown_data(cp+4,"\n\t",length-4); break; } if (SLARP_MAX_LEN < length && vflag) printf(", (trailing junk: %d bytes)", length - SLARP_MAX_LEN); if (vflag > 1) print_unknown_data(cp+4,"\n\t",length-4); return; trunc: printf("[|slarp]"); } /* * Local Variables: * c-style: whitesmith * c-basic-offset: 8 * End: */ tcpdump-3.9.8/./print-netbios.c0000644000026300017500000000500307755642435014446 0ustar mcrmcr/* * Copyright (c) 1994, 1995, 1996 * The Regents of the University of California. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that: (1) source code distributions * retain the above copyright notice and this paragraph in its entirety, (2) * distributions including binary code include the above copyright notice and * this paragraph in its entirety in the documentation or other materials * provided with the distribution, and (3) all advertising materials mentioning * features or use of this software display the following acknowledgement: * ``This product includes software developed by the University of California, * Lawrence Berkeley Laboratory and its contributors.'' Neither the name of * the University nor the names of its contributors may be used to endorse * or promote products derived from this software without specific prior * written permission. * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * * Format and print NETBIOS packets. * Contributed by Brad Parker (brad@fcr.com). */ #ifndef lint static const char rcsid[] _U_ = "@(#) $Header: /tcpdump/master/tcpdump/print-netbios.c,v 1.20 2003/11/16 09:36:29 guy Exp $"; #endif #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include #include #include "interface.h" #include "addrtoname.h" #include "netbios.h" #include "extract.h" /* * Print NETBIOS packets. */ void netbios_print(struct p8022Hdr *nb, u_int length) { if (length < p8022Size) { (void)printf(" truncated-netbios %d", length); return; } if (nb->flags == UI) { (void)printf("802.1 UI "); } else { (void)printf("802.1 CONN "); } if ((u_char *)(nb + 1) > snapend) { printf(" [|netbios]"); return; } /* netbios_decode(nb, (u_char *)nb + p8022Size, length - p8022Size); */ } #ifdef never (void)printf("%s.%d > ", ipxaddr_string(EXTRACT_32BITS(ipx->srcNet), ipx->srcNode), EXTRACT_16BITS(ipx->srcSkt)); (void)printf("%s.%d:", ipxaddr_string(EXTRACT_32BITS(ipx->dstNet), ipx->dstNode), EXTRACT_16BITS(ipx->dstSkt)); if ((u_char *)(ipx + 1) > snapend) { printf(" [|ipx]"); return; } /* take length from ipx header */ length = EXTRACT_16BITS(&ipx->length); ipx_decode(ipx, (u_char *)ipx + ipxSize, length - ipxSize); #endif tcpdump-3.9.8/./print-ppp.c0000644000026300017500000012362410504040015013560 0ustar mcrmcr/* * Copyright (c) 1990, 1991, 1993, 1994, 1995, 1996, 1997 * The Regents of the University of California. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that: (1) source code distributions * retain the above copyright notice and this paragraph in its entirety, (2) * distributions including binary code include the above copyright notice and * this paragraph in its entirety in the documentation or other materials * provided with the distribution, and (3) all advertising materials mentioning * features or use of this software display the following acknowledgement: * ``This product includes software developed by the University of California, * Lawrence Berkeley Laboratory and its contributors.'' Neither the name of * the University nor the names of its contributors may be used to endorse * or promote products derived from this software without specific prior * written permission. * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * * Extensively modified by Motonori Shindo (mshindo@mshindo.net) for more * complete PPP support. */ /* * TODO: * o resolve XXX as much as possible * o MP support * o BAP support */ #ifndef lint static const char rcsid[] _U_ = "@(#) $Header: /tcpdump/master/tcpdump/print-ppp.c,v 1.108.2.6 2005/12/05 11:40:36 hannes Exp $ (LBL)"; #endif #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #ifdef __bsdi__ #include #include #endif #include #include #include #include "interface.h" #include "extract.h" #include "addrtoname.h" #include "ppp.h" #include "chdlc.h" #include "ethertype.h" #include "oui.h" /* * The following constatns are defined by IANA. Please refer to * http://www.isi.edu/in-notes/iana/assignments/ppp-numbers * for the up-to-date information. */ /* Protocol Codes defined in ppp.h */ struct tok ppptype2str[] = { { PPP_IP, "IP" }, { PPP_OSI, "OSI" }, { PPP_NS, "NS" }, { PPP_DECNET, "DECNET" }, { PPP_APPLE, "APPLE" }, { PPP_IPX, "IPX" }, { PPP_VJC, "VJC IP" }, { PPP_VJNC, "VJNC IP" }, { PPP_BRPDU, "BRPDU" }, { PPP_STII, "STII" }, { PPP_VINES, "VINES" }, { PPP_MPLS_UCAST, "MPLS" }, { PPP_MPLS_MCAST, "MPLS" }, { PPP_COMP, "Compressed"}, { PPP_ML, "MLPPP"}, { PPP_IPV6, "IP6"}, { PPP_HELLO, "HELLO" }, { PPP_LUXCOM, "LUXCOM" }, { PPP_SNS, "SNS" }, { PPP_IPCP, "IPCP" }, { PPP_OSICP, "OSICP" }, { PPP_NSCP, "NSCP" }, { PPP_DECNETCP, "DECNETCP" }, { PPP_APPLECP, "APPLECP" }, { PPP_IPXCP, "IPXCP" }, { PPP_STIICP, "STIICP" }, { PPP_VINESCP, "VINESCP" }, { PPP_IPV6CP, "IP6CP" }, { PPP_MPLSCP, "MPLSCP" }, { PPP_LCP, "LCP" }, { PPP_PAP, "PAP" }, { PPP_LQM, "LQM" }, { PPP_CHAP, "CHAP" }, { PPP_EAP, "EAP" }, { PPP_SPAP, "SPAP" }, { PPP_SPAP_OLD, "Old-SPAP" }, { PPP_BACP, "BACP" }, { PPP_BAP, "BAP" }, { PPP_MPCP, "MLPPP-CP" }, { 0, NULL } }; /* Control Protocols (LCP/IPCP/CCP etc.) Codes defined in RFC 1661 */ #define CPCODES_VEXT 0 /* Vendor-Specific (RFC2153) */ #define CPCODES_CONF_REQ 1 /* Configure-Request */ #define CPCODES_CONF_ACK 2 /* Configure-Ack */ #define CPCODES_CONF_NAK 3 /* Configure-Nak */ #define CPCODES_CONF_REJ 4 /* Configure-Reject */ #define CPCODES_TERM_REQ 5 /* Terminate-Request */ #define CPCODES_TERM_ACK 6 /* Terminate-Ack */ #define CPCODES_CODE_REJ 7 /* Code-Reject */ #define CPCODES_PROT_REJ 8 /* Protocol-Reject (LCP only) */ #define CPCODES_ECHO_REQ 9 /* Echo-Request (LCP only) */ #define CPCODES_ECHO_RPL 10 /* Echo-Reply (LCP only) */ #define CPCODES_DISC_REQ 11 /* Discard-Request (LCP only) */ #define CPCODES_ID 12 /* Identification (LCP only) RFC1570 */ #define CPCODES_TIME_REM 13 /* Time-Remaining (LCP only) RFC1570 */ #define CPCODES_RESET_REQ 14 /* Reset-Request (CCP only) RFC1962 */ #define CPCODES_RESET_REP 15 /* Reset-Reply (CCP only) */ struct tok cpcodes[] = { {CPCODES_VEXT, "Vendor-Extension"}, /* RFC2153 */ {CPCODES_CONF_REQ, "Conf-Request"}, {CPCODES_CONF_ACK, "Conf-Ack"}, {CPCODES_CONF_NAK, "Conf-Nack"}, {CPCODES_CONF_REJ, "Conf-Reject"}, {CPCODES_TERM_REQ, "Term-Request"}, {CPCODES_TERM_ACK, "Term-Ack"}, {CPCODES_CODE_REJ, "Code-Reject"}, {CPCODES_PROT_REJ, "Prot-Reject"}, {CPCODES_ECHO_REQ, "Echo-Request"}, {CPCODES_ECHO_RPL, "Echo-Reply"}, {CPCODES_DISC_REQ, "Disc-Req"}, {CPCODES_ID, "Ident"}, /* RFC1570 */ {CPCODES_TIME_REM, "Time-Rem"}, /* RFC1570 */ {CPCODES_RESET_REQ, "Reset-Req"}, /* RFC1962 */ {CPCODES_RESET_REP, "Reset-Ack"}, /* RFC1962 */ {0, NULL} }; /* LCP Config Options */ #define LCPOPT_VEXT 0 #define LCPOPT_MRU 1 #define LCPOPT_ACCM 2 #define LCPOPT_AP 3 #define LCPOPT_QP 4 #define LCPOPT_MN 5 #define LCPOPT_DEP6 6 #define LCPOPT_PFC 7 #define LCPOPT_ACFC 8 #define LCPOPT_FCSALT 9 #define LCPOPT_SDP 10 #define LCPOPT_NUMMODE 11 #define LCPOPT_DEP12 12 #define LCPOPT_CBACK 13 #define LCPOPT_DEP14 14 #define LCPOPT_DEP15 15 #define LCPOPT_DEP16 16 #define LCPOPT_MLMRRU 17 #define LCPOPT_MLSSNHF 18 #define LCPOPT_MLED 19 #define LCPOPT_PROP 20 #define LCPOPT_DCEID 21 #define LCPOPT_MPP 22 #define LCPOPT_LD 23 #define LCPOPT_LCPAOPT 24 #define LCPOPT_COBS 25 #define LCPOPT_PE 26 #define LCPOPT_MLHF 27 #define LCPOPT_I18N 28 #define LCPOPT_SDLOS 29 #define LCPOPT_PPPMUX 30 #define LCPOPT_MIN LCPOPT_VEXT #define LCPOPT_MAX LCPOPT_PPPMUX static const char *lcpconfopts[] = { "Vend-Ext", /* (0) */ "MRU", /* (1) */ "ACCM", /* (2) */ "Auth-Prot", /* (3) */ "Qual-Prot", /* (4) */ "Magic-Num", /* (5) */ "deprecated(6)", /* used to be a Quality Protocol */ "PFC", /* (7) */ "ACFC", /* (8) */ "FCS-Alt", /* (9) */ "SDP", /* (10) */ "Num-Mode", /* (11) */ "deprecated(12)", /* used to be a Multi-Link-Procedure*/ "Call-Back", /* (13) */ "deprecated(14)", /* used to be a Connect-Time */ "deprecated(15)", /* used to be a Compund-Frames */ "deprecated(16)", /* used to be a Nominal-Data-Encap */ "MRRU", /* (17) */ "12-Bit seq #", /* (18) */ "End-Disc", /* (19) */ "Proprietary", /* (20) */ "DCE-Id", /* (21) */ "MP+", /* (22) */ "Link-Disc", /* (23) */ "LCP-Auth-Opt", /* (24) */ "COBS", /* (25) */ "Prefix-elision", /* (26) */ "Multilink-header-Form",/* (27) */ "I18N", /* (28) */ "SDL-over-SONET/SDH", /* (29) */ "PPP-Muxing", /* (30) */ }; /* ECP - to be supported */ /* CCP Config Options */ #define CCPOPT_OUI 0 /* RFC1962 */ #define CCPOPT_PRED1 1 /* RFC1962 */ #define CCPOPT_PRED2 2 /* RFC1962 */ #define CCPOPT_PJUMP 3 /* RFC1962 */ /* 4-15 unassigned */ #define CCPOPT_HPPPC 16 /* RFC1962 */ #define CCPOPT_STACLZS 17 /* RFC1974 */ #define CCPOPT_MPPC 18 /* RFC2118 */ #define CCPOPT_GFZA 19 /* RFC1962 */ #define CCPOPT_V42BIS 20 /* RFC1962 */ #define CCPOPT_BSDCOMP 21 /* RFC1977 */ /* 22 unassigned */ #define CCPOPT_LZSDCP 23 /* RFC1967 */ #define CCPOPT_MVRCA 24 /* RFC1975 */ #define CCPOPT_DEC 25 /* RFC1976 */ #define CCPOPT_DEFLATE 26 /* RFC1979 */ /* 27-254 unassigned */ #define CCPOPT_RESV 255 /* RFC1962 */ const struct tok ccpconfopts_values[] = { { CCPOPT_OUI, "OUI" }, { CCPOPT_PRED1, "Pred-1" }, { CCPOPT_PRED2, "Pred-2" }, { CCPOPT_PJUMP, "Puddle" }, { CCPOPT_HPPPC, "HP-PPC" }, { CCPOPT_STACLZS, "Stac-LZS" }, { CCPOPT_MPPC, "MPPC" }, { CCPOPT_GFZA, "Gand-FZA" }, { CCPOPT_V42BIS, "V.42bis" }, { CCPOPT_BSDCOMP, "BSD-Comp" }, { CCPOPT_LZSDCP, "LZS-DCP" }, { CCPOPT_MVRCA, "MVRCA" }, { CCPOPT_DEC, "DEC" }, { CCPOPT_DEFLATE, "Deflate" }, { CCPOPT_RESV, "Reserved"}, {0, NULL} }; /* BACP Config Options */ #define BACPOPT_FPEER 1 /* RFC2125 */ const struct tok bacconfopts_values[] = { { BACPOPT_FPEER, "Favored-Peer" }, {0, NULL} }; /* SDCP - to be supported */ /* IPCP Config Options */ #define IPCPOPT_2ADDR 1 /* RFC1172, RFC1332 (deprecated) */ #define IPCPOPT_IPCOMP 2 /* RFC1332 */ #define IPCPOPT_ADDR 3 /* RFC1332 */ #define IPCPOPT_MOBILE4 4 /* RFC2290 */ #define IPCPOPT_PRIDNS 129 /* RFC1877 */ #define IPCPOPT_PRINBNS 130 /* RFC1877 */ #define IPCPOPT_SECDNS 131 /* RFC1877 */ #define IPCPOPT_SECNBNS 132 /* RFC1877 */ struct tok ipcpopt_values[] = { { IPCPOPT_2ADDR, "IP-Addrs" }, { IPCPOPT_IPCOMP, "IP-Comp" }, { IPCPOPT_ADDR, "IP-Addr" }, { IPCPOPT_MOBILE4, "Home-Addr" }, { IPCPOPT_PRIDNS, "Pri-DNS" }, { IPCPOPT_PRINBNS, "Pri-NBNS" }, { IPCPOPT_SECDNS, "Sec-DNS" }, { IPCPOPT_SECNBNS, "Sec-NBNS" }, { 0, NULL } }; #define IPCPOPT_IPCOMP_HDRCOMP 0x61 /* rfc3544 */ #define IPCPOPT_IPCOMP_MINLEN 14 struct tok ipcpopt_compproto_values[] = { { PPP_VJC, "VJ-Comp" }, { IPCPOPT_IPCOMP_HDRCOMP, "IP Header Compression" }, { 0, NULL } }; struct tok ipcpopt_compproto_subopt_values[] = { { 1, "RTP-Compression" }, { 2, "Enhanced RTP-Compression" }, { 0, NULL } }; /* IP6CP Config Options */ #define IP6CP_IFID 1 struct tok ip6cpopt_values[] = { { IP6CP_IFID, "Interface-ID" }, { 0, NULL } }; /* ATCP - to be supported */ /* OSINLCP - to be supported */ /* BVCP - to be supported */ /* BCP - to be supported */ /* IPXCP - to be supported */ /* MPLSCP - to be supported */ /* Auth Algorithms */ /* 0-4 Reserved (RFC1994) */ #define AUTHALG_CHAPMD5 5 /* RFC1994 */ #define AUTHALG_MSCHAP1 128 /* RFC2433 */ #define AUTHALG_MSCHAP2 129 /* RFC2795 */ struct tok authalg_values[] = { { AUTHALG_CHAPMD5, "MD5" }, { AUTHALG_MSCHAP1, "MS-CHAPv1" }, { AUTHALG_MSCHAP2, "MS-CHAPv2" }, { 0, NULL } }; /* FCS Alternatives - to be supported */ /* Multilink Endpoint Discriminator (RFC1717) */ #define MEDCLASS_NULL 0 /* Null Class */ #define MEDCLASS_LOCAL 1 /* Locally Assigned */ #define MEDCLASS_IPV4 2 /* Internet Protocol (IPv4) */ #define MEDCLASS_MAC 3 /* IEEE 802.1 global MAC address */ #define MEDCLASS_MNB 4 /* PPP Magic Number Block */ #define MEDCLASS_PSNDN 5 /* Public Switched Network Director Number */ /* PPP LCP Callback */ #define CALLBACK_AUTH 0 /* Location determined by user auth */ #define CALLBACK_DSTR 1 /* Dialing string */ #define CALLBACK_LID 2 /* Location identifier */ #define CALLBACK_E164 3 /* E.164 number */ #define CALLBACK_X500 4 /* X.500 distinguished name */ #define CALLBACK_CBCP 6 /* Location is determined during CBCP nego */ struct tok ppp_callback_values[] = { { CALLBACK_AUTH, "UserAuth" }, { CALLBACK_DSTR, "DialString" }, { CALLBACK_LID, "LocalID" }, { CALLBACK_E164, "E.164" }, { CALLBACK_X500, "X.500" }, { CALLBACK_CBCP, "CBCP" }, { 0, NULL } }; /* CHAP */ #define CHAP_CHAL 1 #define CHAP_RESP 2 #define CHAP_SUCC 3 #define CHAP_FAIL 4 struct tok chapcode_values[] = { { CHAP_CHAL, "Challenge" }, { CHAP_RESP, "Response" }, { CHAP_SUCC, "Success" }, { CHAP_FAIL, "Fail" }, { 0, NULL} }; /* PAP */ #define PAP_AREQ 1 #define PAP_AACK 2 #define PAP_ANAK 3 struct tok papcode_values[] = { { PAP_AREQ, "Auth-Req" }, { PAP_AACK, "Auth-ACK" }, { PAP_ANAK, "Auth-NACK" }, { 0, NULL } }; /* BAP */ #define BAP_CALLREQ 1 #define BAP_CALLRES 2 #define BAP_CBREQ 3 #define BAP_CBRES 4 #define BAP_LDQREQ 5 #define BAP_LDQRES 6 #define BAP_CSIND 7 #define BAP_CSRES 8 static void handle_ctrl_proto (u_int proto,const u_char *p, int length); static void handle_chap (const u_char *p, int length); static void handle_pap (const u_char *p, int length); static void handle_bap (const u_char *p, int length); static void handle_mlppp(const u_char *p, int length); static int print_lcp_config_options (const u_char *p, int); static int print_ipcp_config_options (const u_char *p, int); static int print_ip6cp_config_options (const u_char *p, int); static int print_ccp_config_options (const u_char *p, int); static int print_bacp_config_options (const u_char *p, int); static void handle_ppp (u_int proto, const u_char *p, int length); static void ppp_hdlc(const u_char *p, int length); /* generic Control Protocol (e.g. LCP, IPCP, CCP, etc.) handler */ static void handle_ctrl_proto(u_int proto, const u_char *pptr, int length) { const char *typestr; u_int code, len; int (*pfunc)(const u_char *, int); int x, j; const u_char *tptr; tptr=pptr; typestr = tok2str(ppptype2str, "unknown ctrl-proto (0x%04x)", proto); printf("%s, ",typestr); if (length < 4) /* FIXME weak boundary checking */ goto trunc; TCHECK2(*tptr, 2); code = *tptr++; printf("%s (0x%02x), id %u, length %u", tok2str(cpcodes, "Unknown Opcode",code), code, *tptr++, /* ID */ length+2); if (!vflag) return; if (length <= 4) return; /* there may be a NULL confreq etc. */ TCHECK2(*tptr, 2); len = EXTRACT_16BITS(tptr); tptr += 2; printf("\n\tencoded length %u (=Option(s) length %u)",len,len-4); if (vflag>1) print_unknown_data(pptr-2,"\n\t",6); switch (code) { case CPCODES_VEXT: if (length < 11) break; TCHECK2(*tptr, 4); printf("\n\t Magic-Num 0x%08x", EXTRACT_32BITS(tptr)); tptr += 4; TCHECK2(*tptr, 3); printf(" Vendor: %s (%u)", tok2str(oui_values,"Unknown",EXTRACT_24BITS(tptr)), EXTRACT_24BITS(tptr)); /* XXX: need to decode Kind and Value(s)? */ break; case CPCODES_CONF_REQ: case CPCODES_CONF_ACK: case CPCODES_CONF_NAK: case CPCODES_CONF_REJ: x = len - 4; /* Code(1), Identifier(1) and Length(2) */ do { switch (proto) { case PPP_LCP: pfunc = print_lcp_config_options; break; case PPP_IPCP: pfunc = print_ipcp_config_options; break; case PPP_IPV6CP: pfunc = print_ip6cp_config_options; break; case PPP_CCP: pfunc = print_ccp_config_options; break; case PPP_BACP: pfunc = print_bacp_config_options; break; default: /* * No print routine for the options for * this protocol. */ pfunc = NULL; break; } if (pfunc == NULL) /* catch the above null pointer if unknown CP */ break; if ((j = (*pfunc)(tptr, len)) == 0) break; x -= j; tptr += j; } while (x > 0); break; case CPCODES_TERM_REQ: case CPCODES_TERM_ACK: /* XXX: need to decode Data? */ break; case CPCODES_CODE_REJ: /* XXX: need to decode Rejected-Packet? */ break; case CPCODES_PROT_REJ: if (length < 6) break; TCHECK2(*tptr, 2); printf("\n\t Rejected %s Protocol (0x%04x)", tok2str(ppptype2str,"unknown", EXTRACT_16BITS(tptr)), EXTRACT_16BITS(tptr)); /* XXX: need to decode Rejected-Information? - hexdump for now */ if (len > 6) { printf("\n\t Rejected Packet"); print_unknown_data(tptr+2,"\n\t ",len-2); } break; case CPCODES_ECHO_REQ: case CPCODES_ECHO_RPL: case CPCODES_DISC_REQ: if (length < 8) break; TCHECK2(*tptr, 4); printf("\n\t Magic-Num 0x%08x", EXTRACT_32BITS(tptr)); /* XXX: need to decode Data? - hexdump for now */ if (len > 8) { printf("\n\t -----trailing data-----"); TCHECK2(tptr[4], len-8); print_unknown_data(tptr+4,"\n\t ",len-8); } break; case CPCODES_ID: if (length < 8) break; TCHECK2(*tptr, 4); printf("\n\t Magic-Num 0x%08x", EXTRACT_32BITS(tptr)); /* RFC 1661 says this is intended to be human readable */ if (len > 8) { printf("\n\t Message\n\t "); fn_printn(tptr+4,len-4,snapend); } break; case CPCODES_TIME_REM: if (length < 12) break; TCHECK2(*tptr, 4); printf("\n\t Magic-Num 0x%08x", EXTRACT_32BITS(tptr)); TCHECK2(*(tptr + 4), 4); printf(", Seconds-Remaining %us", EXTRACT_32BITS(tptr + 4)); /* XXX: need to decode Message? */ break; default: /* XXX this is dirty but we do not get the * original pointer passed to the begin * the PPP packet */ if (vflag <= 1) print_unknown_data(pptr-2,"\n\t ",length+2); break; } return; trunc: printf("[|%s]", typestr); } /* LCP config options */ static int print_lcp_config_options(const u_char *p, int length) { int len, opt; if (length < 2) return 0; TCHECK2(*p, 2); len = p[1]; opt = p[0]; if (length < len) return 0; if (len < 2) { if ((opt >= LCPOPT_MIN) && (opt <= LCPOPT_MAX)) printf("\n\t %s Option (0x%02x), length %u (bogus, should be >= 2)", lcpconfopts[opt],opt,len); else printf("\n\tunknown LCP option 0x%02x", opt); return 0; } if ((opt >= LCPOPT_MIN) && (opt <= LCPOPT_MAX)) printf("\n\t %s Option (0x%02x), length %u: ", lcpconfopts[opt],opt,len); else { printf("\n\tunknown LCP option 0x%02x", opt); return len; } switch (opt) { case LCPOPT_VEXT: if (len >= 6) { TCHECK2(*(p + 2), 3); printf("Vendor: %s (%u)", tok2str(oui_values,"Unknown",EXTRACT_24BITS(p+2)), EXTRACT_24BITS(p+2)); #if 0 TCHECK(p[5]); printf(", kind: 0x%02x", p[5]); printf(", Value: 0x") for (i = 0; i < len - 6; i++) { TCHECK(p[6 + i]); printf("%02x", p[6 + i]); } #endif } break; case LCPOPT_MRU: if (len == 4) { TCHECK2(*(p + 2), 2); printf("%u", EXTRACT_16BITS(p + 2)); } break; case LCPOPT_ACCM: if (len == 6) { TCHECK2(*(p + 2), 4); printf("0x%08x", EXTRACT_32BITS(p + 2)); } break; case LCPOPT_AP: if (len >= 4) { TCHECK2(*(p + 2), 2); printf("%s", tok2str(ppptype2str,"Unknown Auth Proto (0x04x)",EXTRACT_16BITS(p+2))); switch (EXTRACT_16BITS(p+2)) { case PPP_CHAP: TCHECK(p[4]); printf(", %s",tok2str(authalg_values,"Unknown Auth Alg %u",p[4])); break; case PPP_PAP: /* fall through */ case PPP_EAP: case PPP_SPAP: case PPP_SPAP_OLD: break; default: print_unknown_data(p,"\n\t",len); } } break; case LCPOPT_QP: if (len >= 4) { TCHECK2(*(p + 2), 2); if (EXTRACT_16BITS(p+2) == PPP_LQM) printf(" LQR"); else printf(" unknown"); } break; case LCPOPT_MN: if (len == 6) { TCHECK2(*(p + 2), 4); printf("0x%08x", EXTRACT_32BITS(p + 2)); } break; case LCPOPT_PFC: break; case LCPOPT_ACFC: break; case LCPOPT_LD: if (len == 4) { TCHECK2(*(p + 2), 2); printf("0x%04x", EXTRACT_16BITS(p + 2)); } break; case LCPOPT_CBACK: if (len < 3) break; TCHECK(p[2]); printf("Callback Operation %s (%u)", tok2str(ppp_callback_values,"Unknown",p[2]), p[2]); break; case LCPOPT_MLMRRU: if (len == 4) { TCHECK2(*(p + 2), 2); printf("%u", EXTRACT_16BITS(p + 2)); } break; case LCPOPT_MLED: if (len < 3) break; TCHECK(p[2]); switch (p[2]) { /* class */ case MEDCLASS_NULL: printf("Null"); break; case MEDCLASS_LOCAL: printf("Local"); /* XXX */ break; case MEDCLASS_IPV4: if (len != 7) break; TCHECK2(*(p + 3), 4); printf("IPv4 %s", ipaddr_string(p + 3)); break; case MEDCLASS_MAC: if (len != 9) break; TCHECK(p[8]); printf("MAC %02x:%02x:%02x:%02x:%02x:%02x", p[3], p[4], p[5], p[6], p[7], p[8]); break; case MEDCLASS_MNB: printf("Magic-Num-Block"); /* XXX */ break; case MEDCLASS_PSNDN: printf("PSNDN"); /* XXX */ break; } break; /* XXX: to be supported */ #if 0 case LCPOPT_DEP6: case LCPOPT_FCSALT: case LCPOPT_SDP: case LCPOPT_NUMMODE: case LCPOPT_DEP12: case LCPOPT_DEP14: case LCPOPT_DEP15: case LCPOPT_DEP16: case LCPOPT_MLSSNHF: case LCPOPT_PROP: case LCPOPT_DCEID: case LCPOPT_MPP: case LCPOPT_LCPAOPT: case LCPOPT_COBS: case LCPOPT_PE: case LCPOPT_MLHF: case LCPOPT_I18N: case LCPOPT_SDLOS: case LCPOPT_PPPMUX: break; #endif default: if(vflag<2) print_unknown_data(&p[2],"\n\t ",len-2); break; } if (vflag>1) print_unknown_data(&p[2],"\n\t ",len-2); /* exclude TLV header */ return len; trunc: printf("[|lcp]"); return 0; } /* ML-PPP*/ struct tok ppp_ml_flag_values[] = { { 0x80, "begin" }, { 0x40, "end" }, { 0, NULL } }; static void handle_mlppp(const u_char *p, int length) { if (!eflag) printf("MLPPP, "); printf("seq 0x%03x, Flags [%s], length %u", (EXTRACT_16BITS(p))&0x0fff, /* only support 12-Bit sequence space for now */ bittok2str(ppp_ml_flag_values, "none", *p & 0xc0), length); return; } /* CHAP */ static void handle_chap(const u_char *p, int length) { u_int code, len; int val_size, name_size, msg_size; const u_char *p0; int i; p0 = p; if (length < 1) { printf("[|chap]"); return; } else if (length < 4) { TCHECK(*p); printf("[|chap 0x%02x]", *p); return; } TCHECK(*p); code = *p; printf("CHAP, %s (0x%02x)", tok2str(chapcode_values,"unknown",code), code); p++; TCHECK(*p); printf(", id %u", *p); /* ID */ p++; TCHECK2(*p, 2); len = EXTRACT_16BITS(p); p += 2; /* * Note that this is a generic CHAP decoding routine. Since we * don't know which flavor of CHAP (i.e. CHAP-MD5, MS-CHAPv1, * MS-CHAPv2) is used at this point, we can't decode packet * specifically to each algorithms. Instead, we simply decode * the GCD (Gratest Common Denominator) for all algorithms. */ switch (code) { case CHAP_CHAL: case CHAP_RESP: if (length - (p - p0) < 1) return; TCHECK(*p); val_size = *p; /* value size */ p++; if (length - (p - p0) < val_size) return; printf(", Value "); for (i = 0; i < val_size; i++) { TCHECK(*p); printf("%02x", *p++); } name_size = len - (p - p0); printf(", Name "); for (i = 0; i < name_size; i++) { TCHECK(*p); safeputchar(*p++); } break; case CHAP_SUCC: case CHAP_FAIL: msg_size = len - (p - p0); printf(", Msg "); for (i = 0; i< msg_size; i++) { TCHECK(*p); safeputchar(*p++); } break; } return; trunc: printf("[|chap]"); } /* PAP (see RFC 1334) */ static void handle_pap(const u_char *p, int length) { u_int code, len; int peerid_len, passwd_len, msg_len; const u_char *p0; int i; p0 = p; if (length < 1) { printf("[|pap]"); return; } else if (length < 4) { TCHECK(*p); printf("[|pap 0x%02x]", *p); return; } TCHECK(*p); code = *p; printf("PAP, %s (0x%02x)", tok2str(papcode_values,"unknown",code), code); p++; TCHECK(*p); printf(", id %u", *p); /* ID */ p++; TCHECK2(*p, 2); len = EXTRACT_16BITS(p); p += 2; if ((int)len > length) { printf(", length %u > packet size", len); return; } length = len; if (length < (p - p0)) { printf(", length %u < PAP header length", length); return; } switch (code) { case PAP_AREQ: if (length - (p - p0) < 1) return; TCHECK(*p); peerid_len = *p; /* Peer-ID Length */ p++; if (length - (p - p0) < peerid_len) return; printf(", Peer "); for (i = 0; i < peerid_len; i++) { TCHECK(*p); safeputchar(*p++); } if (length - (p - p0) < 1) return; TCHECK(*p); passwd_len = *p; /* Password Length */ p++; if (length - (p - p0) < passwd_len) return; printf(", Name "); for (i = 0; i < passwd_len; i++) { TCHECK(*p); safeputchar(*p++); } break; case PAP_AACK: case PAP_ANAK: if (length - (p - p0) < 1) return; TCHECK(*p); msg_len = *p; /* Msg-Length */ p++; if (length - (p - p0) < msg_len) return; printf(", Msg "); for (i = 0; i< msg_len; i++) { TCHECK(*p); safeputchar(*p++); } break; } return; trunc: printf("[|pap]"); } /* BAP */ static void handle_bap(const u_char *p _U_, int length _U_) { /* XXX: to be supported!! */ } /* IPCP config options */ static int print_ipcp_config_options(const u_char *p, int length) { int len, opt; u_int compproto, ipcomp_subopttotallen, ipcomp_subopt, ipcomp_suboptlen; if (length < 2) return 0; TCHECK2(*p, 2); len = p[1]; opt = p[0]; if (length < len) return 0; if (len < 2) { printf("\n\t %s Option (0x%02x), length %u (bogus, should be >= 2)", tok2str(ipcpopt_values,"unknown",opt), opt, len); return 0; } printf("\n\t %s Option (0x%02x), length %u: ", tok2str(ipcpopt_values,"unknown",opt), opt, len); switch (opt) { case IPCPOPT_2ADDR: /* deprecated */ if (len != 10) goto invlen; TCHECK2(*(p + 6), 4); printf("src %s, dst %s", ipaddr_string(p + 2), ipaddr_string(p + 6)); break; case IPCPOPT_IPCOMP: if (len < 4) goto invlen; TCHECK2(*(p + 2), 2); compproto = EXTRACT_16BITS(p+2); printf("%s (0x%02x):", tok2str(ipcpopt_compproto_values,"Unknown",compproto), compproto); switch (compproto) { case PPP_VJC: /* XXX: VJ-Comp parameters should be decoded */ break; case IPCPOPT_IPCOMP_HDRCOMP: if (len < IPCPOPT_IPCOMP_MINLEN) goto invlen; TCHECK2(*(p + 2), IPCPOPT_IPCOMP_MINLEN); printf("\n\t TCP Space %u, non-TCP Space %u" \ ", maxPeriod %u, maxTime %u, maxHdr %u", EXTRACT_16BITS(p+4), EXTRACT_16BITS(p+6), EXTRACT_16BITS(p+8), EXTRACT_16BITS(p+10), EXTRACT_16BITS(p+12)); /* suboptions present ? */ if (len > IPCPOPT_IPCOMP_MINLEN) { ipcomp_subopttotallen = len - IPCPOPT_IPCOMP_MINLEN; p += IPCPOPT_IPCOMP_MINLEN; printf("\n\t Suboptions, length %u", ipcomp_subopttotallen); while (ipcomp_subopttotallen >= 2) { TCHECK2(*p, 2); ipcomp_subopt = *p; ipcomp_suboptlen = *(p+1); /* sanity check */ if (ipcomp_subopt == 0 || ipcomp_suboptlen == 0 ) break; /* XXX: just display the suboptions for now */ printf("\n\t\t%s Suboption #%u, length %u", tok2str(ipcpopt_compproto_subopt_values, "Unknown", ipcomp_subopt), ipcomp_subopt, ipcomp_suboptlen); ipcomp_subopttotallen -= ipcomp_suboptlen; p += ipcomp_suboptlen; } } break; default: break; } break; case IPCPOPT_ADDR: /* those options share the same format - fall through */ case IPCPOPT_MOBILE4: case IPCPOPT_PRIDNS: case IPCPOPT_PRINBNS: case IPCPOPT_SECDNS: case IPCPOPT_SECNBNS: if (len != 6) goto invlen; TCHECK2(*(p + 2), 4); printf("%s", ipaddr_string(p + 2)); break; default: if(vflag<2) print_unknown_data(&p[2],"\n\t ",len-2); break; } if (vflag>1) print_unknown_data(&p[2],"\n\t ",len-2); /* exclude TLV header */ return len; invlen: printf(", invalid-length-%d", opt); return 0; trunc: printf("[|ipcp]"); return 0; } /* IP6CP config options */ static int print_ip6cp_config_options(const u_char *p, int length) { int len, opt; if (length < 2) return 0; TCHECK2(*p, 2); len = p[1]; opt = p[0]; if (length < len) return 0; if (len < 2) { printf("\n\t %s Option (0x%02x), length %u (bogus, should be >= 2)", tok2str(ip6cpopt_values,"unknown",opt), opt, len); return 0; } printf("\n\t %s Option (0x%02x), length %u: ", tok2str(ip6cpopt_values,"unknown",opt), opt, len); switch (opt) { case IP6CP_IFID: if (len != 10) goto invlen; TCHECK2(*(p + 2), 8); printf("%04x:%04x:%04x:%04x", EXTRACT_16BITS(p + 2), EXTRACT_16BITS(p + 4), EXTRACT_16BITS(p + 6), EXTRACT_16BITS(p + 8)); break; default: if(vflag<2) print_unknown_data(&p[2],"\n\t ",len-2); break; } if (vflag>1) print_unknown_data(&p[2],"\n\t ",len-2); /* exclude TLV header */ return len; invlen: printf(", invalid-length-%d", opt); return 0; trunc: printf("[|ip6cp]"); return 0; } /* CCP config options */ static int print_ccp_config_options(const u_char *p, int length) { int len, opt; if (length < 2) return 0; TCHECK2(*p, 2); len = p[1]; opt = p[0]; if (length < len) return 0; if (len < 2) { printf("\n\t %s Option (0x%02x), length %u (bogus, should be >= 2)", tok2str(ccpconfopts_values, "Unknown", opt), opt, len); return 0; } printf("\n\t %s Option (0x%02x), length %u:", tok2str(ccpconfopts_values, "Unknown", opt), opt, len); switch (opt) { /* fall through --> default: nothing supported yet */ case CCPOPT_OUI: case CCPOPT_PRED1: case CCPOPT_PRED2: case CCPOPT_PJUMP: case CCPOPT_HPPPC: case CCPOPT_STACLZS: case CCPOPT_MPPC: case CCPOPT_GFZA: case CCPOPT_V42BIS: case CCPOPT_BSDCOMP: case CCPOPT_LZSDCP: case CCPOPT_MVRCA: case CCPOPT_DEC: case CCPOPT_DEFLATE: case CCPOPT_RESV: default: if(vflag<2) print_unknown_data(&p[2],"\n\t ",len-2); break; } if (vflag>1) print_unknown_data(&p[2],"\n\t ",len-2); /* exclude TLV header */ return len; trunc: printf("[|ccp]"); return 0; } /* BACP config options */ static int print_bacp_config_options(const u_char *p, int length) { int len, opt; if (length < 2) return 0; TCHECK2(*p, 2); len = p[1]; opt = p[0]; if (length < len) return 0; if (len < 2) { printf("\n\t %s Option (0x%02x), length %u (bogus, should be >= 2)", tok2str(bacconfopts_values, "Unknown", opt), opt, len); return 0; } printf("\n\t %s Option (0x%02x), length %u:", tok2str(bacconfopts_values, "Unknown", opt), opt, len); switch (opt) { case BACPOPT_FPEER: TCHECK2(*(p + 2), 4); printf(", Magic-Num 0x%08x", EXTRACT_32BITS(p + 2)); break; default: if(vflag<2) print_unknown_data(&p[2],"\n\t ",len-2); break; } if (vflag>1) print_unknown_data(&p[2],"\n\t ",len-2); /* exclude TLV header */ return len; trunc: printf("[|bacp]"); return 0; } static void ppp_hdlc(const u_char *p, int length) { u_char *b, *s, *t, c; int i, proto; const void *se; b = (u_int8_t *)malloc(length); if (b == NULL) return; /* * Unescape all the data into a temporary, private, buffer. * Do this so that we dont overwrite the original packet * contents. */ for (s = (u_char *)p, t = b, i = length; i > 0; i--) { c = *s++; if (c == 0x7d) { if (i > 1) { i--; c = *s++ ^ 0x20; } else continue; } *t++ = c; } se = snapend; snapend = t; /* now lets guess about the payload codepoint format */ proto = *b; /* start with a one-octet codepoint guess */ switch (proto) { case PPP_IP: ip_print(gndo, b+1, t - b - 1); goto cleanup; #ifdef INET6 case PPP_IPV6: ip6_print(b+1, t - b - 1); goto cleanup; #endif default: /* no luck - try next guess */ break; } proto = EXTRACT_16BITS(b); /* next guess - load two octets */ switch (proto) { case (PPP_ADDRESS << 8 | PPP_CONTROL): /* looks like a PPP frame */ proto = EXTRACT_16BITS(b+2); /* load the PPP proto-id */ handle_ppp(proto, b+4, t - b - 4); break; default: /* last guess - proto must be a PPP proto-id */ handle_ppp(proto, b+2, t - b - 2); break; } cleanup: snapend = se; free(b); return; } /* PPP */ static void handle_ppp(u_int proto, const u_char *p, int length) { if ((proto & 0xff00) == 0x7e00) {/* is this an escape code ? */ ppp_hdlc(p-1, length); return; } switch (proto) { case PPP_LCP: /* fall through */ case PPP_IPCP: case PPP_OSICP: case PPP_MPLSCP: case PPP_IPV6CP: case PPP_CCP: case PPP_BACP: handle_ctrl_proto(proto, p, length); break; case PPP_ML: handle_mlppp(p, length); break; case PPP_CHAP: handle_chap(p, length); break; case PPP_PAP: handle_pap(p, length); break; case PPP_BAP: /* XXX: not yet completed */ handle_bap(p, length); break; case ETHERTYPE_IP: /*XXX*/ case PPP_VJNC: case PPP_IP: ip_print(gndo, p, length); break; #ifdef INET6 case ETHERTYPE_IPV6: /*XXX*/ case PPP_IPV6: ip6_print(p, length); break; #endif case ETHERTYPE_IPX: /*XXX*/ case PPP_IPX: ipx_print(p, length); break; case PPP_OSI: isoclns_print(p, length, length); break; case PPP_MPLS_UCAST: case PPP_MPLS_MCAST: mpls_print(p, length); break; case PPP_COMP: printf("compressed PPP data"); break; default: printf("%s ", tok2str(ppptype2str, "unknown PPP protocol (0x%04x)", proto)); print_unknown_data(p,"\n\t",length); break; } } /* Standard PPP printer */ u_int ppp_print(register const u_char *p, u_int length) { u_int proto,ppp_header; u_int olen = length; /* _o_riginal length */ u_int hdr_len = 0; /* * Here, we assume that p points to the Address and Control * field (if they present). */ if (length < 2) goto trunc; TCHECK2(*p, 2); ppp_header = EXTRACT_16BITS(p); switch(ppp_header) { case (PPP_WITHDIRECTION_IN << 8 | PPP_CONTROL): if (eflag) printf("In "); p += 2; length -= 2; hdr_len += 2; break; case (PPP_WITHDIRECTION_OUT << 8 | PPP_CONTROL): if (eflag) printf("Out "); p += 2; length -= 2; hdr_len += 2; break; case (PPP_ADDRESS << 8 | PPP_CONTROL): p += 2; /* ACFC not used */ length -= 2; hdr_len += 2; break; default: break; } if (length < 2) goto trunc; TCHECK(*p); if (*p % 2) { proto = *p; /* PFC is used */ p++; length--; hdr_len++; } else { TCHECK2(*p, 2); proto = EXTRACT_16BITS(p); p += 2; length -= 2; hdr_len += 2; } if (eflag) printf("%s (0x%04x), length %u: ", tok2str(ppptype2str, "unknown", proto), proto, olen); handle_ppp(proto, p, length); return (hdr_len); trunc: printf("[|ppp]"); return (0); } /* PPP I/F printer */ u_int ppp_if_print(const struct pcap_pkthdr *h, register const u_char *p) { register u_int length = h->len; register u_int caplen = h->caplen; if (caplen < PPP_HDRLEN) { printf("[|ppp]"); return (caplen); } #if 0 /* * XXX: seems to assume that there are 2 octets prepended to an * actual PPP frame. The 1st octet looks like Input/Output flag * while 2nd octet is unknown, at least to me * (mshindo@mshindo.net). * * That was what the original tcpdump code did. * * FreeBSD's "if_ppp.c" *does* set the first octet to 1 for outbound * packets and 0 for inbound packets - but only if the * protocol field has the 0x8000 bit set (i.e., it's a network * control protocol); it does so before running the packet through * "bpf_filter" to see if it should be discarded, and to see * if we should update the time we sent the most recent packet... * * ...but it puts the original address field back after doing * so. * * NetBSD's "if_ppp.c" doesn't set the first octet in that fashion. * * I don't know if any PPP implementation handed up to a BPF * device packets with the first octet being 1 for outbound and * 0 for inbound packets, so I (guy@alum.mit.edu) don't know * whether that ever needs to be checked or not. * * Note that NetBSD has a DLT_PPP_SERIAL, which it uses for PPP, * and its tcpdump appears to assume that the frame always * begins with an address field and a control field, and that * the address field might be 0x0f or 0x8f, for Cisco * point-to-point with HDLC framing as per section 4.3.1 of RFC * 1547, as well as 0xff, for PPP in HDLC-like framing as per * RFC 1662. * * (Is the Cisco framing in question what DLT_C_HDLC, in * BSD/OS, is?) */ if (eflag) printf("%c %4d %02x ", p[0] ? 'O' : 'I', length, p[1]); #endif ppp_print(p, length); return (0); } /* * PPP I/F printer to use if we know that RFC 1662-style PPP in HDLC-like * framing, or Cisco PPP with HDLC framing as per section 4.3.1 of RFC 1547, * is being used (i.e., we don't check for PPP_ADDRESS and PPP_CONTROL, * discard them *if* those are the first two octets, and parse the remaining * packet as a PPP packet, as "ppp_print()" does). * * This handles, for example, DLT_PPP_SERIAL in NetBSD. */ u_int ppp_hdlc_if_print(const struct pcap_pkthdr *h, register const u_char *p) { register u_int length = h->len; register u_int caplen = h->caplen; u_int proto; u_int hdrlen = 0; if (caplen < 2) { printf("[|ppp]"); return (caplen); } switch (p[0]) { case PPP_ADDRESS: if (caplen < 4) { printf("[|ppp]"); return (caplen); } if (eflag) printf("%02x %02x %d ", p[0], p[1], length); p += 2; length -= 2; hdrlen += 2; proto = EXTRACT_16BITS(p); p += 2; length -= 2; hdrlen += 2; printf("%s: ", tok2str(ppptype2str, "unknown PPP protocol (0x%04x)", proto)); handle_ppp(proto, p, length); break; case CHDLC_UNICAST: case CHDLC_BCAST: return (chdlc_if_print(h, p)); default: if (eflag) printf("%02x %02x %d ", p[0], p[1], length); p += 2; length -= 2; hdrlen += 2; /* * XXX - NetBSD's "ppp_netbsd_serial_if_print()" treats * the next two octets as an Ethernet type; does that * ever happen? */ printf("unknown addr %02x; ctrl %02x", p[0], p[1]); break; } return (hdrlen); } #define PPP_BSDI_HDRLEN 24 /* BSD/OS specific PPP printer */ u_int ppp_bsdos_if_print(const struct pcap_pkthdr *h _U_, register const u_char *p _U_) { register int hdrlength; #ifdef __bsdi__ register u_int length = h->len; register u_int caplen = h->caplen; u_int16_t ptype; const u_char *q; int i; if (caplen < PPP_BSDI_HDRLEN) { printf("[|ppp]"); return (caplen) } hdrlength = 0; #if 0 if (p[0] == PPP_ADDRESS && p[1] == PPP_CONTROL) { if (eflag) printf("%02x %02x ", p[0], p[1]); p += 2; hdrlength = 2; } if (eflag) printf("%d ", length); /* Retrieve the protocol type */ if (*p & 01) { /* Compressed protocol field */ ptype = *p; if (eflag) printf("%02x ", ptype); p++; hdrlength += 1; } else { /* Un-compressed protocol field */ ptype = ntohs(*(u_int16_t *)p); if (eflag) printf("%04x ", ptype); p += 2; hdrlength += 2; } #else ptype = 0; /*XXX*/ if (eflag) printf("%c ", p[SLC_DIR] ? 'O' : 'I'); if (p[SLC_LLHL]) { /* link level header */ struct ppp_header *ph; q = p + SLC_BPFHDRLEN; ph = (struct ppp_header *)q; if (ph->phdr_addr == PPP_ADDRESS && ph->phdr_ctl == PPP_CONTROL) { if (eflag) printf("%02x %02x ", q[0], q[1]); ptype = ntohs(ph->phdr_type); if (eflag && (ptype == PPP_VJC || ptype == PPP_VJNC)) { printf("%s ", tok2str(ppptype2str, "proto-#%d", ptype)); } } else { if (eflag) { printf("LLH=["); for (i = 0; i < p[SLC_LLHL]; i++) printf("%02x", q[i]); printf("] "); } } } if (eflag) printf("%d ", length); if (p[SLC_CHL]) { q = p + SLC_BPFHDRLEN + p[SLC_LLHL]; switch (ptype) { case PPP_VJC: ptype = vjc_print(q, ptype); hdrlength = PPP_BSDI_HDRLEN; p += hdrlength; switch (ptype) { case PPP_IP: ip_print(p, length); break; #ifdef INET6 case PPP_IPV6: ip6_print(p, length); break; #endif case PPP_MPLS_UCAST: case PPP_MPLS_MCAST: mpls_print(p, length); break; } goto printx; case PPP_VJNC: ptype = vjc_print(q, ptype); hdrlength = PPP_BSDI_HDRLEN; p += hdrlength; switch (ptype) { case PPP_IP: ip_print(p, length); break; #ifdef INET6 case PPP_IPV6: ip6_print(p, length); break; #endif case PPP_MPLS_UCAST: case PPP_MPLS_MCAST: mpls_print(p, length); break; } goto printx; default: if (eflag) { printf("CH=["); for (i = 0; i < p[SLC_LLHL]; i++) printf("%02x", q[i]); printf("] "); } break; } } hdrlength = PPP_BSDI_HDRLEN; #endif length -= hdrlength; p += hdrlength; switch (ptype) { case PPP_IP: ip_print(p, length); break; #ifdef INET6 case PPP_IPV6: ip6_print(p, length); break; #endif case PPP_MPLS_UCAST: case PPP_MPLS_MCAST: mpls_print(p, length); break; default: printf("%s ", tok2str(ppptype2str, "unknown PPP protocol (0x%04x)", ptype)); } printx: #else /* __bsdi */ hdrlength = 0; #endif /* __bsdi__ */ return (hdrlength); } /* * Local Variables: * c-style: whitesmith * c-basic-offset: 8 * End: */ tcpdump-3.9.8/./af.h0000644000026300017500000000355210570560635012241 0ustar mcrmcr/* @(#) $Header: /tcpdump/master/tcpdump/af.h,v 1.3.2.1 2007/02/26 13:33:17 hannes Exp $ (LBL) */ /* * Copyright (c) 1998-2006 The TCPDUMP project * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that: (1) source code * distributions retain the above copyright notice and this paragraph * in its entirety, and (2) distributions including binary code include * the above copyright notice and this paragraph in its entirety in * the documentation or other materials provided with the distribution. * THIS SOFTWARE IS PROVIDED ``AS IS'' AND * WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT * LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * FOR A PARTICULAR PURPOSE. * * Original code by Hannes Gredler (hannes@juniper.net) */ extern struct tok af_values[]; extern struct tok bsd_af_values[]; /* RFC1700 address family numbers */ #define AFNUM_INET 1 #define AFNUM_INET6 2 #define AFNUM_NSAP 3 #define AFNUM_HDLC 4 #define AFNUM_BBN1822 5 #define AFNUM_802 6 #define AFNUM_E163 7 #define AFNUM_E164 8 #define AFNUM_F69 9 #define AFNUM_X121 10 #define AFNUM_IPX 11 #define AFNUM_ATALK 12 #define AFNUM_DECNET 13 #define AFNUM_BANYAN 14 #define AFNUM_E164NSAP 15 #define AFNUM_VPLS 25 /* draft-kompella-ppvpn-l2vpn */ #define AFNUM_L2VPN 196 /* still to be approved by IANA */ /* * BSD AF_ values. * * Unfortunately, the BSDs don't all use the same value for AF_INET6, * so, because we want to be able to read captures from all of the BSDs, * we check for all of them. */ #define BSD_AFNUM_INET 2 #define BSD_AFNUM_NS 6 /* XEROX NS protocols */ #define BSD_AFNUM_ISO 7 #define BSD_AFNUM_APPLETALK 16 #define BSD_AFNUM_IPX 23 #define BSD_AFNUM_INET6_BSD 24 /* OpenBSD (and probably NetBSD), BSD/OS */ #define BSD_AFNUM_INET6_FREEBSD 28 #define BSD_AFNUM_INET6_DARWIN 30 tcpdump-3.9.8/./pcap_dump_ftell.c0000644000026300017500000000271410250152511014764 0ustar mcrmcr/* * Copyright (c) 1993, 1994, 1995, 1996, 1997 * The Regents of the University of California. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that: (1) source code distributions * retain the above copyright notice and this paragraph in its entirety, (2) * distributions including binary code include the above copyright notice and * this paragraph in its entirety in the documentation or other materials * provided with the distribution, and (3) all advertising materials mentioning * features or use of this software display the following acknowledgement: * ``This product includes software developed by the University of California, * Lawrence Berkeley Laboratory and its contributors.'' Neither the name of * the University nor the names of its contributors may be used to endorse * or promote products derived from this software without specific prior * written permission. * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. */ #ifndef lint static const char rcsid[] _U_ = "@(#) $Header: /tcpdump/master/tcpdump/pcap_dump_ftell.c,v 1.1.2.1 2005/06/03 22:10:17 guy Exp $ (LBL)"; #endif #include #include #include "pcap-missing.h" long pcap_dump_ftell(pcap_dumper_t *p) { return (ftell((FILE *)p)); } tcpdump-3.9.8/./tests/0000755000026300017500000000000010504040016012616 5ustar mcrmcrtcpdump-3.9.8/./tests/print-capX.out0000644000026300017500000006721010504040016015402 0ustar mcrmcr23:57:35.938066 IP 127.0.0.1.55920 > 127.0.0.1.80: S 928549246:928549246(0) win 32767 0x0000: 4500 003c 1b68 4000 4006 2152 7f00 0001 E..<.h@.@.!R.... 0x0010: 7f00 0001 da70 0050 3758 897e 0000 0000 .....p.P7X.~.... 0x0020: a002 7fff 1421 0000 0204 400c 0402 080a .....!....@..... 0x0030: 4ddc 9216 0000 0000 0103 0302 M........... 23:57:35.938122 IP 127.0.0.1.80 > 127.0.0.1.55920: S 930778609:930778609(0) ack 928549247 win 32767 0x0000: 4500 003c 0000 4000 4006 3cba 7f00 0001 E..<..@.@.<..... 0x0010: 7f00 0001 0050 da70 377a 8df1 3758 897f .....P.p7z..7X.. 0x0020: a012 7fff 6eb1 0000 0204 400c 0402 080a ....n.....@..... 0x0030: 4ddc 9216 4ddc 9216 0103 0302 M...M....... 23:57:35.938167 IP 127.0.0.1.55920 > 127.0.0.1.80: . ack 1 win 8192 0x0000: 4500 0034 1b6a 4000 4006 2158 7f00 0001 E..4.j@.@.!X.... 0x0010: 7f00 0001 da70 0050 3758 897f 377a 8df2 .....p.P7X..7z.. 0x0020: 8010 2000 37d0 0000 0101 080a 4ddc 9216 ....7.......M... 0x0030: 4ddc 9216 M... 23:57:35.939423 IP 127.0.0.1.55920 > 127.0.0.1.80: P 1:203(202) ack 1 win 8192 0x0000: 4500 00fe 1b6c 4000 4006 208c 7f00 0001 E....l@.@....... 0x0010: 7f00 0001 da70 0050 3758 897f 377a 8df2 .....p.P7X..7z.. 0x0020: 8018 2000 fef2 0000 0101 080a 4ddc 9217 ............M... 0x0030: 4ddc 9216 4745 5420 2f20 4854 5450 2f31 M...GET./.HTTP/1 0x0040: 2e31 0d0a 486f 7374 3a20 6c6f 6361 6c68 .1..Host:.localh 0x0050: 6f73 740d 0a55 7365 722d 4167 656e 743a ost..User-Agent: 0x0060: 2045 4c69 6e6b 732f 302e 3130 2e34 2d37 .ELinks/0.10.4-7 0x0070: 2d64 6562 6961 6e20 2874 6578 746d 6f64 -debian.(textmod 0x0080: 653b 204c 696e 7578 2032 2e36 2e31 312d e;.Linux.2.6.11- 0x0090: 312d 3638 362d 736d 7020 6936 3836 3b20 1-686-smp.i686;. 0x00a0: 3133 3278 3536 2d32 290d 0a41 6363 6570 132x56-2)..Accep 0x00b0: 743a 202a 2f2a 0d0a 4163 6365 7074 2d45 t:.*/*..Accept-E 0x00c0: 6e63 6f64 696e 673a 2067 7a69 700d 0a41 ncoding:.gzip..A 0x00d0: 6363 6570 742d 4c61 6e67 7561 6765 3a20 ccept-Language:. 0x00e0: 656e 0d0a 436f 6e6e 6563 7469 6f6e 3a20 en..Connection:. 0x00f0: 4b65 6570 2d41 6c69 7665 0d0a 0d0a Keep-Alive.... 23:57:35.940474 IP 127.0.0.1.80 > 127.0.0.1.55920: . ack 203 win 8192 0x0000: 4500 0034 1fe4 4000 4006 1cde 7f00 0001 E..4..@.@....... 0x0010: 7f00 0001 0050 da70 377a 8df2 3758 8a49 .....P.p7z..7X.I 0x0020: 8010 2000 3703 0000 0101 080a 4ddc 9218 ....7.......M... 0x0030: 4ddc 9217 M... 23:57:35.941232 IP 127.0.0.1.80 > 127.0.0.1.55920: P 1:5560(5559) ack 203 win 8192 0x0000: 4500 15eb 1fe6 4000 4006 0725 7f00 0001 E.....@.@..%.... 0x0010: 7f00 0001 0050 da70 377a 8df2 3758 8a49 .....P.p7z..7X.I 0x0020: 8018 2000 13e0 0000 0101 080a 4ddc 9219 ............M... 0x0030: 4ddc 9217 4854 5450 2f31 2e31 2032 3030 M...HTTP/1.1.200 0x0040: 204f 4b0d 0a44 6174 653a 2057 6564 2c20 .OK..Date:.Wed,. 0x0050: 3036 204a 756c 2032 3030 3520 3033 3a35 06.Jul.2005.03:5 0x0060: 373a 3335 2047 4d54 0d0a 5365 7276 6572 7:35.GMT..Server 0x0070: 3a20 4170 6163 6865 2f31 2e33 2e33 330d :.Apache/1.3.33. 0x0080: 0a4c 6173 742d 4d6f 6469 6669 6564 3a20 .Last-Modified:. 0x0090: 5375 6e2c 2031 3520 4175 6720 3230 3034 Sun,.15.Aug.2004 0x00a0: 2030 303a 3433 3a34 3120 474d 540d 0a45 .00:43:41.GMT..E 0x00b0: 5461 673a 2022 3665 3830 6630 2d31 3438 Tag:."6e80f0-148 0x00c0: 612d 3431 3165 6231 6264 220d 0a41 6363 a-411eb1bd"..Acc 0x00d0: 6570 742d 5261 6e67 6573 3a20 6279 7465 ept-Ranges:.byte 0x00e0: 730d 0a43 6f6e 7465 6e74 2d4c 656e 6774 s..Content-Lengt 0x00f0: 683a 2035 3235 380d 0a4b 6565 702d 416c h:.5258..Keep-Al 0x0100: 6976 653a 2074 696d 656f 7574 3d31 352c ive:.timeout=15, 0x0110: 206d 6178 3d31 3030 0d0a 436f 6e6e 6563 .max=100..Connec 0x0120: 7469 6f6e 3a20 4b65 6570 2d41 6c69 7665 tion:.Keep-Alive 0x0130: 0d0a 436f 6e74 656e 742d 5479 7065 3a20 ..Content-Type:. 0x0140: 7465 7874 2f68 746d 6c3b 2063 6861 7273 text/html;.chars 0x0150: 6574 3d69 736f 2d38 3835 392d 310d 0a0d et=iso-8859-1... 0x0160: 0a3c 2144 4f43 5459 5045 2048 544d 4c20 . 0x01a0: 0a3c 4854 4d4c 3e0a 3c48 4541 443e 0a20 .... 0x01b0: 2020 3c4d 4554 4120 4854 5450 2d45 5155 .......... 0x0250: 3c54 4954 4c45 3e50 6c61 6365 686f 6c64 Placehold 0x0260: 6572 2070 6167 653c 2f54 4954 4c45 3e0a er.page. 0x0270: 3c2f 4845 4144 3e0a 3c42 4f44 5920 5445 ... 0x02d0: 3c48 313e 506c 6163 6568 6f6c 6465 7220

Placeholder. 0x02e0: 7061 6765 3c2f 4831 3e0a 3c48 323e 4966 page

.

If 0x02f0: 2079 6f75 2061 7265 206a 7573 7420 6272 .you.are.just.br 0x0300: 6f77 7369 6e67 2074 6865 2077 6562 3c2f owsing.the.web..

The.owne 0x0320: 7220 6f66 2074 6869 7320 7765 6220 7369 r.of.this.web.si 0x0330: 7465 2068 6173 206e 6f74 2070 7574 2075 te.has.not.put.u 0x0340: 7020 616e 7920 7765 6220 7061 6765 7320 p.any.web.pages. 0x0350: 7965 742e 0a50 6c65 6173 6520 636f 6d65 yet..Please.come 0x0360: 2062 6163 6b20 6c61 7465 722e 3c2f 503e .back.later.

0x0370: 0a0a 3c50 3e3c 534d 414c 4c3e 3c43 4954 ..

Move.along,.no 0x0390: 7468 696e 6720 746f 2073 6565 2068 6572 thing.to.see.her 0x03a0: 652e 2e2e 3c2f 4349 5445 3e20 3a2d 293c e....:-)< 0x03b0: 2f53 4d41 4c4c 3e3c 2f50 3e0a 0a3c 4832 /SMALL>

..

If.you.are.tryi 0x03d0: 6e67 2074 6f20 6c6f 6361 7465 2074 6865 ng.to.locate.the 0x03e0: 2061 646d 696e 6973 7472 6174 6f72 206f .administrator.o 0x03f0: 6620 7468 6973 206d 6163 6869 6e65 3c2f f.this.machine..

If.you.w 0x0410: 616e 7420 746f 2072 6570 6f72 7420 736f ant.to.report.so 0x0420: 6d65 7468 696e 6720 6162 6f75 7420 7468 mething.about.th 0x0430: 6973 2068 6f73 7427 7320 6265 6861 7669 is.host's.behavi 0x0440: 6f72 2c20 706c 6561 7365 0a63 6f6e 7461 or,.please.conta 0x0450: 6374 2074 6865 2049 6e74 6572 6e65 7420 ct.the.Internet. 0x0460: 5365 7276 6963 6520 5072 6f76 6964 6572 Service.Provider 0x0470: 2028 4953 5029 2069 6e76 6f6c 7665 6420 .(ISP).involved. 0x0480: 6469 7265 6374 6c79 2e3c 2f50 3e0a 0a3c directly.

..< 0x0490: 503e 5365 6520 7468 6520 3c41 2068 7265 P>See.the.Networ 0x04c0: 6b20 4162 7573 650a 436c 6561 7269 6e67 k.Abuse.Clearing 0x04d0: 686f 7573 653c 2f41 3e20 666f 7220 686f house.for.ho 0x04e0: 7720 746f 2064 6f20 7468 6973 2e3c 2f50 w.to.do.this.

..

If.you.ar 0x0500: 6520 7468 6520 6164 6d69 6e69 7374 7261 e.the.administra 0x0510: 746f 7220 6f66 2074 6869 7320 6d61 6368 tor.of.this.mach 0x0520: 696e 653c 2f48 323e 0a0a 3c50 3e54 6865 ine

..

The 0x0530: 2069 6e69 7469 616c 2069 6e73 7461 6c6c .initial.install 0x0540: 6174 696f 6e20 6f66 203c 4120 6872 6566 ation.of.Debian 0x0570: 2773 0a61 7061 6368 653c 2f41 3e20 7765 's.apache.we 0x0580: 6220 7365 7276 6572 2070 6163 6b61 6765 b.server.package 0x0590: 2077 6173 2073 7563 6365 7373 6675 6c2e .was.successful. 0x05a0: 3c2f 503e 0a0a 3c50 3e3c 5354 524f 4e47

..

You.should.repl 0x05c0: 6163 6520 7468 6973 2070 6167 6520 7769 ace.this.page.wi 0x05d0: 7468 2079 6f75 7220 6f77 6e20 7765 6220 th.your.own.web. 0x05e0: 7061 6765 7320 6173 0a73 6f6f 6e20 6173 pages.as.soon.as 0x05f0: 2070 6f73 7369 626c 652e 3c2f 5354 524f .possible.

..

Unle 0x0610: 7373 2079 6f75 2063 6861 6e67 6564 2069 ss.you.changed.i 0x0620: 7473 2063 6f6e 6669 6775 7261 7469 6f6e ts.configuration 0x0630: 2c20 796f 7572 206e 6577 2073 6572 7665 ,.your.new.serve 0x0640: 7220 6973 2063 6f6e 6669 6775 7265 6420 r.is.configured. 0x0650: 6173 2066 6f6c 6c6f 7773 3a0a 3c55 4c3e as.follows:.

    0x0660: 0a3c 4c49 3e0a 436f 6e66 6967 7572 6174 .
  • .Configurat 0x0670: 696f 6e20 6669 6c65 7320 6361 6e20 6265 ion.files.can.be 0x0680: 2066 6f75 6e64 2069 6e20 3c54 543e 2f65 .found.in./e 0x0690: 7463 2f61 7061 6368 653c 2f54 543e 2e3c tc/apache.< 0x06a0: 2f4c 493e 0a0a 3c4c 493e 0a54 6865 203c /LI>..
  • .The.< 0x06b0: 5454 3e44 6f63 756d 656e 7452 6f6f 743c TT>DocumentRoot< 0x06c0: 2f54 543e 2c20 7768 6963 6820 6973 2074 /TT>,.which.is.t 0x06d0: 6865 2064 6972 6563 746f 7279 2075 6e64 he.directory.und 0x06e0: 6572 2077 6869 6368 2061 6c6c 2079 6f75 er.which.all.you 0x06f0: 720a 4854 4d4c 2066 696c 6573 2073 686f r.HTML.files.sho 0x0700: 756c 6420 6578 6973 742c 2069 7320 7365 uld.exist,.is.se 0x0710: 7420 746f 203c 5454 3e2f 7661 722f 7777 t.to./var/ww 0x0720: 773c 2f54 543e 2e3c 2f4c 493e 0a0a 3c4c w.
  • ...CGI.scripts.a 0x0740: 7265 206c 6f6f 6b65 6420 666f 7220 696e re.looked.for.in 0x0750: 203c 5454 3e2f 7573 722f 6c69 622f 6367 ./usr/lib/cg 0x0760: 692d 6269 6e3c 2f54 543e 2c20 7768 6963 i-bin,.whic 0x0770: 6820 6973 2077 6865 7265 0a44 6562 6961 h.is.where.Debia 0x0780: 6e20 7061 636b 6167 6573 2077 696c 6c20 n.packages.will. 0x0790: 706c 6163 6520 7468 6569 7220 7363 7269 place.their.scri 0x07a0: 7074 732e 3c2f 4c49 3e0a 0a3c 4c49 3e0a pts...
  • . 0x07b0: 4c6f 6720 6669 6c65 7320 6172 6520 706c Log.files.are.pl 0x07c0: 6163 6564 2069 6e20 3c54 543e 2f76 6172 aced.in./var 0x07d0: 2f6c 6f67 2f61 7061 6368 653c 2f54 543e /log/apache 0x07e0: 2c20 616e 6420 7769 6c6c 2062 6520 726f ,.and.will.be.ro 0x07f0: 7461 7465 640a 7765 656b 6c79 2e20 2054 tated.weekly...T 0x0800: 6865 2066 7265 7175 656e 6379 206f 6620 he.frequency.of. 0x0810: 726f 7461 7469 6f6e 2063 616e 2062 6520 rotation.can.be. 0x0820: 6561 7369 6c79 2063 6861 6e67 6564 2062 easily.changed.b 0x0830: 7920 6564 6974 696e 670a 3c54 543e 2f65 y.editing./e 0x0840: 7463 2f6c 6f67 726f 7461 7465 2e64 2f61 tc/logrotate.d/a 0x0850: 7061 6368 653c 2f54 543e 2e3c 2f4c 493e pache.
  • 0x0860: 0a0a 3c4c 493e 0a54 6865 2064 6566 6175 ..
  • .The.defau 0x0870: 6c74 2064 6972 6563 746f 7279 2069 6e64 lt.directory.ind 0x0880: 6578 2069 7320 3c54 543e 696e 6465 782e ex.is.index. 0x0890: 6874 6d6c 3c2f 5454 3e2c 206d 6561 6e69 html,.meani 0x08a0: 6e67 2074 6861 7420 7265 7175 6573 7473 ng.that.requests 0x08b0: 0a66 6f72 2061 2064 6972 6563 746f 7279 .for.a.directory 0x08c0: 203c 5454 3e2f 666f 6f2f 6261 722f 3c2f ./foo/bar/.will.give.th 0x08e0: 6520 636f 6e74 656e 7473 206f 6620 7468 e.contents.of.th 0x08f0: 6520 6669 6c65 203c 5454 3e2f 7661 722f e.file./var/ 0x0900: 7777 772f 666f 6f2f 6261 722f 696e 6465 www/foo/bar/inde 0x0910: 782e 6874 6d6c 3c2f 5454 3e0a 6966 2069 x.html.if.i 0x0920: 7420 6578 6973 7473 2028 6173 7375 6d69 t.exists.(assumi 0x0930: 6e67 2074 6861 7420 3c54 543e 2f76 6172 ng.that./var 0x0940: 2f77 7777 3c2f 5454 3e20 6973 2079 6f75 /www.is.you 0x0950: 7220 3c54 543e 446f 6375 6d65 6e74 526f r.DocumentRo 0x0960: 6f74 3c2f 5454 3e29 2e3c 2f4c 493e 0a0a ot).
  • .. 0x0970: 3c4c 493e 0a55 7365 7220 6469 7265 6374
  • .User.direct 0x0980: 6f72 6965 7320 6172 6520 656e 6162 6c65 ories.are.enable 0x0990: 642c 2061 6e64 2075 7365 7220 646f 6375 d,.and.user.docu 0x09a0: 6d65 6e74 7320 7769 6c6c 2062 6520 6c6f ments.will.be.lo 0x09b0: 6f6b 6564 2066 6f72 0a69 6e20 7468 6520 oked.for.in.the. 0x09c0: 3c54 543e 7075 626c 6963 5f68 746d 6c3c public_html< 0x09d0: 2f54 543e 2064 6972 6563 746f 7279 206f /TT>.directory.o 0x09e0: 6620 7468 6520 7573 6572 7327 2068 6f6d f.the.users'.hom 0x09f0: 6573 2e20 2054 6865 7365 2064 6972 730a es...These.dirs. 0x0a00: 7368 6f75 6c64 2062 6520 756e 6465 7220 should.be.under. 0x0a10: 3c54 543e 2f68 6f6d 653c 2f54 543e 2c20 /home,. 0x0a20: 616e 6420 7573 6572 7320 7769 6c6c 206e and.users.will.n 0x0a30: 6f74 2062 6520 6162 6c65 2074 6f20 7379 ot.be.able.to.sy 0x0a40: 6d6c 696e 6b0a 746f 2066 696c 6573 2074 mlink.to.files.t 0x0a50: 6865 7920 646f 6e27 7420 6f77 6e2e 3c2f hey.don't.own...
.All.t 0x0a70: 6865 2073 7461 6e64 6172 6420 6170 6163 he.standard.apac 0x0a80: 6865 206d 6f64 756c 6573 2061 7265 2061 he.modules.are.a 0x0a90: 7661 696c 6162 6c65 2077 6974 6820 7468 vailable.with.th 0x0aa0: 6973 2072 656c 6561 7365 2061 6e64 2061 is.release.and.a 0x0ab0: 7265 0a6e 6f77 206d 616e 6167 6564 2077 re.now.managed.w 0x0ac0: 6974 6820 6465 6263 6f6e 662e 2020 5479 ith.debconf...Ty 0x0ad0: 7065 203c 5454 3e64 706b 672d 7265 636f pe.dpkg-reco 0x0ae0: 6e66 6967 7572 6520 6170 6163 6865 3c2f nfigure.apache.to.select.wh 0x0b00: 6963 6820 6d6f 6475 6c65 7320 796f 7520 ich.modules.you. 0x0b10: 7761 6e74 2065 6e61 626c 6564 2e20 204d want.enabled...M 0x0b20: 616e 7920 6f74 6865 7220 6d6f 6475 6c65 any.other.module 0x0b30: 7320 6172 6520 6176 6169 6c61 626c 650a s.are.available. 0x0b40: 7468 726f 7567 6820 7468 6520 4465 6269 through.the.Debi 0x0b50: 616e 2070 6163 6b61 6765 2073 7973 7465 an.package.syste 0x0b60: 6d20 7769 7468 2074 6865 206e 616d 6573 m.with.the.names 0x0b70: 203c 5454 3e6c 6962 6170 6163 6865 2d6d .libapache-m 0x0b80: 6f64 2d2a 3c2f 5454 3e2e 0a49 6620 796f od-*..If.yo 0x0b90: 7520 6e65 6564 2074 6f20 636f 6d70 696c u.need.to.compil 0x0ba0: 6520 6120 6d6f 6475 6c65 2079 6f75 7273 e.a.module.yours 0x0bb0: 656c 662c 2079 6f75 2077 696c 6c20 6e65 elf,.you.will.ne 0x0bc0: 6564 2074 6f20 696e 7374 616c 6c20 7468 ed.to.install.th 0x0bd0: 650a 3c54 543e 6170 6163 6865 2d64 6576 e.apache-dev 0x0be0: 3c2f 5454 3e20 7061 636b 6167 652e 0a0a .package... 0x0bf0: 3c50 3e4d 6f72 6520 646f 6375 6d65 6e74

More.document 0x0c00: 6174 696f 6e20 6f6e 2041 7061 6368 6520 ation.on.Apache. 0x0c10: 6361 6e20 6265 2066 6f75 6e64 206f 6e3a can.be.found.on: 0x0c20: 0a3c 554c 3e0a 3c4c 493e 0a54 6865 203c .

    .
  • .The.< 0x0c30: 4120 4852 4546 3d22 2f64 6f63 2f61 7061 A.HREF="/doc/apa 0x0c40: 6368 652d 646f 632f 6d61 6e75 616c 2f22 che-doc/manual/" 0x0c50: 3e41 7061 6368 6520 646f 6375 6d65 6e74 >Apache.document 0x0c60: 6174 696f 6e3c 2f41 3e20 7374 6f72 6564 ation.stored 0x0c70: 206f 6e20 796f 7572 2073 6572 7665 722e .on.your.server. 0x0c80: 3c2f 4c49 3e0a 0a3c 4c49 3e0a 5468 6520
  • ..
  • .The. 0x0c90: 3c41 2048 5245 463d 2268 7474 703a 2f2f Apache.Project< 0x0cc0: 2f41 3e20 686f 6d65 2073 6974 652e 3c2f /A>.home.site...
  • .The.Apache-SSL.home.site.
  • ..
  • .The.mo 0x0d50: 6420 7065 726c 3c2f 413e 2068 6f6d 6520 d.perl.home. 0x0d60: 7369 7465 2e3c 2f4c 493e 0a0a 3c4c 493e site.
  • ..
  • 0x0d70: 0a54 6865 203c 4120 4852 4546 3d22 6874 .The.Apache 0x0da0: 5765 656b 3c2f 413e 206e 6577 736c 6574 Week.newslet 0x0db0: 7465 722e 3c2f 4c49 3e0a 0a3c 4c49 3e0a ter.
  • ..
  • . 0x0dc0: 5468 6520 3c41 2048 5245 463d 2268 7474 The.Debian. 0x0df0: 5072 6f6a 6563 740a 446f 6375 6d65 6e74 Project.Document 0x0e00: 6174 696f 6e3c 2f41 3e20 7768 6963 6820 ation.which. 0x0e10: 636f 6e74 6169 6e73 2048 4f57 544f 732c contains.HOWTOs, 0x0e20: 2046 4151 732c 2061 6e64 2073 6f66 7477 .FAQs,.and.softw 0x0e30: 6172 6520 7570 6461 7465 732e 3c2f 4c49 are.updates.
  • .
..

You. 0x0e50: 6361 6e20 616c 736f 2063 6f6e 7375 6c74 can.also.consult 0x0e60: 2074 6865 206c 6973 7420 6f66 203c 4120 .the.list.of.World.Wide.We 0x0ea0: 6220 4672 6571 7565 6e74 6c79 2041 736b b.Frequently.Ask 0x0eb0: 6564 2051 7565 7374 696f 6e73 3c2f 413e ed.Questions 0x0ec0: 2066 6f72 2069 6e66 6f72 6d61 7469 6f6e .for.information 0x0ed0: 2e0a 0a3c 4832 3e4c 6574 206f 7468 6572 ...

Let.other 0x0ee0: 2070 656f 706c 6520 6b6e 6f77 2061 626f .people.know.abo 0x0ef0: 7574 2074 6869 7320 7365 7276 6572 3c2f ut.this.server..Netcraft 0x0f30: 2070 726f 7669 6465 7320 616e 2069 6e74 .provides.an.int 0x0f40: 6572 6573 7469 6e67 2066 7265 650a 7365 eresting.free.se 0x0f50: 7276 6963 6520 666f 7220 7765 6220 7369 rvice.for.web.si 0x0f60: 7465 206d 6f6e 6974 6f72 696e 6720 616e te.monitoring.an 0x0f70: 6420 7374 6174 6973 7469 6320 636f 6c6c d.statistic.coll 0x0f80: 6563 7469 6f6e 2e0a 596f 7520 6361 6e20 ection..You.can. 0x0f90: 6c65 7420 7468 656d 206b 6e6f 7720 6162 let.them.know.ab 0x0fa0: 6f75 7420 796f 7572 2073 6572 7665 7220 out.your.server. 0x0fb0: 7573 696e 6720 7468 6569 720a 3c41 2048 using.their.interface. 0x0ff0: 0a45 6e61 626c 696e 6720 7468 6520 6d6f .Enabling.the.mo 0x1000: 6e69 746f 7269 6e67 206f 6620 796f 7572 nitoring.of.your 0x1010: 2073 6572 7665 7220 7769 6c6c 2070 726f .server.will.pro 0x1020: 7669 6465 2061 2062 6574 7465 7220 676c vide.a.better.gl 0x1030: 6f62 616c 206f 7665 7276 6965 770a 6f66 obal.overview.of 0x1040: 2077 686f 2069 7320 7573 696e 6720 7768 .who.is.using.wh 0x1050: 6174 2061 6e64 2077 6865 7265 2c20 616e at.and.where,.an 0x1060: 6420 6974 2077 6f75 6c64 2067 6976 6520 d.it.would.give. 0x1070: 4465 6269 616e 2061 2062 6574 7465 720a Debian.a.better. 0x1080: 6f76 6572 7669 6577 206f 6620 7468 6520 overview.of.the. 0x1090: 6170 6163 6865 2070 6163 6b61 6765 2075 apache.package.u 0x10a0: 7361 6765 2e0a 0a3c 4832 3e41 626f 7574 sage...

About 0x10b0: 2074 6869 7320 7061 6765 3c2f 4832 3e0a .this.page

. 0x10c0: 0a3c 494d 4720 414c 4947 4e3d 2272 6967 ...

0x1110: 5468 6973 2069 7320 6120 706c 6163 6568 This.is.a.placeh 0x1120: 6f6c 6465 7220 7061 6765 2069 6e73 7461 older.page.insta 0x1130: 6c6c 6564 2062 7920 7468 6520 3c41 0a48 lled.by.the.Deb 0x1160: 6961 6e3c 2f41 3e0a 7265 6c65 6173 6520 ian.release. 0x1170: 6f66 2074 6865 2061 7061 6368 6520 5765 of.the.apache.We 0x1180: 6220 7365 7276 6572 2070 6163 6b61 6765 b.server.package 0x1190: 2e0a 0a3c 503e 5468 6973 2063 6f6d 7075 ...

This.compu 0x11a0: 7465 7220 6861 7320 696e 7374 616c 6c65 ter.has.installe 0x11b0: 6420 7468 6520 4465 6269 616e 2047 4e55 d.the.Debian.GNU 0x11c0: 2f4c 696e 7578 206f 7065 7261 7469 6e67 /Linux.operating 0x11d0: 2073 7973 7465 6d2c 0a62 7574 2069 7420 .system,.but.it. 0x11e0: 6861 7320 3c73 7472 6f6e 673e 6e6f 7468 has.noth 0x11f0: 696e 6720 746f 2064 6f20 7769 7468 2074 ing.to.do.with.t 0x1200: 6865 2044 6562 6961 6e0a 5072 6f6a 6563 he.Debian.Projec 0x1210: 743c 2f73 7472 6f6e 673e 2e20 506c 6561 t..Plea 0x1220: 7365 2064 6f20 3c73 7472 6f6e 673e 6e6f se.do.no 0x1230: 743c 2f73 7472 6f6e 673e 2063 6f6e 7461 t.conta 0x1240: 6374 2074 6865 2044 6562 6961 6e0a 5072 ct.the.Debian.Pr 0x1250: 6f6a 6563 7420 6162 6f75 7420 6974 2e3c oject.about.it.< 0x1260: 2f50 3e0a 0a3c 503e 4966 2079 6f75 2066 /P>..

If.you.f 0x1270: 696e 6420 6120 6275 6720 696e 2074 6869 ind.a.bug.in.thi 0x1280: 7320 6170 6163 6865 2070 6163 6b61 6765 s.apache.package 0x1290: 2c20 6f72 2069 6e20 4170 6163 6865 2069 ,.or.in.Apache.i 0x12a0: 7473 656c 662c 0a70 6c65 6173 6520 6669 tself,.please.fi 0x12b0: 6c65 2061 2062 7567 2072 6570 6f72 7420 le.a.bug.report. 0x12c0: 6f6e 2069 742e 2020 496e 7374 7275 6374 on.it...Instruct 0x12d0: 696f 6e73 206f 6e20 646f 696e 6720 7468 ions.on.doing.th 0x12e0: 6973 2c20 616e 6420 7468 650a 6c69 7374 is,.and.the.list 0x12f0: 206f 6620 3c41 2048 5245 463d 2268 7474 .of. 0x1320: 6b6e 6f77 6e20 6275 6773 3c2f 413e 206f known.bugs.o 0x1330: 6620 7468 6973 0a70 6163 6b61 6765 2c20 f.this.package,. 0x1340: 6361 6e20 6265 2066 6f75 6e64 2069 6e20 can.be.found.in. 0x1350: 7468 6520 0a3c 4120 4852 4546 3d22 6874 the..Debian.Bug.T 0x1390: 7261 636b 696e 6720 5379 7374 656d 3c2f racking.System...

Thanks.f 0x13b0: 6f72 2075 7369 6e67 2074 6869 7320 7061 or.using.this.pa 0x13c0: 636b 6167 652c 2061 6e64 2063 6f6e 6772 ckage,.and.congr 0x13d0: 6174 756c 6174 696f 6e73 2066 6f72 2079 atulations.for.y 0x13e0: 6f75 7220 6368 6f69 6365 206f 660a 6120 our.choice.of.a. 0x13f0: 4465 6269 616e 2073 7973 7465 6d21 3c2f Debian.system!...........< 0x1520: 212d 2d0a 2020 5468 6973 2070 6167 6520 !--...This.page. 0x1530: 7761 7320 696e 6974 6961 6c6c 7920 6372 was.initially.cr 0x1540: 6561 7465 6420 6279 204a 6f68 6e69 6520 eated.by.Johnie. 0x1550: 496e 6772 616d 2028 6874 7470 3a2f 2f6e Ingram.(http://n 0x1560: 6574 676f 642e 6e65 742f 290a 2020 4974 etgod.net/)...It 0x1570: 2077 6173 206c 6174 6572 2065 6469 7465 .was.later.edite 0x1580: 6420 6279 204d 6174 7468 6577 2057 696c d.by.Matthew.Wil 0x1590: 636f 7820 616e 6420 4a6f 7369 7020 526f cox.and.Josip.Ro 0x15a0: 6469 6e2e 0a20 204c 6173 7420 6d6f 6469 din....Last.modi 0x15b0: 6669 6564 3a20 2444 6174 653a 2032 3030 fied:.$Date:.200 0x15c0: 342f 3036 2f32 3020 3135 3a33 333a 3537 4/06/20.15:33:57 0x15d0: 2024 2e0a 2020 2d2d 3e0a 0a3c 2f42 4f44 .$....-->.... 23:57:35.941260 IP 127.0.0.1.55920 > 127.0.0.1.80: . ack 5560 win 12383 0x0000: 4500 0034 1b6e 4000 4006 2154 7f00 0001 E..4.n@.@.!T.... 0x0010: 7f00 0001 da70 0050 3758 8a49 377a a3a9 .....p.P7X.I7z.. 0x0020: 8010 305f 10ea 0000 0101 080a 4ddc 9219 ..0_........M... 0x0030: 4ddc 9219 M... 23:57:37.229575 IP 127.0.0.1.55920 > 127.0.0.1.80: F 203:203(0) ack 5560 win 12383 0x0000: 4500 0034 1b70 4000 4006 2152 7f00 0001 E..4.p@.@.!R.... 0x0010: 7f00 0001 da70 0050 3758 8a49 377a a3a9 .....p.P7X.I7z.. 0x0020: 8011 305f 0be1 0000 0101 080a 4ddc 9721 ..0_........M..! 0x0030: 4ddc 9219 M... 23:57:37.230839 IP 127.0.0.1.80 > 127.0.0.1.55920: F 5560:5560(0) ack 204 win 8192 0x0000: 4500 0034 1fe8 4000 4006 1cda 7f00 0001 E..4..@.@....... 0x0010: 7f00 0001 0050 da70 377a a3a9 3758 8a4a .....P.p7z..7X.J 0x0020: 8011 2000 1735 0000 0101 080a 4ddc 9723 .....5......M..# 0x0030: 4ddc 9721 M..! 23:57:37.230900 IP 127.0.0.1.55920 > 127.0.0.1.80: . ack 5561 win 12383 0x0000: 4500 0034 1b72 4000 4006 2150 7f00 0001 E..4.r@.@.!P.... 0x0010: 7f00 0001 da70 0050 3758 8a4a 377a a3aa .....p.P7X.J7z.. 0x0020: 8010 305f 06d4 0000 0101 080a 4ddc 9723 ..0_........M..# 0x0030: 4ddc 9723 M..# tcpdump-3.9.8/./tests/isakmp1.out0000644000026300017500000000010310320056003014705 0ustar mcrmcrIP 127.0.0.1.500 > 127.0.0.1.500: isakmp: phase 2/others ? #190[C] tcpdump-3.9.8/./tests/lmp.pcap0000644000026300017500000000330410320056212014254 0ustar mcrmcrÔò¡ÿÿ¤@fêbb]\êÆuІJET­òߤ  ÃNÃN@8’€BȤ@<ñFF]\êÆuІJE8­óß¿  ÃNÃN$ 2<¤@€òbb]\êÆuІJET­ôߢ  ÃNÃN@8 2 2¤@óZZ]\êÆuІJEL­õß©  ÃNÃN80 2 2¤@rôRR]\êÆuІJED­öß°  ÃNÃN0( 2¤@Cõ::]\êÆuІJE,­÷ßÇ  ÃNÃN¤@¥÷ŠŠ]\êÆuІJE|­øßv  ÃNÃNh`; $À¨À¨ –BÈBÈ $   –N“1-N™ÜÖa¤@ŒøRR]\êÆuІJED­ùß­  ÃNÃN0( 2d ¤@eùJJ]\êÆuІJE<­úß´  ÃNÃN(  ¤@1úBB]\êÆuІJE4­ûß»  ÃNÃN  ¤@ûBB]\êÆuІJE4­üߺ  ÃNÃN   ¤@ÐûBB]\êÆuІJE4­ýß¹  ÃNÃN   ¤@üBB]\êÆuІJE4­þ߸  ÃNÃN   ¤@iýBB]\êÆuІJE4­ÿß·  ÃNÃN   ¤@8þ::]\êÆuІJE,®ß¾  ÃNÃN¤@%ÿNN]\êÆuІJE@®ß©  ÃNÃN,$ ¤@VV]\êÆuІJEH®ß   ÃNÃN4, À€¤@ÕNN]\êÆuІJE@®ß§  ÃNÃN,$ ÀÀtcpdump-3.9.8/./tests/isakmp2.sh0000644000026300017500000000026607776431320014547 0ustar mcrmcr#!/bin/sh uudecode isakmp-pointer-loop.puu echo -n test isakmp2... if (../tcpdump -t -n -r isakmp-pointer-loop.pcap | diff - isakmp2.out) then echo passed. else echo failed. fi tcpdump-3.9.8/./tests/mpls-ldp-hello.pcap0000644000026300017500000000016210320056212016314 0ustar mcrmcrÔò¡ê GYº>T‡ JJÿ!EÀF<Û‘ à††2Ôž& p tcpdump-3.9.8/./tests/08-sunrise-sunset-aes.puu0000644000026300017500000000404510034121700017354 0ustar mcrmcrbegin 644 08-sunrise-sunset-aes.pcap MU,.RH0(`!``````````````&```!``````````````"F````I@```!```&1D M11```&1D(P@`10``F/SJ``!`,OD"P`$"%\`!`BW1(T5G`````>:['.C0J(%P MVF'>(TU6&*"9A,`,/KS\:>DH>O_L(51)_[YY"L9?8'?J4V:_.]B+6UR\T>39D+=NA;$``````````*8```"F````$``` M9&1%$```9&0C"`!%``"8_.L``$`R^0'``0(7P`$"+=$C16<````";K2P<-=Q MYE]@=^I39K\[V$1HDU9'L,6BVK.^B4]E6QY&:?3?T)G?"RSU;X!J]]7S)<`, M*L!SYO^RUWR?!EIJMWU=5B406YL-I`]LK`^;-3%(NEY#R`ST=W40=:*[M$*8 M#`GLTK(5ZCS"BC@``````````I@```*8````0 M``!D9$40``!D9",(`$4``)C\[```0#+Y`,`!`A?``0(MT2-%9P````,-RO@E M%F`X`Y3]7F3YK9N>=6-;U&'6">_4H80DMY^Z9E3ZL3[ONN*L<"Z@7(VO]XT^ M/2JP<(/^8NTO-4\/B5AJEC4N;,\"7-&(;9AM_2G5A1C.[LBK3')P?AE;$I[) M!8N&RC?OTD77ELURFXRD/JD(:@RER``````````"F````I@`` M`!```&1D11```&1D(P@`10``F/SM``!`,OC_P`$"%\`!`BW1(T5G````!(;* M-^_21=S8F&G50PJ5Y>5K%@R;)A(E<5YD'@86@GT"-&&MHP*.A=?%=:FDZH=4 M*9":>]'G'CB4%2?PJ"2^H*51\8P!9T`X3#;F+H$[4Z$7ZL0<\S=S\%`:BW9U2'@U^@D,,:.P``````````*8```"F M````$```9&1%$```9&0C"`!%``"8_.X``$`R^/[``0(7P`$"+=$C16<````% M,2>GIY3H1?JQ!SS-W/P4!BW&*&A[$!XGK<^M^>_X193"G"1QTWG>Q"CO25$" MPM+1+8[6&(17\EE\P:6-WVPT=911?@'-Z,,/UVZ2!QV(X4513U9]P62CJMS> M^ODBGHU=%T.H2&Z<4,8(!4,2[&A4^H="L:+`=4G?*(7,2@``````````I@`` M`*8````0``!D9$40``!D9",(`$4``)C\[P``0#+X_<`!`A?``0(MT2-%9P`` M``870ZA(;IQ0Q@@%0Q+L:%3Z@*HQPZA]3STWDY#CYJGOJH)K>I' MEHMF"X!^G,H@,YWT7^=60.3/$7?AYH)G9GBD%%#,D]!EDA]B*?UE>U96+"5\ MK=""/.LO'__^;$NI`L#D]@&G?Z7B2O#GI?NDK MF[7JPN,8V\H>%G+)'+%+FL*&\8+H2^KFWF5YQ:$4V!,1?G;=OYD;!,3YD'V( MW[Y!I(U=X9[\:L)(5GBJ,B!-5N$.CGV$VLD^R?Z,KL[AMI(ZC-P````````` M`*8```"F````$```9&1%$```9&0C"`!%``"8_/$``$`R^/O``0(7P`$"+=$C M16<````(PDA6>*HR($U6X0Z.?83:R;Y0&'2065/"*M'ELXD?1%3\L3TC.UK HKWB(C5O@78>9LQ^<0Z6]F=:<;@[>L^;/\-6WB81[GX)LGD@`` ` end tcpdump-3.9.8/./tests/.#esp1.out.1.30000644000026300017500000000224010320056003014635 0ustar mcrmcrIP 192.1.2.23 > 192.1.2.45: ESP(spi=0x12345678,seq=0x1), length 116: IP 192.0.2.1 > 192.0.1.1: ICMP echo request seq 1280, length 64 (ipip-proto-4) IP 192.1.2.23 > 192.1.2.45: ESP(spi=0x12345678,seq=0x2), length 116: IP 192.0.2.1 > 192.0.1.1: ICMP echo request seq 1536, length 64 (ipip-proto-4) IP 192.1.2.23 > 192.1.2.45: ESP(spi=0x12345678,seq=0x3), length 116: IP 192.0.2.1 > 192.0.1.1: ICMP echo request seq 1792, length 64 (ipip-proto-4) IP 192.1.2.23 > 192.1.2.45: ESP(spi=0x12345678,seq=0x4), length 116: IP 192.0.2.1 > 192.0.1.1: ICMP echo request seq 2048, length 64 (ipip-proto-4) IP 192.1.2.23 > 192.1.2.45: ESP(spi=0x12345678,seq=0x5), length 116: IP 192.0.2.1 > 192.0.1.1: ICMP echo request seq 2304, length 64 (ipip-proto-4) IP 192.1.2.23 > 192.1.2.45: ESP(spi=0x12345678,seq=0x6), length 116: IP 192.0.2.1 > 192.0.1.1: ICMP echo request seq 2560, length 64 (ipip-proto-4) IP 192.1.2.23 > 192.1.2.45: ESP(spi=0x12345678,seq=0x7), length 116: IP 192.0.2.1 > 192.0.1.1: ICMP echo request seq 2816, length 64 (ipip-proto-4) IP 192.1.2.23 > 192.1.2.45: ESP(spi=0x12345678,seq=0x8), length 116: IP 192.0.2.1 > 192.0.1.1: ICMP echo request seq 3072, length 64 (ipip-proto-4) tcpdump-3.9.8/./tests/chdlc-slarp.pcap0000644000026300017500000000007610233723305015672 0ustar mcrmcrÔò¡`h‚ËX@iÜ €5 1W@^&ÿÿé tcpdump-3.9.8/./tests/esp1.gdbinit0000644000026300017500000000021407626571255015056 0ustar mcrmcrset args -t -n -E "0x12345678@192.1.2.45 3des-cbc-hmac96:0x4043434545464649494a4a4c4c4f4f515152525454575758" -r 02-sunrise-sunset-esp.pcap tcpdump-3.9.8/./tests/02-sunrise-sunset-esp.pcap0000644000026300017500000000251010320056212017475 0ustar mcrmcrÔò¡––ddEdd#Eˆÿg@2ö•ÀÀ-4VxL E/<°’Ó§HÍåÈãœNè<þ–¡ä*ÏÒ¸z«Ñd+£¯œÃB,@­ßMà cc‡4q‡Ô ;ƒ¿ªC½„¤[v3ƒ™±õÊÌ’TE~YUpAãÜ‘vèoÓÿݰ¼ø0—––ddEdd#Eˆÿh@2ö”ÀÀ-4VxpAãÜ‘vès¯b‚;Ÿ/§©ÇZÔ,í¾¨t¡¬“‡ãâ &ìX.¾Ö¯4‡ã.õ¸2 *°ïNêÐÏìBCE&?î.žŸU:(Eé á5)ê”]øÍQº^ V,4öEÕæ1ý+¯––ddEdd#Eˆÿi@2ö“ÀÀ-4Vx]øÍQº^ `ÜVƒJŒR&¼j/vbÌ0Te#Ò[âŸtÙ}ÎË‘v®‘c»ŽÛøê¤SvQmrn«}’¶e\Fý;÷Ü]†[*x®%Õ ´´Þë…«f˜?W/½±fúÇå´tg––ddEdd#Eˆÿj@2ö’ÀÀ-4Vx«f˜?W/½vÙ+³þ/}¿ö&Ù¤«F}?žÁO€l¤4Ž«'õR6„¸¬³6̉´šÃâÉ‚z¾Pz7üîØENaD~üª§¯õZ|Ñ/Æ‚js©¯ßòëwu»œ}tcpdump-3.9.8/./tests/isakmp-identification-segfault.pcap0000644000026300017500000000054410320056212021552 0ustar mcrmcrÔò¡ÿÿ£a`@/Ê<<E8 lÿFõô$Jì%™pŒ„z‹tcpdump-3.9.8/./tests/isakmp4.sh0000644000026300017500000000032110225076343014532 0ustar mcrmcr#!/bin/sh uudecode isakmp4500.puu echo -n test isakmp4... ../tcpdump -t -n -E "file esp-secrets.txt" -r isakmp4500.pcap >isakmp4.new if diff isakmp4.new isakmp4.out then echo passed. else echo failed. fi tcpdump-3.9.8/./tests/isakmp4.new0000644000026300017500000000476310320056212014714 0ustar mcrmcrarp who-has 192.1.2.23 tell 192.1.2.254 arp reply 192.1.2.23 is-at 10:00:00:64:64:23 IP 192.1.2.254.500 > 192.1.2.23.500: isakmp: phase 1 I ident IP 192.1.2.23.500 > 192.1.2.254.500: isakmp: phase 1 R ident IP 192.1.2.254.500 > 192.1.2.23.500: isakmp: phase 1 I ident IP 192.1.2.23.500 > 192.1.2.254.500: isakmp: phase 1 R ident IP 192.1.2.254.4500 > 192.1.2.23.4500: NONESP-encap: isakmp: phase 1 I ident[E] IP 192.1.2.23.4500 > 192.1.2.254.4500: NONESP-encap: isakmp: phase 1 R ident[E] IP 192.1.2.254.4500 > 192.1.2.23.4500: NONESP-encap: isakmp: phase 2/others I oakley-quick[E] IP 192.1.2.23.4500 > 192.1.2.254.4500: NONESP-encap: isakmp: phase 2/others R oakley-quick[E] IP 192.1.2.254.4500 > 192.1.2.23.4500: NONESP-encap: isakmp: phase 2/others I oakley-quick[E] IP 192.1.2.254.4500 > 192.1.2.23.4500: UDP-encap: ESP(spi=0xf4dc0ae5,seq=0x1), length 132 arp who-has 192.1.2.254 tell 192.1.2.23 arp reply 192.1.2.254 is-at 10:00:00:de:ad:ba IP 192.1.2.23.4500 > 192.1.2.254.4500: NONESP-encap: isakmp: phase 2/others R oakley-quick[E] IP 192.1.2.254.4500 > 192.1.2.23.4500: NONESP-encap: isakmp: phase 2/others I oakley-quick[E] IP 192.1.2.254.4500 > 192.1.2.23.4500: UDP-encap: ESP(spi=0xf4dc0ae5,seq=0x2), length 132 IP 192.1.2.254.4500 > 192.1.2.23.4500: isakmp-nat-keep-alive IP 192.1.2.254.4500 > 192.1.2.23.4500: UDP-encap: ESP(spi=0xf4dc0ae5,seq=0x3), length 132 IP 192.1.2.23.4500 > 192.1.2.254.4500: NONESP-encap: isakmp: phase 2/others R oakley-quick[E] IP 192.1.2.254.4500 > 192.1.2.23.4500: NONESP-encap: isakmp: phase 2/others I oakley-quick[E] IP 192.1.2.254.4500 > 192.1.2.23.4500: UDP-encap: ESP(spi=0xf4dc0ae5,seq=0x4), length 132 IP 192.1.2.254.4500 > 192.1.2.23.4500: isakmp-nat-keep-alive IP 192.1.2.254.4500 > 192.1.2.23.4500: UDP-encap: ESP(spi=0xf4dc0ae5,seq=0x5), length 132 IP 192.1.2.254.4500 > 192.1.2.23.4500: UDP-encap: ESP(spi=0xf4dc0ae5,seq=0x6), length 132 arp who-has 192.1.2.23 tell 192.1.2.254 arp reply 192.1.2.23 is-at 10:00:00:64:64:23 IP 192.1.2.254.4500 > 192.1.2.23.4500: isakmp-nat-keep-alive IP 192.1.2.254.4500 > 192.1.2.23.4500: UDP-encap: ESP(spi=0xf4dc0ae5,seq=0x7), length 132 IP 192.1.2.23.4500 > 192.1.2.254.4500: NONESP-encap: isakmp: phase 2/others R oakley-quick[E] IP 192.1.2.254.4500 > 192.1.2.23.4500: UDP-encap: ESP(spi=0xf4dc0ae5,seq=0x8), length 132 arp who-has 192.1.2.254 tell 192.1.2.23 arp reply 192.1.2.254 is-at 10:00:00:de:ad:ba IP 192.1.2.254.4500 > 192.1.2.23.4500: isakmp-nat-keep-alive IP 192.1.2.23.4500 > 192.1.2.254.4500: NONESP-encap: isakmp: phase 2/others R inf[E] tcpdump-3.9.8/./tests/isakmp-delete-segfault.pcap0000644000026300017500000000132110320056212020015 0ustar mcrmcrÔò¡€.©©ÿÿÿÿÿÿE¦/@@ eapon1.new if diff eapon1.new eapon1.out then echo passed. else echo failed. fi tcpdump-3.9.8/./tests/esp2.sh0000644000026300017500000000057110225052107014032 0ustar mcrmcr#!/bin/sh uudecode 08-sunrise-sunset-esp2.puu echo -n test esp2... ../tcpdump -t -n -E "0x12345678@192.1.2.45 3des-cbc-hmac96:0x43434545464649494a4a4c4c4f4f51515252545457575840,0xabcdabcd@192.0.1.1 3des-cbc-hmac96:0x434545464649494a4a4c4c4f4f5151525254545757584043" -r 08-sunrise-sunset-esp2.pcap >esp2.new if diff esp2.new esp2.out then echo passed. else echo failed. fi tcpdump-3.9.8/./tests/.cvsignore0000644000026300017500000000034710225052105014624 0ustar mcrmcr*.new *.pcap 02-sunrise-sunset-esp.pcap 08-sunrise-sunset-aes.pcap 08-sunrise-sunset-esp.pcap 08-sunrise-sunset-esp2.pcap isakmp-delete-segfault.pcap isakmp-identification-segfault.pcap isakmp-pointer-loop.pcap run1.pcap run2.pcap tcpdump-3.9.8/./tests/mpls-traceroute.pcap0000644000026300017500000000364410063340174016630 0ustar mcrmcrÔò¡Ü IzÍ@ÎÐ00ÿ–E(¥L÷o  ¥K‚›IzÍ@ýÓ¬¬ÿ!E¨–@ÿM±   ÍE(¥L÷o  ¥K‚› Å_–IzÍ@ÎÞ00ÿ–E(¥M÷n  ¥K‚œIzÍ@ºú¬¬ÿ!E¨—@ÿM°   ÍE(¥M÷n  ¥K‚œ Å_–IzÍ@)ü00ÿ–E(¥N÷m  ¥K‚IzÍ@ þ¬¬ÿ!E¨˜@ÿM¯   ÍE(¥N÷m  ¥K‚ Å_–IzÍ@Y00ÿ–E(¥Oöl  ¥K‚žIzÍ@>¬¬ÿ!E¨ç@þ{(   ÍE(¥O÷l  ¥K‚ž ÄäIzÍ@~ 00ÿ–E(¥Pök  ¥K‚ŸIzÍ@ï ¬¬ÿ!E¨ç@þ{'   ÍE(¥P÷k  ¥K‚Ÿ ÄäIzÍ@: 00ÿ–E(¥Qöj  ¥K‚ IzÍ@¡¬¬ÿ!E¨ç @þ{&   ÌÿE(¥Q÷j  ¥K‚  ÄäIzÍ@Î00ÿ–E(¥Rõi  ¥K‚¡IzÍ@_<<ÿ!E8ŧ@ý›  ÔûE(¥R÷i  ¥K‚¡IzÍ@BM 00ÿ–E(¥Sõh  ¥K‚¢IzÍ@ºO <<ÿ!E8Ũ@ý›  ÔúE(¥S÷h  ¥K‚¢IzÍ@–Q 00ÿ–E(¥Tõg  ¥K‚£IzÍ@ëS <<ÿ!E8Å©@ý›  ÔùE(¥T÷g  ¥K‚£tcpdump-3.9.8/./tests/isakmp-identification-segfault.puu0000644000026300017500000000104010030062510021424 0ustar mcrmcrbegin 644 isakmp-identification-segfault.pcap MU,.RH0(`!````````````/__````````HV%@0"_*#@`\`0``/`$```(```!% M``$XH&P``/\1'$9_```!?P```0'U`?0!)$KL)9EPC(1ZBP(```````````40 M`@`````````!'````0`"```````````````````````````````````````` M```````````````````````````````````````````````````````````` M```````````````````````````````````````````````````````````` M```````````````````````````````````````````````````````````` M```````````````````````````````````````````````````````````` I```````````````````````````````````````````````````````` ` end tcpdump-3.9.8/./tests/isakmp3.sh0000644000026300017500000000034310225052110014517 0ustar mcrmcr#!/bin/sh uudecode isakmp-identification-segfault.puu echo -n test isakmp3... ../tcpdump -t -v -n -r isakmp-identification-segfault.pcap > isakmp3.new if diff isakmp3.new isakmp3.out then echo passed. else echo failed. fi tcpdump-3.9.8/./tests/print-flags.puu0000644000026300017500000002170510320055545015615 0ustar mcrmcrbegin 644 print-flags.pcap MU,.RH0(`!````````````/__```!````KU;+0E)0#@!*````2@`````````` M``````````@`10``/!MH0`!`!B%2?P```7\```':<`!0-UB)?@````"@`G__ M%"$```($0`P$`@@*3=R2%@`````!`P,"KU;+0HI0#@!*````2@`````````` M``````````@`10``/```0`!`!CRZ?P```7\```$`4-IP-WJ-\3=8B7^@$G__ M;K$```($0`P$`@@*3=R2%DWHWR@!@@`/[R```!`0@* M3=R2%TW?P```7\```$`4-IP-WJ-\C=8 MBDF`$"``-P,```$!"`I-W)(83=R2%Z]6RT*P7`X`^14``/D5```````````` M```````(`$4`%>L?YD``0`8')7\```%_```!`%#:<#=ZC?(W6(I)@!@@`!/@ M```!`0@*3=R2&4W71E#TQ,#`-"D-O;FYE8W1I;VXZ($ME97`M06QI=F4-"D-O M;G1E;G0M5'EP93H@=&5X="]H=&UL.R!C:&%R7!E(B!#3TY414Y4/2)T97AT+VAT;6P[(&-H M87)S970]:7-O+3@X-3DM,2(^"B`@(#Q-151!($Y!344](D1E2!W96(@<&%G97,@ M>65T+@I0;&5A6EN9R!T;R!L M;V-A=&4@=&AE(&%D;6EN:7-T6]U(&%R92!T:&4@861M:6YI2!E9&ET:6YG"CQ4 M5#XO971C+VQO9W)O=&%T92YD+V%P86-H93PO5%0^+CPO3$D^"@H\3$D^"E1H M92!D969A=6QT(&1I2!I;F1E>"!I6]U2!O9B!T:&4@=7-E6]U('=A;G0@96YA8FQE9"X@($UA;GD@;W1H97(@;6]D=6QE6]U6]U2!T:&4@/$$*2%)%1CTB:'1T<#HO+W=W=RYD96)I86XN;W)G+R(^1&5B M:6%N/"]!/@IR96QE87-E(&]F('1H92!A<&%C:&4@5V5B('-E7-T96TL"F)U="!I="!H87,@/'-T M6]U M(&9I;F0@82!B=6<@:6X@=&AI6]U2!*;VAN:64@26YG2!-871T:&5W(%=I;&-O>"!A;F0@ M2F]S:7`@4F]D:6XN"B`@3&%S="!M;V1I9FEE9#H@)$1A=&4Z(#(P,#0O,#8O M,C`@,34Z,S,Z-3<@)"X*("`M+3X*"CPO0D]$63X*/"](5$U,/@JO5LM"S%P. M`$(```!"````````````````````"`!%```T&VY``$`&(51_```!?P```=IP M`%`W6(I)-WJCJ8`0,%\0Z@```0$("DW``P!"````0@`` M``````````````````@`10``-!MP0`!`!B%2?P```7\```':<`!0-UB*23=Z MHZF`$3!?"^$```$!"`I-W) 127.0.0.1.80: S 928549246:928549246(0) win 32767 0x0000: 4500 003c 1b68 4000 4006 2152 7f00 0001 0x0010: 7f00 0001 da70 0050 3758 897e 0000 0000 0x0020: a002 7fff 1421 0000 0204 400c 0402 080a 0x0030: 4ddc 9216 0000 0000 0103 0302 23:57:35.938122 IP 127.0.0.1.80 > 127.0.0.1.55920: S 930778609:930778609(0) ack 928549247 win 32767 0x0000: 4500 003c 0000 4000 4006 3cba 7f00 0001 0x0010: 7f00 0001 0050 da70 377a 8df1 3758 897f 0x0020: a012 7fff 6eb1 0000 0204 400c 0402 080a 0x0030: 4ddc 9216 4ddc 9216 0103 0302 23:57:35.938167 IP 127.0.0.1.55920 > 127.0.0.1.80: . ack 1 win 8192 0x0000: 4500 0034 1b6a 4000 4006 2158 7f00 0001 0x0010: 7f00 0001 da70 0050 3758 897f 377a 8df2 0x0020: 8010 2000 37d0 0000 0101 080a 4ddc 9216 0x0030: 4ddc 9216 23:57:35.939423 IP 127.0.0.1.55920 > 127.0.0.1.80: P 1:203(202) ack 1 win 8192 0x0000: 4500 00fe 1b6c 4000 4006 208c 7f00 0001 0x0010: 7f00 0001 da70 0050 3758 897f 377a 8df2 0x0020: 8018 2000 fef2 0000 0101 080a 4ddc 9217 0x0030: 4ddc 9216 4745 5420 2f20 4854 5450 2f31 0x0040: 2e31 0d0a 486f 7374 3a20 6c6f 6361 6c68 0x0050: 6f73 740d 0a55 7365 722d 4167 656e 743a 0x0060: 2045 4c69 6e6b 732f 302e 3130 2e34 2d37 0x0070: 2d64 6562 6961 6e20 2874 6578 746d 6f64 0x0080: 653b 204c 696e 7578 2032 2e36 2e31 312d 0x0090: 312d 3638 362d 736d 7020 6936 3836 3b20 0x00a0: 3133 3278 3536 2d32 290d 0a41 6363 6570 0x00b0: 743a 202a 2f2a 0d0a 4163 6365 7074 2d45 0x00c0: 6e63 6f64 696e 673a 2067 7a69 700d 0a41 0x00d0: 6363 6570 742d 4c61 6e67 7561 6765 3a20 0x00e0: 656e 0d0a 436f 6e6e 6563 7469 6f6e 3a20 0x00f0: 4b65 6570 2d41 6c69 7665 0d0a 0d0a 23:57:35.940474 IP 127.0.0.1.80 > 127.0.0.1.55920: . ack 203 win 8192 0x0000: 4500 0034 1fe4 4000 4006 1cde 7f00 0001 0x0010: 7f00 0001 0050 da70 377a 8df2 3758 8a49 0x0020: 8010 2000 3703 0000 0101 080a 4ddc 9218 0x0030: 4ddc 9217 23:57:35.941232 IP 127.0.0.1.80 > 127.0.0.1.55920: P 1:5560(5559) ack 203 win 8192 0x0000: 4500 15eb 1fe6 4000 4006 0725 7f00 0001 0x0010: 7f00 0001 0050 da70 377a 8df2 3758 8a49 0x0020: 8018 2000 13e0 0000 0101 080a 4ddc 9219 0x0030: 4ddc 9217 4854 5450 2f31 2e31 2032 3030 0x0040: 204f 4b0d 0a44 6174 653a 2057 6564 2c20 0x0050: 3036 204a 756c 2032 3030 3520 3033 3a35 0x0060: 373a 3335 2047 4d54 0d0a 5365 7276 6572 0x0070: 3a20 4170 6163 6865 2f31 2e33 2e33 330d 0x0080: 0a4c 6173 742d 4d6f 6469 6669 6564 3a20 0x0090: 5375 6e2c 2031 3520 4175 6720 3230 3034 0x00a0: 2030 303a 3433 3a34 3120 474d 540d 0a45 0x00b0: 5461 673a 2022 3665 3830 6630 2d31 3438 0x00c0: 612d 3431 3165 6231 6264 220d 0a41 6363 0x00d0: 6570 742d 5261 6e67 6573 3a20 6279 7465 0x00e0: 730d 0a43 6f6e 7465 6e74 2d4c 656e 6774 0x00f0: 683a 2035 3235 380d 0a4b 6565 702d 416c 0x0100: 6976 653a 2074 696d 656f 7574 3d31 352c 0x0110: 206d 6178 3d31 3030 0d0a 436f 6e6e 6563 0x0120: 7469 6f6e 3a20 4b65 6570 2d41 6c69 7665 0x0130: 0d0a 436f 6e74 656e 742d 5479 7065 3a20 0x0140: 7465 7874 2f68 746d 6c3b 2063 6861 7273 0x0150: 6574 3d69 736f 2d38 3835 392d 310d 0a0d 0x0160: 0a3c 2144 4f43 5459 5045 2048 544d 4c20 0x0170: 5055 424c 4943 2022 2d2f 2f57 3343 2f2f 0x0180: 4454 4420 4854 4d4c 2034 2e30 3120 5472 0x0190: 616e 7369 7469 6f6e 616c 2f2f 454e 223e 0x01a0: 0a3c 4854 4d4c 3e0a 3c48 4541 443e 0a20 0x01b0: 2020 3c4d 4554 4120 4854 5450 2d45 5155 0x01c0: 4956 3d22 436f 6e74 656e 742d 5479 7065 0x01d0: 2220 434f 4e54 454e 543d 2274 6578 742f 0x01e0: 6874 6d6c 3b20 6368 6172 7365 743d 6973 0x01f0: 6f2d 3838 3539 2d31 223e 0a20 2020 3c4d 0x0200: 4554 4120 4e41 4d45 3d22 4465 7363 7269 0x0210: 7074 696f 6e22 2043 4f4e 5445 4e54 3d22 0x0220: 5468 6520 696e 6974 6961 6c20 696e 7374 0x0230: 616c 6c61 7469 6f6e 206f 6620 4465 6269 0x0240: 616e 2061 7061 6368 652e 223e 0a20 2020 0x0250: 3c54 4954 4c45 3e50 6c61 6365 686f 6c64 0x0260: 6572 2070 6167 653c 2f54 4954 4c45 3e0a 0x0270: 3c2f 4845 4144 3e0a 3c42 4f44 5920 5445 0x0280: 5854 3d22 2330 3030 3030 3022 2042 4743 0x0290: 4f4c 4f52 3d22 2346 4646 4646 4622 204c 0x02a0: 494e 4b3d 2223 3030 3030 4546 2220 564c 0x02b0: 494e 4b3d 2223 3535 3138 3841 2220 414c 0x02c0: 494e 4b3d 2223 4646 3030 3030 223e 0a0a 0x02d0: 3c48 313e 506c 6163 6568 6f6c 6465 7220 0x02e0: 7061 6765 3c2f 4831 3e0a 3c48 323e 4966 0x02f0: 2079 6f75 2061 7265 206a 7573 7420 6272 0x0300: 6f77 7369 6e67 2074 6865 2077 6562 3c2f 0x0310: 6832 3e0a 0a3c 503e 5468 6520 6f77 6e65 0x0320: 7220 6f66 2074 6869 7320 7765 6220 7369 0x0330: 7465 2068 6173 206e 6f74 2070 7574 2075 0x0340: 7020 616e 7920 7765 6220 7061 6765 7320 0x0350: 7965 742e 0a50 6c65 6173 6520 636f 6d65 0x0360: 2062 6163 6b20 6c61 7465 722e 3c2f 503e 0x0370: 0a0a 3c50 3e3c 534d 414c 4c3e 3c43 4954 0x0380: 453e 4d6f 7665 2061 6c6f 6e67 2c20 6e6f 0x0390: 7468 696e 6720 746f 2073 6565 2068 6572 0x03a0: 652e 2e2e 3c2f 4349 5445 3e20 3a2d 293c 0x03b0: 2f53 4d41 4c4c 3e3c 2f50 3e0a 0a3c 4832 0x03c0: 3e49 6620 796f 7520 6172 6520 7472 7969 0x03d0: 6e67 2074 6f20 6c6f 6361 7465 2074 6865 0x03e0: 2061 646d 696e 6973 7472 6174 6f72 206f 0x03f0: 6620 7468 6973 206d 6163 6869 6e65 3c2f 0x0400: 4832 3e0a 0a3c 503e 4966 2079 6f75 2077 0x0410: 616e 7420 746f 2072 6570 6f72 7420 736f 0x0420: 6d65 7468 696e 6720 6162 6f75 7420 7468 0x0430: 6973 2068 6f73 7427 7320 6265 6861 7669 0x0440: 6f72 2c20 706c 6561 7365 0a63 6f6e 7461 0x0450: 6374 2074 6865 2049 6e74 6572 6e65 7420 0x0460: 5365 7276 6963 6520 5072 6f76 6964 6572 0x0470: 2028 4953 5029 2069 6e76 6f6c 7665 6420 0x0480: 6469 7265 6374 6c79 2e3c 2f50 3e0a 0a3c 0x0490: 503e 5365 6520 7468 6520 3c41 2068 7265 0x04a0: 663d 2268 7474 703a 2f2f 7777 772e 6162 0x04b0: 7573 652e 6e65 742f 223e 4e65 7477 6f72 0x04c0: 6b20 4162 7573 650a 436c 6561 7269 6e67 0x04d0: 686f 7573 653c 2f41 3e20 666f 7220 686f 0x04e0: 7720 746f 2064 6f20 7468 6973 2e3c 2f50 0x04f0: 3e0a 0a3c 4832 3e49 6620 796f 7520 6172 0x0500: 6520 7468 6520 6164 6d69 6e69 7374 7261 0x0510: 746f 7220 6f66 2074 6869 7320 6d61 6368 0x0520: 696e 653c 2f48 323e 0a0a 3c50 3e54 6865 0x0530: 2069 6e69 7469 616c 2069 6e73 7461 6c6c 0x0540: 6174 696f 6e20 6f66 203c 4120 6872 6566 0x0550: 3d22 6874 7470 3a2f 2f77 7777 2e64 6562 0x0560: 6961 6e2e 6f72 672f 223e 4465 6269 616e 0x0570: 2773 0a61 7061 6368 653c 2f41 3e20 7765 0x0580: 6220 7365 7276 6572 2070 6163 6b61 6765 0x0590: 2077 6173 2073 7563 6365 7373 6675 6c2e 0x05a0: 3c2f 503e 0a0a 3c50 3e3c 5354 524f 4e47 0x05b0: 3e59 6f75 2073 686f 756c 6420 7265 706c 0x05c0: 6163 6520 7468 6973 2070 6167 6520 7769 0x05d0: 7468 2079 6f75 7220 6f77 6e20 7765 6220 0x05e0: 7061 6765 7320 6173 0a73 6f6f 6e20 6173 0x05f0: 2070 6f73 7369 626c 652e 3c2f 5354 524f 0x0600: 4e47 3e3c 2f50 3e0a 0a3c 503e 556e 6c65 0x0610: 7373 2079 6f75 2063 6861 6e67 6564 2069 0x0620: 7473 2063 6f6e 6669 6775 7261 7469 6f6e 0x0630: 2c20 796f 7572 206e 6577 2073 6572 7665 0x0640: 7220 6973 2063 6f6e 6669 6775 7265 6420 0x0650: 6173 2066 6f6c 6c6f 7773 3a0a 3c55 4c3e 0x0660: 0a3c 4c49 3e0a 436f 6e66 6967 7572 6174 0x0670: 696f 6e20 6669 6c65 7320 6361 6e20 6265 0x0680: 2066 6f75 6e64 2069 6e20 3c54 543e 2f65 0x0690: 7463 2f61 7061 6368 653c 2f54 543e 2e3c 0x06a0: 2f4c 493e 0a0a 3c4c 493e 0a54 6865 203c 0x06b0: 5454 3e44 6f63 756d 656e 7452 6f6f 743c 0x06c0: 2f54 543e 2c20 7768 6963 6820 6973 2074 0x06d0: 6865 2064 6972 6563 746f 7279 2075 6e64 0x06e0: 6572 2077 6869 6368 2061 6c6c 2079 6f75 0x06f0: 720a 4854 4d4c 2066 696c 6573 2073 686f 0x0700: 756c 6420 6578 6973 742c 2069 7320 7365 0x0710: 7420 746f 203c 5454 3e2f 7661 722f 7777 0x0720: 773c 2f54 543e 2e3c 2f4c 493e 0a0a 3c4c 0x0730: 493e 0a43 4749 2073 6372 6970 7473 2061 0x0740: 7265 206c 6f6f 6b65 6420 666f 7220 696e 0x0750: 203c 5454 3e2f 7573 722f 6c69 622f 6367 0x0760: 692d 6269 6e3c 2f54 543e 2c20 7768 6963 0x0770: 6820 6973 2077 6865 7265 0a44 6562 6961 0x0780: 6e20 7061 636b 6167 6573 2077 696c 6c20 0x0790: 706c 6163 6520 7468 6569 7220 7363 7269 0x07a0: 7074 732e 3c2f 4c49 3e0a 0a3c 4c49 3e0a 0x07b0: 4c6f 6720 6669 6c65 7320 6172 6520 706c 0x07c0: 6163 6564 2069 6e20 3c54 543e 2f76 6172 0x07d0: 2f6c 6f67 2f61 7061 6368 653c 2f54 543e 0x07e0: 2c20 616e 6420 7769 6c6c 2062 6520 726f 0x07f0: 7461 7465 640a 7765 656b 6c79 2e20 2054 0x0800: 6865 2066 7265 7175 656e 6379 206f 6620 0x0810: 726f 7461 7469 6f6e 2063 616e 2062 6520 0x0820: 6561 7369 6c79 2063 6861 6e67 6564 2062 0x0830: 7920 6564 6974 696e 670a 3c54 543e 2f65 0x0840: 7463 2f6c 6f67 726f 7461 7465 2e64 2f61 0x0850: 7061 6368 653c 2f54 543e 2e3c 2f4c 493e 0x0860: 0a0a 3c4c 493e 0a54 6865 2064 6566 6175 0x0870: 6c74 2064 6972 6563 746f 7279 2069 6e64 0x0880: 6578 2069 7320 3c54 543e 696e 6465 782e 0x0890: 6874 6d6c 3c2f 5454 3e2c 206d 6561 6e69 0x08a0: 6e67 2074 6861 7420 7265 7175 6573 7473 0x08b0: 0a66 6f72 2061 2064 6972 6563 746f 7279 0x08c0: 203c 5454 3e2f 666f 6f2f 6261 722f 3c2f 0x08d0: 5454 3e20 7769 6c6c 2067 6976 6520 7468 0x08e0: 6520 636f 6e74 656e 7473 206f 6620 7468 0x08f0: 6520 6669 6c65 203c 5454 3e2f 7661 722f 0x0900: 7777 772f 666f 6f2f 6261 722f 696e 6465 0x0910: 782e 6874 6d6c 3c2f 5454 3e0a 6966 2069 0x0920: 7420 6578 6973 7473 2028 6173 7375 6d69 0x0930: 6e67 2074 6861 7420 3c54 543e 2f76 6172 0x0940: 2f77 7777 3c2f 5454 3e20 6973 2079 6f75 0x0950: 7220 3c54 543e 446f 6375 6d65 6e74 526f 0x0960: 6f74 3c2f 5454 3e29 2e3c 2f4c 493e 0a0a 0x0970: 3c4c 493e 0a55 7365 7220 6469 7265 6374 0x0980: 6f72 6965 7320 6172 6520 656e 6162 6c65 0x0990: 642c 2061 6e64 2075 7365 7220 646f 6375 0x09a0: 6d65 6e74 7320 7769 6c6c 2062 6520 6c6f 0x09b0: 6f6b 6564 2066 6f72 0a69 6e20 7468 6520 0x09c0: 3c54 543e 7075 626c 6963 5f68 746d 6c3c 0x09d0: 2f54 543e 2064 6972 6563 746f 7279 206f 0x09e0: 6620 7468 6520 7573 6572 7327 2068 6f6d 0x09f0: 6573 2e20 2054 6865 7365 2064 6972 730a 0x0a00: 7368 6f75 6c64 2062 6520 756e 6465 7220 0x0a10: 3c54 543e 2f68 6f6d 653c 2f54 543e 2c20 0x0a20: 616e 6420 7573 6572 7320 7769 6c6c 206e 0x0a30: 6f74 2062 6520 6162 6c65 2074 6f20 7379 0x0a40: 6d6c 696e 6b0a 746f 2066 696c 6573 2074 0x0a50: 6865 7920 646f 6e27 7420 6f77 6e2e 3c2f 0x0a60: 4c49 3e0a 0a3c 2f55 4c3e 0a41 6c6c 2074 0x0a70: 6865 2073 7461 6e64 6172 6420 6170 6163 0x0a80: 6865 206d 6f64 756c 6573 2061 7265 2061 0x0a90: 7661 696c 6162 6c65 2077 6974 6820 7468 0x0aa0: 6973 2072 656c 6561 7365 2061 6e64 2061 0x0ab0: 7265 0a6e 6f77 206d 616e 6167 6564 2077 0x0ac0: 6974 6820 6465 6263 6f6e 662e 2020 5479 0x0ad0: 7065 203c 5454 3e64 706b 672d 7265 636f 0x0ae0: 6e66 6967 7572 6520 6170 6163 6865 3c2f 0x0af0: 5454 3e20 746f 0a73 656c 6563 7420 7768 0x0b00: 6963 6820 6d6f 6475 6c65 7320 796f 7520 0x0b10: 7761 6e74 2065 6e61 626c 6564 2e20 204d 0x0b20: 616e 7920 6f74 6865 7220 6d6f 6475 6c65 0x0b30: 7320 6172 6520 6176 6169 6c61 626c 650a 0x0b40: 7468 726f 7567 6820 7468 6520 4465 6269 0x0b50: 616e 2070 6163 6b61 6765 2073 7973 7465 0x0b60: 6d20 7769 7468 2074 6865 206e 616d 6573 0x0b70: 203c 5454 3e6c 6962 6170 6163 6865 2d6d 0x0b80: 6f64 2d2a 3c2f 5454 3e2e 0a49 6620 796f 0x0b90: 7520 6e65 6564 2074 6f20 636f 6d70 696c 0x0ba0: 6520 6120 6d6f 6475 6c65 2079 6f75 7273 0x0bb0: 656c 662c 2079 6f75 2077 696c 6c20 6e65 0x0bc0: 6564 2074 6f20 696e 7374 616c 6c20 7468 0x0bd0: 650a 3c54 543e 6170 6163 6865 2d64 6576 0x0be0: 3c2f 5454 3e20 7061 636b 6167 652e 0a0a 0x0bf0: 3c50 3e4d 6f72 6520 646f 6375 6d65 6e74 0x0c00: 6174 696f 6e20 6f6e 2041 7061 6368 6520 0x0c10: 6361 6e20 6265 2066 6f75 6e64 206f 6e3a 0x0c20: 0a3c 554c 3e0a 3c4c 493e 0a54 6865 203c 0x0c30: 4120 4852 4546 3d22 2f64 6f63 2f61 7061 0x0c40: 6368 652d 646f 632f 6d61 6e75 616c 2f22 0x0c50: 3e41 7061 6368 6520 646f 6375 6d65 6e74 0x0c60: 6174 696f 6e3c 2f41 3e20 7374 6f72 6564 0x0c70: 206f 6e20 796f 7572 2073 6572 7665 722e 0x0c80: 3c2f 4c49 3e0a 0a3c 4c49 3e0a 5468 6520 0x0c90: 3c41 2048 5245 463d 2268 7474 703a 2f2f 0x0ca0: 7777 772e 6170 6163 6865 2e6f 7267 2f22 0x0cb0: 3e41 7061 6368 6520 5072 6f6a 6563 743c 0x0cc0: 2f41 3e20 686f 6d65 2073 6974 652e 3c2f 0x0cd0: 4c49 3e0a 0a3c 4c49 3e0a 5468 6520 3c41 0x0ce0: 2048 5245 463d 2268 7474 703a 2f2f 7777 0x0cf0: 772e 6170 6163 6865 2d73 736c 2e6f 7267 0x0d00: 2f22 3e41 7061 6368 652d 5353 4c3c 2f41 0x0d10: 3e20 686f 6d65 2073 6974 652e 3c2f 4c49 0x0d20: 3e0a 0a3c 4c49 3e0a 5468 6520 3c41 2048 0x0d30: 5245 463d 2268 7474 703a 2f2f 7065 726c 0x0d40: 2e61 7061 6368 652e 6f72 672f 223e 6d6f 0x0d50: 6420 7065 726c 3c2f 413e 2068 6f6d 6520 0x0d60: 7369 7465 2e3c 2f4c 493e 0a0a 3c4c 493e 0x0d70: 0a54 6865 203c 4120 4852 4546 3d22 6874 0x0d80: 7470 3a2f 2f77 7777 2e61 7061 6368 6577 0x0d90: 6565 6b2e 636f 6d2f 223e 4170 6163 6865 0x0da0: 5765 656b 3c2f 413e 206e 6577 736c 6574 0x0db0: 7465 722e 3c2f 4c49 3e0a 0a3c 4c49 3e0a 0x0dc0: 5468 6520 3c41 2048 5245 463d 2268 7474 0x0dd0: 703a 2f2f 7777 772e 6465 6269 616e 2e6f 0x0de0: 7267 2f64 6f63 2f22 3e44 6562 6961 6e20 0x0df0: 5072 6f6a 6563 740a 446f 6375 6d65 6e74 0x0e00: 6174 696f 6e3c 2f41 3e20 7768 6963 6820 0x0e10: 636f 6e74 6169 6e73 2048 4f57 544f 732c 0x0e20: 2046 4151 732c 2061 6e64 2073 6f66 7477 0x0e30: 6172 6520 7570 6461 7465 732e 3c2f 4c49 0x0e40: 3e0a 3c2f 554c 3e0a 0a3c 503e 596f 7520 0x0e50: 6361 6e20 616c 736f 2063 6f6e 7375 6c74 0x0e60: 2074 6865 206c 6973 7420 6f66 203c 4120 0x0e70: 4852 4546 3d22 6874 7470 3a2f 2f77 7777 0x0e80: 2e62 6f75 7465 6c6c 2e63 6f6d 2f66 6171 0x0e90: 2f22 3e57 6f72 6c64 0a57 6964 6520 5765 0x0ea0: 6220 4672 6571 7565 6e74 6c79 2041 736b 0x0eb0: 6564 2051 7565 7374 696f 6e73 3c2f 413e 0x0ec0: 2066 6f72 2069 6e66 6f72 6d61 7469 6f6e 0x0ed0: 2e0a 0a3c 4832 3e4c 6574 206f 7468 6572 0x0ee0: 2070 656f 706c 6520 6b6e 6f77 2061 626f 0x0ef0: 7574 2074 6869 7320 7365 7276 6572 3c2f 0x0f00: 4832 3e0a 0a3c 4120 4852 4546 3d22 6874 0x0f10: 7470 3a2f 2f6e 6574 6372 6166 742e 636f 0x0f20: 6d2f 223e 4e65 7463 7261 6674 3c2f 413e 0x0f30: 2070 726f 7669 6465 7320 616e 2069 6e74 0x0f40: 6572 6573 7469 6e67 2066 7265 650a 7365 0x0f50: 7276 6963 6520 666f 7220 7765 6220 7369 0x0f60: 7465 206d 6f6e 6974 6f72 696e 6720 616e 0x0f70: 6420 7374 6174 6973 7469 6320 636f 6c6c 0x0f80: 6563 7469 6f6e 2e0a 596f 7520 6361 6e20 0x0f90: 6c65 7420 7468 656d 206b 6e6f 7720 6162 0x0fa0: 6f75 7420 796f 7572 2073 6572 7665 7220 0x0fb0: 7573 696e 6720 7468 6569 720a 3c41 2048 0x0fc0: 5245 463d 2268 7474 703a 2f2f 7570 7469 0x0fd0: 6d65 2e6e 6574 6372 6166 742e 636f 6d2f 0x0fe0: 223e 696e 7465 7266 6163 653c 2f41 3e2e 0x0ff0: 0a45 6e61 626c 696e 6720 7468 6520 6d6f 0x1000: 6e69 746f 7269 6e67 206f 6620 796f 7572 0x1010: 2073 6572 7665 7220 7769 6c6c 2070 726f 0x1020: 7669 6465 2061 2062 6574 7465 7220 676c 0x1030: 6f62 616c 206f 7665 7276 6965 770a 6f66 0x1040: 2077 686f 2069 7320 7573 696e 6720 7768 0x1050: 6174 2061 6e64 2077 6865 7265 2c20 616e 0x1060: 6420 6974 2077 6f75 6c64 2067 6976 6520 0x1070: 4465 6269 616e 2061 2062 6574 7465 720a 0x1080: 6f76 6572 7669 6577 206f 6620 7468 6520 0x1090: 6170 6163 6865 2070 6163 6b61 6765 2075 0x10a0: 7361 6765 2e0a 0a3c 4832 3e41 626f 7574 0x10b0: 2074 6869 7320 7061 6765 3c2f 4832 3e0a 0x10c0: 0a3c 494d 4720 414c 4947 4e3d 2272 6967 0x10d0: 6874 2220 414c 543d 2222 2048 4549 4748 0x10e0: 543d 2232 3437 2220 5749 4454 483d 2232 0x10f0: 3738 2220 5352 433d 2269 636f 6e73 2f6a 0x1100: 6865 3036 312e 706e 6722 3e0a 0a3c 503e 0x1110: 5468 6973 2069 7320 6120 706c 6163 6568 0x1120: 6f6c 6465 7220 7061 6765 2069 6e73 7461 0x1130: 6c6c 6564 2062 7920 7468 6520 3c41 0a48 0x1140: 5245 463d 2268 7474 703a 2f2f 7777 772e 0x1150: 6465 6269 616e 2e6f 7267 2f22 3e44 6562 0x1160: 6961 6e3c 2f41 3e0a 7265 6c65 6173 6520 0x1170: 6f66 2074 6865 2061 7061 6368 6520 5765 0x1180: 6220 7365 7276 6572 2070 6163 6b61 6765 0x1190: 2e0a 0a3c 503e 5468 6973 2063 6f6d 7075 0x11a0: 7465 7220 6861 7320 696e 7374 616c 6c65 0x11b0: 6420 7468 6520 4465 6269 616e 2047 4e55 0x11c0: 2f4c 696e 7578 206f 7065 7261 7469 6e67 0x11d0: 2073 7973 7465 6d2c 0a62 7574 2069 7420 0x11e0: 6861 7320 3c73 7472 6f6e 673e 6e6f 7468 0x11f0: 696e 6720 746f 2064 6f20 7769 7468 2074 0x1200: 6865 2044 6562 6961 6e0a 5072 6f6a 6563 0x1210: 743c 2f73 7472 6f6e 673e 2e20 506c 6561 0x1220: 7365 2064 6f20 3c73 7472 6f6e 673e 6e6f 0x1230: 743c 2f73 7472 6f6e 673e 2063 6f6e 7461 0x1240: 6374 2074 6865 2044 6562 6961 6e0a 5072 0x1250: 6f6a 6563 7420 6162 6f75 7420 6974 2e3c 0x1260: 2f50 3e0a 0a3c 503e 4966 2079 6f75 2066 0x1270: 696e 6420 6120 6275 6720 696e 2074 6869 0x1280: 7320 6170 6163 6865 2070 6163 6b61 6765 0x1290: 2c20 6f72 2069 6e20 4170 6163 6865 2069 0x12a0: 7473 656c 662c 0a70 6c65 6173 6520 6669 0x12b0: 6c65 2061 2062 7567 2072 6570 6f72 7420 0x12c0: 6f6e 2069 742e 2020 496e 7374 7275 6374 0x12d0: 696f 6e73 206f 6e20 646f 696e 6720 7468 0x12e0: 6973 2c20 616e 6420 7468 650a 6c69 7374 0x12f0: 206f 6620 3c41 2048 5245 463d 2268 7474 0x1300: 703a 2f2f 6275 6773 2e64 6562 6961 6e2e 0x1310: 6f72 672f 7372 633a 6170 6163 6865 223e 0x1320: 6b6e 6f77 6e20 6275 6773 3c2f 413e 206f 0x1330: 6620 7468 6973 0a70 6163 6b61 6765 2c20 0x1340: 6361 6e20 6265 2066 6f75 6e64 2069 6e20 0x1350: 7468 6520 0a3c 4120 4852 4546 3d22 6874 0x1360: 7470 3a2f 2f77 7777 2e64 6562 6961 6e2e 0x1370: 6f72 672f 4275 6773 2f52 6570 6f72 7469 0x1380: 6e67 223e 4465 6269 616e 2042 7567 2054 0x1390: 7261 636b 696e 6720 5379 7374 656d 3c2f 0x13a0: 413e 2e0a 0a3c 503e 5468 616e 6b73 2066 0x13b0: 6f72 2075 7369 6e67 2074 6869 7320 7061 0x13c0: 636b 6167 652c 2061 6e64 2063 6f6e 6772 0x13d0: 6174 756c 6174 696f 6e73 2066 6f72 2079 0x13e0: 6f75 7220 6368 6f69 6365 206f 660a 6120 0x13f0: 4465 6269 616e 2073 7973 7465 6d21 3c2f 0x1400: 503e 0a0a 3c44 4956 2061 6c69 676e 3d22 0x1410: 6365 6e74 6572 223e 0a3c 6120 6872 6566 0x1420: 3d22 6874 7470 3a2f 2f77 7777 2e64 6562 0x1430: 6961 6e2e 6f72 672f 223e 0a3c 494d 4720 0x1440: 616c 6967 6e3d 226d 6964 646c 6522 2068 0x1450: 6569 6768 743d 2233 3022 2077 6964 7468 0x1460: 3d22 3235 2220 7372 633d 2269 636f 6e73 0x1470: 2f64 6562 6961 6e2f 6f70 656e 6c6f 676f 0x1480: 2d32 352e 6a70 6722 2061 6c74 3d22 4465 0x1490: 6269 616e 223e 0a3c 2f61 3e0a 3c61 2068 0x14a0: 7265 663d 2268 7474 703a 2f2f 7777 772e 0x14b0: 6170 6163 6865 2e6f 7267 2f22 3e0a 3c49 0x14c0: 4d47 2061 6c69 676e 3d22 6d69 6464 6c65 0x14d0: 2220 6865 6967 6874 3d22 3332 2220 7769 0x14e0: 6474 683d 2232 3539 2220 7372 633d 2269 0x14f0: 636f 6e73 2f61 7061 6368 655f 7062 2e70 0x1500: 6e67 2220 616c 743d 2241 7061 6368 6522 0x1510: 3e0a 3c2f 613e 0a3c 2f44 4956 3e0a 0a3c 0x1520: 212d 2d0a 2020 5468 6973 2070 6167 6520 0x1530: 7761 7320 696e 6974 6961 6c6c 7920 6372 0x1540: 6561 7465 6420 6279 204a 6f68 6e69 6520 0x1550: 496e 6772 616d 2028 6874 7470 3a2f 2f6e 0x1560: 6574 676f 642e 6e65 742f 290a 2020 4974 0x1570: 2077 6173 206c 6174 6572 2065 6469 7465 0x1580: 6420 6279 204d 6174 7468 6577 2057 696c 0x1590: 636f 7820 616e 6420 4a6f 7369 7020 526f 0x15a0: 6469 6e2e 0a20 204c 6173 7420 6d6f 6469 0x15b0: 6669 6564 3a20 2444 6174 653a 2032 3030 0x15c0: 342f 3036 2f32 3020 3135 3a33 333a 3537 0x15d0: 2024 2e0a 2020 2d2d 3e0a 0a3c 2f42 4f44 0x15e0: 593e 0a3c 2f48 544d 4c3e 0a 23:57:35.941260 IP 127.0.0.1.55920 > 127.0.0.1.80: . ack 5560 win 12383 0x0000: 4500 0034 1b6e 4000 4006 2154 7f00 0001 0x0010: 7f00 0001 da70 0050 3758 8a49 377a a3a9 0x0020: 8010 305f 10ea 0000 0101 080a 4ddc 9219 0x0030: 4ddc 9219 23:57:37.229575 IP 127.0.0.1.55920 > 127.0.0.1.80: F 203:203(0) ack 5560 win 12383 0x0000: 4500 0034 1b70 4000 4006 2152 7f00 0001 0x0010: 7f00 0001 da70 0050 3758 8a49 377a a3a9 0x0020: 8011 305f 0be1 0000 0101 080a 4ddc 9721 0x0030: 4ddc 9219 23:57:37.230839 IP 127.0.0.1.80 > 127.0.0.1.55920: F 5560:5560(0) ack 204 win 8192 0x0000: 4500 0034 1fe8 4000 4006 1cda 7f00 0001 0x0010: 7f00 0001 0050 da70 377a a3a9 3758 8a4a 0x0020: 8011 2000 1735 0000 0101 080a 4ddc 9723 0x0030: 4ddc 9721 23:57:37.230900 IP 127.0.0.1.55920 > 127.0.0.1.80: . ack 5561 win 12383 0x0000: 4500 0034 1b72 4000 4006 2150 7f00 0001 0x0010: 7f00 0001 da70 0050 3758 8a4a 377a a3aa 0x0020: 8010 305f 06d4 0000 0101 080a 4ddc 9723 0x0030: 4ddc 9723 tcpdump-3.9.8/./tests/eapon1.new0000644000026300017500000001767010320056212014530 0ustar mcrmcrIP 192.168.1.249.netbios-dgm > 192.168.1.255.netbios-dgm: NBT UDP PACKET(138) IP 192.168.1.249.netbios-dgm > 192.168.1.255.netbios-dgm: NBT UDP PACKET(138) IP 192.168.1.249.netbios-dgm > 192.168.1.255.netbios-dgm: NBT UDP PACKET(138) IP 192.168.1.249.netbios-ns > 192.168.1.255.netbios-ns: NBT UDP PACKET(137): QUERY; REQUEST; BROADCAST IP 192.168.1.249.netbios-ns > 192.168.1.255.netbios-ns: NBT UDP PACKET(137): QUERY; REQUEST; BROADCAST IP 192.168.1.249.netbios-ns > 192.168.1.255.netbios-ns: NBT UDP PACKET(137): QUERY; REQUEST; BROADCAST IP 192.168.1.249.netbios-dgm > 192.168.1.255.netbios-dgm: NBT UDP PACKET(138) IP 192.168.1.249.netbios-ns > 192.168.1.255.netbios-ns: NBT UDP PACKET(137): QUERY; REQUEST; BROADCAST IP 192.168.1.249.netbios-ns > 192.168.1.255.netbios-ns: NBT UDP PACKET(137): QUERY; REQUEST; BROADCAST IP 192.168.1.249.netbios-ns > 192.168.1.255.netbios-ns: NBT UDP PACKET(137): QUERY; REQUEST; BROADCAST arp who-has 192.168.1.1 tell 192.168.1.249 arp reply 192.168.1.1 is-at 00:0d:88:4f:25:91 (oui Unknown) IP 192.168.1.249.bootpc > 192.168.1.1.bootps: BOOTP/DHCP, Request from 00:04:23:57:a5:7a (oui Unknown), length: 300 EAP code=1 id=0 length=5 IP 0.0.0.0.bootpc > 255.255.255.255.bootps: BOOTP/DHCP, Request from 00:04:23:57:a5:7a (oui Unknown), length: 300 IP 0.0.0.0.bootpc > 255.255.255.255.bootps: BOOTP/DHCP, Request from 00:04:23:57:a5:7a (oui Unknown), length: 300 EAP code=1 id=1 length=0 EAP code=1 id=0 length=5 EAP code=1 id=0 length=45 EAP code=1 id=0 length=20 EAP code=1 id=0 length=76 EAP code=1 id=0 length=80 EAP code=1 id=0 length=28 EAP code=1 id=0 length=4 EAP code=1 id=3 length=57 EAP code=1 id=3 length=44 IP 0.0.0.0.bootpc > 255.255.255.255.bootps: BOOTP/DHCP, Request from 00:04:23:57:a5:7a (oui Unknown), length: 300 IP 0.0.0.0.bootpc > 255.255.255.255.bootps: BOOTP/DHCP, Request from 00:04:23:57:a5:7a (oui Unknown), length: 300 IP 0.0.0.0.bootpc > 255.255.255.255.bootps: BOOTP/DHCP, Request from 00:04:23:57:a5:7a (oui Unknown), length: 300 EAP code=1 id=1 length=0 EAP code=1 id=0 length=5 EAP code=1 id=0 length=45 EAP code=1 id=0 length=20 EAP code=1 id=0 length=76 EAP code=1 id=0 length=80 EAP code=1 id=0 length=28 EAP code=1 id=0 length=4 EAP code=1 id=3 length=57 EAP code=1 id=3 length=44 arp who-has 169.254.67.194 tell 169.254.67.194 arp who-has 169.254.67.194 tell 169.254.67.194 arp who-has 169.254.67.194 tell 169.254.67.194 IP 169.254.67.194.4299 > 239.255.255.250.1900: UDP, length 133 IP 169.254.67.194 > IGMP: igmp v3 report, 1 group record(s) IP 169.254.67.194.netbios-ns > 169.254.255.255.netbios-ns: NBT UDP PACKET(137): REGISTRATION; REQUEST; BROADCAST IP 169.254.67.194 > IGMP: igmp v3 report, 1 group record(s) IP 169.254.67.194.netbios-ns > 169.254.255.255.netbios-ns: NBT UDP PACKET(137): REGISTRATION; REQUEST; BROADCAST IP 169.254.67.194.netbios-ns > 169.254.255.255.netbios-ns: NBT UDP PACKET(137): REGISTRATION; REQUEST; BROADCAST IP 0.0.0.0.bootpc > 255.255.255.255.bootps: BOOTP/DHCP, Request from 00:04:23:57:a5:7a (oui Unknown), length: 300 IP 169.254.67.194.netbios-ns > 169.254.255.255.netbios-ns: NBT UDP PACKET(137): REGISTRATION; REQUEST; BROADCAST IP 169.254.67.194.4299 > 239.255.255.250.1900: UDP, length 133 IP 169.254.67.194.netbios-ns > 169.254.255.255.netbios-ns: NBT UDP PACKET(137): REGISTRATION; REQUEST; BROADCAST EAP code=1 id=1 length=0 EAP code=1 id=0 length=5 EAP code=1 id=0 length=45 EAP code=1 id=0 length=20 IP 169.254.67.194.netbios-ns > 169.254.255.255.netbios-ns: NBT UDP PACKET(137): REGISTRATION; REQUEST; BROADCAST IP 169.254.67.194.netbios-ns > 169.254.255.255.netbios-ns: NBT UDP PACKET(137): REGISTRATION; REQUEST; BROADCAST EAP code=1 id=0 length=76 EAP code=1 id=0 length=80 IP 169.254.67.194.netbios-ns > 169.254.255.255.netbios-ns: NBT UDP PACKET(137): REGISTRATION; REQUEST; BROADCAST EAP code=1 id=0 length=28 EAP code=1 id=0 length=4 EAP code=1 id=3 length=57 EAP code=1 id=3 length=44 IP 0.0.0.0.bootpc > 255.255.255.255.bootps: BOOTP/DHCP, Request from 00:04:23:57:a5:7a (oui Unknown), length: 300 IP 169.254.67.194.4299 > 239.255.255.250.1900: UDP, length 133 IP 169.254.67.194.netbios-ns > 169.254.255.255.netbios-ns: NBT UDP PACKET(137): REGISTRATION; REQUEST; BROADCAST IP 169.254.67.194.netbios-ns > 169.254.255.255.netbios-ns: NBT UDP PACKET(137): REGISTRATION; REQUEST; BROADCAST IP 169.254.67.194.netbios-ns > 169.254.255.255.netbios-ns: NBT UDP PACKET(137): REGISTRATION; REQUEST; BROADCAST IP 169.254.67.194.netbios-ns > 169.254.255.255.netbios-ns: NBT UDP PACKET(137): REGISTRATION; REQUEST; BROADCAST IP 169.254.67.194.netbios-ns > 169.254.255.255.netbios-ns: NBT UDP PACKET(137): REGISTRATION; REQUEST; BROADCAST IP 169.254.67.194.netbios-ns > 169.254.255.255.netbios-ns: NBT UDP PACKET(137): REGISTRATION; REQUEST; BROADCAST IP 169.254.67.194.netbios-ns > 169.254.255.255.netbios-ns: NBT UDP PACKET(137): REGISTRATION; REQUEST; BROADCAST IP 169.254.67.194.netbios-ns > 169.254.255.255.netbios-ns: NBT UDP PACKET(137): REGISTRATION; REQUEST; BROADCAST IP 169.254.67.194.netbios-dgm > 169.254.255.255.netbios-dgm: NBT UDP PACKET(138) IP 169.254.67.194.netbios-dgm > 169.254.255.255.netbios-dgm: NBT UDP PACKET(138) IP 169.254.67.194.netbios-dgm > 169.254.255.255.netbios-dgm: NBT UDP PACKET(138) IP 169.254.67.194.netbios-dgm > 169.254.255.255.netbios-dgm: NBT UDP PACKET(138) IP 169.254.67.194.netbios-dgm > 169.254.255.255.netbios-dgm: NBT UDP PACKET(138) IP 0.0.0.0.bootpc > 255.255.255.255.bootps: BOOTP/DHCP, Request from 00:04:23:57:a5:7a (oui Unknown), length: 300 IP 169.254.67.194.netbios-dgm > 169.254.255.255.netbios-dgm: NBT UDP PACKET(138) IP 169.254.67.194.netbios-dgm > 169.254.255.255.netbios-dgm: NBT UDP PACKET(138) IP 169.254.67.194.netbios-dgm > 169.254.255.255.netbios-dgm: NBT UDP PACKET(138) IP 169.254.67.194.netbios-dgm > 169.254.255.255.netbios-dgm: NBT UDP PACKET(138) IP 169.254.67.194.netbios-ns > 169.254.255.255.netbios-ns: NBT UDP PACKET(137): REGISTRATION; REQUEST; BROADCAST IP 169.254.67.194.netbios-ns > 169.254.255.255.netbios-ns: NBT UDP PACKET(137): REGISTRATION; REQUEST; BROADCAST IP 169.254.67.194.netbios-ns > 169.254.255.255.netbios-ns: NBT UDP PACKET(137): REGISTRATION; REQUEST; BROADCAST IP 169.254.67.194.netbios-ns > 169.254.255.255.netbios-ns: NBT UDP PACKET(137): REGISTRATION; REQUEST; BROADCAST IP 169.254.67.194.netbios-ns > 169.254.255.255.netbios-ns: NBT UDP PACKET(137): REGISTRATION; REQUEST; BROADCAST IP 169.254.67.194.netbios-ns > 169.254.255.255.netbios-ns: NBT UDP PACKET(137): REGISTRATION; REQUEST; BROADCAST IP 169.254.67.194.netbios-ns > 169.254.255.255.netbios-ns: NBT UDP PACKET(137): REGISTRATION; REQUEST; BROADCAST IP 169.254.67.194.netbios-ns > 169.254.255.255.netbios-ns: NBT UDP PACKET(137): REGISTRATION; REQUEST; BROADCAST IP 169.254.67.194.netbios-dgm > 169.254.255.255.netbios-dgm: NBT UDP PACKET(138) IP 169.254.67.194.netbios-dgm > 169.254.255.255.netbios-dgm: NBT UDP PACKET(138) IP 169.254.67.194.netbios-dgm > 169.254.255.255.netbios-dgm: NBT UDP PACKET(138) IP 169.254.67.194.netbios-ns > 169.254.255.255.netbios-ns: NBT UDP PACKET(137): QUERY; REQUEST; BROADCAST IP 169.254.67.194.netbios-ns > 169.254.255.255.netbios-ns: NBT UDP PACKET(137): QUERY; REQUEST; BROADCAST IP 169.254.67.194.netbios-ns > 169.254.255.255.netbios-ns: NBT UDP PACKET(137): QUERY; REQUEST; BROADCAST IP 169.254.67.194.netbios-ns > 169.254.255.255.netbios-ns: NBT UDP PACKET(137): QUERY; REQUEST; BROADCAST IP 169.254.67.194.netbios-ns > 169.254.255.255.netbios-ns: NBT UDP PACKET(137): QUERY; REQUEST; BROADCAST IP 169.254.67.194.netbios-ns > 169.254.255.255.netbios-ns: NBT UDP PACKET(137): QUERY; REQUEST; BROADCAST IP 0.0.0.0.bootpc > 255.255.255.255.bootps: BOOTP/DHCP, Request from 00:04:23:57:a5:7a (oui Unknown), length: 300 EAP code=1 id=1 length=0 EAP code=1 id=0 length=5 EAP code=1 id=0 length=45 EAP code=1 id=0 length=20 IP 169.254.67.194.netbios-dgm > 169.254.255.255.netbios-dgm: NBT UDP PACKET(138) EAP code=1 id=0 length=76 EAP code=1 id=0 length=80 EAP code=1 id=0 length=28 EAP code=1 id=0 length=4 EAP code=1 id=3 length=57 EAP code=1 id=3 length=44 tcpdump-3.9.8/./tests/print-flags.pcap0000644000026300017500000001473510320056212015724 0ustar mcrmcrÔò¡ÿÿ¯VËBRPJJE<h@@!RÚpP7X‰~ ÿ!@  MÜ’¯VËBŠPJJE<@@<ºPÚp7zñ7X‰ ÿn±@  MÜ’MÜ’¯VËB·PBBE4j@@!XÚpP7X‰7zò€ 7Ð MÜ’MÜ’¯VËBŸU  Eþl@@ ŒÚpP7X‰7zò€ þò MÜ’MÜ’GET / HTTP/1.1 Host: localhost User-Agent: ELinks/0.10.4-7-debian (textmode; Linux 2.6.11-1-686-smp i686; 132x56-2) Accept: */* Accept-Encoding: gzip Accept-Language: en Connection: Keep-Alive ¯VËBºYBBE4ä@@ÞPÚp7zò7XŠI€ 7 MÜ’MÜ’¯VËB°\ùùEëæ@@%PÚp7zò7XŠI€ à MÜ’MÜ’HTTP/1.1 200 OK Date: Wed, 06 Jul 2005 03:57:35 GMT Server: Apache/1.3.33 Last-Modified: Sun, 15 Aug 2004 00:43:41 GMT ETag: "6e80f0-148a-411eb1bd" Accept-Ranges: bytes Content-Length: 5258 Keep-Alive: timeout=15, max=100 Connection: Keep-Alive Content-Type: text/html; charset=iso-8859-1 Placeholder page

Placeholder page

If you are just browsing the web

The owner of this web site has not put up any web pages yet. Please come back later.

Move along, nothing to see here... :-)

If you are trying to locate the administrator of this machine

If you want to report something about this host's behavior, please contact the Internet Service Provider (ISP) involved directly.

See the Network Abuse Clearinghouse for how to do this.

If you are the administrator of this machine

The initial installation of Debian's apache web server package was successful.

You should replace this page with your own web pages as soon as possible.

Unless you changed its configuration, your new server is configured as follows:

  • Configuration files can be found in /etc/apache.
  • The DocumentRoot, which is the directory under which all your HTML files should exist, is set to /var/www.
  • CGI scripts are looked for in /usr/lib/cgi-bin, which is where Debian packages will place their scripts.
  • Log files are placed in /var/log/apache, and will be rotated weekly. The frequency of rotation can be easily changed by editing /etc/logrotate.d/apache.
  • The default directory index is index.html, meaning that requests for a directory /foo/bar/ will give the contents of the file /var/www/foo/bar/index.html if it exists (assuming that /var/www is your DocumentRoot).
  • User directories are enabled, and user documents will be looked for in the public_html directory of the users' homes. These dirs should be under /home, and users will not be able to symlink to files they don't own.
All the standard apache modules are available with this release and are now managed with debconf. Type dpkg-reconfigure apache to select which modules you want enabled. Many other modules are available through the Debian package system with the names libapache-mod-*. If you need to compile a module yourself, you will need to install the apache-dev package.

More documentation on Apache can be found on:

You can also consult the list of World Wide Web Frequently Asked Questions for information.

Let other people know about this server

Netcraft provides an interesting free service for web site monitoring and statistic collection. You can let them know about your server using their interface. Enabling the monitoring of your server will provide a better global overview of who is using what and where, and it would give Debian a better overview of the apache package usage.

About this page

This is a placeholder page installed by the Debian release of the apache Web server package.

This computer has installed the Debian GNU/Linux operating system, but it has nothing to do with the Debian Project. Please do not contact the Debian Project about it.

If you find a bug in this apache package, or in Apache itself, please file a bug report on it. Instructions on doing this, and the list of known bugs of this package, can be found in the Debian Bug Tracking System.

Thanks for using this package, and congratulations for your choice of a Debian system!

¯VËBÌ\BBE4n@@!TÚpP7XŠI7z£©€0_ê MÜ’MÜ’±VËBÇ€BBE4p@@!RÚpP7XŠI7z£©€0_ á MÜ—!MÜ’±VËB·…BBE4è@@ÚPÚp7z£©7XŠJ€ 5 MÜ—#MÜ—!±VËBô…BBE4r@@!PÚpP7XŠJ7z£ª€0_Ô MÜ—#MÜ—#tcpdump-3.9.8/./tests/isakmp4500.puu0000644000026300017500000002234410225055611015162 0ustar mcrmcrbegin 644 isakmp4500.pcap MU,.RH0(`!``````````````&```!```````````````J````*@```/______ M_Q```-ZMN@@&``$(``8$``$0``#>K;K``0+^````````P`$"%P`````````` M*@```"H````0``#>K;H0``!D9",(!@`!"``&!``"$```9&0CP`$"%Q```-ZM MNL`!`OX``````````$X!``!.`0``$```9&0C$```WJVZ"`!%``%```!``#\1 MM97``0+^P`$"%P'T`?0!+)6LGHGR.(^0O!X```````````$0`@`````````! M)`T``)0````!`````0```(@``0`$`P``(``!``"`"P`!@`P.$(`!``6``@`! M@`,``X`$``4#```@`0$``(`+``&`#`X0@`$`!8`"``*``P`#@`0`!0,``"`" M`0``@`L``8`,#A"``0`%@`(``H`#``.`!``"````(`,!``"`"P`!@`P.$(`! M``6``@`!@`,``X`$``(-```03T5K4F)'6%)V;5!%#0``%*_*UQ-HH?'):X:6 M_'=7`0`-```42A,<@0<#6$5<5RCR#I5%+PT``!1]E!FF4Q#*;RP7G9(54IU6 M#0``%,U@1D,UWR'X?/VR_&BVI$@````41(45+1BVN\T+Z*A&E7G=S``````` M````L@```+(````0``#>K;H0``!D9",(`$4``*0``$``0!&U,<`!`A?``0+^ M`?0!]`"08%.>B?(XCY"\'@IT-7SCT:2_`1`"``````````"(#0``-`````$` M```!````*``!``$````@``$``(`+``&`#`X0@`$`!8`"``&``P`#@`0`!0T` M`!!/16M28D=84G9M4$4-```4K\K7$VBA\"G0U?./1I+\$$`(````` M`````1P*``#$M]N'X4E&AEMT*7(UA)]?Z:M`RW>TPRPR/2V-U^-O'ST7,9K7 MCQQFQ`#^2/PP0G^@]QHR=9!Y7?/EL'O(\L(I'#51V6N1?)1J+6P-A6&T0Y@" M-KJ[,_WPC+W%H'KSV>J_(W#3`3A4&A^4Q*T^3Q*2'^M#9[XHW-IVWO.#J=M? MDHTX?/DS#]CDJG;?BC_E:$W:3AD]N9+!U'[+6UU.`,)4^&ASH2SO\CU.=2!# MH'UY(FI*395>I?Z@4```4 M;OX2\$KY#?O/L5UQN$&[G@```!1$]1?@/[.!^`^$+14XS/^L``````````!& M`0``1@$``!```-ZMNA```&1D(P@`10`!.```0`!`$;2=P`$"%\`!`OX!]`'T M`20!UYZ)\CB/D+P>"G0U?./1I+\$$`(``````````1P*``#$YYI?^#V[%WO* M+,?[XKU\"YVFZ0UCMOA'6Y:C93#4^M&/)'3",1Q/"&7*"D0_<1SX#@"KRZDV M\_XCB4O9XNS0"_O8-'[C&AG5O;G^G_N*#?4,"OA'?R><"WN68Q(H<1EONM3! MS3=]U]MRZ(4UBM]&:I\KW&3X;LQ%M[B0:,/"]DTM1^J8+8CESE'6JEFCE,,$ M?$W5P,^5=1K1AT@YX0J-9%/E]`MY&<%C?*Y*K\'5X#2B5OD6+FTGJ)^V299# M*>H6%```%&Q^7ZRJ16$T%<6UJE;P`` M`!1N_A+P2OD-^\^Q77&X0;N>``````````!R`0``<@$``!```&1D(Q```-ZM MN@@`10`!9```0``_$;5QP`$"_L`!`A<1E!&4`5!RH0````">B?(XCY"\'@IT M-7SCT:2_!1`"`0````````%$H"1@W`ZTW:4&'Z=!K*`IRTNLK:3J/^$DD/B4 M>Q,F?M5`3=(?!HGW$/M)`\W8Z/'FXK6$!(9!7BL9!@QV=(^E7><\)R8EVE3F M6`.O^:2F!(>LD7%71N]`LA?B!/!0\*H2"YOJ0]_W9#9DJYZ).M/.;+8A?L[O M`J-'HV_0*'&&^P\8:$'I^"13SN]VT%5\8O8;P2VV=`+&9+4]'MH+/&:'PR!H M4O#,GI+1=+*MRN"5.-8D&$16)"G0U?./1I+\%$`(!`````````2S" M8Z5]+<^-M8Q9P&X;^%JN2^*NYC1"AZ%4J-PIMZM611WA:Z$*6IBWC.3.9037)L`[ADSH`K&0*^[6)>")$E3;"4;U="I",2*`1TP_=5+%B"II3>( M'@``````````V@$``-H!```0``!D9",0``#>K;H(`$4``4YQ5SAO`10)\84&I?],R2.?5M MZ/Y^Y"#*%+0.<9KX(/Z$'&M,-)/2I7U^,!G,*G!E_O.D;7F_;D^V#&&*(R.+ MH;YSI'1@I8GV%+\'*6,1(8`8D(VUP[,(R?PQ7#,5WQY3[HT+IFF"3?.+;(*M M_?C;JQ#]O'9522*ZO7>'TEDYLLA`*L$8(XJ$!T>_HYS?G=WR11E($-021FMS MB[NXAJ^CQVGO87[B@^I6THHW-%Z8%PTH&BCO^.[@K_NS8RVTE7CE&MA]6C@> MEDIDM&T^.41?F(\X$Z-5[547$HC='*\>8``"[9.IHT)+[,^LZ?_6(6I\L32# MF-JM7U".L4?X/8=G*KFA<>THJ-622W,;J`IW2^MLBI?_O<"G0U?./1I+\($"`!BWZ)1P```5RM:&N4 MQ1;W19+;77%JE,,H'8&F6ITJM=R5O>KL1%[]#E/LJ#&./WFJ`#,3C!H=I_'* M34/)_E+)(`!A&W00*T\"9O9JX0N">$#'(ZL<$'\P=GHB.0:\AXT/!^^*%U.'5#'2IX:7/2KZ$%^3W;%R4[&2T>'?2(@FF M#T/=+2O[?Q4.(\@Q;]3V=L5Q2XFG)^E)0J:1AX`J4%E3_Y]^6='!R-ENY%9# M3!XD:5K?/V&.!&X#>I_$96Y;P_!5']070(D3N#$47!AZ^VCW-?I?JT2AL5YOWBO5[D!"OV)46(FK)9" M$C40GNJ7*A,SE6%6A(4>KPE(-$)=L6=2VQLO>Y12N8QBH3V%(90.\5YL`R,O M1@``````````8@```&(````0``!D9",0``#>K;H(`$4``%0``$``/Q&V@<`! M`O[``0(7$901E`!`KQ<`````GHGR.(^0O!X*=#5\X]&DOP@0(`&+?HE'```` M-"4[,88.:.R$%:1S6K/XK;H(`$4``*"JM```/Q%+@<`!`O[``0(7$901E`",``#TW`KE```` M`?SD"<11-X_=FBX7J&]'/C[B>;BA23X"^A;(BA/H;8_\0'U,E@M&;+=R&*LY MAF.NT6/*J.SL[UR2)+H^A6#5<38R;!FY\:AV_6ZV)FQ2! M1T\L:`GPK6U?_?TVHSK[6(WSF?Q"XF5K/0U,A.Y+D\RP]G(``````````"H` M```J````$```WJVZ$```9&0C"`8``0@`!@0``1```&1D(\`!`A<```````#` M`0+^```````````J````*@```!```&1D(Q```-ZMN@@&``$(``8$``(0``#> MK;K``0+^$```9&0CP`$"%P``````````B@$``(H!```0``#>K;H0``!D9",( M`$4``7P``$``0!&T6<`!`A?``0+^$901E`%HRNX`````GHGR.(^0O!X*=#5\ MX]&DOP@0(`&+?HE'```!7*UH:Y3%%O=%DMM=<6J4PR@=@:9:G2JUW)6]ZNQ$ M7OT.4^RH,8X_>:H`,Q.,&AVG\B(Y!KR'C0\'[XIS!(%P&'QX74X=4,=*GAS%MDNE:?+;+?\O0S-Y MI<]*OH07Y/=L7)3L9+1X=](B":8/0]TM*_M_%0XCR#%OU/9VQ7%+B:*]7N0$*_8E18B:LED(2-1">ZIB?(XCY"\ M'@IT-7SCT:2_"!`@`8M^B4<````T)3LQA@YH[(05I'-:L_AR6CWGJ@DY)*0" M``````````"N````K@```!```&1D(Q```-ZMN@@`10``H*JU```_$4N`P`$" M_L`!`A<1E!&4`(P``/3<"N4````";5_]_3:C.OM8C?.9_$+B9;KU/R+D"U^- MLGB)>"40ZCMW:+^A4%UI1Y)\.O4B]`44T(2XS\S=2[[[X.6A-PCDZP*3XFAD M294>+W:M%%+\`)?XP#[:6]NHG>#;FFF-RMAA7D"KQ-&OX3Z5S'CBYC"740``````````*P```"L````0``!D9",0``#>K;H(`$4``!T` M`$``/Q&VN,`!`O[``0(7$901E``)6)O_``````````"N````K@```!```&1D M(Q```-ZMN@@`10``H*JV```_$4M_P`$"_L`!`A<1E!&4`(P``/3<"N4````# M7D"KQ-&OX1F0#F$^I@1V5E>.`*!H=Z?(&*,.MS]E4H#P+2"^MMG?%@Y3*L%D'7$>LLOA,HUEB3IB;87,\:-0``````````B@$` M`(H!```0``#>K;H0``!D9",(`$4``7P``$``0!&T6<`!`A?``0+^$901E`%H MRNX`````GHGR.(^0O!X*=#5\X]&DOP@0(`&+?HE'```!7*UH:Y3%%O=%DMM= M<6J4PR@=@:9:G2JUW)6]ZNQ$7OT.4^RH,8X_>:H`,Q.,&AVG\B(Y!KR'C0\'[XIS!(%P&'QX74X= M4,=*GAS%MDNE:?+;+?\O0S-YI<]*OH07Y/=L7)3L9+1X=](B":8/0]TM*_M_ M%0XCR#%OU/9VQ7%+B:*]7N0$*_8E18B:LED(2-1">ZIB?(XCY"\'@IT-7SCT:2_"!`@`8M^B4<````T)3LQA@YH M[(05I'-:L_AR6CWGJ@DY)*0"``````````"N````K@```!```&1D(Q```-ZM MN@@`10``H*JW```_$4M^P`$"_L`!`A<1E!&4`(P``/3<"N4````$"^MMG?%@ MY3*L%D'7$>LLOHFXH,6B3<'M/]A_UT%X.MP;F`ZT@=\62*]W'/Y5@1,(8+`W MTIZ(C;8G'VC<"+'VM:$K/=:VI MD#:KB^/G$BB@:+=TSV\S)T5-E#UOBKZ"E5_,%P``````````*P```"L````0 M``!D9",0``#>K;H(`$4``!T``$``/Q&VN,`!`O[``0(7$901E``)6)O_```` M``````"N````K@```!```&1D(Q```-ZMN@@`10``H*JX```_$4M]P`$"_L`! M`A<1E!&4`(P``/3<"N4````%D#:KB^/G$BB@:+=TSV\S)XZ>X,YAOI/W1_BS M7:N%MO?3J+1\I=>O-36N1GBDD+HMR]D8U)G(OJ] MMX!><$3'U0``````````K@```*X````0``!D9",0``#>K;H(`$4``*"JN0`` M/Q%+?,`!`O[``0(7$901E`",``#TW`KE````!HUKYV'DUKD9XI)"Z+@>3:9638^IH_2\8CVE-BL2&43,3ZAY3'1@3Z:+\)XSXDSO]L,@? MCOL6@]+&+X^#H(D.X>B;)<%[E4:S:#.D70:!#<8Q\QZFH`K;H(`$4``!T``$``/Q&VN,`!`O[` M`0(7$901E``)6)O_``````````"N````K@```!```&1D(Q```-ZMN@@`10`` MH*JZ```_$4M[P`$"_L`!`A<1E!&4`(P``/3<"N4````'$-QC'S'J:@!R,;Z< M<"K%#ST!-8\O2;F**R/9Z%HAZ`2#KQIW*9'HI9C067ZK-G^XAL^O0I7Z/'H( M<.`7P@/P'/E0@``````````B@$``(H!```0``#>K;H0 M``!D9",(`$4``7P``$``0!&T6<`!`A?``0+^$901E`%HRNX`````GHGR.(^0 MO!X*=#5\X]&DOP@0(`&+?HE'```!7*UH:Y3%%O=%DMM=<6J4PR@=@:9:G2JU MW)6]ZNQ$7OT.4^RH,8X_>:H`,Q.,&AVG\B(Y!KR'C0\'[XIS!(%P&'QX74X=4,=*GAS%MDNE:?+; M+?\O0S-YI<]*OH07Y/=L7)3L9+1X=](B":8/0]TM*_M_%0XCR#%OU/9VQ7%+ MB:*]7N0$*_8E18B:LED(2-1">ZIGVJ+F M#M/G_FP&NANM[W@`)Y9\\Z?F4SX%'E.^2BCP\9+!/`25PK%+G'U@$&1+=@%( M#9RV^U"B8-5,EXJ0-QZTLOJ/L^F\).BC@++XQGOL8JC_`L;'=``````````` M*@```"H````0``#>K;H0``!D9",(!@`!"``&!``!$```9&0CP`$"%P`````` M`,`!`OX``````````"H````J````$```9&0C$```WJVZ"`8``0@`!@0``A`` M`-ZMNL`!`OX0``!D9"/``0(7```````````K````*P```!```&1D(Q```-ZM MN@@`10``'0``0``_$;:XP`$"_L`!`A<1E!&4``E8F_\``````````'H```!Z M````$```WJVZ$```9&0C"`!%``!L``!``$`1M6G``0(7P`$"_A&4$90`6,G# M`````)Z)\CB/D+P>"G0U?./1I+\($`4!`KW&3P```$S_T\^1(\?(IVCQDA]J C20SF@.^<&]2'1D(_3FHHKW7PKQJ'!!.01QV>?]$9K_EN`N<` ` end tcpdump-3.9.8/./tests/print-X.new0000644000026300017500000006721010320056212014701 0ustar mcrmcr23:57:35.938066 IP 127.0.0.1.55920 > 127.0.0.1.80: S 928549246:928549246(0) win 32767 0x0000: 4500 003c 1b68 4000 4006 2152 7f00 0001 E..<.h@.@.!R.... 0x0010: 7f00 0001 da70 0050 3758 897e 0000 0000 .....p.P7X.~.... 0x0020: a002 7fff 1421 0000 0204 400c 0402 080a .....!....@..... 0x0030: 4ddc 9216 0000 0000 0103 0302 M........... 23:57:35.938122 IP 127.0.0.1.80 > 127.0.0.1.55920: S 930778609:930778609(0) ack 928549247 win 32767 0x0000: 4500 003c 0000 4000 4006 3cba 7f00 0001 E..<..@.@.<..... 0x0010: 7f00 0001 0050 da70 377a 8df1 3758 897f .....P.p7z..7X.. 0x0020: a012 7fff 6eb1 0000 0204 400c 0402 080a ....n.....@..... 0x0030: 4ddc 9216 4ddc 9216 0103 0302 M...M....... 23:57:35.938167 IP 127.0.0.1.55920 > 127.0.0.1.80: . ack 1 win 8192 0x0000: 4500 0034 1b6a 4000 4006 2158 7f00 0001 E..4.j@.@.!X.... 0x0010: 7f00 0001 da70 0050 3758 897f 377a 8df2 .....p.P7X..7z.. 0x0020: 8010 2000 37d0 0000 0101 080a 4ddc 9216 ....7.......M... 0x0030: 4ddc 9216 M... 23:57:35.939423 IP 127.0.0.1.55920 > 127.0.0.1.80: P 1:203(202) ack 1 win 8192 0x0000: 4500 00fe 1b6c 4000 4006 208c 7f00 0001 E....l@.@....... 0x0010: 7f00 0001 da70 0050 3758 897f 377a 8df2 .....p.P7X..7z.. 0x0020: 8018 2000 fef2 0000 0101 080a 4ddc 9217 ............M... 0x0030: 4ddc 9216 4745 5420 2f20 4854 5450 2f31 M...GET./.HTTP/1 0x0040: 2e31 0d0a 486f 7374 3a20 6c6f 6361 6c68 .1..Host:.localh 0x0050: 6f73 740d 0a55 7365 722d 4167 656e 743a ost..User-Agent: 0x0060: 2045 4c69 6e6b 732f 302e 3130 2e34 2d37 .ELinks/0.10.4-7 0x0070: 2d64 6562 6961 6e20 2874 6578 746d 6f64 -debian.(textmod 0x0080: 653b 204c 696e 7578 2032 2e36 2e31 312d e;.Linux.2.6.11- 0x0090: 312d 3638 362d 736d 7020 6936 3836 3b20 1-686-smp.i686;. 0x00a0: 3133 3278 3536 2d32 290d 0a41 6363 6570 132x56-2)..Accep 0x00b0: 743a 202a 2f2a 0d0a 4163 6365 7074 2d45 t:.*/*..Accept-E 0x00c0: 6e63 6f64 696e 673a 2067 7a69 700d 0a41 ncoding:.gzip..A 0x00d0: 6363 6570 742d 4c61 6e67 7561 6765 3a20 ccept-Language:. 0x00e0: 656e 0d0a 436f 6e6e 6563 7469 6f6e 3a20 en..Connection:. 0x00f0: 4b65 6570 2d41 6c69 7665 0d0a 0d0a Keep-Alive.... 23:57:35.940474 IP 127.0.0.1.80 > 127.0.0.1.55920: . ack 203 win 8192 0x0000: 4500 0034 1fe4 4000 4006 1cde 7f00 0001 E..4..@.@....... 0x0010: 7f00 0001 0050 da70 377a 8df2 3758 8a49 .....P.p7z..7X.I 0x0020: 8010 2000 3703 0000 0101 080a 4ddc 9218 ....7.......M... 0x0030: 4ddc 9217 M... 23:57:35.941232 IP 127.0.0.1.80 > 127.0.0.1.55920: P 1:5560(5559) ack 203 win 8192 0x0000: 4500 15eb 1fe6 4000 4006 0725 7f00 0001 E.....@.@..%.... 0x0010: 7f00 0001 0050 da70 377a 8df2 3758 8a49 .....P.p7z..7X.I 0x0020: 8018 2000 13e0 0000 0101 080a 4ddc 9219 ............M... 0x0030: 4ddc 9217 4854 5450 2f31 2e31 2032 3030 M...HTTP/1.1.200 0x0040: 204f 4b0d 0a44 6174 653a 2057 6564 2c20 .OK..Date:.Wed,. 0x0050: 3036 204a 756c 2032 3030 3520 3033 3a35 06.Jul.2005.03:5 0x0060: 373a 3335 2047 4d54 0d0a 5365 7276 6572 7:35.GMT..Server 0x0070: 3a20 4170 6163 6865 2f31 2e33 2e33 330d :.Apache/1.3.33. 0x0080: 0a4c 6173 742d 4d6f 6469 6669 6564 3a20 .Last-Modified:. 0x0090: 5375 6e2c 2031 3520 4175 6720 3230 3034 Sun,.15.Aug.2004 0x00a0: 2030 303a 3433 3a34 3120 474d 540d 0a45 .00:43:41.GMT..E 0x00b0: 5461 673a 2022 3665 3830 6630 2d31 3438 Tag:."6e80f0-148 0x00c0: 612d 3431 3165 6231 6264 220d 0a41 6363 a-411eb1bd"..Acc 0x00d0: 6570 742d 5261 6e67 6573 3a20 6279 7465 ept-Ranges:.byte 0x00e0: 730d 0a43 6f6e 7465 6e74 2d4c 656e 6774 s..Content-Lengt 0x00f0: 683a 2035 3235 380d 0a4b 6565 702d 416c h:.5258..Keep-Al 0x0100: 6976 653a 2074 696d 656f 7574 3d31 352c ive:.timeout=15, 0x0110: 206d 6178 3d31 3030 0d0a 436f 6e6e 6563 .max=100..Connec 0x0120: 7469 6f6e 3a20 4b65 6570 2d41 6c69 7665 tion:.Keep-Alive 0x0130: 0d0a 436f 6e74 656e 742d 5479 7065 3a20 ..Content-Type:. 0x0140: 7465 7874 2f68 746d 6c3b 2063 6861 7273 text/html;.chars 0x0150: 6574 3d69 736f 2d38 3835 392d 310d 0a0d et=iso-8859-1... 0x0160: 0a3c 2144 4f43 5459 5045 2048 544d 4c20 . 0x01a0: 0a3c 4854 4d4c 3e0a 3c48 4541 443e 0a20 .... 0x01b0: 2020 3c4d 4554 4120 4854 5450 2d45 5155 .......... 0x0250: 3c54 4954 4c45 3e50 6c61 6365 686f 6c64 Placehold 0x0260: 6572 2070 6167 653c 2f54 4954 4c45 3e0a er.page. 0x0270: 3c2f 4845 4144 3e0a 3c42 4f44 5920 5445 ... 0x02d0: 3c48 313e 506c 6163 6568 6f6c 6465 7220

Placeholder. 0x02e0: 7061 6765 3c2f 4831 3e0a 3c48 323e 4966 page

.

If 0x02f0: 2079 6f75 2061 7265 206a 7573 7420 6272 .you.are.just.br 0x0300: 6f77 7369 6e67 2074 6865 2077 6562 3c2f owsing.the.web..

The.owne 0x0320: 7220 6f66 2074 6869 7320 7765 6220 7369 r.of.this.web.si 0x0330: 7465 2068 6173 206e 6f74 2070 7574 2075 te.has.not.put.u 0x0340: 7020 616e 7920 7765 6220 7061 6765 7320 p.any.web.pages. 0x0350: 7965 742e 0a50 6c65 6173 6520 636f 6d65 yet..Please.come 0x0360: 2062 6163 6b20 6c61 7465 722e 3c2f 503e .back.later.

0x0370: 0a0a 3c50 3e3c 534d 414c 4c3e 3c43 4954 ..

Move.along,.no 0x0390: 7468 696e 6720 746f 2073 6565 2068 6572 thing.to.see.her 0x03a0: 652e 2e2e 3c2f 4349 5445 3e20 3a2d 293c e....:-)< 0x03b0: 2f53 4d41 4c4c 3e3c 2f50 3e0a 0a3c 4832 /SMALL>

..

If.you.are.tryi 0x03d0: 6e67 2074 6f20 6c6f 6361 7465 2074 6865 ng.to.locate.the 0x03e0: 2061 646d 696e 6973 7472 6174 6f72 206f .administrator.o 0x03f0: 6620 7468 6973 206d 6163 6869 6e65 3c2f f.this.machine..

If.you.w 0x0410: 616e 7420 746f 2072 6570 6f72 7420 736f ant.to.report.so 0x0420: 6d65 7468 696e 6720 6162 6f75 7420 7468 mething.about.th 0x0430: 6973 2068 6f73 7427 7320 6265 6861 7669 is.host's.behavi 0x0440: 6f72 2c20 706c 6561 7365 0a63 6f6e 7461 or,.please.conta 0x0450: 6374 2074 6865 2049 6e74 6572 6e65 7420 ct.the.Internet. 0x0460: 5365 7276 6963 6520 5072 6f76 6964 6572 Service.Provider 0x0470: 2028 4953 5029 2069 6e76 6f6c 7665 6420 .(ISP).involved. 0x0480: 6469 7265 6374 6c79 2e3c 2f50 3e0a 0a3c directly.

..< 0x0490: 503e 5365 6520 7468 6520 3c41 2068 7265 P>See.the.Networ 0x04c0: 6b20 4162 7573 650a 436c 6561 7269 6e67 k.Abuse.Clearing 0x04d0: 686f 7573 653c 2f41 3e20 666f 7220 686f house.for.ho 0x04e0: 7720 746f 2064 6f20 7468 6973 2e3c 2f50 w.to.do.this.

..

If.you.ar 0x0500: 6520 7468 6520 6164 6d69 6e69 7374 7261 e.the.administra 0x0510: 746f 7220 6f66 2074 6869 7320 6d61 6368 tor.of.this.mach 0x0520: 696e 653c 2f48 323e 0a0a 3c50 3e54 6865 ine

..

The 0x0530: 2069 6e69 7469 616c 2069 6e73 7461 6c6c .initial.install 0x0540: 6174 696f 6e20 6f66 203c 4120 6872 6566 ation.of.Debian 0x0570: 2773 0a61 7061 6368 653c 2f41 3e20 7765 's.apache.we 0x0580: 6220 7365 7276 6572 2070 6163 6b61 6765 b.server.package 0x0590: 2077 6173 2073 7563 6365 7373 6675 6c2e .was.successful. 0x05a0: 3c2f 503e 0a0a 3c50 3e3c 5354 524f 4e47

..

You.should.repl 0x05c0: 6163 6520 7468 6973 2070 6167 6520 7769 ace.this.page.wi 0x05d0: 7468 2079 6f75 7220 6f77 6e20 7765 6220 th.your.own.web. 0x05e0: 7061 6765 7320 6173 0a73 6f6f 6e20 6173 pages.as.soon.as 0x05f0: 2070 6f73 7369 626c 652e 3c2f 5354 524f .possible.

..

Unle 0x0610: 7373 2079 6f75 2063 6861 6e67 6564 2069 ss.you.changed.i 0x0620: 7473 2063 6f6e 6669 6775 7261 7469 6f6e ts.configuration 0x0630: 2c20 796f 7572 206e 6577 2073 6572 7665 ,.your.new.serve 0x0640: 7220 6973 2063 6f6e 6669 6775 7265 6420 r.is.configured. 0x0650: 6173 2066 6f6c 6c6f 7773 3a0a 3c55 4c3e as.follows:.

    0x0660: 0a3c 4c49 3e0a 436f 6e66 6967 7572 6174 .
  • .Configurat 0x0670: 696f 6e20 6669 6c65 7320 6361 6e20 6265 ion.files.can.be 0x0680: 2066 6f75 6e64 2069 6e20 3c54 543e 2f65 .found.in./e 0x0690: 7463 2f61 7061 6368 653c 2f54 543e 2e3c tc/apache.< 0x06a0: 2f4c 493e 0a0a 3c4c 493e 0a54 6865 203c /LI>..
  • .The.< 0x06b0: 5454 3e44 6f63 756d 656e 7452 6f6f 743c TT>DocumentRoot< 0x06c0: 2f54 543e 2c20 7768 6963 6820 6973 2074 /TT>,.which.is.t 0x06d0: 6865 2064 6972 6563 746f 7279 2075 6e64 he.directory.und 0x06e0: 6572 2077 6869 6368 2061 6c6c 2079 6f75 er.which.all.you 0x06f0: 720a 4854 4d4c 2066 696c 6573 2073 686f r.HTML.files.sho 0x0700: 756c 6420 6578 6973 742c 2069 7320 7365 uld.exist,.is.se 0x0710: 7420 746f 203c 5454 3e2f 7661 722f 7777 t.to./var/ww 0x0720: 773c 2f54 543e 2e3c 2f4c 493e 0a0a 3c4c w.
  • ...CGI.scripts.a 0x0740: 7265 206c 6f6f 6b65 6420 666f 7220 696e re.looked.for.in 0x0750: 203c 5454 3e2f 7573 722f 6c69 622f 6367 ./usr/lib/cg 0x0760: 692d 6269 6e3c 2f54 543e 2c20 7768 6963 i-bin,.whic 0x0770: 6820 6973 2077 6865 7265 0a44 6562 6961 h.is.where.Debia 0x0780: 6e20 7061 636b 6167 6573 2077 696c 6c20 n.packages.will. 0x0790: 706c 6163 6520 7468 6569 7220 7363 7269 place.their.scri 0x07a0: 7074 732e 3c2f 4c49 3e0a 0a3c 4c49 3e0a pts...
  • . 0x07b0: 4c6f 6720 6669 6c65 7320 6172 6520 706c Log.files.are.pl 0x07c0: 6163 6564 2069 6e20 3c54 543e 2f76 6172 aced.in./var 0x07d0: 2f6c 6f67 2f61 7061 6368 653c 2f54 543e /log/apache 0x07e0: 2c20 616e 6420 7769 6c6c 2062 6520 726f ,.and.will.be.ro 0x07f0: 7461 7465 640a 7765 656b 6c79 2e20 2054 tated.weekly...T 0x0800: 6865 2066 7265 7175 656e 6379 206f 6620 he.frequency.of. 0x0810: 726f 7461 7469 6f6e 2063 616e 2062 6520 rotation.can.be. 0x0820: 6561 7369 6c79 2063 6861 6e67 6564 2062 easily.changed.b 0x0830: 7920 6564 6974 696e 670a 3c54 543e 2f65 y.editing./e 0x0840: 7463 2f6c 6f67 726f 7461 7465 2e64 2f61 tc/logrotate.d/a 0x0850: 7061 6368 653c 2f54 543e 2e3c 2f4c 493e pache.
  • 0x0860: 0a0a 3c4c 493e 0a54 6865 2064 6566 6175 ..
  • .The.defau 0x0870: 6c74 2064 6972 6563 746f 7279 2069 6e64 lt.directory.ind 0x0880: 6578 2069 7320 3c54 543e 696e 6465 782e ex.is.index. 0x0890: 6874 6d6c 3c2f 5454 3e2c 206d 6561 6e69 html,.meani 0x08a0: 6e67 2074 6861 7420 7265 7175 6573 7473 ng.that.requests 0x08b0: 0a66 6f72 2061 2064 6972 6563 746f 7279 .for.a.directory 0x08c0: 203c 5454 3e2f 666f 6f2f 6261 722f 3c2f ./foo/bar/.will.give.th 0x08e0: 6520 636f 6e74 656e 7473 206f 6620 7468 e.contents.of.th 0x08f0: 6520 6669 6c65 203c 5454 3e2f 7661 722f e.file./var/ 0x0900: 7777 772f 666f 6f2f 6261 722f 696e 6465 www/foo/bar/inde 0x0910: 782e 6874 6d6c 3c2f 5454 3e0a 6966 2069 x.html.if.i 0x0920: 7420 6578 6973 7473 2028 6173 7375 6d69 t.exists.(assumi 0x0930: 6e67 2074 6861 7420 3c54 543e 2f76 6172 ng.that./var 0x0940: 2f77 7777 3c2f 5454 3e20 6973 2079 6f75 /www.is.you 0x0950: 7220 3c54 543e 446f 6375 6d65 6e74 526f r.DocumentRo 0x0960: 6f74 3c2f 5454 3e29 2e3c 2f4c 493e 0a0a ot).
  • .. 0x0970: 3c4c 493e 0a55 7365 7220 6469 7265 6374
  • .User.direct 0x0980: 6f72 6965 7320 6172 6520 656e 6162 6c65 ories.are.enable 0x0990: 642c 2061 6e64 2075 7365 7220 646f 6375 d,.and.user.docu 0x09a0: 6d65 6e74 7320 7769 6c6c 2062 6520 6c6f ments.will.be.lo 0x09b0: 6f6b 6564 2066 6f72 0a69 6e20 7468 6520 oked.for.in.the. 0x09c0: 3c54 543e 7075 626c 6963 5f68 746d 6c3c public_html< 0x09d0: 2f54 543e 2064 6972 6563 746f 7279 206f /TT>.directory.o 0x09e0: 6620 7468 6520 7573 6572 7327 2068 6f6d f.the.users'.hom 0x09f0: 6573 2e20 2054 6865 7365 2064 6972 730a es...These.dirs. 0x0a00: 7368 6f75 6c64 2062 6520 756e 6465 7220 should.be.under. 0x0a10: 3c54 543e 2f68 6f6d 653c 2f54 543e 2c20 /home,. 0x0a20: 616e 6420 7573 6572 7320 7769 6c6c 206e and.users.will.n 0x0a30: 6f74 2062 6520 6162 6c65 2074 6f20 7379 ot.be.able.to.sy 0x0a40: 6d6c 696e 6b0a 746f 2066 696c 6573 2074 mlink.to.files.t 0x0a50: 6865 7920 646f 6e27 7420 6f77 6e2e 3c2f hey.don't.own...
.All.t 0x0a70: 6865 2073 7461 6e64 6172 6420 6170 6163 he.standard.apac 0x0a80: 6865 206d 6f64 756c 6573 2061 7265 2061 he.modules.are.a 0x0a90: 7661 696c 6162 6c65 2077 6974 6820 7468 vailable.with.th 0x0aa0: 6973 2072 656c 6561 7365 2061 6e64 2061 is.release.and.a 0x0ab0: 7265 0a6e 6f77 206d 616e 6167 6564 2077 re.now.managed.w 0x0ac0: 6974 6820 6465 6263 6f6e 662e 2020 5479 ith.debconf...Ty 0x0ad0: 7065 203c 5454 3e64 706b 672d 7265 636f pe.dpkg-reco 0x0ae0: 6e66 6967 7572 6520 6170 6163 6865 3c2f nfigure.apache.to.select.wh 0x0b00: 6963 6820 6d6f 6475 6c65 7320 796f 7520 ich.modules.you. 0x0b10: 7761 6e74 2065 6e61 626c 6564 2e20 204d want.enabled...M 0x0b20: 616e 7920 6f74 6865 7220 6d6f 6475 6c65 any.other.module 0x0b30: 7320 6172 6520 6176 6169 6c61 626c 650a s.are.available. 0x0b40: 7468 726f 7567 6820 7468 6520 4465 6269 through.the.Debi 0x0b50: 616e 2070 6163 6b61 6765 2073 7973 7465 an.package.syste 0x0b60: 6d20 7769 7468 2074 6865 206e 616d 6573 m.with.the.names 0x0b70: 203c 5454 3e6c 6962 6170 6163 6865 2d6d .libapache-m 0x0b80: 6f64 2d2a 3c2f 5454 3e2e 0a49 6620 796f od-*..If.yo 0x0b90: 7520 6e65 6564 2074 6f20 636f 6d70 696c u.need.to.compil 0x0ba0: 6520 6120 6d6f 6475 6c65 2079 6f75 7273 e.a.module.yours 0x0bb0: 656c 662c 2079 6f75 2077 696c 6c20 6e65 elf,.you.will.ne 0x0bc0: 6564 2074 6f20 696e 7374 616c 6c20 7468 ed.to.install.th 0x0bd0: 650a 3c54 543e 6170 6163 6865 2d64 6576 e.apache-dev 0x0be0: 3c2f 5454 3e20 7061 636b 6167 652e 0a0a .package... 0x0bf0: 3c50 3e4d 6f72 6520 646f 6375 6d65 6e74

More.document 0x0c00: 6174 696f 6e20 6f6e 2041 7061 6368 6520 ation.on.Apache. 0x0c10: 6361 6e20 6265 2066 6f75 6e64 206f 6e3a can.be.found.on: 0x0c20: 0a3c 554c 3e0a 3c4c 493e 0a54 6865 203c .

    .
  • .The.< 0x0c30: 4120 4852 4546 3d22 2f64 6f63 2f61 7061 A.HREF="/doc/apa 0x0c40: 6368 652d 646f 632f 6d61 6e75 616c 2f22 che-doc/manual/" 0x0c50: 3e41 7061 6368 6520 646f 6375 6d65 6e74 >Apache.document 0x0c60: 6174 696f 6e3c 2f41 3e20 7374 6f72 6564 ation.stored 0x0c70: 206f 6e20 796f 7572 2073 6572 7665 722e .on.your.server. 0x0c80: 3c2f 4c49 3e0a 0a3c 4c49 3e0a 5468 6520
  • ..
  • .The. 0x0c90: 3c41 2048 5245 463d 2268 7474 703a 2f2f Apache.Project< 0x0cc0: 2f41 3e20 686f 6d65 2073 6974 652e 3c2f /A>.home.site...
  • .The.Apache-SSL.home.site.
  • ..
  • .The.mo 0x0d50: 6420 7065 726c 3c2f 413e 2068 6f6d 6520 d.perl.home. 0x0d60: 7369 7465 2e3c 2f4c 493e 0a0a 3c4c 493e site.
  • ..
  • 0x0d70: 0a54 6865 203c 4120 4852 4546 3d22 6874 .The.Apache 0x0da0: 5765 656b 3c2f 413e 206e 6577 736c 6574 Week.newslet 0x0db0: 7465 722e 3c2f 4c49 3e0a 0a3c 4c49 3e0a ter.
  • ..
  • . 0x0dc0: 5468 6520 3c41 2048 5245 463d 2268 7474 The.Debian. 0x0df0: 5072 6f6a 6563 740a 446f 6375 6d65 6e74 Project.Document 0x0e00: 6174 696f 6e3c 2f41 3e20 7768 6963 6820 ation.which. 0x0e10: 636f 6e74 6169 6e73 2048 4f57 544f 732c contains.HOWTOs, 0x0e20: 2046 4151 732c 2061 6e64 2073 6f66 7477 .FAQs,.and.softw 0x0e30: 6172 6520 7570 6461 7465 732e 3c2f 4c49 are.updates.
  • .
..

You. 0x0e50: 6361 6e20 616c 736f 2063 6f6e 7375 6c74 can.also.consult 0x0e60: 2074 6865 206c 6973 7420 6f66 203c 4120 .the.list.of.World.Wide.We 0x0ea0: 6220 4672 6571 7565 6e74 6c79 2041 736b b.Frequently.Ask 0x0eb0: 6564 2051 7565 7374 696f 6e73 3c2f 413e ed.Questions 0x0ec0: 2066 6f72 2069 6e66 6f72 6d61 7469 6f6e .for.information 0x0ed0: 2e0a 0a3c 4832 3e4c 6574 206f 7468 6572 ...

Let.other 0x0ee0: 2070 656f 706c 6520 6b6e 6f77 2061 626f .people.know.abo 0x0ef0: 7574 2074 6869 7320 7365 7276 6572 3c2f ut.this.server..Netcraft 0x0f30: 2070 726f 7669 6465 7320 616e 2069 6e74 .provides.an.int 0x0f40: 6572 6573 7469 6e67 2066 7265 650a 7365 eresting.free.se 0x0f50: 7276 6963 6520 666f 7220 7765 6220 7369 rvice.for.web.si 0x0f60: 7465 206d 6f6e 6974 6f72 696e 6720 616e te.monitoring.an 0x0f70: 6420 7374 6174 6973 7469 6320 636f 6c6c d.statistic.coll 0x0f80: 6563 7469 6f6e 2e0a 596f 7520 6361 6e20 ection..You.can. 0x0f90: 6c65 7420 7468 656d 206b 6e6f 7720 6162 let.them.know.ab 0x0fa0: 6f75 7420 796f 7572 2073 6572 7665 7220 out.your.server. 0x0fb0: 7573 696e 6720 7468 6569 720a 3c41 2048 using.their.interface. 0x0ff0: 0a45 6e61 626c 696e 6720 7468 6520 6d6f .Enabling.the.mo 0x1000: 6e69 746f 7269 6e67 206f 6620 796f 7572 nitoring.of.your 0x1010: 2073 6572 7665 7220 7769 6c6c 2070 726f .server.will.pro 0x1020: 7669 6465 2061 2062 6574 7465 7220 676c vide.a.better.gl 0x1030: 6f62 616c 206f 7665 7276 6965 770a 6f66 obal.overview.of 0x1040: 2077 686f 2069 7320 7573 696e 6720 7768 .who.is.using.wh 0x1050: 6174 2061 6e64 2077 6865 7265 2c20 616e at.and.where,.an 0x1060: 6420 6974 2077 6f75 6c64 2067 6976 6520 d.it.would.give. 0x1070: 4465 6269 616e 2061 2062 6574 7465 720a Debian.a.better. 0x1080: 6f76 6572 7669 6577 206f 6620 7468 6520 overview.of.the. 0x1090: 6170 6163 6865 2070 6163 6b61 6765 2075 apache.package.u 0x10a0: 7361 6765 2e0a 0a3c 4832 3e41 626f 7574 sage...

About 0x10b0: 2074 6869 7320 7061 6765 3c2f 4832 3e0a .this.page

. 0x10c0: 0a3c 494d 4720 414c 4947 4e3d 2272 6967 ...

0x1110: 5468 6973 2069 7320 6120 706c 6163 6568 This.is.a.placeh 0x1120: 6f6c 6465 7220 7061 6765 2069 6e73 7461 older.page.insta 0x1130: 6c6c 6564 2062 7920 7468 6520 3c41 0a48 lled.by.the.Deb 0x1160: 6961 6e3c 2f41 3e0a 7265 6c65 6173 6520 ian.release. 0x1170: 6f66 2074 6865 2061 7061 6368 6520 5765 of.the.apache.We 0x1180: 6220 7365 7276 6572 2070 6163 6b61 6765 b.server.package 0x1190: 2e0a 0a3c 503e 5468 6973 2063 6f6d 7075 ...

This.compu 0x11a0: 7465 7220 6861 7320 696e 7374 616c 6c65 ter.has.installe 0x11b0: 6420 7468 6520 4465 6269 616e 2047 4e55 d.the.Debian.GNU 0x11c0: 2f4c 696e 7578 206f 7065 7261 7469 6e67 /Linux.operating 0x11d0: 2073 7973 7465 6d2c 0a62 7574 2069 7420 .system,.but.it. 0x11e0: 6861 7320 3c73 7472 6f6e 673e 6e6f 7468 has.noth 0x11f0: 696e 6720 746f 2064 6f20 7769 7468 2074 ing.to.do.with.t 0x1200: 6865 2044 6562 6961 6e0a 5072 6f6a 6563 he.Debian.Projec 0x1210: 743c 2f73 7472 6f6e 673e 2e20 506c 6561 t..Plea 0x1220: 7365 2064 6f20 3c73 7472 6f6e 673e 6e6f se.do.no 0x1230: 743c 2f73 7472 6f6e 673e 2063 6f6e 7461 t.conta 0x1240: 6374 2074 6865 2044 6562 6961 6e0a 5072 ct.the.Debian.Pr 0x1250: 6f6a 6563 7420 6162 6f75 7420 6974 2e3c oject.about.it.< 0x1260: 2f50 3e0a 0a3c 503e 4966 2079 6f75 2066 /P>..

If.you.f 0x1270: 696e 6420 6120 6275 6720 696e 2074 6869 ind.a.bug.in.thi 0x1280: 7320 6170 6163 6865 2070 6163 6b61 6765 s.apache.package 0x1290: 2c20 6f72 2069 6e20 4170 6163 6865 2069 ,.or.in.Apache.i 0x12a0: 7473 656c 662c 0a70 6c65 6173 6520 6669 tself,.please.fi 0x12b0: 6c65 2061 2062 7567 2072 6570 6f72 7420 le.a.bug.report. 0x12c0: 6f6e 2069 742e 2020 496e 7374 7275 6374 on.it...Instruct 0x12d0: 696f 6e73 206f 6e20 646f 696e 6720 7468 ions.on.doing.th 0x12e0: 6973 2c20 616e 6420 7468 650a 6c69 7374 is,.and.the.list 0x12f0: 206f 6620 3c41 2048 5245 463d 2268 7474 .of. 0x1320: 6b6e 6f77 6e20 6275 6773 3c2f 413e 206f known.bugs.o 0x1330: 6620 7468 6973 0a70 6163 6b61 6765 2c20 f.this.package,. 0x1340: 6361 6e20 6265 2066 6f75 6e64 2069 6e20 can.be.found.in. 0x1350: 7468 6520 0a3c 4120 4852 4546 3d22 6874 the..Debian.Bug.T 0x1390: 7261 636b 696e 6720 5379 7374 656d 3c2f racking.System...

Thanks.f 0x13b0: 6f72 2075 7369 6e67 2074 6869 7320 7061 or.using.this.pa 0x13c0: 636b 6167 652c 2061 6e64 2063 6f6e 6772 ckage,.and.congr 0x13d0: 6174 756c 6174 696f 6e73 2066 6f72 2079 atulations.for.y 0x13e0: 6f75 7220 6368 6f69 6365 206f 660a 6120 our.choice.of.a. 0x13f0: 4465 6269 616e 2073 7973 7465 6d21 3c2f Debian.system!...........< 0x1520: 212d 2d0a 2020 5468 6973 2070 6167 6520 !--...This.page. 0x1530: 7761 7320 696e 6974 6961 6c6c 7920 6372 was.initially.cr 0x1540: 6561 7465 6420 6279 204a 6f68 6e69 6520 eated.by.Johnie. 0x1550: 496e 6772 616d 2028 6874 7470 3a2f 2f6e Ingram.(http://n 0x1560: 6574 676f 642e 6e65 742f 290a 2020 4974 etgod.net/)...It 0x1570: 2077 6173 206c 6174 6572 2065 6469 7465 .was.later.edite 0x1580: 6420 6279 204d 6174 7468 6577 2057 696c d.by.Matthew.Wil 0x1590: 636f 7820 616e 6420 4a6f 7369 7020 526f cox.and.Josip.Ro 0x15a0: 6469 6e2e 0a20 204c 6173 7420 6d6f 6469 din....Last.modi 0x15b0: 6669 6564 3a20 2444 6174 653a 2032 3030 fied:.$Date:.200 0x15c0: 342f 3036 2f32 3020 3135 3a33 333a 3537 4/06/20.15:33:57 0x15d0: 2024 2e0a 2020 2d2d 3e0a 0a3c 2f42 4f44 .$....-->.... 23:57:35.941260 IP 127.0.0.1.55920 > 127.0.0.1.80: . ack 5560 win 12383 0x0000: 4500 0034 1b6e 4000 4006 2154 7f00 0001 E..4.n@.@.!T.... 0x0010: 7f00 0001 da70 0050 3758 8a49 377a a3a9 .....p.P7X.I7z.. 0x0020: 8010 305f 10ea 0000 0101 080a 4ddc 9219 ..0_........M... 0x0030: 4ddc 9219 M... 23:57:37.229575 IP 127.0.0.1.55920 > 127.0.0.1.80: F 203:203(0) ack 5560 win 12383 0x0000: 4500 0034 1b70 4000 4006 2152 7f00 0001 E..4.p@.@.!R.... 0x0010: 7f00 0001 da70 0050 3758 8a49 377a a3a9 .....p.P7X.I7z.. 0x0020: 8011 305f 0be1 0000 0101 080a 4ddc 9721 ..0_........M..! 0x0030: 4ddc 9219 M... 23:57:37.230839 IP 127.0.0.1.80 > 127.0.0.1.55920: F 5560:5560(0) ack 204 win 8192 0x0000: 4500 0034 1fe8 4000 4006 1cda 7f00 0001 E..4..@.@....... 0x0010: 7f00 0001 0050 da70 377a a3a9 3758 8a4a .....P.p7z..7X.J 0x0020: 8011 2000 1735 0000 0101 080a 4ddc 9723 .....5......M..# 0x0030: 4ddc 9721 M..! 23:57:37.230900 IP 127.0.0.1.55920 > 127.0.0.1.80: . ack 5561 win 12383 0x0000: 4500 0034 1b72 4000 4006 2150 7f00 0001 E..4.r@.@.!P.... 0x0010: 7f00 0001 da70 0050 3758 8a4a 377a a3aa .....p.P7X.J7z.. 0x0020: 8010 305f 06d4 0000 0101 080a 4ddc 9723 ..0_........M..# 0x0030: 4ddc 9723 M..# tcpdump-3.9.8/./tests/mpls-ldp-hello.out0000644000026300017500000000123310320056205016202 0ustar mcrmcrIP (tos 0xc0, ttl 1, id 15579, offset 0, flags [none], proto: UDP (17), length: 70) 10.1.1.3.646 > 224.0.0.2.646: LDP, Label-Space-ID: 10.1.0.2:0, pdu-length: 38 Hello Message (0x0100), length: 28, Message ID: 0x00011970, Flags: [ignore if unknown] Common Hello Parameters TLV (0x0400), length: 4, Flags: [ignore and don't forward if unknown] Hold Time: 15s, Flags: [Link Hello] IPv4 Transport Address TLV (0x0401), length: 4, Flags: [ignore and don't forward if unknown] IPv4 Transport Address: 10.1.0.2 Configuration Sequence Number TLV (0x0402), length: 4, Flags: [ignore and don't forward if unknown] Sequence Number: 1 tcpdump-3.9.8/./tests/.#mpls-ldp-hello.out.1.30000644000026300017500000000122710320056003016622 0ustar mcrmcrIP (tos 0xc0, ttl 1, id 15579, offset 0, flags [none], proto: UDP (17), length: 70) 10.1.1.3.646 > 224.0.0.2.646: LDP, Label-Space-ID: 10.1.0.2:0, length: 42 Hello Message (0x0100), length: 28, Message ID: 0x00011970, Flags: [ignore if unknown] Common Hello Parameters TLV (0x0400), length: 4, Flags: [ignore and don't forward if unknown] Hold Time: 15s, Flags: [Link Hello] IPv4 Transport Address TLV (0x0401), length: 4, Flags: [ignore and don't forward if unknown] IPv4 Transport Address: 10.1.0.2 Configuration Sequence Number TLV (0x0402), length: 4, Flags: [ignore and don't forward if unknown] Sequence Number: 1 tcpdump-3.9.8/./tests/isakmp3.new0000644000026300017500000000225110320056212014701 0ustar mcrmcrIP (tos 0x0, ttl 255, id 41068, offset 0, flags [none], proto: UDP (17), length: 312) 127.0.0.1.501 > 127.0.0.1.500: isakmp 1.0 msgid : phase 1 I ident: (id: idtype=FQDN protoid=0 port=0 len=248 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000) tcpdump-3.9.8/./tests/mpls-ldp-hello.new0000644000026300017500000000123310320056212016162 0ustar mcrmcrIP (tos 0xc0, ttl 1, id 15579, offset 0, flags [none], proto: UDP (17), length: 70) 10.1.1.3.646 > 224.0.0.2.646: LDP, Label-Space-ID: 10.1.0.2:0, pdu-length: 38 Hello Message (0x0100), length: 28, Message ID: 0x00011970, Flags: [ignore if unknown] Common Hello Parameters TLV (0x0400), length: 4, Flags: [ignore and don't forward if unknown] Hold Time: 15s, Flags: [Link Hello] IPv4 Transport Address TLV (0x0401), length: 4, Flags: [ignore and don't forward if unknown] IPv4 Transport Address: 10.1.0.2 Configuration Sequence Number TLV (0x0402), length: 4, Flags: [ignore and don't forward if unknown] Sequence Number: 1 tcpdump-3.9.8/./tests/bgp_vpn_attrset.out0000644000026300017500000000207410320056203016554 0ustar mcrmcrIP (tos 0xc0, ttl 62, id 58628, offset 0, flags [none], proto: TCP (6), length: 173) 12.4.4.4.2051 > 12.1.1.1.179: P, cksum 0xcf18 (correct), 3293077573:3293077694(121) ack 3348108582 win 16384 : BGP, length: 121 Update Message (2), length: 121 Origin (1), length: 1, Flags [T]: IGP AS Path (2), length: 0, Flags [T]: empty Local Preference (5), length: 4, Flags [T]: 100 Extended Community (16), length: 8, Flags [OT]: target (0x0002), Flags [none]: 300:0.0.1.44 Attribute Set (128), length: 36, Flags [OT]: Origin AS: 65001 Origin (1), length: 1, Flags [T]: IGP AS Path (2), length: 4, Flags [T]: 5555 Local Preference (5), length: 4, Flags [T]: 44 Originator ID (9), length: 4, Flags [O]: 22.5.5.5 Cluster List (10), length: 4, Flags [O]: 22.5.5.5 Multi-Protocol Reach NLRI (14), length: 30, Flags [OE]: AFI: IPv4 (1), SAFI: labeled VPN Unicast (128) nexthop: RD: 0:0.0.0.0, 12.4.4.4, nh-length: 12, no SNPA RD: 500:0.0.1.244, 133.0.0.0/8, label:100208 (bottom) tcpdump-3.9.8/./tests/rsvp-infinite-loop.pcap0000644000026300017500000000060010233757631017244 0ustar mcrmcrÔò¡`q{ÕoBdž88Î*E(@€.ÐÐM+À¨˜Î@{ÕoBñ|88Î*E(@@. WÇj§=À¨˜Î@{ÕoB4g88Î*E(@@.¯å³ À¨X΀{ÕoBuQ88Î*E(@@.|rck™!À¨X΀{ÕoB¶; 88Î*E(@@.¥\¼.tÀ¨X΀tcpdump-3.9.8/./tests/esp0.sh0000644000026300017500000000026507627040171014042 0ustar mcrmcr#!/bin/sh echo -n test esp0... uudecode 02-sunrise-sunset-esp.puu if (../tcpdump -t -n -r 02-sunrise-sunset-esp.pcap | diff - esp0.out) then echo passed. else echo failed. fi tcpdump-3.9.8/./tests/alltests.sh0000644000026300017500000000015110032056462015012 0ustar mcrmcr#!/bin/sh for i in *.sh do if [ "X$i" = "Xalltests.sh" ] then continue; fi sh ./$i done tcpdump-3.9.8/./tests/print-xx.new0000644000026300017500000005167210320056212015136 0ustar mcrmcr23:57:35.938066 IP 127.0.0.1.55920 > 127.0.0.1.80: S 928549246:928549246(0) win 32767 0x0000: 0000 0000 0000 0000 0000 0000 0800 4500 0x0010: 003c 1b68 4000 4006 2152 7f00 0001 7f00 0x0020: 0001 da70 0050 3758 897e 0000 0000 a002 0x0030: 7fff 1421 0000 0204 400c 0402 080a 4ddc 0x0040: 9216 0000 0000 0103 0302 23:57:35.938122 IP 127.0.0.1.80 > 127.0.0.1.55920: S 930778609:930778609(0) ack 928549247 win 32767 0x0000: 0000 0000 0000 0000 0000 0000 0800 4500 0x0010: 003c 0000 4000 4006 3cba 7f00 0001 7f00 0x0020: 0001 0050 da70 377a 8df1 3758 897f a012 0x0030: 7fff 6eb1 0000 0204 400c 0402 080a 4ddc 0x0040: 9216 4ddc 9216 0103 0302 23:57:35.938167 IP 127.0.0.1.55920 > 127.0.0.1.80: . ack 1 win 8192 0x0000: 0000 0000 0000 0000 0000 0000 0800 4500 0x0010: 0034 1b6a 4000 4006 2158 7f00 0001 7f00 0x0020: 0001 da70 0050 3758 897f 377a 8df2 8010 0x0030: 2000 37d0 0000 0101 080a 4ddc 9216 4ddc 0x0040: 9216 23:57:35.939423 IP 127.0.0.1.55920 > 127.0.0.1.80: P 1:203(202) ack 1 win 8192 0x0000: 0000 0000 0000 0000 0000 0000 0800 4500 0x0010: 00fe 1b6c 4000 4006 208c 7f00 0001 7f00 0x0020: 0001 da70 0050 3758 897f 377a 8df2 8018 0x0030: 2000 fef2 0000 0101 080a 4ddc 9217 4ddc 0x0040: 9216 4745 5420 2f20 4854 5450 2f31 2e31 0x0050: 0d0a 486f 7374 3a20 6c6f 6361 6c68 6f73 0x0060: 740d 0a55 7365 722d 4167 656e 743a 2045 0x0070: 4c69 6e6b 732f 302e 3130 2e34 2d37 2d64 0x0080: 6562 6961 6e20 2874 6578 746d 6f64 653b 0x0090: 204c 696e 7578 2032 2e36 2e31 312d 312d 0x00a0: 3638 362d 736d 7020 6936 3836 3b20 3133 0x00b0: 3278 3536 2d32 290d 0a41 6363 6570 743a 0x00c0: 202a 2f2a 0d0a 4163 6365 7074 2d45 6e63 0x00d0: 6f64 696e 673a 2067 7a69 700d 0a41 6363 0x00e0: 6570 742d 4c61 6e67 7561 6765 3a20 656e 0x00f0: 0d0a 436f 6e6e 6563 7469 6f6e 3a20 4b65 0x0100: 6570 2d41 6c69 7665 0d0a 0d0a 23:57:35.940474 IP 127.0.0.1.80 > 127.0.0.1.55920: . ack 203 win 8192 0x0000: 0000 0000 0000 0000 0000 0000 0800 4500 0x0010: 0034 1fe4 4000 4006 1cde 7f00 0001 7f00 0x0020: 0001 0050 da70 377a 8df2 3758 8a49 8010 0x0030: 2000 3703 0000 0101 080a 4ddc 9218 4ddc 0x0040: 9217 23:57:35.941232 IP 127.0.0.1.80 > 127.0.0.1.55920: P 1:5560(5559) ack 203 win 8192 0x0000: 0000 0000 0000 0000 0000 0000 0800 4500 0x0010: 15eb 1fe6 4000 4006 0725 7f00 0001 7f00 0x0020: 0001 0050 da70 377a 8df2 3758 8a49 8018 0x0030: 2000 13e0 0000 0101 080a 4ddc 9219 4ddc 0x0040: 9217 4854 5450 2f31 2e31 2032 3030 204f 0x0050: 4b0d 0a44 6174 653a 2057 6564 2c20 3036 0x0060: 204a 756c 2032 3030 3520 3033 3a35 373a 0x0070: 3335 2047 4d54 0d0a 5365 7276 6572 3a20 0x0080: 4170 6163 6865 2f31 2e33 2e33 330d 0a4c 0x0090: 6173 742d 4d6f 6469 6669 6564 3a20 5375 0x00a0: 6e2c 2031 3520 4175 6720 3230 3034 2030 0x00b0: 303a 3433 3a34 3120 474d 540d 0a45 5461 0x00c0: 673a 2022 3665 3830 6630 2d31 3438 612d 0x00d0: 3431 3165 6231 6264 220d 0a41 6363 6570 0x00e0: 742d 5261 6e67 6573 3a20 6279 7465 730d 0x00f0: 0a43 6f6e 7465 6e74 2d4c 656e 6774 683a 0x0100: 2035 3235 380d 0a4b 6565 702d 416c 6976 0x0110: 653a 2074 696d 656f 7574 3d31 352c 206d 0x0120: 6178 3d31 3030 0d0a 436f 6e6e 6563 7469 0x0130: 6f6e 3a20 4b65 6570 2d41 6c69 7665 0d0a 0x0140: 436f 6e74 656e 742d 5479 7065 3a20 7465 0x0150: 7874 2f68 746d 6c3b 2063 6861 7273 6574 0x0160: 3d69 736f 2d38 3835 392d 310d 0a0d 0a3c 0x0170: 2144 4f43 5459 5045 2048 544d 4c20 5055 0x0180: 424c 4943 2022 2d2f 2f57 3343 2f2f 4454 0x0190: 4420 4854 4d4c 2034 2e30 3120 5472 616e 0x01a0: 7369 7469 6f6e 616c 2f2f 454e 223e 0a3c 0x01b0: 4854 4d4c 3e0a 3c48 4541 443e 0a20 2020 0x01c0: 3c4d 4554 4120 4854 5450 2d45 5155 4956 0x01d0: 3d22 436f 6e74 656e 742d 5479 7065 2220 0x01e0: 434f 4e54 454e 543d 2274 6578 742f 6874 0x01f0: 6d6c 3b20 6368 6172 7365 743d 6973 6f2d 0x0200: 3838 3539 2d31 223e 0a20 2020 3c4d 4554 0x0210: 4120 4e41 4d45 3d22 4465 7363 7269 7074 0x0220: 696f 6e22 2043 4f4e 5445 4e54 3d22 5468 0x0230: 6520 696e 6974 6961 6c20 696e 7374 616c 0x0240: 6c61 7469 6f6e 206f 6620 4465 6269 616e 0x0250: 2061 7061 6368 652e 223e 0a20 2020 3c54 0x0260: 4954 4c45 3e50 6c61 6365 686f 6c64 6572 0x0270: 2070 6167 653c 2f54 4954 4c45 3e0a 3c2f 0x0280: 4845 4144 3e0a 3c42 4f44 5920 5445 5854 0x0290: 3d22 2330 3030 3030 3022 2042 4743 4f4c 0x02a0: 4f52 3d22 2346 4646 4646 4622 204c 494e 0x02b0: 4b3d 2223 3030 3030 4546 2220 564c 494e 0x02c0: 4b3d 2223 3535 3138 3841 2220 414c 494e 0x02d0: 4b3d 2223 4646 3030 3030 223e 0a0a 3c48 0x02e0: 313e 506c 6163 6568 6f6c 6465 7220 7061 0x02f0: 6765 3c2f 4831 3e0a 3c48 323e 4966 2079 0x0300: 6f75 2061 7265 206a 7573 7420 6272 6f77 0x0310: 7369 6e67 2074 6865 2077 6562 3c2f 6832 0x0320: 3e0a 0a3c 503e 5468 6520 6f77 6e65 7220 0x0330: 6f66 2074 6869 7320 7765 6220 7369 7465 0x0340: 2068 6173 206e 6f74 2070 7574 2075 7020 0x0350: 616e 7920 7765 6220 7061 6765 7320 7965 0x0360: 742e 0a50 6c65 6173 6520 636f 6d65 2062 0x0370: 6163 6b20 6c61 7465 722e 3c2f 503e 0a0a 0x0380: 3c50 3e3c 534d 414c 4c3e 3c43 4954 453e 0x0390: 4d6f 7665 2061 6c6f 6e67 2c20 6e6f 7468 0x03a0: 696e 6720 746f 2073 6565 2068 6572 652e 0x03b0: 2e2e 3c2f 4349 5445 3e20 3a2d 293c 2f53 0x03c0: 4d41 4c4c 3e3c 2f50 3e0a 0a3c 4832 3e49 0x03d0: 6620 796f 7520 6172 6520 7472 7969 6e67 0x03e0: 2074 6f20 6c6f 6361 7465 2074 6865 2061 0x03f0: 646d 696e 6973 7472 6174 6f72 206f 6620 0x0400: 7468 6973 206d 6163 6869 6e65 3c2f 4832 0x0410: 3e0a 0a3c 503e 4966 2079 6f75 2077 616e 0x0420: 7420 746f 2072 6570 6f72 7420 736f 6d65 0x0430: 7468 696e 6720 6162 6f75 7420 7468 6973 0x0440: 2068 6f73 7427 7320 6265 6861 7669 6f72 0x0450: 2c20 706c 6561 7365 0a63 6f6e 7461 6374 0x0460: 2074 6865 2049 6e74 6572 6e65 7420 5365 0x0470: 7276 6963 6520 5072 6f76 6964 6572 2028 0x0480: 4953 5029 2069 6e76 6f6c 7665 6420 6469 0x0490: 7265 6374 6c79 2e3c 2f50 3e0a 0a3c 503e 0x04a0: 5365 6520 7468 6520 3c41 2068 7265 663d 0x04b0: 2268 7474 703a 2f2f 7777 772e 6162 7573 0x04c0: 652e 6e65 742f 223e 4e65 7477 6f72 6b20 0x04d0: 4162 7573 650a 436c 6561 7269 6e67 686f 0x04e0: 7573 653c 2f41 3e20 666f 7220 686f 7720 0x04f0: 746f 2064 6f20 7468 6973 2e3c 2f50 3e0a 0x0500: 0a3c 4832 3e49 6620 796f 7520 6172 6520 0x0510: 7468 6520 6164 6d69 6e69 7374 7261 746f 0x0520: 7220 6f66 2074 6869 7320 6d61 6368 696e 0x0530: 653c 2f48 323e 0a0a 3c50 3e54 6865 2069 0x0540: 6e69 7469 616c 2069 6e73 7461 6c6c 6174 0x0550: 696f 6e20 6f66 203c 4120 6872 6566 3d22 0x0560: 6874 7470 3a2f 2f77 7777 2e64 6562 6961 0x0570: 6e2e 6f72 672f 223e 4465 6269 616e 2773 0x0580: 0a61 7061 6368 653c 2f41 3e20 7765 6220 0x0590: 7365 7276 6572 2070 6163 6b61 6765 2077 0x05a0: 6173 2073 7563 6365 7373 6675 6c2e 3c2f 0x05b0: 503e 0a0a 3c50 3e3c 5354 524f 4e47 3e59 0x05c0: 6f75 2073 686f 756c 6420 7265 706c 6163 0x05d0: 6520 7468 6973 2070 6167 6520 7769 7468 0x05e0: 2079 6f75 7220 6f77 6e20 7765 6220 7061 0x05f0: 6765 7320 6173 0a73 6f6f 6e20 6173 2070 0x0600: 6f73 7369 626c 652e 3c2f 5354 524f 4e47 0x0610: 3e3c 2f50 3e0a 0a3c 503e 556e 6c65 7373 0x0620: 2079 6f75 2063 6861 6e67 6564 2069 7473 0x0630: 2063 6f6e 6669 6775 7261 7469 6f6e 2c20 0x0640: 796f 7572 206e 6577 2073 6572 7665 7220 0x0650: 6973 2063 6f6e 6669 6775 7265 6420 6173 0x0660: 2066 6f6c 6c6f 7773 3a0a 3c55 4c3e 0a3c 0x0670: 4c49 3e0a 436f 6e66 6967 7572 6174 696f 0x0680: 6e20 6669 6c65 7320 6361 6e20 6265 2066 0x0690: 6f75 6e64 2069 6e20 3c54 543e 2f65 7463 0x06a0: 2f61 7061 6368 653c 2f54 543e 2e3c 2f4c 0x06b0: 493e 0a0a 3c4c 493e 0a54 6865 203c 5454 0x06c0: 3e44 6f63 756d 656e 7452 6f6f 743c 2f54 0x06d0: 543e 2c20 7768 6963 6820 6973 2074 6865 0x06e0: 2064 6972 6563 746f 7279 2075 6e64 6572 0x06f0: 2077 6869 6368 2061 6c6c 2079 6f75 720a 0x0700: 4854 4d4c 2066 696c 6573 2073 686f 756c 0x0710: 6420 6578 6973 742c 2069 7320 7365 7420 0x0720: 746f 203c 5454 3e2f 7661 722f 7777 773c 0x0730: 2f54 543e 2e3c 2f4c 493e 0a0a 3c4c 493e 0x0740: 0a43 4749 2073 6372 6970 7473 2061 7265 0x0750: 206c 6f6f 6b65 6420 666f 7220 696e 203c 0x0760: 5454 3e2f 7573 722f 6c69 622f 6367 692d 0x0770: 6269 6e3c 2f54 543e 2c20 7768 6963 6820 0x0780: 6973 2077 6865 7265 0a44 6562 6961 6e20 0x0790: 7061 636b 6167 6573 2077 696c 6c20 706c 0x07a0: 6163 6520 7468 6569 7220 7363 7269 7074 0x07b0: 732e 3c2f 4c49 3e0a 0a3c 4c49 3e0a 4c6f 0x07c0: 6720 6669 6c65 7320 6172 6520 706c 6163 0x07d0: 6564 2069 6e20 3c54 543e 2f76 6172 2f6c 0x07e0: 6f67 2f61 7061 6368 653c 2f54 543e 2c20 0x07f0: 616e 6420 7769 6c6c 2062 6520 726f 7461 0x0800: 7465 640a 7765 656b 6c79 2e20 2054 6865 0x0810: 2066 7265 7175 656e 6379 206f 6620 726f 0x0820: 7461 7469 6f6e 2063 616e 2062 6520 6561 0x0830: 7369 6c79 2063 6861 6e67 6564 2062 7920 0x0840: 6564 6974 696e 670a 3c54 543e 2f65 7463 0x0850: 2f6c 6f67 726f 7461 7465 2e64 2f61 7061 0x0860: 6368 653c 2f54 543e 2e3c 2f4c 493e 0a0a 0x0870: 3c4c 493e 0a54 6865 2064 6566 6175 6c74 0x0880: 2064 6972 6563 746f 7279 2069 6e64 6578 0x0890: 2069 7320 3c54 543e 696e 6465 782e 6874 0x08a0: 6d6c 3c2f 5454 3e2c 206d 6561 6e69 6e67 0x08b0: 2074 6861 7420 7265 7175 6573 7473 0a66 0x08c0: 6f72 2061 2064 6972 6563 746f 7279 203c 0x08d0: 5454 3e2f 666f 6f2f 6261 722f 3c2f 5454 0x08e0: 3e20 7769 6c6c 2067 6976 6520 7468 6520 0x08f0: 636f 6e74 656e 7473 206f 6620 7468 6520 0x0900: 6669 6c65 203c 5454 3e2f 7661 722f 7777 0x0910: 772f 666f 6f2f 6261 722f 696e 6465 782e 0x0920: 6874 6d6c 3c2f 5454 3e0a 6966 2069 7420 0x0930: 6578 6973 7473 2028 6173 7375 6d69 6e67 0x0940: 2074 6861 7420 3c54 543e 2f76 6172 2f77 0x0950: 7777 3c2f 5454 3e20 6973 2079 6f75 7220 0x0960: 3c54 543e 446f 6375 6d65 6e74 526f 6f74 0x0970: 3c2f 5454 3e29 2e3c 2f4c 493e 0a0a 3c4c 0x0980: 493e 0a55 7365 7220 6469 7265 6374 6f72 0x0990: 6965 7320 6172 6520 656e 6162 6c65 642c 0x09a0: 2061 6e64 2075 7365 7220 646f 6375 6d65 0x09b0: 6e74 7320 7769 6c6c 2062 6520 6c6f 6f6b 0x09c0: 6564 2066 6f72 0a69 6e20 7468 6520 3c54 0x09d0: 543e 7075 626c 6963 5f68 746d 6c3c 2f54 0x09e0: 543e 2064 6972 6563 746f 7279 206f 6620 0x09f0: 7468 6520 7573 6572 7327 2068 6f6d 6573 0x0a00: 2e20 2054 6865 7365 2064 6972 730a 7368 0x0a10: 6f75 6c64 2062 6520 756e 6465 7220 3c54 0x0a20: 543e 2f68 6f6d 653c 2f54 543e 2c20 616e 0x0a30: 6420 7573 6572 7320 7769 6c6c 206e 6f74 0x0a40: 2062 6520 6162 6c65 2074 6f20 7379 6d6c 0x0a50: 696e 6b0a 746f 2066 696c 6573 2074 6865 0x0a60: 7920 646f 6e27 7420 6f77 6e2e 3c2f 4c49 0x0a70: 3e0a 0a3c 2f55 4c3e 0a41 6c6c 2074 6865 0x0a80: 2073 7461 6e64 6172 6420 6170 6163 6865 0x0a90: 206d 6f64 756c 6573 2061 7265 2061 7661 0x0aa0: 696c 6162 6c65 2077 6974 6820 7468 6973 0x0ab0: 2072 656c 6561 7365 2061 6e64 2061 7265 0x0ac0: 0a6e 6f77 206d 616e 6167 6564 2077 6974 0x0ad0: 6820 6465 6263 6f6e 662e 2020 5479 7065 0x0ae0: 203c 5454 3e64 706b 672d 7265 636f 6e66 0x0af0: 6967 7572 6520 6170 6163 6865 3c2f 5454 0x0b00: 3e20 746f 0a73 656c 6563 7420 7768 6963 0x0b10: 6820 6d6f 6475 6c65 7320 796f 7520 7761 0x0b20: 6e74 2065 6e61 626c 6564 2e20 204d 616e 0x0b30: 7920 6f74 6865 7220 6d6f 6475 6c65 7320 0x0b40: 6172 6520 6176 6169 6c61 626c 650a 7468 0x0b50: 726f 7567 6820 7468 6520 4465 6269 616e 0x0b60: 2070 6163 6b61 6765 2073 7973 7465 6d20 0x0b70: 7769 7468 2074 6865 206e 616d 6573 203c 0x0b80: 5454 3e6c 6962 6170 6163 6865 2d6d 6f64 0x0b90: 2d2a 3c2f 5454 3e2e 0a49 6620 796f 7520 0x0ba0: 6e65 6564 2074 6f20 636f 6d70 696c 6520 0x0bb0: 6120 6d6f 6475 6c65 2079 6f75 7273 656c 0x0bc0: 662c 2079 6f75 2077 696c 6c20 6e65 6564 0x0bd0: 2074 6f20 696e 7374 616c 6c20 7468 650a 0x0be0: 3c54 543e 6170 6163 6865 2d64 6576 3c2f 0x0bf0: 5454 3e20 7061 636b 6167 652e 0a0a 3c50 0x0c00: 3e4d 6f72 6520 646f 6375 6d65 6e74 6174 0x0c10: 696f 6e20 6f6e 2041 7061 6368 6520 6361 0x0c20: 6e20 6265 2066 6f75 6e64 206f 6e3a 0a3c 0x0c30: 554c 3e0a 3c4c 493e 0a54 6865 203c 4120 0x0c40: 4852 4546 3d22 2f64 6f63 2f61 7061 6368 0x0c50: 652d 646f 632f 6d61 6e75 616c 2f22 3e41 0x0c60: 7061 6368 6520 646f 6375 6d65 6e74 6174 0x0c70: 696f 6e3c 2f41 3e20 7374 6f72 6564 206f 0x0c80: 6e20 796f 7572 2073 6572 7665 722e 3c2f 0x0c90: 4c49 3e0a 0a3c 4c49 3e0a 5468 6520 3c41 0x0ca0: 2048 5245 463d 2268 7474 703a 2f2f 7777 0x0cb0: 772e 6170 6163 6865 2e6f 7267 2f22 3e41 0x0cc0: 7061 6368 6520 5072 6f6a 6563 743c 2f41 0x0cd0: 3e20 686f 6d65 2073 6974 652e 3c2f 4c49 0x0ce0: 3e0a 0a3c 4c49 3e0a 5468 6520 3c41 2048 0x0cf0: 5245 463d 2268 7474 703a 2f2f 7777 772e 0x0d00: 6170 6163 6865 2d73 736c 2e6f 7267 2f22 0x0d10: 3e41 7061 6368 652d 5353 4c3c 2f41 3e20 0x0d20: 686f 6d65 2073 6974 652e 3c2f 4c49 3e0a 0x0d30: 0a3c 4c49 3e0a 5468 6520 3c41 2048 5245 0x0d40: 463d 2268 7474 703a 2f2f 7065 726c 2e61 0x0d50: 7061 6368 652e 6f72 672f 223e 6d6f 6420 0x0d60: 7065 726c 3c2f 413e 2068 6f6d 6520 7369 0x0d70: 7465 2e3c 2f4c 493e 0a0a 3c4c 493e 0a54 0x0d80: 6865 203c 4120 4852 4546 3d22 6874 7470 0x0d90: 3a2f 2f77 7777 2e61 7061 6368 6577 6565 0x0da0: 6b2e 636f 6d2f 223e 4170 6163 6865 5765 0x0db0: 656b 3c2f 413e 206e 6577 736c 6574 7465 0x0dc0: 722e 3c2f 4c49 3e0a 0a3c 4c49 3e0a 5468 0x0dd0: 6520 3c41 2048 5245 463d 2268 7474 703a 0x0de0: 2f2f 7777 772e 6465 6269 616e 2e6f 7267 0x0df0: 2f64 6f63 2f22 3e44 6562 6961 6e20 5072 0x0e00: 6f6a 6563 740a 446f 6375 6d65 6e74 6174 0x0e10: 696f 6e3c 2f41 3e20 7768 6963 6820 636f 0x0e20: 6e74 6169 6e73 2048 4f57 544f 732c 2046 0x0e30: 4151 732c 2061 6e64 2073 6f66 7477 6172 0x0e40: 6520 7570 6461 7465 732e 3c2f 4c49 3e0a 0x0e50: 3c2f 554c 3e0a 0a3c 503e 596f 7520 6361 0x0e60: 6e20 616c 736f 2063 6f6e 7375 6c74 2074 0x0e70: 6865 206c 6973 7420 6f66 203c 4120 4852 0x0e80: 4546 3d22 6874 7470 3a2f 2f77 7777 2e62 0x0e90: 6f75 7465 6c6c 2e63 6f6d 2f66 6171 2f22 0x0ea0: 3e57 6f72 6c64 0a57 6964 6520 5765 6220 0x0eb0: 4672 6571 7565 6e74 6c79 2041 736b 6564 0x0ec0: 2051 7565 7374 696f 6e73 3c2f 413e 2066 0x0ed0: 6f72 2069 6e66 6f72 6d61 7469 6f6e 2e0a 0x0ee0: 0a3c 4832 3e4c 6574 206f 7468 6572 2070 0x0ef0: 656f 706c 6520 6b6e 6f77 2061 626f 7574 0x0f00: 2074 6869 7320 7365 7276 6572 3c2f 4832 0x0f10: 3e0a 0a3c 4120 4852 4546 3d22 6874 7470 0x0f20: 3a2f 2f6e 6574 6372 6166 742e 636f 6d2f 0x0f30: 223e 4e65 7463 7261 6674 3c2f 413e 2070 0x0f40: 726f 7669 6465 7320 616e 2069 6e74 6572 0x0f50: 6573 7469 6e67 2066 7265 650a 7365 7276 0x0f60: 6963 6520 666f 7220 7765 6220 7369 7465 0x0f70: 206d 6f6e 6974 6f72 696e 6720 616e 6420 0x0f80: 7374 6174 6973 7469 6320 636f 6c6c 6563 0x0f90: 7469 6f6e 2e0a 596f 7520 6361 6e20 6c65 0x0fa0: 7420 7468 656d 206b 6e6f 7720 6162 6f75 0x0fb0: 7420 796f 7572 2073 6572 7665 7220 7573 0x0fc0: 696e 6720 7468 6569 720a 3c41 2048 5245 0x0fd0: 463d 2268 7474 703a 2f2f 7570 7469 6d65 0x0fe0: 2e6e 6574 6372 6166 742e 636f 6d2f 223e 0x0ff0: 696e 7465 7266 6163 653c 2f41 3e2e 0a45 0x1000: 6e61 626c 696e 6720 7468 6520 6d6f 6e69 0x1010: 746f 7269 6e67 206f 6620 796f 7572 2073 0x1020: 6572 7665 7220 7769 6c6c 2070 726f 7669 0x1030: 6465 2061 2062 6574 7465 7220 676c 6f62 0x1040: 616c 206f 7665 7276 6965 770a 6f66 2077 0x1050: 686f 2069 7320 7573 696e 6720 7768 6174 0x1060: 2061 6e64 2077 6865 7265 2c20 616e 6420 0x1070: 6974 2077 6f75 6c64 2067 6976 6520 4465 0x1080: 6269 616e 2061 2062 6574 7465 720a 6f76 0x1090: 6572 7669 6577 206f 6620 7468 6520 6170 0x10a0: 6163 6865 2070 6163 6b61 6765 2075 7361 0x10b0: 6765 2e0a 0a3c 4832 3e41 626f 7574 2074 0x10c0: 6869 7320 7061 6765 3c2f 4832 3e0a 0a3c 0x10d0: 494d 4720 414c 4947 4e3d 2272 6967 6874 0x10e0: 2220 414c 543d 2222 2048 4549 4748 543d 0x10f0: 2232 3437 2220 5749 4454 483d 2232 3738 0x1100: 2220 5352 433d 2269 636f 6e73 2f6a 6865 0x1110: 3036 312e 706e 6722 3e0a 0a3c 503e 5468 0x1120: 6973 2069 7320 6120 706c 6163 6568 6f6c 0x1130: 6465 7220 7061 6765 2069 6e73 7461 6c6c 0x1140: 6564 2062 7920 7468 6520 3c41 0a48 5245 0x1150: 463d 2268 7474 703a 2f2f 7777 772e 6465 0x1160: 6269 616e 2e6f 7267 2f22 3e44 6562 6961 0x1170: 6e3c 2f41 3e0a 7265 6c65 6173 6520 6f66 0x1180: 2074 6865 2061 7061 6368 6520 5765 6220 0x1190: 7365 7276 6572 2070 6163 6b61 6765 2e0a 0x11a0: 0a3c 503e 5468 6973 2063 6f6d 7075 7465 0x11b0: 7220 6861 7320 696e 7374 616c 6c65 6420 0x11c0: 7468 6520 4465 6269 616e 2047 4e55 2f4c 0x11d0: 696e 7578 206f 7065 7261 7469 6e67 2073 0x11e0: 7973 7465 6d2c 0a62 7574 2069 7420 6861 0x11f0: 7320 3c73 7472 6f6e 673e 6e6f 7468 696e 0x1200: 6720 746f 2064 6f20 7769 7468 2074 6865 0x1210: 2044 6562 6961 6e0a 5072 6f6a 6563 743c 0x1220: 2f73 7472 6f6e 673e 2e20 506c 6561 7365 0x1230: 2064 6f20 3c73 7472 6f6e 673e 6e6f 743c 0x1240: 2f73 7472 6f6e 673e 2063 6f6e 7461 6374 0x1250: 2074 6865 2044 6562 6961 6e0a 5072 6f6a 0x1260: 6563 7420 6162 6f75 7420 6974 2e3c 2f50 0x1270: 3e0a 0a3c 503e 4966 2079 6f75 2066 696e 0x1280: 6420 6120 6275 6720 696e 2074 6869 7320 0x1290: 6170 6163 6865 2070 6163 6b61 6765 2c20 0x12a0: 6f72 2069 6e20 4170 6163 6865 2069 7473 0x12b0: 656c 662c 0a70 6c65 6173 6520 6669 6c65 0x12c0: 2061 2062 7567 2072 6570 6f72 7420 6f6e 0x12d0: 2069 742e 2020 496e 7374 7275 6374 696f 0x12e0: 6e73 206f 6e20 646f 696e 6720 7468 6973 0x12f0: 2c20 616e 6420 7468 650a 6c69 7374 206f 0x1300: 6620 3c41 2048 5245 463d 2268 7474 703a 0x1310: 2f2f 6275 6773 2e64 6562 6961 6e2e 6f72 0x1320: 672f 7372 633a 6170 6163 6865 223e 6b6e 0x1330: 6f77 6e20 6275 6773 3c2f 413e 206f 6620 0x1340: 7468 6973 0a70 6163 6b61 6765 2c20 6361 0x1350: 6e20 6265 2066 6f75 6e64 2069 6e20 7468 0x1360: 6520 0a3c 4120 4852 4546 3d22 6874 7470 0x1370: 3a2f 2f77 7777 2e64 6562 6961 6e2e 6f72 0x1380: 672f 4275 6773 2f52 6570 6f72 7469 6e67 0x1390: 223e 4465 6269 616e 2042 7567 2054 7261 0x13a0: 636b 696e 6720 5379 7374 656d 3c2f 413e 0x13b0: 2e0a 0a3c 503e 5468 616e 6b73 2066 6f72 0x13c0: 2075 7369 6e67 2074 6869 7320 7061 636b 0x13d0: 6167 652c 2061 6e64 2063 6f6e 6772 6174 0x13e0: 756c 6174 696f 6e73 2066 6f72 2079 6f75 0x13f0: 7220 6368 6f69 6365 206f 660a 6120 4465 0x1400: 6269 616e 2073 7973 7465 6d21 3c2f 503e 0x1410: 0a0a 3c44 4956 2061 6c69 676e 3d22 6365 0x1420: 6e74 6572 223e 0a3c 6120 6872 6566 3d22 0x1430: 6874 7470 3a2f 2f77 7777 2e64 6562 6961 0x1440: 6e2e 6f72 672f 223e 0a3c 494d 4720 616c 0x1450: 6967 6e3d 226d 6964 646c 6522 2068 6569 0x1460: 6768 743d 2233 3022 2077 6964 7468 3d22 0x1470: 3235 2220 7372 633d 2269 636f 6e73 2f64 0x1480: 6562 6961 6e2f 6f70 656e 6c6f 676f 2d32 0x1490: 352e 6a70 6722 2061 6c74 3d22 4465 6269 0x14a0: 616e 223e 0a3c 2f61 3e0a 3c61 2068 7265 0x14b0: 663d 2268 7474 703a 2f2f 7777 772e 6170 0x14c0: 6163 6865 2e6f 7267 2f22 3e0a 3c49 4d47 0x14d0: 2061 6c69 676e 3d22 6d69 6464 6c65 2220 0x14e0: 6865 6967 6874 3d22 3332 2220 7769 6474 0x14f0: 683d 2232 3539 2220 7372 633d 2269 636f 0x1500: 6e73 2f61 7061 6368 655f 7062 2e70 6e67 0x1510: 2220 616c 743d 2241 7061 6368 6522 3e0a 0x1520: 3c2f 613e 0a3c 2f44 4956 3e0a 0a3c 212d 0x1530: 2d0a 2020 5468 6973 2070 6167 6520 7761 0x1540: 7320 696e 6974 6961 6c6c 7920 6372 6561 0x1550: 7465 6420 6279 204a 6f68 6e69 6520 496e 0x1560: 6772 616d 2028 6874 7470 3a2f 2f6e 6574 0x1570: 676f 642e 6e65 742f 290a 2020 4974 2077 0x1580: 6173 206c 6174 6572 2065 6469 7465 6420 0x1590: 6279 204d 6174 7468 6577 2057 696c 636f 0x15a0: 7820 616e 6420 4a6f 7369 7020 526f 6469 0x15b0: 6e2e 0a20 204c 6173 7420 6d6f 6469 6669 0x15c0: 6564 3a20 2444 6174 653a 2032 3030 342f 0x15d0: 3036 2f32 3020 3135 3a33 333a 3537 2024 0x15e0: 2e0a 2020 2d2d 3e0a 0a3c 2f42 4f44 593e 0x15f0: 0a3c 2f48 544d 4c3e 0a 23:57:35.941260 IP 127.0.0.1.55920 > 127.0.0.1.80: . ack 5560 win 12383 0x0000: 0000 0000 0000 0000 0000 0000 0800 4500 0x0010: 0034 1b6e 4000 4006 2154 7f00 0001 7f00 0x0020: 0001 da70 0050 3758 8a49 377a a3a9 8010 0x0030: 305f 10ea 0000 0101 080a 4ddc 9219 4ddc 0x0040: 9219 23:57:37.229575 IP 127.0.0.1.55920 > 127.0.0.1.80: F 203:203(0) ack 5560 win 12383 0x0000: 0000 0000 0000 0000 0000 0000 0800 4500 0x0010: 0034 1b70 4000 4006 2152 7f00 0001 7f00 0x0020: 0001 da70 0050 3758 8a49 377a a3a9 8011 0x0030: 305f 0be1 0000 0101 080a 4ddc 9721 4ddc 0x0040: 9219 23:57:37.230839 IP 127.0.0.1.80 > 127.0.0.1.55920: F 5560:5560(0) ack 204 win 8192 0x0000: 0000 0000 0000 0000 0000 0000 0800 4500 0x0010: 0034 1fe8 4000 4006 1cda 7f00 0001 7f00 0x0020: 0001 0050 da70 377a a3a9 3758 8a4a 8011 0x0030: 2000 1735 0000 0101 080a 4ddc 9723 4ddc 0x0040: 9721 23:57:37.230900 IP 127.0.0.1.55920 > 127.0.0.1.80: . ack 5561 win 12383 0x0000: 0000 0000 0000 0000 0000 0000 0800 4500 0x0010: 0034 1b72 4000 4006 2150 7f00 0001 7f00 0x0020: 0001 da70 0050 3758 8a4a 377a a3aa 8010 0x0030: 305f 06d4 0000 0101 080a 4ddc 9723 4ddc 0x0040: 9723 tcpdump-3.9.8/./tests/lmp.new0000644000026300017500000002630610320056212014131 0ustar mcrmcrIP (tos 0x0, ttl 1, id 44530, offset 0, flags [none], proto: UDP (17), length: 84) 10.0.12.1.49998 > 10.0.12.2.49998: LMPv1, msg-type: Begin Verify, Flags: [Control Channel Down], length: 56 Link ID Object (3), Class-Type: IPv4 Local (1) Flags: [non-negotiable], length: 8 IPv4 Link ID: 1.0.0.0 (0x01000000) Message ID Object (5), Class-Type: 1 (1) Flags: [non-negotiable], length: 8 Message ID: 3 (0x00000003) Link ID Object (3), Class-Type: IPv4 Remote (2) Flags: [non-negotiable], length: 8 IPv4 Link ID: 1.0.0.0 (0x01000000) Verify Begin Object (8), Class-Type: 1 (1) Flags: [negotiable], length: 24 Flags: none Verify Interval: 20 Data links: 30 Encoding type: Lambda (photonic) Verify Tranport Mechanism: 32768 (0x8000) Transmission Rate: 100.000 Mbps Wavelength: 8 IP (tos 0x0, ttl 1, id 44531, offset 0, flags [none], proto: UDP (17), length: 56) 10.0.12.1.49998 > 10.0.12.2.49998: LMPv1, msg-type: Hello, Flags: [Control Channel Down], length: 28 Control Channel ID Object (1), Class-Type: Local (1) Flags: [non-negotiable], length: 8 Control Channel ID: 1 (0x00000001) Hello Object (7), Class-Type: 1 (1) Flags: [non-negotiable], length: 12 TxSeqNum: 50 RcvSeqNum: 60 IP (tos 0x0, ttl 1, id 44532, offset 0, flags [none], proto: UDP (17), length: 84) 10.0.12.1.49998 > 10.0.12.2.49998: LMPv1, msg-type: Config NACK, Flags: [Control Channel Down], length: 56 Control Channel ID Object (1), Class-Type: Local (1) Flags: [non-negotiable], length: 8 Control Channel ID: 1 (0x00000001) Node ID Object (2), Class-Type: Local (1) Flags: [non-negotiable], length: 8 Node ID: 10.0.50.1 (0x0a003201) Control Channel ID Object (1), Class-Type: Remote (2) Flags: [non-negotiable], length: 8 Control Channel ID: 2 (0x00000002) Message ID Object (5), Class-Type: 2 (2) Flags: [non-negotiable], length: 8 Message ID Ack: 3 (0x00000003) Node ID Object (2), Class-Type: Remote (2) Flags: [non-negotiable], length: 8 Node ID: 10.0.50.2 (0x0a003202) Configuration Object (6), Class-Type: 1 (1) Flags: [negotiable], length: 8 Hello Interval: 5 Hello Dead Interval: 15 IP (tos 0x0, ttl 1, id 44533, offset 0, flags [none], proto: UDP (17), length: 76) 10.0.12.1.49998 > 10.0.12.2.49998: LMPv1, msg-type: Config ACK, Flags: [Control Channel Down], length: 48 Control Channel ID Object (1), Class-Type: Local (1) Flags: [non-negotiable], length: 8 Control Channel ID: 1 (0x00000001) Node ID Object (2), Class-Type: Local (1) Flags: [non-negotiable], length: 8 Node ID: 10.0.50.1 (0x0a003201) Control Channel ID Object (1), Class-Type: Remote (2) Flags: [non-negotiable], length: 8 Control Channel ID: 2 (0x00000002) Message ID Object (5), Class-Type: 2 (2) Flags: [non-negotiable], length: 8 Message ID Ack: 3 (0x00000003) Node ID Object (2), Class-Type: Remote (2) Flags: [non-negotiable], length: 8 Node ID: 10.0.50.2 (0x0a003202) IP (tos 0x0, ttl 1, id 44534, offset 0, flags [none], proto: UDP (17), length: 68) 10.0.12.1.49998 > 10.0.12.2.49998: LMPv1, msg-type: Config, Flags: [Control Channel Down], length: 40 Control Channel ID Object (1), Class-Type: Local (1) Flags: [non-negotiable], length: 8 Control Channel ID: 1 (0x00000001) Message ID Object (5), Class-Type: 1 (1) Flags: [non-negotiable], length: 8 Message ID: 3 (0x00000003) Node ID Object (2), Class-Type: Local (1) Flags: [non-negotiable], length: 8 Node ID: 10.0.50.1 (0x0a003201) Configuration Object (6), Class-Type: 1 (1) Flags: [negotiable], length: 8 Hello Interval: 5 Hello Dead Interval: 15 IP (tos 0x0, ttl 1, id 44535, offset 0, flags [none], proto: UDP (17), length: 44) 10.0.12.1.49998 > 10.0.12.2.49998: LMPv1, msg-type: Link Summary ACK, Flags: [Control Channel Down], length: 16 Message ID Object (5), Class-Type: 2 (2) Flags: [non-negotiable], length: 8 Message ID Ack: 1 (0x00000001) IP (tos 0x0, ttl 1, id 44536, offset 0, flags [none], proto: UDP (17), length: 124) 10.0.12.1.49998 > 10.0.12.2.49998: LMPv1, msg-type: Link Summary NACK, Flags: [Control Channel Down], length: 96 Message ID Object (5), Class-Type: 2 (2) Flags: [non-negotiable], length: 8 Message ID Ack: 1 (0x00000001) Error Code Object (20), Class-Type: 2 (2) Flags: [non-negotiable], length: 8 Error Code: Unacceptable non-negotiable LINK_SUMMARY parameters, Renegotiate LINK_SUMMARY parameters, Invalid DATA-LINK Object, Unknown TE-LINK Object c-type, Unknown DATA-LINK Object c-type Data Link Object (12), Class-Type: IPv4 (1) Flags: [non-negotiable], length: 36 Flags: [none] Local Interface ID: 192.168.1.1 (0xc0a80101) Remote Interface ID: 192.168.1.2 (0xc0a80102) Subobject, Type: Interface Switching Type (1), Length: 12 Switching Type: Lambda-Switch Capable (150) Encoding Type: Lambda (photonic) (8) Min Reservable Bandwidth: 100.000 Mbps Max Reservable Bandwidth: 100.000 Mbps Subobject, Type: Wavelength (2), Length: 8 Wavelength: 6 Data Link Object (12), Class-Type: IPv4 (1) Flags: [non-negotiable], length: 36 Flags: [none] Local Interface ID: 10.1.1.1 (0x0a010101) Remote Interface ID: 10.1.1.2 (0x0a010102) Subobject, Type: Interface Switching Type (1), Length: 12 Switching Type: Lambda-Switch Capable (150) Encoding Type: ANSI/ETSI PDH (3) Min Reservable Bandwidth: 1234736768.000 Mbps Max Reservable Bandwidth: 1290693376.000 Mbps Subobject, Type: Wavelength (2), Length: 8 Wavelength: 353 IP (tos 0x0, ttl 1, id 44537, offset 0, flags [none], proto: UDP (17), length: 68) 10.0.12.1.49998 > 10.0.12.2.49998: LMPv1, msg-type: Begin Verify ACK, Flags: [Control Channel Down], length: 40 Link ID Object (3), Class-Type: IPv4 Local (1) Flags: [non-negotiable], length: 8 IPv4 Link ID: 1.0.0.0 (0x01000000) Message ID Object (5), Class-Type: 2 (2) Flags: [non-negotiable], length: 8 Message ID Ack: 1 (0x00000001) Verify Begin ACK Object (9), Class-Type: 1 (1) Flags: [negotiable], length: 8 Verify Dead Interval: 50 Verify Transport Response: 100 Verify ID Object (10), Class-Type: 1 (1) Flags: [non-negotiable], length: 8 Verify ID: 5 IP (tos 0x0, ttl 1, id 44538, offset 0, flags [none], proto: UDP (17), length: 60) 10.0.12.1.49998 > 10.0.12.2.49998: LMPv1, msg-type: Begin Verify NACK, Flags: [Control Channel Down], length: 32 Link ID Object (3), Class-Type: IPv4 Local (1) Flags: [non-negotiable], length: 8 IPv4 Link ID: 10.0.0.0 (0x0a000000) Message ID Object (5), Class-Type: 2 (2) Flags: [non-negotiable], length: 8 Message ID Ack: 3 (0x00000003) Error Code Object (20), Class-Type: 1 (1) Flags: [non-negotiable], length: 8 Error Code: Link Verification Procedure Not supported, Unwilling to verify, Unsupported verification transport mechanism IP (tos 0x0, ttl 1, id 44539, offset 0, flags [none], proto: UDP (17), length: 52) 10.0.12.1.49998 > 10.0.12.2.49998: LMPv1, msg-type: End Verify, Flags: [Control Channel Down], length: 24 Message ID Object (5), Class-Type: 1 (1) Flags: [non-negotiable], length: 8 Message ID: 3 (0x00000003) Verify ID Object (10), Class-Type: 1 (1) Flags: [non-negotiable], length: 8 Verify ID: 5 IP (tos 0x0, ttl 1, id 44540, offset 0, flags [none], proto: UDP (17), length: 52) 10.0.12.1.49998 > 10.0.12.2.49998: LMPv1, msg-type: End Verify ACK, Flags: [Control Channel Down], length: 24 Message ID Object (5), Class-Type: 2 (2) Flags: [non-negotiable], length: 8 Message ID Ack: 3 (0x00000003) Verify ID Object (10), Class-Type: 1 (1) Flags: [non-negotiable], length: 8 Verify ID: 5 IP (tos 0x0, ttl 1, id 44541, offset 0, flags [none], proto: UDP (17), length: 52) 10.0.12.1.49998 > 10.0.12.2.49998: LMPv1, msg-type: Test, Flags: [Control Channel Down], length: 24 Interface ID Object (4), Class-Type: IPv4 Local (1) Flags: [non-negotiable], length: 8 IPv4 Link ID: 1.0.0.0 (0x01000000) Verify ID Object (10), Class-Type: 1 (1) Flags: [non-negotiable], length: 8 Verify ID: 5 IP (tos 0x0, ttl 1, id 44542, offset 0, flags [none], proto: UDP (17), length: 52) 10.0.12.1.49998 > 10.0.12.2.49998: LMPv1, msg-type: Test Status Failure, Flags: [Control Channel Down], length: 24 Message ID Object (5), Class-Type: 1 (1) Flags: [non-negotiable], length: 8 Message ID: 1 (0x00000001) Verify ID Object (10), Class-Type: 1 (1) Flags: [non-negotiable], length: 8 Verify ID: 5 IP (tos 0x0, ttl 1, id 44543, offset 0, flags [none], proto: UDP (17), length: 52) 10.0.12.1.49998 > 10.0.12.2.49998: LMPv1, msg-type: Test Status ACK, Flags: [Control Channel Down], length: 24 Message ID Object (5), Class-Type: 2 (2) Flags: [non-negotiable], length: 8 Message ID Ack: 1 (0x00000001) Verify ID Object (10), Class-Type: 1 (1) Flags: [non-negotiable], length: 8 Verify ID: 5 IP (tos 0x0, ttl 1, id 44544, offset 0, flags [none], proto: UDP (17), length: 44) 10.0.12.1.49998 > 10.0.12.2.49998: LMPv1, msg-type: Channel Status ACK, Flags: [Control Channel Down], length: 16 Message ID Object (5), Class-Type: 2 (2) Flags: [non-negotiable], length: 8 Message ID Ack: 3 (0x00000003) IP (tos 0x0, ttl 1, id 44545, offset 0, flags [none], proto: UDP (17), length: 64) 10.0.12.1.49998 > 10.0.12.2.49998: LMPv1, msg-type: Channel Status Request, Flags: [Control Channel Down], length: 36 Link ID Object (3), Class-Type: IPv4 Local (1) Flags: [non-negotiable], length: 8 IPv4 Link ID: 1.0.0.0 (0x01000000) Message ID Object (5), Class-Type: 1 (1) Flags: [non-negotiable], length: 8 Message ID: 3 (0x00000003) Channel Status Request Object (14), Class-Type: IPv4 (1) Flags: [non-negotiable], length: 12 Interface ID: 2.0.0.0 (0x02000000) Interface ID: 2.0.0.0 (0x02000000) IP (tos 0x0, ttl 1, id 44546, offset 0, flags [none], proto: UDP (17), length: 72) 10.0.12.1.49998 > 10.0.12.2.49998: LMPv1, msg-type: Channel Status, Flags: [Control Channel Down], length: 44 Link ID Object (3), Class-Type: IPv4 Local (1) Flags: [non-negotiable], length: 8 IPv4 Link ID: 1.0.0.0 (0x01000000) Message ID Object (5), Class-Type: 1 (1) Flags: [non-negotiable], length: 8 Message ID: 3 (0x00000003) Channel Status Object (13), Class-Type: IPv4 (1) Flags: [non-negotiable], length: 20 Interface ID: 1.0.0.0 (0x01000000) Active: Allocated (1) Direction: Transmit (1) Channel Status: Signal Fail (3) Interface ID: 1.0.0.0 (0x01000000) Active: Allocated (1) Direction: Receive (0) Channel Status: Signal Degraded (2) IP (tos 0x0, ttl 1, id 44547, offset 0, flags [none], proto: UDP (17), length: 64) 10.0.12.1.49998 > 10.0.12.2.49998: LMPv1, msg-type: Channel Status Response, Flags: [Control Channel Down], length: 36 Message ID Object (5), Class-Type: 2 (2) Flags: [non-negotiable], length: 8 Message ID Ack: 3 (0x00000003) Channel Status Object (13), Class-Type: IPv4 (1) Flags: [non-negotiable], length: 20 Interface ID: 1.0.0.0 (0x01000000) Active: Allocated (1) Direction: Transmit (1) Channel Status: Signal Degraded (2) Interface ID: 1.0.0.0 (0x01000000) Active: Allocated (1) Direction: Transmit (1) Channel Status: Signal Okay (1) tcpdump-3.9.8/./tests/esp3.sh0000644000026300017500000000041110225052107014024 0ustar mcrmcr#!/bin/sh uudecode 02-sunrise-sunset-esp.puu echo -n test esp3... ../tcpdump -t -n -E "3des-cbc-hmac96:0x4043434545464649494a4a4c4c4f4f515152525454575758" -r 02-sunrise-sunset-esp.pcap >esp3.new if diff esp3.new esp1.out then echo passed. else echo failed. fi tcpdump-3.9.8/./tests/ospf-gmpls.new0000644000026300017500000000775210320056212015434 0ustar mcrmcrIP (tos 0xc0, ttl 1, id 4052, offset 0, flags [none], proto: OSPF (89), length: 172) 40.35.1.2 > 224.0.0.5: OSPFv2, LS-Update, length: 152 Router-ID: 10.255.245.35, Backbone Area, Authentication Type: none (0), 1 LSA LSA #1 Advertising Router: 10.255.245.37, seq 0x80000002, age 9s, length: 104 Area Local Opaque LSA (10), Opaque-Type: Traffic Engineering LSA (1), Opaque-ID: 8 Options: [External] Link TLV (2), length: 100 Link Type subTLV (1), length: 1, Point-to-point (1) Link ID subTLV (2), length: 4, 10.255.245.69 (0x0afff545) Local Interface IP address subTLV (3), length: 4, 10.9.142.1 Remote Interface IP address subTLV (4), length: 4, 10.9.142.2 Traffic Engineering Metric subTLV (5), length: 4, Metric 63 Maximum Bandwidth subTLV (6), length: 4, 622.080 Mbps Maximum Reservable Bandwidth subTLV (7), length: 4, 622.080 Mbps Unreserved Bandwidth subTLV (8), length: 32 TE-Class 0: 622.080 Mbps TE-Class 1: 622.080 Mbps TE-Class 2: 622.080 Mbps TE-Class 3: 622.080 Mbps TE-Class 4: 622.080 Mbps TE-Class 5: 622.080 Mbps TE-Class 6: 622.080 Mbps TE-Class 7: 622.080 Mbps Administrative Group subTLV (9), length: 4, 0x00000000 IP (tos 0xc0, ttl 1, id 4106, offset 0, flags [none], proto: OSPF (89), length: 172) 40.35.1.2 > 224.0.0.5: OSPFv2, LS-Update, length: 152 Router-ID: 10.255.245.35, Backbone Area, Authentication Type: none (0), 1 LSA LSA #1 Advertising Router: 10.255.245.37, seq 0x80000002, age 9s, length: 104 Area Local Opaque LSA (10), Opaque-Type: Traffic Engineering LSA (1), Opaque-ID: 9 Options: [External] Link TLV (2), length: 100 Link Type subTLV (1), length: 1, Point-to-point (1) Link ID subTLV (2), length: 4, 10.255.245.69 (0x0afff545) Local Interface IP address subTLV (3), length: 4, 10.9.143.1 Remote Interface IP address subTLV (4), length: 4, 10.9.143.2 Traffic Engineering Metric subTLV (5), length: 4, Metric 63 Maximum Bandwidth subTLV (6), length: 4, 622.080 Mbps Maximum Reservable Bandwidth subTLV (7), length: 4, 622.080 Mbps Unreserved Bandwidth subTLV (8), length: 32 TE-Class 0: 622.080 Mbps TE-Class 1: 622.080 Mbps TE-Class 2: 622.080 Mbps TE-Class 3: 622.080 Mbps TE-Class 4: 622.080 Mbps TE-Class 5: 622.080 Mbps TE-Class 6: 622.080 Mbps TE-Class 7: 622.080 Mbps Administrative Group subTLV (9), length: 4, 0x00000000 IP (tos 0xc0, ttl 1, id 4160, offset 0, flags [none], proto: OSPF (89), length: 212) 40.35.1.2 > 224.0.0.5: OSPFv2, LS-Update, length: 192 Router-ID: 10.255.245.35, Backbone Area, Authentication Type: none (0), 1 LSA LSA #1 Advertising Router: 10.255.245.35, seq 0x80000003, age 3s, length: 144 Area Local Opaque LSA (10), Opaque-Type: Traffic Engineering LSA (1), Opaque-ID: 3 Options: [External] Link TLV (2), length: 140 Link Type subTLV (1), length: 1, Point-to-point (1) Link ID subTLV (2), length: 4, 10.255.245.40 (0x0afff528) Local Interface IP address subTLV (3), length: 4, 10.40.35.14 Remote Interface IP address subTLV (4), length: 4, 10.40.35.13 Traffic Engineering Metric subTLV (5), length: 4, Metric 1 Maximum Bandwidth subTLV (6), length: 4, 100.000 Mbps Maximum Reservable Bandwidth subTLV (7), length: 4, 100.000 Mbps Unreserved Bandwidth subTLV (8), length: 32 TE-Class 0: 0.000 Mbps TE-Class 1: 0.000 Mbps TE-Class 2: 0.000 Mbps TE-Class 3: 0.000 Mbps TE-Class 4: 0.000 Mbps TE-Class 5: 0.000 Mbps TE-Class 6: 0.000 Mbps TE-Class 7: 0.000 Mbps Interface Switching Capability subTLV (15), length: 44 Interface Switching Capability: Packet-Switch Capable-1 LSP Encoding: Ethernet V2/DIX Max LSP Bandwidth: priority level 0: 0.000 Mbps priority level 1: 0.000 Mbps priority level 2: 0.000 Mbps priority level 3: 0.000 Mbps priority level 4: 0.000 Mbps priority level 5: 0.000 Mbps priority level 6: 0.000 Mbps priority level 7: 0.000 Mbps tcpdump-3.9.8/./tests/espudp1.pcap0000644000026300017500000000261010320056212015044 0ustar mcrmcrÔò¡žžddEdd#E¦@PÀÀ-””|4Vx§QÞ¹)#ŒL«žòU ·dÅ¢g)üŽz~cªKTªYöBz)$Ì#C´ÂQ‘#+Ñ`ŽOIÀG&¶UÇš^ýÂqQÀG½Ô[d,;µnMQIÆb¼F"RÌ£"­Z?çjã3Úǃ¾~žžddEdd#E¦@PÀÀ-””|4Vx)1($¯«eAeý~î÷‰<©mîÖèŠzºØFåE'¨L羪ÅI¼Wnåª9ò!¬N¸Óu=¯æù» ¡»˜uCÌp •ªF'å4ó9$UÞ|žHu²Vð'„ô€tÁ6ÞoPîÏ žžddEdd#E¦@PÀÀ-””|4VxÐ|ɺĠþx]íëEž=*{/+Õák"'±aüûkÆÞ k &HNîw‰ñ_k˜>•i; ª;câJ+ŠQOÄYÛ`ÝÄê—§Ø$nÓì…& BÜ(‰8.Î} H\zKõ™i 6eŠc!]žžddEdd#E¦@PÀÀ-””|4Vx›fð©ò"ûI’1áé’q)ø;"Ðij™B€×ÔÝ]%èÕ`"oE1vE›¾#ªj¹úu"Ûp¯ðò¸ðV;R¢-d-cÖrxG|ÓW¸áxb_ÍGth‡;"¼4ÚàŠºXÉ”õàVOÑžžddEdd#E¦@PÀÀ-””|4Vxvò…FoBFáF ï|„ÅWù#Ë{zH#ÊjËZE冘V° ÎŽÆ Æ¸– Êxn{¹«Ä¯ž¶|Êt^е^±¤´ôj²Íb¾9Qô’)‡NF Ü0<†oì’À°‡&e\§y2¤IKëP¨ÑžžddEdd#E¦@PÀÀ-””|4Vx¿I‹Üíï“Õ‰^ga–g&­ðäF²D œ~h¹WÆPåø”rôÓ_¿Ü÷Uý®'òÛ2Uoœ£C¤8%!VÔlŠ%æ»…äÀØÄ=,v¶°D6'¾ëÎ8wï˜L{~ òO¦¬œþÙFéÀ#?³žžddEdd#E¦@PÀÀ-””|4Vx™M94³ÒâŽ=N£”XXž}¬i¸8QضXNsÖöNó½ÈîCî[Ñ{~êsÉäwFYL%ß)dc°˜Ññ*Î:ÇUÑEïà ¢µ3ò™9ÏN"ÕXÕãOË·Ê8øµ¿Å‡kIžžddEdd#E¦@PÀÀ-””|4Vx+ôìXi%eqÇB‚(qVn`tS öÙ¬»ÉƒÓž:TËk¥&! Y)Èväˆ"Š–Ðš)*ꬨum0O»Û#+Ì¿÷Û«¨¦¾gv F,fÊÀ5¢vÄ÷R‰´GRm“‰û=I»Átcpdump-3.9.8/./tests/lspping-fec-ldp.pcap0000644000026300017500000000224610064003463016461 0ustar mcrmcrÔò¡Ü !{Í@lù OOÿ“ @EÀGŸ@¶Ê  ³nç$¦°þ€'€@ý  ´ }¾ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ${Í@ÝÎTTÿ•ÿELŸ@L… ² ¯8—’@Í{$Îu   ${Í@ÐÒ@@ÿ!EÀ<ƾ>›   ¯²(¥2@Í{$Îu@Í{$ÔŽ${Í@'g OOÿ– @EÀGŸ@½Ò  Ö³ÓÂ*<”\€@l   µGýkÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ${Í@wí<<ÿ– @EÀ4Ÿ@½ä  Ö³ÓÕ*<”o€@dQ  µQ %%{Í@õTTÿ•ÿELŸ@L ² ¯8p´@Í{%õQ   %{Í@¨ø@@ÿ!EÀ<ÆÀ>›   ¯²(Xp@Í{%õQ@Í{%úq&{Í@_öTTÿ•ÿELŸ@L ² ¯8oç@Í{&ö   &{Í@Ãù@@ÿ!EÀ<ÆÂ>›   ¯²(V@Í{&ö@Í{&û†'{Í@AöTTÿ•ÿELŸ@L} ² ¯8p@Í{'õó   '{Í@Šù@@ÿ!EÀ<ÆÃ>›   ¯²(Vë@Í{'õó@Í{'ûN({Í@öTTÿ•ÿELŸ@L{ ² ¯8oº@Í{(öE   ({Í@%ú@@ÿ!EÀ<ÆÆ>›   ¯²(Uþ@Í{(öE@Í{(ûætcpdump-3.9.8/./tests/print-capXX.out0000644000026300017500000007043410504040016015534 0ustar mcrmcr23:57:35.938066 IP 127.0.0.1.55920 > 127.0.0.1.80: S 928549246:928549246(0) win 32767 0x0000: 0000 0000 0000 0000 0000 0000 0800 4500 ..............E. 0x0010: 003c 1b68 4000 4006 2152 7f00 0001 7f00 .<.h@.@.!R...... 0x0020: 0001 da70 0050 3758 897e 0000 0000 a002 ...p.P7X.~...... 0x0030: 7fff 1421 0000 0204 400c 0402 080a 4ddc ...!....@.....M. 0x0040: 9216 0000 0000 0103 0302 .......... 23:57:35.938122 IP 127.0.0.1.80 > 127.0.0.1.55920: S 930778609:930778609(0) ack 928549247 win 32767 0x0000: 0000 0000 0000 0000 0000 0000 0800 4500 ..............E. 0x0010: 003c 0000 4000 4006 3cba 7f00 0001 7f00 .<..@.@.<....... 0x0020: 0001 0050 da70 377a 8df1 3758 897f a012 ...P.p7z..7X.... 0x0030: 7fff 6eb1 0000 0204 400c 0402 080a 4ddc ..n.....@.....M. 0x0040: 9216 4ddc 9216 0103 0302 ..M....... 23:57:35.938167 IP 127.0.0.1.55920 > 127.0.0.1.80: . ack 1 win 8192 0x0000: 0000 0000 0000 0000 0000 0000 0800 4500 ..............E. 0x0010: 0034 1b6a 4000 4006 2158 7f00 0001 7f00 .4.j@.@.!X...... 0x0020: 0001 da70 0050 3758 897f 377a 8df2 8010 ...p.P7X..7z.... 0x0030: 2000 37d0 0000 0101 080a 4ddc 9216 4ddc ..7.......M...M. 0x0040: 9216 .. 23:57:35.939423 IP 127.0.0.1.55920 > 127.0.0.1.80: P 1:203(202) ack 1 win 8192 0x0000: 0000 0000 0000 0000 0000 0000 0800 4500 ..............E. 0x0010: 00fe 1b6c 4000 4006 208c 7f00 0001 7f00 ...l@.@......... 0x0020: 0001 da70 0050 3758 897f 377a 8df2 8018 ...p.P7X..7z.... 0x0030: 2000 fef2 0000 0101 080a 4ddc 9217 4ddc ..........M...M. 0x0040: 9216 4745 5420 2f20 4854 5450 2f31 2e31 ..GET./.HTTP/1.1 0x0050: 0d0a 486f 7374 3a20 6c6f 6361 6c68 6f73 ..Host:.localhos 0x0060: 740d 0a55 7365 722d 4167 656e 743a 2045 t..User-Agent:.E 0x0070: 4c69 6e6b 732f 302e 3130 2e34 2d37 2d64 Links/0.10.4-7-d 0x0080: 6562 6961 6e20 2874 6578 746d 6f64 653b ebian.(textmode; 0x0090: 204c 696e 7578 2032 2e36 2e31 312d 312d .Linux.2.6.11-1- 0x00a0: 3638 362d 736d 7020 6936 3836 3b20 3133 686-smp.i686;.13 0x00b0: 3278 3536 2d32 290d 0a41 6363 6570 743a 2x56-2)..Accept: 0x00c0: 202a 2f2a 0d0a 4163 6365 7074 2d45 6e63 .*/*..Accept-Enc 0x00d0: 6f64 696e 673a 2067 7a69 700d 0a41 6363 oding:.gzip..Acc 0x00e0: 6570 742d 4c61 6e67 7561 6765 3a20 656e ept-Language:.en 0x00f0: 0d0a 436f 6e6e 6563 7469 6f6e 3a20 4b65 ..Connection:.Ke 0x0100: 6570 2d41 6c69 7665 0d0a 0d0a ep-Alive.... 23:57:35.940474 IP 127.0.0.1.80 > 127.0.0.1.55920: . ack 203 win 8192 0x0000: 0000 0000 0000 0000 0000 0000 0800 4500 ..............E. 0x0010: 0034 1fe4 4000 4006 1cde 7f00 0001 7f00 .4..@.@......... 0x0020: 0001 0050 da70 377a 8df2 3758 8a49 8010 ...P.p7z..7X.I.. 0x0030: 2000 3703 0000 0101 080a 4ddc 9218 4ddc ..7.......M...M. 0x0040: 9217 .. 23:57:35.941232 IP 127.0.0.1.80 > 127.0.0.1.55920: P 1:5560(5559) ack 203 win 8192 0x0000: 0000 0000 0000 0000 0000 0000 0800 4500 ..............E. 0x0010: 15eb 1fe6 4000 4006 0725 7f00 0001 7f00 ....@.@..%...... 0x0020: 0001 0050 da70 377a 8df2 3758 8a49 8018 ...P.p7z..7X.I.. 0x0030: 2000 13e0 0000 0101 080a 4ddc 9219 4ddc ..........M...M. 0x0040: 9217 4854 5450 2f31 2e31 2032 3030 204f ..HTTP/1.1.200.O 0x0050: 4b0d 0a44 6174 653a 2057 6564 2c20 3036 K..Date:.Wed,.06 0x0060: 204a 756c 2032 3030 3520 3033 3a35 373a .Jul.2005.03:57: 0x0070: 3335 2047 4d54 0d0a 5365 7276 6572 3a20 35.GMT..Server:. 0x0080: 4170 6163 6865 2f31 2e33 2e33 330d 0a4c Apache/1.3.33..L 0x0090: 6173 742d 4d6f 6469 6669 6564 3a20 5375 ast-Modified:.Su 0x00a0: 6e2c 2031 3520 4175 6720 3230 3034 2030 n,.15.Aug.2004.0 0x00b0: 303a 3433 3a34 3120 474d 540d 0a45 5461 0:43:41.GMT..ETa 0x00c0: 673a 2022 3665 3830 6630 2d31 3438 612d g:."6e80f0-148a- 0x00d0: 3431 3165 6231 6264 220d 0a41 6363 6570 411eb1bd"..Accep 0x00e0: 742d 5261 6e67 6573 3a20 6279 7465 730d t-Ranges:.bytes. 0x00f0: 0a43 6f6e 7465 6e74 2d4c 656e 6774 683a .Content-Length: 0x0100: 2035 3235 380d 0a4b 6565 702d 416c 6976 .5258..Keep-Aliv 0x0110: 653a 2074 696d 656f 7574 3d31 352c 206d e:.timeout=15,.m 0x0120: 6178 3d31 3030 0d0a 436f 6e6e 6563 7469 ax=100..Connecti 0x0130: 6f6e 3a20 4b65 6570 2d41 6c69 7665 0d0a on:.Keep-Alive.. 0x0140: 436f 6e74 656e 742d 5479 7065 3a20 7465 Content-Type:.te 0x0150: 7874 2f68 746d 6c3b 2063 6861 7273 6574 xt/html;.charset 0x0160: 3d69 736f 2d38 3835 392d 310d 0a0d 0a3c =iso-8859-1....< 0x0170: 2144 4f43 5459 5045 2048 544d 4c20 5055 !DOCTYPE.HTML.PU 0x0180: 424c 4943 2022 2d2f 2f57 3343 2f2f 4454 BLIC."-//W3C//DT 0x0190: 4420 4854 4d4c 2034 2e30 3120 5472 616e D.HTML.4.01.Tran 0x01a0: 7369 7469 6f6e 616c 2f2f 454e 223e 0a3c sitional//EN">.< 0x01b0: 4854 4d4c 3e0a 3c48 4541 443e 0a20 2020 HTML>..... 0x01c0: 3c4d 4554 4120 4854 5450 2d45 5155 4956 ........Placeholder 0x0270: 2070 6167 653c 2f54 4954 4c45 3e0a 3c2f .page....Placeholder.pa 0x02f0: 6765 3c2f 4831 3e0a 3c48 323e 4966 2079 ge

.

If.y 0x0300: 6f75 2061 7265 206a 7573 7420 6272 6f77 ou.are.just.brow 0x0310: 7369 6e67 2074 6865 2077 6562 3c2f 6832 sing.the.web

..

The.owner. 0x0330: 6f66 2074 6869 7320 7765 6220 7369 7465 of.this.web.site 0x0340: 2068 6173 206e 6f74 2070 7574 2075 7020 .has.not.put.up. 0x0350: 616e 7920 7765 6220 7061 6765 7320 7965 any.web.pages.ye 0x0360: 742e 0a50 6c65 6173 6520 636f 6d65 2062 t..Please.come.b 0x0370: 6163 6b20 6c61 7465 722e 3c2f 503e 0a0a ack.later.

.. 0x0380: 3c50 3e3c 534d 414c 4c3e 3c43 4954 453e

0x0390: 4d6f 7665 2061 6c6f 6e67 2c20 6e6f 7468 Move.along,.noth 0x03a0: 696e 6720 746f 2073 6565 2068 6572 652e ing.to.see.here. 0x03b0: 2e2e 3c2f 4349 5445 3e20 3a2d 293c 2f53 ...:-)

..

I 0x03d0: 6620 796f 7520 6172 6520 7472 7969 6e67 f.you.are.trying 0x03e0: 2074 6f20 6c6f 6361 7465 2074 6865 2061 .to.locate.the.a 0x03f0: 646d 696e 6973 7472 6174 6f72 206f 6620 dministrator.of. 0x0400: 7468 6973 206d 6163 6869 6e65 3c2f 4832 this.machine

..

If.you.wan 0x0420: 7420 746f 2072 6570 6f72 7420 736f 6d65 t.to.report.some 0x0430: 7468 696e 6720 6162 6f75 7420 7468 6973 thing.about.this 0x0440: 2068 6f73 7427 7320 6265 6861 7669 6f72 .host's.behavior 0x0450: 2c20 706c 6561 7365 0a63 6f6e 7461 6374 ,.please.contact 0x0460: 2074 6865 2049 6e74 6572 6e65 7420 5365 .the.Internet.Se 0x0470: 7276 6963 6520 5072 6f76 6964 6572 2028 rvice.Provider.( 0x0480: 4953 5029 2069 6e76 6f6c 7665 6420 6469 ISP).involved.di 0x0490: 7265 6374 6c79 2e3c 2f50 3e0a 0a3c 503e rectly.

..

0x04a0: 5365 6520 7468 6520 3c41 2068 7265 663d See.the.Network. 0x04d0: 4162 7573 650a 436c 6561 7269 6e67 686f Abuse.Clearingho 0x04e0: 7573 653c 2f41 3e20 666f 7220 686f 7720 use.for.how. 0x04f0: 746f 2064 6f20 7468 6973 2e3c 2f50 3e0a to.do.this.

. 0x0500: 0a3c 4832 3e49 6620 796f 7520 6172 6520 .

If.you.are. 0x0510: 7468 6520 6164 6d69 6e69 7374 7261 746f the.administrato 0x0520: 7220 6f66 2074 6869 7320 6d61 6368 696e r.of.this.machin 0x0530: 653c 2f48 323e 0a0a 3c50 3e54 6865 2069 e

..

The.i 0x0540: 6e69 7469 616c 2069 6e73 7461 6c6c 6174 nitial.installat 0x0550: 696f 6e20 6f66 203c 4120 6872 6566 3d22 ion.of.Debian's 0x0580: 0a61 7061 6368 653c 2f41 3e20 7765 6220 .apache.web. 0x0590: 7365 7276 6572 2070 6163 6b61 6765 2077 server.package.w 0x05a0: 6173 2073 7563 6365 7373 6675 6c2e 3c2f as.successful...

Y 0x05c0: 6f75 2073 686f 756c 6420 7265 706c 6163 ou.should.replac 0x05d0: 6520 7468 6973 2070 6167 6520 7769 7468 e.this.page.with 0x05e0: 2079 6f75 7220 6f77 6e20 7765 6220 7061 .your.own.web.pa 0x05f0: 6765 7320 6173 0a73 6f6f 6e20 6173 2070 ges.as.soon.as.p 0x0600: 6f73 7369 626c 652e 3c2f 5354 524f 4e47 ossible.

..

Unless 0x0620: 2079 6f75 2063 6861 6e67 6564 2069 7473 .you.changed.its 0x0630: 2063 6f6e 6669 6775 7261 7469 6f6e 2c20 .configuration,. 0x0640: 796f 7572 206e 6577 2073 6572 7665 7220 your.new.server. 0x0650: 6973 2063 6f6e 6669 6775 7265 6420 6173 is.configured.as 0x0660: 2066 6f6c 6c6f 7773 3a0a 3c55 4c3e 0a3c .follows:.

    .< 0x0670: 4c49 3e0a 436f 6e66 6967 7572 6174 696f LI>.Configuratio 0x0680: 6e20 6669 6c65 7320 6361 6e20 6265 2066 n.files.can.be.f 0x0690: 6f75 6e64 2069 6e20 3c54 543e 2f65 7463 ound.in./etc 0x06a0: 2f61 7061 6368 653c 2f54 543e 2e3c 2f4c /apache...
  • .The.DocumentRoot,.which.is.the 0x06e0: 2064 6972 6563 746f 7279 2075 6e64 6572 .directory.under 0x06f0: 2077 6869 6368 2061 6c6c 2079 6f75 720a .which.all.your. 0x0700: 4854 4d4c 2066 696c 6573 2073 686f 756c HTML.files.shoul 0x0710: 6420 6578 6973 742c 2069 7320 7365 7420 d.exist,.is.set. 0x0720: 746f 203c 5454 3e2f 7661 722f 7777 773c to./var/www< 0x0730: 2f54 543e 2e3c 2f4c 493e 0a0a 3c4c 493e /TT>.
  • ..
  • 0x0740: 0a43 4749 2073 6372 6970 7473 2061 7265 .CGI.scripts.are 0x0750: 206c 6f6f 6b65 6420 666f 7220 696e 203c .looked.for.in.< 0x0760: 5454 3e2f 7573 722f 6c69 622f 6367 692d TT>/usr/lib/cgi- 0x0770: 6269 6e3c 2f54 543e 2c20 7768 6963 6820 bin,.which. 0x0780: 6973 2077 6865 7265 0a44 6562 6961 6e20 is.where.Debian. 0x0790: 7061 636b 6167 6573 2077 696c 6c20 706c packages.will.pl 0x07a0: 6163 6520 7468 6569 7220 7363 7269 7074 ace.their.script 0x07b0: 732e 3c2f 4c49 3e0a 0a3c 4c49 3e0a 4c6f s.
  • ..
  • .Lo 0x07c0: 6720 6669 6c65 7320 6172 6520 706c 6163 g.files.are.plac 0x07d0: 6564 2069 6e20 3c54 543e 2f76 6172 2f6c ed.in./var/l 0x07e0: 6f67 2f61 7061 6368 653c 2f54 543e 2c20 og/apache,. 0x07f0: 616e 6420 7769 6c6c 2062 6520 726f 7461 and.will.be.rota 0x0800: 7465 640a 7765 656b 6c79 2e20 2054 6865 ted.weekly...The 0x0810: 2066 7265 7175 656e 6379 206f 6620 726f .frequency.of.ro 0x0820: 7461 7469 6f6e 2063 616e 2062 6520 6561 tation.can.be.ea 0x0830: 7369 6c79 2063 6861 6e67 6564 2062 7920 sily.changed.by. 0x0840: 6564 6974 696e 670a 3c54 543e 2f65 7463 editing./etc 0x0850: 2f6c 6f67 726f 7461 7465 2e64 2f61 7061 /logrotate.d/apa 0x0860: 6368 653c 2f54 543e 2e3c 2f4c 493e 0a0a che.
  • .. 0x0870: 3c4c 493e 0a54 6865 2064 6566 6175 6c74
  • .The.default 0x0880: 2064 6972 6563 746f 7279 2069 6e64 6578 .directory.index 0x0890: 2069 7320 3c54 543e 696e 6465 782e 6874 .is.index.ht 0x08a0: 6d6c 3c2f 5454 3e2c 206d 6561 6e69 6e67 ml,.meaning 0x08b0: 2074 6861 7420 7265 7175 6573 7473 0a66 .that.requests.f 0x08c0: 6f72 2061 2064 6972 6563 746f 7279 203c or.a.directory.< 0x08d0: 5454 3e2f 666f 6f2f 6261 722f 3c2f 5454 TT>/foo/bar/.will.give.the. 0x08f0: 636f 6e74 656e 7473 206f 6620 7468 6520 contents.of.the. 0x0900: 6669 6c65 203c 5454 3e2f 7661 722f 7777 file./var/ww 0x0910: 772f 666f 6f2f 6261 722f 696e 6465 782e w/foo/bar/index. 0x0920: 6874 6d6c 3c2f 5454 3e0a 6966 2069 7420 html.if.it. 0x0930: 6578 6973 7473 2028 6173 7375 6d69 6e67 exists.(assuming 0x0940: 2074 6861 7420 3c54 543e 2f76 6172 2f77 .that./var/w 0x0950: 7777 3c2f 5454 3e20 6973 2079 6f75 7220 ww.is.your. 0x0960: 3c54 543e 446f 6375 6d65 6e74 526f 6f74 DocumentRoot 0x0970: 3c2f 5454 3e29 2e3c 2f4c 493e 0a0a 3c4c ).
  • ...User.director 0x0990: 6965 7320 6172 6520 656e 6162 6c65 642c ies.are.enabled, 0x09a0: 2061 6e64 2075 7365 7220 646f 6375 6d65 .and.user.docume 0x09b0: 6e74 7320 7769 6c6c 2062 6520 6c6f 6f6b nts.will.be.look 0x09c0: 6564 2066 6f72 0a69 6e20 7468 6520 3c54 ed.for.in.the.public_html.directory.of. 0x09f0: 7468 6520 7573 6572 7327 2068 6f6d 6573 the.users'.homes 0x0a00: 2e20 2054 6865 7365 2064 6972 730a 7368 ...These.dirs.sh 0x0a10: 6f75 6c64 2062 6520 756e 6465 7220 3c54 ould.be.under./home
    ,.an 0x0a30: 6420 7573 6572 7320 7769 6c6c 206e 6f74 d.users.will.not 0x0a40: 2062 6520 6162 6c65 2074 6f20 7379 6d6c .be.able.to.syml 0x0a50: 696e 6b0a 746f 2066 696c 6573 2074 6865 ink.to.files.the 0x0a60: 7920 646f 6e27 7420 6f77 6e2e 3c2f 4c49 y.don't.own...
.All.the 0x0a80: 2073 7461 6e64 6172 6420 6170 6163 6865 .standard.apache 0x0a90: 206d 6f64 756c 6573 2061 7265 2061 7661 .modules.are.ava 0x0aa0: 696c 6162 6c65 2077 6974 6820 7468 6973 ilable.with.this 0x0ab0: 2072 656c 6561 7365 2061 6e64 2061 7265 .release.and.are 0x0ac0: 0a6e 6f77 206d 616e 6167 6564 2077 6974 .now.managed.wit 0x0ad0: 6820 6465 6263 6f6e 662e 2020 5479 7065 h.debconf...Type 0x0ae0: 203c 5454 3e64 706b 672d 7265 636f 6e66 .dpkg-reconf 0x0af0: 6967 7572 6520 6170 6163 6865 3c2f 5454 igure.apache.to.select.whic 0x0b10: 6820 6d6f 6475 6c65 7320 796f 7520 7761 h.modules.you.wa 0x0b20: 6e74 2065 6e61 626c 6564 2e20 204d 616e nt.enabled...Man 0x0b30: 7920 6f74 6865 7220 6d6f 6475 6c65 7320 y.other.modules. 0x0b40: 6172 6520 6176 6169 6c61 626c 650a 7468 are.available.th 0x0b50: 726f 7567 6820 7468 6520 4465 6269 616e rough.the.Debian 0x0b60: 2070 6163 6b61 6765 2073 7973 7465 6d20 .package.system. 0x0b70: 7769 7468 2074 6865 206e 616d 6573 203c with.the.names.< 0x0b80: 5454 3e6c 6962 6170 6163 6865 2d6d 6f64 TT>libapache-mod 0x0b90: 2d2a 3c2f 5454 3e2e 0a49 6620 796f 7520 -*
..If.you. 0x0ba0: 6e65 6564 2074 6f20 636f 6d70 696c 6520 need.to.compile. 0x0bb0: 6120 6d6f 6475 6c65 2079 6f75 7273 656c a.module.yoursel 0x0bc0: 662c 2079 6f75 2077 696c 6c20 6e65 6564 f,.you.will.need 0x0bd0: 2074 6f20 696e 7374 616c 6c20 7468 650a .to.install.the. 0x0be0: 3c54 543e 6170 6163 6865 2d64 6576 3c2f apache-dev.package...

More.documentat 0x0c10: 696f 6e20 6f6e 2041 7061 6368 6520 6361 ion.on.Apache.ca 0x0c20: 6e20 6265 2066 6f75 6e64 206f 6e3a 0a3c n.be.found.on:.< 0x0c30: 554c 3e0a 3c4c 493e 0a54 6865 203c 4120 UL>.

  • .The.A 0x0c60: 7061 6368 6520 646f 6375 6d65 6e74 6174 pache.documentat 0x0c70: 696f 6e3c 2f41 3e20 7374 6f72 6564 206f ion.stored.o 0x0c80: 6e20 796f 7572 2073 6572 7665 722e 3c2f n.your.server...
  • .The.A 0x0cc0: 7061 6368 6520 5072 6f6a 6563 743c 2f41 pache.Project.home.site.
  • ..
  • .The.Apache-SSL. 0x0d20: 686f 6d65 2073 6974 652e 3c2f 4c49 3e0a home.site.
  • . 0x0d30: 0a3c 4c49 3e0a 5468 6520 3c41 2048 5245 .
  • .The.mod. 0x0d60: 7065 726c 3c2f 413e 2068 6f6d 6520 7369 perl.home.si 0x0d70: 7465 2e3c 2f4c 493e 0a0a 3c4c 493e 0a54 te.
  • ..
  • .T 0x0d80: 6865 203c 4120 4852 4546 3d22 6874 7470 he.ApacheWe 0x0db0: 656b 3c2f 413e 206e 6577 736c 6574 7465 ek.newslette 0x0dc0: 722e 3c2f 4c49 3e0a 0a3c 4c49 3e0a 5468 r.
  • ..
  • .Th 0x0dd0: 6520 3c41 2048 5245 463d 2268 7474 703a e.Debian.Pr 0x0e00: 6f6a 6563 740a 446f 6375 6d65 6e74 6174 oject.Documentat 0x0e10: 696f 6e3c 2f41 3e20 7768 6963 6820 636f ion.which.co 0x0e20: 6e74 6169 6e73 2048 4f57 544f 732c 2046 ntains.HOWTOs,.F 0x0e30: 4151 732c 2061 6e64 2073 6f66 7477 6172 AQs,.and.softwar 0x0e40: 6520 7570 6461 7465 732e 3c2f 4c49 3e0a e.updates.
  • . 0x0e50: 3c2f 554c 3e0a 0a3c 503e 596f 7520 6361 ..

    You.ca 0x0e60: 6e20 616c 736f 2063 6f6e 7375 6c74 2074 n.also.consult.t 0x0e70: 6865 206c 6973 7420 6f66 203c 4120 4852 he.list.of.World.Wide.Web. 0x0eb0: 4672 6571 7565 6e74 6c79 2041 736b 6564 Frequently.Asked 0x0ec0: 2051 7565 7374 696f 6e73 3c2f 413e 2066 .Questions.f 0x0ed0: 6f72 2069 6e66 6f72 6d61 7469 6f6e 2e0a or.information.. 0x0ee0: 0a3c 4832 3e4c 6574 206f 7468 6572 2070 .

    Let.other.p 0x0ef0: 656f 706c 6520 6b6e 6f77 2061 626f 7574 eople.know.about 0x0f00: 2074 6869 7320 7365 7276 6572 3c2f 4832 .this.server

    ..Netcraft.p 0x0f40: 726f 7669 6465 7320 616e 2069 6e74 6572 rovides.an.inter 0x0f50: 6573 7469 6e67 2066 7265 650a 7365 7276 esting.free.serv 0x0f60: 6963 6520 666f 7220 7765 6220 7369 7465 ice.for.web.site 0x0f70: 206d 6f6e 6974 6f72 696e 6720 616e 6420 .monitoring.and. 0x0f80: 7374 6174 6973 7469 6320 636f 6c6c 6563 statistic.collec 0x0f90: 7469 6f6e 2e0a 596f 7520 6361 6e20 6c65 tion..You.can.le 0x0fa0: 7420 7468 656d 206b 6e6f 7720 6162 6f75 t.them.know.abou 0x0fb0: 7420 796f 7572 2073 6572 7665 7220 7573 t.your.server.us 0x0fc0: 696e 6720 7468 6569 720a 3c41 2048 5245 ing.their. 0x0ff0: 696e 7465 7266 6163 653c 2f41 3e2e 0a45 interface..E 0x1000: 6e61 626c 696e 6720 7468 6520 6d6f 6e69 nabling.the.moni 0x1010: 746f 7269 6e67 206f 6620 796f 7572 2073 toring.of.your.s 0x1020: 6572 7665 7220 7769 6c6c 2070 726f 7669 erver.will.provi 0x1030: 6465 2061 2062 6574 7465 7220 676c 6f62 de.a.better.glob 0x1040: 616c 206f 7665 7276 6965 770a 6f66 2077 al.overview.of.w 0x1050: 686f 2069 7320 7573 696e 6720 7768 6174 ho.is.using.what 0x1060: 2061 6e64 2077 6865 7265 2c20 616e 6420 .and.where,.and. 0x1070: 6974 2077 6f75 6c64 2067 6976 6520 4465 it.would.give.De 0x1080: 6269 616e 2061 2062 6574 7465 720a 6f76 bian.a.better.ov 0x1090: 6572 7669 6577 206f 6620 7468 6520 6170 erview.of.the.ap 0x10a0: 6163 6865 2070 6163 6b61 6765 2075 7361 ache.package.usa 0x10b0: 6765 2e0a 0a3c 4832 3e41 626f 7574 2074 ge...

    About.t 0x10c0: 6869 7320 7061 6765 3c2f 4832 3e0a 0a3c his.page

    ..< 0x10d0: 494d 4720 414c 4947 4e3d 2272 6967 6874 IMG.ALIGN="right 0x10e0: 2220 414c 543d 2222 2048 4549 4748 543d ".ALT="".HEIGHT= 0x10f0: 2232 3437 2220 5749 4454 483d 2232 3738 "247".WIDTH="278 0x1100: 2220 5352 433d 2269 636f 6e73 2f6a 6865 ".SRC="icons/jhe 0x1110: 3036 312e 706e 6722 3e0a 0a3c 503e 5468 061.png">..

    Th 0x1120: 6973 2069 7320 6120 706c 6163 6568 6f6c is.is.a.placehol 0x1130: 6465 7220 7061 6765 2069 6e73 7461 6c6c der.page.install 0x1140: 6564 2062 7920 7468 6520 3c41 0a48 5245 ed.by.the.Debia 0x1170: 6e3c 2f41 3e0a 7265 6c65 6173 6520 6f66 n.release.of 0x1180: 2074 6865 2061 7061 6368 6520 5765 6220 .the.apache.Web. 0x1190: 7365 7276 6572 2070 6163 6b61 6765 2e0a server.package.. 0x11a0: 0a3c 503e 5468 6973 2063 6f6d 7075 7465 .

    This.compute 0x11b0: 7220 6861 7320 696e 7374 616c 6c65 6420 r.has.installed. 0x11c0: 7468 6520 4465 6269 616e 2047 4e55 2f4c the.Debian.GNU/L 0x11d0: 696e 7578 206f 7065 7261 7469 6e67 2073 inux.operating.s 0x11e0: 7973 7465 6d2c 0a62 7574 2069 7420 6861 ystem,.but.it.ha 0x11f0: 7320 3c73 7472 6f6e 673e 6e6f 7468 696e s.nothin 0x1200: 6720 746f 2064 6f20 7769 7468 2074 6865 g.to.do.with.the 0x1210: 2044 6562 6961 6e0a 5072 6f6a 6563 743c .Debian.Project< 0x1220: 2f73 7472 6f6e 673e 2e20 506c 6561 7365 /strong>..Please 0x1230: 2064 6f20 3c73 7472 6f6e 673e 6e6f 743c .do.not< 0x1240: 2f73 7472 6f6e 673e 2063 6f6e 7461 6374 /strong>.contact 0x1250: 2074 6865 2044 6562 6961 6e0a 5072 6f6a .the.Debian.Proj 0x1260: 6563 7420 6162 6f75 7420 6974 2e3c 2f50 ect.about.it.

    ..

    If.you.fin 0x1280: 6420 6120 6275 6720 696e 2074 6869 7320 d.a.bug.in.this. 0x1290: 6170 6163 6865 2070 6163 6b61 6765 2c20 apache.package,. 0x12a0: 6f72 2069 6e20 4170 6163 6865 2069 7473 or.in.Apache.its 0x12b0: 656c 662c 0a70 6c65 6173 6520 6669 6c65 elf,.please.file 0x12c0: 2061 2062 7567 2072 6570 6f72 7420 6f6e .a.bug.report.on 0x12d0: 2069 742e 2020 496e 7374 7275 6374 696f .it...Instructio 0x12e0: 6e73 206f 6e20 646f 696e 6720 7468 6973 ns.on.doing.this 0x12f0: 2c20 616e 6420 7468 650a 6c69 7374 206f ,.and.the.list.o 0x1300: 6620 3c41 2048 5245 463d 2268 7474 703a f.kn 0x1330: 6f77 6e20 6275 6773 3c2f 413e 206f 6620 own.bugs.of. 0x1340: 7468 6973 0a70 6163 6b61 6765 2c20 6361 this.package,.ca 0x1350: 6e20 6265 2066 6f75 6e64 2069 6e20 7468 n.be.found.in.th 0x1360: 6520 0a3c 4120 4852 4546 3d22 6874 7470 e..Debian.Bug.Tra 0x13a0: 636b 696e 6720 5379 7374 656d 3c2f 413e cking.System 0x13b0: 2e0a 0a3c 503e 5468 616e 6b73 2066 6f72 ...

    Thanks.for 0x13c0: 2075 7369 6e67 2074 6869 7320 7061 636b .using.this.pack 0x13d0: 6167 652c 2061 6e64 2063 6f6e 6772 6174 age,.and.congrat 0x13e0: 756c 6174 696f 6e73 2066 6f72 2079 6f75 ulations.for.you 0x13f0: 7220 6368 6f69 6365 206f 660a 6120 4465 r.choice.of.a.De 0x1400: 6269 616e 2073 7973 7465 6d21 3c2f 503e bian.system!

    0x1410: 0a0a 3c44 4956 2061 6c69 676e 3d22 6365 ........ 0x1520: 3c2f 613e 0a3c 2f44 4956 3e0a 0a3c 212d ..... 0x15f0: 0a3c 2f48 544d 4c3e 0a .. 23:57:35.941260 IP 127.0.0.1.55920 > 127.0.0.1.80: . ack 5560 win 12383 0x0000: 0000 0000 0000 0000 0000 0000 0800 4500 ..............E. 0x0010: 0034 1b6e 4000 4006 2154 7f00 0001 7f00 .4.n@.@.!T...... 0x0020: 0001 da70 0050 3758 8a49 377a a3a9 8010 ...p.P7X.I7z.... 0x0030: 305f 10ea 0000 0101 080a 4ddc 9219 4ddc 0_........M...M. 0x0040: 9219 .. 23:57:37.229575 IP 127.0.0.1.55920 > 127.0.0.1.80: F 203:203(0) ack 5560 win 12383 0x0000: 0000 0000 0000 0000 0000 0000 0800 4500 ..............E. 0x0010: 0034 1b70 4000 4006 2152 7f00 0001 7f00 .4.p@.@.!R...... 0x0020: 0001 da70 0050 3758 8a49 377a a3a9 8011 ...p.P7X.I7z.... 0x0030: 305f 0be1 0000 0101 080a 4ddc 9721 4ddc 0_........M..!M. 0x0040: 9219 .. 23:57:37.230839 IP 127.0.0.1.80 > 127.0.0.1.55920: F 5560:5560(0) ack 204 win 8192 0x0000: 0000 0000 0000 0000 0000 0000 0800 4500 ..............E. 0x0010: 0034 1fe8 4000 4006 1cda 7f00 0001 7f00 .4..@.@......... 0x0020: 0001 0050 da70 377a a3a9 3758 8a4a 8011 ...P.p7z..7X.J.. 0x0030: 2000 1735 0000 0101 080a 4ddc 9723 4ddc ...5......M..#M. 0x0040: 9721 .! 23:57:37.230900 IP 127.0.0.1.55920 > 127.0.0.1.80: . ack 5561 win 12383 0x0000: 0000 0000 0000 0000 0000 0000 0800 4500 ..............E. 0x0010: 0034 1b72 4000 4006 2150 7f00 0001 7f00 .4.r@.@.!P...... 0x0020: 0001 da70 0050 3758 8a4a 377a a3aa 8010 ...p.P7X.J7z.... 0x0030: 305f 06d4 0000 0101 080a 4ddc 9723 4ddc 0_........M..#M. 0x0040: 9723 .# tcpdump-3.9.8/./tests/.#esp2.out.1.30000644000026300017500000000347010320056003014644 0ustar mcrmcrIP 192.1.2.23 > 192.1.2.45: ESP(spi=0x12345678,seq=0x1), length 172: IP 192.1.2.23 > 192.0.1.1: ESP(spi=0xabcdabcd,seq=0x1), length 116: IP 192.0.2.1 > 192.0.1.1: ICMP echo request seq 1280, length 64 (ipip-proto-4) (ipip-proto-4) IP 192.1.2.23 > 192.1.2.45: ESP(spi=0x12345678,seq=0x2), length 172: IP 192.1.2.23 > 192.0.1.1: ESP(spi=0xabcdabcd,seq=0x2), length 116: IP 192.0.2.1 > 192.0.1.1: ICMP echo request seq 1536, length 64 (ipip-proto-4) (ipip-proto-4) IP 192.1.2.23 > 192.1.2.45: ESP(spi=0x12345678,seq=0x3), length 172: IP 192.1.2.23 > 192.0.1.1: ESP(spi=0xabcdabcd,seq=0x3), length 116: IP 192.0.2.1 > 192.0.1.1: ICMP echo request seq 1792, length 64 (ipip-proto-4) (ipip-proto-4) IP 192.1.2.23 > 192.1.2.45: ESP(spi=0x12345678,seq=0x4), length 172: IP 192.1.2.23 > 192.0.1.1: ESP(spi=0xabcdabcd,seq=0x4), length 116: IP 192.0.2.1 > 192.0.1.1: ICMP echo request seq 2048, length 64 (ipip-proto-4) (ipip-proto-4) IP 192.1.2.23 > 192.1.2.45: ESP(spi=0x12345678,seq=0x5), length 172: IP 192.1.2.23 > 192.0.1.1: ESP(spi=0xabcdabcd,seq=0x5), length 116: IP 192.0.2.1 > 192.0.1.1: ICMP echo request seq 2304, length 64 (ipip-proto-4) (ipip-proto-4) IP 192.1.2.23 > 192.1.2.45: ESP(spi=0x12345678,seq=0x6), length 172: IP 192.1.2.23 > 192.0.1.1: ESP(spi=0xabcdabcd,seq=0x6), length 116: IP 192.0.2.1 > 192.0.1.1: ICMP echo request seq 2560, length 64 (ipip-proto-4) (ipip-proto-4) IP 192.1.2.23 > 192.1.2.45: ESP(spi=0x12345678,seq=0x7), length 172: IP 192.1.2.23 > 192.0.1.1: ESP(spi=0xabcdabcd,seq=0x7), length 116: IP 192.0.2.1 > 192.0.1.1: ICMP echo request seq 2816, length 64 (ipip-proto-4) (ipip-proto-4) IP 192.1.2.23 > 192.1.2.45: ESP(spi=0x12345678,seq=0x8), length 172: IP 192.1.2.23 > 192.0.1.1: ESP(spi=0xabcdabcd,seq=0x8), length 116: IP 192.0.2.1 > 192.0.1.1: ICMP echo request seq 3072, length 64 (ipip-proto-4) (ipip-proto-4) tcpdump-3.9.8/./tests/isakmp-delete-segfault.puu0000644000026300017500000000202207776431317017732 0ustar mcrmcrbegin 644 isakmp-delete-segfault.pcap MU,.RH0(`!``````````````$```!````@"X```````"I`@``J0(``/______ M_P$!`0$!`0@`10``I@`O0`!`$3PA?P```7\```$!]`'T`<@``!N3$,+\/7K^ M3SF!FR'H6?T,OKXN&YH=5T,AEYH%R@(@71+C65#___\````````````````` M```````````````````````````````````````````````````````````` M```````````````````````````````````````````````````````````` M```````````````````````````````````````````````````````````` M```````````````````````````````````````````````````````````` M```````````````````````````````````````````````````````````` M```````````````````````````````````````````````````````````` M```````````````````````````````````````````````````````````` M```````````````````````````````````````````````````````````` M```````````````````````````````````````````````````````````` M```````````````````````````````````````````````````````````` M```````````````````````````````````````````````````````````` M```````````````````````````````````````````````````````````` M```````````````````````````````````````````````````````````` !```` ` end tcpdump-3.9.8/./tests/.#esp5.out.1.20000644000026300017500000000224010320056003014640 0ustar mcrmcrIP 192.1.2.23 > 192.1.2.45: ESP(spi=0xd1234567,seq=0x1), length 132: IP 192.0.2.1 > 192.0.1.1: ICMP echo request seq 1280, length 64 (ipip-proto-4) IP 192.1.2.23 > 192.1.2.45: ESP(spi=0xd1234567,seq=0x2), length 132: IP 192.0.2.1 > 192.0.1.1: ICMP echo request seq 1536, length 64 (ipip-proto-4) IP 192.1.2.23 > 192.1.2.45: ESP(spi=0xd1234567,seq=0x3), length 132: IP 192.0.2.1 > 192.0.1.1: ICMP echo request seq 1792, length 64 (ipip-proto-4) IP 192.1.2.23 > 192.1.2.45: ESP(spi=0xd1234567,seq=0x4), length 132: IP 192.0.2.1 > 192.0.1.1: ICMP echo request seq 2048, length 64 (ipip-proto-4) IP 192.1.2.23 > 192.1.2.45: ESP(spi=0xd1234567,seq=0x5), length 132: IP 192.0.2.1 > 192.0.1.1: ICMP echo request seq 2304, length 64 (ipip-proto-4) IP 192.1.2.23 > 192.1.2.45: ESP(spi=0xd1234567,seq=0x6), length 132: IP 192.0.2.1 > 192.0.1.1: ICMP echo request seq 2560, length 64 (ipip-proto-4) IP 192.1.2.23 > 192.1.2.45: ESP(spi=0xd1234567,seq=0x7), length 132: IP 192.0.2.1 > 192.0.1.1: ICMP echo request seq 2816, length 64 (ipip-proto-4) IP 192.1.2.23 > 192.1.2.45: ESP(spi=0xd1234567,seq=0x8), length 132: IP 192.0.2.1 > 192.0.1.1: ICMP echo request seq 3072, length 64 (ipip-proto-4) tcpdump-3.9.8/./tests/.#ospf-gmpls.out.1.30000644000026300017500000001017210320056003016057 0ustar mcrmcrIP (tos 0xc0, ttl 1, id 4052, offset 0, flags [none], proto: OSPF (89), length: 172) 40.35.1.2 > 224.0.0.5: OSPFv2, LS-Update, length: 152 Router-ID: 10.255.245.35, Backbone Area, Authentication Type: none (0), 1 LSA LSA #1 Advertising Router: 10.255.245.37, seq 0x80000002, age 9s, length: 104 Area Local Opaque LSA (10), Opaque-Type: Traffic Engineering LSA (1), Opaque-ID: 8 Options: [External] Link TLV (2), length: 100 Link Type subTLV (1), length: 1, Point-to-point (1) Link ID subTLV (2), length: 4, 10.255.245.69 (0x0afff545) Local Interface IP address subTLV (3), length: 4, 10.9.142.1 Remote Interface IP address subTLV (4), length: 4, 10.9.142.2 Traffic Engineering Metric subTLV (5), length: 4, Metric 63 Maximum Bandwidth subTLV (6), length: 4, 622.080 Mbps Maximum Reservable Bandwidth subTLV (7), length: 4, 622.080 Mbps Unreserved Bandwidth subTLV (8), length: 32 priority level 0: 622.080 Mbps priority level 1: 622.080 Mbps priority level 2: 622.080 Mbps priority level 3: 622.080 Mbps priority level 4: 622.080 Mbps priority level 5: 622.080 Mbps priority level 6: 622.080 Mbps priority level 7: 622.080 Mbps Administrative Group subTLV (9), length: 4, 0x00000000 IP (tos 0xc0, ttl 1, id 4106, offset 0, flags [none], proto: OSPF (89), length: 172) 40.35.1.2 > 224.0.0.5: OSPFv2, LS-Update, length: 152 Router-ID: 10.255.245.35, Backbone Area, Authentication Type: none (0), 1 LSA LSA #1 Advertising Router: 10.255.245.37, seq 0x80000002, age 9s, length: 104 Area Local Opaque LSA (10), Opaque-Type: Traffic Engineering LSA (1), Opaque-ID: 9 Options: [External] Link TLV (2), length: 100 Link Type subTLV (1), length: 1, Point-to-point (1) Link ID subTLV (2), length: 4, 10.255.245.69 (0x0afff545) Local Interface IP address subTLV (3), length: 4, 10.9.143.1 Remote Interface IP address subTLV (4), length: 4, 10.9.143.2 Traffic Engineering Metric subTLV (5), length: 4, Metric 63 Maximum Bandwidth subTLV (6), length: 4, 622.080 Mbps Maximum Reservable Bandwidth subTLV (7), length: 4, 622.080 Mbps Unreserved Bandwidth subTLV (8), length: 32 priority level 0: 622.080 Mbps priority level 1: 622.080 Mbps priority level 2: 622.080 Mbps priority level 3: 622.080 Mbps priority level 4: 622.080 Mbps priority level 5: 622.080 Mbps priority level 6: 622.080 Mbps priority level 7: 622.080 Mbps Administrative Group subTLV (9), length: 4, 0x00000000 IP (tos 0xc0, ttl 1, id 4160, offset 0, flags [none], proto: OSPF (89), length: 212) 40.35.1.2 > 224.0.0.5: OSPFv2, LS-Update, length: 192 Router-ID: 10.255.245.35, Backbone Area, Authentication Type: none (0), 1 LSA LSA #1 Advertising Router: 10.255.245.35, seq 0x80000003, age 3s, length: 144 Area Local Opaque LSA (10), Opaque-Type: Traffic Engineering LSA (1), Opaque-ID: 3 Options: [External] Link TLV (2), length: 140 Link Type subTLV (1), length: 1, Point-to-point (1) Link ID subTLV (2), length: 4, 10.255.245.40 (0x0afff528) Local Interface IP address subTLV (3), length: 4, 10.40.35.14 Remote Interface IP address subTLV (4), length: 4, 10.40.35.13 Traffic Engineering Metric subTLV (5), length: 4, Metric 1 Maximum Bandwidth subTLV (6), length: 4, 100.000 Mbps Maximum Reservable Bandwidth subTLV (7), length: 4, 100.000 Mbps Unreserved Bandwidth subTLV (8), length: 32 priority level 0: 0.000 Mbps priority level 1: 0.000 Mbps priority level 2: 0.000 Mbps priority level 3: 0.000 Mbps priority level 4: 0.000 Mbps priority level 5: 0.000 Mbps priority level 6: 0.000 Mbps priority level 7: 0.000 Mbps Interface Switching Capability subTLV (15), length: 44 Interface Switching Capability: Packet-Switch Capable-1 LSP Encoding: Ethernet V2/DIX Max LSP Bandwidth: priority level 0: 0.000 Mbps priority level 1: 0.000 Mbps priority level 2: 0.000 Mbps priority level 3: 0.000 Mbps priority level 4: 0.000 Mbps priority level 5: 0.000 Mbps priority level 6: 0.000 Mbps priority level 7: 0.000 Mbps tcpdump-3.9.8/./tests/espudp1.out0000644000026300017500000000144310320056205014735 0ustar mcrmcrIP 192.1.2.23.4500 > 192.1.2.45.4500: UDP-encap: ESP(spi=0x12345678,seq=0x1), length 116 IP 192.1.2.23.4500 > 192.1.2.45.4500: UDP-encap: ESP(spi=0x12345678,seq=0x2), length 116: ip-proto-227 49 IP 192.1.2.23.4500 > 192.1.2.45.4500: UDP-encap: ESP(spi=0x12345678,seq=0x3), length 116: PIMv13, length: 10 IP 192.1.2.23.4500 > 192.1.2.45.4500: UDP-encap: ESP(spi=0x12345678,seq=0x4), length 116 IP 192.1.2.23.4500 > 192.1.2.45.4500: UDP-encap: ESP(spi=0x12345678,seq=0x5), length 116 IP 192.1.2.23.4500 > 192.1.2.45.4500: UDP-encap: ESP(spi=0x12345678,seq=0x6), length 116: ip-proto-183 28 IP 192.1.2.23.4500 > 192.1.2.45.4500: UDP-encap: ESP(spi=0x12345678,seq=0x7), length 116: ip-proto-72 34 IP 192.1.2.23.4500 > 192.1.2.45.4500: UDP-encap: ESP(spi=0x12345678,seq=0x8), length 116: ip-proto-224 59 tcpdump-3.9.8/./tests/lmp.puu0000644000026300017500000000455710225052041014155 0ustar mcrmcrbegin 644 lmp.pcap MU,.RH0(`!````````````/__```!````I!J-0&;J``!B````8@`````%75SJ MQ@`$=="&2@@`10``5*WR```!$=^D"@`,`0H`#`+#3L-.`$```!````4`.``` M`0,`"`$````!!0`(`````P(#``@!````@0@`&````!0````>")*``$+(```` M```(I!J-0#SQ``!&````1@`````%75SJQ@`$=="&2@@`10``.*WS```!$=^_ M"@`,`0H`#`+#3L-.`"0``!````0`'````0$`"`````$!!P`,````,@```#RD M&HU`@/(``&(```!B``````5=7.K&``1UT(9*"`!%``!4K?0```$1WZ(*``P! M"@`,`L-.PTX`0```$````P`X```!`0`(`````0$"``@*`#(!`@$`"`````(" M!0`(`````P("``@*`#("@08`"``%``^D&HU`?_,``%H```!:``````5=7.K& M``1UT(9*"`!%``!,K?4```$1WZD*``P!"@`,`L-.PTX`.```$````@`P```! M`0`(`````0$"``@*`#(!`@$`"`````("!0`(`````P("``@*`#("I!J-0'+T M``!2````4@`````%75SJQ@`$=="&2@@`10``1*WV```!$=^P"@`,`0H`#`+# M3L-.`#```!````$`*````0$`"`````$!!0`(`````P$"``@*`#(!@08`"``% M``^D&HU`0_4``#H````Z``````5=7.K&``1UT(9*"`!%```LK?<```$1W\<* M``P!"@`,`L-.PTX`&```$```#P`0```"!0`(`````:0:C4"E]P``B@```(H` M````!5U7($>.<3N@\_I:AY"K/TKAZJP719"NCKYP;PT(0+$"M%=]-X"`*8V.' M-'$1A]02"3N#OZI#&1R]A*1;`G8S@YFQ]`````(:<$'CW)%VZ',2KQMB@CN?'"^GJ<=: MD-0`+.V^J'2AK).'XQ_B"B8:[%A_+K[6KS2'XR[UN`,R"BJP?^].ZM#/[$)# M17^!D"8_[BZ>GU4Z*$7I"N$U*>J47?C-4;I>#`%6+#0%]D75YC']*Z\````` M`````)8```"6````$```9&1%$```9&0C"`!%``"(_VD``$`R]I/``0(7P`$" M+1(T5G@````#7?C-4;I>#`%@W%89?QJ#$TJ,4G\FO&HO=F+,,%1E(]);XI]T MV7W.RY$2=JZ1%!QCNX[;^.JD4W91;7)NJWV2MF4?7`=&_3OWW%V&6RIXKB75 M#;2TWNL"A:MF!I@_5R^]L6;Z`L?E@1:T&71G``````````"6````E@```!`` M`&1D11```&1D(P@`10``B/]J``!`,O:2P`$"%\`!`BT2-%9X````!*MF!I@_ M5R^]%';9*Q:S_B]]O_8FV:2K1A!]/SQHI7>OS815*I?4%/:.=BBJUEGJ(X8\ MP1E/@&P\9MR)DP3[UCWI@,MR%A$\CR]=G(("[CFB7AUN$AENZOO&\:7% M2KLW<'NP,L(I=!;8=0``````````E@```)8````0``!D9$40``!D9",(`$4` M`(C_:P``0#+VD<`!`A?``0(M$C16>`````5NZOO&\:7%2J12,9;LOK"-S,=$ MO0]X+J(OJQED#PLBRY[\^352UZK&576,Z<:%73AWV3:;Y/:=@(` M`````````)8```"6````$```9&1%$```9&0C"`!%``"(_VP``$`R]I#``0(7 MP`$"+1(T5G@````&M,^T?7>6,Z=>N_YZQFV[H1^6\!/I*IMAOHZE\E0M.Z!X M#[0EG3#>%]7`]*2F?@S4X2''TK09J@NG/.HEXCE./..K^'-@":X[\?0L+B`S MQA\HTK\'J]:S]N6O`]\)NQD)9;H2P\K`^NX37`R5``````````"6````E@`` M`!```&1D11```&1D(P@`10``B/]M``!`,O:/P`$"%\`!`BT2-%9X````!^6O M`]\)NQD)>BYZ>`/DA=N;A2...3-7FZOK?:5KGXBN`/E?$\[-11-$G#E;(>N" M+<$/YP'SM$>16LU18&Q]9)$]0)/M]:2Z#A6]-,SM*>FI/`X*K-*-:KS3IW<" MO(>(P(K=:X::SJ;O[J>0K```````````E@```)8````0``!D9$40``!D9",( M`$4``(C_;@``0#+VCL`!`A?``0(M$C16>`````C3IW<"O(>(P'-43;C[`MCD M`BMZAX]F!?'Z$8Q"5HYMVDC9"8I^O(Z4!/)`/IVD-(ZK)_52-H2XK+,(-LR) MM)K#XLF">KY0>C?\[MA%3F%$?ORJ@:>O]5H>?-$OQH)J````G@```!```&1D M11```&1D(P@`10``D*8.``!`$5`(P`$"%\`!`BT1E!&4`'P``!(T5G@````! MIQI1WARY*2.,3*N>\E4-MV0"Q0&B9RG\CH]Z?F.J2U2J6?9"%WHI),PCC4.T MPHU1D2,KT6".3TG`1R:V$E7'FE[]PG%1#\!'O=1;9"P[#Q*U;DU12<9BO$:/ M(AI2S*,BK5H_YVKC,]K'@[Y^``````````">````G@```!```&1D11```&1D M(P@`10``D*8/``!`$5`'P`$"%\`!`BT1E!&4`'P``!(T5G@````"*3$H)*^K MG65!9?U^[O>)/*D1"&WNUN@=BGJZV$;E12<$J$SGOAFJ!<5)O%=NY:HY\B$3 M!*Q.N--U/:_F^;L-H0>[$9AU0\QP"`F5JD8GY307\SDD5=Y\G@%('76R5O`G MA/2`=,$VWF]0[L\*``````````">````G@```!```&1D11```&1D(P@`10`` MD*80``!`$5`&P`$"%\`!`BT1E!&4`'P``!(T5G@````#C]!\R;K$H/YX7>T6 MZT6>/2I[+Q4&*]7A`VLB)[%A_/MKQMX-:R"-)DA.[G>)\5]KF#Z5:3L+JCMC MXDHKBE%/Q%D1VV#=?\3JEZ?8)&[3[(4F"4*0W"B)."[.?0U(7!!Z2_69:0DV M98H$8R%=``````````">````G@```!```&1D11```&1D(P@`10``D*81``!` M$5`%P`$"%\`!`BT1E!&4`'P``!(T5G@````$FV8=\*GR(@_[&TF2&3'AZ9)Q M*?@[(M!I:IE"@-?4W5TEZ-5@(F\613%V19L#%[XCJFJY^G4BVW"O\/*X\!A6 M@1<[4J(5+60M8]9R>$=\TU>XX7AB7\T'1W1HAPX[(KPTVN"*NEC)E/7@5D_1 M``````````">````G@```!```&1D11```&1D(P@`10``D*82``!`$5`$P`$" M%\`!`BT1E!&4`'P``!(T5G@````%=@CRA49O0D;A1@T5[WR$Q5?Y(\M[>D@C MRFK+$5I%Y8:85K`)&LZ.Q@G&N)8-RG@2;GNYJ\2OC9ZV?,IT7HJU7K&DM/1_ M:K+-8KXY4?22*8=.1@O<,#R&;^R2P`>PAR9E7*>!>3*D24OK4*C1```````` M``">````G@```!```&1D11```&1D(P@`10``D*83``!`$5`#P`$"%\`!`BT1 ME!&4`'P``!(T5G@````&OTF+$=SM[Y.=U8E>9V&69R:M\.1&LA]$#9Q^:+E7 MQE#E^)1R]--?O]SW!%7]KB<7\MLR56^WX)#?)/IJR<_@C91NG`(S^S``````````">```` MG@```!```&1D11```&1D(P@`10``D*84``!`$5`"P`$"%\`!`BT1E!&4`'P` M`!(T5G@````'!12933DTC1RSTN*./4ZCE%A8GGVL:;@`.%'8MEA.C7/6]D[S MO1C([D/N6]%[?NISR>1W1EE,)=\I9&.PF-'Q*LXZQU71100.[\,-HK41G3/R MG9DY$,].(M58U1\0XT\4R[<=RCCXM;_%AVM)``````````">````G@```!`` M`&1D11```&1D(P@`10``D*85``!`$5`!P`$"%\`!`BT1E!&4`'P``!(T5G@` M```(*_3L6&DE`65QQPA"@BAQ5FY@=%,+]@C9K+O)@],/GCI4%,MKI282(0M9 M*<@/=L.DB"**EM":*2KJK`^H=0YM,$^[`=L%(RO,O_<4`MNKJ*:^9W8@1BP$ 59LK`-:)VQ/=2B;1'4FV3B?L]2;O! ` end tcpdump-3.9.8/./tests/esp-secrets.txt0000644000026300017500000000045210034121700015613 0ustar mcrmcr# a comment 0x12345678@192.1.2.45 3des-cbc-hmac96:0x43434545464649494a4a4c4c4f4f51515252545457575840 0xabcdabcd@192.0.1.1 3des-cbc-hmac96:0x434545464649494a4a4c4c4f4f5151525254545757584043 0xd1234567@192.1.2.45 aes256-cbc-hmac96:0xaaaabbbbccccdddd4043434545464649494a4a4c4c4f4f515152525454575758 tcpdump-3.9.8/./tests/esp5.gdbinit0000644000026300017500000000011210034121701015025 0ustar mcrmcrset args -t -n -E "file esp-secrets.txt" -r 08-sunrise-sunset-aes.pcap tcpdump-3.9.8/./tests/ospf-gmpls.out0000644000026300017500000000775210320056205015454 0ustar mcrmcrIP (tos 0xc0, ttl 1, id 4052, offset 0, flags [none], proto: OSPF (89), length: 172) 40.35.1.2 > 224.0.0.5: OSPFv2, LS-Update, length: 152 Router-ID: 10.255.245.35, Backbone Area, Authentication Type: none (0), 1 LSA LSA #1 Advertising Router: 10.255.245.37, seq 0x80000002, age 9s, length: 104 Area Local Opaque LSA (10), Opaque-Type: Traffic Engineering LSA (1), Opaque-ID: 8 Options: [External] Link TLV (2), length: 100 Link Type subTLV (1), length: 1, Point-to-point (1) Link ID subTLV (2), length: 4, 10.255.245.69 (0x0afff545) Local Interface IP address subTLV (3), length: 4, 10.9.142.1 Remote Interface IP address subTLV (4), length: 4, 10.9.142.2 Traffic Engineering Metric subTLV (5), length: 4, Metric 63 Maximum Bandwidth subTLV (6), length: 4, 622.080 Mbps Maximum Reservable Bandwidth subTLV (7), length: 4, 622.080 Mbps Unreserved Bandwidth subTLV (8), length: 32 TE-Class 0: 622.080 Mbps TE-Class 1: 622.080 Mbps TE-Class 2: 622.080 Mbps TE-Class 3: 622.080 Mbps TE-Class 4: 622.080 Mbps TE-Class 5: 622.080 Mbps TE-Class 6: 622.080 Mbps TE-Class 7: 622.080 Mbps Administrative Group subTLV (9), length: 4, 0x00000000 IP (tos 0xc0, ttl 1, id 4106, offset 0, flags [none], proto: OSPF (89), length: 172) 40.35.1.2 > 224.0.0.5: OSPFv2, LS-Update, length: 152 Router-ID: 10.255.245.35, Backbone Area, Authentication Type: none (0), 1 LSA LSA #1 Advertising Router: 10.255.245.37, seq 0x80000002, age 9s, length: 104 Area Local Opaque LSA (10), Opaque-Type: Traffic Engineering LSA (1), Opaque-ID: 9 Options: [External] Link TLV (2), length: 100 Link Type subTLV (1), length: 1, Point-to-point (1) Link ID subTLV (2), length: 4, 10.255.245.69 (0x0afff545) Local Interface IP address subTLV (3), length: 4, 10.9.143.1 Remote Interface IP address subTLV (4), length: 4, 10.9.143.2 Traffic Engineering Metric subTLV (5), length: 4, Metric 63 Maximum Bandwidth subTLV (6), length: 4, 622.080 Mbps Maximum Reservable Bandwidth subTLV (7), length: 4, 622.080 Mbps Unreserved Bandwidth subTLV (8), length: 32 TE-Class 0: 622.080 Mbps TE-Class 1: 622.080 Mbps TE-Class 2: 622.080 Mbps TE-Class 3: 622.080 Mbps TE-Class 4: 622.080 Mbps TE-Class 5: 622.080 Mbps TE-Class 6: 622.080 Mbps TE-Class 7: 622.080 Mbps Administrative Group subTLV (9), length: 4, 0x00000000 IP (tos 0xc0, ttl 1, id 4160, offset 0, flags [none], proto: OSPF (89), length: 212) 40.35.1.2 > 224.0.0.5: OSPFv2, LS-Update, length: 192 Router-ID: 10.255.245.35, Backbone Area, Authentication Type: none (0), 1 LSA LSA #1 Advertising Router: 10.255.245.35, seq 0x80000003, age 3s, length: 144 Area Local Opaque LSA (10), Opaque-Type: Traffic Engineering LSA (1), Opaque-ID: 3 Options: [External] Link TLV (2), length: 140 Link Type subTLV (1), length: 1, Point-to-point (1) Link ID subTLV (2), length: 4, 10.255.245.40 (0x0afff528) Local Interface IP address subTLV (3), length: 4, 10.40.35.14 Remote Interface IP address subTLV (4), length: 4, 10.40.35.13 Traffic Engineering Metric subTLV (5), length: 4, Metric 1 Maximum Bandwidth subTLV (6), length: 4, 100.000 Mbps Maximum Reservable Bandwidth subTLV (7), length: 4, 100.000 Mbps Unreserved Bandwidth subTLV (8), length: 32 TE-Class 0: 0.000 Mbps TE-Class 1: 0.000 Mbps TE-Class 2: 0.000 Mbps TE-Class 3: 0.000 Mbps TE-Class 4: 0.000 Mbps TE-Class 5: 0.000 Mbps TE-Class 6: 0.000 Mbps TE-Class 7: 0.000 Mbps Interface Switching Capability subTLV (15), length: 44 Interface Switching Capability: Packet-Switch Capable-1 LSP Encoding: Ethernet V2/DIX Max LSP Bandwidth: priority level 0: 0.000 Mbps priority level 1: 0.000 Mbps priority level 2: 0.000 Mbps priority level 3: 0.000 Mbps priority level 4: 0.000 Mbps priority level 5: 0.000 Mbps priority level 6: 0.000 Mbps priority level 7: 0.000 Mbps tcpdump-3.9.8/./tests/ldp-infinite-loop.pcap0000644000026300017500000000063610233757631017042 0ustar mcrmcrÔò¡`qOÕoB‚¬>>Î*E.@@†Y-tÅHÀ¨°û†—ÑÿÿÿÿÿÿÿÿÿÿÿÿÿÿOÕoB–>>Î*E.@€À´Z[À¨…C†=åÿÿÿÿÿÿÿÿÿÿÿÿÿÿOÕoB[€>>Î*E.@@(’˾-À¨4À†µÐÿÿÿÿÿÿÿÿÿÿÿÿÿÿOÕoBj >>Î*E.@@èÏCÇLÀ¨G—†c¬ÿÿÿÿÿÿÿÿÿÿÿÿÿÿOÕoBÞT >>Î*E.@@wï ÕóQÀ¨ß †[Vÿÿÿÿÿÿÿÿÿÿÿÿÿÿtcpdump-3.9.8/./tests/print-AA.new0000644000026300017500000001702210320056212014747 0ustar mcrmcr23:57:35.938066 IP 127.0.0.1.55920 > 127.0.0.1.80: S 928549246:928549246(0) win 32767 ..............E..<.h@.@.!R.........p.P7X.~.........!....@.... M........... 23:57:35.938122 IP 127.0.0.1.80 > 127.0.0.1.55920: S 930778609:930778609(0) ack 928549247 win 32767 ..............E..<..@.@.<..........P.p7z..7X......n.....@.... M...M....... 23:57:35.938167 IP 127.0.0.1.55920 > 127.0.0.1.80: . ack 1 win 8192 ..............E..4.j@.@.!X.........p.P7X..7z.... .7...... M...M... 23:57:35.939423 IP 127.0.0.1.55920 > 127.0.0.1.80: P 1:203(202) ack 1 win 8192 ..............E....l@.@. ..........p.P7X..7z.... ........ M...M...GET / HTTP/1.1 Host: localhost User-Agent: ELinks/0.10.4-7-debian (textmode; Linux 2.6.11-1-686-smp i686; 132x56-2) Accept: */* Accept-Encoding: gzip Accept-Language: en Connection: Keep-Alive 23:57:35.940474 IP 127.0.0.1.80 > 127.0.0.1.55920: . ack 203 win 8192 ..............E..4..@.@............P.p7z..7X.I.. .7...... M...M... 23:57:35.941232 IP 127.0.0.1.80 > 127.0.0.1.55920: P 1:5560(5559) ack 203 win 8192 ..............E.....@.@..%.........P.p7z..7X.I.. ........ M...M...HTTP/1.1 200 OK Date: Wed, 06 Jul 2005 03:57:35 GMT Server: Apache/1.3.33 Last-Modified: Sun, 15 Aug 2004 00:43:41 GMT ETag: "6e80f0-148a-411eb1bd" Accept-Ranges: bytes Content-Length: 5258 Keep-Alive: timeout=15, max=100 Connection: Keep-Alive Content-Type: text/html; charset=iso-8859-1 Placeholder page

    Placeholder page

    If you are just browsing the web

    The owner of this web site has not put up any web pages yet. Please come back later.

    Move along, nothing to see here... :-)

    If you are trying to locate the administrator of this machine

    If you want to report something about this host's behavior, please contact the Internet Service Provider (ISP) involved directly.

    See the Network Abuse Clearinghouse for how to do this.

    If you are the administrator of this machine

    The initial installation of Debian's apache web server package was successful.

    You should replace this page with your own web pages as soon as possible.

    Unless you changed its configuration, your new server is configured as follows:

    • Configuration files can be found in /etc/apache.
    • The DocumentRoot, which is the directory under which all your HTML files should exist, is set to /var/www.
    • CGI scripts are looked for in /usr/lib/cgi-bin, which is where Debian packages will place their scripts.
    • Log files are placed in /var/log/apache, and will be rotated weekly. The frequency of rotation can be easily changed by editing /etc/logrotate.d/apache.
    • The default directory index is index.html, meaning that requests for a directory /foo/bar/ will give the contents of the file /var/www/foo/bar/index.html if it exists (assuming that /var/www is your DocumentRoot).
    • User directories are enabled, and user documents will be looked for in the public_html directory of the users' homes. These dirs should be under /home, and users will not be able to symlink to files they don't own.
    All the standard apache modules are available with this release and are now managed with debconf. Type dpkg-reconfigure apache to select which modules you want enabled. Many other modules are available through the Debian package system with the names libapache-mod-*. If you need to compile a module yourself, you will need to install the apache-dev package.

    More documentation on Apache can be found on:

    You can also consult the list of World Wide Web Frequently Asked Questions for information.

    Let other people know about this server

    Netcraft provides an interesting free service for web site monitoring and statistic collection. You can let them know about your server using their interface. Enabling the monitoring of your server will provide a better global overview of who is using what and where, and it would give Debian a better overview of the apache package usage.

    About this page

    This is a placeholder page installed by the Debian release of the apache Web server package.

    This computer has installed the Debian GNU/Linux operating system, but it has nothing to do with the Debian Project. Please do not contact the Debian Project about it.

    If you find a bug in this apache package, or in Apache itself, please file a bug report on it. Instructions on doing this, and the list of known bugs of this package, can be found in the Debian Bug Tracking System.

    Thanks for using this package, and congratulations for your choice of a Debian system!

    23:57:35.941260 IP 127.0.0.1.55920 > 127.0.0.1.80: . ack 5560 win 12383 ..............E..4.n@.@.!T.........p.P7X.I7z....0_....... M...M... 23:57:37.229575 IP 127.0.0.1.55920 > 127.0.0.1.80: F 203:203(0) ack 5560 win 12383 ..............E..4.p@.@.!R.........p.P7X.I7z....0_....... M..!M... 23:57:37.230839 IP 127.0.0.1.80 > 127.0.0.1.55920: F 5560:5560(0) ack 204 win 8192 ..............E..4..@.@............P.p7z..7X.J.. ..5..... M..#M..! 23:57:37.230900 IP 127.0.0.1.55920 > 127.0.0.1.80: . ack 5561 win 12383 ..............E..4.r@.@.!P.........p.P7X.J7z....0_....... M..#M..# tcpdump-3.9.8/./tests/esp4.sh0000644000026300017500000000033510225052107014032 0ustar mcrmcr#!/bin/sh uudecode 08-sunrise-sunset-esp2.puu echo -n test esp4... ../tcpdump -t -n -E "file esp-secrets.txt" -r 08-sunrise-sunset-esp2.pcap >esp4.new if diff esp4.new esp2.out then echo passed. else echo failed. fi tcpdump-3.9.8/./tests/eapon1.out0000644000026300017500000001767010320056204014547 0ustar mcrmcrIP 192.168.1.249.netbios-dgm > 192.168.1.255.netbios-dgm: NBT UDP PACKET(138) IP 192.168.1.249.netbios-dgm > 192.168.1.255.netbios-dgm: NBT UDP PACKET(138) IP 192.168.1.249.netbios-dgm > 192.168.1.255.netbios-dgm: NBT UDP PACKET(138) IP 192.168.1.249.netbios-ns > 192.168.1.255.netbios-ns: NBT UDP PACKET(137): QUERY; REQUEST; BROADCAST IP 192.168.1.249.netbios-ns > 192.168.1.255.netbios-ns: NBT UDP PACKET(137): QUERY; REQUEST; BROADCAST IP 192.168.1.249.netbios-ns > 192.168.1.255.netbios-ns: NBT UDP PACKET(137): QUERY; REQUEST; BROADCAST IP 192.168.1.249.netbios-dgm > 192.168.1.255.netbios-dgm: NBT UDP PACKET(138) IP 192.168.1.249.netbios-ns > 192.168.1.255.netbios-ns: NBT UDP PACKET(137): QUERY; REQUEST; BROADCAST IP 192.168.1.249.netbios-ns > 192.168.1.255.netbios-ns: NBT UDP PACKET(137): QUERY; REQUEST; BROADCAST IP 192.168.1.249.netbios-ns > 192.168.1.255.netbios-ns: NBT UDP PACKET(137): QUERY; REQUEST; BROADCAST arp who-has 192.168.1.1 tell 192.168.1.249 arp reply 192.168.1.1 is-at 00:0d:88:4f:25:91 (oui Unknown) IP 192.168.1.249.bootpc > 192.168.1.1.bootps: BOOTP/DHCP, Request from 00:04:23:57:a5:7a (oui Unknown), length: 300 EAP code=1 id=0 length=5 IP 0.0.0.0.bootpc > 255.255.255.255.bootps: BOOTP/DHCP, Request from 00:04:23:57:a5:7a (oui Unknown), length: 300 IP 0.0.0.0.bootpc > 255.255.255.255.bootps: BOOTP/DHCP, Request from 00:04:23:57:a5:7a (oui Unknown), length: 300 EAP code=1 id=1 length=0 EAP code=1 id=0 length=5 EAP code=1 id=0 length=45 EAP code=1 id=0 length=20 EAP code=1 id=0 length=76 EAP code=1 id=0 length=80 EAP code=1 id=0 length=28 EAP code=1 id=0 length=4 EAP code=1 id=3 length=57 EAP code=1 id=3 length=44 IP 0.0.0.0.bootpc > 255.255.255.255.bootps: BOOTP/DHCP, Request from 00:04:23:57:a5:7a (oui Unknown), length: 300 IP 0.0.0.0.bootpc > 255.255.255.255.bootps: BOOTP/DHCP, Request from 00:04:23:57:a5:7a (oui Unknown), length: 300 IP 0.0.0.0.bootpc > 255.255.255.255.bootps: BOOTP/DHCP, Request from 00:04:23:57:a5:7a (oui Unknown), length: 300 EAP code=1 id=1 length=0 EAP code=1 id=0 length=5 EAP code=1 id=0 length=45 EAP code=1 id=0 length=20 EAP code=1 id=0 length=76 EAP code=1 id=0 length=80 EAP code=1 id=0 length=28 EAP code=1 id=0 length=4 EAP code=1 id=3 length=57 EAP code=1 id=3 length=44 arp who-has 169.254.67.194 tell 169.254.67.194 arp who-has 169.254.67.194 tell 169.254.67.194 arp who-has 169.254.67.194 tell 169.254.67.194 IP 169.254.67.194.4299 > 239.255.255.250.1900: UDP, length 133 IP 169.254.67.194 > IGMP: igmp v3 report, 1 group record(s) IP 169.254.67.194.netbios-ns > 169.254.255.255.netbios-ns: NBT UDP PACKET(137): REGISTRATION; REQUEST; BROADCAST IP 169.254.67.194 > IGMP: igmp v3 report, 1 group record(s) IP 169.254.67.194.netbios-ns > 169.254.255.255.netbios-ns: NBT UDP PACKET(137): REGISTRATION; REQUEST; BROADCAST IP 169.254.67.194.netbios-ns > 169.254.255.255.netbios-ns: NBT UDP PACKET(137): REGISTRATION; REQUEST; BROADCAST IP 0.0.0.0.bootpc > 255.255.255.255.bootps: BOOTP/DHCP, Request from 00:04:23:57:a5:7a (oui Unknown), length: 300 IP 169.254.67.194.netbios-ns > 169.254.255.255.netbios-ns: NBT UDP PACKET(137): REGISTRATION; REQUEST; BROADCAST IP 169.254.67.194.4299 > 239.255.255.250.1900: UDP, length 133 IP 169.254.67.194.netbios-ns > 169.254.255.255.netbios-ns: NBT UDP PACKET(137): REGISTRATION; REQUEST; BROADCAST EAP code=1 id=1 length=0 EAP code=1 id=0 length=5 EAP code=1 id=0 length=45 EAP code=1 id=0 length=20 IP 169.254.67.194.netbios-ns > 169.254.255.255.netbios-ns: NBT UDP PACKET(137): REGISTRATION; REQUEST; BROADCAST IP 169.254.67.194.netbios-ns > 169.254.255.255.netbios-ns: NBT UDP PACKET(137): REGISTRATION; REQUEST; BROADCAST EAP code=1 id=0 length=76 EAP code=1 id=0 length=80 IP 169.254.67.194.netbios-ns > 169.254.255.255.netbios-ns: NBT UDP PACKET(137): REGISTRATION; REQUEST; BROADCAST EAP code=1 id=0 length=28 EAP code=1 id=0 length=4 EAP code=1 id=3 length=57 EAP code=1 id=3 length=44 IP 0.0.0.0.bootpc > 255.255.255.255.bootps: BOOTP/DHCP, Request from 00:04:23:57:a5:7a (oui Unknown), length: 300 IP 169.254.67.194.4299 > 239.255.255.250.1900: UDP, length 133 IP 169.254.67.194.netbios-ns > 169.254.255.255.netbios-ns: NBT UDP PACKET(137): REGISTRATION; REQUEST; BROADCAST IP 169.254.67.194.netbios-ns > 169.254.255.255.netbios-ns: NBT UDP PACKET(137): REGISTRATION; REQUEST; BROADCAST IP 169.254.67.194.netbios-ns > 169.254.255.255.netbios-ns: NBT UDP PACKET(137): REGISTRATION; REQUEST; BROADCAST IP 169.254.67.194.netbios-ns > 169.254.255.255.netbios-ns: NBT UDP PACKET(137): REGISTRATION; REQUEST; BROADCAST IP 169.254.67.194.netbios-ns > 169.254.255.255.netbios-ns: NBT UDP PACKET(137): REGISTRATION; REQUEST; BROADCAST IP 169.254.67.194.netbios-ns > 169.254.255.255.netbios-ns: NBT UDP PACKET(137): REGISTRATION; REQUEST; BROADCAST IP 169.254.67.194.netbios-ns > 169.254.255.255.netbios-ns: NBT UDP PACKET(137): REGISTRATION; REQUEST; BROADCAST IP 169.254.67.194.netbios-ns > 169.254.255.255.netbios-ns: NBT UDP PACKET(137): REGISTRATION; REQUEST; BROADCAST IP 169.254.67.194.netbios-dgm > 169.254.255.255.netbios-dgm: NBT UDP PACKET(138) IP 169.254.67.194.netbios-dgm > 169.254.255.255.netbios-dgm: NBT UDP PACKET(138) IP 169.254.67.194.netbios-dgm > 169.254.255.255.netbios-dgm: NBT UDP PACKET(138) IP 169.254.67.194.netbios-dgm > 169.254.255.255.netbios-dgm: NBT UDP PACKET(138) IP 169.254.67.194.netbios-dgm > 169.254.255.255.netbios-dgm: NBT UDP PACKET(138) IP 0.0.0.0.bootpc > 255.255.255.255.bootps: BOOTP/DHCP, Request from 00:04:23:57:a5:7a (oui Unknown), length: 300 IP 169.254.67.194.netbios-dgm > 169.254.255.255.netbios-dgm: NBT UDP PACKET(138) IP 169.254.67.194.netbios-dgm > 169.254.255.255.netbios-dgm: NBT UDP PACKET(138) IP 169.254.67.194.netbios-dgm > 169.254.255.255.netbios-dgm: NBT UDP PACKET(138) IP 169.254.67.194.netbios-dgm > 169.254.255.255.netbios-dgm: NBT UDP PACKET(138) IP 169.254.67.194.netbios-ns > 169.254.255.255.netbios-ns: NBT UDP PACKET(137): REGISTRATION; REQUEST; BROADCAST IP 169.254.67.194.netbios-ns > 169.254.255.255.netbios-ns: NBT UDP PACKET(137): REGISTRATION; REQUEST; BROADCAST IP 169.254.67.194.netbios-ns > 169.254.255.255.netbios-ns: NBT UDP PACKET(137): REGISTRATION; REQUEST; BROADCAST IP 169.254.67.194.netbios-ns > 169.254.255.255.netbios-ns: NBT UDP PACKET(137): REGISTRATION; REQUEST; BROADCAST IP 169.254.67.194.netbios-ns > 169.254.255.255.netbios-ns: NBT UDP PACKET(137): REGISTRATION; REQUEST; BROADCAST IP 169.254.67.194.netbios-ns > 169.254.255.255.netbios-ns: NBT UDP PACKET(137): REGISTRATION; REQUEST; BROADCAST IP 169.254.67.194.netbios-ns > 169.254.255.255.netbios-ns: NBT UDP PACKET(137): REGISTRATION; REQUEST; BROADCAST IP 169.254.67.194.netbios-ns > 169.254.255.255.netbios-ns: NBT UDP PACKET(137): REGISTRATION; REQUEST; BROADCAST IP 169.254.67.194.netbios-dgm > 169.254.255.255.netbios-dgm: NBT UDP PACKET(138) IP 169.254.67.194.netbios-dgm > 169.254.255.255.netbios-dgm: NBT UDP PACKET(138) IP 169.254.67.194.netbios-dgm > 169.254.255.255.netbios-dgm: NBT UDP PACKET(138) IP 169.254.67.194.netbios-ns > 169.254.255.255.netbios-ns: NBT UDP PACKET(137): QUERY; REQUEST; BROADCAST IP 169.254.67.194.netbios-ns > 169.254.255.255.netbios-ns: NBT UDP PACKET(137): QUERY; REQUEST; BROADCAST IP 169.254.67.194.netbios-ns > 169.254.255.255.netbios-ns: NBT UDP PACKET(137): QUERY; REQUEST; BROADCAST IP 169.254.67.194.netbios-ns > 169.254.255.255.netbios-ns: NBT UDP PACKET(137): QUERY; REQUEST; BROADCAST IP 169.254.67.194.netbios-ns > 169.254.255.255.netbios-ns: NBT UDP PACKET(137): QUERY; REQUEST; BROADCAST IP 169.254.67.194.netbios-ns > 169.254.255.255.netbios-ns: NBT UDP PACKET(137): QUERY; REQUEST; BROADCAST IP 0.0.0.0.bootpc > 255.255.255.255.bootps: BOOTP/DHCP, Request from 00:04:23:57:a5:7a (oui Unknown), length: 300 EAP code=1 id=1 length=0 EAP code=1 id=0 length=5 EAP code=1 id=0 length=45 EAP code=1 id=0 length=20 IP 169.254.67.194.netbios-dgm > 169.254.255.255.netbios-dgm: NBT UDP PACKET(138) EAP code=1 id=0 length=76 EAP code=1 id=0 length=80 EAP code=1 id=0 length=28 EAP code=1 id=0 length=4 EAP code=1 id=3 length=57 EAP code=1 id=3 length=44 tcpdump-3.9.8/./tests/.#eapon1.sh.1.10000755000026300017500000000022410320056204014757 0ustar mcrmcr#!/bin/sh uudecode eapon1.puu echo -n test eapon1... if (../tcpdump -r eapon1.pcap | diff - eapon1.out) then echo passed. else echo failed. fi tcpdump-3.9.8/./tests/isakmp-pointer-loop.pcap0000644000026300017500000000016010320056212017372 0ustar mcrmcrÔò¡ÿÿ“&Õ?¿àHHZNè”-oÚöE:‡e@ó "ªù~ªùWôô&ò~ tcpdump-3.9.8/./tests/esp5.sh0000644000026300017500000000033410225052107014032 0ustar mcrmcr#!/bin/sh uudecode 08-sunrise-sunset-aes.puu echo -n test esp5... ../tcpdump -t -n -E "file esp-secrets.txt" -r 08-sunrise-sunset-aes.pcap > esp5.new if diff esp5.new esp5.out then echo passed. else echo failed. fi tcpdump-3.9.8/./tests/eapon1.puu0000644000026300017500000005416210030451020014537 0ustar mcrmcrbegin 644 eapon1.pcap MU,.RH0(`!````````````/__```!````"%5@0)*@#@#=````W0```/______ M_P`$(U>E>@@`10``SSB'``"`$7Q.P*@!^<"H`?\`B@"*`+M3[!$.B1W`J`'Y M`(H`I0``($5%14M&041*1$9&1$1!14M#04-!0T%#04-!0T%#04%!`"!%0D9# M14-%1D5*1D5&1$5(1D-&1D9!1D%%1D-!0T%!00#_4TU")0`````````````` M`````````````````````!$```L```````````#H`P``````````"P!6``,` M`0`!``(`'`!<34%)3%-,3U1<0E)/5U-%``(`1$I0.353,$H`"%5@0/2@#@#= M````W0```/_______P`$(U>E>@@`10``SSB(``"`$7Q-P*@!^<"H`?\`B@"* M`+L,\A$.B1[`J`'Y`(H`I0``($5%14M&041*1$9&1$1!14M#04-!0T%#04-! M0T%#04%!`"!!0D%#1E!&4$5.1D1%0T9#15!&2$9$149&4$9004-!0@#_4TU" M)0```````````````````````````````````!$```L```````````#H`P`` M````````"P!6``,``0`!``(`'`!<34%)3%-,3U1<0E)/5U-%``(`1$I0.353 M,$H`"%5@0("C#@#[````^P```/_______P`$(U>E>@@`10``[3B)``"`$7PN MP*@!^<"H`?\`B@"*`-E#WA$.B1_`J`'Y`(H`PP``($5%14M&041*1$9&1$1! M14M#04-!0T%#04-!0T%#04%!`"!!0D%#1E!&4$5.1D1%0T9#15!&2$9$149& M4$9004-!0@#_4TU")0```````````````````````````````````!$``"D` M``````````#H`P``````````*0!6``,``0`!``(`.@!<34%)3%-,3U1<0E)/ M5U-%``P`8.H``$%20D5)5%-'4E504$4``0`#"@`0`(!,_@0#1$I0.353,$H` M"%5@0/JI#@!<````7````/_______P`$(U>E>@@`10``3CB*``"`$7S,P*@! M^<"H`?\`B0")`#J"=XDA`1```0```````"!%0D9#14-%1D5*1D5&1$5(1D-& M1D9!1D%%1D-!0T%"3```(``!"55@0//8"@!<````7````/_______P`$(U>E M>@@`10``3CB-``"`$7S)P*@!^<"H`?\`B0")`#J"=XDA`1```0```````"!% M0D9#14-%1D5*1D5&1$5(1D-&1D9!1D%%1D-!0T%"3```(``!"E5@0+,)!P!< M````7````/_______P`$(U>E>@@`10``3CB.``"`$7S(P*@!^<"H`?\`B0") M`#J"=XDA`1```0```````"!%0D9#14-%1D5*1D5&1$5(1D-&1D9!1D%%1D-! M0T%"3```(``!"E5@0,@N#`#S````\P```/_______P`$(U>E>@@`10``Y3B/ M``"`$7PPP*@!^<"H`?\`B@"*`-'GIA$.B2+`J`'Y`(H`NP``($5%14M&041* M1$9&1$1!14M#04-!0T%#04-!0T%#04-!`"!%0D9#14-%1D5*1D5&1$5(1D-& M1D9!1D%%1D-!0T%"3P#_4TU")0`````````````````````````````````` M`!$``"$```````````#H`P``````````(0!6``,``0````(`,@!<34%)3%-, M3U1<0E)/5U-%``\`@/P*`$1*4#DU4S!*``!R`&\`10,`7````%P```#_______\`!"-7I7H( M`$4``$XXE0``@!%\P<"H`?G`J`'_`(D`B0`Z@G")*`$0``$````````@14)& M0T5#149%2D9%1D1%2$9#1D9&049!149#04-!0DP``"```0Y58$!0N`X`7``` M`%P```#_______\`!"-7I7H(`$4``$XXE@``@!%\P,"H`?G`J`'_`(D`B0`Z M@G")*`$0``$````````@14)&0T5#149%2D9%1D1%2$9#1D9&049!149#04-! M0DP``"```0]58$#*.`<`*@```"H```#_______\`!"-7I7H(!@`!"``&!``! M``0C5Z5ZP*@!^0```````,"H`0$/56!`%UD'`#P````\``````0C5Z5Z``V( M3R61"`8``0@`!@0``@`-B$\ED<"H`0$`!"-7I7K`J`'Y```````````````` M````````#U5@0"E9!P!6`0``5@$````-B$\ED0`$(U>E>@@`10`!2#B7``"` M$7S#P*@!^<"H`0$`1`!#`31YVP$!!@#(+24]CP&``,"H`?D````````````` M````!"-7I7H````````````````````````````````````````````````` M```````````````````````````````````````````````````````````` M```````````````````````````````````````````````````````````` M```````````````````````````````````````````````````````````` M````````````````````````````````````````8X)38S4!!S8$P*@!`3T' M`0`$(U>E>O\````````````````````````````````````````````````` M``````]58$`6@0D`/````#P`````!"-7I7H`#,Z(,9J(C@$```4!`0`%`0`` M```````````````````````````````````````````````/56!`"BL*`%8! M``!6`0``________``0C5Z5Z"`!%``%(.)\``(`1`0<`````_____P!$`$,! M-,&K`0$&`)@7ASP````````````````````````````$(U>E>@`````````` M```````````````````````````````````````````````````````````` M```````````````````````````````````````````````````````````` M```````````````````````````````````````````````````````````` M```````````````````````````````````````````````````````````` M``````````````````!C@E-C-0$!=`$!/0E>@@`10`!2#BA``"`$0$%`````/____\`1`!#`32. MS0$!!@#5`WTN````````````````````````````!"-7I7H````````````` M```````````````````````````````````````````````````````````` M```````````````````````````````````````````````````````````` M```````````````````````````````````````````````````````````` M```````````````````````````````````````````````````````````` M````````````````8X)38S4!`70!`3T'`0`$(U>E>C($P*@!^0P(1$I0.353 M,$H\"$U31E0@-2XP-PL!#P,&+"XO'R'Y*_\``````!!58$"$8P(`$P```!,` M````#,Z(,9H`!"-7I7J(C@$!````$%5@0.IK`@`\````/``````$(U>E>@`, MSH@QFHB.`0``!0$"``4!```````````````````````````````````````` M`````````!%58$!>L`L`/P```#\`````#,Z(,9H`!"-7I7J(C@$``"T"`@`M M`3$R.34P,C,X,C`P,#4S.3%`;6YC,#(S+FUC8S(Y-2YO=VQA;BYO````7@`````, MSH@QF@`$(U>E>HB.`0``3`(0`$P2"@``#@L`*#$R.34P,C,X,C`P,#4S.3%` M;6YC,#(S+FUC8S(Y-2YO=VQA;BYOL.*X:RH)3A8\F M`ET1,5U'QWV%1Z`@V,N=24.:\=%3TKIE>@`,SH@QFHB.`0,`+`$`#0``0&!5$0"=&X[D=]]>4;W^,JD$U5@0*@!#0!6`0``5@$``/_______P`$(U>E M>@@`10`!2#BG``"`$0#_`````/____\`1`!#`30ES`$!!@#5`WTN:0$````` M````````````````````!"-7I7H````````````````````````````````` M```````````````````````````````````````````````````````````` M```````````````````````````````````````````````````````````` M```````````````````````````````````````````````````````````` M````````````````````````````````````````````````````````8X)3 M8S4!`70!`3T'`0`$(U>E>C($P*@!^0P(1$I0.353,$H\"$U31E0@-2XP-PL! M#P,&+"XO'R'Y*_\``````!I58$#O`@T`5@$``%8!``#_______\`!"-7I7H( M`$4``4@XKP``@!$`]P````#_____`$0`0P$T)E>@`````````````````````````````````````` M```````````````````````````````````````````````````````````` M```````````````````````````````````````````````````````````` M```````````````````````````````````````````````````````````` M``````````````````````````````````````````````````!C@E-C-0$! M=`$!/0E>HB.`0$` M```P56!`^J$*`#P````\``````0C5Z5Z``S.B#&:B(X!```%`0,`!0$````` M````````````````````````````````````````````,%5@0)SA"@`_```` M/P`````,SH@QF@`$(U>E>HB.`0``+0(#`"T!,3(Y-3`R,S@R,#`P-3,Y,4!M M;F,P,C,N;6-C,CDU+F]W;&%N+F]R9S!58$#0!`P`/````#P`````!"-7I7H` M#,Z(,9J(C@$``!0!+P`4$@H```\"``(``0``$0$!```````````````````` M```````````R56!`-$(%`%X```!>``````S.B#&:``0C5Z5ZB(X!``!,`B\` M3!(*```."P`H,3(Y-3`R,S@R,#`P-3,Y,4!M;F,P,C,N;6-C,CDU+F]W;&%N M+F]R9P<%``#7H!![\\SE,P[&']$W6C<%$`$``3)58$#,.`<`8@```&(````` M!"-7I7H`#,Z(,9J(C@$``%`!,`!0$@L```$-```P```````````````````` M,0```````````````````#(````````````````````+!0``0WL?0G!%;49D M0(DL@MD'#C-58$!S4P(`+@```"X`````#,Z(,9H`!"-7I7J(C@$``!P",``< M$@L```L%``!%[_\P8H+&6U!$B#@$)T-",U5@0"'6`P`\````/``````$(U>E M>@`,SH@QFHB.`0``!`,```0````````````````````````````````````` M`````````````#-58$!=V@,`2P```$L`````!"-7I7H`#,Z(,9J(C@$#`#D! M``T``$!@53$`G7]!<++?0.3Y>#A83O[YHHT"0T@&N\)FL/6P9NHATX%BIRI%B`S56!`F-T#`#X````^``````0C5Z5Z``S.B#&:B(X!`P`L M`0`-``!`8%4Q`)[N$`!R;$K*.XLG`JO9N"A#@XK>5*[_:U"C]E[O?""IR!5+ M56!`]Q(-`"H````J````________``0C5Z5Z"`8``0@`!@0``0`$(U>E>JG^ M0\(```````"I_D/"2U5@0'&!#0`J````*@```/_______P`$(U>E>@@&``$( M``8$``$`!"-7I7JI_D/"````````J?Y#PDQ58$`X@@T`*@```"H```#_____ M__\`!"-7I7H(!@`!"``&!``!``0C5Z5ZJ?Y#P@```````*G^0\)-56!`*=H- M`*\```"O`````0!>?__Z``0C5Z5Z"`!%``"A.+X```$1HM.I_D/"[___^A#+ M!VP`C6+X32U314%20T@@*B!(5%10+S$N,0T*2&]S=#HR,SDN,C4U+C(U-2XR M-3`Z,3DP,`T*4U0Z=7)N.G-C:&5M87,M=7!N<"UO41E=FEC93HQ#0I-86XZ(G-S9'`Z9&ES8V]V97(B#0I-6#HS M#0H-"DU58$"\Y`T`-@```#8````!`%X``!8`!"-7I7H(`$8``"@XP````0(> M.:G^0\+@```6E`0``"(`Z@,````!!````.____I-56!`OK4.`&X```!N```` M________``0C5Z5Z"`!%``!@.,(``(`1:@RI_D/"J?[__P")`(D`3+4(B2XI M$``!```````!($5%14M&041*1$9&1$1!14M#04-!0T%#04-!0T%#04%!```@ M``'`#``@``$`!)/@``9@`*G^0\).56!`!H\*`#8````V`````0!>```6``0C M5Z5Z"`!&```H.,0```$"'C6I_D/"X```%I0$```B`.H#`````00```#O___Z M3E5@0!3E"@!N````;@```/_______P`$(U>E>@@`10``8#C%``"`$6H)J?Y# MPJG^__\`B0")`$RU"(DN*1```0```````2!%145+1D%$2D1&1D1$045+0T%# M04-!0T%#04-!0T%!00``(``!P`P`(``!``23X``&8`"I_D/"3U5@0#,6!P!N M````;@```/_______P`$(U>E>@@`10``8#C&``"`$6H(J?Y#PJG^__\`B0") M`$RU"(DN*1```0```````2!%145+1D%$2D1&1D1$045+0T%#04-!0T%#04-! M0T%!00``(``!P`P`(``!``23X``&8`"I_D/"3U5@0*^U#0!6`0``5@$``/__ M_____P`$(U>E>@@`10`!2#C'``"`$0#?`````/____\`1`!#`325:P$!!@"2 M13E.``"`````````````````````````!"-7I7H````````````````````` M```````````````````````````````````````````````````````````` M```````````````````````````````````````````````````````````` M```````````````````````````````````````````````````````````` M```````````````````````````````````````````````````````````` M````````8X)38S4!`70!`3T'`0`$(U>E>C($P*@!^0P(1$I0.353,$H\"$U3 M1E0@-2XP-PL!#P,&+"XO'R'Y*_\``````%!58$`T1P,`;@```&X```#_____ M__\`!"-7I7H(`$4``&`XR```@!%J!JG^0\*I_O__`(D`B0!,M@B)+B@0``$` M``````$@145%2T9!1$I$1D9$1$%%2T-!0T%#04-!0T%#04-!04$``"```<`, M`"```0`$D^``!F``J?Y#PE!58$",WPT`KP```*\````!`%Y___H`!"-7I7H( M`$4``*$XR@```1&BQZG^0\+O___Z$,L';`"-8OA-+5-%05)#2"`J($A45%`O M,2XQ#0I(;W-T.C(S.2XR-34N,C4U+C(U,#HQ.3`P#0I35#IUE>@@`10``8#C,``"`$6H"J?Y#PJG^__\`B0")`$PP]8DO*1`` M`0```````2!%0D9#14-%1D5*1D5&1$5(1D-&1D9!1D%%1D-!0T%!00``(``! MP`P`(``!``23X``&X`"I_D/"455@0#/A`P`3````$P`````,SH@QF@`$(U>E M>HB.`0$```!156!`8>D#`#P````\``````0C5Z5Z``S.B#&:B(X!```%`00` M!0$`````````````````````````````````````````````````455@0+TU M!``_````/P`````,SH@QF@`$(U>E>HB.`0``+0($`"T!,3(Y-3`R,S@R,#`P M-3,Y,4!M;F,P,C,N;6-C,CDU+F]W;&%N+F]R9U%58$#Y[@4`/````#P````` M!"-7I7H`#,Z(,9J(C@$``!0!4``4$@H```\"``(``0``$0$!```````````` M``````````````````!156!`9.L*`&X```!N````________``0C5Z5Z"`!% M``!@.,T``(`1:@&I_D/"J?[__P")`(D`3##UB2\I$``!```````!($5"1D-% M0T5&14I&149$14A&0T9&1D%&045&0T%#04%!```@``'`#``@``$`!)/@``;@ M`*G^0\)256!`71P'`&X```!N````________``0C5Z5Z"`!%``!@.,X``(`1 M:@"I_D/"J?[__P")`(D`3##UB2\I$``!```````!($5"1D-%0T5&14I&149$ M14A&0T9&1D%&045&0T%#04%!```@``'`#``@``$`!)/@``;@`*G^0\)256!` M9[(.`%X```!>``````S.B#&:``0C5Z5ZB(X!``!,`E``3!(*```."P`H,3(Y M-3`R,S@R,#`P-3,Y,4!M;F,P,C,N;6-C,CDU+F]W;&%N+F]R9P<%```Z)]TL M?V'JYOR&8?J))U]%$`$``5)58$`"$P\`8@```&(`````!"-7I7H`#,Z(,9J( MC@$``%`!40!0$@L```$-```P````````````````````,0`````````````` M`````#(````````````````````+!0``*IFHOZ$\8[TX!>!F]%P6:%-58$!8 M30,`;@```&X```#_______\`!"-7I7H(`$4``&`XSP``@!%I_ZG^0\*I_O__ M`(D`B0!,,?6)+R@0``$```````$@14)&0T5#149%2D9%1D1%2$9#1D9&049! M149#04-!04$``"```<`,`"```0`$D^``!N``J?Y#PE-58$#M3`H`+@```"X` M````#,Z(,9H`!"-7I7J(C@$``!P"40`<$@L```L%``#BE(K>$<9]M,I(_@G, MC).Y4U5@0`*="@`\````/``````$(U>E>@`,SH@QFHB.`0``!`,```0````` M`````````````````````````````````````````````%-58$#CH`H`2P`` M`$L`````!"-7I7H`#,Z(,9J(C@$#`#D!``T``$!@55(`GZN0MGOEA8[@4WO* M&_11@$@"&2ZIH`.YHY==8)$_%6#R:U/Z"F'14BLDK,Z)I:%356!`&*0*`#X` M```^``````0C5Z5Z``S.B#&:B(X!`P`L`0`-``!`8%52`*!&UK1?KE>@`````````````````````````` M```````````````````````````````````````````````````````````` M```````````````````````````````````````````````````````````` M```````````````````````````````````````````````````````````` M```````````````````````````````````````````````````````````` M``!C@E-C-0$!=`$!/0E>@@`10``H3C2```!$:*_J?Y#PN____H0RP=L`(UB^$TM4T5!4D-(("H@ M2%144"\Q+C$-"DAOE>@@`10``SSCF``"` M$6EYJ?Y#PJG^__\`B@"*`+L)/1$.B3:I_D/"`(H`I0``($5%14M&041*1$9& M1$1!14M#04-!0T%#04-!0T%#04%!`"!%0D9#14-%1D5*1D5&1$5(1D-&1D9! M1D%%1D-!0T%"3@#_4TU")0```````````````````````````````````!$` M``L```````````#H`P``````````"P!6``,``0`!``(`'`!<34%)3%-,3U1< M0E)/5U-%``(`1$I0.353,$H`655@0.K0#@#=````W0```/_______P`$(U>E M>@@`10``SSCG``"`$6EXJ?Y#PJG^__\`B@"*`+L)/!$.B3>I_D/"`(H`I0`` M($5%14M&041*1$9&1$1!14M#04-!0T%#04-!0T%#04%!`"!%0D9#14-%1D5* M1D5&1$5(1D-&1D9!1D%%1D-!0T%"3@#_4TU")0`````````````````````` M`````````````!$```L```````````#H`P``````````"P!6``,``0`!``(` M'`!<34%)3%-,3U1<0E)/5U-%``(`1$I0.353,$H`6U5@0-@R!P#=````W0`` M`/_______P`$(U>E>@@`10``SSCH``"`$6EWJ?Y#PJG^__\`B@"*`+L).Q$. MB3BI_D/"`(H`I0``($5%14M&041*1$9&1$1!14M#04-!0T%#04-!0T%#04%! M`"!%0D9#14-%1D5*1D5&1$5(1D-&1D9!1D%%1D-!0T%"3@#_4TU")0`````` M`````````````````````````````!$```L```````````#H`P`````````` M"P!6``,``0`!``(`'`!<34%)3%-,3U1<0E)/5U-%``(`1$I0.353,$H`7%5@ M0"2]#0!6`0``5@$``/_______P`$(U>E>@@`10`!2#CI``"`$0"]`````/__ M__\`1`!#`31L:@$!!@"213E.*0&`````````````````````````!"-7I7H` M```````````````````````````````````````````````````````````` M```````````````````````````````````````````````````````````` M```````````````````````````````````````````````````````````` M```````````````````````````````````````````````````````````` M````````````````````````````8X)38S4!`70!`3T'`0`$(U>E>C($P*@! M^0P(1$I0.353,$H\"$U31E0@-2XP-PL!#P,&+"XO'R'Y*_\``````%Q58$`# MUPX`Z0```.D```#_______\`!"-7I7H(`$4``-LXZ@``@!%I::G^0\*I_O__ M`(H`B@#';@L1#HDYJ?Y#P@"*`+$``"!%145+1D%$2D1&1D1$045+0T%#04-! M0T%#04-!0T%!00`@14)&0T5#149%2D9%1D1%2$9#1D9&049!149#04-!0D\` M_U--0B4````````````````````````````````````1```7```````````` MZ`,``````````!<`5@`#``$``0`"`"@`7$U!24Q33$]47$)23U=310`(`2`/ M`1!9L1D5`````$1*4#DU4S!*`%U58$#/UPX`Z0```.D```#_______\`!"-7 MI7H(`$4``-LXZP``@!%I:*G^0\*I_O__`(H`B@#';@H1#HDZJ?Y#P@"*`+$` M`"!%145+1D%$2D1&1D1$045+0T%#04-!0T%#04-!0T%!00`@14)&0T5#149% M2D9%1D1%2$9#1D9&049!149#04-!0D\`_U--0B4````````````````````` M```````````````1```7````````````Z`,``````````!<`5@`#``$``0`" M`"@`7$U!24Q33$]47$)23U=310`(`2`/`1!9L1D5`````$1*4#DU4S!*`%Y5 M8$"+V`X`Z0```.D```#_______\`!"-7I7H(`$4``-LX[```@!%I9ZG^0\*I M_O__`(H`B@#';@D1#HD[J?Y#P@"*`+$``"!%145+1D%$2D1&1D1$045+0T%# M04-!0T%#04-!0T%!00`@14)&0T5#149%2D9%1D1%2$9#1D9&049!149#04-! M0D\`_U--0B4````````````````````````````````````1```7```````` M````Z`,``````````!<`5@`#``$``0`"`"@`7$U!24Q33$]47$)23U=310`( M`2`/`1!9L1D5`````$1*4#DU4S!*`%]58$!)V0X`Z0```.D```#_______\` M!"-7I7H(`$4``-LX[0``@!%I9JG^0\*I_O__`(H`B@#';@@1#HD\J?Y#P@"* M`+$``"!%145+1D%$2D1&1D1$045+0T%#04-!0T%#04-!0T%!00`@14)&0T5# M149%2D9%1D1%2$9#1D9&049!149#04-!0D\`_U--0B4````````````````` M```````````````````1```7````````````Z`,``````````!<`5@`#``$` M`0`"`"@`7$U!24Q33$]47$)23U=310`(`2`/`1!9L1D5`````$1*4#DU4S!* M`&!58$"CV@X`;@```&X```#_______\`!"-7I7H(`$4``&`X[@``@!%IX*G^ M0\*I_O__`(D`B0!,H^:)/2D0``$```````$@14)&0T5#149%2D9%1D1%2$9# M1D9&049!149#04-!0DX``"```<`,`"```0`$D^``!F``J?Y#PF%58$#F"@L` M;@```&X```#_______\`!"-7I7H(`$4``&`X[P``@!%IWZG^0\*I_O__`(D` MB0!,H^:)/2D0``$```````$@14)&0T5#149%2D9%1D1%2$9#1D9&049!149# M04-!0DX``"```<`,`"```0`$D^``!F``J?Y#PF)58$#?.P<`;@```&X```#_ M______\`!"-7I7H(`$4``&`X\```@!%IWJG^0\*I_O__`(D`B0!,H^:)/2D0 M``$```````$@14)&0T5#149%2D9%1D1%2$9#1D9&049!149#04-!0DX``"`` M`<`,`"```0`$D^``!F``J?Y#PF-58$#9;`,`;@```&X```#_______\`!"-7 MI7H(`$4``&`X\P``@!%IVZG^0\*I_O__`(D`B0!,I.:)/2@0``$```````$@ M14)&0T5#149%2D9%1D1%2$9#1D9&049!149#04-!0DX``"```<`,`"```0`$ MD^``!F``J?Y#PF-58$"'X`X`;@```&X```#_______\`!"-7I7H(`$4``&`X M]```@!%IVJG^0\*I_O__`(D`B0!,Z>R)/BD0``$```````$@04)!0T901E!% M3D9$14-&0T501DA&1$5&1E!&4$%#04(``"```<`,`"```0`$D^``!N``J?Y# MPF158$`/$0L`;@```&X```#_______\`!"-7I7H(`$4``&`X]0``@!%IV:G^ M0\*I_O__`(D`B0!,Z>R)/BD0``$```````$@04)!0T901E!%3D9$14-&0T50 M1DA&1$5&1E!&4$%#04(``"```<`,`"```0`$D^``!N``J?Y#PF558$`&0@<` M;@```&X```#_______\`!"-7I7H(`$4``&`X]@``@!%IV*G^0\*I_O__`(D` MB0!,Z>R)/BD0``$```````$@04)!0T901E!%3D9$14-&0T501DA&1$5&1E!& M4$%#04(``"```<`,`"```0`$D^``!N``J?Y#PF958$#^<@,`;@```&X```#_ M______\`!"-7I7H(`$4``&`X]P``@!%IUZG^0\*I_O__`(D`B0!,ZNR)/B@0 M``$```````$@04)!0T901E!%3D9$14-&0T501DA&1$5&1E!&4$%#04(``"`` M`<`,`"```0`$D^``!N``J?Y#PF958$!_Y@X`W0```-T```#_______\`!"-7 MI7H(`$4``,\X^```@!%I9ZG^0\*I_O__`(H`B@"[%C41#HD_J?Y#P@"*`*4` M`"!%145+1D%$2D1&1D1$045+0T%#04-!0T%#04-!0T%!00`@14)&0T5#149% M2D9%1D1%2$9#1D9&049!149#04-!04$`_U--0B4````````````````````` M```````````````1```+````````````Z`,```````````L`5@`#``$``0`" M`!P`7$U!24Q33$]47$)23U=310`"`$1*4#DU4S!*`&958$!AYPX`W0```-T` M``#_______\`!"-7I7H(`$4``,\X^0``@!%I9JG^0\*I_O__`(H`B@"[SSH1 M#HE`J?Y#P@"*`*4``"!%145+1D%$2D1&1D1$045+0T%#04-!0T%#04-!0T%! M00`@04)!0T901E!%3D9$14-&0T501DA&1$5&1E!&4$%#04(`_U--0B4````` M```````````````````````````````1```+````````````Z`,````````` M``L`5@`#``$``0`"`!P`7$U!24Q33$]47$)23U=310`"`$1*4#DU4S!*`&95 M8$!PZ@X`^P```/L```#_______\`!"-7I7H(`$4``.TX^@``@!%I1ZG^0\*I M_O__`(H`B@#9)2,1#HE!J?Y#P@"*`,,``"!%145+1D%$2D1&1D1$045+0T%# M04-!0T%#04-!0T%!00`@04)!0T901E!%3D9$14-&0T501DA&1$5&1E!&4$%# M04(`_U--0B4````````````````````````````````````1```I```````` M````Z`,``````````"D`5@`#``$``0`"`#H`7$U!24Q33$]47$)23U=310`, M`&#J``!!4D)%25131U)54%!%``$``PH`$`"`;/[%!D1*4#DU4S!*`&958$"4 M\`X`7````%P```#_______\`!"-7I7H(`$4``$XX^P``@!%IY:G^0\*I_O__ M`(D`B0`Z;]^)0P$0``$````````@14)&0T5#149%2D9%1D1%2$9#1D9&049! M149#04-!0DP``"```6=58$`('PL`7````%P```#_______\`!"-7I7H(`$4` M`$XX_```@!%IY*G^0\*I_O__`(D`B0`Z;]^)0P$0``$````````@14)&0T5# M149%2D9%1D1%2$9#1D9&049!149#04-!0DP``"```6A58$`&4`<`7````%P` M``#_______\`!"-7I7H(`$4``$XX_0``@!%IXZG^0\*I_O__`(D`B0`Z;]^) M0P$0``$````````@14)&0T5#149%2D9%1D1%2$9#1D9&049!149#04-!0DP` M`"```6M58$"J6P<`7````%P```#_______\`!"-7I7H(`$4``$XY`0``@!%I MWZG^0\*I_O__`(D`B0`Z;]N)1P$0``$````````@14)&0T5#149%2D9%1D1% M2$9#1D9&049!149#04-!0DP``"```6Q58$`-BP,`7````%P```#_______\` M!"-7I7H(`$4``$XY`@``@!%IWJG^0\*I_O__`(D`B0`Z;]N)1P$0``$````` M```@14)&0T5#149%2D9%1D1%2$9#1D9&049!149#04-!0DP``"```6Q58$!% M_@X`7````%P```#_______\`!"-7I7H(`$4``$XY!```@!%IW*G^0\*I_O__ M`(D`B0`Z;]N)1P$0``$````````@14)&0T5#149%2D9%1D1%2$9#1D9&049! M149#04-!0DP``"```6U58$`7O@T`5@$``%8!``#_______\`!"-7I7H(`$4` M`4@Y!@``@!$`H`````#_____`$0`0P$T;&H!`08`DD4Y3BD!@``````````` M``````````````0C5Z5Z```````````````````````````````````````` M```````````````````````````````````````````````````````````` M```````````````````````````````````````````````````````````` M```````````````````````````````````````````````````````````` M`````````````````````````````````````````````````&."4V,U`0%T M`0$]!P$`!"-7I7HR!,"H`?D,"$1*4#DU4S!*/`A-4T94(#4N,#<+`0\#!BPN M+Q\A^2O_``````!Q56!`]:$*`!,````3``````S.B#&:``0C5Z5ZB(X!`0`` M`'%58$!%P`H`/````#P`````!"-7I7H`#,Z(,9J(C@$```4!!0`%`0`````` M``````````````````````````````````````````!Q56!`C?4*`#\````_ M``````S.B#&:``0C5Z5ZB(X!```M`@4`+0$Q,CDU,#(S.#(P,#`U,SDQ0&UN M8S`R,RYM8V,R.34N;W=L86XN;W)G<55@0/XV"P`\````/``````$(U>E>@`, MSH@QFHB.`0``%`%P`!02"@``#P(``@`!```1`0$````````````````````` M`````````')58$#=.0P`\P```/,```#_______\`!"-7I7H(`$4``.4Y#``` M@!%I/:G^0\*I_O__`(H`B@#1\^D1#HE*J?Y#P@"*`+L``"!%145+1D%$2D1& M1D1$045+0T%#04-!0T%#04-!0T%#00`@14)&0T5#149%2D9%1D1%2$9#1D9& M049!149#04-!0D\`_U--0B4````````````````````````````````````1 M```A````````````Z`,``````````"$`5@`#``$````"`#(`7$U!24Q33$]4 M7$)23U=310`/`(#\"@!$2E`Y-5,P2@``60!<`%4`!0$#$`4`#P%5J@!S56!` MJ'L$`%X```!>``````S.B#&:``0C5Z5ZB(X!``!,`G``3!(*```."P`H,3(Y M-3`R,S@R,#`P-3,Y,4!M;F,P,C,N;6-C,CDU+F]W;&%N+F]R9P<%```)[DNV M]E>@`,SH@QFHB.`0`` M!`,```0``````````````````````````````````````````````````'15 M8$`G6P``2P```$L`````!"-7I7H`#,Z(,9J(C@$#`#D!``T``$!@57(`H7=G MF]` 192.1.2.45: ESP(spi=0x12345678,seq=0x1), length 172: IP 192.1.2.23 > 192.0.1.1: ESP(spi=0xabcdabcd,seq=0x1), length 116: IP 192.0.2.1 > 192.0.1.1: ICMP echo request, id 28416, seq 1280, length 64 (ipip-proto-4) (ipip-proto-4) IP 192.1.2.23 > 192.1.2.45: ESP(spi=0x12345678,seq=0x2), length 172: IP 192.1.2.23 > 192.0.1.1: ESP(spi=0xabcdabcd,seq=0x2), length 116: IP 192.0.2.1 > 192.0.1.1: ICMP echo request, id 28416, seq 1536, length 64 (ipip-proto-4) (ipip-proto-4) IP 192.1.2.23 > 192.1.2.45: ESP(spi=0x12345678,seq=0x3), length 172: IP 192.1.2.23 > 192.0.1.1: ESP(spi=0xabcdabcd,seq=0x3), length 116: IP 192.0.2.1 > 192.0.1.1: ICMP echo request, id 28416, seq 1792, length 64 (ipip-proto-4) (ipip-proto-4) IP 192.1.2.23 > 192.1.2.45: ESP(spi=0x12345678,seq=0x4), length 172: IP 192.1.2.23 > 192.0.1.1: ESP(spi=0xabcdabcd,seq=0x4), length 116: IP 192.0.2.1 > 192.0.1.1: ICMP echo request, id 28416, seq 2048, length 64 (ipip-proto-4) (ipip-proto-4) IP 192.1.2.23 > 192.1.2.45: ESP(spi=0x12345678,seq=0x5), length 172: IP 192.1.2.23 > 192.0.1.1: ESP(spi=0xabcdabcd,seq=0x5), length 116: IP 192.0.2.1 > 192.0.1.1: ICMP echo request, id 28416, seq 2304, length 64 (ipip-proto-4) (ipip-proto-4) IP 192.1.2.23 > 192.1.2.45: ESP(spi=0x12345678,seq=0x6), length 172: IP 192.1.2.23 > 192.0.1.1: ESP(spi=0xabcdabcd,seq=0x6), length 116: IP 192.0.2.1 > 192.0.1.1: ICMP echo request, id 28416, seq 2560, length 64 (ipip-proto-4) (ipip-proto-4) IP 192.1.2.23 > 192.1.2.45: ESP(spi=0x12345678,seq=0x7), length 172: IP 192.1.2.23 > 192.0.1.1: ESP(spi=0xabcdabcd,seq=0x7), length 116: IP 192.0.2.1 > 192.0.1.1: ICMP echo request, id 28416, seq 2816, length 64 (ipip-proto-4) (ipip-proto-4) IP 192.1.2.23 > 192.1.2.45: ESP(spi=0x12345678,seq=0x8), length 172: IP 192.1.2.23 > 192.0.1.1: ESP(spi=0xabcdabcd,seq=0x8), length 116: IP 192.0.2.1 > 192.0.1.1: ICMP echo request, id 28416, seq 3072, length 64 (ipip-proto-4) (ipip-proto-4) tcpdump-3.9.8/./tests/08-sunrise-sunset-esp2.pcap0000644000026300017500000000341010320056212017565 0ustar mcrmcrÔò¡ÎÎddEdd#EÀ)M@2ÌxÀÀ-4VxGA/ÅK™€ ﻯÔÐÙ`¨oWÅØCŽö“‰ KvEªpzÞ×¹Hæ»*顼5…ì –|5ÿÓ»ó7>´.3ÂõÜû¹=°3ÉS-ç¬ï¼fçœE9g¯§ÌÎ>Æ2šUS35¹Wúð êsxb?·DB=šÛ óDí<ÍVÂT6ð†{Ð:E£YE`ÕÖT(F¯YYA/JÎÎddEdd#EÀ)O@2ÌvÀÀ-4Vx:uû>nŸ\ðÎ=‰¹~ÃÇù/VdûðÛ¥Í9}M>„ÇÐב‘ÒlÕ%·ó|žª¿êCm-Ï€2µuxYnnr)QûamÎimHzäÆq™·áÚiËKµ)вuŠÌþÓ@)¦­jî}̰±°¡Èr²=ùÞë^›g“°îû¬bɆÐ.€LÁ)÷[)‡^±|šÖ$ËžÐôz,¡VÀÎÎddEdd#EÀ)Q@2ÌtÀÀ-4Vx% 7¦zŒ+=ÿÄ·I£ûKïtûßøpÒµ­¦âŒªWòÇ d‡ÏBШ­>ôNfÈå-—@L~Aמjb«£ãÌÏŠ@Y¹‰ö ÛŸkeï`$B“GQÝ×VkiI:Ñ/£%µ'åà)5->¿ô?ßQ„$bÏÀ‘{Óq7Eç̸æ­¢÷ø¢fäœÝŠôäíÜšµ+cX˨sŠà›¨Ít¬ºËÎÎddEdd#EÀ)S@2ÌrÀÀ-4Vx÷Ü讞åŸu-vìG\4±Èå–öRä œ†Í›þÆÜÑÍóÀÒÇU™˜ˆE'ÈEE^å*Kl½¯}d€c—Õ5½¬Ñ;8Vcˆ©«úV¹ªÏ%@Ä÷«ÏiÐÛ·* 'ôSgÃ7ZÕ4_<_Š.ŸC …0â‰_¯uâ箘ÍSÕv‹d778Jòhïóô­ OÂíysIóq›rê€ÂÎÎddEdd#EÀ)U@2ÌpÀÀ-4Vx éšÌ(Ô¢dÞTc!•³$tt|¿5ø$#TQTÂsÁð¨ä¬á¯Ôr÷•¯—©€¡·7 מ 1Âæ±ŸL´< Kí%1¿hç ™§ÝÒ«¾+Úxgü¹ÿ…2é)A³r}À¯sè,¤s¡ª…Ö=†JŒl˜°j?›9§,‰¦ô¸eD±‰nß½ŽÝ(ø,hðê›°)—ÞÎÎddEdd#EÀ)W@2ÌnÀÀ-4Vx”-Ý(–gKÇ^…;Œñ¥ȩûÐ:'É >=Y8'…Lî!Ú«­­Ü·©’ù€×N>õÌCo®‹±¦TÉ™R ÚEŠ0~€Wâa.Ö–"•ÁØz#0¼Ò˜ºÃõHL @ü¿6”ãß{«nv"þÅ0ˆ®_I–}uYLáµ ¸’ÞflÏ8JzOž‡cŒŒü&+F$®-ú)¿ÿç?ÎÎddEdd#EÀ)Y@2ÌlÀÀ-4Vx ³Ä~Ö†ñyëËö<Ö¢á‘:mÏ­¶¶;kDɮԎ£Ç…Ö '…ª±ŸØê2¿ñûý ¼NÌ&¿Óö2ÊvFÿh6x$¾Áö5Ro€W;ÄKc!Î × a)àîk¯ß+ é©ÓR\zõÑ)ë›rþðþÌzU0ï‹^ó9DŒ’Jˤî‚ÔY’LÌî6µhú@l p4È#Thf Å\øÎÎddEdd#EÀ)[@2ÌjÀÀ-4Vx¡Ìö¡3 ˆ¿]nЫ>ðž–¸S'$ƒ›[ƒk¶”rlªô:j‘ÍûBÔìfÐoñW¢Ö³&7!ê+žýŒø;3…'™i­âqøçØ÷¥]¦M7×0¬Y£°Ìq»òáÝÂt¶ð(CP«èÛÌZpj¦ç©©0*A”­ìë7ÃÁ_ΆpejP[µ~ì­%G+ð‡ÖTö gõôý e4µç­<tcpdump-3.9.8/./tests/print-XX.new0000644000026300017500000007043410320056212015033 0ustar mcrmcr23:57:35.938066 IP 127.0.0.1.55920 > 127.0.0.1.80: S 928549246:928549246(0) win 32767 0x0000: 0000 0000 0000 0000 0000 0000 0800 4500 ..............E. 0x0010: 003c 1b68 4000 4006 2152 7f00 0001 7f00 .<.h@.@.!R...... 0x0020: 0001 da70 0050 3758 897e 0000 0000 a002 ...p.P7X.~...... 0x0030: 7fff 1421 0000 0204 400c 0402 080a 4ddc ...!....@.....M. 0x0040: 9216 0000 0000 0103 0302 .......... 23:57:35.938122 IP 127.0.0.1.80 > 127.0.0.1.55920: S 930778609:930778609(0) ack 928549247 win 32767 0x0000: 0000 0000 0000 0000 0000 0000 0800 4500 ..............E. 0x0010: 003c 0000 4000 4006 3cba 7f00 0001 7f00 .<..@.@.<....... 0x0020: 0001 0050 da70 377a 8df1 3758 897f a012 ...P.p7z..7X.... 0x0030: 7fff 6eb1 0000 0204 400c 0402 080a 4ddc ..n.....@.....M. 0x0040: 9216 4ddc 9216 0103 0302 ..M....... 23:57:35.938167 IP 127.0.0.1.55920 > 127.0.0.1.80: . ack 1 win 8192 0x0000: 0000 0000 0000 0000 0000 0000 0800 4500 ..............E. 0x0010: 0034 1b6a 4000 4006 2158 7f00 0001 7f00 .4.j@.@.!X...... 0x0020: 0001 da70 0050 3758 897f 377a 8df2 8010 ...p.P7X..7z.... 0x0030: 2000 37d0 0000 0101 080a 4ddc 9216 4ddc ..7.......M...M. 0x0040: 9216 .. 23:57:35.939423 IP 127.0.0.1.55920 > 127.0.0.1.80: P 1:203(202) ack 1 win 8192 0x0000: 0000 0000 0000 0000 0000 0000 0800 4500 ..............E. 0x0010: 00fe 1b6c 4000 4006 208c 7f00 0001 7f00 ...l@.@......... 0x0020: 0001 da70 0050 3758 897f 377a 8df2 8018 ...p.P7X..7z.... 0x0030: 2000 fef2 0000 0101 080a 4ddc 9217 4ddc ..........M...M. 0x0040: 9216 4745 5420 2f20 4854 5450 2f31 2e31 ..GET./.HTTP/1.1 0x0050: 0d0a 486f 7374 3a20 6c6f 6361 6c68 6f73 ..Host:.localhos 0x0060: 740d 0a55 7365 722d 4167 656e 743a 2045 t..User-Agent:.E 0x0070: 4c69 6e6b 732f 302e 3130 2e34 2d37 2d64 Links/0.10.4-7-d 0x0080: 6562 6961 6e20 2874 6578 746d 6f64 653b ebian.(textmode; 0x0090: 204c 696e 7578 2032 2e36 2e31 312d 312d .Linux.2.6.11-1- 0x00a0: 3638 362d 736d 7020 6936 3836 3b20 3133 686-smp.i686;.13 0x00b0: 3278 3536 2d32 290d 0a41 6363 6570 743a 2x56-2)..Accept: 0x00c0: 202a 2f2a 0d0a 4163 6365 7074 2d45 6e63 .*/*..Accept-Enc 0x00d0: 6f64 696e 673a 2067 7a69 700d 0a41 6363 oding:.gzip..Acc 0x00e0: 6570 742d 4c61 6e67 7561 6765 3a20 656e ept-Language:.en 0x00f0: 0d0a 436f 6e6e 6563 7469 6f6e 3a20 4b65 ..Connection:.Ke 0x0100: 6570 2d41 6c69 7665 0d0a 0d0a ep-Alive.... 23:57:35.940474 IP 127.0.0.1.80 > 127.0.0.1.55920: . ack 203 win 8192 0x0000: 0000 0000 0000 0000 0000 0000 0800 4500 ..............E. 0x0010: 0034 1fe4 4000 4006 1cde 7f00 0001 7f00 .4..@.@......... 0x0020: 0001 0050 da70 377a 8df2 3758 8a49 8010 ...P.p7z..7X.I.. 0x0030: 2000 3703 0000 0101 080a 4ddc 9218 4ddc ..7.......M...M. 0x0040: 9217 .. 23:57:35.941232 IP 127.0.0.1.80 > 127.0.0.1.55920: P 1:5560(5559) ack 203 win 8192 0x0000: 0000 0000 0000 0000 0000 0000 0800 4500 ..............E. 0x0010: 15eb 1fe6 4000 4006 0725 7f00 0001 7f00 ....@.@..%...... 0x0020: 0001 0050 da70 377a 8df2 3758 8a49 8018 ...P.p7z..7X.I.. 0x0030: 2000 13e0 0000 0101 080a 4ddc 9219 4ddc ..........M...M. 0x0040: 9217 4854 5450 2f31 2e31 2032 3030 204f ..HTTP/1.1.200.O 0x0050: 4b0d 0a44 6174 653a 2057 6564 2c20 3036 K..Date:.Wed,.06 0x0060: 204a 756c 2032 3030 3520 3033 3a35 373a .Jul.2005.03:57: 0x0070: 3335 2047 4d54 0d0a 5365 7276 6572 3a20 35.GMT..Server:. 0x0080: 4170 6163 6865 2f31 2e33 2e33 330d 0a4c Apache/1.3.33..L 0x0090: 6173 742d 4d6f 6469 6669 6564 3a20 5375 ast-Modified:.Su 0x00a0: 6e2c 2031 3520 4175 6720 3230 3034 2030 n,.15.Aug.2004.0 0x00b0: 303a 3433 3a34 3120 474d 540d 0a45 5461 0:43:41.GMT..ETa 0x00c0: 673a 2022 3665 3830 6630 2d31 3438 612d g:."6e80f0-148a- 0x00d0: 3431 3165 6231 6264 220d 0a41 6363 6570 411eb1bd"..Accep 0x00e0: 742d 5261 6e67 6573 3a20 6279 7465 730d t-Ranges:.bytes. 0x00f0: 0a43 6f6e 7465 6e74 2d4c 656e 6774 683a .Content-Length: 0x0100: 2035 3235 380d 0a4b 6565 702d 416c 6976 .5258..Keep-Aliv 0x0110: 653a 2074 696d 656f 7574 3d31 352c 206d e:.timeout=15,.m 0x0120: 6178 3d31 3030 0d0a 436f 6e6e 6563 7469 ax=100..Connecti 0x0130: 6f6e 3a20 4b65 6570 2d41 6c69 7665 0d0a on:.Keep-Alive.. 0x0140: 436f 6e74 656e 742d 5479 7065 3a20 7465 Content-Type:.te 0x0150: 7874 2f68 746d 6c3b 2063 6861 7273 6574 xt/html;.charset 0x0160: 3d69 736f 2d38 3835 392d 310d 0a0d 0a3c =iso-8859-1....< 0x0170: 2144 4f43 5459 5045 2048 544d 4c20 5055 !DOCTYPE.HTML.PU 0x0180: 424c 4943 2022 2d2f 2f57 3343 2f2f 4454 BLIC."-//W3C//DT 0x0190: 4420 4854 4d4c 2034 2e30 3120 5472 616e D.HTML.4.01.Tran 0x01a0: 7369 7469 6f6e 616c 2f2f 454e 223e 0a3c sitional//EN">.< 0x01b0: 4854 4d4c 3e0a 3c48 4541 443e 0a20 2020 HTML>..... 0x01c0: 3c4d 4554 4120 4854 5450 2d45 5155 4956 ........Placeholder 0x0270: 2070 6167 653c 2f54 4954 4c45 3e0a 3c2f .page....Placeholder.pa 0x02f0: 6765 3c2f 4831 3e0a 3c48 323e 4966 2079 ge

    .

    If.y 0x0300: 6f75 2061 7265 206a 7573 7420 6272 6f77 ou.are.just.brow 0x0310: 7369 6e67 2074 6865 2077 6562 3c2f 6832 sing.the.web

    ..

    The.owner. 0x0330: 6f66 2074 6869 7320 7765 6220 7369 7465 of.this.web.site 0x0340: 2068 6173 206e 6f74 2070 7574 2075 7020 .has.not.put.up. 0x0350: 616e 7920 7765 6220 7061 6765 7320 7965 any.web.pages.ye 0x0360: 742e 0a50 6c65 6173 6520 636f 6d65 2062 t..Please.come.b 0x0370: 6163 6b20 6c61 7465 722e 3c2f 503e 0a0a ack.later.

    .. 0x0380: 3c50 3e3c 534d 414c 4c3e 3c43 4954 453e

    0x0390: 4d6f 7665 2061 6c6f 6e67 2c20 6e6f 7468 Move.along,.noth 0x03a0: 696e 6720 746f 2073 6565 2068 6572 652e ing.to.see.here. 0x03b0: 2e2e 3c2f 4349 5445 3e20 3a2d 293c 2f53 ...:-)

    ..

    I 0x03d0: 6620 796f 7520 6172 6520 7472 7969 6e67 f.you.are.trying 0x03e0: 2074 6f20 6c6f 6361 7465 2074 6865 2061 .to.locate.the.a 0x03f0: 646d 696e 6973 7472 6174 6f72 206f 6620 dministrator.of. 0x0400: 7468 6973 206d 6163 6869 6e65 3c2f 4832 this.machine

    ..

    If.you.wan 0x0420: 7420 746f 2072 6570 6f72 7420 736f 6d65 t.to.report.some 0x0430: 7468 696e 6720 6162 6f75 7420 7468 6973 thing.about.this 0x0440: 2068 6f73 7427 7320 6265 6861 7669 6f72 .host's.behavior 0x0450: 2c20 706c 6561 7365 0a63 6f6e 7461 6374 ,.please.contact 0x0460: 2074 6865 2049 6e74 6572 6e65 7420 5365 .the.Internet.Se 0x0470: 7276 6963 6520 5072 6f76 6964 6572 2028 rvice.Provider.( 0x0480: 4953 5029 2069 6e76 6f6c 7665 6420 6469 ISP).involved.di 0x0490: 7265 6374 6c79 2e3c 2f50 3e0a 0a3c 503e rectly.

    ..

    0x04a0: 5365 6520 7468 6520 3c41 2068 7265 663d See.the.Network. 0x04d0: 4162 7573 650a 436c 6561 7269 6e67 686f Abuse.Clearingho 0x04e0: 7573 653c 2f41 3e20 666f 7220 686f 7720 use.for.how. 0x04f0: 746f 2064 6f20 7468 6973 2e3c 2f50 3e0a to.do.this.

    . 0x0500: 0a3c 4832 3e49 6620 796f 7520 6172 6520 .

    If.you.are. 0x0510: 7468 6520 6164 6d69 6e69 7374 7261 746f the.administrato 0x0520: 7220 6f66 2074 6869 7320 6d61 6368 696e r.of.this.machin 0x0530: 653c 2f48 323e 0a0a 3c50 3e54 6865 2069 e

    ..

    The.i 0x0540: 6e69 7469 616c 2069 6e73 7461 6c6c 6174 nitial.installat 0x0550: 696f 6e20 6f66 203c 4120 6872 6566 3d22 ion.of.Debian's 0x0580: 0a61 7061 6368 653c 2f41 3e20 7765 6220 .apache.web. 0x0590: 7365 7276 6572 2070 6163 6b61 6765 2077 server.package.w 0x05a0: 6173 2073 7563 6365 7373 6675 6c2e 3c2f as.successful...

    Y 0x05c0: 6f75 2073 686f 756c 6420 7265 706c 6163 ou.should.replac 0x05d0: 6520 7468 6973 2070 6167 6520 7769 7468 e.this.page.with 0x05e0: 2079 6f75 7220 6f77 6e20 7765 6220 7061 .your.own.web.pa 0x05f0: 6765 7320 6173 0a73 6f6f 6e20 6173 2070 ges.as.soon.as.p 0x0600: 6f73 7369 626c 652e 3c2f 5354 524f 4e47 ossible.

    ..

    Unless 0x0620: 2079 6f75 2063 6861 6e67 6564 2069 7473 .you.changed.its 0x0630: 2063 6f6e 6669 6775 7261 7469 6f6e 2c20 .configuration,. 0x0640: 796f 7572 206e 6577 2073 6572 7665 7220 your.new.server. 0x0650: 6973 2063 6f6e 6669 6775 7265 6420 6173 is.configured.as 0x0660: 2066 6f6c 6c6f 7773 3a0a 3c55 4c3e 0a3c .follows:.

      .< 0x0670: 4c49 3e0a 436f 6e66 6967 7572 6174 696f LI>.Configuratio 0x0680: 6e20 6669 6c65 7320 6361 6e20 6265 2066 n.files.can.be.f 0x0690: 6f75 6e64 2069 6e20 3c54 543e 2f65 7463 ound.in./etc 0x06a0: 2f61 7061 6368 653c 2f54 543e 2e3c 2f4c /apache...
    • .The.DocumentRoot,.which.is.the 0x06e0: 2064 6972 6563 746f 7279 2075 6e64 6572 .directory.under 0x06f0: 2077 6869 6368 2061 6c6c 2079 6f75 720a .which.all.your. 0x0700: 4854 4d4c 2066 696c 6573 2073 686f 756c HTML.files.shoul 0x0710: 6420 6578 6973 742c 2069 7320 7365 7420 d.exist,.is.set. 0x0720: 746f 203c 5454 3e2f 7661 722f 7777 773c to./var/www< 0x0730: 2f54 543e 2e3c 2f4c 493e 0a0a 3c4c 493e /TT>.
    • ..
    • 0x0740: 0a43 4749 2073 6372 6970 7473 2061 7265 .CGI.scripts.are 0x0750: 206c 6f6f 6b65 6420 666f 7220 696e 203c .looked.for.in.< 0x0760: 5454 3e2f 7573 722f 6c69 622f 6367 692d TT>/usr/lib/cgi- 0x0770: 6269 6e3c 2f54 543e 2c20 7768 6963 6820 bin,.which. 0x0780: 6973 2077 6865 7265 0a44 6562 6961 6e20 is.where.Debian. 0x0790: 7061 636b 6167 6573 2077 696c 6c20 706c packages.will.pl 0x07a0: 6163 6520 7468 6569 7220 7363 7269 7074 ace.their.script 0x07b0: 732e 3c2f 4c49 3e0a 0a3c 4c49 3e0a 4c6f s.
    • ..
    • .Lo 0x07c0: 6720 6669 6c65 7320 6172 6520 706c 6163 g.files.are.plac 0x07d0: 6564 2069 6e20 3c54 543e 2f76 6172 2f6c ed.in./var/l 0x07e0: 6f67 2f61 7061 6368 653c 2f54 543e 2c20 og/apache,. 0x07f0: 616e 6420 7769 6c6c 2062 6520 726f 7461 and.will.be.rota 0x0800: 7465 640a 7765 656b 6c79 2e20 2054 6865 ted.weekly...The 0x0810: 2066 7265 7175 656e 6379 206f 6620 726f .frequency.of.ro 0x0820: 7461 7469 6f6e 2063 616e 2062 6520 6561 tation.can.be.ea 0x0830: 7369 6c79 2063 6861 6e67 6564 2062 7920 sily.changed.by. 0x0840: 6564 6974 696e 670a 3c54 543e 2f65 7463 editing./etc 0x0850: 2f6c 6f67 726f 7461 7465 2e64 2f61 7061 /logrotate.d/apa 0x0860: 6368 653c 2f54 543e 2e3c 2f4c 493e 0a0a che.
    • .. 0x0870: 3c4c 493e 0a54 6865 2064 6566 6175 6c74
    • .The.default 0x0880: 2064 6972 6563 746f 7279 2069 6e64 6578 .directory.index 0x0890: 2069 7320 3c54 543e 696e 6465 782e 6874 .is.index.ht 0x08a0: 6d6c 3c2f 5454 3e2c 206d 6561 6e69 6e67 ml,.meaning 0x08b0: 2074 6861 7420 7265 7175 6573 7473 0a66 .that.requests.f 0x08c0: 6f72 2061 2064 6972 6563 746f 7279 203c or.a.directory.< 0x08d0: 5454 3e2f 666f 6f2f 6261 722f 3c2f 5454 TT>/foo/bar/.will.give.the. 0x08f0: 636f 6e74 656e 7473 206f 6620 7468 6520 contents.of.the. 0x0900: 6669 6c65 203c 5454 3e2f 7661 722f 7777 file./var/ww 0x0910: 772f 666f 6f2f 6261 722f 696e 6465 782e w/foo/bar/index. 0x0920: 6874 6d6c 3c2f 5454 3e0a 6966 2069 7420 html.if.it. 0x0930: 6578 6973 7473 2028 6173 7375 6d69 6e67 exists.(assuming 0x0940: 2074 6861 7420 3c54 543e 2f76 6172 2f77 .that./var/w 0x0950: 7777 3c2f 5454 3e20 6973 2079 6f75 7220 ww.is.your. 0x0960: 3c54 543e 446f 6375 6d65 6e74 526f 6f74 DocumentRoot 0x0970: 3c2f 5454 3e29 2e3c 2f4c 493e 0a0a 3c4c ).
    • ...User.director 0x0990: 6965 7320 6172 6520 656e 6162 6c65 642c ies.are.enabled, 0x09a0: 2061 6e64 2075 7365 7220 646f 6375 6d65 .and.user.docume 0x09b0: 6e74 7320 7769 6c6c 2062 6520 6c6f 6f6b nts.will.be.look 0x09c0: 6564 2066 6f72 0a69 6e20 7468 6520 3c54 ed.for.in.the.public_html.directory.of. 0x09f0: 7468 6520 7573 6572 7327 2068 6f6d 6573 the.users'.homes 0x0a00: 2e20 2054 6865 7365 2064 6972 730a 7368 ...These.dirs.sh 0x0a10: 6f75 6c64 2062 6520 756e 6465 7220 3c54 ould.be.under./home
      ,.an 0x0a30: 6420 7573 6572 7320 7769 6c6c 206e 6f74 d.users.will.not 0x0a40: 2062 6520 6162 6c65 2074 6f20 7379 6d6c .be.able.to.syml 0x0a50: 696e 6b0a 746f 2066 696c 6573 2074 6865 ink.to.files.the 0x0a60: 7920 646f 6e27 7420 6f77 6e2e 3c2f 4c49 y.don't.own...
    .All.the 0x0a80: 2073 7461 6e64 6172 6420 6170 6163 6865 .standard.apache 0x0a90: 206d 6f64 756c 6573 2061 7265 2061 7661 .modules.are.ava 0x0aa0: 696c 6162 6c65 2077 6974 6820 7468 6973 ilable.with.this 0x0ab0: 2072 656c 6561 7365 2061 6e64 2061 7265 .release.and.are 0x0ac0: 0a6e 6f77 206d 616e 6167 6564 2077 6974 .now.managed.wit 0x0ad0: 6820 6465 6263 6f6e 662e 2020 5479 7065 h.debconf...Type 0x0ae0: 203c 5454 3e64 706b 672d 7265 636f 6e66 .dpkg-reconf 0x0af0: 6967 7572 6520 6170 6163 6865 3c2f 5454 igure.apache.to.select.whic 0x0b10: 6820 6d6f 6475 6c65 7320 796f 7520 7761 h.modules.you.wa 0x0b20: 6e74 2065 6e61 626c 6564 2e20 204d 616e nt.enabled...Man 0x0b30: 7920 6f74 6865 7220 6d6f 6475 6c65 7320 y.other.modules. 0x0b40: 6172 6520 6176 6169 6c61 626c 650a 7468 are.available.th 0x0b50: 726f 7567 6820 7468 6520 4465 6269 616e rough.the.Debian 0x0b60: 2070 6163 6b61 6765 2073 7973 7465 6d20 .package.system. 0x0b70: 7769 7468 2074 6865 206e 616d 6573 203c with.the.names.< 0x0b80: 5454 3e6c 6962 6170 6163 6865 2d6d 6f64 TT>libapache-mod 0x0b90: 2d2a 3c2f 5454 3e2e 0a49 6620 796f 7520 -*..If.you. 0x0ba0: 6e65 6564 2074 6f20 636f 6d70 696c 6520 need.to.compile. 0x0bb0: 6120 6d6f 6475 6c65 2079 6f75 7273 656c a.module.yoursel 0x0bc0: 662c 2079 6f75 2077 696c 6c20 6e65 6564 f,.you.will.need 0x0bd0: 2074 6f20 696e 7374 616c 6c20 7468 650a .to.install.the. 0x0be0: 3c54 543e 6170 6163 6865 2d64 6576 3c2f apache-dev.package...

    More.documentat 0x0c10: 696f 6e20 6f6e 2041 7061 6368 6520 6361 ion.on.Apache.ca 0x0c20: 6e20 6265 2066 6f75 6e64 206f 6e3a 0a3c n.be.found.on:.< 0x0c30: 554c 3e0a 3c4c 493e 0a54 6865 203c 4120 UL>.

  • .The.A 0x0c60: 7061 6368 6520 646f 6375 6d65 6e74 6174 pache.documentat 0x0c70: 696f 6e3c 2f41 3e20 7374 6f72 6564 206f ion.stored.o 0x0c80: 6e20 796f 7572 2073 6572 7665 722e 3c2f n.your.server...
  • .The.A 0x0cc0: 7061 6368 6520 5072 6f6a 6563 743c 2f41 pache.Project.home.site.
  • ..
  • .The.Apache-SSL. 0x0d20: 686f 6d65 2073 6974 652e 3c2f 4c49 3e0a home.site.
  • . 0x0d30: 0a3c 4c49 3e0a 5468 6520 3c41 2048 5245 .
  • .The.mod. 0x0d60: 7065 726c 3c2f 413e 2068 6f6d 6520 7369 perl.home.si 0x0d70: 7465 2e3c 2f4c 493e 0a0a 3c4c 493e 0a54 te.
  • ..
  • .T 0x0d80: 6865 203c 4120 4852 4546 3d22 6874 7470 he.ApacheWe 0x0db0: 656b 3c2f 413e 206e 6577 736c 6574 7465 ek.newslette 0x0dc0: 722e 3c2f 4c49 3e0a 0a3c 4c49 3e0a 5468 r.
  • ..
  • .Th 0x0dd0: 6520 3c41 2048 5245 463d 2268 7474 703a e.Debian.Pr 0x0e00: 6f6a 6563 740a 446f 6375 6d65 6e74 6174 oject.Documentat 0x0e10: 696f 6e3c 2f41 3e20 7768 6963 6820 636f ion.which.co 0x0e20: 6e74 6169 6e73 2048 4f57 544f 732c 2046 ntains.HOWTOs,.F 0x0e30: 4151 732c 2061 6e64 2073 6f66 7477 6172 AQs,.and.softwar 0x0e40: 6520 7570 6461 7465 732e 3c2f 4c49 3e0a e.updates.
  • . 0x0e50: 3c2f 554c 3e0a 0a3c 503e 596f 7520 6361 ..

    You.ca 0x0e60: 6e20 616c 736f 2063 6f6e 7375 6c74 2074 n.also.consult.t 0x0e70: 6865 206c 6973 7420 6f66 203c 4120 4852 he.list.of.World.Wide.Web. 0x0eb0: 4672 6571 7565 6e74 6c79 2041 736b 6564 Frequently.Asked 0x0ec0: 2051 7565 7374 696f 6e73 3c2f 413e 2066 .Questions.f 0x0ed0: 6f72 2069 6e66 6f72 6d61 7469 6f6e 2e0a or.information.. 0x0ee0: 0a3c 4832 3e4c 6574 206f 7468 6572 2070 .

    Let.other.p 0x0ef0: 656f 706c 6520 6b6e 6f77 2061 626f 7574 eople.know.about 0x0f00: 2074 6869 7320 7365 7276 6572 3c2f 4832 .this.server

    ..Netcraft.p 0x0f40: 726f 7669 6465 7320 616e 2069 6e74 6572 rovides.an.inter 0x0f50: 6573 7469 6e67 2066 7265 650a 7365 7276 esting.free.serv 0x0f60: 6963 6520 666f 7220 7765 6220 7369 7465 ice.for.web.site 0x0f70: 206d 6f6e 6974 6f72 696e 6720 616e 6420 .monitoring.and. 0x0f80: 7374 6174 6973 7469 6320 636f 6c6c 6563 statistic.collec 0x0f90: 7469 6f6e 2e0a 596f 7520 6361 6e20 6c65 tion..You.can.le 0x0fa0: 7420 7468 656d 206b 6e6f 7720 6162 6f75 t.them.know.abou 0x0fb0: 7420 796f 7572 2073 6572 7665 7220 7573 t.your.server.us 0x0fc0: 696e 6720 7468 6569 720a 3c41 2048 5245 ing.their. 0x0ff0: 696e 7465 7266 6163 653c 2f41 3e2e 0a45 interface..E 0x1000: 6e61 626c 696e 6720 7468 6520 6d6f 6e69 nabling.the.moni 0x1010: 746f 7269 6e67 206f 6620 796f 7572 2073 toring.of.your.s 0x1020: 6572 7665 7220 7769 6c6c 2070 726f 7669 erver.will.provi 0x1030: 6465 2061 2062 6574 7465 7220 676c 6f62 de.a.better.glob 0x1040: 616c 206f 7665 7276 6965 770a 6f66 2077 al.overview.of.w 0x1050: 686f 2069 7320 7573 696e 6720 7768 6174 ho.is.using.what 0x1060: 2061 6e64 2077 6865 7265 2c20 616e 6420 .and.where,.and. 0x1070: 6974 2077 6f75 6c64 2067 6976 6520 4465 it.would.give.De 0x1080: 6269 616e 2061 2062 6574 7465 720a 6f76 bian.a.better.ov 0x1090: 6572 7669 6577 206f 6620 7468 6520 6170 erview.of.the.ap 0x10a0: 6163 6865 2070 6163 6b61 6765 2075 7361 ache.package.usa 0x10b0: 6765 2e0a 0a3c 4832 3e41 626f 7574 2074 ge...

    About.t 0x10c0: 6869 7320 7061 6765 3c2f 4832 3e0a 0a3c his.page

    ..< 0x10d0: 494d 4720 414c 4947 4e3d 2272 6967 6874 IMG.ALIGN="right 0x10e0: 2220 414c 543d 2222 2048 4549 4748 543d ".ALT="".HEIGHT= 0x10f0: 2232 3437 2220 5749 4454 483d 2232 3738 "247".WIDTH="278 0x1100: 2220 5352 433d 2269 636f 6e73 2f6a 6865 ".SRC="icons/jhe 0x1110: 3036 312e 706e 6722 3e0a 0a3c 503e 5468 061.png">..

    Th 0x1120: 6973 2069 7320 6120 706c 6163 6568 6f6c is.is.a.placehol 0x1130: 6465 7220 7061 6765 2069 6e73 7461 6c6c der.page.install 0x1140: 6564 2062 7920 7468 6520 3c41 0a48 5245 ed.by.the.Debia 0x1170: 6e3c 2f41 3e0a 7265 6c65 6173 6520 6f66 n.release.of 0x1180: 2074 6865 2061 7061 6368 6520 5765 6220 .the.apache.Web. 0x1190: 7365 7276 6572 2070 6163 6b61 6765 2e0a server.package.. 0x11a0: 0a3c 503e 5468 6973 2063 6f6d 7075 7465 .

    This.compute 0x11b0: 7220 6861 7320 696e 7374 616c 6c65 6420 r.has.installed. 0x11c0: 7468 6520 4465 6269 616e 2047 4e55 2f4c the.Debian.GNU/L 0x11d0: 696e 7578 206f 7065 7261 7469 6e67 2073 inux.operating.s 0x11e0: 7973 7465 6d2c 0a62 7574 2069 7420 6861 ystem,.but.it.ha 0x11f0: 7320 3c73 7472 6f6e 673e 6e6f 7468 696e s.nothin 0x1200: 6720 746f 2064 6f20 7769 7468 2074 6865 g.to.do.with.the 0x1210: 2044 6562 6961 6e0a 5072 6f6a 6563 743c .Debian.Project< 0x1220: 2f73 7472 6f6e 673e 2e20 506c 6561 7365 /strong>..Please 0x1230: 2064 6f20 3c73 7472 6f6e 673e 6e6f 743c .do.not< 0x1240: 2f73 7472 6f6e 673e 2063 6f6e 7461 6374 /strong>.contact 0x1250: 2074 6865 2044 6562 6961 6e0a 5072 6f6a .the.Debian.Proj 0x1260: 6563 7420 6162 6f75 7420 6974 2e3c 2f50 ect.about.it.

    ..

    If.you.fin 0x1280: 6420 6120 6275 6720 696e 2074 6869 7320 d.a.bug.in.this. 0x1290: 6170 6163 6865 2070 6163 6b61 6765 2c20 apache.package,. 0x12a0: 6f72 2069 6e20 4170 6163 6865 2069 7473 or.in.Apache.its 0x12b0: 656c 662c 0a70 6c65 6173 6520 6669 6c65 elf,.please.file 0x12c0: 2061 2062 7567 2072 6570 6f72 7420 6f6e .a.bug.report.on 0x12d0: 2069 742e 2020 496e 7374 7275 6374 696f .it...Instructio 0x12e0: 6e73 206f 6e20 646f 696e 6720 7468 6973 ns.on.doing.this 0x12f0: 2c20 616e 6420 7468 650a 6c69 7374 206f ,.and.the.list.o 0x1300: 6620 3c41 2048 5245 463d 2268 7474 703a f.kn 0x1330: 6f77 6e20 6275 6773 3c2f 413e 206f 6620 own.bugs.of. 0x1340: 7468 6973 0a70 6163 6b61 6765 2c20 6361 this.package,.ca 0x1350: 6e20 6265 2066 6f75 6e64 2069 6e20 7468 n.be.found.in.th 0x1360: 6520 0a3c 4120 4852 4546 3d22 6874 7470 e..Debian.Bug.Tra 0x13a0: 636b 696e 6720 5379 7374 656d 3c2f 413e cking.System 0x13b0: 2e0a 0a3c 503e 5468 616e 6b73 2066 6f72 ...

    Thanks.for 0x13c0: 2075 7369 6e67 2074 6869 7320 7061 636b .using.this.pack 0x13d0: 6167 652c 2061 6e64 2063 6f6e 6772 6174 age,.and.congrat 0x13e0: 756c 6174 696f 6e73 2066 6f72 2079 6f75 ulations.for.you 0x13f0: 7220 6368 6f69 6365 206f 660a 6120 4465 r.choice.of.a.De 0x1400: 6269 616e 2073 7973 7465 6d21 3c2f 503e bian.system!

    0x1410: 0a0a 3c44 4956 2061 6c69 676e 3d22 6365 ........ 0x1520: 3c2f 613e 0a3c 2f44 4956 3e0a 0a3c 212d ..... 0x15f0: 0a3c 2f48 544d 4c3e 0a .. 23:57:35.941260 IP 127.0.0.1.55920 > 127.0.0.1.80: . ack 5560 win 12383 0x0000: 0000 0000 0000 0000 0000 0000 0800 4500 ..............E. 0x0010: 0034 1b6e 4000 4006 2154 7f00 0001 7f00 .4.n@.@.!T...... 0x0020: 0001 da70 0050 3758 8a49 377a a3a9 8010 ...p.P7X.I7z.... 0x0030: 305f 10ea 0000 0101 080a 4ddc 9219 4ddc 0_........M...M. 0x0040: 9219 .. 23:57:37.229575 IP 127.0.0.1.55920 > 127.0.0.1.80: F 203:203(0) ack 5560 win 12383 0x0000: 0000 0000 0000 0000 0000 0000 0800 4500 ..............E. 0x0010: 0034 1b70 4000 4006 2152 7f00 0001 7f00 .4.p@.@.!R...... 0x0020: 0001 da70 0050 3758 8a49 377a a3a9 8011 ...p.P7X.I7z.... 0x0030: 305f 0be1 0000 0101 080a 4ddc 9721 4ddc 0_........M..!M. 0x0040: 9219 .. 23:57:37.230839 IP 127.0.0.1.80 > 127.0.0.1.55920: F 5560:5560(0) ack 204 win 8192 0x0000: 0000 0000 0000 0000 0000 0000 0800 4500 ..............E. 0x0010: 0034 1fe8 4000 4006 1cda 7f00 0001 7f00 .4..@.@......... 0x0020: 0001 0050 da70 377a a3a9 3758 8a4a 8011 ...P.p7z..7X.J.. 0x0030: 2000 1735 0000 0101 080a 4ddc 9723 4ddc ...5......M..#M. 0x0040: 9721 .! 23:57:37.230900 IP 127.0.0.1.55920 > 127.0.0.1.80: . ack 5561 win 12383 0x0000: 0000 0000 0000 0000 0000 0000 0800 4500 ..............E. 0x0010: 0034 1b72 4000 4006 2150 7f00 0001 7f00 .4.r@.@.!P...... 0x0020: 0001 da70 0050 3758 8a4a 377a a3aa 8010 ...p.P7X.J7z.... 0x0030: 305f 06d4 0000 0101 080a 4ddc 9723 4ddc 0_........M..#M. 0x0040: 9723 .# tcpdump-3.9.8/./tests/esp3.new0000644000026300017500000000237010320056212014206 0ustar mcrmcrIP 192.1.2.23 > 192.1.2.45: ESP(spi=0x12345678,seq=0x1), length 116: IP 192.0.2.1 > 192.0.1.1: ICMP echo request, id 28416, seq 1280, length 64 (ipip-proto-4) IP 192.1.2.23 > 192.1.2.45: ESP(spi=0x12345678,seq=0x2), length 116: IP 192.0.2.1 > 192.0.1.1: ICMP echo request, id 28416, seq 1536, length 64 (ipip-proto-4) IP 192.1.2.23 > 192.1.2.45: ESP(spi=0x12345678,seq=0x3), length 116: IP 192.0.2.1 > 192.0.1.1: ICMP echo request, id 28416, seq 1792, length 64 (ipip-proto-4) IP 192.1.2.23 > 192.1.2.45: ESP(spi=0x12345678,seq=0x4), length 116: IP 192.0.2.1 > 192.0.1.1: ICMP echo request, id 28416, seq 2048, length 64 (ipip-proto-4) IP 192.1.2.23 > 192.1.2.45: ESP(spi=0x12345678,seq=0x5), length 116: IP 192.0.2.1 > 192.0.1.1: ICMP echo request, id 28416, seq 2304, length 64 (ipip-proto-4) IP 192.1.2.23 > 192.1.2.45: ESP(spi=0x12345678,seq=0x6), length 116: IP 192.0.2.1 > 192.0.1.1: ICMP echo request, id 28416, seq 2560, length 64 (ipip-proto-4) IP 192.1.2.23 > 192.1.2.45: ESP(spi=0x12345678,seq=0x7), length 116: IP 192.0.2.1 > 192.0.1.1: ICMP echo request, id 28416, seq 2816, length 64 (ipip-proto-4) IP 192.1.2.23 > 192.1.2.45: ESP(spi=0x12345678,seq=0x8), length 116: IP 192.0.2.1 > 192.0.1.1: ICMP echo request, id 28416, seq 3072, length 64 (ipip-proto-4) tcpdump-3.9.8/./tests/mpls-ldp-hello.sh0000755000026300017500000000034110225052111016003 0ustar mcrmcr#!/bin/sh uudecode mpls-ldp-hello.puu echo -n test mpls-ldp-hello ... ../tcpdump -t -n -v -r mpls-ldp-hello.pcap >mpls-ldp-hello.new if diff mpls-ldp-hello.new mpls-ldp-hello.out then echo passed. else echo failed. fi tcpdump-3.9.8/./tests/isis-infinite-loop.pcap0000644000026300017500000000070610233757631017230 0ustar mcrmcrÔò¡`qŒÕoB0‘FFÎ*E6@@/y@ýx7À¨þƒÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿŒÕoB1`FFÎ*E6@@/üõê°‘IÀ¨þƒÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿŒÕoBrJFFÎ*E6@@/Ä8á[Ó[À¨þƒÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿŒÕoB°4FFÎ*E6@€/†ý Ä.À¨þƒÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿŒÕoBõFFÎ*E6@€/”úöµ­?À¨þƒÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿtcpdump-3.9.8/./tests/bgp-infinite-loop.pcap0000644000026300017500000000105210233757630017023 0ustar mcrmcrÔò¡`qdÕoBFY ZZÎ*EJ»@€>ÍÄ;0AÀ¨7†³“;¤+ ’mP ¾Áÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ„dÕoB»8 ZZÎ*EJš@@™yëeZ À¨ê²³/B“gðPt-ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ„dÕoBû"ZZÎ*EJ©C@€nû³nmWÀ¨Ÿè³³°CYPn4PØ-ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ„dÕoB> ZZÎ*EJÇŠ@@®4rãbÀ¨õ³B™¢pá6YXP´Vÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ„eÕoB3µZZÎ*EJÇŠ@@®4rãbÀ¨õ³B™¢pá6YXP´Vÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ„tcpdump-3.9.8/./tests/CVS/0000755000026300017500000000000010504040016013251 5ustar mcrmcrtcpdump-3.9.8/./tests/CVS/Entries0000644000026300017500000001032610504040016014607 0ustar mcrmcr/.cvsignore/1.6/Wed Apr 6 21:27:33 2005//Ttcpdump_3_9 /02-sunrise-sunset-esp.puu/1.1/Tue Feb 25 04:35:57 2003//Ttcpdump_3_9 /08-sunrise-sunset-aes.puu/1.1/Mon Apr 5 00:09:36 2004//Ttcpdump_3_9 /08-sunrise-sunset-esp2.puu/1.1/Wed Feb 26 03:21:46 2003//Ttcpdump_3_9 /alltests.sh/1.1/Mon Mar 29 17:30:26 2004//Ttcpdump_3_9 /bgp-infinite-loop.pcap/1.1.4.1/Wed Apr 27 18:53:12 2005/-kb/Ttcpdump_3_9 /bgp_vpn_attrset.pcap/1.1/Thu Jan 8 07:21:20 2004/-kb/Ttcpdump_3_9 /bgp_vpn_attrset.sh/1.2/Mon Mar 29 17:30:12 2004//Ttcpdump_3_9 /chdlc-slarp-short.pcap/1.1.2.1/Wed Apr 27 14:34:25 2005/-kb/Ttcpdump_3_9 /chdlc-slarp.pcap/1.1.2.1/Wed Apr 27 14:50:45 2005/-kb/Ttcpdump_3_9 /eapon1.gdbinit/1.1/Thu Mar 25 03:29:20 2004//Ttcpdump_3_9 /eapon1.puu/1.1/Thu Mar 25 03:29:20 2004//Ttcpdump_3_9 /eapon2.puu/1.1/Thu Mar 25 03:29:21 2004//Ttcpdump_3_9 /esp-secrets.txt/1.2/Mon Apr 5 00:09:36 2004//Ttcpdump_3_9 /esp0.sh/1.1/Wed Feb 26 04:20:09 2003//Ttcpdump_3_9 /esp1.gdbinit/1.1/Tue Feb 25 04:35:57 2003//Ttcpdump_3_9 /esp1.sh/1.3/Wed Apr 6 21:27:35 2005//Ttcpdump_3_9 /esp2.gdbinit/1.1/Wed Feb 26 03:21:47 2003//Ttcpdump_3_9 /esp2.sh/1.3/Wed Apr 6 21:27:35 2005//Ttcpdump_3_9 /esp3.gdbinit/1.1/Wed Feb 26 04:44:34 2003//Ttcpdump_3_9 /esp3.sh/1.2/Wed Apr 6 21:27:35 2005//Ttcpdump_3_9 /esp4.gdbinit/1.1/Wed Feb 26 04:44:34 2003//Ttcpdump_3_9 /esp4.sh/1.2/Wed Apr 6 21:27:35 2005//Ttcpdump_3_9 /esp5.gdbinit/1.1/Mon Apr 5 00:09:37 2004//Ttcpdump_3_9 /esp5.sh/1.2/Wed Apr 6 21:27:35 2005//Ttcpdump_3_9 /espudp1.puu/1.1/Wed Apr 6 21:58:33 2005//Ttcpdump_3_9 /espudp1.sh/1.1/Wed Apr 6 21:58:33 2005//Ttcpdump_3_9 /isakmp-delete-segfault.puu/1.1/Tue Jan 6 04:00:15 2004//Ttcpdump_3_9 /isakmp-identification-segfault.puu/1.1/Tue Mar 23 16:26:48 2004//Ttcpdump_3_9 /isakmp-pointer-loop.puu/1.1/Tue Jan 6 04:00:15 2004//Ttcpdump_3_9 /isakmp1.sh/1.1/Tue Jan 6 04:00:15 2004//Ttcpdump_3_9 /isakmp2.sh/1.1/Tue Jan 6 04:00:16 2004//Ttcpdump_3_9 /isakmp3.sh/1.2/Wed Apr 6 21:27:36 2005//Ttcpdump_3_9 /isakmp4.sh/1.2/Thu Apr 7 00:20:51 2005//Ttcpdump_3_9 /isakmp4500.puu/1.1/Wed Apr 6 21:58:33 2005//Ttcpdump_3_9 /isis-infinite-loop.pcap/1.1.4.1/Wed Apr 27 18:53:13 2005/-kb/Ttcpdump_3_9 /ldp-infinite-loop.pcap/1.1.4.1/Wed Apr 27 18:53:13 2005/-kb/Ttcpdump_3_9 /lmp.puu/1.1/Wed Apr 6 21:26:57 2005//Ttcpdump_3_9 /lmp.sh/1.2/Wed Apr 6 21:27:36 2005//Ttcpdump_3_9 /lspping-fec-ldp.pcap/1.1/Wed Jun 16 08:39:15 2004/-kb/Ttcpdump_3_9 /lspping-fec-rsvp.pcap/1.1/Wed Jun 16 08:39:16 2004/-kb/Ttcpdump_3_9 /mpls-ldp-hello.puu/1.1/Wed Apr 6 21:26:58 2005//Ttcpdump_3_9 /mpls-ldp-hello.sh/1.2/Wed Apr 6 21:27:37 2005//Ttcpdump_3_9 /mpls-traceroute.pcap/1.1/Mon Jun 14 15:13:00 2004/-kb/Ttcpdump_3_9 /ospf-gmpls.puu/1.1/Wed Apr 6 21:26:59 2005//Ttcpdump_3_9 /ospf-gmpls.sh/1.2/Wed Apr 6 21:27:37 2005//Ttcpdump_3_9 /rsvp-infinite-loop.pcap/1.1.4.1/Wed Apr 27 18:53:13 2005/-kb/Ttcpdump_3_9 /esp0.out/1.3/Sun Oct 2 22:15:31 2005/-ko/Ttcpdump_3_9 /isakmp1.out/1.1/Sun Oct 2 22:15:31 2005/-ko/Ttcpdump_3_9 /isakmp2.out/1.1/Sun Oct 2 22:15:31 2005/-ko/Ttcpdump_3_9 /isakmp3.out/1.3/Sun Oct 2 22:15:31 2005/-ko/Ttcpdump_3_9 /isakmp4.out/1.1/Sun Oct 2 22:15:31 2005/-ko/Ttcpdump_3_9 /lmp.out/1.1/Sun Oct 2 22:15:31 2005/-ko/Ttcpdump_3_9 /bgp_vpn_attrset.out/1.3.2.1/Sun Oct 2 22:17:39 2005/-ko/Ttcpdump_3_9 /eapon1.out/1.2.2.1/Sun Oct 2 22:17:40 2005/-ko/Ttcpdump_3_9 /eapon1.sh/1.1.4.1/Sun Oct 2 22:17:40 2005//Ttcpdump_3_9 /esp1.out/1.3.2.1/Sun Oct 2 22:17:40 2005/-ko/Ttcpdump_3_9 /esp2.out/1.3.2.1/Sun Oct 2 22:17:40 2005/-ko/Ttcpdump_3_9 /esp5.out/1.2.2.1/Sun Oct 2 22:17:41 2005/-ko/Ttcpdump_3_9 /espudp1.out/1.1.2.1/Sun Oct 2 22:17:41 2005/-ko/Ttcpdump_3_9 /mpls-ldp-hello.out/1.3.2.1/Sun Oct 2 22:17:41 2005/-ko/Ttcpdump_3_9 /ospf-gmpls.out/1.3.2.1/Sun Oct 2 22:17:41 2005/-ko/Ttcpdump_3_9 /print-A.out/1.2.2.1/Sun Oct 2 22:17:41 2005/-ko/Ttcpdump_3_9 /print-AA.out/1.2.2.1/Sun Oct 2 22:17:42 2005/-ko/Ttcpdump_3_9 /print-flags.puu/1.1.2.1/Sun Oct 2 22:12:53 2005//Ttcpdump_3_9 /print-flags.sh/1.2.2.1/Sun Oct 2 22:12:53 2005//Ttcpdump_3_9 /print-x.out/1.2.2.1/Sun Oct 2 22:17:42 2005/-ko/Ttcpdump_3_9 /print-xx.out/1.2.2.1/Sun Oct 2 22:17:42 2005/-ko/Ttcpdump_3_9 /print-capX.out/1.1.2.2/Tue Sep 19 19:07:58 2006/-ko/Ttcpdump_3_9 /print-capXX.out/1.1.2.2/Tue Sep 19 19:07:58 2006/-ko/Ttcpdump_3_9 D tcpdump-3.9.8/./tests/CVS/Root0000644000026300017500000000004010245647660014135 0ustar mcrmcrcvs.tcpdump.org:/tcpdump/master tcpdump-3.9.8/./tests/CVS/Repository0000644000026300017500000000001610245647660015374 0ustar mcrmcrtcpdump/tests tcpdump-3.9.8/./tests/CVS/Tag0000644000026300017500000000001510245647662013731 0ustar mcrmcrTtcpdump_3_9 tcpdump-3.9.8/./tests/isakmp2.out0000644000026300017500000000010410320056003014707 0ustar mcrmcrIP 129.170.249.126.500 > 129.170.249.87.500: isakmp: phase 1 ? base tcpdump-3.9.8/./tests/ospf-gmpls.puu0000644000026300017500000000162610225052043015450 0ustar mcrmcrbegin 644 ospf-gmpls.pcap MU,.RH0(`!````````````'81````````KME#X`?``"`&0``0`!`0`````"``0*__5%``,` M!`H)C@$`!``$"@F.`@`%``0````_``8`!$R44,``!P`$3)10P``(`"!,E%#` M3)10P$R44,!,E%#`3)10P$R44,!,E%#`3)10P``)``0`````Y-EO’ëCg¾(ÜÚvÞóƒ©Û_’8|ù3Øäªvߊ?åhMÚN=¹’ÁÔ~Ë[]NÂTøhs¡,ïò=Nu C w4U,dÑ8=^±(oÛf)••óÁwÍ]/nQ &IÊw'ët¹>SÑôåž·†·âû~r¬â|j4¸O@³ÙZZÞ­ºdd#EL@@´‰ÀÀþ””8ÇÄž‰ò8¼ t5|ãѤ¿,Âc¥}-ϵŒYÀnøZ®Kâ®æ4B‡¡T¨Ü)·«VEÜ_V—FdÖ)ÒƒÇí£>æ™·e|J*Á’^„“+€ƒ tÞCèZèB–¦-ã93™A5Ér&ÛCQ­.†{ÚÃ~ .>'à‹^_‰‹ÌKñîTõL ·ðejÇ4…I_[OÚ›–Œ5ÇŤ0Šdüu¾Hz f„ ‡vDÌô´ûiˆcoåôw! ‡Ë·N>ˆ®ZJf(ÈãX1JuGmÛöÅÎ9ekb3tÏ;U‹2jžD"¥(Wxp¨šÆñùëî3  Æ@¯»X—‚$ISl%ÕЩÄŠ0ýÕK ©¥7ˆÚÚdd#Þ­ºEÌ@?µ ÀþÀ””¸Ý8ž‰ò8¼ t5|ãѤ¿ ‹~‰G¬qéºsðœæYçH– •ð˜T ÿÆ>à‘ì‡E/Xm©˜HDðLíb÷µ4£$¤)©m>2s˜LtLçüŽ€ûcÆüÛóW”çs†ð@ŸPj_ôÌ’9õmèþ~ä Ê´qšø þ„kL4“Ò¥}~0Ì*peþó¤my¿nO¶ aŠ##‹¡¾s¤t`¥‰ö¿)c!€µÃ³Éü1\3ßSî ¦i‚Mó‹l‚­ýøÛ«ý¼vUI"º½w‡ÒY9²È@*Á#Š„G¿£œßÝòEHÔFks‹»¸†¯£Çiïa~âƒêVÒŠ74^˜ ((ïøîà¯û³c-´•xåØ}Z8–Jd´m>9D_˜8£UíUˆÝ¯`í“©£BKìϬéÿÖ!j|±4ƒ˜Ú­_PޱGø=‡g*¹¡qí(¨Õ’Ks¨ wKëlŠ—ÿ½Ç%ŒvGåüÔÎk\yFËÿN0Ä ¾=—ÔsâKÞ¥"ÍJÐz‡sƒϪïáÑN.FÎxŠŠÞ­ºdd#E|@@´YÀÀþ””hÊò8¼ t5|ãѤ¿ ‹~‰G\­hk”Å÷E’Û]qj”Ã(¦Z*µÜ•½êìD^ýSì¨1Ž?yª3Œ§ñÊMCÉþRÉ at+Oföjá ‚x@Ç#«0vz"9¼‡ïŠsp|x]NPÇJžŶK¥iòÛ-ÿ/C3y¥ÏJ¾„ä÷l\”ìd´xwÒ" ¦CÝ-+û#È1oÔövÅqK‰§'éIB¦‘‡€*PYSÿŸ~YÑÁÈÙnäVCL$iZß?aŽnzŸÄen[ÃðU×'"¥•=ì!Qdíä­QØ]ñÚÄËBºÊåÛw]$NàÄQpaëí£Ü×é~­†Åy¿x¯W¹ ý‰Qb&¬–B5žê—*3•aV„…¯ H4B]±gRÛ/{”R¹Œb¡=…!”ñ^l#/Fbbdd#Þ­ºET@?¶ÀþÀ””@¯ž‰ò8¼ t5|ãѤ¿ ‹~‰G4%;1†h설sZ³ørZ=çª 9$¤®®dd#Þ­ºE ª´?KÀþÀ””ŒôÜ åüä ÄQ7Ýš.¨oG>>ây¸¡I>úÈŠèmü@}L– Fl·r«9†c®Ñg0ã$ѯ-â Ôxòª;;;×$‰.¡X5\MŒ›n|j¿[­‰›GO,h ð­m_ýý6£:ûXó™üBâek= L„îK“̰ör**Þ­ºdd#dd#ÀÀþ**dd#Þ­ºÞ­ºÀþdd#ÀŠŠÞ­ºdd#E|@@´YÀÀþ””hÊò8¼ t5|ãѤ¿ ‹~‰G\­hk”Å÷E’Û]qj”Ã(¦Z*µÜ•½êìD^ýSì¨1Ž?yª3Œ§ñÊMCÉþRÉ at+Oföjá ‚x@Ç#«0vz"9¼‡ïŠsp|x]NPÇJžŶK¥iòÛ-ÿ/C3y¥ÏJ¾„ä÷l\”ìd´xwÒ" ¦CÝ-+û#È1oÔövÅqK‰§'éIB¦‘‡€*PYSÿŸ~YÑÁÈÙnäVCL$iZß?aŽnzŸÄen[ÃðU×'"¥•=ì!Qdíä­QØ]ñÚÄËBºÊåÛw]$NàÄQpaëí£Ü×é~­†Åy¿x¯W¹ ý‰Qb&¬–B5žê—*3•aV„…¯ H4B]±gRÛ/{”R¹Œb¡=…!”ñ^l#/Fbbdd#Þ­ºET@?¶ÀþÀ””@¯ž‰ò8¼ t5|ãѤ¿ ‹~‰G4%;1†h설sZ³ørZ=çª 9$¤®®dd#Þ­ºE ªµ?K€ÀþÀ””ŒôÜ åm_ýý6£:ûXó™üBâeºõ?"ä _²x‰x%ê;wh¿¡P]iG’|:õ"ôЄ¸ÏÌÝK¾ûàå¡7äë“âhdI•/v­Rü—øÀ>Ú[Û¨àÛšiÊØa^@«ÄѯáÉHžì³=b…Á‡ây>•Ìxâæ0—Q++dd#Þ­ºE@?¶¸ÀþÀ”” X›ÿ®®dd#Þ­ºE ª¶?KÀþÀ””ŒôÜ å^@«ÄѯáÉHžì³=b…ÁkM“»jŸRr§¹aL›$?šÍ-Gäô)kð™3@³8SX’O¼ya>¦vVWŽ hw§È£·?eR€ð-Ê¢>7qÍ%©Šç’ ëmñ`å2¬A×ë,¾(ÖX“¦&Ø\Ï5ŠŠÞ­ºdd#E|@@´YÀÀþ””hÊò8¼ t5|ãѤ¿ ‹~‰G\­hk”Å÷E’Û]qj”Ã(¦Z*µÜ•½êìD^ýSì¨1Ž?yª3Œ§ñÊMCÉþRÉ at+Oföjá ‚x@Ç#«0vz"9¼‡ïŠsp|x]NPÇJžŶK¥iòÛ-ÿ/C3y¥ÏJ¾„ä÷l\”ìd´xwÒ" ¦CÝ-+û#È1oÔövÅqK‰§'éIB¦‘‡€*PYSÿŸ~YÑÁÈÙnäVCL$iZß?aŽnzŸÄen[ÃðU×'"¥•=ì!Qdíä­QØ]ñÚÄËBºÊåÛw]$NàÄQpaëí£Ü×é~­†Åy¿x¯W¹ ý‰Qb&¬–B5žê—*3•aV„…¯ H4B]±gRÛ/{”R¹Œb¡=…!”ñ^l#/Fbbdd#Þ­ºET@?¶ÀþÀ””@¯ž‰ò8¼ t5|ãѤ¿ ‹~‰G4%;1†h설sZ³ørZ=çª 9$¤®®dd#Þ­ºE ª·?K~ÀþÀ””ŒôÜ å ëmñ`å2¬A×ë,¾‰¸ Å¢MÁí?Ø×Ax:ܘ´ßH¯wþU`°7Òžˆ·-øRg9œ„¹V«õúüôÍmÅ®1ÂÖ=y‰ÇÚ7,}­hJÏu­©6«‹ãç( h·tÏo3'EM”=oо‚•_Ì++dd#Þ­ºE@?¶¸ÀþÀ”” X›ÿ®®dd#Þ­ºE ª¸?K}ÀþÀ””ŒôÜ å6«‹ãç( h·tÏo3'ŽžàÎa¾“÷Gø³]«…¶÷Ó¨´|¥×¯5̾¢žµ4Ðx`÷PʪòeμNˆÿ¾¦xœ†7í‚fͺBmfí½ðS¾J(ðñ’Á<•±Kœ}`dKvH œ¶ûP¢`ÕL—Š7´²ú³é¼$裀²øÆ{ìb¨ÿÆÇt**Þ­ºdd#dd#ÀÀþ**dd#Þ­ºÞ­ºÀþdd#À++dd#Þ­ºE@?¶¸ÀþÀ”” X›ÿzzÞ­ºdd#El@@µiÀÀþ””XÉÞ‰ò8¼ t5|ãѤ¿½ÆOLÿÓÏ‘#Çȧhñ’jI æ€ïœÔ‡FB?Nj(¯uð¯‡GžÑ¯ùnçtcpdump-3.9.8/./tests/print-A.new0000644000026300017500000001660610320056212014655 0ustar mcrmcr23:57:35.938066 IP 127.0.0.1.55920 > 127.0.0.1.80: S 928549246:928549246(0) win 32767 E..<.h@.@.!R.........p.P7X.~.........!....@.... M........... 23:57:35.938122 IP 127.0.0.1.80 > 127.0.0.1.55920: S 930778609:930778609(0) ack 928549247 win 32767 E..<..@.@.<..........P.p7z..7X......n.....@.... M...M....... 23:57:35.938167 IP 127.0.0.1.55920 > 127.0.0.1.80: . ack 1 win 8192 E..4.j@.@.!X.........p.P7X..7z.... .7...... M...M... 23:57:35.939423 IP 127.0.0.1.55920 > 127.0.0.1.80: P 1:203(202) ack 1 win 8192 E....l@.@. ..........p.P7X..7z.... ........ M...M...GET / HTTP/1.1 Host: localhost User-Agent: ELinks/0.10.4-7-debian (textmode; Linux 2.6.11-1-686-smp i686; 132x56-2) Accept: */* Accept-Encoding: gzip Accept-Language: en Connection: Keep-Alive 23:57:35.940474 IP 127.0.0.1.80 > 127.0.0.1.55920: . ack 203 win 8192 E..4..@.@............P.p7z..7X.I.. .7...... M...M... 23:57:35.941232 IP 127.0.0.1.80 > 127.0.0.1.55920: P 1:5560(5559) ack 203 win 8192 E.....@.@..%.........P.p7z..7X.I.. ........ M...M...HTTP/1.1 200 OK Date: Wed, 06 Jul 2005 03:57:35 GMT Server: Apache/1.3.33 Last-Modified: Sun, 15 Aug 2004 00:43:41 GMT ETag: "6e80f0-148a-411eb1bd" Accept-Ranges: bytes Content-Length: 5258 Keep-Alive: timeout=15, max=100 Connection: Keep-Alive Content-Type: text/html; charset=iso-8859-1 Placeholder page

    Placeholder page

    If you are just browsing the web

    The owner of this web site has not put up any web pages yet. Please come back later.

    Move along, nothing to see here... :-)

    If you are trying to locate the administrator of this machine

    If you want to report something about this host's behavior, please contact the Internet Service Provider (ISP) involved directly.

    See the Network Abuse Clearinghouse for how to do this.

    If you are the administrator of this machine

    The initial installation of Debian's apache web server package was successful.

    You should replace this page with your own web pages as soon as possible.

    Unless you changed its configuration, your new server is configured as follows:

    • Configuration files can be found in /etc/apache.
    • The DocumentRoot, which is the directory under which all your HTML files should exist, is set to /var/www.
    • CGI scripts are looked for in /usr/lib/cgi-bin, which is where Debian packages will place their scripts.
    • Log files are placed in /var/log/apache, and will be rotated weekly. The frequency of rotation can be easily changed by editing /etc/logrotate.d/apache.
    • The default directory index is index.html, meaning that requests for a directory /foo/bar/ will give the contents of the file /var/www/foo/bar/index.html if it exists (assuming that /var/www is your DocumentRoot).
    • User directories are enabled, and user documents will be looked for in the public_html directory of the users' homes. These dirs should be under /home, and users will not be able to symlink to files they don't own.
    All the standard apache modules are available with this release and are now managed with debconf. Type dpkg-reconfigure apache to select which modules you want enabled. Many other modules are available through the Debian package system with the names libapache-mod-*. If you need to compile a module yourself, you will need to install the apache-dev package.

    More documentation on Apache can be found on:

    You can also consult the list of World Wide Web Frequently Asked Questions for information.

    Let other people know about this server

    Netcraft provides an interesting free service for web site monitoring and statistic collection. You can let them know about your server using their interface. Enabling the monitoring of your server will provide a better global overview of who is using what and where, and it would give Debian a better overview of the apache package usage.

    About this page

    This is a placeholder page installed by the Debian release of the apache Web server package.

    This computer has installed the Debian GNU/Linux operating system, but it has nothing to do with the Debian Project. Please do not contact the Debian Project about it.

    If you find a bug in this apache package, or in Apache itself, please file a bug report on it. Instructions on doing this, and the list of known bugs of this package, can be found in the Debian Bug Tracking System.

    Thanks for using this package, and congratulations for your choice of a Debian system!

    23:57:35.941260 IP 127.0.0.1.55920 > 127.0.0.1.80: . ack 5560 win 12383 E..4.n@.@.!T.........p.P7X.I7z....0_....... M...M... 23:57:37.229575 IP 127.0.0.1.55920 > 127.0.0.1.80: F 203:203(0) ack 5560 win 12383 E..4.p@.@.!R.........p.P7X.I7z....0_....... M..!M... 23:57:37.230839 IP 127.0.0.1.80 > 127.0.0.1.55920: F 5560:5560(0) ack 204 win 8192 E..4..@.@............P.p7z..7X.J.. ..5..... M..#M..! 23:57:37.230900 IP 127.0.0.1.55920 > 127.0.0.1.80: . ack 5561 win 12383 E..4.r@.@.!P.........p.P7X.J7z....0_....... M..#M..# tcpdump-3.9.8/./tests/isakmp3.out0000644000026300017500000000225110320056003014715 0ustar mcrmcrIP (tos 0x0, ttl 255, id 41068, offset 0, flags [none], proto: UDP (17), length: 312) 127.0.0.1.501 > 127.0.0.1.500: isakmp 1.0 msgid : phase 1 I ident: (id: idtype=FQDN protoid=0 port=0 len=248 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000) tcpdump-3.9.8/./tests/08-sunrise-sunset-esp2.puu0000644000026300017500000000473407627031312017477 0ustar mcrmcrbegin 644 08-sunrise-sunset-esp2.pcap MU,.RH0(`!``````````````&```!``````````````#.````S@```!```&1D M11```&1D(P@`10``P"E-``!`,LQXP`$"%\`!`BT2-%9X`````4=!+\5+F8`+ M[[NOU-#98*AO5\780X[VDXF@2W8<10:J!'!Z!-[7N4CFNRKIH;PUA1SL"Y9\ M-?_3N_,W/@*T+C/"]=S[`;D!/;`SR5,3+><9K.^\9N><18TY9Z\!I\S./L8R MFE53,S6Y5X_Z\(T)ZIUS?X$8>&(_MT1"!SV:VPP!\XU$[3S-5L)4-O"&>]`Z M1:./61=%C6`6U1/65"A&KUE902]*``````````#.````S@```!```&1D11`` M`&1D(P@`10``P"E/``!`,LQVP`$"%\`!`BT2-%9X`````CIU^SX%;G^!GUSP MSA ML7P6FM81),N>T/1Z'"P7H5;```````````#.````S@```!```&1D11```&1D M(P@`10``P"E1``!`,LQTP`$"%\`!`BT2-%9X`````R4)-P&F>HPK/?_$MTFC M^TOO=/L#W_APTK6MIH_BC*I7\L<,9(?/0M"HK3[T3F;(Y2V70$P5?D'7GFIB MJZ/C",S/BD!9N8GV"\.;GVME[P!@!B1"DT=1W0_75FMI23H!T2^C);4GY>`I M-2T^O_0_WU&$)&+/P)%[TQUQ-T7G%\RXYJT0HO[$=< M`@@TL1#(Y980]E*/!^2@G`*&S9O^QMS1S?/`TL=5F9B(12?(145>Y2I+;+T? MKWUD@&.7U36]K-$[.%9CB*FK^E8>N:K/)4#$]ZO/:=#;MRH-)_139\,W6M4T M7SQ?BBX>,+A3#BB5^O=>+GKIC-4]5VBP)D-S7-)\W&;<@_J@,*!``````````#.````S@```!```&1D11```&1D(P@`10`` MP"E5``!`,LQPP`$"%\`!`BT2-%9X````!0OIFA;,@2C4HF3>5!-C(0>5LR0" M='1\OQ.!-?@D(U0!453"``````````#.````S@```!```&1D11```&1D(P@`10``P"E7 M``!`,LQNP`$"%\`!`BT2-%9X````!I0M"-THEF=+!L=>A3N,\1+"'Z7(J?O0 M.B?)(#X=/5F-.">%3.X'(=JKK:WZMN M=B+^Q3"(KE\1299]=5E,'.&U(`H9N)+>9FS/`CA*>D^>AV.-C(S\)BM&)*XM M^BF__^<_``````````#.````S@```!```&1D11```&1D(P@`10``P"E9``!` M,LQLP`$"%\`!`BT2-%9X````!R"SQ'[6%(;Q>>O+]CS6D*+AD3IMC\^MMK8[ M:T3)KM06!G^.H\>%UAT@)X6JL9\3V.HR"+_Q^_T-O$Y_S":_TP;V,LIV1O]H M-G@DOL'V-5)O@%<%!#O$2V,AS@W7(&$IX.YKK]\K#>FITU)<>O42T2GKFW+^ M\/[,>E4P[Q"+7O,Y1(R22LND[H+469(%3,SN&3:U:/I`'&R@<`HKGOV,^#L9,QF%)W^9!VFM MXG'XY]CWI5VF33?7,*P?6:.PS'&[\N$7W<*==+;P*$./4*OH&=O,6G!JIN>I M'ZDP*D&4K>SK-\/!7\Z&<&5J4%NU?NRM&25'*_"'UE3VH&?U]/V@932UYZT\ ` end tcpdump-3.9.8/./tests/esp5.new0000644000026300017500000000237010320056212014210 0ustar mcrmcrIP 192.1.2.23 > 192.1.2.45: ESP(spi=0xd1234567,seq=0x1), length 132: IP 192.0.2.1 > 192.0.1.1: ICMP echo request, id 28416, seq 1280, length 64 (ipip-proto-4) IP 192.1.2.23 > 192.1.2.45: ESP(spi=0xd1234567,seq=0x2), length 132: IP 192.0.2.1 > 192.0.1.1: ICMP echo request, id 28416, seq 1536, length 64 (ipip-proto-4) IP 192.1.2.23 > 192.1.2.45: ESP(spi=0xd1234567,seq=0x3), length 132: IP 192.0.2.1 > 192.0.1.1: ICMP echo request, id 28416, seq 1792, length 64 (ipip-proto-4) IP 192.1.2.23 > 192.1.2.45: ESP(spi=0xd1234567,seq=0x4), length 132: IP 192.0.2.1 > 192.0.1.1: ICMP echo request, id 28416, seq 2048, length 64 (ipip-proto-4) IP 192.1.2.23 > 192.1.2.45: ESP(spi=0xd1234567,seq=0x5), length 132: IP 192.0.2.1 > 192.0.1.1: ICMP echo request, id 28416, seq 2304, length 64 (ipip-proto-4) IP 192.1.2.23 > 192.1.2.45: ESP(spi=0xd1234567,seq=0x6), length 132: IP 192.0.2.1 > 192.0.1.1: ICMP echo request, id 28416, seq 2560, length 64 (ipip-proto-4) IP 192.1.2.23 > 192.1.2.45: ESP(spi=0xd1234567,seq=0x7), length 132: IP 192.0.2.1 > 192.0.1.1: ICMP echo request, id 28416, seq 2816, length 64 (ipip-proto-4) IP 192.1.2.23 > 192.1.2.45: ESP(spi=0xd1234567,seq=0x8), length 132: IP 192.0.2.1 > 192.0.1.1: ICMP echo request, id 28416, seq 3072, length 64 (ipip-proto-4) tcpdump-3.9.8/./tests/ospf-gmpls.sh0000755000026300017500000000031210225052111015237 0ustar mcrmcr#!/bin/sh uudecode ospf-gmpls.puu echo -n test ospf-gmpls... ../tcpdump -t -n -v -r ospf-gmpls.pcap > ospf-gmpls.new if diff ospf-gmpls.new ospf-gmpls.out then echo passed. else echo failed. fi tcpdump-3.9.8/./tests/lmp.out0000644000026300017500000002630610320056003014145 0ustar mcrmcrIP (tos 0x0, ttl 1, id 44530, offset 0, flags [none], proto: UDP (17), length: 84) 10.0.12.1.49998 > 10.0.12.2.49998: LMPv1, msg-type: Begin Verify, Flags: [Control Channel Down], length: 56 Link ID Object (3), Class-Type: IPv4 Local (1) Flags: [non-negotiable], length: 8 IPv4 Link ID: 1.0.0.0 (0x01000000) Message ID Object (5), Class-Type: 1 (1) Flags: [non-negotiable], length: 8 Message ID: 3 (0x00000003) Link ID Object (3), Class-Type: IPv4 Remote (2) Flags: [non-negotiable], length: 8 IPv4 Link ID: 1.0.0.0 (0x01000000) Verify Begin Object (8), Class-Type: 1 (1) Flags: [negotiable], length: 24 Flags: none Verify Interval: 20 Data links: 30 Encoding type: Lambda (photonic) Verify Tranport Mechanism: 32768 (0x8000) Transmission Rate: 100.000 Mbps Wavelength: 8 IP (tos 0x0, ttl 1, id 44531, offset 0, flags [none], proto: UDP (17), length: 56) 10.0.12.1.49998 > 10.0.12.2.49998: LMPv1, msg-type: Hello, Flags: [Control Channel Down], length: 28 Control Channel ID Object (1), Class-Type: Local (1) Flags: [non-negotiable], length: 8 Control Channel ID: 1 (0x00000001) Hello Object (7), Class-Type: 1 (1) Flags: [non-negotiable], length: 12 TxSeqNum: 50 RcvSeqNum: 60 IP (tos 0x0, ttl 1, id 44532, offset 0, flags [none], proto: UDP (17), length: 84) 10.0.12.1.49998 > 10.0.12.2.49998: LMPv1, msg-type: Config NACK, Flags: [Control Channel Down], length: 56 Control Channel ID Object (1), Class-Type: Local (1) Flags: [non-negotiable], length: 8 Control Channel ID: 1 (0x00000001) Node ID Object (2), Class-Type: Local (1) Flags: [non-negotiable], length: 8 Node ID: 10.0.50.1 (0x0a003201) Control Channel ID Object (1), Class-Type: Remote (2) Flags: [non-negotiable], length: 8 Control Channel ID: 2 (0x00000002) Message ID Object (5), Class-Type: 2 (2) Flags: [non-negotiable], length: 8 Message ID Ack: 3 (0x00000003) Node ID Object (2), Class-Type: Remote (2) Flags: [non-negotiable], length: 8 Node ID: 10.0.50.2 (0x0a003202) Configuration Object (6), Class-Type: 1 (1) Flags: [negotiable], length: 8 Hello Interval: 5 Hello Dead Interval: 15 IP (tos 0x0, ttl 1, id 44533, offset 0, flags [none], proto: UDP (17), length: 76) 10.0.12.1.49998 > 10.0.12.2.49998: LMPv1, msg-type: Config ACK, Flags: [Control Channel Down], length: 48 Control Channel ID Object (1), Class-Type: Local (1) Flags: [non-negotiable], length: 8 Control Channel ID: 1 (0x00000001) Node ID Object (2), Class-Type: Local (1) Flags: [non-negotiable], length: 8 Node ID: 10.0.50.1 (0x0a003201) Control Channel ID Object (1), Class-Type: Remote (2) Flags: [non-negotiable], length: 8 Control Channel ID: 2 (0x00000002) Message ID Object (5), Class-Type: 2 (2) Flags: [non-negotiable], length: 8 Message ID Ack: 3 (0x00000003) Node ID Object (2), Class-Type: Remote (2) Flags: [non-negotiable], length: 8 Node ID: 10.0.50.2 (0x0a003202) IP (tos 0x0, ttl 1, id 44534, offset 0, flags [none], proto: UDP (17), length: 68) 10.0.12.1.49998 > 10.0.12.2.49998: LMPv1, msg-type: Config, Flags: [Control Channel Down], length: 40 Control Channel ID Object (1), Class-Type: Local (1) Flags: [non-negotiable], length: 8 Control Channel ID: 1 (0x00000001) Message ID Object (5), Class-Type: 1 (1) Flags: [non-negotiable], length: 8 Message ID: 3 (0x00000003) Node ID Object (2), Class-Type: Local (1) Flags: [non-negotiable], length: 8 Node ID: 10.0.50.1 (0x0a003201) Configuration Object (6), Class-Type: 1 (1) Flags: [negotiable], length: 8 Hello Interval: 5 Hello Dead Interval: 15 IP (tos 0x0, ttl 1, id 44535, offset 0, flags [none], proto: UDP (17), length: 44) 10.0.12.1.49998 > 10.0.12.2.49998: LMPv1, msg-type: Link Summary ACK, Flags: [Control Channel Down], length: 16 Message ID Object (5), Class-Type: 2 (2) Flags: [non-negotiable], length: 8 Message ID Ack: 1 (0x00000001) IP (tos 0x0, ttl 1, id 44536, offset 0, flags [none], proto: UDP (17), length: 124) 10.0.12.1.49998 > 10.0.12.2.49998: LMPv1, msg-type: Link Summary NACK, Flags: [Control Channel Down], length: 96 Message ID Object (5), Class-Type: 2 (2) Flags: [non-negotiable], length: 8 Message ID Ack: 1 (0x00000001) Error Code Object (20), Class-Type: 2 (2) Flags: [non-negotiable], length: 8 Error Code: Unacceptable non-negotiable LINK_SUMMARY parameters, Renegotiate LINK_SUMMARY parameters, Invalid DATA-LINK Object, Unknown TE-LINK Object c-type, Unknown DATA-LINK Object c-type Data Link Object (12), Class-Type: IPv4 (1) Flags: [non-negotiable], length: 36 Flags: [none] Local Interface ID: 192.168.1.1 (0xc0a80101) Remote Interface ID: 192.168.1.2 (0xc0a80102) Subobject, Type: Interface Switching Type (1), Length: 12 Switching Type: Lambda-Switch Capable (150) Encoding Type: Lambda (photonic) (8) Min Reservable Bandwidth: 100.000 Mbps Max Reservable Bandwidth: 100.000 Mbps Subobject, Type: Wavelength (2), Length: 8 Wavelength: 6 Data Link Object (12), Class-Type: IPv4 (1) Flags: [non-negotiable], length: 36 Flags: [none] Local Interface ID: 10.1.1.1 (0x0a010101) Remote Interface ID: 10.1.1.2 (0x0a010102) Subobject, Type: Interface Switching Type (1), Length: 12 Switching Type: Lambda-Switch Capable (150) Encoding Type: ANSI/ETSI PDH (3) Min Reservable Bandwidth: 1234736768.000 Mbps Max Reservable Bandwidth: 1290693376.000 Mbps Subobject, Type: Wavelength (2), Length: 8 Wavelength: 353 IP (tos 0x0, ttl 1, id 44537, offset 0, flags [none], proto: UDP (17), length: 68) 10.0.12.1.49998 > 10.0.12.2.49998: LMPv1, msg-type: Begin Verify ACK, Flags: [Control Channel Down], length: 40 Link ID Object (3), Class-Type: IPv4 Local (1) Flags: [non-negotiable], length: 8 IPv4 Link ID: 1.0.0.0 (0x01000000) Message ID Object (5), Class-Type: 2 (2) Flags: [non-negotiable], length: 8 Message ID Ack: 1 (0x00000001) Verify Begin ACK Object (9), Class-Type: 1 (1) Flags: [negotiable], length: 8 Verify Dead Interval: 50 Verify Transport Response: 100 Verify ID Object (10), Class-Type: 1 (1) Flags: [non-negotiable], length: 8 Verify ID: 5 IP (tos 0x0, ttl 1, id 44538, offset 0, flags [none], proto: UDP (17), length: 60) 10.0.12.1.49998 > 10.0.12.2.49998: LMPv1, msg-type: Begin Verify NACK, Flags: [Control Channel Down], length: 32 Link ID Object (3), Class-Type: IPv4 Local (1) Flags: [non-negotiable], length: 8 IPv4 Link ID: 10.0.0.0 (0x0a000000) Message ID Object (5), Class-Type: 2 (2) Flags: [non-negotiable], length: 8 Message ID Ack: 3 (0x00000003) Error Code Object (20), Class-Type: 1 (1) Flags: [non-negotiable], length: 8 Error Code: Link Verification Procedure Not supported, Unwilling to verify, Unsupported verification transport mechanism IP (tos 0x0, ttl 1, id 44539, offset 0, flags [none], proto: UDP (17), length: 52) 10.0.12.1.49998 > 10.0.12.2.49998: LMPv1, msg-type: End Verify, Flags: [Control Channel Down], length: 24 Message ID Object (5), Class-Type: 1 (1) Flags: [non-negotiable], length: 8 Message ID: 3 (0x00000003) Verify ID Object (10), Class-Type: 1 (1) Flags: [non-negotiable], length: 8 Verify ID: 5 IP (tos 0x0, ttl 1, id 44540, offset 0, flags [none], proto: UDP (17), length: 52) 10.0.12.1.49998 > 10.0.12.2.49998: LMPv1, msg-type: End Verify ACK, Flags: [Control Channel Down], length: 24 Message ID Object (5), Class-Type: 2 (2) Flags: [non-negotiable], length: 8 Message ID Ack: 3 (0x00000003) Verify ID Object (10), Class-Type: 1 (1) Flags: [non-negotiable], length: 8 Verify ID: 5 IP (tos 0x0, ttl 1, id 44541, offset 0, flags [none], proto: UDP (17), length: 52) 10.0.12.1.49998 > 10.0.12.2.49998: LMPv1, msg-type: Test, Flags: [Control Channel Down], length: 24 Interface ID Object (4), Class-Type: IPv4 Local (1) Flags: [non-negotiable], length: 8 IPv4 Link ID: 1.0.0.0 (0x01000000) Verify ID Object (10), Class-Type: 1 (1) Flags: [non-negotiable], length: 8 Verify ID: 5 IP (tos 0x0, ttl 1, id 44542, offset 0, flags [none], proto: UDP (17), length: 52) 10.0.12.1.49998 > 10.0.12.2.49998: LMPv1, msg-type: Test Status Failure, Flags: [Control Channel Down], length: 24 Message ID Object (5), Class-Type: 1 (1) Flags: [non-negotiable], length: 8 Message ID: 1 (0x00000001) Verify ID Object (10), Class-Type: 1 (1) Flags: [non-negotiable], length: 8 Verify ID: 5 IP (tos 0x0, ttl 1, id 44543, offset 0, flags [none], proto: UDP (17), length: 52) 10.0.12.1.49998 > 10.0.12.2.49998: LMPv1, msg-type: Test Status ACK, Flags: [Control Channel Down], length: 24 Message ID Object (5), Class-Type: 2 (2) Flags: [non-negotiable], length: 8 Message ID Ack: 1 (0x00000001) Verify ID Object (10), Class-Type: 1 (1) Flags: [non-negotiable], length: 8 Verify ID: 5 IP (tos 0x0, ttl 1, id 44544, offset 0, flags [none], proto: UDP (17), length: 44) 10.0.12.1.49998 > 10.0.12.2.49998: LMPv1, msg-type: Channel Status ACK, Flags: [Control Channel Down], length: 16 Message ID Object (5), Class-Type: 2 (2) Flags: [non-negotiable], length: 8 Message ID Ack: 3 (0x00000003) IP (tos 0x0, ttl 1, id 44545, offset 0, flags [none], proto: UDP (17), length: 64) 10.0.12.1.49998 > 10.0.12.2.49998: LMPv1, msg-type: Channel Status Request, Flags: [Control Channel Down], length: 36 Link ID Object (3), Class-Type: IPv4 Local (1) Flags: [non-negotiable], length: 8 IPv4 Link ID: 1.0.0.0 (0x01000000) Message ID Object (5), Class-Type: 1 (1) Flags: [non-negotiable], length: 8 Message ID: 3 (0x00000003) Channel Status Request Object (14), Class-Type: IPv4 (1) Flags: [non-negotiable], length: 12 Interface ID: 2.0.0.0 (0x02000000) Interface ID: 2.0.0.0 (0x02000000) IP (tos 0x0, ttl 1, id 44546, offset 0, flags [none], proto: UDP (17), length: 72) 10.0.12.1.49998 > 10.0.12.2.49998: LMPv1, msg-type: Channel Status, Flags: [Control Channel Down], length: 44 Link ID Object (3), Class-Type: IPv4 Local (1) Flags: [non-negotiable], length: 8 IPv4 Link ID: 1.0.0.0 (0x01000000) Message ID Object (5), Class-Type: 1 (1) Flags: [non-negotiable], length: 8 Message ID: 3 (0x00000003) Channel Status Object (13), Class-Type: IPv4 (1) Flags: [non-negotiable], length: 20 Interface ID: 1.0.0.0 (0x01000000) Active: Allocated (1) Direction: Transmit (1) Channel Status: Signal Fail (3) Interface ID: 1.0.0.0 (0x01000000) Active: Allocated (1) Direction: Receive (0) Channel Status: Signal Degraded (2) IP (tos 0x0, ttl 1, id 44547, offset 0, flags [none], proto: UDP (17), length: 64) 10.0.12.1.49998 > 10.0.12.2.49998: LMPv1, msg-type: Channel Status Response, Flags: [Control Channel Down], length: 36 Message ID Object (5), Class-Type: 2 (2) Flags: [non-negotiable], length: 8 Message ID Ack: 3 (0x00000003) Channel Status Object (13), Class-Type: IPv4 (1) Flags: [non-negotiable], length: 20 Interface ID: 1.0.0.0 (0x01000000) Active: Allocated (1) Direction: Transmit (1) Channel Status: Signal Degraded (2) Interface ID: 1.0.0.0 (0x01000000) Active: Allocated (1) Direction: Transmit (1) Channel Status: Signal Okay (1) tcpdump-3.9.8/./tests/esp2.gdbinit0000644000026300017500000000034507627031313015047 0ustar mcrmcrset args -t -n -E "0x12345678@192.1.2.45 3des-cbc-hmac96:0x43434545464649494a4a4c4c4f4f51515252545457575840,0xabcdabcd@192.0.1.1 3des-cbc-hmac96:0x434545464649494a4a4c4c4f4f5151525254545757584043" -r 08-sunrise-sunset-esp2.pcap tcpdump-3.9.8/./tests/esp3.gdbinit0000644000026300017500000000016707627043062015056 0ustar mcrmcrset args -t -n -E "3des-cbc-hmac96:0x43434545464649494a4a4c4c4f4f51515252545457575840" -r 08-sunrise-sunset-esp2.pcap tcpdump-3.9.8/./tests/esp5.out0000644000026300017500000000237010320056205014230 0ustar mcrmcrIP 192.1.2.23 > 192.1.2.45: ESP(spi=0xd1234567,seq=0x1), length 132: IP 192.0.2.1 > 192.0.1.1: ICMP echo request, id 28416, seq 1280, length 64 (ipip-proto-4) IP 192.1.2.23 > 192.1.2.45: ESP(spi=0xd1234567,seq=0x2), length 132: IP 192.0.2.1 > 192.0.1.1: ICMP echo request, id 28416, seq 1536, length 64 (ipip-proto-4) IP 192.1.2.23 > 192.1.2.45: ESP(spi=0xd1234567,seq=0x3), length 132: IP 192.0.2.1 > 192.0.1.1: ICMP echo request, id 28416, seq 1792, length 64 (ipip-proto-4) IP 192.1.2.23 > 192.1.2.45: ESP(spi=0xd1234567,seq=0x4), length 132: IP 192.0.2.1 > 192.0.1.1: ICMP echo request, id 28416, seq 2048, length 64 (ipip-proto-4) IP 192.1.2.23 > 192.1.2.45: ESP(spi=0xd1234567,seq=0x5), length 132: IP 192.0.2.1 > 192.0.1.1: ICMP echo request, id 28416, seq 2304, length 64 (ipip-proto-4) IP 192.1.2.23 > 192.1.2.45: ESP(spi=0xd1234567,seq=0x6), length 132: IP 192.0.2.1 > 192.0.1.1: ICMP echo request, id 28416, seq 2560, length 64 (ipip-proto-4) IP 192.1.2.23 > 192.1.2.45: ESP(spi=0xd1234567,seq=0x7), length 132: IP 192.0.2.1 > 192.0.1.1: ICMP echo request, id 28416, seq 2816, length 64 (ipip-proto-4) IP 192.1.2.23 > 192.1.2.45: ESP(spi=0xd1234567,seq=0x8), length 132: IP 192.0.2.1 > 192.0.1.1: ICMP echo request, id 28416, seq 3072, length 64 (ipip-proto-4) tcpdump-3.9.8/./tests/print-A.out0000644000026300017500000001660610320056205014675 0ustar mcrmcr23:57:35.938066 IP 127.0.0.1.55920 > 127.0.0.1.80: S 928549246:928549246(0) win 32767 E..<.h@.@.!R.........p.P7X.~.........!....@.... M........... 23:57:35.938122 IP 127.0.0.1.80 > 127.0.0.1.55920: S 930778609:930778609(0) ack 928549247 win 32767 E..<..@.@.<..........P.p7z..7X......n.....@.... M...M....... 23:57:35.938167 IP 127.0.0.1.55920 > 127.0.0.1.80: . ack 1 win 8192 E..4.j@.@.!X.........p.P7X..7z.... .7...... M...M... 23:57:35.939423 IP 127.0.0.1.55920 > 127.0.0.1.80: P 1:203(202) ack 1 win 8192 E....l@.@. ..........p.P7X..7z.... ........ M...M...GET / HTTP/1.1 Host: localhost User-Agent: ELinks/0.10.4-7-debian (textmode; Linux 2.6.11-1-686-smp i686; 132x56-2) Accept: */* Accept-Encoding: gzip Accept-Language: en Connection: Keep-Alive 23:57:35.940474 IP 127.0.0.1.80 > 127.0.0.1.55920: . ack 203 win 8192 E..4..@.@............P.p7z..7X.I.. .7...... M...M... 23:57:35.941232 IP 127.0.0.1.80 > 127.0.0.1.55920: P 1:5560(5559) ack 203 win 8192 E.....@.@..%.........P.p7z..7X.I.. ........ M...M...HTTP/1.1 200 OK Date: Wed, 06 Jul 2005 03:57:35 GMT Server: Apache/1.3.33 Last-Modified: Sun, 15 Aug 2004 00:43:41 GMT ETag: "6e80f0-148a-411eb1bd" Accept-Ranges: bytes Content-Length: 5258 Keep-Alive: timeout=15, max=100 Connection: Keep-Alive Content-Type: text/html; charset=iso-8859-1 Placeholder page

    Placeholder page

    If you are just browsing the web

    The owner of this web site has not put up any web pages yet. Please come back later.

    Move along, nothing to see here... :-)

    If you are trying to locate the administrator of this machine

    If you want to report something about this host's behavior, please contact the Internet Service Provider (ISP) involved directly.

    See the Network Abuse Clearinghouse for how to do this.

    If you are the administrator of this machine

    The initial installation of Debian's apache web server package was successful.

    You should replace this page with your own web pages as soon as possible.

    Unless you changed its configuration, your new server is configured as follows:

    • Configuration files can be found in /etc/apache.
    • The DocumentRoot, which is the directory under which all your HTML files should exist, is set to /var/www.
    • CGI scripts are looked for in /usr/lib/cgi-bin, which is where Debian packages will place their scripts.
    • Log files are placed in /var/log/apache, and will be rotated weekly. The frequency of rotation can be easily changed by editing /etc/logrotate.d/apache.
    • The default directory index is index.html, meaning that requests for a directory /foo/bar/ will give the contents of the file /var/www/foo/bar/index.html if it exists (assuming that /var/www is your DocumentRoot).
    • User directories are enabled, and user documents will be looked for in the public_html directory of the users' homes. These dirs should be under /home, and users will not be able to symlink to files they don't own.
    All the standard apache modules are available with this release and are now managed with debconf. Type dpkg-reconfigure apache to select which modules you want enabled. Many other modules are available through the Debian package system with the names libapache-mod-*. If you need to compile a module yourself, you will need to install the apache-dev package.

    More documentation on Apache can be found on:

    You can also consult the list of World Wide Web Frequently Asked Questions for information.

    Let other people know about this server

    Netcraft provides an interesting free service for web site monitoring and statistic collection. You can let them know about your server using their interface. Enabling the monitoring of your server will provide a better global overview of who is using what and where, and it would give Debian a better overview of the apache package usage.

    About this page

    This is a placeholder page installed by the Debian release of the apache Web server package.

    This computer has installed the Debian GNU/Linux operating system, but it has nothing to do with the Debian Project. Please do not contact the Debian Project about it.

    If you find a bug in this apache package, or in Apache itself, please file a bug report on it. Instructions on doing this, and the list of known bugs of this package, can be found in the Debian Bug Tracking System.

    Thanks for using this package, and congratulations for your choice of a Debian system!

    23:57:35.941260 IP 127.0.0.1.55920 > 127.0.0.1.80: . ack 5560 win 12383 E..4.n@.@.!T.........p.P7X.I7z....0_....... M...M... 23:57:37.229575 IP 127.0.0.1.55920 > 127.0.0.1.80: F 203:203(0) ack 5560 win 12383 E..4.p@.@.!R.........p.P7X.I7z....0_....... M..!M... 23:57:37.230839 IP 127.0.0.1.80 > 127.0.0.1.55920: F 5560:5560(0) ack 204 win 8192 E..4..@.@............P.p7z..7X.J.. ..5..... M..#M..! 23:57:37.230900 IP 127.0.0.1.55920 > 127.0.0.1.80: . ack 5561 win 12383 E..4.r@.@.!P.........p.P7X.J7z....0_....... M..#M..# tcpdump-3.9.8/./tests/08-sunrise-sunset-aes.pcap0000644000026300017500000000271010320056212017466 0ustar mcrmcrÔò¡¦¦ddEdd#E˜üê@2ùÀÀ-Ñ#Egæ»èШpÚaÞ#MV ™„À >¼üié(zÿì!TIÿ¾y Ç(Êlˆ±%ÞÊÈpäøQ4- ñœÁŒ‘ _7çO(ògI¿™‹Â ÆE~+Üɺ Ó¨hašÆn´°p×qæ_`wêSf¿;Ø‹[\¼ÑäÙ·n…±¦¦ddEdd#E˜üë@2ùÀÀ-Ñ#Egn´°p×qæ_`wêSf¿;ØDh“VG°Å¢Ú³¾‰Oe[FiôßÐ™ß ,õo€j÷Õó%À *Àsæÿ²×|ŸZj·}]V%[› ¤l¬›51Hº^CÈ ôwuu¢»´B˜ Êø%`8”ý^dù­›žÞ{4¬…z0¢Ž¦¦ddEdd#E˜üì@2ùÀÀ-Ñ#Eg Êø%`8”ý^dù­›žuc[ÔaÖ ïÔ¡„$·ŸºfTú±>ïºâ¬p. \¯÷>=*°pƒþbí/5O‰Xj–5.lÏ\шm˜mý)Õ…ÎîÈ«Lrp~[žÉ‹†Ê7ïÒEÜØ˜iÕC •åå³\¦ã)ªBƒ)r¦¦ddEdd#E˜üí@2øÿÀÀ-Ñ#Eg†Ê7ïÒEÜØ˜iÕC •ååk ›&%q^d‚}4a­£Ž…×Åu©¤ê‡T)š{Ñç8”'ð¨$¾ ¥QñŒg@8L6æ.;r}×uúÎÉ4 aìNØÉÖ­O1'§§”èEú±<ÍÜü¢ÝR ~‚C h즦ddEdd#E˜üî@2øþÀÀ-Ñ#Eg1'§§”èEú±<ÍÜü-Æ(h{'­Ï­ùïøE”œ$qÓyÞÄ(ïIQÂÒÑ-ŽÖ„WòY|Á¥ßl4u”Q~ÍèÃ×n’ˆáEQOV}Ád£ªÜÞúù"ž]C¨HnœPÆCìhTú‡B±¢ÀuIß(…ÌJ¦¦ddEdd#E˜üï@2øýÀÀ-Ñ#EgC¨HnœPÆCìhTú€ª1è}O=7“ãæ©ïª‚kr½´fu‘yêG–‹f €~œÊ 3ô_çV@äÏwáæ‚gfx¤PÌ“Ðe’b)ýe{VV,%|­Ð‚<ë/ÿþlKœ–NHdþƒV°ÿö?O¹Œ”À`g+¦¦ddEdd#E˜üð@2øüÀÀ-Ñ#EgþlKœ–NHdþƒV°ÿö?ú«QWµûMê@°9=€ißéx’¼9é~é+›µêÂãÛÊrɱKšÂ†ñ‚èKêæÞeyÅ¡Ø~vÝ¿™Äù}ˆß¾A¤]ážüjÂHVxª2 MVáŽ}„ÚÉ>ÉþŒ®Îá¶’:ŒÜ¦¦ddEdd#E˜üñ@2øûÀÀ-Ñ#EgÂHVxª2 MVáŽ}„ÚɾPrSÔÎâuá¼ZI¬‰:鯿ò±ë»E+Šyéßþ_£2«¢Z$åxaÒAeO«G–Î$}SòÄôŒík¯xˆ[à]‡™³œC¥½™ÖœnÞ³æÏðÕ·‰„{Ÿ‚\·4"uë'’tcpdump-3.9.8/./tests/esp0.out0000644000026300017500000000104010320056003014210 0ustar mcrmcrIP 192.1.2.23 > 192.1.2.45: ESP(spi=0x12345678,seq=0x1), length 116 IP 192.1.2.23 > 192.1.2.45: ESP(spi=0x12345678,seq=0x2), length 116 IP 192.1.2.23 > 192.1.2.45: ESP(spi=0x12345678,seq=0x3), length 116 IP 192.1.2.23 > 192.1.2.45: ESP(spi=0x12345678,seq=0x4), length 116 IP 192.1.2.23 > 192.1.2.45: ESP(spi=0x12345678,seq=0x5), length 116 IP 192.1.2.23 > 192.1.2.45: ESP(spi=0x12345678,seq=0x6), length 116 IP 192.1.2.23 > 192.1.2.45: ESP(spi=0x12345678,seq=0x7), length 116 IP 192.1.2.23 > 192.1.2.45: ESP(spi=0x12345678,seq=0x8), length 116 tcpdump-3.9.8/./tests/esp1.sh0000644000026300017500000000043710225052107014032 0ustar mcrmcr#!/bin/sh uudecode 02-sunrise-sunset-esp.puu echo -n test esp1... ../tcpdump -t -n -E "0x12345678@192.1.2.45 3des-cbc-hmac96:0x4043434545464649494a4a4c4c4f4f515152525454575758" -r 02-sunrise-sunset-esp.pcap >esp1.new if diff esp1.new esp1.out then echo passed. else echo failed. fi tcpdump-3.9.8/./tests/esp4.gdbinit0000644000026300017500000000011207627043062015045 0ustar mcrmcrset args -t -n -E "file esp-secrets.txt" -r 08-sunrise-sunset-esp2.pcap tcpdump-3.9.8/./tests/lmp.sh0000755000026300017500000000023710225052110013745 0ustar mcrmcr#!/bin/sh uudecode lmp.puu echo -n test lmp ... ../tcpdump -t -n -v -r lmp.pcap >lmp.new if diff lmp.new lmp.out then echo passed. else echo failed. fi tcpdump-3.9.8/./tests/eapon1.pcap0000644000026300017500000004003410320056212014650 0ustar mcrmcrÔò¡ÿÿU`@’ ÝÝÿÿÿÿÿÿ#W¥zEÏ8‡€|NÀ¨ùÀ¨ÿŠŠ»Sì‰À¨ùŠ¥ EEEKFADJDFFDDAEKCACACACACACACAAA EBFCECEFEJFEFDEHFCFFFAFAEFCACAAAÿSMB% è V\MAILSLOT\BROWSEDJP95S0JU`@ô ÝÝÿÿÿÿÿÿ#W¥zEÏ8ˆ€|MÀ¨ùÀ¨ÿŠŠ» ò‰À¨ùŠ¥ EEEKFADJDFFDDAEKCACACACACACACAAA ABACFPFPENFDECFCEPFHFDEFFPFPACABÿSMB% è V\MAILSLOT\BROWSEDJP95S0JU`@€£ûûÿÿÿÿÿÿ#W¥zEí8‰€|.À¨ùÀ¨ÿŠŠÙCÞ‰À¨ùŠÃ EEEKFADJDFFDDAEKCACACACACACACAAA ABACFPFPENFDECFCEPFHFDEFFPFPACABÿSMB%)è)V:\MAILSLOT\BROWSE `êARBEITSGRUPPE €LþDJP95S0JU`@ú©\\ÿÿÿÿÿÿ#W¥zEN8Š€|ÌÀ¨ùÀ¨ÿ‰‰:‚w‰! EBFCECEFEJFEFDEHFCFFFAFAEFCACABL  U`@óØ \\ÿÿÿÿÿÿ#W¥zEN8€|ÉÀ¨ùÀ¨ÿ‰‰:‚w‰! EBFCECEFEJFEFDEHFCFFFAFAEFCACABL  U`@³ \\ÿÿÿÿÿÿ#W¥zEN8Ž€|ÈÀ¨ùÀ¨ÿ‰‰:‚w‰! EBFCECEFEJFEFDEHFCFFFAFAEFCACABL  U`@È. óóÿÿÿÿÿÿ#W¥zEå8€|0À¨ùÀ¨ÿŠŠÑ禉"À¨ùŠ» EEEKFADJDFFDDAEKCACACACACACACACA EBFCECEFEJFEFDEHFCFFFAFAEFCACABOÿSMB%!è!V2\MAILSLOT\BROWSE€ü DJP95S0JrosUª U`@U\\ÿÿÿÿÿÿ#W¥zEN8”€|ÂÀ¨ùÀ¨ÿ‰‰:‚p‰( EBFCECEFEJFEFDEHFCFFFAFAEFCACABL U`@E\\ÿÿÿÿÿÿ#W¥zEN8•€|ÁÀ¨ùÀ¨ÿ‰‰:‚p‰( EBFCECEFEJFEFDEHFCFFFAFAEFCACABL U`@P¸\\ÿÿÿÿÿÿ#W¥zEN8–€|ÀÀ¨ùÀ¨ÿ‰‰:‚p‰( EBFCECEFEJFEFDEHFCFFFAFAEFCACABL U`@Ê8**ÿÿÿÿÿÿ#W¥z#W¥zÀ¨ùÀ¨U`@Y<<#W¥z ˆO%‘ ˆO%‘À¨#W¥zÀ¨ùU`@)YVV ˆO%‘#W¥zEH8—€|ÃÀ¨ùÀ¨DC4yÛÈ-%=€À¨ù#W¥zc‚Sc56À¨=#W¥zÿU`@ <<#W¥z Έ1šˆŽU`@ + VVÿÿÿÿÿÿ#W¥zEH8Ÿ€ÿÿÿÿDC4Á«˜‡<#W¥zc‚Sc5t=#W¥z2À¨ù DJP95S0J<MSFT 5.07 ,./!ù+ÿU`@þ VVÿÿÿÿÿÿ#W¥zEH8¡€ÿÿÿÿDC4ŽÍÕ}.#W¥zc‚Sc5t=#W¥z2À¨ù DJP95S0J<MSFT 5.07 ,./!ù+ÿU`@„c Έ1š#W¥zˆŽU`@êk<<#W¥z Έ1šˆŽU`@^° ?? Έ1š#W¥zˆŽ--1295023820005391@mnc023.mcc295.owlan.orgU`@a <<#W¥z Έ1šˆŽ U`@ͬ ^^ Έ1š#W¥zˆŽLL  (1295023820005391@mnc023.mcc295.owlan.orgâÒùrËÉöÇÁ¥œŸÊâU`@Áò bb#W¥z Έ1šˆŽPP  012 ëôŽ€b—³Î+MxöˆŒföU`@³ .. Έ1š#W¥zˆŽ  «¹³¤¯_P…Y5ŸˆÅiîU`@(u <<#W¥z Έ1šˆŽU`@y KK#W¥z Έ1šˆŽ9 @`U›jº…'¬8®Ê‚S…&]1]GÇ}…G  ØËICšñÑSÒº\Ïcâ&¸U`@N| >>#W¥z Έ1šˆŽ, @`Uœ•ø=.¹S§•²È! vHoNƒqáztn;‘ß}yF÷øÊ¤U`@¨ VVÿÿÿÿÿÿ#W¥zEH8§€ÿÿÿÿÿDC4%ÌÕ}.i#W¥zc‚Sc5t=#W¥z2À¨ù DJP95S0J<MSFT 5.07 ,./!ù+ÿU`@ï VVÿÿÿÿÿÿ#W¥zEH8¯€÷ÿÿÿÿDC4%ÌÕ}.i#W¥zc‚Sc5t=#W¥z2À¨ù DJP95S0J<MSFT 5.07 ,./!ù+ÿ*U`@û VVÿÿÿÿÿÿ#W¥zEH8²€ôÿÿÿÿDC4%ÌÕ}.i#W¥zc‚Sc5t=#W¥z2À¨ù DJP95S0J<MSFT 5.07 ,./!ù+ÿ0U`@è„  Έ1š#W¥zˆŽ0U`@ú¡ <<#W¥z Έ1šˆŽ0U`@œá ?? Έ1š#W¥zˆŽ--1295023820005391@mnc023.mcc295.owlan.org0U`@Ð <<#W¥z Έ1šˆŽ/ 2U`@4B^^ Έ1š#W¥zˆŽL/L  (1295023820005391@mnc023.mcc295.owlan.org× {óÌå3ÆÑ7Z72U`@Ì8bb#W¥z Έ1šˆŽP0P  012 C{BpEmFd@‰,‚Ù3U`@sS.. Έ1š#W¥zˆŽ0 Eïÿ0b‚Æ[PDˆ8'CB3U`@!Ö<<#W¥z Έ1šˆŽ3U`@]ÚKK#W¥z Έ1šˆŽ9 @`U1Ap²ß@äùx8XNþù¢CH»Âf°õ°fê!Ó\•þàQ\à øŠœ© 3U`@˜Ý>>#W¥z Έ1šˆŽ, @`U1žîrlJÊ;‹'«Ù¸(CƒŠÞT®ÿkP£ö^ï| ©ÈKU`@÷ **ÿÿÿÿÿÿ#W¥z#W¥z©þC©þCÂKU`@q **ÿÿÿÿÿÿ#W¥z#W¥z©þC©þCÂLU`@8‚ **ÿÿÿÿÿÿ#W¥z#W¥z©þC©þCÂMU`@)Ú ¯¯^ÿú#W¥zE¡8¾¢Ó©þCÂïÿÿúËlbøM-SEARCH * HTTP/1.1 Host:239.255.255.250:1900 ST:urn:schemas-upnp-org:device:InternetGatewayDevice:1 Man:"ssdp:discover" MX:3 MU`@¼ä 66^#W¥zF(8À9©þCÂà”"êïÿÿúMU`@¾µnnÿÿÿÿÿÿ#W¥zE`8€j ©þC©þÿÿ‰‰Lµ‰.) EEEKFADJDFFDDAEKCACACACACACACAAA À “à`©þCÂNU`@ 66^#W¥zF(8Ä5©þCÂà”"êïÿÿúNU`@å nnÿÿÿÿÿÿ#W¥zE`8Å€j ©þC©þÿÿ‰‰Lµ‰.) EEEKFADJDFFDDAEKCACACACACACACAAA À “à`©þCÂOU`@3nnÿÿÿÿÿÿ#W¥zE`8Æ€j©þC©þÿÿ‰‰Lµ‰.) EEEKFADJDFFDDAEKCACACACACACACAAA À “à`©þCÂOU`@¯µ VVÿÿÿÿÿÿ#W¥zEH8Ç€ßÿÿÿÿDC4•k’E9N€#W¥zc‚Sc5t=#W¥z2À¨ù DJP95S0J<MSFT 5.07 ,./!ù+ÿPU`@4Gnnÿÿÿÿÿÿ#W¥zE`8È€j©þC©þÿÿ‰‰L¶‰.( EEEKFADJDFFDDAEKCACACACACACACAAA À “à`©þCÂPU`@Œß ¯¯^ÿú#W¥zE¡8ʢǩþCÂïÿÿúËlbøM-SEARCH * HTTP/1.1 Host:239.255.255.250:1900 ST:urn:schemas-upnp-org:device:InternetGatewayDevice:1 Man:"ssdp:discover" MX:3 PU`@¼nnÿÿÿÿÿÿ#W¥zE`8Ì€j©þC©þÿÿ‰‰L0õ‰/) EBFCECEFEJFEFDEHFCFFFAFAEFCACAAA À “àà©þCÂQU`@3á Έ1š#W¥zˆŽQU`@aé<<#W¥z Έ1šˆŽQU`@½5?? Έ1š#W¥zˆŽ--1295023820005391@mnc023.mcc295.owlan.orgQU`@ùî<<#W¥z Έ1šˆŽP QU`@dë nnÿÿÿÿÿÿ#W¥zE`8Í€j©þC©þÿÿ‰‰L0õ‰/) EBFCECEFEJFEFDEHFCFFFAFAEFCACAAA À “àà©þCÂRU`@]nnÿÿÿÿÿÿ#W¥zE`8΀j©þC©þÿÿ‰‰L0õ‰/) EBFCECEFEJFEFDEHFCFFFAFAEFCACAAA À “àà©þCÂRU`@g²^^ Έ1š#W¥zˆŽLPL  (1295023820005391@mnc023.mcc295.owlan.org:'Ý,aêæü†aú‰'_ERU`@bb#W¥z Έ1šˆŽPQP  012 *™¨¿¡>#W¥z Έ1šˆŽ, @`UR FÖ´_­Ì¥Ž äw/éúƒš¾¼Î`«ß´Ä;=»QSU`@dº VVÿÿÿÿÿÿ#W¥zEH8ЀÖÿÿÿÿDC4lj’E9N)€#W¥zc‚Sc5t=#W¥z2À¨ù DJP95S0J<MSFT 5.07 ,./!ù+ÿSU`@—á ¯¯^ÿú#W¥zE¡8Ò¢¿©þCÂïÿÿúËlbøM-SEARCH * HTTP/1.1 Host:239.255.255.250:1900 ST:urn:schemas-upnp-org:device:InternetGatewayDevice:1 Man:"ssdp:discover" MX:3 SU`@¹Ânnÿÿÿÿÿÿ#W¥zE`8Ô€iú©þC©þÿÿ‰‰Lµ‰0) EEEKFADJDFFDDAEKCACACACACACACACA À “à`©þCÂSU`@ØÄnnÿÿÿÿÿÿ#W¥zE`8Õ€iù©þC©þÿÿ‰‰L"ò‰1) EBFCECEFEJFEFDEHFCFFFAFAEFCACABO À “àà©þCÂTU`@Œñ nnÿÿÿÿÿÿ#W¥zE`8Ø€iö©þC©þÿÿ‰‰Lµ‰0) EEEKFADJDFFDDAEKCACACACACACACACA À “à`©þCÂTU`@Qõ nnÿÿÿÿÿÿ#W¥zE`8Ù€iõ©þC©þÿÿ‰‰L"ò‰1) EBFCECEFEJFEFDEHFCFFFAFAEFCACABO À “àà©þCÂUU`@‰"nnÿÿÿÿÿÿ#W¥zE`8Ú€iô©þC©þÿÿ‰‰Lµ‰0) EEEKFADJDFFDDAEKCACACACACACACACA À “à`©þCÂUU`@M&nnÿÿÿÿÿÿ#W¥zE`8Û€ió©þC©þÿÿ‰‰L"ò‰1) EBFCECEFEJFEFDEHFCFFFAFAEFCACABO À “àà©þCÂVU`@|Snnÿÿÿÿÿÿ#W¥zE`8Ü€iò©þC©þÿÿ‰‰L¶‰0( EEEKFADJDFFDDAEKCACACACACACACACA À “à`©þCÂVU`@FWnnÿÿÿÿÿÿ#W¥zE`8Ý€iñ©þC©þÿÿ‰‰L#ò‰1( EBFCECEFEJFEFDEHFCFFFAFAEFCACABO À “àà©þCÂVU`@ÉÌÝÝÿÿÿÿÿÿ#W¥zEÏ8ã€i|©þC©þÿÿŠŠ» A‰2©þCŠ¥ EEEKFADJDFFDDAEKCACACACACACACAAA EBFCECEFEJFEFDEHFCFFFAFAEFCACABNÿSMB% è V\MAILSLOT\BROWSEDJP95S0JVU`@ÝÍóóÿÿÿÿÿÿ#W¥zEå8ä€ie©þC©þÿÿŠŠÑ‰3©þCŠ» EEEKFADJDFFDDAEKCACACACACACACACA EBFCECEFEJFEFDEHFCFFFAFAEFCACABNÿSMB%!è!V2\MAILSLOT\BROWSE€ü DJP95S0JUªXU`@¿,ÝÝÿÿÿÿÿÿ#W¥zEÏ8æ€iy©þC©þÿÿŠŠ» =‰6©þCŠ¥ EEEKFADJDFFDDAEKCACACACACACACAAA EBFCECEFEJFEFDEHFCFFFAFAEFCACABNÿSMB% è V\MAILSLOT\BROWSEDJP95S0JYU`@êÐÝÝÿÿÿÿÿÿ#W¥zEÏ8ç€ix©þC©þÿÿŠŠ» <‰7©þCŠ¥ EEEKFADJDFFDDAEKCACACACACACACAAA EBFCECEFEJFEFDEHFCFFFAFAEFCACABNÿSMB% è V\MAILSLOT\BROWSEDJP95S0J[U`@Ø2ÝÝÿÿÿÿÿÿ#W¥zEÏ8è€iw©þC©þÿÿŠŠ» ;‰8©þCŠ¥ EEEKFADJDFFDDAEKCACACACACACACAAA EBFCECEFEJFEFDEHFCFFFAFAEFCACABNÿSMB% è V\MAILSLOT\BROWSEDJP95S0J\U`@$½ VVÿÿÿÿÿÿ#W¥zEH8逽ÿÿÿÿDC4lj’E9N)€#W¥zc‚Sc5t=#W¥z2À¨ù DJP95S0J<MSFT 5.07 ,./!ù+ÿ\U`@×ééÿÿÿÿÿÿ#W¥zEÛ8ê€ii©þC©þÿÿŠŠÇn ‰9©þCб EEEKFADJDFFDDAEKCACACACACACACAAA EBFCECEFEJFEFDEHFCFFFAFAEFCACABOÿSMB%èV(\MAILSLOT\BROWSE Y±DJP95S0J]U`@Ï×ééÿÿÿÿÿÿ#W¥zEÛ8ë€ih©þC©þÿÿŠŠÇn ‰:©þCб EEEKFADJDFFDDAEKCACACACACACACAAA EBFCECEFEJFEFDEHFCFFFAFAEFCACABOÿSMB%èV(\MAILSLOT\BROWSE Y±DJP95S0J^U`@‹Øééÿÿÿÿÿÿ#W¥zEÛ8ì€ig©þC©þÿÿŠŠÇn ‰;©þCб EEEKFADJDFFDDAEKCACACACACACACAAA EBFCECEFEJFEFDEHFCFFFAFAEFCACABOÿSMB%èV(\MAILSLOT\BROWSE Y±DJP95S0J_U`@IÙééÿÿÿÿÿÿ#W¥zEÛ8í€if©þC©þÿÿŠŠÇn‰<©þCб EEEKFADJDFFDDAEKCACACACACACACAAA EBFCECEFEJFEFDEHFCFFFAFAEFCACABOÿSMB%èV(\MAILSLOT\BROWSE Y±DJP95S0J`U`@£Únnÿÿÿÿÿÿ#W¥zE`8î€ià©þC©þÿÿ‰‰L£æ‰=) EBFCECEFEJFEFDEHFCFFFAFAEFCACABN À “à`©þCÂaU`@æ nnÿÿÿÿÿÿ#W¥zE`8ï€iß©þC©þÿÿ‰‰L£æ‰=) EBFCECEFEJFEFDEHFCFFFAFAEFCACABN À “à`©þCÂbU`@ß;nnÿÿÿÿÿÿ#W¥zE`8ð€iÞ©þC©þÿÿ‰‰L£æ‰=) EBFCECEFEJFEFDEHFCFFFAFAEFCACABN À “à`©þCÂcU`@Ùlnnÿÿÿÿÿÿ#W¥zE`8ó€iÛ©þC©þÿÿ‰‰L¤æ‰=( EBFCECEFEJFEFDEHFCFFFAFAEFCACABN À “à`©þCÂcU`@‡ànnÿÿÿÿÿÿ#W¥zE`8ô€iÚ©þC©þÿÿ‰‰Léì‰>) ABACFPFPENFDECFCEPFHFDEFFPFPACAB À “àà©þCÂdU`@ nnÿÿÿÿÿÿ#W¥zE`8õ€iÙ©þC©þÿÿ‰‰Léì‰>) ABACFPFPENFDECFCEPFHFDEFFPFPACAB À “àà©þCÂeU`@Bnnÿÿÿÿÿÿ#W¥zE`8ö€iØ©þC©þÿÿ‰‰Léì‰>) ABACFPFPENFDECFCEPFHFDEFFPFPACAB À “àà©þCÂfU`@þrnnÿÿÿÿÿÿ#W¥zE`8÷€iשþC©þÿÿ‰‰Lêì‰>( ABACFPFPENFDECFCEPFHFDEFFPFPACAB À “àà©þCÂfU`@æÝÝÿÿÿÿÿÿ#W¥zEÏ8ø€ig©þC©þÿÿŠŠ»5‰?©þCŠ¥ EEEKFADJDFFDDAEKCACACACACACACAAA EBFCECEFEJFEFDEHFCFFFAFAEFCACAAAÿSMB% è V\MAILSLOT\BROWSEDJP95S0JfU`@açÝÝÿÿÿÿÿÿ#W¥zEÏ8ù€if©þC©þÿÿŠŠ»Ï:‰@©þCŠ¥ EEEKFADJDFFDDAEKCACACACACACACAAA ABACFPFPENFDECFCEPFHFDEFFPFPACABÿSMB% è V\MAILSLOT\BROWSEDJP95S0JfU`@pêûûÿÿÿÿÿÿ#W¥zEí8ú€iG©þC©þÿÿŠŠÙ%#‰A©þCŠà EEEKFADJDFFDDAEKCACACACACACACAAA ABACFPFPENFDECFCEPFHFDEFFPFPACABÿSMB%)è)V:\MAILSLOT\BROWSE `êARBEITSGRUPPE €lþÅDJP95S0JfU`@”ð\\ÿÿÿÿÿÿ#W¥zEN8û€iå©þC©þÿÿ‰‰:o߉C EBFCECEFEJFEFDEHFCFFFAFAEFCACABL gU`@ \\ÿÿÿÿÿÿ#W¥zEN8ü€iä©þC©þÿÿ‰‰:o߉C EBFCECEFEJFEFDEHFCFFFAFAEFCACABL hU`@P\\ÿÿÿÿÿÿ#W¥zEN8ý€iã©þC©þÿÿ‰‰:o߉C EBFCECEFEJFEFDEHFCFFFAFAEFCACABL kU`@ª[\\ÿÿÿÿÿÿ#W¥zEN9€iß©þC©þÿÿ‰‰:oÛ‰G EBFCECEFEJFEFDEHFCFFFAFAEFCACABL lU`@ ‹\\ÿÿÿÿÿÿ#W¥zEN9€iÞ©þC©þÿÿ‰‰:oÛ‰G EBFCECEFEJFEFDEHFCFFFAFAEFCACABL lU`@Eþ\\ÿÿÿÿÿÿ#W¥zEN9€iÜ©þC©þÿÿ‰‰:oÛ‰G EBFCECEFEJFEFDEHFCFFFAFAEFCACABL mU`@¾ VVÿÿÿÿÿÿ#W¥zEH9€ ÿÿÿÿDC4lj’E9N)€#W¥zc‚Sc5t=#W¥z2À¨ù DJP95S0J<MSFT 5.07 ,./!ù+ÿqU`@õ¡  Έ1š#W¥zˆŽqU`@EÀ <<#W¥z Έ1šˆŽqU`@õ ?? Έ1š#W¥zˆŽ--1295023820005391@mnc023.mcc295.owlan.orgqU`@þ6 <<#W¥z Έ1šˆŽp rU`@Ý9 óóÿÿÿÿÿÿ#W¥zEå9 €i=©þC©þÿÿŠŠÑóé‰J©þCŠ» EEEKFADJDFFDDAEKCACACACACACACACA EBFCECEFEJFEFDEHFCFFFAFAEFCACABOÿSMB%!è!V2\MAILSLOT\BROWSE€ü DJP95S0JY\UUªsU`@¨{^^ Έ1š#W¥zˆŽLpL  (1295023820005391@mnc023.mcc295.owlan.org îK¶õÍ9¾†Ò¬ÀsU`@ÓÄbb#W¥z Έ1šˆŽPqP  012 PÄ]i& ç¸U°M;q…sU`@ƒ9.. Έ1š#W¥zˆŽq Ì;Ê"Ù»ëÎÔ6»F‘tU`@3W<<#W¥z Έ1šˆŽtU`@'[KK#W¥z Έ1šˆŽ9 @`Ur¡wg›ÐÕÖ±üëä˜ä¿çÊcF°‡Â[Ñž³dš”l!íÃ/`ä7ÚF'Û@ÍtU`@U^>>#W¥z Έ1šˆŽ, @`Ur¢)håÚ`Ú„¨1lh𠿃Ôã ÑSq ·ÀöÞšÀ¦Átcpdump-3.9.8/./tests/espudp1.sh0000644000026300017500000000031310225055611014537 0ustar mcrmcr#!/bin/sh uudecode espudp1.puu echo -n test espudp1... ../tcpdump -t -n -E "file esp-secrets.txt" -r espudp1.pcap >espudp1.new if diff espudp1.new espudp1.out then echo passed. else echo failed. fi tcpdump-3.9.8/./tests/isakmp-pointer-loop.puu0000644000026300017500000000030707776431317017313 0ustar mcrmcrbegin 644 isakmp-pointer-loop.pcap MU,.RH0(`!````````````/__```!````DR;5/[_@!0!(````2``````$6D[H ME``"+6_:]@@`10``.H=E0`#S$0HB@:KY?H&J^5y}  ³ÄH`EÇ&€@Ï Ø› •»ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿyb@@@dÀ,,À€$ýé@@³@,€ € € `wôô…tcpdump-3.9.8/./tests/esp2.out0000644000026300017500000000362010320056204014223 0ustar mcrmcrIP 192.1.2.23 > 192.1.2.45: ESP(spi=0x12345678,seq=0x1), length 172: IP 192.1.2.23 > 192.0.1.1: ESP(spi=0xabcdabcd,seq=0x1), length 116: IP 192.0.2.1 > 192.0.1.1: ICMP echo request, id 28416, seq 1280, length 64 (ipip-proto-4) (ipip-proto-4) IP 192.1.2.23 > 192.1.2.45: ESP(spi=0x12345678,seq=0x2), length 172: IP 192.1.2.23 > 192.0.1.1: ESP(spi=0xabcdabcd,seq=0x2), length 116: IP 192.0.2.1 > 192.0.1.1: ICMP echo request, id 28416, seq 1536, length 64 (ipip-proto-4) (ipip-proto-4) IP 192.1.2.23 > 192.1.2.45: ESP(spi=0x12345678,seq=0x3), length 172: IP 192.1.2.23 > 192.0.1.1: ESP(spi=0xabcdabcd,seq=0x3), length 116: IP 192.0.2.1 > 192.0.1.1: ICMP echo request, id 28416, seq 1792, length 64 (ipip-proto-4) (ipip-proto-4) IP 192.1.2.23 > 192.1.2.45: ESP(spi=0x12345678,seq=0x4), length 172: IP 192.1.2.23 > 192.0.1.1: ESP(spi=0xabcdabcd,seq=0x4), length 116: IP 192.0.2.1 > 192.0.1.1: ICMP echo request, id 28416, seq 2048, length 64 (ipip-proto-4) (ipip-proto-4) IP 192.1.2.23 > 192.1.2.45: ESP(spi=0x12345678,seq=0x5), length 172: IP 192.1.2.23 > 192.0.1.1: ESP(spi=0xabcdabcd,seq=0x5), length 116: IP 192.0.2.1 > 192.0.1.1: ICMP echo request, id 28416, seq 2304, length 64 (ipip-proto-4) (ipip-proto-4) IP 192.1.2.23 > 192.1.2.45: ESP(spi=0x12345678,seq=0x6), length 172: IP 192.1.2.23 > 192.0.1.1: ESP(spi=0xabcdabcd,seq=0x6), length 116: IP 192.0.2.1 > 192.0.1.1: ICMP echo request, id 28416, seq 2560, length 64 (ipip-proto-4) (ipip-proto-4) IP 192.1.2.23 > 192.1.2.45: ESP(spi=0x12345678,seq=0x7), length 172: IP 192.1.2.23 > 192.0.1.1: ESP(spi=0xabcdabcd,seq=0x7), length 116: IP 192.0.2.1 > 192.0.1.1: ICMP echo request, id 28416, seq 2816, length 64 (ipip-proto-4) (ipip-proto-4) IP 192.1.2.23 > 192.1.2.45: ESP(spi=0x12345678,seq=0x8), length 172: IP 192.1.2.23 > 192.0.1.1: ESP(spi=0xabcdabcd,seq=0x8), length 116: IP 192.0.2.1 > 192.0.1.1: ICMP echo request, id 28416, seq 3072, length 64 (ipip-proto-4) (ipip-proto-4) tcpdump-3.9.8/./tests/isakmp4.out0000644000026300017500000000476310320056003014730 0ustar mcrmcrarp who-has 192.1.2.23 tell 192.1.2.254 arp reply 192.1.2.23 is-at 10:00:00:64:64:23 IP 192.1.2.254.500 > 192.1.2.23.500: isakmp: phase 1 I ident IP 192.1.2.23.500 > 192.1.2.254.500: isakmp: phase 1 R ident IP 192.1.2.254.500 > 192.1.2.23.500: isakmp: phase 1 I ident IP 192.1.2.23.500 > 192.1.2.254.500: isakmp: phase 1 R ident IP 192.1.2.254.4500 > 192.1.2.23.4500: NONESP-encap: isakmp: phase 1 I ident[E] IP 192.1.2.23.4500 > 192.1.2.254.4500: NONESP-encap: isakmp: phase 1 R ident[E] IP 192.1.2.254.4500 > 192.1.2.23.4500: NONESP-encap: isakmp: phase 2/others I oakley-quick[E] IP 192.1.2.23.4500 > 192.1.2.254.4500: NONESP-encap: isakmp: phase 2/others R oakley-quick[E] IP 192.1.2.254.4500 > 192.1.2.23.4500: NONESP-encap: isakmp: phase 2/others I oakley-quick[E] IP 192.1.2.254.4500 > 192.1.2.23.4500: UDP-encap: ESP(spi=0xf4dc0ae5,seq=0x1), length 132 arp who-has 192.1.2.254 tell 192.1.2.23 arp reply 192.1.2.254 is-at 10:00:00:de:ad:ba IP 192.1.2.23.4500 > 192.1.2.254.4500: NONESP-encap: isakmp: phase 2/others R oakley-quick[E] IP 192.1.2.254.4500 > 192.1.2.23.4500: NONESP-encap: isakmp: phase 2/others I oakley-quick[E] IP 192.1.2.254.4500 > 192.1.2.23.4500: UDP-encap: ESP(spi=0xf4dc0ae5,seq=0x2), length 132 IP 192.1.2.254.4500 > 192.1.2.23.4500: isakmp-nat-keep-alive IP 192.1.2.254.4500 > 192.1.2.23.4500: UDP-encap: ESP(spi=0xf4dc0ae5,seq=0x3), length 132 IP 192.1.2.23.4500 > 192.1.2.254.4500: NONESP-encap: isakmp: phase 2/others R oakley-quick[E] IP 192.1.2.254.4500 > 192.1.2.23.4500: NONESP-encap: isakmp: phase 2/others I oakley-quick[E] IP 192.1.2.254.4500 > 192.1.2.23.4500: UDP-encap: ESP(spi=0xf4dc0ae5,seq=0x4), length 132 IP 192.1.2.254.4500 > 192.1.2.23.4500: isakmp-nat-keep-alive IP 192.1.2.254.4500 > 192.1.2.23.4500: UDP-encap: ESP(spi=0xf4dc0ae5,seq=0x5), length 132 IP 192.1.2.254.4500 > 192.1.2.23.4500: UDP-encap: ESP(spi=0xf4dc0ae5,seq=0x6), length 132 arp who-has 192.1.2.23 tell 192.1.2.254 arp reply 192.1.2.23 is-at 10:00:00:64:64:23 IP 192.1.2.254.4500 > 192.1.2.23.4500: isakmp-nat-keep-alive IP 192.1.2.254.4500 > 192.1.2.23.4500: UDP-encap: ESP(spi=0xf4dc0ae5,seq=0x7), length 132 IP 192.1.2.23.4500 > 192.1.2.254.4500: NONESP-encap: isakmp: phase 2/others R oakley-quick[E] IP 192.1.2.254.4500 > 192.1.2.23.4500: UDP-encap: ESP(spi=0xf4dc0ae5,seq=0x8), length 132 arp who-has 192.1.2.254 tell 192.1.2.23 arp reply 192.1.2.254 is-at 10:00:00:de:ad:ba IP 192.1.2.254.4500 > 192.1.2.23.4500: isakmp-nat-keep-alive IP 192.1.2.23.4500 > 192.1.2.254.4500: NONESP-encap: isakmp: phase 2/others R inf[E] tcpdump-3.9.8/./tests/lspping-fec-rsvp.pcap0000644000026300017500000000173010064003464016672 0ustar mcrmcrÔò¡Ü ezÍ@Æ–``ÿ–ÿEXM@N? ± ¯D}¤@Íze–U Sr  ezÍ@Ï™@@ÿ!EÀ<ÅÊ>œ   ¯±(©@Íze–U@Íze›©fzÍ@s½``ÿ–ÿEXO@N= ± ¯DVË@Ízf½, Sr  fzÍ@ÿï@@ÿ!EÀ<ÅË>œ   ¯±(›µ@Ízf½,@ÍzfñÂgzÍ@½``ÿ–ÿEXQ@N; ± ¯DV}@Ízg½x Sr  gzÍ@Á@@ÿ!EÀ<ÅÍ>œ   ¯±(ÊO@Ízg½x@ÍzgÂÙhzÍ@¾``ÿ–ÿEXS@N9 ± ¯DV"@Ízh½Ñ Sr  hzÍ@2Á@@ÿ!EÀ<ÅÎ>œ   ¯±(ɺ@Ízh½Ñ@ÍzhÃizÍ@R¾``ÿ–ÿEXV@N6 ± ¯DUÔ@Ízi¾ Sr  izÍ@ŽÁ@@ÿ!EÀ<ÅÑ>œ   ¯±(ÉA@Ízi¾@ÍziÃ<tcpdump-3.9.8/./tests/espudp1.new0000644000026300017500000000144310320056212014715 0ustar mcrmcrIP 192.1.2.23.4500 > 192.1.2.45.4500: UDP-encap: ESP(spi=0x12345678,seq=0x1), length 116 IP 192.1.2.23.4500 > 192.1.2.45.4500: UDP-encap: ESP(spi=0x12345678,seq=0x2), length 116: ip-proto-227 49 IP 192.1.2.23.4500 > 192.1.2.45.4500: UDP-encap: ESP(spi=0x12345678,seq=0x3), length 116: PIMv13, length: 10 IP 192.1.2.23.4500 > 192.1.2.45.4500: UDP-encap: ESP(spi=0x12345678,seq=0x4), length 116 IP 192.1.2.23.4500 > 192.1.2.45.4500: UDP-encap: ESP(spi=0x12345678,seq=0x5), length 116 IP 192.1.2.23.4500 > 192.1.2.45.4500: UDP-encap: ESP(spi=0x12345678,seq=0x6), length 116: ip-proto-183 28 IP 192.1.2.23.4500 > 192.1.2.45.4500: UDP-encap: ESP(spi=0x12345678,seq=0x7), length 116: ip-proto-72 34 IP 192.1.2.23.4500 > 192.1.2.45.4500: UDP-encap: ESP(spi=0x12345678,seq=0x8), length 116: ip-proto-224 59 tcpdump-3.9.8/./tests/print-AA.out0000644000026300017500000001702210320056206014770 0ustar mcrmcr23:57:35.938066 IP 127.0.0.1.55920 > 127.0.0.1.80: S 928549246:928549246(0) win 32767 ..............E..<.h@.@.!R.........p.P7X.~.........!....@.... M........... 23:57:35.938122 IP 127.0.0.1.80 > 127.0.0.1.55920: S 930778609:930778609(0) ack 928549247 win 32767 ..............E..<..@.@.<..........P.p7z..7X......n.....@.... M...M....... 23:57:35.938167 IP 127.0.0.1.55920 > 127.0.0.1.80: . ack 1 win 8192 ..............E..4.j@.@.!X.........p.P7X..7z.... .7...... M...M... 23:57:35.939423 IP 127.0.0.1.55920 > 127.0.0.1.80: P 1:203(202) ack 1 win 8192 ..............E....l@.@. ..........p.P7X..7z.... ........ M...M...GET / HTTP/1.1 Host: localhost User-Agent: ELinks/0.10.4-7-debian (textmode; Linux 2.6.11-1-686-smp i686; 132x56-2) Accept: */* Accept-Encoding: gzip Accept-Language: en Connection: Keep-Alive 23:57:35.940474 IP 127.0.0.1.80 > 127.0.0.1.55920: . ack 203 win 8192 ..............E..4..@.@............P.p7z..7X.I.. .7...... M...M... 23:57:35.941232 IP 127.0.0.1.80 > 127.0.0.1.55920: P 1:5560(5559) ack 203 win 8192 ..............E.....@.@..%.........P.p7z..7X.I.. ........ M...M...HTTP/1.1 200 OK Date: Wed, 06 Jul 2005 03:57:35 GMT Server: Apache/1.3.33 Last-Modified: Sun, 15 Aug 2004 00:43:41 GMT ETag: "6e80f0-148a-411eb1bd" Accept-Ranges: bytes Content-Length: 5258 Keep-Alive: timeout=15, max=100 Connection: Keep-Alive Content-Type: text/html; charset=iso-8859-1 Placeholder page

    Placeholder page

    If you are just browsing the web

    The owner of this web site has not put up any web pages yet. Please come back later.

    Move along, nothing to see here... :-)

    If you are trying to locate the administrator of this machine

    If you want to report something about this host's behavior, please contact the Internet Service Provider (ISP) involved directly.

    See the Network Abuse Clearinghouse for how to do this.

    If you are the administrator of this machine

    The initial installation of Debian's apache web server package was successful.

    You should replace this page with your own web pages as soon as possible.

    Unless you changed its configuration, your new server is configured as follows:

    • Configuration files can be found in /etc/apache.
    • The DocumentRoot, which is the directory under which all your HTML files should exist, is set to /var/www.
    • CGI scripts are looked for in /usr/lib/cgi-bin, which is where Debian packages will place their scripts.
    • Log files are placed in /var/log/apache, and will be rotated weekly. The frequency of rotation can be easily changed by editing /etc/logrotate.d/apache.
    • The default directory index is index.html, meaning that requests for a directory /foo/bar/ will give the contents of the file /var/www/foo/bar/index.html if it exists (assuming that /var/www is your DocumentRoot).
    • User directories are enabled, and user documents will be looked for in the public_html directory of the users' homes. These dirs should be under /home, and users will not be able to symlink to files they don't own.
    All the standard apache modules are available with this release and are now managed with debconf. Type dpkg-reconfigure apache to select which modules you want enabled. Many other modules are available through the Debian package system with the names libapache-mod-*. If you need to compile a module yourself, you will need to install the apache-dev package.

    More documentation on Apache can be found on:

    You can also consult the list of World Wide Web Frequently Asked Questions for information.

    Let other people know about this server

    Netcraft provides an interesting free service for web site monitoring and statistic collection. You can let them know about your server using their interface. Enabling the monitoring of your server will provide a better global overview of who is using what and where, and it would give Debian a better overview of the apache package usage.

    About this page

    This is a placeholder page installed by the Debian release of the apache Web server package.

    This computer has installed the Debian GNU/Linux operating system, but it has nothing to do with the Debian Project. Please do not contact the Debian Project about it.

    If you find a bug in this apache package, or in Apache itself, please file a bug report on it. Instructions on doing this, and the list of known bugs of this package, can be found in the Debian Bug Tracking System.

    Thanks for using this package, and congratulations for your choice of a Debian system!

    23:57:35.941260 IP 127.0.0.1.55920 > 127.0.0.1.80: . ack 5560 win 12383 ..............E..4.n@.@.!T.........p.P7X.I7z....0_....... M...M... 23:57:37.229575 IP 127.0.0.1.55920 > 127.0.0.1.80: F 203:203(0) ack 5560 win 12383 ..............E..4.p@.@.!R.........p.P7X.I7z....0_....... M..!M... 23:57:37.230839 IP 127.0.0.1.80 > 127.0.0.1.55920: F 5560:5560(0) ack 204 win 8192 ..............E..4..@.@............P.p7z..7X.J.. ..5..... M..#M..! 23:57:37.230900 IP 127.0.0.1.55920 > 127.0.0.1.80: . ack 5561 win 12383 ..............E..4.r@.@.!P.........p.P7X.J7z....0_....... M..#M..# tcpdump-3.9.8/./tests/.#bgp_vpn_attrset.out.1.30000644000026300017500000000205410320056003017171 0ustar mcrmcrIP (tos 0xc0, ttl 62, id 58628, offset 0, flags [none], proto: TCP (6), length: 173) 12.4.4.4.2051 > 12.1.1.1.179: P, cksum 0xcf18 (correct), 3293077573:3293077694(121) ack 3348108582 win 16384 : BGP, length: 121 Update Message (2), length: 121 Origin (1), length: 1, Flags [T]: IGP AS Path (2), length: 0, Flags [T]: empty Local Preference (5), length: 4, Flags [T]: 100 Extended Community (16), length: 8, Flags [OT]: target (0x0002), Flags [none]: 300:0.0.1.44 Attribute Set (128), length: 36, Flags [OT]: Origin AS: 65001 Origin (1), length: 1, Flags [T]: IGP AS Path (2), length: 4, Flags [T]: 5555 Local Preference (5), length: 4, Flags [T]: 44 Originator ID (9), length: 4, Flags [O]: 22.5.5.5 Cluster List (10), length: 4, Flags [O]: 22.5.5.5 Multi-Protocol Reach NLRI (14), length: 30, Flags [OE]: AFI: IPv4 (1), SAFI: labeled VPN Unicast (128) nexthop: RD: 0:0.0.0.0, 12.4.4.4, no SNPA RD: 500:0.0.1.244, 133.0.0.0/8, label:100208 (bottom) tcpdump-3.9.8/./tests/ospf-gmpls.pcap0000644000026300017500000000120010320056212015544 0ustar mcrmcrÔò¡v®Ù\?õ¤°°EÀ¬ÔYŸ;(#à˜ ÿõ#©Š   ÿõ%€x>|d ÿõE Ž Ž?L”PÀL”PÀ L”PÀL”PÀL”PÀL”PÀL”PÀL”PÀL”PÀL”PÀ äÙ\?Ì °°EÀ¬ YŸ(#à˜ ÿõ#oÄ   ÿõ%€°|d ÿõE  ?L”PÀL”PÀ L”PÀL”PÀL”PÀL”PÀL”PÀL”PÀL”PÀL”PÀ Ú\?5<ØØEÀÔ@Yž§(#àÀ ÿõ#Ú7  ÿõ#€!¤Œ ÿõ( (# (# K>¼ K>¼  ,K>¼ (tcpdump-3.9.8/./tests/esp1.out0000644000026300017500000000237010320056204014223 0ustar mcrmcrIP 192.1.2.23 > 192.1.2.45: ESP(spi=0x12345678,seq=0x1), length 116: IP 192.0.2.1 > 192.0.1.1: ICMP echo request, id 28416, seq 1280, length 64 (ipip-proto-4) IP 192.1.2.23 > 192.1.2.45: ESP(spi=0x12345678,seq=0x2), length 116: IP 192.0.2.1 > 192.0.1.1: ICMP echo request, id 28416, seq 1536, length 64 (ipip-proto-4) IP 192.1.2.23 > 192.1.2.45: ESP(spi=0x12345678,seq=0x3), length 116: IP 192.0.2.1 > 192.0.1.1: ICMP echo request, id 28416, seq 1792, length 64 (ipip-proto-4) IP 192.1.2.23 > 192.1.2.45: ESP(spi=0x12345678,seq=0x4), length 116: IP 192.0.2.1 > 192.0.1.1: ICMP echo request, id 28416, seq 2048, length 64 (ipip-proto-4) IP 192.1.2.23 > 192.1.2.45: ESP(spi=0x12345678,seq=0x5), length 116: IP 192.0.2.1 > 192.0.1.1: ICMP echo request, id 28416, seq 2304, length 64 (ipip-proto-4) IP 192.1.2.23 > 192.1.2.45: ESP(spi=0x12345678,seq=0x6), length 116: IP 192.0.2.1 > 192.0.1.1: ICMP echo request, id 28416, seq 2560, length 64 (ipip-proto-4) IP 192.1.2.23 > 192.1.2.45: ESP(spi=0x12345678,seq=0x7), length 116: IP 192.0.2.1 > 192.0.1.1: ICMP echo request, id 28416, seq 2816, length 64 (ipip-proto-4) IP 192.1.2.23 > 192.1.2.45: ESP(spi=0x12345678,seq=0x8), length 116: IP 192.0.2.1 > 192.0.1.1: ICMP echo request, id 28416, seq 3072, length 64 (ipip-proto-4) tcpdump-3.9.8/./tests/chdlc-slarp-short.pcap0000644000026300017500000000007210233721361017023 0ustar mcrmcrÔò¡`h‚ËX@iÜ €5 1W@^&ÿtcpdump-3.9.8/./tests/print-x.new0000644000026300017500000005077010320056212014744 0ustar mcrmcr23:57:35.938066 IP 127.0.0.1.55920 > 127.0.0.1.80: S 928549246:928549246(0) win 32767 0x0000: 4500 003c 1b68 4000 4006 2152 7f00 0001 0x0010: 7f00 0001 da70 0050 3758 897e 0000 0000 0x0020: a002 7fff 1421 0000 0204 400c 0402 080a 0x0030: 4ddc 9216 0000 0000 0103 0302 23:57:35.938122 IP 127.0.0.1.80 > 127.0.0.1.55920: S 930778609:930778609(0) ack 928549247 win 32767 0x0000: 4500 003c 0000 4000 4006 3cba 7f00 0001 0x0010: 7f00 0001 0050 da70 377a 8df1 3758 897f 0x0020: a012 7fff 6eb1 0000 0204 400c 0402 080a 0x0030: 4ddc 9216 4ddc 9216 0103 0302 23:57:35.938167 IP 127.0.0.1.55920 > 127.0.0.1.80: . ack 1 win 8192 0x0000: 4500 0034 1b6a 4000 4006 2158 7f00 0001 0x0010: 7f00 0001 da70 0050 3758 897f 377a 8df2 0x0020: 8010 2000 37d0 0000 0101 080a 4ddc 9216 0x0030: 4ddc 9216 23:57:35.939423 IP 127.0.0.1.55920 > 127.0.0.1.80: P 1:203(202) ack 1 win 8192 0x0000: 4500 00fe 1b6c 4000 4006 208c 7f00 0001 0x0010: 7f00 0001 da70 0050 3758 897f 377a 8df2 0x0020: 8018 2000 fef2 0000 0101 080a 4ddc 9217 0x0030: 4ddc 9216 4745 5420 2f20 4854 5450 2f31 0x0040: 2e31 0d0a 486f 7374 3a20 6c6f 6361 6c68 0x0050: 6f73 740d 0a55 7365 722d 4167 656e 743a 0x0060: 2045 4c69 6e6b 732f 302e 3130 2e34 2d37 0x0070: 2d64 6562 6961 6e20 2874 6578 746d 6f64 0x0080: 653b 204c 696e 7578 2032 2e36 2e31 312d 0x0090: 312d 3638 362d 736d 7020 6936 3836 3b20 0x00a0: 3133 3278 3536 2d32 290d 0a41 6363 6570 0x00b0: 743a 202a 2f2a 0d0a 4163 6365 7074 2d45 0x00c0: 6e63 6f64 696e 673a 2067 7a69 700d 0a41 0x00d0: 6363 6570 742d 4c61 6e67 7561 6765 3a20 0x00e0: 656e 0d0a 436f 6e6e 6563 7469 6f6e 3a20 0x00f0: 4b65 6570 2d41 6c69 7665 0d0a 0d0a 23:57:35.940474 IP 127.0.0.1.80 > 127.0.0.1.55920: . ack 203 win 8192 0x0000: 4500 0034 1fe4 4000 4006 1cde 7f00 0001 0x0010: 7f00 0001 0050 da70 377a 8df2 3758 8a49 0x0020: 8010 2000 3703 0000 0101 080a 4ddc 9218 0x0030: 4ddc 9217 23:57:35.941232 IP 127.0.0.1.80 > 127.0.0.1.55920: P 1:5560(5559) ack 203 win 8192 0x0000: 4500 15eb 1fe6 4000 4006 0725 7f00 0001 0x0010: 7f00 0001 0050 da70 377a 8df2 3758 8a49 0x0020: 8018 2000 13e0 0000 0101 080a 4ddc 9219 0x0030: 4ddc 9217 4854 5450 2f31 2e31 2032 3030 0x0040: 204f 4b0d 0a44 6174 653a 2057 6564 2c20 0x0050: 3036 204a 756c 2032 3030 3520 3033 3a35 0x0060: 373a 3335 2047 4d54 0d0a 5365 7276 6572 0x0070: 3a20 4170 6163 6865 2f31 2e33 2e33 330d 0x0080: 0a4c 6173 742d 4d6f 6469 6669 6564 3a20 0x0090: 5375 6e2c 2031 3520 4175 6720 3230 3034 0x00a0: 2030 303a 3433 3a34 3120 474d 540d 0a45 0x00b0: 5461 673a 2022 3665 3830 6630 2d31 3438 0x00c0: 612d 3431 3165 6231 6264 220d 0a41 6363 0x00d0: 6570 742d 5261 6e67 6573 3a20 6279 7465 0x00e0: 730d 0a43 6f6e 7465 6e74 2d4c 656e 6774 0x00f0: 683a 2035 3235 380d 0a4b 6565 702d 416c 0x0100: 6976 653a 2074 696d 656f 7574 3d31 352c 0x0110: 206d 6178 3d31 3030 0d0a 436f 6e6e 6563 0x0120: 7469 6f6e 3a20 4b65 6570 2d41 6c69 7665 0x0130: 0d0a 436f 6e74 656e 742d 5479 7065 3a20 0x0140: 7465 7874 2f68 746d 6c3b 2063 6861 7273 0x0150: 6574 3d69 736f 2d38 3835 392d 310d 0a0d 0x0160: 0a3c 2144 4f43 5459 5045 2048 544d 4c20 0x0170: 5055 424c 4943 2022 2d2f 2f57 3343 2f2f 0x0180: 4454 4420 4854 4d4c 2034 2e30 3120 5472 0x0190: 616e 7369 7469 6f6e 616c 2f2f 454e 223e 0x01a0: 0a3c 4854 4d4c 3e0a 3c48 4541 443e 0a20 0x01b0: 2020 3c4d 4554 4120 4854 5450 2d45 5155 0x01c0: 4956 3d22 436f 6e74 656e 742d 5479 7065 0x01d0: 2220 434f 4e54 454e 543d 2274 6578 742f 0x01e0: 6874 6d6c 3b20 6368 6172 7365 743d 6973 0x01f0: 6f2d 3838 3539 2d31 223e 0a20 2020 3c4d 0x0200: 4554 4120 4e41 4d45 3d22 4465 7363 7269 0x0210: 7074 696f 6e22 2043 4f4e 5445 4e54 3d22 0x0220: 5468 6520 696e 6974 6961 6c20 696e 7374 0x0230: 616c 6c61 7469 6f6e 206f 6620 4465 6269 0x0240: 616e 2061 7061 6368 652e 223e 0a20 2020 0x0250: 3c54 4954 4c45 3e50 6c61 6365 686f 6c64 0x0260: 6572 2070 6167 653c 2f54 4954 4c45 3e0a 0x0270: 3c2f 4845 4144 3e0a 3c42 4f44 5920 5445 0x0280: 5854 3d22 2330 3030 3030 3022 2042 4743 0x0290: 4f4c 4f52 3d22 2346 4646 4646 4622 204c 0x02a0: 494e 4b3d 2223 3030 3030 4546 2220 564c 0x02b0: 494e 4b3d 2223 3535 3138 3841 2220 414c 0x02c0: 494e 4b3d 2223 4646 3030 3030 223e 0a0a 0x02d0: 3c48 313e 506c 6163 6568 6f6c 6465 7220 0x02e0: 7061 6765 3c2f 4831 3e0a 3c48 323e 4966 0x02f0: 2079 6f75 2061 7265 206a 7573 7420 6272 0x0300: 6f77 7369 6e67 2074 6865 2077 6562 3c2f 0x0310: 6832 3e0a 0a3c 503e 5468 6520 6f77 6e65 0x0320: 7220 6f66 2074 6869 7320 7765 6220 7369 0x0330: 7465 2068 6173 206e 6f74 2070 7574 2075 0x0340: 7020 616e 7920 7765 6220 7061 6765 7320 0x0350: 7965 742e 0a50 6c65 6173 6520 636f 6d65 0x0360: 2062 6163 6b20 6c61 7465 722e 3c2f 503e 0x0370: 0a0a 3c50 3e3c 534d 414c 4c3e 3c43 4954 0x0380: 453e 4d6f 7665 2061 6c6f 6e67 2c20 6e6f 0x0390: 7468 696e 6720 746f 2073 6565 2068 6572 0x03a0: 652e 2e2e 3c2f 4349 5445 3e20 3a2d 293c 0x03b0: 2f53 4d41 4c4c 3e3c 2f50 3e0a 0a3c 4832 0x03c0: 3e49 6620 796f 7520 6172 6520 7472 7969 0x03d0: 6e67 2074 6f20 6c6f 6361 7465 2074 6865 0x03e0: 2061 646d 696e 6973 7472 6174 6f72 206f 0x03f0: 6620 7468 6973 206d 6163 6869 6e65 3c2f 0x0400: 4832 3e0a 0a3c 503e 4966 2079 6f75 2077 0x0410: 616e 7420 746f 2072 6570 6f72 7420 736f 0x0420: 6d65 7468 696e 6720 6162 6f75 7420 7468 0x0430: 6973 2068 6f73 7427 7320 6265 6861 7669 0x0440: 6f72 2c20 706c 6561 7365 0a63 6f6e 7461 0x0450: 6374 2074 6865 2049 6e74 6572 6e65 7420 0x0460: 5365 7276 6963 6520 5072 6f76 6964 6572 0x0470: 2028 4953 5029 2069 6e76 6f6c 7665 6420 0x0480: 6469 7265 6374 6c79 2e3c 2f50 3e0a 0a3c 0x0490: 503e 5365 6520 7468 6520 3c41 2068 7265 0x04a0: 663d 2268 7474 703a 2f2f 7777 772e 6162 0x04b0: 7573 652e 6e65 742f 223e 4e65 7477 6f72 0x04c0: 6b20 4162 7573 650a 436c 6561 7269 6e67 0x04d0: 686f 7573 653c 2f41 3e20 666f 7220 686f 0x04e0: 7720 746f 2064 6f20 7468 6973 2e3c 2f50 0x04f0: 3e0a 0a3c 4832 3e49 6620 796f 7520 6172 0x0500: 6520 7468 6520 6164 6d69 6e69 7374 7261 0x0510: 746f 7220 6f66 2074 6869 7320 6d61 6368 0x0520: 696e 653c 2f48 323e 0a0a 3c50 3e54 6865 0x0530: 2069 6e69 7469 616c 2069 6e73 7461 6c6c 0x0540: 6174 696f 6e20 6f66 203c 4120 6872 6566 0x0550: 3d22 6874 7470 3a2f 2f77 7777 2e64 6562 0x0560: 6961 6e2e 6f72 672f 223e 4465 6269 616e 0x0570: 2773 0a61 7061 6368 653c 2f41 3e20 7765 0x0580: 6220 7365 7276 6572 2070 6163 6b61 6765 0x0590: 2077 6173 2073 7563 6365 7373 6675 6c2e 0x05a0: 3c2f 503e 0a0a 3c50 3e3c 5354 524f 4e47 0x05b0: 3e59 6f75 2073 686f 756c 6420 7265 706c 0x05c0: 6163 6520 7468 6973 2070 6167 6520 7769 0x05d0: 7468 2079 6f75 7220 6f77 6e20 7765 6220 0x05e0: 7061 6765 7320 6173 0a73 6f6f 6e20 6173 0x05f0: 2070 6f73 7369 626c 652e 3c2f 5354 524f 0x0600: 4e47 3e3c 2f50 3e0a 0a3c 503e 556e 6c65 0x0610: 7373 2079 6f75 2063 6861 6e67 6564 2069 0x0620: 7473 2063 6f6e 6669 6775 7261 7469 6f6e 0x0630: 2c20 796f 7572 206e 6577 2073 6572 7665 0x0640: 7220 6973 2063 6f6e 6669 6775 7265 6420 0x0650: 6173 2066 6f6c 6c6f 7773 3a0a 3c55 4c3e 0x0660: 0a3c 4c49 3e0a 436f 6e66 6967 7572 6174 0x0670: 696f 6e20 6669 6c65 7320 6361 6e20 6265 0x0680: 2066 6f75 6e64 2069 6e20 3c54 543e 2f65 0x0690: 7463 2f61 7061 6368 653c 2f54 543e 2e3c 0x06a0: 2f4c 493e 0a0a 3c4c 493e 0a54 6865 203c 0x06b0: 5454 3e44 6f63 756d 656e 7452 6f6f 743c 0x06c0: 2f54 543e 2c20 7768 6963 6820 6973 2074 0x06d0: 6865 2064 6972 6563 746f 7279 2075 6e64 0x06e0: 6572 2077 6869 6368 2061 6c6c 2079 6f75 0x06f0: 720a 4854 4d4c 2066 696c 6573 2073 686f 0x0700: 756c 6420 6578 6973 742c 2069 7320 7365 0x0710: 7420 746f 203c 5454 3e2f 7661 722f 7777 0x0720: 773c 2f54 543e 2e3c 2f4c 493e 0a0a 3c4c 0x0730: 493e 0a43 4749 2073 6372 6970 7473 2061 0x0740: 7265 206c 6f6f 6b65 6420 666f 7220 696e 0x0750: 203c 5454 3e2f 7573 722f 6c69 622f 6367 0x0760: 692d 6269 6e3c 2f54 543e 2c20 7768 6963 0x0770: 6820 6973 2077 6865 7265 0a44 6562 6961 0x0780: 6e20 7061 636b 6167 6573 2077 696c 6c20 0x0790: 706c 6163 6520 7468 6569 7220 7363 7269 0x07a0: 7074 732e 3c2f 4c49 3e0a 0a3c 4c49 3e0a 0x07b0: 4c6f 6720 6669 6c65 7320 6172 6520 706c 0x07c0: 6163 6564 2069 6e20 3c54 543e 2f76 6172 0x07d0: 2f6c 6f67 2f61 7061 6368 653c 2f54 543e 0x07e0: 2c20 616e 6420 7769 6c6c 2062 6520 726f 0x07f0: 7461 7465 640a 7765 656b 6c79 2e20 2054 0x0800: 6865 2066 7265 7175 656e 6379 206f 6620 0x0810: 726f 7461 7469 6f6e 2063 616e 2062 6520 0x0820: 6561 7369 6c79 2063 6861 6e67 6564 2062 0x0830: 7920 6564 6974 696e 670a 3c54 543e 2f65 0x0840: 7463 2f6c 6f67 726f 7461 7465 2e64 2f61 0x0850: 7061 6368 653c 2f54 543e 2e3c 2f4c 493e 0x0860: 0a0a 3c4c 493e 0a54 6865 2064 6566 6175 0x0870: 6c74 2064 6972 6563 746f 7279 2069 6e64 0x0880: 6578 2069 7320 3c54 543e 696e 6465 782e 0x0890: 6874 6d6c 3c2f 5454 3e2c 206d 6561 6e69 0x08a0: 6e67 2074 6861 7420 7265 7175 6573 7473 0x08b0: 0a66 6f72 2061 2064 6972 6563 746f 7279 0x08c0: 203c 5454 3e2f 666f 6f2f 6261 722f 3c2f 0x08d0: 5454 3e20 7769 6c6c 2067 6976 6520 7468 0x08e0: 6520 636f 6e74 656e 7473 206f 6620 7468 0x08f0: 6520 6669 6c65 203c 5454 3e2f 7661 722f 0x0900: 7777 772f 666f 6f2f 6261 722f 696e 6465 0x0910: 782e 6874 6d6c 3c2f 5454 3e0a 6966 2069 0x0920: 7420 6578 6973 7473 2028 6173 7375 6d69 0x0930: 6e67 2074 6861 7420 3c54 543e 2f76 6172 0x0940: 2f77 7777 3c2f 5454 3e20 6973 2079 6f75 0x0950: 7220 3c54 543e 446f 6375 6d65 6e74 526f 0x0960: 6f74 3c2f 5454 3e29 2e3c 2f4c 493e 0a0a 0x0970: 3c4c 493e 0a55 7365 7220 6469 7265 6374 0x0980: 6f72 6965 7320 6172 6520 656e 6162 6c65 0x0990: 642c 2061 6e64 2075 7365 7220 646f 6375 0x09a0: 6d65 6e74 7320 7769 6c6c 2062 6520 6c6f 0x09b0: 6f6b 6564 2066 6f72 0a69 6e20 7468 6520 0x09c0: 3c54 543e 7075 626c 6963 5f68 746d 6c3c 0x09d0: 2f54 543e 2064 6972 6563 746f 7279 206f 0x09e0: 6620 7468 6520 7573 6572 7327 2068 6f6d 0x09f0: 6573 2e20 2054 6865 7365 2064 6972 730a 0x0a00: 7368 6f75 6c64 2062 6520 756e 6465 7220 0x0a10: 3c54 543e 2f68 6f6d 653c 2f54 543e 2c20 0x0a20: 616e 6420 7573 6572 7320 7769 6c6c 206e 0x0a30: 6f74 2062 6520 6162 6c65 2074 6f20 7379 0x0a40: 6d6c 696e 6b0a 746f 2066 696c 6573 2074 0x0a50: 6865 7920 646f 6e27 7420 6f77 6e2e 3c2f 0x0a60: 4c49 3e0a 0a3c 2f55 4c3e 0a41 6c6c 2074 0x0a70: 6865 2073 7461 6e64 6172 6420 6170 6163 0x0a80: 6865 206d 6f64 756c 6573 2061 7265 2061 0x0a90: 7661 696c 6162 6c65 2077 6974 6820 7468 0x0aa0: 6973 2072 656c 6561 7365 2061 6e64 2061 0x0ab0: 7265 0a6e 6f77 206d 616e 6167 6564 2077 0x0ac0: 6974 6820 6465 6263 6f6e 662e 2020 5479 0x0ad0: 7065 203c 5454 3e64 706b 672d 7265 636f 0x0ae0: 6e66 6967 7572 6520 6170 6163 6865 3c2f 0x0af0: 5454 3e20 746f 0a73 656c 6563 7420 7768 0x0b00: 6963 6820 6d6f 6475 6c65 7320 796f 7520 0x0b10: 7761 6e74 2065 6e61 626c 6564 2e20 204d 0x0b20: 616e 7920 6f74 6865 7220 6d6f 6475 6c65 0x0b30: 7320 6172 6520 6176 6169 6c61 626c 650a 0x0b40: 7468 726f 7567 6820 7468 6520 4465 6269 0x0b50: 616e 2070 6163 6b61 6765 2073 7973 7465 0x0b60: 6d20 7769 7468 2074 6865 206e 616d 6573 0x0b70: 203c 5454 3e6c 6962 6170 6163 6865 2d6d 0x0b80: 6f64 2d2a 3c2f 5454 3e2e 0a49 6620 796f 0x0b90: 7520 6e65 6564 2074 6f20 636f 6d70 696c 0x0ba0: 6520 6120 6d6f 6475 6c65 2079 6f75 7273 0x0bb0: 656c 662c 2079 6f75 2077 696c 6c20 6e65 0x0bc0: 6564 2074 6f20 696e 7374 616c 6c20 7468 0x0bd0: 650a 3c54 543e 6170 6163 6865 2d64 6576 0x0be0: 3c2f 5454 3e20 7061 636b 6167 652e 0a0a 0x0bf0: 3c50 3e4d 6f72 6520 646f 6375 6d65 6e74 0x0c00: 6174 696f 6e20 6f6e 2041 7061 6368 6520 0x0c10: 6361 6e20 6265 2066 6f75 6e64 206f 6e3a 0x0c20: 0a3c 554c 3e0a 3c4c 493e 0a54 6865 203c 0x0c30: 4120 4852 4546 3d22 2f64 6f63 2f61 7061 0x0c40: 6368 652d 646f 632f 6d61 6e75 616c 2f22 0x0c50: 3e41 7061 6368 6520 646f 6375 6d65 6e74 0x0c60: 6174 696f 6e3c 2f41 3e20 7374 6f72 6564 0x0c70: 206f 6e20 796f 7572 2073 6572 7665 722e 0x0c80: 3c2f 4c49 3e0a 0a3c 4c49 3e0a 5468 6520 0x0c90: 3c41 2048 5245 463d 2268 7474 703a 2f2f 0x0ca0: 7777 772e 6170 6163 6865 2e6f 7267 2f22 0x0cb0: 3e41 7061 6368 6520 5072 6f6a 6563 743c 0x0cc0: 2f41 3e20 686f 6d65 2073 6974 652e 3c2f 0x0cd0: 4c49 3e0a 0a3c 4c49 3e0a 5468 6520 3c41 0x0ce0: 2048 5245 463d 2268 7474 703a 2f2f 7777 0x0cf0: 772e 6170 6163 6865 2d73 736c 2e6f 7267 0x0d00: 2f22 3e41 7061 6368 652d 5353 4c3c 2f41 0x0d10: 3e20 686f 6d65 2073 6974 652e 3c2f 4c49 0x0d20: 3e0a 0a3c 4c49 3e0a 5468 6520 3c41 2048 0x0d30: 5245 463d 2268 7474 703a 2f2f 7065 726c 0x0d40: 2e61 7061 6368 652e 6f72 672f 223e 6d6f 0x0d50: 6420 7065 726c 3c2f 413e 2068 6f6d 6520 0x0d60: 7369 7465 2e3c 2f4c 493e 0a0a 3c4c 493e 0x0d70: 0a54 6865 203c 4120 4852 4546 3d22 6874 0x0d80: 7470 3a2f 2f77 7777 2e61 7061 6368 6577 0x0d90: 6565 6b2e 636f 6d2f 223e 4170 6163 6865 0x0da0: 5765 656b 3c2f 413e 206e 6577 736c 6574 0x0db0: 7465 722e 3c2f 4c49 3e0a 0a3c 4c49 3e0a 0x0dc0: 5468 6520 3c41 2048 5245 463d 2268 7474 0x0dd0: 703a 2f2f 7777 772e 6465 6269 616e 2e6f 0x0de0: 7267 2f64 6f63 2f22 3e44 6562 6961 6e20 0x0df0: 5072 6f6a 6563 740a 446f 6375 6d65 6e74 0x0e00: 6174 696f 6e3c 2f41 3e20 7768 6963 6820 0x0e10: 636f 6e74 6169 6e73 2048 4f57 544f 732c 0x0e20: 2046 4151 732c 2061 6e64 2073 6f66 7477 0x0e30: 6172 6520 7570 6461 7465 732e 3c2f 4c49 0x0e40: 3e0a 3c2f 554c 3e0a 0a3c 503e 596f 7520 0x0e50: 6361 6e20 616c 736f 2063 6f6e 7375 6c74 0x0e60: 2074 6865 206c 6973 7420 6f66 203c 4120 0x0e70: 4852 4546 3d22 6874 7470 3a2f 2f77 7777 0x0e80: 2e62 6f75 7465 6c6c 2e63 6f6d 2f66 6171 0x0e90: 2f22 3e57 6f72 6c64 0a57 6964 6520 5765 0x0ea0: 6220 4672 6571 7565 6e74 6c79 2041 736b 0x0eb0: 6564 2051 7565 7374 696f 6e73 3c2f 413e 0x0ec0: 2066 6f72 2069 6e66 6f72 6d61 7469 6f6e 0x0ed0: 2e0a 0a3c 4832 3e4c 6574 206f 7468 6572 0x0ee0: 2070 656f 706c 6520 6b6e 6f77 2061 626f 0x0ef0: 7574 2074 6869 7320 7365 7276 6572 3c2f 0x0f00: 4832 3e0a 0a3c 4120 4852 4546 3d22 6874 0x0f10: 7470 3a2f 2f6e 6574 6372 6166 742e 636f 0x0f20: 6d2f 223e 4e65 7463 7261 6674 3c2f 413e 0x0f30: 2070 726f 7669 6465 7320 616e 2069 6e74 0x0f40: 6572 6573 7469 6e67 2066 7265 650a 7365 0x0f50: 7276 6963 6520 666f 7220 7765 6220 7369 0x0f60: 7465 206d 6f6e 6974 6f72 696e 6720 616e 0x0f70: 6420 7374 6174 6973 7469 6320 636f 6c6c 0x0f80: 6563 7469 6f6e 2e0a 596f 7520 6361 6e20 0x0f90: 6c65 7420 7468 656d 206b 6e6f 7720 6162 0x0fa0: 6f75 7420 796f 7572 2073 6572 7665 7220 0x0fb0: 7573 696e 6720 7468 6569 720a 3c41 2048 0x0fc0: 5245 463d 2268 7474 703a 2f2f 7570 7469 0x0fd0: 6d65 2e6e 6574 6372 6166 742e 636f 6d2f 0x0fe0: 223e 696e 7465 7266 6163 653c 2f41 3e2e 0x0ff0: 0a45 6e61 626c 696e 6720 7468 6520 6d6f 0x1000: 6e69 746f 7269 6e67 206f 6620 796f 7572 0x1010: 2073 6572 7665 7220 7769 6c6c 2070 726f 0x1020: 7669 6465 2061 2062 6574 7465 7220 676c 0x1030: 6f62 616c 206f 7665 7276 6965 770a 6f66 0x1040: 2077 686f 2069 7320 7573 696e 6720 7768 0x1050: 6174 2061 6e64 2077 6865 7265 2c20 616e 0x1060: 6420 6974 2077 6f75 6c64 2067 6976 6520 0x1070: 4465 6269 616e 2061 2062 6574 7465 720a 0x1080: 6f76 6572 7669 6577 206f 6620 7468 6520 0x1090: 6170 6163 6865 2070 6163 6b61 6765 2075 0x10a0: 7361 6765 2e0a 0a3c 4832 3e41 626f 7574 0x10b0: 2074 6869 7320 7061 6765 3c2f 4832 3e0a 0x10c0: 0a3c 494d 4720 414c 4947 4e3d 2272 6967 0x10d0: 6874 2220 414c 543d 2222 2048 4549 4748 0x10e0: 543d 2232 3437 2220 5749 4454 483d 2232 0x10f0: 3738 2220 5352 433d 2269 636f 6e73 2f6a 0x1100: 6865 3036 312e 706e 6722 3e0a 0a3c 503e 0x1110: 5468 6973 2069 7320 6120 706c 6163 6568 0x1120: 6f6c 6465 7220 7061 6765 2069 6e73 7461 0x1130: 6c6c 6564 2062 7920 7468 6520 3c41 0a48 0x1140: 5245 463d 2268 7474 703a 2f2f 7777 772e 0x1150: 6465 6269 616e 2e6f 7267 2f22 3e44 6562 0x1160: 6961 6e3c 2f41 3e0a 7265 6c65 6173 6520 0x1170: 6f66 2074 6865 2061 7061 6368 6520 5765 0x1180: 6220 7365 7276 6572 2070 6163 6b61 6765 0x1190: 2e0a 0a3c 503e 5468 6973 2063 6f6d 7075 0x11a0: 7465 7220 6861 7320 696e 7374 616c 6c65 0x11b0: 6420 7468 6520 4465 6269 616e 2047 4e55 0x11c0: 2f4c 696e 7578 206f 7065 7261 7469 6e67 0x11d0: 2073 7973 7465 6d2c 0a62 7574 2069 7420 0x11e0: 6861 7320 3c73 7472 6f6e 673e 6e6f 7468 0x11f0: 696e 6720 746f 2064 6f20 7769 7468 2074 0x1200: 6865 2044 6562 6961 6e0a 5072 6f6a 6563 0x1210: 743c 2f73 7472 6f6e 673e 2e20 506c 6561 0x1220: 7365 2064 6f20 3c73 7472 6f6e 673e 6e6f 0x1230: 743c 2f73 7472 6f6e 673e 2063 6f6e 7461 0x1240: 6374 2074 6865 2044 6562 6961 6e0a 5072 0x1250: 6f6a 6563 7420 6162 6f75 7420 6974 2e3c 0x1260: 2f50 3e0a 0a3c 503e 4966 2079 6f75 2066 0x1270: 696e 6420 6120 6275 6720 696e 2074 6869 0x1280: 7320 6170 6163 6865 2070 6163 6b61 6765 0x1290: 2c20 6f72 2069 6e20 4170 6163 6865 2069 0x12a0: 7473 656c 662c 0a70 6c65 6173 6520 6669 0x12b0: 6c65 2061 2062 7567 2072 6570 6f72 7420 0x12c0: 6f6e 2069 742e 2020 496e 7374 7275 6374 0x12d0: 696f 6e73 206f 6e20 646f 696e 6720 7468 0x12e0: 6973 2c20 616e 6420 7468 650a 6c69 7374 0x12f0: 206f 6620 3c41 2048 5245 463d 2268 7474 0x1300: 703a 2f2f 6275 6773 2e64 6562 6961 6e2e 0x1310: 6f72 672f 7372 633a 6170 6163 6865 223e 0x1320: 6b6e 6f77 6e20 6275 6773 3c2f 413e 206f 0x1330: 6620 7468 6973 0a70 6163 6b61 6765 2c20 0x1340: 6361 6e20 6265 2066 6f75 6e64 2069 6e20 0x1350: 7468 6520 0a3c 4120 4852 4546 3d22 6874 0x1360: 7470 3a2f 2f77 7777 2e64 6562 6961 6e2e 0x1370: 6f72 672f 4275 6773 2f52 6570 6f72 7469 0x1380: 6e67 223e 4465 6269 616e 2042 7567 2054 0x1390: 7261 636b 696e 6720 5379 7374 656d 3c2f 0x13a0: 413e 2e0a 0a3c 503e 5468 616e 6b73 2066 0x13b0: 6f72 2075 7369 6e67 2074 6869 7320 7061 0x13c0: 636b 6167 652c 2061 6e64 2063 6f6e 6772 0x13d0: 6174 756c 6174 696f 6e73 2066 6f72 2079 0x13e0: 6f75 7220 6368 6f69 6365 206f 660a 6120 0x13f0: 4465 6269 616e 2073 7973 7465 6d21 3c2f 0x1400: 503e 0a0a 3c44 4956 2061 6c69 676e 3d22 0x1410: 6365 6e74 6572 223e 0a3c 6120 6872 6566 0x1420: 3d22 6874 7470 3a2f 2f77 7777 2e64 6562 0x1430: 6961 6e2e 6f72 672f 223e 0a3c 494d 4720 0x1440: 616c 6967 6e3d 226d 6964 646c 6522 2068 0x1450: 6569 6768 743d 2233 3022 2077 6964 7468 0x1460: 3d22 3235 2220 7372 633d 2269 636f 6e73 0x1470: 2f64 6562 6961 6e2f 6f70 656e 6c6f 676f 0x1480: 2d32 352e 6a70 6722 2061 6c74 3d22 4465 0x1490: 6269 616e 223e 0a3c 2f61 3e0a 3c61 2068 0x14a0: 7265 663d 2268 7474 703a 2f2f 7777 772e 0x14b0: 6170 6163 6865 2e6f 7267 2f22 3e0a 3c49 0x14c0: 4d47 2061 6c69 676e 3d22 6d69 6464 6c65 0x14d0: 2220 6865 6967 6874 3d22 3332 2220 7769 0x14e0: 6474 683d 2232 3539 2220 7372 633d 2269 0x14f0: 636f 6e73 2f61 7061 6368 655f 7062 2e70 0x1500: 6e67 2220 616c 743d 2241 7061 6368 6522 0x1510: 3e0a 3c2f 613e 0a3c 2f44 4956 3e0a 0a3c 0x1520: 212d 2d0a 2020 5468 6973 2070 6167 6520 0x1530: 7761 7320 696e 6974 6961 6c6c 7920 6372 0x1540: 6561 7465 6420 6279 204a 6f68 6e69 6520 0x1550: 496e 6772 616d 2028 6874 7470 3a2f 2f6e 0x1560: 6574 676f 642e 6e65 742f 290a 2020 4974 0x1570: 2077 6173 206c 6174 6572 2065 6469 7465 0x1580: 6420 6279 204d 6174 7468 6577 2057 696c 0x1590: 636f 7820 616e 6420 4a6f 7369 7020 526f 0x15a0: 6469 6e2e 0a20 204c 6173 7420 6d6f 6469 0x15b0: 6669 6564 3a20 2444 6174 653a 2032 3030 0x15c0: 342f 3036 2f32 3020 3135 3a33 333a 3537 0x15d0: 2024 2e0a 2020 2d2d 3e0a 0a3c 2f42 4f44 0x15e0: 593e 0a3c 2f48 544d 4c3e 0a 23:57:35.941260 IP 127.0.0.1.55920 > 127.0.0.1.80: . ack 5560 win 12383 0x0000: 4500 0034 1b6e 4000 4006 2154 7f00 0001 0x0010: 7f00 0001 da70 0050 3758 8a49 377a a3a9 0x0020: 8010 305f 10ea 0000 0101 080a 4ddc 9219 0x0030: 4ddc 9219 23:57:37.229575 IP 127.0.0.1.55920 > 127.0.0.1.80: F 203:203(0) ack 5560 win 12383 0x0000: 4500 0034 1b70 4000 4006 2152 7f00 0001 0x0010: 7f00 0001 da70 0050 3758 8a49 377a a3a9 0x0020: 8011 305f 0be1 0000 0101 080a 4ddc 9721 0x0030: 4ddc 9219 23:57:37.230839 IP 127.0.0.1.80 > 127.0.0.1.55920: F 5560:5560(0) ack 204 win 8192 0x0000: 4500 0034 1fe8 4000 4006 1cda 7f00 0001 0x0010: 7f00 0001 0050 da70 377a a3a9 3758 8a4a 0x0020: 8011 2000 1735 0000 0101 080a 4ddc 9723 0x0030: 4ddc 9721 23:57:37.230900 IP 127.0.0.1.55920 > 127.0.0.1.80: . ack 5561 win 12383 0x0000: 4500 0034 1b72 4000 4006 2150 7f00 0001 0x0010: 7f00 0001 da70 0050 3758 8a4a 377a a3aa 0x0020: 8010 305f 06d4 0000 0101 080a 4ddc 9723 0x0030: 4ddc 9723 tcpdump-3.9.8/./tests/mpls-ldp-hello.puu0000644000026300017500000000030210225052042016177 0ustar mcrmcrbegin 644 mpls-ldp-hello.pcap MU,.RH0(`!````````````.H%```)````1UFZ/E2'#`!*````2@```/\#`"%% MP`!&/-L```$1D08*`0$#X````@*&`H8`,M2>``$`)@H!``(```$``!P``1EP 8!```!``/```$`0`$"@$``@0"``0````! ` end tcpdump-3.9.8/./tests/.#eapon1.out.1.20000644000026300017500000002312210320056003015151 0ustar mcrmcr11:17:28.958610 IP 192.168.1.249.netbios-dgm > 192.168.1.255.netbios-dgm: NBT UDP PACKET(138) 11:17:28.958708 IP 192.168.1.249.netbios-dgm > 192.168.1.255.netbios-dgm: NBT UDP PACKET(138) 11:17:28.959360 IP 192.168.1.249.netbios-dgm > 192.168.1.255.netbios-dgm: NBT UDP PACKET(138) 11:17:28.961018 IP 192.168.1.249.netbios-ns > 192.168.1.255.netbios-ns: NBT UDP PACKET(137): QUERY; REQUEST; BROADCAST 11:17:29.710899 IP 192.168.1.249.netbios-ns > 192.168.1.255.netbios-ns: NBT UDP PACKET(137): QUERY; REQUEST; BROADCAST 11:17:30.461235 IP 192.168.1.249.netbios-ns > 192.168.1.255.netbios-ns: NBT UDP PACKET(137): QUERY; REQUEST; BROADCAST 11:17:30.798408 IP 192.168.1.249.netbios-dgm > 192.168.1.255.netbios-dgm: NBT UDP PACKET(138) 11:17:33.464213 IP 192.168.1.249.netbios-ns > 192.168.1.255.netbios-ns: NBT UDP PACKET(137): QUERY; REQUEST; BROADCAST 11:17:34.214302 IP 192.168.1.249.netbios-ns > 192.168.1.255.netbios-ns: NBT UDP PACKET(137): QUERY; REQUEST; BROADCAST 11:17:34.964688 IP 192.168.1.249.netbios-ns > 192.168.1.255.netbios-ns: NBT UDP PACKET(137): QUERY; REQUEST; BROADCAST 11:17:35.473290 arp who-has 192.168.1.1 tell 192.168.1.249 11:17:35.481559 arp reply 192.168.1.1 is-at 00:0d:88:4f:25:91 11:17:35.481577 IP 192.168.1.249.bootpc > 192.168.1.1.bootps: BOOTP/DHCP, Request from 00:04:23:57:a5:7a, length: 300 11:17:35.622870 EAP code=1 id=0 length=5 11:17:35.666378 IP 0.0.0.0.bootpc > 255.255.255.255.bootps: BOOTP/DHCP, Request from 00:04:23:57:a5:7a, length: 300 11:17:35.851486 IP 0.0.0.0.bootpc > 255.255.255.255.bootps: BOOTP/DHCP, Request from 00:04:23:57:a5:7a, length: 300 11:17:36.156548 EAP code=1 id=1 length=0 11:17:36.158698 EAP code=1 id=0 length=5 11:17:37.766046 EAP code=1 id=0 length=45 11:17:37.790625 EAP code=1 id=0 length=20 11:17:37.830669 EAP code=1 id=0 length=76 11:17:37.848577 EAP code=1 id=0 length=80 11:17:38.661939 EAP code=1 id=0 length=28 11:17:38.685352 EAP code=1 id=0 length=4 11:17:38.686358 EAP code=1 id=3 length=57 11:17:38.687182 EAP code=1 id=3 length=44 11:17:39.852392 IP 0.0.0.0.bootpc > 255.255.255.255.bootps: BOOTP/DHCP, Request from 00:04:23:57:a5:7a, length: 300 11:17:46.852719 IP 0.0.0.0.bootpc > 255.255.255.255.bootps: BOOTP/DHCP, Request from 00:04:23:57:a5:7a, length: 300 11:18:02.852731 IP 0.0.0.0.bootpc > 255.255.255.255.bootps: BOOTP/DHCP, Request from 00:04:23:57:a5:7a, length: 300 11:18:08.689384 EAP code=1 id=1 length=0 11:18:08.696826 EAP code=1 id=0 length=5 11:18:08.713116 EAP code=1 id=0 length=45 11:18:08.787664 EAP code=1 id=0 length=20 11:18:10.344628 EAP code=1 id=0 length=76 11:18:10.473292 EAP code=1 id=0 length=80 11:18:11.152435 EAP code=1 id=0 length=28 11:18:11.251425 EAP code=1 id=0 length=4 11:18:11.252509 EAP code=1 id=3 length=57 11:18:11.253336 EAP code=1 id=3 length=44 11:18:35.856823 arp who-has 169.254.67.194 tell 169.254.67.194 11:18:35.885105 arp who-has 169.254.67.194 tell 169.254.67.194 11:18:36.885304 arp who-has 169.254.67.194 tell 169.254.67.194 11:18:37.907817 IP 169.254.67.194.4299 > 239.255.255.250.1900: UDP, length 133 11:18:37.910524 IP 169.254.67.194 > IGMP.MCAST.NET: igmp v3 report, 1 group record(s) 11:18:37.964030 IP 169.254.67.194.netbios-ns > 169.254.255.255.netbios-ns: NBT UDP PACKET(137): REGISTRATION; REQUEST; BROADCAST 11:18:38.691974 IP 169.254.67.194 > IGMP.MCAST.NET: igmp v3 report, 1 group record(s) 11:18:38.714004 IP 169.254.67.194.netbios-ns > 169.254.255.255.netbios-ns: NBT UDP PACKET(137): REGISTRATION; REQUEST; BROADCAST 11:18:39.464435 IP 169.254.67.194.netbios-ns > 169.254.255.255.netbios-ns: NBT UDP PACKET(137): REGISTRATION; REQUEST; BROADCAST 11:18:39.898479 IP 0.0.0.0.bootpc > 255.255.255.255.bootps: BOOTP/DHCP, Request from 00:04:23:57:a5:7a, length: 300 11:18:40.214836 IP 169.254.67.194.netbios-ns > 169.254.255.255.netbios-ns: NBT UDP PACKET(137): REGISTRATION; REQUEST; BROADCAST 11:18:40.909196 IP 169.254.67.194.4299 > 239.255.255.250.1900: UDP, length 133 11:18:40.965632 IP 169.254.67.194.netbios-ns > 169.254.255.255.netbios-ns: NBT UDP PACKET(137): REGISTRATION; REQUEST; BROADCAST 11:18:41.254259 EAP code=1 id=1 length=0 11:18:41.256353 EAP code=1 id=0 length=5 11:18:41.275901 EAP code=1 id=0 length=45 11:18:41.388857 EAP code=1 id=0 length=20 11:18:41.715620 IP 169.254.67.194.netbios-ns > 169.254.255.255.netbios-ns: NBT UDP PACKET(137): REGISTRATION; REQUEST; BROADCAST 11:18:42.466013 IP 169.254.67.194.netbios-ns > 169.254.255.255.netbios-ns: NBT UDP PACKET(137): REGISTRATION; REQUEST; BROADCAST 11:18:42.963175 EAP code=1 id=0 length=76 11:18:42.987906 EAP code=1 id=0 length=80 11:18:43.216408 IP 169.254.67.194.netbios-ns > 169.254.255.255.netbios-ns: NBT UDP PACKET(137): REGISTRATION; REQUEST; BROADCAST 11:18:43.675053 EAP code=1 id=0 length=28 11:18:43.695554 EAP code=1 id=0 length=4 11:18:43.696547 EAP code=1 id=3 length=57 11:18:43.697368 EAP code=1 id=3 length=44 11:18:43.899684 IP 0.0.0.0.bootpc > 255.255.255.255.bootps: BOOTP/DHCP, Request from 00:04:23:57:a5:7a, length: 300 11:18:43.909719 IP 169.254.67.194.4299 > 239.255.255.250.1900: UDP, length 133 11:18:43.967353 IP 169.254.67.194.netbios-ns > 169.254.255.255.netbios-ns: NBT UDP PACKET(137): REGISTRATION; REQUEST; BROADCAST 11:18:43.967896 IP 169.254.67.194.netbios-ns > 169.254.255.255.netbios-ns: NBT UDP PACKET(137): REGISTRATION; REQUEST; BROADCAST 11:18:44.717196 IP 169.254.67.194.netbios-ns > 169.254.255.255.netbios-ns: NBT UDP PACKET(137): REGISTRATION; REQUEST; BROADCAST 11:18:44.718161 IP 169.254.67.194.netbios-ns > 169.254.255.255.netbios-ns: NBT UDP PACKET(137): REGISTRATION; REQUEST; BROADCAST 11:18:45.467593 IP 169.254.67.194.netbios-ns > 169.254.255.255.netbios-ns: NBT UDP PACKET(137): REGISTRATION; REQUEST; BROADCAST 11:18:45.468557 IP 169.254.67.194.netbios-ns > 169.254.255.255.netbios-ns: NBT UDP PACKET(137): REGISTRATION; REQUEST; BROADCAST 11:18:46.217980 IP 169.254.67.194.netbios-ns > 169.254.255.255.netbios-ns: NBT UDP PACKET(137): REGISTRATION; REQUEST; BROADCAST 11:18:46.218950 IP 169.254.67.194.netbios-ns > 169.254.255.255.netbios-ns: NBT UDP PACKET(137): REGISTRATION; REQUEST; BROADCAST 11:18:46.969929 IP 169.254.67.194.netbios-dgm > 169.254.255.255.netbios-dgm: NBT UDP PACKET(138) 11:18:46.970205 IP 169.254.67.194.netbios-dgm > 169.254.255.255.netbios-dgm: NBT UDP PACKET(138) 11:18:48.470207 IP 169.254.67.194.netbios-dgm > 169.254.255.255.netbios-dgm: NBT UDP PACKET(138) 11:18:49.970986 IP 169.254.67.194.netbios-dgm > 169.254.255.255.netbios-dgm: NBT UDP PACKET(138) 11:18:51.471768 IP 169.254.67.194.netbios-dgm > 169.254.255.255.netbios-dgm: NBT UDP PACKET(138) 11:18:52.900388 IP 0.0.0.0.bootpc > 255.255.255.255.bootps: BOOTP/DHCP, Request from 00:04:23:57:a5:7a, length: 300 11:18:52.972547 IP 169.254.67.194.netbios-dgm > 169.254.255.255.netbios-dgm: NBT UDP PACKET(138) 11:18:53.972751 IP 169.254.67.194.netbios-dgm > 169.254.255.255.netbios-dgm: NBT UDP PACKET(138) 11:18:54.972939 IP 169.254.67.194.netbios-dgm > 169.254.255.255.netbios-dgm: NBT UDP PACKET(138) 11:18:55.973129 IP 169.254.67.194.netbios-dgm > 169.254.255.255.netbios-dgm: NBT UDP PACKET(138) 11:18:56.973475 IP 169.254.67.194.netbios-ns > 169.254.255.255.netbios-ns: NBT UDP PACKET(137): REGISTRATION; REQUEST; BROADCAST 11:18:57.723686 IP 169.254.67.194.netbios-ns > 169.254.255.255.netbios-ns: NBT UDP PACKET(137): REGISTRATION; REQUEST; BROADCAST 11:18:58.474079 IP 169.254.67.194.netbios-ns > 169.254.255.255.netbios-ns: NBT UDP PACKET(137): REGISTRATION; REQUEST; BROADCAST 11:18:59.224473 IP 169.254.67.194.netbios-ns > 169.254.255.255.netbios-ns: NBT UDP PACKET(137): REGISTRATION; REQUEST; BROADCAST 11:18:59.974983 IP 169.254.67.194.netbios-ns > 169.254.255.255.netbios-ns: NBT UDP PACKET(137): REGISTRATION; REQUEST; BROADCAST 11:19:00.725263 IP 169.254.67.194.netbios-ns > 169.254.255.255.netbios-ns: NBT UDP PACKET(137): REGISTRATION; REQUEST; BROADCAST 11:19:01.475654 IP 169.254.67.194.netbios-ns > 169.254.255.255.netbios-ns: NBT UDP PACKET(137): REGISTRATION; REQUEST; BROADCAST 11:19:02.226046 IP 169.254.67.194.netbios-ns > 169.254.255.255.netbios-ns: NBT UDP PACKET(137): REGISTRATION; REQUEST; BROADCAST 11:19:02.976511 IP 169.254.67.194.netbios-dgm > 169.254.255.255.netbios-dgm: NBT UDP PACKET(138) 11:19:02.976737 IP 169.254.67.194.netbios-dgm > 169.254.255.255.netbios-dgm: NBT UDP PACKET(138) 11:19:02.977520 IP 169.254.67.194.netbios-dgm > 169.254.255.255.netbios-dgm: NBT UDP PACKET(138) 11:19:02.979092 IP 169.254.67.194.netbios-ns > 169.254.255.255.netbios-ns: NBT UDP PACKET(137): QUERY; REQUEST; BROADCAST 11:19:03.728840 IP 169.254.67.194.netbios-ns > 169.254.255.255.netbios-ns: NBT UDP PACKET(137): QUERY; REQUEST; BROADCAST 11:19:04.479238 IP 169.254.67.194.netbios-ns > 169.254.255.255.netbios-ns: NBT UDP PACKET(137): QUERY; REQUEST; BROADCAST 11:19:07.482218 IP 169.254.67.194.netbios-ns > 169.254.255.255.netbios-ns: NBT UDP PACKET(137): QUERY; REQUEST; BROADCAST 11:19:08.232205 IP 169.254.67.194.netbios-ns > 169.254.255.255.netbios-ns: NBT UDP PACKET(137): QUERY; REQUEST; BROADCAST 11:19:08.982597 IP 169.254.67.194.netbios-ns > 169.254.255.255.netbios-ns: NBT UDP PACKET(137): QUERY; REQUEST; BROADCAST 11:19:09.900631 IP 0.0.0.0.bootpc > 255.255.255.255.bootps: BOOTP/DHCP, Request from 00:04:23:57:a5:7a, length: 300 11:19:13.696821 EAP code=1 id=1 length=0 11:19:13.704581 EAP code=1 id=0 length=5 11:19:13.718221 EAP code=1 id=0 length=45 11:19:13.734974 EAP code=1 id=0 length=20 11:19:14.801245 IP 169.254.67.194.netbios-dgm > 169.254.255.255.netbios-dgm: NBT UDP PACKET(138) 11:19:15.293800 EAP code=1 id=0 length=76 11:19:15.312531 EAP code=1 id=0 length=80 11:19:15.997763 EAP code=1 id=0 length=28 11:19:16.022323 EAP code=1 id=0 length=4 11:19:16.023335 EAP code=1 id=3 length=57 11:19:16.024149 EAP code=1 id=3 length=44 tcpdump-3.9.8/./tests/eapon1.gdbinit0000644000026300017500000000003010030451020015327 0ustar mcrmcrset args -r eapon1.pcap tcpdump-3.9.8/./tests/eapon2.puu0000644000026300017500000000745210030451021014541 0ustar mcrmcrbegin 644 eapon2.pcap MU,.RH0(`!````````````&`````!````_E1@0(0`#`!"````0@`````+VY#] M`@#@3UR$8`@`11``-"500``W!O$4U8'_>L&:EKBMN@`6*6Y2?^.:F>V`$/C@ M9C@```$!"`H974FMBM15+Q!58$!QG`8`8````.L`````"]N0_0(`X$]@<4 M5(X`:)P-"Q0`8$$!L&:EKA4C@<4`/I,<`$5`/+M5G/\`0<0G:=Q]S4< MM*"$``/81;I[5@?]ZP9J6N%2.!Q0`RHLB`18`PB*WG4W^01LM]B4XN&`' M6E(!*C$R.34P,C,X,C`P,#4S.3%`;6YC,#(S+FUC8S(Y-2YO$55@0!P&!0!@ M````!@$`````#`>LA0`+VY#]`@@`10``^``"0`!`$0RDP9J6N-6!_WH'%%2. M`.2>DP(6`-P04TN>&O"\WL%@,.`1V142"`;____^#`8```)`!@8````"&CH` M``$W$32`+U<1;LS62B]58$!:H@8`8````.L`````"]N0_0(`X$]@M>A=G MB0$J,3(Y-3`R,S@R,#`P-3,Y,4!M;F,P,C,N;6-C,CDU+F\O56!`G*<&`&`` M``"*```````,!ZR%``O;D/T""`!%``!\``-``$`1#1_!FI:XU8'_>@<45(X` M:#L&:EKA4C@<4`/H2$P$9`/)6HP7H8R0(O M*"8``/81;IG5@?]ZP9J6N%2.!Q0`R@WC`1H`PCS/?&QHIT8SX.[2#=[S68H! M*C$R.34P,C,X,C`P,#4S.3%`;6YC,#(S+FUC8S(Y-2YO,55@0#VS#0!@```` M!@$`````#`>LA0`+VY#]`@@`10``^``%0`!`$0RAP9J6N-6!_WH'%%2.`.3B MMP(:`-S*Z(?9H34)&AB0":D9@<45(X`:#0% M"QL`8(N:^N5L(EK&#H6-':U$XV((!O____X,!@```D`&!@````)/%@%0`!02 M"@``#P(``@`!455@0*VL"0!@````'`$````+VY#]`@#@3UR$8`@`10`!#B@I M``#V$6YFU8'_>L&:EKA4C@<4`/KDFP$<`/+H$R8P9(B"W[^G<4!"HKQ+`2HQ M,CDU,#(S.#(P,#`U,SDQ0&UN8S`R,RYM8V,R.34N;U%58$"ZL@D`8````,8` M``````P'K(4`"]N0_0((`$4``+@`!T``0!$,W\&:EKC5@?]Z!Q14C@"DI=@+ M'`";*!>&FY;C?2/)T74`@&_____@P&```"0`8&`````D]2`5$`4!(+ M```!#0``,`!256!`@SL%`&````#L``````O;D/T"`.!/7(1@"`!%``#>*"H` M`/81;I75@?]ZP9J6N%2.!Q0`RI"T`1T`PE:^P6JH@]U$D*!C#8CO0UP!*C$R M.34P,C,X,C`P,#4S.3%`;6YC,#(S+FUC8S(Y-2YO4E5@0'M`!0!@````!@$` M````#`>LA0`+VY#]`@@`10``^``(0`!`$0R>P9J6N-6!_WH'%%2.`.2<&@(= M`-P&]WGHNB++Z0K&A"^B<2S/"`;____^#`8```)`!@8````"&CH```$W$32F M=DT@&\D[/G!58$!OW04`8````.L`````"]N0_0(`X$]AS"W^P0$J,3(Y M-3`R,S@R,#`P-3,Y,4!M;F,P,C,N;6-C,CDU+F]P56!`L>(%`&````"*```` M```,!ZR%``O;D/T""`!%``!\``E``$`1#1G!FI:XU8'_>@<45(X`:`.V"QX` M8+P/!*Y!RZ>(/:C.%/A62\((!O____X,!@```D`&!@````)/%@%P`!02"@`` M#P(``@`!<55@0)*H#@!@````'`$````+VY#]`@#@3UR$8`@`10`!#B@L``#V M$6YCU8'_>L&:EKA4C@<4`/JLH@$?`/*.M".D<>M4,KL=.(:"[-F;`2HQ,CDU M,#(S.#(P,#`U,SDQ0&UN8S`R,RYM8V,R.34N;W%58$#$K@X`8````,8````` M``P'K(4`"]N0_0((`$4``+@`"D``0!$,W,&:EKC5@?]Z!Q14C@"DK7D+'P"< MMWVPJO:XC`JEY#15<5U0Z@@&_____@P&```"0`8&`````D]2`7$`4!(+```! M#0``,`!R56!`S#4*`&````#L``````O;D/T"`.!/7(1@"`!%``#>*"T``/81 M;I+5@?]ZP9J6N%2.!Q0`RE>1`2``PK+"]?UCV]G1I<-+X16?0+L!*C$R.34P M,C,X,C`P,#4S.3%`;6YC,#(S+FUC8S(Y-2YOLA0`+VY#]`@@`10``^``+0`!`$0R;P9J6N-6!_WH'%%2.`.1M%P(@`-PJ M=?H'6<1=UD&:FRVA,V+S"`;____^#`8```)`!@8````"&CH```$W$32RVRE= $I%P\00`` ` end tcpdump-3.9.8/./tests/esp1.new0000644000026300017500000000237010320056212014204 0ustar mcrmcrIP 192.1.2.23 > 192.1.2.45: ESP(spi=0x12345678,seq=0x1), length 116: IP 192.0.2.1 > 192.0.1.1: ICMP echo request, id 28416, seq 1280, length 64 (ipip-proto-4) IP 192.1.2.23 > 192.1.2.45: ESP(spi=0x12345678,seq=0x2), length 116: IP 192.0.2.1 > 192.0.1.1: ICMP echo request, id 28416, seq 1536, length 64 (ipip-proto-4) IP 192.1.2.23 > 192.1.2.45: ESP(spi=0x12345678,seq=0x3), length 116: IP 192.0.2.1 > 192.0.1.1: ICMP echo request, id 28416, seq 1792, length 64 (ipip-proto-4) IP 192.1.2.23 > 192.1.2.45: ESP(spi=0x12345678,seq=0x4), length 116: IP 192.0.2.1 > 192.0.1.1: ICMP echo request, id 28416, seq 2048, length 64 (ipip-proto-4) IP 192.1.2.23 > 192.1.2.45: ESP(spi=0x12345678,seq=0x5), length 116: IP 192.0.2.1 > 192.0.1.1: ICMP echo request, id 28416, seq 2304, length 64 (ipip-proto-4) IP 192.1.2.23 > 192.1.2.45: ESP(spi=0x12345678,seq=0x6), length 116: IP 192.0.2.1 > 192.0.1.1: ICMP echo request, id 28416, seq 2560, length 64 (ipip-proto-4) IP 192.1.2.23 > 192.1.2.45: ESP(spi=0x12345678,seq=0x7), length 116: IP 192.0.2.1 > 192.0.1.1: ICMP echo request, id 28416, seq 2816, length 64 (ipip-proto-4) IP 192.1.2.23 > 192.1.2.45: ESP(spi=0x12345678,seq=0x8), length 116: IP 192.0.2.1 > 192.0.1.1: ICMP echo request, id 28416, seq 3072, length 64 (ipip-proto-4) tcpdump-3.9.8/./tests/print-xx.out0000644000026300017500000005167210320056206015157 0ustar mcrmcr23:57:35.938066 IP 127.0.0.1.55920 > 127.0.0.1.80: S 928549246:928549246(0) win 32767 0x0000: 0000 0000 0000 0000 0000 0000 0800 4500 0x0010: 003c 1b68 4000 4006 2152 7f00 0001 7f00 0x0020: 0001 da70 0050 3758 897e 0000 0000 a002 0x0030: 7fff 1421 0000 0204 400c 0402 080a 4ddc 0x0040: 9216 0000 0000 0103 0302 23:57:35.938122 IP 127.0.0.1.80 > 127.0.0.1.55920: S 930778609:930778609(0) ack 928549247 win 32767 0x0000: 0000 0000 0000 0000 0000 0000 0800 4500 0x0010: 003c 0000 4000 4006 3cba 7f00 0001 7f00 0x0020: 0001 0050 da70 377a 8df1 3758 897f a012 0x0030: 7fff 6eb1 0000 0204 400c 0402 080a 4ddc 0x0040: 9216 4ddc 9216 0103 0302 23:57:35.938167 IP 127.0.0.1.55920 > 127.0.0.1.80: . ack 1 win 8192 0x0000: 0000 0000 0000 0000 0000 0000 0800 4500 0x0010: 0034 1b6a 4000 4006 2158 7f00 0001 7f00 0x0020: 0001 da70 0050 3758 897f 377a 8df2 8010 0x0030: 2000 37d0 0000 0101 080a 4ddc 9216 4ddc 0x0040: 9216 23:57:35.939423 IP 127.0.0.1.55920 > 127.0.0.1.80: P 1:203(202) ack 1 win 8192 0x0000: 0000 0000 0000 0000 0000 0000 0800 4500 0x0010: 00fe 1b6c 4000 4006 208c 7f00 0001 7f00 0x0020: 0001 da70 0050 3758 897f 377a 8df2 8018 0x0030: 2000 fef2 0000 0101 080a 4ddc 9217 4ddc 0x0040: 9216 4745 5420 2f20 4854 5450 2f31 2e31 0x0050: 0d0a 486f 7374 3a20 6c6f 6361 6c68 6f73 0x0060: 740d 0a55 7365 722d 4167 656e 743a 2045 0x0070: 4c69 6e6b 732f 302e 3130 2e34 2d37 2d64 0x0080: 6562 6961 6e20 2874 6578 746d 6f64 653b 0x0090: 204c 696e 7578 2032 2e36 2e31 312d 312d 0x00a0: 3638 362d 736d 7020 6936 3836 3b20 3133 0x00b0: 3278 3536 2d32 290d 0a41 6363 6570 743a 0x00c0: 202a 2f2a 0d0a 4163 6365 7074 2d45 6e63 0x00d0: 6f64 696e 673a 2067 7a69 700d 0a41 6363 0x00e0: 6570 742d 4c61 6e67 7561 6765 3a20 656e 0x00f0: 0d0a 436f 6e6e 6563 7469 6f6e 3a20 4b65 0x0100: 6570 2d41 6c69 7665 0d0a 0d0a 23:57:35.940474 IP 127.0.0.1.80 > 127.0.0.1.55920: . ack 203 win 8192 0x0000: 0000 0000 0000 0000 0000 0000 0800 4500 0x0010: 0034 1fe4 4000 4006 1cde 7f00 0001 7f00 0x0020: 0001 0050 da70 377a 8df2 3758 8a49 8010 0x0030: 2000 3703 0000 0101 080a 4ddc 9218 4ddc 0x0040: 9217 23:57:35.941232 IP 127.0.0.1.80 > 127.0.0.1.55920: P 1:5560(5559) ack 203 win 8192 0x0000: 0000 0000 0000 0000 0000 0000 0800 4500 0x0010: 15eb 1fe6 4000 4006 0725 7f00 0001 7f00 0x0020: 0001 0050 da70 377a 8df2 3758 8a49 8018 0x0030: 2000 13e0 0000 0101 080a 4ddc 9219 4ddc 0x0040: 9217 4854 5450 2f31 2e31 2032 3030 204f 0x0050: 4b0d 0a44 6174 653a 2057 6564 2c20 3036 0x0060: 204a 756c 2032 3030 3520 3033 3a35 373a 0x0070: 3335 2047 4d54 0d0a 5365 7276 6572 3a20 0x0080: 4170 6163 6865 2f31 2e33 2e33 330d 0a4c 0x0090: 6173 742d 4d6f 6469 6669 6564 3a20 5375 0x00a0: 6e2c 2031 3520 4175 6720 3230 3034 2030 0x00b0: 303a 3433 3a34 3120 474d 540d 0a45 5461 0x00c0: 673a 2022 3665 3830 6630 2d31 3438 612d 0x00d0: 3431 3165 6231 6264 220d 0a41 6363 6570 0x00e0: 742d 5261 6e67 6573 3a20 6279 7465 730d 0x00f0: 0a43 6f6e 7465 6e74 2d4c 656e 6774 683a 0x0100: 2035 3235 380d 0a4b 6565 702d 416c 6976 0x0110: 653a 2074 696d 656f 7574 3d31 352c 206d 0x0120: 6178 3d31 3030 0d0a 436f 6e6e 6563 7469 0x0130: 6f6e 3a20 4b65 6570 2d41 6c69 7665 0d0a 0x0140: 436f 6e74 656e 742d 5479 7065 3a20 7465 0x0150: 7874 2f68 746d 6c3b 2063 6861 7273 6574 0x0160: 3d69 736f 2d38 3835 392d 310d 0a0d 0a3c 0x0170: 2144 4f43 5459 5045 2048 544d 4c20 5055 0x0180: 424c 4943 2022 2d2f 2f57 3343 2f2f 4454 0x0190: 4420 4854 4d4c 2034 2e30 3120 5472 616e 0x01a0: 7369 7469 6f6e 616c 2f2f 454e 223e 0a3c 0x01b0: 4854 4d4c 3e0a 3c48 4541 443e 0a20 2020 0x01c0: 3c4d 4554 4120 4854 5450 2d45 5155 4956 0x01d0: 3d22 436f 6e74 656e 742d 5479 7065 2220 0x01e0: 434f 4e54 454e 543d 2274 6578 742f 6874 0x01f0: 6d6c 3b20 6368 6172 7365 743d 6973 6f2d 0x0200: 3838 3539 2d31 223e 0a20 2020 3c4d 4554 0x0210: 4120 4e41 4d45 3d22 4465 7363 7269 7074 0x0220: 696f 6e22 2043 4f4e 5445 4e54 3d22 5468 0x0230: 6520 696e 6974 6961 6c20 696e 7374 616c 0x0240: 6c61 7469 6f6e 206f 6620 4465 6269 616e 0x0250: 2061 7061 6368 652e 223e 0a20 2020 3c54 0x0260: 4954 4c45 3e50 6c61 6365 686f 6c64 6572 0x0270: 2070 6167 653c 2f54 4954 4c45 3e0a 3c2f 0x0280: 4845 4144 3e0a 3c42 4f44 5920 5445 5854 0x0290: 3d22 2330 3030 3030 3022 2042 4743 4f4c 0x02a0: 4f52 3d22 2346 4646 4646 4622 204c 494e 0x02b0: 4b3d 2223 3030 3030 4546 2220 564c 494e 0x02c0: 4b3d 2223 3535 3138 3841 2220 414c 494e 0x02d0: 4b3d 2223 4646 3030 3030 223e 0a0a 3c48 0x02e0: 313e 506c 6163 6568 6f6c 6465 7220 7061 0x02f0: 6765 3c2f 4831 3e0a 3c48 323e 4966 2079 0x0300: 6f75 2061 7265 206a 7573 7420 6272 6f77 0x0310: 7369 6e67 2074 6865 2077 6562 3c2f 6832 0x0320: 3e0a 0a3c 503e 5468 6520 6f77 6e65 7220 0x0330: 6f66 2074 6869 7320 7765 6220 7369 7465 0x0340: 2068 6173 206e 6f74 2070 7574 2075 7020 0x0350: 616e 7920 7765 6220 7061 6765 7320 7965 0x0360: 742e 0a50 6c65 6173 6520 636f 6d65 2062 0x0370: 6163 6b20 6c61 7465 722e 3c2f 503e 0a0a 0x0380: 3c50 3e3c 534d 414c 4c3e 3c43 4954 453e 0x0390: 4d6f 7665 2061 6c6f 6e67 2c20 6e6f 7468 0x03a0: 696e 6720 746f 2073 6565 2068 6572 652e 0x03b0: 2e2e 3c2f 4349 5445 3e20 3a2d 293c 2f53 0x03c0: 4d41 4c4c 3e3c 2f50 3e0a 0a3c 4832 3e49 0x03d0: 6620 796f 7520 6172 6520 7472 7969 6e67 0x03e0: 2074 6f20 6c6f 6361 7465 2074 6865 2061 0x03f0: 646d 696e 6973 7472 6174 6f72 206f 6620 0x0400: 7468 6973 206d 6163 6869 6e65 3c2f 4832 0x0410: 3e0a 0a3c 503e 4966 2079 6f75 2077 616e 0x0420: 7420 746f 2072 6570 6f72 7420 736f 6d65 0x0430: 7468 696e 6720 6162 6f75 7420 7468 6973 0x0440: 2068 6f73 7427 7320 6265 6861 7669 6f72 0x0450: 2c20 706c 6561 7365 0a63 6f6e 7461 6374 0x0460: 2074 6865 2049 6e74 6572 6e65 7420 5365 0x0470: 7276 6963 6520 5072 6f76 6964 6572 2028 0x0480: 4953 5029 2069 6e76 6f6c 7665 6420 6469 0x0490: 7265 6374 6c79 2e3c 2f50 3e0a 0a3c 503e 0x04a0: 5365 6520 7468 6520 3c41 2068 7265 663d 0x04b0: 2268 7474 703a 2f2f 7777 772e 6162 7573 0x04c0: 652e 6e65 742f 223e 4e65 7477 6f72 6b20 0x04d0: 4162 7573 650a 436c 6561 7269 6e67 686f 0x04e0: 7573 653c 2f41 3e20 666f 7220 686f 7720 0x04f0: 746f 2064 6f20 7468 6973 2e3c 2f50 3e0a 0x0500: 0a3c 4832 3e49 6620 796f 7520 6172 6520 0x0510: 7468 6520 6164 6d69 6e69 7374 7261 746f 0x0520: 7220 6f66 2074 6869 7320 6d61 6368 696e 0x0530: 653c 2f48 323e 0a0a 3c50 3e54 6865 2069 0x0540: 6e69 7469 616c 2069 6e73 7461 6c6c 6174 0x0550: 696f 6e20 6f66 203c 4120 6872 6566 3d22 0x0560: 6874 7470 3a2f 2f77 7777 2e64 6562 6961 0x0570: 6e2e 6f72 672f 223e 4465 6269 616e 2773 0x0580: 0a61 7061 6368 653c 2f41 3e20 7765 6220 0x0590: 7365 7276 6572 2070 6163 6b61 6765 2077 0x05a0: 6173 2073 7563 6365 7373 6675 6c2e 3c2f 0x05b0: 503e 0a0a 3c50 3e3c 5354 524f 4e47 3e59 0x05c0: 6f75 2073 686f 756c 6420 7265 706c 6163 0x05d0: 6520 7468 6973 2070 6167 6520 7769 7468 0x05e0: 2079 6f75 7220 6f77 6e20 7765 6220 7061 0x05f0: 6765 7320 6173 0a73 6f6f 6e20 6173 2070 0x0600: 6f73 7369 626c 652e 3c2f 5354 524f 4e47 0x0610: 3e3c 2f50 3e0a 0a3c 503e 556e 6c65 7373 0x0620: 2079 6f75 2063 6861 6e67 6564 2069 7473 0x0630: 2063 6f6e 6669 6775 7261 7469 6f6e 2c20 0x0640: 796f 7572 206e 6577 2073 6572 7665 7220 0x0650: 6973 2063 6f6e 6669 6775 7265 6420 6173 0x0660: 2066 6f6c 6c6f 7773 3a0a 3c55 4c3e 0a3c 0x0670: 4c49 3e0a 436f 6e66 6967 7572 6174 696f 0x0680: 6e20 6669 6c65 7320 6361 6e20 6265 2066 0x0690: 6f75 6e64 2069 6e20 3c54 543e 2f65 7463 0x06a0: 2f61 7061 6368 653c 2f54 543e 2e3c 2f4c 0x06b0: 493e 0a0a 3c4c 493e 0a54 6865 203c 5454 0x06c0: 3e44 6f63 756d 656e 7452 6f6f 743c 2f54 0x06d0: 543e 2c20 7768 6963 6820 6973 2074 6865 0x06e0: 2064 6972 6563 746f 7279 2075 6e64 6572 0x06f0: 2077 6869 6368 2061 6c6c 2079 6f75 720a 0x0700: 4854 4d4c 2066 696c 6573 2073 686f 756c 0x0710: 6420 6578 6973 742c 2069 7320 7365 7420 0x0720: 746f 203c 5454 3e2f 7661 722f 7777 773c 0x0730: 2f54 543e 2e3c 2f4c 493e 0a0a 3c4c 493e 0x0740: 0a43 4749 2073 6372 6970 7473 2061 7265 0x0750: 206c 6f6f 6b65 6420 666f 7220 696e 203c 0x0760: 5454 3e2f 7573 722f 6c69 622f 6367 692d 0x0770: 6269 6e3c 2f54 543e 2c20 7768 6963 6820 0x0780: 6973 2077 6865 7265 0a44 6562 6961 6e20 0x0790: 7061 636b 6167 6573 2077 696c 6c20 706c 0x07a0: 6163 6520 7468 6569 7220 7363 7269 7074 0x07b0: 732e 3c2f 4c49 3e0a 0a3c 4c49 3e0a 4c6f 0x07c0: 6720 6669 6c65 7320 6172 6520 706c 6163 0x07d0: 6564 2069 6e20 3c54 543e 2f76 6172 2f6c 0x07e0: 6f67 2f61 7061 6368 653c 2f54 543e 2c20 0x07f0: 616e 6420 7769 6c6c 2062 6520 726f 7461 0x0800: 7465 640a 7765 656b 6c79 2e20 2054 6865 0x0810: 2066 7265 7175 656e 6379 206f 6620 726f 0x0820: 7461 7469 6f6e 2063 616e 2062 6520 6561 0x0830: 7369 6c79 2063 6861 6e67 6564 2062 7920 0x0840: 6564 6974 696e 670a 3c54 543e 2f65 7463 0x0850: 2f6c 6f67 726f 7461 7465 2e64 2f61 7061 0x0860: 6368 653c 2f54 543e 2e3c 2f4c 493e 0a0a 0x0870: 3c4c 493e 0a54 6865 2064 6566 6175 6c74 0x0880: 2064 6972 6563 746f 7279 2069 6e64 6578 0x0890: 2069 7320 3c54 543e 696e 6465 782e 6874 0x08a0: 6d6c 3c2f 5454 3e2c 206d 6561 6e69 6e67 0x08b0: 2074 6861 7420 7265 7175 6573 7473 0a66 0x08c0: 6f72 2061 2064 6972 6563 746f 7279 203c 0x08d0: 5454 3e2f 666f 6f2f 6261 722f 3c2f 5454 0x08e0: 3e20 7769 6c6c 2067 6976 6520 7468 6520 0x08f0: 636f 6e74 656e 7473 206f 6620 7468 6520 0x0900: 6669 6c65 203c 5454 3e2f 7661 722f 7777 0x0910: 772f 666f 6f2f 6261 722f 696e 6465 782e 0x0920: 6874 6d6c 3c2f 5454 3e0a 6966 2069 7420 0x0930: 6578 6973 7473 2028 6173 7375 6d69 6e67 0x0940: 2074 6861 7420 3c54 543e 2f76 6172 2f77 0x0950: 7777 3c2f 5454 3e20 6973 2079 6f75 7220 0x0960: 3c54 543e 446f 6375 6d65 6e74 526f 6f74 0x0970: 3c2f 5454 3e29 2e3c 2f4c 493e 0a0a 3c4c 0x0980: 493e 0a55 7365 7220 6469 7265 6374 6f72 0x0990: 6965 7320 6172 6520 656e 6162 6c65 642c 0x09a0: 2061 6e64 2075 7365 7220 646f 6375 6d65 0x09b0: 6e74 7320 7769 6c6c 2062 6520 6c6f 6f6b 0x09c0: 6564 2066 6f72 0a69 6e20 7468 6520 3c54 0x09d0: 543e 7075 626c 6963 5f68 746d 6c3c 2f54 0x09e0: 543e 2064 6972 6563 746f 7279 206f 6620 0x09f0: 7468 6520 7573 6572 7327 2068 6f6d 6573 0x0a00: 2e20 2054 6865 7365 2064 6972 730a 7368 0x0a10: 6f75 6c64 2062 6520 756e 6465 7220 3c54 0x0a20: 543e 2f68 6f6d 653c 2f54 543e 2c20 616e 0x0a30: 6420 7573 6572 7320 7769 6c6c 206e 6f74 0x0a40: 2062 6520 6162 6c65 2074 6f20 7379 6d6c 0x0a50: 696e 6b0a 746f 2066 696c 6573 2074 6865 0x0a60: 7920 646f 6e27 7420 6f77 6e2e 3c2f 4c49 0x0a70: 3e0a 0a3c 2f55 4c3e 0a41 6c6c 2074 6865 0x0a80: 2073 7461 6e64 6172 6420 6170 6163 6865 0x0a90: 206d 6f64 756c 6573 2061 7265 2061 7661 0x0aa0: 696c 6162 6c65 2077 6974 6820 7468 6973 0x0ab0: 2072 656c 6561 7365 2061 6e64 2061 7265 0x0ac0: 0a6e 6f77 206d 616e 6167 6564 2077 6974 0x0ad0: 6820 6465 6263 6f6e 662e 2020 5479 7065 0x0ae0: 203c 5454 3e64 706b 672d 7265 636f 6e66 0x0af0: 6967 7572 6520 6170 6163 6865 3c2f 5454 0x0b00: 3e20 746f 0a73 656c 6563 7420 7768 6963 0x0b10: 6820 6d6f 6475 6c65 7320 796f 7520 7761 0x0b20: 6e74 2065 6e61 626c 6564 2e20 204d 616e 0x0b30: 7920 6f74 6865 7220 6d6f 6475 6c65 7320 0x0b40: 6172 6520 6176 6169 6c61 626c 650a 7468 0x0b50: 726f 7567 6820 7468 6520 4465 6269 616e 0x0b60: 2070 6163 6b61 6765 2073 7973 7465 6d20 0x0b70: 7769 7468 2074 6865 206e 616d 6573 203c 0x0b80: 5454 3e6c 6962 6170 6163 6865 2d6d 6f64 0x0b90: 2d2a 3c2f 5454 3e2e 0a49 6620 796f 7520 0x0ba0: 6e65 6564 2074 6f20 636f 6d70 696c 6520 0x0bb0: 6120 6d6f 6475 6c65 2079 6f75 7273 656c 0x0bc0: 662c 2079 6f75 2077 696c 6c20 6e65 6564 0x0bd0: 2074 6f20 696e 7374 616c 6c20 7468 650a 0x0be0: 3c54 543e 6170 6163 6865 2d64 6576 3c2f 0x0bf0: 5454 3e20 7061 636b 6167 652e 0a0a 3c50 0x0c00: 3e4d 6f72 6520 646f 6375 6d65 6e74 6174 0x0c10: 696f 6e20 6f6e 2041 7061 6368 6520 6361 0x0c20: 6e20 6265 2066 6f75 6e64 206f 6e3a 0a3c 0x0c30: 554c 3e0a 3c4c 493e 0a54 6865 203c 4120 0x0c40: 4852 4546 3d22 2f64 6f63 2f61 7061 6368 0x0c50: 652d 646f 632f 6d61 6e75 616c 2f22 3e41 0x0c60: 7061 6368 6520 646f 6375 6d65 6e74 6174 0x0c70: 696f 6e3c 2f41 3e20 7374 6f72 6564 206f 0x0c80: 6e20 796f 7572 2073 6572 7665 722e 3c2f 0x0c90: 4c49 3e0a 0a3c 4c49 3e0a 5468 6520 3c41 0x0ca0: 2048 5245 463d 2268 7474 703a 2f2f 7777 0x0cb0: 772e 6170 6163 6865 2e6f 7267 2f22 3e41 0x0cc0: 7061 6368 6520 5072 6f6a 6563 743c 2f41 0x0cd0: 3e20 686f 6d65 2073 6974 652e 3c2f 4c49 0x0ce0: 3e0a 0a3c 4c49 3e0a 5468 6520 3c41 2048 0x0cf0: 5245 463d 2268 7474 703a 2f2f 7777 772e 0x0d00: 6170 6163 6865 2d73 736c 2e6f 7267 2f22 0x0d10: 3e41 7061 6368 652d 5353 4c3c 2f41 3e20 0x0d20: 686f 6d65 2073 6974 652e 3c2f 4c49 3e0a 0x0d30: 0a3c 4c49 3e0a 5468 6520 3c41 2048 5245 0x0d40: 463d 2268 7474 703a 2f2f 7065 726c 2e61 0x0d50: 7061 6368 652e 6f72 672f 223e 6d6f 6420 0x0d60: 7065 726c 3c2f 413e 2068 6f6d 6520 7369 0x0d70: 7465 2e3c 2f4c 493e 0a0a 3c4c 493e 0a54 0x0d80: 6865 203c 4120 4852 4546 3d22 6874 7470 0x0d90: 3a2f 2f77 7777 2e61 7061 6368 6577 6565 0x0da0: 6b2e 636f 6d2f 223e 4170 6163 6865 5765 0x0db0: 656b 3c2f 413e 206e 6577 736c 6574 7465 0x0dc0: 722e 3c2f 4c49 3e0a 0a3c 4c49 3e0a 5468 0x0dd0: 6520 3c41 2048 5245 463d 2268 7474 703a 0x0de0: 2f2f 7777 772e 6465 6269 616e 2e6f 7267 0x0df0: 2f64 6f63 2f22 3e44 6562 6961 6e20 5072 0x0e00: 6f6a 6563 740a 446f 6375 6d65 6e74 6174 0x0e10: 696f 6e3c 2f41 3e20 7768 6963 6820 636f 0x0e20: 6e74 6169 6e73 2048 4f57 544f 732c 2046 0x0e30: 4151 732c 2061 6e64 2073 6f66 7477 6172 0x0e40: 6520 7570 6461 7465 732e 3c2f 4c49 3e0a 0x0e50: 3c2f 554c 3e0a 0a3c 503e 596f 7520 6361 0x0e60: 6e20 616c 736f 2063 6f6e 7375 6c74 2074 0x0e70: 6865 206c 6973 7420 6f66 203c 4120 4852 0x0e80: 4546 3d22 6874 7470 3a2f 2f77 7777 2e62 0x0e90: 6f75 7465 6c6c 2e63 6f6d 2f66 6171 2f22 0x0ea0: 3e57 6f72 6c64 0a57 6964 6520 5765 6220 0x0eb0: 4672 6571 7565 6e74 6c79 2041 736b 6564 0x0ec0: 2051 7565 7374 696f 6e73 3c2f 413e 2066 0x0ed0: 6f72 2069 6e66 6f72 6d61 7469 6f6e 2e0a 0x0ee0: 0a3c 4832 3e4c 6574 206f 7468 6572 2070 0x0ef0: 656f 706c 6520 6b6e 6f77 2061 626f 7574 0x0f00: 2074 6869 7320 7365 7276 6572 3c2f 4832 0x0f10: 3e0a 0a3c 4120 4852 4546 3d22 6874 7470 0x0f20: 3a2f 2f6e 6574 6372 6166 742e 636f 6d2f 0x0f30: 223e 4e65 7463 7261 6674 3c2f 413e 2070 0x0f40: 726f 7669 6465 7320 616e 2069 6e74 6572 0x0f50: 6573 7469 6e67 2066 7265 650a 7365 7276 0x0f60: 6963 6520 666f 7220 7765 6220 7369 7465 0x0f70: 206d 6f6e 6974 6f72 696e 6720 616e 6420 0x0f80: 7374 6174 6973 7469 6320 636f 6c6c 6563 0x0f90: 7469 6f6e 2e0a 596f 7520 6361 6e20 6c65 0x0fa0: 7420 7468 656d 206b 6e6f 7720 6162 6f75 0x0fb0: 7420 796f 7572 2073 6572 7665 7220 7573 0x0fc0: 696e 6720 7468 6569 720a 3c41 2048 5245 0x0fd0: 463d 2268 7474 703a 2f2f 7570 7469 6d65 0x0fe0: 2e6e 6574 6372 6166 742e 636f 6d2f 223e 0x0ff0: 696e 7465 7266 6163 653c 2f41 3e2e 0a45 0x1000: 6e61 626c 696e 6720 7468 6520 6d6f 6e69 0x1010: 746f 7269 6e67 206f 6620 796f 7572 2073 0x1020: 6572 7665 7220 7769 6c6c 2070 726f 7669 0x1030: 6465 2061 2062 6574 7465 7220 676c 6f62 0x1040: 616c 206f 7665 7276 6965 770a 6f66 2077 0x1050: 686f 2069 7320 7573 696e 6720 7768 6174 0x1060: 2061 6e64 2077 6865 7265 2c20 616e 6420 0x1070: 6974 2077 6f75 6c64 2067 6976 6520 4465 0x1080: 6269 616e 2061 2062 6574 7465 720a 6f76 0x1090: 6572 7669 6577 206f 6620 7468 6520 6170 0x10a0: 6163 6865 2070 6163 6b61 6765 2075 7361 0x10b0: 6765 2e0a 0a3c 4832 3e41 626f 7574 2074 0x10c0: 6869 7320 7061 6765 3c2f 4832 3e0a 0a3c 0x10d0: 494d 4720 414c 4947 4e3d 2272 6967 6874 0x10e0: 2220 414c 543d 2222 2048 4549 4748 543d 0x10f0: 2232 3437 2220 5749 4454 483d 2232 3738 0x1100: 2220 5352 433d 2269 636f 6e73 2f6a 6865 0x1110: 3036 312e 706e 6722 3e0a 0a3c 503e 5468 0x1120: 6973 2069 7320 6120 706c 6163 6568 6f6c 0x1130: 6465 7220 7061 6765 2069 6e73 7461 6c6c 0x1140: 6564 2062 7920 7468 6520 3c41 0a48 5245 0x1150: 463d 2268 7474 703a 2f2f 7777 772e 6465 0x1160: 6269 616e 2e6f 7267 2f22 3e44 6562 6961 0x1170: 6e3c 2f41 3e0a 7265 6c65 6173 6520 6f66 0x1180: 2074 6865 2061 7061 6368 6520 5765 6220 0x1190: 7365 7276 6572 2070 6163 6b61 6765 2e0a 0x11a0: 0a3c 503e 5468 6973 2063 6f6d 7075 7465 0x11b0: 7220 6861 7320 696e 7374 616c 6c65 6420 0x11c0: 7468 6520 4465 6269 616e 2047 4e55 2f4c 0x11d0: 696e 7578 206f 7065 7261 7469 6e67 2073 0x11e0: 7973 7465 6d2c 0a62 7574 2069 7420 6861 0x11f0: 7320 3c73 7472 6f6e 673e 6e6f 7468 696e 0x1200: 6720 746f 2064 6f20 7769 7468 2074 6865 0x1210: 2044 6562 6961 6e0a 5072 6f6a 6563 743c 0x1220: 2f73 7472 6f6e 673e 2e20 506c 6561 7365 0x1230: 2064 6f20 3c73 7472 6f6e 673e 6e6f 743c 0x1240: 2f73 7472 6f6e 673e 2063 6f6e 7461 6374 0x1250: 2074 6865 2044 6562 6961 6e0a 5072 6f6a 0x1260: 6563 7420 6162 6f75 7420 6974 2e3c 2f50 0x1270: 3e0a 0a3c 503e 4966 2079 6f75 2066 696e 0x1280: 6420 6120 6275 6720 696e 2074 6869 7320 0x1290: 6170 6163 6865 2070 6163 6b61 6765 2c20 0x12a0: 6f72 2069 6e20 4170 6163 6865 2069 7473 0x12b0: 656c 662c 0a70 6c65 6173 6520 6669 6c65 0x12c0: 2061 2062 7567 2072 6570 6f72 7420 6f6e 0x12d0: 2069 742e 2020 496e 7374 7275 6374 696f 0x12e0: 6e73 206f 6e20 646f 696e 6720 7468 6973 0x12f0: 2c20 616e 6420 7468 650a 6c69 7374 206f 0x1300: 6620 3c41 2048 5245 463d 2268 7474 703a 0x1310: 2f2f 6275 6773 2e64 6562 6961 6e2e 6f72 0x1320: 672f 7372 633a 6170 6163 6865 223e 6b6e 0x1330: 6f77 6e20 6275 6773 3c2f 413e 206f 6620 0x1340: 7468 6973 0a70 6163 6b61 6765 2c20 6361 0x1350: 6e20 6265 2066 6f75 6e64 2069 6e20 7468 0x1360: 6520 0a3c 4120 4852 4546 3d22 6874 7470 0x1370: 3a2f 2f77 7777 2e64 6562 6961 6e2e 6f72 0x1380: 672f 4275 6773 2f52 6570 6f72 7469 6e67 0x1390: 223e 4465 6269 616e 2042 7567 2054 7261 0x13a0: 636b 696e 6720 5379 7374 656d 3c2f 413e 0x13b0: 2e0a 0a3c 503e 5468 616e 6b73 2066 6f72 0x13c0: 2075 7369 6e67 2074 6869 7320 7061 636b 0x13d0: 6167 652c 2061 6e64 2063 6f6e 6772 6174 0x13e0: 756c 6174 696f 6e73 2066 6f72 2079 6f75 0x13f0: 7220 6368 6f69 6365 206f 660a 6120 4465 0x1400: 6269 616e 2073 7973 7465 6d21 3c2f 503e 0x1410: 0a0a 3c44 4956 2061 6c69 676e 3d22 6365 0x1420: 6e74 6572 223e 0a3c 6120 6872 6566 3d22 0x1430: 6874 7470 3a2f 2f77 7777 2e64 6562 6961 0x1440: 6e2e 6f72 672f 223e 0a3c 494d 4720 616c 0x1450: 6967 6e3d 226d 6964 646c 6522 2068 6569 0x1460: 6768 743d 2233 3022 2077 6964 7468 3d22 0x1470: 3235 2220 7372 633d 2269 636f 6e73 2f64 0x1480: 6562 6961 6e2f 6f70 656e 6c6f 676f 2d32 0x1490: 352e 6a70 6722 2061 6c74 3d22 4465 6269 0x14a0: 616e 223e 0a3c 2f61 3e0a 3c61 2068 7265 0x14b0: 663d 2268 7474 703a 2f2f 7777 772e 6170 0x14c0: 6163 6865 2e6f 7267 2f22 3e0a 3c49 4d47 0x14d0: 2061 6c69 676e 3d22 6d69 6464 6c65 2220 0x14e0: 6865 6967 6874 3d22 3332 2220 7769 6474 0x14f0: 683d 2232 3539 2220 7372 633d 2269 636f 0x1500: 6e73 2f61 7061 6368 655f 7062 2e70 6e67 0x1510: 2220 616c 743d 2241 7061 6368 6522 3e0a 0x1520: 3c2f 613e 0a3c 2f44 4956 3e0a 0a3c 212d 0x1530: 2d0a 2020 5468 6973 2070 6167 6520 7761 0x1540: 7320 696e 6974 6961 6c6c 7920 6372 6561 0x1550: 7465 6420 6279 204a 6f68 6e69 6520 496e 0x1560: 6772 616d 2028 6874 7470 3a2f 2f6e 6574 0x1570: 676f 642e 6e65 742f 290a 2020 4974 2077 0x1580: 6173 206c 6174 6572 2065 6469 7465 6420 0x1590: 6279 204d 6174 7468 6577 2057 696c 636f 0x15a0: 7820 616e 6420 4a6f 7369 7020 526f 6469 0x15b0: 6e2e 0a20 204c 6173 7420 6d6f 6469 6669 0x15c0: 6564 3a20 2444 6174 653a 2032 3030 342f 0x15d0: 3036 2f32 3020 3135 3a33 333a 3537 2024 0x15e0: 2e0a 2020 2d2d 3e0a 0a3c 2f42 4f44 593e 0x15f0: 0a3c 2f48 544d 4c3e 0a 23:57:35.941260 IP 127.0.0.1.55920 > 127.0.0.1.80: . ack 5560 win 12383 0x0000: 0000 0000 0000 0000 0000 0000 0800 4500 0x0010: 0034 1b6e 4000 4006 2154 7f00 0001 7f00 0x0020: 0001 da70 0050 3758 8a49 377a a3a9 8010 0x0030: 305f 10ea 0000 0101 080a 4ddc 9219 4ddc 0x0040: 9219 23:57:37.229575 IP 127.0.0.1.55920 > 127.0.0.1.80: F 203:203(0) ack 5560 win 12383 0x0000: 0000 0000 0000 0000 0000 0000 0800 4500 0x0010: 0034 1b70 4000 4006 2152 7f00 0001 7f00 0x0020: 0001 da70 0050 3758 8a49 377a a3a9 8011 0x0030: 305f 0be1 0000 0101 080a 4ddc 9721 4ddc 0x0040: 9219 23:57:37.230839 IP 127.0.0.1.80 > 127.0.0.1.55920: F 5560:5560(0) ack 204 win 8192 0x0000: 0000 0000 0000 0000 0000 0000 0800 4500 0x0010: 0034 1fe8 4000 4006 1cda 7f00 0001 7f00 0x0020: 0001 0050 da70 377a a3a9 3758 8a4a 8011 0x0030: 2000 1735 0000 0101 080a 4ddc 9723 4ddc 0x0040: 9721 23:57:37.230900 IP 127.0.0.1.55920 > 127.0.0.1.80: . ack 5561 win 12383 0x0000: 0000 0000 0000 0000 0000 0000 0800 4500 0x0010: 0034 1b72 4000 4006 2150 7f00 0001 7f00 0x0020: 0001 da70 0050 3758 8a4a 377a a3aa 8010 0x0030: 305f 06d4 0000 0101 080a 4ddc 9723 4ddc 0x0040: 9723 tcpdump-3.9.8/./tests/esp4.new0000644000026300017500000000362010320056212014206 0ustar mcrmcrIP 192.1.2.23 > 192.1.2.45: ESP(spi=0x12345678,seq=0x1), length 172: IP 192.1.2.23 > 192.0.1.1: ESP(spi=0xabcdabcd,seq=0x1), length 116: IP 192.0.2.1 > 192.0.1.1: ICMP echo request, id 28416, seq 1280, length 64 (ipip-proto-4) (ipip-proto-4) IP 192.1.2.23 > 192.1.2.45: ESP(spi=0x12345678,seq=0x2), length 172: IP 192.1.2.23 > 192.0.1.1: ESP(spi=0xabcdabcd,seq=0x2), length 116: IP 192.0.2.1 > 192.0.1.1: ICMP echo request, id 28416, seq 1536, length 64 (ipip-proto-4) (ipip-proto-4) IP 192.1.2.23 > 192.1.2.45: ESP(spi=0x12345678,seq=0x3), length 172: IP 192.1.2.23 > 192.0.1.1: ESP(spi=0xabcdabcd,seq=0x3), length 116: IP 192.0.2.1 > 192.0.1.1: ICMP echo request, id 28416, seq 1792, length 64 (ipip-proto-4) (ipip-proto-4) IP 192.1.2.23 > 192.1.2.45: ESP(spi=0x12345678,seq=0x4), length 172: IP 192.1.2.23 > 192.0.1.1: ESP(spi=0xabcdabcd,seq=0x4), length 116: IP 192.0.2.1 > 192.0.1.1: ICMP echo request, id 28416, seq 2048, length 64 (ipip-proto-4) (ipip-proto-4) IP 192.1.2.23 > 192.1.2.45: ESP(spi=0x12345678,seq=0x5), length 172: IP 192.1.2.23 > 192.0.1.1: ESP(spi=0xabcdabcd,seq=0x5), length 116: IP 192.0.2.1 > 192.0.1.1: ICMP echo request, id 28416, seq 2304, length 64 (ipip-proto-4) (ipip-proto-4) IP 192.1.2.23 > 192.1.2.45: ESP(spi=0x12345678,seq=0x6), length 172: IP 192.1.2.23 > 192.0.1.1: ESP(spi=0xabcdabcd,seq=0x6), length 116: IP 192.0.2.1 > 192.0.1.1: ICMP echo request, id 28416, seq 2560, length 64 (ipip-proto-4) (ipip-proto-4) IP 192.1.2.23 > 192.1.2.45: ESP(spi=0x12345678,seq=0x7), length 172: IP 192.1.2.23 > 192.0.1.1: ESP(spi=0xabcdabcd,seq=0x7), length 116: IP 192.0.2.1 > 192.0.1.1: ICMP echo request, id 28416, seq 2816, length 64 (ipip-proto-4) (ipip-proto-4) IP 192.1.2.23 > 192.1.2.45: ESP(spi=0x12345678,seq=0x8), length 172: IP 192.1.2.23 > 192.0.1.1: ESP(spi=0xabcdabcd,seq=0x8), length 116: IP 192.0.2.1 > 192.0.1.1: ICMP echo request, id 28416, seq 3072, length 64 (ipip-proto-4) (ipip-proto-4) tcpdump-3.9.8/./icmp6.h0000644000026300017500000003756610320053322012664 0ustar mcrmcr/* @(#) $Header: /tcpdump/master/tcpdump/icmp6.h,v 1.16.2.1 2005/09/05 09:29:28 guy Exp $ (LBL) */ /* $NetBSD: icmp6.h,v 1.13 2000/08/03 16:30:37 itojun Exp $ */ /* $KAME: icmp6.h,v 1.22 2000/08/03 15:25:16 jinmei Exp $ */ /* * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project. * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. Neither the name of the project nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ /* * Copyright (c) 1982, 1986, 1993 * The Regents of the University of California. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. All advertising materials mentioning features or use of this software * must display the following acknowledgement: * This product includes software developed by the University of * California, Berkeley and its contributors. * 4. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * * @(#)ip_icmp.h 8.1 (Berkeley) 6/10/93 */ #ifndef _NETINET_ICMP6_H_ #define _NETINET_ICMP6_H_ struct icmp6_hdr { u_int8_t icmp6_type; /* type field */ u_int8_t icmp6_code; /* code field */ u_int16_t icmp6_cksum; /* checksum field */ union { u_int32_t icmp6_un_data32[1]; /* type-specific field */ u_int16_t icmp6_un_data16[2]; /* type-specific field */ u_int8_t icmp6_un_data8[4]; /* type-specific field */ } icmp6_dataun; }; #define icmp6_data32 icmp6_dataun.icmp6_un_data32 #define icmp6_data16 icmp6_dataun.icmp6_un_data16 #define icmp6_data8 icmp6_dataun.icmp6_un_data8 #define icmp6_pptr icmp6_data32[0] /* parameter prob */ #define icmp6_mtu icmp6_data32[0] /* packet too big */ #define icmp6_id icmp6_data16[0] /* echo request/reply */ #define icmp6_seq icmp6_data16[1] /* echo request/reply */ #define icmp6_maxdelay icmp6_data16[0] /* mcast group membership */ #define ICMP6_DST_UNREACH 1 /* dest unreachable, codes: */ #define ICMP6_PACKET_TOO_BIG 2 /* packet too big */ #define ICMP6_TIME_EXCEEDED 3 /* time exceeded, code: */ #define ICMP6_PARAM_PROB 4 /* ip6 header bad */ #define ICMP6_ECHO_REQUEST 128 /* echo service */ #define ICMP6_ECHO_REPLY 129 /* echo reply */ #define ICMP6_MEMBERSHIP_QUERY 130 /* group membership query */ #define MLD6_LISTENER_QUERY 130 /* multicast listener query */ #define ICMP6_MEMBERSHIP_REPORT 131 /* group membership report */ #define MLD6_LISTENER_REPORT 131 /* multicast listener report */ #define ICMP6_MEMBERSHIP_REDUCTION 132 /* group membership termination */ #define MLD6_LISTENER_DONE 132 /* multicast listener done */ #define ND_ROUTER_SOLICIT 133 /* router solicitation */ #define ND_ROUTER_ADVERT 134 /* router advertisement */ #define ND_NEIGHBOR_SOLICIT 135 /* neighbor solicitation */ #define ND_NEIGHBOR_ADVERT 136 /* neighbor advertisement */ #define ND_REDIRECT 137 /* redirect */ #define ICMP6_ROUTER_RENUMBERING 138 /* router renumbering */ #define ICMP6_WRUREQUEST 139 /* who are you request */ #define ICMP6_WRUREPLY 140 /* who are you reply */ #define ICMP6_FQDN_QUERY 139 /* FQDN query */ #define ICMP6_FQDN_REPLY 140 /* FQDN reply */ #define ICMP6_NI_QUERY 139 /* node information request */ #define ICMP6_NI_REPLY 140 /* node information reply */ #define IND_SOLICIT 141 /* inverse neighbor solicitation */ #define IND_ADVERT 142 /* inverse neighbor advertisement */ #define ICMP6_V2_MEMBERSHIP_REPORT 143 /* v2 membership report */ #define MLDV2_LISTENER_REPORT 143 /* v2 multicast listener report */ #define ICMP6_HADISCOV_REQUEST 144 #define ICMP6_HADISCOV_REPLY 145 #define ICMP6_MOBILEPREFIX_SOLICIT 146 #define ICMP6_MOBILEPREFIX_ADVERT 147 #define MLD6_MTRACE_RESP 200 /* mtrace response(to sender) */ #define MLD6_MTRACE 201 /* mtrace messages */ #define ICMP6_MAXTYPE 201 #define ICMP6_DST_UNREACH_NOROUTE 0 /* no route to destination */ #define ICMP6_DST_UNREACH_ADMIN 1 /* administratively prohibited */ #define ICMP6_DST_UNREACH_NOTNEIGHBOR 2 /* not a neighbor(obsolete) */ #define ICMP6_DST_UNREACH_BEYONDSCOPE 2 /* beyond scope of source address */ #define ICMP6_DST_UNREACH_ADDR 3 /* address unreachable */ #define ICMP6_DST_UNREACH_NOPORT 4 /* port unreachable */ #define ICMP6_TIME_EXCEED_TRANSIT 0 /* ttl==0 in transit */ #define ICMP6_TIME_EXCEED_REASSEMBLY 1 /* ttl==0 in reass */ #define ICMP6_PARAMPROB_HEADER 0 /* erroneous header field */ #define ICMP6_PARAMPROB_NEXTHEADER 1 /* unrecognized next header */ #define ICMP6_PARAMPROB_OPTION 2 /* unrecognized option */ #define ICMP6_INFOMSG_MASK 0x80 /* all informational messages */ #define ICMP6_NI_SUBJ_IPV6 0 /* Query Subject is an IPv6 address */ #define ICMP6_NI_SUBJ_FQDN 1 /* Query Subject is a Domain name */ #define ICMP6_NI_SUBJ_IPV4 2 /* Query Subject is an IPv4 address */ #define ICMP6_NI_SUCCESS 0 /* node information successful reply */ #define ICMP6_NI_REFUSED 1 /* node information request is refused */ #define ICMP6_NI_UNKNOWN 2 /* unknown Qtype */ #define ICMP6_ROUTER_RENUMBERING_COMMAND 0 /* rr command */ #define ICMP6_ROUTER_RENUMBERING_RESULT 1 /* rr result */ #define ICMP6_ROUTER_RENUMBERING_SEQNUM_RESET 255 /* rr seq num reset */ /* Used in kernel only */ #define ND_REDIRECT_ONLINK 0 /* redirect to an on-link node */ #define ND_REDIRECT_ROUTER 1 /* redirect to a better router */ /* * Multicast Listener Discovery */ struct mld6_hdr { struct icmp6_hdr mld6_hdr; struct in6_addr mld6_addr; /* multicast address */ }; #define mld6_type mld6_hdr.icmp6_type #define mld6_code mld6_hdr.icmp6_code #define mld6_cksum mld6_hdr.icmp6_cksum #define mld6_maxdelay mld6_hdr.icmp6_data16[0] #define mld6_reserved mld6_hdr.icmp6_data16[1] #define MLD_MINLEN 24 #define MLDV2_MINLEN 28 /* * Neighbor Discovery */ struct nd_router_solicit { /* router solicitation */ struct icmp6_hdr nd_rs_hdr; /* could be followed by options */ }; #define nd_rs_type nd_rs_hdr.icmp6_type #define nd_rs_code nd_rs_hdr.icmp6_code #define nd_rs_cksum nd_rs_hdr.icmp6_cksum #define nd_rs_reserved nd_rs_hdr.icmp6_data32[0] struct nd_router_advert { /* router advertisement */ struct icmp6_hdr nd_ra_hdr; u_int32_t nd_ra_reachable; /* reachable time */ u_int32_t nd_ra_retransmit; /* retransmit timer */ /* could be followed by options */ }; #define nd_ra_type nd_ra_hdr.icmp6_type #define nd_ra_code nd_ra_hdr.icmp6_code #define nd_ra_cksum nd_ra_hdr.icmp6_cksum #define nd_ra_curhoplimit nd_ra_hdr.icmp6_data8[0] #define nd_ra_flags_reserved nd_ra_hdr.icmp6_data8[1] #define ND_RA_FLAG_MANAGED 0x80 #define ND_RA_FLAG_OTHER 0x40 #define ND_RA_FLAG_HOME_AGENT 0x20 /* * Router preference values based on draft-draves-ipngwg-router-selection-01. * These are non-standard definitions. */ #define ND_RA_FLAG_RTPREF_MASK 0x18 /* 00011000 */ #define ND_RA_FLAG_RTPREF_HIGH 0x08 /* 00001000 */ #define ND_RA_FLAG_RTPREF_MEDIUM 0x00 /* 00000000 */ #define ND_RA_FLAG_RTPREF_LOW 0x18 /* 00011000 */ #define ND_RA_FLAG_RTPREF_RSV 0x10 /* 00010000 */ #define nd_ra_router_lifetime nd_ra_hdr.icmp6_data16[1] struct nd_neighbor_solicit { /* neighbor solicitation */ struct icmp6_hdr nd_ns_hdr; struct in6_addr nd_ns_target; /*target address */ /* could be followed by options */ }; #define nd_ns_type nd_ns_hdr.icmp6_type #define nd_ns_code nd_ns_hdr.icmp6_code #define nd_ns_cksum nd_ns_hdr.icmp6_cksum #define nd_ns_reserved nd_ns_hdr.icmp6_data32[0] struct nd_neighbor_advert { /* neighbor advertisement */ struct icmp6_hdr nd_na_hdr; struct in6_addr nd_na_target; /* target address */ /* could be followed by options */ }; #define nd_na_type nd_na_hdr.icmp6_type #define nd_na_code nd_na_hdr.icmp6_code #define nd_na_cksum nd_na_hdr.icmp6_cksum #define nd_na_flags_reserved nd_na_hdr.icmp6_data32[0] #define ND_NA_FLAG_ROUTER 0x80000000 #define ND_NA_FLAG_SOLICITED 0x40000000 #define ND_NA_FLAG_OVERRIDE 0x20000000 struct nd_redirect { /* redirect */ struct icmp6_hdr nd_rd_hdr; struct in6_addr nd_rd_target; /* target address */ struct in6_addr nd_rd_dst; /* destination address */ /* could be followed by options */ }; #define nd_rd_type nd_rd_hdr.icmp6_type #define nd_rd_code nd_rd_hdr.icmp6_code #define nd_rd_cksum nd_rd_hdr.icmp6_cksum #define nd_rd_reserved nd_rd_hdr.icmp6_data32[0] struct nd_opt_hdr { /* Neighbor discovery option header */ u_int8_t nd_opt_type; u_int8_t nd_opt_len; /* followed by option specific data*/ }; #define ND_OPT_SOURCE_LINKADDR 1 #define ND_OPT_TARGET_LINKADDR 2 #define ND_OPT_PREFIX_INFORMATION 3 #define ND_OPT_REDIRECTED_HEADER 4 #define ND_OPT_MTU 5 #define ND_OPT_ADVINTERVAL 7 #define ND_OPT_HOMEAGENT_INFO 8 #define ND_OPT_ROUTE_INFO 9 /* draft-ietf-ipngwg-router-preference, not officially assigned yet */ struct nd_opt_prefix_info { /* prefix information */ u_int8_t nd_opt_pi_type; u_int8_t nd_opt_pi_len; u_int8_t nd_opt_pi_prefix_len; u_int8_t nd_opt_pi_flags_reserved; u_int8_t nd_opt_pi_valid_time[4]; u_int8_t nd_opt_pi_preferred_time[4]; u_int8_t nd_opt_pi_reserved2[4]; struct in6_addr nd_opt_pi_prefix; }; #define ND_OPT_PI_FLAG_ONLINK 0x80 #define ND_OPT_PI_FLAG_AUTO 0x40 #define ND_OPT_PI_FLAG_ROUTER 0x20 /*2292bis*/ struct nd_opt_rd_hdr { /* redirected header */ u_int8_t nd_opt_rh_type; u_int8_t nd_opt_rh_len; u_int16_t nd_opt_rh_reserved1; u_int32_t nd_opt_rh_reserved2; /* followed by IP header and data */ }; struct nd_opt_mtu { /* MTU option */ u_int8_t nd_opt_mtu_type; u_int8_t nd_opt_mtu_len; u_int16_t nd_opt_mtu_reserved; u_int32_t nd_opt_mtu_mtu; }; struct nd_opt_advinterval { /* Advertisement interval option */ u_int8_t nd_opt_adv_type; u_int8_t nd_opt_adv_len; u_int16_t nd_opt_adv_reserved; u_int32_t nd_opt_adv_interval; }; struct nd_opt_homeagent_info { /* Home Agent info */ u_int8_t nd_opt_hai_type; u_int8_t nd_opt_hai_len; u_int16_t nd_opt_hai_reserved; int16_t nd_opt_hai_preference; u_int16_t nd_opt_hai_lifetime; }; struct nd_opt_route_info { /* route info */ u_int8_t nd_opt_rti_type; u_int8_t nd_opt_rti_len; u_int8_t nd_opt_rti_prefixlen; u_int8_t nd_opt_rti_flags; u_int32_t nd_opt_rti_lifetime; /* prefix follows */ }; /* * icmp6 namelookup */ struct icmp6_namelookup { struct icmp6_hdr icmp6_nl_hdr; u_int8_t icmp6_nl_nonce[8]; int32_t icmp6_nl_ttl; #if 0 u_int8_t icmp6_nl_len; u_int8_t icmp6_nl_name[3]; #endif /* could be followed by options */ }; /* * icmp6 node information */ struct icmp6_nodeinfo { struct icmp6_hdr icmp6_ni_hdr; u_int8_t icmp6_ni_nonce[8]; /* could be followed by reply data */ }; #define ni_type icmp6_ni_hdr.icmp6_type #define ni_code icmp6_ni_hdr.icmp6_code #define ni_cksum icmp6_ni_hdr.icmp6_cksum #define ni_qtype icmp6_ni_hdr.icmp6_data16[0] #define ni_flags icmp6_ni_hdr.icmp6_data16[1] #define NI_QTYPE_NOOP 0 /* NOOP */ #define NI_QTYPE_SUPTYPES 1 /* Supported Qtypes */ #define NI_QTYPE_FQDN 2 /* FQDN (draft 04) */ #define NI_QTYPE_DNSNAME 2 /* DNS Name */ #define NI_QTYPE_NODEADDR 3 /* Node Addresses */ #define NI_QTYPE_IPV4ADDR 4 /* IPv4 Addresses */ /* network endian */ #define NI_SUPTYPE_FLAG_COMPRESS ((u_int16_t)htons(0x1)) #define NI_FQDN_FLAG_VALIDTTL ((u_int16_t)htons(0x1)) /* network endian */ #define NI_NODEADDR_FLAG_TRUNCATE ((u_int16_t)htons(0x1)) #define NI_NODEADDR_FLAG_ALL ((u_int16_t)htons(0x2)) #define NI_NODEADDR_FLAG_COMPAT ((u_int16_t)htons(0x4)) #define NI_NODEADDR_FLAG_LINKLOCAL ((u_int16_t)htons(0x8)) #define NI_NODEADDR_FLAG_SITELOCAL ((u_int16_t)htons(0x10)) #define NI_NODEADDR_FLAG_GLOBAL ((u_int16_t)htons(0x20)) #define NI_NODEADDR_FLAG_ANYCAST ((u_int16_t)htons(0x40)) /* just experimental. not in spec */ struct ni_reply_fqdn { u_int32_t ni_fqdn_ttl; /* TTL */ u_int8_t ni_fqdn_namelen; /* length in octets of the FQDN */ u_int8_t ni_fqdn_name[3]; /* XXX: alignment */ }; /* * Router Renumbering. as router-renum-08.txt */ struct icmp6_router_renum { /* router renumbering header */ struct icmp6_hdr rr_hdr; u_int8_t rr_segnum; u_int8_t rr_flags; u_int16_t rr_maxdelay; u_int32_t rr_reserved; }; #define ICMP6_RR_FLAGS_TEST 0x80 #define ICMP6_RR_FLAGS_REQRESULT 0x40 #define ICMP6_RR_FLAGS_FORCEAPPLY 0x20 #define ICMP6_RR_FLAGS_SPECSITE 0x10 #define ICMP6_RR_FLAGS_PREVDONE 0x08 #define rr_type rr_hdr.icmp6_type #define rr_code rr_hdr.icmp6_code #define rr_cksum rr_hdr.icmp6_cksum #define rr_seqnum rr_hdr.icmp6_data32[0] struct rr_pco_match { /* match prefix part */ u_int8_t rpm_code; u_int8_t rpm_len; u_int8_t rpm_ordinal; u_int8_t rpm_matchlen; u_int8_t rpm_minlen; u_int8_t rpm_maxlen; u_int16_t rpm_reserved; struct in6_addr rpm_prefix; }; #define RPM_PCO_ADD 1 #define RPM_PCO_CHANGE 2 #define RPM_PCO_SETGLOBAL 3 #define RPM_PCO_MAX 4 struct rr_pco_use { /* use prefix part */ u_int8_t rpu_uselen; u_int8_t rpu_keeplen; u_int8_t rpu_ramask; u_int8_t rpu_raflags; u_int32_t rpu_vltime; u_int32_t rpu_pltime; u_int32_t rpu_flags; struct in6_addr rpu_prefix; }; #define ICMP6_RR_PCOUSE_RAFLAGS_ONLINK 0x80 #define ICMP6_RR_PCOUSE_RAFLAGS_AUTO 0x40 /* network endian */ #define ICMP6_RR_PCOUSE_FLAGS_DECRVLTIME ((u_int32_t)htonl(0x80000000)) #define ICMP6_RR_PCOUSE_FLAGS_DECRPLTIME ((u_int32_t)htonl(0x40000000)) struct rr_result { /* router renumbering result message */ u_int16_t rrr_flags; u_int8_t rrr_ordinal; u_int8_t rrr_matchedlen; u_int32_t rrr_ifid; struct in6_addr rrr_prefix; }; /* network endian */ #define ICMP6_RR_RESULT_FLAGS_OOB ((u_int16_t)htons(0x0002)) #define ICMP6_RR_RESULT_FLAGS_FORBIDDEN ((u_int16_t)htons(0x0001)) #endif /* not _NETINET_ICMP6_H_ */ tcpdump-3.9.8/./packetdat.awk0000644000026300017500000000262406777230377014160 0ustar mcrmcrBEGIN { # we need to know (usual) packet size to convert byte numbers # to packet numbers if (packetsize <= 0) packetsize = 512 } $5 !~ /[SR]/ { # print out per-packet data in the form: # # # <1st send time> # # <1st ack time> # # <# sends> # <# acks> n = split ($1,t,":") tim = t[1]*3600 + t[2]*60 + t[3] if ($6 != "ack") { i = index($6,":") strtSeq = substr($6,1,i-1) id = 1.5 + (strtSeq - 1) / packetsize id -= id % 1 if (maxId < id) maxId = id if (firstSend[id] == 0) { firstSend[id] = tim seqNo[id] = strtSeq } lastSend[id] = tim timesSent[id]++ totalPackets++ } else { id = 1 + ($7 - 2) / packetsize id -= id % 1 timesAcked[id]++ if (firstAck[id] == 0) firstAck[id] = tim lastAck[id] = tim totalAcks++ } } END { print "# " maxId " chunks. " totalPackets " packets sent. " \ totalAcks " acks." # for packets that were implicitly acked, make the ack time # be the ack time of next explicitly acked packet. for (i = maxId-1; i > 0; --i) while (i > 0 && firstAck[i] == 0) { lastAck[i] = firstAck[i] = firstAck[i+1] --i } tzero = firstSend[1] for (i = 1; i <= maxId; i++) printf "%d\t%d\t%.2f\t%.2f\t%.2f\t%.2f\t%d\t%d\n",\ i, seqNo[i], \ firstSend[i] - tzero, lastSend[i] - tzero,\ firstAck[i] - tzero, lastAck[i] - tzero,\ timesSent[i], timesAcked[i] } tcpdump-3.9.8/./token.h0000644000026300017500000000453207575562704013004 0ustar mcrmcr/* @(#) $Header: /tcpdump/master/tcpdump/token.h,v 1.6 2002/12/11 07:14:12 guy Exp $ (LBL) */ /* * Copyright (c) 1998, Larry Lile * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice unmodified, this list of conditions, and the following * disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * */ #define TOKEN_HDRLEN 14 #define TOKEN_RING_MAC_LEN 6 #define ROUTING_SEGMENT_MAX 16 #define IS_SOURCE_ROUTED(trp) ((trp)->token_shost[0] & 0x80) #define FRAME_TYPE(trp) (((trp)->token_fc & 0xC0) >> 6) #define TOKEN_FC_LLC 1 #define BROADCAST(trp) ((ntohs((trp)->token_rcf) & 0xE000) >> 13) #define RIF_LENGTH(trp) ((ntohs((trp)->token_rcf) & 0x1f00) >> 8) #define DIRECTION(trp) ((ntohs((trp)->token_rcf) & 0x0080) >> 7) #define LARGEST_FRAME(trp) ((ntohs((trp)->token_rcf) & 0x0070) >> 4) #define RING_NUMBER(trp, x) ((ntohs((trp)->token_rseg[x]) & 0xfff0) >> 4) #define BRIDGE_NUMBER(trp, x) ((ntohs((trp)->token_rseg[x]) & 0x000f)) #define SEGMENT_COUNT(trp) ((int)((RIF_LENGTH(trp) - 2) / 2)) struct token_header { u_int8_t token_ac; u_int8_t token_fc; u_int8_t token_dhost[TOKEN_RING_MAC_LEN]; u_int8_t token_shost[TOKEN_RING_MAC_LEN]; u_int16_t token_rcf; u_int16_t token_rseg[ROUTING_SEGMENT_MAX]; }; tcpdump-3.9.8/./print-tcp.c0000644000026300017500000004561010504040015013545 0ustar mcrmcr/* * Copyright (c) 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997 * The Regents of the University of California. All rights reserved. * * Copyright (c) 1999-2004 The tcpdump.org project * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that: (1) source code distributions * retain the above copyright notice and this paragraph in its entirety, (2) * distributions including binary code include the above copyright notice and * this paragraph in its entirety in the documentation or other materials * provided with the distribution, and (3) all advertising materials mentioning * features or use of this software display the following acknowledgement: * ``This product includes software developed by the University of California, * Lawrence Berkeley Laboratory and its contributors.'' Neither the name of * the University nor the names of its contributors may be used to endorse * or promote products derived from this software without specific prior * written permission. * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. */ #ifndef lint static const char rcsid[] _U_ = "@(#) $Header: /tcpdump/master/tcpdump/print-tcp.c,v 1.120.2.3 2005/10/16 06:05:46 guy Exp $ (LBL)"; #endif #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include #include #include "interface.h" #include "addrtoname.h" #include "extract.h" #include "tcp.h" #include "ip.h" #ifdef INET6 #include "ip6.h" #endif #include "ipproto.h" #include "rpc_auth.h" #include "rpc_msg.h" #include "nameser.h" #ifdef HAVE_LIBCRYPTO #include #define SIGNATURE_VALID 0 #define SIGNATURE_INVALID 1 #define CANT_CHECK_SIGNATURE 2 static int tcp_verify_signature(const struct ip *ip, const struct tcphdr *tp, const u_char *data, int length, const u_char *rcvsig); #endif static void print_tcp_rst_data(register const u_char *sp, u_int length); #define MAX_RST_DATA_LEN 30 struct tha { #ifndef INET6 struct in_addr src; struct in_addr dst; #else struct in6_addr src; struct in6_addr dst; #endif /*INET6*/ u_int port; }; struct tcp_seq_hash { struct tcp_seq_hash *nxt; struct tha addr; tcp_seq seq; tcp_seq ack; }; #define TSEQ_HASHSIZE 919 /* These tcp optinos do not have the size octet */ #define ZEROLENOPT(o) ((o) == TCPOPT_EOL || (o) == TCPOPT_NOP) static struct tcp_seq_hash tcp_seq_hash[TSEQ_HASHSIZE]; #ifndef TELNET_PORT #define TELNET_PORT 23 #endif #ifndef BGP_PORT #define BGP_PORT 179 #endif #define NETBIOS_SSN_PORT 139 #ifndef PPTP_PORT #define PPTP_PORT 1723 #endif #define BEEP_PORT 10288 #ifndef NFS_PORT #define NFS_PORT 2049 #endif #define MSDP_PORT 639 #define LDP_PORT 646 static int tcp_cksum(register const struct ip *ip, register const struct tcphdr *tp, register u_int len) { union phu { struct phdr { u_int32_t src; u_int32_t dst; u_char mbz; u_char proto; u_int16_t len; } ph; u_int16_t pa[6]; } phu; const u_int16_t *sp; /* pseudo-header.. */ phu.ph.len = htons((u_int16_t)len); phu.ph.mbz = 0; phu.ph.proto = IPPROTO_TCP; memcpy(&phu.ph.src, &ip->ip_src.s_addr, sizeof(u_int32_t)); if (IP_HL(ip) == 5) memcpy(&phu.ph.dst, &ip->ip_dst.s_addr, sizeof(u_int32_t)); else phu.ph.dst = ip_finddst(ip); sp = &phu.pa[0]; return in_cksum((u_short *)tp, len, sp[0]+sp[1]+sp[2]+sp[3]+sp[4]+sp[5]); } #ifdef INET6 static int tcp6_cksum(const struct ip6_hdr *ip6, const struct tcphdr *tp, u_int len) { size_t i; register const u_int16_t *sp; u_int32_t sum; union { struct { struct in6_addr ph_src; struct in6_addr ph_dst; u_int32_t ph_len; u_int8_t ph_zero[3]; u_int8_t ph_nxt; } ph; u_int16_t pa[20]; } phu; /* pseudo-header */ memset(&phu, 0, sizeof(phu)); phu.ph.ph_src = ip6->ip6_src; phu.ph.ph_dst = ip6->ip6_dst; phu.ph.ph_len = htonl(len); phu.ph.ph_nxt = IPPROTO_TCP; sum = 0; for (i = 0; i < sizeof(phu.pa) / sizeof(phu.pa[0]); i++) sum += phu.pa[i]; sp = (const u_int16_t *)tp; for (i = 0; i < (len & ~1); i += 2) sum += *sp++; if (len & 1) sum += htons((*(const u_int8_t *)sp) << 8); while (sum > 0xffff) sum = (sum & 0xffff) + (sum >> 16); sum = ~sum & 0xffff; return (sum); } #endif void tcp_print(register const u_char *bp, register u_int length, register const u_char *bp2, int fragmented) { register const struct tcphdr *tp; register const struct ip *ip; register u_char flags; register u_int hlen; register char ch; u_int16_t sport, dport, win, urp; u_int32_t seq, ack, thseq, thack; int threv; #ifdef INET6 register const struct ip6_hdr *ip6; #endif tp = (struct tcphdr *)bp; ip = (struct ip *)bp2; #ifdef INET6 if (IP_V(ip) == 6) ip6 = (struct ip6_hdr *)bp2; else ip6 = NULL; #endif /*INET6*/ ch = '\0'; if (!TTEST(tp->th_dport)) { (void)printf("%s > %s: [|tcp]", ipaddr_string(&ip->ip_src), ipaddr_string(&ip->ip_dst)); return; } sport = EXTRACT_16BITS(&tp->th_sport); dport = EXTRACT_16BITS(&tp->th_dport); hlen = TH_OFF(tp) * 4; /* * If data present, header length valid, and NFS port used, * assume NFS. * Pass offset of data plus 4 bytes for RPC TCP msg length * to NFS print routines. */ if (!qflag && hlen >= sizeof(*tp) && hlen <= length) { if ((u_char *)tp + 4 + sizeof(struct sunrpc_msg) <= snapend && dport == NFS_PORT) { nfsreq_print((u_char *)tp + hlen + 4, length - hlen, (u_char *)ip); return; } else if ((u_char *)tp + 4 + sizeof(struct sunrpc_msg) <= snapend && sport == NFS_PORT) { nfsreply_print((u_char *)tp + hlen + 4, length - hlen, (u_char *)ip); return; } } #ifdef INET6 if (ip6) { if (ip6->ip6_nxt == IPPROTO_TCP) { (void)printf("%s.%s > %s.%s: ", ip6addr_string(&ip6->ip6_src), tcpport_string(sport), ip6addr_string(&ip6->ip6_dst), tcpport_string(dport)); } else { (void)printf("%s > %s: ", tcpport_string(sport), tcpport_string(dport)); } } else #endif /*INET6*/ { if (ip->ip_p == IPPROTO_TCP) { (void)printf("%s.%s > %s.%s: ", ipaddr_string(&ip->ip_src), tcpport_string(sport), ipaddr_string(&ip->ip_dst), tcpport_string(dport)); } else { (void)printf("%s > %s: ", tcpport_string(sport), tcpport_string(dport)); } } if (hlen < sizeof(*tp)) { (void)printf(" tcp %d [bad hdr length %u - too short, < %lu]", length - hlen, hlen, (unsigned long)sizeof(*tp)); return; } TCHECK(*tp); seq = EXTRACT_32BITS(&tp->th_seq); ack = EXTRACT_32BITS(&tp->th_ack); win = EXTRACT_16BITS(&tp->th_win); urp = EXTRACT_16BITS(&tp->th_urp); if (qflag) { (void)printf("tcp %d", length - hlen); if (hlen > length) { (void)printf(" [bad hdr length %u - too long, > %u]", hlen, length); } return; } if ((flags = tp->th_flags) & (TH_SYN|TH_FIN|TH_RST|TH_PUSH| TH_ECNECHO|TH_CWR)) { if (flags & TH_SYN) putchar('S'); if (flags & TH_FIN) putchar('F'); if (flags & TH_RST) putchar('R'); if (flags & TH_PUSH) putchar('P'); if (flags & TH_CWR) putchar('W'); /* congestion _W_indow reduced (ECN) */ if (flags & TH_ECNECHO) putchar('E'); /* ecn _E_cho sent (ECN) */ } else putchar('.'); if (!Sflag && (flags & TH_ACK)) { register struct tcp_seq_hash *th; const void *src, *dst; register int rev; struct tha tha; /* * Find (or record) the initial sequence numbers for * this conversation. (we pick an arbitrary * collating order so there's only one entry for * both directions). */ #ifdef INET6 memset(&tha, 0, sizeof(tha)); rev = 0; if (ip6) { src = &ip6->ip6_src; dst = &ip6->ip6_dst; if (sport > dport) rev = 1; else if (sport == dport) { if (memcmp(src, dst, sizeof ip6->ip6_dst) > 0) rev = 1; } if (rev) { memcpy(&tha.src, dst, sizeof ip6->ip6_dst); memcpy(&tha.dst, src, sizeof ip6->ip6_src); tha.port = dport << 16 | sport; } else { memcpy(&tha.dst, dst, sizeof ip6->ip6_dst); memcpy(&tha.src, src, sizeof ip6->ip6_src); tha.port = sport << 16 | dport; } } else { src = &ip->ip_src; dst = &ip->ip_dst; if (sport > dport) rev = 1; else if (sport == dport) { if (memcmp(src, dst, sizeof ip->ip_dst) > 0) rev = 1; } if (rev) { memcpy(&tha.src, dst, sizeof ip->ip_dst); memcpy(&tha.dst, src, sizeof ip->ip_src); tha.port = dport << 16 | sport; } else { memcpy(&tha.dst, dst, sizeof ip->ip_dst); memcpy(&tha.src, src, sizeof ip->ip_src); tha.port = sport << 16 | dport; } } #else rev = 0; src = &ip->ip_src; dst = &ip->ip_dst; if (sport > dport) rev = 1; else if (sport == dport) { if (memcmp(src, dst, sizeof ip->ip_dst) > 0) rev = 1; } if (rev) { memcpy(&tha.src, dst, sizeof ip->ip_dst); memcpy(&tha.dst, src, sizeof ip->ip_src); tha.port = dport << 16 | sport; } else { memcpy(&tha.dst, dst, sizeof ip->ip_dst); memcpy(&tha.src, src, sizeof ip->ip_src); tha.port = sport << 16 | dport; } #endif threv = rev; for (th = &tcp_seq_hash[tha.port % TSEQ_HASHSIZE]; th->nxt; th = th->nxt) if (memcmp((char *)&tha, (char *)&th->addr, sizeof(th->addr)) == 0) break; if (!th->nxt || (flags & TH_SYN)) { /* didn't find it or new conversation */ if (th->nxt == NULL) { th->nxt = (struct tcp_seq_hash *) calloc(1, sizeof(*th)); if (th->nxt == NULL) error("tcp_print: calloc"); } th->addr = tha; if (rev) th->ack = seq, th->seq = ack - 1; else th->seq = seq, th->ack = ack - 1; } else { if (rev) seq -= th->ack, ack -= th->seq; else seq -= th->seq, ack -= th->ack; } thseq = th->seq; thack = th->ack; } else { /*fool gcc*/ thseq = thack = threv = 0; } if (hlen > length) { (void)printf(" [bad hdr length %u - too long, > %u]", hlen, length); return; } if (IP_V(ip) == 4 && vflag && !fragmented) { u_int16_t sum, tcp_sum; if (TTEST2(tp->th_sport, length)) { sum = tcp_cksum(ip, tp, length); (void)printf(", cksum 0x%04x",EXTRACT_16BITS(&tp->th_sum)); if (sum != 0) { tcp_sum = EXTRACT_16BITS(&tp->th_sum); (void)printf(" (incorrect (-> 0x%04x),",in_cksum_shouldbe(tcp_sum, sum)); } else (void)printf(" (correct),"); } } #ifdef INET6 if (IP_V(ip) == 6 && ip6->ip6_plen && vflag && !fragmented) { u_int16_t sum,tcp_sum; if (TTEST2(tp->th_sport, length)) { sum = tcp6_cksum(ip6, tp, length); (void)printf(", cksum 0x%04x",EXTRACT_16BITS(&tp->th_sum)); if (sum != 0) { tcp_sum = EXTRACT_16BITS(&tp->th_sum); (void)printf(" (incorrect (-> 0x%04x),",in_cksum_shouldbe(tcp_sum, sum)); } else (void)printf(" (correct),"); } } #endif length -= hlen; if (vflag > 1 || length > 0 || flags & (TH_SYN | TH_FIN | TH_RST)) (void)printf(" %u:%u(%u)", seq, seq + length, length); if (flags & TH_ACK) (void)printf(" ack %u", ack); (void)printf(" win %d", win); if (flags & TH_URG) (void)printf(" urg %d", urp); /* * Handle any options. */ if (hlen > sizeof(*tp)) { register const u_char *cp; register u_int i, opt, datalen; register u_int len; hlen -= sizeof(*tp); cp = (const u_char *)tp + sizeof(*tp); putchar(' '); ch = '<'; while (hlen > 0) { putchar(ch); TCHECK(*cp); opt = *cp++; if (ZEROLENOPT(opt)) len = 1; else { TCHECK(*cp); len = *cp++; /* total including type, len */ if (len < 2 || len > hlen) goto bad; --hlen; /* account for length byte */ } --hlen; /* account for type byte */ datalen = 0; /* Bail if "l" bytes of data are not left or were not captured */ #define LENCHECK(l) { if ((l) > hlen) goto bad; TCHECK2(*cp, l); } switch (opt) { case TCPOPT_MAXSEG: (void)printf("mss"); datalen = 2; LENCHECK(datalen); (void)printf(" %u", EXTRACT_16BITS(cp)); break; case TCPOPT_EOL: (void)printf("eol"); break; case TCPOPT_NOP: (void)printf("nop"); break; case TCPOPT_WSCALE: (void)printf("wscale"); datalen = 1; LENCHECK(datalen); (void)printf(" %u", *cp); break; case TCPOPT_SACKOK: (void)printf("sackOK"); break; case TCPOPT_SACK: datalen = len - 2; if (datalen % 8 != 0) { (void)printf("malformed sack"); } else { u_int32_t s, e; (void)printf("sack %d ", datalen / 8); for (i = 0; i < datalen; i += 8) { LENCHECK(i + 4); s = EXTRACT_32BITS(cp + i); LENCHECK(i + 8); e = EXTRACT_32BITS(cp + i + 4); if (threv) { s -= thseq; e -= thseq; } else { s -= thack; e -= thack; } (void)printf("{%u:%u}", s, e); } } break; case TCPOPT_ECHO: (void)printf("echo"); datalen = 4; LENCHECK(datalen); (void)printf(" %u", EXTRACT_32BITS(cp)); break; case TCPOPT_ECHOREPLY: (void)printf("echoreply"); datalen = 4; LENCHECK(datalen); (void)printf(" %u", EXTRACT_32BITS(cp)); break; case TCPOPT_TIMESTAMP: (void)printf("timestamp"); datalen = 8; LENCHECK(4); (void)printf(" %u", EXTRACT_32BITS(cp)); LENCHECK(datalen); (void)printf(" %u", EXTRACT_32BITS(cp + 4)); break; case TCPOPT_CC: (void)printf("cc"); datalen = 4; LENCHECK(datalen); (void)printf(" %u", EXTRACT_32BITS(cp)); break; case TCPOPT_CCNEW: (void)printf("ccnew"); datalen = 4; LENCHECK(datalen); (void)printf(" %u", EXTRACT_32BITS(cp)); break; case TCPOPT_CCECHO: (void)printf("ccecho"); datalen = 4; LENCHECK(datalen); (void)printf(" %u", EXTRACT_32BITS(cp)); break; case TCPOPT_SIGNATURE: (void)printf("md5:"); datalen = TCP_SIGLEN; LENCHECK(datalen); #ifdef HAVE_LIBCRYPTO switch (tcp_verify_signature(ip, tp, bp + TH_OFF(tp) * 4, length, cp)) { case SIGNATURE_VALID: (void)printf("valid"); break; case SIGNATURE_INVALID: (void)printf("invalid"); break; case CANT_CHECK_SIGNATURE: (void)printf("can't check - "); for (i = 0; i < TCP_SIGLEN; ++i) (void)printf("%02x", cp[i]); break; } #else for (i = 0; i < TCP_SIGLEN; ++i) (void)printf("%02x", cp[i]); #endif break; default: (void)printf("opt-%u:", opt); datalen = len - 2; for (i = 0; i < datalen; ++i) { LENCHECK(i); (void)printf("%02x", cp[i]); } break; } /* Account for data printed */ cp += datalen; hlen -= datalen; /* Check specification against observed length */ ++datalen; /* option octet */ if (!ZEROLENOPT(opt)) ++datalen; /* size octet */ if (datalen != len) (void)printf("[len %d]", len); ch = ','; if (opt == TCPOPT_EOL) break; } putchar('>'); } if (length <= 0) return; /* * Decode payload if necessary. */ bp += TH_OFF(tp) * 4; if (flags & TH_RST) { if (vflag) print_tcp_rst_data(bp, length); } else { if (sport == TELNET_PORT || dport == TELNET_PORT) { if (!qflag && vflag) telnet_print(bp, length); } else if (sport == BGP_PORT || dport == BGP_PORT) bgp_print(bp, length); else if (sport == PPTP_PORT || dport == PPTP_PORT) pptp_print(bp); #ifdef TCPDUMP_DO_SMB else if (sport == NETBIOS_SSN_PORT || dport == NETBIOS_SSN_PORT) nbt_tcp_print(bp, length); #endif else if (sport == BEEP_PORT || dport == BEEP_PORT) beep_print(bp, length); else if (length > 2 && (sport == NAMESERVER_PORT || dport == NAMESERVER_PORT || sport == MULTICASTDNS_PORT || dport == MULTICASTDNS_PORT)) { /* * TCP DNS query has 2byte length at the head. * XXX packet could be unaligned, it can go strange */ ns_print(bp + 2, length - 2, 0); } else if (sport == MSDP_PORT || dport == MSDP_PORT) { msdp_print(bp, length); } else if (length > 0 && (sport == LDP_PORT || dport == LDP_PORT)) { ldp_print(bp, length); } } return; bad: fputs("[bad opt]", stdout); if (ch != '\0') putchar('>'); return; trunc: fputs("[|tcp]", stdout); if (ch != '\0') putchar('>'); } /* * RFC1122 says the following on data in RST segments: * * 4.2.2.12 RST Segment: RFC-793 Section 3.4 * * A TCP SHOULD allow a received RST segment to include data. * * DISCUSSION * It has been suggested that a RST segment could contain * ASCII text that encoded and explained the cause of the * RST. No standard has yet been established for such * data. * */ static void print_tcp_rst_data(register const u_char *sp, u_int length) { int c; if (TTEST2(*sp, length)) printf(" [RST"); else printf(" [!RST"); if (length > MAX_RST_DATA_LEN) { length = MAX_RST_DATA_LEN; /* can use -X for longer */ putchar('+'); /* indicate we truncate */ } putchar(' '); while (length-- && sp <= snapend) { c = *sp++; safeputchar(c); } putchar(']'); } #ifdef HAVE_LIBCRYPTO static int tcp_verify_signature(const struct ip *ip, const struct tcphdr *tp, const u_char *data, int length, const u_char *rcvsig) { struct tcphdr tp1; u_char sig[TCP_SIGLEN]; char zero_proto = 0; MD5_CTX ctx; u_int16_t savecsum, tlen; #ifdef INET6 struct ip6_hdr *ip6; #endif u_int32_t len32; u_int8_t nxt; tp1 = *tp; if (tcpmd5secret == NULL) return (CANT_CHECK_SIGNATURE); MD5_Init(&ctx); /* * Step 1: Update MD5 hash with IP pseudo-header. */ if (IP_V(ip) == 4) { MD5_Update(&ctx, (char *)&ip->ip_src, sizeof(ip->ip_src)); MD5_Update(&ctx, (char *)&ip->ip_dst, sizeof(ip->ip_dst)); MD5_Update(&ctx, (char *)&zero_proto, sizeof(zero_proto)); MD5_Update(&ctx, (char *)&ip->ip_p, sizeof(ip->ip_p)); tlen = EXTRACT_16BITS(&ip->ip_len) - IP_HL(ip) * 4; tlen = htons(tlen); MD5_Update(&ctx, (char *)&tlen, sizeof(tlen)); #ifdef INET6 } else if (IP_V(ip) == 6) { ip6 = (struct ip6_hdr *)ip; MD5_Update(&ctx, (char *)&ip6->ip6_src, sizeof(ip6->ip6_src)); MD5_Update(&ctx, (char *)&ip6->ip6_dst, sizeof(ip6->ip6_dst)); len32 = htonl(ntohs(ip6->ip6_plen)); MD5_Update(&ctx, (char *)&len32, sizeof(len32)); nxt = 0; MD5_Update(&ctx, (char *)&nxt, sizeof(nxt)); MD5_Update(&ctx, (char *)&nxt, sizeof(nxt)); MD5_Update(&ctx, (char *)&nxt, sizeof(nxt)); nxt = IPPROTO_TCP; MD5_Update(&ctx, (char *)&nxt, sizeof(nxt)); #endif } else return (CANT_CHECK_SIGNATURE); /* * Step 2: Update MD5 hash with TCP header, excluding options. * The TCP checksum must be set to zero. */ savecsum = tp1.th_sum; tp1.th_sum = 0; MD5_Update(&ctx, (char *)&tp1, sizeof(struct tcphdr)); tp1.th_sum = savecsum; /* * Step 3: Update MD5 hash with TCP segment data, if present. */ if (length > 0) MD5_Update(&ctx, data, length); /* * Step 4: Update MD5 hash with shared secret. */ MD5_Update(&ctx, tcpmd5secret, strlen(tcpmd5secret)); MD5_Final(sig, &ctx); if (memcmp(rcvsig, sig, TCP_SIGLEN) == 0) return (SIGNATURE_VALID); else return (SIGNATURE_INVALID); } #endif /* HAVE_LIBCRYPTO */ tcpdump-3.9.8/./l2tp.h0000644000026300017500000000546207371461757012550 0ustar mcrmcr/* @(#) $Header: /tcpdump/master/tcpdump/l2tp.h,v 1.5 2001/11/05 10:03:27 guy Exp $ (LBL) */ /* * Copyright (c) 1991, 1993, 1994, 1995, 1996, 1997 * The Regents of the University of California. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that: (1) source code distributions * retain the above copyright notice and this paragraph in its entirety, (2) * distributions including binary code include the above copyright notice and * this paragraph in its entirety in the documentation or other materials * provided with the distribution, and (3) all advertising materials mentioning * features or use of this software display the following acknowledgement: * ``This product includes software developed by the University of California, * Lawrence Berkeley Laboratory and its contributors.'' Neither the name of * the University nor the names of its contributors may be used to endorse * or promote products derived from this software without specific prior * written permission. * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * * L2TP support contributed by Motonori Shindo (mshindo@mshindo.net) */ #define L2TP_FLAG_TYPE 0x8000 /* Type (0=Data, 1=Control) */ #define L2TP_FLAG_LENGTH 0x4000 /* Length */ #define L2TP_FLAG_SEQUENCE 0x0800 /* Sequence */ #define L2TP_FLAG_OFFSET 0x0200 /* Offset */ #define L2TP_FLAG_PRIORITY 0x0100 /* Priority */ #define L2TP_VERSION_MASK 0x000f /* Version Mask */ #define L2TP_VERSION_L2F 0x0001 /* L2F */ #define L2TP_VERSION_L2TP 0x0002 /* L2TP */ #define L2TP_AVP_HDR_FLAG_MANDATORY 0x8000 /* Mandatory Flag */ #define L2TP_AVP_HDR_FLAG_HIDDEN 0x4000 /* Hidden Flag */ #define L2TP_AVP_HDR_LEN_MASK 0x03ff /* Length Mask */ #define L2TP_FRAMING_CAP_SYNC_MASK 0x00000001 /* Synchronous */ #define L2TP_FRAMING_CAP_ASYNC_MASK 0x00000002 /* Asynchronous */ #define L2TP_FRAMING_TYPE_SYNC_MASK 0x00000001 /* Synchronous */ #define L2TP_FRAMING_TYPE_ASYNC_MASK 0x00000002 /* Asynchronous */ #define L2TP_BEARER_CAP_DIGITAL_MASK 0x00000001 /* Digital */ #define L2TP_BEARER_CAP_ANALOG_MASK 0x00000002 /* Analog */ #define L2TP_BEARER_TYPE_DIGITAL_MASK 0x00000001 /* Digital */ #define L2TP_BEARER_TYPE_ANALOG_MASK 0x00000002 /* Analog */ /* Authen Type */ #define L2TP_AUTHEN_TYPE_RESERVED 0x0000 /* Reserved */ #define L2TP_AUTHEN_TYPE_TEXTUAL 0x0001 /* Textual username/password exchange */ #define L2TP_AUTHEN_TYPE_CHAP 0x0002 /* PPP CHAP */ #define L2TP_AUTHEN_TYPE_PAP 0x0003 /* PPP PAP */ #define L2TP_AUTHEN_TYPE_NO_AUTH 0x0004 /* No Authentication */ #define L2TP_AUTHEN_TYPE_MSCHAPv1 0x0005 /* MSCHAPv1 */ #define L2TP_PROXY_AUTH_ID_MASK 0x00ff tcpdump-3.9.8/./print-arp.c0000644000026300017500000002505210044500746013552 0ustar mcrmcr/* * Copyright (c) 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997 * The Regents of the University of California. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that: (1) source code distributions * retain the above copyright notice and this paragraph in its entirety, (2) * distributions including binary code include the above copyright notice and * this paragraph in its entirety in the documentation or other materials * provided with the distribution, and (3) all advertising materials mentioning * features or use of this software display the following acknowledgement: * ``This product includes software developed by the University of California, * Lawrence Berkeley Laboratory and its contributors.'' Neither the name of * the University nor the names of its contributors may be used to endorse * or promote products derived from this software without specific prior * written permission. * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. */ #ifndef lint static const char rcsid[] _U_ = "@(#) $Header: /tcpdump/master/tcpdump/print-arp.c,v 1.64 2004/04/30 16:42:14 mcr Exp $ (LBL)"; #endif #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include #include "netdissect.h" #include "addrtoname.h" #include "ether.h" #include "ethertype.h" #include "extract.h" /* must come after interface.h */ /* * Address Resolution Protocol. * * See RFC 826 for protocol description. ARP packets are variable * in size; the arphdr structure defines the fixed-length portion. * Protocol type values are the same as those for 10 Mb/s Ethernet. * It is followed by the variable-sized fields ar_sha, arp_spa, * arp_tha and arp_tpa in that order, according to the lengths * specified. Field names used correspond to RFC 826. */ struct arp_pkthdr { u_short ar_hrd; /* format of hardware address */ #define ARPHRD_ETHER 1 /* ethernet hardware format */ #define ARPHRD_IEEE802 6 /* token-ring hardware format */ #define ARPHRD_ARCNET 7 /* arcnet hardware format */ #define ARPHRD_FRELAY 15 /* frame relay hardware format */ #define ARPHRD_STRIP 23 /* Ricochet Starmode Radio hardware format */ #define ARPHRD_IEEE1394 24 /* IEEE 1394 (FireWire) hardware format */ u_short ar_pro; /* format of protocol address */ u_char ar_hln; /* length of hardware address */ u_char ar_pln; /* length of protocol address */ u_short ar_op; /* one of: */ #define ARPOP_REQUEST 1 /* request to resolve address */ #define ARPOP_REPLY 2 /* response to previous request */ #define ARPOP_REVREQUEST 3 /* request protocol address given hardware */ #define ARPOP_REVREPLY 4 /* response giving protocol address */ #define ARPOP_INVREQUEST 8 /* request to identify peer */ #define ARPOP_INVREPLY 9 /* response identifying peer */ /* * The remaining fields are variable in size, * according to the sizes above. */ #ifdef COMMENT_ONLY u_char ar_sha[]; /* sender hardware address */ u_char ar_spa[]; /* sender protocol address */ u_char ar_tha[]; /* target hardware address */ u_char ar_tpa[]; /* target protocol address */ #endif #define ar_sha(ap) (((const u_char *)((ap)+1))+0) #define ar_spa(ap) (((const u_char *)((ap)+1))+ (ap)->ar_hln) #define ar_tha(ap) (((const u_char *)((ap)+1))+ (ap)->ar_hln+(ap)->ar_pln) #define ar_tpa(ap) (((const u_char *)((ap)+1))+2*(ap)->ar_hln+(ap)->ar_pln) }; #define ARP_HDRLEN 8 #define HRD(ap) EXTRACT_16BITS(&(ap)->ar_hrd) #define HLN(ap) ((ap)->ar_hln) #define PLN(ap) ((ap)->ar_pln) #define OP(ap) EXTRACT_16BITS(&(ap)->ar_op) #define PRO(ap) EXTRACT_16BITS(&(ap)->ar_pro) #define SHA(ap) (ar_sha(ap)) #define SPA(ap) (ar_spa(ap)) #define THA(ap) (ar_tha(ap)) #define TPA(ap) (ar_tpa(ap)) /* * ATM Address Resolution Protocol. * * See RFC 2225 for protocol description. ATMARP packets are similar * to ARP packets, except that there are no length fields for the * protocol address - instead, there are type/length fields for * the ATM number and subaddress - and the hardware addresses consist * of an ATM number and an ATM subaddress. */ struct atmarp_pkthdr { u_short aar_hrd; /* format of hardware address */ #define ARPHRD_ATM2225 19 /* ATM (RFC 2225) */ u_short aar_pro; /* format of protocol address */ u_char aar_shtl; /* length of source ATM number */ u_char aar_sstl; /* length of source ATM subaddress */ #define ATMARP_IS_E164 0x40 /* bit in type/length for E.164 format */ #define ATMARP_LEN_MASK 0x3F /* length of {sub}address in type/length */ u_short aar_op; /* same as regular ARP */ #define ATMARPOP_NAK 10 /* NAK */ u_char aar_spln; /* length of source protocol address */ u_char aar_thtl; /* length of target ATM number */ u_char aar_tstl; /* length of target ATM subaddress */ u_char aar_tpln; /* length of target protocol address */ /* * The remaining fields are variable in size, * according to the sizes above. */ #ifdef COMMENT_ONLY u_char aar_sha[]; /* source ATM number */ u_char aar_ssa[]; /* source ATM subaddress */ u_char aar_spa[]; /* sender protocol address */ u_char aar_tha[]; /* target ATM number */ u_char aar_tsa[]; /* target ATM subaddress */ u_char aar_tpa[]; /* target protocol address */ #endif #define ATMHRD(ap) EXTRACT_16BITS(&(ap)->aar_hrd) #define ATMSHLN(ap) ((ap)->aar_shtl & ATMARP_LEN_MASK) #define ATMSSLN(ap) ((ap)->aar_sstl & ATMARP_LEN_MASK) #define ATMSPLN(ap) ((ap)->aar_spln) #define ATMOP(ap) EXTRACT_16BITS(&(ap)->aar_op) #define ATMPRO(ap) EXTRACT_16BITS(&(ap)->aar_pro) #define ATMTHLN(ap) ((ap)->aar_thtl & ATMARP_LEN_MASK) #define ATMTSLN(ap) ((ap)->aar_tstl & ATMARP_LEN_MASK) #define ATMTPLN(ap) ((ap)->aar_tpln) #define aar_sha(ap) ((const u_char *)((ap)+1)) #define aar_ssa(ap) (aar_sha(ap) + ATMSHLN(ap)) #define aar_spa(ap) (aar_ssa(ap) + ATMSSLN(ap)) #define aar_tha(ap) (aar_spa(ap) + ATMSPLN(ap)) #define aar_tsa(ap) (aar_tha(ap) + ATMTHLN(ap)) #define aar_tpa(ap) (aar_tsa(ap) + ATMTSLN(ap)) }; #define ATMSHA(ap) (aar_sha(ap)) #define ATMSSA(ap) (aar_ssa(ap)) #define ATMSPA(ap) (aar_spa(ap)) #define ATMTHA(ap) (aar_tha(ap)) #define ATMTSA(ap) (aar_tsa(ap)) #define ATMTPA(ap) (aar_tpa(ap)) static u_char ezero[6]; static void atmarp_addr_print(netdissect_options *ndo, const u_char *ha, u_int ha_len, const u_char *srca, u_int srca_len) { if (ha_len == 0) ND_PRINT((ndo, "")); else { ND_PRINT((ndo, "%s", linkaddr_string(ha, ha_len))); if (srca_len != 0) ND_PRINT((ndo, ",%s", linkaddr_string(srca, srca_len))); } } static void atmarp_print(netdissect_options *ndo, const u_char *bp, u_int length, u_int caplen) { const struct atmarp_pkthdr *ap; u_short pro, hrd, op; ap = (const struct atmarp_pkthdr *)bp; ND_TCHECK(*ap); hrd = ATMHRD(ap); pro = ATMPRO(ap); op = ATMOP(ap); if (!ND_TTEST2(*aar_tpa(ap), ATMTPLN(ap))) { ND_PRINT((ndo, "truncated-atmarp")); ND_DEFAULTPRINT((const u_char *)ap, length); return; } if ((pro != ETHERTYPE_IP && pro != ETHERTYPE_TRAIL) || ATMSPLN(ap) != 4 || ATMTPLN(ap) != 4) { ND_PRINT((ndo, "atmarp-#%d for proto #%d (%d/%d) hardware #%d", op, pro, ATMSPLN(ap), ATMTPLN(ap), hrd)); return; } if (pro == ETHERTYPE_TRAIL) ND_PRINT((ndo, "trailer-")); switch (op) { case ARPOP_REQUEST: ND_PRINT((ndo, "arp who-has %s", ipaddr_string(ATMTPA(ap)))); if (ATMTHLN(ap) != 0) { ND_PRINT((ndo, " (")); atmarp_addr_print(ndo, ATMTHA(ap), ATMTHLN(ap), ATMTSA(ap), ATMTSLN(ap)); ND_PRINT((ndo, ")")); } ND_PRINT((ndo, " tell %s", ipaddr_string(ATMSPA(ap)))); break; case ARPOP_REPLY: ND_PRINT((ndo, "arp reply %s", ipaddr_string(ATMSPA(ap)))); ND_PRINT((ndo, " is-at ")); atmarp_addr_print(ndo, ATMSHA(ap), ATMSHLN(ap), ATMSSA(ap), ATMSSLN(ap)); break; case ARPOP_INVREQUEST: ND_PRINT((ndo, "invarp who-is ")); atmarp_addr_print(ndo, ATMTHA(ap), ATMTHLN(ap), ATMTSA(ap), ATMTSLN(ap)); ND_PRINT((ndo, " tell ")); atmarp_addr_print(ndo, ATMSHA(ap), ATMSHLN(ap), ATMSSA(ap), ATMSSLN(ap)); break; case ARPOP_INVREPLY: ND_PRINT((ndo, "invarp reply ")); atmarp_addr_print(ndo, ATMSHA(ap), ATMSHLN(ap), ATMSSA(ap), ATMSSLN(ap)); ND_PRINT((ndo, " at %s", ipaddr_string(ATMSPA(ap)))); break; case ATMARPOP_NAK: ND_PRINT((ndo, "nak reply for %s", ipaddr_string(ATMSPA(ap)))); break; default: ND_PRINT((ndo, "atmarp-#%d", op)); ND_DEFAULTPRINT((const u_char *)ap, caplen); return; } return; trunc: ND_PRINT((ndo, "[|atmarp]")); } void arp_print(netdissect_options *ndo, const u_char *bp, u_int length, u_int caplen) { const struct arp_pkthdr *ap; u_short pro, hrd, op; ap = (const struct arp_pkthdr *)bp; ND_TCHECK(*ap); hrd = HRD(ap); if (hrd == ARPHRD_ATM2225) { atmarp_print(ndo, bp, length, caplen); return; } pro = PRO(ap); op = OP(ap); if (!ND_TTEST2(*ar_tpa(ap), PLN(ap))) { ND_PRINT((ndo, "truncated-arp")); ND_DEFAULTPRINT((const u_char *)ap, length); return; } if ((pro != ETHERTYPE_IP && pro != ETHERTYPE_TRAIL) || PLN(ap) != 4 || HLN(ap) == 0) { ND_PRINT((ndo, "arp-#%d for proto #%d (%d) hardware #%d (%d)", op, pro, PLN(ap), hrd, HLN(ap))); return; } if (pro == ETHERTYPE_TRAIL) ND_PRINT((ndo, "trailer-")); switch (op) { case ARPOP_REQUEST: ND_PRINT((ndo, "arp who-has %s", ipaddr_string(TPA(ap)))); if (memcmp((const char *)ezero, (const char *)THA(ap), HLN(ap)) != 0) ND_PRINT((ndo, " (%s)", linkaddr_string(THA(ap), HLN(ap)))); ND_PRINT((ndo, " tell %s", ipaddr_string(SPA(ap)))); break; case ARPOP_REPLY: ND_PRINT((ndo, "arp reply %s", ipaddr_string(SPA(ap)))); ND_PRINT((ndo, " is-at %s", linkaddr_string(SHA(ap), HLN(ap)))); break; case ARPOP_REVREQUEST: ND_PRINT((ndo, "rarp who-is %s tell %s", linkaddr_string(THA(ap), HLN(ap)), linkaddr_string(SHA(ap), HLN(ap)))); break; case ARPOP_REVREPLY: ND_PRINT((ndo, "rarp reply %s at %s", linkaddr_string(THA(ap), HLN(ap)), ipaddr_string(TPA(ap)))); break; case ARPOP_INVREQUEST: ND_PRINT((ndo, "invarp who-is %s tell %s", linkaddr_string(THA(ap), HLN(ap)), linkaddr_string(SHA(ap), HLN(ap)))); break; case ARPOP_INVREPLY: ND_PRINT((ndo,"invarp reply %s at %s", linkaddr_string(THA(ap), HLN(ap)), ipaddr_string(TPA(ap)))); break; default: ND_PRINT((ndo, "arp-#%d", op)); ND_DEFAULTPRINT((const u_char *)ap, caplen); return; } if (hrd != ARPHRD_ETHER) ND_PRINT((ndo, " hardware #%d", hrd)); return; trunc: ND_PRINT((ndo, "[|arp]")); } /* * Local Variables: * c-style: bsd * End: */ tcpdump-3.9.8/./print-symantec.c0000644000026300017500000000743710264535442014627 0ustar mcrmcr/* * Copyright (c) 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 2000 * The Regents of the University of California. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that: (1) source code distributions * retain the above copyright notice and this paragraph in its entirety, (2) * distributions including binary code include the above copyright notice and * this paragraph in its entirety in the documentation or other materials * provided with the distribution, and (3) all advertising materials mentioning * features or use of this software display the following acknowledgement: * ``This product includes software developed by the University of California, * Lawrence Berkeley Laboratory and its contributors.'' Neither the name of * the University nor the names of its contributors may be used to endorse * or promote products derived from this software without specific prior * written permission. * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. */ #ifndef lint static const char rcsid[] _U_ = "@(#) $Header: /tcpdump/master/tcpdump/print-symantec.c,v 1.4.2.1 2005/07/07 01:24:39 guy Exp $ (LBL)"; #endif #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include #include "interface.h" #include "addrtoname.h" #include "ethertype.h" #include "ether.h" struct symantec_header { u_int8_t stuff1[6]; u_int16_t ether_type; u_int8_t stuff2[36]; }; static inline void symantec_hdr_print(register const u_char *bp, u_int length) { register const struct symantec_header *sp; u_int16_t etype; sp = (const struct symantec_header *)bp; etype = ntohs(sp->ether_type); if (!qflag) { if (etype <= ETHERMTU) (void)printf("invalid ethertype %u", etype); else (void)printf("ethertype %s (0x%04x)", tok2str(ethertype_values,"Unknown", etype), etype); } else { if (etype <= ETHERMTU) (void)printf("invalid ethertype %u", etype); else (void)printf("%s", tok2str(ethertype_values,"Unknown Ethertype (0x%04x)", etype)); } (void)printf(", length %u: ", length); } /* * This is the top level routine of the printer. 'p' points * to the ether header of the packet, 'h->ts' is the timestamp, * 'h->len' is the length of the packet off the wire, and 'h->caplen' * is the number of bytes actually captured. */ u_int symantec_if_print(const struct pcap_pkthdr *h, const u_char *p) { u_int length = h->len; u_int caplen = h->caplen; struct symantec_header *sp; u_short ether_type; u_short extracted_ether_type; if (caplen < sizeof (struct symantec_header)) { printf("[|symantec]"); return caplen; } if (eflag) symantec_hdr_print(p, length); length -= sizeof (struct symantec_header); caplen -= sizeof (struct symantec_header); sp = (struct symantec_header *)p; p += sizeof (struct symantec_header); ether_type = ntohs(sp->ether_type); if (ether_type <= ETHERMTU) { /* ether_type not known, print raw packet */ if (!eflag) symantec_hdr_print((u_char *)sp, length + sizeof (struct symantec_header)); if (!suppress_default_print) default_print(p, caplen); } else if (ether_encap_print(ether_type, p, length, caplen, &extracted_ether_type) == 0) { /* ether_type not known, print raw packet */ if (!eflag) symantec_hdr_print((u_char *)sp, length + sizeof (struct symantec_header)); if (!suppress_default_print) default_print(p, caplen); } return (sizeof (struct symantec_header)); } tcpdump-3.9.8/./print-lane.c0000644000026300017500000001053210504040015013671 0ustar mcrmcr/* * Marko Kiiskila carnil@cs.tut.fi * * Tampere University of Technology - Telecommunications Laboratory * * Permission to use, copy, modify and distribute this * software and its documentation is hereby granted, * provided that both the copyright notice and this * permission notice appear in all copies of the software, * derivative works or modified versions, and any portions * thereof, that both notices appear in supporting * documentation, and that the use of this software is * acknowledged in any publications resulting from using * the software. * * TUT ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" * CONDITION AND DISCLAIMS ANY LIABILITY OF ANY KIND FOR * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS * SOFTWARE. * */ #ifndef lint static const char rcsid[] _U_ = "@(#) $Header: /tcpdump/master/tcpdump/print-lane.c,v 1.23.2.2 2005/11/13 12:12:59 guy Exp $ (LBL)"; #endif #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include #include "interface.h" #include "addrtoname.h" #include "extract.h" #include "ether.h" #include "lane.h" static const struct tok lecop2str[] = { { 0x0001, "configure request" }, { 0x0101, "configure response" }, { 0x0002, "join request" }, { 0x0102, "join response" }, { 0x0003, "ready query" }, { 0x0103, "ready indication" }, { 0x0004, "register request" }, { 0x0104, "register response" }, { 0x0005, "unregister request" }, { 0x0105, "unregister response" }, { 0x0006, "ARP request" }, { 0x0106, "ARP response" }, { 0x0007, "flush request" }, { 0x0107, "flush response" }, { 0x0008, "NARP request" }, { 0x0009, "topology request" }, { 0, NULL } }; static inline void lane_hdr_print(register const u_char *bp, int length) { register const struct lecdatahdr_8023 *ep; ep = (const struct lecdatahdr_8023 *)bp; if (qflag) (void)printf("lecid:%x %s %s %d: ", EXTRACT_16BITS(&ep->le_header), etheraddr_string(ep->h_source), etheraddr_string(ep->h_dest), length); else (void)printf("lecid:%x %s %s %s %d: ", EXTRACT_16BITS(&ep->le_header), etheraddr_string(ep->h_source), etheraddr_string(ep->h_dest), etherproto_string(ep->h_type), length); } /* * This is the top level routine of the printer. 'p' points * to the LANE header of the packet, 'h->ts' is the timestamp, * 'h->len' is the length of the packet off the wire, and 'h->caplen' * is the number of bytes actually captured. * * This assumes 802.3, not 802.5, LAN emulation. */ void lane_print(const u_char *p, u_int length, u_int caplen) { struct lane_controlhdr *lec; struct lecdatahdr_8023 *ep; u_short ether_type; u_short extracted_ethertype; if (caplen < sizeof(struct lane_controlhdr)) { printf("[|lane]"); return; } lec = (struct lane_controlhdr *)p; if (EXTRACT_16BITS(&lec->lec_header) == 0xff00) { /* * LE Control. */ printf("lec: proto %x vers %x %s", lec->lec_proto, lec->lec_vers, tok2str(lecop2str, "opcode-#%u", EXTRACT_16BITS(&lec->lec_opcode))); return; } if (caplen < sizeof(struct lecdatahdr_8023)) { printf("[|lane]"); return; } if (eflag) lane_hdr_print(p, length); /* * Go past the LANE header. */ length -= sizeof(struct lecdatahdr_8023); caplen -= sizeof(struct lecdatahdr_8023); ep = (struct lecdatahdr_8023 *)p; p += sizeof(struct lecdatahdr_8023); ether_type = EXTRACT_16BITS(&ep->h_type); /* * Is it (gag) an 802.3 encapsulation? */ if (ether_type <= ETHERMTU) { /* Try to print the LLC-layer header & higher layers */ if (llc_print(p, length, caplen, ep->h_source, ep->h_dest, &extracted_ethertype) == 0) { /* ether_type not known, print raw packet */ if (!eflag) lane_hdr_print((u_char *)ep, length + sizeof(*ep)); if (extracted_ethertype) { printf("(LLC %s) ", etherproto_string(htons(extracted_ethertype))); } if (!suppress_default_print) default_print(p, caplen); } } else if (ether_encap_print(ether_type, p, length, caplen, &extracted_ethertype) == 0) { /* ether_type not known, print raw packet */ if (!eflag) lane_hdr_print((u_char *)ep, length + sizeof(*ep)); if (!suppress_default_print) default_print(p, caplen); } } u_int lane_if_print(const struct pcap_pkthdr *h, const u_char *p) { lane_print(p, h->len, h->caplen); return (sizeof(struct lecdatahdr_8023)); } tcpdump-3.9.8/./nameser.h0000644000026300017500000002624610634111730013277 0ustar mcrmcr/* @(#) $Header: /tcpdump/master/tcpdump/nameser.h,v 1.14.4.2 2006/11/10 03:15:35 guy Exp $ (LBL) */ /* * Copyright (c) 1983, 1989, 1993 * The Regents of the University of California. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. All advertising materials mentioning features or use of this software * must display the following acknowledgement: * This product includes software developed by the University of * California, Berkeley and its contributors. * 4. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * * @(#)nameser.h 8.2 (Berkeley) 2/16/94 * - * Portions Copyright (c) 1993 by Digital Equipment Corporation. * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies, and that * the name of Digital Equipment Corporation not be used in advertising or * publicity pertaining to distribution of the document or software without * specific, written prior permission. * * THE SOFTWARE IS PROVIDED "AS IS" AND DIGITAL EQUIPMENT CORP. DISCLAIMS ALL * WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL DIGITAL EQUIPMENT * CORPORATION BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS * SOFTWARE. * - * --Copyright-- */ #ifndef _NAMESER_H_ #define _NAMESER_H_ #include /* * Define constants based on rfc883 */ #define PACKETSZ 512 /* maximum packet size */ #define MAXDNAME 256 /* maximum domain name */ #define MAXCDNAME 255 /* maximum compressed domain name */ #define MAXLABEL 63 /* maximum length of domain label */ /* Number of bytes of fixed size data in query structure */ #define QFIXEDSZ 4 /* number of bytes of fixed size data in resource record */ #define RRFIXEDSZ 10 /* * Internet nameserver port number */ #define NAMESERVER_PORT 53 /* * Port for multicast DNS; see * * http://files.multicastdns.org/draft-cheshire-dnsext-multicastdns.txt * * for the current mDNS spec. */ #define MULTICASTDNS_PORT 5353 /* * Currently defined opcodes */ #define QUERY 0x0 /* standard query */ #define IQUERY 0x1 /* inverse query */ #define STATUS 0x2 /* nameserver status query */ #if 0 #define xxx 0x3 /* 0x3 reserved */ #endif /* non standard - supports ALLOW_UPDATES stuff from Mike Schwartz */ #define UPDATEA 0x9 /* add resource record */ #define UPDATED 0xa /* delete a specific resource record */ #define UPDATEDA 0xb /* delete all named resource record */ #define UPDATEM 0xc /* modify a specific resource record */ #define UPDATEMA 0xd /* modify all named resource record */ #define ZONEINIT 0xe /* initial zone transfer */ #define ZONEREF 0xf /* incremental zone referesh */ /* * Undefine various #defines from various System V-flavored OSes (Solaris, * SINIX, HP-UX) so the compiler doesn't whine that we redefine them. */ #ifdef T_NULL #undef T_NULL #endif #ifdef T_OPT #undef T_OPT #endif #ifdef T_UNSPEC #undef T_UNSPEC #endif #ifdef NOERROR #undef NOERROR #endif /* * Currently defined response codes */ #define NOERROR 0 /* no error */ #define FORMERR 1 /* format error */ #define SERVFAIL 2 /* server failure */ #define NXDOMAIN 3 /* non existent domain */ #define NOTIMP 4 /* not implemented */ #define REFUSED 5 /* query refused */ /* non standard */ #define NOCHANGE 0xf /* update failed to change db */ /* * Type values for resources and queries */ #define T_A 1 /* host address */ #define T_NS 2 /* authoritative server */ #define T_MD 3 /* mail destination */ #define T_MF 4 /* mail forwarder */ #define T_CNAME 5 /* connonical name */ #define T_SOA 6 /* start of authority zone */ #define T_MB 7 /* mailbox domain name */ #define T_MG 8 /* mail group member */ #define T_MR 9 /* mail rename name */ #define T_NULL 10 /* null resource record */ #define T_WKS 11 /* well known service */ #define T_PTR 12 /* domain name pointer */ #define T_HINFO 13 /* host information */ #define T_MINFO 14 /* mailbox information */ #define T_MX 15 /* mail routing information */ #define T_TXT 16 /* text strings */ #define T_RP 17 /* responsible person */ #define T_AFSDB 18 /* AFS cell database */ #define T_X25 19 /* X_25 calling address */ #define T_ISDN 20 /* ISDN calling address */ #define T_RT 21 /* router */ #define T_NSAP 22 /* NSAP address */ #define T_NSAP_PTR 23 /* reverse lookup for NSAP */ #define T_SIG 24 /* security signature */ #define T_KEY 25 /* security key */ #define T_PX 26 /* X.400 mail mapping */ #define T_GPOS 27 /* geographical position (withdrawn) */ #define T_AAAA 28 /* IP6 Address */ #define T_LOC 29 /* Location Information */ #define T_NXT 30 /* Next Valid Name in Zone */ #define T_EID 31 /* Endpoint identifier */ #define T_NIMLOC 32 /* Nimrod locator */ #define T_SRV 33 /* Server selection */ #define T_ATMA 34 /* ATM Address */ #define T_NAPTR 35 /* Naming Authority PoinTeR */ #define T_KX 36 /* Key Exchanger */ #define T_CERT 37 /* Certificates in the DNS */ #define T_A6 38 /* IP6 address */ #define T_DNAME 39 /* non-terminal redirection */ #define T_SINK 40 /* unknown */ #define T_OPT 41 /* EDNS0 option (meta-RR) */ #define T_APL 42 /* lists of address prefixes */ #define T_DS 43 /* Delegation Signer */ #define T_SSHFP 44 /* SSH Fingerprint */ #define T_IPSECKEY 45 /* IPsec keying material */ #define T_RRSIG 46 /* new security signature */ #define T_NSEC 47 /* provable insecure information */ #define T_DNSKEY 48 /* new security key */ /* non standard */ #define T_SPF 99 /* sender policy framework */ #define T_UINFO 100 /* user (finger) information */ #define T_UID 101 /* user ID */ #define T_GID 102 /* group ID */ #define T_UNSPEC 103 /* Unspecified format (binary data) */ #define T_UNSPECA 104 /* "unspecified ascii". Ugly MIT hack */ /* Query type values which do not appear in resource records */ #define T_TKEY 249 /* Transaction Key [RFC2930] */ #define T_TSIG 250 /* Transaction Signature [RFC2845] */ #define T_IXFR 251 /* incremental transfer [RFC1995] */ #define T_AXFR 252 /* transfer zone of authority */ #define T_MAILB 253 /* transfer mailbox records */ #define T_MAILA 254 /* transfer mail agent records */ #define T_ANY 255 /* wildcard match */ /* * Values for class field */ #define C_IN 1 /* the arpa internet */ #define C_CHAOS 3 /* for chaos net (MIT) */ #define C_HS 4 /* for Hesiod name server (MIT) (XXX) */ /* Query class values which do not appear in resource records */ #define C_ANY 255 /* wildcard match */ #define C_QU 0x8000 /* mDNS QU flag in queries */ #define C_CACHE_FLUSH 0x8000 /* mDNS cache flush flag in replies */ /* * Status return codes for T_UNSPEC conversion routines */ #define CONV_SUCCESS 0 #define CONV_OVERFLOW -1 #define CONV_BADFMT -2 #define CONV_BADCKSUM -3 #define CONV_BADBUFLEN -4 /* * Structure for query header. */ typedef struct { u_int16_t id; /* query identification number */ u_int8_t flags1; /* first byte of flags */ u_int8_t flags2; /* second byte of flags */ u_int16_t qdcount; /* number of question entries */ u_int16_t ancount; /* number of answer entries */ u_int16_t nscount; /* number of authority entries */ u_int16_t arcount; /* number of resource entries */ } HEADER; /* * Macros for subfields of flag fields. */ #define DNS_QR(np) ((np)->flags1 & 0x80) /* response flag */ #define DNS_OPCODE(np) ((((np)->flags1) >> 3) & 0xF) /* purpose of message */ #define DNS_AA(np) ((np)->flags1 & 0x04) /* authoritative answer */ #define DNS_TC(np) ((np)->flags1 & 0x02) /* truncated message */ #define DNS_RD(np) ((np)->flags1 & 0x01) /* recursion desired */ #define DNS_RA(np) ((np)->flags2 & 0x80) /* recursion available */ #define DNS_AD(np) ((np)->flags2 & 0x20) /* authentic data from named */ #define DNS_CD(np) ((np)->flags2 & 0x10) /* checking disabled by resolver */ #define DNS_RCODE(np) ((np)->flags2 & 0xF) /* response code */ /* * Defines for handling compressed domain names, EDNS0 labels, etc. */ #define INDIR_MASK 0xc0 /* 11.... */ #define EDNS0_MASK 0x40 /* 01.... */ # define EDNS0_ELT_BITLABEL 0x01 /* * Structure for passing resource records around. */ struct rrec { int16_t r_zone; /* zone number */ int16_t r_class; /* class number */ int16_t r_type; /* type number */ u_int32_t r_ttl; /* time to live */ int r_size; /* size of data area */ char *r_data; /* pointer to data */ }; /* * Inline versions of get/put short/long. Pointer is advanced. * We also assume that a "u_int16_t" holds 2 "chars" * and that a "u_int32_t" holds 4 "chars". * * These macros demonstrate the property of C whereby it can be * portable or it can be elegant but never both. */ #define GETSHORT(s, cp) { \ register u_char *t_cp = (u_char *)(cp); \ (s) = ((u_int16_t)t_cp[0] << 8) | (u_int16_t)t_cp[1]; \ (cp) += 2; \ } #define GETLONG(l, cp) { \ register u_char *t_cp = (u_char *)(cp); \ (l) = (((u_int32_t)t_cp[0]) << 24) \ | (((u_int32_t)t_cp[1]) << 16) \ | (((u_int32_t)t_cp[2]) << 8) \ | (((u_int32_t)t_cp[3])); \ (cp) += 4; \ } #define PUTSHORT(s, cp) { \ register u_int16_t t_s = (u_int16_t)(s); \ register u_char *t_cp = (u_char *)(cp); \ *t_cp++ = t_s >> 8; \ *t_cp = t_s; \ (cp) += 2; \ } /* * Warning: PUTLONG --no-longer-- destroys its first argument. if you * were depending on this "feature", you will lose. */ #define PUTLONG(l, cp) { \ register u_int32_t t_l = (u_int32_t)(l); \ register u_char *t_cp = (u_char *)(cp); \ *t_cp++ = t_l >> 24; \ *t_cp++ = t_l >> 16; \ *t_cp++ = t_l >> 8; \ *t_cp = t_l; \ (cp) += 4; \ } #endif /* !_NAMESER_H_ */ tcpdump-3.9.8/./print-802_11.c0000644000026300017500000007737610651260273013624 0ustar mcrmcr/* * Copyright (c) 2001 * Fortress Technologies, Inc. All rights reserved. * Charlie Lenahan (clenahan@fortresstech.com) * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that: (1) source code distributions * retain the above copyright notice and this paragraph in its entirety, (2) * distributions including binary code include the above copyright notice and * this paragraph in its entirety in the documentation or other materials * provided with the distribution, and (3) all advertising materials mentioning * features or use of this software display the following acknowledgement: * ``This product includes software developed by the University of California, * Lawrence Berkeley Laboratory and its contributors.'' Neither the name of * the University nor the names of its contributors may be used to endorse * or promote products derived from this software without specific prior * written permission. * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. */ #ifndef lint static const char rcsid[] _U_ = "@(#) $Header: /tcpdump/master/tcpdump/print-802_11.c,v 1.31.2.15 2007/07/22 23:14:14 guy Exp $ (LBL)"; #endif #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include #include #include "interface.h" #include "addrtoname.h" #include "ethertype.h" #include "extract.h" #include "cpack.h" #include "ieee802_11.h" #include "ieee802_11_radio.h" #define PRINT_SSID(p) \ switch (p.ssid_status) { \ case TRUNCATED: \ return 0; \ case PRESENT: \ printf(" ("); \ fn_print(p.ssid.ssid, NULL); \ printf(")"); \ break; \ case NOT_PRESENT: \ break; \ } #define PRINT_RATE(_sep, _r, _suf) \ printf("%s%2.1f%s", _sep, (.5 * ((_r) & 0x7f)), _suf) #define PRINT_RATES(p) \ switch (p.rates_status) { \ case TRUNCATED: \ return 0; \ case PRESENT: \ do { \ int z; \ const char *sep = " ["; \ for (z = 0; z < p.rates.length ; z++) { \ PRINT_RATE(sep, p.rates.rate[z], \ (p.rates.rate[z] & 0x80 ? "*" : "")); \ sep = " "; \ } \ if (p.rates.length != 0) \ printf(" Mbit]"); \ } while (0); \ break; \ case NOT_PRESENT: \ break; \ } #define PRINT_DS_CHANNEL(p) \ switch (p.ds_status) { \ case TRUNCATED: \ return 0; \ case PRESENT: \ printf(" CH: %u", p.ds.channel); \ break; \ case NOT_PRESENT: \ break; \ } \ printf("%s", \ CAPABILITY_PRIVACY(p.capability_info) ? ", PRIVACY" : "" ); static const char *auth_alg_text[]={"Open System","Shared Key","EAP"}; #define NUM_AUTH_ALGS (sizeof auth_alg_text / sizeof auth_alg_text[0]) static const char *status_text[] = { "Succesful", /* 0 */ "Unspecified failure", /* 1 */ "Reserved", /* 2 */ "Reserved", /* 3 */ "Reserved", /* 4 */ "Reserved", /* 5 */ "Reserved", /* 6 */ "Reserved", /* 7 */ "Reserved", /* 8 */ "Reserved", /* 9 */ "Cannot Support all requested capabilities in the Capability Information field", /* 10 */ "Reassociation denied due to inability to confirm that association exists", /* 11 */ "Association denied due to reason outside the scope of the standard", /* 12 */ "Responding station does not support the specified authentication algorithm ", /* 13 */ "Received an Authentication frame with authentication transaction " \ "sequence number out of expected sequence", /* 14 */ "Authentication rejected because of challenge failure", /* 15 */ "Authentication rejected due to timeout waiting for next frame in sequence", /* 16 */ "Association denied because AP is unable to handle additional associated stations", /* 17 */ "Association denied due to requesting station not supporting all of the " \ "data rates in BSSBasicRateSet parameter", /* 18 */ }; #define NUM_STATUSES (sizeof status_text / sizeof status_text[0]) static const char *reason_text[] = { "Reserved", /* 0 */ "Unspecified reason", /* 1 */ "Previous authentication no longer valid", /* 2 */ "Deauthenticated because sending station is leaving (or has left) IBSS or ESS", /* 3 */ "Disassociated due to inactivity", /* 4 */ "Disassociated because AP is unable to handle all currently associated stations", /* 5 */ "Class 2 frame received from nonauthenticated station", /* 6 */ "Class 3 frame received from nonassociated station", /* 7 */ "Disassociated because sending station is leaving (or has left) BSS", /* 8 */ "Station requesting (re)association is not authenticated with responding station", /* 9 */ }; #define NUM_REASONS (sizeof reason_text / sizeof reason_text[0]) static int wep_print(const u_char *p) { u_int32_t iv; if (!TTEST2(*p, IEEE802_11_IV_LEN + IEEE802_11_KID_LEN)) return 0; iv = EXTRACT_LE_32BITS(p); printf("Data IV:%3x Pad %x KeyID %x", IV_IV(iv), IV_PAD(iv), IV_KEYID(iv)); return 1; } static void parse_elements(struct mgmt_body_t *pbody, const u_char *p, int offset) { /* * We haven't seen any elements yet. */ pbody->challenge_status = NOT_PRESENT; pbody->ssid_status = NOT_PRESENT; pbody->rates_status = NOT_PRESENT; pbody->ds_status = NOT_PRESENT; pbody->cf_status = NOT_PRESENT; pbody->tim_status = NOT_PRESENT; for (;;) { if (!TTEST2(*(p + offset), 1)) return; switch (*(p + offset)) { case E_SSID: /* Present, possibly truncated */ pbody->ssid_status = TRUNCATED; if (!TTEST2(*(p + offset), 2)) return; memcpy(&pbody->ssid, p + offset, 2); offset += 2; if (pbody->ssid.length != 0) { if (pbody->ssid.length > sizeof(pbody->ssid.ssid) - 1) return; if (!TTEST2(*(p + offset), pbody->ssid.length)) return; memcpy(&pbody->ssid.ssid, p + offset, pbody->ssid.length); offset += pbody->ssid.length; } pbody->ssid.ssid[pbody->ssid.length] = '\0'; /* Present and not truncated */ pbody->ssid_status = PRESENT; break; case E_CHALLENGE: /* Present, possibly truncated */ pbody->challenge_status = TRUNCATED; if (!TTEST2(*(p + offset), 2)) return; memcpy(&pbody->challenge, p + offset, 2); offset += 2; if (pbody->challenge.length != 0) { if (pbody->challenge.length > sizeof(pbody->challenge.text) - 1) return; if (!TTEST2(*(p + offset), pbody->challenge.length)) return; memcpy(&pbody->challenge.text, p + offset, pbody->challenge.length); offset += pbody->challenge.length; } pbody->challenge.text[pbody->challenge.length] = '\0'; /* Present and not truncated */ pbody->challenge_status = PRESENT; break; case E_RATES: /* Present, possibly truncated */ pbody->rates_status = TRUNCATED; if (!TTEST2(*(p + offset), 2)) return; memcpy(&(pbody->rates), p + offset, 2); offset += 2; if (pbody->rates.length != 0) { if (pbody->rates.length > sizeof pbody->rates.rate) return; if (!TTEST2(*(p + offset), pbody->rates.length)) return; memcpy(&pbody->rates.rate, p + offset, pbody->rates.length); offset += pbody->rates.length; } /* Present and not truncated */ pbody->rates_status = PRESENT; break; case E_DS: /* Present, possibly truncated */ pbody->ds_status = TRUNCATED; if (!TTEST2(*(p + offset), 3)) return; memcpy(&pbody->ds, p + offset, 3); offset += 3; /* Present and not truncated */ pbody->ds_status = PRESENT; break; case E_CF: /* Present, possibly truncated */ pbody->cf_status = TRUNCATED; if (!TTEST2(*(p + offset), 8)) return; memcpy(&pbody->cf, p + offset, 8); offset += 8; /* Present and not truncated */ pbody->cf_status = PRESENT; break; case E_TIM: /* Present, possibly truncated */ pbody->tim_status = TRUNCATED; if (!TTEST2(*(p + offset), 2)) return; memcpy(&pbody->tim, p + offset, 2); offset += 2; if (!TTEST2(*(p + offset), 3)) return; memcpy(&pbody->tim.count, p + offset, 3); offset += 3; if (pbody->tim.length <= 3) break; if (pbody->tim.length - 3 > sizeof pbody->tim.bitmap) return; if (!TTEST2(*(p + offset), pbody->tim.length - 3)) return; memcpy(pbody->tim.bitmap, p + (pbody->tim.length - 3), (pbody->tim.length - 3)); offset += pbody->tim.length - 3; /* Present and not truncated */ pbody->tim_status = PRESENT; break; default: #if 0 printf("(1) unhandled element_id (%d) ", *(p + offset) ); #endif if (!TTEST2(*(p + offset), 2)) return; if (!TTEST2(*(p + offset + 2), *(p + offset + 1))) return; offset += *(p + offset + 1) + 2; break; } } } /********************************************************************************* * Print Handle functions for the management frame types *********************************************************************************/ static int handle_beacon(const u_char *p) { struct mgmt_body_t pbody; int offset = 0; memset(&pbody, 0, sizeof(pbody)); if (!TTEST2(*p, IEEE802_11_TSTAMP_LEN + IEEE802_11_BCNINT_LEN + IEEE802_11_CAPINFO_LEN)) return 0; memcpy(&pbody.timestamp, p, IEEE802_11_TSTAMP_LEN); offset += IEEE802_11_TSTAMP_LEN; pbody.beacon_interval = EXTRACT_LE_16BITS(p+offset); offset += IEEE802_11_BCNINT_LEN; pbody.capability_info = EXTRACT_LE_16BITS(p+offset); offset += IEEE802_11_CAPINFO_LEN; parse_elements(&pbody, p, offset); PRINT_SSID(pbody); PRINT_RATES(pbody); printf(" %s", CAPABILITY_ESS(pbody.capability_info) ? "ESS" : "IBSS"); PRINT_DS_CHANNEL(pbody); return 1; } static int handle_assoc_request(const u_char *p) { struct mgmt_body_t pbody; int offset = 0; memset(&pbody, 0, sizeof(pbody)); if (!TTEST2(*p, IEEE802_11_CAPINFO_LEN + IEEE802_11_LISTENINT_LEN)) return 0; pbody.capability_info = EXTRACT_LE_16BITS(p); offset += IEEE802_11_CAPINFO_LEN; pbody.listen_interval = EXTRACT_LE_16BITS(p+offset); offset += IEEE802_11_LISTENINT_LEN; parse_elements(&pbody, p, offset); PRINT_SSID(pbody); PRINT_RATES(pbody); return 1; } static int handle_assoc_response(const u_char *p) { struct mgmt_body_t pbody; int offset = 0; memset(&pbody, 0, sizeof(pbody)); if (!TTEST2(*p, IEEE802_11_CAPINFO_LEN + IEEE802_11_STATUS_LEN + IEEE802_11_AID_LEN)) return 0; pbody.capability_info = EXTRACT_LE_16BITS(p); offset += IEEE802_11_CAPINFO_LEN; pbody.status_code = EXTRACT_LE_16BITS(p+offset); offset += IEEE802_11_STATUS_LEN; pbody.aid = EXTRACT_LE_16BITS(p+offset); offset += IEEE802_11_AID_LEN; parse_elements(&pbody, p, offset); printf(" AID(%x) :%s: %s", ((u_int16_t)(pbody.aid << 2 )) >> 2 , CAPABILITY_PRIVACY(pbody.capability_info) ? " PRIVACY " : "", (pbody.status_code < NUM_STATUSES ? status_text[pbody.status_code] : "n/a")); return 1; } static int handle_reassoc_request(const u_char *p) { struct mgmt_body_t pbody; int offset = 0; memset(&pbody, 0, sizeof(pbody)); if (!TTEST2(*p, IEEE802_11_CAPINFO_LEN + IEEE802_11_LISTENINT_LEN + IEEE802_11_AP_LEN)) return 0; pbody.capability_info = EXTRACT_LE_16BITS(p); offset += IEEE802_11_CAPINFO_LEN; pbody.listen_interval = EXTRACT_LE_16BITS(p+offset); offset += IEEE802_11_LISTENINT_LEN; memcpy(&pbody.ap, p+offset, IEEE802_11_AP_LEN); offset += IEEE802_11_AP_LEN; parse_elements(&pbody, p, offset); PRINT_SSID(pbody); printf(" AP : %s", etheraddr_string( pbody.ap )); return 1; } static int handle_reassoc_response(const u_char *p) { /* Same as a Association Reponse */ return handle_assoc_response(p); } static int handle_probe_request(const u_char *p) { struct mgmt_body_t pbody; int offset = 0; memset(&pbody, 0, sizeof(pbody)); parse_elements(&pbody, p, offset); PRINT_SSID(pbody); PRINT_RATES(pbody); return 1; } static int handle_probe_response(const u_char *p) { struct mgmt_body_t pbody; int offset = 0; memset(&pbody, 0, sizeof(pbody)); if (!TTEST2(*p, IEEE802_11_TSTAMP_LEN + IEEE802_11_BCNINT_LEN + IEEE802_11_CAPINFO_LEN)) return 0; memcpy(&pbody.timestamp, p, IEEE802_11_TSTAMP_LEN); offset += IEEE802_11_TSTAMP_LEN; pbody.beacon_interval = EXTRACT_LE_16BITS(p+offset); offset += IEEE802_11_BCNINT_LEN; pbody.capability_info = EXTRACT_LE_16BITS(p+offset); offset += IEEE802_11_CAPINFO_LEN; parse_elements(&pbody, p, offset); PRINT_SSID(pbody); PRINT_RATES(pbody); PRINT_DS_CHANNEL(pbody); return 1; } static int handle_atim(void) { /* the frame body for ATIM is null. */ return 1; } static int handle_disassoc(const u_char *p) { struct mgmt_body_t pbody; memset(&pbody, 0, sizeof(pbody)); if (!TTEST2(*p, IEEE802_11_REASON_LEN)) return 0; pbody.reason_code = EXTRACT_LE_16BITS(p); printf(": %s", (pbody.reason_code < NUM_REASONS) ? reason_text[pbody.reason_code] : "Reserved" ); return 1; } static int handle_auth(const u_char *p) { struct mgmt_body_t pbody; int offset = 0; memset(&pbody, 0, sizeof(pbody)); if (!TTEST2(*p, 6)) return 0; pbody.auth_alg = EXTRACT_LE_16BITS(p); offset += 2; pbody.auth_trans_seq_num = EXTRACT_LE_16BITS(p + offset); offset += 2; pbody.status_code = EXTRACT_LE_16BITS(p + offset); offset += 2; parse_elements(&pbody, p, offset); if ((pbody.auth_alg == 1) && ((pbody.auth_trans_seq_num == 2) || (pbody.auth_trans_seq_num == 3))) { printf(" (%s)-%x [Challenge Text] %s", (pbody.auth_alg < NUM_AUTH_ALGS) ? auth_alg_text[pbody.auth_alg] : "Reserved", pbody.auth_trans_seq_num, ((pbody.auth_trans_seq_num % 2) ? ((pbody.status_code < NUM_STATUSES) ? status_text[pbody.status_code] : "n/a") : "")); return 1; } printf(" (%s)-%x: %s", (pbody.auth_alg < NUM_AUTH_ALGS) ? auth_alg_text[pbody.auth_alg] : "Reserved", pbody.auth_trans_seq_num, (pbody.auth_trans_seq_num % 2) ? ((pbody.status_code < NUM_STATUSES) ? status_text[pbody.status_code] : "n/a") : ""); return 1; } static int handle_deauth(const struct mgmt_header_t *pmh, const u_char *p) { struct mgmt_body_t pbody; int offset = 0; const char *reason = NULL; memset(&pbody, 0, sizeof(pbody)); if (!TTEST2(*p, IEEE802_11_REASON_LEN)) return 0; pbody.reason_code = EXTRACT_LE_16BITS(p); offset += IEEE802_11_REASON_LEN; reason = (pbody.reason_code < NUM_REASONS) ? reason_text[pbody.reason_code] : "Reserved"; if (eflag) { printf(": %s", reason); } else { printf(" (%s): %s", etheraddr_string(pmh->sa), reason); } return 1; } /********************************************************************************* * Print Body funcs *********************************************************************************/ static int mgmt_body_print(u_int16_t fc, const struct mgmt_header_t *pmh, const u_char *p) { switch (FC_SUBTYPE(fc)) { case ST_ASSOC_REQUEST: printf("Assoc Request"); return handle_assoc_request(p); case ST_ASSOC_RESPONSE: printf("Assoc Response"); return handle_assoc_response(p); case ST_REASSOC_REQUEST: printf("ReAssoc Request"); return handle_reassoc_request(p); case ST_REASSOC_RESPONSE: printf("ReAssoc Response"); return handle_reassoc_response(p); case ST_PROBE_REQUEST: printf("Probe Request"); return handle_probe_request(p); case ST_PROBE_RESPONSE: printf("Probe Response"); return handle_probe_response(p); case ST_BEACON: printf("Beacon"); return handle_beacon(p); case ST_ATIM: printf("ATIM"); return handle_atim(); case ST_DISASSOC: printf("Disassociation"); return handle_disassoc(p); case ST_AUTH: printf("Authentication"); if (!TTEST2(*p, 3)) return 0; if ((p[0] == 0 ) && (p[1] == 0) && (p[2] == 0)) { printf("Authentication (Shared-Key)-3 "); return wep_print(p); } return handle_auth(p); case ST_DEAUTH: printf("DeAuthentication"); return handle_deauth(pmh, p); break; default: printf("Unhandled Management subtype(%x)", FC_SUBTYPE(fc)); return 1; } } /********************************************************************************* * Handles printing all the control frame types *********************************************************************************/ static int ctrl_body_print(u_int16_t fc, const u_char *p) { switch (FC_SUBTYPE(fc)) { case CTRL_PS_POLL: printf("Power Save-Poll"); if (!TTEST2(*p, CTRL_PS_POLL_HDRLEN)) return 0; printf(" AID(%x)", EXTRACT_LE_16BITS(&(((const struct ctrl_ps_poll_t *)p)->aid))); break; case CTRL_RTS: printf("Request-To-Send"); if (!TTEST2(*p, CTRL_RTS_HDRLEN)) return 0; if (!eflag) printf(" TA:%s ", etheraddr_string(((const struct ctrl_rts_t *)p)->ta)); break; case CTRL_CTS: printf("Clear-To-Send"); if (!TTEST2(*p, CTRL_CTS_HDRLEN)) return 0; if (!eflag) printf(" RA:%s ", etheraddr_string(((const struct ctrl_cts_t *)p)->ra)); break; case CTRL_ACK: printf("Acknowledgment"); if (!TTEST2(*p, CTRL_ACK_HDRLEN)) return 0; if (!eflag) printf(" RA:%s ", etheraddr_string(((const struct ctrl_ack_t *)p)->ra)); break; case CTRL_CF_END: printf("CF-End"); if (!TTEST2(*p, CTRL_END_HDRLEN)) return 0; if (!eflag) printf(" RA:%s ", etheraddr_string(((const struct ctrl_end_t *)p)->ra)); break; case CTRL_END_ACK: printf("CF-End+CF-Ack"); if (!TTEST2(*p, CTRL_END_ACK_HDRLEN)) return 0; if (!eflag) printf(" RA:%s ", etheraddr_string(((const struct ctrl_end_ack_t *)p)->ra)); break; default: printf("Unknown Ctrl Subtype"); } return 1; } /* * Print Header funcs */ /* * Data Frame - Address field contents * * To Ds | From DS | Addr 1 | Addr 2 | Addr 3 | Addr 4 * 0 | 0 | DA | SA | BSSID | n/a * 0 | 1 | DA | BSSID | SA | n/a * 1 | 0 | BSSID | SA | DA | n/a * 1 | 1 | RA | TA | DA | SA */ static void data_header_print(u_int16_t fc, const u_char *p, const u_int8_t **srcp, const u_int8_t **dstp) { u_int subtype = FC_SUBTYPE(fc); if (DATA_FRAME_IS_CF_ACK(subtype) || DATA_FRAME_IS_CF_POLL(subtype) || DATA_FRAME_IS_QOS(subtype)) { printf("CF "); if (DATA_FRAME_IS_CF_ACK(subtype)) { if (DATA_FRAME_IS_CF_POLL(subtype)) printf("Ack/Poll"); else printf("Ack"); } else { if (DATA_FRAME_IS_CF_POLL(subtype)) printf("Poll"); } if (DATA_FRAME_IS_QOS(subtype)) printf("+QoS"); printf(" "); } #define ADDR1 (p + 4) #define ADDR2 (p + 10) #define ADDR3 (p + 16) #define ADDR4 (p + 24) if (!FC_TO_DS(fc) && !FC_FROM_DS(fc)) { if (srcp != NULL) *srcp = ADDR2; if (dstp != NULL) *dstp = ADDR1; if (!eflag) return; printf("DA:%s SA:%s BSSID:%s ", etheraddr_string(ADDR1), etheraddr_string(ADDR2), etheraddr_string(ADDR3)); } else if (!FC_TO_DS(fc) && FC_FROM_DS(fc)) { if (srcp != NULL) *srcp = ADDR3; if (dstp != NULL) *dstp = ADDR1; if (!eflag) return; printf("DA:%s BSSID:%s SA:%s ", etheraddr_string(ADDR1), etheraddr_string(ADDR2), etheraddr_string(ADDR3)); } else if (FC_TO_DS(fc) && !FC_FROM_DS(fc)) { if (srcp != NULL) *srcp = ADDR2; if (dstp != NULL) *dstp = ADDR3; if (!eflag) return; printf("BSSID:%s SA:%s DA:%s ", etheraddr_string(ADDR1), etheraddr_string(ADDR2), etheraddr_string(ADDR3)); } else if (FC_TO_DS(fc) && FC_FROM_DS(fc)) { if (srcp != NULL) *srcp = ADDR4; if (dstp != NULL) *dstp = ADDR3; if (!eflag) return; printf("RA:%s TA:%s DA:%s SA:%s ", etheraddr_string(ADDR1), etheraddr_string(ADDR2), etheraddr_string(ADDR3), etheraddr_string(ADDR4)); } #undef ADDR1 #undef ADDR2 #undef ADDR3 #undef ADDR4 } static void mgmt_header_print(const u_char *p, const u_int8_t **srcp, const u_int8_t **dstp) { const struct mgmt_header_t *hp = (const struct mgmt_header_t *) p; if (srcp != NULL) *srcp = hp->sa; if (dstp != NULL) *dstp = hp->da; if (!eflag) return; printf("BSSID:%s DA:%s SA:%s ", etheraddr_string((hp)->bssid), etheraddr_string((hp)->da), etheraddr_string((hp)->sa)); } static void ctrl_header_print(u_int16_t fc, const u_char *p, const u_int8_t **srcp, const u_int8_t **dstp) { if (srcp != NULL) *srcp = NULL; if (dstp != NULL) *dstp = NULL; if (!eflag) return; switch (FC_SUBTYPE(fc)) { case CTRL_PS_POLL: printf("BSSID:%s TA:%s ", etheraddr_string(((const struct ctrl_ps_poll_t *)p)->bssid), etheraddr_string(((const struct ctrl_ps_poll_t *)p)->ta)); break; case CTRL_RTS: printf("RA:%s TA:%s ", etheraddr_string(((const struct ctrl_rts_t *)p)->ra), etheraddr_string(((const struct ctrl_rts_t *)p)->ta)); break; case CTRL_CTS: printf("RA:%s ", etheraddr_string(((const struct ctrl_cts_t *)p)->ra)); break; case CTRL_ACK: printf("RA:%s ", etheraddr_string(((const struct ctrl_ack_t *)p)->ra)); break; case CTRL_CF_END: printf("RA:%s BSSID:%s ", etheraddr_string(((const struct ctrl_end_t *)p)->ra), etheraddr_string(((const struct ctrl_end_t *)p)->bssid)); break; case CTRL_END_ACK: printf("RA:%s BSSID:%s ", etheraddr_string(((const struct ctrl_end_ack_t *)p)->ra), etheraddr_string(((const struct ctrl_end_ack_t *)p)->bssid)); break; default: printf("(H) Unknown Ctrl Subtype"); break; } } static int extract_header_length(u_int16_t fc) { int len; switch (FC_TYPE(fc)) { case T_MGMT: return MGMT_HDRLEN; case T_CTRL: switch (FC_SUBTYPE(fc)) { case CTRL_PS_POLL: return CTRL_PS_POLL_HDRLEN; case CTRL_RTS: return CTRL_RTS_HDRLEN; case CTRL_CTS: return CTRL_CTS_HDRLEN; case CTRL_ACK: return CTRL_ACK_HDRLEN; case CTRL_CF_END: return CTRL_END_HDRLEN; case CTRL_END_ACK: return CTRL_END_ACK_HDRLEN; default: return 0; } case T_DATA: len = (FC_TO_DS(fc) && FC_FROM_DS(fc)) ? 30 : 24; if (DATA_FRAME_IS_QOS(FC_SUBTYPE(fc))) len += 2; return len; default: printf("unknown IEEE802.11 frame type (%d)", FC_TYPE(fc)); return 0; } } /* * Print the 802.11 MAC header if eflag is set, and set "*srcp" and "*dstp" * to point to the source and destination MAC addresses in any case if * "srcp" and "dstp" aren't null. */ static inline void ieee_802_11_hdr_print(u_int16_t fc, const u_char *p, const u_int8_t **srcp, const u_int8_t **dstp) { if (vflag) { if (FC_MORE_DATA(fc)) printf("More Data "); if (FC_MORE_FLAG(fc)) printf("More Fragments "); if (FC_POWER_MGMT(fc)) printf("Pwr Mgmt "); if (FC_RETRY(fc)) printf("Retry "); if (FC_ORDER(fc)) printf("Strictly Ordered "); if (FC_WEP(fc)) printf("WEP Encrypted "); if (FC_TYPE(fc) != T_CTRL || FC_SUBTYPE(fc) != CTRL_PS_POLL) printf("%dus ", EXTRACT_LE_16BITS( &((const struct mgmt_header_t *)p)->duration)); } switch (FC_TYPE(fc)) { case T_MGMT: mgmt_header_print(p, srcp, dstp); break; case T_CTRL: ctrl_header_print(fc, p, srcp, dstp); break; case T_DATA: data_header_print(fc, p, srcp, dstp); break; default: printf("(header) unknown IEEE802.11 frame type (%d)", FC_TYPE(fc)); *srcp = NULL; *dstp = NULL; break; } } #ifndef roundup2 #define roundup2(x, y) (((x)+((y)-1))&(~((y)-1))) /* if y is powers of two */ #endif static u_int ieee802_11_print(const u_char *p, u_int length, u_int caplen, int pad) { u_int16_t fc; u_int hdrlen; const u_int8_t *src, *dst; u_short extracted_ethertype; if (caplen < IEEE802_11_FC_LEN) { printf("[|802.11]"); return caplen; } fc = EXTRACT_LE_16BITS(p); hdrlen = extract_header_length(fc); if (pad) hdrlen = roundup2(hdrlen, 4); if (caplen < hdrlen) { printf("[|802.11]"); return hdrlen; } ieee_802_11_hdr_print(fc, p, &src, &dst); /* * Go past the 802.11 header. */ length -= hdrlen; caplen -= hdrlen; p += hdrlen; switch (FC_TYPE(fc)) { case T_MGMT: if (!mgmt_body_print(fc, (const struct mgmt_header_t *)(p - hdrlen), p)) { printf("[|802.11]"); return hdrlen; } break; case T_CTRL: if (!ctrl_body_print(fc, p - hdrlen)) { printf("[|802.11]"); return hdrlen; } break; case T_DATA: if (DATA_FRAME_IS_NULL(FC_SUBTYPE(fc))) return hdrlen; /* no-data frame */ /* There may be a problem w/ AP not having this bit set */ if (FC_WEP(fc)) { if (!wep_print(p)) { printf("[|802.11]"); return hdrlen; } } else if (llc_print(p, length, caplen, dst, src, &extracted_ethertype) == 0) { /* * Some kinds of LLC packet we cannot * handle intelligently */ if (!eflag) ieee_802_11_hdr_print(fc, p - hdrlen, NULL, NULL); if (extracted_ethertype) printf("(LLC %s) ", etherproto_string( htons(extracted_ethertype))); if (!suppress_default_print) default_print(p, caplen); } break; default: printf("unknown 802.11 frame type (%d)", FC_TYPE(fc)); break; } return hdrlen; } /* * This is the top level routine of the printer. 'p' points * to the 802.11 header of the packet, 'h->ts' is the timestamp, * 'h->len' is the length of the packet off the wire, and 'h->caplen' * is the number of bytes actually captured. */ u_int ieee802_11_if_print(const struct pcap_pkthdr *h, const u_char *p) { return ieee802_11_print(p, h->len, h->caplen, 0); } static int print_radiotap_field(struct cpack_state *s, u_int32_t bit, int *pad) { union { int8_t i8; u_int8_t u8; int16_t i16; u_int16_t u16; u_int32_t u32; u_int64_t u64; } u, u2; int rc; switch (bit) { case IEEE80211_RADIOTAP_FLAGS: rc = cpack_uint8(s, &u.u8); if (u.u8 & IEEE80211_RADIOTAP_F_DATAPAD) *pad = 1; break; case IEEE80211_RADIOTAP_RATE: case IEEE80211_RADIOTAP_DB_ANTSIGNAL: case IEEE80211_RADIOTAP_DB_ANTNOISE: case IEEE80211_RADIOTAP_ANTENNA: rc = cpack_uint8(s, &u.u8); break; case IEEE80211_RADIOTAP_DBM_ANTSIGNAL: case IEEE80211_RADIOTAP_DBM_ANTNOISE: rc = cpack_int8(s, &u.i8); break; case IEEE80211_RADIOTAP_CHANNEL: rc = cpack_uint16(s, &u.u16); if (rc != 0) break; rc = cpack_uint16(s, &u2.u16); break; case IEEE80211_RADIOTAP_FHSS: case IEEE80211_RADIOTAP_LOCK_QUALITY: case IEEE80211_RADIOTAP_TX_ATTENUATION: rc = cpack_uint16(s, &u.u16); break; case IEEE80211_RADIOTAP_DB_TX_ATTENUATION: rc = cpack_uint8(s, &u.u8); break; case IEEE80211_RADIOTAP_DBM_TX_POWER: rc = cpack_int8(s, &u.i8); break; case IEEE80211_RADIOTAP_TSFT: rc = cpack_uint64(s, &u.u64); break; default: /* this bit indicates a field whose * size we do not know, so we cannot * proceed. */ printf("[0x%08x] ", bit); return -1; } if (rc != 0) { printf("[|802.11]"); return rc; } switch (bit) { case IEEE80211_RADIOTAP_CHANNEL: printf("%u MHz ", u.u16); if (u2.u16 != 0) printf("(0x%04x) ", u2.u16); break; case IEEE80211_RADIOTAP_FHSS: printf("fhset %d fhpat %d ", u.u16 & 0xff, (u.u16 >> 8) & 0xff); break; case IEEE80211_RADIOTAP_RATE: PRINT_RATE("", u.u8, " Mb/s "); break; case IEEE80211_RADIOTAP_DBM_ANTSIGNAL: printf("%ddB signal ", u.i8); break; case IEEE80211_RADIOTAP_DBM_ANTNOISE: printf("%ddB noise ", u.i8); break; case IEEE80211_RADIOTAP_DB_ANTSIGNAL: printf("%ddB signal ", u.u8); break; case IEEE80211_RADIOTAP_DB_ANTNOISE: printf("%ddB noise ", u.u8); break; case IEEE80211_RADIOTAP_LOCK_QUALITY: printf("%u sq ", u.u16); break; case IEEE80211_RADIOTAP_TX_ATTENUATION: printf("%d tx power ", -(int)u.u16); break; case IEEE80211_RADIOTAP_DB_TX_ATTENUATION: printf("%ddB tx power ", -(int)u.u8); break; case IEEE80211_RADIOTAP_DBM_TX_POWER: printf("%ddBm tx power ", u.i8); break; case IEEE80211_RADIOTAP_FLAGS: if (u.u8 & IEEE80211_RADIOTAP_F_CFP) printf("cfp "); if (u.u8 & IEEE80211_RADIOTAP_F_SHORTPRE) printf("short preamble "); if (u.u8 & IEEE80211_RADIOTAP_F_WEP) printf("wep "); if (u.u8 & IEEE80211_RADIOTAP_F_FRAG) printf("fragmented "); if (u.u8 & IEEE80211_RADIOTAP_F_BADFCS) printf("bad-fcs "); break; case IEEE80211_RADIOTAP_ANTENNA: printf("antenna %d ", u.u8); break; case IEEE80211_RADIOTAP_TSFT: printf("%" PRIu64 "us tsft ", u.u64); break; } return 0; } static u_int ieee802_11_radio_print(const u_char *p, u_int length, u_int caplen) { #define BITNO_32(x) (((x) >> 16) ? 16 + BITNO_16((x) >> 16) : BITNO_16((x))) #define BITNO_16(x) (((x) >> 8) ? 8 + BITNO_8((x) >> 8) : BITNO_8((x))) #define BITNO_8(x) (((x) >> 4) ? 4 + BITNO_4((x) >> 4) : BITNO_4((x))) #define BITNO_4(x) (((x) >> 2) ? 2 + BITNO_2((x) >> 2) : BITNO_2((x))) #define BITNO_2(x) (((x) & 2) ? 1 : 0) #define BIT(n) (1 << n) #define IS_EXTENDED(__p) \ (EXTRACT_LE_32BITS(__p) & BIT(IEEE80211_RADIOTAP_EXT)) != 0 struct cpack_state cpacker; struct ieee80211_radiotap_header *hdr; u_int32_t present, next_present; u_int32_t *presentp, *last_presentp; enum ieee80211_radiotap_type bit; int bit0; const u_char *iter; u_int len; int pad; if (caplen < sizeof(*hdr)) { printf("[|802.11]"); return caplen; } hdr = (struct ieee80211_radiotap_header *)p; len = EXTRACT_LE_16BITS(&hdr->it_len); if (caplen < len) { printf("[|802.11]"); return caplen; } for (last_presentp = &hdr->it_present; IS_EXTENDED(last_presentp) && (u_char*)(last_presentp + 1) <= p + len; last_presentp++); /* are there more bitmap extensions than bytes in header? */ if (IS_EXTENDED(last_presentp)) { printf("[|802.11]"); return caplen; } iter = (u_char*)(last_presentp + 1); if (cpack_init(&cpacker, (u_int8_t*)iter, len - (iter - p)) != 0) { /* XXX */ printf("[|802.11]"); return caplen; } /* Assume no Atheros padding between 802.11 header and body */ pad = 0; for (bit0 = 0, presentp = &hdr->it_present; presentp <= last_presentp; presentp++, bit0 += 32) { for (present = EXTRACT_LE_32BITS(presentp); present; present = next_present) { /* clear the least significant bit that is set */ next_present = present & (present - 1); /* extract the least significant bit that is set */ bit = (enum ieee80211_radiotap_type) (bit0 + BITNO_32(present ^ next_present)); if (print_radiotap_field(&cpacker, bit, &pad) != 0) goto out; } } out: return len + ieee802_11_print(p + len, length - len, caplen - len, pad); #undef BITNO_32 #undef BITNO_16 #undef BITNO_8 #undef BITNO_4 #undef BITNO_2 #undef BIT } static u_int ieee802_11_avs_radio_print(const u_char *p, u_int length, u_int caplen) { u_int32_t caphdr_len; caphdr_len = EXTRACT_32BITS(p + 4); if (caphdr_len < 8) { /* * Yow! The capture header length is claimed not * to be large enough to include even the version * cookie or capture header length! */ printf("[|802.11]"); return caplen; } if (caplen < caphdr_len) { printf("[|802.11]"); return caplen; } return caphdr_len + ieee802_11_print(p + caphdr_len, length - caphdr_len, caplen - caphdr_len, 0); } #define PRISM_HDR_LEN 144 #define WLANCAP_MAGIC_COOKIE_V1 0x80211001 /* * For DLT_PRISM_HEADER; like DLT_IEEE802_11, but with an extra header, * containing information such as radio information, which we * currently ignore. * * If, however, the packet begins with WLANCAP_MAGIC_COOKIE_V1, it's * really DLT_IEEE802_11_RADIO (currently, on Linux, there's no * ARPHRD_ type for DLT_IEEE802_11_RADIO, as there is a * ARPHRD_IEEE80211_PRISM for DLT_PRISM_HEADER, so * ARPHRD_IEEE80211_PRISM is used for DLT_IEEE802_11_RADIO, and * the first 4 bytes of the header are used to indicate which it is). */ u_int prism_if_print(const struct pcap_pkthdr *h, const u_char *p) { u_int caplen = h->caplen; u_int length = h->len; if (caplen < 4) { printf("[|802.11]"); return caplen; } if (EXTRACT_32BITS(p) == WLANCAP_MAGIC_COOKIE_V1) return ieee802_11_avs_radio_print(p, length, caplen); if (caplen < PRISM_HDR_LEN) { printf("[|802.11]"); return caplen; } return PRISM_HDR_LEN + ieee802_11_print(p + PRISM_HDR_LEN, length - PRISM_HDR_LEN, caplen - PRISM_HDR_LEN, 0); } /* * For DLT_IEEE802_11_RADIO; like DLT_IEEE802_11, but with an extra * header, containing information such as radio information, which we * currently ignore. */ u_int ieee802_11_radio_if_print(const struct pcap_pkthdr *h, const u_char *p) { u_int caplen = h->caplen; u_int length = h->len; if (caplen < 8) { printf("[|802.11]"); return caplen; } return ieee802_11_radio_print(p, length, caplen); } tcpdump-3.9.8/./netdissect.h0000644000026300017500000004173710504040014014004 0ustar mcrmcr/* * Copyright (c) 1988-1997 * The Regents of the University of California. All rights reserved. * * Copyright (c) 1998-2004 Michael Richardson * The TCPDUMP project * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that: (1) source code distributions * retain the above copyright notice and this paragraph in its entirety, (2) * distributions including binary code include the above copyright notice and * this paragraph in its entirety in the documentation or other materials * provided with the distribution, and (3) all advertising materials mentioning * features or use of this software display the following acknowledgement: * ``This product includes software developed by the University of California, * Lawrence Berkeley Laboratory and its contributors.'' Neither the name of * the University nor the names of its contributors may be used to endorse * or promote products derived from this software without specific prior * written permission. * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * * @(#) $Header: /tcpdump/master/tcpdump/netdissect.h,v 1.16.2.4 2006/02/08 01:40:09 hannes Exp $ (LBL) */ #ifndef netdissect_h #define netdissect_h #ifdef HAVE_OS_PROTO_H #include "os-proto.h" #endif #include #ifndef HAVE___ATTRIBUTE__ #define __attribute__(x) #endif /* snprintf et al */ #include #if !defined(HAVE_SNPRINTF) int snprintf (char *str, size_t sz, const char *format, ...) __attribute__ ((format (printf, 3, 4))); #endif #if !defined(HAVE_VSNPRINTF) int vsnprintf (char *str, size_t sz, const char *format, va_list ap) __attribute__((format (printf, 3, 0))); #endif #ifndef HAVE_STRLCAT extern size_t strlcat (char *, const char *, size_t); #endif #ifndef HAVE_STRLCPY extern size_t strlcpy (char *, const char *, size_t); #endif #ifndef HAVE_STRDUP extern char *strdup (const char *str); #endif #ifndef HAVE_STRSEP extern char *strsep(char **, const char *); #endif struct tok { int v; /* value */ const char *s; /* string */ }; #define TOKBUFSIZE 128 extern const char *tok2strbuf(const struct tok *, const char *, int, char *buf, size_t bufsize); /* tok2str is deprecated */ extern const char *tok2str(const struct tok *, const char *, int); extern char *bittok2str(const struct tok *, const char *, int); typedef struct netdissect_options netdissect_options; struct netdissect_options { int ndo_aflag; /* translate network and broadcast addresses */ int ndo_eflag; /* print ethernet header */ int ndo_fflag; /* don't translate "foreign" IP address */ int ndo_nflag; /* leave addresses as numbers */ int ndo_Nflag; /* remove domains from printed host names */ int ndo_qflag; /* quick (shorter) output */ int ndo_Rflag; /* print sequence # field in AH/ESP*/ int ndo_sflag; /* use the libsmi to translate OIDs */ int ndo_Sflag; /* print raw TCP sequence numbers */ int ndo_tflag; /* print packet arrival time */ int ndo_Uflag; /* "unbuffered" output of dump files */ int ndo_uflag; /* Print undecoded NFS handles */ int ndo_vflag; /* verbose */ int ndo_xflag; /* print packet in hex */ int ndo_Xflag; /* print packet in hex/ascii */ int ndo_Aflag; /* print packet only in ascii observing TAB, * LF, CR and SPACE as graphical chars */ int ndo_Oflag; /* run filter code optimizer */ int ndo_dlt; /* if != -1, ask libpcap for the DLT it names*/ int ndo_pflag; /* don't go promiscuous */ int ndo_Cflag; /* rotate dump files after this many bytes */ int ndo_Cflag_count; /* Keep track of which file number we're writing */ int ndo_Wflag; /* recycle output files after this number of files */ int ndo_WflagChars; int ndo_suppress_default_print; /* don't use default_print() for unknown packet types */ const char *ndo_dltname; char *ndo_espsecret; struct sa_list *ndo_sa_list_head; /* used by print-esp.c */ struct sa_list *ndo_sa_default; char *ndo_tcpmd5secret; /* TCP-MD5 secret key */ struct esp_algorithm *ndo_espsecret_xform; /* cache of decoded */ char *ndo_espsecret_key; int ndo_packettype; /* as specified by -T */ char *ndo_program_name; /*used to generate self-identifying messages */ int32_t ndo_thiszone; /* seconds offset from gmt to local time */ int ndo_snaplen; /*global pointers to beginning and end of current packet (during printing) */ const u_char *ndo_packetp; const u_char *ndo_snapend; /* bookkeeping for ^T output */ int ndo_infodelay; /* pointer to void function to output stuff */ void (*ndo_default_print)(netdissect_options *, register const u_char *bp, register u_int length); void (*ndo_info)(netdissect_options *, int verbose); int (*ndo_printf)(netdissect_options *, const char *fmt, ...); void (*ndo_error)(netdissect_options *, const char *fmt, ...); void (*ndo_warning)(netdissect_options *, const char *fmt, ...); }; #define PT_VAT 1 /* Visual Audio Tool */ #define PT_WB 2 /* distributed White Board */ #define PT_RPC 3 /* Remote Procedure Call */ #define PT_RTP 4 /* Real-Time Applications protocol */ #define PT_RTCP 5 /* Real-Time Applications control protocol */ #define PT_SNMP 6 /* Simple Network Management Protocol */ #define PT_CNFP 7 /* Cisco NetFlow protocol */ #ifndef min #define min(a,b) ((a)>(b)?(b):(a)) #endif #ifndef max #define max(a,b) ((b)>(a)?(b):(a)) #endif #ifndef INET6 /* * The default snapshot length. This value allows most printers to print * useful information while keeping the amount of unwanted data down. * In particular, it allows for an ethernet header, tcp/ip header, and * 14 bytes of data (assuming no ip options). */ #define DEFAULT_SNAPLEN 68 #else #define DEFAULT_SNAPLEN 96 #endif #ifndef BIG_ENDIAN #define BIG_ENDIAN 4321 #define LITTLE_ENDIAN 1234 #endif #define ESRC(ep) ((ep)->ether_shost) #define EDST(ep) ((ep)->ether_dhost) #ifndef NTOHL #define NTOHL(x) (x) = ntohl(x) #define NTOHS(x) (x) = ntohs(x) #define HTONL(x) (x) = htonl(x) #define HTONS(x) (x) = htons(x) #endif /* * True if "l" bytes of "var" were captured. * * The "ndo->ndo_snapend - (l) <= ndo->ndo_snapend" checks to make sure * "l" isn't so large that "ndo->ndo_snapend - (l)" underflows. * * The check is for <= rather than < because "l" might be 0. */ #define ND_TTEST2(var, l) (ndo->ndo_snapend - (l) <= ndo->ndo_snapend && \ (const u_char *)&(var) <= ndo->ndo_snapend - (l)) /* True if "var" was captured */ #define ND_TTEST(var) ND_TTEST2(var, sizeof(var)) /* Bail if "l" bytes of "var" were not captured */ #define ND_TCHECK2(var, l) if (!ND_TTEST2(var, l)) goto trunc /* Bail if "var" was not captured */ #define ND_TCHECK(var) ND_TCHECK2(var, sizeof(var)) #define ND_PRINT(STUFF) (*ndo->ndo_printf)STUFF #define ND_DEFAULTPRINT(ap, length) (*ndo->ndo_default_print)(ndo, ap, length) #if 0 extern void ts_print(netdissect_options *ipdo, const struct timeval *); extern void relts_print(int); #endif extern int fn_print(const u_char *, const u_char *); extern int fn_printn(const u_char *, u_int, const u_char *); extern const char *tok2str(const struct tok *, const char *, int); extern void wrapup(int); #if 0 extern char *read_infile(netdissect_options *, char *); extern char *copy_argv(netdissect_options *, char **); #endif extern void safeputchar(int); extern void safeputs(const char *, int); #if 0 extern const char *isonsap_string(netdissect_options *, const u_char *); extern const char *protoid_string(netdissect_options *, const u_char *); extern const char *dnname_string(netdissect_options *, u_short); extern const char *dnnum_string(netdissect_options *, u_short); #endif /* The printer routines. */ #include extern void eap_print(netdissect_options *,const u_char *, u_int); extern int esp_print(netdissect_options *, register const u_char *bp, int len, register const u_char *bp2, int *nhdr, int *padlen); extern void arp_print(netdissect_options *,const u_char *, u_int, u_int); extern void isakmp_print(netdissect_options *,const u_char *, u_int, const u_char *); extern void isakmp_rfc3948_print(netdissect_options *,const u_char *, u_int, const u_char *); extern void ip_print(netdissect_options *,const u_char *, u_int); extern void ip_print_inner(netdissect_options *ndo, const u_char *bp, u_int length, u_int nh, const u_char *bp2); /* stuff that has not yet been rototiled */ #if 0 extern void ascii_print(netdissect_options *,u_int); extern void hex_and_ascii_print_with_offset(netdissect_options *,const char *, u_int, u_int); extern void hex_and_ascii_print(netdissect_options *,const char *, u_int); extern void hex_print_with_offset(netdissect_options *,const char *, u_int, u_int); extern void hex_print(netdissect_options *,const char *, u_int); extern void telnet_print(netdissect_options *,const u_char *, u_int); extern int ether_encap_print(netdissect_options *,u_short, const u_char *, u_int, u_int, u_short *); extern int llc_print(netdissect_options *, const u_char *, u_int, u_int, const u_char *, const u_char *, u_short *); extern void aarp_print(netdissect_options *,const u_char *, u_int); extern void atalk_print(netdissect_options *,const u_char *, u_int); extern void atm_if_print(u_char *,const struct pcap_pkthdr *, const u_char *); extern void bootp_print(netdissect_options *,const u_char *, u_int, u_short, u_short); extern void bgp_print(netdissect_options *,const u_char *, int); extern void bxxp_print(netdissect_options *,const u_char *, u_int); extern void chdlc_if_print(u_char *user, const struct pcap_pkthdr *h, register const u_char *p); extern void chdlc_print(netdissect_options *ndo, register const u_char *p, u_int length, u_int caplen); extern void cisco_autorp_print(netdissect_options *, const u_char *, u_int); extern void cnfp_print(netdissect_options *,const u_char *cp, u_int len, const u_char *bp); extern void decnet_print(netdissect_options *,const u_char *, u_int, u_int); extern void default_print(netdissect_options *,const u_char *, u_int); extern void dvmrp_print(netdissect_options *,const u_char *, u_int); extern void egp_print(netdissect_options *,const u_char *, u_int, const u_char *); extern void arcnet_if_print(u_char*,const struct pcap_pkthdr *,const u_char *); extern void ether_if_print(u_char *,const struct pcap_pkthdr *,const u_char *); extern void token_if_print(u_char *,const struct pcap_pkthdr *,const u_char *); extern void fddi_if_print(u_char *,const struct pcap_pkthdr *, const u_char *); extern void gre_print(netdissect_options *,const u_char *, u_int); extern void icmp_print(netdissect_options *,const u_char *, u_int, const u_char *); extern void hsrp_print(netdissect_options *ndo, register const u_char *bp, register u_int len); extern void ieee802_11_if_print(u_char *,const struct pcap_pkthdr *, const u_char *); extern void igmp_print(netdissect_options *, register const u_char *, u_int); extern void igrp_print(netdissect_options *,const u_char *, u_int, const u_char *); extern void ipN_print(netdissect_options *,const u_char *, u_int); extern void ipx_print(netdissect_options *,const u_char *, u_int); extern void isoclns_print(netdissect_options *,const u_char *, u_int, u_int, const u_char *, const u_char *); extern void krb_print(netdissect_options *,const u_char *, u_int); extern void llap_print(netdissect_options *,const u_char *, u_int); extern const char *linkaddr_string(netdissect_options *ndo, const u_char *ep, const unsigned int len); extern void ltalk_if_print(netdissect_options *ndo, u_char *user, const struct pcap_pkthdr *h, const u_char *p); extern void mpls_print(netdissect_options *ndo, const u_char *bp, u_int length); extern void msdp_print(netdissect_options *ndo, const unsigned char *sp, u_int length); extern void nfsreply_print(netdissect_options *,const u_char *, u_int, const u_char *); extern void nfsreq_print(netdissect_options *,const u_char *, u_int, const u_char *); extern void ns_print(netdissect_options *,const u_char *, u_int); extern void ntp_print(netdissect_options *,const u_char *, u_int); extern void null_if_print(u_char *,const struct pcap_pkthdr *, const u_char *); extern void ospf_print(netdissect_options *,const u_char *, u_int, const u_char *); extern void pimv1_print(netdissect_options *,const u_char *, u_int); extern void mobile_print(netdissect_options *,const u_char *, u_int); extern void pim_print(netdissect_options *,const u_char *, u_int); extern void pppoe_if_print(u_char *,const struct pcap_pkthdr *, const u_char *); extern void pppoe_print(netdissect_options *,const u_char *, u_int); extern void ppp_print(netdissect_options *, register const u_char *, u_int); extern void ppp_if_print(u_char *,const struct pcap_pkthdr *, const u_char *); extern void ppp_hdlc_if_print(u_char *, const struct pcap_pkthdr *, const u_char *); extern void ppp_bsdos_if_print(u_char *, const struct pcap_pkthdr *, const u_char *); extern int vjc_print(netdissect_options *,register const char *, register u_int, u_short); extern void raw_if_print(u_char *, const struct pcap_pkthdr *, const u_char *); extern void rip_print(netdissect_options *,const u_char *, u_int); extern void sctp_print(netdissect_options *ndo, const u_char *bp, const u_char *bp2, u_int sctpPacketLength); extern void sl_if_print(u_char *,const struct pcap_pkthdr *, const u_char *); extern void lane_if_print(u_char *,const struct pcap_pkthdr *,const u_char *); extern void cip_if_print(u_char *,const struct pcap_pkthdr *,const u_char *); extern void sl_bsdos_if_print(u_char *, const struct pcap_pkthdr *, const u_char *); extern void sll_if_print(u_char *, const struct pcap_pkthdr *, const u_char *); extern void snmp_print(netdissect_options *,const u_char *, u_int); extern void sunrpcrequest_print(netdissect_options *,const u_char *, u_int, const u_char *); extern void tcp_print(netdissect_options *,const u_char *, u_int, const u_char *, int); extern void tftp_print(netdissect_options *,const u_char *, u_int); extern void timed_print(netdissect_options *,const u_char *, u_int); extern void udp_print(netdissect_options *,const u_char *, u_int, const u_char *, int); extern void wb_print(netdissect_options *,const void *, u_int); extern int ah_print(netdissect_options *,register const u_char *, register const u_char *); extern void esp_print_decodesecret(netdissect_options *ndo); extern int ipcomp_print(netdissect_options *,register const u_char *, register const u_char *, int *); extern void rx_print(netdissect_options *,register const u_char *, int, int, int, u_char *); extern void netbeui_print(netdissect_options *,u_short, const u_char *, int); extern void ipx_netbios_print(netdissect_options *,const u_char *, u_int); extern void nbt_tcp_print(netdissect_options *,const u_char *, int); extern void nbt_udp137_print(netdissect_options *, const u_char *data, int); extern void nbt_udp138_print(netdissect_options *, const u_char *data, int); extern char *smb_errstr(netdissect_options *,int, int); extern const char *nt_errstr(netdissect_options *, u_int32_t); extern void print_data(netdissect_options *,const unsigned char *, int); extern void l2tp_print(netdissect_options *,const u_char *, u_int); extern void lcp_print(netdissect_options *,const u_char *, u_int); extern void vrrp_print(netdissect_options *,const u_char *bp, u_int len, int ttl); extern void cdp_print(netdissect_options *,const u_char *, u_int, u_int, const u_char *, const u_char *); extern void stp_print(netdissect_options *,const u_char *p, u_int length); extern void radius_print(netdissect_options *,const u_char *, u_int); extern void lwres_print(netdissect_options *,const u_char *, u_int); extern void pptp_print(netdissect_options *,const u_char *, u_int); #ifdef INET6 extern void ip6_print(netdissect_options *,const u_char *, u_int); extern void ip6_opt_print(netdissect_options *,const u_char *, int); extern int hbhopt_print(netdissect_options *,const u_char *); extern int dstopt_print(netdissect_options *,const u_char *); extern int frag6_print(netdissect_options *,const u_char *, const u_char *); extern void icmp6_print(netdissect_options *,const u_char *, const u_char *); extern void ripng_print(netdissect_options *,const u_char *, int); extern int rt6_print(netdissect_options *,const u_char *, const u_char *); extern void ospf6_print(netdissect_options *,const u_char *, u_int); extern void dhcp6_print(netdissect_options *,const u_char *, u_int, u_int16_t, u_int16_t); extern void zephyr_print(netdissect_options * ndo, const u_char *cp, int length); #endif /*INET6*/ extern u_short in_cksum(const u_short *, register u_int, int); #endif #endif /* netdissect_h */ tcpdump-3.9.8/./tcp.h0000644000026300017500000000715610504040015012423 0ustar mcrmcr/* @(#) $Header: /tcpdump/master/tcpdump/tcp.h,v 1.11.2.1 2005/11/29 09:09:26 hannes Exp $ (LBL) */ /* * Copyright (c) 1982, 1986, 1993 * The Regents of the University of California. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. All advertising materials mentioning features or use of this software * must display the following acknowledgement: * This product includes software developed by the University of * California, Berkeley and its contributors. * 4. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * * @(#)tcp.h 8.1 (Berkeley) 6/10/93 */ typedef u_int32_t tcp_seq; /* * TCP header. * Per RFC 793, September, 1981. */ struct tcphdr { u_int16_t th_sport; /* source port */ u_int16_t th_dport; /* destination port */ tcp_seq th_seq; /* sequence number */ tcp_seq th_ack; /* acknowledgement number */ u_int8_t th_offx2; /* data offset, rsvd */ #define TH_OFF(th) (((th)->th_offx2 & 0xf0) >> 4) u_int8_t th_flags; #define TH_FIN 0x01 #define TH_SYN 0x02 #define TH_RST 0x04 #define TH_PUSH 0x08 #define TH_ACK 0x10 #define TH_URG 0x20 #define TH_ECNECHO 0x40 /* ECN Echo */ #define TH_CWR 0x80 /* ECN Cwnd Reduced */ u_int16_t th_win; /* window */ u_int16_t th_sum; /* checksum */ u_int16_t th_urp; /* urgent pointer */ }; #define TCPOPT_EOL 0 #define TCPOPT_NOP 1 #define TCPOPT_MAXSEG 2 #define TCPOLEN_MAXSEG 4 #define TCPOPT_WSCALE 3 /* window scale factor (rfc1323) */ #define TCPOPT_SACKOK 4 /* selective ack ok (rfc2018) */ #define TCPOPT_SACK 5 /* selective ack (rfc2018) */ #define TCPOPT_ECHO 6 /* echo (rfc1072) */ #define TCPOPT_ECHOREPLY 7 /* echo (rfc1072) */ #define TCPOPT_TIMESTAMP 8 /* timestamp (rfc1323) */ #define TCPOLEN_TIMESTAMP 10 #define TCPOLEN_TSTAMP_APPA (TCPOLEN_TIMESTAMP+2) /* appendix A */ #define TCPOPT_CC 11 /* T/TCP CC options (rfc1644) */ #define TCPOPT_CCNEW 12 /* T/TCP CC options (rfc1644) */ #define TCPOPT_CCECHO 13 /* T/TCP CC options (rfc1644) */ #define TCPOPT_SIGNATURE 19 /* Keyed MD5 (rfc2385) */ #define TCPOLEN_SIGNATURE 18 #define TCP_SIGLEN 16 /* length of an option 19 digest */ #define TCPOPT_AUTH 20 /* Enhanced AUTH option */ #define TCPOPT_TSTAMP_HDR \ (TCPOPT_NOP<<24|TCPOPT_NOP<<16|TCPOPT_TIMESTAMP<<8|TCPOLEN_TIMESTAMP) tcpdump-3.9.8/./CHANGES0000644000026300017500000007766610676336430012517 0ustar mcrmcr$Header: /tcpdump/master/tcpdump/CHANGES,v 1.87.2.17 2007/09/13 13:39:44 ken Exp $ Mon. September 10, 2007. ken@xelerance.com. Summary for 0.9.8 tcpdump release Rework ARP printer Rework OSPFv3 printer Add support for Frame-Relay ARP Decode DHCP Option 121 (RFC 3442 Classless Static Route) Decode DHCP Option 249 (MS Classless Static Route) the same as Option 121 TLV: Add support for Juniper .pcap extensions Print EGP header in new-world-order style Converted print-isakmp.c to NETDISSECT Moved AF specific stuff into af.h Test subsystem now table driven, and saves outputs and diffs to one place Require for pf definitions - allows reading of pflog formatted libpcap files on an OS other than where the file was generated Wed. July 23, 2007. mcr@xelerance.com. Summary for 0.9.7 tcpdump release NFS: Print unsigned values as such. RX: parse safely. BGP: fixes for IPv6-less builds. 801.1ag: use standard codepoint. use /dev/bpf on systems with such a device. 802.11: print QoS data, avoid dissect of no-data frame, ignore padding. smb: make sure that we haven't gone past the end of the captured data. smb: squelch an uninitialized complaint from coverity. NFS: from NetBSD; don't interpret the reply as a possible NFS reply if it got MSG_DENIED. BGP: don't print TLV values that didn't fit, from www.digit-labs.org. revised INSTALL.txt about libpcap dependancy. Wed. April 25, 2007. ken@xelerance.com. Summary for 3.9.6 tcpdump release Update man page to reflect changes to libpcap Changes to both TCP and IP Printer Output Fix a potential buffer overflow in the 802.11 printer Print basic info about a few more Cisco LAN protocols. mDNS cleanup ICMP MPLS rework of the extension code bugfix: use the correct codepoint for the OSPF simple text auth token entry, and use safeputs to print the password. Add support in pflog for additional values Add support for OIF RSVP Extensions UNI 1.0 Rev. 2 and additional RSVP objects Add support for the Message-id NACK c-type. Add support for 802.3ah loopback ctrl msg Add support for Multiple-STP as per 802.1s Add support for rapid-SPT as per 802.1w Add support for CFM Link-trace msg, Link-trace-Reply msg, Sender-ID tlv, private tlv, port, interface status Add support for unidirectional link detection as per http://www.ietf.org/internet-drafts/draft-foschiano-udld-02.txt Add support for the olsr protocol as per RFC 3626 plus the LQ extensions from olsr.org Add support for variable-length checksum in DCCP, as per section 9 of RFC 4340. Add support for per-VLAN spanning tree and per-VLAN rapid spanning tree Add support for Multiple-STP as per 802.1s Add support for the cisco propriatry 'dynamic trunking protocol' Add support for the cisco proprietary VTP protocol Update dhcp6 options table as per IETF standardization activities Tue. September 19, 2006. ken@xelerance.com. Summary for 3.9.5 tcpdump release Fix compiling on AIX (, at end of ENUM) Updated list of DNS RR typecodes Use local Ethernet defs on WIN32 Add support for Frame-Relay ARP Fixes for compiling under MSVC++ Add support for parsing Juniper .pcap files Add support for FRF.16 Multilink Frame-Relay (DLT_MFR) Rework the OSPFv3 printer Fix printing for 4.4BSD/NetBSD NFS Filehandles Add support for Cisco style NLPID encapsulation Add cisco prop. eigrp related, extended communities Add support for BGP signaled VPLS Cleanup the bootp printer Add support for PPP over Frame-Relay Add some bounds checking to the IP options code, and clean up the options output a bit. Add additional modp groups to ISAKMP printer Add support for Address-Withdraw and Label-Withdraw Msgs Add support for the BFD Discriminator TLV Fixes for 64bit compiling Add support for PIMv2 checksum verification Add support for further dissection of the IPCP Compression Option Add support for Cisco's proposed VQP protocol Add basic support for keyed authentication TCP option Lots of minor cosmetic changes to output printers Mon. September 19, 2005. ken@xelerance.com. Summary for 3.9.4 tcpdump release Decoder support for more Juniper link-layer types Fix a potential buffer overflow (although it can't occur in practice). Fix the handling of unknown management frame types in the 802.11 printer. Add FRF.16 support, fix various Frame Relay bugs. Add support for RSVP integrity objects, update fast-reroute object printer to latest spec. Clean up documentation of vlan filter expression, document mpls filter expression. Document new pppoed and pppoes filter expressions. Update diffserver-TE codepoints as per RFC 4124. Spelling fixes in ICMPv6. Don't require any fields other than flags to be present in IS-IS restart signaling TLVs, and only print the system ID in those TLVs as system IDs, not as node IDs. Support for DCCP. Tue. July 5, 2005. ken@xelerance.com. Summary for 3.9.3 tcpdump release Option to chroot() when dropping privs Fixes for compiling on nearly every platform, including improved 64bit support Many new testcases Support for sending packets Many compliation fixes on most platforms Fixes for recent version of GCC to eliminate warnings Improved Unicode support Decoders & DLT Changes, Updates and New: AES ESP support Juniper ATM, FRF.15, FRF.16, PPPoE, ML-FR, ML-PIC, ML-PPP, PL-PPP, LS-PIC GGSN,ES,MONITOR,SERVICES L2VPN Axent Raptor/Symantec Firewall TCP-MD5 (RFC 2385) ESP-in-UDP (RFC 3948) ATM OAM LMP, LMP Service Discovery IP over FC IP over IEEE 1394 BACnet MS/TP SS7 LDP over TCP LACP, MARKER as per 802.3ad PGM (RFC 3208) LSP-PING G.7041/Y.1303 Generic Framing Procedure EIGRP-IP, EIGRP-IPX ICMP6 Radio - via radiotap DHCPv6 HDLC over PPP Tue. March 30, 2004. mcr@sandelman.ottawa.on.ca. Summary for 3.8.3 release No changes from 3.8.2. Version bumped only to maintain consistency with libpcap 0.8.3. Mon. March 29, 2004. mcr@sandelman.ottawa.on.ca. Summary for 3.8.2 release Fixes for print-isakmp.c CVE: CAN-2004-0183, CAN-2004-0184 http://www.rapid7.com/advisories/R7-0017.html IP-over-IEEE1394 printing. some MINGW32 changes. updates for autoconf 2.5 fixes for print-aodv.c - check for too short packets formatting changes to print-ascii for hex output. check for too short packets: print-bgp.c, print-bootp.c, print-cdp.c, print-chdlc.c, print-domain.c, print-icmp.c, print-icmp6.c, print-ip.c, print-lwres.c, print-ospf.c, print-pim.c, print-ppp.c,print-pppoe.c, print-rsvp.c, print-wb.c print-ether.c - better handling of unknown types. print-isoclns.c - additional decoding of types. print-llc.c - strings for LLC names added. print-pfloc.c - various enhancements print-radius.c - better decoding to strings. Wed. November 12, 2003. mcr@sandelman.ottawa.on.ca. Summary for 3.8 release changed syntax of -E argument so that multiple SAs can be decrypted fixes for Digital Unix headers and Documentation __attribute__ fixes CDP changes from Terry Kennedy . IPv6 mobility updates from Kazushi Sugyo Fixes for ASN.1 decoder for 2.100.3 forms. Added a count of packets received and processed to clarify numbers. Incorporated WinDUMP patches for Win32 builds. PPPoE payload length headers. Fixes for HP C compiler builds. Use new pcap_breakloop() and pcap_findalldevs() if we can. BGP output split into multiple lines. Fixes to 802.11 decoding. Fixes to PIM decoder. SuperH is a CPU that can't handle unaligned access. Many fixes for unaligned access work. Fixes to Frame-Relay decoder for Q.933/922 frames. Clarified when Solaris can do captures as non-root. Added tests/ subdir for examples/regression tests. New -U flag. -flush stdout after every packet New -A flag -print ascii only support for decoding IS-IS inside Cisco HDLC Frames more verbosity for tftp decoder mDNS decoder new BFD decoder cross compilation patches RFC 3561 AODV support. UDP/TCP pseudo-checksum properly for source-route options. sanitized all files to modified BSD license Add support for RFC 2625 IP-over-Fibre Channel. fixes for DECnet support. Support RFC 2684 bridging of Ethernet, 802.5 Token Ring, and FDDI. RFC 2684 encapsulation of BPDUs. Tuesday, February 25, 2003. fenner@research.att.com. 3.7.2 release Fixed infinite loop when parsing malformed isakmp packets. (reported by iDefense; already fixed in CVS) Fixed infinite loop when parsing malformed BGP packets. Fixed buffer overflow with certain malformed NFS packets. Pretty-print unprintable network names in 802.11 printer. Handle truncated nbp (appletalk) packets. Updated DHCPv6 printer to match draft-ietf-dhc-dhcpv6-22.txt Print IP protocol name even if we don't have a printer for it. Print IP protocol name or number for fragments. Print the whole MPLS label stack, not just the top label. Print request header and file handle for NFS v3 FSINFO and PATHCONF requests. Fix NFS packet truncation checks. Handle "old" DR-Priority and Bidir-Capable PIM HELLO options. Handle unknown RADIUS attributes properly. Fix an ASN.1 parsing error that would cause e.g. the OID 2.100.3 to be misrepresented as 4.20.3 . Monday, January 21, 2002. mcr@sandelman.ottawa.on.ca. Summary for 3.7 release see http://www.tcpdump.org/cvs-log/2002-01-21.10:16:48.html for commit log. keyword "ipx" added. Better OSI/802.2 support on Linux. IEEE 802.11 support, from clenahan@fortresstech.com, achirica@ttd.net. LLC SAP support for FDDI/token ring/RFC-1483 style ATM BXXP protocol was replaced by the BEEP protocol; improvements to SNAP demux. Changes to "any" interface documentation. Documentation on pcap_stats() counters. Fix a memory leak found by Miklos Szeredi - pcap_ether_aton(). Added MPLS encapsulation decoding per RFC3032. DNS dissector handles TKEY, TSIG and IXFR. adaptive SLIP interface patch from Igor Khristophorov SMB printing has much improved bounds checks OUI 0x0000f8 decoded as encapsulated ethernet for Cisco-custom bridging Zephyr support, from Nickolai Zeldovich . Solaris - devices with digits in them. Stefan Hudson IPX socket 0x85be is for Cisco EIGRP over IPX. Improvements to fragmented ESP handling. SCTP support from Armando L. Caro Jr. Linux ARPHDR_ATM support fixed. Added a "netbeui" keyword, which selects NetBEUI packets. IPv6 ND improvements, MobileIP dissector, 2292bis-02 for RA option. Handle ARPHDR_HDLC from Marcus Felipe Pereira . Handle IPX socket 0x553 -> NetBIOS-over-IPX socket, "nwlink-dgm" Better Linux libc5 compat. BIND9 lwres dissector added. MIPS and SPARC get strict alignment macros (affects print-bgp.c) Apple LocalTalk LINKTYPE_ reserved. New time stamp formats documented. DHCP6 updated to draft-22.txt spec. ICMP types/codes now accept symbolic names. Add SIGINFO handler from LBL encrypted CIPE tunnels in IRIX, from Franz Schaefer . now we are -Wstrict-prototype clean. NetBSD DLT_PPP_ETHER; adapted from Martin Husemann . PPPoE dissector cleaned up. Support for LocalTalk hardware, from Uns Lider . In dissector, now the caller prints the IP addresses rather than proto. cjclark@alum.mit.edu: print the IP proto for non-initial fragments. LLC frames with a DSAP and LSAP of 0xe0 are IPX frames. Linux cooked frames with a type value of LINUX_SLL_P_802_3 are IPX. captures on the "any" device won't be done in promiscuous mode Token Ring support on DLPI - Onno van der Linden ARCNet support, from NetBSD. HSRP dissector, from Julian Cowley . Handle (GRE-encapsulated) PPTP added -C option to rotate save file every optarg * 1,000,000 bytes. support for "vrrp" name - NetBSD, by Klaus Klein . PPTP support, from Motonori Shindo . IS-IS over PPP support, from Hannes Gredler . CNFP support for IPv6,format. Harry Raaymakers . ESP printing updated to RFC2406. HP-UX can now handle large number of PPAs. MSDP printer added. L2TP dissector improvements from Motonori Shindo. Tuesday January 9, 2001. mcr@sandelman.ottawa.on.ca. Summary for 3.6 release Cleaned up documentation. Promisc mode fixes for Linux IPsec changes/cleanups. Alignment fixes for picky architectures Removed dependency on native headers for packet dissectors. Removed Linux specific headers that were shipped libpcap changes provide for exchanging capture files between systems. Save files now have well known PACKET_ values instead of depending upon system dependant mappings of DLT_* types. Support for computing/checking IP and UDP/TCP checksums. Updated autoconf stock files. IPv6 improvements: dhcp (draft-15), mobile-ip6, ppp, ospf6, Added dissector support for: ISOCLNS, Token Ring, IGMPv3, bxxp, timed, vrrp, radius, chdlc, cnfp, cdp, IEEE802.1d, raw-AppleTalk Added filtering support for: VLANs, ESIS, ISIS Improvements to: print-telnet, IPTalk, bootp/dhcp, ECN, PPP, L2TP, PPPoE HP-UX 11.0 -- find the right dlpi device. Solaris 8 - IPv6 works Linux - Added support for an "any" device to capture on all interfaces Security fixes: buffer overrun audit done. Strcpy replaced with strlcpy, sprintf replaced with snprintf. Look for lex problems, and warn about them. v3.5 Fri Jan 28 18:00:00 PST 2000 Bill Fenner - switch to config.h for autoconf - unify RCSID strings - Updated PIMv1, PIMv2, DVMRP, IGMP parsers, add Cisco Auto-RP parser - Really fix the RIP printer - Fix MAC address -> name translation. - some -Wall -Wformat fixes - update makemib to parse much of SMIv2 - Print TCP sequence # with -vv even if you normally wouldn't - Print as much of IP/TCP/UDP headers as possible even if truncated. itojun@iijlab.net - -X will make a ascii dump. from netbsd. - telnet command sequence decoder (ff xx xx). from netbsd. - print-bgp.c: improve options printing. ugly code exists for unaligned option parsing (need some fix). - const poisoning in SMB decoder. - -Wall -Werror clean checks. - bring in KAME IPv6/IPsec decoding code. Assar Westerlund - SNMPv2 and SNMPv3 printer - If compiled with libsmi, tcpdump can load MIBs on the fly to decode SNMP packets. - Incorporate NFS parsing code from NetBSD. Adds support for nfsv3. - portability fixes - permit building in different directories. Ken Hornstein - bring in code at /afs/transarc.com/public/afs-contrib/tools/tcpdump for parsing AFS3 packets Andrew Tridgell - SMB printing code Love - print-rx.c: add code for printing MakeDir and StoreStatus. Also change date format to the right one. Michael C. Richardson - Created tcpdump.org repository v3.4 Sat Jul 25 12:40:55 PDT 1998 - Hardwire Linux slip support since it's too hard to detect. - Redo configuration of "network" libraries (-lsocket and -lnsl) to deal with IRIX. Thanks to John Hawkinson (jhawk@mit.edu) - Added -a which tries to translate network and broadcast addresses to names. Suggested by Rob van Nieuwkerk (robn@verdi.et.tudelft.nl) - Added a configure option to disable gcc. - Added a "raw" packet printer. - Not having an interface address is no longer fatal. Requested by John Hawkinson. - Rework signal setup to accommodate Linux. - OSPF truncation check fix. Also display the type of OSPF packets using MD5 authentication. Thanks to Brian Wellington (bwelling@tis.com) - Fix truncation check bugs in the Kerberos printer. Reported by Ezra Peisach (epeisach@mit.edu) - Don't catch SIGHUP when invoked with nohup(1). Thanks to Dave Plonka (plonka@mfa.com) - Specify full install target as a way of detecting if install directory does not exist. Thanks to Dave Plonka. - Bit-swap FDDI addresses for BSD/OS too. Thanks to Paul Vixie (paul@vix.com) - Fix off-by-one bug when testing size of ethernet packets. Thanks to Marty Leisner (leisner@sdsp.mc.xerox.com) - Add a local autoconf macro to check for routines in libraries; the autoconf version is broken (it only puts the library name in the cache variable name). Thanks to John Hawkinson. - Add a local autoconf macro to check for types; the autoconf version is broken (it uses grep instead of actually compiling a code fragment). - Modified to support the new BSD/OS 2.1 PPP and SLIP link layer header formats. - Extend OSF ip header workaround to versions 1 and 2. - Fix some signed problems in the nfs printer. As reported by David Sacerdote (davids@silence.secnet.com) - Detect group wheel and use it as the default since BSD/OS' install can't hack numeric groups. Reported by David Sacerdote. - AIX needs special loader options. Thanks to Jonathan I. Kamens (jik@cam.ov.com) - Fixed the nfs printer to print port numbers in decimal. Thanks to Kent Vander Velden (graphix@iastate.edu) - Find installed libpcap in /usr/local/lib when not using gcc. - Disallow network masks with non-network bits set. - Attempt to detect "egcs" versions of gcc. - Add missing closing double quotes when displaying bootp strings. Reported by Viet-Trung Luu (vluu@picard.math.uwaterloo.ca) v3.3 Sat Nov 30 20:56:27 PST 1996 - Added Linux support. - GRE encapsulated packet printer thanks to John Hawkinson (jhawk@mit.edu) - Rewrite gmt2local() to avoid problematic os dependencies. - Suppress nfs truncation message on errors. - Add missing m4 quoting in AC_LBL_UNALIGNED_ACCESS autoconf macro. Reported by Joachim Ott (ott@ardala.han.de) - Enable "ip_hl vs. ip_vhl" workaround for OSF4 too. - Print arp hardware type in host order. Thanks to Onno van der Linden (onno@simplex.nl) - Avoid solaris compiler warnings. Thanks to Bruce Barnett (barnett@grymoire.crd.ge.com) - Fix rip printer to not print one more route than is actually in the packet. Thanks to Jean-Luc Richier (Jean-Luc.Richier@imag.fr) and Bill Fenner (fenner@parc.xerox.com) - Use autoconf endian detection since BYTE_ORDER isn't defined on all systems. - Fix dvmrp printer truncation checks and add a dvmrp probe printer. Thanks to Danny J. Mitzel (mitzel@ipsilon.com) - Rewrite ospf printer to improve truncation checks. - Don't parse tcp options past the EOL. As noted by David Sacerdote (davids@secnet.com). Also, check tcp options to make sure they ar actually in the tcp header (in addition to the normal truncation checks). Fix the SACK code to print the N blocks (instead of the first block N times). - Don't say really small UDP packets are truncated just because they aren't big enough to be a RPC. As noted by David Sacerdote. v3.2.1 Sun Jul 14 03:02:26 PDT 1996 - Added rfc1716 icmp codes as suggested by Martin Fredriksson (martin@msp.se) - Print mtu for icmp unreach need frag packets. Thanks to John Hawkinson (jhawk@mit.edu) - Decode icmp router discovery messages. Thanks to Jeffrey Honig (jch@bsdi.com) - Added a printer entry for DLT_IEEE802 as suggested by Tak Kushida (kushida@trl.ibm.co.jp) - Check igmp checksum if possible. Thanks to John Hawkinson. - Made changes for SINIX. Thanks to Andrej Borsenkow (borsenkow.msk@sni.de) - Use autoconf's idea of the top level directory in install targets. Thanks to John Hawkinson. - Avoid infinite loop in tcp options printing code. Thanks to Jeffrey Mogul (mogul@pa.dec.com) - Avoid using -lsocket in IRIX 5.2 and earlier since it breaks snoop. Thanks to John Hawkinson. - Added some more packet truncation checks. - On systems that have it, use sigset() instead of signal() since signal() has different semantics on these systems. - Fixed some more alignment problems on the alpha. - Add code to massage unprintable characters in the domain and ipx printers. Thanks to John Hawkinson. - Added explicit netmask support. Thanks to Steve Nuchia (steve@research.oknet.com) - Add "sca" keyword (for DEC cluster services) as suggested by Terry Kennedy (terry@spcvxa.spc.edu) - Add "atalk" keyword as suggested by John Hawkinson. - Added an igrp printer. Thanks to Francis Dupont (francis.dupont@inria.fr) - Print IPX net numbers in hex a la Novell Netware. Thanks to Terry Kennedy (terry@spcvxa.spc.edu) - Fixed snmp extended tag field parsing bug. Thanks to Pascal Hennequin (pascal.hennequin@hugo.int-evry.fr) - Added some ETHERTYPEs missing on some systems. - Added truncated packet macros and various checks. - Fixed endian problems with the DECnet printer. - Use $CC when checking gcc version. Thanks to Carl Lindberg (carl_lindberg@blacksmith.com) - Fixes for AIX (although this system is not yet supported). Thanks to John Hawkinson. - Fix bugs in the autoconf misaligned accesses code fragment. - Include sys/param.h to get BYTE_ORDER in a few places. Thanks to Pavlin Ivanov Radoslavov (pavlin@cs.titech.ac.jp) v3.2 Sun Jun 23 02:28:10 PDT 1996 - Print new icmp unreachable codes as suggested by Martin Fredriksson (martin@msp.se). Also print code value when unknown for icmp redirect and time exceeded. - Fix an alignment endian bug in getname(). Thanks to John Hawkinson. - Define "new" domain record types if not found in arpa/nameserv.h. Resulted from a suggestion from John Hawkinson (jhawk@mit.edu). Also fixed an endian bug when printing mx record and added some new record types. - Added RIP V2 support. Thanks to Jeffrey Honig (jch@bsdi.com) - Added T/TCP options printing. As suggested by Richard Stevens (rstevens@noao.edu) - Use autoconf to detect architectures that can't handle misaligned accesses. v3.1 Thu Jun 13 20:59:32 PDT 1996 - Changed u_int32/int32 to u_int32_t/int32_t to be consistent with bsd and bind (as suggested by Charles Hannum). - Port to GNU autoconf. - Add support for printing DVMRP and PIM traffic thanks to Havard Eidnes (Havard.Eidnes@runit.sintef.no). - Fix AppleTalk, IPX and DECnet byte order problems due to wrong endian define being referenced. Reported by Terry Kennedy. - Minor fixes to the man page thanks to Mark Andrews. - Endian fixes to RTP and vat packet dumpers, thanks to Bruce Mah (bmah@cs.berkeley.edu). - Added support for new dns types, thanks to Rainer Orth. - Fixed tftp_print() to print the block number for ACKs. - Document -dd and -ddd. Resulted from a bug report from Charlie Slater (cslater@imatek.com). - Check return status from malloc/calloc/etc. - Check return status from pcap_loop() so we can print an error and exit with a bad status if there were problems. - Bail if ip option length is <= 0. Resulted from a bug report from Darren Reed (darrenr@vitruvius.arbld.unimelb.edu.au). - Print out a little more information for sun rpc packets. - Add suport for Kerberos 4 thanks to John Hawkinson (jhawk@mit.edu). - Fixed the Fix EXTRACT_SHORT() and EXTRACT_LONG() macros (which were wrong on little endian machines). - Fixed alignment bug in ipx_decode(). Thanks to Matt Crawford (crawdad@fnal.gov). - Fix ntp_print() to not print garbage when the stratum is "unspecified." Thanks to Deus Ex Machina (root@belle.bork.com). - Rewrote tcp options printer code to check for truncation. Added selective acknowledgment case. - Fixed an endian bug in the ospf printer. Thanks to Jeffrey C Honig (jch@bsdi.com) - Fix rip printer to handle 4.4 BSD sockaddr struct which only uses one octet for the sa_family member. Thanks to Yoshitaka Tokugawa (toku@dit.co.jp) - Don't checksum ip header if we don't have all of it. Thanks to John Hawkinson (jhawk@mit.edu). - Print out hostnames if possible in egp printer. Thanks to Jeffrey Honig (jhc@bsdi.com) v3.1a1 Wed May 3 19:21:11 PDT 1995 - Include time.h when SVR4 is defined to avoid problems under Solaris 2.3. - Fix etheraddr_string() in the ETHER_SERVICE to return the saved strings, not the local buffer. Thanks to Stefan Petri (petri@ibr.cs.tu-bs.de). - Detect when pcap raises the snaplen (e.g. with snit). Print a warning that the selected value was not used. Thanks to Pascal Hennequin (Pascal.Hennequin@hugo.int-evry.fr). - Add a truncated packet test to print-nfs.c. Thanks to Pascal Hennequin. - BYTEORDER -> BYTE_ORDER Thanks to Terry Kennedy (terry@spcvxa.spc.edu). v3.0.3 Sun Oct 1 18:35:00 GMT 1995 - Although there never was a 3.0.3 release, the linux boys cleverly "released" one in late 1995. v3.0.2 Thu Apr 20 21:28:16 PDT 1995 - Change configuration to not use gcc v2 flags with gcc v1. - Redo gmt2local() so that it works under BSDI (which seems to return an empty timezone struct from gettimeofday()). Based on report from Terry Kennedy (terry@spcvxa.spc.edu). - Change configure to recognize IP[0-9]* as "mips" SGI hardware. Based on report from Mark Andrews (mandrews@alias.com). - Don't pass cc flags to gcc. Resulted from a bug report from Rainer Orth (ro@techfak.uni-bielefeld.de). - Fixed printout of connection id for uncompressed tcp slip packets. Resulted from a bug report from Richard Stevens (rstevens@noao.edu). - Hack around deficiency in Ultrix's make. - Add ETHERTYPE_TRAIL define which is missing from irix5. v3.0.1 Wed Aug 31 22:42:26 PDT 1994 - Fix problems with gcc2 vs. malloc() and read() prototypes under SunOS 4. v3.0 Mon Jun 20 19:23:27 PDT 1994 - Added support for printing tcp option timestamps thanks to Mark Andrews (mandrews@alias.com). - Reorganize protocol dumpers to take const pointers to packets so they never change the contents (i.e., they used to do endian conversions in place). Previously, whenever more than one pass was taken over the packet, the packet contents would be dumped incorrectly (i.e., the output form -x would be wrong on little endian machines because the protocol dumpers would modify the data). Thanks to Charles Hannum (mycroft@gnu.ai.mit.edu) for reporting this problem. - Added support for decnet protocol dumping thanks to Jeff Mogul (mogul@pa.dec.com). - Fix bug that caused length of packet to be incorrectly printed (off by ether header size) for unknown ethernet types thanks to Greg Miller (gmiller@kayak.mitre.org). - Added support for IPX protocol dumping thanks to Brad Parker (brad@fcr.com). - Added check to verify IP header checksum under -v thanks to Brad Parker (brad@fcr.com). - Move packet capture code to new libpcap library (which is packaged separately). - Prototype everything and assume an ansi compiler. - print-arp.c: Print hardware ethernet addresses if they're not what we expect. - print-bootp.c: Decode the cmu vendor field. Add RFC1497 tags. Many helpful suggestions from Gordon Ross (gwr@jericho.mc.com). - print-fddi.c: Improvements. Thanks to Jeffrey Mogul (mogul@pa.dec.com). - print-icmp.c: Byte swap netmask before printing. Thanks to Richard Stevens (rstevens@noao.edu). Print icmp type when unknown. - print-ip.c: Print the inner ip datagram of ip-in-ip encapsulated packets. By default, only the inner packet is dumped, appended with the token "(encap)". Under -v, both the inner and output packets are dumped (on the same line). Note that the filter applies to the original packet, not the encapsulated packet. So if you run tcpdump on a net with an IP Multicast tunnel, you cannot filter out the datagrams using the conventional syntax. (You can filter away all the ip-in-ip traffic with "not ip proto 4".) - print-nfs.c: Keep pending rpc's in circular table. Add generic nfs header and remove os dependences. Thanks to Jeffrey Mogul. - print-ospf.c: Improvements. Thanks to Jeffrey Mogul. - tcpdump.c: Add -T flag allows interpretation of "vat", "wb", "rpc" (sunrpc) and rtp packets. Added "inbound" and "outbound" keywords Add && and || operators v2.2.1 Tue Jun 6 17:57:22 PDT 1992 - Fix bug with -c flag. v2.2 Fri May 22 17:19:41 PDT 1992 - savefile.c: Remove hack that shouldn't have been exported. Add truncate checks. - Added the 'icmp' keyword. For example, 'icmp[0] != 8 and icmp[0] != 0' matches non-echo/reply ICMP packets. - Many improvements to filter code optimizer. - Added 'multicast' keyword and extended the 'broadcast' keyword can now be so that protocol qualifications are allowed. For example, "ip broadcast" and "ether multicast" are valid filters. - Added support for monitoring the loopback interface (i.e. 'tcpdump -i lo'). Jeffrey Honig (jch@MITCHELL.CIT.CORNELL.EDU) contributed the kernel patches to netinet/if_loop.c. - Added support for the Ungermann-Bass Ethernet on IBM/PC-RTs running AOS. Contact Jeffrey Honig (jch@MITCHELL.CIT.CORNELL.EDU) for the diffs. - Added EGP and OSPF printers, thanks to Jeffrey Honig. v2.1 Tue Jan 28 11:00:14 PST 1992 - Internal release (never publically exported). v2.0.1 Sun Jan 26 21:10:10 PDT - Various byte ordering fixes. - Add truncation checks. - inet.c: Support BSD style SIOCGIFCONF. - nametoaddr.c: Handle multi addresses for single host. - optimize.c: Rewritten. - pcap-bpf.c: don't choke when we get ptraced. only set promiscuous for broadcast nets. - print-atal.c: Fix an alignment bug (thanks to stanonik@nprdc.navy.mil) Add missing printf() argument. - print-bootp.c: First attempt at decoding the vendor buffer. - print-domain.c: Fix truncation checks. - print-icmp.c: Calculate length of packets from the ip header. - print-ip.c: Print frag id in decimal (so it's easier to match up with non-frags). Add support for ospf, egp and igmp. - print-nfs.c: Lots of changes. - print-ntp.c: Make some verbose output depend on -v. - print-snmp.c: New version from John LoVerso. - print-tcp.c: Print rfc1072 tcp options. - tcpdump.c: Print "0x" prefix for %x formats. Always print 6 digits (microseconds) worth of precision. Fix uid bugs. - A packet dumper has been added (thanks to Jeff Mogul of DECWRL). With this option, you can create an architecture independent binary trace file in real time, without the overhead of the packet printer. At a later time, the packets can be filtered (again) and printed. - BSD is supported. You must have BPF in your kernel. Since the filtering is now done in the kernel, fewer packets are dropped. In fact, with BPF and the packet dumper option, a measly Sun 3/50 can keep up with a busy network. - Compressed SLIP packets can now be dumped, provided you use our SLIP software and BPF. These packets are dumped as any other IP packet; the compressed headers are dumped with the '-e' option. - Machines with little-endian byte ordering are supported (thanks to Jeff Mogul). - Ultrix 4.0 is supported (also thanks to Jeff Mogul). - IBM RT and Stanford Enetfilter support has been added by Rayan Zachariassen . Tcpdump has been tested under both the vanilla Enetfilter interface, and the extended interface (#ifdef'd by IBMRTPC) present in the MERIT version of the Enetfilter. - TFTP packets are now printed (requests only). - BOOTP packets are now printed. - SNMP packets are now printed. (thanks to John LoVerso of Xylogics). - Sparc architectures, including the Sparcstation-1, are now supported thanks to Steve McCanne and Craig Leres. - SunOS 4 is now supported thanks to Micky Liu of Columbia University (micky@cunixc.cc.columbia.edu). - IP options are now printed. - RIP packets are now printed. - There's a -v flag that prints out more information than the default (e.g., it will enable printing of IP ttl, tos and id) and -q flag that prints out less (e.g., it will disable interpretation of AppleTalk-in-UDP). - The grammar has undergone substantial changes (if you have an earlier version of tcpdump, you should re-read the manual entry). The most useful change is the addition of an expression syntax that lets you filter on arbitrary fields or values in the packet. E.g., "ip[0] > 0x45" would print only packets with IP options, "tcp[13] & 3 != 0" would print only TCP SYN and FIN packets. The most painful change is that concatenation no longer means "and" -- e.g., you have to say "host foo and port bar" instead of "host foo port bar". The up side to this down is that repeated qualifiers can be omitted, making most filter expressions shorter. E.g., you can now say "ip host foo and (bar or baz)" to look at ip traffic between hosts foo and bar or between hosts foo and baz. [The old way of saying this was "ip host foo and (ip host bar or ip host baz)".] v2.0 Sun Jan 13 12:20:40 PST 1991 - Initial public release. tcpdump-3.9.8/./print-sunrpc.c0000644000026300017500000001016610234003646014300 0ustar mcrmcr/* * Copyright (c) 1992, 1993, 1994, 1995, 1996 * The Regents of the University of California. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that: (1) source code distributions * retain the above copyright notice and this paragraph in its entirety, (2) * distributions including binary code include the above copyright notice and * this paragraph in its entirety in the documentation or other materials * provided with the distribution, and (3) all advertising materials mentioning * features or use of this software display the following acknowledgement: * ``This product includes software developed by the University of California, * Lawrence Berkeley Laboratory and its contributors.'' Neither the name of * the University nor the names of its contributors may be used to endorse * or promote products derived from this software without specific prior * written permission. * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. */ #ifndef lint static const char rcsid[] _U_ = "@(#) $Header: /tcpdump/master/tcpdump/print-sunrpc.c,v 1.46.2.1 2005/04/27 21:44:06 guy Exp $ (LBL)"; #endif #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #ifdef HAVE_GETRPCBYNUMBER #include #ifdef HAVE_RPC_RPCENT_H #include #endif /* HAVE_RPC_RPCENT_H */ #endif /* HAVE_GETRPCBYNUMBER */ #include #include #include "interface.h" #include "addrtoname.h" #include "extract.h" #include "ip.h" #ifdef INET6 #include "ip6.h" #endif #include "rpc_auth.h" #include "rpc_msg.h" #include "pmap_prot.h" static struct tok proc2str[] = { { SUNRPC_PMAPPROC_NULL, "null" }, { SUNRPC_PMAPPROC_SET, "set" }, { SUNRPC_PMAPPROC_UNSET, "unset" }, { SUNRPC_PMAPPROC_GETPORT, "getport" }, { SUNRPC_PMAPPROC_DUMP, "dump" }, { SUNRPC_PMAPPROC_CALLIT, "call" }, { 0, NULL } }; /* Forwards */ static char *progstr(u_int32_t); void sunrpcrequest_print(register const u_char *bp, register u_int length, register const u_char *bp2) { register const struct sunrpc_msg *rp; register const struct ip *ip; #ifdef INET6 register const struct ip6_hdr *ip6; #endif u_int32_t x; char srcid[20], dstid[20]; /*fits 32bit*/ rp = (struct sunrpc_msg *)bp; if (!nflag) { snprintf(srcid, sizeof(srcid), "0x%x", EXTRACT_32BITS(&rp->rm_xid)); strlcpy(dstid, "sunrpc", sizeof(dstid)); } else { snprintf(srcid, sizeof(srcid), "0x%x", EXTRACT_32BITS(&rp->rm_xid)); snprintf(dstid, sizeof(dstid), "0x%x", SUNRPC_PMAPPORT); } switch (IP_V((struct ip *)bp2)) { case 4: ip = (struct ip *)bp2; printf("%s.%s > %s.%s: %d", ipaddr_string(&ip->ip_src), srcid, ipaddr_string(&ip->ip_dst), dstid, length); break; #ifdef INET6 case 6: ip6 = (struct ip6_hdr *)bp2; printf("%s.%s > %s.%s: %d", ip6addr_string(&ip6->ip6_src), srcid, ip6addr_string(&ip6->ip6_dst), dstid, length); break; #endif default: printf("%s.%s > %s.%s: %d", "?", srcid, "?", dstid, length); break; } printf(" %s", tok2str(proc2str, " proc #%u", EXTRACT_32BITS(&rp->rm_call.cb_proc))); x = EXTRACT_32BITS(&rp->rm_call.cb_rpcvers); if (x != 2) printf(" [rpcver %u]", x); switch (EXTRACT_32BITS(&rp->rm_call.cb_proc)) { case SUNRPC_PMAPPROC_SET: case SUNRPC_PMAPPROC_UNSET: case SUNRPC_PMAPPROC_GETPORT: case SUNRPC_PMAPPROC_CALLIT: x = EXTRACT_32BITS(&rp->rm_call.cb_prog); if (!nflag) printf(" %s", progstr(x)); else printf(" %u", x); printf(".%u", EXTRACT_32BITS(&rp->rm_call.cb_vers)); break; } } static char * progstr(prog) u_int32_t prog; { #ifdef HAVE_GETRPCBYNUMBER register struct rpcent *rp; #endif static char buf[32]; static u_int32_t lastprog = 0; if (lastprog != 0 && prog == lastprog) return (buf); #ifdef HAVE_GETRPCBYNUMBER rp = getrpcbynumber(prog); if (rp == NULL) #endif (void) snprintf(buf, sizeof(buf), "#%u", prog); #ifdef HAVE_GETRPCBYNUMBER else strlcpy(buf, rp->r_name, sizeof(buf)); #endif return (buf); } tcpdump-3.9.8/./print-esp.c0000644000026300017500000002627010231645751013566 0ustar mcrmcr/* $NetBSD: print-ah.c,v 1.4 1996/05/20 00:41:16 fvdl Exp $ */ /* * Copyright (c) 1988, 1989, 1990, 1991, 1992, 1993, 1994 * The Regents of the University of California. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that: (1) source code distributions * retain the above copyright notice and this paragraph in its entirety, (2) * distributions including binary code include the above copyright notice and * this paragraph in its entirety in the documentation or other materials * provided with the distribution, and (3) all advertising materials mentioning * features or use of this software display the following acknowledgement: * ``This product includes software developed by the University of California, * Lawrence Berkeley Laboratory and its contributors.'' Neither the name of * the University nor the names of its contributors may be used to endorse * or promote products derived from this software without specific prior * written permission. * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. */ #ifndef lint static const char rcsid[] _U_ = "@(#) $Header: /tcpdump/master/tcpdump/print-esp.c,v 1.55.2.1 2005/04/21 06:44:57 guy Exp $ (LBL)"; #endif #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include #ifdef HAVE_LIBCRYPTO #ifdef HAVE_OPENSSL_EVP_H #include #endif #endif #include #include "ip.h" #include "esp.h" #ifdef INET6 #include "ip6.h" #endif #include "netdissect.h" #include "addrtoname.h" #include "extract.h" #ifndef HAVE_SOCKADDR_STORAGE #ifdef INET6 struct sockaddr_storage { union { struct sockaddr_in sin; struct sockaddr_in6 sin6; } un; }; #else #define sockaddr_storage sockaddr #endif #endif /* HAVE_SOCKADDR_STORAGE */ #ifdef HAVE_LIBCRYPTO struct sa_list { struct sa_list *next; struct sockaddr_storage daddr; u_int32_t spi; const EVP_CIPHER *evp; int ivlen; int authlen; u_char secret[256]; /* is that big enough for all secrets? */ int secretlen; }; static void esp_print_addsa(netdissect_options *ndo, struct sa_list *sa, int sa_def) { /* copy the "sa" */ struct sa_list *nsa; nsa = (struct sa_list *)malloc(sizeof(struct sa_list)); if (nsa == NULL) (*ndo->ndo_error)(ndo, "ran out of memory to allocate sa structure"); *nsa = *sa; if (sa_def) ndo->ndo_sa_default = nsa; nsa->next = ndo->ndo_sa_list_head; ndo->ndo_sa_list_head = nsa; } static u_int hexdigit(netdissect_options *ndo, char hex) { if (hex >= '0' && hex <= '9') return (hex - '0'); else if (hex >= 'A' && hex <= 'F') return (hex - 'A' + 10); else if (hex >= 'a' && hex <= 'f') return (hex - 'a' + 10); else { (*ndo->ndo_error)(ndo, "invalid hex digit %c in espsecret\n", hex); return 0; } } static u_int hex2byte(netdissect_options *ndo, char *hexstring) { u_int byte; byte = (hexdigit(ndo, hexstring[0]) << 4) + hexdigit(ndo, hexstring[1]); return byte; } /* * decode the form: SPINUM@IP ALGONAME:0xsecret * * special form: file /name * causes us to go read from this file instead. * */ static void esp_print_decode_onesecret(netdissect_options *ndo, char *line) { struct sa_list sa1; int sa_def; char *spikey; char *decode; spikey = strsep(&line, " \t"); sa_def = 0; memset(&sa1, 0, sizeof(struct sa_list)); /* if there is only one token, then it is an algo:key token */ if (line == NULL) { decode = spikey; spikey = NULL; /* memset(&sa1.daddr, 0, sizeof(sa1.daddr)); */ /* sa1.spi = 0; */ sa_def = 1; } else decode = line; if (spikey && strcasecmp(spikey, "file") == 0) { /* open file and read it */ FILE *secretfile; char fileline[1024]; char *nl; secretfile = fopen(line, FOPEN_READ_TXT); if (secretfile == NULL) { perror(line); exit(3); } while (fgets(fileline, sizeof(fileline)-1, secretfile) != NULL) { /* remove newline from the line */ nl = strchr(fileline, '\n'); if (nl) *nl = '\0'; if (fileline[0] == '#') continue; if (fileline[0] == '\0') continue; esp_print_decode_onesecret(ndo, fileline); } fclose(secretfile); return; } if (spikey) { char *spistr, *foo; u_int32_t spino; struct sockaddr_in *sin; #ifdef INET6 struct sockaddr_in6 *sin6; #endif spistr = strsep(&spikey, "@"); spino = strtoul(spistr, &foo, 0); if (spistr == foo || !spikey) { (*ndo->ndo_warning)(ndo, "print_esp: failed to decode spi# %s\n", foo); return; } sa1.spi = spino; sin = (struct sockaddr_in *)&sa1.daddr; #ifdef INET6 sin6 = (struct sockaddr_in6 *)&sa1.daddr; if (inet_pton(AF_INET6, spikey, &sin6->sin6_addr) == 1) { #ifdef HAVE_SOCKADDR_SA_LEN sin6->sin6_len = sizeof(struct sockaddr_in6); #endif sin6->sin6_family = AF_INET6; } else #endif if (inet_pton(AF_INET, spikey, &sin->sin_addr) == 1) { #ifdef HAVE_SOCKADDR_SA_LEN sin->sin_len = sizeof(struct sockaddr_in); #endif sin->sin_family = AF_INET; } else { (*ndo->ndo_warning)(ndo, "print_esp: can not decode IP# %s\n", spikey); return; } } if (decode) { char *colon, *p; u_char espsecret_key[256]; int len; size_t i; const EVP_CIPHER *evp; int authlen = 0; /* skip any blank spaces */ while (isspace((unsigned char)*decode)) decode++; colon = strchr(decode, ':'); if (colon == NULL) { (*ndo->ndo_warning)(ndo, "failed to decode espsecret: %s\n", decode); return; } *colon = '\0'; len = colon - decode; if (strlen(decode) > strlen("-hmac96") && !strcmp(decode + strlen(decode) - strlen("-hmac96"), "-hmac96")) { p = strstr(decode, "-hmac96"); *p = '\0'; authlen = 12; } if (strlen(decode) > strlen("-cbc") && !strcmp(decode + strlen(decode) - strlen("-cbc"), "-cbc")) { p = strstr(decode, "-cbc"); *p = '\0'; } evp = EVP_get_cipherbyname(decode); if (!evp) { (*ndo->ndo_warning)(ndo, "failed to find cipher algo %s\n", decode); sa1.evp = NULL; sa1.authlen = 0; sa1.ivlen = 0; return; } sa1.evp = evp; sa1.authlen = authlen; sa1.ivlen = EVP_CIPHER_iv_length(evp); colon++; if (colon[0] == '0' && colon[1] == 'x') { /* decode some hex! */ colon += 2; len = strlen(colon) / 2; if (len > 256) { (*ndo->ndo_warning)(ndo, "secret is too big: %d\n", len); return; } i = 0; while (colon[0] != '\0' && colon[1]!='\0') { espsecret_key[i] = hex2byte(ndo, colon); colon += 2; i++; } memcpy(sa1.secret, espsecret_key, i); sa1.secretlen = i; } else { i = strlen(colon); if (i < sizeof(sa1.secret)) { memcpy(sa1.secret, colon, i); sa1.secretlen = i; } else { memcpy(sa1.secret, colon, sizeof(sa1.secret)); sa1.secretlen = sizeof(sa1.secret); } } } esp_print_addsa(ndo, &sa1, sa_def); } static void esp_print_decodesecret(netdissect_options *ndo) { char *line; char *p; p = ndo->ndo_espsecret; while (ndo->ndo_espsecret && ndo->ndo_espsecret[0] != '\0') { /* pick out the first line or first thing until a comma */ if ((line = strsep(&ndo->ndo_espsecret, "\n,")) == NULL) { line = ndo->ndo_espsecret; ndo->ndo_espsecret = NULL; } esp_print_decode_onesecret(ndo, line); } } static void esp_init(netdissect_options *ndo _U_) { OpenSSL_add_all_algorithms(); EVP_add_cipher_alias(SN_des_ede3_cbc, "3des"); } #endif int esp_print(netdissect_options *ndo, const u_char *bp, const int length, const u_char *bp2 #ifndef HAVE_LIBCRYPTO _U_ #endif , int *nhdr #ifndef HAVE_LIBCRYPTO _U_ #endif , int *padlen #ifndef HAVE_LIBCRYPTO _U_ #endif ) { register const struct newesp *esp; register const u_char *ep; #ifdef HAVE_LIBCRYPTO struct ip *ip; struct sa_list *sa = NULL; int espsecret_keylen; #ifdef INET6 struct ip6_hdr *ip6 = NULL; #endif int advance; int len; u_char *secret; int ivlen = 0; u_char *ivoff; u_char *p; EVP_CIPHER_CTX ctx; int blocksz; static int initialized = 0; #endif esp = (struct newesp *)bp; #ifdef HAVE_LIBCRYPTO secret = NULL; advance = 0; if (!initialized) { esp_init(ndo); initialized = 1; } #endif #if 0 /* keep secret out of a register */ p = (u_char *)&secret; #endif /* 'ep' points to the end of available data. */ ep = ndo->ndo_snapend; if ((u_char *)(esp + 1) >= ep) { fputs("[|ESP]", stdout); goto fail; } (*ndo->ndo_printf)(ndo, "ESP(spi=0x%08x", EXTRACT_32BITS(&esp->esp_spi)); (*ndo->ndo_printf)(ndo, ",seq=0x%x)", EXTRACT_32BITS(&esp->esp_seq)); (*ndo->ndo_printf)(ndo, ", length %u", length); #ifndef HAVE_LIBCRYPTO goto fail; #else /* initiailize SAs */ if (ndo->ndo_sa_list_head == NULL) { if (!ndo->ndo_espsecret) goto fail; esp_print_decodesecret(ndo); } if (ndo->ndo_sa_list_head == NULL) goto fail; ip = (struct ip *)bp2; switch (IP_V(ip)) { #ifdef INET6 case 6: ip6 = (struct ip6_hdr *)bp2; /* we do not attempt to decrypt jumbograms */ if (!EXTRACT_16BITS(&ip6->ip6_plen)) goto fail; /* if we can't get nexthdr, we do not need to decrypt it */ len = sizeof(struct ip6_hdr) + EXTRACT_16BITS(&ip6->ip6_plen); /* see if we can find the SA, and if so, decode it */ for (sa = ndo->ndo_sa_list_head; sa != NULL; sa = sa->next) { struct sockaddr_in6 *sin6 = (struct sockaddr_in6 *)&sa->daddr; if (sa->spi == ntohl(esp->esp_spi) && sin6->sin6_family == AF_INET6 && memcmp(&sin6->sin6_addr, &ip6->ip6_dst, sizeof(struct in6_addr)) == 0) { break; } } break; #endif /*INET6*/ case 4: /* nexthdr & padding are in the last fragment */ if (EXTRACT_16BITS(&ip->ip_off) & IP_MF) goto fail; len = EXTRACT_16BITS(&ip->ip_len); /* see if we can find the SA, and if so, decode it */ for (sa = ndo->ndo_sa_list_head; sa != NULL; sa = sa->next) { struct sockaddr_in *sin = (struct sockaddr_in *)&sa->daddr; if (sa->spi == ntohl(esp->esp_spi) && sin->sin_family == AF_INET && sin->sin_addr.s_addr == ip->ip_dst.s_addr) { break; } } break; default: goto fail; } /* if we didn't find the specific one, then look for * an unspecified one. */ if (sa == NULL) sa = ndo->ndo_sa_default; /* if not found fail */ if (sa == NULL) goto fail; /* if we can't get nexthdr, we do not need to decrypt it */ if (ep - bp2 < len) goto fail; if (ep - bp2 > len) { /* FCS included at end of frame (NetBSD 1.6 or later) */ ep = bp2 + len; } ivoff = (u_char *)(esp + 1) + 0; ivlen = sa->ivlen; secret = sa->secret; espsecret_keylen = sa->secretlen; ep = ep - sa->authlen; if (sa->evp) { memset(&ctx, 0, sizeof(ctx)); if (EVP_CipherInit(&ctx, sa->evp, secret, NULL, 0) < 0) (*ndo->ndo_warning)(ndo, "espkey init failed"); blocksz = EVP_CIPHER_CTX_block_size(&ctx); p = ivoff; EVP_CipherInit(&ctx, NULL, NULL, p, 0); EVP_Cipher(&ctx, p + ivlen, p + ivlen, ep - (p + ivlen)); advance = ivoff - (u_char *)esp + ivlen; } else advance = sizeof(struct newesp); /* sanity check for pad length */ if (ep - bp < *(ep - 2)) goto fail; if (padlen) *padlen = *(ep - 2) + 2; if (nhdr) *nhdr = *(ep - 1); (ndo->ndo_printf)(ndo, ": "); return advance; #endif fail: return -1; } /* * Local Variables: * c-style: whitesmith * c-basic-offset: 8 * End: */ tcpdump-3.9.8/./Makefile.in0000644000026300017500000001545710676336430013557 0ustar mcrmcr# Copyright (c) 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997 # The Regents of the University of California. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that: (1) source code distributions # retain the above copyright notice and this paragraph in its entirety, (2) # distributions including binary code include the above copyright notice and # this paragraph in its entirety in the documentation or other materials # provided with the distribution, and (3) all advertising materials mentioning # features or use of this software display the following acknowledgement: # ``This product includes software developed by the University of California, # Lawrence Berkeley Laboratory and its contributors.'' Neither the name of # the University nor the names of its contributors may be used to endorse # or promote products derived from this software without specific prior # written permission. # THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED # WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF # MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. # # @(#) $Header: /tcpdump/master/tcpdump/Makefile.in,v 1.293.2.7 2007/09/12 19:48:50 guy Exp $ (LBL) # # Various configurable paths (remember to edit Makefile.in, not Makefile) # # Top level hierarchy prefix = @prefix@ exec_prefix = @exec_prefix@ # Pathname of directory to install the binary sbindir = @sbindir@ # Pathname of directory to install the man page mandir = @mandir@ # VPATH srcdir = @srcdir@ VPATH = @srcdir@ # # You shouldn't need to edit anything below here. # CC = @CC@ PROG = tcpdump CCOPT = @V_CCOPT@ INCLS = -I. @V_INCLS@ DEFS = @DEFS@ @CPPFLAGS@ @V_DEFS@ # Standard CFLAGS CFLAGS = $(CCOPT) $(DEFS) $(INCLS) # Standard LDFLAGS LDFLAGS = @LDFLAGS@ # Standard LIBS LIBS = @LIBS@ INSTALL = @INSTALL@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_DATA = @INSTALL_DATA@ # Explicitly define compilation rule since SunOS 4's make doesn't like gcc. # Also, gcc does not remove the .o before forking 'as', which can be a # problem if you don't own the file but can write to the directory. .c.o: @rm -f $@ $(CC) $(CFLAGS) -c $(srcdir)/$*.c CSRC = addrtoname.c af.c cpack.c gmpls.c oui.c gmt2local.c ipproto.c \ nlpid.c l2vpn.c machdep.c parsenfsfh.c \ print-802_11.c print-ap1394.c print-ah.c print-arcnet.c \ print-aodv.c print-arp.c print-ascii.c print-atalk.c print-atm.c \ print-beep.c print-bfd.c print-bgp.c print-bootp.c print-cdp.c \ print-chdlc.c print-cip.c print-cnfp.c print-dccp.c print-decnet.c \ print-domain.c print-dvmrp.c print-enc.c print-egp.c \ print-eap.c print-eigrp.c\ print-esp.c print-ether.c print-fddi.c print-fr.c \ print-gre.c print-hsrp.c print-icmp.c print-igmp.c \ print-igrp.c print-ip.c print-ipcomp.c print-ipfc.c \ print-ipx.c print-isakmp.c print-isoclns.c print-juniper.c print-krb.c \ print-l2tp.c print-lane.c print-ldp.c print-llc.c \ print-lmp.c print-lspping.c \ print-lwres.c print-mobile.c print-mpls.c print-msdp.c \ print-nfs.c print-ntp.c print-null.c print-olsr.c print-ospf.c \ print-pgm.c print-pim.c print-ppp.c print-pppoe.c \ print-pptp.c print-radius.c print-raw.c print-rip.c \ print-rsvp.c print-rx.c print-sctp.c print-sip.c print-sl.c print-sll.c \ print-slow.c print-snmp.c print-stp.c print-sunatm.c print-sunrpc.c \ print-symantec.c print-syslog.c print-tcp.c print-telnet.c print-tftp.c \ print-timed.c print-token.c print-udp.c print-vjc.c print-vrrp.c \ print-wb.c print-zephyr.c setsignal.c tcpdump.c util.c LOCALSRC = @LOCALSRC@ GENSRC = version.c LIBOBJS = @LIBOBJS@ SRC = $(CSRC) $(GENSRC) $(LOCALSRC) # We would like to say "OBJ = $(SRC:.c=.o)" but Ultrix's make cannot # hack the extra indirection OBJ = $(CSRC:.c=.o) $(GENSRC:.c=.o) $(LOCALSRC:.c=.o) $(LIBOBJS) HDR = addrtoname.h appletalk.h bootp.h cpack.h dccp.h decnet.h \ ethertype.h extract.h fddi.h gmt2local.h igrp.h interface.h \ ipx.h llc.h machdep.h mib.h nfsfh.h nfsv2.h ntp.h ospf.h \ setsignal.h \ gnuc.h ipsec_doi.h isakmp.h l2tp.h nameser.h \ netbios.h oakley.h ospf6.h pf.h ppp.h route6d.h TAGHDR = \ /usr/include/arpa/tftp.h \ /usr/include/net/if_arp.h \ /usr/include/net/slip.h \ /usr/include/netinet/if_ether.h \ /usr/include/netinet/in.h \ /usr/include/netinet/ip_icmp.h \ /usr/include/netinet/tcp.h \ /usr/include/netinet/udp.h \ /usr/include/protocols/routed.h TAGFILES = $(SRC) $(HDR) $(TAGHDR) CLEANFILES = $(PROG) $(OBJ) $(GENSRC) all: $(PROG) $(PROG): $(OBJ) @V_PCAPDEP@ @rm -f $@ $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(OBJ) $(LIBS) datalinks.o: $(srcdir)/missing/datalinks.c $(CC) $(CFLAGS) -o $@ -c $(srcdir)/missing/datalinks.c dlnames.o: $(srcdir)/missing/dlnames.c $(CC) $(CFLAGS) -o $@ -c $(srcdir)/missing/dlnames.c getnameinfo.o: $(srcdir)/missing/getnameinfo.c $(CC) $(CFLAGS) -o $@ -c $(srcdir)/missing/getnameinfo.c getaddrinfo.o: $(srcdir)/missing/getaddrinfo.c $(CC) $(CFLAGS) -o $@ -c $(srcdir)/missing/getaddrinfo.c inet_pton.o: $(srcdir)/missing/inet_pton.c $(CC) $(CFLAGS) -o $@ -c $(srcdir)/missing/inet_pton.c inet_ntop.o: $(srcdir)/missing/inet_ntop.c $(CC) $(CFLAGS) -o $@ -c $(srcdir)/missing/inet_ntop.c inet_aton.o: $(srcdir)/missing/inet_aton.c $(CC) $(CFLAGS) -o $@ -c $(srcdir)/missing/inet_aton.c snprintf.o: $(srcdir)/missing/snprintf.c $(CC) $(CFLAGS) -o $@ -c $(srcdir)/missing/snprintf.c strlcat.o: $(srcdir)/missing/strlcat.c $(CC) $(CFLAGS) -o $@ -c $(srcdir)/missing/strlcat.c strlcpy.o: $(srcdir)/missing/strlcpy.c $(CC) $(CFLAGS) -o $@ -c $(srcdir)/missing/strlcpy.c strsep.o: $(srcdir)/missing/strsep.c $(CC) $(CFLAGS) -o $@ -c $(srcdir)/missing/strsep.c version.o: version.c $(CC) $(CFLAGS) -c version.c version.c: $(srcdir)/VERSION @rm -f $@ sed -e 's/.*/char version[] = "&";/' $(srcdir)/VERSION > $@ install: [ -d $(DESTDIR)$(sbindir) ] || \ (mkdir -p $(DESTDIR)$(sbindir); chmod 755 $(DESTDIR)$(sbindir)) $(INSTALL_PROGRAM) $(PROG) $(DESTDIR)$(sbindir)/$(PROG) [ -d $(DESTDIR)$(mandir)/man1 ] || \ (mkdir -p $(DESTDIR)$(mandir)/man1; chmod 755 $(DESTDIR)$(mandir)/man1) $(INSTALL_DATA) $(srcdir)/$(PROG).1 $(DESTDIR)$(mandir)/man1/$(PROG).1 uninstall: rm -f $(DESTDIR)$(sbindir)/$(PROG) rm -f $(DESTDIR)$(mandir)/man1/$(PROG).1 lint: $(GENSRC) lint -hbxn $(SRC) | \ grep -v 'struct/union .* never defined' | \ grep -v 'possible pointer alignment problem' clean: rm -f $(CLEANFILES) distclean: rm -f $(CLEANFILES) Makefile config.cache config.log config.status \ config.h gnuc.h os-proto.h stamp-h stamp-h.in tags: $(TAGFILES) ctags -wtd $(TAGFILES) releasetar: @cwd=`pwd` ; dir=`basename $$cwd` ; name=$(PROG)-`cat VERSION` ; \ list="" ; make distclean; cd ..; mkdir -p n; cd n; ln -s ../$$dir $$name; \ tar -c -z -f $$name.tar.gz $$name/. ; depend: $(GENSRC) ${srcdir}/mkdep -c $(CC) $(DEFS) $(INCLS) $(SRC) tcpdump-3.9.8/./pcap-missing.h0000644000026300017500000000357710262571730014250 0ustar mcrmcr/* * Copyright (c) 1988-2002 * The Regents of the University of California. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that: (1) source code distributions * retain the above copyright notice and this paragraph in its entirety, (2) * distributions including binary code include the above copyright notice and * this paragraph in its entirety in the documentation or other materials * provided with the distribution, and (3) all advertising materials mentioning * features or use of this software display the following acknowledgement: * ``This product includes software developed by the University of California, * Lawrence Berkeley Laboratory and its contributors.'' Neither the name of * the University nor the names of its contributors may be used to endorse * or promote products derived from this software without specific prior * written permission. * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * * @(#) $Header: /tcpdump/master/tcpdump/pcap-missing.h,v 1.2.2.1 2005/06/03 22:10:16 guy Exp $ (LBL) */ #ifndef tcpdump_pcap_missing_h #define tcpdump_pcap_missing_h /* * Declarations of functions that might be missing from libpcap. */ #ifndef HAVE_PCAP_LIST_DATALINKS extern int pcap_list_datalinks(pcap_t *, int **); #endif #ifndef HAVE_PCAP_DATALINK_NAME_TO_VAL /* * We assume no platform has one but not the other. */ extern int pcap_datalink_name_to_val(const char *); extern const char *pcap_datalink_val_to_name(int); #endif #ifndef HAVE_PCAP_DATALINK_VAL_TO_DESCRIPTION extern const char *pcap_datalink_val_to_description(int); #endif #ifndef HAVE_PCAP_DUMP_FTELL extern long pcap_dump_ftell(pcap_dumper_t *); #endif #endif tcpdump-3.9.8/./print-rx.c0000644000026300017500000015300410643174115013422 0ustar mcrmcr/* * Copyright: (c) 2000 United States Government as represented by the * Secretary of the Navy. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in * the documentation and/or other materials provided with the * distribution. * 3. The names of the authors may not be used to endorse or promote * products derived from this software without specific prior * written permission. * * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. */ /* * This code unmangles RX packets. RX is the mutant form of RPC that AFS * uses to communicate between clients and servers. * * In this code, I mainly concern myself with decoding the AFS calls, not * with the guts of RX, per se. * * Bah. If I never look at rx_packet.h again, it will be too soon. * * Ken Hornstein */ #ifndef lint static const char rcsid[] _U_ = "@(#) $Header: /tcpdump/master/tcpdump/print-rx.c,v 1.37.2.2 2007/06/15 19:43:15 guy Exp $"; #endif #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include #include #include "interface.h" #include "addrtoname.h" #include "extract.h" #include "rx.h" #include "ip.h" static struct tok rx_types[] = { { RX_PACKET_TYPE_DATA, "data" }, { RX_PACKET_TYPE_ACK, "ack" }, { RX_PACKET_TYPE_BUSY, "busy" }, { RX_PACKET_TYPE_ABORT, "abort" }, { RX_PACKET_TYPE_ACKALL, "ackall" }, { RX_PACKET_TYPE_CHALLENGE, "challenge" }, { RX_PACKET_TYPE_RESPONSE, "response" }, { RX_PACKET_TYPE_DEBUG, "debug" }, { RX_PACKET_TYPE_PARAMS, "params" }, { RX_PACKET_TYPE_VERSION, "version" }, { 0, NULL }, }; static struct double_tok { int flag; /* Rx flag */ int packetType; /* Packet type */ const char *s; /* Flag string */ } rx_flags[] = { { RX_CLIENT_INITIATED, 0, "client-init" }, { RX_REQUEST_ACK, 0, "req-ack" }, { RX_LAST_PACKET, 0, "last-pckt" }, { RX_MORE_PACKETS, 0, "more-pckts" }, { RX_FREE_PACKET, 0, "free-pckt" }, { RX_SLOW_START_OK, RX_PACKET_TYPE_ACK, "slow-start" }, { RX_JUMBO_PACKET, RX_PACKET_TYPE_DATA, "jumbogram" } }; static struct tok fs_req[] = { { 130, "fetch-data" }, { 131, "fetch-acl" }, { 132, "fetch-status" }, { 133, "store-data" }, { 134, "store-acl" }, { 135, "store-status" }, { 136, "remove-file" }, { 137, "create-file" }, { 138, "rename" }, { 139, "symlink" }, { 140, "link" }, { 141, "makedir" }, { 142, "rmdir" }, { 143, "oldsetlock" }, { 144, "oldextlock" }, { 145, "oldrellock" }, { 146, "get-stats" }, { 147, "give-cbs" }, { 148, "get-vlinfo" }, { 149, "get-vlstats" }, { 150, "set-vlstats" }, { 151, "get-rootvl" }, { 152, "check-token" }, { 153, "get-time" }, { 154, "nget-vlinfo" }, { 155, "bulk-stat" }, { 156, "setlock" }, { 157, "extlock" }, { 158, "rellock" }, { 159, "xstat-ver" }, { 160, "get-xstat" }, { 161, "dfs-lookup" }, { 162, "dfs-flushcps" }, { 163, "dfs-symlink" }, { 220, "residency" }, { 0, NULL }, }; static struct tok cb_req[] = { { 204, "callback" }, { 205, "initcb" }, { 206, "probe" }, { 207, "getlock" }, { 208, "getce" }, { 209, "xstatver" }, { 210, "getxstat" }, { 211, "initcb2" }, { 212, "whoareyou" }, { 213, "initcb3" }, { 214, "probeuuid" }, { 215, "getsrvprefs" }, { 216, "getcellservdb" }, { 217, "getlocalcell" }, { 218, "getcacheconf" }, { 0, NULL }, }; static struct tok pt_req[] = { { 500, "new-user" }, { 501, "where-is-it" }, { 502, "dump-entry" }, { 503, "add-to-group" }, { 504, "name-to-id" }, { 505, "id-to-name" }, { 506, "delete" }, { 507, "remove-from-group" }, { 508, "get-cps" }, { 509, "new-entry" }, { 510, "list-max" }, { 511, "set-max" }, { 512, "list-entry" }, { 513, "change-entry" }, { 514, "list-elements" }, { 515, "same-mbr-of" }, { 516, "set-fld-sentry" }, { 517, "list-owned" }, { 518, "get-cps2" }, { 519, "get-host-cps" }, { 520, "update-entry" }, { 521, "list-entries" }, { 0, NULL }, }; static struct tok vldb_req[] = { { 501, "create-entry" }, { 502, "delete-entry" }, { 503, "get-entry-by-id" }, { 504, "get-entry-by-name" }, { 505, "get-new-volume-id" }, { 506, "replace-entry" }, { 507, "update-entry" }, { 508, "setlock" }, { 509, "releaselock" }, { 510, "list-entry" }, { 511, "list-attrib" }, { 512, "linked-list" }, { 513, "get-stats" }, { 514, "probe" }, { 515, "get-addrs" }, { 516, "change-addr" }, { 517, "create-entry-n" }, { 518, "get-entry-by-id-n" }, { 519, "get-entry-by-name-n" }, { 520, "replace-entry-n" }, { 521, "list-entry-n" }, { 522, "list-attrib-n" }, { 523, "linked-list-n" }, { 524, "update-entry-by-name" }, { 525, "create-entry-u" }, { 526, "get-entry-by-id-u" }, { 527, "get-entry-by-name-u" }, { 528, "replace-entry-u" }, { 529, "list-entry-u" }, { 530, "list-attrib-u" }, { 531, "linked-list-u" }, { 532, "regaddr" }, { 533, "get-addrs-u" }, { 534, "list-attrib-n2" }, { 0, NULL }, }; static struct tok kauth_req[] = { { 1, "auth-old" }, { 21, "authenticate" }, { 22, "authenticate-v2" }, { 2, "change-pw" }, { 3, "get-ticket-old" }, { 23, "get-ticket" }, { 4, "set-pw" }, { 5, "set-fields" }, { 6, "create-user" }, { 7, "delete-user" }, { 8, "get-entry" }, { 9, "list-entry" }, { 10, "get-stats" }, { 11, "debug" }, { 12, "get-pw" }, { 13, "get-random-key" }, { 14, "unlock" }, { 15, "lock-status" }, { 0, NULL }, }; static struct tok vol_req[] = { { 100, "create-volume" }, { 101, "delete-volume" }, { 102, "restore" }, { 103, "forward" }, { 104, "end-trans" }, { 105, "clone" }, { 106, "set-flags" }, { 107, "get-flags" }, { 108, "trans-create" }, { 109, "dump" }, { 110, "get-nth-volume" }, { 111, "set-forwarding" }, { 112, "get-name" }, { 113, "get-status" }, { 114, "sig-restore" }, { 115, "list-partitions" }, { 116, "list-volumes" }, { 117, "set-id-types" }, { 118, "monitor" }, { 119, "partition-info" }, { 120, "reclone" }, { 121, "list-one-volume" }, { 122, "nuke" }, { 123, "set-date" }, { 124, "x-list-volumes" }, { 125, "x-list-one-volume" }, { 126, "set-info" }, { 127, "x-list-partitions" }, { 128, "forward-multiple" }, { 0, NULL }, }; static struct tok bos_req[] = { { 80, "create-bnode" }, { 81, "delete-bnode" }, { 82, "set-status" }, { 83, "get-status" }, { 84, "enumerate-instance" }, { 85, "get-instance-info" }, { 86, "get-instance-parm" }, { 87, "add-superuser" }, { 88, "delete-superuser" }, { 89, "list-superusers" }, { 90, "list-keys" }, { 91, "add-key" }, { 92, "delete-key" }, { 93, "set-cell-name" }, { 94, "get-cell-name" }, { 95, "get-cell-host" }, { 96, "add-cell-host" }, { 97, "delete-cell-host" }, { 98, "set-t-status" }, { 99, "shutdown-all" }, { 100, "restart-all" }, { 101, "startup-all" }, { 102, "set-noauth-flag" }, { 103, "re-bozo" }, { 104, "restart" }, { 105, "start-bozo-install" }, { 106, "uninstall" }, { 107, "get-dates" }, { 108, "exec" }, { 109, "prune" }, { 110, "set-restart-time" }, { 111, "get-restart-time" }, { 112, "start-bozo-log" }, { 113, "wait-all" }, { 114, "get-instance-strings" }, { 115, "get-restricted" }, { 116, "set-restricted" }, { 0, NULL }, }; static struct tok ubik_req[] = { { 10000, "vote-beacon" }, { 10001, "vote-debug-old" }, { 10002, "vote-sdebug-old" }, { 10003, "vote-getsyncsite" }, { 10004, "vote-debug" }, { 10005, "vote-sdebug" }, { 20000, "disk-begin" }, { 20001, "disk-commit" }, { 20002, "disk-lock" }, { 20003, "disk-write" }, { 20004, "disk-getversion" }, { 20005, "disk-getfile" }, { 20006, "disk-sendfile" }, { 20007, "disk-abort" }, { 20008, "disk-releaselocks" }, { 20009, "disk-truncate" }, { 20010, "disk-probe" }, { 20011, "disk-writev" }, { 20012, "disk-interfaceaddr" }, { 20013, "disk-setversion" }, { 0, NULL }, }; #define VOTE_LOW 10000 #define VOTE_HIGH 10005 #define DISK_LOW 20000 #define DISK_HIGH 20013 static struct tok cb_types[] = { { 1, "exclusive" }, { 2, "shared" }, { 3, "dropped" }, { 0, NULL }, }; static struct tok ubik_lock_types[] = { { 1, "read" }, { 2, "write" }, { 3, "wait" }, { 0, NULL }, }; static const char *voltype[] = { "read-write", "read-only", "backup" }; static struct tok afs_fs_errors[] = { { 101, "salvage volume" }, { 102, "no such vnode" }, { 103, "no such volume" }, { 104, "volume exist" }, { 105, "no service" }, { 106, "volume offline" }, { 107, "voline online" }, { 108, "diskfull" }, { 109, "diskquota exceeded" }, { 110, "volume busy" }, { 111, "volume moved" }, { 112, "AFS IO error" }, { -100, "restarting fileserver" }, { 0, NULL } }; /* * Reasons for acknowledging a packet */ static struct tok rx_ack_reasons[] = { { 1, "ack requested" }, { 2, "duplicate packet" }, { 3, "out of sequence" }, { 4, "exceeds window" }, { 5, "no buffer space" }, { 6, "ping" }, { 7, "ping response" }, { 8, "delay" }, { 9, "idle" }, { 0, NULL }, }; /* * Cache entries we keep around so we can figure out the RX opcode * numbers for replies. This allows us to make sense of RX reply packets. */ struct rx_cache_entry { u_int32_t callnum; /* Call number (net order) */ struct in_addr client; /* client IP address (net order) */ struct in_addr server; /* server IP address (net order) */ int dport; /* server port (host order) */ u_short serviceId; /* Service identifier (net order) */ u_int32_t opcode; /* RX opcode (host order) */ }; #define RX_CACHE_SIZE 64 static struct rx_cache_entry rx_cache[RX_CACHE_SIZE]; static int rx_cache_next = 0; static int rx_cache_hint = 0; static void rx_cache_insert(const u_char *, const struct ip *, int); static int rx_cache_find(const struct rx_header *, const struct ip *, int, int32_t *); static void fs_print(const u_char *, int); static void fs_reply_print(const u_char *, int, int32_t); static void acl_print(u_char *, int, u_char *); static void cb_print(const u_char *, int); static void cb_reply_print(const u_char *, int, int32_t); static void prot_print(const u_char *, int); static void prot_reply_print(const u_char *, int, int32_t); static void vldb_print(const u_char *, int); static void vldb_reply_print(const u_char *, int, int32_t); static void kauth_print(const u_char *, int); static void kauth_reply_print(const u_char *, int, int32_t); static void vol_print(const u_char *, int); static void vol_reply_print(const u_char *, int, int32_t); static void bos_print(const u_char *, int); static void bos_reply_print(const u_char *, int, int32_t); static void ubik_print(const u_char *); static void ubik_reply_print(const u_char *, int, int32_t); static void rx_ack_print(const u_char *, int); static int is_ubik(u_int32_t); /* * Handle the rx-level packet. See if we know what port it's going to so * we can peek at the afs call inside */ void rx_print(register const u_char *bp, int length, int sport, int dport, u_char *bp2) { register struct rx_header *rxh; int i; int32_t opcode; if (snapend - bp < (int)sizeof (struct rx_header)) { printf(" [|rx] (%d)", length); return; } rxh = (struct rx_header *) bp; printf(" rx %s", tok2str(rx_types, "type %d", rxh->type)); if (vflag) { int firstflag = 0; if (vflag > 1) printf(" cid %08x call# %d", (int) EXTRACT_32BITS(&rxh->cid), (int) EXTRACT_32BITS(&rxh->callNumber)); printf(" seq %d ser %d", (int) EXTRACT_32BITS(&rxh->seq), (int) EXTRACT_32BITS(&rxh->serial)); if (vflag > 2) printf(" secindex %d serviceid %hu", (int) rxh->securityIndex, EXTRACT_16BITS(&rxh->serviceId)); if (vflag > 1) for (i = 0; i < NUM_RX_FLAGS; i++) { if (rxh->flags & rx_flags[i].flag && (!rx_flags[i].packetType || rxh->type == rx_flags[i].packetType)) { if (!firstflag) { firstflag = 1; printf(" "); } else { printf(","); } printf("<%s>", rx_flags[i].s); } } } /* * Try to handle AFS calls that we know about. Check the destination * port and make sure it's a data packet. Also, make sure the * seq number is 1 (because otherwise it's a continuation packet, * and we can't interpret that). Also, seems that reply packets * do not have the client-init flag set, so we check for that * as well. */ if (rxh->type == RX_PACKET_TYPE_DATA && EXTRACT_32BITS(&rxh->seq) == 1 && rxh->flags & RX_CLIENT_INITIATED) { /* * Insert this call into the call cache table, so we * have a chance to print out replies */ rx_cache_insert(bp, (const struct ip *) bp2, dport); switch (dport) { case FS_RX_PORT: /* AFS file service */ fs_print(bp, length); break; case CB_RX_PORT: /* AFS callback service */ cb_print(bp, length); break; case PROT_RX_PORT: /* AFS protection service */ prot_print(bp, length); break; case VLDB_RX_PORT: /* AFS VLDB service */ vldb_print(bp, length); break; case KAUTH_RX_PORT: /* AFS Kerberos auth service */ kauth_print(bp, length); break; case VOL_RX_PORT: /* AFS Volume service */ vol_print(bp, length); break; case BOS_RX_PORT: /* AFS BOS service */ bos_print(bp, length); break; default: ; } /* * If it's a reply (client-init is _not_ set, but seq is one) * then look it up in the cache. If we find it, call the reply * printing functions Note that we handle abort packets here, * because printing out the return code can be useful at times. */ } else if (((rxh->type == RX_PACKET_TYPE_DATA && EXTRACT_32BITS(&rxh->seq) == 1) || rxh->type == RX_PACKET_TYPE_ABORT) && (rxh->flags & RX_CLIENT_INITIATED) == 0 && rx_cache_find(rxh, (const struct ip *) bp2, sport, &opcode)) { switch (sport) { case FS_RX_PORT: /* AFS file service */ fs_reply_print(bp, length, opcode); break; case CB_RX_PORT: /* AFS callback service */ cb_reply_print(bp, length, opcode); break; case PROT_RX_PORT: /* AFS PT service */ prot_reply_print(bp, length, opcode); break; case VLDB_RX_PORT: /* AFS VLDB service */ vldb_reply_print(bp, length, opcode); break; case KAUTH_RX_PORT: /* AFS Kerberos auth service */ kauth_reply_print(bp, length, opcode); break; case VOL_RX_PORT: /* AFS Volume service */ vol_reply_print(bp, length, opcode); break; case BOS_RX_PORT: /* AFS BOS service */ bos_reply_print(bp, length, opcode); break; default: ; } /* * If it's an RX ack packet, then use the appropriate ack decoding * function (there isn't any service-specific information in the * ack packet, so we can use one for all AFS services) */ } else if (rxh->type == RX_PACKET_TYPE_ACK) rx_ack_print(bp, length); printf(" (%d)", length); } /* * Insert an entry into the cache. Taken from print-nfs.c */ static void rx_cache_insert(const u_char *bp, const struct ip *ip, int dport) { struct rx_cache_entry *rxent; const struct rx_header *rxh = (const struct rx_header *) bp; if (snapend - bp + 1 <= (int)(sizeof(struct rx_header) + sizeof(int32_t))) return; rxent = &rx_cache[rx_cache_next]; if (++rx_cache_next >= RX_CACHE_SIZE) rx_cache_next = 0; rxent->callnum = rxh->callNumber; rxent->client = ip->ip_src; rxent->server = ip->ip_dst; rxent->dport = dport; rxent->serviceId = rxh->serviceId; rxent->opcode = EXTRACT_32BITS(bp + sizeof(struct rx_header)); } /* * Lookup an entry in the cache. Also taken from print-nfs.c * * Note that because this is a reply, we're looking at the _source_ * port. */ static int rx_cache_find(const struct rx_header *rxh, const struct ip *ip, int sport, int32_t *opcode) { int i; struct rx_cache_entry *rxent; u_int32_t clip = ip->ip_dst.s_addr; u_int32_t sip = ip->ip_src.s_addr; /* Start the search where we last left off */ i = rx_cache_hint; do { rxent = &rx_cache[i]; if (rxent->callnum == rxh->callNumber && rxent->client.s_addr == clip && rxent->server.s_addr == sip && rxent->serviceId == rxh->serviceId && rxent->dport == sport) { /* We got a match! */ rx_cache_hint = i; *opcode = rxent->opcode; return(1); } if (++i > RX_CACHE_SIZE) i = 0; } while (i != rx_cache_hint); /* Our search failed */ return(0); } /* * These extrememly grody macros handle the printing of various AFS stuff. */ #define FIDOUT() { unsigned long n1, n2, n3; \ TCHECK2(bp[0], sizeof(int32_t) * 3); \ n1 = EXTRACT_32BITS(bp); \ bp += sizeof(int32_t); \ n2 = EXTRACT_32BITS(bp); \ bp += sizeof(int32_t); \ n3 = EXTRACT_32BITS(bp); \ bp += sizeof(int32_t); \ printf(" fid %d/%d/%d", (int) n1, (int) n2, (int) n3); \ } #define STROUT(MAX) { unsigned int i; \ TCHECK2(bp[0], sizeof(int32_t)); \ i = EXTRACT_32BITS(bp); \ if (i > (MAX)) \ goto trunc; \ bp += sizeof(int32_t); \ printf(" \""); \ if (fn_printn(bp, i, snapend)) \ goto trunc; \ printf("\""); \ bp += ((i + sizeof(int32_t) - 1) / sizeof(int32_t)) * sizeof(int32_t); \ } #define INTOUT() { int i; \ TCHECK2(bp[0], sizeof(int32_t)); \ i = (int) EXTRACT_32BITS(bp); \ bp += sizeof(int32_t); \ printf(" %d", i); \ } #define UINTOUT() { unsigned long i; \ TCHECK2(bp[0], sizeof(int32_t)); \ i = EXTRACT_32BITS(bp); \ bp += sizeof(int32_t); \ printf(" %lu", i); \ } #define DATEOUT() { time_t t; struct tm *tm; char str[256]; \ TCHECK2(bp[0], sizeof(int32_t)); \ t = (time_t) EXTRACT_32BITS(bp); \ bp += sizeof(int32_t); \ tm = localtime(&t); \ strftime(str, 256, "%Y/%m/%d %T", tm); \ printf(" %s", str); \ } #define STOREATTROUT() { unsigned long mask, i; \ TCHECK2(bp[0], (sizeof(int32_t)*6)); \ mask = EXTRACT_32BITS(bp); bp += sizeof(int32_t); \ if (mask) printf (" StoreStatus"); \ if (mask & 1) { printf(" date"); DATEOUT(); } \ else bp += sizeof(int32_t); \ i = EXTRACT_32BITS(bp); bp += sizeof(int32_t); \ if (mask & 2) printf(" owner %lu", i); \ i = EXTRACT_32BITS(bp); bp += sizeof(int32_t); \ if (mask & 4) printf(" group %lu", i); \ i = EXTRACT_32BITS(bp); bp += sizeof(int32_t); \ if (mask & 8) printf(" mode %lo", i & 07777); \ i = EXTRACT_32BITS(bp); bp += sizeof(int32_t); \ if (mask & 16) printf(" segsize %lu", i); \ /* undocumented in 3.3 docu */ \ if (mask & 1024) printf(" fsync"); \ } #define UBIK_VERSIONOUT() {int32_t epoch; int32_t counter; \ TCHECK2(bp[0], sizeof(int32_t) * 2); \ epoch = EXTRACT_32BITS(bp); \ bp += sizeof(int32_t); \ counter = EXTRACT_32BITS(bp); \ bp += sizeof(int32_t); \ printf(" %d.%d", epoch, counter); \ } #define AFSUUIDOUT() {u_int32_t temp; int i; \ TCHECK2(bp[0], 11*sizeof(u_int32_t)); \ temp = EXTRACT_32BITS(bp); \ bp += sizeof(u_int32_t); \ printf(" %08x", temp); \ temp = EXTRACT_32BITS(bp); \ bp += sizeof(u_int32_t); \ printf("%04x", temp); \ temp = EXTRACT_32BITS(bp); \ bp += sizeof(u_int32_t); \ printf("%04x", temp); \ for (i = 0; i < 8; i++) { \ temp = EXTRACT_32BITS(bp); \ bp += sizeof(u_int32_t); \ printf("%02x", (unsigned char) temp); \ } \ } /* * This is the sickest one of all */ #define VECOUT(MAX) { u_char *sp; \ u_char s[AFSNAMEMAX]; \ int k; \ if ((MAX) + 1 > sizeof(s)) \ goto trunc; \ TCHECK2(bp[0], (MAX) * sizeof(int32_t)); \ sp = s; \ for (k = 0; k < (MAX); k++) { \ *sp++ = (u_char) EXTRACT_32BITS(bp); \ bp += sizeof(int32_t); \ } \ s[(MAX)] = '\0'; \ printf(" \""); \ fn_print(s, NULL); \ printf("\""); \ } /* * Handle calls to the AFS file service (fs) */ static void fs_print(register const u_char *bp, int length) { int fs_op; unsigned long i; if (length <= (int)sizeof(struct rx_header)) return; if (snapend - bp + 1 <= (int)(sizeof(struct rx_header) + sizeof(int32_t))) { goto trunc; } /* * Print out the afs call we're invoking. The table used here was * gleaned from fsint/afsint.xg */ fs_op = EXTRACT_32BITS(bp + sizeof(struct rx_header)); printf(" fs call %s", tok2str(fs_req, "op#%d", fs_op)); /* * Print out arguments to some of the AFS calls. This stuff is * all from afsint.xg */ bp += sizeof(struct rx_header) + 4; /* * Sigh. This is gross. Ritchie forgive me. */ switch (fs_op) { case 130: /* Fetch data */ FIDOUT(); printf(" offset"); UINTOUT(); printf(" length"); UINTOUT(); break; case 131: /* Fetch ACL */ case 132: /* Fetch Status */ case 143: /* Old set lock */ case 144: /* Old extend lock */ case 145: /* Old release lock */ case 156: /* Set lock */ case 157: /* Extend lock */ case 158: /* Release lock */ FIDOUT(); break; case 135: /* Store status */ FIDOUT(); STOREATTROUT(); break; case 133: /* Store data */ FIDOUT(); STOREATTROUT(); printf(" offset"); UINTOUT(); printf(" length"); UINTOUT(); printf(" flen"); UINTOUT(); break; case 134: /* Store ACL */ { char a[AFSOPAQUEMAX+1]; FIDOUT(); TCHECK2(bp[0], 4); i = EXTRACT_32BITS(bp); bp += sizeof(int32_t); TCHECK2(bp[0], i); i = min(AFSOPAQUEMAX, i); strncpy(a, (char *) bp, i); a[i] = '\0'; acl_print((u_char *) a, sizeof(a), (u_char *) a + i); break; } case 137: /* Create file */ case 141: /* MakeDir */ FIDOUT(); STROUT(AFSNAMEMAX); STOREATTROUT(); break; case 136: /* Remove file */ case 142: /* Remove directory */ FIDOUT(); STROUT(AFSNAMEMAX); break; case 138: /* Rename file */ printf(" old"); FIDOUT(); STROUT(AFSNAMEMAX); printf(" new"); FIDOUT(); STROUT(AFSNAMEMAX); break; case 139: /* Symlink */ FIDOUT(); STROUT(AFSNAMEMAX); printf(" link to"); STROUT(AFSNAMEMAX); break; case 140: /* Link */ FIDOUT(); STROUT(AFSNAMEMAX); printf(" link to"); FIDOUT(); break; case 148: /* Get volume info */ STROUT(AFSNAMEMAX); break; case 149: /* Get volume stats */ case 150: /* Set volume stats */ printf(" volid"); UINTOUT(); break; case 154: /* New get volume info */ printf(" volname"); STROUT(AFSNAMEMAX); break; case 155: /* Bulk stat */ { unsigned long j; TCHECK2(bp[0], 4); j = EXTRACT_32BITS(bp); bp += sizeof(int32_t); for (i = 0; i < j; i++) { FIDOUT(); if (i != j - 1) printf(","); } if (j == 0) printf(" "); } default: ; } return; trunc: printf(" [|fs]"); } /* * Handle replies to the AFS file service */ static void fs_reply_print(register const u_char *bp, int length, int32_t opcode) { unsigned long i; struct rx_header *rxh; if (length <= (int)sizeof(struct rx_header)) return; rxh = (struct rx_header *) bp; /* * Print out the afs call we're invoking. The table used here was * gleaned from fsint/afsint.xg */ printf(" fs reply %s", tok2str(fs_req, "op#%d", opcode)); bp += sizeof(struct rx_header); /* * If it was a data packet, interpret the response */ if (rxh->type == RX_PACKET_TYPE_DATA) { switch (opcode) { case 131: /* Fetch ACL */ { char a[AFSOPAQUEMAX+1]; TCHECK2(bp[0], 4); i = EXTRACT_32BITS(bp); bp += sizeof(int32_t); TCHECK2(bp[0], i); i = min(AFSOPAQUEMAX, i); strncpy(a, (char *) bp, i); a[i] = '\0'; acl_print((u_char *) a, sizeof(a), (u_char *) a + i); break; } case 137: /* Create file */ case 141: /* MakeDir */ printf(" new"); FIDOUT(); break; case 151: /* Get root volume */ printf(" root volume"); STROUT(AFSNAMEMAX); break; case 153: /* Get time */ DATEOUT(); break; default: ; } } else if (rxh->type == RX_PACKET_TYPE_ABORT) { int i; /* * Otherwise, just print out the return code */ TCHECK2(bp[0], sizeof(int32_t)); i = (int) EXTRACT_32BITS(bp); bp += sizeof(int32_t); printf(" error %s", tok2str(afs_fs_errors, "#%d", i)); } else { printf(" strange fs reply of type %d", rxh->type); } return; trunc: printf(" [|fs]"); } /* * Print out an AFS ACL string. An AFS ACL is a string that has the * following format: * * * * .... * * "positive" and "negative" are integers which contain the number of * positive and negative ACL's in the string. The uid/aclbits pair are * ASCII strings containing the UID/PTS record and and a ascii number * representing a logical OR of all the ACL permission bits */ static void acl_print(u_char *s, int maxsize, u_char *end) { int pos, neg, acl; int n, i; char *user; char fmt[1024]; if ((user = (char *)malloc(maxsize)) == NULL) return; if (sscanf((char *) s, "%d %d\n%n", &pos, &neg, &n) != 2) goto finish; s += n; if (s > end) goto finish; /* * This wacky order preserves the order used by the "fs" command */ #define ACLOUT(acl) \ if (acl & PRSFS_READ) \ printf("r"); \ if (acl & PRSFS_LOOKUP) \ printf("l"); \ if (acl & PRSFS_INSERT) \ printf("i"); \ if (acl & PRSFS_DELETE) \ printf("d"); \ if (acl & PRSFS_WRITE) \ printf("w"); \ if (acl & PRSFS_LOCK) \ printf("k"); \ if (acl & PRSFS_ADMINISTER) \ printf("a"); for (i = 0; i < pos; i++) { snprintf(fmt, sizeof(fmt), "%%%ds %%d\n%%n", maxsize - 1); if (sscanf((char *) s, fmt, user, &acl, &n) != 2) goto finish; s += n; printf(" +{"); fn_print((u_char *)user, NULL); printf(" "); ACLOUT(acl); printf("}"); if (s > end) goto finish; } for (i = 0; i < neg; i++) { snprintf(fmt, sizeof(fmt), "%%%ds %%d\n%%n", maxsize - 1); if (sscanf((char *) s, fmt, user, &acl, &n) != 2) goto finish; s += n; printf(" -{"); fn_print((u_char *)user, NULL); printf(" "); ACLOUT(acl); printf("}"); if (s > end) goto finish; } finish: free(user); return; } #undef ACLOUT /* * Handle calls to the AFS callback service */ static void cb_print(register const u_char *bp, int length) { int cb_op; unsigned long i; if (length <= (int)sizeof(struct rx_header)) return; if (snapend - bp + 1 <= (int)(sizeof(struct rx_header) + sizeof(int32_t))) { goto trunc; } /* * Print out the afs call we're invoking. The table used here was * gleaned from fsint/afscbint.xg */ cb_op = EXTRACT_32BITS(bp + sizeof(struct rx_header)); printf(" cb call %s", tok2str(cb_req, "op#%d", cb_op)); bp += sizeof(struct rx_header) + 4; /* * Print out the afs call we're invoking. The table used here was * gleaned from fsint/afscbint.xg */ switch (cb_op) { case 204: /* Callback */ { unsigned long j, t; TCHECK2(bp[0], 4); j = EXTRACT_32BITS(bp); bp += sizeof(int32_t); for (i = 0; i < j; i++) { FIDOUT(); if (i != j - 1) printf(","); } if (j == 0) printf(" "); j = EXTRACT_32BITS(bp); bp += sizeof(int32_t); if (j != 0) printf(";"); for (i = 0; i < j; i++) { printf(" ver"); INTOUT(); printf(" expires"); DATEOUT(); TCHECK2(bp[0], 4); t = EXTRACT_32BITS(bp); bp += sizeof(int32_t); tok2str(cb_types, "type %d", t); } } case 214: { printf(" afsuuid"); AFSUUIDOUT(); break; } default: ; } return; trunc: printf(" [|cb]"); } /* * Handle replies to the AFS Callback Service */ static void cb_reply_print(register const u_char *bp, int length, int32_t opcode) { struct rx_header *rxh; if (length <= (int)sizeof(struct rx_header)) return; rxh = (struct rx_header *) bp; /* * Print out the afs call we're invoking. The table used here was * gleaned from fsint/afscbint.xg */ printf(" cb reply %s", tok2str(cb_req, "op#%d", opcode)); bp += sizeof(struct rx_header); /* * If it was a data packet, interpret the response. */ if (rxh->type == RX_PACKET_TYPE_DATA) switch (opcode) { case 213: /* InitCallBackState3 */ AFSUUIDOUT(); break; default: ; } else { /* * Otherwise, just print out the return code */ printf(" errcode"); INTOUT(); } return; trunc: printf(" [|cb]"); } /* * Handle calls to the AFS protection database server */ static void prot_print(register const u_char *bp, int length) { unsigned long i; int pt_op; if (length <= (int)sizeof(struct rx_header)) return; if (snapend - bp + 1 <= (int)(sizeof(struct rx_header) + sizeof(int32_t))) { goto trunc; } /* * Print out the afs call we're invoking. The table used here was * gleaned from ptserver/ptint.xg */ pt_op = EXTRACT_32BITS(bp + sizeof(struct rx_header)); printf(" pt"); if (is_ubik(pt_op)) { ubik_print(bp); return; } printf(" call %s", tok2str(pt_req, "op#%d", pt_op)); /* * Decode some of the arguments to the PT calls */ bp += sizeof(struct rx_header) + 4; switch (pt_op) { case 500: /* I New User */ STROUT(PRNAMEMAX); printf(" id"); INTOUT(); printf(" oldid"); INTOUT(); break; case 501: /* Where is it */ case 506: /* Delete */ case 508: /* Get CPS */ case 512: /* List entry */ case 514: /* List elements */ case 517: /* List owned */ case 518: /* Get CPS2 */ case 519: /* Get host CPS */ printf(" id"); INTOUT(); break; case 502: /* Dump entry */ printf(" pos"); INTOUT(); break; case 503: /* Add to group */ case 507: /* Remove from group */ case 515: /* Is a member of? */ printf(" uid"); INTOUT(); printf(" gid"); INTOUT(); break; case 504: /* Name to ID */ { unsigned long j; TCHECK2(bp[0], 4); j = EXTRACT_32BITS(bp); bp += sizeof(int32_t); /* * Who designed this chicken-shit protocol? * * Each character is stored as a 32-bit * integer! */ for (i = 0; i < j; i++) { VECOUT(PRNAMEMAX); } if (j == 0) printf(" "); } break; case 505: /* Id to name */ { unsigned long j; printf(" ids:"); TCHECK2(bp[0], 4); i = EXTRACT_32BITS(bp); bp += sizeof(int32_t); for (j = 0; j < i; j++) INTOUT(); if (j == 0) printf(" "); } break; case 509: /* New entry */ STROUT(PRNAMEMAX); printf(" flag"); INTOUT(); printf(" oid"); INTOUT(); break; case 511: /* Set max */ printf(" id"); INTOUT(); printf(" gflag"); INTOUT(); break; case 513: /* Change entry */ printf(" id"); INTOUT(); STROUT(PRNAMEMAX); printf(" oldid"); INTOUT(); printf(" newid"); INTOUT(); break; case 520: /* Update entry */ printf(" id"); INTOUT(); STROUT(PRNAMEMAX); break; default: ; } return; trunc: printf(" [|pt]"); } /* * Handle replies to the AFS protection service */ static void prot_reply_print(register const u_char *bp, int length, int32_t opcode) { struct rx_header *rxh; unsigned long i; if (length < (int)sizeof(struct rx_header)) return; rxh = (struct rx_header *) bp; /* * Print out the afs call we're invoking. The table used here was * gleaned from ptserver/ptint.xg. Check to see if it's a * Ubik call, however. */ printf(" pt"); if (is_ubik(opcode)) { ubik_reply_print(bp, length, opcode); return; } printf(" reply %s", tok2str(pt_req, "op#%d", opcode)); bp += sizeof(struct rx_header); /* * If it was a data packet, interpret the response */ if (rxh->type == RX_PACKET_TYPE_DATA) switch (opcode) { case 504: /* Name to ID */ { unsigned long j; printf(" ids:"); TCHECK2(bp[0], 4); i = EXTRACT_32BITS(bp); bp += sizeof(int32_t); for (j = 0; j < i; j++) INTOUT(); if (j == 0) printf(" "); } break; case 505: /* ID to name */ { unsigned long j; TCHECK2(bp[0], 4); j = EXTRACT_32BITS(bp); bp += sizeof(int32_t); /* * Who designed this chicken-shit protocol? * * Each character is stored as a 32-bit * integer! */ for (i = 0; i < j; i++) { VECOUT(PRNAMEMAX); } if (j == 0) printf(" "); } break; case 508: /* Get CPS */ case 514: /* List elements */ case 517: /* List owned */ case 518: /* Get CPS2 */ case 519: /* Get host CPS */ { unsigned long j; TCHECK2(bp[0], 4); j = EXTRACT_32BITS(bp); bp += sizeof(int32_t); for (i = 0; i < j; i++) { INTOUT(); } if (j == 0) printf(" "); } break; case 510: /* List max */ printf(" maxuid"); INTOUT(); printf(" maxgid"); INTOUT(); break; default: ; } else { /* * Otherwise, just print out the return code */ printf(" errcode"); INTOUT(); } return; trunc: printf(" [|pt]"); } /* * Handle calls to the AFS volume location database service */ static void vldb_print(register const u_char *bp, int length) { int vldb_op; unsigned long i; if (length <= (int)sizeof(struct rx_header)) return; if (snapend - bp + 1 <= (int)(sizeof(struct rx_header) + sizeof(int32_t))) { goto trunc; } /* * Print out the afs call we're invoking. The table used here was * gleaned from vlserver/vldbint.xg */ vldb_op = EXTRACT_32BITS(bp + sizeof(struct rx_header)); printf(" vldb"); if (is_ubik(vldb_op)) { ubik_print(bp); return; } printf(" call %s", tok2str(vldb_req, "op#%d", vldb_op)); /* * Decode some of the arguments to the VLDB calls */ bp += sizeof(struct rx_header) + 4; switch (vldb_op) { case 501: /* Create new volume */ case 517: /* Create entry N */ VECOUT(VLNAMEMAX); break; case 502: /* Delete entry */ case 503: /* Get entry by ID */ case 507: /* Update entry */ case 508: /* Set lock */ case 509: /* Release lock */ case 518: /* Get entry by ID N */ printf(" volid"); INTOUT(); TCHECK2(bp[0], sizeof(int32_t)); i = EXTRACT_32BITS(bp); bp += sizeof(int32_t); if (i <= 2) printf(" type %s", voltype[i]); break; case 504: /* Get entry by name */ case 519: /* Get entry by name N */ case 524: /* Update entry by name */ case 527: /* Get entry by name U */ STROUT(VLNAMEMAX); break; case 505: /* Get new vol id */ printf(" bump"); INTOUT(); break; case 506: /* Replace entry */ case 520: /* Replace entry N */ printf(" volid"); INTOUT(); TCHECK2(bp[0], sizeof(int32_t)); i = EXTRACT_32BITS(bp); bp += sizeof(int32_t); if (i <= 2) printf(" type %s", voltype[i]); VECOUT(VLNAMEMAX); break; case 510: /* List entry */ case 521: /* List entry N */ printf(" index"); INTOUT(); break; default: ; } return; trunc: printf(" [|vldb]"); } /* * Handle replies to the AFS volume location database service */ static void vldb_reply_print(register const u_char *bp, int length, int32_t opcode) { struct rx_header *rxh; unsigned long i; if (length < (int)sizeof(struct rx_header)) return; rxh = (struct rx_header *) bp; /* * Print out the afs call we're invoking. The table used here was * gleaned from vlserver/vldbint.xg. Check to see if it's a * Ubik call, however. */ printf(" vldb"); if (is_ubik(opcode)) { ubik_reply_print(bp, length, opcode); return; } printf(" reply %s", tok2str(vldb_req, "op#%d", opcode)); bp += sizeof(struct rx_header); /* * If it was a data packet, interpret the response */ if (rxh->type == RX_PACKET_TYPE_DATA) switch (opcode) { case 510: /* List entry */ printf(" count"); INTOUT(); printf(" nextindex"); INTOUT(); case 503: /* Get entry by id */ case 504: /* Get entry by name */ { unsigned long nservers, j; VECOUT(VLNAMEMAX); TCHECK2(bp[0], sizeof(int32_t)); bp += sizeof(int32_t); printf(" numservers"); TCHECK2(bp[0], sizeof(int32_t)); nservers = EXTRACT_32BITS(bp); bp += sizeof(int32_t); printf(" %lu", nservers); printf(" servers"); for (i = 0; i < 8; i++) { TCHECK2(bp[0], sizeof(int32_t)); if (i < nservers) printf(" %s", intoa(((struct in_addr *) bp)->s_addr)); bp += sizeof(int32_t); } printf(" partitions"); for (i = 0; i < 8; i++) { TCHECK2(bp[0], sizeof(int32_t)); j = EXTRACT_32BITS(bp); if (i < nservers && j <= 26) printf(" %c", 'a' + (int)j); else if (i < nservers) printf(" %lu", j); bp += sizeof(int32_t); } TCHECK2(bp[0], 8 * sizeof(int32_t)); bp += 8 * sizeof(int32_t); printf(" rwvol"); UINTOUT(); printf(" rovol"); UINTOUT(); printf(" backup"); UINTOUT(); } break; case 505: /* Get new volume ID */ printf(" newvol"); UINTOUT(); break; case 521: /* List entry */ case 529: /* List entry U */ printf(" count"); INTOUT(); printf(" nextindex"); INTOUT(); case 518: /* Get entry by ID N */ case 519: /* Get entry by name N */ { unsigned long nservers, j; VECOUT(VLNAMEMAX); printf(" numservers"); TCHECK2(bp[0], sizeof(int32_t)); nservers = EXTRACT_32BITS(bp); bp += sizeof(int32_t); printf(" %lu", nservers); printf(" servers"); for (i = 0; i < 13; i++) { TCHECK2(bp[0], sizeof(int32_t)); if (i < nservers) printf(" %s", intoa(((struct in_addr *) bp)->s_addr)); bp += sizeof(int32_t); } printf(" partitions"); for (i = 0; i < 13; i++) { TCHECK2(bp[0], sizeof(int32_t)); j = EXTRACT_32BITS(bp); if (i < nservers && j <= 26) printf(" %c", 'a' + (int)j); else if (i < nservers) printf(" %lu", j); bp += sizeof(int32_t); } TCHECK2(bp[0], 13 * sizeof(int32_t)); bp += 13 * sizeof(int32_t); printf(" rwvol"); UINTOUT(); printf(" rovol"); UINTOUT(); printf(" backup"); UINTOUT(); } break; case 526: /* Get entry by ID U */ case 527: /* Get entry by name U */ { unsigned long nservers, j; VECOUT(VLNAMEMAX); printf(" numservers"); TCHECK2(bp[0], sizeof(int32_t)); nservers = EXTRACT_32BITS(bp); bp += sizeof(int32_t); printf(" %lu", nservers); printf(" servers"); for (i = 0; i < 13; i++) { if (i < nservers) { printf(" afsuuid"); AFSUUIDOUT(); } else { TCHECK2(bp[0], 44); bp += 44; } } TCHECK2(bp[0], 4 * 13); bp += 4 * 13; printf(" partitions"); for (i = 0; i < 13; i++) { TCHECK2(bp[0], sizeof(int32_t)); j = EXTRACT_32BITS(bp); if (i < nservers && j <= 26) printf(" %c", 'a' + (int)j); else if (i < nservers) printf(" %lu", j); bp += sizeof(int32_t); } TCHECK2(bp[0], 13 * sizeof(int32_t)); bp += 13 * sizeof(int32_t); printf(" rwvol"); UINTOUT(); printf(" rovol"); UINTOUT(); printf(" backup"); UINTOUT(); } default: ; } else { /* * Otherwise, just print out the return code */ printf(" errcode"); INTOUT(); } return; trunc: printf(" [|vldb]"); } /* * Handle calls to the AFS Kerberos Authentication service */ static void kauth_print(register const u_char *bp, int length) { int kauth_op; if (length <= (int)sizeof(struct rx_header)) return; if (snapend - bp + 1 <= (int)(sizeof(struct rx_header) + sizeof(int32_t))) { goto trunc; } /* * Print out the afs call we're invoking. The table used here was * gleaned from kauth/kauth.rg */ kauth_op = EXTRACT_32BITS(bp + sizeof(struct rx_header)); printf(" kauth"); if (is_ubik(kauth_op)) { ubik_print(bp); return; } printf(" call %s", tok2str(kauth_req, "op#%d", kauth_op)); /* * Decode some of the arguments to the KA calls */ bp += sizeof(struct rx_header) + 4; switch (kauth_op) { case 1: /* Authenticate old */; case 21: /* Authenticate */ case 22: /* Authenticate-V2 */ case 2: /* Change PW */ case 5: /* Set fields */ case 6: /* Create user */ case 7: /* Delete user */ case 8: /* Get entry */ case 14: /* Unlock */ case 15: /* Lock status */ printf(" principal"); STROUT(KANAMEMAX); STROUT(KANAMEMAX); break; case 3: /* GetTicket-old */ case 23: /* GetTicket */ { int i; printf(" kvno"); INTOUT(); printf(" domain"); STROUT(KANAMEMAX); TCHECK2(bp[0], sizeof(int32_t)); i = (int) EXTRACT_32BITS(bp); bp += sizeof(int32_t); TCHECK2(bp[0], i); bp += i; printf(" principal"); STROUT(KANAMEMAX); STROUT(KANAMEMAX); break; } case 4: /* Set Password */ printf(" principal"); STROUT(KANAMEMAX); STROUT(KANAMEMAX); printf(" kvno"); INTOUT(); break; case 12: /* Get password */ printf(" name"); STROUT(KANAMEMAX); break; default: ; } return; trunc: printf(" [|kauth]"); } /* * Handle replies to the AFS Kerberos Authentication Service */ static void kauth_reply_print(register const u_char *bp, int length, int32_t opcode) { struct rx_header *rxh; if (length <= (int)sizeof(struct rx_header)) return; rxh = (struct rx_header *) bp; /* * Print out the afs call we're invoking. The table used here was * gleaned from kauth/kauth.rg */ printf(" kauth"); if (is_ubik(opcode)) { ubik_reply_print(bp, length, opcode); return; } printf(" reply %s", tok2str(kauth_req, "op#%d", opcode)); bp += sizeof(struct rx_header); /* * If it was a data packet, interpret the response. */ if (rxh->type == RX_PACKET_TYPE_DATA) /* Well, no, not really. Leave this for later */ ; else { /* * Otherwise, just print out the return code */ printf(" errcode"); INTOUT(); } return; trunc: printf(" [|kauth]"); } /* * Handle calls to the AFS Volume location service */ static void vol_print(register const u_char *bp, int length) { int vol_op; if (length <= (int)sizeof(struct rx_header)) return; if (snapend - bp + 1 <= (int)(sizeof(struct rx_header) + sizeof(int32_t))) { goto trunc; } /* * Print out the afs call we're invoking. The table used here was * gleaned from volser/volint.xg */ vol_op = EXTRACT_32BITS(bp + sizeof(struct rx_header)); printf(" vol call %s", tok2str(vol_req, "op#%d", vol_op)); /* * Normally there would be a switch statement here to decode the * arguments to the AFS call, but since I don't have access to * an AFS server (yet) and I'm not an AFS admin, I can't * test any of these calls. Leave this blank for now. */ return; trunc: printf(" [|vol]"); } /* * Handle replies to the AFS Volume Service */ static void vol_reply_print(register const u_char *bp, int length, int32_t opcode) { struct rx_header *rxh; if (length <= (int)sizeof(struct rx_header)) return; rxh = (struct rx_header *) bp; /* * Print out the afs call we're invoking. The table used here was * gleaned from volser/volint.xg */ printf(" vol reply %s", tok2str(vol_req, "op#%d", opcode)); bp += sizeof(struct rx_header); /* * If it was a data packet, interpret the response. */ if (rxh->type == RX_PACKET_TYPE_DATA) /* Well, no, not really. Leave this for later */ ; else { /* * Otherwise, just print out the return code */ printf(" errcode"); INTOUT(); } return; trunc: printf(" [|vol]"); } /* * Handle calls to the AFS BOS service */ static void bos_print(register const u_char *bp, int length) { int bos_op; if (length <= (int)sizeof(struct rx_header)) return; if (snapend - bp + 1 <= (int)(sizeof(struct rx_header) + sizeof(int32_t))) { goto trunc; } /* * Print out the afs call we're invoking. The table used here was * gleaned from bozo/bosint.xg */ bos_op = EXTRACT_32BITS(bp + sizeof(struct rx_header)); printf(" bos call %s", tok2str(bos_req, "op#%d", bos_op)); /* * Decode some of the arguments to the BOS calls */ bp += sizeof(struct rx_header) + 4; switch (bos_op) { case 80: /* Create B node */ printf(" type"); STROUT(BOSNAMEMAX); printf(" instance"); STROUT(BOSNAMEMAX); break; case 81: /* Delete B node */ case 83: /* Get status */ case 85: /* Get instance info */ case 87: /* Add super user */ case 88: /* Delete super user */ case 93: /* Set cell name */ case 96: /* Add cell host */ case 97: /* Delete cell host */ case 104: /* Restart */ case 106: /* Uninstall */ case 108: /* Exec */ case 112: /* Getlog */ case 114: /* Get instance strings */ STROUT(BOSNAMEMAX); break; case 82: /* Set status */ case 98: /* Set T status */ STROUT(BOSNAMEMAX); printf(" status"); INTOUT(); break; case 86: /* Get instance parm */ STROUT(BOSNAMEMAX); printf(" num"); INTOUT(); break; case 84: /* Enumerate instance */ case 89: /* List super users */ case 90: /* List keys */ case 91: /* Add key */ case 92: /* Delete key */ case 95: /* Get cell host */ INTOUT(); break; case 105: /* Install */ STROUT(BOSNAMEMAX); printf(" size"); INTOUT(); printf(" flags"); INTOUT(); printf(" date"); INTOUT(); break; default: ; } return; trunc: printf(" [|bos]"); } /* * Handle replies to the AFS BOS Service */ static void bos_reply_print(register const u_char *bp, int length, int32_t opcode) { struct rx_header *rxh; if (length <= (int)sizeof(struct rx_header)) return; rxh = (struct rx_header *) bp; /* * Print out the afs call we're invoking. The table used here was * gleaned from volser/volint.xg */ printf(" bos reply %s", tok2str(bos_req, "op#%d", opcode)); bp += sizeof(struct rx_header); /* * If it was a data packet, interpret the response. */ if (rxh->type == RX_PACKET_TYPE_DATA) /* Well, no, not really. Leave this for later */ ; else { /* * Otherwise, just print out the return code */ printf(" errcode"); INTOUT(); } return; trunc: printf(" [|bos]"); } /* * Check to see if this is a Ubik opcode. */ static int is_ubik(u_int32_t opcode) { if ((opcode >= VOTE_LOW && opcode <= VOTE_HIGH) || (opcode >= DISK_LOW && opcode <= DISK_HIGH)) return(1); else return(0); } /* * Handle Ubik opcodes to any one of the replicated database services */ static void ubik_print(register const u_char *bp) { int ubik_op; int32_t temp; /* * Print out the afs call we're invoking. The table used here was * gleaned from ubik/ubik_int.xg */ ubik_op = EXTRACT_32BITS(bp + sizeof(struct rx_header)); printf(" ubik call %s", tok2str(ubik_req, "op#%d", ubik_op)); /* * Decode some of the arguments to the Ubik calls */ bp += sizeof(struct rx_header) + 4; switch (ubik_op) { case 10000: /* Beacon */ TCHECK2(bp[0], 4); temp = EXTRACT_32BITS(bp); bp += sizeof(int32_t); printf(" syncsite %s", temp ? "yes" : "no"); printf(" votestart"); DATEOUT(); printf(" dbversion"); UBIK_VERSIONOUT(); printf(" tid"); UBIK_VERSIONOUT(); break; case 10003: /* Get sync site */ printf(" site"); UINTOUT(); break; case 20000: /* Begin */ case 20001: /* Commit */ case 20007: /* Abort */ case 20008: /* Release locks */ case 20010: /* Writev */ printf(" tid"); UBIK_VERSIONOUT(); break; case 20002: /* Lock */ printf(" tid"); UBIK_VERSIONOUT(); printf(" file"); INTOUT(); printf(" pos"); INTOUT(); printf(" length"); INTOUT(); temp = EXTRACT_32BITS(bp); bp += sizeof(int32_t); tok2str(ubik_lock_types, "type %d", temp); break; case 20003: /* Write */ printf(" tid"); UBIK_VERSIONOUT(); printf(" file"); INTOUT(); printf(" pos"); INTOUT(); break; case 20005: /* Get file */ printf(" file"); INTOUT(); break; case 20006: /* Send file */ printf(" file"); INTOUT(); printf(" length"); INTOUT(); printf(" dbversion"); UBIK_VERSIONOUT(); break; case 20009: /* Truncate */ printf(" tid"); UBIK_VERSIONOUT(); printf(" file"); INTOUT(); printf(" length"); INTOUT(); break; case 20012: /* Set version */ printf(" tid"); UBIK_VERSIONOUT(); printf(" oldversion"); UBIK_VERSIONOUT(); printf(" newversion"); UBIK_VERSIONOUT(); break; default: ; } return; trunc: printf(" [|ubik]"); } /* * Handle Ubik replies to any one of the replicated database services */ static void ubik_reply_print(register const u_char *bp, int length, int32_t opcode) { struct rx_header *rxh; if (length < (int)sizeof(struct rx_header)) return; rxh = (struct rx_header *) bp; /* * Print out the ubik call we're invoking. This table was gleaned * from ubik/ubik_int.xg */ printf(" ubik reply %s", tok2str(ubik_req, "op#%d", opcode)); bp += sizeof(struct rx_header); /* * If it was a data packet, print out the arguments to the Ubik calls */ if (rxh->type == RX_PACKET_TYPE_DATA) switch (opcode) { case 10000: /* Beacon */ printf(" vote no"); break; case 20004: /* Get version */ printf(" dbversion"); UBIK_VERSIONOUT(); break; default: ; } /* * Otherwise, print out "yes" it it was a beacon packet (because * that's how yes votes are returned, go figure), otherwise * just print out the error code. */ else switch (opcode) { case 10000: /* Beacon */ printf(" vote yes until"); DATEOUT(); break; default: printf(" errcode"); INTOUT(); } return; trunc: printf(" [|ubik]"); } /* * Handle RX ACK packets. */ static void rx_ack_print(register const u_char *bp, int length) { struct rx_ackPacket *rxa; int i, start, last; u_int32_t firstPacket; if (length < (int)sizeof(struct rx_header)) return; bp += sizeof(struct rx_header); /* * This may seem a little odd .... the rx_ackPacket structure * contains an array of individual packet acknowledgements * (used for selective ack/nack), but since it's variable in size, * we don't want to truncate based on the size of the whole * rx_ackPacket structure. */ TCHECK2(bp[0], sizeof(struct rx_ackPacket) - RX_MAXACKS); rxa = (struct rx_ackPacket *) bp; bp += (sizeof(struct rx_ackPacket) - RX_MAXACKS); /* * Print out a few useful things from the ack packet structure */ if (vflag > 2) printf(" bufspace %d maxskew %d", (int) EXTRACT_16BITS(&rxa->bufferSpace), (int) EXTRACT_16BITS(&rxa->maxSkew)); firstPacket = EXTRACT_32BITS(&rxa->firstPacket); printf(" first %d serial %d reason %s", firstPacket, EXTRACT_32BITS(&rxa->serial), tok2str(rx_ack_reasons, "#%d", (int) rxa->reason)); /* * Okay, now we print out the ack array. The way _this_ works * is that we start at "first", and step through the ack array. * If we have a contiguous range of acks/nacks, try to * collapse them into a range. * * If you're really clever, you might have noticed that this * doesn't seem quite correct. Specifically, due to structure * padding, sizeof(struct rx_ackPacket) - RX_MAXACKS won't actually * yield the start of the ack array (because RX_MAXACKS is 255 * and the structure will likely get padded to a 2 or 4 byte * boundary). However, this is the way it's implemented inside * of AFS - the start of the extra fields are at * sizeof(struct rx_ackPacket) - RX_MAXACKS + nAcks, which _isn't_ * the exact start of the ack array. Sigh. That's why we aren't * using bp, but instead use rxa->acks[]. But nAcks gets added * to bp after this, so bp ends up at the right spot. Go figure. */ if (rxa->nAcks != 0) { TCHECK2(bp[0], rxa->nAcks); /* * Sigh, this is gross, but it seems to work to collapse * ranges correctly. */ for (i = 0, start = last = -2; i < rxa->nAcks; i++) if (rxa->acks[i] == RX_ACK_TYPE_ACK) { /* * I figured this deserved _some_ explanation. * First, print "acked" and the packet seq * number if this is the first time we've * seen an acked packet. */ if (last == -2) { printf(" acked %d", firstPacket + i); start = i; } /* * Otherwise, if the there is a skip in * the range (such as an nacked packet in * the middle of some acked packets), * then print the current packet number * seperated from the last number by * a comma. */ else if (last != i - 1) { printf(",%d", firstPacket + i); start = i; } /* * We always set last to the value of * the last ack we saw. Conversely, start * is set to the value of the first ack * we saw in a range. */ last = i; /* * Okay, this bit a code gets executed when * we hit a nack ... in _this_ case we * want to print out the range of packets * that were acked, so we need to print * the _previous_ packet number seperated * from the first by a dash (-). Since we * already printed the first packet above, * just print the final packet. Don't * do this if there will be a single-length * range. */ } else if (last == i - 1 && start != last) printf("-%d", firstPacket + i - 1); /* * So, what's going on here? We ran off the end of the * ack list, and if we got a range we need to finish it up. * So we need to determine if the last packet in the list * was an ack (if so, then last will be set to it) and * we need to see if the last range didn't start with the * last packet (because if it _did_, then that would mean * that the packet number has already been printed and * we don't need to print it again). */ if (last == i - 1 && start != last) printf("-%d", firstPacket + i - 1); /* * Same as above, just without comments */ for (i = 0, start = last = -2; i < rxa->nAcks; i++) if (rxa->acks[i] == RX_ACK_TYPE_NACK) { if (last == -2) { printf(" nacked %d", firstPacket + i); start = i; } else if (last != i - 1) { printf(",%d", firstPacket + i); start = i; } last = i; } else if (last == i - 1 && start != last) printf("-%d", firstPacket + i - 1); if (last == i - 1 && start != last) printf("-%d", firstPacket + i - 1); bp += rxa->nAcks; } /* * These are optional fields; depending on your version of AFS, * you may or may not see them */ #define TRUNCRET(n) if (snapend - bp + 1 <= n) return; if (vflag > 1) { TRUNCRET(4); printf(" ifmtu"); INTOUT(); TRUNCRET(4); printf(" maxmtu"); INTOUT(); TRUNCRET(4); printf(" rwind"); INTOUT(); TRUNCRET(4); printf(" maxpackets"); INTOUT(); } return; trunc: printf(" [|ack]"); } #undef TRUNCRET tcpdump-3.9.8/./machdep.h0000644000026300017500000000252307040532630013241 0ustar mcrmcr/* * Copyright (c) 1996 * The Regents of the University of California. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that: (1) source code distributions * retain the above copyright notice and this paragraph in its entirety, (2) * distributions including binary code include the above copyright notice and * this paragraph in its entirety in the documentation or other materials * provided with the distribution, and (3) all advertising materials mentioning * features or use of this software display the following acknowledgement: * ``This product includes software developed by the University of California, * Lawrence Berkeley Laboratory and its contributors.'' Neither the name of * the University nor the names of its contributors may be used to endorse * or promote products derived from this software without specific prior * written permission. * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * * @(#) $Header: /tcpdump/master/tcpdump/machdep.h,v 1.2 2000/01/17 06:24:24 itojun Exp $ (LBL) */ #ifndef tcpdump_machdep_h #define tcpdump_machdep_h int abort_on_misalignment(char *, size_t); #endif tcpdump-3.9.8/./print-raw.c0000644000026300017500000000325607755642442013602 0ustar mcrmcr/* * Copyright (c) 1996 * The Regents of the University of California. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that: (1) source code distributions * retain the above copyright notice and this paragraph in its entirety, (2) * distributions including binary code include the above copyright notice and * this paragraph in its entirety in the documentation or other materials * provided with the distribution, and (3) all advertising materials mentioning * features or use of this software display the following acknowledgement: * ``This product includes software developed by the University of California, * Lawrence Berkeley Laboratory and its contributors.'' Neither the name of * the University nor the names of its contributors may be used to endorse * or promote products derived from this software without specific prior * written permission. * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. */ #ifndef lint static const char rcsid[] _U_ = "@(#) $Header: /tcpdump/master/tcpdump/print-raw.c,v 1.41 2003/11/16 09:36:34 guy Exp $ (LBL)"; #endif #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include #include #include "addrtoname.h" #include "interface.h" /* * The DLT_RAW packet has no header. It contains a raw IP packet. */ u_int raw_if_print(const struct pcap_pkthdr *h, const u_char *p) { if (eflag) printf("ip: "); ipN_print(p, h->len); return (0); } tcpdump-3.9.8/./lbl/0000755000026300017500000000000010245647654012254 5ustar mcrmcrtcpdump-3.9.8/./lbl/os-sunos4.h0000644000026300017500000001417506777230401014300 0ustar mcrmcr/* * Copyright (c) 1989, 1990, 1993, 1994, 1995, 1996 * The Regents of the University of California. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that: (1) source code distributions * retain the above copyright notice and this paragraph in its entirety, (2) * distributions including binary code include the above copyright notice and * this paragraph in its entirety in the documentation or other materials * provided with the distribution, and (3) all advertising materials mentioning * features or use of this software display the following acknowledgement: * ``This product includes software developed by the University of California, * Lawrence Berkeley Laboratory and its contributors.'' Neither the name of * the University nor the names of its contributors may be used to endorse * or promote products derived from this software without specific prior * written permission. * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * * @(#) $Header: /tcpdump/master/tcpdump/lbl/os-sunos4.h,v 1.32.1.1 1999/10/07 23:47:13 mcr Exp $ (LBL) */ /* Prototypes missing in SunOS 4 */ #ifdef FILE int _filbuf(FILE *); int _flsbuf(u_char, FILE *); int fclose(FILE *); int fflush(FILE *); int fgetc(FILE *); int fprintf(FILE *, const char *, ...); int fputc(int, FILE *); int fputs(const char *, FILE *); u_int fread(void *, u_int, u_int, FILE *); int fseek(FILE *, long, int); u_int fwrite(const void *, u_int, u_int, FILE *); int pclose(FILE *); void rewind(FILE *); void setbuf(FILE *, char *); int setlinebuf(FILE *); int ungetc(int, FILE *); int vfprintf(FILE *, const char *, ...); int vprintf(const char *, ...); #endif #if __GNUC__ <= 1 int read(int, char *, u_int); int write(int, char *, u_int); #endif long a64l(const char *); #ifdef __STDC__ struct sockaddr; #endif int accept(int, struct sockaddr *, int *); int bind(int, struct sockaddr *, int); int bcmp(const void *, const void *, u_int); void bcopy(const void *, void *, u_int); void bzero(void *, int); int chroot(const char *); int close(int); void closelog(void); int connect(int, struct sockaddr *, int); char *crypt(const char *, const char *); int daemon(int, int); int fchmod(int, int); int fchown(int, int, int); void endgrent(void); void endpwent(void); void endservent(void); #ifdef __STDC__ struct ether_addr; #endif struct ether_addr *ether_aton(const char *); int flock(int, int); #ifdef __STDC__ struct stat; #endif int fstat(int, struct stat *); #ifdef __STDC__ struct statfs; #endif int fstatfs(int, struct statfs *); int fsync(int); #ifdef __STDC__ struct timeb; #endif int ftime(struct timeb *); int ftruncate(int, off_t); int getdtablesize(void); long gethostid(void); int gethostname(char *, int); int getopt(int, char * const *, const char *); int getpagesize(void); char *getpass(char *); int getpeername(int, struct sockaddr *, int *); int getpriority(int, int); #ifdef __STDC__ struct rlimit; #endif int getrlimit(int, struct rlimit *); int getsockname(int, struct sockaddr *, int *); int getsockopt(int, int, int, char *, int *); #ifdef __STDC__ struct timeval; struct timezone; #endif int gettimeofday(struct timeval *, struct timezone *); char *getusershell(void); char *getwd(char *); int initgroups(const char *, int); int ioctl(int, int, caddr_t); int iruserok(u_long, int, char *, char *); int isatty(int); int killpg(int, int); int listen(int, int); #ifdef __STDC__ struct utmp; #endif void login(struct utmp *); int logout(const char *); off_t lseek(int, off_t, int); int lstat(const char *, struct stat *); int mkstemp(char *); char *mktemp(char *); int munmap(caddr_t, int); void openlog(const char *, int, int); void perror(const char *); int printf(const char *, ...); int puts(const char *); long random(void); int readlink(const char *, char *, int); #ifdef __STDC__ struct iovec; #endif int readv(int, struct iovec *, int); int recv(int, char *, u_int, int); int recvfrom(int, char *, u_int, int, struct sockaddr *, int *); int rename(const char *, const char *); int rcmd(char **, u_short, char *, char *, char *, int *); int rresvport(int *); int send(int, char *, u_int, int); int sendto(int, char *, u_int, int, struct sockaddr *, int); int setenv(const char *, const char *, int); int seteuid(int); int setpriority(int, int, int); int select(int, fd_set *, fd_set *, fd_set *, struct timeval *); int setpgrp(int, int); void setpwent(void); int setrlimit(int, struct rlimit *); void setservent(int); int setsockopt(int, int, int, char *, int); int shutdown(int, int); int sigblock(int); void (*signal (int, void (*) (int))) (int); int sigpause(int); int sigsetmask(int); #ifdef __STDC__ struct sigvec; #endif int sigvec(int, struct sigvec *, struct sigvec*); int snprintf(char *, size_t, const char *, ...); int socket(int, int, int); int socketpair(int, int, int, int *); int symlink(const char *, const char *); void srandom(int); int sscanf(char *, const char *, ...); int stat(const char *, struct stat *); int statfs(char *, struct statfs *); char *strerror(int); int strcasecmp(const char *, const char *); #ifdef __STDC__ struct tm; #endif int strftime(char *, int, char *, struct tm *); int strncasecmp(const char *, const char *, int); long strtol(const char *, char **, int); void sync(void); void syslog(int, const char *, ...); int system(const char *); long tell(int); time_t time(time_t *); char *timezone(int, int); int tolower(int); int toupper(int); int truncate(char *, off_t); void unsetenv(const char *); int vfork(void); int vsprintf(char *, const char *, ...); int writev(int, struct iovec *, int); #ifdef __STDC__ struct rusage; #endif int utimes(const char *, struct timeval *); #if __GNUC__ <= 1 int wait(int *); pid_t wait3(int *, int, struct rusage *); #endif /* Ugly signal hacking */ #ifdef SIG_ERR #undef SIG_ERR #define SIG_ERR (void (*)(int))-1 #undef SIG_DFL #define SIG_DFL (void (*)(int))0 #undef SIG_IGN #define SIG_IGN (void (*)(int))1 #ifdef KERNEL #undef SIG_CATCH #define SIG_CATCH (void (*)(int))2 #endif #undef SIG_HOLD #define SIG_HOLD (void (*)(int))3 #endif tcpdump-3.9.8/./lbl/os-osf4.h0000644000026300017500000000263207575543421013721 0ustar mcrmcr/* * Copyright (c) 1993, 1994, 1995, 1996, 1997 * The Regents of the University of California. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that: (1) source code distributions * retain the above copyright notice and this paragraph in its entirety, (2) * distributions including binary code include the above copyright notice and * this paragraph in its entirety in the documentation or other materials * provided with the distribution, and (3) all advertising materials mentioning * features or use of this software display the following acknowledgement: * ``This product includes software developed by the University of California, * Lawrence Berkeley Laboratory and its contributors.'' Neither the name of * the University nor the names of its contributors may be used to endorse * or promote products derived from this software without specific prior * written permission. * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * * @(#) $Header: /tcpdump/master/tcpdump/lbl/os-osf4.h,v 1.1 2002/12/11 05:03:13 guy Exp $ (LBL) */ /* Prototypes missing in Digital UNIX 4.x */ int snprintf(char *, size_t, const char *, ...); int vsnprintf(char *, size_t, const char *, va_list); tcpdump-3.9.8/./lbl/CVS/0000755000026300017500000000000010245647654012707 5ustar mcrmcrtcpdump-3.9.8/./lbl/CVS/Entries0000644000026300017500000000035610245647654014247 0ustar mcrmcr/os-osf4.h/1.1/Wed Dec 11 05:03:13 2002//Ttcpdump_3_9 /os-solaris2.h/1.19/Wed Oct 11 04:02:15 2000//Ttcpdump_3_9 /os-sunos4.h/1.32.1.1/Thu Oct 7 23:47:13 1999//Ttcpdump_3_9 /os-ultrix4.h/1.19.1.1/Thu Oct 7 23:47:13 1999//Ttcpdump_3_9 D tcpdump-3.9.8/./lbl/CVS/Root0000644000026300017500000000004010245647653013546 0ustar mcrmcrcvs.tcpdump.org:/tcpdump/master tcpdump-3.9.8/./lbl/CVS/Repository0000644000026300017500000000001410245647653015003 0ustar mcrmcrtcpdump/lbl tcpdump-3.9.8/./lbl/CVS/Tag0000644000026300017500000000001510245647654013341 0ustar mcrmcrTtcpdump_3_9 tcpdump-3.9.8/./lbl/os-ultrix4.h0000644000026300017500000000335706777230401014460 0ustar mcrmcr/* * Copyright (c) 1990, 1993, 1994, 1995, 1996 * The Regents of the University of California. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that: (1) source code distributions * retain the above copyright notice and this paragraph in its entirety, (2) * distributions including binary code include the above copyright notice and * this paragraph in its entirety in the documentation or other materials * provided with the distribution, and (3) all advertising materials mentioning * features or use of this software display the following acknowledgement: * ``This product includes software developed by the University of California, * Lawrence Berkeley Laboratory and its contributors.'' Neither the name of * the University nor the names of its contributors may be used to endorse * or promote products derived from this software without specific prior * written permission. * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * * @(#) $Header: /tcpdump/master/tcpdump/lbl/os-ultrix4.h,v 1.19.1.1 1999/10/07 23:47:13 mcr Exp $ (LBL) */ /* Prototypes missing in Ultrix 4 */ int bcmp(const char *, const char *, u_int); void bcopy(const void *, void *, u_int); void bzero(void *, u_int); void endservent(void); int getopt(int, char * const *, const char *); #ifdef __STDC__ struct timeval; struct timezone; #endif int gettimeofday(struct timeval *, struct timezone *); int ioctl(int, int, caddr_t); int pfopen(char *, int); int setlinebuf(FILE *); int socket(int, int, int); int strcasecmp(const char *, const char *); tcpdump-3.9.8/./lbl/os-solaris2.h0000644000026300017500000000276507170763107014607 0ustar mcrmcr/* * Copyright (c) 1993, 1994, 1995, 1996, 1997 * The Regents of the University of California. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that: (1) source code distributions * retain the above copyright notice and this paragraph in its entirety, (2) * distributions including binary code include the above copyright notice and * this paragraph in its entirety in the documentation or other materials * provided with the distribution, and (3) all advertising materials mentioning * features or use of this software display the following acknowledgement: * ``This product includes software developed by the University of California, * Lawrence Berkeley Laboratory and its contributors.'' Neither the name of * the University nor the names of its contributors may be used to endorse * or promote products derived from this software without specific prior * written permission. * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * * @(#) $Header: /tcpdump/master/tcpdump/lbl/os-solaris2.h,v 1.19 2000/10/11 04:02:15 guy Exp $ (LBL) */ /* Prototypes missing in SunOS 5 */ #if defined(_STDIO_H) && defined(HAVE_SETLINEBUF) int setlinebuf(FILE *); #endif char *strerror(int); int snprintf(char *, size_t, const char *, ...); int strcasecmp(const char *, const char *); tcpdump-3.9.8/./print-tftp.c0000644000026300017500000001036110676336432013754 0ustar mcrmcr/* * Copyright (c) 1990, 1991, 1993, 1994, 1995, 1996, 1997 * The Regents of the University of California. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that: (1) source code distributions * retain the above copyright notice and this paragraph in its entirety, (2) * distributions including binary code include the above copyright notice and * this paragraph in its entirety in the documentation or other materials * provided with the distribution, and (3) all advertising materials mentioning * features or use of this software display the following acknowledgement: * ``This product includes software developed by the University of California, * Lawrence Berkeley Laboratory and its contributors.'' Neither the name of * the University nor the names of its contributors may be used to endorse * or promote products derived from this software without specific prior * written permission. * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * * Format and print trivial file transfer protocol packets. */ #ifndef lint static const char rcsid[] _U_ = "@(#) $Header: /tcpdump/master/tcpdump/print-tftp.c,v 1.37.2.1 2007/09/14 01:03:12 guy Exp $ (LBL)"; #endif #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #ifdef SEGSIZE #undef SEGSIZE /* SINIX sucks */ #endif #include #include #include "interface.h" #include "addrtoname.h" #include "extract.h" #include "tftp.h" /* op code to string mapping */ static struct tok op2str[] = { { RRQ, "RRQ" }, /* read request */ { WRQ, "WRQ" }, /* write request */ { DATA, "DATA" }, /* data packet */ { ACK, "ACK" }, /* acknowledgement */ { ERROR, "ERROR" }, /* error code */ { OACK, "OACK" }, /* option acknowledgement */ { 0, NULL } }; /* error code to string mapping */ static struct tok err2str[] = { { EUNDEF, "EUNDEF" }, /* not defined */ { ENOTFOUND, "ENOTFOUND" }, /* file not found */ { EACCESS, "EACCESS" }, /* access violation */ { ENOSPACE, "ENOSPACE" }, /* disk full or allocation exceeded */ { EBADOP, "EBADOP" }, /* illegal TFTP operation */ { EBADID, "EBADID" }, /* unknown transfer ID */ { EEXISTS, "EEXISTS" }, /* file already exists */ { ENOUSER, "ENOUSER" }, /* no such user */ { 0, NULL } }; /* * Print trivial file transfer program requests */ void tftp_print(register const u_char *bp, u_int length) { register const struct tftphdr *tp; register const char *cp; register const u_char *p; register int opcode, i; static char tstr[] = " [|tftp]"; tp = (const struct tftphdr *)bp; /* Print length */ printf(" %d", length); /* Print tftp request type */ TCHECK(tp->th_opcode); opcode = EXTRACT_16BITS(&tp->th_opcode); cp = tok2str(op2str, "tftp-#%d", opcode); printf(" %s", cp); /* Bail if bogus opcode */ if (*cp == 't') return; switch (opcode) { case RRQ: case WRQ: case OACK: /* * XXX Not all arpa/tftp.h's specify th_stuff as any * array; use address of th_block instead */ #ifdef notdef p = (u_char *)tp->th_stuff; #else p = (u_char *)&tp->th_block; #endif putchar(' '); /* Print filename or first option */ if (opcode != OACK) putchar('"'); i = fn_print(p, snapend); if (opcode != OACK) putchar('"'); /* Print the mode (RRQ and WRQ only) and any options */ while ((p = (const u_char *)strchr((const char *)p, '\0')) != NULL) { if (length <= (u_int)(p - (const u_char *)&tp->th_block)) break; p++; if (*p != '\0') { putchar(' '); fn_print(p, snapend); } } if (i) goto trunc; break; case ACK: case DATA: TCHECK(tp->th_block); printf(" block %d", EXTRACT_16BITS(&tp->th_block)); break; case ERROR: /* Print error code string */ TCHECK(tp->th_code); printf(" %s \"", tok2str(err2str, "tftp-err-#%d \"", EXTRACT_16BITS(&tp->th_code))); /* Print error message string */ i = fn_print((const u_char *)tp->th_data, snapend); putchar('"'); if (i) goto trunc; break; default: /* We shouldn't get here */ printf("(unknown #%d)", opcode); break; } return; trunc: fputs(tstr, stdout); return; } tcpdump-3.9.8/./.#tcpdump.c.1.253.2.50000644000026300017500000010133410250355375014410 0ustar mcrmcr/* * Copyright (c) 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 2000 * The Regents of the University of California. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that: (1) source code distributions * retain the above copyright notice and this paragraph in its entirety, (2) * distributions including binary code include the above copyright notice and * this paragraph in its entirety in the documentation or other materials * provided with the distribution, and (3) all advertising materials mentioning * features or use of this software display the following acknowledgement: * ``This product includes software developed by the University of California, * Lawrence Berkeley Laboratory and its contributors.'' Neither the name of * the University nor the names of its contributors may be used to endorse * or promote products derived from this software without specific prior * written permission. * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * * Support for splitting captures into multiple files with a maximum * file size: * * Copyright (c) 2001 * Seth Webster */ #ifndef lint static const char copyright[] _U_ = "@(#) Copyright (c) 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 2000\n\ The Regents of the University of California. All rights reserved.\n"; static const char rcsid[] _U_ = "@(#) $Header: /tcpdump/master/tcpdump/tcpdump.c,v 1.253.2.5 2005/05/23 06:28:56 hannes Exp $ (LBL)"; #endif /* * tcpdump - monitor tcp/ip traffic on an ethernet. * * First written in 1987 by Van Jacobson, Lawrence Berkeley Laboratory. * Mercilessly hacked and occasionally improved since then via the * combined efforts of Van, Steve McCanne and Craig Leres of LBL. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #ifdef WIN32 #include "getopt.h" #include "w32_fzs.h" extern int strcasecmp (const char *__s1, const char *__s2); extern int SIZE_BUF; #define off_t long #define uint UINT #endif /* WIN32 */ #ifdef HAVE_SMI_H #include #endif #include #include #include #include #include #ifndef WIN32 #include #include #include #endif /* WIN32 */ #include "netdissect.h" #include "interface.h" #include "addrtoname.h" #include "machdep.h" #include "setsignal.h" #include "gmt2local.h" #include "pcap-missing.h" netdissect_options Gndo; netdissect_options *gndo = &Gndo; /* * Define the maximum number of files for the -C flag, and how many * characters can be added to a filename for the -C flag (which * should be enough to handle MAX_CFLAG - 1). */ #define MAX_CFLAG 1000000 #define MAX_CFLAG_CHARS 6 int dflag; /* print filter code */ int Lflag; /* list available data link types and exit */ static int infodelay; static int infoprint; char *program_name; int32_t thiszone; /* seconds offset from gmt to local time */ /* Forwards */ static RETSIGTYPE cleanup(int); static void usage(void) __attribute__((noreturn)); static void show_dlts_and_exit(pcap_t *pd) __attribute__((noreturn)); static void print_packet(u_char *, const struct pcap_pkthdr *, const u_char *); static void ndo_default_print(netdissect_options *, const u_char *, u_int); static void dump_packet_and_trunc(u_char *, const struct pcap_pkthdr *, const u_char *); static void dump_packet(u_char *, const struct pcap_pkthdr *, const u_char *); static void droproot(const char *, const char *); static void ndo_error(netdissect_options *ndo, const char *fmt, ...); static void ndo_warning(netdissect_options *ndo, const char *fmt, ...); #ifdef SIGINFO RETSIGTYPE requestinfo(int); #endif #if defined(USE_WIN32_MM_TIMER) #include static UINT timer_id; static void CALLBACK verbose_stats_dump(UINT, UINT, DWORD_PTR, DWORD_PTR, DWORD_PTR); #elif defined(HAVE_ALARM) static void verbose_stats_dump(int sig); #endif static void info(int); static u_int packets_captured; typedef u_int (*if_printer)(const struct pcap_pkthdr *, const u_char *); struct printer { if_printer f; int type; }; static struct printer printers[] = { { arcnet_if_print, DLT_ARCNET }, #ifdef DLT_ARCNET_LINUX { arcnet_linux_if_print, DLT_ARCNET_LINUX }, #endif { ether_if_print, DLT_EN10MB }, { token_if_print, DLT_IEEE802 }, #ifdef DLT_LANE8023 { lane_if_print, DLT_LANE8023 }, #endif #ifdef DLT_CIP { cip_if_print, DLT_CIP }, #endif #ifdef DLT_ATM_CLIP { cip_if_print, DLT_ATM_CLIP }, #endif { sl_if_print, DLT_SLIP }, #ifdef DLT_SLIP_BSDOS { sl_bsdos_if_print, DLT_SLIP_BSDOS }, #endif { ppp_if_print, DLT_PPP }, #ifdef DLT_PPP_WITHDIRECTION { ppp_if_print, DLT_PPP_WITHDIRECTION }, #endif #ifdef DLT_PPP_BSDOS { ppp_bsdos_if_print, DLT_PPP_BSDOS }, #endif { fddi_if_print, DLT_FDDI }, { null_if_print, DLT_NULL }, #ifdef DLT_LOOP { null_if_print, DLT_LOOP }, #endif { raw_if_print, DLT_RAW }, { atm_if_print, DLT_ATM_RFC1483 }, #ifdef DLT_C_HDLC { chdlc_if_print, DLT_C_HDLC }, #endif #ifdef DLT_HDLC { chdlc_if_print, DLT_HDLC }, #endif #ifdef DLT_PPP_SERIAL { ppp_hdlc_if_print, DLT_PPP_SERIAL }, #endif #ifdef DLT_PPP_ETHER { pppoe_if_print, DLT_PPP_ETHER }, #endif #ifdef DLT_LINUX_SLL { sll_if_print, DLT_LINUX_SLL }, #endif #ifdef DLT_IEEE802_11 { ieee802_11_if_print, DLT_IEEE802_11}, #endif #ifdef DLT_LTALK { ltalk_if_print, DLT_LTALK }, #endif #ifdef DLT_PFLOG { pflog_if_print, DLT_PFLOG }, #endif #ifdef DLT_FR { fr_if_print, DLT_FR }, #endif #ifdef DLT_FRELAY { fr_if_print, DLT_FRELAY }, #endif #ifdef DLT_SUNATM { sunatm_if_print, DLT_SUNATM }, #endif #ifdef DLT_IP_OVER_FC { ipfc_if_print, DLT_IP_OVER_FC }, #endif #ifdef DLT_PRISM_HEADER { prism_if_print, DLT_PRISM_HEADER }, #endif #ifdef DLT_IEEE802_11_RADIO { ieee802_11_radio_if_print, DLT_IEEE802_11_RADIO }, #endif #ifdef DLT_ENC { enc_if_print, DLT_ENC }, #endif #ifdef DLT_SYMANTEC_FIREWALL { symantec_if_print, DLT_SYMANTEC_FIREWALL }, #endif #ifdef DLT_APPLE_IP_OVER_IEEE1394 { ap1394_if_print, DLT_APPLE_IP_OVER_IEEE1394 }, #endif #ifdef DLT_JUNIPER_ATM1 { juniper_atm1_print, DLT_JUNIPER_ATM1 }, #endif #ifdef DLT_JUNIPER_ATM2 { juniper_atm2_print, DLT_JUNIPER_ATM2 }, #endif #ifdef DLT_JUNIPER_MFR { juniper_mfr_print, DLT_JUNIPER_MFR }, #endif #ifdef DLT_JUNIPER_MLFR { juniper_mlfr_print, DLT_JUNIPER_MLFR }, #endif #ifdef DLT_JUNIPER_MLPPP { juniper_mlppp_print, DLT_JUNIPER_MLPPP }, #endif #ifdef DLT_JUNIPER_PPPOE { juniper_pppoe_print, DLT_JUNIPER_PPPOE }, #endif #ifdef DLT_JUNIPER_PPPOE_ATM { juniper_pppoe_atm_print, DLT_JUNIPER_PPPOE_ATM }, #endif #ifdef DLT_JUNIPER_GGSN { juniper_ggsn_print, DLT_JUNIPER_GGSN }, #endif #ifdef DLT_JUNIPER_ES { juniper_es_print, DLT_JUNIPER_ES }, #endif #ifdef DLT_JUNIPER_MONITOR { juniper_monitor_print, DLT_JUNIPER_MONITOR }, #endif #ifdef DLT_JUNIPER_SERVICES { juniper_services_print, DLT_JUNIPER_SERVICES }, #endif { NULL, 0 }, }; static if_printer lookup_printer(int type) { struct printer *p; for (p = printers; p->f; ++p) if (type == p->type) return p->f; return NULL; /* NOTREACHED */ } static pcap_t *pd; extern int optind; extern int opterr; extern char *optarg; struct print_info { if_printer printer; }; struct dump_info { char *WFileName; pcap_t *pd; pcap_dumper_t *p; }; static void show_dlts_and_exit(pcap_t *pd) { int n_dlts; int *dlts = 0; const char *dlt_name; n_dlts = pcap_list_datalinks(pd, &dlts); if (n_dlts < 0) error("%s", pcap_geterr(pd)); else if (n_dlts == 0 || !dlts) error("No data link types."); (void) fprintf(stderr, "Data link types (use option -y to set):\n"); while (--n_dlts >= 0) { dlt_name = pcap_datalink_val_to_name(dlts[n_dlts]); if (dlt_name != NULL) { (void) fprintf(stderr, " %s (%s)", dlt_name, pcap_datalink_val_to_description(dlts[n_dlts])); /* * OK, does tcpdump handle that type? */ if (lookup_printer(dlts[n_dlts]) == NULL) (void) fprintf(stderr, " (not supported)"); putchar('\n'); } else { (void) fprintf(stderr, " DLT %d (not supported)\n", dlts[n_dlts]); } } free(dlts); exit(0); } /* * Set up flags that might or might not be supported depending on the * version of libpcap we're using. */ #ifdef WIN32 #define B_FLAG "B:" #define B_FLAG_USAGE " [ -B size ]" #else /* WIN32 */ #define B_FLAG #define B_FLAG_USAGE #endif /* WIN32 */ #ifdef HAVE_PCAP_FINDALLDEVS #ifndef HAVE_PCAP_IF_T #undef HAVE_PCAP_FINDALLDEVS #endif #endif #ifdef HAVE_PCAP_FINDALLDEVS #define D_FLAG "D" #else #define D_FLAG #endif #ifdef HAVE_PCAP_DUMP_FLUSH #define U_FLAG "U" #else #define U_FLAG #endif #ifndef WIN32 /* Drop root privileges and chroot if necessary */ static void droproot(const char *username, const char *chroot_dir) { struct passwd *pw = NULL; if (chroot_dir && !username) { fprintf(stderr, "tcpdump: Chroot without dropping root is insecure\n"); exit(1); } pw = getpwnam(username); if (pw) { if (chroot_dir) { if (chroot(chroot_dir) != 0 || chdir ("/") != 0) { fprintf(stderr, "tcpdump: Couldn't chroot/chdir to '%.64s': %s\n", chroot_dir, pcap_strerror(errno)); exit(1); } } if (initgroups(pw->pw_name, pw->pw_gid) != 0 || setgid(pw->pw_gid) != 0 || setuid(pw->pw_uid) != 0) { fprintf(stderr, "tcpdump: Couldn't change to '%.32s' uid=%lu gid=%lu: %s\n", username, (unsigned long)pw->pw_uid, (unsigned long)pw->pw_gid, pcap_strerror(errno)); exit(1); } } else { fprintf(stderr, "tcpdump: Couldn't find user '%.32s'\n", username); exit(1); } } #endif /* WIN32 */ static int getWflagChars(int x) { int c = 0; x -= 1; while (x > 0) { c += 1; x /= 10; } return c; } static void MakeFilename(char *buffer, char *orig_name, int cnt, int max_chars) { if (cnt == 0 && max_chars == 0) strcpy(buffer, orig_name); else sprintf(buffer, "%s%0*d", orig_name, max_chars, cnt); } static int tcpdump_printf(netdissect_options *ndo _U_, const char *fmt, ...) { va_list args; int ret; va_start(args, fmt); ret=vfprintf(stdout, fmt, args); va_end(args); return ret; } int main(int argc, char **argv) { register int cnt, op, i; bpf_u_int32 localnet, netmask; register char *cp, *infile, *cmdbuf, *device, *RFileName, *WFileName, *WFileNameAlt; pcap_handler callback; int type; struct bpf_program fcode; #ifndef WIN32 RETSIGTYPE (*oldhandler)(int); #endif struct print_info printinfo; struct dump_info dumpinfo; u_char *pcap_userdata; char ebuf[PCAP_ERRBUF_SIZE]; char *username = NULL; char *chroot_dir = NULL; #ifdef HAVE_PCAP_FINDALLDEVS pcap_if_t *devpointer; int devnum; #endif int status; #ifdef WIN32 u_int UserBufferSize = 1000000; if(wsockinit() != 0) return 1; #endif /* WIN32 */ gndo->ndo_Oflag=1; gndo->ndo_Rflag=1; gndo->ndo_dlt=-1; gndo->ndo_default_print=ndo_default_print; gndo->ndo_printf=tcpdump_printf; gndo->ndo_error=ndo_error; gndo->ndo_warning=ndo_warning; gndo->ndo_snaplen = DEFAULT_SNAPLEN; cnt = -1; device = NULL; infile = NULL; RFileName = NULL; WFileName = NULL; if ((cp = strrchr(argv[0], '/')) != NULL) program_name = cp + 1; else program_name = argv[0]; if (abort_on_misalignment(ebuf, sizeof(ebuf)) < 0) error("%s", ebuf); #ifdef LIBSMI smiInit("tcpdump"); #endif opterr = 0; while ( (op = getopt(argc, argv, "aA" B_FLAG "c:C:d" D_FLAG "eE:fF:i:lLm:M:nNOpP:qr:Rs:StT:u" U_FLAG "vw:W:xXy:YZ:")) != -1) switch (op) { case 'a': /* compatibility for old -a */ break; case 'A': ++xflag; ++Xflag; ++Aflag; break; #ifdef WIN32 case 'B': UserBufferSize = atoi(optarg)*1024; if (UserBufferSize < 0) error("invalid packet buffer size %s", optarg); break; #endif /* WIN32 */ case 'c': cnt = atoi(optarg); if (cnt <= 0) error("invalid packet count %s", optarg); break; case 'C': Cflag = atoi(optarg) * 1000000; if (Cflag < 0) error("invalid file size %s", optarg); break; case 'd': ++dflag; break; #ifdef HAVE_PCAP_FINDALLDEVS case 'D': if (pcap_findalldevs(&devpointer, ebuf) < 0) error("%s", ebuf); else { for (i = 0; devpointer != 0; i++) { printf("%d.%s", i+1, devpointer->name); if (devpointer->description != NULL) printf(" (%s)", devpointer->description); printf("\n"); devpointer = devpointer->next; } } return 0; #endif /* HAVE_PCAP_FINDALLDEVS */ case 'L': Lflag++; break; case 'e': ++eflag; break; case 'E': #ifndef HAVE_LIBCRYPTO warning("crypto code not compiled in"); #endif gndo->ndo_espsecret = optarg; break; case 'f': ++fflag; break; case 'F': infile = optarg; break; case 'i': if (optarg[0] == '0' && optarg[1] == 0) error("Invalid adapter index"); #ifdef HAVE_PCAP_FINDALLDEVS /* * If the argument is a number, treat it as * an index into the list of adapters, as * printed by "tcpdump -D". * * This should be OK on UNIX systems, as interfaces * shouldn't have names that begin with digits. * It can be useful on Windows, where more than * one interface can have the same name. */ if ((devnum = atoi(optarg)) != 0) { if (devnum < 0) error("Invalid adapter index"); if (pcap_findalldevs(&devpointer, ebuf) < 0) error("%s", ebuf); else { for (i = 0; i < devnum-1; i++){ devpointer = devpointer->next; if (devpointer == NULL) error("Invalid adapter index"); } } device = devpointer->name; break; } #endif /* HAVE_PCAP_FINDALLDEVS */ device = optarg; break; case 'l': #ifdef WIN32 /* * _IOLBF is the same as _IOFBF in Microsoft's C * libraries; the only alternative they offer * is _IONBF. * * XXX - this should really be checking for MSVC++, * not WIN32, if, for example, MinGW has its own * C library that is more UNIX-compatible. */ setvbuf(stdout, NULL, _IONBF, 0); #else /* WIN32 */ #ifdef HAVE_SETLINEBUF setlinebuf(stdout); #else setvbuf(stdout, NULL, _IOLBF, 0); #endif #endif /* WIN32 */ break; case 'n': ++nflag; break; case 'N': ++Nflag; break; case 'm': #ifdef LIBSMI if (smiLoadModule(optarg) == 0) { error("could not load MIB module %s", optarg); } sflag = 1; #else (void)fprintf(stderr, "%s: ignoring option `-m %s' ", program_name, optarg); (void)fprintf(stderr, "(no libsmi support)\n"); #endif break; case 'M': /* TCP-MD5 shared secret */ #ifndef HAVE_LIBCRYPTO warning("crypto code not compiled in"); #endif tcpmd5secret = optarg; break; case 'O': Oflag = 0; break; case 'p': ++pflag; break; case 'q': ++qflag; break; case 'r': RFileName = optarg; break; case 'R': Rflag = 0; break; case 's': { char *end; snaplen = strtol(optarg, &end, 0); if (optarg == end || *end != '\0' || snaplen < 0 || snaplen > 65535) error("invalid snaplen %s", optarg); else if (snaplen == 0) snaplen = 65535; break; } case 'S': ++Sflag; break; case 't': ++tflag; break; case 'T': if (strcasecmp(optarg, "vat") == 0) packettype = PT_VAT; else if (strcasecmp(optarg, "wb") == 0) packettype = PT_WB; else if (strcasecmp(optarg, "rpc") == 0) packettype = PT_RPC; else if (strcasecmp(optarg, "rtp") == 0) packettype = PT_RTP; else if (strcasecmp(optarg, "rtcp") == 0) packettype = PT_RTCP; else if (strcasecmp(optarg, "snmp") == 0) packettype = PT_SNMP; else if (strcasecmp(optarg, "cnfp") == 0) packettype = PT_CNFP; else if (strcasecmp(optarg, "tftp") == 0) packettype = PT_TFTP; else if (strcasecmp(optarg, "aodv") == 0) packettype = PT_AODV; else error("unknown packet type `%s'", optarg); break; case 'u': ++uflag; break; #ifdef HAVE_PCAP_DUMP_FLUSH case 'U': ++Uflag; break; #endif case 'v': ++vflag; break; case 'w': WFileName = optarg; break; case 'W': Wflag = atoi(optarg); if (Wflag < 0) error("invalid number of output files %s", optarg); WflagChars = getWflagChars(Wflag); break; case 'x': ++xflag; break; case 'X': ++Xflag; break; case 'y': gndo->ndo_dltname = optarg; gndo->ndo_dlt = pcap_datalink_name_to_val(gndo->ndo_dltname); if (gndo->ndo_dlt < 0) error("invalid data link type %s", gndo->ndo_dltname); break; #if defined(HAVE_PCAP_DEBUG) || defined(HAVE_YYDEBUG) case 'Y': { /* Undocumented flag */ #ifdef HAVE_PCAP_DEBUG extern int pcap_debug; pcap_debug = 1; #else extern int yydebug; yydebug = 1; #endif } break; #endif case 'Z': if (optarg) { username = strdup(optarg); } else { usage(); /* NOTREACHED */ } break; default: usage(); /* NOTREACHED */ } switch (tflag) { case 0: /* Default */ case 4: /* Default + Date*/ thiszone = gmt2local(0); break; case 1: /* No time stamp */ case 2: /* Unix timeval style */ case 3: /* Microseconds since previous packet */ break; default: /* Not supported */ error("only -t, -tt, -ttt, and -tttt are supported"); break; } #ifdef WITH_CHROOT /* if run as root, prepare for chrooting */ if (getuid() == 0 || geteuid() == 0) { /* future extensibility for cmd-line arguments */ if (!chroot_dir) chroot_dir = WITH_CHROOT; } #endif #ifdef WITH_USER /* if run as root, prepare for dropping root privileges */ if (getuid() == 0 || geteuid() == 0) { /* Run with '-Z root' to restore old behaviour */ if (!username) username = WITH_USER; } #endif if (RFileName != NULL) { int dlt; const char *dlt_name; #ifndef WIN32 /* * We don't need network access, so relinquish any set-UID * or set-GID privileges we have (if any). * * We do *not* want set-UID privileges when opening a * trace file, as that might let the user read other * people's trace files (especially if we're set-UID * root). */ if (setgid(getgid()) != 0 || setuid(getuid()) != 0 ) fprintf(stderr, "Warning: setgid/setuid failed !\n"); #endif /* WIN32 */ pd = pcap_open_offline(RFileName, ebuf); if (pd == NULL) error("%s", ebuf); dlt = pcap_datalink(pd); dlt_name = pcap_datalink_val_to_name(dlt); if (dlt_name == NULL) { fprintf(stderr, "reading from file %s, link-type %u\n", RFileName, dlt); } else { fprintf(stderr, "reading from file %s, link-type %s (%s)\n", RFileName, dlt_name, pcap_datalink_val_to_description(dlt)); } localnet = 0; netmask = 0; if (fflag != 0) error("-f and -r options are incompatible"); } else { if (device == NULL) { device = pcap_lookupdev(ebuf); if (device == NULL) error("%s", ebuf); } #ifdef WIN32 if(strlen(device) == 1) //we assume that an ASCII string is always longer than 1 char { //a Unicode string has a \0 as second byte (so strlen() is 1) fprintf(stderr, "%s: listening on %ws\n", program_name, device); } else { fprintf(stderr, "%s: listening on %s\n", program_name, device); } fflush(stderr); #endif /* WIN32 */ *ebuf = '\0'; pd = pcap_open_live(device, snaplen, !pflag, 1000, ebuf); if (pd == NULL) error("%s", ebuf); else if (*ebuf) warning("%s", ebuf); /* * Let user own process after socket has been opened. */ #ifndef WIN32 if (setgid(getgid()) != 0 || setuid(getuid()) != 0) fprintf(stderr, "Warning: setgid/setuid failed !\n"); #endif /* WIN32 */ #ifdef WIN32 if(UserBufferSize != 1000000) if(pcap_setbuff(pd, UserBufferSize)==-1){ error("%s", pcap_geterr(pd)); } #endif /* WIN32 */ if (Lflag) show_dlts_and_exit(pd); if (gndo->ndo_dlt >= 0) { #ifdef HAVE_PCAP_SET_DATALINK if (pcap_set_datalink(pd, gndo->ndo_dlt) < 0) error("%s", pcap_geterr(pd)); #else /* * We don't actually support changing the * data link type, so we only let them * set it to what it already is. */ if (gndo->ndo_dlt != pcap_datalink(pd)) { error("%s is not one of the DLTs supported by this device\n", gndo->ndo_dltname); } #endif (void)fprintf(stderr, "%s: data link type %s\n", program_name, gndo->ndo_dltname); (void)fflush(stderr); } i = pcap_snapshot(pd); if (snaplen < i) { warning("snaplen raised from %d to %d", snaplen, i); snaplen = i; } if (pcap_lookupnet(device, &localnet, &netmask, ebuf) < 0) { localnet = 0; netmask = 0; warning("%s", ebuf); } } if (infile) cmdbuf = read_infile(infile); else cmdbuf = copy_argv(&argv[optind]); if (pcap_compile(pd, &fcode, cmdbuf, Oflag, netmask) < 0) error("%s", pcap_geterr(pd)); if (dflag) { bpf_dump(&fcode, dflag); pcap_close(pd); exit(0); } init_addrtoname(localnet, netmask); #ifndef WIN32 (void)setsignal(SIGPIPE, cleanup); #endif /* WIN32 */ (void)setsignal(SIGTERM, cleanup); (void)setsignal(SIGINT, cleanup); /* Cooperate with nohup(1) */ #ifndef WIN32 if ((oldhandler = setsignal(SIGHUP, cleanup)) != SIG_DFL) (void)setsignal(SIGHUP, oldhandler); #endif /* WIN32 */ if (pcap_setfilter(pd, &fcode) < 0) error("%s", pcap_geterr(pd)); if (WFileName) { pcap_dumper_t *p; WFileNameAlt = (char *)malloc(strlen(WFileName) + MAX_CFLAG_CHARS + 1); if (WFileNameAlt == NULL) error("malloc of WFileNameAlt"); MakeFilename(WFileNameAlt, WFileName, 0, WflagChars); p = pcap_dump_open(pd, WFileNameAlt); if (p == NULL) error("%s", pcap_geterr(pd)); if (Cflag != 0) { callback = dump_packet_and_trunc; dumpinfo.WFileName = WFileName; dumpinfo.pd = pd; dumpinfo.p = p; pcap_userdata = (u_char *)&dumpinfo; } else { callback = dump_packet; pcap_userdata = (u_char *)p; } } else { type = pcap_datalink(pd); printinfo.printer = lookup_printer(type); if (printinfo.printer == NULL) { gndo->ndo_dltname = pcap_datalink_val_to_name(type); if (gndo->ndo_dltname != NULL) error("unsupported data link type %s", gndo->ndo_dltname); else error("unsupported data link type %d", type); } callback = print_packet; pcap_userdata = (u_char *)&printinfo; } #ifndef WIN32 /* * We cannot do this earlier, because we want to be able to open * the file (if done) for writing before giving up permissions. */ if (getuid() == 0 || geteuid() == 0) { if (username || chroot_dir) droproot(username, chroot_dir); } #endif /* WIN32 */ #ifdef SIGINFO (void)setsignal(SIGINFO, requestinfo); #endif if (vflag > 0 && WFileName) { /* * When capturing to a file, "-v" means tcpdump should, * every 10 secodns, "v"erbosely report the number of * packets captured. */ #ifdef USE_WIN32_MM_TIMER /* call verbose_stats_dump() each 1000 +/-100msec */ timer_id = timeSetEvent(1000, 100, verbose_stats_dump, 0, TIME_PERIODIC); setvbuf(stderr, NULL, _IONBF, 0); #elif defined(HAVE_ALARM) (void)setsignal(SIGALRM, verbose_stats_dump); alarm(1); #endif } #ifndef WIN32 if (RFileName == NULL) { int dlt; const char *dlt_name; if (!vflag && !WFileName) { (void)fprintf(stderr, "%s: verbose output suppressed, use -v or -vv for full protocol decode\n", program_name); } else (void)fprintf(stderr, "%s: ", program_name); dlt = pcap_datalink(pd); dlt_name = pcap_datalink_val_to_name(dlt); if (dlt_name == NULL) { (void)fprintf(stderr, "listening on %s, link-type %u, capture size %u bytes\n", device, dlt, snaplen); } else { (void)fprintf(stderr, "listening on %s, link-type %s (%s), capture size %u bytes\n", device, dlt_name, pcap_datalink_val_to_description(dlt), snaplen); } (void)fflush(stderr); } #endif /* WIN32 */ status = pcap_loop(pd, cnt, callback, pcap_userdata); if (WFileName == NULL) { /* * We're printing packets. Flush the printed output, * so it doesn't get intermingled with error output. */ if (status == -2) { /* * We got interrupted, so perhaps we didn't * manage to finish a line we were printing. * Print an extra newline, just in case. */ putchar('\n'); } (void)fflush(stdout); } if (status == -1) { /* * Error. Report it. */ (void)fprintf(stderr, "%s: pcap_loop: %s\n", program_name, pcap_geterr(pd)); } if (RFileName == NULL) { /* * We're doing a live capture. Report the capture * statistics. */ info(1); } pcap_close(pd); exit(status == -1 ? 1 : 0); } /* make a clean exit on interrupts */ static RETSIGTYPE cleanup(int signo _U_) { #ifdef USE_WIN32_MM_TIMER if (timer_id) timeKillEvent(timer_id); timer_id = 0; #elif defined(HAVE_ALARM) alarm(0); #endif #ifdef HAVE_PCAP_BREAKLOOP /* * We have "pcap_breakloop()"; use it, so that we do as little * as possible in the signal handler (it's probably not safe * to do anything with standard I/O streams in a signal handler - * the ANSI C standard doesn't say it is). */ pcap_breakloop(pd); #else /* * We don't have "pcap_breakloop()"; this isn't safe, but * it's the best we can do. Print the summary if we're * not reading from a savefile - i.e., if we're doing a * live capture - and exit. */ if (pd != NULL && pcap_file(pd) == NULL) { /* * We got interrupted, so perhaps we didn't * manage to finish a line we were printing. * Print an extra newline, just in case. */ putchar('\n'); (void)fflush(stdout); info(1); } exit(0); #endif } static void info(register int verbose) { struct pcap_stat stat; if (pcap_stats(pd, &stat) < 0) { (void)fprintf(stderr, "pcap_stats: %s\n", pcap_geterr(pd)); return; } if (!verbose) fprintf(stderr, "%s: ", program_name); (void)fprintf(stderr, "%u packets captured", packets_captured); if (!verbose) fputs(", ", stderr); else putc('\n', stderr); (void)fprintf(stderr, "%d packets received by filter", stat.ps_recv); if (!verbose) fputs(", ", stderr); else putc('\n', stderr); (void)fprintf(stderr, "%d packets dropped by kernel\n", stat.ps_drop); infoprint = 0; } static void dump_packet_and_trunc(u_char *user, const struct pcap_pkthdr *h, const u_char *sp) { struct dump_info *dump_info; char *name; ++packets_captured; ++infodelay; dump_info = (struct dump_info *)user; /* * XXX - this won't prevent capture files from getting * larger than Cflag - the last packet written to the * file could put it over Cflag. */ if (ftell((FILE *)dump_info->p) > Cflag) { /* * Close the current file and open a new one. */ pcap_dump_close(dump_info->p); Cflag_count++; if (Wflag > 0) { if (Cflag_count >= Wflag) Cflag_count = 0; } else { if (Cflag_count >= MAX_CFLAG) error("too many output files"); } name = (char *)malloc(strlen(dump_info->WFileName) + MAX_CFLAG_CHARS + 1); if (name == NULL) error("dump_packet_and_trunc: malloc"); MakeFilename(name, dump_info->WFileName, Cflag_count, WflagChars); dump_info->p = pcap_dump_open(dump_info->pd, name); free(name); if (dump_info->p == NULL) error("%s", pcap_geterr(pd)); } pcap_dump((u_char *)dump_info->p, h, sp); #ifdef HAVE_PCAP_DUMP_FLUSH if (Uflag) pcap_dump_flush(dump_info->p); #endif --infodelay; if (infoprint) info(0); } static void dump_packet(u_char *user, const struct pcap_pkthdr *h, const u_char *sp) { ++packets_captured; ++infodelay; pcap_dump(user, h, sp); #ifdef HAVE_PCAP_DUMP_FLUSH if (Uflag) pcap_dump_flush((pcap_dumper_t *)user); #endif --infodelay; if (infoprint) info(0); } static void print_packet(u_char *user, const struct pcap_pkthdr *h, const u_char *sp) { struct print_info *print_info; u_int hdrlen; ++packets_captured; ++infodelay; ts_print(&h->ts); print_info = (struct print_info *)user; /* * Some printers want to check that they're not walking off the * end of the packet. * Rather than pass it all the way down, we set this global. */ snapend = sp + h->caplen; hdrlen = (*print_info->printer)(h, sp); if (xflag) { /* * Print the raw packet data. */ if (xflag > 1) { /* * Include the link-layer header. */ hex_print("\n\t", sp, h->caplen); } else { /* * Don't include the link-layer header - and if * we have nothing past the link-layer header, * print nothing. */ if (h->caplen > hdrlen) hex_print("\n\t", sp + hdrlen, h->caplen - hdrlen); } } else if (Xflag) { /* * Print the raw packet data. */ if (Xflag > 1) { /* * Include the link-layer header. */ ascii_print("\n\t", sp, h->caplen); } else { /* * Don't include the link-layer header - and if * we have nothing past the link-layer header, * print nothing. */ if (h->caplen > hdrlen) ascii_print("\n\t", sp + hdrlen, h->caplen - hdrlen); } } putchar('\n'); --infodelay; if (infoprint) info(0); } #ifdef WIN32 /* * XXX - there should really be libpcap calls to get the version * number as a string (the string would be generated from #defines * at run time, so that it's not generated from string constants * in the library, as, on many UNIX systems, those constants would * be statically linked into the application executable image, and * would thus reflect the version of libpcap on the system on * which the application was *linked*, not the system on which it's * *running*. * * That routine should be documented, unlike the "version[]" * string, so that UNIX vendors providing their own libpcaps * don't omit it (as a couple of vendors have...). * * Packet.dll should perhaps also export a routine to return the * version number of the Packet.dll code, to supply the * "Wpcap_version" information on Windows. */ char WDversion[]="current-cvs.tcpdump.org"; #if !defined(HAVE_GENERATED_VERSION) char version[]="current-cvs.tcpdump.org"; #endif char pcap_version[]="current-cvs.tcpdump.org"; char Wpcap_version[]="3.1"; #endif /* * By default, print the specified data out in hex. */ static void ndo_default_print(netdissect_options *ndo _U_, const u_char *bp, u_int length) { ascii_print("\n\t", bp, length); /* pass on lf and identation string */ } void default_print(const u_char *bp, u_int length) { ndo_default_print(gndo, bp, length); } #ifdef SIGINFO RETSIGTYPE requestinfo(int signo _U_) { if (infodelay) ++infoprint; else info(0); } #endif /* * Called once each second in verbose mode while dumping to file */ #ifdef USE_WIN32_MM_TIMER void CALLBACK verbose_stats_dump (UINT timer_id _U_, UINT msg _U_, DWORD_PTR arg _U_, DWORD_PTR dw1 _U_, DWORD_PTR dw2 _U_) { struct pcap_stat stat; if (infodelay == 0 && pcap_stats(pd, &stat) >= 0) fprintf(stderr, "Got %u\r", packets_captured); } #elif defined(HAVE_ALARM) static void verbose_stats_dump(int sig _U_) { struct pcap_stat stat; if (infodelay == 0 && pcap_stats(pd, &stat) >= 0) fprintf(stderr, "Got %u\r", packets_captured); alarm(1); } #endif static void usage(void) { extern char version[]; #ifndef HAVE_PCAP_LIB_VERSION #if defined(WIN32) || defined(HAVE_PCAP_VERSION) extern char pcap_version[]; #else /* defined(WIN32) || defined(HAVE_PCAP_VERSION) */ static char pcap_version[] = "unknown"; #endif /* defined(WIN32) || defined(HAVE_PCAP_VERSION) */ #endif /* HAVE_PCAP_LIB_VERSION */ #ifdef HAVE_PCAP_LIB_VERSION #ifdef WIN32 (void)fprintf(stderr, "%s version %s, based on tcpdump version %s\n", program_name, WDversion, version); #else /* WIN32 */ (void)fprintf(stderr, "%s version %s\n", program_name, version); #endif /* WIN32 */ (void)fprintf(stderr, "%s\n",pcap_lib_version()); #else /* HAVE_PCAP_LIB_VERSION */ #ifdef WIN32 (void)fprintf(stderr, "%s version %s, based on tcpdump version %s\n", program_name, WDversion, version); (void)fprintf(stderr, "WinPcap version %s, based on libpcap version %s\n",Wpcap_version, pcap_version); #else /* WIN32 */ (void)fprintf(stderr, "%s version %s\n", program_name, version); (void)fprintf(stderr, "libpcap version %s\n", pcap_version); #endif /* WIN32 */ #endif /* HAVE_PCAP_LIB_VERSION */ (void)fprintf(stderr, "Usage: %s [-aAd" D_FLAG "eflLnNOpqRStu" U_FLAG "vxX]" B_FLAG_USAGE " [-c count] [ -C file_size ]\n", program_name); (void)fprintf(stderr, "\t\t[ -E algo:secret ] [ -F file ] [ -i interface ] [ -M secret ]\n"); (void)fprintf(stderr, "\t\t[ -r file ] [ -s snaplen ] [ -T type ] [ -w file ]\n"); (void)fprintf(stderr, "\t\t[ -W filecount ] [ -y datalinktype ] [ -Z user ]\n"); (void)fprintf(stderr, "\t\t[ expression ]\n"); exit(1); } /* VARARGS */ static void ndo_error(netdissect_options *ndo _U_, const char *fmt, ...) { va_list ap; (void)fprintf(stderr, "%s: ", program_name); va_start(ap, fmt); (void)vfprintf(stderr, fmt, ap); va_end(ap); if (*fmt) { fmt += strlen(fmt); if (fmt[-1] != '\n') (void)fputc('\n', stderr); } exit(1); /* NOTREACHED */ } /* VARARGS */ static void ndo_warning(netdissect_options *ndo _U_, const char *fmt, ...) { va_list ap; (void)fprintf(stderr, "%s: WARNING: ", program_name); va_start(ap, fmt); (void)vfprintf(stderr, fmt, ap); va_end(ap); if (*fmt) { fmt += strlen(fmt); if (fmt[-1] != '\n') (void)fputc('\n', stderr); } } tcpdump-3.9.8/./print-slow.c0000644000026300017500000002177510264232434013764 0ustar mcrmcr/* * Copyright (c) 1998-2005 The TCPDUMP project * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that: (1) source code * distributions retain the above copyright notice and this paragraph * in its entirety, and (2) distributions including binary code include * the above copyright notice and this paragraph in its entirety in * the documentation or other materials provided with the distribution. * THIS SOFTWARE IS PROVIDED ``AS IS'' AND * WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT * LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * FOR A PARTICULAR PURPOSE. * * support for the IEEE "slow protocols" LACP, MARKER as per 802.3ad * * Original code by Hannes Gredler (hannes@juniper.net) */ #ifndef lint static const char rcsid[] _U_ = "@(#) $Header: /tcpdump/master/tcpdump/print-slow.c,v 1.1.2.1 2005/07/10 14:47:56 hannes Exp $"; #endif #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include #include #include "interface.h" #include "extract.h" #include "addrtoname.h" #include "ether.h" struct slow_common_header { u_int8_t proto_subtype; u_int8_t version; }; #define SLOW_PROTO_LACP 1 #define SLOW_PROTO_MARKER 2 #define LACP_VERSION 1 #define MARKER_VERSION 1 static const struct tok slow_proto_values[] = { { SLOW_PROTO_LACP, "LACP" }, { SLOW_PROTO_MARKER, "MARKER" }, { 0, NULL} }; struct tlv_header_t { u_int8_t type; u_int8_t length; }; #define LACP_TLV_TERMINATOR 0x00 #define LACP_TLV_ACTOR_INFO 0x01 #define LACP_TLV_PARTNER_INFO 0x02 #define LACP_TLV_COLLECTOR_INFO 0x03 #define MARKER_TLV_TERMINATOR 0x00 #define MARKER_TLV_MARKER_INFO 0x01 static const struct tok slow_tlv_values[] = { { (SLOW_PROTO_LACP << 8) + LACP_TLV_TERMINATOR, "Terminator"}, { (SLOW_PROTO_LACP << 8) + LACP_TLV_ACTOR_INFO, "Actor Information"}, { (SLOW_PROTO_LACP << 8) + LACP_TLV_PARTNER_INFO, "Partner Information"}, { (SLOW_PROTO_LACP << 8) + LACP_TLV_COLLECTOR_INFO, "Collector Information"}, { (SLOW_PROTO_MARKER << 8) + MARKER_TLV_TERMINATOR, "Terminator"}, { (SLOW_PROTO_MARKER << 8) + MARKER_TLV_MARKER_INFO, "Marker Information"}, { 0, NULL} }; struct lacp_tlv_actor_partner_info_t { u_int8_t sys_pri[2]; u_int8_t sys[ETHER_ADDR_LEN]; u_int8_t key[2]; u_int8_t port_pri[2]; u_int8_t port[2]; u_int8_t state; u_int8_t pad[3]; }; static const struct tok lacp_tlv_actor_partner_info_state_values[] = { { 0x01, "Activity"}, { 0x02, "Timeout"}, { 0x04, "Aggregation"}, { 0x08, "Synchronization"}, { 0x10, "Collecting"}, { 0x20, "Distributing"}, { 0x40, "Default"}, { 0x80, "Expired"}, { 0, NULL} }; struct lacp_tlv_collector_info_t { u_int8_t max_delay[2]; u_int8_t pad[12]; }; struct marker_tlv_marker_info_t { u_int8_t req_port[2]; u_int8_t req_sys[ETHER_ADDR_LEN]; u_int8_t req_trans_id[4]; u_int8_t pad[2]; }; struct lacp_marker_tlv_terminator_t { u_int8_t pad[50]; }; void slow_print(register const u_char *pptr, register u_int len) { const struct slow_common_header *slow_com_header; const struct tlv_header_t *tlv_header; const u_char *tptr,*tlv_tptr; u_int tlv_len,tlen,tlv_tlen; union { const struct lacp_marker_tlv_terminator_t *lacp_marker_tlv_terminator; const struct lacp_tlv_actor_partner_info_t *lacp_tlv_actor_partner_info; const struct lacp_tlv_collector_info_t *lacp_tlv_collector_info; const struct marker_tlv_marker_info_t *marker_tlv_marker_info; } tlv_ptr; tptr=pptr; slow_com_header = (const struct slow_common_header *)pptr; TCHECK(*slow_com_header); /* * Sanity checking of the header. */ if (slow_com_header->proto_subtype == SLOW_PROTO_LACP && slow_com_header->version != LACP_VERSION) { printf("LACP version %u packet not supported",slow_com_header->version); return; } if (slow_com_header->proto_subtype == SLOW_PROTO_MARKER && slow_com_header->version != MARKER_VERSION) { printf("MARKER version %u packet not supported",slow_com_header->version); return; } printf("%sv%u, length: %u", tok2str(slow_proto_values, "unknown (%u)",slow_com_header->proto_subtype), slow_com_header->version, len); if (!vflag) return; /* ok they seem to want to know everything - lets fully decode it */ tlen=len-sizeof(struct slow_common_header); tptr+=sizeof(const struct slow_common_header); while(tlen>0) { /* did we capture enough for fully decoding the tlv header ? */ TCHECK2(*tptr, sizeof(struct tlv_header_t)); tlv_header = (const struct tlv_header_t *)tptr; tlv_len = tlv_header->length; printf("\n\t%s TLV (0x%02x), length: %u", tok2str(slow_tlv_values, "Unknown", (slow_com_header->proto_subtype << 8) + tlv_header->type), tlv_header->type, tlv_len); if ((tlv_len < sizeof(struct tlv_header_t) || tlv_len > tlen) && tlv_header->type != LACP_TLV_TERMINATOR && tlv_header->type != MARKER_TLV_TERMINATOR) { printf("\n\t-----trailing data-----"); print_unknown_data(tptr+sizeof(sizeof(struct tlv_header_t)),"\n\t ",tlen); return; } tlv_tptr=tptr+sizeof(struct tlv_header_t); tlv_tlen=tlv_len-sizeof(struct tlv_header_t); /* did we capture enough for fully decoding the tlv ? */ TCHECK2(*tptr, tlv_len); switch((slow_com_header->proto_subtype << 8) + tlv_header->type) { /* those two TLVs have the same structure -> fall through */ case ((SLOW_PROTO_LACP << 8) + LACP_TLV_ACTOR_INFO): case ((SLOW_PROTO_LACP << 8) + LACP_TLV_PARTNER_INFO): tlv_ptr.lacp_tlv_actor_partner_info = (const struct lacp_tlv_actor_partner_info_t *)tlv_tptr; printf("\n\t System %s, System Priority %u, Key %u" \ ", Port %u, Port Priority %u\n\t State Flags [%s]", etheraddr_string(tlv_ptr.lacp_tlv_actor_partner_info->sys), EXTRACT_16BITS(tlv_ptr.lacp_tlv_actor_partner_info->sys_pri), EXTRACT_16BITS(tlv_ptr.lacp_tlv_actor_partner_info->key), EXTRACT_16BITS(tlv_ptr.lacp_tlv_actor_partner_info->port), EXTRACT_16BITS(tlv_ptr.lacp_tlv_actor_partner_info->port_pri), bittok2str(lacp_tlv_actor_partner_info_state_values, "none", tlv_ptr.lacp_tlv_actor_partner_info->state)); break; case ((SLOW_PROTO_LACP << 8) + LACP_TLV_COLLECTOR_INFO): tlv_ptr.lacp_tlv_collector_info = (const struct lacp_tlv_collector_info_t *)tlv_tptr; printf("\n\t Max Delay %u", EXTRACT_16BITS(tlv_ptr.lacp_tlv_collector_info->max_delay)); break; case ((SLOW_PROTO_MARKER << 8) + MARKER_TLV_MARKER_INFO): tlv_ptr.marker_tlv_marker_info = (const struct marker_tlv_marker_info_t *)tlv_tptr; printf("\n\t Request System %s, Request Port %u, Request Transaction ID 0x%08x", etheraddr_string(tlv_ptr.marker_tlv_marker_info->req_sys), EXTRACT_16BITS(tlv_ptr.marker_tlv_marker_info->req_port), EXTRACT_32BITS(tlv_ptr.marker_tlv_marker_info->req_trans_id)); break; /* those two TLVs have the same structure -> fall through */ case ((SLOW_PROTO_LACP << 8) + LACP_TLV_TERMINATOR): case ((SLOW_PROTO_MARKER << 8) + LACP_TLV_TERMINATOR): tlv_ptr.lacp_marker_tlv_terminator = (const struct lacp_marker_tlv_terminator_t *)tlv_tptr; if (tlv_len == 0) { tlv_len = sizeof(tlv_ptr.lacp_marker_tlv_terminator->pad) + sizeof(struct tlv_header_t); /* tell the user that we modified the length field */ if (vflag>1) printf(" (=%u)",tlv_len); /* we have messed around with the length field - now we need to check * again if there are enough bytes on the wire for the hexdump */ TCHECK2(tlv_ptr.lacp_marker_tlv_terminator->pad[0], sizeof(tlv_ptr.lacp_marker_tlv_terminator->pad)); } break; default: if (vflag <= 1) print_unknown_data(tlv_tptr,"\n\t ",tlv_tlen); break; } /* do we want to see an additionally hexdump ? */ if (vflag > 1) print_unknown_data(tptr+sizeof(sizeof(struct tlv_header_t)),"\n\t ", tlv_len-sizeof(struct tlv_header_t)); tptr+=tlv_len; tlen-=tlv_len; } return; trunc: printf("\n\t\t packet exceeded snapshot"); } tcpdump-3.9.8/./smbutil.c0000644000026300017500000017415510651260273013330 0ustar mcrmcr/* * Copyright (C) Andrew Tridgell 1995-1999 * * This software may be distributed either under the terms of the * BSD-style license that accompanies tcpdump or the GNU GPL version 2 * or later */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #ifndef lint static const char rcsid[] _U_ = "@(#) $Header: /tcpdump/master/tcpdump/smbutil.c,v 1.36.2.3 2007/07/15 19:08:25 guy Exp $"; #endif #include #include #include #include #include "interface.h" #include "extract.h" #include "smb.h" static u_int32_t stringlen; extern const u_char *startbuf; /* * interpret a 32 bit dos packed date/time to some parameters */ static void interpret_dos_date(u_int32_t date, struct tm *tp) { u_int32_t p0, p1, p2, p3; p0 = date & 0xFF; p1 = ((date & 0xFF00) >> 8) & 0xFF; p2 = ((date & 0xFF0000) >> 16) & 0xFF; p3 = ((date & 0xFF000000) >> 24) & 0xFF; tp->tm_sec = 2 * (p0 & 0x1F); tp->tm_min = ((p0 >> 5) & 0xFF) + ((p1 & 0x7) << 3); tp->tm_hour = (p1 >> 3) & 0xFF; tp->tm_mday = (p2 & 0x1F); tp->tm_mon = ((p2 >> 5) & 0xFF) + ((p3 & 0x1) << 3) - 1; tp->tm_year = ((p3 >> 1) & 0xFF) + 80; } /* * common portion: * create a unix date from a dos date */ static time_t int_unix_date(u_int32_t dos_date) { struct tm t; if (dos_date == 0) return(0); interpret_dos_date(dos_date, &t); t.tm_wday = 1; t.tm_yday = 1; t.tm_isdst = 0; return (mktime(&t)); } /* * create a unix date from a dos date * in network byte order */ static time_t make_unix_date(const u_char *date_ptr) { u_int32_t dos_date = 0; dos_date = EXTRACT_LE_32BITS(date_ptr); return int_unix_date(dos_date); } /* * create a unix date from a dos date * in halfword-swapped network byte order! */ static time_t make_unix_date2(const u_char *date_ptr) { u_int32_t x, x2; x = EXTRACT_LE_32BITS(date_ptr); x2 = ((x & 0xFFFF) << 16) | ((x & 0xFFFF0000) >> 16); return int_unix_date(x2); } /* * interpret an 8 byte "filetime" structure to a time_t * It's originally in "100ns units since jan 1st 1601" */ static time_t interpret_long_date(const u_char *p) { double d; time_t ret; /* this gives us seconds since jan 1st 1601 (approx) */ d = (EXTRACT_LE_32BITS(p + 4) * 256.0 + p[3]) * (1.0e-7 * (1 << 24)); /* now adjust by 369 years to make the secs since 1970 */ d -= 369.0 * 365.25 * 24 * 60 * 60; /* and a fudge factor as we got it wrong by a few days */ d += (3 * 24 * 60 * 60 + 6 * 60 * 60 + 2); if (d < 0) return(0); ret = (time_t)d; return(ret); } /* * interpret the weird netbios "name". Return the name type, or -1 if * we run past the end of the buffer */ static int name_interpret(const u_char *in, const u_char *maxbuf, char *out) { int ret; int len; if (in >= maxbuf) return(-1); /* name goes past the end of the buffer */ TCHECK2(*in, 1); len = (*in++) / 2; *out=0; if (len > 30 || len < 1) return(0); while (len--) { TCHECK2(*in, 2); if (in + 1 >= maxbuf) return(-1); /* name goes past the end of the buffer */ if (in[0] < 'A' || in[0] > 'P' || in[1] < 'A' || in[1] > 'P') { *out = 0; return(0); } *out = ((in[0] - 'A') << 4) + (in[1] - 'A'); in += 2; out++; } *out = 0; ret = out[-1]; return(ret); trunc: return(-1); } /* * find a pointer to a netbios name */ static const u_char * name_ptr(const u_char *buf, int ofs, const u_char *maxbuf) { const u_char *p; u_char c; p = buf + ofs; if (p >= maxbuf) return(NULL); /* name goes past the end of the buffer */ TCHECK2(*p, 1); c = *p; /* XXX - this should use the same code that the DNS dissector does */ if ((c & 0xC0) == 0xC0) { u_int16_t l; TCHECK2(*p, 2); if ((p + 1) >= maxbuf) return(NULL); /* name goes past the end of the buffer */ l = EXTRACT_16BITS(p) & 0x3FFF; if (l == 0) { /* We have a pointer that points to itself. */ return(NULL); } p = buf + l; if (p >= maxbuf) return(NULL); /* name goes past the end of the buffer */ TCHECK2(*p, 1); } return(p); trunc: return(NULL); /* name goes past the end of the buffer */ } /* * extract a netbios name from a buf */ static int name_extract(const u_char *buf, int ofs, const u_char *maxbuf, char *name) { const u_char *p = name_ptr(buf, ofs, maxbuf); if (p == NULL) return(-1); /* error (probably name going past end of buffer) */ name[0] = '\0'; return(name_interpret(p, maxbuf, name)); } /* * return the total storage length of a mangled name */ static int name_len(const unsigned char *s, const unsigned char *maxbuf) { const unsigned char *s0 = s; unsigned char c; if (s >= maxbuf) return(-1); /* name goes past the end of the buffer */ TCHECK2(*s, 1); c = *s; if ((c & 0xC0) == 0xC0) return(2); while (*s) { if (s >= maxbuf) return(-1); /* name goes past the end of the buffer */ TCHECK2(*s, 1); s += (*s) + 1; } return(PTR_DIFF(s, s0) + 1); trunc: return(-1); /* name goes past the end of the buffer */ } static void print_asc(const unsigned char *buf, int len) { int i; for (i = 0; i < len; i++) safeputchar(buf[i]); } static const char * name_type_str(int name_type) { const char *f = NULL; switch (name_type) { case 0: f = "Workstation"; break; case 0x03: f = "Client?"; break; case 0x20: f = "Server"; break; case 0x1d: f = "Master Browser"; break; case 0x1b: f = "Domain Controller"; break; case 0x1e: f = "Browser Server"; break; default: f = "Unknown"; break; } return(f); } void print_data(const unsigned char *buf, int len) { int i = 0; if (len <= 0) return; printf("[%03X] ", i); for (i = 0; i < len; /*nothing*/) { TCHECK(buf[i]); printf("%02X ", buf[i] & 0xff); i++; if (i%8 == 0) printf(" "); if (i % 16 == 0) { print_asc(&buf[i - 16], 8); printf(" "); print_asc(&buf[i - 8], 8); printf("\n"); if (i < len) printf("[%03X] ", i); } } if (i % 16) { int n; n = 16 - (i % 16); printf(" "); if (n>8) printf(" "); while (n--) printf(" "); n = SMBMIN(8, i % 16); print_asc(&buf[i - (i % 16)], n); printf(" "); n = (i % 16) - n; if (n > 0) print_asc(&buf[i - n], n); printf("\n"); } return; trunc: printf("\n"); printf("WARNING: Short packet. Try increasing the snap length\n"); } static void write_bits(unsigned int val, const char *fmt) { const char *p = fmt; int i = 0; while ((p = strchr(fmt, '|'))) { size_t l = PTR_DIFF(p, fmt); if (l && (val & (1 << i))) printf("%.*s ", (int)l, fmt); fmt = p + 1; i++; } } /* convert a UCS2 string into iso-8859-1 string */ #define MAX_UNISTR_SIZE 1000 static const char * unistr(const u_char *s, u_int32_t *len, int use_unicode) { static char buf[MAX_UNISTR_SIZE+1]; size_t l = 0; u_int32_t strsize; const u_char *sp; if (use_unicode) { /* * Skip padding that puts the string on an even boundary. */ if (((s - startbuf) % 2) != 0) { TCHECK(s[0]); s++; } } if (*len == 0) { /* * Null-terminated string. */ strsize = 0; sp = s; if (!use_unicode) { for (;;) { TCHECK(sp[0]); *len += 1; if (sp[0] == 0) break; sp++; } strsize = *len - 1; } else { for (;;) { TCHECK2(sp[0], 2); *len += 2; if (sp[0] == 0 && sp[1] == 0) break; sp += 2; } strsize = *len - 2; } } else { /* * Counted string. */ strsize = *len; } if (!use_unicode) { while (strsize != 0) { TCHECK(s[0]); if (l >= MAX_UNISTR_SIZE) break; if (isprint(s[0])) buf[l] = s[0]; else { if (s[0] == 0) break; buf[l] = '.'; } l++; s++; strsize--; } } else { while (strsize != 0) { TCHECK2(s[0], 2); if (l >= MAX_UNISTR_SIZE) break; if (s[1] == 0 && isprint(s[0])) { /* It's a printable ASCII character */ buf[l] = s[0]; } else { /* It's a non-ASCII character or a non-printable ASCII character */ if (s[0] == 0 && s[1] == 0) break; buf[l] = '.'; } l++; s += 2; if (strsize == 1) break; strsize -= 2; } } buf[l] = 0; return buf; trunc: return NULL; } static const u_char * smb_fdata1(const u_char *buf, const char *fmt, const u_char *maxbuf, int unicodestr) { int reverse = 0; const char *attrib_fmt = "READONLY|HIDDEN|SYSTEM|VOLUME|DIR|ARCHIVE|"; while (*fmt && buf sizeof(bitfmt) - 1) l = sizeof(bitfmt)-1; strncpy(bitfmt, fmt, l); bitfmt[l] = '\0'; fmt = p + 1; TCHECK(buf[0]); write_bits(buf[0], bitfmt); buf++; break; } case 'P': { int l = atoi(fmt + 1); TCHECK2(buf[0], l); buf += l; fmt++; while (isdigit((unsigned char)*fmt)) fmt++; break; } case 'r': reverse = !reverse; fmt++; break; case 'b': { unsigned int x; TCHECK(buf[0]); x = buf[0]; printf("%u (0x%x)", x, x); buf += 1; fmt++; break; } case 'd': { unsigned int x; TCHECK2(buf[0], 2); x = reverse ? EXTRACT_16BITS(buf) : EXTRACT_LE_16BITS(buf); printf("%d (0x%x)", x, x); buf += 2; fmt++; break; } case 'D': { unsigned int x; TCHECK2(buf[0], 4); x = reverse ? EXTRACT_32BITS(buf) : EXTRACT_LE_32BITS(buf); printf("%d (0x%x)", x, x); buf += 4; fmt++; break; } case 'L': { u_int64_t x; TCHECK2(buf[0], 8); x = reverse ? EXTRACT_64BITS(buf) : EXTRACT_LE_64BITS(buf); printf("%" PRIu64 " (0x%" PRIx64 ")", x, x); buf += 8; fmt++; break; } case 'M': { /* Weird mixed-endian length values in 64-bit locks */ u_int32_t x1, x2; u_int64_t x; TCHECK2(buf[0], 8); x1 = reverse ? EXTRACT_32BITS(buf) : EXTRACT_LE_32BITS(buf); x2 = reverse ? EXTRACT_32BITS(buf + 4) : EXTRACT_LE_32BITS(buf + 4); x = (((u_int64_t)x1) << 32) | x2; printf("%" PRIu64 " (0x%" PRIx64 ")", x, x); buf += 8; fmt++; break; } case 'B': { unsigned int x; TCHECK(buf[0]); x = buf[0]; printf("0x%X", x); buf += 1; fmt++; break; } case 'w': { unsigned int x; TCHECK2(buf[0], 2); x = reverse ? EXTRACT_16BITS(buf) : EXTRACT_LE_16BITS(buf); printf("0x%X", x); buf += 2; fmt++; break; } case 'W': { unsigned int x; TCHECK2(buf[0], 4); x = reverse ? EXTRACT_32BITS(buf) : EXTRACT_LE_32BITS(buf); printf("0x%X", x); buf += 4; fmt++; break; } case 'l': { fmt++; switch (*fmt) { case 'b': TCHECK(buf[0]); stringlen = buf[0]; printf("%u", stringlen); buf += 1; break; case 'd': TCHECK2(buf[0], 2); stringlen = reverse ? EXTRACT_16BITS(buf) : EXTRACT_LE_16BITS(buf); printf("%u", stringlen); buf += 2; break; case 'D': TCHECK2(buf[0], 4); stringlen = reverse ? EXTRACT_32BITS(buf) : EXTRACT_LE_32BITS(buf); printf("%u", stringlen); buf += 4; break; } fmt++; break; } case 'S': case 'R': /* like 'S', but always ASCII */ { /*XXX unistr() */ const char *s; u_int32_t len; len = 0; s = unistr(buf, &len, (*fmt == 'R') ? 0 : unicodestr); if (s == NULL) goto trunc; printf("%s", s); buf += len; fmt++; break; } case 'Z': case 'Y': /* like 'Z', but always ASCII */ { const char *s; u_int32_t len; TCHECK(*buf); if (*buf != 4 && *buf != 2) { printf("Error! ASCIIZ buffer of type %u", *buf); return maxbuf; /* give up */ } len = 0; s = unistr(buf + 1, &len, (*fmt == 'Y') ? 0 : unicodestr); if (s == NULL) goto trunc; printf("%s", s); buf += len + 1; fmt++; break; } case 's': { int l = atoi(fmt + 1); TCHECK2(*buf, l); printf("%-*.*s", l, l, buf); buf += l; fmt++; while (isdigit((unsigned char)*fmt)) fmt++; break; } case 'c': { TCHECK2(*buf, stringlen); printf("%-*.*s", (int)stringlen, (int)stringlen, buf); buf += stringlen; fmt++; while (isdigit((unsigned char)*fmt)) fmt++; break; } case 'C': { const char *s; s = unistr(buf, &stringlen, unicodestr); if (s == NULL) goto trunc; printf("%s", s); buf += stringlen; fmt++; break; } case 'h': { int l = atoi(fmt + 1); TCHECK2(*buf, l); while (l--) printf("%02x", *buf++); fmt++; while (isdigit((unsigned char)*fmt)) fmt++; break; } case 'n': { int t = atoi(fmt+1); char nbuf[255]; int name_type; int len; switch (t) { case 1: name_type = name_extract(startbuf, PTR_DIFF(buf, startbuf), maxbuf, nbuf); if (name_type < 0) goto trunc; len = name_len(buf, maxbuf); if (len < 0) goto trunc; buf += len; printf("%-15.15s NameType=0x%02X (%s)", nbuf, name_type, name_type_str(name_type)); break; case 2: TCHECK(buf[15]); name_type = buf[15]; printf("%-15.15s NameType=0x%02X (%s)", buf, name_type, name_type_str(name_type)); buf += 16; break; } fmt++; while (isdigit((unsigned char)*fmt)) fmt++; break; } case 'T': { time_t t; struct tm *lt; const char *tstring; u_int32_t x; switch (atoi(fmt + 1)) { case 1: TCHECK2(buf[0], 4); x = EXTRACT_LE_32BITS(buf); if (x == 0 || x == 0xFFFFFFFF) t = 0; else t = make_unix_date(buf); buf += 4; break; case 2: TCHECK2(buf[0], 4); x = EXTRACT_LE_32BITS(buf); if (x == 0 || x == 0xFFFFFFFF) t = 0; else t = make_unix_date2(buf); buf += 4; break; case 3: TCHECK2(buf[0], 8); t = interpret_long_date(buf); buf += 8; break; default: t = 0; break; } if (t != 0) { lt = localtime(&t); if (lt != NULL) tstring = asctime(lt); else tstring = "(Can't convert time)\n"; } else tstring = "NULL\n"; printf("%s", tstring); fmt++; while (isdigit((unsigned char)*fmt)) fmt++; break; } default: putchar(*fmt); fmt++; break; } } if (buf >= maxbuf && *fmt) printf("END OF BUFFER\n"); return(buf); trunc: printf("\n"); printf("WARNING: Short packet. Try increasing the snap length\n"); return(NULL); } const u_char * smb_fdata(const u_char *buf, const char *fmt, const u_char *maxbuf, int unicodestr) { static int depth = 0; char s[128]; char *p; while (*fmt) { switch (*fmt) { case '*': fmt++; while (buf < maxbuf) { const u_char *buf2; depth++; buf2 = smb_fdata(buf, fmt, maxbuf, unicodestr); depth--; if (buf2 == NULL) return(NULL); if (buf2 == buf) return(buf); buf = buf2; } return(buf); case '|': fmt++; if (buf >= maxbuf) return(buf); break; case '%': fmt++; buf = maxbuf; break; case '#': fmt++; return(buf); break; case '[': fmt++; if (buf >= maxbuf) return(buf); memset(s, 0, sizeof(s)); p = strchr(fmt, ']'); if ((size_t)(p - fmt + 1) > sizeof(s)) { /* overrun */ return(buf); } strncpy(s, fmt, p - fmt); s[p - fmt] = '\0'; fmt = p + 1; buf = smb_fdata1(buf, s, maxbuf, unicodestr); if (buf == NULL) return(NULL); break; default: putchar(*fmt); fmt++; fflush(stdout); break; } } if (!depth && buf < maxbuf) { size_t len = PTR_DIFF(maxbuf, buf); printf("Data: (%lu bytes)\n", (unsigned long)len); print_data(buf, len); return(buf + len); } return(buf); } typedef struct { const char *name; int code; const char *message; } err_code_struct; /* DOS Error Messages */ static const err_code_struct dos_msgs[] = { { "ERRbadfunc", 1, "Invalid function." }, { "ERRbadfile", 2, "File not found." }, { "ERRbadpath", 3, "Directory invalid." }, { "ERRnofids", 4, "No file descriptors available" }, { "ERRnoaccess", 5, "Access denied." }, { "ERRbadfid", 6, "Invalid file handle." }, { "ERRbadmcb", 7, "Memory control blocks destroyed." }, { "ERRnomem", 8, "Insufficient server memory to perform the requested function." }, { "ERRbadmem", 9, "Invalid memory block address." }, { "ERRbadenv", 10, "Invalid environment." }, { "ERRbadformat", 11, "Invalid format." }, { "ERRbadaccess", 12, "Invalid open mode." }, { "ERRbaddata", 13, "Invalid data." }, { "ERR", 14, "reserved." }, { "ERRbaddrive", 15, "Invalid drive specified." }, { "ERRremcd", 16, "A Delete Directory request attempted to remove the server's current directory." }, { "ERRdiffdevice", 17, "Not same device." }, { "ERRnofiles", 18, "A File Search command can find no more files matching the specified criteria." }, { "ERRbadshare", 32, "The sharing mode specified for an Open conflicts with existing FIDs on the file." }, { "ERRlock", 33, "A Lock request conflicted with an existing lock or specified an invalid mode, or an Unlock requested attempted to remove a lock held by another process." }, { "ERRfilexists", 80, "The file named in a Create Directory, Make New File or Link request already exists." }, { "ERRbadpipe", 230, "Pipe invalid." }, { "ERRpipebusy", 231, "All instances of the requested pipe are busy." }, { "ERRpipeclosing", 232, "Pipe close in progress." }, { "ERRnotconnected", 233, "No process on other end of pipe." }, { "ERRmoredata", 234, "There is more data to be returned." }, { NULL, -1, NULL } }; /* Server Error Messages */ err_code_struct server_msgs[] = { { "ERRerror", 1, "Non-specific error code." }, { "ERRbadpw", 2, "Bad password - name/password pair in a Tree Connect or Session Setup are invalid." }, { "ERRbadtype", 3, "reserved." }, { "ERRaccess", 4, "The requester does not have the necessary access rights within the specified context for the requested function. The context is defined by the TID or the UID." }, { "ERRinvnid", 5, "The tree ID (TID) specified in a command was invalid." }, { "ERRinvnetname", 6, "Invalid network name in tree connect." }, { "ERRinvdevice", 7, "Invalid device - printer request made to non-printer connection or non-printer request made to printer connection." }, { "ERRqfull", 49, "Print queue full (files) -- returned by open print file." }, { "ERRqtoobig", 50, "Print queue full -- no space." }, { "ERRqeof", 51, "EOF on print queue dump." }, { "ERRinvpfid", 52, "Invalid print file FID." }, { "ERRsmbcmd", 64, "The server did not recognize the command received." }, { "ERRsrverror", 65, "The server encountered an internal error, e.g., system file unavailable." }, { "ERRfilespecs", 67, "The file handle (FID) and pathname parameters contained an invalid combination of values." }, { "ERRreserved", 68, "reserved." }, { "ERRbadpermits", 69, "The access permissions specified for a file or directory are not a valid combination. The server cannot set the requested attribute." }, { "ERRreserved", 70, "reserved." }, { "ERRsetattrmode", 71, "The attribute mode in the Set File Attribute request is invalid." }, { "ERRpaused", 81, "Server is paused." }, { "ERRmsgoff", 82, "Not receiving messages." }, { "ERRnoroom", 83, "No room to buffer message." }, { "ERRrmuns", 87, "Too many remote user names." }, { "ERRtimeout", 88, "Operation timed out." }, { "ERRnoresource", 89, "No resources currently available for request." }, { "ERRtoomanyuids", 90, "Too many UIDs active on this session." }, { "ERRbaduid", 91, "The UID is not known as a valid ID on this session." }, { "ERRusempx", 250, "Temp unable to support Raw, use MPX mode." }, { "ERRusestd", 251, "Temp unable to support Raw, use standard read/write." }, { "ERRcontmpx", 252, "Continue in MPX mode." }, { "ERRreserved", 253, "reserved." }, { "ERRreserved", 254, "reserved." }, { "ERRnosupport", 0xFFFF, "Function not supported." }, { NULL, -1, NULL } }; /* Hard Error Messages */ err_code_struct hard_msgs[] = { { "ERRnowrite", 19, "Attempt to write on write-protected diskette." }, { "ERRbadunit", 20, "Unknown unit." }, { "ERRnotready", 21, "Drive not ready." }, { "ERRbadcmd", 22, "Unknown command." }, { "ERRdata", 23, "Data error (CRC)." }, { "ERRbadreq", 24, "Bad request structure length." }, { "ERRseek", 25 , "Seek error." }, { "ERRbadmedia", 26, "Unknown media type." }, { "ERRbadsector", 27, "Sector not found." }, { "ERRnopaper", 28, "Printer out of paper." }, { "ERRwrite", 29, "Write fault." }, { "ERRread", 30, "Read fault." }, { "ERRgeneral", 31, "General failure." }, { "ERRbadshare", 32, "A open conflicts with an existing open." }, { "ERRlock", 33, "A Lock request conflicted with an existing lock or specified an invalid mode, or an Unlock requested attempted to remove a lock held by another process." }, { "ERRwrongdisk", 34, "The wrong disk was found in a drive." }, { "ERRFCBUnavail", 35, "No FCBs are available to process request." }, { "ERRsharebufexc", 36, "A sharing buffer has been exceeded." }, { NULL, -1, NULL } }; static const struct { int code; const char *class; const err_code_struct *err_msgs; } err_classes[] = { { 0, "SUCCESS", NULL }, { 0x01, "ERRDOS", dos_msgs }, { 0x02, "ERRSRV", server_msgs }, { 0x03, "ERRHRD", hard_msgs }, { 0x04, "ERRXOS", NULL }, { 0xE1, "ERRRMX1", NULL }, { 0xE2, "ERRRMX2", NULL }, { 0xE3, "ERRRMX3", NULL }, { 0xFF, "ERRCMD", NULL }, { -1, NULL, NULL } }; /* * return a SMB error string from a SMB buffer */ char * smb_errstr(int class, int num) { static char ret[128]; int i, j; ret[0] = 0; for (i = 0; err_classes[i].class; i++) if (err_classes[i].code == class) { if (err_classes[i].err_msgs) { const err_code_struct *err = err_classes[i].err_msgs; for (j = 0; err[j].name; j++) if (num == err[j].code) { snprintf(ret, sizeof(ret), "%s - %s (%s)", err_classes[i].class, err[j].name, err[j].message); return ret; } } snprintf(ret, sizeof(ret), "%s - %d", err_classes[i].class, num); return ret; } snprintf(ret, sizeof(ret), "ERROR: Unknown error (%d,%d)", class, num); return(ret); } typedef struct { u_int32_t code; const char *name; } nt_err_code_struct; /* * NT Error codes */ static const nt_err_code_struct nt_errors[] = { { 0x00000000, "STATUS_SUCCESS" }, { 0x00000000, "STATUS_WAIT_0" }, { 0x00000001, "STATUS_WAIT_1" }, { 0x00000002, "STATUS_WAIT_2" }, { 0x00000003, "STATUS_WAIT_3" }, { 0x0000003F, "STATUS_WAIT_63" }, { 0x00000080, "STATUS_ABANDONED" }, { 0x00000080, "STATUS_ABANDONED_WAIT_0" }, { 0x000000BF, "STATUS_ABANDONED_WAIT_63" }, { 0x000000C0, "STATUS_USER_APC" }, { 0x00000100, "STATUS_KERNEL_APC" }, { 0x00000101, "STATUS_ALERTED" }, { 0x00000102, "STATUS_TIMEOUT" }, { 0x00000103, "STATUS_PENDING" }, { 0x00000104, "STATUS_REPARSE" }, { 0x00000105, "STATUS_MORE_ENTRIES" }, { 0x00000106, "STATUS_NOT_ALL_ASSIGNED" }, { 0x00000107, "STATUS_SOME_NOT_MAPPED" }, { 0x00000108, "STATUS_OPLOCK_BREAK_IN_PROGRESS" }, { 0x00000109, "STATUS_VOLUME_MOUNTED" }, { 0x0000010A, "STATUS_RXACT_COMMITTED" }, { 0x0000010B, "STATUS_NOTIFY_CLEANUP" }, { 0x0000010C, "STATUS_NOTIFY_ENUM_DIR" }, { 0x0000010D, "STATUS_NO_QUOTAS_FOR_ACCOUNT" }, { 0x0000010E, "STATUS_PRIMARY_TRANSPORT_CONNECT_FAILED" }, { 0x00000110, "STATUS_PAGE_FAULT_TRANSITION" }, { 0x00000111, "STATUS_PAGE_FAULT_DEMAND_ZERO" }, { 0x00000112, "STATUS_PAGE_FAULT_COPY_ON_WRITE" }, { 0x00000113, "STATUS_PAGE_FAULT_GUARD_PAGE" }, { 0x00000114, "STATUS_PAGE_FAULT_PAGING_FILE" }, { 0x00000115, "STATUS_CACHE_PAGE_LOCKED" }, { 0x00000116, "STATUS_CRASH_DUMP" }, { 0x00000117, "STATUS_BUFFER_ALL_ZEROS" }, { 0x00000118, "STATUS_REPARSE_OBJECT" }, { 0x0000045C, "STATUS_NO_SHUTDOWN_IN_PROGRESS" }, { 0x40000000, "STATUS_OBJECT_NAME_EXISTS" }, { 0x40000001, "STATUS_THREAD_WAS_SUSPENDED" }, { 0x40000002, "STATUS_WORKING_SET_LIMIT_RANGE" }, { 0x40000003, "STATUS_IMAGE_NOT_AT_BASE" }, { 0x40000004, "STATUS_RXACT_STATE_CREATED" }, { 0x40000005, "STATUS_SEGMENT_NOTIFICATION" }, { 0x40000006, "STATUS_LOCAL_USER_SESSION_KEY" }, { 0x40000007, "STATUS_BAD_CURRENT_DIRECTORY" }, { 0x40000008, "STATUS_SERIAL_MORE_WRITES" }, { 0x40000009, "STATUS_REGISTRY_RECOVERED" }, { 0x4000000A, "STATUS_FT_READ_RECOVERY_FROM_BACKUP" }, { 0x4000000B, "STATUS_FT_WRITE_RECOVERY" }, { 0x4000000C, "STATUS_SERIAL_COUNTER_TIMEOUT" }, { 0x4000000D, "STATUS_NULL_LM_PASSWORD" }, { 0x4000000E, "STATUS_IMAGE_MACHINE_TYPE_MISMATCH" }, { 0x4000000F, "STATUS_RECEIVE_PARTIAL" }, { 0x40000010, "STATUS_RECEIVE_EXPEDITED" }, { 0x40000011, "STATUS_RECEIVE_PARTIAL_EXPEDITED" }, { 0x40000012, "STATUS_EVENT_DONE" }, { 0x40000013, "STATUS_EVENT_PENDING" }, { 0x40000014, "STATUS_CHECKING_FILE_SYSTEM" }, { 0x40000015, "STATUS_FATAL_APP_EXIT" }, { 0x40000016, "STATUS_PREDEFINED_HANDLE" }, { 0x40000017, "STATUS_WAS_UNLOCKED" }, { 0x40000018, "STATUS_SERVICE_NOTIFICATION" }, { 0x40000019, "STATUS_WAS_LOCKED" }, { 0x4000001A, "STATUS_LOG_HARD_ERROR" }, { 0x4000001B, "STATUS_ALREADY_WIN32" }, { 0x4000001C, "STATUS_WX86_UNSIMULATE" }, { 0x4000001D, "STATUS_WX86_CONTINUE" }, { 0x4000001E, "STATUS_WX86_SINGLE_STEP" }, { 0x4000001F, "STATUS_WX86_BREAKPOINT" }, { 0x40000020, "STATUS_WX86_EXCEPTION_CONTINUE" }, { 0x40000021, "STATUS_WX86_EXCEPTION_LASTCHANCE" }, { 0x40000022, "STATUS_WX86_EXCEPTION_CHAIN" }, { 0x40000023, "STATUS_IMAGE_MACHINE_TYPE_MISMATCH_EXE" }, { 0x40000024, "STATUS_NO_YIELD_PERFORMED" }, { 0x40000025, "STATUS_TIMER_RESUME_IGNORED" }, { 0x80000001, "STATUS_GUARD_PAGE_VIOLATION" }, { 0x80000002, "STATUS_DATATYPE_MISALIGNMENT" }, { 0x80000003, "STATUS_BREAKPOINT" }, { 0x80000004, "STATUS_SINGLE_STEP" }, { 0x80000005, "STATUS_BUFFER_OVERFLOW" }, { 0x80000006, "STATUS_NO_MORE_FILES" }, { 0x80000007, "STATUS_WAKE_SYSTEM_DEBUGGER" }, { 0x8000000A, "STATUS_HANDLES_CLOSED" }, { 0x8000000B, "STATUS_NO_INHERITANCE" }, { 0x8000000C, "STATUS_GUID_SUBSTITUTION_MADE" }, { 0x8000000D, "STATUS_PARTIAL_COPY" }, { 0x8000000E, "STATUS_DEVICE_PAPER_EMPTY" }, { 0x8000000F, "STATUS_DEVICE_POWERED_OFF" }, { 0x80000010, "STATUS_DEVICE_OFF_LINE" }, { 0x80000011, "STATUS_DEVICE_BUSY" }, { 0x80000012, "STATUS_NO_MORE_EAS" }, { 0x80000013, "STATUS_INVALID_EA_NAME" }, { 0x80000014, "STATUS_EA_LIST_INCONSISTENT" }, { 0x80000015, "STATUS_INVALID_EA_FLAG" }, { 0x80000016, "STATUS_VERIFY_REQUIRED" }, { 0x80000017, "STATUS_EXTRANEOUS_INFORMATION" }, { 0x80000018, "STATUS_RXACT_COMMIT_NECESSARY" }, { 0x8000001A, "STATUS_NO_MORE_ENTRIES" }, { 0x8000001B, "STATUS_FILEMARK_DETECTED" }, { 0x8000001C, "STATUS_MEDIA_CHANGED" }, { 0x8000001D, "STATUS_BUS_RESET" }, { 0x8000001E, "STATUS_END_OF_MEDIA" }, { 0x8000001F, "STATUS_BEGINNING_OF_MEDIA" }, { 0x80000020, "STATUS_MEDIA_CHECK" }, { 0x80000021, "STATUS_SETMARK_DETECTED" }, { 0x80000022, "STATUS_NO_DATA_DETECTED" }, { 0x80000023, "STATUS_REDIRECTOR_HAS_OPEN_HANDLES" }, { 0x80000024, "STATUS_SERVER_HAS_OPEN_HANDLES" }, { 0x80000025, "STATUS_ALREADY_DISCONNECTED" }, { 0x80000026, "STATUS_LONGJUMP" }, { 0x80040111, "MAPI_E_LOGON_FAILED" }, { 0x80090300, "SEC_E_INSUFFICIENT_MEMORY" }, { 0x80090301, "SEC_E_INVALID_HANDLE" }, { 0x80090302, "SEC_E_UNSUPPORTED_FUNCTION" }, { 0x8009030B, "SEC_E_NO_IMPERSONATION" }, { 0x8009030D, "SEC_E_UNKNOWN_CREDENTIALS" }, { 0x8009030E, "SEC_E_NO_CREDENTIALS" }, { 0x8009030F, "SEC_E_MESSAGE_ALTERED" }, { 0x80090310, "SEC_E_OUT_OF_SEQUENCE" }, { 0x80090311, "SEC_E_NO_AUTHENTICATING_AUTHORITY" }, { 0xC0000001, "STATUS_UNSUCCESSFUL" }, { 0xC0000002, "STATUS_NOT_IMPLEMENTED" }, { 0xC0000003, "STATUS_INVALID_INFO_CLASS" }, { 0xC0000004, "STATUS_INFO_LENGTH_MISMATCH" }, { 0xC0000005, "STATUS_ACCESS_VIOLATION" }, { 0xC0000006, "STATUS_IN_PAGE_ERROR" }, { 0xC0000007, "STATUS_PAGEFILE_QUOTA" }, { 0xC0000008, "STATUS_INVALID_HANDLE" }, { 0xC0000009, "STATUS_BAD_INITIAL_STACK" }, { 0xC000000A, "STATUS_BAD_INITIAL_PC" }, { 0xC000000B, "STATUS_INVALID_CID" }, { 0xC000000C, "STATUS_TIMER_NOT_CANCELED" }, { 0xC000000D, "STATUS_INVALID_PARAMETER" }, { 0xC000000E, "STATUS_NO_SUCH_DEVICE" }, { 0xC000000F, "STATUS_NO_SUCH_FILE" }, { 0xC0000010, "STATUS_INVALID_DEVICE_REQUEST" }, { 0xC0000011, "STATUS_END_OF_FILE" }, { 0xC0000012, "STATUS_WRONG_VOLUME" }, { 0xC0000013, "STATUS_NO_MEDIA_IN_DEVICE" }, { 0xC0000014, "STATUS_UNRECOGNIZED_MEDIA" }, { 0xC0000015, "STATUS_NONEXISTENT_SECTOR" }, { 0xC0000016, "STATUS_MORE_PROCESSING_REQUIRED" }, { 0xC0000017, "STATUS_NO_MEMORY" }, { 0xC0000018, "STATUS_CONFLICTING_ADDRESSES" }, { 0xC0000019, "STATUS_NOT_MAPPED_VIEW" }, { 0xC000001A, "STATUS_UNABLE_TO_FREE_VM" }, { 0xC000001B, "STATUS_UNABLE_TO_DELETE_SECTION" }, { 0xC000001C, "STATUS_INVALID_SYSTEM_SERVICE" }, { 0xC000001D, "STATUS_ILLEGAL_INSTRUCTION" }, { 0xC000001E, "STATUS_INVALID_LOCK_SEQUENCE" }, { 0xC000001F, "STATUS_INVALID_VIEW_SIZE" }, { 0xC0000020, "STATUS_INVALID_FILE_FOR_SECTION" }, { 0xC0000021, "STATUS_ALREADY_COMMITTED" }, { 0xC0000022, "STATUS_ACCESS_DENIED" }, { 0xC0000023, "STATUS_BUFFER_TOO_SMALL" }, { 0xC0000024, "STATUS_OBJECT_TYPE_MISMATCH" }, { 0xC0000025, "STATUS_NONCONTINUABLE_EXCEPTION" }, { 0xC0000026, "STATUS_INVALID_DISPOSITION" }, { 0xC0000027, "STATUS_UNWIND" }, { 0xC0000028, "STATUS_BAD_STACK" }, { 0xC0000029, "STATUS_INVALID_UNWIND_TARGET" }, { 0xC000002A, "STATUS_NOT_LOCKED" }, { 0xC000002B, "STATUS_PARITY_ERROR" }, { 0xC000002C, "STATUS_UNABLE_TO_DECOMMIT_VM" }, { 0xC000002D, "STATUS_NOT_COMMITTED" }, { 0xC000002E, "STATUS_INVALID_PORT_ATTRIBUTES" }, { 0xC000002F, "STATUS_PORT_MESSAGE_TOO_LONG" }, { 0xC0000030, "STATUS_INVALID_PARAMETER_MIX" }, { 0xC0000031, "STATUS_INVALID_QUOTA_LOWER" }, { 0xC0000032, "STATUS_DISK_CORRUPT_ERROR" }, { 0xC0000033, "STATUS_OBJECT_NAME_INVALID" }, { 0xC0000034, "STATUS_OBJECT_NAME_NOT_FOUND" }, { 0xC0000035, "STATUS_OBJECT_NAME_COLLISION" }, { 0xC0000037, "STATUS_PORT_DISCONNECTED" }, { 0xC0000038, "STATUS_DEVICE_ALREADY_ATTACHED" }, { 0xC0000039, "STATUS_OBJECT_PATH_INVALID" }, { 0xC000003A, "STATUS_OBJECT_PATH_NOT_FOUND" }, { 0xC000003B, "STATUS_OBJECT_PATH_SYNTAX_BAD" }, { 0xC000003C, "STATUS_DATA_OVERRUN" }, { 0xC000003D, "STATUS_DATA_LATE_ERROR" }, { 0xC000003E, "STATUS_DATA_ERROR" }, { 0xC000003F, "STATUS_CRC_ERROR" }, { 0xC0000040, "STATUS_SECTION_TOO_BIG" }, { 0xC0000041, "STATUS_PORT_CONNECTION_REFUSED" }, { 0xC0000042, "STATUS_INVALID_PORT_HANDLE" }, { 0xC0000043, "STATUS_SHARING_VIOLATION" }, { 0xC0000044, "STATUS_QUOTA_EXCEEDED" }, { 0xC0000045, "STATUS_INVALID_PAGE_PROTECTION" }, { 0xC0000046, "STATUS_MUTANT_NOT_OWNED" }, { 0xC0000047, "STATUS_SEMAPHORE_LIMIT_EXCEEDED" }, { 0xC0000048, "STATUS_PORT_ALREADY_SET" }, { 0xC0000049, "STATUS_SECTION_NOT_IMAGE" }, { 0xC000004A, "STATUS_SUSPEND_COUNT_EXCEEDED" }, { 0xC000004B, "STATUS_THREAD_IS_TERMINATING" }, { 0xC000004C, "STATUS_BAD_WORKING_SET_LIMIT" }, { 0xC000004D, "STATUS_INCOMPATIBLE_FILE_MAP" }, { 0xC000004E, "STATUS_SECTION_PROTECTION" }, { 0xC000004F, "STATUS_EAS_NOT_SUPPORTED" }, { 0xC0000050, "STATUS_EA_TOO_LARGE" }, { 0xC0000051, "STATUS_NONEXISTENT_EA_ENTRY" }, { 0xC0000052, "STATUS_NO_EAS_ON_FILE" }, { 0xC0000053, "STATUS_EA_CORRUPT_ERROR" }, { 0xC0000054, "STATUS_FILE_LOCK_CONFLICT" }, { 0xC0000055, "STATUS_LOCK_NOT_GRANTED" }, { 0xC0000056, "STATUS_DELETE_PENDING" }, { 0xC0000057, "STATUS_CTL_FILE_NOT_SUPPORTED" }, { 0xC0000058, "STATUS_UNKNOWN_REVISION" }, { 0xC0000059, "STATUS_REVISION_MISMATCH" }, { 0xC000005A, "STATUS_INVALID_OWNER" }, { 0xC000005B, "STATUS_INVALID_PRIMARY_GROUP" }, { 0xC000005C, "STATUS_NO_IMPERSONATION_TOKEN" }, { 0xC000005D, "STATUS_CANT_DISABLE_MANDATORY" }, { 0xC000005E, "STATUS_NO_LOGON_SERVERS" }, { 0xC000005F, "STATUS_NO_SUCH_LOGON_SESSION" }, { 0xC0000060, "STATUS_NO_SUCH_PRIVILEGE" }, { 0xC0000061, "STATUS_PRIVILEGE_NOT_HELD" }, { 0xC0000062, "STATUS_INVALID_ACCOUNT_NAME" }, { 0xC0000063, "STATUS_USER_EXISTS" }, { 0xC0000064, "STATUS_NO_SUCH_USER" }, { 0xC0000065, "STATUS_GROUP_EXISTS" }, { 0xC0000066, "STATUS_NO_SUCH_GROUP" }, { 0xC0000067, "STATUS_MEMBER_IN_GROUP" }, { 0xC0000068, "STATUS_MEMBER_NOT_IN_GROUP" }, { 0xC0000069, "STATUS_LAST_ADMIN" }, { 0xC000006A, "STATUS_WRONG_PASSWORD" }, { 0xC000006B, "STATUS_ILL_FORMED_PASSWORD" }, { 0xC000006C, "STATUS_PASSWORD_RESTRICTION" }, { 0xC000006D, "STATUS_LOGON_FAILURE" }, { 0xC000006E, "STATUS_ACCOUNT_RESTRICTION" }, { 0xC000006F, "STATUS_INVALID_LOGON_HOURS" }, { 0xC0000070, "STATUS_INVALID_WORKSTATION" }, { 0xC0000071, "STATUS_PASSWORD_EXPIRED" }, { 0xC0000072, "STATUS_ACCOUNT_DISABLED" }, { 0xC0000073, "STATUS_NONE_MAPPED" }, { 0xC0000074, "STATUS_TOO_MANY_LUIDS_REQUESTED" }, { 0xC0000075, "STATUS_LUIDS_EXHAUSTED" }, { 0xC0000076, "STATUS_INVALID_SUB_AUTHORITY" }, { 0xC0000077, "STATUS_INVALID_ACL" }, { 0xC0000078, "STATUS_INVALID_SID" }, { 0xC0000079, "STATUS_INVALID_SECURITY_DESCR" }, { 0xC000007A, "STATUS_PROCEDURE_NOT_FOUND" }, { 0xC000007B, "STATUS_INVALID_IMAGE_FORMAT" }, { 0xC000007C, "STATUS_NO_TOKEN" }, { 0xC000007D, "STATUS_BAD_INHERITANCE_ACL" }, { 0xC000007E, "STATUS_RANGE_NOT_LOCKED" }, { 0xC000007F, "STATUS_DISK_FULL" }, { 0xC0000080, "STATUS_SERVER_DISABLED" }, { 0xC0000081, "STATUS_SERVER_NOT_DISABLED" }, { 0xC0000082, "STATUS_TOO_MANY_GUIDS_REQUESTED" }, { 0xC0000083, "STATUS_GUIDS_EXHAUSTED" }, { 0xC0000084, "STATUS_INVALID_ID_AUTHORITY" }, { 0xC0000085, "STATUS_AGENTS_EXHAUSTED" }, { 0xC0000086, "STATUS_INVALID_VOLUME_LABEL" }, { 0xC0000087, "STATUS_SECTION_NOT_EXTENDED" }, { 0xC0000088, "STATUS_NOT_MAPPED_DATA" }, { 0xC0000089, "STATUS_RESOURCE_DATA_NOT_FOUND" }, { 0xC000008A, "STATUS_RESOURCE_TYPE_NOT_FOUND" }, { 0xC000008B, "STATUS_RESOURCE_NAME_NOT_FOUND" }, { 0xC000008C, "STATUS_ARRAY_BOUNDS_EXCEEDED" }, { 0xC000008D, "STATUS_FLOAT_DENORMAL_OPERAND" }, { 0xC000008E, "STATUS_FLOAT_DIVIDE_BY_ZERO" }, { 0xC000008F, "STATUS_FLOAT_INEXACT_RESULT" }, { 0xC0000090, "STATUS_FLOAT_INVALID_OPERATION" }, { 0xC0000091, "STATUS_FLOAT_OVERFLOW" }, { 0xC0000092, "STATUS_FLOAT_STACK_CHECK" }, { 0xC0000093, "STATUS_FLOAT_UNDERFLOW" }, { 0xC0000094, "STATUS_INTEGER_DIVIDE_BY_ZERO" }, { 0xC0000095, "STATUS_INTEGER_OVERFLOW" }, { 0xC0000096, "STATUS_PRIVILEGED_INSTRUCTION" }, { 0xC0000097, "STATUS_TOO_MANY_PAGING_FILES" }, { 0xC0000098, "STATUS_FILE_INVALID" }, { 0xC0000099, "STATUS_ALLOTTED_SPACE_EXCEEDED" }, { 0xC000009A, "STATUS_INSUFFICIENT_RESOURCES" }, { 0xC000009B, "STATUS_DFS_EXIT_PATH_FOUND" }, { 0xC000009C, "STATUS_DEVICE_DATA_ERROR" }, { 0xC000009D, "STATUS_DEVICE_NOT_CONNECTED" }, { 0xC000009E, "STATUS_DEVICE_POWER_FAILURE" }, { 0xC000009F, "STATUS_FREE_VM_NOT_AT_BASE" }, { 0xC00000A0, "STATUS_MEMORY_NOT_ALLOCATED" }, { 0xC00000A1, "STATUS_WORKING_SET_QUOTA" }, { 0xC00000A2, "STATUS_MEDIA_WRITE_PROTECTED" }, { 0xC00000A3, "STATUS_DEVICE_NOT_READY" }, { 0xC00000A4, "STATUS_INVALID_GROUP_ATTRIBUTES" }, { 0xC00000A5, "STATUS_BAD_IMPERSONATION_LEVEL" }, { 0xC00000A6, "STATUS_CANT_OPEN_ANONYMOUS" }, { 0xC00000A7, "STATUS_BAD_VALIDATION_CLASS" }, { 0xC00000A8, "STATUS_BAD_TOKEN_TYPE" }, { 0xC00000A9, "STATUS_BAD_MASTER_BOOT_RECORD" }, { 0xC00000AA, "STATUS_INSTRUCTION_MISALIGNMENT" }, { 0xC00000AB, "STATUS_INSTANCE_NOT_AVAILABLE" }, { 0xC00000AC, "STATUS_PIPE_NOT_AVAILABLE" }, { 0xC00000AD, "STATUS_INVALID_PIPE_STATE" }, { 0xC00000AE, "STATUS_PIPE_BUSY" }, { 0xC00000AF, "STATUS_ILLEGAL_FUNCTION" }, { 0xC00000B0, "STATUS_PIPE_DISCONNECTED" }, { 0xC00000B1, "STATUS_PIPE_CLOSING" }, { 0xC00000B2, "STATUS_PIPE_CONNECTED" }, { 0xC00000B3, "STATUS_PIPE_LISTENING" }, { 0xC00000B4, "STATUS_INVALID_READ_MODE" }, { 0xC00000B5, "STATUS_IO_TIMEOUT" }, { 0xC00000B6, "STATUS_FILE_FORCED_CLOSED" }, { 0xC00000B7, "STATUS_PROFILING_NOT_STARTED" }, { 0xC00000B8, "STATUS_PROFILING_NOT_STOPPED" }, { 0xC00000B9, "STATUS_COULD_NOT_INTERPRET" }, { 0xC00000BA, "STATUS_FILE_IS_A_DIRECTORY" }, { 0xC00000BB, "STATUS_NOT_SUPPORTED" }, { 0xC00000BC, "STATUS_REMOTE_NOT_LISTENING" }, { 0xC00000BD, "STATUS_DUPLICATE_NAME" }, { 0xC00000BE, "STATUS_BAD_NETWORK_PATH" }, { 0xC00000BF, "STATUS_NETWORK_BUSY" }, { 0xC00000C0, "STATUS_DEVICE_DOES_NOT_EXIST" }, { 0xC00000C1, "STATUS_TOO_MANY_COMMANDS" }, { 0xC00000C2, "STATUS_ADAPTER_HARDWARE_ERROR" }, { 0xC00000C3, "STATUS_INVALID_NETWORK_RESPONSE" }, { 0xC00000C4, "STATUS_UNEXPECTED_NETWORK_ERROR" }, { 0xC00000C5, "STATUS_BAD_REMOTE_ADAPTER" }, { 0xC00000C6, "STATUS_PRINT_QUEUE_FULL" }, { 0xC00000C7, "STATUS_NO_SPOOL_SPACE" }, { 0xC00000C8, "STATUS_PRINT_CANCELLED" }, { 0xC00000C9, "STATUS_NETWORK_NAME_DELETED" }, { 0xC00000CA, "STATUS_NETWORK_ACCESS_DENIED" }, { 0xC00000CB, "STATUS_BAD_DEVICE_TYPE" }, { 0xC00000CC, "STATUS_BAD_NETWORK_NAME" }, { 0xC00000CD, "STATUS_TOO_MANY_NAMES" }, { 0xC00000CE, "STATUS_TOO_MANY_SESSIONS" }, { 0xC00000CF, "STATUS_SHARING_PAUSED" }, { 0xC00000D0, "STATUS_REQUEST_NOT_ACCEPTED" }, { 0xC00000D1, "STATUS_REDIRECTOR_PAUSED" }, { 0xC00000D2, "STATUS_NET_WRITE_FAULT" }, { 0xC00000D3, "STATUS_PROFILING_AT_LIMIT" }, { 0xC00000D4, "STATUS_NOT_SAME_DEVICE" }, { 0xC00000D5, "STATUS_FILE_RENAMED" }, { 0xC00000D6, "STATUS_VIRTUAL_CIRCUIT_CLOSED" }, { 0xC00000D7, "STATUS_NO_SECURITY_ON_OBJECT" }, { 0xC00000D8, "STATUS_CANT_WAIT" }, { 0xC00000D9, "STATUS_PIPE_EMPTY" }, { 0xC00000DA, "STATUS_CANT_ACCESS_DOMAIN_INFO" }, { 0xC00000DB, "STATUS_CANT_TERMINATE_SELF" }, { 0xC00000DC, "STATUS_INVALID_SERVER_STATE" }, { 0xC00000DD, "STATUS_INVALID_DOMAIN_STATE" }, { 0xC00000DE, "STATUS_INVALID_DOMAIN_ROLE" }, { 0xC00000DF, "STATUS_NO_SUCH_DOMAIN" }, { 0xC00000E0, "STATUS_DOMAIN_EXISTS" }, { 0xC00000E1, "STATUS_DOMAIN_LIMIT_EXCEEDED" }, { 0xC00000E2, "STATUS_OPLOCK_NOT_GRANTED" }, { 0xC00000E3, "STATUS_INVALID_OPLOCK_PROTOCOL" }, { 0xC00000E4, "STATUS_INTERNAL_DB_CORRUPTION" }, { 0xC00000E5, "STATUS_INTERNAL_ERROR" }, { 0xC00000E6, "STATUS_GENERIC_NOT_MAPPED" }, { 0xC00000E7, "STATUS_BAD_DESCRIPTOR_FORMAT" }, { 0xC00000E8, "STATUS_INVALID_USER_BUFFER" }, { 0xC00000E9, "STATUS_UNEXPECTED_IO_ERROR" }, { 0xC00000EA, "STATUS_UNEXPECTED_MM_CREATE_ERR" }, { 0xC00000EB, "STATUS_UNEXPECTED_MM_MAP_ERROR" }, { 0xC00000EC, "STATUS_UNEXPECTED_MM_EXTEND_ERR" }, { 0xC00000ED, "STATUS_NOT_LOGON_PROCESS" }, { 0xC00000EE, "STATUS_LOGON_SESSION_EXISTS" }, { 0xC00000EF, "STATUS_INVALID_PARAMETER_1" }, { 0xC00000F0, "STATUS_INVALID_PARAMETER_2" }, { 0xC00000F1, "STATUS_INVALID_PARAMETER_3" }, { 0xC00000F2, "STATUS_INVALID_PARAMETER_4" }, { 0xC00000F3, "STATUS_INVALID_PARAMETER_5" }, { 0xC00000F4, "STATUS_INVALID_PARAMETER_6" }, { 0xC00000F5, "STATUS_INVALID_PARAMETER_7" }, { 0xC00000F6, "STATUS_INVALID_PARAMETER_8" }, { 0xC00000F7, "STATUS_INVALID_PARAMETER_9" }, { 0xC00000F8, "STATUS_INVALID_PARAMETER_10" }, { 0xC00000F9, "STATUS_INVALID_PARAMETER_11" }, { 0xC00000FA, "STATUS_INVALID_PARAMETER_12" }, { 0xC00000FB, "STATUS_REDIRECTOR_NOT_STARTED" }, { 0xC00000FC, "STATUS_REDIRECTOR_STARTED" }, { 0xC00000FD, "STATUS_STACK_OVERFLOW" }, { 0xC00000FE, "STATUS_NO_SUCH_PACKAGE" }, { 0xC00000FF, "STATUS_BAD_FUNCTION_TABLE" }, { 0xC0000100, "STATUS_VARIABLE_NOT_FOUND" }, { 0xC0000101, "STATUS_DIRECTORY_NOT_EMPTY" }, { 0xC0000102, "STATUS_FILE_CORRUPT_ERROR" }, { 0xC0000103, "STATUS_NOT_A_DIRECTORY" }, { 0xC0000104, "STATUS_BAD_LOGON_SESSION_STATE" }, { 0xC0000105, "STATUS_LOGON_SESSION_COLLISION" }, { 0xC0000106, "STATUS_NAME_TOO_LONG" }, { 0xC0000107, "STATUS_FILES_OPEN" }, { 0xC0000108, "STATUS_CONNECTION_IN_USE" }, { 0xC0000109, "STATUS_MESSAGE_NOT_FOUND" }, { 0xC000010A, "STATUS_PROCESS_IS_TERMINATING" }, { 0xC000010B, "STATUS_INVALID_LOGON_TYPE" }, { 0xC000010C, "STATUS_NO_GUID_TRANSLATION" }, { 0xC000010D, "STATUS_CANNOT_IMPERSONATE" }, { 0xC000010E, "STATUS_IMAGE_ALREADY_LOADED" }, { 0xC000010F, "STATUS_ABIOS_NOT_PRESENT" }, { 0xC0000110, "STATUS_ABIOS_LID_NOT_EXIST" }, { 0xC0000111, "STATUS_ABIOS_LID_ALREADY_OWNED" }, { 0xC0000112, "STATUS_ABIOS_NOT_LID_OWNER" }, { 0xC0000113, "STATUS_ABIOS_INVALID_COMMAND" }, { 0xC0000114, "STATUS_ABIOS_INVALID_LID" }, { 0xC0000115, "STATUS_ABIOS_SELECTOR_NOT_AVAILABLE" }, { 0xC0000116, "STATUS_ABIOS_INVALID_SELECTOR" }, { 0xC0000117, "STATUS_NO_LDT" }, { 0xC0000118, "STATUS_INVALID_LDT_SIZE" }, { 0xC0000119, "STATUS_INVALID_LDT_OFFSET" }, { 0xC000011A, "STATUS_INVALID_LDT_DESCRIPTOR" }, { 0xC000011B, "STATUS_INVALID_IMAGE_NE_FORMAT" }, { 0xC000011C, "STATUS_RXACT_INVALID_STATE" }, { 0xC000011D, "STATUS_RXACT_COMMIT_FAILURE" }, { 0xC000011E, "STATUS_MAPPED_FILE_SIZE_ZERO" }, { 0xC000011F, "STATUS_TOO_MANY_OPENED_FILES" }, { 0xC0000120, "STATUS_CANCELLED" }, { 0xC0000121, "STATUS_CANNOT_DELETE" }, { 0xC0000122, "STATUS_INVALID_COMPUTER_NAME" }, { 0xC0000123, "STATUS_FILE_DELETED" }, { 0xC0000124, "STATUS_SPECIAL_ACCOUNT" }, { 0xC0000125, "STATUS_SPECIAL_GROUP" }, { 0xC0000126, "STATUS_SPECIAL_USER" }, { 0xC0000127, "STATUS_MEMBERS_PRIMARY_GROUP" }, { 0xC0000128, "STATUS_FILE_CLOSED" }, { 0xC0000129, "STATUS_TOO_MANY_THREADS" }, { 0xC000012A, "STATUS_THREAD_NOT_IN_PROCESS" }, { 0xC000012B, "STATUS_TOKEN_ALREADY_IN_USE" }, { 0xC000012C, "STATUS_PAGEFILE_QUOTA_EXCEEDED" }, { 0xC000012D, "STATUS_COMMITMENT_LIMIT" }, { 0xC000012E, "STATUS_INVALID_IMAGE_LE_FORMAT" }, { 0xC000012F, "STATUS_INVALID_IMAGE_NOT_MZ" }, { 0xC0000130, "STATUS_INVALID_IMAGE_PROTECT" }, { 0xC0000131, "STATUS_INVALID_IMAGE_WIN_16" }, { 0xC0000132, "STATUS_LOGON_SERVER_CONFLICT" }, { 0xC0000133, "STATUS_TIME_DIFFERENCE_AT_DC" }, { 0xC0000134, "STATUS_SYNCHRONIZATION_REQUIRED" }, { 0xC0000135, "STATUS_DLL_NOT_FOUND" }, { 0xC0000136, "STATUS_OPEN_FAILED" }, { 0xC0000137, "STATUS_IO_PRIVILEGE_FAILED" }, { 0xC0000138, "STATUS_ORDINAL_NOT_FOUND" }, { 0xC0000139, "STATUS_ENTRYPOINT_NOT_FOUND" }, { 0xC000013A, "STATUS_CONTROL_C_EXIT" }, { 0xC000013B, "STATUS_LOCAL_DISCONNECT" }, { 0xC000013C, "STATUS_REMOTE_DISCONNECT" }, { 0xC000013D, "STATUS_REMOTE_RESOURCES" }, { 0xC000013E, "STATUS_LINK_FAILED" }, { 0xC000013F, "STATUS_LINK_TIMEOUT" }, { 0xC0000140, "STATUS_INVALID_CONNECTION" }, { 0xC0000141, "STATUS_INVALID_ADDRESS" }, { 0xC0000142, "STATUS_DLL_INIT_FAILED" }, { 0xC0000143, "STATUS_MISSING_SYSTEMFILE" }, { 0xC0000144, "STATUS_UNHANDLED_EXCEPTION" }, { 0xC0000145, "STATUS_APP_INIT_FAILURE" }, { 0xC0000146, "STATUS_PAGEFILE_CREATE_FAILED" }, { 0xC0000147, "STATUS_NO_PAGEFILE" }, { 0xC0000148, "STATUS_INVALID_LEVEL" }, { 0xC0000149, "STATUS_WRONG_PASSWORD_CORE" }, { 0xC000014A, "STATUS_ILLEGAL_FLOAT_CONTEXT" }, { 0xC000014B, "STATUS_PIPE_BROKEN" }, { 0xC000014C, "STATUS_REGISTRY_CORRUPT" }, { 0xC000014D, "STATUS_REGISTRY_IO_FAILED" }, { 0xC000014E, "STATUS_NO_EVENT_PAIR" }, { 0xC000014F, "STATUS_UNRECOGNIZED_VOLUME" }, { 0xC0000150, "STATUS_SERIAL_NO_DEVICE_INITED" }, { 0xC0000151, "STATUS_NO_SUCH_ALIAS" }, { 0xC0000152, "STATUS_MEMBER_NOT_IN_ALIAS" }, { 0xC0000153, "STATUS_MEMBER_IN_ALIAS" }, { 0xC0000154, "STATUS_ALIAS_EXISTS" }, { 0xC0000155, "STATUS_LOGON_NOT_GRANTED" }, { 0xC0000156, "STATUS_TOO_MANY_SECRETS" }, { 0xC0000157, "STATUS_SECRET_TOO_LONG" }, { 0xC0000158, "STATUS_INTERNAL_DB_ERROR" }, { 0xC0000159, "STATUS_FULLSCREEN_MODE" }, { 0xC000015A, "STATUS_TOO_MANY_CONTEXT_IDS" }, { 0xC000015B, "STATUS_LOGON_TYPE_NOT_GRANTED" }, { 0xC000015C, "STATUS_NOT_REGISTRY_FILE" }, { 0xC000015D, "STATUS_NT_CROSS_ENCRYPTION_REQUIRED" }, { 0xC000015E, "STATUS_DOMAIN_CTRLR_CONFIG_ERROR" }, { 0xC000015F, "STATUS_FT_MISSING_MEMBER" }, { 0xC0000160, "STATUS_ILL_FORMED_SERVICE_ENTRY" }, { 0xC0000161, "STATUS_ILLEGAL_CHARACTER" }, { 0xC0000162, "STATUS_UNMAPPABLE_CHARACTER" }, { 0xC0000163, "STATUS_UNDEFINED_CHARACTER" }, { 0xC0000164, "STATUS_FLOPPY_VOLUME" }, { 0xC0000165, "STATUS_FLOPPY_ID_MARK_NOT_FOUND" }, { 0xC0000166, "STATUS_FLOPPY_WRONG_CYLINDER" }, { 0xC0000167, "STATUS_FLOPPY_UNKNOWN_ERROR" }, { 0xC0000168, "STATUS_FLOPPY_BAD_REGISTERS" }, { 0xC0000169, "STATUS_DISK_RECALIBRATE_FAILED" }, { 0xC000016A, "STATUS_DISK_OPERATION_FAILED" }, { 0xC000016B, "STATUS_DISK_RESET_FAILED" }, { 0xC000016C, "STATUS_SHARED_IRQ_BUSY" }, { 0xC000016D, "STATUS_FT_ORPHANING" }, { 0xC000016E, "STATUS_BIOS_FAILED_TO_CONNECT_INTERRUPT" }, { 0xC0000172, "STATUS_PARTITION_FAILURE" }, { 0xC0000173, "STATUS_INVALID_BLOCK_LENGTH" }, { 0xC0000174, "STATUS_DEVICE_NOT_PARTITIONED" }, { 0xC0000175, "STATUS_UNABLE_TO_LOCK_MEDIA" }, { 0xC0000176, "STATUS_UNABLE_TO_UNLOAD_MEDIA" }, { 0xC0000177, "STATUS_EOM_OVERFLOW" }, { 0xC0000178, "STATUS_NO_MEDIA" }, { 0xC000017A, "STATUS_NO_SUCH_MEMBER" }, { 0xC000017B, "STATUS_INVALID_MEMBER" }, { 0xC000017C, "STATUS_KEY_DELETED" }, { 0xC000017D, "STATUS_NO_LOG_SPACE" }, { 0xC000017E, "STATUS_TOO_MANY_SIDS" }, { 0xC000017F, "STATUS_LM_CROSS_ENCRYPTION_REQUIRED" }, { 0xC0000180, "STATUS_KEY_HAS_CHILDREN" }, { 0xC0000181, "STATUS_CHILD_MUST_BE_VOLATILE" }, { 0xC0000182, "STATUS_DEVICE_CONFIGURATION_ERROR" }, { 0xC0000183, "STATUS_DRIVER_INTERNAL_ERROR" }, { 0xC0000184, "STATUS_INVALID_DEVICE_STATE" }, { 0xC0000185, "STATUS_IO_DEVICE_ERROR" }, { 0xC0000186, "STATUS_DEVICE_PROTOCOL_ERROR" }, { 0xC0000187, "STATUS_BACKUP_CONTROLLER" }, { 0xC0000188, "STATUS_LOG_FILE_FULL" }, { 0xC0000189, "STATUS_TOO_LATE" }, { 0xC000018A, "STATUS_NO_TRUST_LSA_SECRET" }, { 0xC000018B, "STATUS_NO_TRUST_SAM_ACCOUNT" }, { 0xC000018C, "STATUS_TRUSTED_DOMAIN_FAILURE" }, { 0xC000018D, "STATUS_TRUSTED_RELATIONSHIP_FAILURE" }, { 0xC000018E, "STATUS_EVENTLOG_FILE_CORRUPT" }, { 0xC000018F, "STATUS_EVENTLOG_CANT_START" }, { 0xC0000190, "STATUS_TRUST_FAILURE" }, { 0xC0000191, "STATUS_MUTANT_LIMIT_EXCEEDED" }, { 0xC0000192, "STATUS_NETLOGON_NOT_STARTED" }, { 0xC0000193, "STATUS_ACCOUNT_EXPIRED" }, { 0xC0000194, "STATUS_POSSIBLE_DEADLOCK" }, { 0xC0000195, "STATUS_NETWORK_CREDENTIAL_CONFLICT" }, { 0xC0000196, "STATUS_REMOTE_SESSION_LIMIT" }, { 0xC0000197, "STATUS_EVENTLOG_FILE_CHANGED" }, { 0xC0000198, "STATUS_NOLOGON_INTERDOMAIN_TRUST_ACCOUNT" }, { 0xC0000199, "STATUS_NOLOGON_WORKSTATION_TRUST_ACCOUNT" }, { 0xC000019A, "STATUS_NOLOGON_SERVER_TRUST_ACCOUNT" }, { 0xC000019B, "STATUS_DOMAIN_TRUST_INCONSISTENT" }, { 0xC000019C, "STATUS_FS_DRIVER_REQUIRED" }, { 0xC0000202, "STATUS_NO_USER_SESSION_KEY" }, { 0xC0000203, "STATUS_USER_SESSION_DELETED" }, { 0xC0000204, "STATUS_RESOURCE_LANG_NOT_FOUND" }, { 0xC0000205, "STATUS_INSUFF_SERVER_RESOURCES" }, { 0xC0000206, "STATUS_INVALID_BUFFER_SIZE" }, { 0xC0000207, "STATUS_INVALID_ADDRESS_COMPONENT" }, { 0xC0000208, "STATUS_INVALID_ADDRESS_WILDCARD" }, { 0xC0000209, "STATUS_TOO_MANY_ADDRESSES" }, { 0xC000020A, "STATUS_ADDRESS_ALREADY_EXISTS" }, { 0xC000020B, "STATUS_ADDRESS_CLOSED" }, { 0xC000020C, "STATUS_CONNECTION_DISCONNECTED" }, { 0xC000020D, "STATUS_CONNECTION_RESET" }, { 0xC000020E, "STATUS_TOO_MANY_NODES" }, { 0xC000020F, "STATUS_TRANSACTION_ABORTED" }, { 0xC0000210, "STATUS_TRANSACTION_TIMED_OUT" }, { 0xC0000211, "STATUS_TRANSACTION_NO_RELEASE" }, { 0xC0000212, "STATUS_TRANSACTION_NO_MATCH" }, { 0xC0000213, "STATUS_TRANSACTION_RESPONDED" }, { 0xC0000214, "STATUS_TRANSACTION_INVALID_ID" }, { 0xC0000215, "STATUS_TRANSACTION_INVALID_TYPE" }, { 0xC0000216, "STATUS_NOT_SERVER_SESSION" }, { 0xC0000217, "STATUS_NOT_CLIENT_SESSION" }, { 0xC0000218, "STATUS_CANNOT_LOAD_REGISTRY_FILE" }, { 0xC0000219, "STATUS_DEBUG_ATTACH_FAILED" }, { 0xC000021A, "STATUS_SYSTEM_PROCESS_TERMINATED" }, { 0xC000021B, "STATUS_DATA_NOT_ACCEPTED" }, { 0xC000021C, "STATUS_NO_BROWSER_SERVERS_FOUND" }, { 0xC000021D, "STATUS_VDM_HARD_ERROR" }, { 0xC000021E, "STATUS_DRIVER_CANCEL_TIMEOUT" }, { 0xC000021F, "STATUS_REPLY_MESSAGE_MISMATCH" }, { 0xC0000220, "STATUS_MAPPED_ALIGNMENT" }, { 0xC0000221, "STATUS_IMAGE_CHECKSUM_MISMATCH" }, { 0xC0000222, "STATUS_LOST_WRITEBEHIND_DATA" }, { 0xC0000223, "STATUS_CLIENT_SERVER_PARAMETERS_INVALID" }, { 0xC0000224, "STATUS_PASSWORD_MUST_CHANGE" }, { 0xC0000225, "STATUS_NOT_FOUND" }, { 0xC0000226, "STATUS_NOT_TINY_STREAM" }, { 0xC0000227, "STATUS_RECOVERY_FAILURE" }, { 0xC0000228, "STATUS_STACK_OVERFLOW_READ" }, { 0xC0000229, "STATUS_FAIL_CHECK" }, { 0xC000022A, "STATUS_DUPLICATE_OBJECTID" }, { 0xC000022B, "STATUS_OBJECTID_EXISTS" }, { 0xC000022C, "STATUS_CONVERT_TO_LARGE" }, { 0xC000022D, "STATUS_RETRY" }, { 0xC000022E, "STATUS_FOUND_OUT_OF_SCOPE" }, { 0xC000022F, "STATUS_ALLOCATE_BUCKET" }, { 0xC0000230, "STATUS_PROPSET_NOT_FOUND" }, { 0xC0000231, "STATUS_MARSHALL_OVERFLOW" }, { 0xC0000232, "STATUS_INVALID_VARIANT" }, { 0xC0000233, "STATUS_DOMAIN_CONTROLLER_NOT_FOUND" }, { 0xC0000234, "STATUS_ACCOUNT_LOCKED_OUT" }, { 0xC0000235, "STATUS_HANDLE_NOT_CLOSABLE" }, { 0xC0000236, "STATUS_CONNECTION_REFUSED" }, { 0xC0000237, "STATUS_GRACEFUL_DISCONNECT" }, { 0xC0000238, "STATUS_ADDRESS_ALREADY_ASSOCIATED" }, { 0xC0000239, "STATUS_ADDRESS_NOT_ASSOCIATED" }, { 0xC000023A, "STATUS_CONNECTION_INVALID" }, { 0xC000023B, "STATUS_CONNECTION_ACTIVE" }, { 0xC000023C, "STATUS_NETWORK_UNREACHABLE" }, { 0xC000023D, "STATUS_HOST_UNREACHABLE" }, { 0xC000023E, "STATUS_PROTOCOL_UNREACHABLE" }, { 0xC000023F, "STATUS_PORT_UNREACHABLE" }, { 0xC0000240, "STATUS_REQUEST_ABORTED" }, { 0xC0000241, "STATUS_CONNECTION_ABORTED" }, { 0xC0000242, "STATUS_BAD_COMPRESSION_BUFFER" }, { 0xC0000243, "STATUS_USER_MAPPED_FILE" }, { 0xC0000244, "STATUS_AUDIT_FAILED" }, { 0xC0000245, "STATUS_TIMER_RESOLUTION_NOT_SET" }, { 0xC0000246, "STATUS_CONNECTION_COUNT_LIMIT" }, { 0xC0000247, "STATUS_LOGIN_TIME_RESTRICTION" }, { 0xC0000248, "STATUS_LOGIN_WKSTA_RESTRICTION" }, { 0xC0000249, "STATUS_IMAGE_MP_UP_MISMATCH" }, { 0xC0000250, "STATUS_INSUFFICIENT_LOGON_INFO" }, { 0xC0000251, "STATUS_BAD_DLL_ENTRYPOINT" }, { 0xC0000252, "STATUS_BAD_SERVICE_ENTRYPOINT" }, { 0xC0000253, "STATUS_LPC_REPLY_LOST" }, { 0xC0000254, "STATUS_IP_ADDRESS_CONFLICT1" }, { 0xC0000255, "STATUS_IP_ADDRESS_CONFLICT2" }, { 0xC0000256, "STATUS_REGISTRY_QUOTA_LIMIT" }, { 0xC0000257, "STATUS_PATH_NOT_COVERED" }, { 0xC0000258, "STATUS_NO_CALLBACK_ACTIVE" }, { 0xC0000259, "STATUS_LICENSE_QUOTA_EXCEEDED" }, { 0xC000025A, "STATUS_PWD_TOO_SHORT" }, { 0xC000025B, "STATUS_PWD_TOO_RECENT" }, { 0xC000025C, "STATUS_PWD_HISTORY_CONFLICT" }, { 0xC000025E, "STATUS_PLUGPLAY_NO_DEVICE" }, { 0xC000025F, "STATUS_UNSUPPORTED_COMPRESSION" }, { 0xC0000260, "STATUS_INVALID_HW_PROFILE" }, { 0xC0000261, "STATUS_INVALID_PLUGPLAY_DEVICE_PATH" }, { 0xC0000262, "STATUS_DRIVER_ORDINAL_NOT_FOUND" }, { 0xC0000263, "STATUS_DRIVER_ENTRYPOINT_NOT_FOUND" }, { 0xC0000264, "STATUS_RESOURCE_NOT_OWNED" }, { 0xC0000265, "STATUS_TOO_MANY_LINKS" }, { 0xC0000266, "STATUS_QUOTA_LIST_INCONSISTENT" }, { 0xC0000267, "STATUS_FILE_IS_OFFLINE" }, { 0xC0000268, "STATUS_EVALUATION_EXPIRATION" }, { 0xC0000269, "STATUS_ILLEGAL_DLL_RELOCATION" }, { 0xC000026A, "STATUS_LICENSE_VIOLATION" }, { 0xC000026B, "STATUS_DLL_INIT_FAILED_LOGOFF" }, { 0xC000026C, "STATUS_DRIVER_UNABLE_TO_LOAD" }, { 0xC000026D, "STATUS_DFS_UNAVAILABLE" }, { 0xC000026E, "STATUS_VOLUME_DISMOUNTED" }, { 0xC000026F, "STATUS_WX86_INTERNAL_ERROR" }, { 0xC0000270, "STATUS_WX86_FLOAT_STACK_CHECK" }, { 0xC0000271, "STATUS_VALIDATE_CONTINUE" }, { 0xC0000272, "STATUS_NO_MATCH" }, { 0xC0000273, "STATUS_NO_MORE_MATCHES" }, { 0xC0000275, "STATUS_NOT_A_REPARSE_POINT" }, { 0xC0000276, "STATUS_IO_REPARSE_TAG_INVALID" }, { 0xC0000277, "STATUS_IO_REPARSE_TAG_MISMATCH" }, { 0xC0000278, "STATUS_IO_REPARSE_DATA_INVALID" }, { 0xC0000279, "STATUS_IO_REPARSE_TAG_NOT_HANDLED" }, { 0xC0000280, "STATUS_REPARSE_POINT_NOT_RESOLVED" }, { 0xC0000281, "STATUS_DIRECTORY_IS_A_REPARSE_POINT" }, { 0xC0000282, "STATUS_RANGE_LIST_CONFLICT" }, { 0xC0000283, "STATUS_SOURCE_ELEMENT_EMPTY" }, { 0xC0000284, "STATUS_DESTINATION_ELEMENT_FULL" }, { 0xC0000285, "STATUS_ILLEGAL_ELEMENT_ADDRESS" }, { 0xC0000286, "STATUS_MAGAZINE_NOT_PRESENT" }, { 0xC0000287, "STATUS_REINITIALIZATION_NEEDED" }, { 0x80000288, "STATUS_DEVICE_REQUIRES_CLEANING" }, { 0x80000289, "STATUS_DEVICE_DOOR_OPEN" }, { 0xC000028A, "STATUS_ENCRYPTION_FAILED" }, { 0xC000028B, "STATUS_DECRYPTION_FAILED" }, { 0xC000028C, "STATUS_RANGE_NOT_FOUND" }, { 0xC000028D, "STATUS_NO_RECOVERY_POLICY" }, { 0xC000028E, "STATUS_NO_EFS" }, { 0xC000028F, "STATUS_WRONG_EFS" }, { 0xC0000290, "STATUS_NO_USER_KEYS" }, { 0xC0000291, "STATUS_FILE_NOT_ENCRYPTED" }, { 0xC0000292, "STATUS_NOT_EXPORT_FORMAT" }, { 0xC0000293, "STATUS_FILE_ENCRYPTED" }, { 0x40000294, "STATUS_WAKE_SYSTEM" }, { 0xC0000295, "STATUS_WMI_GUID_NOT_FOUND" }, { 0xC0000296, "STATUS_WMI_INSTANCE_NOT_FOUND" }, { 0xC0000297, "STATUS_WMI_ITEMID_NOT_FOUND" }, { 0xC0000298, "STATUS_WMI_TRY_AGAIN" }, { 0xC0000299, "STATUS_SHARED_POLICY" }, { 0xC000029A, "STATUS_POLICY_OBJECT_NOT_FOUND" }, { 0xC000029B, "STATUS_POLICY_ONLY_IN_DS" }, { 0xC000029C, "STATUS_VOLUME_NOT_UPGRADED" }, { 0xC000029D, "STATUS_REMOTE_STORAGE_NOT_ACTIVE" }, { 0xC000029E, "STATUS_REMOTE_STORAGE_MEDIA_ERROR" }, { 0xC000029F, "STATUS_NO_TRACKING_SERVICE" }, { 0xC00002A0, "STATUS_SERVER_SID_MISMATCH" }, { 0xC00002A1, "STATUS_DS_NO_ATTRIBUTE_OR_VALUE" }, { 0xC00002A2, "STATUS_DS_INVALID_ATTRIBUTE_SYNTAX" }, { 0xC00002A3, "STATUS_DS_ATTRIBUTE_TYPE_UNDEFINED" }, { 0xC00002A4, "STATUS_DS_ATTRIBUTE_OR_VALUE_EXISTS" }, { 0xC00002A5, "STATUS_DS_BUSY" }, { 0xC00002A6, "STATUS_DS_UNAVAILABLE" }, { 0xC00002A7, "STATUS_DS_NO_RIDS_ALLOCATED" }, { 0xC00002A8, "STATUS_DS_NO_MORE_RIDS" }, { 0xC00002A9, "STATUS_DS_INCORRECT_ROLE_OWNER" }, { 0xC00002AA, "STATUS_DS_RIDMGR_INIT_ERROR" }, { 0xC00002AB, "STATUS_DS_OBJ_CLASS_VIOLATION" }, { 0xC00002AC, "STATUS_DS_CANT_ON_NON_LEAF" }, { 0xC00002AD, "STATUS_DS_CANT_ON_RDN" }, { 0xC00002AE, "STATUS_DS_CANT_MOD_OBJ_CLASS" }, { 0xC00002AF, "STATUS_DS_CROSS_DOM_MOVE_FAILED" }, { 0xC00002B0, "STATUS_DS_GC_NOT_AVAILABLE" }, { 0xC00002B1, "STATUS_DIRECTORY_SERVICE_REQUIRED" }, { 0xC00002B2, "STATUS_REPARSE_ATTRIBUTE_CONFLICT" }, { 0xC00002B3, "STATUS_CANT_ENABLE_DENY_ONLY" }, { 0xC00002B4, "STATUS_FLOAT_MULTIPLE_FAULTS" }, { 0xC00002B5, "STATUS_FLOAT_MULTIPLE_TRAPS" }, { 0xC00002B6, "STATUS_DEVICE_REMOVED" }, { 0xC00002B7, "STATUS_JOURNAL_DELETE_IN_PROGRESS" }, { 0xC00002B8, "STATUS_JOURNAL_NOT_ACTIVE" }, { 0xC00002B9, "STATUS_NOINTERFACE" }, { 0xC00002C1, "STATUS_DS_ADMIN_LIMIT_EXCEEDED" }, { 0xC00002C2, "STATUS_DRIVER_FAILED_SLEEP" }, { 0xC00002C3, "STATUS_MUTUAL_AUTHENTICATION_FAILED" }, { 0xC00002C4, "STATUS_CORRUPT_SYSTEM_FILE" }, { 0xC00002C5, "STATUS_DATATYPE_MISALIGNMENT_ERROR" }, { 0xC00002C6, "STATUS_WMI_READ_ONLY" }, { 0xC00002C7, "STATUS_WMI_SET_FAILURE" }, { 0xC00002C8, "STATUS_COMMITMENT_MINIMUM" }, { 0xC00002C9, "STATUS_REG_NAT_CONSUMPTION" }, { 0xC00002CA, "STATUS_TRANSPORT_FULL" }, { 0xC00002CB, "STATUS_DS_SAM_INIT_FAILURE" }, { 0xC00002CC, "STATUS_ONLY_IF_CONNECTED" }, { 0xC00002CD, "STATUS_DS_SENSITIVE_GROUP_VIOLATION" }, { 0xC00002CE, "STATUS_PNP_RESTART_ENUMERATION" }, { 0xC00002CF, "STATUS_JOURNAL_ENTRY_DELETED" }, { 0xC00002D0, "STATUS_DS_CANT_MOD_PRIMARYGROUPID" }, { 0xC00002D1, "STATUS_SYSTEM_IMAGE_BAD_SIGNATURE" }, { 0xC00002D2, "STATUS_PNP_REBOOT_REQUIRED" }, { 0xC00002D3, "STATUS_POWER_STATE_INVALID" }, { 0xC00002D4, "STATUS_DS_INVALID_GROUP_TYPE" }, { 0xC00002D5, "STATUS_DS_NO_NEST_GLOBALGROUP_IN_MIXEDDOMAIN" }, { 0xC00002D6, "STATUS_DS_NO_NEST_LOCALGROUP_IN_MIXEDDOMAIN" }, { 0xC00002D7, "STATUS_DS_GLOBAL_CANT_HAVE_LOCAL_MEMBER" }, { 0xC00002D8, "STATUS_DS_GLOBAL_CANT_HAVE_UNIVERSAL_MEMBER" }, { 0xC00002D9, "STATUS_DS_UNIVERSAL_CANT_HAVE_LOCAL_MEMBER" }, { 0xC00002DA, "STATUS_DS_GLOBAL_CANT_HAVE_CROSSDOMAIN_MEMBER" }, { 0xC00002DB, "STATUS_DS_LOCAL_CANT_HAVE_CROSSDOMAIN_LOCAL_MEMBER" }, { 0xC00002DC, "STATUS_DS_HAVE_PRIMARY_MEMBERS" }, { 0xC00002DD, "STATUS_WMI_NOT_SUPPORTED" }, { 0xC00002DE, "STATUS_INSUFFICIENT_POWER" }, { 0xC00002DF, "STATUS_SAM_NEED_BOOTKEY_PASSWORD" }, { 0xC00002E0, "STATUS_SAM_NEED_BOOTKEY_FLOPPY" }, { 0xC00002E1, "STATUS_DS_CANT_START" }, { 0xC00002E2, "STATUS_DS_INIT_FAILURE" }, { 0xC00002E3, "STATUS_SAM_INIT_FAILURE" }, { 0xC00002E4, "STATUS_DS_GC_REQUIRED" }, { 0xC00002E5, "STATUS_DS_LOCAL_MEMBER_OF_LOCAL_ONLY" }, { 0xC00002E6, "STATUS_DS_NO_FPO_IN_UNIVERSAL_GROUPS" }, { 0xC00002E7, "STATUS_DS_MACHINE_ACCOUNT_QUOTA_EXCEEDED" }, { 0xC00002E8, "STATUS_MULTIPLE_FAULT_VIOLATION" }, { 0xC0000300, "STATUS_NOT_SUPPORTED_ON_SBS" }, { 0xC0009898, "STATUS_WOW_ASSERTION" }, { 0xC0020001, "RPC_NT_INVALID_STRING_BINDING" }, { 0xC0020002, "RPC_NT_WRONG_KIND_OF_BINDING" }, { 0xC0020003, "RPC_NT_INVALID_BINDING" }, { 0xC0020004, "RPC_NT_PROTSEQ_NOT_SUPPORTED" }, { 0xC0020005, "RPC_NT_INVALID_RPC_PROTSEQ" }, { 0xC0020006, "RPC_NT_INVALID_STRING_UUID" }, { 0xC0020007, "RPC_NT_INVALID_ENDPOINT_FORMAT" }, { 0xC0020008, "RPC_NT_INVALID_NET_ADDR" }, { 0xC0020009, "RPC_NT_NO_ENDPOINT_FOUND" }, { 0xC002000A, "RPC_NT_INVALID_TIMEOUT" }, { 0xC002000B, "RPC_NT_OBJECT_NOT_FOUND" }, { 0xC002000C, "RPC_NT_ALREADY_REGISTERED" }, { 0xC002000D, "RPC_NT_TYPE_ALREADY_REGISTERED" }, { 0xC002000E, "RPC_NT_ALREADY_LISTENING" }, { 0xC002000F, "RPC_NT_NO_PROTSEQS_REGISTERED" }, { 0xC0020010, "RPC_NT_NOT_LISTENING" }, { 0xC0020011, "RPC_NT_UNKNOWN_MGR_TYPE" }, { 0xC0020012, "RPC_NT_UNKNOWN_IF" }, { 0xC0020013, "RPC_NT_NO_BINDINGS" }, { 0xC0020014, "RPC_NT_NO_PROTSEQS" }, { 0xC0020015, "RPC_NT_CANT_CREATE_ENDPOINT" }, { 0xC0020016, "RPC_NT_OUT_OF_RESOURCES" }, { 0xC0020017, "RPC_NT_SERVER_UNAVAILABLE" }, { 0xC0020018, "RPC_NT_SERVER_TOO_BUSY" }, { 0xC0020019, "RPC_NT_INVALID_NETWORK_OPTIONS" }, { 0xC002001A, "RPC_NT_NO_CALL_ACTIVE" }, { 0xC002001B, "RPC_NT_CALL_FAILED" }, { 0xC002001C, "RPC_NT_CALL_FAILED_DNE" }, { 0xC002001D, "RPC_NT_PROTOCOL_ERROR" }, { 0xC002001F, "RPC_NT_UNSUPPORTED_TRANS_SYN" }, { 0xC0020021, "RPC_NT_UNSUPPORTED_TYPE" }, { 0xC0020022, "RPC_NT_INVALID_TAG" }, { 0xC0020023, "RPC_NT_INVALID_BOUND" }, { 0xC0020024, "RPC_NT_NO_ENTRY_NAME" }, { 0xC0020025, "RPC_NT_INVALID_NAME_SYNTAX" }, { 0xC0020026, "RPC_NT_UNSUPPORTED_NAME_SYNTAX" }, { 0xC0020028, "RPC_NT_UUID_NO_ADDRESS" }, { 0xC0020029, "RPC_NT_DUPLICATE_ENDPOINT" }, { 0xC002002A, "RPC_NT_UNKNOWN_AUTHN_TYPE" }, { 0xC002002B, "RPC_NT_MAX_CALLS_TOO_SMALL" }, { 0xC002002C, "RPC_NT_STRING_TOO_LONG" }, { 0xC002002D, "RPC_NT_PROTSEQ_NOT_FOUND" }, { 0xC002002E, "RPC_NT_PROCNUM_OUT_OF_RANGE" }, { 0xC002002F, "RPC_NT_BINDING_HAS_NO_AUTH" }, { 0xC0020030, "RPC_NT_UNKNOWN_AUTHN_SERVICE" }, { 0xC0020031, "RPC_NT_UNKNOWN_AUTHN_LEVEL" }, { 0xC0020032, "RPC_NT_INVALID_AUTH_IDENTITY" }, { 0xC0020033, "RPC_NT_UNKNOWN_AUTHZ_SERVICE" }, { 0xC0020034, "EPT_NT_INVALID_ENTRY" }, { 0xC0020035, "EPT_NT_CANT_PERFORM_OP" }, { 0xC0020036, "EPT_NT_NOT_REGISTERED" }, { 0xC0020037, "RPC_NT_NOTHING_TO_EXPORT" }, { 0xC0020038, "RPC_NT_INCOMPLETE_NAME" }, { 0xC0020039, "RPC_NT_INVALID_VERS_OPTION" }, { 0xC002003A, "RPC_NT_NO_MORE_MEMBERS" }, { 0xC002003B, "RPC_NT_NOT_ALL_OBJS_UNEXPORTED" }, { 0xC002003C, "RPC_NT_INTERFACE_NOT_FOUND" }, { 0xC002003D, "RPC_NT_ENTRY_ALREADY_EXISTS" }, { 0xC002003E, "RPC_NT_ENTRY_NOT_FOUND" }, { 0xC002003F, "RPC_NT_NAME_SERVICE_UNAVAILABLE" }, { 0xC0020040, "RPC_NT_INVALID_NAF_ID" }, { 0xC0020041, "RPC_NT_CANNOT_SUPPORT" }, { 0xC0020042, "RPC_NT_NO_CONTEXT_AVAILABLE" }, { 0xC0020043, "RPC_NT_INTERNAL_ERROR" }, { 0xC0020044, "RPC_NT_ZERO_DIVIDE" }, { 0xC0020045, "RPC_NT_ADDRESS_ERROR" }, { 0xC0020046, "RPC_NT_FP_DIV_ZERO" }, { 0xC0020047, "RPC_NT_FP_UNDERFLOW" }, { 0xC0020048, "RPC_NT_FP_OVERFLOW" }, { 0xC0021007, "RPC_P_RECEIVE_ALERTED" }, { 0xC0021008, "RPC_P_CONNECTION_CLOSED" }, { 0xC0021009, "RPC_P_RECEIVE_FAILED" }, { 0xC002100A, "RPC_P_SEND_FAILED" }, { 0xC002100B, "RPC_P_TIMEOUT" }, { 0xC002100C, "RPC_P_SERVER_TRANSPORT_ERROR" }, { 0xC002100E, "RPC_P_EXCEPTION_OCCURED" }, { 0xC0021012, "RPC_P_CONNECTION_SHUTDOWN" }, { 0xC0021015, "RPC_P_THREAD_LISTENING" }, { 0xC0030001, "RPC_NT_NO_MORE_ENTRIES" }, { 0xC0030002, "RPC_NT_SS_CHAR_TRANS_OPEN_FAIL" }, { 0xC0030003, "RPC_NT_SS_CHAR_TRANS_SHORT_FILE" }, { 0xC0030004, "RPC_NT_SS_IN_NULL_CONTEXT" }, { 0xC0030005, "RPC_NT_SS_CONTEXT_MISMATCH" }, { 0xC0030006, "RPC_NT_SS_CONTEXT_DAMAGED" }, { 0xC0030007, "RPC_NT_SS_HANDLES_MISMATCH" }, { 0xC0030008, "RPC_NT_SS_CANNOT_GET_CALL_HANDLE" }, { 0xC0030009, "RPC_NT_NULL_REF_POINTER" }, { 0xC003000A, "RPC_NT_ENUM_VALUE_OUT_OF_RANGE" }, { 0xC003000B, "RPC_NT_BYTE_COUNT_TOO_SMALL" }, { 0xC003000C, "RPC_NT_BAD_STUB_DATA" }, { 0xC0020049, "RPC_NT_CALL_IN_PROGRESS" }, { 0xC002004A, "RPC_NT_NO_MORE_BINDINGS" }, { 0xC002004B, "RPC_NT_GROUP_MEMBER_NOT_FOUND" }, { 0xC002004C, "EPT_NT_CANT_CREATE" }, { 0xC002004D, "RPC_NT_INVALID_OBJECT" }, { 0xC002004F, "RPC_NT_NO_INTERFACES" }, { 0xC0020050, "RPC_NT_CALL_CANCELLED" }, { 0xC0020051, "RPC_NT_BINDING_INCOMPLETE" }, { 0xC0020052, "RPC_NT_COMM_FAILURE" }, { 0xC0020053, "RPC_NT_UNSUPPORTED_AUTHN_LEVEL" }, { 0xC0020054, "RPC_NT_NO_PRINC_NAME" }, { 0xC0020055, "RPC_NT_NOT_RPC_ERROR" }, { 0x40020056, "RPC_NT_UUID_LOCAL_ONLY" }, { 0xC0020057, "RPC_NT_SEC_PKG_ERROR" }, { 0xC0020058, "RPC_NT_NOT_CANCELLED" }, { 0xC0030059, "RPC_NT_INVALID_ES_ACTION" }, { 0xC003005A, "RPC_NT_WRONG_ES_VERSION" }, { 0xC003005B, "RPC_NT_WRONG_STUB_VERSION" }, { 0xC003005C, "RPC_NT_INVALID_PIPE_OBJECT" }, { 0xC003005D, "RPC_NT_INVALID_PIPE_OPERATION" }, { 0xC003005E, "RPC_NT_WRONG_PIPE_VERSION" }, { 0x400200AF, "RPC_NT_SEND_INCOMPLETE" }, { 0, NULL } }; /* * return an NT error string from a SMB buffer */ const char * nt_errstr(u_int32_t err) { static char ret[128]; int i; ret[0] = 0; for (i = 0; nt_errors[i].name; i++) { if (err == nt_errors[i].code) return nt_errors[i].name; } snprintf(ret, sizeof(ret), "0x%08x", err); return ret; } tcpdump-3.9.8/./print-sip.c0000644000026300017500000000312610101505424013551 0ustar mcrmcr/* * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that: (1) source code * distributions retain the above copyright notice and this paragraph * in its entirety, and (2) distributions including binary code include * the above copyright notice and this paragraph in its entirety in * the documentation or other materials provided with the distribution. * THIS SOFTWARE IS PROVIDED ``AS IS'' AND * WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT * LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * FOR A PARTICULAR PURPOSE. * * Original code by Hannes Gredler (hannes@juniper.net) */ #ifndef lint static const char rcsid[] _U_ = "@(#) $Header: /tcpdump/master/tcpdump/print-sip.c,v 1.1 2004/07/27 17:04:20 hannes Exp $"; #endif #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include #include "interface.h" #include "extract.h" #include "udp.h" void sip_print(register const u_char *pptr, register u_int len) { u_int idx; printf("SIP, length: %u%s", len, vflag ? "\n\t" : ""); /* in non-verbose mode just lets print the protocol and length */ if (vflag < 1) return; for (idx = 0; idx < len; idx++) { if (EXTRACT_16BITS(pptr+idx) != 0x0d0a) { /* linefeed ? */ safeputchar(*(pptr+idx)); } else { printf("\n\t"); idx+=1; } } /* do we want to see an additionally hexdump ? */ if (vflag> 1) print_unknown_data(pptr,"\n\t",len); return; } tcpdump-3.9.8/./ppp.h0000644000026300017500000000630510135507330012437 0ustar mcrmcr/* @(#) $Header: /tcpdump/master/tcpdump/ppp.h,v 1.16 2004/10/20 16:14:16 hannes Exp $ (LBL) */ /* * Point to Point Protocol (PPP) RFC1331 * * Copyright 1989 by Carnegie Mellon. * * Permission to use, copy, modify, and distribute this program for any * purpose and without fee is hereby granted, provided that this copyright * and permission notice appear on all copies and supporting documentation, * the name of Carnegie Mellon not be used in advertising or publicity * pertaining to distribution of the program without specific prior * permission, and notice be given in supporting documentation that copying * and distribution is by permission of Carnegie Mellon and Stanford * University. Carnegie Mellon makes no representations about the * suitability of this software for any purpose. It is provided "as is" * without express or implied warranty. */ #define PPP_HDRLEN 4 /* length of PPP header */ #define PPP_ADDRESS 0xff /* The address byte value */ #define PPP_CONTROL 0x03 /* The control byte value */ #define PPP_WITHDIRECTION_IN 0x00 /* non-standard for DLT_PPP_WITHDIRECTION */ #define PPP_WITHDIRECTION_OUT 0x01 /* non-standard for DLT_PPP_WITHDIRECTION */ /* Protocol numbers */ #define PPP_IP 0x0021 /* Raw IP */ #define PPP_OSI 0x0023 /* OSI Network Layer */ #define PPP_NS 0x0025 /* Xerox NS IDP */ #define PPP_DECNET 0x0027 /* DECnet Phase IV */ #define PPP_APPLE 0x0029 /* Appletalk */ #define PPP_IPX 0x002b /* Novell IPX */ #define PPP_VJC 0x002d /* Van Jacobson Compressed TCP/IP */ #define PPP_VJNC 0x002f /* Van Jacobson Uncompressed TCP/IP */ #define PPP_BRPDU 0x0031 /* Bridging PDU */ #define PPP_STII 0x0033 /* Stream Protocol (ST-II) */ #define PPP_VINES 0x0035 /* Banyan Vines */ #define PPP_ML 0x003d /* Multi-Link PPP */ #define PPP_IPV6 0x0057 /* IPv6 */ #define PPP_COMP 0x00fd /* Compressed Datagram */ #define PPP_HELLO 0x0201 /* 802.1d Hello Packets */ #define PPP_LUXCOM 0x0231 /* Luxcom */ #define PPP_SNS 0x0233 /* Sigma Network Systems */ #define PPP_MPLS_UCAST 0x0281 /* rfc 3032 */ #define PPP_MPLS_MCAST 0x0283 /* rfc 3022 */ #define PPP_IPCP 0x8021 /* IP Control Protocol */ #define PPP_OSICP 0x8023 /* OSI Network Layer Control Protocol */ #define PPP_NSCP 0x8025 /* Xerox NS IDP Control Protocol */ #define PPP_DECNETCP 0x8027 /* DECnet Control Protocol */ #define PPP_APPLECP 0x8029 /* Appletalk Control Protocol */ #define PPP_IPXCP 0x802b /* Novell IPX Control Protocol */ #define PPP_STIICP 0x8033 /* Strean Protocol Control Protocol */ #define PPP_VINESCP 0x8035 /* Banyan Vines Control Protocol */ #define PPP_IPV6CP 0x8057 /* IPv6 Control Protocol */ #define PPP_CCP 0x80fd /* Compress Control Protocol */ #define PPP_MPLSCP 0x8281 /* rfc 3022 */ #define PPP_LCP 0xc021 /* Link Control Protocol */ #define PPP_PAP 0xc023 /* Password Authentication Protocol */ #define PPP_LQM 0xc025 /* Link Quality Monitoring */ #define PPP_SPAP 0xc027 #define PPP_CHAP 0xc223 /* Challenge Handshake Authentication Protocol */ #define PPP_BACP 0xc02b /* Bandwidth Allocation Control Protocol */ #define PPP_BAP 0xc02d /* BAP */ #define PPP_MPCP 0xc03d /* Multi-Link */ #define PPP_SPAP_OLD 0xc123 #define PPP_EAP 0xc227 extern struct tok ppptype2str[]; tcpdump-3.9.8/./print-msdp.c0000644000026300017500000000531710225052571013734 0ustar mcrmcr/* * Copyright (c) 2001 William C. Fenner. * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that: (1) source code * distributions retain the above copyright notice and this paragraph * in its entirety, and (2) distributions including binary code include * the above copyright notice and this paragraph in its entirety in * the documentation or other materials provided with the distribution. * The name of William C. Fenner may not be used to endorse or * promote products derived from this software without specific prior * written permission. THIS SOFTWARE IS PROVIDED ``AS IS'' AND * WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT * LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * FOR A PARTICULAR PURPOSE. */ #ifndef lint static const char rcsid[] _U_ = "@(#) $Header: /tcpdump/master/tcpdump/print-msdp.c,v 1.7 2005/04/06 21:32:41 mcr Exp $"; #endif #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include #include "interface.h" #include "addrtoname.h" #include "extract.h" #define MSDP_TYPE_MAX 7 void msdp_print(const unsigned char *sp, u_int length) { unsigned int type, len; TCHECK2(*sp, 3); /* See if we think we're at the beginning of a compound packet */ type = *sp; len = EXTRACT_16BITS(sp + 1); if (len > 1500 || len < 3 || type == 0 || type > MSDP_TYPE_MAX) goto trunc; /* not really truncated, but still not decodable */ (void)printf(" msdp:"); while (length > 0) { TCHECK2(*sp, 3); type = *sp; len = EXTRACT_16BITS(sp + 1); if (len > 1400 || vflag) printf(" [len %u]", len); if (len < 3) goto trunc; sp += 3; length -= 3; switch (type) { case 1: /* IPv4 Source-Active */ case 3: /* IPv4 Source-Active Response */ if (type == 1) (void)printf(" SA"); else (void)printf(" SA-Response"); TCHECK(*sp); (void)printf(" %u entries", *sp); if ((u_int)((*sp * 12) + 8) < len) { (void)printf(" [w/data]"); if (vflag > 1) { (void)printf(" "); ip_print(gndo, sp + *sp * 12 + 8 - 3, len - (*sp * 12 + 8)); } } break; case 2: (void)printf(" SA-Request"); TCHECK2(*sp, 5); (void)printf(" for %s", ipaddr_string(sp + 1)); break; case 4: (void)printf(" Keepalive"); if (len != 3) (void)printf("[len=%d] ", len); break; case 5: (void)printf(" Notification"); break; default: (void)printf(" [type=%d len=%d]", type, len); break; } sp += (len - 3); length -= (len - 3); } return; trunc: (void)printf(" [|msdp]"); } /* * Local Variables: * c-style: whitesmith * c-basic-offset: 8 * End: */ tcpdump-3.9.8/./l2vpn.h0000755000026300017500000000147210063542221012702 0ustar mcrmcr/* @(#) $Header: /tcpdump/master/tcpdump/l2vpn.h,v 1.1 2004/06/15 09:42:41 hannes Exp $ (LBL) */ /* * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that: (1) source code * distributions retain the above copyright notice and this paragraph * in its entirety, and (2) distributions including binary code include * the above copyright notice and this paragraph in its entirety in * the documentation or other materials provided with the distribution. * THIS SOFTWARE IS PROVIDED ``AS IS'' AND * WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT * LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * FOR A PARTICULAR PURPOSE. * * Original code by Hannes Gredler (hannes@juniper.net) */ extern struct tok l2vpn_encaps_values[]; tcpdump-3.9.8/./print-sll.c0000644000026300017500000001203210504040015013541 0ustar mcrmcr/* * Copyright (c) 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997 * The Regents of the University of California. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that: (1) source code distributions * retain the above copyright notice and this paragraph in its entirety, (2) * distributions including binary code include the above copyright notice and * this paragraph in its entirety in the documentation or other materials * provided with the distribution, and (3) all advertising materials mentioning * features or use of this software display the following acknowledgement: * ``This product includes software developed by the University of California, * Lawrence Berkeley Laboratory and its contributors.'' Neither the name of * the University nor the names of its contributors may be used to endorse * or promote products derived from this software without specific prior * written permission. * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. */ #ifndef lint static const char rcsid[] _U_ = "@(#) $Header: /tcpdump/master/tcpdump/print-sll.c,v 1.16.2.3 2005/11/13 12:13:00 guy Exp $ (LBL)"; #endif #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include #include #include "interface.h" #include "addrtoname.h" #include "ethertype.h" #include "extract.h" #include "ether.h" #include "sll.h" const struct tok sll_pkttype_values[] = { { LINUX_SLL_HOST, "In" }, { LINUX_SLL_BROADCAST, "B" }, { LINUX_SLL_MULTICAST, "M" }, { LINUX_SLL_OTHERHOST, "P" }, { LINUX_SLL_OUTGOING, "Out" }, { 0, NULL} }; static inline void sll_print(register const struct sll_header *sllp, u_int length) { u_short ether_type; printf("%3s ",tok2str(sll_pkttype_values,"?",EXTRACT_16BITS(&sllp->sll_pkttype))); /* * XXX - check the link-layer address type value? * For now, we just assume 6 means Ethernet. * XXX - print others as strings of hex? */ if (EXTRACT_16BITS(&sllp->sll_halen) == 6) (void)printf("%s ", etheraddr_string(sllp->sll_addr)); if (!qflag) { ether_type = EXTRACT_16BITS(&sllp->sll_protocol); if (ether_type <= ETHERMTU) { /* * Not an Ethernet type; what type is it? */ switch (ether_type) { case LINUX_SLL_P_802_3: /* * Ethernet_802.3 IPX frame. */ (void)printf("802.3"); break; case LINUX_SLL_P_802_2: /* * 802.2. */ (void)printf("802.3"); break; default: /* * What is it? */ (void)printf("ethertype Unknown (0x%04x)", ether_type); break; } } else { (void)printf("ethertype %s (0x%04x)", tok2str(ethertype_values, "Unknown", ether_type), ether_type); } (void)printf(", length %u: ", length); } } /* * This is the top level routine of the printer. 'p' points to the * Linux "cooked capture" header of the packet, 'h->ts' is the timestamp, * 'h->len' is the length of the packet off the wire, and 'h->caplen' * is the number of bytes actually captured. */ u_int sll_if_print(const struct pcap_pkthdr *h, const u_char *p) { u_int caplen = h->caplen; u_int length = h->len; register const struct sll_header *sllp; u_short ether_type; u_short extracted_ethertype; if (caplen < SLL_HDR_LEN) { /* * XXX - this "can't happen" because "pcap-linux.c" always * adds this many bytes of header to every packet in a * cooked socket capture. */ printf("[|sll]"); return (caplen); } sllp = (const struct sll_header *)p; if (eflag) sll_print(sllp, length); /* * Go past the cooked-mode header. */ length -= SLL_HDR_LEN; caplen -= SLL_HDR_LEN; p += SLL_HDR_LEN; ether_type = ntohs(sllp->sll_protocol); /* * Is it (gag) an 802.3 encapsulation, or some non-Ethernet * packet type? */ if (ether_type <= ETHERMTU) { /* * Yes - what type is it? */ switch (ether_type) { case LINUX_SLL_P_802_3: /* * Ethernet_802.3 IPX frame. */ ipx_print(p, length); break; case LINUX_SLL_P_802_2: /* * 802.2. * Try to print the LLC-layer header & higher layers. */ if (llc_print(p, length, caplen, NULL, NULL, &extracted_ethertype) == 0) goto unknown; /* unknown LLC type */ break; default: extracted_ethertype = 0; /*FALLTHROUGH*/ unknown: /* ether_type not known, print raw packet */ if (!eflag) sll_print(sllp, length + SLL_HDR_LEN); if (extracted_ethertype) { printf("(LLC %s) ", etherproto_string(htons(extracted_ethertype))); } if (!suppress_default_print) default_print(p, caplen); break; } } else if (ether_encap_print(ether_type, p, length, caplen, &extracted_ethertype) == 0) { /* ether_type not known, print raw packet */ if (!eflag) sll_print(sllp, length + SLL_HDR_LEN); if (!suppress_default_print) default_print(p, caplen); } return (SLL_HDR_LEN); } tcpdump-3.9.8/./interface.h0000644000026300017500000003626510634111730013607 0ustar mcrmcr/* * Copyright (c) 1988-2002 * The Regents of the University of California. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that: (1) source code distributions * retain the above copyright notice and this paragraph in its entirety, (2) * distributions including binary code include the above copyright notice and * this paragraph in its entirety in the documentation or other materials * provided with the distribution, and (3) all advertising materials mentioning * features or use of this software display the following acknowledgement: * ``This product includes software developed by the University of California, * Lawrence Berkeley Laboratory and its contributors.'' Neither the name of * the University nor the names of its contributors may be used to endorse * or promote products derived from this software without specific prior * written permission. * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * * @(#) $Header: /tcpdump/master/tcpdump/interface.h,v 1.244.2.21 2007/03/28 07:45:46 hannes Exp $ (LBL) */ #ifndef tcpdump_interface_h #define tcpdump_interface_h #ifdef HAVE_OS_PROTO_H #include "os-proto.h" #endif #ifndef HAVE___ATTRIBUTE__ #define __attribute__(x) #endif /* snprintf et al */ #include #if HAVE_STDINT_H #include #endif #if !defined(HAVE_SNPRINTF) int snprintf(char *, size_t, const char *, ...) __attribute__((format(printf, 3, 4))); #endif #if !defined(HAVE_VSNPRINTF) int vsnprintf(char *, size_t, const char *, va_list) __attribute__((format(printf, 3, 0))); #endif #ifndef HAVE_STRLCAT extern size_t strlcat(char *, const char *, size_t); #endif #ifndef HAVE_STRLCPY extern size_t strlcpy(char *, const char *, size_t); #endif #ifndef HAVE_STRDUP extern char *strdup(const char *); #endif #ifndef HAVE_STRSEP extern char *strsep(char **, const char *); #endif #define PT_VAT 1 /* Visual Audio Tool */ #define PT_WB 2 /* distributed White Board */ #define PT_RPC 3 /* Remote Procedure Call */ #define PT_RTP 4 /* Real-Time Applications protocol */ #define PT_RTCP 5 /* Real-Time Applications control protocol */ #define PT_SNMP 6 /* Simple Network Management Protocol */ #define PT_CNFP 7 /* Cisco NetFlow protocol */ #define PT_TFTP 8 /* trivial file transfer protocol */ #define PT_AODV 9 /* Ad-hoc On-demand Distance Vector Protocol */ #ifndef min #define min(a,b) ((a)>(b)?(b):(a)) #endif #ifndef max #define max(a,b) ((b)>(a)?(b):(a)) #endif /* * The default snapshot length. This value allows most printers to print * useful information while keeping the amount of unwanted data down. */ #ifndef INET6 #define DEFAULT_SNAPLEN 68 /* ether + IPv4 + TCP + 14 */ #else #define DEFAULT_SNAPLEN 96 /* ether + IPv6 + TCP + 22 */ #endif #ifndef BIG_ENDIAN #define BIG_ENDIAN 4321 #define LITTLE_ENDIAN 1234 #endif #define ESRC(ep) ((ep)->ether_shost) #define EDST(ep) ((ep)->ether_dhost) #ifndef NTOHL #define NTOHL(x) (x) = ntohl(x) #define NTOHS(x) (x) = ntohs(x) #define HTONL(x) (x) = htonl(x) #define HTONS(x) (x) = htons(x) #endif #endif #ifndef MIN #define MIN(a,b) ((a)<(b)?(a):(b)) #endif extern char *program_name; /* used to generate self-identifying messages */ extern int32_t thiszone; /* seconds offset from gmt to local time */ /* * True if "l" bytes of "var" were captured. * * The "snapend - (l) <= snapend" checks to make sure "l" isn't so large * that "snapend - (l)" underflows. * * The check is for <= rather than < because "l" might be 0. */ #define TTEST2(var, l) (snapend - (l) <= snapend && \ (const u_char *)&(var) <= snapend - (l)) /* True if "var" was captured */ #define TTEST(var) TTEST2(var, sizeof(var)) /* Bail if "l" bytes of "var" were not captured */ #define TCHECK2(var, l) if (!TTEST2(var, l)) goto trunc /* Bail if "var" was not captured */ #define TCHECK(var) TCHECK2(var, sizeof(var)) extern void ts_print(const struct timeval *); extern void relts_print(int); extern int fn_print(const u_char *, const u_char *); extern int fn_printn(const u_char *, u_int, const u_char *); extern int fn_printzp(const u_char *, u_int, const u_char *); extern int mask2plen(u_int32_t); extern const char *tok2strary_internal(const char **, int, const char *, int); #define tok2strary(a,f,i) tok2strary_internal(a, sizeof(a)/sizeof(a[0]),f,i) extern const char *dnaddr_string(u_short); extern void error(const char *, ...) __attribute__((noreturn, format (printf, 1, 2))); extern void warning(const char *, ...) __attribute__ ((format (printf, 1, 2))); extern char *read_infile(char *); extern char *copy_argv(char **); extern void safeputchar(int); extern void safeputs(const char *, int); extern const char *isonsap_string(const u_char *, register u_int); extern const char *protoid_string(const u_char *); extern const char *ipxsap_string(u_short); extern const char *dnname_string(u_short); extern const char *dnnum_string(u_short); /* The printer routines. */ #include extern int print_unknown_data(const u_char *, const char *,int); extern void ascii_print(const u_char *, u_int); extern void hex_and_ascii_print_with_offset(const char *, const u_char *, u_int, u_int); extern void hex_and_ascii_print(const char *, const u_char *, u_int); extern void hex_print_with_offset(const char *, const u_char *, u_int, u_int); extern void hex_print(const char *, const u_char *, u_int); extern void telnet_print(const u_char *, u_int); extern int ether_encap_print(u_short, const u_char *, u_int, u_int, u_short *); extern int llc_print(const u_char *, u_int, u_int, const u_char *, const u_char *, u_short *); extern int snap_print(const u_char *, u_int, u_int, u_short *, u_int); extern void aarp_print(const u_char *, u_int); extern void aodv_print(const u_char *, u_int, int); extern void atalk_print(const u_char *, u_int); extern void atm_print(u_int, u_int, u_int, const u_char *, u_int, u_int); extern u_int atm_if_print(const struct pcap_pkthdr *, const u_char *); extern u_int sunatm_if_print(const struct pcap_pkthdr *, const u_char *); extern int oam_print(const u_char *, u_int, u_int); extern void bootp_print(const u_char *, u_int); extern void bgp_print(const u_char *, int); extern void beep_print(const u_char *, u_int); extern void cnfp_print(const u_char *, const u_char *); extern void decnet_print(const u_char *, u_int, u_int); extern void default_print(const u_char *, u_int); extern void dvmrp_print(const u_char *, u_int); extern void egp_print(const u_char *, u_int); extern u_int enc_if_print(const struct pcap_pkthdr *, const u_char *); extern u_int pflog_if_print(const struct pcap_pkthdr *, const u_char *); extern u_int arcnet_if_print(const struct pcap_pkthdr *, const u_char *); extern u_int arcnet_linux_if_print(const struct pcap_pkthdr *, const u_char *); extern void ether_print(const u_char *, u_int, u_int); extern u_int ether_if_print(const struct pcap_pkthdr *, const u_char *); extern u_int token_print(const u_char *, u_int, u_int); extern u_int token_if_print(const struct pcap_pkthdr *, const u_char *); extern void fddi_print(const u_char *, u_int, u_int); extern u_int fddi_if_print(const struct pcap_pkthdr *, const u_char *); extern u_int fr_if_print(const struct pcap_pkthdr *, const u_char *); extern u_int mfr_if_print(const struct pcap_pkthdr *, const u_char *); extern u_int fr_print(register const u_char *, u_int); extern u_int mfr_print(register const u_char *, u_int); extern u_int ieee802_11_if_print(const struct pcap_pkthdr *, const u_char *); extern u_int ieee802_11_radio_if_print(const struct pcap_pkthdr *, const u_char *); extern u_int ap1394_if_print(const struct pcap_pkthdr *, const u_char *); extern void gre_print(const u_char *, u_int); extern void icmp_print(const u_char *, u_int, const u_char *, int); extern void igmp_print(const u_char *, u_int); extern void igrp_print(const u_char *, u_int, const u_char *); extern void ipN_print(const u_char *, u_int); extern u_int ipfc_if_print(const struct pcap_pkthdr *, const u_char *); extern void ipx_print(const u_char *, u_int); extern void isoclns_print(const u_char *, u_int, u_int); extern void krb_print(const u_char *); extern u_int llap_print(const u_char *, u_int); extern u_int ltalk_if_print(const struct pcap_pkthdr *, const u_char *); extern void msdp_print(const unsigned char *, u_int); extern void nfsreply_print(const u_char *, u_int, const u_char *); extern void nfsreq_print(const u_char *, u_int, const u_char *); extern void ns_print(const u_char *, u_int, int); extern void ntp_print(const u_char *, u_int); extern u_int null_if_print(const struct pcap_pkthdr *, const u_char *); extern void ospf_print(const u_char *, u_int, const u_char *); extern void olsr_print (const u_char *, u_int); extern void pimv1_print(const u_char *, u_int); extern void cisco_autorp_print(const u_char *, u_int); extern void rsvp_print(const u_char *, u_int); extern void ldp_print(const u_char *, u_int); extern void lmp_print(const u_char *, u_int); extern void lspping_print(const u_char *, u_int); extern void eigrp_print(const u_char *, u_int); extern void mobile_print(const u_char *, u_int); extern void pim_print(const u_char *, u_int); extern u_int pppoe_print(const u_char *, u_int); extern u_int ppp_print(register const u_char *, u_int); extern u_int ppp_if_print(const struct pcap_pkthdr *, const u_char *); extern u_int ppp_hdlc_if_print(const struct pcap_pkthdr *, const u_char *); extern u_int ppp_bsdos_if_print(const struct pcap_pkthdr *, const u_char *); extern u_int pppoe_if_print(const struct pcap_pkthdr *, const u_char *); extern u_int prism_if_print(const struct pcap_pkthdr *, const u_char *); extern void q933_print(const u_char *, u_int); extern int vjc_print(register const char *, u_short); extern u_int raw_if_print(const struct pcap_pkthdr *, const u_char *); extern void rip_print(const u_char *, u_int); extern u_int sl_if_print(const struct pcap_pkthdr *, const u_char *); extern void lane_print(const u_char *, u_int, u_int); extern u_int lane_if_print(const struct pcap_pkthdr *, const u_char *); extern u_int cip_if_print(const struct pcap_pkthdr *, const u_char *); extern u_int sl_bsdos_if_print(const struct pcap_pkthdr *, const u_char *); extern u_int chdlc_if_print(const struct pcap_pkthdr *, const u_char *); extern u_int chdlc_print(register const u_char *, u_int); extern u_int juniper_atm1_print(const struct pcap_pkthdr *, const u_char *); extern u_int juniper_atm2_print(const struct pcap_pkthdr *, const u_char *); extern u_int juniper_mfr_print(const struct pcap_pkthdr *, register const u_char *); extern u_int juniper_mlfr_print(const struct pcap_pkthdr *, const u_char *); extern u_int juniper_mlppp_print(const struct pcap_pkthdr *, const u_char *); extern u_int juniper_pppoe_print(const struct pcap_pkthdr *, const u_char *); extern u_int juniper_pppoe_atm_print(const struct pcap_pkthdr *, const u_char *); extern u_int juniper_ggsn_print(const struct pcap_pkthdr *, const u_char *); extern u_int juniper_es_print(const struct pcap_pkthdr *, const u_char *); extern u_int juniper_monitor_print(const struct pcap_pkthdr *, const u_char *); extern u_int juniper_services_print(const struct pcap_pkthdr *, const u_char *); extern u_int juniper_ether_print(const struct pcap_pkthdr *, const u_char *); extern u_int juniper_ppp_print(const struct pcap_pkthdr *, const u_char *); extern u_int juniper_frelay_print(const struct pcap_pkthdr *, const u_char *); extern u_int juniper_chdlc_print(const struct pcap_pkthdr *, const u_char *); extern u_int sll_if_print(const struct pcap_pkthdr *, const u_char *); extern void snmp_print(const u_char *, u_int); extern void sunrpcrequest_print(const u_char *, u_int, const u_char *); extern u_int symantec_if_print(const struct pcap_pkthdr *, const u_char *); extern void tcp_print(const u_char *, u_int, const u_char *, int); extern void tftp_print(const u_char *, u_int); extern void timed_print(const u_char *); extern void udp_print(const u_char *, u_int, const u_char *, int); extern void wb_print(const void *, u_int); extern int ah_print(register const u_char *); extern int ipcomp_print(register const u_char *, int *); extern void rx_print(register const u_char *, int, int, int, u_char *); extern void netbeui_print(u_short, const u_char *, int); extern void ipx_netbios_print(const u_char *, u_int); extern void nbt_tcp_print(const u_char *, int); extern void nbt_udp137_print(const u_char *, int); extern void nbt_udp138_print(const u_char *, int); extern char *smb_errstr(int, int); extern const char *nt_errstr(u_int32_t); extern void print_data(const unsigned char *, int); extern void l2tp_print(const u_char *, u_int); extern void vrrp_print(const u_char *, u_int, int); extern void slow_print(const u_char *, u_int); extern void pgm_print(const u_char *, u_int, const u_char *); extern void cdp_print(const u_char *, u_int, u_int); extern void stp_print(const u_char *, u_int); extern void radius_print(const u_char *, u_int); extern void lwres_print(const u_char *, u_int); extern void pptp_print(const u_char *); extern void dccp_print(const u_char *, const u_char *, u_int); extern void sctp_print(const u_char *, const u_char *, u_int); extern void mpls_print(const u_char *, u_int); extern void mpls_lsp_ping_print(const u_char *, u_int); extern void zephyr_print(const u_char *, int); extern void hsrp_print(const u_char *, u_int); extern void bfd_print(const u_char *, u_int, u_int); extern void sip_print(const u_char *, u_int); extern void syslog_print(const u_char *, u_int); #ifdef INET6 extern void ip6_print(const u_char *, u_int); extern void ip6_opt_print(const u_char *, int); extern int hbhopt_print(const u_char *); extern int dstopt_print(const u_char *); extern int frag6_print(const u_char *, const u_char *); extern int mobility_print(const u_char *, const u_char *); extern void icmp6_print(const u_char *, u_int, const u_char *, int); extern void ripng_print(const u_char *, unsigned int); extern int rt6_print(const u_char *, const u_char *); extern void ospf6_print(const u_char *, u_int); extern void dhcp6_print(const u_char *, u_int); #endif /*INET6*/ extern u_short in_cksum(const u_short *, register u_int, int); extern u_int16_t in_cksum_shouldbe(u_int16_t, u_int16_t); #ifndef HAVE_BPF_DUMP struct bpf_program; extern void bpf_dump(struct bpf_program *, int); #endif #include "netdissect.h" /* forward compatibility */ extern netdissect_options *gndo; #define eflag gndo->ndo_eflag #define fflag gndo->ndo_fflag #define nflag gndo->ndo_nflag #define Nflag gndo->ndo_Nflag #define Oflag gndo->ndo_Oflag #define pflag gndo->ndo_pflag #define qflag gndo->ndo_qflag #define Rflag gndo->ndo_Rflag #define sflag gndo->ndo_sflag #define Sflag gndo->ndo_Sflag #define tflag gndo->ndo_tflag #define Uflag gndo->ndo_Uflag #define uflag gndo->ndo_uflag #define vflag gndo->ndo_vflag #define xflag gndo->ndo_xflag #define Xflag gndo->ndo_Xflag #define Cflag gndo->ndo_Cflag #define Aflag gndo->ndo_Aflag #define suppress_default_print gndo->ndo_suppress_default_print #define packettype gndo->ndo_packettype #define tcpmd5secret gndo->ndo_tcpmd5secret #define Wflag gndo->ndo_Wflag #define WflagChars gndo->ndo_WflagChars #define Cflag_count gndo->ndo_Cflag_count #define snaplen gndo->ndo_snaplen #define snapend gndo->ndo_snapend tcpdump-3.9.8/./print-sctp.c0000644000026300017500000002466010676336432013757 0ustar mcrmcr/* Copyright (c) 2001 NETLAB, Temple University * Copyright (c) 2001 Protocol Engineering Lab, University of Delaware * * Jerry Heinz * John Fiore * Armando L. Caro Jr. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * 3. Neither the name of the University nor of the Laboratory may be used * to endorse or promote products derived from this software without * specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ #ifndef lint static const char rcsid[] _U_ = "@(#) $Header: /tcpdump/master/tcpdump/print-sctp.c,v 1.16.2.5 2007/09/13 18:04:58 guy Exp $ (NETLAB/PEL)"; #endif #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include "sctpHeader.h" #include "sctpConstants.h" #include #include #include #include "interface.h" #include "addrtoname.h" #include "extract.h" /* must come after interface.h */ #include "ip.h" #ifdef INET6 #include "ip6.h" #endif void sctp_print(const u_char *bp, /* beginning of sctp packet */ const u_char *bp2, /* beginning of enclosing */ u_int sctpPacketLength) /* ip packet */ { const struct sctpHeader *sctpPktHdr; const struct ip *ip; #ifdef INET6 const struct ip6_hdr *ip6; #endif const void *endPacketPtr; u_short sourcePort, destPort; int chunkCount; const struct sctpChunkDesc *chunkDescPtr; const void *nextChunk; const char *sep; sctpPktHdr = (const struct sctpHeader*) bp; endPacketPtr = (const u_char*)sctpPktHdr+sctpPacketLength; if( (u_long) endPacketPtr > (u_long) snapend) endPacketPtr = (const void *) snapend; ip = (struct ip *)bp2; #ifdef INET6 if (IP_V(ip) == 6) ip6 = (const struct ip6_hdr *)bp2; else ip6 = NULL; #endif /*INET6*/ TCHECK(*sctpPktHdr); if (sctpPacketLength < sizeof(struct sctpHeader)) { (void)printf("truncated-sctp - %ld bytes missing!", (long)sctpPacketLength-sizeof(struct sctpHeader)); return; } /* sctpPacketLength -= sizeof(struct sctpHeader); packet length */ /* is now only as long as the payload */ sourcePort = EXTRACT_16BITS(&sctpPktHdr->source); destPort = EXTRACT_16BITS(&sctpPktHdr->destination); #ifdef INET6 if (ip6) { (void)printf("%s.%d > %s.%d: sctp", ip6addr_string(&ip6->ip6_src), sourcePort, ip6addr_string(&ip6->ip6_dst), destPort); } else #endif /*INET6*/ { (void)printf("%s.%d > %s.%d: sctp", ipaddr_string(&ip->ip_src), sourcePort, ipaddr_string(&ip->ip_dst), destPort); } fflush(stdout); if (vflag >= 2) sep = "\n\t"; else sep = " ("; /* cycle through all chunks, printing information on each one */ for (chunkCount = 0, chunkDescPtr = (const struct sctpChunkDesc *) ((const u_char*) sctpPktHdr + sizeof(struct sctpHeader)); chunkDescPtr != NULL && ( (const void *) ((const u_char *) chunkDescPtr + sizeof(struct sctpChunkDesc)) <= endPacketPtr); chunkDescPtr = (const struct sctpChunkDesc *) nextChunk, chunkCount++) { u_int16_t chunkLength; const u_char *chunkEnd; u_int16_t align; TCHECK(*chunkDescPtr); chunkLength = EXTRACT_16BITS(&chunkDescPtr->chunkLength); if (chunkLength < sizeof(*chunkDescPtr)) { printf("%s%d) [Bad chunk length %u]", sep, chunkCount+1, chunkLength); break; } TCHECK2(*((u_int8_t *)chunkDescPtr), chunkLength); chunkEnd = ((const u_char*)chunkDescPtr + chunkLength); align=chunkLength % 4; if (align != 0) align = 4 - align; nextChunk = (const void *) (chunkEnd + align); printf("%s%d) ", sep, chunkCount+1); switch (chunkDescPtr->chunkID) { case SCTP_DATA : { const struct sctpDataPart *dataHdrPtr; printf("[DATA] "); if ((chunkDescPtr->chunkFlg & SCTP_DATA_UNORDERED) == SCTP_DATA_UNORDERED) printf("(U)"); if ((chunkDescPtr->chunkFlg & SCTP_DATA_FIRST_FRAG) == SCTP_DATA_FIRST_FRAG) printf("(B)"); if ((chunkDescPtr->chunkFlg & SCTP_DATA_LAST_FRAG) == SCTP_DATA_LAST_FRAG) printf("(E)"); if( ((chunkDescPtr->chunkFlg & SCTP_DATA_UNORDERED) == SCTP_DATA_UNORDERED) || ((chunkDescPtr->chunkFlg & SCTP_DATA_FIRST_FRAG) == SCTP_DATA_FIRST_FRAG) || ((chunkDescPtr->chunkFlg & SCTP_DATA_LAST_FRAG) == SCTP_DATA_LAST_FRAG) ) printf(" "); dataHdrPtr=(const struct sctpDataPart*)(chunkDescPtr+1); printf("[TSN: %u] ", EXTRACT_32BITS(&dataHdrPtr->TSN)); printf("[SID: %u] ", EXTRACT_16BITS(&dataHdrPtr->streamId)); printf("[SSEQ %u] ", EXTRACT_16BITS(&dataHdrPtr->sequence)); printf("[PPID 0x%x] ", EXTRACT_32BITS(&dataHdrPtr->payloadtype)); fflush(stdout); if (vflag >= 2) /* if verbose output is specified */ { /* at the command line */ const u_char *payloadPtr; printf("[Payload"); if (!suppress_default_print) { payloadPtr = (const u_char *) (++dataHdrPtr); printf(":"); if (htons(chunkDescPtr->chunkLength) < sizeof(struct sctpDataPart)+ sizeof(struct sctpChunkDesc)+1) { /* Less than 1 byte of chunk payload */ printf("bogus chunk length %u]", htons(chunkDescPtr->chunkLength)); return; } default_print(payloadPtr, htons(chunkDescPtr->chunkLength) - (sizeof(struct sctpDataPart)+ sizeof(struct sctpChunkDesc))); } else printf("]"); } break; } case SCTP_INITIATION : { const struct sctpInitiation *init; printf("[INIT] "); init=(const struct sctpInitiation*)(chunkDescPtr+1); printf("[init tag: %u] ", EXTRACT_32BITS(&init->initTag)); printf("[rwnd: %u] ", EXTRACT_32BITS(&init->rcvWindowCredit)); printf("[OS: %u] ", EXTRACT_16BITS(&init->NumPreopenStreams)); printf("[MIS: %u] ", EXTRACT_16BITS(&init->MaxInboundStreams)); printf("[init TSN: %u] ", EXTRACT_32BITS(&init->initialTSN)); #if(0) /* ALC you can add code for optional params here */ if( (init+1) < chunkEnd ) printf(" @@@@@ UNFINISHED @@@@@@%s\n", "Optional params present, but not printed."); #endif break; } case SCTP_INITIATION_ACK : { const struct sctpInitiation *init; printf("[INIT ACK] "); init=(const struct sctpInitiation*)(chunkDescPtr+1); printf("[init tag: %u] ", EXTRACT_32BITS(&init->initTag)); printf("[rwnd: %u] ", EXTRACT_32BITS(&init->rcvWindowCredit)); printf("[OS: %u] ", EXTRACT_16BITS(&init->NumPreopenStreams)); printf("[MIS: %u] ", EXTRACT_16BITS(&init->MaxInboundStreams)); printf("[init TSN: %u] ", EXTRACT_32BITS(&init->initialTSN)); #if(0) /* ALC you can add code for optional params here */ if( (init+1) < chunkEnd ) printf(" @@@@@ UNFINISHED @@@@@@%s\n", "Optional params present, but not printed."); #endif break; } case SCTP_SELECTIVE_ACK: { const struct sctpSelectiveAck *sack; const struct sctpSelectiveFrag *frag; int fragNo, tsnNo; const u_char *dupTSN; printf("[SACK] "); sack=(const struct sctpSelectiveAck*)(chunkDescPtr+1); printf("[cum ack %u] ", EXTRACT_32BITS(&sack->highestConseqTSN)); printf("[a_rwnd %u] ", EXTRACT_32BITS(&sack->updatedRwnd)); printf("[#gap acks %u] ", EXTRACT_16BITS(&sack->numberOfdesc)); printf("[#dup tsns %u] ", EXTRACT_16BITS(&sack->numDupTsns)); /* print gaps */ for (frag = ( (const struct sctpSelectiveFrag *) ((const struct sctpSelectiveAck *) sack+1)), fragNo=0; (const void *)frag < nextChunk && fragNo < EXTRACT_16BITS(&sack->numberOfdesc); frag++, fragNo++) printf("\n\t\t[gap ack block #%d: start = %u, end = %u] ", fragNo+1, EXTRACT_32BITS(&sack->highestConseqTSN) + EXTRACT_16BITS(&frag->fragmentStart), EXTRACT_32BITS(&sack->highestConseqTSN) + EXTRACT_16BITS(&frag->fragmentEnd)); /* print duplicate TSNs */ for (dupTSN = (const u_char *)frag, tsnNo=0; (const void *) dupTSN < nextChunk && tsnNonumDupTsns); dupTSN += 4, tsnNo++) printf("\n\t\t[dup TSN #%u: %u] ", tsnNo+1, EXTRACT_32BITS(dupTSN)); break; } case SCTP_HEARTBEAT_REQUEST : { const struct sctpHBsender *hb; hb=(const struct sctpHBsender*)chunkDescPtr; printf("[HB REQ] "); break; } case SCTP_HEARTBEAT_ACK : printf("[HB ACK] "); break; case SCTP_ABORT_ASSOCIATION : printf("[ABORT] "); break; case SCTP_SHUTDOWN : printf("[SHUTDOWN] "); break; case SCTP_SHUTDOWN_ACK : printf("[SHUTDOWN ACK] "); break; case SCTP_OPERATION_ERR : printf("[OP ERR] "); break; case SCTP_COOKIE_ECHO : printf("[COOKIE ECHO] "); break; case SCTP_COOKIE_ACK : printf("[COOKIE ACK] "); break; case SCTP_ECN_ECHO : printf("[ECN ECHO] "); break; case SCTP_ECN_CWR : printf("[ECN CWR] "); break; case SCTP_SHUTDOWN_COMPLETE : printf("[SHUTDOWN COMPLETE] "); break; case SCTP_FORWARD_CUM_TSN : printf("[FOR CUM TSN] "); break; case SCTP_RELIABLE_CNTL : printf("[REL CTRL] "); break; case SCTP_RELIABLE_CNTL_ACK : printf("[REL CTRL ACK] "); break; default : printf("[Unknown chunk type: 0x%x]", chunkDescPtr->chunkID); return; } if (vflag < 2) sep = ", ("; } return; trunc: printf("[|sctp]"); return; } tcpdump-3.9.8/./print-lwres.c0000644000026300017500000003311110030165125014110 0ustar mcrmcr/* * Copyright (C) 2001 WIDE Project. * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. Neither the name of the project nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ #ifndef lint static const char rcsid[] _U_ = "@(#) $Header: /tcpdump/master/tcpdump/print-lwres.c,v 1.13 2004/03/24 01:54:29 guy Exp $ (LBL)"; #endif #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include "nameser.h" #include #include #include "interface.h" #include "addrtoname.h" #include "extract.h" /* must come after interface.h */ /* BIND9 lib/lwres/include/lwres */ typedef u_int32_t lwres_uint32_t; typedef u_int16_t lwres_uint16_t; typedef u_int8_t lwres_uint8_t; struct lwres_lwpacket { lwres_uint32_t length; lwres_uint16_t version; lwres_uint16_t pktflags; lwres_uint32_t serial; lwres_uint32_t opcode; lwres_uint32_t result; lwres_uint32_t recvlength; lwres_uint16_t authtype; lwres_uint16_t authlength; }; #define LWRES_LWPACKETFLAG_RESPONSE 0x0001U /* if set, pkt is a response */ #define LWRES_LWPACKETVERSION_0 0 #define LWRES_FLAG_TRUSTNOTREQUIRED 0x00000001U #define LWRES_FLAG_SECUREDATA 0x00000002U /* * no-op */ #define LWRES_OPCODE_NOOP 0x00000000U typedef struct { /* public */ lwres_uint16_t datalength; /* data follows */ } lwres_nooprequest_t; typedef struct { /* public */ lwres_uint16_t datalength; /* data follows */ } lwres_noopresponse_t; /* * get addresses by name */ #define LWRES_OPCODE_GETADDRSBYNAME 0x00010001U typedef struct lwres_addr lwres_addr_t; struct lwres_addr { lwres_uint32_t family; lwres_uint16_t length; /* address folows */ }; typedef struct { /* public */ lwres_uint32_t flags; lwres_uint32_t addrtypes; lwres_uint16_t namelen; /* name follows */ } lwres_gabnrequest_t; typedef struct { /* public */ lwres_uint32_t flags; lwres_uint16_t naliases; lwres_uint16_t naddrs; lwres_uint16_t realnamelen; /* aliases follows */ /* addrs follows */ /* realname follows */ } lwres_gabnresponse_t; /* * get name by address */ #define LWRES_OPCODE_GETNAMEBYADDR 0x00010002U typedef struct { /* public */ lwres_uint32_t flags; lwres_addr_t addr; /* addr body follows */ } lwres_gnbarequest_t; typedef struct { /* public */ lwres_uint32_t flags; lwres_uint16_t naliases; lwres_uint16_t realnamelen; /* aliases follows */ /* realname follows */ } lwres_gnbaresponse_t; /* * get rdata by name */ #define LWRES_OPCODE_GETRDATABYNAME 0x00010003U typedef struct { /* public */ lwres_uint32_t flags; lwres_uint16_t rdclass; lwres_uint16_t rdtype; lwres_uint16_t namelen; /* name follows */ } lwres_grbnrequest_t; typedef struct { /* public */ lwres_uint32_t flags; lwres_uint16_t rdclass; lwres_uint16_t rdtype; lwres_uint32_t ttl; lwres_uint16_t nrdatas; lwres_uint16_t nsigs; /* realname here (len + name) */ /* rdata here (len + name) */ /* signatures here (len + name) */ } lwres_grbnresponse_t; #define LWRDATA_VALIDATED 0x00000001 #define LWRES_ADDRTYPE_V4 0x00000001U /* ipv4 */ #define LWRES_ADDRTYPE_V6 0x00000002U /* ipv6 */ #define LWRES_MAX_ALIASES 16 /* max # of aliases */ #define LWRES_MAX_ADDRS 64 /* max # of addrs */ struct tok opcode[] = { { LWRES_OPCODE_NOOP, "noop", }, { LWRES_OPCODE_GETADDRSBYNAME, "getaddrsbyname", }, { LWRES_OPCODE_GETNAMEBYADDR, "getnamebyaddr", }, { LWRES_OPCODE_GETRDATABYNAME, "getrdatabyname", }, { 0, NULL, }, }; /* print-domain.c */ extern struct tok ns_type2str[]; extern struct tok ns_class2str[]; static int lwres_printname(size_t, const char *); static int lwres_printnamelen(const char *); static int lwres_printbinlen(const char *); static int lwres_printaddr(lwres_addr_t *); static int lwres_printname(size_t l, const char *p0) { const char *p; size_t i; p = p0; /* + 1 for terminating \0 */ if (p + l + 1 > (const char *)snapend) goto trunc; printf(" "); for (i = 0; i < l; i++) safeputchar(*p++); p++; /* skip terminating \0 */ return p - p0; trunc: return -1; } static int lwres_printnamelen(const char *p) { u_int16_t l; int advance; if (p + 2 > (const char *)snapend) goto trunc; l = EXTRACT_16BITS(p); advance = lwres_printname(l, p + 2); if (advance < 0) goto trunc; return 2 + advance; trunc: return -1; } static int lwres_printbinlen(const char *p0) { const char *p; u_int16_t l; int i; p = p0; if (p + 2 > (const char *)snapend) goto trunc; l = EXTRACT_16BITS(p); if (p + 2 + l > (const char *)snapend) goto trunc; p += 2; for (i = 0; i < l; i++) printf("%02x", *p++); return p - p0; trunc: return -1; } static int lwres_printaddr(lwres_addr_t *ap) { u_int16_t l; const char *p; int i; TCHECK(ap->length); l = EXTRACT_16BITS(&ap->length); /* XXX ap points to packed struct */ p = (const char *)&ap->length + sizeof(ap->length); TCHECK2(*p, l); switch (EXTRACT_32BITS(&ap->family)) { case 1: /* IPv4 */ if (l < 4) return -1; printf(" %s", ipaddr_string(p)); p += sizeof(struct in_addr); break; #ifdef INET6 case 2: /* IPv6 */ if (l < 16) return -1; printf(" %s", ip6addr_string(p)); p += sizeof(struct in6_addr); break; #endif default: printf(" %u/", EXTRACT_32BITS(&ap->family)); for (i = 0; i < l; i++) printf("%02x", *p++); } return p - (const char *)ap; trunc: return -1; } void lwres_print(register const u_char *bp, u_int length) { const struct lwres_lwpacket *np; u_int32_t v; const char *s; int response; int advance; int unsupported = 0; np = (const struct lwres_lwpacket *)bp; TCHECK(np->authlength); printf(" lwres"); v = EXTRACT_16BITS(&np->version); if (vflag || v != LWRES_LWPACKETVERSION_0) printf(" v%u", v); if (v != LWRES_LWPACKETVERSION_0) { s = (const char *)np + EXTRACT_32BITS(&np->length); goto tail; } response = EXTRACT_16BITS(&np->pktflags) & LWRES_LWPACKETFLAG_RESPONSE; /* opcode and pktflags */ v = EXTRACT_32BITS(&np->opcode); s = tok2str(opcode, "#0x%x", v); printf(" %s%s", s, response ? "" : "?"); /* pktflags */ v = EXTRACT_16BITS(&np->pktflags); if (v & ~LWRES_LWPACKETFLAG_RESPONSE) printf("[0x%x]", v); if (vflag > 1) { printf(" ("); /*)*/ printf("serial:0x%x", EXTRACT_32BITS(&np->serial)); printf(" result:0x%x", EXTRACT_32BITS(&np->result)); printf(" recvlen:%u", EXTRACT_32BITS(&np->recvlength)); /* BIND910: not used */ if (vflag > 2) { printf(" authtype:0x%x", EXTRACT_16BITS(&np->authtype)); printf(" authlen:%u", EXTRACT_16BITS(&np->authlength)); } /*(*/ printf(")"); } /* per-opcode content */ if (!response) { /* * queries */ lwres_gabnrequest_t *gabn; lwres_gnbarequest_t *gnba; lwres_grbnrequest_t *grbn; u_int32_t l; gabn = NULL; gnba = NULL; grbn = NULL; switch (EXTRACT_32BITS(&np->opcode)) { case LWRES_OPCODE_NOOP: break; case LWRES_OPCODE_GETADDRSBYNAME: gabn = (lwres_gabnrequest_t *)(np + 1); TCHECK(gabn->namelen); /* XXX gabn points to packed struct */ s = (const char *)&gabn->namelen + sizeof(gabn->namelen); l = EXTRACT_16BITS(&gabn->namelen); /* BIND910: not used */ if (vflag > 2) { printf(" flags:0x%x", EXTRACT_32BITS(&gabn->flags)); } v = EXTRACT_32BITS(&gabn->addrtypes); switch (v & (LWRES_ADDRTYPE_V4 | LWRES_ADDRTYPE_V6)) { case LWRES_ADDRTYPE_V4: printf(" IPv4"); break; case LWRES_ADDRTYPE_V6: printf(" IPv6"); break; case LWRES_ADDRTYPE_V4 | LWRES_ADDRTYPE_V6: printf(" IPv4/6"); break; } if (v & ~(LWRES_ADDRTYPE_V4 | LWRES_ADDRTYPE_V6)) printf("[0x%x]", v); advance = lwres_printname(l, s); if (advance < 0) goto trunc; s += advance; break; case LWRES_OPCODE_GETNAMEBYADDR: gnba = (lwres_gnbarequest_t *)(np + 1); TCHECK(gnba->addr); /* BIND910: not used */ if (vflag > 2) { printf(" flags:0x%x", EXTRACT_32BITS(&gnba->flags)); } s = (const char *)&gnba->addr; advance = lwres_printaddr(&gnba->addr); if (advance < 0) goto trunc; s += advance; break; case LWRES_OPCODE_GETRDATABYNAME: /* XXX no trace, not tested */ grbn = (lwres_grbnrequest_t *)(np + 1); TCHECK(grbn->namelen); /* BIND910: not used */ if (vflag > 2) { printf(" flags:0x%x", EXTRACT_32BITS(&grbn->flags)); } printf(" %s", tok2str(ns_type2str, "Type%d", EXTRACT_16BITS(&grbn->rdtype))); if (EXTRACT_16BITS(&grbn->rdclass) != C_IN) { printf(" %s", tok2str(ns_class2str, "Class%d", EXTRACT_16BITS(&grbn->rdclass))); } /* XXX grbn points to packed struct */ s = (const char *)&grbn->namelen + sizeof(grbn->namelen); l = EXTRACT_16BITS(&grbn->namelen); advance = lwres_printname(l, s); if (advance < 0) goto trunc; s += advance; break; default: unsupported++; break; } } else { /* * responses */ lwres_gabnresponse_t *gabn; lwres_gnbaresponse_t *gnba; lwres_grbnresponse_t *grbn; u_int32_t l, na; u_int32_t i; gabn = NULL; gnba = NULL; grbn = NULL; switch (EXTRACT_32BITS(&np->opcode)) { case LWRES_OPCODE_NOOP: break; case LWRES_OPCODE_GETADDRSBYNAME: gabn = (lwres_gabnresponse_t *)(np + 1); TCHECK(gabn->realnamelen); /* XXX gabn points to packed struct */ s = (const char *)&gabn->realnamelen + sizeof(gabn->realnamelen); l = EXTRACT_16BITS(&gabn->realnamelen); /* BIND910: not used */ if (vflag > 2) { printf(" flags:0x%x", EXTRACT_32BITS(&gabn->flags)); } printf(" %u/%u", EXTRACT_16BITS(&gabn->naliases), EXTRACT_16BITS(&gabn->naddrs)); advance = lwres_printname(l, s); if (advance < 0) goto trunc; s += advance; /* aliases */ na = EXTRACT_16BITS(&gabn->naliases); for (i = 0; i < na; i++) { advance = lwres_printnamelen(s); if (advance < 0) goto trunc; s += advance; } /* addrs */ na = EXTRACT_16BITS(&gabn->naddrs); for (i = 0; i < na; i++) { advance = lwres_printaddr((lwres_addr_t *)s); if (advance < 0) goto trunc; s += advance; } break; case LWRES_OPCODE_GETNAMEBYADDR: gnba = (lwres_gnbaresponse_t *)(np + 1); TCHECK(gnba->realnamelen); /* XXX gnba points to packed struct */ s = (const char *)&gnba->realnamelen + sizeof(gnba->realnamelen); l = EXTRACT_16BITS(&gnba->realnamelen); /* BIND910: not used */ if (vflag > 2) { printf(" flags:0x%x", EXTRACT_32BITS(&gnba->flags)); } printf(" %u", EXTRACT_16BITS(&gnba->naliases)); advance = lwres_printname(l, s); if (advance < 0) goto trunc; s += advance; /* aliases */ na = EXTRACT_16BITS(&gnba->naliases); for (i = 0; i < na; i++) { advance = lwres_printnamelen(s); if (advance < 0) goto trunc; s += advance; } break; case LWRES_OPCODE_GETRDATABYNAME: /* XXX no trace, not tested */ grbn = (lwres_grbnresponse_t *)(np + 1); TCHECK(grbn->nsigs); /* BIND910: not used */ if (vflag > 2) { printf(" flags:0x%x", EXTRACT_32BITS(&grbn->flags)); } printf(" %s", tok2str(ns_type2str, "Type%d", EXTRACT_16BITS(&grbn->rdtype))); if (EXTRACT_16BITS(&grbn->rdclass) != C_IN) { printf(" %s", tok2str(ns_class2str, "Class%d", EXTRACT_16BITS(&grbn->rdclass))); } printf(" TTL "); relts_print(EXTRACT_32BITS(&grbn->ttl)); printf(" %u/%u", EXTRACT_16BITS(&grbn->nrdatas), EXTRACT_16BITS(&grbn->nsigs)); /* XXX grbn points to packed struct */ s = (const char *)&grbn->nsigs+ sizeof(grbn->nsigs); advance = lwres_printnamelen(s); if (advance < 0) goto trunc; s += advance; /* rdatas */ na = EXTRACT_16BITS(&grbn->nrdatas); for (i = 0; i < na; i++) { /* XXX should decode resource data */ advance = lwres_printbinlen(s); if (advance < 0) goto trunc; s += advance; } /* sigs */ na = EXTRACT_16BITS(&grbn->nsigs); for (i = 0; i < na; i++) { /* XXX how should we print it? */ advance = lwres_printbinlen(s); if (advance < 0) goto trunc; s += advance; } break; default: unsupported++; break; } } tail: /* length mismatch */ if (EXTRACT_32BITS(&np->length) != length) { printf(" [len: %u != %u]", EXTRACT_32BITS(&np->length), length); } if (!unsupported && s < (const char *)np + EXTRACT_32BITS(&np->length)) printf("[extra]"); return; trunc: printf("[|lwres]"); return; } tcpdump-3.9.8/./TODO0000644000026300017500000000021007224677556012173 0ustar mcrmcr1. update credits 2. review "FILES" 3. search for version info 4. get PLATFORMS filled in 5. update CHANGES file 6. do same for libpcap tcpdump-3.9.8/./print-ap1394.c0000644000026300017500000000735710264535437013732 0ustar mcrmcr/* * Copyright (c) 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 2000 * The Regents of the University of California. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that: (1) source code distributions * retain the above copyright notice and this paragraph in its entirety, (2) * distributions including binary code include the above copyright notice and * this paragraph in its entirety in the documentation or other materials * provided with the distribution, and (3) all advertising materials mentioning * features or use of this software display the following acknowledgement: * ``This product includes software developed by the University of California, * Lawrence Berkeley Laboratory and its contributors.'' Neither the name of * the University nor the names of its contributors may be used to endorse * or promote products derived from this software without specific prior * written permission. * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. */ #ifndef lint static const char rcsid[] _U_ = "@(#) $Header: /tcpdump/master/tcpdump/print-ap1394.c,v 1.3.2.1 2005/07/07 01:24:33 guy Exp $ (LBL)"; #endif #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include #include "interface.h" #include "addrtoname.h" #include "ethertype.h" /* * Structure of a header for Apple's IP-over-IEEE 1384 BPF header. */ #define FIREWIRE_EUI64_LEN 8 struct firewire_header { u_char firewire_dhost[FIREWIRE_EUI64_LEN]; u_char firewire_shost[FIREWIRE_EUI64_LEN]; u_short firewire_type; }; /* * Length of that header; note that some compilers may pad * "struct firewire_header" to a multiple of 4 bytes, for example, so * "sizeof (struct firewire_header)" may not give the right answer. */ #define FIREWIRE_HDRLEN 18 static inline void ap1394_hdr_print(register const u_char *bp, u_int length) { register const struct firewire_header *fp; fp = (const struct firewire_header *)bp; (void)printf("%s > %s", linkaddr_string(fp->firewire_dhost, FIREWIRE_EUI64_LEN), linkaddr_string(fp->firewire_shost, FIREWIRE_EUI64_LEN)); if (!qflag) { (void)printf(", ethertype %s (0x%04x)", tok2str(ethertype_values,"Unknown", ntohs(fp->firewire_type)), ntohs(fp->firewire_type)); } else { (void)printf(", %s", tok2str(ethertype_values,"Unknown Ethertype (0x%04x)", ntohs(fp->firewire_type))); } (void)printf(", length %u: ", length); } /* * This is the top level routine of the printer. 'p' points * to the ether header of the packet, 'h->ts' is the timestamp, * 'h->len' is the length of the packet off the wire, and 'h->caplen' * is the number of bytes actually captured. */ u_int ap1394_if_print(const struct pcap_pkthdr *h, const u_char *p) { u_int length = h->len; u_int caplen = h->caplen; struct firewire_header *fp; u_short ether_type; u_short extracted_ether_type; if (caplen < FIREWIRE_HDRLEN) { printf("[|ap1394]"); return FIREWIRE_HDRLEN; } if (eflag) ap1394_hdr_print(p, length); length -= FIREWIRE_HDRLEN; caplen -= FIREWIRE_HDRLEN; fp = (struct firewire_header *)p; p += FIREWIRE_HDRLEN; ether_type = ntohs(fp->firewire_type); extracted_ether_type = 0; if (ether_encap_print(ether_type, p, length, caplen, &extracted_ether_type) == 0) { /* ether_type not known, print raw packet */ if (!eflag) ap1394_hdr_print((u_char *)fp, length + FIREWIRE_HDRLEN); if (!suppress_default_print) default_print(p, caplen); } return FIREWIRE_HDRLEN; } tcpdump-3.9.8/./print-udp.c0000644000026300017500000004324310634111731013557 0ustar mcrmcr/* * Copyright (c) 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997 * The Regents of the University of California. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that: (1) source code distributions * retain the above copyright notice and this paragraph in its entirety, (2) * distributions including binary code include the above copyright notice and * this paragraph in its entirety in the documentation or other materials * provided with the distribution, and (3) all advertising materials mentioning * features or use of this software display the following acknowledgement: * ``This product includes software developed by the University of California, * Lawrence Berkeley Laboratory and its contributors.'' Neither the name of * the University nor the names of its contributors may be used to endorse * or promote products derived from this software without specific prior * written permission. * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. */ #ifndef lint static const char rcsid[] _U_ = "@(#) $Header: /tcpdump/master/tcpdump/print-udp.c,v 1.138.2.1 2007/03/28 07:45:46 hannes Exp $ (LBL)"; #endif #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #ifdef SEGSIZE #undef SEGSIZE #endif #include #include #include #include "interface.h" #include "addrtoname.h" #include "extract.h" #include "appletalk.h" #include "udp.h" #include "ip.h" #ifdef INET6 #include "ip6.h" #endif #include "ipproto.h" #include "rpc_auth.h" #include "rpc_msg.h" #include "nameser.h" #include "nfs.h" #include "bootp.h" struct rtcphdr { u_int16_t rh_flags; /* T:2 P:1 CNT:5 PT:8 */ u_int16_t rh_len; /* length of message (in words) */ u_int32_t rh_ssrc; /* synchronization src id */ }; typedef struct { u_int32_t upper; /* more significant 32 bits */ u_int32_t lower; /* less significant 32 bits */ } ntp64; /* * Sender report. */ struct rtcp_sr { ntp64 sr_ntp; /* 64-bit ntp timestamp */ u_int32_t sr_ts; /* reference media timestamp */ u_int32_t sr_np; /* no. packets sent */ u_int32_t sr_nb; /* no. bytes sent */ }; /* * Receiver report. * Time stamps are middle 32-bits of ntp timestamp. */ struct rtcp_rr { u_int32_t rr_srcid; /* sender being reported */ u_int32_t rr_nl; /* no. packets lost */ u_int32_t rr_ls; /* extended last seq number received */ u_int32_t rr_dv; /* jitter (delay variance) */ u_int32_t rr_lsr; /* orig. ts from last rr from this src */ u_int32_t rr_dlsr; /* time from recpt of last rr to xmit time */ }; /*XXX*/ #define RTCP_PT_SR 200 #define RTCP_PT_RR 201 #define RTCP_PT_SDES 202 #define RTCP_SDES_CNAME 1 #define RTCP_SDES_NAME 2 #define RTCP_SDES_EMAIL 3 #define RTCP_SDES_PHONE 4 #define RTCP_SDES_LOC 5 #define RTCP_SDES_TOOL 6 #define RTCP_SDES_NOTE 7 #define RTCP_SDES_PRIV 8 #define RTCP_PT_BYE 203 #define RTCP_PT_APP 204 static void vat_print(const void *hdr, register const struct udphdr *up) { /* vat/vt audio */ u_int ts = *(u_int16_t *)hdr; if ((ts & 0xf060) != 0) { /* probably vt */ (void)printf("udp/vt %u %d / %d", (u_int32_t)(EXTRACT_16BITS(&up->uh_ulen) - sizeof(*up)), ts & 0x3ff, ts >> 10); } else { /* probably vat */ u_int32_t i0 = EXTRACT_32BITS(&((u_int *)hdr)[0]); u_int32_t i1 = EXTRACT_32BITS(&((u_int *)hdr)[1]); printf("udp/vat %u c%d %u%s", (u_int32_t)(EXTRACT_16BITS(&up->uh_ulen) - sizeof(*up) - 8), i0 & 0xffff, i1, i0 & 0x800000? "*" : ""); /* audio format */ if (i0 & 0x1f0000) printf(" f%d", (i0 >> 16) & 0x1f); if (i0 & 0x3f000000) printf(" s%d", (i0 >> 24) & 0x3f); } } static void rtp_print(const void *hdr, u_int len, register const struct udphdr *up) { /* rtp v1 or v2 */ u_int *ip = (u_int *)hdr; u_int hasopt, hasext, contype, hasmarker; u_int32_t i0 = EXTRACT_32BITS(&((u_int *)hdr)[0]); u_int32_t i1 = EXTRACT_32BITS(&((u_int *)hdr)[1]); u_int dlen = EXTRACT_16BITS(&up->uh_ulen) - sizeof(*up) - 8; const char * ptype; ip += 2; len >>= 2; len -= 2; hasopt = 0; hasext = 0; if ((i0 >> 30) == 1) { /* rtp v1 */ hasopt = i0 & 0x800000; contype = (i0 >> 16) & 0x3f; hasmarker = i0 & 0x400000; ptype = "rtpv1"; } else { /* rtp v2 */ hasext = i0 & 0x10000000; contype = (i0 >> 16) & 0x7f; hasmarker = i0 & 0x800000; dlen -= 4; ptype = "rtp"; ip += 1; len -= 1; } printf("udp/%s %d c%d %s%s %d %u", ptype, dlen, contype, (hasopt || hasext)? "+" : "", hasmarker? "*" : "", i0 & 0xffff, i1); if (vflag) { printf(" %u", EXTRACT_32BITS(&((u_int *)hdr)[2])); if (hasopt) { u_int i2, optlen; do { i2 = ip[0]; optlen = (i2 >> 16) & 0xff; if (optlen == 0 || optlen > len) { printf(" !opt"); return; } ip += optlen; len -= optlen; } while ((int)i2 >= 0); } if (hasext) { u_int i2, extlen; i2 = ip[0]; extlen = (i2 & 0xffff) + 1; if (extlen > len) { printf(" !ext"); return; } ip += extlen; } if (contype == 0x1f) /*XXX H.261 */ printf(" 0x%04x", ip[0] >> 16); } } static const u_char * rtcp_print(const u_char *hdr, const u_char *ep) { /* rtp v2 control (rtcp) */ struct rtcp_rr *rr = 0; struct rtcp_sr *sr; struct rtcphdr *rh = (struct rtcphdr *)hdr; u_int len; u_int16_t flags; int cnt; double ts, dts; if ((u_char *)(rh + 1) > ep) { printf(" [|rtcp]"); return (ep); } len = (EXTRACT_16BITS(&rh->rh_len) + 1) * 4; flags = EXTRACT_16BITS(&rh->rh_flags); cnt = (flags >> 8) & 0x1f; switch (flags & 0xff) { case RTCP_PT_SR: sr = (struct rtcp_sr *)(rh + 1); printf(" sr"); if (len != cnt * sizeof(*rr) + sizeof(*sr) + sizeof(*rh)) printf(" [%d]", len); if (vflag) printf(" %u", EXTRACT_32BITS(&rh->rh_ssrc)); if ((u_char *)(sr + 1) > ep) { printf(" [|rtcp]"); return (ep); } ts = (double)(EXTRACT_32BITS(&sr->sr_ntp.upper)) + ((double)(EXTRACT_32BITS(&sr->sr_ntp.lower)) / 4294967296.0); printf(" @%.2f %u %up %ub", ts, EXTRACT_32BITS(&sr->sr_ts), EXTRACT_32BITS(&sr->sr_np), EXTRACT_32BITS(&sr->sr_nb)); rr = (struct rtcp_rr *)(sr + 1); break; case RTCP_PT_RR: printf(" rr"); if (len != cnt * sizeof(*rr) + sizeof(*rh)) printf(" [%d]", len); rr = (struct rtcp_rr *)(rh + 1); if (vflag) printf(" %u", EXTRACT_32BITS(&rh->rh_ssrc)); break; case RTCP_PT_SDES: printf(" sdes %d", len); if (vflag) printf(" %u", EXTRACT_32BITS(&rh->rh_ssrc)); cnt = 0; break; case RTCP_PT_BYE: printf(" bye %d", len); if (vflag) printf(" %u", EXTRACT_32BITS(&rh->rh_ssrc)); cnt = 0; break; default: printf(" type-0x%x %d", flags & 0xff, len); cnt = 0; break; } if (cnt > 1) printf(" c%d", cnt); while (--cnt >= 0) { if ((u_char *)(rr + 1) > ep) { printf(" [|rtcp]"); return (ep); } if (vflag) printf(" %u", EXTRACT_32BITS(&rr->rr_srcid)); ts = (double)(EXTRACT_32BITS(&rr->rr_lsr)) / 65536.; dts = (double)(EXTRACT_32BITS(&rr->rr_dlsr)) / 65536.; printf(" %ul %us %uj @%.2f+%.2f", EXTRACT_32BITS(&rr->rr_nl) & 0x00ffffff, EXTRACT_32BITS(&rr->rr_ls), EXTRACT_32BITS(&rr->rr_dv), ts, dts); } return (hdr + len); } static int udp_cksum(register const struct ip *ip, register const struct udphdr *up, register u_int len) { union phu { struct phdr { u_int32_t src; u_int32_t dst; u_char mbz; u_char proto; u_int16_t len; } ph; u_int16_t pa[6]; } phu; register const u_int16_t *sp; /* pseudo-header.. */ phu.ph.len = htons((u_int16_t)len); phu.ph.mbz = 0; phu.ph.proto = IPPROTO_UDP; memcpy(&phu.ph.src, &ip->ip_src.s_addr, sizeof(u_int32_t)); if (IP_HL(ip) == 5) memcpy(&phu.ph.dst, &ip->ip_dst.s_addr, sizeof(u_int32_t)); else phu.ph.dst = ip_finddst(ip); sp = &phu.pa[0]; return in_cksum((u_short *)up, len, sp[0]+sp[1]+sp[2]+sp[3]+sp[4]+sp[5]); } #ifdef INET6 static int udp6_cksum(const struct ip6_hdr *ip6, const struct udphdr *up, u_int len) { size_t i; register const u_int16_t *sp; u_int32_t sum; union { struct { struct in6_addr ph_src; struct in6_addr ph_dst; u_int32_t ph_len; u_int8_t ph_zero[3]; u_int8_t ph_nxt; } ph; u_int16_t pa[20]; } phu; /* pseudo-header */ memset(&phu, 0, sizeof(phu)); phu.ph.ph_src = ip6->ip6_src; phu.ph.ph_dst = ip6->ip6_dst; phu.ph.ph_len = htonl(len); phu.ph.ph_nxt = IPPROTO_UDP; sum = 0; for (i = 0; i < sizeof(phu.pa) / sizeof(phu.pa[0]); i++) sum += phu.pa[i]; sp = (const u_int16_t *)up; for (i = 0; i < (len & ~1); i += 2) sum += *sp++; if (len & 1) sum += htons((*(const u_int8_t *)sp) << 8); while (sum > 0xffff) sum = (sum & 0xffff) + (sum >> 16); sum = ~sum & 0xffff; return (sum); } #endif static void udpipaddr_print(const struct ip *ip, int sport, int dport) { #ifdef INET6 const struct ip6_hdr *ip6; if (IP_V(ip) == 6) ip6 = (const struct ip6_hdr *)ip; else ip6 = NULL; if (ip6) { if (ip6->ip6_nxt == IPPROTO_UDP) { if (sport == -1) { (void)printf("%s > %s: ", ip6addr_string(&ip6->ip6_src), ip6addr_string(&ip6->ip6_dst)); } else { (void)printf("%s.%s > %s.%s: ", ip6addr_string(&ip6->ip6_src), udpport_string(sport), ip6addr_string(&ip6->ip6_dst), udpport_string(dport)); } } else { if (sport != -1) { (void)printf("%s > %s: ", udpport_string(sport), udpport_string(dport)); } } } else #endif /*INET6*/ { if (ip->ip_p == IPPROTO_UDP) { if (sport == -1) { (void)printf("%s > %s: ", ipaddr_string(&ip->ip_src), ipaddr_string(&ip->ip_dst)); } else { (void)printf("%s.%s > %s.%s: ", ipaddr_string(&ip->ip_src), udpport_string(sport), ipaddr_string(&ip->ip_dst), udpport_string(dport)); } } else { if (sport != -1) { (void)printf("%s > %s: ", udpport_string(sport), udpport_string(dport)); } } } } void udp_print(register const u_char *bp, u_int length, register const u_char *bp2, int fragmented) { register const struct udphdr *up; register const struct ip *ip; register const u_char *cp; register const u_char *ep = bp + length; u_int16_t sport, dport, ulen; #ifdef INET6 register const struct ip6_hdr *ip6; #endif if (ep > snapend) ep = snapend; up = (struct udphdr *)bp; ip = (struct ip *)bp2; #ifdef INET6 if (IP_V(ip) == 6) ip6 = (struct ip6_hdr *)bp2; else ip6 = NULL; #endif /*INET6*/ cp = (u_char *)(up + 1); if (!TTEST(up->uh_dport)) { udpipaddr_print(ip, -1, -1); (void)printf("[|udp]"); return; } sport = EXTRACT_16BITS(&up->uh_sport); dport = EXTRACT_16BITS(&up->uh_dport); if (length < sizeof(struct udphdr)) { udpipaddr_print(ip, sport, dport); (void)printf("truncated-udp %d", length); return; } length -= sizeof(struct udphdr); if (cp > snapend) { udpipaddr_print(ip, sport, dport); (void)printf("[|udp]"); return; } ulen = EXTRACT_16BITS(&up->uh_ulen); if (ulen < 8) { udpipaddr_print(ip, sport, dport); (void)printf("truncated-udplength %d", ulen); return; } if (packettype) { register struct sunrpc_msg *rp; enum sunrpc_msg_type direction; switch (packettype) { case PT_VAT: udpipaddr_print(ip, sport, dport); vat_print((void *)(up + 1), up); break; case PT_WB: udpipaddr_print(ip, sport, dport); wb_print((void *)(up + 1), length); break; case PT_RPC: rp = (struct sunrpc_msg *)(up + 1); direction = (enum sunrpc_msg_type)EXTRACT_32BITS(&rp->rm_direction); if (direction == SUNRPC_CALL) sunrpcrequest_print((u_char *)rp, length, (u_char *)ip); else nfsreply_print((u_char *)rp, length, (u_char *)ip); /*XXX*/ break; case PT_RTP: udpipaddr_print(ip, sport, dport); rtp_print((void *)(up + 1), length, up); break; case PT_RTCP: udpipaddr_print(ip, sport, dport); while (cp < ep) cp = rtcp_print(cp, ep); break; case PT_SNMP: udpipaddr_print(ip, sport, dport); snmp_print((const u_char *)(up + 1), length); break; case PT_CNFP: udpipaddr_print(ip, sport, dport); cnfp_print(cp, (const u_char *)ip); break; case PT_TFTP: udpipaddr_print(ip, sport, dport); tftp_print(cp, length); break; case PT_AODV: udpipaddr_print(ip, sport, dport); aodv_print((const u_char *)(up + 1), length, #ifdef INET6 ip6 != NULL); #else 0); #endif break; } return; } if (!qflag) { register struct sunrpc_msg *rp; enum sunrpc_msg_type direction; rp = (struct sunrpc_msg *)(up + 1); if (TTEST(rp->rm_direction)) { direction = (enum sunrpc_msg_type)EXTRACT_32BITS(&rp->rm_direction); if (dport == NFS_PORT && direction == SUNRPC_CALL) { nfsreq_print((u_char *)rp, length, (u_char *)ip); return; } if (sport == NFS_PORT && direction == SUNRPC_REPLY) { nfsreply_print((u_char *)rp, length, (u_char *)ip); return; } #ifdef notdef if (dport == SUNRPC_PORT && direction == SUNRPC_CALL) { sunrpcrequest_print((u_char *)rp, length, (u_char *)ip); return; } #endif } if (TTEST(((struct LAP *)cp)->type) && ((struct LAP *)cp)->type == lapDDP && (atalk_port(sport) || atalk_port(dport))) { if (vflag) fputs("kip ", stdout); llap_print(cp, length); return; } } udpipaddr_print(ip, sport, dport); if (IP_V(ip) == 4 && (vflag > 1) && !fragmented) { int sum = up->uh_sum; if (sum == 0) { (void)printf("[no cksum] "); } else if (TTEST2(cp[0], length)) { sum = udp_cksum(ip, up, length + sizeof(struct udphdr)); if (sum != 0) (void)printf("[bad udp cksum %x!] ", sum); else (void)printf("[udp sum ok] "); } } #ifdef INET6 if (IP_V(ip) == 6 && ip6->ip6_plen && vflag && !fragmented) { int sum = up->uh_sum; /* for IPv6, UDP checksum is mandatory */ if (TTEST2(cp[0], length)) { sum = udp6_cksum(ip6, up, length + sizeof(struct udphdr)); if (sum != 0) (void)printf("[bad udp cksum %x!] ", sum); else (void)printf("[udp sum ok] "); } } #endif if (!qflag) { #define ISPORT(p) (dport == (p) || sport == (p)) if (ISPORT(NAMESERVER_PORT)) ns_print((const u_char *)(up + 1), length, 0); else if (ISPORT(MULTICASTDNS_PORT)) ns_print((const u_char *)(up + 1), length, 1); else if (ISPORT(TIMED_PORT)) timed_print((const u_char *)(up + 1)); else if (ISPORT(TFTP_PORT)) tftp_print((const u_char *)(up + 1), length); else if (ISPORT(IPPORT_BOOTPC) || ISPORT(IPPORT_BOOTPS)) bootp_print((const u_char *)(up + 1), length); else if (ISPORT(RIP_PORT)) rip_print((const u_char *)(up + 1), length); else if (ISPORT(AODV_PORT)) aodv_print((const u_char *)(up + 1), length, #ifdef INET6 ip6 != NULL); #else 0); #endif else if (ISPORT(ISAKMP_PORT)) isakmp_print(gndo, (const u_char *)(up + 1), length, bp2); else if (ISPORT(ISAKMP_PORT_NATT)) isakmp_rfc3948_print(gndo, (const u_char *)(up + 1), length, bp2); #if 1 /*???*/ else if (ISPORT(ISAKMP_PORT_USER1) || ISPORT(ISAKMP_PORT_USER2)) isakmp_print(gndo, (const u_char *)(up + 1), length, bp2); #endif else if (ISPORT(SNMP_PORT) || ISPORT(SNMPTRAP_PORT)) snmp_print((const u_char *)(up + 1), length); else if (ISPORT(NTP_PORT)) ntp_print((const u_char *)(up + 1), length); else if (ISPORT(KERBEROS_PORT) || ISPORT(KERBEROS_SEC_PORT)) krb_print((const void *)(up + 1)); else if (ISPORT(L2TP_PORT)) l2tp_print((const u_char *)(up + 1), length); #ifdef TCPDUMP_DO_SMB else if (ISPORT(NETBIOS_NS_PORT)) nbt_udp137_print((const u_char *)(up + 1), length); else if (ISPORT(NETBIOS_DGRAM_PORT)) nbt_udp138_print((const u_char *)(up + 1), length); #endif else if (dport == 3456) vat_print((const void *)(up + 1), up); else if (ISPORT(ZEPHYR_SRV_PORT) || ISPORT(ZEPHYR_CLT_PORT)) zephyr_print((const void *)(up + 1), length); /* * Since there are 10 possible ports to check, I think * a <> test would be more efficient */ else if ((sport >= RX_PORT_LOW && sport <= RX_PORT_HIGH) || (dport >= RX_PORT_LOW && dport <= RX_PORT_HIGH)) rx_print((const void *)(up + 1), length, sport, dport, (u_char *) ip); #ifdef INET6 else if (ISPORT(RIPNG_PORT)) ripng_print((const u_char *)(up + 1), length); else if (ISPORT(DHCP6_SERV_PORT) || ISPORT(DHCP6_CLI_PORT)) { dhcp6_print((const u_char *)(up + 1), length); } #endif /*INET6*/ /* * Kludge in test for whiteboard packets. */ else if (dport == 4567) wb_print((const void *)(up + 1), length); else if (ISPORT(CISCO_AUTORP_PORT)) cisco_autorp_print((const void *)(up + 1), length); else if (ISPORT(RADIUS_PORT) || ISPORT(RADIUS_NEW_PORT) || ISPORT(RADIUS_ACCOUNTING_PORT) || ISPORT(RADIUS_NEW_ACCOUNTING_PORT) ) radius_print((const u_char *)(up+1), length); else if (dport == HSRP_PORT) hsrp_print((const u_char *)(up + 1), length); else if (ISPORT(LWRES_PORT)) lwres_print((const u_char *)(up + 1), length); else if (ISPORT(LDP_PORT)) ldp_print((const u_char *)(up + 1), length); else if (ISPORT(OLSR_PORT)) olsr_print((const u_char *)(up + 1), length); else if (ISPORT(MPLS_LSP_PING_PORT)) lspping_print((const u_char *)(up + 1), length); else if (dport == BFD_CONTROL_PORT || dport == BFD_ECHO_PORT ) bfd_print((const u_char *)(up+1), length, dport); else if (ISPORT(LMP_PORT)) lmp_print((const u_char *)(up + 1), length); else if (ISPORT(SIP_PORT)) sip_print((const u_char *)(up + 1), length); else if (ISPORT(SYSLOG_PORT)) syslog_print((const u_char *)(up + 1), length); else (void)printf("UDP, length %u", (u_int32_t)(ulen - sizeof(*up))); #undef ISPORT } else (void)printf("UDP, length %u", (u_int32_t)(ulen - sizeof(*up))); } /* * Local Variables: * c-style: whitesmith * c-basic-offset: 8 * End: */ tcpdump-3.9.8/./print-token.c0000644000026300017500000001264310504040015014077 0ustar mcrmcr/* * Copyright (c) 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996 * The Regents of the University of California. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that: (1) source code distributions * retain the above copyright notice and this paragraph in its entirety, (2) * distributions including binary code include the above copyright notice and * this paragraph in its entirety in the documentation or other materials * provided with the distribution, and (3) all advertising materials mentioning * features or use of this software display the following acknowledgement: * ``This product includes software developed by the University of California, * Lawrence Berkeley Laboratory and its contributors.'' Neither the name of * the University nor the names of its contributors may be used to endorse * or promote products derived from this software without specific prior * written permission. * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * * Hacked version of print-ether.c Larry Lile * * Further tweaked to more closely resemble print-fddi.c * Guy Harris */ #ifndef lint static const char rcsid[] _U_ = "@(#) $Header: /tcpdump/master/tcpdump/print-token.c,v 1.25.2.2 2005/11/13 12:13:01 guy Exp $"; #endif #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include #include #include "interface.h" #include "addrtoname.h" #include "ethertype.h" #include "ether.h" #include "token.h" /* Extract src, dst addresses */ static inline void extract_token_addrs(const struct token_header *trp, char *fsrc, char *fdst) { memcpy(fdst, (const char *)trp->token_dhost, 6); memcpy(fsrc, (const char *)trp->token_shost, 6); } /* * Print the TR MAC header */ static inline void token_hdr_print(register const struct token_header *trp, register u_int length, register const u_char *fsrc, register const u_char *fdst) { const char *srcname, *dstname; srcname = etheraddr_string(fsrc); dstname = etheraddr_string(fdst); if (vflag) (void) printf("%02x %02x %s %s %d: ", trp->token_ac, trp->token_fc, srcname, dstname, length); else printf("%s %s %d: ", srcname, dstname, length); } static const char *broadcast_indicator[] = { "Non-Broadcast", "Non-Broadcast", "Non-Broadcast", "Non-Broadcast", "All-routes", "All-routes", "Single-route", "Single-route" }; static const char *direction[] = { "Forward", "Backward" }; static const char *largest_frame[] = { "516", "1500", "2052", "4472", "8144", "11407", "17800", "??" }; u_int token_print(const u_char *p, u_int length, u_int caplen) { const struct token_header *trp; u_short extracted_ethertype; struct ether_header ehdr; u_int route_len = 0, hdr_len = TOKEN_HDRLEN; int seg; trp = (const struct token_header *)p; if (caplen < TOKEN_HDRLEN) { printf("[|token-ring]"); return hdr_len; } /* * Get the TR addresses into a canonical form */ extract_token_addrs(trp, (char*)ESRC(&ehdr), (char*)EDST(&ehdr)); /* Adjust for source routing information in the MAC header */ if (IS_SOURCE_ROUTED(trp)) { /* Clear source-routed bit */ *ESRC(&ehdr) &= 0x7f; if (eflag) token_hdr_print(trp, length, ESRC(&ehdr), EDST(&ehdr)); route_len = RIF_LENGTH(trp); if (vflag) { printf("%s ", broadcast_indicator[BROADCAST(trp)]); printf("%s", direction[DIRECTION(trp)]); for (seg = 0; seg < SEGMENT_COUNT(trp); seg++) printf(" [%d:%d]", RING_NUMBER(trp, seg), BRIDGE_NUMBER(trp, seg)); } else { printf("rt = %x", ntohs(trp->token_rcf)); for (seg = 0; seg < SEGMENT_COUNT(trp); seg++) printf(":%x", ntohs(trp->token_rseg[seg])); } printf(" (%s) ", largest_frame[LARGEST_FRAME(trp)]); } else { if (eflag) token_hdr_print(trp, length, ESRC(&ehdr), EDST(&ehdr)); } /* Skip over token ring MAC header and routing information */ hdr_len += route_len; length -= hdr_len; p += hdr_len; caplen -= hdr_len; /* Frame Control field determines interpretation of packet */ if (FRAME_TYPE(trp) == TOKEN_FC_LLC) { /* Try to print the LLC-layer header & higher layers */ if (llc_print(p, length, caplen, ESRC(&ehdr), EDST(&ehdr), &extracted_ethertype) == 0) { /* ether_type not known, print raw packet */ if (!eflag) token_hdr_print(trp, length + TOKEN_HDRLEN + route_len, ESRC(&ehdr), EDST(&ehdr)); if (extracted_ethertype) { printf("(LLC %s) ", etherproto_string(htons(extracted_ethertype))); } if (!suppress_default_print) default_print(p, caplen); } } else { /* Some kinds of TR packet we cannot handle intelligently */ /* XXX - dissect MAC packets if frame type is 0 */ if (!eflag) token_hdr_print(trp, length + TOKEN_HDRLEN + route_len, ESRC(&ehdr), EDST(&ehdr)); if (!suppress_default_print) default_print(p, caplen); } return (hdr_len); } /* * This is the top level routine of the printer. 'p' points * to the TR header of the packet, 'h->ts' is the timestamp, * 'h->len' is the length of the packet off the wire, and 'h->caplen' * is the number of bytes actually captured. */ u_int token_if_print(const struct pcap_pkthdr *h, const u_char *p) { return (token_print(p, h->len, h->caplen)); } tcpdump-3.9.8/./INSTALL0000644000026300017500000002701310676336430012532 0ustar mcrmcr@(#) $Header: /tcpdump/master/tcpdump/INSTALL,v 1.63.2.7 2007/09/14 01:03:12 guy Exp $ (LBL) If you have not built libpcap, and your system does not have libpcap installed, install libpcap first. Your system might provide a version of libpcap that can be installed; if so, to compile tcpdump you might need to install a "developer" version of libpcap as well as the "run-time" version. You can also install tcpdump.org's version of libpcap; see the README file in this directory for the ftp location. You will need an ANSI C compiler to build tcpdump. The configure script will abort if your compiler is not ANSI compliant. If this happens, use the GNU C compiler, available via anonymous ftp: ftp://ftp.gnu.org/pub/gnu/gcc/ After libpcap has been built (either install it with "make install" or make sure both the libpcap and tcpdump source trees are in the same directory), run ./configure (a shell script). "configure" will determine your system attributes and generate an appropriate Makefile from Makefile.in. Now build tcpdump by running "make". If everything builds ok, su and type "make install". This will install tcpdump and the manual entry. Any user will be able to use tcpdump to read saved captures. Whether a user will be able to capture traffic depends on the OS and the configuration of the system; see the tcpdump man page for details. DO NOT give untrusted users the ability to capture traffic. If a user can capture traffic, he or she could use utilities such as tcpdump to capture any traffic on your net, including passwords. Note that most systems ship tcpdump, but usually an older version. Remember to remove or rename the installed binary when upgrading. If your system is not one which we have tested tcpdump on, you may have to modify the configure script and Makefile.in. Please send us patches for any modifications you need to make. Please see "PLATFORMS" for notes about tested platforms. FILES ----- CHANGES - description of differences between releases CREDITS - people that have helped tcpdump along FILES - list of files exported as part of the distribution INSTALL - this file LICENSE - the license under which tcpdump is distributed Makefile.in - compilation rules (input to the configure script) README - description of distribution Readme.Win32 - notes on building tcpdump on Win32 systems (with WinPcap) VERSION - version of this release acconfig.h - autoconf input aclocal.m4 - autoconf macros addrtoname.c - address to hostname routines addrtoname.h - address to hostname definitions ah.h - IPSEC Authentication Header definitions aodv.h - AODV definitions appletalk.h - AppleTalk definitions arcnet.h - ARCNET definitions atime.awk - TCP ack awk script atm.h - ATM traffic type definitions atmuni31.h - ATM Q.2931 definitions bgp.h - BGP declarations bootp.h - BOOTP definitions bpf_dump.c - BPF program printing routines, in case libpcap doesn't have them chdlc.h - Cisco HDLC definitions cpack.c - functions to extract packed data cpack.h - declarations of functions to extract packed data config.guess - autoconf support config.h.in - autoconf input config.sub - autoconf support configure - configure script (run this first) configure.in - configure script source dccp.h - DCCP definitions decnet.h - DECnet definitions decode_prefix.h - Declarations of "decode_prefix{4,6}()" enc.h - OpenBSD IPsec encapsulation BPF layer definitions esp.h - IPSEC Encapsulating Security Payload definitions ether.h - Ethernet definitions ethertype.h - Ethernet type value definitions extract.h - alignment definitions fddi.h - Fiber Distributed Data Interface definitions gmpls.c - GMPLS definitions gmpls.h - GMPLS declarations gmt2local.c - time conversion routines gmt2local.h - time conversion prototypes icmp6.h - ICMPv6 definitiions ieee802_11.h - IEEE 802.11 definitions ieee802_11_radio.h - radiotap header definitions igrp.h - Interior Gateway Routing Protocol definitions install-sh - BSD style install script interface.h - globals, prototypes and definitions ip.h - IP definitions ip6.h - IPv6 definitions ipfc.h - IP-over-Fibre Channel definitions ipproto.c - IP protocol type value-to-name table ipproto.h - IP protocol type value definitions ipsec_doi.h - ISAKMP packet definitions - RFC2407 ipx.h - IPX definitions isakmp.h - ISAKMP packet definitions - RFC2408 l2vpn.c - L2VPN encapsulation value-to-name table l2vpn.h - L2VPN encapsulation definitions l2tp.h - Layer Two Tunneling Protocol definitions lane.h - ATM LANE definitions lbl/os-*.h - OS-dependent defines and prototypes llc.h - LLC definitions machdep.c - machine dependent routines machdep.h - machine dependent definitions makemib - mib to header script mib.h - mib definitions missing/* - replacements for missing library functions mkdep - construct Makefile dependency list mpls.h - MPLS definitions nameser.h - DNS definitions netbios.h - NETBIOS definitions netdissect.h - definitions and declarations for tcpdump-as-library (under development) nfs.h - Network File System V2 definitions nfsfh.h - Network File System file handle definitions nlpid.c - OSI NLPID value-to-name table nlpid.h - OSI NLPID definitions ntp.h - Network Time Protocol definitions oakley.h - ISAKMP packet definitions - RFC2409 ospf.h - Open Shortest Path First definitions ospf6.h - IPv6 Open Shortest Path First definitions packetdat.awk - TCP chunk summary awk script parsenfsfh.c - Network File System file parser routines pcap_dump_ftell.c - pcap_dump_ftell() implementation, in case libpcap doesn't have it pcap-missing.h - declarations of functions possibly missing from libpcap pmap_prot.h - definitions for ONC RPC portmapper protocol ppp.h - Point to Point Protocol definitions print-802_11.c - IEEE 802.11 printer routines print-ap1394.c - Apple IP-over-IEEE 1394 printer routines print-ah.c - IPSEC Authentication Header printer routines print-aodv.c - AODV printer routines print-arcnet.c - ARCNET printer routines print-arp.c - Address Resolution Protocol printer routines print-ascii.c - ASCII packet dump routines print-atalk.c - AppleTalk printer routines print-atm.c - ATM printer routines print-bgp.c - Border Gateway Protocol printer routines print-bootp.c - BOOTP and IPv4 DHCP printer routines print-beep.c - BEEP printer routines print-cdp.c - Cisco Discovery Protocol printer routines print-chdlc.c - Cisco HDLC printer routines print-cip.c - Classical-IP over ATM routines print-cnfp.c - Cisco NetFlow printer routines print-dccp.c - DCCP printer routines print-decnet.c - DECnet printer routines print-dhcp6.c - IPv6 DHCP printer routines print-domain.c - Domain Name System printer routines print-dvmrp.c - Distance Vector Multicast Routing Protocol printer routines print-eap.c - EAP printer routines print-enc.c - OpenBSD IPsec encapsulation BPF layer printer routines print-egp.c - External Gateway Protocol printer routines print-esp.c - IPSEC Encapsulating Security Payload printer routines print-ether.c - Ethernet printer routines print-fddi.c - Fiber Distributed Data Interface printer routines print-fr.c - Frame Relay printer routines print-frag6.c - IPv6 fragmentation header printer routines print-gre.c - Generic Routing Encapsulation printer routines print-hsrp.c - Cisco Hot Standby Router Protocol printer routines print-icmp.c - Internet Control Message Protocol printer routines print-icmp6.c - IPv6 Internet Control Message Protocol printer routines print-igmp.c - Internet Group Management Protocol printer routines print-igrp.c - Interior Gateway Routing Protocol printer routines print-ip.c - IP printer routines print-ip6.c - IPv6 printer routines print-ip6opts.c - IPv6 header option printer routines print-ipcomp.c - IP Payload Compression Protocol printer routines print-ipx.c - IPX printer routines print-isakmp.c - Internet Security Association and Key Management Protocol print-isoclns.c - ISO CLNS, ESIS, and ISIS printer routines print-krb.c - Kerberos printer routines print-l2tp.c - Layer Two Tunneling Protocol printer routines print-lane.c - ATM LANE printer routines print-llc.c - IEEE 802.2 LLC printer routines print-lspping.c - LSPPING printer routines print-lwres.c - Lightweight Resolver protocol printer routines print-mobile.c - IPv4 mobility printer routines print-mobility.c - IPv6 mobility printer routines print-mpls.c - Multi-Protocol Label Switching printer routines print-msdp.c - Multicast Source Discovery Protocol printer routines print-netbios.c - NetBIOS frame protocol printer routines print-nfs.c - Network File System printer routines print-ntp.c - Network Time Protocol printer routines print-null.c - BSD loopback device printer routines print-ospf.c - Open Shortest Path First printer routines print-ospf6.c - IPv6 Open Shortest Path First printer routines print-pflog.c - OpenBSD packet filter log file printer routines print-pgm.c - Pragmatic General Multicast printer routines print-pim.c - Protocol Independent Multicast printer routines print-ppp.c - Point to Point Protocol printer routines print-pppoe.c - PPP-over-Ethernet printer routines print-pptp.c - Point-to-Point Tunnelling Protocol printer routines print-radius.c - Radius protocol printer routines print-raw.c - Raw IP printer routines print-rip.c - Routing Information Protocol printer routines print-ripng.c - IPv6 Routing Information Protocol printer routines print-rsvp.c - Resource reSerVation Protocol (RSVP) printer routines print-rt6.c - IPv6 routing header printer routines print-rx.c - AFS RX printer routines print-sctp.c - Stream Control Transmission Protocol printer routines print-sip.c - SIP printer routines print-sl.c - Compressed Serial Line Internet Protocol printer routines print-sll.c - Linux "cooked" capture printer routines print-slow.c - IEEE "slow protocol" (802.3ad) printer routines print-smb.c - SMB/CIFS printer routines print-snmp.c - Simple Network Management Protocol printer routines print-stp.c - IEEE 802.1d spanning tree protocol printer routines print-sunatm.c - SunATM DLPI capture printer routines print-sunrpc.c - Sun Remote Procedure Call printer routines print-symantec.c - Symantec Enterprise Firewall printer routines print-tcp.c - TCP printer routines print-telnet.c - Telnet option printer routines print-tftp.c - Trivial File Transfer Protocol printer routines print-timed.c - BSD time daemon protocol printer routines print-token.c - Token Ring printer routines print-udp.c - UDP printer routines print-vjc.c - PPP Van Jacobson compression (RFC1144) printer routines print-vrrp.c - Virtual Router Redundancy Protocol print-wb.c - White Board printer routines print-zephyr.c - Zephyr printer routines route6d.h - packet definition for IPv6 Routing Information Protocol rpc_auth.h - definitions for ONC RPC authentication rpc_msg.h - definitions for ONC RPC messages rx.h - AFS RX definitions sctpConstants.h - Stream Control Transmission Protocol constant definitions sctpHeader.h - Stream Control Transmission Protocol packet definitions send-ack.awk - unidirectional tcp send/ack awk script setsignal.c - OS-independent signal routines setsignal.h - OS-independent signal prototypes slcompress.h - SLIP/PPP Van Jacobson compression (RFC1144) definitions slip.h - SLIP definitions sll.h - Linux "cooked" capture definitions smb.h - SMB/CIFS definitions smbutil.c - SMB/CIFS utility routines stime.awk - TCP send awk script strcasecmp.c - missing routine tcp.h - TCP definitions tcpdump.1 - manual entry tcpdump.c - main program telnet.h - Telnet definitions tftp.h - TFTP definitions timed.h - BSD time daemon protocol definitions token.h - Token Ring definitions udp.h - UDP definitions util.c - utility routines vfprintf.c - emulation routine win32 - headers and routines for building on Win32 systems tcpdump-3.9.8/./addrtoname.h0000644000026300017500000000377307351470737014004 0ustar mcrmcr/* * Copyright (c) 1990, 1992, 1993, 1994, 1995, 1996, 1997 * The Regents of the University of California. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that: (1) source code distributions * retain the above copyright notice and this paragraph in its entirety, (2) * distributions including binary code include the above copyright notice and * this paragraph in its entirety in the documentation or other materials * provided with the distribution, and (3) all advertising materials mentioning * features or use of this software display the following acknowledgement: * ``This product includes software developed by the University of California, * Lawrence Berkeley Laboratory and its contributors.'' Neither the name of * the University nor the names of its contributors may be used to endorse * or promote products derived from this software without specific prior * written permission. * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * * @(#) $Header: /tcpdump/master/tcpdump/addrtoname.h,v 1.18 2001/09/17 21:57:51 fenner Exp $ (LBL) */ /* Name to address translation routines. */ extern const char *linkaddr_string(const u_char *, const unsigned int); extern const char *etheraddr_string(const u_char *); extern const char *etherproto_string(u_short); extern const char *tcpport_string(u_short); extern const char *udpport_string(u_short); extern const char *getname(const u_char *); #ifdef INET6 extern const char *getname6(const u_char *); #endif extern const char *intoa(u_int32_t); extern void init_addrtoname(u_int32_t, u_int32_t); extern struct hnamemem *newhnamemem(void); #ifdef INET6 extern struct h6namemem *newh6namemem(void); #endif #define ipaddr_string(p) getname((const u_char *)(p)) #ifdef INET6 #define ip6addr_string(p) getname6((const u_char *)(p)) #endif tcpdump-3.9.8/./mkdep0000755000026300017500000000445606777230376012546 0ustar mcrmcr#!/bin/sh - # # Copyright (c) 1994, 1996 # The Regents of the University of California. All rights reserved. # # Redistribution and use in source and binary forms are permitted # provided that this notice is preserved and that due credit is given # to the University of California at Berkeley. The name of the University # may not be used to endorse or promote products derived from this # software without specific prior written permission. This software # is provided ``as is'' without express or implied warranty. # # @(#)mkdep.sh 5.11 (Berkeley) 5/5/88 # PATH=/bin:/usr/bin:/usr/ucb:/usr/local:/usr/local/bin export PATH MAKE=Makefile # default makefile name is "Makefile" CC=cc # default C compiler is "cc" while : do case "$1" in # -c allows you to specify the C compiler -c) CC=$2 shift; shift ;; # -f allows you to select a makefile name -f) MAKE=$2 shift; shift ;; # the -p flag produces "program: program.c" style dependencies # so .o's don't get produced -p) SED='s;\.o;;' shift ;; *) break ;; esac done if [ $# = 0 ] ; then echo 'usage: mkdep [-p] [-c cc] [-f makefile] [flags] file ...' exit 1 fi if [ ! -w $MAKE ]; then echo "mkdep: no writeable file \"$MAKE\"" exit 1 fi TMP=/tmp/mkdep$$ trap 'rm -f $TMP ; exit 1' 1 2 3 13 15 cp $MAKE ${MAKE}.bak sed -e '/DO NOT DELETE THIS LINE/,$d' < $MAKE > $TMP cat << _EOF_ >> $TMP # DO NOT DELETE THIS LINE -- mkdep uses it. # DO NOT PUT ANYTHING AFTER THIS LINE, IT WILL GO AWAY. _EOF_ # If your compiler doesn't have -M, add it. If you can't, the next two # lines will try and replace the "cc -M". The real problem is that this # hack can't deal with anything that requires a search path, and doesn't # even try for anything using bracket (<>) syntax. # # egrep '^#include[ ]*".*"' /dev/null $* | # sed -e 's/:[^"]*"\([^"]*\)".*/: \1/' -e 's/\.c/.o/' | # XXX this doesn't work with things like "-DDECLWAITSTATUS=union\ wait" $CC -M $* | sed " s; \./; ;g $SED" | awk '{ if ($1 != prev) { if (rec != "") print rec; rec = $0; prev = $1; } else { if (length(rec $2) > 78) { print rec; rec = $0; } else rec = rec " " $2 } } END { print rec }' >> $TMP cat << _EOF_ >> $TMP # IF YOU PUT ANYTHING HERE IT WILL GO AWAY _EOF_ # copy to preserve permissions cp $TMP $MAKE rm -f ${MAKE}.bak $TMP exit 0 tcpdump-3.9.8/./acconfig.h0000644000026300017500000000664210262571725013427 0ustar mcrmcr/* "generated automatically" means DO NOT MAKE CHANGES TO config.h.in -- * make them to acconfig.h and rerun autoheader */ @TOP@ /* Define if you have SSLeay 0.9.0b with the buggy cast128. */ #undef HAVE_BUGGY_CAST128 /* Define if you enable IPv6 support */ #undef INET6 /* Define if you enable support for the libsmi. */ #undef LIBSMI /* Define if you have the header file. */ #undef HAVE_SMI_H /* define if you have struct __res_state_ext */ #undef HAVE_RES_STATE_EXT /* define if your struct __res_state has the nsort member */ #undef HAVE_NEW_RES_STATE /* * define if struct ether_header.ether_dhost is a struct with ether_addr_octet */ #undef ETHER_HEADER_HAS_EA /* define if struct ether_arp contains arp_xsha */ #undef ETHER_ARP_HAS_X /* define if you have the addrinfo function. */ #undef HAVE_ADDRINFO /* define if you need to include missing/addrinfoh.h. */ #undef NEED_ADDRINFO_H /* define ifyou have the h_errno variable. */ #undef HAVE_H_ERRNO /* define if IN6ADDRSZ is defined (XXX not used!) */ #undef HAVE_IN6ADDRSZ /* define if INADDRSZ is defined (XXX not used!) */ #undef HAVE_INADDRSZ /* define if this is a development version, to use additional prototypes. */ #undef HAVE_OS_PROTO_H /* define if defines __P() */ #undef HAVE_PORTABLE_PROTOTYPE /* define if RES_USE_INET6 is defined */ #undef HAVE_RES_USE_INET6 /* define if struct sockaddr has the sa_len member */ #undef HAVE_SOCKADDR_SA_LEN /* define if you have struct sockaddr_storage */ #undef HAVE_SOCKADDR_STORAGE /* define if you have both getipnodebyname() and getipnodebyaddr() */ #undef USE_GETIPNODEBY /* define if you have ether_ntohost() and it works */ #undef USE_ETHER_NTOHOST /* define if libpcap has pcap_version */ #undef HAVE_PCAP_VERSION /* define if libpcap has pcap_debug */ #undef HAVE_PCAP_DEBUG /* define if libpcap has yydebug */ #undef HAVE_YYDEBUG /* define if libpcap has pcap_list_datalinks() */ #undef HAVE_PCAP_LIST_DATALINKS /* define if libpcap has pcap_set_datalink() */ #undef HAVE_PCAP_SET_DATALINK /* define if libpcap has pcap_datalink_name_to_val() */ #undef HAVE_PCAP_DATALINK_NAME_TO_VAL /* define if libpcap has pcap_datalink_val_to_description() */ #undef HAVE_PCAP_DATALINK_VAL_TO_DESCRIPTION /* define if libpcap has pcap_dump_ftell() */ #undef HAVE_PCAP_DUMP_FTELL /* define if you have getrpcbynumber() */ #undef HAVE_GETRPCBYNUMBER /* define if unaligned memory accesses fail */ #undef LBL_ALIGN /* The successful return value from signal (?)XXX */ #undef RETSIGVAL /* Define this on IRIX */ #undef _BSD_SIGNALS /* For HP/UX ANSI compiler? */ #undef _HPUX_SOURCE /* AIX hack. */ #undef _SUN /* Workaround for missing 64-bit formats */ #undef PRId64 #undef PRIo64 #undef PRIx64 #undef PRIu64 /* Whether or not to include the possibly-buggy SMB printer */ #undef TCPDUMP_DO_SMB /* Long story short: aclocal.m4 depends on autoconf 2.13 * implementation details wrt "const"; newer versions * have different implementation details so for now we * put "const" here. This may cause duplicate definitions * in config.h but that should be OK since they're the same. */ #undef const /* Define if you have the dnet_htoa function. */ #undef HAVE_DNET_HTOA /* Define if you have a dnet_htoa declaration in . */ #undef HAVE_NETDNET_DNETDB_H_DNET_HTOA /* define if should drop privileges by default */ #undef WITH_USER /* define if should chroot when dropping privileges */ #undef WITH_CHROOT tcpdump-3.9.8/./print-ipfc.c0000644000026300017500000000753010504040015013677 0ustar mcrmcr/* * Copyright (c) 1991, 1992, 1993, 1994, 1995, 1996, 1997 * The Regents of the University of California. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that: (1) source code distributions * retain the above copyright notice and this paragraph in its entirety, (2) * distributions including binary code include the above copyright notice and * this paragraph in its entirety in the documentation or other materials * provided with the distribution, and (3) all advertising materials mentioning * features or use of this software display the following acknowledgement: * ``This product includes software developed by the University of California, * Lawrence Berkeley Laboratory and its contributors.'' Neither the name of * the University nor the names of its contributors may be used to endorse * or promote products derived from this software without specific prior * written permission. * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. */ #ifndef lint static const char rcsid[] _U_ = "@(#) $Header: /tcpdump/master/tcpdump/print-ipfc.c,v 1.7.2.2 2005/11/13 12:12:59 guy Exp $ (LBL)"; #endif #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include #include #include "interface.h" #include "addrtoname.h" #include "ethertype.h" #include "ether.h" #include "ipfc.h" /* * RFC 2625 IP-over-Fibre Channel. */ /* Extract src, dst addresses */ static inline void extract_ipfc_addrs(const struct ipfc_header *ipfcp, char *ipfcsrc, char *ipfcdst) { /* * We assume that, as per RFC 2625, the lower 48 bits of the * source and destination addresses are MAC addresses. */ memcpy(ipfcdst, (const char *)&ipfcp->ipfc_dhost[2], 6); memcpy(ipfcsrc, (const char *)&ipfcp->ipfc_shost[2], 6); } /* * Print the Network_Header */ static inline void ipfc_hdr_print(register const struct ipfc_header *ipfcp _U_, register u_int length, register const u_char *ipfcsrc, register const u_char *ipfcdst) { const char *srcname, *dstname; srcname = etheraddr_string(ipfcsrc); dstname = etheraddr_string(ipfcdst); /* * XXX - show the upper 16 bits? Do so only if "vflag" is set? */ (void) printf("%s %s %d: ", srcname, dstname, length); } static void ipfc_print(const u_char *p, u_int length, u_int caplen) { const struct ipfc_header *ipfcp = (const struct ipfc_header *)p; struct ether_header ehdr; u_short extracted_ethertype; if (caplen < IPFC_HDRLEN) { printf("[|ipfc]"); return; } /* * Get the network addresses into a canonical form */ extract_ipfc_addrs(ipfcp, (char *)ESRC(&ehdr), (char *)EDST(&ehdr)); if (eflag) ipfc_hdr_print(ipfcp, length, ESRC(&ehdr), EDST(&ehdr)); /* Skip over Network_Header */ length -= IPFC_HDRLEN; p += IPFC_HDRLEN; caplen -= IPFC_HDRLEN; /* Try to print the LLC-layer header & higher layers */ if (llc_print(p, length, caplen, ESRC(&ehdr), EDST(&ehdr), &extracted_ethertype) == 0) { /* * Some kinds of LLC packet we cannot * handle intelligently */ if (!eflag) ipfc_hdr_print(ipfcp, length + IPFC_HDRLEN, ESRC(&ehdr), EDST(&ehdr)); if (extracted_ethertype) { printf("(LLC %s) ", etherproto_string(htons(extracted_ethertype))); } if (!suppress_default_print) default_print(p, caplen); } } /* * This is the top level routine of the printer. 'p' points * to the Network_Header of the packet, 'h->ts' is the timestamp, * 'h->len' is the length of the packet off the wire, and 'h->caplen' * is the number of bytes actually captured. */ u_int ipfc_if_print(const struct pcap_pkthdr *h, register const u_char *p) { ipfc_print(p, h->len, h->caplen); return (IPFC_HDRLEN); } tcpdump-3.9.8/./nlpid.c0000755000026300017500000000260010135231173012735 0ustar mcrmcr/* * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that: (1) source code * distributions retain the above copyright notice and this paragraph * in its entirety, and (2) distributions including binary code include * the above copyright notice and this paragraph in its entirety in * the documentation or other materials provided with the distribution. * THIS SOFTWARE IS PROVIDED ``AS IS'' AND * WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT * LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * FOR A PARTICULAR PURPOSE. * * Original code by Hannes Gredler (hannes@juniper.net) */ #ifndef lint static const char rcsid[] _U_ = "@(#) $Header: /tcpdump/master/tcpdump/nlpid.c,v 1.4 2004/10/19 15:27:55 hannes Exp $ (LBL)"; #endif #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include "interface.h" #include "nlpid.h" struct tok nlpid_values[] = { { NLPID_NULLNS, "NULL" }, { NLPID_Q933, "Q.933" }, { NLPID_LMI, "LMI" }, { NLPID_SNAP, "SNAP" }, { NLPID_CLNP, "CLNP" }, { NLPID_ESIS, "ES-IS" }, { NLPID_ISIS, "IS-IS" }, { NLPID_CONS, "CONS" }, { NLPID_IDRP, "IDRP" }, { NLPID_MFR, "FRF.15" }, { NLPID_IP, "IPv4" }, { NLPID_PPP, "PPP" }, { NLPID_X25_ESIS, "X25 ES-IS" }, { NLPID_IP6, "IPv6" }, { 0, NULL } }; tcpdump-3.9.8/./print-null.c0000644000026300017500000001017410634111731013736 0ustar mcrmcr/* * Copyright (c) 1991, 1993, 1994, 1995, 1996, 1997 * The Regents of the University of California. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that: (1) source code distributions * retain the above copyright notice and this paragraph in its entirety, (2) * distributions including binary code include the above copyright notice and * this paragraph in its entirety in the documentation or other materials * provided with the distribution, and (3) all advertising materials mentioning * features or use of this software display the following acknowledgement: * ``This product includes software developed by the University of California, * Lawrence Berkeley Laboratory and its contributors.'' Neither the name of * the University nor the names of its contributors may be used to endorse * or promote products derived from this software without specific prior * written permission. * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. */ #ifndef lint static const char rcsid[] _U_ = "@(#) $Header: /tcpdump/master/tcpdump/print-null.c,v 1.53.2.4 2007/02/26 13:31:33 hannes Exp $ (LBL)"; #endif #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include #include #include "interface.h" #include "addrtoname.h" #include "af.h" #include "ip.h" #ifdef INET6 #include "ip6.h" #endif /* * The DLT_NULL packet header is 4 bytes long. It contains a host-byte-order * 32-bit integer that specifies the family, e.g. AF_INET. * * Note here that "host" refers to the host on which the packets were * captured; that isn't necessarily *this* host. * * The OpenBSD DLT_LOOP packet header is the same, except that the integer * is in network byte order. */ #define NULL_HDRLEN 4 /* * Byte-swap a 32-bit number. * ("htonl()" or "ntohl()" won't work - we want to byte-swap even on * big-endian platforms.) */ #define SWAPLONG(y) \ ((((y)&0xff)<<24) | (((y)&0xff00)<<8) | (((y)&0xff0000)>>8) | (((y)>>24)&0xff)) static inline void null_hdr_print(u_int family, u_int length) { if (!qflag) { (void)printf("AF %s (%u)", tok2str(bsd_af_values,"Unknown",family),family); } else { (void)printf("%s", tok2str(bsd_af_values,"Unknown AF %u",family)); } (void)printf(", length %u: ", length); } /* * This is the top level routine of the printer. 'p' points * to the ether header of the packet, 'h->ts' is the timestamp, * 'h->len' is the length of the packet off the wire, and 'h->caplen' * is the number of bytes actually captured. */ u_int null_if_print(const struct pcap_pkthdr *h, const u_char *p) { u_int length = h->len; u_int caplen = h->caplen; u_int family; if (caplen < NULL_HDRLEN) { printf("[|null]"); return (NULL_HDRLEN); } memcpy((char *)&family, (char *)p, sizeof(family)); /* * This isn't necessarily in our host byte order; if this is * a DLT_LOOP capture, it's in network byte order, and if * this is a DLT_NULL capture from a machine with the opposite * byte-order, it's in the opposite byte order from ours. * * If the upper 16 bits aren't all zero, assume it's byte-swapped. */ if ((family & 0xFFFF0000) != 0) family = SWAPLONG(family); if (eflag) null_hdr_print(family, length); length -= NULL_HDRLEN; caplen -= NULL_HDRLEN; p += NULL_HDRLEN; switch (family) { case BSD_AFNUM_INET: ip_print(gndo, p, length); break; #ifdef INET6 case BSD_AFNUM_INET6_BSD: case BSD_AFNUM_INET6_FREEBSD: case BSD_AFNUM_INET6_DARWIN: ip6_print(p, length); break; #endif case BSD_AFNUM_ISO: isoclns_print(p, length, caplen); break; case BSD_AFNUM_APPLETALK: atalk_print(p, length); break; case BSD_AFNUM_IPX: ipx_print(p, length); break; default: /* unknown AF_ value */ if (!eflag) null_hdr_print(family, length + NULL_HDRLEN); if (!suppress_default_print) default_print(p, caplen); } return (NULL_HDRLEN); } /* * Local Variables: * c-style: whitesmith * c-basic-offset: 8 * End: */ tcpdump-3.9.8/./print-enc.c0000644000026300017500000000466410225052567013547 0ustar mcrmcr/* $OpenBSD: print-enc.c,v 1.7 2002/02/19 19:39:40 millert Exp $ */ /* * Copyright (c) 1990, 1991, 1993, 1994, 1995, 1996 * The Regents of the University of California. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that: (1) source code distributions * retain the above copyright notice and this paragraph in its entirety, (2) * distributions including binary code include the above copyright notice and * this paragraph in its entirety in the documentation or other materials * provided with the distribution, and (3) all advertising materials mentioning * features or use of this software display the following acknowledgement: * ``This product includes software developed by the University of California, * Lawrence Berkeley Laboratory and its contributors.'' Neither the name of * the University nor the names of its contributors may be used to endorse * or promote products derived from this software without specific prior * written permission. * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. */ #ifndef lint static const char rcsid[] _U_ = "@(#) $Header: /tcpdump/master/tcpdump/print-enc.c,v 1.4 2005/04/06 21:32:39 mcr Exp $ (LBL)"; #endif #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include "interface.h" #include "addrtoname.h" #include "enc.h" #define ENC_PRINT_TYPE(wh, xf, nam) \ if ((wh) & (xf)) { \ printf("%s%s", nam, (wh) == (xf) ? "): " : ","); \ (wh) &= ~(xf); \ } u_int enc_if_print(const struct pcap_pkthdr *h, register const u_char *p) { register u_int length = h->len; register u_int caplen = h->caplen; int flags; const struct enchdr *hdr; if (caplen < ENC_HDRLEN) { printf("[|enc]"); goto out; } hdr = (struct enchdr *)p; flags = hdr->flags; if (flags == 0) printf("(unprotected): "); else printf("("); ENC_PRINT_TYPE(flags, M_AUTH, "authentic"); ENC_PRINT_TYPE(flags, M_CONF, "confidential"); /* ENC_PRINT_TYPE(flags, M_TUNNEL, "tunnel"); */ printf("SPI 0x%08x: ", (u_int32_t)ntohl(hdr->spi)); length -= ENC_HDRLEN; /* XXX - use the address family */ ip_print(gndo, p + ENC_HDRLEN, length); out: return (ENC_HDRLEN); } /* * Local Variables: * c-style: whitesmith * c-basic-offset: 8 * End: */ tcpdump-3.9.8/./print-egp.c0000644000026300017500000001731410171203655013545 0ustar mcrmcr/* * Copyright (c) 1991, 1992, 1993, 1994, 1995, 1996 * The Regents of the University of California. All rights reserved. * * Redistribution and use in source and binary forms are permitted * provided that the above copyright notice and this paragraph are * duplicated in all such forms and that any documentation, * advertising materials, and other materials related to such * distribution and use acknowledge that the software was developed * by the University of California, Lawrence Berkeley Laboratory, * Berkeley, CA. The name of the University may not be used to * endorse or promote products derived from this software without * specific prior written permission. * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * * Initial contribution from Jeff Honig (jch@MITCHELL.CIT.CORNELL.EDU). */ #ifndef lint static const char rcsid[] _U_ = "@(#) $Header: /tcpdump/master/tcpdump/print-egp.c,v 1.37 2005/01/12 11:19:09 hannes Exp $ (LBL)"; #endif #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include "interface.h" #include "addrtoname.h" #include "extract.h" #include "ip.h" struct egp_packet { u_int8_t egp_version; #define EGP_VERSION 2 u_int8_t egp_type; #define EGPT_ACQUIRE 3 #define EGPT_REACH 5 #define EGPT_POLL 2 #define EGPT_UPDATE 1 #define EGPT_ERROR 8 u_int8_t egp_code; #define EGPC_REQUEST 0 #define EGPC_CONFIRM 1 #define EGPC_REFUSE 2 #define EGPC_CEASE 3 #define EGPC_CEASEACK 4 #define EGPC_HELLO 0 #define EGPC_HEARDU 1 u_int8_t egp_status; #define EGPS_UNSPEC 0 #define EGPS_ACTIVE 1 #define EGPS_PASSIVE 2 #define EGPS_NORES 3 #define EGPS_ADMIN 4 #define EGPS_GODOWN 5 #define EGPS_PARAM 6 #define EGPS_PROTO 7 #define EGPS_INDET 0 #define EGPS_UP 1 #define EGPS_DOWN 2 #define EGPS_UNSOL 0x80 u_int16_t egp_checksum; u_int16_t egp_as; u_int16_t egp_sequence; union { u_int16_t egpu_hello; u_int8_t egpu_gws[2]; u_int16_t egpu_reason; #define EGPR_UNSPEC 0 #define EGPR_BADHEAD 1 #define EGPR_BADDATA 2 #define EGPR_NOREACH 3 #define EGPR_XSPOLL 4 #define EGPR_NORESP 5 #define EGPR_UVERSION 6 } egp_handg; #define egp_hello egp_handg.egpu_hello #define egp_intgw egp_handg.egpu_gws[0] #define egp_extgw egp_handg.egpu_gws[1] #define egp_reason egp_handg.egpu_reason union { u_int16_t egpu_poll; u_int32_t egpu_sourcenet; } egp_pands; #define egp_poll egp_pands.egpu_poll #define egp_sourcenet egp_pands.egpu_sourcenet }; const char *egp_acquire_codes[] = { "request", "confirm", "refuse", "cease", "cease_ack" }; const char *egp_acquire_status[] = { "unspecified", "active_mode", "passive_mode", "insufficient_resources", "administratively_prohibited", "going_down", "parameter_violation", "protocol_violation" }; const char *egp_reach_codes[] = { "hello", "i-h-u" }; const char *egp_status_updown[] = { "indeterminate", "up", "down" }; const char *egp_reasons[] = { "unspecified", "bad_EGP_header_format", "bad_EGP_data_field_format", "reachability_info_unavailable", "excessive_polling_rate", "no_response", "unsupported_version" }; static void egpnrprint(register const struct egp_packet *egp) { register const u_int8_t *cp; u_int32_t addr; register u_int32_t net; register u_int netlen; int gateways, distances, networks; int t_gateways; const char *comma; addr = egp->egp_sourcenet; if (IN_CLASSA(addr)) { net = addr & IN_CLASSA_NET; netlen = 1; } else if (IN_CLASSB(addr)) { net = addr & IN_CLASSB_NET; netlen = 2; } else if (IN_CLASSC(addr)) { net = addr & IN_CLASSC_NET; netlen = 3; } else { net = 0; netlen = 0; } cp = (u_int8_t *)(egp + 1); t_gateways = egp->egp_intgw + egp->egp_extgw; for (gateways = 0; gateways < t_gateways; ++gateways) { /* Pickup host part of gateway address */ addr = 0; TCHECK2(cp[0], 4 - netlen); switch (netlen) { case 1: addr = *cp++; /* fall through */ case 2: addr = (addr << 8) | *cp++; /* fall through */ case 3: addr = (addr << 8) | *cp++; } addr |= net; TCHECK2(cp[0], 1); distances = *cp++; printf(" %s %s ", gateways < (int)egp->egp_intgw ? "int" : "ext", ipaddr_string(&addr)); comma = ""; putchar('('); while (--distances >= 0) { TCHECK2(cp[0], 2); printf("%sd%d:", comma, (int)*cp++); comma = ", "; networks = *cp++; while (--networks >= 0) { /* Pickup network number */ TCHECK2(cp[0], 1); addr = (u_int32_t)*cp++ << 24; if (IN_CLASSB(addr)) { TCHECK2(cp[0], 1); addr |= (u_int32_t)*cp++ << 16; } else if (!IN_CLASSA(addr)) { TCHECK2(cp[0], 2); addr |= (u_int32_t)*cp++ << 16; addr |= (u_int32_t)*cp++ << 8; } printf(" %s", ipaddr_string(&addr)); } } putchar(')'); } return; trunc: fputs("[|]", stdout); } void egp_print(register const u_int8_t *bp, register u_int length) { register const struct egp_packet *egp; register int status; register int code; register int type; egp = (struct egp_packet *)bp; if (!TTEST2(*egp, length)) { printf("[|egp]"); return; } (void)printf("egp: "); if (egp->egp_version != EGP_VERSION) { printf("[version %d]", egp->egp_version); return; } printf("as:%d seq:%d", EXTRACT_16BITS(&egp->egp_as), EXTRACT_16BITS(&egp->egp_sequence)); type = egp->egp_type; code = egp->egp_code; status = egp->egp_status; switch (type) { case EGPT_ACQUIRE: printf(" acquire"); switch (code) { case EGPC_REQUEST: case EGPC_CONFIRM: printf(" %s", egp_acquire_codes[code]); switch (status) { case EGPS_UNSPEC: case EGPS_ACTIVE: case EGPS_PASSIVE: printf(" %s", egp_acquire_status[status]); break; default: printf(" [status %d]", status); break; } printf(" hello:%d poll:%d", EXTRACT_16BITS(&egp->egp_hello), EXTRACT_16BITS(&egp->egp_poll)); break; case EGPC_REFUSE: case EGPC_CEASE: case EGPC_CEASEACK: printf(" %s", egp_acquire_codes[code]); switch (status ) { case EGPS_UNSPEC: case EGPS_NORES: case EGPS_ADMIN: case EGPS_GODOWN: case EGPS_PARAM: case EGPS_PROTO: printf(" %s", egp_acquire_status[status]); break; default: printf("[status %d]", status); break; } break; default: printf("[code %d]", code); break; } break; case EGPT_REACH: switch (code) { case EGPC_HELLO: case EGPC_HEARDU: printf(" %s", egp_reach_codes[code]); if (status <= EGPS_DOWN) printf(" state:%s", egp_status_updown[status]); else printf(" [status %d]", status); break; default: printf("[reach code %d]", code); break; } break; case EGPT_POLL: printf(" poll"); if (egp->egp_status <= EGPS_DOWN) printf(" state:%s", egp_status_updown[status]); else printf(" [status %d]", status); printf(" net:%s", ipaddr_string(&egp->egp_sourcenet)); break; case EGPT_UPDATE: printf(" update"); if (status & EGPS_UNSOL) { status &= ~EGPS_UNSOL; printf(" unsolicited"); } if (status <= EGPS_DOWN) printf(" state:%s", egp_status_updown[status]); else printf(" [status %d]", status); printf(" %s int %d ext %d", ipaddr_string(&egp->egp_sourcenet), egp->egp_intgw, egp->egp_extgw); if (vflag) egpnrprint(egp); break; case EGPT_ERROR: printf(" error"); if (status <= EGPS_DOWN) printf(" state:%s", egp_status_updown[status]); else printf(" [status %d]", status); if (EXTRACT_16BITS(&egp->egp_reason) <= EGPR_UVERSION) printf(" %s", egp_reasons[EXTRACT_16BITS(&egp->egp_reason)]); else printf(" [reason %d]", EXTRACT_16BITS(&egp->egp_reason)); break; default: printf("[type %d]", type); break; } } tcpdump-3.9.8/./atm.h0000644000026300017500000000231610262571725012431 0ustar mcrmcr/* * Copyright (c) 2002 Guy Harris. * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that: (1) source code * distributions retain the above copyright notice and this paragraph * in its entirety, and (2) distributions including binary code include * the above copyright notice and this paragraph in its entirety in * the documentation or other materials provided with the distribution. * The name of Guy Harris may not be used to endorse or promote products * derived from this software without specific prior written permission. * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * * @(#) $Header: /tcpdump/master/tcpdump/atm.h,v 1.1.4.1 2005/06/20 07:45:05 hannes Exp $ */ /* * Traffic types for ATM. */ #define ATM_UNKNOWN 0 /* Unknown */ #define ATM_LANE 1 /* LANE */ #define ATM_LLC 2 /* LLC encapsulation */ /* * some OAM cell captures (most notably Juniper's) * do not deliver a heading HEC byte */ #define ATM_OAM_NOHEC 0 #define ATM_OAM_HEC 1 tcpdump-3.9.8/./print-pppoe.c0000644000026300017500000001317710233515450014116 0ustar mcrmcr/* * Copyright (c) 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997 * The Regents of the University of California. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that: (1) source code distributions * retain the above copyright notice and this paragraph in its entirety, (2) * distributions including binary code include the above copyright notice and * this paragraph in its entirety in the documentation or other materials * provided with the distribution, and (3) all advertising materials mentioning * features or use of this software display the following acknowledgement: * ``This product includes software developed by the University of California, * Lawrence Berkeley Laboratory and its contributors.'' Neither the name of * the University nor the names of its contributors may be used to endorse * or promote products derived from this software without specific prior * written permission. * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * * Original code by Greg Stark */ #ifndef lint static const char rcsid[] _U_ = "@(#) $Header: /tcpdump/master/tcpdump/print-pppoe.c,v 1.30.2.1 2005/04/26 19:48:56 guy Exp $ (LBL)"; #endif #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include #include "interface.h" #include "addrtoname.h" #include "ppp.h" #include "ethertype.h" #include "ether.h" #include "extract.h" /* must come after interface.h */ /* Codes */ enum { PPPOE_PADI = 0x09, PPPOE_PADO = 0x07, PPPOE_PADR = 0x19, PPPOE_PADS = 0x65, PPPOE_PADT = 0xa7 }; static struct tok pppoecode2str[] = { { PPPOE_PADI, "PADI" }, { PPPOE_PADO, "PADO" }, { PPPOE_PADR, "PADR" }, { PPPOE_PADS, "PADS" }, { PPPOE_PADT, "PADT" }, { 0, "" }, /* PPP Data */ { 0, NULL } }; /* Tags */ enum { PPPOE_EOL = 0, PPPOE_SERVICE_NAME = 0x0101, PPPOE_AC_NAME = 0x0102, PPPOE_HOST_UNIQ = 0x0103, PPPOE_AC_COOKIE = 0x0104, PPPOE_VENDOR = 0x0105, PPPOE_RELAY_SID = 0x0110, PPPOE_SERVICE_NAME_ERROR = 0x0201, PPPOE_AC_SYSTEM_ERROR = 0x0202, PPPOE_GENERIC_ERROR = 0x0203 }; static struct tok pppoetag2str[] = { { PPPOE_EOL, "EOL" }, { PPPOE_SERVICE_NAME, "Service-Name" }, { PPPOE_AC_NAME, "AC-Name" }, { PPPOE_HOST_UNIQ, "Host-Uniq" }, { PPPOE_AC_COOKIE, "AC-Cookie" }, { PPPOE_VENDOR, "Vendor-Specific" }, { PPPOE_RELAY_SID, "Relay-Session-ID" }, { PPPOE_SERVICE_NAME_ERROR, "Service-Name-Error" }, { PPPOE_AC_SYSTEM_ERROR, "AC-System-Error" }, { PPPOE_GENERIC_ERROR, "Generic-Error" }, { 0, NULL } }; #define PPPOE_HDRLEN 6 #define MAXTAGPRINT 80 u_int pppoe_if_print(const struct pcap_pkthdr *h, register const u_char *p) { return (pppoe_print(p, h->len)); } u_int pppoe_print(register const u_char *bp, u_int length) { u_int16_t pppoe_ver, pppoe_type, pppoe_code, pppoe_sessionid; u_int pppoe_length; const u_char *pppoe_packet, *pppoe_payload; if (length < PPPOE_HDRLEN) { (void)printf("truncated-pppoe %u", length); return (length); } length -= PPPOE_HDRLEN; pppoe_packet = bp; TCHECK2(*pppoe_packet, PPPOE_HDRLEN); pppoe_ver = (pppoe_packet[0] & 0xF0) >> 4; pppoe_type = (pppoe_packet[0] & 0x0F); pppoe_code = pppoe_packet[1]; pppoe_sessionid = EXTRACT_16BITS(pppoe_packet + 2); pppoe_length = EXTRACT_16BITS(pppoe_packet + 4); pppoe_payload = pppoe_packet + PPPOE_HDRLEN; if (pppoe_ver != 1) { printf(" [ver %d]",pppoe_ver); } if (pppoe_type != 1) { printf(" [type %d]",pppoe_type); } printf("PPPoE %s", tok2str(pppoecode2str, "PAD-%x", pppoe_code)); if (pppoe_code == PPPOE_PADI && pppoe_length > 1484 - PPPOE_HDRLEN) { printf(" [len %u!]",pppoe_length); } if (pppoe_length > length) { printf(" [len %u > %u!]", pppoe_length, length); pppoe_length = length; } if (pppoe_sessionid) { printf(" [ses 0x%x]", pppoe_sessionid); } if (pppoe_code) { /* PPP session packets don't contain tags */ u_short tag_type = 0xffff, tag_len; const u_char *p = pppoe_payload; /* * loop invariant: * p points to current tag, * tag_type is previous tag or 0xffff for first iteration */ while (tag_type && p < pppoe_payload + pppoe_length) { TCHECK2(*p, 4); tag_type = EXTRACT_16BITS(p); tag_len = EXTRACT_16BITS(p + 2); p += 4; /* p points to tag_value */ if (tag_len) { unsigned isascii = 0, isgarbage = 0; const u_char *v = p; char tag_str[MAXTAGPRINT]; unsigned tag_str_len = 0; /* TODO print UTF-8 decoded text */ TCHECK2(*p, tag_len); for (v = p; v < p + tag_len && tag_str_len < MAXTAGPRINT-1; v++) if (*v >= 32 && *v < 127) { tag_str[tag_str_len++] = *v; isascii++; } else { tag_str[tag_str_len++] = '.'; isgarbage++; } tag_str[tag_str_len] = 0; if (isascii > isgarbage) { printf(" [%s \"%*.*s\"]", tok2str(pppoetag2str, "TAG-0x%x", tag_type), (int)tag_str_len, (int)tag_str_len, tag_str); } else { /* Print hex, not fast to abuse printf but this doesn't get used much */ printf(" [%s 0x", tok2str(pppoetag2str, "TAG-0x%x", tag_type)); for (v=p; v #include #ifdef HAVE_SIGACTION #include #endif #ifdef HAVE_OS_PROTO_H #include "os-proto.h" #endif #include "setsignal.h" /* * An OS-independent signal() with, whenever possible, partial BSD * semantics, i.e. the signal handler is restored following service * of the signal, but system calls are *not* restarted, so that if * "pcap_breakloop()" is called in a signal handler in a live capture, * the read/recvfrom/whatever in the live capture doesn't get restarted, * it returns -1 and sets "errno" to EINTR, so we can break out of the * live capture loop. * * We use "sigaction()" if available. We don't specify that the signal * should restart system calls, so that should always do what we want. * * Otherwise, if "sigset()" is available, it probably has BSD semantics * while "signal()" has traditional semantics, so we use "sigset()"; it * might cause system calls to be restarted for the signal, however. * I don't know whether, in any systems where it did cause system calls to * be restarted, there was a way to ask it not to do so; there may no * longer be any interesting systems without "sigaction()", however, * and, if there are, they might have "sigvec()" with SV_INTERRUPT * (which I think first appeared in 4.3BSD). * * Otherwise, we use "signal()" - which means we might get traditional * semantics, wherein system calls don't get restarted *but* the * signal handler is reset to SIG_DFL and the signal is not blocked, * so that a subsequent signal would kill the process immediately. * * Did I mention that signals suck? At least in POSIX-compliant systems * they suck far less, as those systems have "sigaction()". */ RETSIGTYPE (*setsignal (int sig, RETSIGTYPE (*func)(int)))(int) { #ifdef HAVE_SIGACTION struct sigaction old, new; memset(&new, 0, sizeof(new)); new.sa_handler = func; if (sigaction(sig, &new, &old) < 0) return (SIG_ERR); return (old.sa_handler); #else #ifdef HAVE_SIGSET return (sigset(sig, func)); #else return (signal(sig, func)); #endif #endif } tcpdump-3.9.8/./aodv.h0000644000026300017500000001571607730472062012611 0ustar mcrmcr/* @(#) $Header: /tcpdump/master/tcpdump/aodv.h,v 1.3 2003/09/13 01:34:42 guy Exp $ (LBL) */ /* * Copyright (c) 2003 Bruce M. Simpson * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. All advertising materials mentioning features or use of this software * must display the following acknowledgement: * This product includes software developed by Bruce M. Simpson. * 4. Neither the name of Bruce M. Simpson nor the names of co- * contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY Bruce M. Simpson AND CONTRIBUTORS * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL Bruce M. Simpson OR CONTRIBUTORS * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. */ #ifndef _AODV_H_ #define _AODV_H_ struct aodv_rreq { u_int8_t rreq_type; /* AODV message type (1) */ u_int8_t rreq_flags; /* various flags */ u_int8_t rreq_zero0; /* reserved, set to zero */ u_int8_t rreq_hops; /* number of hops from originator */ u_int32_t rreq_id; /* request ID */ u_int32_t rreq_da; /* destination IPv4 address */ u_int32_t rreq_ds; /* destination sequence number */ u_int32_t rreq_oa; /* originator IPv4 address */ u_int32_t rreq_os; /* originator sequence number */ }; #ifdef INET6 struct aodv_rreq6 { u_int8_t rreq_type; /* AODV message type (1) */ u_int8_t rreq_flags; /* various flags */ u_int8_t rreq_zero0; /* reserved, set to zero */ u_int8_t rreq_hops; /* number of hops from originator */ u_int32_t rreq_id; /* request ID */ struct in6_addr rreq_da; /* destination IPv6 address */ u_int32_t rreq_ds; /* destination sequence number */ struct in6_addr rreq_oa; /* originator IPv6 address */ u_int32_t rreq_os; /* originator sequence number */ }; struct aodv_rreq6_draft_01 { u_int8_t rreq_type; /* AODV message type (16) */ u_int8_t rreq_flags; /* various flags */ u_int8_t rreq_zero0; /* reserved, set to zero */ u_int8_t rreq_hops; /* number of hops from originator */ u_int32_t rreq_id; /* request ID */ u_int32_t rreq_ds; /* destination sequence number */ u_int32_t rreq_os; /* originator sequence number */ struct in6_addr rreq_da; /* destination IPv6 address */ struct in6_addr rreq_oa; /* originator IPv6 address */ }; #endif #define RREQ_JOIN 0x80 /* join (reserved for multicast */ #define RREQ_REPAIR 0x40 /* repair (reserved for multicast */ #define RREQ_GRAT 0x20 /* gratuitous RREP */ #define RREQ_DEST 0x10 /* destination only */ #define RREQ_UNKNOWN 0x08 /* unknown destination sequence num */ #define RREQ_FLAGS_MASK 0xF8 /* mask for rreq_flags */ struct aodv_rrep { u_int8_t rrep_type; /* AODV message type (2) */ u_int8_t rrep_flags; /* various flags */ u_int8_t rrep_ps; /* prefix size */ u_int8_t rrep_hops; /* number of hops from o to d */ u_int32_t rrep_da; /* destination IPv4 address */ u_int32_t rrep_ds; /* destination sequence number */ u_int32_t rrep_oa; /* originator IPv4 address */ u_int32_t rrep_life; /* lifetime of this route */ }; #ifdef INET6 struct aodv_rrep6 { u_int8_t rrep_type; /* AODV message type (2) */ u_int8_t rrep_flags; /* various flags */ u_int8_t rrep_ps; /* prefix size */ u_int8_t rrep_hops; /* number of hops from o to d */ struct in6_addr rrep_da; /* destination IPv6 address */ u_int32_t rrep_ds; /* destination sequence number */ struct in6_addr rrep_oa; /* originator IPv6 address */ u_int32_t rrep_life; /* lifetime of this route */ }; struct aodv_rrep6_draft_01 { u_int8_t rrep_type; /* AODV message type (17) */ u_int8_t rrep_flags; /* various flags */ u_int8_t rrep_ps; /* prefix size */ u_int8_t rrep_hops; /* number of hops from o to d */ u_int32_t rrep_ds; /* destination sequence number */ struct in6_addr rrep_da; /* destination IPv6 address */ struct in6_addr rrep_oa; /* originator IPv6 address */ u_int32_t rrep_life; /* lifetime of this route */ }; #endif #define RREP_REPAIR 0x80 /* repair (reserved for multicast */ #define RREP_ACK 0x40 /* acknowledgement required */ #define RREP_FLAGS_MASK 0xC0 /* mask for rrep_flags */ #define RREP_PREFIX_MASK 0x1F /* mask for prefix size */ struct rerr_unreach { u_int32_t u_da; /* IPv4 address */ u_int32_t u_ds; /* sequence number */ }; #ifdef INET6 struct rerr_unreach6 { struct in6_addr u_da; /* IPv6 address */ u_int32_t u_ds; /* sequence number */ }; struct rerr_unreach6_draft_01 { struct in6_addr u_da; /* IPv6 address */ u_int32_t u_ds; /* sequence number */ }; #endif struct aodv_rerr { u_int8_t rerr_type; /* AODV message type (3 or 18) */ u_int8_t rerr_flags; /* various flags */ u_int8_t rerr_zero0; /* reserved, set to zero */ u_int8_t rerr_dc; /* destination count */ union { struct rerr_unreach dest[1]; #ifdef INET6 struct rerr_unreach6 dest6[1]; struct rerr_unreach6_draft_01 dest6_draft_01[1]; #endif } r; }; #define RERR_NODELETE 0x80 /* don't delete the link */ #define RERR_FLAGS_MASK 0x80 /* mask for rerr_flags */ struct aodv_rrep_ack { u_int8_t ra_type; u_int8_t ra_zero0; }; union aodv { struct aodv_rreq rreq; struct aodv_rrep rrep; struct aodv_rerr rerr; struct aodv_rrep_ack rrep_ack; #ifdef INET6 struct aodv_rreq6 rreq6; struct aodv_rreq6_draft_01 rreq6_draft_01; struct aodv_rrep6 rrep6; struct aodv_rrep6_draft_01 rrep6_draft_01; #endif }; #define AODV_RREQ 1 /* route request */ #define AODV_RREP 2 /* route response */ #define AODV_RERR 3 /* error report */ #define AODV_RREP_ACK 4 /* route response acknowledgement */ #define AODV_V6_DRAFT_01_RREQ 16 /* IPv6 route request */ #define AODV_V6_DRAFT_01_RREP 17 /* IPv6 route response */ #define AODV_V6_DRAFT_01_RERR 18 /* IPv6 error report */ #define AODV_V6_DRAFT_01_RREP_ACK 19 /* IPV6 route response acknowledgment */ struct aodv_ext { u_int8_t type; /* extension type */ u_int8_t length; /* extension length */ }; struct aodv_hello { struct aodv_ext eh; /* extension header */ u_int32_t interval; /* expect my next hello in * (n) ms */ }; #define AODV_EXT_HELLO 1 #endif /* _AODV_H_ */ tcpdump-3.9.8/./atime.awk0000644000026300017500000000102106777230375013303 0ustar mcrmcr$6 ~ /^ack/ && $5 !~ /[SFR]/ { # given a tcpdump ftp trace, output one line for each ack # in the form # # where is the time packet was acked (in seconds with # zero at time of first packet) and is the tcp sequence # number of the ack divided by 1024 (i.e., Kbytes acked). # # convert time to seconds n = split ($1,t,":") tim = t[1]*3600 + t[2]*60 + t[3] if (! tzero) { tzero = tim OFS = "\t" } # get packet sequence number printf "%7.2f\t%g\n", tim-tzero, $7/1024 } tcpdump-3.9.8/./sll.h0000644000026300017500000001274707575562703012464 0ustar mcrmcr/*- * Copyright (c) 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997 * The Regents of the University of California. All rights reserved. * * This code is derived from the Stanford/CMU enet packet filter, * (net/enet.c) distributed as part of 4.3BSD, and code contributed * to Berkeley by Steven McCanne and Van Jacobson both of Lawrence * Berkeley Laboratory. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. All advertising materials mentioning features or use of this software * must display the following acknowledgement: * This product includes software developed by the University of * California, Berkeley and its contributors. * 4. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * * @(#) $Header: /tcpdump/master/tcpdump/sll.h,v 1.7 2002/12/11 07:14:11 guy Exp $ (LBL) */ /* * For captures on Linux cooked sockets, we construct a fake header * that includes: * * a 2-byte "packet type" which is one of: * * LINUX_SLL_HOST packet was sent to us * LINUX_SLL_BROADCAST packet was broadcast * LINUX_SLL_MULTICAST packet was multicast * LINUX_SLL_OTHERHOST packet was sent to somebody else * LINUX_SLL_OUTGOING packet was sent *by* us; * * a 2-byte Ethernet protocol field; * * a 2-byte link-layer type; * * a 2-byte link-layer address length; * * an 8-byte source link-layer address, whose actual length is * specified by the previous value. * * All fields except for the link-layer address are in network byte order. * * DO NOT change the layout of this structure, or change any of the * LINUX_SLL_ values below. If you must change the link-layer header * for a "cooked" Linux capture, introduce a new DLT_ type (ask * "tcpdump-workers@tcpdump.org" for one, so that you don't give it a * value that collides with a value already being used), and use the * new header in captures of that type, so that programs that can * handle DLT_LINUX_SLL captures will continue to handle them correctly * without any change, and so that capture files with different headers * can be told apart and programs that read them can dissect the * packets in them. * * This structure, and the #defines below, must be the same in the * libpcap and tcpdump versions of "sll.h". */ /* * A DLT_LINUX_SLL fake link-layer header. */ #define SLL_HDR_LEN 16 /* total header length */ #define SLL_ADDRLEN 8 /* length of address field */ struct sll_header { u_int16_t sll_pkttype; /* packet type */ u_int16_t sll_hatype; /* link-layer address type */ u_int16_t sll_halen; /* link-layer address length */ u_int8_t sll_addr[SLL_ADDRLEN]; /* link-layer address */ u_int16_t sll_protocol; /* protocol */ }; /* * The LINUX_SLL_ values for "sll_pkttype"; these correspond to the * PACKET_ values on Linux, but are defined here so that they're * available even on systems other than Linux, and so that they * don't change even if the PACKET_ values change. */ #define LINUX_SLL_HOST 0 #define LINUX_SLL_BROADCAST 1 #define LINUX_SLL_MULTICAST 2 #define LINUX_SLL_OTHERHOST 3 #define LINUX_SLL_OUTGOING 4 /* * The LINUX_SLL_ values for "sll_protocol"; these correspond to the * ETH_P_ values on Linux, but are defined here so that they're * available even on systems other than Linux. We assume, for now, * that the ETH_P_ values won't change in Linux; if they do, then: * * if we don't translate them in "pcap-linux.c", capture files * won't necessarily be readable if captured on a system that * defines ETH_P_ values that don't match these values; * * if we do translate them in "pcap-linux.c", that makes life * unpleasant for the BPF code generator, as the values you test * for in the kernel aren't the values that you test for when * reading a capture file, so the fixup code run on BPF programs * handed to the kernel ends up having to do more work. * * Add other values here as necessary, for handling packet types that * might show up on non-Ethernet, non-802.x networks. (Not all the ones * in the Linux "if_ether.h" will, I suspect, actually show up in * captures.) */ #define LINUX_SLL_P_802_3 0x0001 /* Novell 802.3 frames without 802.2 LLC header */ #define LINUX_SLL_P_802_2 0x0004 /* 802.2 frames (not D/I/X Ethernet) */ tcpdump-3.9.8/./vfprintf.c0000644000026300017500000000342507755642455013517 0ustar mcrmcr/* * Copyright (c) 1995 * The Regents of the University of California. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that: (1) source code distributions * retain the above copyright notice and this paragraph in its entirety, (2) * distributions including binary code include the above copyright notice and * this paragraph in its entirety in the documentation or other materials * provided with the distribution, and (3) all advertising materials mentioning * features or use of this software display the following acknowledgement: * ``This product includes software developed by the University of California, * Lawrence Berkeley Laboratory and its contributors.'' Neither the name of * the University nor the names of its contributors may be used to endorse * or promote products derived from this software without specific prior * written permission. * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. */ #ifndef lint static const char rcsid[] _U_ = "@(#) $Header: /tcpdump/master/tcpdump/vfprintf.c,v 1.6 2003/11/16 09:36:45 guy Exp $ (LBL)"; #endif #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include #include #include #include "interface.h" /* * Stock 4.3 doesn't have vfprintf. * This routine is due to Chris Torek. */ vfprintf(f, fmt, args) FILE *f; char *fmt; va_list args; { int ret; if ((f->_flag & _IOWRT) == 0) { if (f->_flag & _IORW) f->_flag |= _IOWRT; else return EOF; } ret = _doprnt(fmt, args, f); return ferror(f) ? EOF : ret; } tcpdump-3.9.8/./print-fddi.c0000644000026300017500000002176010504040014013664 0ustar mcrmcr/* * Copyright (c) 1991, 1992, 1993, 1994, 1995, 1996, 1997 * The Regents of the University of California. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that: (1) source code distributions * retain the above copyright notice and this paragraph in its entirety, (2) * distributions including binary code include the above copyright notice and * this paragraph in its entirety in the documentation or other materials * provided with the distribution, and (3) all advertising materials mentioning * features or use of this software display the following acknowledgement: * ``This product includes software developed by the University of California, * Lawrence Berkeley Laboratory and its contributors.'' Neither the name of * the University nor the names of its contributors may be used to endorse * or promote products derived from this software without specific prior * written permission. * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. */ #ifndef lint static const char rcsid[] _U_ = "@(#) $Header: /tcpdump/master/tcpdump/print-fddi.c,v 1.64.2.2 2005/11/13 12:12:59 guy Exp $ (LBL)"; #endif #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include #include #include "interface.h" #include "addrtoname.h" #include "ethertype.h" #include "ether.h" #include "fddi.h" /* * Some FDDI interfaces use bit-swapped addresses. */ #if defined(ultrix) || defined(__alpha) || defined(__bsdi) || defined(__NetBSD__) || defined(__linux__) int fddi_bitswap = 0; #else int fddi_bitswap = 1; #endif /* * FDDI support for tcpdump, by Jeffrey Mogul [DECWRL], June 1992 * * Based in part on code by Van Jacobson, which bears this note: * * NOTE: This is a very preliminary hack for FDDI support. * There are all sorts of wired in constants & nothing (yet) * to print SMT packets as anything other than hex dumps. * Most of the necessary changes are waiting on my redoing * the "header" that a kernel fddi driver supplies to bpf: I * want it to look like one byte of 'direction' (0 or 1 * depending on whether the packet was inbound or outbound), * two bytes of system/driver dependent data (anything an * implementor thinks would be useful to filter on and/or * save per-packet, then the real 21-byte FDDI header. * Steve McCanne & I have also talked about adding the * 'direction' byte to all bpf headers (e.g., in the two * bytes of padding on an ethernet header). It's not clear * we could do this in a backwards compatible way & we hate * the idea of an incompatible bpf change. Discussions are * proceeding. * * Also, to really support FDDI (and better support 802.2 * over ethernet) we really need to re-think the rather simple * minded assumptions about fixed length & fixed format link * level headers made in gencode.c. One day... * * - vj */ static u_char fddi_bit_swap[] = { 0x00, 0x80, 0x40, 0xc0, 0x20, 0xa0, 0x60, 0xe0, 0x10, 0x90, 0x50, 0xd0, 0x30, 0xb0, 0x70, 0xf0, 0x08, 0x88, 0x48, 0xc8, 0x28, 0xa8, 0x68, 0xe8, 0x18, 0x98, 0x58, 0xd8, 0x38, 0xb8, 0x78, 0xf8, 0x04, 0x84, 0x44, 0xc4, 0x24, 0xa4, 0x64, 0xe4, 0x14, 0x94, 0x54, 0xd4, 0x34, 0xb4, 0x74, 0xf4, 0x0c, 0x8c, 0x4c, 0xcc, 0x2c, 0xac, 0x6c, 0xec, 0x1c, 0x9c, 0x5c, 0xdc, 0x3c, 0xbc, 0x7c, 0xfc, 0x02, 0x82, 0x42, 0xc2, 0x22, 0xa2, 0x62, 0xe2, 0x12, 0x92, 0x52, 0xd2, 0x32, 0xb2, 0x72, 0xf2, 0x0a, 0x8a, 0x4a, 0xca, 0x2a, 0xaa, 0x6a, 0xea, 0x1a, 0x9a, 0x5a, 0xda, 0x3a, 0xba, 0x7a, 0xfa, 0x06, 0x86, 0x46, 0xc6, 0x26, 0xa6, 0x66, 0xe6, 0x16, 0x96, 0x56, 0xd6, 0x36, 0xb6, 0x76, 0xf6, 0x0e, 0x8e, 0x4e, 0xce, 0x2e, 0xae, 0x6e, 0xee, 0x1e, 0x9e, 0x5e, 0xde, 0x3e, 0xbe, 0x7e, 0xfe, 0x01, 0x81, 0x41, 0xc1, 0x21, 0xa1, 0x61, 0xe1, 0x11, 0x91, 0x51, 0xd1, 0x31, 0xb1, 0x71, 0xf1, 0x09, 0x89, 0x49, 0xc9, 0x29, 0xa9, 0x69, 0xe9, 0x19, 0x99, 0x59, 0xd9, 0x39, 0xb9, 0x79, 0xf9, 0x05, 0x85, 0x45, 0xc5, 0x25, 0xa5, 0x65, 0xe5, 0x15, 0x95, 0x55, 0xd5, 0x35, 0xb5, 0x75, 0xf5, 0x0d, 0x8d, 0x4d, 0xcd, 0x2d, 0xad, 0x6d, 0xed, 0x1d, 0x9d, 0x5d, 0xdd, 0x3d, 0xbd, 0x7d, 0xfd, 0x03, 0x83, 0x43, 0xc3, 0x23, 0xa3, 0x63, 0xe3, 0x13, 0x93, 0x53, 0xd3, 0x33, 0xb3, 0x73, 0xf3, 0x0b, 0x8b, 0x4b, 0xcb, 0x2b, 0xab, 0x6b, 0xeb, 0x1b, 0x9b, 0x5b, 0xdb, 0x3b, 0xbb, 0x7b, 0xfb, 0x07, 0x87, 0x47, 0xc7, 0x27, 0xa7, 0x67, 0xe7, 0x17, 0x97, 0x57, 0xd7, 0x37, 0xb7, 0x77, 0xf7, 0x0f, 0x8f, 0x4f, 0xcf, 0x2f, 0xaf, 0x6f, 0xef, 0x1f, 0x9f, 0x5f, 0xdf, 0x3f, 0xbf, 0x7f, 0xff, }; /* * Print FDDI frame-control bits */ static inline void print_fddi_fc(u_char fc) { switch (fc) { case FDDIFC_VOID: /* Void frame */ printf("void "); break; case FDDIFC_NRT: /* Nonrestricted token */ printf("nrt "); break; case FDDIFC_RT: /* Restricted token */ printf("rt "); break; case FDDIFC_SMT_INFO: /* SMT Info */ printf("info "); break; case FDDIFC_SMT_NSA: /* SMT Next station adrs */ printf("nsa "); break; case FDDIFC_MAC_BEACON: /* MAC Beacon frame */ printf("beacon "); break; case FDDIFC_MAC_CLAIM: /* MAC Claim frame */ printf("claim "); break; default: switch (fc & FDDIFC_CLFF) { case FDDIFC_MAC: printf("mac%1x ", fc & FDDIFC_ZZZZ); break; case FDDIFC_SMT: printf("smt%1x ", fc & FDDIFC_ZZZZ); break; case FDDIFC_LLC_ASYNC: printf("async%1x ", fc & FDDIFC_ZZZZ); break; case FDDIFC_LLC_SYNC: printf("sync%1x ", fc & FDDIFC_ZZZZ); break; case FDDIFC_IMP_ASYNC: printf("imp_async%1x ", fc & FDDIFC_ZZZZ); break; case FDDIFC_IMP_SYNC: printf("imp_sync%1x ", fc & FDDIFC_ZZZZ); break; default: printf("%02x ", fc); break; } } } /* Extract src, dst addresses */ static inline void extract_fddi_addrs(const struct fddi_header *fddip, char *fsrc, char *fdst) { register int i; if (fddi_bitswap) { /* * bit-swap the fddi addresses (isn't the IEEE standards * process wonderful!) then convert them to names. */ for (i = 0; i < 6; ++i) fdst[i] = fddi_bit_swap[fddip->fddi_dhost[i]]; for (i = 0; i < 6; ++i) fsrc[i] = fddi_bit_swap[fddip->fddi_shost[i]]; } else { memcpy(fdst, (const char *)fddip->fddi_dhost, 6); memcpy(fsrc, (const char *)fddip->fddi_shost, 6); } } /* * Print the FDDI MAC header */ static inline void fddi_hdr_print(register const struct fddi_header *fddip, register u_int length, register const u_char *fsrc, register const u_char *fdst) { const char *srcname, *dstname; srcname = etheraddr_string(fsrc); dstname = etheraddr_string(fdst); if (vflag) (void) printf("%02x %s %s %d: ", fddip->fddi_fc, srcname, dstname, length); else if (qflag) printf("%s %s %d: ", srcname, dstname, length); else { (void) print_fddi_fc(fddip->fddi_fc); (void) printf("%s %s %d: ", srcname, dstname, length); } } static inline void fddi_smt_print(const u_char *p _U_, u_int length _U_) { printf(""); } void fddi_print(const u_char *p, u_int length, u_int caplen) { const struct fddi_header *fddip = (const struct fddi_header *)p; struct ether_header ehdr; u_short extracted_ethertype; if (caplen < FDDI_HDRLEN) { printf("[|fddi]"); return; } /* * Get the FDDI addresses into a canonical form */ extract_fddi_addrs(fddip, (char *)ESRC(&ehdr), (char *)EDST(&ehdr)); if (eflag) fddi_hdr_print(fddip, length, ESRC(&ehdr), EDST(&ehdr)); /* Skip over FDDI MAC header */ length -= FDDI_HDRLEN; p += FDDI_HDRLEN; caplen -= FDDI_HDRLEN; /* Frame Control field determines interpretation of packet */ if ((fddip->fddi_fc & FDDIFC_CLFF) == FDDIFC_LLC_ASYNC) { /* Try to print the LLC-layer header & higher layers */ if (llc_print(p, length, caplen, ESRC(&ehdr), EDST(&ehdr), &extracted_ethertype) == 0) { /* * Some kinds of LLC packet we cannot * handle intelligently */ if (!eflag) fddi_hdr_print(fddip, length + FDDI_HDRLEN, ESRC(&ehdr), EDST(&ehdr)); if (extracted_ethertype) { printf("(LLC %s) ", etherproto_string(htons(extracted_ethertype))); } if (!suppress_default_print) default_print(p, caplen); } } else if ((fddip->fddi_fc & FDDIFC_CLFF) == FDDIFC_SMT) fddi_smt_print(p, caplen); else { /* Some kinds of FDDI packet we cannot handle intelligently */ if (!eflag) fddi_hdr_print(fddip, length + FDDI_HDRLEN, ESRC(&ehdr), EDST(&ehdr)); if (!suppress_default_print) default_print(p, caplen); } } /* * This is the top level routine of the printer. 'p' points * to the FDDI header of the packet, 'h->ts' is the timestamp, * 'h->len' is the length of the packet off the wire, and 'h->caplen' * is the number of bytes actually captured. */ u_int fddi_if_print(const struct pcap_pkthdr *h, register const u_char *p) { fddi_print(p, h->len, h->caplen); return (FDDI_HDRLEN); } tcpdump-3.9.8/./slip.h0000644000026300017500000000240007170222421012577 0ustar mcrmcr/* * Definitions that user level programs might need to know to interact * with serial line IP (slip) lines. * * @(#) $Header: /tcpdump/master/tcpdump/slip.h,v 1.1 2000/10/09 01:53:21 guy Exp $ * * Copyright (c) 1990 Regents of the University of California. * All rights reserved. * * Redistribution and use in source and binary forms are permitted * provided that the above copyright notice and this paragraph are * duplicated in all such forms and that any documentation, * advertising materials, and other materials related to such * distribution and use acknowledge that the software was developed * by the University of California, Berkeley. The name of the * University may not be used to endorse or promote products derived * from this software without specific prior written permission. * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. */ /* * definitions of the pseudo- link-level header attached to slip * packets grabbed by the packet filter (bpf) traffic monitor. */ #define SLIP_HDRLEN 16 #define SLX_DIR 0 #define SLX_CHDR 1 #define CHDR_LEN 15 #define SLIPDIR_IN 0 #define SLIPDIR_OUT 1 tcpdump-3.9.8/./aclocal.m40000644000026300017500000010103110504040013013305 0ustar mcrmcrdnl @(#) $Header: /tcpdump/master/tcpdump/aclocal.m4,v 1.106.2.7 2005/11/08 03:00:52 guy Exp $ (LBL) dnl dnl Copyright (c) 1995, 1996, 1997, 1998 dnl The Regents of the University of California. All rights reserved. dnl dnl Redistribution and use in source and binary forms, with or without dnl modification, are permitted provided that: (1) source code distributions dnl retain the above copyright notice and this paragraph in its entirety, (2) dnl distributions including binary code include the above copyright notice and dnl this paragraph in its entirety in the documentation or other materials dnl provided with the distribution, and (3) all advertising materials mentioning dnl features or use of this software display the following acknowledgement: dnl ``This product includes software developed by the University of California, dnl Lawrence Berkeley Laboratory and its contributors.'' Neither the name of dnl the University nor the names of its contributors may be used to endorse dnl or promote products derived from this software without specific prior dnl written permission. dnl THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED dnl WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF dnl MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. dnl dnl LBL autoconf macros dnl dnl dnl Determine which compiler we're using (cc or gcc) dnl If using gcc, determine the version number dnl If using cc, require that it support ansi prototypes dnl If using gcc, use -O2 (otherwise use -O) dnl If using cc, explicitly specify /usr/local/include dnl dnl usage: dnl dnl AC_LBL_C_INIT(copt, incls) dnl dnl results: dnl dnl $1 (copt set) dnl $2 (incls set) dnl CC dnl LDFLAGS dnl ac_cv_lbl_gcc_vers dnl LBL_CFLAGS dnl AC_DEFUN(AC_LBL_C_INIT, [AC_PREREQ(2.12) AC_BEFORE([$0], [AC_PROG_CC]) AC_BEFORE([$0], [AC_LBL_FIXINCLUDES]) AC_BEFORE([$0], [AC_LBL_DEVEL]) AC_ARG_WITH(gcc, [ --without-gcc don't use gcc]) $1="-O" $2="" if test "${srcdir}" != "." ; then $2="-I\$(srcdir)" fi if test "${CFLAGS+set}" = set; then LBL_CFLAGS="$CFLAGS" fi if test -z "$CC" ; then case "$host_os" in bsdi*) AC_CHECK_PROG(SHLICC2, shlicc2, yes, no) if test $SHLICC2 = yes ; then CC=shlicc2 export CC fi ;; esac fi if test -z "$CC" -a "$with_gcc" = no ; then CC=cc export CC fi AC_PROG_CC if test "$GCC" = yes ; then if test "$SHLICC2" = yes ; then ac_cv_lbl_gcc_vers=2 $1="-O2" else AC_MSG_CHECKING(gcc version) AC_CACHE_VAL(ac_cv_lbl_gcc_vers, ac_cv_lbl_gcc_vers=`$CC -v 2>&1 | \ sed -e '/^gcc version /!d' \ -e 's/^gcc version //' \ -e 's/ .*//' -e 's/^[[[^0-9]]]*//' \ -e 's/\..*//'`) AC_MSG_RESULT($ac_cv_lbl_gcc_vers) if test $ac_cv_lbl_gcc_vers -gt 1 ; then $1="-O2" fi fi else AC_MSG_CHECKING(that $CC handles ansi prototypes) AC_CACHE_VAL(ac_cv_lbl_cc_ansi_prototypes, AC_TRY_COMPILE( [#include ], [int frob(int, char *)], ac_cv_lbl_cc_ansi_prototypes=yes, ac_cv_lbl_cc_ansi_prototypes=no)) AC_MSG_RESULT($ac_cv_lbl_cc_ansi_prototypes) if test $ac_cv_lbl_cc_ansi_prototypes = no ; then case "$host_os" in hpux*) AC_MSG_CHECKING(for HP-UX ansi compiler ($CC -Aa -D_HPUX_SOURCE)) savedcflags="$CFLAGS" CFLAGS="-Aa -D_HPUX_SOURCE $CFLAGS" AC_CACHE_VAL(ac_cv_lbl_cc_hpux_cc_aa, AC_TRY_COMPILE( [#include ], [int frob(int, char *)], ac_cv_lbl_cc_hpux_cc_aa=yes, ac_cv_lbl_cc_hpux_cc_aa=no)) AC_MSG_RESULT($ac_cv_lbl_cc_hpux_cc_aa) if test $ac_cv_lbl_cc_hpux_cc_aa = no ; then AC_MSG_ERROR(see the INSTALL doc for more info) fi CFLAGS="$savedcflags" V_CCOPT="-Aa $V_CCOPT" AC_DEFINE(_HPUX_SOURCE) ;; *) AC_MSG_ERROR(see the INSTALL doc for more info) ;; esac fi $2="$$2 -I/usr/local/include" LDFLAGS="$LDFLAGS -L/usr/local/lib" case "$host_os" in irix*) V_CCOPT="$V_CCOPT -xansi -signed -O" ;; osf*) V_CCOPT="$V_CCOPT -std1 -O" ;; ultrix*) AC_MSG_CHECKING(that Ultrix $CC hacks const in prototypes) AC_CACHE_VAL(ac_cv_lbl_cc_const_proto, AC_TRY_COMPILE( [#include ], [struct a { int b; }; void c(const struct a *)], ac_cv_lbl_cc_const_proto=yes, ac_cv_lbl_cc_const_proto=no)) AC_MSG_RESULT($ac_cv_lbl_cc_const_proto) if test $ac_cv_lbl_cc_const_proto = no ; then AC_DEFINE(const,) fi ;; esac fi ]) # # Try compiling a sample of the type of code that appears in # gencode.c with "inline", "__inline__", and "__inline". # # Autoconf's AC_C_INLINE, at least in autoconf 2.13, isn't good enough, # as it just tests whether a function returning "int" can be inlined; # at least some versions of HP's C compiler can inline that, but can't # inline a function that returns a struct pointer. # AC_DEFUN(AC_LBL_C_INLINE, [AC_MSG_CHECKING(for inline) AC_CACHE_VAL(ac_cv_lbl_inline, [ ac_cv_lbl_inline="" ac_lbl_cc_inline=no for ac_lbl_inline in inline __inline__ __inline do AC_TRY_COMPILE( [#define inline $ac_lbl_inline static inline struct iltest *foo(void); struct iltest { int iltest1; int iltest2; }; static inline struct iltest * foo() { static struct iltest xxx; return &xxx; }],,ac_lbl_cc_inline=yes,) if test "$ac_lbl_cc_inline" = yes ; then break; fi done if test "$ac_lbl_cc_inline" = yes ; then ac_cv_lbl_inline=$ac_lbl_inline fi]) if test ! -z "$ac_cv_lbl_inline" ; then AC_MSG_RESULT($ac_cv_lbl_inline) else AC_MSG_RESULT(no) fi AC_DEFINE_UNQUOTED(inline, $ac_cv_lbl_inline, [Define as token for inline if inlining supported])]) dnl dnl Use pfopen.c if available and pfopen() not in standard libraries dnl Require libpcap dnl Look for libpcap in .. dnl Use the installed libpcap if there is no local version dnl dnl usage: dnl dnl AC_LBL_LIBPCAP(pcapdep, incls) dnl dnl results: dnl dnl $1 (pcapdep set) dnl $2 (incls appended) dnl LIBS dnl LBL_LIBS dnl AC_DEFUN(AC_LBL_LIBPCAP, [AC_REQUIRE([AC_LBL_LIBRARY_NET]) dnl dnl save a copy before locating libpcap.a dnl LBL_LIBS="$LIBS" pfopen=/usr/examples/packetfilter/pfopen.c if test -f $pfopen ; then AC_CHECK_FUNCS(pfopen) if test $ac_cv_func_pfopen = "no" ; then AC_MSG_RESULT(Using $pfopen) LIBS="$LIBS $pfopen" fi fi AC_MSG_CHECKING(for local pcap library) libpcap=FAIL lastdir=FAIL places=`ls $srcdir/.. | sed -e 's,/$,,' -e "s,^,$srcdir/../," | \ egrep '/libpcap-[[0-9]]*.[[0-9]]*(.[[0-9]]*)?([[ab]][[0-9]]*)?$'` for dir in $places $srcdir/../libpcap $srcdir/libpcap ; do basedir=`echo $dir | sed -e 's/[[ab]][[0-9]]*$//'` if test $lastdir = $basedir ; then dnl skip alphas when an actual release is present continue; fi lastdir=$dir if test -r $dir/libpcap.a ; then libpcap=$dir/libpcap.a d=$dir dnl continue and select the last one that exists fi done if test $libpcap = FAIL ; then AC_MSG_RESULT(not found) AC_CHECK_LIB(pcap, main, libpcap="-lpcap") if test $libpcap = FAIL ; then AC_MSG_ERROR(see the INSTALL doc for more info) fi dnl dnl Good old Red Hat Linux puts "pcap.h" in dnl "/usr/include/pcap"; had the LBL folks done so, dnl that would have been a good idea, but for dnl the Red Hat folks to do so just breaks source dnl compatibility with other systems. dnl dnl We work around this by assuming that, as we didn't dnl find a local libpcap, libpcap is in /usr/lib or dnl /usr/local/lib and that the corresponding header dnl file is under one of those directories; if we don't dnl find it in either of those directories, we check to dnl see if it's in a "pcap" subdirectory of them and, dnl if so, add that subdirectory to the "-I" list. dnl AC_MSG_CHECKING(for extraneous pcap header directories) if test \( ! -r /usr/local/include/pcap.h \) -a \ \( ! -r /usr/include/pcap.h \); then if test -r /usr/local/include/pcap/pcap.h; then d="/usr/local/include/pcap" elif test -r /usr/include/pcap/pcap.h; then d="/usr/include/pcap" fi fi if test -z "$d" ; then AC_MSG_RESULT(not found) else $2="-I$d $$2" AC_MSG_RESULT(found -- -I$d added) fi else $1=$libpcap places=`ls $srcdir/.. | sed -e 's,/$,,' -e "s,^,$srcdir/../," | \ egrep '/libpcap-[[0-9]]*.[[0-9]]*(.[[0-9]]*)?([[ab]][[0-9]]*)?$'` if test -r $d/pcap.h; then $2="-I$d $$2" elif test -r $places/pcap.h; then $2="-I$places $$2" else AC_MSG_ERROR(cannot find pcap.h, see INSTALL) fi AC_MSG_RESULT($libpcap) fi LIBS="$libpcap $LIBS" case "$host_os" in aix*) pseexe="/lib/pse.exp" AC_MSG_CHECKING(for $pseexe) if test -f $pseexe ; then AC_MSG_RESULT(yes) LIBS="$LIBS -I:$pseexe" fi # # We need "-lodm" and "-lcfg", as libpcap requires them on # AIX, and we just build a static libpcap.a and thus can't # arrange that when you link with libpcap you automatically # link with those libraries. # LIBS="$LIBS -lodm -lcfg" ;; esac dnl dnl Check for "pcap_list_datalinks()", "pcap_set_datalink()", dnl and "pcap_datalink_name_to_val()", and use substitute versions dnl if they're not present. dnl AC_CHECK_FUNC(pcap_list_datalinks, AC_DEFINE(HAVE_PCAP_LIST_DATALINKS), [ AC_LIBOBJ(datalinks) ]) AC_CHECK_FUNC(pcap_set_datalink, AC_DEFINE(HAVE_PCAP_SET_DATALINK)) AC_CHECK_FUNC(pcap_datalink_name_to_val, [ AC_DEFINE(HAVE_PCAP_DATALINK_NAME_TO_VAL) AC_CHECK_FUNC(pcap_datalink_val_to_description, AC_DEFINE(HAVE_PCAP_DATALINK_VAL_TO_DESCRIPTION), [ AC_LIBOBJ(dlnames) ]) ], [ AC_LIBOBJ(dlnames) ]) dnl dnl Check for "pcap_breakloop()"; you can't substitute for it if dnl it's absent (it has hooks into the live capture routines), dnl so just define the HAVE_ value if it's there. dnl AC_CHECK_FUNCS(pcap_breakloop) dnl dnl Check for "pcap_dump_ftell()" and use a substitute version dnl if it's not present. AC_CHECK_FUNC(pcap_dump_ftell, AC_DEFINE(HAVE_PCAP_DUMP_FTELL), [ AC_LIBOBJ(pcap_dump_ftell) ]) ]) dnl dnl Define RETSIGTYPE and RETSIGVAL dnl dnl usage: dnl dnl AC_LBL_TYPE_SIGNAL dnl dnl results: dnl dnl RETSIGTYPE (defined) dnl RETSIGVAL (defined) dnl AC_DEFUN(AC_LBL_TYPE_SIGNAL, [AC_BEFORE([$0], [AC_LBL_LIBPCAP]) AC_TYPE_SIGNAL if test "$ac_cv_type_signal" = void ; then AC_DEFINE(RETSIGVAL,) else AC_DEFINE(RETSIGVAL,(0)) fi case "$host_os" in irix*) AC_DEFINE(_BSD_SIGNALS) ;; *) dnl prefer sigaction() to sigset() AC_CHECK_FUNCS(sigaction) if test $ac_cv_func_sigaction = no ; then AC_CHECK_FUNCS(sigset) fi ;; esac]) dnl dnl If using gcc, make sure we have ANSI ioctl definitions dnl dnl usage: dnl dnl AC_LBL_FIXINCLUDES dnl AC_DEFUN(AC_LBL_FIXINCLUDES, [if test "$GCC" = yes ; then AC_MSG_CHECKING(for ANSI ioctl definitions) AC_CACHE_VAL(ac_cv_lbl_gcc_fixincludes, AC_TRY_COMPILE( [/* * This generates a "duplicate case value" when fixincludes * has not be run. */ # include # include # include # ifdef HAVE_SYS_IOCCOM_H # include # endif], [switch (0) { case _IO('A', 1):; case _IO('B', 1):; }], ac_cv_lbl_gcc_fixincludes=yes, ac_cv_lbl_gcc_fixincludes=no)) AC_MSG_RESULT($ac_cv_lbl_gcc_fixincludes) if test $ac_cv_lbl_gcc_fixincludes = no ; then # Don't cache failure unset ac_cv_lbl_gcc_fixincludes AC_MSG_ERROR(see the INSTALL for more info) fi fi]) dnl dnl Check for flex, default to lex dnl Require flex 2.4 or higher dnl Check for bison, default to yacc dnl Default to lex/yacc if both flex and bison are not available dnl Define the yy prefix string if using flex and bison dnl dnl usage: dnl dnl AC_LBL_LEX_AND_YACC(lex, yacc, yyprefix) dnl dnl results: dnl dnl $1 (lex set) dnl $2 (yacc appended) dnl $3 (optional flex and bison -P prefix) dnl AC_DEFUN(AC_LBL_LEX_AND_YACC, [AC_ARG_WITH(flex, [ --without-flex don't use flex]) AC_ARG_WITH(bison, [ --without-bison don't use bison]) if test "$with_flex" = no ; then $1=lex else AC_CHECK_PROGS($1, flex, lex) fi if test "$$1" = flex ; then # The -V flag was added in 2.4 AC_MSG_CHECKING(for flex 2.4 or higher) AC_CACHE_VAL(ac_cv_lbl_flex_v24, if flex -V >/dev/null 2>&1; then ac_cv_lbl_flex_v24=yes else ac_cv_lbl_flex_v24=no fi) AC_MSG_RESULT($ac_cv_lbl_flex_v24) if test $ac_cv_lbl_flex_v24 = no ; then s="2.4 or higher required" AC_MSG_WARN(ignoring obsolete flex executable ($s)) $1=lex fi fi if test "$with_bison" = no ; then $2=yacc else AC_CHECK_PROGS($2, bison, yacc) fi if test "$$2" = bison ; then $2="$$2 -y" fi if test "$$1" != lex -a "$$2" = yacc -o "$$1" = lex -a "$$2" != yacc ; then AC_MSG_WARN(don't have both flex and bison; reverting to lex/yacc) $1=lex $2=yacc fi if test "$$1" = flex -a -n "$3" ; then $1="$$1 -P$3" $2="$$2 -p $3" fi]) dnl dnl Checks to see if union wait is used with WEXITSTATUS() dnl dnl usage: dnl dnl AC_LBL_UNION_WAIT dnl dnl results: dnl dnl DECLWAITSTATUS (defined) dnl AC_DEFUN(AC_LBL_UNION_WAIT, [AC_MSG_CHECKING(if union wait is used) AC_CACHE_VAL(ac_cv_lbl_union_wait, AC_TRY_COMPILE([ # include # include ], [int status; u_int i = WEXITSTATUS(status); u_int j = waitpid(0, &status, 0);], ac_cv_lbl_union_wait=no, ac_cv_lbl_union_wait=yes)) AC_MSG_RESULT($ac_cv_lbl_union_wait) if test $ac_cv_lbl_union_wait = yes ; then AC_DEFINE(DECLWAITSTATUS,union wait) else AC_DEFINE(DECLWAITSTATUS,int) fi]) dnl dnl Checks to see if the sockaddr struct has the 4.4 BSD sa_len member dnl dnl usage: dnl dnl AC_LBL_SOCKADDR_SA_LEN dnl dnl results: dnl dnl HAVE_SOCKADDR_SA_LEN (defined) dnl AC_DEFUN(AC_LBL_SOCKADDR_SA_LEN, [AC_MSG_CHECKING(if sockaddr struct has sa_len member) AC_CACHE_VAL(ac_cv_lbl_sockaddr_has_sa_len, AC_TRY_COMPILE([ # include # include ], [u_int i = sizeof(((struct sockaddr *)0)->sa_len)], ac_cv_lbl_sockaddr_has_sa_len=yes, ac_cv_lbl_sockaddr_has_sa_len=no)) AC_MSG_RESULT($ac_cv_lbl_sockaddr_has_sa_len) if test $ac_cv_lbl_sockaddr_has_sa_len = yes ; then AC_DEFINE(HAVE_SOCKADDR_SA_LEN) fi]) dnl dnl Checks to see if -R is used dnl dnl usage: dnl dnl AC_LBL_HAVE_RUN_PATH dnl dnl results: dnl dnl ac_cv_lbl_have_run_path (yes or no) dnl AC_DEFUN(AC_LBL_HAVE_RUN_PATH, [AC_MSG_CHECKING(for ${CC-cc} -R) AC_CACHE_VAL(ac_cv_lbl_have_run_path, [echo 'main(){}' > conftest.c ${CC-cc} -o conftest conftest.c -R/a1/b2/c3 >conftest.out 2>&1 if test ! -s conftest.out ; then ac_cv_lbl_have_run_path=yes else ac_cv_lbl_have_run_path=no fi rm -f conftest*]) AC_MSG_RESULT($ac_cv_lbl_have_run_path) ]) dnl dnl Check whether a given format can be used to print 64-bit integers dnl AC_DEFUN(AC_LBL_CHECK_64BIT_FORMAT, [ AC_MSG_CHECKING([whether %$1x can be used to format 64-bit integers]) AC_RUN_IFELSE( [ AC_LANG_SOURCE( [[ # ifdef HAVE_INTTYPES_H #include # endif # ifdef HAVE_SYS_BITYPES_H #include # endif #include #include main() { u_int64_t t = 1; char strbuf[16+1]; sprintf(strbuf, "%016$1x", t << 32); if (strcmp(strbuf, "0000000100000000") == 0) exit(0); else exit(1); } ]]) ], [ AC_DEFINE(PRId64, "$1d") AC_DEFINE(PRIo64, "$1o") AC_DEFINE(PRIx64, "$1x") AC_DEFINE(PRIu64, "$1u") AC_MSG_RESULT(yes) ], [ AC_MSG_RESULT(no) $2 ]) ]) dnl dnl Checks to see if unaligned memory accesses fail dnl dnl usage: dnl dnl AC_LBL_UNALIGNED_ACCESS dnl dnl results: dnl dnl LBL_ALIGN (DEFINED) dnl AC_DEFUN(AC_LBL_UNALIGNED_ACCESS, [AC_MSG_CHECKING(if unaligned accesses fail) AC_CACHE_VAL(ac_cv_lbl_unaligned_fail, [case "$host_cpu" in # # These are CPU types where: # # the CPU faults on an unaligned access, but at least some # OSes that support that CPU catch the fault and simulate # the unaligned access (e.g., Alpha/{Digital,Tru64} UNIX) - # the simulation is slow, so we don't want to use it; # # the CPU, I infer (from the old # # XXX: should also check that they don't do weird things (like on arm) # # comment) doesn't fault on unaligned accesses, but doesn't # do a normal unaligned fetch, either (e.g., presumably, ARM); # # for whatever reason, the test program doesn't work # (this has been claimed to be the case for several of those # CPUs - I don't know what the problem is; the problem # was reported as "the test program dumps core" for SuperH, # but that's what the test program is *supposed* to do - # it dumps core before it writes anything, so the test # for an empty output file should find an empty output # file and conclude that unaligned accesses don't work). # # This run-time test won't work if you're cross-compiling, so # in order to support cross-compiling for a particular CPU, # we have to wire in the list of CPU types anyway, as far as # I know, so perhaps we should just have a set of CPUs on # which we know it doesn't work, a set of CPUs on which we # know it does work, and have the script just fail on other # cpu types and update it when such a failure occurs. # alpha*|arm*|hp*|mips*|sh*|sparc*|ia64|nv1) ac_cv_lbl_unaligned_fail=yes ;; *) cat >conftest.c < # include # include unsigned char a[[5]] = { 1, 2, 3, 4, 5 }; main() { unsigned int i; pid_t pid; int status; /* avoid "core dumped" message */ pid = fork(); if (pid < 0) exit(2); if (pid > 0) { /* parent */ pid = waitpid(pid, &status, 0); if (pid < 0) exit(3); exit(!WIFEXITED(status)); } /* child */ i = *(unsigned int *)&a[[1]]; printf("%d\n", i); exit(0); } EOF ${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS \ conftest.c $LIBS >/dev/null 2>&1 if test ! -x conftest ; then dnl failed to compile for some reason ac_cv_lbl_unaligned_fail=yes else ./conftest >conftest.out if test ! -s conftest.out ; then ac_cv_lbl_unaligned_fail=yes else ac_cv_lbl_unaligned_fail=no fi fi rm -f conftest* core core.conftest ;; esac]) AC_MSG_RESULT($ac_cv_lbl_unaligned_fail) if test $ac_cv_lbl_unaligned_fail = yes ; then AC_DEFINE(LBL_ALIGN) fi]) dnl dnl If using gcc and the file .devel exists: dnl Compile with -g (if supported) and -Wall dnl If using gcc 2 or later, do extra prototype checking and some other dnl checks dnl If an os prototype include exists, symlink os-proto.h to it dnl dnl usage: dnl dnl AC_LBL_DEVEL(copt) dnl dnl results: dnl dnl $1 (copt appended) dnl HAVE_OS_PROTO_H (defined) dnl os-proto.h (symlinked) dnl AC_DEFUN(AC_LBL_DEVEL, [rm -f os-proto.h if test "${LBL_CFLAGS+set}" = set; then $1="$$1 ${LBL_CFLAGS}" fi if test -f .devel ; then if test "$GCC" = yes ; then if test "${LBL_CFLAGS+set}" != set; then if test "$ac_cv_prog_cc_g" = yes ; then $1="-g $$1" fi $1="$$1 -Wall" if test $ac_cv_lbl_gcc_vers -gt 1 ; then $1="$$1 -Wmissing-prototypes -Wstrict-prototypes -Wwrite-strings -Wpointer-arith -W" fi fi else case "$host_os" in irix6*) V_CCOPT="$V_CCOPT -n32" ;; *) ;; esac fi os=`echo $host_os | sed -e 's/\([[0-9]][[0-9]]*\)[[^0-9]].*$/\1/'` name="lbl/os-$os.h" if test -f $name ; then ln -s $name os-proto.h AC_DEFINE(HAVE_OS_PROTO_H) else AC_MSG_WARN(can't find $name) fi fi]) dnl dnl Improved version of AC_CHECK_LIB dnl dnl Thanks to John Hawkinson (jhawk@mit.edu) dnl dnl usage: dnl dnl AC_LBL_CHECK_LIB(LIBRARY, FUNCTION [, ACTION-IF-FOUND [, dnl ACTION-IF-NOT-FOUND [, OTHER-LIBRARIES]]]) dnl dnl results: dnl dnl LIBS dnl dnl XXX - "AC_LBL_LIBRARY_NET" was redone to use "AC_SEARCH_LIBS" dnl rather than "AC_LBL_CHECK_LIB", so this isn't used any more. dnl We keep it around for reference purposes in case it's ever dnl useful in the future. dnl define(AC_LBL_CHECK_LIB, [AC_MSG_CHECKING([for $2 in -l$1]) dnl Use a cache variable name containing the library, function dnl name, and extra libraries to link with, because the test really is dnl for library $1 defining function $2, when linked with potinal dnl library $5, not just for library $1. Separate tests with the same dnl $1 and different $2's or $5's may have different results. ac_lib_var=`echo $1['_']$2['_']$5 | sed 'y%./+- %__p__%'` AC_CACHE_VAL(ac_cv_lbl_lib_$ac_lib_var, [ac_save_LIBS="$LIBS" LIBS="-l$1 $5 $LIBS" AC_TRY_LINK(dnl ifelse([$2], [main], , dnl Avoid conflicting decl of main. [/* Override any gcc2 internal prototype to avoid an error. */ ]ifelse(AC_LANG, CPLUSPLUS, [#ifdef __cplusplus extern "C" #endif ])dnl [/* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char $2(); ]), [$2()], eval "ac_cv_lbl_lib_$ac_lib_var=yes", eval "ac_cv_lbl_lib_$ac_lib_var=no") LIBS="$ac_save_LIBS" ])dnl if eval "test \"`echo '$ac_cv_lbl_lib_'$ac_lib_var`\" = yes"; then AC_MSG_RESULT(yes) ifelse([$3], , [changequote(, )dnl ac_tr_lib=HAVE_LIB`echo $1 | sed -e 's/[^a-zA-Z0-9_]/_/g' \ -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'` changequote([, ])dnl AC_DEFINE_UNQUOTED($ac_tr_lib) LIBS="-l$1 $LIBS" ], [$3]) else AC_MSG_RESULT(no) ifelse([$4], , , [$4 ])dnl fi ]) dnl dnl AC_LBL_LIBRARY_NET dnl dnl This test is for network applications that need socket() and dnl gethostbyname() -ish functions. Under Solaris, those applications dnl need to link with "-lsocket -lnsl". Under IRIX, they need to link dnl with "-lnsl" but should *not* link with "-lsocket" because dnl libsocket.a breaks a number of things (for instance: dnl gethostbyname() under IRIX 5.2, and snoop sockets under most dnl versions of IRIX). dnl dnl Unfortunately, many application developers are not aware of this, dnl and mistakenly write tests that cause -lsocket to be used under dnl IRIX. It is also easy to write tests that cause -lnsl to be used dnl under operating systems where neither are necessary (or useful), dnl such as SunOS 4.1.4, which uses -lnsl for TLI. dnl dnl This test exists so that every application developer does not test dnl this in a different, and subtly broken fashion. dnl It has been argued that this test should be broken up into two dnl seperate tests, one for the resolver libraries, and one for the dnl libraries necessary for using Sockets API. Unfortunately, the two dnl are carefully intertwined and allowing the autoconf user to use dnl them independantly potentially results in unfortunate ordering dnl dependancies -- as such, such component macros would have to dnl carefully use indirection and be aware if the other components were dnl executed. Since other autoconf macros do not go to this trouble, dnl and almost no applications use sockets without the resolver, this dnl complexity has not been implemented. dnl dnl The check for libresolv is in case you are attempting to link dnl statically and happen to have a libresolv.a lying around (and no dnl libnsl.a). dnl AC_DEFUN(AC_LBL_LIBRARY_NET, [ # Most operating systems have gethostbyname() in the default searched # libraries (i.e. libc): # Some OSes (eg. Solaris) place it in libnsl # Some strange OSes (SINIX) have it in libsocket: AC_SEARCH_LIBS(gethostbyname, nsl socket resolv) # Unfortunately libsocket sometimes depends on libnsl and # AC_SEARCH_LIBS isn't up to the task of handling dependencies like this. if test "$ac_cv_search_gethostbyname" = "no" then AC_CHECK_LIB(socket, gethostbyname, LIBS="-lsocket -lnsl $LIBS", , -lnsl) fi AC_SEARCH_LIBS(socket, socket, , AC_CHECK_LIB(socket, socket, LIBS="-lsocket -lnsl $LIBS", , -lnsl)) # DLPI needs putmsg under HPUX so test for -lstr while we're at it AC_SEARCH_LIBS(putmsg, str) ]) dnl Copyright (c) 1999 WIDE Project. All rights reserved. dnl dnl Redistribution and use in source and binary forms, with or without dnl modification, are permitted provided that the following conditions dnl are met: dnl 1. Redistributions of source code must retain the above copyright dnl notice, this list of conditions and the following disclaimer. dnl 2. Redistributions in binary form must reproduce the above copyright dnl notice, this list of conditions and the following disclaimer in the dnl documentation and/or other materials provided with the distribution. dnl 3. Neither the name of the project nor the names of its contributors dnl may be used to endorse or promote products derived from this software dnl without specific prior written permission. dnl dnl THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND dnl ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE dnl IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE dnl ARE DISCLAIMED. IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE dnl FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL dnl DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS dnl OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) dnl HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT dnl LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY dnl OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF dnl SUCH DAMAGE. dnl dnl Checks to see if AF_INET6 is defined AC_DEFUN(AC_CHECK_AF_INET6, [ AC_MSG_CHECKING(for AF_INET6) AC_CACHE_VAL($1, AC_TRY_COMPILE([ # include # include ], [int a = AF_INET6], $1=yes, $1=no)) AC_MSG_RESULT($$1) if test $$1 = yes ; then AC_DEFINE(HAVE_AF_INET6) fi ]) dnl dnl Checks to see if the sockaddr struct has the 4.4 BSD sa_len member dnl borrowed from LBL libpcap AC_DEFUN(AC_CHECK_SA_LEN, [ AC_MSG_CHECKING(if sockaddr struct has sa_len member) AC_CACHE_VAL($1, AC_TRY_COMPILE([ # include # include ], [u_int i = sizeof(((struct sockaddr *)0)->sa_len)], $1=yes, $1=no)) AC_MSG_RESULT($$1) if test $$1 = yes ; then AC_DEFINE(HAVE_SOCKADDR_SA_LEN) fi ]) dnl dnl Checks for portable prototype declaration macro AC_DEFUN(AC_CHECK_PORTABLE_PROTO, [ AC_MSG_CHECKING(for __P) AC_CACHE_VAL($1, AC_TRY_COMPILE([ # include ], [int f __P(())], $1=yes, $1=no)) AC_MSG_RESULT($$1) if test $$1 = yes; then AC_DEFINE(HAVE_PORTABLE_PROTOTYPE) fi ]) dnl checks for u_intXX_t AC_DEFUN(AC_CHECK_BITTYPES, [ $1=yes dnl check for u_int8_t AC_MSG_CHECKING(for u_int8_t) AC_CACHE_VAL(ac_cv_u_int8_t, AC_TRY_COMPILE([ # include ], [u_int8_t i], ac_cv_u_int8_t=yes, ac_cv_u_int8_t=no)) AC_MSG_RESULT($ac_cv_u_int8_t) if test $ac_cv_u_int8_t = yes; then AC_DEFINE(HAVE_U_INT8_T) else $1=no fi dnl check for u_int16_t AC_MSG_CHECKING(for u_int16_t) AC_CACHE_VAL(ac_cv_u_int16_t, AC_TRY_COMPILE([ # include ], [u_int16_t i], ac_cv_u_int16_t=yes, ac_cv_u_int16_t=no)) AC_MSG_RESULT($ac_cv_u_int16_t) if test $ac_cv_u_int16_t = yes; then AC_DEFINE(HAVE_U_INT16_T) else $1=no fi dnl check for u_int32_t AC_MSG_CHECKING(for u_int32_t) AC_CACHE_VAL(ac_cv_u_int32_t, AC_TRY_COMPILE([ # include ], [u_int32_t i], ac_cv_u_int32_t=yes, ac_cv_u_int32_t=no)) AC_MSG_RESULT($ac_cv_u_int32_t) if test $ac_cv_u_int32_t = yes; then AC_DEFINE(HAVE_U_INT32_T) else $1=no fi dnl check for u_int64_t AC_MSG_CHECKING(for u_int64_t) AC_CACHE_VAL(ac_cv_u_int64_t, AC_TRY_COMPILE([ # include ], [u_int64_t i], ac_cv_u_int64_t=yes, ac_cv_u_int64_t=no)) AC_MSG_RESULT($ac_cv_u_int64_t) if test $ac_cv_u_int64_t = yes; then AC_DEFINE(HAVE_U_INT64_T) else $1=no fi ]) dnl dnl Checks for addrinfo structure AC_DEFUN(AC_STRUCT_ADDRINFO, [ AC_MSG_CHECKING(for addrinfo) AC_CACHE_VAL($1, AC_TRY_COMPILE([ # include ], [struct addrinfo a], $1=yes, $1=no)) AC_MSG_RESULT($$1) if test $$1 = yes; then AC_DEFINE(HAVE_ADDRINFO) else AC_DEFINE(NEED_ADDRINFO_H) fi ]) dnl dnl Checks for NI_MAXSERV AC_DEFUN(AC_NI_MAXSERV, [ AC_MSG_CHECKING(for NI_MAXSERV) AC_CACHE_VAL($1, AC_EGREP_CPP(yes, [#include #ifdef NI_MAXSERV yes #endif], $1=yes, $1=no)) AC_MSG_RESULT($$1) if test $$1 != yes; then AC_DEFINE(NEED_ADDRINFO_H) fi ]) dnl dnl Checks for NI_NAMEREQD AC_DEFUN(AC_NI_NAMEREQD, [ AC_MSG_CHECKING(for NI_NAMEREQD) AC_CACHE_VAL($1, AC_EGREP_CPP(yes, [#include #ifdef NI_NOFQDN yes #endif], $1=yes, $1=no)) AC_MSG_RESULT($$1) if test $$1 != yes; then AC_DEFINE(NEED_ADDRINFO_H) fi ]) dnl dnl Checks for sockaddr_storage structure AC_DEFUN(AC_STRUCT_SA_STORAGE, [ AC_MSG_CHECKING(for sockaddr_storage) AC_CACHE_VAL($1, AC_TRY_COMPILE([ # include # include ], [struct sockaddr_storage s], $1=yes, $1=no)) AC_MSG_RESULT($$1) if test $$1 = yes; then AC_DEFINE(HAVE_SOCKADDR_STORAGE) fi ]) dnl dnl Checks for macro of IP address size AC_DEFUN(AC_CHECK_ADDRSZ, [ $1=yes dnl check for INADDRSZ AC_MSG_CHECKING(for INADDRSZ) AC_CACHE_VAL(ac_cv_inaddrsz, AC_TRY_COMPILE([ # include ], [int a = INADDRSZ], ac_cv_inaddrsz=yes, ac_cv_inaddrsz=no)) AC_MSG_RESULT($ac_cv_inaddrsz) if test $ac_cv_inaddrsz = yes; then AC_DEFINE(HAVE_INADDRSZ) else $1=no fi dnl check for IN6ADDRSZ AC_MSG_CHECKING(for IN6ADDRSZ) AC_CACHE_VAL(ac_cv_in6addrsz, AC_TRY_COMPILE([ # include ], [int a = IN6ADDRSZ], ac_cv_in6addrsz=yes, ac_cv_in6addrsz=no)) AC_MSG_RESULT($ac_cv_in6addrsz) if test $ac_cv_in6addrsz = yes; then AC_DEFINE(HAVE_IN6ADDRSZ) else $1=no fi ]) dnl dnl check for RES_USE_INET6 AC_DEFUN(AC_CHECK_RES_USE_INET6, [ AC_MSG_CHECKING(for RES_USE_INET6) AC_CACHE_VAL($1, AC_TRY_COMPILE([ # include # include # include ], [int a = RES_USE_INET6], $1=yes, $1=no)) AC_MSG_RESULT($$1) if test $$1 = yes; then AC_DEFINE(HAVE_RES_USE_INET6) fi ]) dnl dnl check for AAAA AC_DEFUN(AC_CHECK_AAAA, [ AC_MSG_CHECKING(for AAAA) AC_CACHE_VAL($1, AC_TRY_COMPILE([ # include # include ], [int a = T_AAAA], $1=yes, $1=no)) AC_MSG_RESULT($$1) if test $$1 = yes; then AC_DEFINE(HAVE_AAAA) fi ]) dnl dnl check for struct res_state_ext AC_DEFUN(AC_STRUCT_RES_STATE_EXT, [ AC_MSG_CHECKING(for res_state_ext) AC_CACHE_VAL($1, AC_TRY_COMPILE([ # include # include # include # include ], [struct __res_state_ext e], $1=yes, $1=no)) AC_MSG_RESULT($$1) if test $$1 = yes; then AC_DEFINE(HAVE_RES_STATE_EXT) fi ]) dnl dnl check for struct res_state_ext AC_DEFUN(AC_STRUCT_RES_STATE, [ AC_MSG_CHECKING(for nsort in res_state) AC_CACHE_VAL($1, AC_TRY_COMPILE([ # include # include # include # include ], [struct __res_state e; e.nsort = 0], $1=yes, $1=no)) AC_MSG_RESULT($$1) if test $$1 = yes; then AC_DEFINE(HAVE_NEW_RES_STATE) fi ]) dnl dnl check for h_errno AC_DEFUN(AC_VAR_H_ERRNO, [ AC_MSG_CHECKING(for h_errno) AC_CACHE_VAL(ac_cv_var_h_errno, AC_TRY_COMPILE([ # include # include ], [int foo = h_errno;], ac_cv_var_h_errno=yes, ac_cv_var_h_errno=no)) AC_MSG_RESULT($ac_cv_var_h_errno) if test "$ac_cv_var_h_errno" = "yes"; then AC_DEFINE(HAVE_H_ERRNO) fi ]) dnl dnl Test for __attribute__ dnl AC_DEFUN(AC_C___ATTRIBUTE__, [ AC_MSG_CHECKING(for __attribute__) AC_CACHE_VAL(ac_cv___attribute__, [ AC_COMPILE_IFELSE( AC_LANG_SOURCE([[ #include static void foo(void) __attribute__ ((noreturn)); static void foo(void) { exit(1); } int main(int argc, char **argv) { foo(); } ]]), ac_cv___attribute__=yes, ac_cv___attribute__=no)]) if test "$ac_cv___attribute__" = "yes"; then AC_DEFINE(HAVE___ATTRIBUTE__, 1, [define if your compiler has __attribute__]) V_DEFS="$V_DEFS -D_U_=\"__attribute__((unused))\"" else V_DEFS="$V_DEFS -D_U_=\"\"" fi AC_MSG_RESULT($ac_cv___attribute__) ]) tcpdump-3.9.8/./igrp.h0000644000026300017500000000211707575562660012623 0ustar mcrmcr/* @(#) $Header: /tcpdump/master/tcpdump/igrp.h,v 1.6 2002/12/11 07:13:52 guy Exp $ (LBL) */ /* Cisco IGRP definitions */ /* IGRP Header */ struct igrphdr { u_int8_t ig_vop; /* protocol version number / opcode */ #define IGRP_V(x) (((x) & 0xf0) >> 4) #define IGRP_OP(x) ((x) & 0x0f) u_int8_t ig_ed; /* edition number */ u_int16_t ig_as; /* autonomous system number */ u_int16_t ig_ni; /* number of subnet in local net */ u_int16_t ig_ns; /* number of networks in AS */ u_int16_t ig_nx; /* number of networks ouside AS */ u_int16_t ig_sum; /* checksum of IGRP header & data */ }; #define IGRP_UPDATE 1 #define IGRP_REQUEST 2 /* IGRP routing entry */ struct igrprte { u_int8_t igr_net[3]; /* 3 significant octets of IP address */ u_int8_t igr_dly[3]; /* delay in tens of microseconds */ u_int8_t igr_bw[3]; /* bandwidth in units of 1 kb/s */ u_int8_t igr_mtu[2]; /* MTU in octets */ u_int8_t igr_rel; /* percent packets successfully tx/rx */ u_int8_t igr_ld; /* percent of channel occupied */ u_int8_t igr_hct; /* hop count */ }; #define IGRP_RTE_SIZE 14 /* don't believe sizeof ! */ tcpdump-3.9.8/./print-ospf.c0000644000026300017500000010547710634111731013746 0ustar mcrmcr/* * Copyright (c) 1992, 1993, 1994, 1995, 1996, 1997 * The Regents of the University of California. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that: (1) source code distributions * retain the above copyright notice and this paragraph in its entirety, (2) * distributions including binary code include the above copyright notice and * this paragraph in its entirety in the documentation or other materials * provided with the distribution, and (3) all advertising materials mentioning * features or use of this software display the following acknowledgement: * ``This product includes software developed by the University of California, * Lawrence Berkeley Laboratory and its contributors.'' Neither the name of * the University nor the names of its contributors may be used to endorse * or promote products derived from this software without specific prior * written permission. * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * * OSPF support contributed by Jeffrey Honig (jch@mitchell.cit.cornell.edu) */ #ifndef lint static const char rcsid[] _U_ = "@(#) $Header: /tcpdump/master/tcpdump/print-ospf.c,v 1.56.2.4 2006/12/13 08:24:27 hannes Exp $ (LBL)"; #endif #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include "interface.h" #include "addrtoname.h" #include "extract.h" #include "gmpls.h" #include "ospf.h" #include "ip.h" static struct tok ospf_option_values[] = { { OSPF_OPTION_T, "TOS" }, { OSPF_OPTION_E, "External" }, { OSPF_OPTION_MC, "Multicast" }, { OSPF_OPTION_NP, "NSSA" }, { OSPF_OPTION_EA, "Advertise External" }, { OSPF_OPTION_DC, "Demand Circuit" }, { OSPF_OPTION_O, "Opaque" }, { OSPF_OPTION_DN, "Up/Down" }, { 0, NULL } }; static struct tok ospf_authtype_values[] = { { OSPF_AUTH_NONE, "none" }, { OSPF_AUTH_SIMPLE, "simple" }, { OSPF_AUTH_MD5, "MD5" }, { 0, NULL } }; static struct tok ospf_rla_flag_values[] = { { RLA_FLAG_B, "ABR" }, { RLA_FLAG_E, "ASBR" }, { RLA_FLAG_W1, "Virtual" }, { RLA_FLAG_W2, "W2" }, { 0, NULL } }; static struct tok type2str[] = { { OSPF_TYPE_UMD, "UMD" }, { OSPF_TYPE_HELLO, "Hello" }, { OSPF_TYPE_DD, "Database Description" }, { OSPF_TYPE_LS_REQ, "LS-Request" }, { OSPF_TYPE_LS_UPDATE, "LS-Update" }, { OSPF_TYPE_LS_ACK, "LS-Ack" }, { 0, NULL } }; static struct tok lsa_values[] = { { LS_TYPE_ROUTER, "Router" }, { LS_TYPE_NETWORK, "Network" }, { LS_TYPE_SUM_IP, "Summary" }, { LS_TYPE_SUM_ABR, "ASBR Summary" }, { LS_TYPE_ASE, "External" }, { LS_TYPE_GROUP, "Multicast Group" }, { LS_TYPE_NSSA, "NSSA" }, { LS_TYPE_OPAQUE_LL, "Link Local Opaque" }, { LS_TYPE_OPAQUE_AL, "Area Local Opaque" }, { LS_TYPE_OPAQUE_DW, "Domain Wide Opaque" }, { 0, NULL } }; static struct tok ospf_dd_flag_values[] = { { OSPF_DB_INIT, "Init" }, { OSPF_DB_MORE, "More" }, { OSPF_DB_MASTER, "Master" }, { 0, NULL } }; static struct tok lsa_opaque_values[] = { { LS_OPAQUE_TYPE_TE, "Traffic Engineering" }, { LS_OPAQUE_TYPE_GRACE, "Graceful restart" }, { LS_OPAQUE_TYPE_RI, "Router Information" }, { 0, NULL } }; static struct tok lsa_opaque_te_tlv_values[] = { { LS_OPAQUE_TE_TLV_ROUTER, "Router Address" }, { LS_OPAQUE_TE_TLV_LINK, "Link" }, { 0, NULL } }; static struct tok lsa_opaque_te_link_tlv_subtlv_values[] = { { LS_OPAQUE_TE_LINK_SUBTLV_LINK_TYPE, "Link Type" }, { LS_OPAQUE_TE_LINK_SUBTLV_LINK_ID, "Link ID" }, { LS_OPAQUE_TE_LINK_SUBTLV_LOCAL_IP, "Local Interface IP address" }, { LS_OPAQUE_TE_LINK_SUBTLV_REMOTE_IP, "Remote Interface IP address" }, { LS_OPAQUE_TE_LINK_SUBTLV_TE_METRIC, "Traffic Engineering Metric" }, { LS_OPAQUE_TE_LINK_SUBTLV_MAX_BW, "Maximum Bandwidth" }, { LS_OPAQUE_TE_LINK_SUBTLV_MAX_RES_BW, "Maximum Reservable Bandwidth" }, { LS_OPAQUE_TE_LINK_SUBTLV_UNRES_BW, "Unreserved Bandwidth" }, { LS_OPAQUE_TE_LINK_SUBTLV_ADMIN_GROUP, "Administrative Group" }, { LS_OPAQUE_TE_LINK_SUBTLV_LINK_LOCAL_REMOTE_ID, "Link Local/Remote Identifier" }, { LS_OPAQUE_TE_LINK_SUBTLV_LINK_PROTECTION_TYPE, "Link Protection Type" }, { LS_OPAQUE_TE_LINK_SUBTLV_INTF_SW_CAP_DESCR, "Interface Switching Capability" }, { LS_OPAQUE_TE_LINK_SUBTLV_SHARED_RISK_GROUP, "Shared Risk Link Group" }, { LS_OPAQUE_TE_LINK_SUBTLV_BW_CONSTRAINTS, "Bandwidth Constraints" }, { 0, NULL } }; static struct tok lsa_opaque_grace_tlv_values[] = { { LS_OPAQUE_GRACE_TLV_PERIOD, "Grace Period" }, { LS_OPAQUE_GRACE_TLV_REASON, "Graceful restart Reason" }, { LS_OPAQUE_GRACE_TLV_INT_ADDRESS, "IPv4 interface address" }, { 0, NULL } }; static struct tok lsa_opaque_grace_tlv_reason_values[] = { { LS_OPAQUE_GRACE_TLV_REASON_UNKNOWN, "Unknown" }, { LS_OPAQUE_GRACE_TLV_REASON_SW_RESTART, "Software Restart" }, { LS_OPAQUE_GRACE_TLV_REASON_SW_UPGRADE, "Software Reload/Upgrade" }, { LS_OPAQUE_GRACE_TLV_REASON_CP_SWITCH, "Control Processor Switch" }, { 0, NULL } }; static struct tok lsa_opaque_te_tlv_link_type_sub_tlv_values[] = { { LS_OPAQUE_TE_LINK_SUBTLV_LINK_TYPE_PTP, "Point-to-point" }, { LS_OPAQUE_TE_LINK_SUBTLV_LINK_TYPE_MA, "Multi-Access" }, { 0, NULL } }; static struct tok lsa_opaque_ri_tlv_values[] = { { LS_OPAQUE_RI_TLV_CAP, "Router Capabilities" }, { 0, NULL } }; static struct tok lsa_opaque_ri_tlv_cap_values[] = { { 1, "Reserved" }, { 2, "Reserved" }, { 4, "Reserved" }, { 8, "Reserved" }, { 16, "graceful restart capable" }, { 32, "graceful restart helper" }, { 64, "Stub router support" }, { 128, "Traffic engineering" }, { 256, "p2p over LAN" }, { 512, "path computation server" }, { 0, NULL } }; static char tstr[] = " [|ospf]"; #ifdef WIN32 #define inline __inline #endif /* WIN32 */ static int ospf_print_lshdr(const struct lsa_hdr *); static const u_char *ospf_print_lsa(const struct lsa *); static int ospf_decode_v2(const struct ospfhdr *, const u_char *); static int ospf_print_lshdr(register const struct lsa_hdr *lshp) { u_int ls_length; TCHECK(lshp->ls_length); ls_length = EXTRACT_16BITS(&lshp->ls_length); if (ls_length < sizeof(struct lsa_hdr)) { printf("\n\t Bogus length %u < %lu", ls_length, (unsigned long)sizeof(struct lsa_hdr)); return(-1); } TCHECK(lshp->ls_seq); /* XXX - ls_length check checked this */ printf("\n\t Advertising Router: %s, seq 0x%08x, age %us, length: %u", ipaddr_string(&lshp->ls_router), EXTRACT_32BITS(&lshp->ls_seq), EXTRACT_16BITS(&lshp->ls_age), ls_length-(u_int)sizeof(struct lsa_hdr)); TCHECK(lshp->ls_type); /* XXX - ls_length check checked this */ switch (lshp->ls_type) { /* the LSA header for opaque LSAs was slightly changed */ case LS_TYPE_OPAQUE_LL: case LS_TYPE_OPAQUE_AL: case LS_TYPE_OPAQUE_DW: printf("\n\t %s LSA (%d), Opaque-Type: %s LSA (%u), Opaque-ID: %u", tok2str(lsa_values,"unknown",lshp->ls_type), lshp->ls_type, tok2str(lsa_opaque_values, "unknown", *(&lshp->un_lsa_id.opaque_field.opaque_type)), *(&lshp->un_lsa_id.opaque_field.opaque_type), EXTRACT_24BITS(&lshp->un_lsa_id.opaque_field.opaque_id) ); break; /* all other LSA types use regular style LSA headers */ default: printf("\n\t %s LSA (%d), LSA-ID: %s", tok2str(lsa_values,"unknown",lshp->ls_type), lshp->ls_type, ipaddr_string(&lshp->un_lsa_id.lsa_id)); break; } TCHECK(lshp->ls_options); /* XXX - ls_length check checked this */ printf("\n\t Options: [%s]", bittok2str(ospf_option_values,"none",lshp->ls_options)); return (ls_length); trunc: return (-1); } /* * Print a single link state advertisement. If truncated or if LSA length * field is less than the length of the LSA header, return NULl, else * return pointer to data past end of LSA. */ static const u_int8_t * ospf_print_lsa(register const struct lsa *lsap) { register const u_int8_t *ls_end; register const struct rlalink *rlp; register const struct tos_metric *tosp; register const struct in_addr *ap; register const struct aslametric *almp; register const struct mcla *mcp; register const u_int32_t *lp; register int j, k, tlv_type, tlv_length, subtlv_type, subtlv_length, priority_level, te_class; register int ls_length; const u_int8_t *tptr; int count_srlg; union { /* int to float conversion buffer for several subTLVs */ float f; u_int32_t i; } bw; tptr = (u_int8_t *)lsap->lsa_un.un_unknown; /* squelch compiler warnings */ ls_length = ospf_print_lshdr(&lsap->ls_hdr); if (ls_length == -1) return(NULL); ls_end = (u_int8_t *)lsap + ls_length; ls_length -= sizeof(struct lsa_hdr); switch (lsap->ls_hdr.ls_type) { case LS_TYPE_ROUTER: TCHECK(lsap->lsa_un.un_rla.rla_flags); printf("\n\t Router LSA Options: [%s]", bittok2str(ospf_rla_flag_values,"none",lsap->lsa_un.un_rla.rla_flags)); TCHECK(lsap->lsa_un.un_rla.rla_count); j = EXTRACT_16BITS(&lsap->lsa_un.un_rla.rla_count); TCHECK(lsap->lsa_un.un_rla.rla_link); rlp = lsap->lsa_un.un_rla.rla_link; while (j--) { TCHECK(*rlp); switch (rlp->link_type) { case RLA_TYPE_VIRTUAL: printf("\n\t Virtual Link: Neighbor Router-ID: %s, Interface Address: %s", ipaddr_string(&rlp->link_id), ipaddr_string(&rlp->link_data)); break; case RLA_TYPE_ROUTER: printf("\n\t Neighbor Router-ID: %s, Interface Address: %s", ipaddr_string(&rlp->link_id), ipaddr_string(&rlp->link_data)); break; case RLA_TYPE_TRANSIT: printf("\n\t Neighbor Network-ID: %s, Interface Address: %s", ipaddr_string(&rlp->link_id), ipaddr_string(&rlp->link_data)); break; case RLA_TYPE_STUB: printf("\n\t Stub Network: %s, Mask: %s", ipaddr_string(&rlp->link_id), ipaddr_string(&rlp->link_data)); break; default: printf("\n\t Unknown Router Link Type (%u)", rlp->link_type); return (ls_end); } printf(", tos 0, metric: %d", EXTRACT_16BITS(&rlp->link_tos0metric)); tosp = (struct tos_metric *) ((sizeof rlp->link_tos0metric) + (u_char *) rlp); for (k = 0; k < (int) rlp->link_toscount; ++k, ++tosp) { TCHECK(*tosp); printf(", tos %d, metric: %d", tosp->tos_type, EXTRACT_16BITS(&tosp->tos_metric)); } rlp = (struct rlalink *)((u_char *)(rlp + 1) + ((rlp->link_toscount) * sizeof(*tosp))); } break; case LS_TYPE_NETWORK: TCHECK(lsap->lsa_un.un_nla.nla_mask); printf("\n\t Mask %s\n\t Connected Routers:", ipaddr_string(&lsap->lsa_un.un_nla.nla_mask)); ap = lsap->lsa_un.un_nla.nla_router; while ((u_char *)ap < ls_end) { TCHECK(*ap); printf("\n\t %s", ipaddr_string(ap)); ++ap; } break; case LS_TYPE_SUM_IP: TCHECK(lsap->lsa_un.un_nla.nla_mask); printf("\n\t Mask %s", ipaddr_string(&lsap->lsa_un.un_sla.sla_mask)); TCHECK(lsap->lsa_un.un_sla.sla_tosmetric); lp = lsap->lsa_un.un_sla.sla_tosmetric; /* suppress tos if its not supported */ if(!((lsap->ls_hdr.ls_options)&OSPF_OPTION_T)) { printf(", metric: %u", EXTRACT_32BITS(lp)&SLA_MASK_METRIC); break; } while ((u_char *)lp < ls_end) { register u_int32_t ul; TCHECK(*lp); ul = EXTRACT_32BITS(lp); printf(", tos %d metric %d", (ul & SLA_MASK_TOS) >> SLA_SHIFT_TOS, ul & SLA_MASK_METRIC); ++lp; } break; case LS_TYPE_SUM_ABR: TCHECK(lsap->lsa_un.un_sla.sla_tosmetric); lp = lsap->lsa_un.un_sla.sla_tosmetric; /* suppress tos if its not supported */ if(!((lsap->ls_hdr.ls_options)&OSPF_OPTION_T)) { printf(", metric: %u", EXTRACT_32BITS(lp)&SLA_MASK_METRIC); break; } while ((u_char *)lp < ls_end) { register u_int32_t ul; TCHECK(*lp); ul = EXTRACT_32BITS(lp); printf(", tos %d metric %d", (ul & SLA_MASK_TOS) >> SLA_SHIFT_TOS, ul & SLA_MASK_METRIC); ++lp; } break; case LS_TYPE_ASE: case LS_TYPE_NSSA: /* fall through - those LSAs share the same format */ TCHECK(lsap->lsa_un.un_nla.nla_mask); printf("\n\t Mask %s", ipaddr_string(&lsap->lsa_un.un_asla.asla_mask)); TCHECK(lsap->lsa_un.un_sla.sla_tosmetric); almp = lsap->lsa_un.un_asla.asla_metric; while ((u_char *)almp < ls_end) { register u_int32_t ul; TCHECK(almp->asla_tosmetric); ul = EXTRACT_32BITS(&almp->asla_tosmetric); printf(", type %d, tos %d metric:", (ul & ASLA_FLAG_EXTERNAL) ? 2 : 1, (ul & ASLA_MASK_TOS) >> ASLA_SHIFT_TOS); if ((ul & ASLA_MASK_METRIC)==0xffffff) printf(" infinite"); else printf(" %d", (ul & ASLA_MASK_METRIC)); TCHECK(almp->asla_forward); if (almp->asla_forward.s_addr) { printf(", forward %s", ipaddr_string(&almp->asla_forward)); } TCHECK(almp->asla_tag); if (almp->asla_tag.s_addr) { printf(", tag %s", ipaddr_string(&almp->asla_tag)); } ++almp; } break; case LS_TYPE_GROUP: /* Multicast extensions as of 23 July 1991 */ mcp = lsap->lsa_un.un_mcla; while ((u_char *)mcp < ls_end) { TCHECK(mcp->mcla_vid); switch (EXTRACT_32BITS(&mcp->mcla_vtype)) { case MCLA_VERTEX_ROUTER: printf("\n\t Router Router-ID %s", ipaddr_string(&mcp->mcla_vid)); break; case MCLA_VERTEX_NETWORK: printf("\n\t Network Designated Router %s", ipaddr_string(&mcp->mcla_vid)); break; default: printf("\n\t unknown VertexType (%u)", EXTRACT_32BITS(&mcp->mcla_vtype)); break; } ++mcp; } break; case LS_TYPE_OPAQUE_LL: /* fall through */ case LS_TYPE_OPAQUE_AL: case LS_TYPE_OPAQUE_DW: switch (*(&lsap->ls_hdr.un_lsa_id.opaque_field.opaque_type)) { case LS_OPAQUE_TYPE_RI: tptr = (u_int8_t *)(&lsap->lsa_un.un_ri_tlv.type); while (ls_length != 0) { TCHECK2(*tptr, 4); if (ls_length < 4) { printf("\n\t Remaining LS length %u < 4", ls_length); return(ls_end); } tlv_type = EXTRACT_16BITS(tptr); tlv_length = EXTRACT_16BITS(tptr+2); tptr+=4; ls_length-=4; printf("\n\t %s TLV (%u), length: %u, value: ", tok2str(lsa_opaque_ri_tlv_values,"unknown",tlv_type), tlv_type, tlv_length); if (tlv_length > ls_length) { printf("\n\t Bogus length %u > %u", tlv_length, ls_length); return(ls_end); } ls_length-=tlv_length; TCHECK2(*tptr, tlv_length); switch(tlv_type) { case LS_OPAQUE_RI_TLV_CAP: if (tlv_length != 4) { printf("\n\t Bogus length %u != 4", tlv_length); return(ls_end); } printf("Capabilities: %s", bittok2str(lsa_opaque_ri_tlv_cap_values, "Unknown", EXTRACT_32BITS(tptr))); break; default: if (vflag <= 1) { if(!print_unknown_data(tptr,"\n\t ",tlv_length)) return(ls_end); } break; } tptr+=tlv_length; } break; case LS_OPAQUE_TYPE_GRACE: tptr = (u_int8_t *)(&lsap->lsa_un.un_grace_tlv.type); while (ls_length != 0) { TCHECK2(*tptr, 4); if (ls_length < 4) { printf("\n\t Remaining LS length %u < 4", ls_length); return(ls_end); } tlv_type = EXTRACT_16BITS(tptr); tlv_length = EXTRACT_16BITS(tptr+2); tptr+=4; ls_length-=4; printf("\n\t %s TLV (%u), length: %u, value: ", tok2str(lsa_opaque_grace_tlv_values,"unknown",tlv_type), tlv_type, tlv_length); if (tlv_length > ls_length) { printf("\n\t Bogus length %u > %u", tlv_length, ls_length); return(ls_end); } ls_length-=tlv_length; TCHECK2(*tptr, tlv_length); switch(tlv_type) { case LS_OPAQUE_GRACE_TLV_PERIOD: if (tlv_length != 4) { printf("\n\t Bogus length %u != 4", tlv_length); return(ls_end); } printf("%us",EXTRACT_32BITS(tptr)); break; case LS_OPAQUE_GRACE_TLV_REASON: if (tlv_length != 1) { printf("\n\t Bogus length %u != 1", tlv_length); return(ls_end); } printf("%s (%u)", tok2str(lsa_opaque_grace_tlv_reason_values, "Unknown", *tptr), *tptr); break; case LS_OPAQUE_GRACE_TLV_INT_ADDRESS: if (tlv_length != 4) { printf("\n\t Bogus length %u != 4", tlv_length); return(ls_end); } printf("%s", ipaddr_string(tptr)); break; default: if (vflag <= 1) { if(!print_unknown_data(tptr,"\n\t ",tlv_length)) return(ls_end); } break; } tptr+=tlv_length; } break; case LS_OPAQUE_TYPE_TE: tptr = (u_int8_t *)(&lsap->lsa_un.un_te_lsa_tlv.type); while (ls_length != 0) { TCHECK2(*tptr, 4); if (ls_length < 4) { printf("\n\t Remaining LS length %u < 4", ls_length); return(ls_end); } tlv_type = EXTRACT_16BITS(tptr); tlv_length = EXTRACT_16BITS(tptr+2); tptr+=4; ls_length-=4; printf("\n\t %s TLV (%u), length: %u", tok2str(lsa_opaque_te_tlv_values,"unknown",tlv_type), tlv_type, tlv_length); if (tlv_length > ls_length) { printf("\n\t Bogus length %u > %u", tlv_length, ls_length); return(ls_end); } ls_length-=tlv_length; switch(tlv_type) { case LS_OPAQUE_TE_TLV_LINK: while (tlv_length != 0) { if (tlv_length < 4) { printf("\n\t Remaining TLV length %u < 4", tlv_length); return(ls_end); } TCHECK2(*tptr, 4); subtlv_type = EXTRACT_16BITS(tptr); subtlv_length = EXTRACT_16BITS(tptr+2); tptr+=4; tlv_length-=4; printf("\n\t %s subTLV (%u), length: %u", tok2str(lsa_opaque_te_link_tlv_subtlv_values,"unknown",subtlv_type), subtlv_type, subtlv_length); TCHECK2(*tptr, subtlv_length); switch(subtlv_type) { case LS_OPAQUE_TE_LINK_SUBTLV_ADMIN_GROUP: printf(", 0x%08x", EXTRACT_32BITS(tptr)); break; case LS_OPAQUE_TE_LINK_SUBTLV_LINK_ID: case LS_OPAQUE_TE_LINK_SUBTLV_LINK_LOCAL_REMOTE_ID: printf(", %s (0x%08x)", ipaddr_string(tptr), EXTRACT_32BITS(tptr)); if (subtlv_length == 8) /* draft-ietf-ccamp-ospf-gmpls-extensions */ printf(", %s (0x%08x)", ipaddr_string(tptr+4), EXTRACT_32BITS(tptr+4)); break; case LS_OPAQUE_TE_LINK_SUBTLV_LOCAL_IP: case LS_OPAQUE_TE_LINK_SUBTLV_REMOTE_IP: printf(", %s", ipaddr_string(tptr)); break; case LS_OPAQUE_TE_LINK_SUBTLV_MAX_BW: case LS_OPAQUE_TE_LINK_SUBTLV_MAX_RES_BW: bw.i = EXTRACT_32BITS(tptr); printf(", %.3f Mbps", bw.f*8/1000000 ); break; case LS_OPAQUE_TE_LINK_SUBTLV_UNRES_BW: for (te_class = 0; te_class < 8; te_class++) { bw.i = EXTRACT_32BITS(tptr+te_class*4); printf("\n\t\tTE-Class %u: %.3f Mbps", te_class, bw.f*8/1000000 ); } break; case LS_OPAQUE_TE_LINK_SUBTLV_BW_CONSTRAINTS: printf("\n\t\tBandwidth Constraints Model ID: %s (%u)", tok2str(diffserv_te_bc_values, "unknown", *tptr), *tptr); /* decode BCs until the subTLV ends */ for (te_class = 0; te_class < (subtlv_length-4)/4; te_class++) { bw.i = EXTRACT_32BITS(tptr+4+te_class*4); printf("\n\t\t Bandwidth constraint CT%u: %.3f Mbps", te_class, bw.f*8/1000000 ); } break; case LS_OPAQUE_TE_LINK_SUBTLV_TE_METRIC: printf(", Metric %u", EXTRACT_32BITS(tptr)); break; case LS_OPAQUE_TE_LINK_SUBTLV_LINK_PROTECTION_TYPE: printf(", %s, Priority %u", bittok2str(gmpls_link_prot_values, "none", *tptr), *(tptr+1)); break; case LS_OPAQUE_TE_LINK_SUBTLV_INTF_SW_CAP_DESCR: printf("\n\t\tInterface Switching Capability: %s", tok2str(gmpls_switch_cap_values, "Unknown", *(tptr))); printf("\n\t\tLSP Encoding: %s\n\t\tMax LSP Bandwidth:", tok2str(gmpls_encoding_values, "Unknown", *(tptr+1))); for (priority_level = 0; priority_level < 8; priority_level++) { bw.i = EXTRACT_32BITS(tptr+4+(priority_level*4)); printf("\n\t\t priority level %d: %.3f Mbps", priority_level, bw.f*8/1000000 ); } break; case LS_OPAQUE_TE_LINK_SUBTLV_LINK_TYPE: printf(", %s (%u)", tok2str(lsa_opaque_te_tlv_link_type_sub_tlv_values,"unknown",*tptr), *tptr); break; case LS_OPAQUE_TE_LINK_SUBTLV_SHARED_RISK_GROUP: count_srlg = subtlv_length / 4; if (count_srlg != 0) printf("\n\t\t Shared risk group: "); while (count_srlg > 0) { bw.i = EXTRACT_32BITS(tptr); printf("%d",bw.i); tptr+=4; count_srlg--; if (count_srlg > 0) printf(", "); } break; default: if (vflag <= 1) { if(!print_unknown_data(tptr,"\n\t\t",subtlv_length)) return(ls_end); } break; } /* in OSPF everything has to be 32-bit aligned, including TLVs */ if (subtlv_length%4 != 0) subtlv_length+=4-(subtlv_length%4); tlv_length-=subtlv_length; tptr+=subtlv_length; } break; case LS_OPAQUE_TE_TLV_ROUTER: if (tlv_length < 4) { printf("\n\t TLV length %u < 4", tlv_length); return(ls_end); } TCHECK2(*tptr, 4); printf(", %s", ipaddr_string(tptr)); break; default: if (vflag <= 1) { if(!print_unknown_data(tptr,"\n\t ",tlv_length)) return(ls_end); } break; } tptr+=tlv_length; } break; } break; default: if (vflag <= 1) { if(!print_unknown_data((u_int8_t *)lsap->lsa_un.un_unknown, "\n\t ", ls_length)) return(ls_end); } break; } /* do we want to see an additionally hexdump ? */ if (vflag> 1) if(!print_unknown_data((u_int8_t *)lsap->lsa_un.un_unknown, "\n\t ", ls_length)) { return(ls_end); } return (ls_end); trunc: return (NULL); } static int ospf_decode_v2(register const struct ospfhdr *op, register const u_char *dataend) { register const struct in_addr *ap; register const struct lsr *lsrp; register const struct lsa_hdr *lshp; register const struct lsa *lsap; register u_int32_t lsa_count,lsa_count_max; switch (op->ospf_type) { case OSPF_TYPE_UMD: /* * Rob Coltun's special monitoring packets; * do nothing */ break; case OSPF_TYPE_HELLO: printf("\n\tOptions: [%s]", bittok2str(ospf_option_values,"none",op->ospf_hello.hello_options)); TCHECK(op->ospf_hello.hello_deadint); printf("\n\t Hello Timer: %us, Dead Timer %us, Mask: %s, Priority: %u", EXTRACT_16BITS(&op->ospf_hello.hello_helloint), EXTRACT_32BITS(&op->ospf_hello.hello_deadint), ipaddr_string(&op->ospf_hello.hello_mask), op->ospf_hello.hello_priority); TCHECK(op->ospf_hello.hello_dr); if (op->ospf_hello.hello_dr.s_addr != 0) printf("\n\t Designated Router %s", ipaddr_string(&op->ospf_hello.hello_dr)); TCHECK(op->ospf_hello.hello_bdr); if (op->ospf_hello.hello_bdr.s_addr != 0) printf(", Backup Designated Router %s", ipaddr_string(&op->ospf_hello.hello_bdr)); ap = op->ospf_hello.hello_neighbor; if ((u_char *)ap < dataend) printf("\n\t Neighbor List:"); while ((u_char *)ap < dataend) { TCHECK(*ap); printf("\n\t %s", ipaddr_string(ap)); ++ap; } break; /* HELLO */ case OSPF_TYPE_DD: TCHECK(op->ospf_db.db_options); printf("\n\tOptions: [%s]", bittok2str(ospf_option_values,"none",op->ospf_db.db_options)); TCHECK(op->ospf_db.db_flags); printf(", DD Flags: [%s]", bittok2str(ospf_dd_flag_values,"none",op->ospf_db.db_flags)); if (vflag) { /* Print all the LS adv's */ lshp = op->ospf_db.db_lshdr; while (ospf_print_lshdr(lshp) != -1) { ++lshp; } } break; case OSPF_TYPE_LS_REQ: lsrp = op->ospf_lsr; while ((u_char *)lsrp < dataend) { TCHECK(*lsrp); printf("\n\t Advertising Router: %s, %s LSA (%u)", ipaddr_string(&lsrp->ls_router), tok2str(lsa_values,"unknown",EXTRACT_32BITS(lsrp->ls_type)), EXTRACT_32BITS(&lsrp->ls_type)); switch (EXTRACT_32BITS(lsrp->ls_type)) { /* the LSA header for opaque LSAs was slightly changed */ case LS_TYPE_OPAQUE_LL: case LS_TYPE_OPAQUE_AL: case LS_TYPE_OPAQUE_DW: printf(", Opaque-Type: %s LSA (%u), Opaque-ID: %u", tok2str(lsa_opaque_values, "unknown",lsrp->un_ls_stateid.opaque_field.opaque_type), lsrp->un_ls_stateid.opaque_field.opaque_type, EXTRACT_24BITS(&lsrp->un_ls_stateid.opaque_field.opaque_id)); break; default: printf(", LSA-ID: %s", ipaddr_string(&lsrp->un_ls_stateid.ls_stateid)); break; } ++lsrp; } break; case OSPF_TYPE_LS_UPDATE: lsap = op->ospf_lsu.lsu_lsa; TCHECK(op->ospf_lsu.lsu_count); lsa_count_max = EXTRACT_32BITS(&op->ospf_lsu.lsu_count); printf(", %d LSA%s",lsa_count_max, lsa_count_max > 1 ? "s" : ""); for (lsa_count=1;lsa_count <= lsa_count_max;lsa_count++) { printf("\n\t LSA #%u",lsa_count); lsap = (const struct lsa *)ospf_print_lsa(lsap); if (lsap == NULL) goto trunc; } break; case OSPF_TYPE_LS_ACK: lshp = op->ospf_lsa.lsa_lshdr; while (ospf_print_lshdr(lshp) != -1) { ++lshp; } break; default: printf("v2 type (%d)", op->ospf_type); break; } return (0); trunc: return (1); } void ospf_print(register const u_char *bp, register u_int length, const u_char *bp2 _U_) { register const struct ospfhdr *op; register const u_char *dataend; register const char *cp; op = (struct ospfhdr *)bp; /* XXX Before we do anything else, strip off the MD5 trailer */ TCHECK(op->ospf_authtype); if (EXTRACT_16BITS(&op->ospf_authtype) == OSPF_AUTH_MD5) { length -= OSPF_AUTH_MD5_LEN; snapend -= OSPF_AUTH_MD5_LEN; } /* If the type is valid translate it, or just print the type */ /* value. If it's not valid, say so and return */ TCHECK(op->ospf_type); cp = tok2str(type2str, "unknown LS-type", op->ospf_type); printf("OSPFv%u, %s, length: %u", op->ospf_version, cp, length); if (*cp == 'u') return; if(!vflag) /* non verbose - so lets bail out here */ return; TCHECK(op->ospf_len); if (length != EXTRACT_16BITS(&op->ospf_len)) { printf(" [len %d]", EXTRACT_16BITS(&op->ospf_len)); return; } dataend = bp + length; TCHECK(op->ospf_routerid); printf("\n\tRouter-ID: %s", ipaddr_string(&op->ospf_routerid)); TCHECK(op->ospf_areaid); if (op->ospf_areaid.s_addr != 0) printf(", Area %s", ipaddr_string(&op->ospf_areaid)); else printf(", Backbone Area"); if (vflag) { /* Print authentication data (should we really do this?) */ TCHECK2(op->ospf_authdata[0], sizeof(op->ospf_authdata)); printf(", Authentication Type: %s (%u)", tok2str(ospf_authtype_values,"unknown",EXTRACT_16BITS(&op->ospf_authtype)), EXTRACT_16BITS(&op->ospf_authtype)); switch (EXTRACT_16BITS(&op->ospf_authtype)) { case OSPF_AUTH_NONE: break; case OSPF_AUTH_SIMPLE: printf("\n\tSimple text password: "); safeputs(op->ospf_authdata, OSPF_AUTH_SIMPLE_LEN); break; case OSPF_AUTH_MD5: printf("\n\tKey-ID: %u, Auth-Length: %u, Crypto Sequence Number: 0x%08x", *((op->ospf_authdata)+2), *((op->ospf_authdata)+3), EXTRACT_32BITS((op->ospf_authdata)+4)); break; default: return; } } /* Do rest according to version. */ switch (op->ospf_version) { case 2: /* ospf version 2 */ if (ospf_decode_v2(op, dataend)) goto trunc; break; default: printf(" ospf [version %d]", op->ospf_version); break; } /* end switch on version */ return; trunc: fputs(tstr, stdout); } tcpdump-3.9.8/./oui.h0000644000026300017500000000636510230334770012444 0ustar mcrmcr/* @(#) $Header: /tcpdump/master/tcpdump/oui.h,v 1.3.2.1 2005/04/17 01:20:56 guy Exp $ (LBL) */ /* * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that: (1) source code * distributions retain the above copyright notice and this paragraph * in its entirety, and (2) distributions including binary code include * the above copyright notice and this paragraph in its entirety in * the documentation or other materials provided with the distribution. * THIS SOFTWARE IS PROVIDED ``AS IS'' AND * WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT * LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * FOR A PARTICULAR PURPOSE. * * Original code by Hannes Gredler (hannes@juniper.net) */ extern struct tok oui_values[]; extern struct tok smi_values[]; #define OUI_ENCAP_ETHER 0x000000 /* encapsulated Ethernet */ #define OUI_CISCO 0x00000c /* Cisco protocols */ #define OUI_NORTEL 0x000081 /* Nortel SONMP */ #define OUI_CISCO_90 0x0000f8 /* Cisco bridging */ #define OUI_RFC2684 0x0080c2 /* RFC 2427/2684 bridged Ethernet */ #define OUI_ATM_FORUM 0x00A03E /* ATM Forum */ #define OUI_CABLE_BPDU 0x00E02F /* DOCSIS spanning tree BPDU */ #define OUI_APPLETALK 0x080007 /* Appletalk */ #define OUI_JUNIPER 0x009069 /* Juniper */ #define OUI_HP 0x080009 /* Hewlett-Packard */ /* * These are SMI Network Management Private Enterprise Codes for * organizations; see * * http://www.iana.org/assignments/enterprise-numbers * * for a list. * * List taken from Ethereal's epan/sminmpec.h. */ #define SMI_IETF 0 /* reserved - used by the IETF in L2TP? */ #define SMI_ACC 5 #define SMI_CISCO 9 #define SMI_HEWLETT_PACKARD 11 #define SMI_SUN_MICROSYSTEMS 42 #define SMI_MERIT 61 #define SMI_SHIVA 166 #define SMI_ERICSSON 193 #define SMI_CISCO_VPN5000 255 #define SMI_LIVINGSTON 307 #define SMI_MICROSOFT 311 #define SMI_3COM 429 #define SMI_ASCEND 529 #define SMI_BAY 1584 #define SMI_FOUNDRY 1991 #define SMI_VERSANET 2180 #define SMI_REDBACK 2352 #define SMI_JUNIPER 2636 #define SMI_APTIS 2637 #define SMI_CISCO_VPN3000 3076 #define SMI_COSINE 3085 #define SMI_SHASTA 3199 #define SMI_NETSCREEN 3224 #define SMI_NOMADIX 3309 #define SMI_SIEMENS 4329 #define SMI_CABLELABS 4491 #define SMI_UNISPHERE 4874 #define SMI_CISCO_BBSM 5263 #define SMI_THE3GPP2 5535 #define SMI_IP_UNPLUGGED 5925 #define SMI_ISSANNI 5948 #define SMI_QUINTUM 6618 #define SMI_INTERLINK 6728 #define SMI_COLUBRIS 8744 #define SMI_COLUMBIA_UNIVERSITY 11862 #define SMI_THE3GPP 10415 #define SMI_GEMTEK_SYSTEMS 10529 #define SMI_WIFI_ALLIANCE 14122 tcpdump-3.9.8/./appletalk.h0000644000026300017500000001025310044670336013620 0ustar mcrmcr/* * Copyright (c) 1988, 1989, 1990, 1993, 1994, 1995, 1996 * The Regents of the University of California. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that: (1) source code distributions * retain the above copyright notice and this paragraph in its entirety, (2) * distributions including binary code include the above copyright notice and * this paragraph in its entirety in the documentation or other materials * provided with the distribution, and (3) all advertising materials mentioning * features or use of this software display the following acknowledgement: * ``This product includes software developed by the University of California, * Lawrence Berkeley Laboratory and its contributors.'' Neither the name of * the University nor the names of its contributors may be used to endorse * or promote products derived from this software without specific prior * written permission. * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * * AppleTalk protocol formats (courtesy Bill Croft of Stanford/SUMEX). * * @(#) $Header: /tcpdump/master/tcpdump/appletalk.h,v 1.16 2004/05/01 09:41:50 hannes Exp $ (LBL) */ struct LAP { u_int8_t dst; u_int8_t src; u_int8_t type; }; #define lapShortDDP 1 /* short DDP type */ #define lapDDP 2 /* DDP type */ #define lapKLAP 'K' /* Kinetics KLAP type */ /* Datagram Delivery Protocol */ struct atDDP { u_int16_t length; u_int16_t checksum; u_int16_t dstNet; u_int16_t srcNet; u_int8_t dstNode; u_int8_t srcNode; u_int8_t dstSkt; u_int8_t srcSkt; u_int8_t type; }; struct atShortDDP { u_int16_t length; u_int8_t dstSkt; u_int8_t srcSkt; u_int8_t type; }; #define ddpMaxWKS 0x7F #define ddpMaxData 586 #define ddpLengthMask 0x3FF #define ddpHopShift 10 #define ddpSize 13 /* size of DDP header (avoid struct padding) */ #define ddpSSize 5 #define ddpWKS 128 /* boundary of DDP well known sockets */ #define ddpRTMP 1 /* RTMP type */ #define ddpRTMPrequest 5 /* RTMP request type */ #define ddpNBP 2 /* NBP type */ #define ddpATP 3 /* ATP type */ #define ddpECHO 4 /* ECHO type */ #define ddpIP 22 /* IP type */ #define ddpARP 23 /* ARP type */ #define ddpEIGRP 88 /* EIGRP over Appletalk */ #define ddpKLAP 0x4b /* Kinetics KLAP type */ /* AppleTalk Transaction Protocol */ struct atATP { u_int8_t control; u_int8_t bitmap; u_int16_t transID; int32_t userData; }; #define atpReqCode 0x40 #define atpRspCode 0x80 #define atpRelCode 0xC0 #define atpXO 0x20 #define atpEOM 0x10 #define atpSTS 0x08 #define atpFlagMask 0x3F #define atpControlMask 0xF8 #define atpMaxNum 8 #define atpMaxData 578 /* AppleTalk Echo Protocol */ struct atEcho { u_int8_t echoFunction; u_int8_t *echoData; }; #define echoSkt 4 /* the echoer socket */ #define echoSize 1 /* size of echo header */ #define echoRequest 1 /* echo request */ #define echoReply 2 /* echo request */ /* Name Binding Protocol */ struct atNBP { u_int8_t control; u_int8_t id; }; struct atNBPtuple { u_int16_t net; u_int8_t node; u_int8_t skt; u_int8_t enumerator; }; #define nbpBrRq 0x10 #define nbpLkUp 0x20 #define nbpLkUpReply 0x30 #define nbpNIS 2 #define nbpTupleMax 15 #define nbpHeaderSize 2 #define nbpTupleSize 5 #define nbpSkt 2 /* NIS */ /* Routing Table Maint. Protocol */ #define rtmpSkt 1 /* number of RTMP socket */ #define rtmpSize 4 /* minimum size */ #define rtmpTupleSize 3 /* Zone Information Protocol */ struct zipHeader { u_int8_t command; u_int8_t netcount; }; #define zipHeaderSize 2 #define zipQuery 1 #define zipReply 2 #define zipTakedown 3 #define zipBringup 4 #define ddpZIP 6 #define zipSkt 6 #define GetMyZone 7 #define GetZoneList 8 /* * UDP port range used for ddp-in-udp encapsulation is 16512-16639 * for client sockets (128-255) and 200-327 for server sockets * (0-127). We also try to recognize the pre-April 88 server * socket range of 768-895. */ #define atalk_port(p) \ (((unsigned)((p) - 16512) < 128) || \ ((unsigned)((p) - 200) < 128) || \ ((unsigned)((p) - 768) < 128)) tcpdump-3.9.8/./lane.h0000644000026300017500000000216107575562662012602 0ustar mcrmcr/* * Marko Kiiskila carnil@cs.tut.fi * * Tampere University of Technology - Telecommunications Laboratory * * Permission to use, copy, modify and distribute this * software and its documentation is hereby granted, * provided that both the copyright notice and this * permission notice appear in all copies of the software, * derivative works or modified versions, and any portions * thereof, that both notices appear in supporting * documentation, and that the use of this software is * acknowledged in any publications resulting from using * the software. * * TUT ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" * CONDITION AND DISCLAIMS ANY LIABILITY OF ANY KIND FOR * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS * SOFTWARE. * */ /* $Id: lane.h,v 1.7 2002/12/11 07:13:54 guy Exp $ */ #ifndef ETHER_ADDR_LEN #define ETHER_ADDR_LEN 6 #endif struct lecdatahdr_8023 { u_int16_t le_header; u_int8_t h_dest[ETHER_ADDR_LEN]; u_int8_t h_source[ETHER_ADDR_LEN]; u_int16_t h_type; }; struct lane_controlhdr { u_int16_t lec_header; u_int8_t lec_proto; u_int8_t lec_vers; u_int16_t lec_opcode; }; tcpdump-3.9.8/./gmpls.c0000644000026300017500000001330410243032662012753 0ustar mcrmcr/* * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that: (1) source code * distributions retain the above copyright notice and this paragraph * in its entirety, and (2) distributions including binary code include * the above copyright notice and this paragraph in its entirety in * the documentation or other materials provided with the distribution. * THIS SOFTWARE IS PROVIDED ``AS IS'' AND * WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT * LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * FOR A PARTICULAR PURPOSE. * * Original code by Hannes Gredler (hannes@juniper.net) */ #ifndef lint static const char rcsid[] _U_ = "@(#) $Header: /tcpdump/master/tcpdump/gmpls.c,v 1.5.2.1 2005/05/19 06:44:02 guy Exp $ (LBL)"; #endif #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include "interface.h" /* rfc3471 */ struct tok gmpls_link_prot_values[] = { { 0x01, "Extra Traffic"}, { 0x02, "Unprotected"}, { 0x04, "Shared"}, { 0x08, "Dedicated 1:1"}, { 0x10, "Dedicated 1+1"}, { 0x20, "Enhanced"}, { 0x40, "Reserved"}, { 0x80, "Reserved"}, { 0, NULL } }; /* rfc3471 */ struct tok gmpls_switch_cap_values[] = { { 1, "Packet-Switch Capable-1"}, { 2, "Packet-Switch Capable-2"}, { 3, "Packet-Switch Capable-3"}, { 4, "Packet-Switch Capable-4"}, { 51, "Layer-2 Switch Capable"}, { 100, "Time-Division-Multiplex"}, { 150, "Lambda-Switch Capable"}, { 200, "Fiber-Switch Capable"}, { 0, NULL } }; /* rfc3471 */ struct tok gmpls_encoding_values[] = { { 1, "Packet"}, { 2, "Ethernet V2/DIX"}, { 3, "ANSI/ETSI PDH"}, { 4, "Reserved"}, { 5, "SDH ITU-T G.707/SONET ANSI T1.105"}, { 6, "Reserved"}, { 7, "Digital Wrapper"}, { 8, "Lambda (photonic)"}, { 9, "Fiber"}, { 10, "Reserved"}, { 11, "FiberChannel"}, { 0, NULL } }; /* rfc3471 */ struct tok gmpls_payload_values[] = { { 0, "Unknown"}, { 1, "Reserved"}, { 2, "Reserved"}, { 3, "Reserved"}, { 4, "Reserved"}, { 5, "Asynchronous mapping of E4"}, { 6, "Asynchronous mapping of DS3/T3"}, { 7, "Asynchronous mapping of E3"}, { 8, "Bit synchronous mapping of E3"}, { 9, "Byte synchronous mapping of E3"}, { 10, "Asynchronous mapping of DS2/T2"}, { 11, "Bit synchronous mapping of DS2/T2"}, { 12, "Reserved"}, { 13, "Asynchronous mapping of E1"}, { 14, "Byte synchronous mapping of E1"}, { 15, "Byte synchronous mapping of 31 * DS0"}, { 16, "Asynchronous mapping of DS1/T1"}, { 17, "Bit synchronous mapping of DS1/T1"}, { 18, "Byte synchronous mapping of DS1/T1"}, { 19, "VC-11 in VC-12"}, { 20, "Reserved"}, { 21, "Reserved"}, { 22, "DS1 SF Asynchronous"}, { 23, "DS1 ESF Asynchronous"}, { 24, "DS3 M23 Asynchronous"}, { 25, "DS3 C-Bit Parity Asynchronous"}, { 26, "VT/LOVC"}, { 27, "STS SPE/HOVC"}, { 28, "POS - No Scrambling, 16 bit CRC"}, { 29, "POS - No Scrambling, 32 bit CRC"}, { 30, "POS - Scrambling, 16 bit CRC"}, { 31, "POS - Scrambling, 32 bit CRC"}, { 32, "ATM mapping"}, { 33, "Ethernet PHY"}, { 34, "SONET/SDH"}, { 35, "Reserved (SONET deprecated)"}, { 36, "Digital Wrapper"}, { 37, "Lambda"}, { 38, "ANSI/ETSI PDH"}, { 39, "Reserved"}, { 40, "Link Access Protocol SDH (X.85 and X.86)"}, { 41, "FDDI"}, { 42, "DQDB (ETSI ETS 300 216)"}, { 43, "FiberChannel-3 (Services)"}, { 44, "HDLC"}, { 45, "Ethernet V2/DIX (only)"}, { 46, "Ethernet 802.3 (only)"}, /* draft-ietf-ccamp-gmpls-g709-04.txt */ { 47, "G.709 ODUj"}, { 48, "G.709 OTUk(v)"}, { 49, "CBR/CBRa"}, { 50, "CBRb"}, { 51, "BSOT"}, { 52, "BSNT"}, { 53, "IP/PPP (GFP)"}, { 54, "Ethernet MAC (framed GFP)"}, { 55, "Ethernet PHY (transparent GFP)"}, { 56, "ESCON"}, { 57, "FICON"}, { 58, "Fiber Channel"}, { 0, NULL } }; /* * Link Type values used by LMP Service Discovery (specifically, the Client * Port Service Attributes Object). See UNI 1.0 section 9.4.2 for details. */ struct tok lmp_sd_service_config_cpsa_link_type_values[] = { { 5, "SDH ITU-T G.707"}, { 6, "SONET ANSI T1.105"}, { 0, NULL} }; /* * Signal Type values for SDH links used by LMP Service Discovery (specifically, * the Client Port Service Attributes Object). See UNI 1.0 section 9.4.2 for * details. */ struct tok lmp_sd_service_config_cpsa_signal_type_sdh_values[] = { { 5, "VC-3"}, { 6, "VC-4"}, { 7, "STM-0"}, { 8, "STM-1"}, { 9, "STM-4"}, { 10, "STM-16"}, { 11, "STM-64"}, { 12, "STM-256"}, { 0, NULL} }; /* * Signal Type values for SONET links used by LMP Service Discovery (specifically, * the Client Port Service Attributes Object). See UNI 1.0 section 9.4.2 for * details. */ struct tok lmp_sd_service_config_cpsa_signal_type_sonet_values[] = { { 5, "STS-1 SPE"}, { 6, "STS-3c SPE"}, { 7, "STS-1"}, { 8, "STM-3"}, { 9, "STM-12"}, { 10, "STM-48"}, { 11, "STM-192"}, { 12, "STM-768"}, { 0, NULL} }; #define DIFFSERV_BC_MODEL_RDM 0 /* draft-ietf-tewg-diff-te-proto-07 */ #define DIFFSERV_BC_MODEL_MAM 1 /* draft-ietf-tewg-diff-te-proto-07 */ #define DIFFSERV_BC_MODEL_EXTD_MAM 254 /* experimental */ struct tok diffserv_te_bc_values[] = { { DIFFSERV_BC_MODEL_RDM, "Russian dolls"}, { DIFFSERV_BC_MODEL_MAM, "Maximum allocation"}, { DIFFSERV_BC_MODEL_EXTD_MAM, "Maximum allocation with E-LSP support"}, { 0, NULL } }; tcpdump-3.9.8/./print-pflog.c0000644000026300017500000001101210676336432014100 0ustar mcrmcr/* * Copyright (c) 1990, 1991, 1993, 1994, 1995, 1996 * The Regents of the University of California. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that: (1) source code distributions * retain the above copyright notice and this paragraph in its entirety, (2) * distributions including binary code include the above copyright notice and * this paragraph in its entirety in the documentation or other materials * provided with the distribution, and (3) all advertising materials mentioning * features or use of this software display the following acknowledgement: * ``This product includes software developed by the University of California, * Lawrence Berkeley Laboratory and its contributors.'' Neither the name of * the University nor the names of its contributors may be used to endorse * or promote products derived from this software without specific prior * written permission. * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. */ #ifndef lint static const char rcsid[] _U_ = "@(#) $Header: /tcpdump/master/tcpdump/print-pflog.c,v 1.13.2.4 2007/09/13 17:18:10 gianluca Exp $ (LBL)"; #endif #ifdef HAVE_CONFIG_H #include "config.h" #endif #ifndef HAVE_NET_PFVAR_H #error "No pf headers available" #endif #include #ifndef WIN32 #include #endif #include #include #include #include #include #include #include "interface.h" #include "addrtoname.h" static struct tok pf_reasons[] = { { 0, "0(match)" }, { 1, "1(bad-offset)" }, { 2, "2(fragment)" }, { 3, "3(short)" }, { 4, "4(normalize)" }, { 5, "5(memory)" }, { 6, "6(bad-timestamp)" }, { 7, "7(congestion)" }, { 8, "8(ip-option)" }, { 9, "9(proto-cksum)" }, { 10, "10(state-mismatch)" }, { 11, "11(state-insert)" }, { 12, "12(state-limit)" }, { 13, "13(src-limit)" }, { 14, "14(synproxy)" }, { 0, NULL } }; static struct tok pf_actions[] = { { PF_PASS, "pass" }, { PF_DROP, "block" }, { PF_SCRUB, "scrub" }, { PF_NAT, "nat" }, { PF_NONAT, "nat" }, { PF_BINAT, "binat" }, { PF_NOBINAT, "binat" }, { PF_RDR, "rdr" }, { PF_NORDR, "rdr" }, { PF_SYNPROXY_DROP, "synproxy-drop" }, { 0, NULL } }; static struct tok pf_directions[] = { { PF_INOUT, "in/out" }, { PF_IN, "in" }, { PF_OUT, "out" }, { 0, NULL } }; /* For reading capture files on other systems */ #define OPENBSD_AF_INET 2 #define OPENBSD_AF_INET6 24 static void pflog_print(const struct pfloghdr *hdr) { u_int32_t rulenr, subrulenr; rulenr = ntohl(hdr->rulenr); subrulenr = ntohl(hdr->subrulenr); if (subrulenr == (u_int32_t)-1) printf("rule %u/", rulenr); else printf("rule %u.%s.%u/", rulenr, hdr->ruleset, subrulenr); printf("%s: %s %s on %s: ", tok2str(pf_reasons, "unkn(%u)", hdr->reason), tok2str(pf_actions, "unkn(%u)", hdr->action), tok2str(pf_directions, "unkn(%u)", hdr->dir), hdr->ifname); } u_int pflog_if_print(const struct pcap_pkthdr *h, register const u_char *p) { u_int length = h->len; u_int hdrlen; u_int caplen = h->caplen; const struct pfloghdr *hdr; u_int8_t af; /* check length */ if (caplen < sizeof(u_int8_t)) { printf("[|pflog]"); return (caplen); } #define MIN_PFLOG_HDRLEN 45 hdr = (struct pfloghdr *)p; if (hdr->length < MIN_PFLOG_HDRLEN) { printf("[pflog: invalid header length!]"); return (hdr->length); /* XXX: not really */ } hdrlen = BPF_WORDALIGN(hdr->length); if (caplen < hdrlen) { printf("[|pflog]"); return (hdrlen); /* XXX: true? */ } /* print what we know */ hdr = (struct pfloghdr *)p; TCHECK(*hdr); if (eflag) pflog_print(hdr); /* skip to the real packet */ af = hdr->af; length -= hdrlen; caplen -= hdrlen; p += hdrlen; switch (af) { case AF_INET: #if OPENBSD_AF_INET != AF_INET case OPENBSD_AF_INET: /* XXX: read pcap files */ #endif ip_print(gndo, p, length); break; #ifdef INET6 case AF_INET6: #if OPENBSD_AF_INET6 != AF_INET6 case OPENBSD_AF_INET6: /* XXX: read pcap files */ #endif ip6_print(p, length); break; #endif default: /* address family not handled, print raw packet */ if (!eflag) pflog_print(hdr); if (!suppress_default_print) default_print(p, caplen); } return (hdrlen); trunc: printf("[|pflog]"); return (hdrlen); } /* * Local Variables: * c-style: whitesmith * c-basic-offset: 8 * End: */ tcpdump-3.9.8/./print-llc.c0000644000026300017500000003265210634111731013543 0ustar mcrmcr/* * Copyright (c) 1992, 1993, 1994, 1995, 1996, 1997 * The Regents of the University of California. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that: (1) source code distributions * retain the above copyright notice and this paragraph in its entirety, (2) * distributions including binary code include the above copyright notice and * this paragraph in its entirety in the documentation or other materials * provided with the distribution, and (3) all advertising materials mentioning * features or use of this software display the following acknowledgement: * ``This product includes software developed by the University of California, * Lawrence Berkeley Laboratory and its contributors.'' Neither the name of * the University nor the names of its contributors may be used to endorse * or promote products derived from this software without specific prior * written permission. * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * * Code by Matt Thomas, Digital Equipment Corporation * with an awful lot of hacking by Jeffrey Mogul, DECWRL */ #ifndef lint static const char rcsid[] _U_ = "@(#) $Header: /tcpdump/master/tcpdump/print-llc.c,v 1.61.2.10 2007/02/08 07:07:51 guy Exp $"; #endif #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include #include "interface.h" #include "addrtoname.h" #include "extract.h" /* must come after interface.h */ #include "llc.h" #include "ethertype.h" #include "oui.h" static struct tok llc_values[] = { { LLCSAP_NULL, "Null" }, { LLCSAP_GLOBAL, "Global" }, { LLCSAP_8021B_I, "802.1B I" }, { LLCSAP_8021B_G, "802.1B G" }, { LLCSAP_IP, "IP" }, { LLCSAP_SNA, "SNA" }, { LLCSAP_PROWAYNM, "ProWay NM" }, { LLCSAP_8021D, "STP" }, { LLCSAP_RS511, "RS511" }, { LLCSAP_ISO8208, "ISO8208" }, { LLCSAP_PROWAY, "ProWay" }, { LLCSAP_SNAP, "SNAP" }, { LLCSAP_IPX, "IPX" }, { LLCSAP_NETBEUI, "NetBeui" }, { LLCSAP_ISONS, "OSI" }, { 0, NULL }, }; static struct tok llc_cmd_values[] = { { LLC_UI, "ui" }, { LLC_TEST, "test" }, { LLC_XID, "xid" }, { LLC_UA, "ua" }, { LLC_DISC, "disc" }, { LLC_DM, "dm" }, { LLC_SABME, "sabme" }, { LLC_FRMR, "frmr" }, { 0, NULL } }; static const struct tok llc_flag_values[] = { { 0, "Command" }, { LLC_GSAP, "Response" }, { LLC_U_POLL, "Poll" }, { LLC_GSAP|LLC_U_POLL, "Final" }, { LLC_IS_POLL, "Poll" }, { LLC_GSAP|LLC_IS_POLL, "Final" }, { 0, NULL } }; static const struct tok llc_ig_flag_values[] = { { 0, "Individual" }, { LLC_IG, "Group" }, { 0, NULL } }; static const struct tok llc_supervisory_values[] = { { 0, "Receiver Ready" }, { 1, "Receiver not Ready" }, { 2, "Reject" }, { 0, NULL } }; static const struct tok cisco_values[] = { { PID_CISCO_CDP, "CDP" }, { PID_CISCO_VTP, "VTP" }, { PID_CISCO_DTP, "DTP" }, { 0, NULL } }; static const struct tok bridged_values[] = { { PID_RFC2684_ETH_FCS, "Ethernet + FCS" }, { PID_RFC2684_ETH_NOFCS, "Ethernet w/o FCS" }, { PID_RFC2684_802_4_FCS, "802.4 + FCS" }, { PID_RFC2684_802_4_NOFCS, "802.4 w/o FCS" }, { PID_RFC2684_802_5_FCS, "Token Ring + FCS" }, { PID_RFC2684_802_5_NOFCS, "Token Ring w/o FCS" }, { PID_RFC2684_FDDI_FCS, "FDDI + FCS" }, { PID_RFC2684_FDDI_NOFCS, "FDDI w/o FCS" }, { PID_RFC2684_802_6_FCS, "802.6 + FCS" }, { PID_RFC2684_802_6_NOFCS, "802.6 w/o FCS" }, { PID_RFC2684_BPDU, "BPDU" }, { 0, NULL }, }; static const struct tok null_values[] = { { 0, NULL } }; struct oui_tok { u_int32_t oui; const struct tok *tok; }; static const struct oui_tok oui_to_tok[] = { { OUI_ENCAP_ETHER, ethertype_values }, { OUI_CISCO_90, ethertype_values }, /* uses some Ethertype values */ { OUI_APPLETALK, ethertype_values }, /* uses some Ethertype values */ { OUI_CISCO, cisco_values }, { OUI_RFC2684, bridged_values }, /* bridged, RFC 2427 FR or RFC 2864 ATM */ { 0, NULL } }; /* * Returns non-zero IFF it succeeds in printing the header */ int llc_print(const u_char *p, u_int length, u_int caplen, const u_char *esrc, const u_char *edst, u_short *extracted_ethertype) { u_int8_t dsap_field, dsap, ssap_field, ssap; u_int16_t control; int is_u; register int ret; *extracted_ethertype = 0; if (caplen < 3) { (void)printf("[|llc]"); default_print((u_char *)p, caplen); return(0); } dsap_field = *p; ssap_field = *(p + 1); /* * OK, what type of LLC frame is this? The length * of the control field depends on that - I frames * have a two-byte control field, and U frames have * a one-byte control field. */ control = *(p + 2); if ((control & LLC_U_FMT) == LLC_U_FMT) { /* * U frame. */ is_u = 1; } else { /* * The control field in I and S frames is * 2 bytes... */ if (caplen < 4) { (void)printf("[|llc]"); default_print((u_char *)p, caplen); return(0); } /* * ...and is little-endian. */ control = EXTRACT_LE_16BITS(p + 2); is_u = 0; } if (ssap_field == LLCSAP_GLOBAL && dsap_field == LLCSAP_GLOBAL) { /* * This is an Ethernet_802.3 IPX frame; it has an * 802.3 header (i.e., an Ethernet header where the * type/length field is <= ETHERMTU, i.e. it's a length * field, not a type field), but has no 802.2 header - * the IPX packet starts right after the Ethernet header, * with a signature of two bytes of 0xFF (which is * LLCSAP_GLOBAL). * * (It might also have been an Ethernet_802.3 IPX at * one time, but got bridged onto another network, * such as an 802.11 network; this has appeared in at * least one capture file.) */ if (eflag) printf("IPX 802.3: "); ipx_print(p, length); return (1); } dsap = dsap_field & ~LLC_IG; ssap = ssap_field & ~LLC_GSAP; if (eflag) { printf("LLC, dsap %s (0x%02x) %s, ssap %s (0x%02x) %s", tok2str(llc_values, "Unknown", dsap), dsap, tok2str(llc_ig_flag_values, "Unknown", dsap_field & LLC_IG), tok2str(llc_values, "Unknown", ssap), ssap, tok2str(llc_flag_values, "Unknown", ssap_field & LLC_GSAP)); if (is_u) { printf(", ctrl 0x%02x: ", control); } else { printf(", ctrl 0x%04x: ", control); } } if (ssap == LLCSAP_8021D && dsap == LLCSAP_8021D && control == LLC_UI) { stp_print(p+3, length-3); return (1); } if (ssap == LLCSAP_IP && dsap == LLCSAP_IP && control == LLC_UI) { ip_print(gndo, p+4, length-4); return (1); } if (ssap == LLCSAP_IPX && dsap == LLCSAP_IPX && control == LLC_UI) { /* * This is an Ethernet_802.2 IPX frame, with an 802.3 * header and an 802.2 LLC header with the source and * destination SAPs being the IPX SAP. * * Skip DSAP, LSAP, and control field. */ if (eflag) printf("IPX 802.2: "); ipx_print(p+3, length-3); return (1); } #ifdef TCPDUMP_DO_SMB if (ssap == LLCSAP_NETBEUI && dsap == LLCSAP_NETBEUI && (!(control & LLC_S_FMT) || control == LLC_U_FMT)) { /* * we don't actually have a full netbeui parser yet, but the * smb parser can handle many smb-in-netbeui packets, which * is very useful, so we call that * * We don't call it for S frames, however, just I frames * (which are frames that don't have the low-order bit, * LLC_S_FMT, set in the first byte of the control field) * and UI frames (whose control field is just 3, LLC_U_FMT). */ /* * Skip the LLC header. */ if (is_u) { p += 3; length -= 3; caplen -= 3; } else { p += 4; length -= 4; caplen -= 4; } netbeui_print(control, p, length); return (1); } #endif if (ssap == LLCSAP_ISONS && dsap == LLCSAP_ISONS && control == LLC_UI) { isoclns_print(p + 3, length - 3, caplen - 3); return (1); } if (ssap == LLCSAP_SNAP && dsap == LLCSAP_SNAP && control == LLC_UI) { /* * XXX - what *is* the right bridge pad value here? * Does anybody ever bridge one form of LAN traffic * over a networking type that uses 802.2 LLC? */ ret = snap_print(p+3, length-3, caplen-3, extracted_ethertype, 2); if (ret) return (ret); } if (!eflag) { if (ssap == dsap) { if (esrc == NULL || edst == NULL) (void)printf("%s ", tok2str(llc_values, "Unknown DSAP 0x%02x", dsap)); else (void)printf("%s > %s %s ", etheraddr_string(esrc), etheraddr_string(edst), tok2str(llc_values, "Unknown DSAP 0x%02x", dsap)); } else { if (esrc == NULL || edst == NULL) (void)printf("%s > %s ", tok2str(llc_values, "Unknown SSAP 0x%02x", ssap), tok2str(llc_values, "Unknown DSAP 0x%02x", dsap)); else (void)printf("%s %s > %s %s ", etheraddr_string(esrc), tok2str(llc_values, "Unknown SSAP 0x%02x", ssap), etheraddr_string(edst), tok2str(llc_values, "Unknown DSAP 0x%02x", dsap)); } } if (is_u) { printf("Unnumbered, %s, Flags [%s], length %u", tok2str(llc_cmd_values, "%02x", LLC_U_CMD(control)), tok2str(llc_flag_values,"?",(ssap_field & LLC_GSAP) | (control & LLC_U_POLL)), length); p += 3; length -= 3; caplen -= 3; if ((control & ~LLC_U_POLL) == LLC_XID) { if (*p == LLC_XID_FI) { printf(": %02x %02x", p[1], p[2]); p += 3; length -= 3; caplen -= 3; } } } else { if ((control & LLC_S_FMT) == LLC_S_FMT) { (void)printf("Supervisory, %s, rcv seq %u, Flags [%s], length %u", tok2str(llc_supervisory_values,"?",LLC_S_CMD(control)), LLC_IS_NR(control), tok2str(llc_flag_values,"?",(ssap_field & LLC_GSAP) | (control & LLC_IS_POLL)), length); } else { (void)printf("Information, send seq %u, rcv seq %u, Flags [%s], length %u", LLC_I_NS(control), LLC_IS_NR(control), tok2str(llc_flag_values,"?",(ssap_field & LLC_GSAP) | (control & LLC_IS_POLL)), length); } p += 4; length -= 4; caplen -= 4; } return(1); } int snap_print(const u_char *p, u_int length, u_int caplen, u_short *extracted_ethertype, u_int bridge_pad) { u_int32_t orgcode; register u_short et; register int ret; TCHECK2(*p, 5); orgcode = EXTRACT_24BITS(p); et = EXTRACT_16BITS(p + 3); if (eflag) { const struct tok *tok = null_values; const struct oui_tok *otp; for (otp = &oui_to_tok[0]; otp->tok != NULL; otp++) { if (otp->oui == orgcode) { tok = otp->tok; break; } } (void)printf("oui %s (0x%06x), %s %s (0x%04x): ", tok2str(oui_values, "Unknown", orgcode), orgcode, (orgcode == 0x000000 ? "ethertype" : "pid"), tok2str(tok, "Unknown", et), et); } p += 5; length -= 5; caplen -= 5; switch (orgcode) { case OUI_ENCAP_ETHER: case OUI_CISCO_90: /* * This is an encapsulated Ethernet packet, * or a packet bridged by some piece of * Cisco hardware; the protocol ID is * an Ethernet protocol type. */ ret = ether_encap_print(et, p, length, caplen, extracted_ethertype); if (ret) return (ret); break; case OUI_APPLETALK: if (et == ETHERTYPE_ATALK) { /* * No, I have no idea why Apple used one * of their own OUIs, rather than * 0x000000, and an Ethernet packet * type, for Appletalk data packets, * but used 0x000000 and an Ethernet * packet type for AARP packets. */ ret = ether_encap_print(et, p, length, caplen, extracted_ethertype); if (ret) return (ret); } break; case OUI_CISCO: if (et == PID_CISCO_CDP) { cdp_print(p, length, caplen); return (1); } break; case OUI_RFC2684: switch (et) { case PID_RFC2684_ETH_FCS: case PID_RFC2684_ETH_NOFCS: /* * XXX - remove the last two bytes for * PID_RFC2684_ETH_FCS? */ /* * Skip the padding. */ TCHECK2(*p, bridge_pad); caplen -= bridge_pad; length -= bridge_pad; p += bridge_pad; /* * What remains is an Ethernet packet. */ ether_print(p, length, caplen); return (1); case PID_RFC2684_802_5_FCS: case PID_RFC2684_802_5_NOFCS: /* * XXX - remove the last two bytes for * PID_RFC2684_ETH_FCS? */ /* * Skip the padding, but not the Access * Control field. */ TCHECK2(*p, bridge_pad); caplen -= bridge_pad; length -= bridge_pad; p += bridge_pad; /* * What remains is an 802.5 Token Ring * packet. */ token_print(p, length, caplen); return (1); case PID_RFC2684_FDDI_FCS: case PID_RFC2684_FDDI_NOFCS: /* * XXX - remove the last two bytes for * PID_RFC2684_ETH_FCS? */ /* * Skip the padding. */ TCHECK2(*p, bridge_pad + 1); caplen -= bridge_pad + 1; length -= bridge_pad + 1; p += bridge_pad + 1; /* * What remains is an FDDI packet. */ fddi_print(p, length, caplen); return (1); case PID_RFC2684_BPDU: stp_print(p, length); return (1); } } return (0); trunc: (void)printf("[|snap]"); return (1); } /* * Local Variables: * c-style: whitesmith * c-basic-offset: 8 * End: */ tcpdump-3.9.8/./gmt2local.h0000644000026300017500000000247206777230376013551 0ustar mcrmcr/* * Copyright (c) 1997 * The Regents of the University of California. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that: (1) source code distributions * retain the above copyright notice and this paragraph in its entirety, (2) * distributions including binary code include the above copyright notice and * this paragraph in its entirety in the documentation or other materials * provided with the distribution, and (3) all advertising materials mentioning * features or use of this software display the following acknowledgement: * ``This product includes software developed by the University of California, * Lawrence Berkeley Laboratory and its contributors.'' Neither the name of * the University nor the names of its contributors may be used to endorse * or promote products derived from this software without specific prior * written permission. * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * * @(#) $Header: /tcpdump/master/tcpdump/gmt2local.h,v 1.2.1.1 1999/10/07 23:47:10 mcr Exp $ (LBL) */ #ifndef gmt2local_h #define gmt2local_h int32_t gmt2local(time_t); #endif tcpdump-3.9.8/./print-radius.c0000644000026300017500000010003110320053326014240 0ustar mcrmcr/* * Copyright (C) 2000 Alfredo Andres Omella. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in * the documentation and/or other materials provided with the * distribution. * 3. The names of the authors may not be used to endorse or promote * products derived from this software without specific prior * written permission. * * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. */ /* * Radius printer routines as specified on: * * RFC 2865: * "Remote Authentication Dial In User Service (RADIUS)" * * RFC 2866: * "RADIUS Accounting" * * RFC 2867: * "RADIUS Accounting Modifications for Tunnel Protocol Support" * * RFC 2868: * "RADIUS Attributes for Tunnel Protocol Support" * * RFC 2869: * "RADIUS Extensions" * * Alfredo Andres Omella (aandres@s21sec.com) v0.1 2000/09/15 * * TODO: Among other things to print ok MacIntosh and Vendor values */ #ifndef lint static const char rcsid[] _U_ = "$Id: print-radius.c,v 1.27.2.1 2005/09/26 01:02:40 guy Exp $"; #endif #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include #include "interface.h" #include "addrtoname.h" #include "extract.h" #include "oui.h" #define TAM_SIZE(x) (sizeof(x)/sizeof(x[0]) ) #define PRINT_HEX(bytes_len, ptr_data) \ while(bytes_len) \ { \ printf("%02X", *ptr_data ); \ ptr_data++; \ bytes_len--; \ } /* Radius packet codes */ #define RADCMD_ACCESS_REQ 1 /* Access-Request */ #define RADCMD_ACCESS_ACC 2 /* Access-Accept */ #define RADCMD_ACCESS_REJ 3 /* Access-Reject */ #define RADCMD_ACCOUN_REQ 4 /* Accounting-Request */ #define RADCMD_ACCOUN_RES 5 /* Accounting-Response */ #define RADCMD_ACCESS_CHA 11 /* Access-Challenge */ #define RADCMD_STATUS_SER 12 /* Status-Server */ #define RADCMD_STATUS_CLI 13 /* Status-Client */ #define RADCMD_RESERVED 255 /* Reserved */ static struct tok radius_command_values[] = { { RADCMD_ACCESS_REQ, "Access Request" }, { RADCMD_ACCESS_ACC, "Access Accept" }, { RADCMD_ACCESS_REJ, "Access Reject" }, { RADCMD_ACCOUN_REQ, "Accounting Request" }, { RADCMD_ACCOUN_RES, "Accounting Response" }, { RADCMD_ACCESS_CHA, "Access Challenge" }, { RADCMD_STATUS_SER, "Status Server" }, { RADCMD_STATUS_CLI, "Status Client" }, { RADCMD_RESERVED, "Reserved" }, { 0, NULL} }; /********************************/ /* Begin Radius Attribute types */ /********************************/ #define SERV_TYPE 6 #define FRM_IPADDR 8 #define LOG_IPHOST 14 #define LOG_SERVICE 15 #define FRM_IPX 23 #define SESSION_TIMEOUT 27 #define IDLE_TIMEOUT 28 #define FRM_ATALK_LINK 37 #define FRM_ATALK_NETWORK 38 #define ACCT_DELAY 41 #define ACCT_SESSION_TIME 46 #define TUNNEL_TYPE 64 #define TUNNEL_MEDIUM 65 #define TUNNEL_CLIENT_END 66 #define TUNNEL_SERVER_END 67 #define TUNNEL_PASS 69 #define ARAP_PASS 70 #define ARAP_FEATURES 71 #define TUNNEL_PRIV_GROUP 81 #define TUNNEL_ASSIGN_ID 82 #define TUNNEL_PREFERENCE 83 #define ARAP_CHALLENGE_RESP 84 #define ACCT_INT_INTERVAL 85 #define TUNNEL_CLIENT_AUTH 90 #define TUNNEL_SERVER_AUTH 91 /********************************/ /* End Radius Attribute types */ /********************************/ static void print_attr_string(register u_char *, u_int, u_short ); static void print_attr_num(register u_char *, u_int, u_short ); static void print_vendor_attr(register u_char *, u_int, u_short ); static void print_attr_address(register u_char *, u_int, u_short); static void print_attr_time(register u_char *, u_int, u_short); static void print_attr_strange(register u_char *, u_int, u_short); struct radius_hdr { u_int8_t code; /* Radius packet code */ u_int8_t id; /* Radius packet id */ u_int16_t len; /* Radius total length */ u_int8_t auth[16]; /* Authenticator */ }; #define MIN_RADIUS_LEN 20 struct radius_attr { u_int8_t type; /* Attribute type */ u_int8_t len; /* Attribute length */ }; /* Service-Type Attribute standard values */ static const char *serv_type[]={ NULL, "Login", "Framed", "Callback Login", "Callback Framed", "Outbound", "Administrative", "NAS Prompt", "Authenticate Only", "Callback NAS Prompt", "Call Check", "Callback Administrative", }; /* Framed-Protocol Attribute standard values */ static const char *frm_proto[]={ NULL, "PPP", "SLIP", "ARAP", "Gandalf proprietary", "Xylogics IPX/SLIP", "X.75 Synchronous", }; /* Framed-Routing Attribute standard values */ static const char *frm_routing[]={ "None", "Send", "Listen", "Send&Listen", }; /* Framed-Compression Attribute standard values */ static const char *frm_comp[]={ "None", "VJ TCP/IP", "IPX", "Stac-LZS", }; /* Login-Service Attribute standard values */ static const char *login_serv[]={ "Telnet", "Rlogin", "TCP Clear", "PortMaster(proprietary)", "LAT", "X.25-PAD", "X.25-T3POS", "Unassigned", "TCP Clear Quiet", }; /* Termination-Action Attribute standard values */ static const char *term_action[]={ "Default", "RADIUS-Request", }; /* NAS-Port-Type Attribute standard values */ static const char *nas_port_type[]={ "Async", "Sync", "ISDN Sync", "ISDN Async V.120", "ISDN Async V.110", "Virtual", "PIAFS", "HDLC Clear Channel", "X.25", "X.75", "G.3 Fax", "SDSL", "ADSL-CAP", "ADSL-DMT", "ISDN-DSL", "Ethernet", "xDSL", "Cable", "Wireless - Other", "Wireless - IEEE 802.11", }; /* Acct-Status-Type Accounting Attribute standard values */ static const char *acct_status[]={ NULL, "Start", "Stop", "Interim-Update", "Unassigned", "Unassigned", "Unassigned", "Accounting-On", "Accounting-Off", "Tunnel-Start", "Tunnel-Stop", "Tunnel-Reject", "Tunnel-Link-Start", "Tunnel-Link-Stop", "Tunnel-Link-Reject", "Failed", }; /* Acct-Authentic Accounting Attribute standard values */ static const char *acct_auth[]={ NULL, "RADIUS", "Local", "Remote", }; /* Acct-Terminate-Cause Accounting Attribute standard values */ static const char *acct_term[]={ NULL, "User Request", "Lost Carrier", "Lost Service", "Idle Timeout", "Session Timeout", "Admin Reset", "Admin Reboot", "Port Error", "NAS Error", "NAS Request", "NAS Reboot", "Port Unneeded", "Port Preempted", "Port Suspended", "Service Unavailable", "Callback", "User Error", "Host Request", }; /* Tunnel-Type Attribute standard values */ static const char *tunnel_type[]={ NULL, "PPTP", "L2F", "L2TP", "ATMP", "VTP", "AH", "IP-IP", "MIN-IP-IP", "ESP", "GRE", "DVS", "IP-in-IP Tunneling", }; /* Tunnel-Medium-Type Attribute standard values */ static const char *tunnel_medium[]={ NULL, "IPv4", "IPv6", "NSAP", "HDLC", "BBN 1822", "802", "E.163", "E.164", "F.69", "X.121", "IPX", "Appletalk", "Decnet IV", "Banyan Vines", "E.164 with NSAP subaddress", }; /* ARAP-Zone-Access Attribute standard values */ static const char *arap_zone[]={ NULL, "Only access to dfl zone", "Use zone filter inc.", "Not used", "Use zone filter exc.", }; static const char *prompt[]={ "No Echo", "Echo", }; struct attrtype { const char *name; /* Attribute name */ const char **subtypes; /* Standard Values (if any) */ u_char siz_subtypes; /* Size of total standard values */ u_char first_subtype; /* First standard value is 0 or 1 */ void (*print_func)(register u_char *, u_int, u_short ); } attr_type[]= { { NULL, NULL, 0, 0, NULL }, { "Username", NULL, 0, 0, print_attr_string }, { "Password", NULL, 0, 0, NULL }, { "CHAP Password", NULL, 0, 0, NULL }, { "NAS IP Address", NULL, 0, 0, print_attr_address }, { "NAS Port", NULL, 0, 0, print_attr_num }, { "Service Type", serv_type, TAM_SIZE(serv_type)-1, 1, print_attr_num }, { "Framed Protocol", frm_proto, TAM_SIZE(frm_proto)-1, 1, print_attr_num }, { "Framed IP Address", NULL, 0, 0, print_attr_address }, { "Framed IP Network", NULL, 0, 0, print_attr_address }, { "Framed Routing", frm_routing, TAM_SIZE(frm_routing), 0, print_attr_num }, { "Filter ID", NULL, 0, 0, print_attr_string }, { "Framed MTU", NULL, 0, 0, print_attr_num }, { "Framed Compression", frm_comp, TAM_SIZE(frm_comp), 0, print_attr_num }, { "Login IP Host", NULL, 0, 0, print_attr_address }, { "Login Service", login_serv, TAM_SIZE(login_serv), 0, print_attr_num }, { "Login TCP Port", NULL, 0, 0, print_attr_num }, { "Unassigned", NULL, 0, 0, NULL }, /*17*/ { "Reply", NULL, 0, 0, print_attr_string }, { "Callback-number", NULL, 0, 0, print_attr_string }, { "Callback-ID", NULL, 0, 0, print_attr_string }, { "Unassigned", NULL, 0, 0, NULL }, /*21*/ { "Framed Route", NULL, 0, 0, print_attr_string }, { "Framed IPX Network", NULL, 0, 0, print_attr_num }, { "State", NULL, 0, 0, print_attr_string }, { "Class", NULL, 0, 0, print_attr_string }, { "Vendor Specific", NULL, 0, 0, print_vendor_attr }, { "Session Timeout", NULL, 0, 0, print_attr_num }, { "Idle Timeout", NULL, 0, 0, print_attr_num }, { "Termination Action", term_action, TAM_SIZE(term_action), 0, print_attr_num }, { "Called Station", NULL, 0, 0, print_attr_string }, { "Calling Station", NULL, 0, 0, print_attr_string }, { "NAS ID", NULL, 0, 0, print_attr_string }, { "Proxy State", NULL, 0, 0, print_attr_string }, { "Login LAT Service", NULL, 0, 0, print_attr_string }, { "Login LAT Node", NULL, 0, 0, print_attr_string }, { "Login LAT Group", NULL, 0, 0, print_attr_string }, { "Framed Appletalk Link", NULL, 0, 0, print_attr_num }, { "Framed Appltalk Net", NULL, 0, 0, print_attr_num }, { "Framed Appletalk Zone", NULL, 0, 0, print_attr_string }, { "Accounting Status", acct_status, TAM_SIZE(acct_status)-1, 1, print_attr_num }, { "Accounting Delay", NULL, 0, 0, print_attr_num }, { "Accounting Input Octets", NULL, 0, 0, print_attr_num }, { "Accounting Output Octets", NULL, 0, 0, print_attr_num }, { "Accounting Session ID", NULL, 0, 0, print_attr_string }, { "Accounting Authentication", acct_auth, TAM_SIZE(acct_auth)-1, 1, print_attr_num }, { "Accounting Session Time", NULL, 0, 0, print_attr_num }, { "Accounting Input Packets", NULL, 0, 0, print_attr_num }, { "Accounting Output Packets", NULL, 0, 0, print_attr_num }, { "Accounting Termination Cause", acct_term, TAM_SIZE(acct_term)-1, 1, print_attr_num }, { "Accounting Multilink Session ID", NULL, 0, 0, print_attr_string }, { "Accounting Link Count", NULL, 0, 0, print_attr_num }, { "Accounting Input Giga", NULL, 0, 0, print_attr_num }, { "Accounting Output Giga", NULL, 0, 0, print_attr_num }, { "Unassigned", NULL, 0, 0, NULL }, /*54*/ { "Event Timestamp", NULL, 0, 0, print_attr_time }, { "Unassigned", NULL, 0, 0, NULL }, /*56*/ { "Unassigned", NULL, 0, 0, NULL }, /*57*/ { "Unassigned", NULL, 0, 0, NULL }, /*58*/ { "Unassigned", NULL, 0, 0, NULL }, /*59*/ { "CHAP challenge", NULL, 0, 0, print_attr_string }, { "NAS Port Type", nas_port_type, TAM_SIZE(nas_port_type), 0, print_attr_num }, { "Port Limit", NULL, 0, 0, print_attr_num }, { "Login LAT Port", NULL, 0, 0, print_attr_string }, /*63*/ { "Tunnel Type", tunnel_type, TAM_SIZE(tunnel_type)-1, 1, print_attr_num }, { "Tunnel Medium", tunnel_medium, TAM_SIZE(tunnel_medium)-1, 1, print_attr_num }, { "Tunnel Client End", NULL, 0, 0, print_attr_string }, { "Tunnel Server End", NULL, 0, 0, print_attr_string }, { "Accounting Tunnel connect", NULL, 0, 0, print_attr_string }, { "Tunnel Password", NULL, 0, 0, print_attr_string }, { "ARAP Password", NULL, 0, 0, print_attr_strange }, { "ARAP Feature", NULL, 0, 0, print_attr_strange }, { "ARAP Zone Acces", arap_zone, TAM_SIZE(arap_zone)-1, 1, print_attr_num }, /*72*/ { "ARAP Security", NULL, 0, 0, print_attr_string }, { "ARAP Security Data", NULL, 0, 0, print_attr_string }, { "Password Retry", NULL, 0, 0, print_attr_num }, { "Prompt", prompt, TAM_SIZE(prompt), 0, print_attr_num }, { "Connect Info", NULL, 0, 0, print_attr_string }, { "Config Token", NULL, 0, 0, print_attr_string }, { "EAP Message", NULL, 0, 0, print_attr_string }, { "Message Authentication", NULL, 0, 0, print_attr_string }, /*80*/ { "Tunnel Private Group", NULL, 0, 0, print_attr_string }, { "Tunnel Assigned ID", NULL, 0, 0, print_attr_string }, { "Tunnel Preference", NULL, 0, 0, print_attr_num }, { "ARAP Challenge Response", NULL, 0, 0, print_attr_strange }, { "Accounting Interim Interval", NULL, 0, 0, print_attr_num }, { "Accounting Tunnel packets lost", NULL, 0, 0, print_attr_num }, /*86*/ { "NAS Port ID", NULL, 0, 0, print_attr_string }, { "Framed Pool", NULL, 0, 0, print_attr_string }, { "Unassigned", NULL, 0, 0, NULL }, { "Tunnel Client Authentication ID", NULL, 0, 0, print_attr_string }, { "Tunnel Server Authentication ID", NULL, 0, 0, print_attr_string }, { "Unassigned", NULL, 0, 0, NULL }, /*92*/ { "Unassigned", NULL, 0, 0, NULL } /*93*/ }; /*****************************/ /* Print an attribute string */ /* value pointed by 'data' */ /* and 'length' size. */ /*****************************/ /* Returns nothing. */ /*****************************/ static void print_attr_string(register u_char *data, u_int length, u_short attr_code ) { register u_int i; TCHECK2(data[0],length); switch(attr_code) { case TUNNEL_PASS: if (length < 3) { printf(" [|radius]"); return; } if (*data && (*data <=0x1F) ) printf("Tag %u, ",*data); data++; length--; printf("Salt %u ",EXTRACT_16BITS(data) ); data+=2; length-=2; break; case TUNNEL_CLIENT_END: case TUNNEL_SERVER_END: case TUNNEL_PRIV_GROUP: case TUNNEL_ASSIGN_ID: case TUNNEL_CLIENT_AUTH: case TUNNEL_SERVER_AUTH: if (*data <= 0x1F) { if (length < 1) { printf(" [|radius]"); return; } printf("Tag %u",*data); data++; length--; } break; } for (i=0; *data && i < length ; i++, data++) printf("%c",(*data < 32 || *data > 128) ? '.' : *data ); return; trunc: printf(" [|radius]"); } /* * print vendor specific attributes */ static void print_vendor_attr(register u_char *data, u_int length, u_short attr_code _U_) { u_int idx; u_int vendor_id; u_int vendor_type; u_int vendor_length; if (length < 4) goto trunc; TCHECK2(*data, 4); vendor_id = EXTRACT_32BITS(data); data+=4; length-=4; printf("Vendor: %s (%u)", tok2str(smi_values,"Unknown",vendor_id), vendor_id); while (length >= 2) { TCHECK2(*data, 2); vendor_type = *(data); vendor_length = *(data+1); if (vendor_length < 2) { printf("\n\t Vendor Attribute: %u, Length: %u (bogus, must be >= 2)", vendor_type, vendor_length); return; } if (vendor_length > length) { printf("\n\t Vendor Attribute: %u, Length: %u (bogus, goes past end of vendor-specific attribute)", vendor_type, vendor_length); return; } data+=2; vendor_length-=2; length-=2; TCHECK2(*data, vendor_length); printf("\n\t Vendor Attribute: %u, Length: %u, Value: ", vendor_type, vendor_length); for (idx = 0; idx < vendor_length ; idx++, data++) printf("%c",(*data < 32 || *data > 128) ? '.' : *data ); length-=vendor_length; } return; trunc: printf(" [|radius]"); } /******************************/ /* Print an attribute numeric */ /* value pointed by 'data' */ /* and 'length' size. */ /******************************/ /* Returns nothing. */ /******************************/ static void print_attr_num(register u_char *data, u_int length, u_short attr_code ) { u_int8_t tag; u_int32_t timeout; if (length != 4) { printf("ERROR: length %u != 4", length); return; } TCHECK2(data[0],4); /* This attribute has standard values */ if (attr_type[attr_code].siz_subtypes) { static const char **table; u_int32_t data_value; table = attr_type[attr_code].subtypes; if ( (attr_code == TUNNEL_TYPE) || (attr_code == TUNNEL_MEDIUM) ) { if (!*data) printf("Tag[Unused]"); else printf("Tag[%d]", *data); data++; data_value = EXTRACT_24BITS(data); } else { data_value = EXTRACT_32BITS(data); } if ( data_value <= (u_int32_t)(attr_type[attr_code].siz_subtypes - 1 + attr_type[attr_code].first_subtype) && data_value >= attr_type[attr_code].first_subtype ) printf("%s",table[data_value]); else printf("#%u",data_value); } else { switch(attr_code) /* Be aware of special cases... */ { case FRM_IPX: if (EXTRACT_32BITS( data) == 0xFFFFFFFE ) printf("NAS Select"); else printf("%d",EXTRACT_32BITS( data) ); break; case SESSION_TIMEOUT: case IDLE_TIMEOUT: case ACCT_DELAY: case ACCT_SESSION_TIME: case ACCT_INT_INTERVAL: timeout = EXTRACT_32BITS( data); if ( timeout < 60 ) printf( "%02d secs", timeout); else { if ( timeout < 3600 ) printf( "%02d:%02d min", timeout / 60, timeout % 60); else printf( "%02d:%02d:%02d hours", timeout / 3600, (timeout % 3600) / 60, timeout % 60); } break; case FRM_ATALK_LINK: if (EXTRACT_32BITS(data) ) printf("%d",EXTRACT_32BITS(data) ); else printf("Unnumbered" ); break; case FRM_ATALK_NETWORK: if (EXTRACT_32BITS(data) ) printf("%d",EXTRACT_32BITS(data) ); else printf("NAS assigned" ); break; case TUNNEL_PREFERENCE: tag = *data; data++; if (tag == 0) printf("Tag (Unused) %d",EXTRACT_24BITS(data) ); else printf("Tag (%d) %d", tag, EXTRACT_24BITS(data) ); break; default: printf("%d",EXTRACT_32BITS( data) ); break; } /* switch */ } /* if-else */ return; trunc: printf(" [|radius]"); } /*****************************/ /* Print an attribute IPv4 */ /* address value pointed by */ /* 'data' and 'length' size. */ /*****************************/ /* Returns nothing. */ /*****************************/ static void print_attr_address(register u_char *data, u_int length, u_short attr_code ) { if (length != 4) { printf("ERROR: length %u != 4", length); return; } TCHECK2(data[0],4); switch(attr_code) { case FRM_IPADDR: case LOG_IPHOST: if (EXTRACT_32BITS(data) == 0xFFFFFFFF ) printf("User Selected"); else if (EXTRACT_32BITS(data) == 0xFFFFFFFE ) printf("NAS Select"); else printf("%s",ipaddr_string(data)); break; default: printf("%s",ipaddr_string(data) ); break; } return; trunc: printf(" [|radius]"); } /*************************************/ /* Print an attribute of 'secs since */ /* January 1, 1970 00:00 UTC' value */ /* pointed by 'data' and 'length' */ /* size. */ /*************************************/ /* Returns nothing. */ /*************************************/ static void print_attr_time(register u_char *data, u_int length, u_short attr_code _U_) { time_t attr_time; char string[26]; if (length != 4) { printf("ERROR: length %u != 4", length); return; } TCHECK2(data[0],4); attr_time = EXTRACT_32BITS(data); strlcpy(string, ctime(&attr_time), sizeof(string)); /* Get rid of the newline */ string[24] = '\0'; printf("%.24s", string); return; trunc: printf(" [|radius]"); } /***********************************/ /* Print an attribute of 'strange' */ /* data format pointed by 'data' */ /* and 'length' size. */ /***********************************/ /* Returns nothing. */ /***********************************/ static void print_attr_strange(register u_char *data, u_int length, u_short attr_code) { u_short len_data; switch(attr_code) { case ARAP_PASS: if (length != 16) { printf("ERROR: length %u != 16", length); return; } printf("User_challenge ("); TCHECK2(data[0],8); len_data = 8; PRINT_HEX(len_data, data); printf(") User_resp("); TCHECK2(data[0],8); len_data = 8; PRINT_HEX(len_data, data); printf(")"); break; case ARAP_FEATURES: if (length != 14) { printf("ERROR: length %u != 14", length); return; } TCHECK2(data[0],1); if (*data) printf("User can change password"); else printf("User cannot change password"); data++; TCHECK2(data[0],1); printf(", Min password length: %d",*data); data++; printf(", created at: "); TCHECK2(data[0],4); len_data = 4; PRINT_HEX(len_data, data); printf(", expires in: "); TCHECK2(data[0],4); len_data = 4; PRINT_HEX(len_data, data); printf(", Current Time: "); TCHECK2(data[0],4); len_data = 4; PRINT_HEX(len_data, data); break; case ARAP_CHALLENGE_RESP: if (length < 8) { printf("ERROR: length %u != 8", length); return; } TCHECK2(data[0],8); len_data = 8; PRINT_HEX(len_data, data); break; } return; trunc: printf(" [|radius]"); } static void radius_attrs_print(register const u_char *attr, u_int length) { register const struct radius_attr *rad_attr = (struct radius_attr *)attr; const char *attr_string; while (length > 0) { if (length < 2) goto trunc; TCHECK(*rad_attr); if (rad_attr->type > 0 && rad_attr->type < TAM_SIZE(attr_type)) attr_string = attr_type[rad_attr->type].name; else attr_string = "Unknown"; if (rad_attr->len < 2) { printf("\n\t %s Attribute (%u), length: %u (bogus, must be >= 2)", attr_string, rad_attr->type, rad_attr->len); return; } if (rad_attr->len > length) { printf("\n\t %s Attribute (%u), length: %u (bogus, goes past end of packet)", attr_string, rad_attr->type, rad_attr->len); return; } printf("\n\t %s Attribute (%u), length: %u, Value: ", attr_string, rad_attr->type, rad_attr->len); if (rad_attr->type < TAM_SIZE(attr_type)) { if (rad_attr->len > 2) { if ( attr_type[rad_attr->type].print_func ) (*attr_type[rad_attr->type].print_func)( ((u_char *)(rad_attr+1)), rad_attr->len - 2, rad_attr->type); } } /* do we also want to see a hex dump ? */ if (vflag> 1) print_unknown_data((u_char *)rad_attr+2,"\n\t ",(rad_attr->len)-2); length-=(rad_attr->len); rad_attr = (struct radius_attr *)( ((char *)(rad_attr))+rad_attr->len); } return; trunc: printf(" [|radius]"); } void radius_print(const u_char *dat, u_int length) { register const struct radius_hdr *rad; u_int len, auth_idx; TCHECK2(*dat, MIN_RADIUS_LEN); rad = (struct radius_hdr *)dat; len = EXTRACT_16BITS(&rad->len); if (len < MIN_RADIUS_LEN) { printf(" [|radius]"); return; } if (len > length) len = length; if (vflag < 1) { printf("RADIUS, %s (%u), id: 0x%02x length: %u", tok2str(radius_command_values,"Unknown Command",rad->code), rad->code, rad->id, len); return; } else { printf("RADIUS, length: %u\n\t%s (%u), id: 0x%02x, Authenticator: ", len, tok2str(radius_command_values,"Unknown Command",rad->code), rad->code, rad->id); for(auth_idx=0; auth_idx < 16; auth_idx++) printf("%02x", rad->auth[auth_idx] ); } if (len > MIN_RADIUS_LEN) radius_attrs_print( dat + MIN_RADIUS_LEN, len - MIN_RADIUS_LEN); return; trunc: printf(" [|radius]"); } tcpdump-3.9.8/./print-cdp.c0000644000026300017500000002511610131254127013533 0ustar mcrmcr/* * Copyright (c) 1992, 1993, 1994, 1995, 1996, 1997 * The Regents of the University of California. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that: (1) source code distributions * retain the above copyright notice and this paragraph in its entirety, (2) * distributions including binary code include the above copyright notice and * this paragraph in its entirety in the documentation or other materials * provided with the distribution, and (3) all advertising materials mentioning * features or use of this software display the following acknowledgement: * ``This product includes software developed by the University of California, * Lawrence Berkeley Laboratory and its contributors.'' Neither the name of * the University nor the names of its contributors may be used to endorse * or promote products derived from this software without specific prior * written permission. * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * * Code by Gert Doering, SpaceNet GmbH, gert@space.net * * Reference documentation: * http://www.cisco.com/univercd/cc/td/doc/product/lan/trsrb/frames.htm */ #ifndef lint static const char rcsid[] _U_ = "@(#) $Header: /tcpdump/master/tcpdump/print-cdp.c,v 1.25 2004/10/07 14:53:11 hannes Exp $"; #endif #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include #include "interface.h" #include "addrtoname.h" #include "extract.h" /* must come after interface.h */ #include "nlpid.h" #define CDP_HEADER_LEN 4 static struct tok cdp_tlv_values[] = { { 0x01, "Device-ID"}, { 0x02, "Address"}, { 0x03, "Port-ID"}, { 0x04, "Capability"}, { 0x05, "Version String"}, { 0x06, "Platform"}, { 0x07, "Prefixes"}, { 0x08, "Protocol-Hello option"}, { 0x09, "VTP Management Domain"}, { 0x0a, "Native VLAN ID"}, { 0x0b, "Duplex"}, { 0x0e, "ATA-186 VoIP VLAN request"}, { 0x0f, "ATA-186 VoIP VLAN assignment"}, { 0x10, "power consumption"}, { 0x11, "MTU"}, { 0x12, "AVVID trust bitmap"}, { 0x13, "AVVID untrusted ports CoS"}, { 0x14, "System Name"}, { 0x15, "System Object ID (not decoded)"}, { 0x16, "Management Addresses"}, { 0x17, "Physical Location"}, { 0, NULL} }; static struct tok cdp_capability_values[] = { { 0x01, "Router" }, { 0x02, "Transparent Bridge" }, { 0x04, "Source Route Bridge" }, { 0x08, "L2 Switch" }, { 0x10, "L3 capable" }, { 0x20, "IGMP snooping" }, { 0x40, "L1 capable" }, { 0, NULL } }; static int cdp_print_addr(const u_char *, int); static int cdp_print_prefixes(const u_char *, int); static unsigned long cdp_get_number(const u_char *, int); void cdp_print(const u_char *pptr, u_int length, u_int caplen) { int type, len, i, j; const u_char *tptr; if (caplen < CDP_HEADER_LEN) { (void)printf("[|cdp]"); return; } tptr = pptr; /* temporary pointer */ if (!TTEST2(*tptr, CDP_HEADER_LEN)) goto trunc; printf("CDPv%u, ttl: %us", *tptr, *(tptr+1)); if (vflag) printf(", checksum: %u (unverified), length %u", EXTRACT_16BITS(tptr), length); tptr += CDP_HEADER_LEN; while (tptr < (pptr+length)) { if (!TTEST2(*tptr, 4)) /* read out Type and Length */ goto trunc; type = EXTRACT_16BITS(tptr); len = EXTRACT_16BITS(tptr+2); /* object length includes the 4 bytes header length */ tptr += 4; len -= 4; if (!TTEST2(*tptr, len)) goto trunc; if (vflag || type == 1) { /* in non-verbose mode just print Device-ID */ if (vflag) printf("\n\t%s (0x%02x), length: %u byte%s: ", tok2str(cdp_tlv_values,"unknown field type", type), type, len, len>1 ? "s" : ""); /* plural */ switch (type) { case 0x01: /* Device-ID */ if (!vflag) printf(", Device-ID '%.*s'", len, tptr); else printf("'%.*s'", len, tptr); break; case 0x02: /* Address */ if (cdp_print_addr(tptr, len) < 0) goto trunc; break; case 0x03: /* Port-ID */ printf("'%.*s'", len, tptr); break; case 0x04: /* Capabilities */ printf("(0x%08x): %s", EXTRACT_32BITS(tptr), bittok2str(cdp_capability_values, "none",EXTRACT_32BITS(tptr))); break; case 0x05: /* Version */ printf("\n\t "); for (i=0;i= 0) { TCHECK2(*p, 2); if (p + 2 > endp) goto trunc; pt = p[0]; /* type of "protocol" field */ pl = p[1]; /* length of "protocol" field */ p += 2; TCHECK2(p[pl], 2); if (p + pl + 2 > endp) goto trunc; al = EXTRACT_16BITS(&p[pl]); /* address length */ if (pt == PT_NLPID && pl == 1 && *p == NLPID_IP && al == 4) { /* * IPv4: protocol type = NLPID, protocol length = 1 * (1-byte NLPID), protocol = 0xcc (NLPID for IPv4), * address length = 4 */ p += 3; TCHECK2(*p, 4); if (p + 4 > endp) goto trunc; printf("IPv4 (%u) %s", num, ipaddr_string(p)); p += 4; } #ifdef INET6 else if (pt == PT_IEEE_802_2 && pl == 8 && memcmp(p, prot_ipv6, 8) == 0 && al == 16) { /* * IPv6: protocol type = IEEE 802.2 header, * protocol length = 8 (size of LLC+SNAP header), * protocol = LLC+SNAP header with the IPv6 * Ethertype, address length = 16 */ p += 10; TCHECK2(*p, al); if (p + al > endp) goto trunc; printf("IPv6 (%u) %s", num, ip6addr_string(p)); p += al; } #endif else { /* * Generic case: just print raw data */ TCHECK2(*p, pl); if (p + pl > endp) goto trunc; printf("pt=0x%02x, pl=%d, pb=", *(p - 2), pl); while (pl-- > 0) printf(" %02x", *p++); TCHECK2(*p, 2); if (p + 2 > endp) goto trunc; al = (*p << 8) + *(p + 1); printf(", al=%d, a=", al); p += 2; TCHECK2(*p, al); if (p + al > endp) goto trunc; while (al-- > 0) printf(" %02x", *p++); } num--; if (num) printf(" "); } return 0; trunc: return -1; } static int cdp_print_prefixes(const u_char * p, int l) { if (l % 5) goto trunc; printf(" IPv4 Prefixes (%d):", l / 5); while (l > 0) { printf(" %u.%u.%u.%u/%u", p[0], p[1], p[2], p[3], p[4]); l -= 5; p += 5; } return 0; trunc: return -1; } /* read in a -byte number, MSB first * (of course this can handle max sizeof(long)) */ static unsigned long cdp_get_number(const u_char * p, int l) { unsigned long res=0; while( l>0 ) { res = (res<<8) + *p; p++; l--; } return res; } tcpdump-3.9.8/./print-pgm.c0000644000026300017500000004333310262571731013561 0ustar mcrmcr/* * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that: (1) source code * distributions retain the above copyright notice and this paragraph * in its entirety, and (2) distributions including binary code include * the above copyright notice and this paragraph in its entirety in * the documentation or other materials provided with the distribution. * THIS SOFTWARE IS PROVIDED ``AS IS'' AND * WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT * LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * FOR A PARTICULAR PURPOSE. * * Original code by Andy Heffernan (ahh@juniper.net) */ #ifndef lint static const char rcsid[] _U_ = "@(#) $Header: /tcpdump/master/tcpdump/print-pgm.c,v 1.1.2.5 2005/06/07 22:06:16 guy Exp $"; #endif #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include #include #include "interface.h" #include "extract.h" #include "addrtoname.h" #include "ip.h" #ifdef INET6 #include "ip6.h" #endif #include "ipproto.h" /* * PGM header (RFC 3208) */ struct pgm_header { u_int16_t pgm_sport; u_int16_t pgm_dport; u_int8_t pgm_type; u_int8_t pgm_options; u_int16_t pgm_sum; u_int8_t pgm_gsid[6]; u_int16_t pgm_length; }; struct pgm_spm { u_int32_t pgms_seq; u_int32_t pgms_trailseq; u_int32_t pgms_leadseq; u_int16_t pgms_nla_afi; u_int16_t pgms_reserved; /* ... u_int8_t pgms_nla[0]; */ /* ... options */ }; struct pgm_nak { u_int32_t pgmn_seq; u_int16_t pgmn_source_afi; u_int16_t pgmn_reserved; /* ... u_int8_t pgmn_source[0]; */ /* ... u_int16_t pgmn_group_afi */ /* ... u_int16_t pgmn_reserved2; */ /* ... u_int8_t pgmn_group[0]; */ /* ... options */ }; struct pgm_poll { u_int32_t pgmp_seq; u_int16_t pgmp_round; u_int16_t pgmp_reserved; /* ... options */ }; struct pgm_polr { u_int32_t pgmp_seq; u_int16_t pgmp_round; u_int16_t pgmp_subtype; u_int16_t pgmp_nla_afi; u_int16_t pgmp_reserved; /* ... u_int8_t pgmp_nla[0]; */ /* ... options */ }; struct pgm_data { u_int32_t pgmd_seq; u_int32_t pgmd_trailseq; /* ... options */ }; typedef enum _pgm_type { PGM_SPM = 0, /* source path message */ PGM_POLL = 1, /* POLL Request */ PGM_POLR = 2, /* POLL Response */ PGM_ODATA = 4, /* original data */ PGM_RDATA = 5, /* repair data */ PGM_NAK = 8, /* NAK */ PGM_NULLNAK = 9, /* Null NAK */ PGM_NCF = 10, /* NAK Confirmation */ PGM_ACK = 11, /* ACK for congestion control */ PGM_SPMR = 12, /* SPM request */ PGM_MAX = 255 } pgm_type; #define PGM_OPT_BIT_PRESENT 0x01 #define PGM_OPT_BIT_NETWORK 0x02 #define PGM_OPT_BIT_VAR_PKTLEN 0x40 #define PGM_OPT_BIT_PARITY 0x80 #define PGM_OPT_LENGTH 0x00 #define PGM_OPT_FRAGMENT 0x01 #define PGM_OPT_NAK_LIST 0x02 #define PGM_OPT_JOIN 0x03 #define PGM_OPT_NAK_BO_IVL 0x04 #define PGM_OPT_NAK_BO_RNG 0x05 #define PGM_OPT_REDIRECT 0x07 #define PGM_OPT_PARITY_PRM 0x08 #define PGM_OPT_PARITY_GRP 0x09 #define PGM_OPT_CURR_TGSIZE 0x0A #define PGM_OPT_NBR_UNREACH 0x0B #define PGM_OPT_PATH_NLA 0x0C #define PGM_OPT_SYN 0x0D #define PGM_OPT_FIN 0x0E #define PGM_OPT_RST 0x0F #define PGM_OPT_CR 0x10 #define PGM_OPT_CRQST 0x11 #define PGM_OPT_MASK 0x7f #define PGM_OPT_END 0x80 /* end of options marker */ #define PGM_MIN_OPT_LEN 4 #ifndef AFI_IP #define AFI_IP 1 #define AFI_IP6 2 #endif void pgm_print(register const u_char *bp, register u_int length, register const u_char *bp2) { register const struct pgm_header *pgm; register const struct ip *ip; register char ch; u_int16_t sport, dport; int addr_size; const void *nla; int nla_af; #ifdef INET6 char nla_buf[INET6_ADDRSTRLEN]; register const struct ip6_hdr *ip6; #else char nla_buf[INET_ADDRSTRLEN]; #endif u_int8_t opt_type, opt_len, flags1, flags2; u_int32_t seq, opts_len, len, offset; pgm = (struct pgm_header *)bp; ip = (struct ip *)bp2; #ifdef INET6 if (IP_V(ip) == 6) ip6 = (struct ip6_hdr *)bp2; else ip6 = NULL; #else /* INET6 */ if (IP_V(ip) == 6) { (void)printf("Can't handle IPv6"); return; } #endif /* INET6 */ ch = '\0'; if (!TTEST(pgm->pgm_dport)) { #ifdef INET6 if (ip6) { (void)printf("%s > %s: [|pgm]", ip6addr_string(&ip6->ip6_src), ip6addr_string(&ip6->ip6_dst)); return; } else #endif /* INET6 */ { (void)printf("%s > %s: [|pgm]", ipaddr_string(&ip->ip_src), ipaddr_string(&ip->ip_dst)); return; } } sport = EXTRACT_16BITS(&pgm->pgm_sport); dport = EXTRACT_16BITS(&pgm->pgm_dport); #ifdef INET6 if (ip6) { if (ip6->ip6_nxt == IPPROTO_PGM) { (void)printf("%s.%s > %s.%s: ", ip6addr_string(&ip6->ip6_src), tcpport_string(sport), ip6addr_string(&ip6->ip6_dst), tcpport_string(dport)); } else { (void)printf("%s > %s: ", tcpport_string(sport), tcpport_string(dport)); } } else #endif /*INET6*/ { if (ip->ip_p == IPPROTO_PGM) { (void)printf("%s.%s > %s.%s: ", ipaddr_string(&ip->ip_src), tcpport_string(sport), ipaddr_string(&ip->ip_dst), tcpport_string(dport)); } else { (void)printf("%s > %s: ", tcpport_string(sport), tcpport_string(dport)); } } TCHECK(*pgm); (void)printf("PGM, length %u", pgm->pgm_length); if (!vflag) return; if (length > pgm->pgm_length) length = pgm->pgm_length; (void)printf(" 0x%02x%02x%02x%02x%02x%02x ", pgm->pgm_gsid[0], pgm->pgm_gsid[1], pgm->pgm_gsid[2], pgm->pgm_gsid[3], pgm->pgm_gsid[4], pgm->pgm_gsid[5]); switch (pgm->pgm_type) { case PGM_SPM: { struct pgm_spm *spm; spm = (struct pgm_spm *)(pgm + 1); TCHECK(*spm); switch (EXTRACT_16BITS(&spm->pgms_nla_afi)) { case AFI_IP: addr_size = sizeof(struct in_addr); nla_af = AF_INET; break; #ifdef INET6 case AFI_IP6: addr_size = sizeof(struct in6_addr); nla_af = AF_INET6; break; #endif default: goto trunc; break; } bp = (u_char *) (spm + 1); TCHECK2(*bp, addr_size); nla = bp; bp += addr_size; inet_ntop(nla_af, nla, nla_buf, sizeof(nla_buf)); (void)printf("SPM seq %u trail %u lead %u nla %s", EXTRACT_32BITS(&spm->pgms_seq), EXTRACT_32BITS(&spm->pgms_trailseq), EXTRACT_32BITS(&spm->pgms_leadseq), nla_buf); break; } case PGM_POLL: { struct pgm_poll *poll; poll = (struct pgm_poll *)(pgm + 1); TCHECK(*poll); (void)printf("POLL seq %u round %u", EXTRACT_32BITS(&poll->pgmp_seq), EXTRACT_16BITS(&poll->pgmp_round)); bp = (u_char *) (poll + 1); break; } case PGM_POLR: { struct pgm_polr *polr; u_int32_t ivl, rnd, mask; polr = (struct pgm_polr *)(pgm + 1); TCHECK(*polr); switch (EXTRACT_16BITS(&polr->pgmp_nla_afi)) { case AFI_IP: addr_size = sizeof(struct in_addr); nla_af = AF_INET; break; #ifdef INET6 case AFI_IP6: addr_size = sizeof(struct in6_addr); nla_af = AF_INET6; break; #endif default: goto trunc; break; } bp = (u_char *) (polr + 1); TCHECK2(*bp, addr_size); nla = bp; bp += addr_size; inet_ntop(nla_af, nla, nla_buf, sizeof(nla_buf)); TCHECK2(*bp, sizeof(u_int32_t)); ivl = EXTRACT_32BITS(bp); bp += sizeof(u_int32_t); TCHECK2(*bp, sizeof(u_int32_t)); rnd = EXTRACT_32BITS(bp); bp += sizeof(u_int32_t); TCHECK2(*bp, sizeof(u_int32_t)); mask = EXTRACT_32BITS(bp); bp += sizeof(u_int32_t); (void)printf("POLR seq %u round %u nla %s ivl %u rnd 0x%08x " "mask 0x%08x", EXTRACT_32BITS(&polr->pgmp_seq), EXTRACT_16BITS(&polr->pgmp_round), nla_buf, ivl, rnd, mask); break; } case PGM_ODATA: { struct pgm_data *odata; odata = (struct pgm_data *)(pgm + 1); TCHECK(*odata); (void)printf("ODATA trail %u seq %u", EXTRACT_32BITS(&odata->pgmd_trailseq), EXTRACT_32BITS(&odata->pgmd_seq)); bp = (u_char *) (odata + 1); break; } case PGM_RDATA: { struct pgm_data *rdata; rdata = (struct pgm_data *)(pgm + 1); TCHECK(*rdata); (void)printf("RDATA trail %u seq %u", EXTRACT_32BITS(&rdata->pgmd_trailseq), EXTRACT_32BITS(&rdata->pgmd_seq)); bp = (u_char *) (rdata + 1); break; } case PGM_NAK: case PGM_NULLNAK: case PGM_NCF: { struct pgm_nak *nak; const void *source, *group; int source_af, group_af; #ifdef INET6 char source_buf[INET6_ADDRSTRLEN], group_buf[INET6_ADDRSTRLEN]; #else char source_buf[INET_ADDRSTRLEN], group_buf[INET_ADDRSTRLEN]; #endif nak = (struct pgm_nak *)(pgm + 1); TCHECK(*nak); /* * Skip past the source, saving info along the way * and stopping if we don't have enough. */ switch (EXTRACT_16BITS(&nak->pgmn_source_afi)) { case AFI_IP: addr_size = sizeof(struct in_addr); source_af = AF_INET; break; #ifdef INET6 case AFI_IP6: addr_size = sizeof(struct in6_addr); source_af = AF_INET6; break; #endif default: goto trunc; break; } bp = (u_char *) (nak + 1); TCHECK2(*bp, addr_size); source = bp; bp += addr_size; /* * Skip past the group, saving info along the way * and stopping if we don't have enough. */ switch (EXTRACT_16BITS(bp)) { case AFI_IP: addr_size = sizeof(struct in_addr); group_af = AF_INET; break; #ifdef INET6 case AFI_IP6: addr_size = sizeof(struct in6_addr); group_af = AF_INET6; break; #endif default: goto trunc; break; } bp += (2 * sizeof(u_int16_t)); TCHECK2(*bp, addr_size); group = bp; bp += addr_size; /* * Options decoding can go here. */ inet_ntop(source_af, source, source_buf, sizeof(source_buf)); inet_ntop(group_af, group, group_buf, sizeof(group_buf)); switch (pgm->pgm_type) { case PGM_NAK: (void)printf("NAK "); break; case PGM_NULLNAK: (void)printf("NNAK "); break; case PGM_NCF: (void)printf("NCF "); break; default: break; } (void)printf("(%s -> %s), seq %u", source_buf, group_buf, EXTRACT_32BITS(&nak->pgmn_seq)); break; } case PGM_SPMR: (void)printf("SPMR"); break; default: (void)printf("UNKNOWN type %0x02x", pgm->pgm_type); break; } if (pgm->pgm_options & PGM_OPT_BIT_PRESENT) { /* * make sure there's enough for the first option header */ if (!TTEST2(*bp, PGM_MIN_OPT_LEN)) { (void)printf("[|OPT]"); return; } /* * That option header MUST be an OPT_LENGTH option * (see the first paragraph of section 9.1 in RFC 3208). */ opt_type = *bp++; if ((opt_type & PGM_OPT_MASK) != PGM_OPT_LENGTH) { (void)printf("[First option bad, should be PGM_OPT_LENGTH, is %u]", opt_type & PGM_OPT_MASK); return; } opt_len = *bp++; if (opt_len != 4) { (void)printf("[Bad OPT_LENGTH option, length %u != 4]", opt_len); return; } opts_len = EXTRACT_16BITS(bp); if (opts_len < 4) { (void)printf("[Bad total option length %u < 4]", opts_len); return; } bp += sizeof(u_int16_t); (void)printf(" OPTS LEN %d", opts_len); opts_len -= 4; while (opts_len) { if (opts_len < PGM_MIN_OPT_LEN) { (void)printf("[Total option length leaves no room for final option]"); return; } opt_type = *bp++; opt_len = *bp++; if (opt_len < PGM_MIN_OPT_LEN) { (void)printf("[Bad option, length %u < %u]", opt_len, PGM_MIN_OPT_LEN); break; } if (opts_len < opt_len) { (void)printf("[Total option length leaves no room for final option]"); return; } if (!TTEST2(*bp, opt_len - 2)) { (void)printf(" [|OPT]"); return; } switch (opt_type & PGM_OPT_MASK) { case PGM_OPT_LENGTH: if (opt_len != 4) { (void)printf("[Bad OPT_LENGTH option, length %u != 4]", opt_len); return; } (void)printf(" OPTS LEN (extra?) %d", EXTRACT_16BITS(bp)); bp += sizeof(u_int16_t); opts_len -= 4; break; case PGM_OPT_FRAGMENT: if (opt_len != 16) { (void)printf("[Bad OPT_FRAGMENT option, length %u != 16]", opt_len); return; } flags1 = *bp++; flags2 = *bp++; seq = EXTRACT_32BITS(bp); bp += sizeof(u_int32_t); offset = EXTRACT_32BITS(bp); bp += sizeof(u_int32_t); len = EXTRACT_32BITS(bp); bp += sizeof(u_int32_t); (void)printf(" FRAG seq %u off %u len %u", seq, offset, len); opts_len -= 16; break; case PGM_OPT_NAK_LIST: flags1 = *bp++; flags2 = *bp++; opt_len -= sizeof(u_int32_t); /* option header */ (void)printf(" NAK LIST"); while (opt_len) { if (opt_len < sizeof(u_int32_t)) { (void)printf("[Option length not a multiple of 4]"); return; } TCHECK2(*bp, sizeof(u_int32_t)); (void)printf(" %u", EXTRACT_32BITS(bp)); bp += sizeof(u_int32_t); opt_len -= sizeof(u_int32_t); opts_len -= sizeof(u_int32_t); } break; case PGM_OPT_JOIN: if (opt_len != 8) { (void)printf("[Bad OPT_JOIN option, length %u != 8]", opt_len); return; } flags1 = *bp++; flags2 = *bp++; seq = EXTRACT_32BITS(bp); bp += sizeof(u_int32_t); (void)printf(" JOIN %u", seq); opts_len -= 8; break; case PGM_OPT_NAK_BO_IVL: if (opt_len != 12) { (void)printf("[Bad OPT_NAK_BO_IVL option, length %u != 12]", opt_len); return; } flags1 = *bp++; flags2 = *bp++; offset = EXTRACT_32BITS(bp); bp += sizeof(u_int32_t); seq = EXTRACT_32BITS(bp); bp += sizeof(u_int32_t); (void)printf(" BACKOFF ivl %u ivlseq %u", offset, seq); opts_len -= 12; break; case PGM_OPT_NAK_BO_RNG: if (opt_len != 12) { (void)printf("[Bad OPT_NAK_BO_RNG option, length %u != 12]", opt_len); return; } flags1 = *bp++; flags2 = *bp++; offset = EXTRACT_32BITS(bp); bp += sizeof(u_int32_t); seq = EXTRACT_32BITS(bp); bp += sizeof(u_int32_t); (void)printf(" BACKOFF max %u min %u", offset, seq); opts_len -= 12; break; case PGM_OPT_REDIRECT: flags1 = *bp++; flags2 = *bp++; switch (EXTRACT_16BITS(bp)) { case AFI_IP: addr_size = sizeof(struct in_addr); nla_af = AF_INET; break; #ifdef INET6 case AFI_IP6: addr_size = sizeof(struct in6_addr); nla_af = AF_INET6; break; #endif default: goto trunc; break; } bp += (2 * sizeof(u_int16_t)); if (opt_len != 4 + addr_size) { (void)printf("[Bad OPT_REDIRECT option, length %u != 4 + address size]", opt_len); return; } TCHECK2(*bp, addr_size); nla = bp; bp += addr_size; inet_ntop(nla_af, nla, nla_buf, sizeof(nla_buf)); (void)printf(" REDIRECT %s", (char *)nla); opts_len -= 4 + addr_size; break; case PGM_OPT_PARITY_PRM: if (opt_len != 8) { (void)printf("[Bad OPT_PARITY_PRM option, length %u != 8]", opt_len); return; } flags1 = *bp++; flags2 = *bp++; len = EXTRACT_32BITS(bp); bp += sizeof(u_int32_t); (void)printf(" PARITY MAXTGS %u", len); opts_len -= 8; break; case PGM_OPT_PARITY_GRP: if (opt_len != 8) { (void)printf("[Bad OPT_PARITY_GRP option, length %u != 8]", opt_len); return; } flags1 = *bp++; flags2 = *bp++; seq = EXTRACT_32BITS(bp); bp += sizeof(u_int32_t); (void)printf(" PARITY GROUP %u", seq); opts_len -= 8; break; case PGM_OPT_CURR_TGSIZE: if (opt_len != 8) { (void)printf("[Bad OPT_CURR_TGSIZE option, length %u != 8]", opt_len); return; } flags1 = *bp++; flags2 = *bp++; len = EXTRACT_32BITS(bp); bp += sizeof(u_int32_t); (void)printf(" PARITY ATGS %u", len); opts_len -= 8; break; case PGM_OPT_NBR_UNREACH: if (opt_len != 4) { (void)printf("[Bad OPT_NBR_UNREACH option, length %u != 4]", opt_len); return; } flags1 = *bp++; flags2 = *bp++; (void)printf(" NBR_UNREACH"); opts_len -= 4; break; case PGM_OPT_PATH_NLA: (void)printf(" PATH_NLA [%d]", opt_len); bp += opt_len; opts_len -= opt_len; break; case PGM_OPT_SYN: if (opt_len != 4) { (void)printf("[Bad OPT_SYN option, length %u != 4]", opt_len); return; } flags1 = *bp++; flags2 = *bp++; (void)printf(" SYN"); opts_len -= 4; break; case PGM_OPT_FIN: if (opt_len != 4) { (void)printf("[Bad OPT_FIN option, length %u != 4]", opt_len); return; } flags1 = *bp++; flags2 = *bp++; (void)printf(" FIN"); opts_len -= 4; break; case PGM_OPT_RST: if (opt_len != 4) { (void)printf("[Bad OPT_RST option, length %u != 4]", opt_len); return; } flags1 = *bp++; flags2 = *bp++; (void)printf(" RST"); opts_len -= 4; break; case PGM_OPT_CR: (void)printf(" CR"); bp += opt_len; opts_len -= opt_len; break; case PGM_OPT_CRQST: if (opt_len != 4) { (void)printf("[Bad OPT_CRQST option, length %u != 4]", opt_len); return; } flags1 = *bp++; flags2 = *bp++; (void)printf(" CRQST"); opts_len -= 4; break; default: (void)printf(" OPT_%02X [%d] ", opt_type, opt_len); bp += opt_len; opts_len -= opt_len; break; } if (opt_type & PGM_OPT_END) break; } } (void)printf(" [%u]", EXTRACT_16BITS(&pgm->pgm_length)); return; trunc: fputs("[|pgm]", stdout); if (ch != '\0') putchar('>'); } tcpdump-3.9.8/./timed.h0000644000026300017500000000730507575562704012767 0ustar mcrmcr/* @(#) $Header: /tcpdump/master/tcpdump/timed.h,v 1.5 2002/12/11 07:14:12 guy Exp $ (LBL) */ /* * Copyright (c) 1983, 1993 * The Regents of the University of California. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. All advertising materials mentioning features or use of this software * must display the following acknowledgement: * This product includes software developed by the University of * California, Berkeley and its contributors. * 4. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * * @(#)timed.h 8.1 (Berkeley) 6/2/93 */ #ifndef _PROTOCOLS_TIMED_H_ #define _PROTOCOLS_TIMED_H_ /* * Time Synchronization Protocol */ #define TSPVERSION 1 #define ANYADDR NULL struct tsp { u_int8_t tsp_type; u_int8_t tsp_vers; u_int16_t tsp_seq; union { struct timeval tspu_time; int8_t tspu_hopcnt; } tsp_u; int8_t tsp_name[256]; }; #define tsp_time tsp_u.tspu_time #define tsp_hopcnt tsp_u.tspu_hopcnt /* * Command types. */ #define TSP_ANY 0 /* match any types */ #define TSP_ADJTIME 1 /* send adjtime */ #define TSP_ACK 2 /* generic acknowledgement */ #define TSP_MASTERREQ 3 /* ask for master's name */ #define TSP_MASTERACK 4 /* acknowledge master request */ #define TSP_SETTIME 5 /* send network time */ #define TSP_MASTERUP 6 /* inform slaves that master is up */ #define TSP_SLAVEUP 7 /* slave is up but not polled */ #define TSP_ELECTION 8 /* advance candidature for master */ #define TSP_ACCEPT 9 /* support candidature of master */ #define TSP_REFUSE 10 /* reject candidature of master */ #define TSP_CONFLICT 11 /* two or more masters present */ #define TSP_RESOLVE 12 /* masters' conflict resolution */ #define TSP_QUIT 13 /* reject candidature if master is up */ #define TSP_DATE 14 /* reset the time (date command) */ #define TSP_DATEREQ 15 /* remote request to reset the time */ #define TSP_DATEACK 16 /* acknowledge time setting */ #define TSP_TRACEON 17 /* turn tracing on */ #define TSP_TRACEOFF 18 /* turn tracing off */ #define TSP_MSITE 19 /* find out master's site */ #define TSP_MSITEREQ 20 /* remote master's site request */ #define TSP_TEST 21 /* for testing election algo */ #define TSP_SETDATE 22 /* New from date command */ #define TSP_SETDATEREQ 23 /* New remote for above */ #define TSP_LOOP 24 /* loop detection packet */ #define TSPTYPENUMBER 25 #endif /* !_TIMED_H_ */ tcpdump-3.9.8/./af.c0000644000026300017500000000414310570560635012231 0ustar mcrmcr/* * Copyright (c) 1998-2006 The TCPDUMP project * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that: (1) source code * distributions retain the above copyright notice and this paragraph * in its entirety, and (2) distributions including binary code include * the above copyright notice and this paragraph in its entirety in * the documentation or other materials provided with the distribution. * THIS SOFTWARE IS PROVIDED ``AS IS'' AND * WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT * LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * FOR A PARTICULAR PURPOSE. * * Original code by Hannes Gredler (hannes@juniper.net) */ #ifndef lint static const char rcsid[] _U_ = "@(#) $Header: /tcpdump/master/tcpdump/af.c,v 1.3.2.1 2007/02/26 13:33:17 hannes Exp $ (LBL)"; #endif #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include "interface.h" #include "af.h" struct tok af_values[] = { { 0, "Reserved"}, { AFNUM_INET, "IPv4"}, { AFNUM_INET6, "IPv6"}, { AFNUM_NSAP, "NSAP"}, { AFNUM_HDLC, "HDLC"}, { AFNUM_BBN1822, "BBN 1822"}, { AFNUM_802, "802"}, { AFNUM_E163, "E.163"}, { AFNUM_E164, "E.164"}, { AFNUM_F69, "F.69"}, { AFNUM_X121, "X.121"}, { AFNUM_IPX, "Novell IPX"}, { AFNUM_ATALK, "Appletalk"}, { AFNUM_DECNET, "Decnet IV"}, { AFNUM_BANYAN, "Banyan Vines"}, { AFNUM_E164NSAP, "E.164 with NSAP subaddress"}, { AFNUM_L2VPN, "Layer-2 VPN"}, { AFNUM_VPLS, "VPLS"}, { 0, NULL}, }; struct tok bsd_af_values[] = { { BSD_AFNUM_INET, "IPv4" }, { BSD_AFNUM_NS, "NS" }, { BSD_AFNUM_ISO, "ISO" }, { BSD_AFNUM_APPLETALK, "Appletalk" }, { BSD_AFNUM_IPX, "IPX" }, { BSD_AFNUM_INET6_BSD, "IPv6" }, { BSD_AFNUM_INET6_FREEBSD, "IPv6" }, { BSD_AFNUM_INET6_DARWIN, "IPv6" }, { 0, NULL} }; tcpdump-3.9.8/./print-ospf6.c0000644000026300017500000004131207755642437014045 0ustar mcrmcr/* * Copyright (c) 1992, 1993, 1994, 1995, 1996, 1997 * The Regents of the University of California. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that: (1) source code distributions * retain the above copyright notice and this paragraph in its entirety, (2) * distributions including binary code include the above copyright notice and * this paragraph in its entirety in the documentation or other materials * provided with the distribution, and (3) all advertising materials mentioning * features or use of this software display the following acknowledgement: * ``This product includes software developed by the University of California, * Lawrence Berkeley Laboratory and its contributors.'' Neither the name of * the University nor the names of its contributors may be used to endorse * or promote products derived from this software without specific prior * written permission. * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * * OSPF support contributed by Jeffrey Honig (jch@mitchell.cit.cornell.edu) */ #ifndef lint static const char rcsid[] _U_ = "@(#) $Header: /tcpdump/master/tcpdump/print-ospf6.c,v 1.13 2003/11/16 09:36:31 guy Exp $ (LBL)"; #endif #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include #include "interface.h" #include "addrtoname.h" #include "extract.h" #include "ospf6.h" struct bits { u_int32_t bit; const char *str; }; static const struct bits ospf6_option_bits[] = { { OSPF6_OPTION_V6, "V6" }, { OSPF6_OPTION_E, "E" }, { OSPF6_OPTION_MC, "MC" }, { OSPF6_OPTION_N, "N" }, { OSPF6_OPTION_R, "R" }, { OSPF6_OPTION_DC, "DC" }, { 0, NULL } }; static const struct bits ospf6_rla_flag_bits[] = { { RLA_FLAG_B, "B" }, { RLA_FLAG_E, "E" }, { RLA_FLAG_V, "V" }, { RLA_FLAG_W, "W" }, { 0, NULL } }; static const struct bits ospf6_asla_flag_bits[] = { { ASLA_FLAG_EXTERNAL, "E" }, { ASLA_FLAG_FWDADDR, "F" }, { ASLA_FLAG_ROUTETAG, "T" }, { 0, NULL } }; static struct tok type2str[] = { { OSPF_TYPE_UMD, "umd" }, { OSPF_TYPE_HELLO, "hello" }, { OSPF_TYPE_DB, "dd" }, { OSPF_TYPE_LSR, "ls_req" }, { OSPF_TYPE_LSU, "ls_upd" }, { OSPF_TYPE_LSA, "ls_ack" }, { 0, NULL } }; static char tstr[] = " [|ospf]"; #ifdef WIN32 #define inline __inline #endif /* WIN32 */ /* Forwards */ static inline void ospf6_print_seqage(u_int32_t, time_t); static inline void ospf6_print_bits(const struct bits *, u_char); static void ospf6_print_ls_type(u_int, const rtrid_t *, const rtrid_t *, const char *); static int ospf6_print_lshdr(const struct lsa_hdr *); static int ospf6_print_lsa(const struct lsa *); static int ospf6_decode_v3(const struct ospf6hdr *, const u_char *); static inline void ospf6_print_seqage(register u_int32_t seq, register time_t us) { register time_t sec = us % 60; register time_t mins = (us / 60) % 60; register time_t hour = us / 3600; printf(" S %X age ", seq); if (hour) printf("%u:%02u:%02u", (u_int32_t) hour, (u_int32_t) mins, (u_int32_t) sec); else if (mins) printf("%u:%02u", (u_int32_t) mins, (u_int32_t) sec); else printf("%u", (u_int32_t) sec); } static inline void ospf6_print_bits(register const struct bits *bp, register u_char options) { register char sep = ' '; do { if (options & bp->bit) { printf("%c%s", sep, bp->str); sep = '/'; } } while ((++bp)->bit); } static void ospf6_print_ls_type(register u_int ls_type, register const rtrid_t *ls_stateid, register const rtrid_t *ls_router, register const char *fmt) { const char *scope; switch (ls_type & LS_SCOPE_MASK) { case LS_SCOPE_LINKLOCAL: scope = "linklocal-"; break; case LS_SCOPE_AREA: scope = "area-"; break; case LS_SCOPE_AS: scope = "AS-"; break; default: scope = ""; break; } switch (ls_type & LS_TYPE_MASK) { case LS_TYPE_ROUTER: printf(" %srtr %s", scope, ipaddr_string(ls_router)); break; case LS_TYPE_NETWORK: printf(" %snet dr %s if %s", scope, ipaddr_string(ls_router), ipaddr_string(ls_stateid)); break; case LS_TYPE_INTER_AP: printf(" %sinter-area-prefix %s abr %s", scope, ipaddr_string(ls_stateid), ipaddr_string(ls_router)); break; case LS_TYPE_INTER_AR: printf(" %sinter-area-router %s rtr %s", scope, ipaddr_string(ls_router), ipaddr_string(ls_stateid)); break; case LS_TYPE_ASE: printf(" %sase %s asbr %s", scope, ipaddr_string(ls_stateid), ipaddr_string(ls_router)); break; case LS_TYPE_GROUP: printf(" %sgroup %s rtr %s", scope, ipaddr_string(ls_stateid), ipaddr_string(ls_router)); break; case LS_TYPE_TYPE7: printf(" %stype7 %s rtr %s", scope, ipaddr_string(ls_stateid), ipaddr_string(ls_router)); break; case LS_TYPE_LINK: printf(" %slink %s rtr %s", scope, ipaddr_string(ls_stateid), ipaddr_string(ls_router)); break; case LS_TYPE_INTRA_AP: printf(" %sintra-area-prefix %s rtr %s", scope, ipaddr_string(ls_stateid), ipaddr_string(ls_router)); break; default: printf(" %s", scope); printf(fmt, ls_type); break; } } static int ospf6_print_lshdr(register const struct lsa_hdr *lshp) { TCHECK(lshp->ls_type); printf(" {"); /* } (ctags) */ TCHECK(lshp->ls_seq); ospf6_print_seqage(EXTRACT_32BITS(&lshp->ls_seq), EXTRACT_16BITS(&lshp->ls_age)); ospf6_print_ls_type(EXTRACT_16BITS(&lshp->ls_type), &lshp->ls_stateid, &lshp->ls_router, "ls_type %d"); return (0); trunc: return (1); } static int ospf6_print_lsaprefix(register const struct lsa_prefix *lsapp) { u_int k; struct in6_addr prefix; TCHECK(*lsapp); k = (lsapp->lsa_p_len + 31) / 32; if (k * 4 > sizeof(struct in6_addr)) { printf("??prefixlen %d??", lsapp->lsa_p_len); goto trunc; } memset(&prefix, 0, sizeof(prefix)); memcpy(&prefix, lsapp->lsa_p_prefix, k * 4); printf(" %s/%d", ip6addr_string(&prefix), lsapp->lsa_p_len); if (lsapp->lsa_p_opt) printf("(opt=%x)", lsapp->lsa_p_opt); if (lsapp->lsa_p_mbz) printf("(mbz=%x)", EXTRACT_16BITS(&lsapp->lsa_p_mbz)); /* XXX */ return sizeof(*lsapp) - 4 + k * 4; trunc: return -1; } /* * Print a single link state advertisement. If truncated return 1, else 0. */ static int ospf6_print_lsa(register const struct lsa *lsap) { register const u_char *ls_end, *ls_opt; register const struct rlalink *rlp; #if 0 register const struct tos_metric *tosp; #endif register const rtrid_t *ap; #if 0 register const struct aslametric *almp; register const struct mcla *mcp; #endif register const struct llsa *llsap; register const struct lsa_prefix *lsapp; #if 0 register const u_int32_t *lp; #endif register u_int j; register int k; u_int32_t flags32; if (ospf6_print_lshdr(&lsap->ls_hdr)) return (1); TCHECK(lsap->ls_hdr.ls_length); ls_end = (u_char *)lsap + EXTRACT_16BITS(&lsap->ls_hdr.ls_length); switch (EXTRACT_16BITS(&lsap->ls_hdr.ls_type)) { case LS_TYPE_ROUTER | LS_SCOPE_AREA: TCHECK(lsap->lsa_un.un_rla.rla_flags); ospf6_print_bits(ospf6_rla_flag_bits, lsap->lsa_un.un_rla.rla_flags); TCHECK(lsap->lsa_un.un_rla.rla_options); ospf6_print_bits(ospf6_option_bits, EXTRACT_32BITS(&lsap->lsa_un.un_rla.rla_options)); TCHECK(lsap->lsa_un.un_rla.rla_link); rlp = lsap->lsa_un.un_rla.rla_link; while (rlp + sizeof(*rlp) <= (struct rlalink *)ls_end) { TCHECK(*rlp); printf(" {"); /* } (ctags) */ switch (rlp->link_type) { case RLA_TYPE_VIRTUAL: printf(" virt"); /* Fall through */ case RLA_TYPE_ROUTER: printf(" nbrid %s nbrif %s if %s", ipaddr_string(&rlp->link_nrtid), ipaddr_string(&rlp->link_nifid), ipaddr_string(&rlp->link_ifid)); break; case RLA_TYPE_TRANSIT: printf(" dr %s drif %s if %s", ipaddr_string(&rlp->link_nrtid), ipaddr_string(&rlp->link_nifid), ipaddr_string(&rlp->link_ifid)); break; default: /* { (ctags) */ printf(" ??RouterLinksType 0x%02x?? }", rlp->link_type); return (0); } printf(" metric %d", EXTRACT_16BITS(&rlp->link_metric)); /* { (ctags) */ printf(" }"); rlp++; } break; case LS_TYPE_NETWORK | LS_SCOPE_AREA: TCHECK(lsap->lsa_un.un_nla.nla_options); ospf6_print_bits(ospf6_option_bits, EXTRACT_32BITS(&lsap->lsa_un.un_nla.nla_options)); printf(" rtrs"); ap = lsap->lsa_un.un_nla.nla_router; while ((u_char *)ap < ls_end) { TCHECK(*ap); printf(" %s", ipaddr_string(ap)); ++ap; } break; case LS_TYPE_INTER_AP | LS_SCOPE_AREA: TCHECK(lsap->lsa_un.un_inter_ap.inter_ap_metric); printf(" metric %u", EXTRACT_32BITS(&lsap->lsa_un.un_inter_ap.inter_ap_metric) & SLA_MASK_METRIC); lsapp = lsap->lsa_un.un_inter_ap.inter_ap_prefix; while (lsapp + sizeof(lsapp) <= (struct lsa_prefix *)ls_end) { k = ospf6_print_lsaprefix(lsapp); if (k) goto trunc; lsapp = (struct lsa_prefix *)(((u_char *)lsapp) + k); } break; case LS_SCOPE_AS | LS_TYPE_ASE: TCHECK(lsap->lsa_un.un_asla.asla_metric); flags32 = EXTRACT_32BITS(&lsap->lsa_un.un_asla.asla_metric); ospf6_print_bits(ospf6_asla_flag_bits, flags32); printf(" metric %u", EXTRACT_32BITS(&lsap->lsa_un.un_asla.asla_metric) & ASLA_MASK_METRIC); lsapp = lsap->lsa_un.un_asla.asla_prefix; k = ospf6_print_lsaprefix(lsapp); if (k < 0) goto trunc; if ((ls_opt = (u_char *)(((u_char *)lsapp) + k)) < ls_end) { struct in6_addr *fwdaddr6; if ((flags32 & ASLA_FLAG_FWDADDR) != 0) { fwdaddr6 = (struct in6_addr *)ls_opt; TCHECK(*fwdaddr6); printf(" forward %s", ip6addr_string(fwdaddr6)); ls_opt += sizeof(struct in6_addr); } if ((flags32 & ASLA_FLAG_ROUTETAG) != 0) { TCHECK(*(u_int32_t *)ls_opt); printf(" tag %s", ipaddr_string((u_int32_t *)ls_opt)); ls_opt += sizeof(u_int32_t); } if (lsapp->lsa_p_mbz) { TCHECK(*(u_int32_t *)ls_opt); printf(" RefLSID: %s", ipaddr_string((u_int32_t *)ls_opt)); ls_opt += sizeof(u_int32_t); } } break; #if 0 case LS_TYPE_SUM_ABR: TCHECK(lsap->lsa_un.un_sla.sla_tosmetric); lp = lsap->lsa_un.un_sla.sla_tosmetric; while ((u_char *)lp < ls_end) { register u_int32_t ul; TCHECK(*lp); ul = EXTRACT_32BITS(lp); printf(" tos %d metric %d", (ul & SLA_MASK_TOS) >> SLA_SHIFT_TOS, ul & SLA_MASK_METRIC); ++lp; } break; case LS_TYPE_GROUP: /* Multicast extensions as of 23 July 1991 */ mcp = lsap->lsa_un.un_mcla; while ((u_char *)mcp < ls_end) { TCHECK(mcp->mcla_vid); switch (EXTRACT_32BITS(&mcp->mcla_vtype)) { case MCLA_VERTEX_ROUTER: printf(" rtr rtrid %s", ipaddr_string(&mcp->mcla_vid)); break; case MCLA_VERTEX_NETWORK: printf(" net dr %s", ipaddr_string(&mcp->mcla_vid)); break; default: printf(" ??VertexType %u??", EXTRACT_32BITS(&mcp->mcla_vtype)); break; } ++mcp; } #endif case LS_TYPE_LINK: /* Link LSA */ llsap = &lsap->lsa_un.un_llsa; TCHECK(llsap->llsa_options); ospf6_print_bits(ospf6_option_bits, EXTRACT_32BITS(&llsap->llsa_options)); TCHECK(llsap->llsa_nprefix); printf(" pri %d lladdr %s npref %d", llsap->llsa_priority, ip6addr_string(&llsap->llsa_lladdr), EXTRACT_32BITS(&llsap->llsa_nprefix)); lsapp = llsap->llsa_prefix; for (j = 0; j < EXTRACT_32BITS(&llsap->llsa_nprefix); j++) { k = ospf6_print_lsaprefix(lsapp); if (k) goto trunc; lsapp = (struct lsa_prefix *)(((u_char *)lsapp) + k); } break; case LS_TYPE_INTRA_AP | LS_SCOPE_AREA: /* Intra-Area-Prefix LSA */ TCHECK(lsap->lsa_un.un_intra_ap.intra_ap_rtid); ospf6_print_ls_type( EXTRACT_16BITS(&lsap->lsa_un.un_intra_ap.intra_ap_lstype), &lsap->lsa_un.un_intra_ap.intra_ap_lsid, &lsap->lsa_un.un_intra_ap.intra_ap_rtid, "LinkStateType %d"); TCHECK(lsap->lsa_un.un_intra_ap.intra_ap_nprefix); printf(" npref %d", EXTRACT_16BITS(&lsap->lsa_un.un_intra_ap.intra_ap_nprefix)); lsapp = lsap->lsa_un.un_intra_ap.intra_ap_prefix; for (j = 0; j < EXTRACT_16BITS(&lsap->lsa_un.un_intra_ap.intra_ap_nprefix); j++) { k = ospf6_print_lsaprefix(lsapp); if (k) goto trunc; lsapp = (struct lsa_prefix *)(((u_char *)lsapp) + k); } break; default: printf(" ??LinkStateType 0x%04x??", EXTRACT_16BITS(&lsap->ls_hdr.ls_type)); } /* { (ctags) */ fputs(" }", stdout); return (0); trunc: fputs(" }", stdout); return (1); } static int ospf6_decode_v3(register const struct ospf6hdr *op, register const u_char *dataend) { register const rtrid_t *ap; register const struct lsr *lsrp; register const struct lsa_hdr *lshp; register const struct lsa *lsap; register char sep; register int i; switch (op->ospf6_type) { case OSPF_TYPE_UMD: /* * Rob Coltun's special monitoring packets; * do nothing */ break; case OSPF_TYPE_HELLO: if (vflag) { TCHECK(op->ospf6_hello.hello_deadint); ospf6_print_bits(ospf6_option_bits, EXTRACT_32BITS(&op->ospf6_hello.hello_options)); printf(" ifid %s pri %d int %d dead %u", ipaddr_string(&op->ospf6_hello.hello_ifid), op->ospf6_hello.hello_priority, EXTRACT_16BITS(&op->ospf6_hello.hello_helloint), EXTRACT_16BITS(&op->ospf6_hello.hello_deadint)); } TCHECK(op->ospf6_hello.hello_dr); if (op->ospf6_hello.hello_dr != 0) printf(" dr %s", ipaddr_string(&op->ospf6_hello.hello_dr)); TCHECK(op->ospf6_hello.hello_bdr); if (op->ospf6_hello.hello_bdr != 0) printf(" bdr %s", ipaddr_string(&op->ospf6_hello.hello_bdr)); if (vflag) { printf(" nbrs"); ap = op->ospf6_hello.hello_neighbor; while ((u_char *)ap < dataend) { TCHECK(*ap); printf(" %s", ipaddr_string(ap)); ++ap; } } break; /* HELLO */ case OSPF_TYPE_DB: TCHECK(op->ospf6_db.db_options); ospf6_print_bits(ospf6_option_bits, EXTRACT_32BITS(&op->ospf6_db.db_options)); sep = ' '; TCHECK(op->ospf6_db.db_flags); if (op->ospf6_db.db_flags & OSPF6_DB_INIT) { printf("%cI", sep); sep = '/'; } if (op->ospf6_db.db_flags & OSPF6_DB_MORE) { printf("%cM", sep); sep = '/'; } if (op->ospf6_db.db_flags & OSPF6_DB_MASTER) { printf("%cMS", sep); sep = '/'; } TCHECK(op->ospf6_db.db_seq); printf(" mtu %u S %X", EXTRACT_16BITS(&op->ospf6_db.db_mtu), EXTRACT_32BITS(&op->ospf6_db.db_seq)); if (vflag) { /* Print all the LS adv's */ lshp = op->ospf6_db.db_lshdr; while (!ospf6_print_lshdr(lshp)) { /* { (ctags) */ printf(" }"); ++lshp; } } break; case OSPF_TYPE_LSR: if (vflag) { lsrp = op->ospf6_lsr; while ((u_char *)lsrp < dataend) { TCHECK(*lsrp); printf(" {"); /* } (ctags) */ ospf6_print_ls_type(EXTRACT_16BITS(&lsrp->ls_type), &lsrp->ls_stateid, &lsrp->ls_router, "LinkStateType %d"); /* { (ctags) */ printf(" }"); ++lsrp; } } break; case OSPF_TYPE_LSU: if (vflag) { lsap = op->ospf6_lsu.lsu_lsa; TCHECK(op->ospf6_lsu.lsu_count); i = EXTRACT_32BITS(&op->ospf6_lsu.lsu_count); while (i--) { if (ospf6_print_lsa(lsap)) goto trunc; lsap = (struct lsa *)((u_char *)lsap + EXTRACT_16BITS(&lsap->ls_hdr.ls_length)); } } break; case OSPF_TYPE_LSA: if (vflag) { lshp = op->ospf6_lsa.lsa_lshdr; while (!ospf6_print_lshdr(lshp)) { /* { (ctags) */ printf(" }"); ++lshp; } } break; default: printf("v3 type %d", op->ospf6_type); break; } return (0); trunc: return (1); } void ospf6_print(register const u_char *bp, register u_int length) { register const struct ospf6hdr *op; register const u_char *dataend; register const char *cp; op = (struct ospf6hdr *)bp; /* If the type is valid translate it, or just print the type */ /* value. If it's not valid, say so and return */ TCHECK(op->ospf6_type); cp = tok2str(type2str, "type%d", op->ospf6_type); printf("OSPFv%d-%s %d:", op->ospf6_version, cp, length); if (*cp == 't') return; TCHECK(op->ospf6_len); if (length != EXTRACT_16BITS(&op->ospf6_len)) { printf(" [len %d]", EXTRACT_16BITS(&op->ospf6_len)); return; } dataend = bp + length; /* Print the routerid if it is not the same as the source */ TCHECK(op->ospf6_routerid); printf(" rtrid %s", ipaddr_string(&op->ospf6_routerid)); TCHECK(op->ospf6_areaid); if (op->ospf6_areaid != 0) printf(" area %s", ipaddr_string(&op->ospf6_areaid)); else printf(" backbone"); TCHECK(op->ospf6_instanceid); if (op->ospf6_instanceid) printf(" instance %u", op->ospf6_instanceid); /* Do rest according to version. */ switch (op->ospf6_version) { case 3: /* ospf version 3 */ if (ospf6_decode_v3(op, dataend)) goto trunc; break; default: printf(" ospf [version %d]", op->ospf6_version); break; } /* end switch on version */ return; trunc: fputs(tstr, stdout); } tcpdump-3.9.8/./print-bfd.c0000644000026300017500000002553110504040014013511 0ustar mcrmcr/* * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that: (1) source code * distributions retain the above copyright notice and this paragraph * in its entirety, and (2) distributions including binary code include * the above copyright notice and this paragraph in its entirety in * the documentation or other materials provided with the distribution. * THIS SOFTWARE IS PROVIDED ``AS IS'' AND * WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT * LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * FOR A PARTICULAR PURPOSE. * * Original code by Hannes Gredler (hannes@juniper.net) */ #ifndef lint static const char rcsid[] _U_ = "@(#) $Header: /tcpdump/master/tcpdump/print-bfd.c,v 1.5.2.5 2006/02/02 06:36:37 hannes Exp $"; #endif #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include #include "interface.h" #include "extract.h" #include "addrtoname.h" #include "udp.h" /* * Control packet, BFDv0, draft-katz-ward-bfd-01.txt * * 0 1 2 3 * 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * |Vers | Diag |H|D|P|F| Rsvd | Detect Mult | Length | * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * | My Discriminator | * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * | Your Discriminator | * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * | Desired Min TX Interval | * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * | Required Min RX Interval | * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * | Required Min Echo RX Interval | * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ */ /* * Control packet, BFDv1, draft-ietf-bfd-base-02.txt * * 0 1 2 3 * 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * |Vers | Diag |Sta|P|F|C|A|D|R| Detect Mult | Length | * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * | My Discriminator | * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * | Your Discriminator | * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * | Desired Min TX Interval | * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * | Required Min RX Interval | * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * | Required Min Echo RX Interval | * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ */ struct bfd_header_t { u_int8_t version_diag; u_int8_t flags; u_int8_t detect_time_multiplier; u_int8_t length; u_int8_t my_discriminator[4]; u_int8_t your_discriminator[4]; u_int8_t desired_min_tx_interval[4]; u_int8_t required_min_rx_interval[4]; u_int8_t required_min_echo_interval[4]; }; /* * An optional Authentication Header may be present * * 0 1 2 3 * 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * | Auth Type | Auth Len | Authentication Data... | * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ */ struct bfd_auth_header_t { u_int8_t auth_type; u_int8_t auth_len; u_int8_t auth_data; }; static const struct tok bfd_v1_authentication_values[] = { { 0, "Reserved" }, { 1, "Simple Password" }, { 2, "Keyed MD5" }, { 3, "Meticulous Keyed MD5" }, { 4, "Keyed SHA1" }, { 5, "Meticulous Keyed SHA1" }, { 0, NULL } }; #define BFD_EXTRACT_VERSION(x) (((x)&0xe0)>>5) #define BFD_EXTRACT_DIAG(x) ((x)&0x1f) static const struct tok bfd_port_values[] = { { BFD_CONTROL_PORT, "Control" }, { BFD_ECHO_PORT, "Echo" }, { 0, NULL } }; static const struct tok bfd_diag_values[] = { { 0, "No Diagnostic" }, { 1, "Control Detection Time Expired" }, { 2, "Echo Function Failed" }, { 3, "Neighbor Signaled Session Down" }, { 4, "Forwarding Plane Reset" }, { 5, "Path Down" }, { 6, "Concatenated Path Down" }, { 7, "Administratively Down" }, { 8, "Reverse Concatenated Path Down" }, { 0, NULL } }; static const struct tok bfd_v0_flag_values[] = { { 0x80, "I Hear You" }, { 0x40, "Demand" }, { 0x20, "Poll" }, { 0x10, "Final" }, { 0x08, "Reserved" }, { 0x04, "Reserved" }, { 0x02, "Reserved" }, { 0x01, "Reserved" }, { 0, NULL } }; #define BFD_FLAG_AUTH 0x04 static const struct tok bfd_v1_flag_values[] = { { 0x20, "Poll" }, { 0x10, "Final" }, { 0x08, "Control Plane Independent" }, { BFD_FLAG_AUTH, "Authentication Present" }, { 0x02, "Demand" }, { 0x01, "Reserved" }, { 0, NULL } }; static const struct tok bfd_v1_state_values[] = { { 0, "AdminDown" }, { 1, "Down" }, { 2, "Init" }, { 3, "Up" }, { 0, NULL } }; void bfd_print(register const u_char *pptr, register u_int len, register u_int port) { const struct bfd_header_t *bfd_header; const struct bfd_auth_header_t *bfd_auth_header; u_int8_t version; bfd_header = (const struct bfd_header_t *)pptr; TCHECK(*bfd_header); version = BFD_EXTRACT_VERSION(bfd_header->version_diag); switch (port << 8 | version) { /* BFDv0 */ case (BFD_CONTROL_PORT << 8): if (vflag < 1 ) { printf("BFDv%u, %s, Flags: [%s], length: %u", version, tok2str(bfd_port_values, "unknown (%u)", port), bittok2str(bfd_v0_flag_values, "none", bfd_header->flags), len); return; } printf("BFDv%u, length: %u\n\t%s, Flags: [%s], Diagnostic: %s (0x%02x)", version, len, tok2str(bfd_port_values, "unknown (%u)", port), bittok2str(bfd_v0_flag_values, "none", bfd_header->flags), tok2str(bfd_diag_values,"unknown",BFD_EXTRACT_DIAG(bfd_header->version_diag)), BFD_EXTRACT_DIAG(bfd_header->version_diag)); printf("\n\tDetection Timer Multiplier: %u (%u ms Detection time), BFD Length: %u", bfd_header->detect_time_multiplier, bfd_header->detect_time_multiplier * EXTRACT_32BITS(bfd_header->desired_min_tx_interval)/1000, bfd_header->length); printf("\n\tMy Discriminator: 0x%08x", EXTRACT_32BITS(bfd_header->my_discriminator)); printf(", Your Discriminator: 0x%08x", EXTRACT_32BITS(bfd_header->your_discriminator)); printf("\n\t Desired min Tx Interval: %4u ms", EXTRACT_32BITS(bfd_header->desired_min_tx_interval)/1000); printf("\n\t Required min Rx Interval: %4u ms", EXTRACT_32BITS(bfd_header->required_min_rx_interval)/1000); printf("\n\t Required min Echo Interval: %4u ms", EXTRACT_32BITS(bfd_header->required_min_echo_interval)/1000); break; /* BFDv1 */ case (BFD_CONTROL_PORT << 8 | 1): if (vflag < 1 ) { printf("BFDv%u, %s, State %s, Flags: [%s], length: %u", version, tok2str(bfd_port_values, "unknown (%u)", port), tok2str(bfd_v1_state_values, "unknown (%u)", (bfd_header->flags & 0xc0) >> 6), bittok2str(bfd_v1_flag_values, "none", bfd_header->flags & 0x3f), len); return; } printf("BFDv%u, length: %u\n\t%s, State %s, Flags: [%s], Diagnostic: %s (0x%02x)", version, len, tok2str(bfd_port_values, "unknown (%u)", port), tok2str(bfd_v1_state_values, "unknown (%u)", (bfd_header->flags & 0xc0) >> 6), bittok2str(bfd_v1_flag_values, "none", bfd_header->flags & 0x3f), tok2str(bfd_diag_values,"unknown",BFD_EXTRACT_DIAG(bfd_header->version_diag)), BFD_EXTRACT_DIAG(bfd_header->version_diag)); printf("\n\tDetection Timer Multiplier: %u (%u ms Detection time), BFD Length: %u", bfd_header->detect_time_multiplier, bfd_header->detect_time_multiplier * EXTRACT_32BITS(bfd_header->desired_min_tx_interval)/1000, bfd_header->length); printf("\n\tMy Discriminator: 0x%08x", EXTRACT_32BITS(bfd_header->my_discriminator)); printf(", Your Discriminator: 0x%08x", EXTRACT_32BITS(bfd_header->your_discriminator)); printf("\n\t Desired min Tx Interval: %4u ms", EXTRACT_32BITS(bfd_header->desired_min_tx_interval)/1000); printf("\n\t Required min Rx Interval: %4u ms", EXTRACT_32BITS(bfd_header->required_min_rx_interval)/1000); printf("\n\t Required min Echo Interval: %4u ms", EXTRACT_32BITS(bfd_header->required_min_echo_interval)/1000); if (bfd_header->flags & BFD_FLAG_AUTH) { pptr += sizeof (const struct bfd_header_t); bfd_auth_header = (const struct bfd_auth_header_t *)pptr; TCHECK2(*bfd_auth_header, sizeof(const struct bfd_auth_header_t)); printf("\n\t%s (%u) Authentication, length %u present", tok2str(bfd_v1_authentication_values,"Unknown",bfd_auth_header->auth_type), bfd_auth_header->auth_type, bfd_auth_header->auth_len); } break; /* BFDv0 */ case (BFD_ECHO_PORT << 8): /* not yet supported - fall through */ /* BFDv1 */ case (BFD_ECHO_PORT << 8 | 1): default: printf("BFD, %s, length: %u", tok2str(bfd_port_values, "unknown (%u)", port), len); if (vflag >= 1) { if(!print_unknown_data(pptr,"\n\t",len)) return; } break; } return; trunc: printf("[|BFD]"); } tcpdump-3.9.8/./print-atalk.c0000644000026300017500000003624210044670336014072 0ustar mcrmcr/* * Copyright (c) 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997 * The Regents of the University of California. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that: (1) source code distributions * retain the above copyright notice and this paragraph in its entirety, (2) * distributions including binary code include the above copyright notice and * this paragraph in its entirety in the documentation or other materials * provided with the distribution, and (3) all advertising materials mentioning * features or use of this software display the following acknowledgement: * ``This product includes software developed by the University of California, * Lawrence Berkeley Laboratory and its contributors.'' Neither the name of * the University nor the names of its contributors may be used to endorse * or promote products derived from this software without specific prior * written permission. * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * * Format and print AppleTalk packets. */ #ifndef lint static const char rcsid[] _U_ = "@(#) $Header: /tcpdump/master/tcpdump/print-atalk.c,v 1.81 2004/05/01 09:41:50 hannes Exp $ (LBL)"; #endif #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include #include #include #include "interface.h" #include "addrtoname.h" #include "ethertype.h" #include "extract.h" /* must come after interface.h */ #include "appletalk.h" static struct tok type2str[] = { { ddpRTMP, "rtmp" }, { ddpRTMPrequest, "rtmpReq" }, { ddpECHO, "echo" }, { ddpIP, "IP" }, { ddpARP, "ARP" }, { ddpKLAP, "KLAP" }, { 0, NULL } }; struct aarp { u_int16_t htype, ptype; u_int8_t halen, palen; u_int16_t op; u_int8_t hsaddr[6]; u_int8_t psaddr[4]; u_int8_t hdaddr[6]; u_int8_t pdaddr[4]; }; static char tstr[] = "[|atalk]"; static void atp_print(const struct atATP *, u_int); static void atp_bitmap_print(u_char); static void nbp_print(const struct atNBP *, u_int, u_short, u_char, u_char); static const char *print_cstring(const char *, const u_char *); static const struct atNBPtuple *nbp_tuple_print(const struct atNBPtuple *, const u_char *, u_short, u_char, u_char); static const struct atNBPtuple *nbp_name_print(const struct atNBPtuple *, const u_char *); static const char *ataddr_string(u_short, u_char); static void ddp_print(const u_char *, u_int, int, u_short, u_char, u_char); static const char *ddpskt_string(int); /* * Print LLAP packets received on a physical LocalTalk interface. */ u_int ltalk_if_print(const struct pcap_pkthdr *h, const u_char *p) { return (llap_print(p, h->caplen)); } /* * Print AppleTalk LLAP packets. */ u_int llap_print(register const u_char *bp, u_int length) { register const struct LAP *lp; register const struct atDDP *dp; register const struct atShortDDP *sdp; u_short snet; u_int hdrlen; /* * Our packet is on a 4-byte boundary, as we're either called * directly from a top-level link-layer printer (ltalk_if_print) * or from the UDP printer. The LLAP+DDP header is a multiple * of 4 bytes in length, so the DDP payload is also on a 4-byte * boundary, and we don't need to align it before calling * "ddp_print()". */ lp = (const struct LAP *)bp; bp += sizeof(*lp); length -= sizeof(*lp); hdrlen = sizeof(*lp); switch (lp->type) { case lapShortDDP: if (length < ddpSSize) { (void)printf(" [|sddp %d]", length); return (length); } sdp = (const struct atShortDDP *)bp; printf("%s.%s", ataddr_string(0, lp->src), ddpskt_string(sdp->srcSkt)); printf(" > %s.%s:", ataddr_string(0, lp->dst), ddpskt_string(sdp->dstSkt)); bp += ddpSSize; length -= ddpSSize; hdrlen += ddpSSize; ddp_print(bp, length, sdp->type, 0, lp->src, sdp->srcSkt); break; case lapDDP: if (length < ddpSize) { (void)printf(" [|ddp %d]", length); return (length); } dp = (const struct atDDP *)bp; snet = EXTRACT_16BITS(&dp->srcNet); printf("%s.%s", ataddr_string(snet, dp->srcNode), ddpskt_string(dp->srcSkt)); printf(" > %s.%s:", ataddr_string(EXTRACT_16BITS(&dp->dstNet), dp->dstNode), ddpskt_string(dp->dstSkt)); bp += ddpSize; length -= ddpSize; hdrlen += ddpSize; ddp_print(bp, length, dp->type, snet, dp->srcNode, dp->srcSkt); break; #ifdef notdef case lapKLAP: klap_print(bp, length); break; #endif default: printf("%d > %d at-lap#%d %d", lp->src, lp->dst, lp->type, length); break; } return (hdrlen); } /* * Print EtherTalk/TokenTalk packets (or FDDITalk, or whatever it's called * when it runs over FDDI; yes, I've seen FDDI captures with AppleTalk * packets in them). */ void atalk_print(register const u_char *bp, u_int length) { register const struct atDDP *dp; u_short snet; if(!eflag) printf("AT "); if (length < ddpSize) { (void)printf(" [|ddp %d]", length); return; } dp = (const struct atDDP *)bp; snet = EXTRACT_16BITS(&dp->srcNet); printf("%s.%s", ataddr_string(snet, dp->srcNode), ddpskt_string(dp->srcSkt)); printf(" > %s.%s: ", ataddr_string(EXTRACT_16BITS(&dp->dstNet), dp->dstNode), ddpskt_string(dp->dstSkt)); bp += ddpSize; length -= ddpSize; ddp_print(bp, length, dp->type, snet, dp->srcNode, dp->srcSkt); } /* XXX should probably pass in the snap header and do checks like arp_print() */ void aarp_print(register const u_char *bp, u_int length) { register const struct aarp *ap; #define AT(member) ataddr_string((ap->member[1]<<8)|ap->member[2],ap->member[3]) printf("aarp "); ap = (const struct aarp *)bp; if (EXTRACT_16BITS(&ap->htype) == 1 && EXTRACT_16BITS(&ap->ptype) == ETHERTYPE_ATALK && ap->halen == 6 && ap->palen == 4 ) switch (EXTRACT_16BITS(&ap->op)) { case 1: /* request */ (void)printf("who-has %s tell %s", AT(pdaddr), AT(psaddr)); return; case 2: /* response */ (void)printf("reply %s is-at %s", AT(pdaddr), etheraddr_string(ap->hdaddr)); return; case 3: /* probe (oy!) */ (void)printf("probe %s tell %s", AT(pdaddr), AT(psaddr)); return; } (void)printf("len %u op %u htype %u ptype %#x halen %u palen %u", length, EXTRACT_16BITS(&ap->op), EXTRACT_16BITS(&ap->htype), EXTRACT_16BITS(&ap->ptype), ap->halen, ap->palen); } /* * Print AppleTalk Datagram Delivery Protocol packets. */ static void ddp_print(register const u_char *bp, register u_int length, register int t, register u_short snet, register u_char snode, u_char skt) { switch (t) { case ddpNBP: nbp_print((const struct atNBP *)bp, length, snet, snode, skt); break; case ddpATP: atp_print((const struct atATP *)bp, length); break; case ddpEIGRP: eigrp_print(bp, length); break; default: (void)printf(" at-%s %d", tok2str(type2str, NULL, t), length); break; } } static void atp_print(register const struct atATP *ap, u_int length) { char c; u_int32_t data; if ((const u_char *)(ap + 1) > snapend) { /* Just bail if we don't have the whole chunk. */ fputs(tstr, stdout); return; } length -= sizeof(*ap); switch (ap->control & 0xc0) { case atpReqCode: (void)printf(" atp-req%s %d", ap->control & atpXO? " " : "*", EXTRACT_16BITS(&ap->transID)); atp_bitmap_print(ap->bitmap); if (length != 0) (void)printf(" [len=%d]", length); switch (ap->control & (atpEOM|atpSTS)) { case atpEOM: (void)printf(" [EOM]"); break; case atpSTS: (void)printf(" [STS]"); break; case atpEOM|atpSTS: (void)printf(" [EOM,STS]"); break; } break; case atpRspCode: (void)printf(" atp-resp%s%d:%d (%d)", ap->control & atpEOM? "*" : " ", EXTRACT_16BITS(&ap->transID), ap->bitmap, length); switch (ap->control & (atpXO|atpSTS)) { case atpXO: (void)printf(" [XO]"); break; case atpSTS: (void)printf(" [STS]"); break; case atpXO|atpSTS: (void)printf(" [XO,STS]"); break; } break; case atpRelCode: (void)printf(" atp-rel %d", EXTRACT_16BITS(&ap->transID)); atp_bitmap_print(ap->bitmap); /* length should be zero */ if (length) (void)printf(" [len=%d]", length); /* there shouldn't be any control flags */ if (ap->control & (atpXO|atpEOM|atpSTS)) { c = '['; if (ap->control & atpXO) { (void)printf("%cXO", c); c = ','; } if (ap->control & atpEOM) { (void)printf("%cEOM", c); c = ','; } if (ap->control & atpSTS) { (void)printf("%cSTS", c); c = ','; } (void)printf("]"); } break; default: (void)printf(" atp-0x%x %d (%d)", ap->control, EXTRACT_16BITS(&ap->transID), length); break; } data = EXTRACT_32BITS(&ap->userData); if (data != 0) (void)printf(" 0x%x", data); } static void atp_bitmap_print(register u_char bm) { register char c; register int i; /* * The '& 0xff' below is needed for compilers that want to sign * extend a u_char, which is the case with the Ultrix compiler. * (gcc is smart enough to eliminate it, at least on the Sparc). */ if ((bm + 1) & (bm & 0xff)) { c = '<'; for (i = 0; bm; ++i) { if (bm & 1) { (void)printf("%c%d", c, i); c = ','; } bm >>= 1; } (void)printf(">"); } else { for (i = 0; bm; ++i) bm >>= 1; if (i > 1) (void)printf("<0-%d>", i - 1); else (void)printf("<0>"); } } static void nbp_print(register const struct atNBP *np, u_int length, register u_short snet, register u_char snode, register u_char skt) { register const struct atNBPtuple *tp = (const struct atNBPtuple *)((u_char *)np + nbpHeaderSize); int i; const u_char *ep; if (length < nbpHeaderSize) { (void)printf(" truncated-nbp %d", length); return; } length -= nbpHeaderSize; if (length < 8) { /* must be room for at least one tuple */ (void)printf(" truncated-nbp %d", length + nbpHeaderSize); return; } /* ep points to end of available data */ ep = snapend; if ((const u_char *)tp > ep) { fputs(tstr, stdout); return; } switch (i = np->control & 0xf0) { case nbpBrRq: case nbpLkUp: (void)printf(i == nbpLkUp? " nbp-lkup %d:":" nbp-brRq %d:", np->id); if ((const u_char *)(tp + 1) > ep) { fputs(tstr, stdout); return; } (void)nbp_name_print(tp, ep); /* * look for anomalies: the spec says there can only * be one tuple, the address must match the source * address and the enumerator should be zero. */ if ((np->control & 0xf) != 1) (void)printf(" [ntup=%d]", np->control & 0xf); if (tp->enumerator) (void)printf(" [enum=%d]", tp->enumerator); if (EXTRACT_16BITS(&tp->net) != snet || tp->node != snode || tp->skt != skt) (void)printf(" [addr=%s.%d]", ataddr_string(EXTRACT_16BITS(&tp->net), tp->node), tp->skt); break; case nbpLkUpReply: (void)printf(" nbp-reply %d:", np->id); /* print each of the tuples in the reply */ for (i = np->control & 0xf; --i >= 0 && tp; ) tp = nbp_tuple_print(tp, ep, snet, snode, skt); break; default: (void)printf(" nbp-0x%x %d (%d)", np->control, np->id, length); break; } } /* print a counted string */ static const char * print_cstring(register const char *cp, register const u_char *ep) { register u_int length; if (cp >= (const char *)ep) { fputs(tstr, stdout); return (0); } length = *cp++; /* Spec says string can be at most 32 bytes long */ if (length > 32) { (void)printf("[len=%u]", length); return (0); } while ((int)--length >= 0) { if (cp >= (const char *)ep) { fputs(tstr, stdout); return (0); } putchar(*cp++); } return (cp); } static const struct atNBPtuple * nbp_tuple_print(register const struct atNBPtuple *tp, register const u_char *ep, register u_short snet, register u_char snode, register u_char skt) { register const struct atNBPtuple *tpn; if ((const u_char *)(tp + 1) > ep) { fputs(tstr, stdout); return 0; } tpn = nbp_name_print(tp, ep); /* if the enumerator isn't 1, print it */ if (tp->enumerator != 1) (void)printf("(%d)", tp->enumerator); /* if the socket doesn't match the src socket, print it */ if (tp->skt != skt) (void)printf(" %d", tp->skt); /* if the address doesn't match the src address, it's an anomaly */ if (EXTRACT_16BITS(&tp->net) != snet || tp->node != snode) (void)printf(" [addr=%s]", ataddr_string(EXTRACT_16BITS(&tp->net), tp->node)); return (tpn); } static const struct atNBPtuple * nbp_name_print(const struct atNBPtuple *tp, register const u_char *ep) { register const char *cp = (const char *)tp + nbpTupleSize; putchar(' '); /* Object */ putchar('"'); if ((cp = print_cstring(cp, ep)) != NULL) { /* Type */ putchar(':'); if ((cp = print_cstring(cp, ep)) != NULL) { /* Zone */ putchar('@'); if ((cp = print_cstring(cp, ep)) != NULL) putchar('"'); } } return ((const struct atNBPtuple *)cp); } #define HASHNAMESIZE 4096 struct hnamemem { int addr; char *name; struct hnamemem *nxt; }; static struct hnamemem hnametable[HASHNAMESIZE]; static const char * ataddr_string(u_short atnet, u_char athost) { register struct hnamemem *tp, *tp2; register int i = (atnet << 8) | athost; char nambuf[MAXHOSTNAMELEN + 20]; static int first = 1; FILE *fp; /* * if this is the first call, see if there's an AppleTalk * number to name map file. */ if (first && (first = 0, !nflag) && (fp = fopen("/etc/atalk.names", "r"))) { char line[256]; int i1, i2, i3; while (fgets(line, sizeof(line), fp)) { if (line[0] == '\n' || line[0] == 0 || line[0] == '#') continue; if (sscanf(line, "%d.%d.%d %256s", &i1, &i2, &i3, nambuf) == 4) /* got a hostname. */ i3 |= ((i1 << 8) | i2) << 8; else if (sscanf(line, "%d.%d %256s", &i1, &i2, nambuf) == 3) /* got a net name */ i3 = (((i1 << 8) | i2) << 8) | 255; else continue; for (tp = &hnametable[i3 & (HASHNAMESIZE-1)]; tp->nxt; tp = tp->nxt) ; tp->addr = i3; tp->nxt = newhnamemem(); tp->name = strdup(nambuf); } fclose(fp); } for (tp = &hnametable[i & (HASHNAMESIZE-1)]; tp->nxt; tp = tp->nxt) if (tp->addr == i) return (tp->name); /* didn't have the node name -- see if we've got the net name */ i |= 255; for (tp2 = &hnametable[i & (HASHNAMESIZE-1)]; tp2->nxt; tp2 = tp2->nxt) if (tp2->addr == i) { tp->addr = (atnet << 8) | athost; tp->nxt = newhnamemem(); (void)snprintf(nambuf, sizeof(nambuf), "%s.%d", tp2->name, athost); tp->name = strdup(nambuf); return (tp->name); } tp->addr = (atnet << 8) | athost; tp->nxt = newhnamemem(); if (athost != 255) (void)snprintf(nambuf, sizeof(nambuf), "%d.%d.%d", atnet >> 8, atnet & 0xff, athost); else (void)snprintf(nambuf, sizeof(nambuf), "%d.%d", atnet >> 8, atnet & 0xff); tp->name = strdup(nambuf); return (tp->name); } static struct tok skt2str[] = { { rtmpSkt, "rtmp" }, /* routing table maintenance */ { nbpSkt, "nis" }, /* name info socket */ { echoSkt, "echo" }, /* AppleTalk echo protocol */ { zipSkt, "zip" }, /* zone info protocol */ { 0, NULL } }; static const char * ddpskt_string(register int skt) { static char buf[8]; if (nflag) { (void)snprintf(buf, sizeof(buf), "%d", skt); return (buf); } return (tok2str(skt2str, "%d", skt)); } tcpdump-3.9.8/./addrtoname.c0000644000026300017500000007253110676336430013770 0ustar mcrmcr/* * Copyright (c) 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997 * The Regents of the University of California. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that: (1) source code distributions * retain the above copyright notice and this paragraph in its entirety, (2) * distributions including binary code include the above copyright notice and * this paragraph in its entirety in the documentation or other materials * provided with the distribution, and (3) all advertising materials mentioning * features or use of this software display the following acknowledgement: * ``This product includes software developed by the University of California, * Lawrence Berkeley Laboratory and its contributors.'' Neither the name of * the University nor the names of its contributors may be used to endorse * or promote products derived from this software without specific prior * written permission. * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * * Internet, ethernet, port, and protocol string to address * and address to string conversion routines */ #ifndef lint static const char rcsid[] _U_ = "@(#) $Header: /tcpdump/master/tcpdump/addrtoname.c,v 1.108.2.9 2007/09/14 00:26:18 guy Exp $ (LBL)"; #endif #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #ifdef USE_ETHER_NTOHOST #ifdef HAVE_NETINET_IF_ETHER_H struct mbuf; /* Squelch compiler warnings on some platforms for */ struct rtentry; /* declarations in */ #include /* for "struct ifnet" in "struct arpcom" on Solaris */ #include #endif /* HAVE_NETINET_IF_ETHER_H */ #ifdef NETINET_ETHER_H_DECLARES_ETHER_NTOHOST #include #endif /* NETINET_ETHER_H_DECLARES_ETHER_NTOHOST */ #if !defined(HAVE_DECL_ETHER_NTOHOST) || !HAVE_DECL_ETHER_NTOHOST #ifndef HAVE_STRUCT_ETHER_ADDR struct ether_addr { unsigned char ether_addr_octet[6]; }; #endif extern int ether_ntohost(char *, const struct ether_addr *); #endif #endif /* USE_ETHER_NTOHOST */ #include #include #include #include #include #include #include "interface.h" #include "addrtoname.h" #include "llc.h" #include "setsignal.h" #include "extract.h" #include "oui.h" #ifndef ETHER_ADDR_LEN #define ETHER_ADDR_LEN 6 #endif /* * hash tables for whatever-to-name translations * * XXX there has to be error checks against strdup(3) failure */ #define HASHNAMESIZE 4096 #define BUFSIZE 128 struct hnamemem { u_int32_t addr; const char *name; struct hnamemem *nxt; }; struct hnamemem hnametable[HASHNAMESIZE]; struct hnamemem tporttable[HASHNAMESIZE]; struct hnamemem uporttable[HASHNAMESIZE]; struct hnamemem eprototable[HASHNAMESIZE]; struct hnamemem dnaddrtable[HASHNAMESIZE]; struct hnamemem ipxsaptable[HASHNAMESIZE]; #if defined(INET6) && defined(WIN32) /* * fake gethostbyaddr for Win2k/XP * gethostbyaddr() returns incorrect value when AF_INET6 is passed * to 3rd argument. * * h_name in struct hostent is only valid. */ static struct hostent * win32_gethostbyaddr(const char *addr, int len, int type) { static struct hostent host; static char hostbuf[NI_MAXHOST]; char hname[NI_MAXHOST]; struct sockaddr_in6 addr6; host.h_name = hostbuf; switch (type) { case AF_INET: return gethostbyaddr(addr, len, type); break; case AF_INET6: memset(&addr6, 0, sizeof(addr6)); addr6.sin6_family = AF_INET6; memcpy(&addr6.sin6_addr, addr, len); if (getnameinfo((struct sockaddr *)&addr6, sizeof(addr6), hname, sizeof(hname), NULL, 0, 0)) { return NULL; } else { strcpy(host.h_name, hname); return &host; } break; default: return NULL; } } #define gethostbyaddr win32_gethostbyaddr #endif /* INET6 & WIN32 */ #ifdef INET6 struct h6namemem { struct in6_addr addr; char *name; struct h6namemem *nxt; }; struct h6namemem h6nametable[HASHNAMESIZE]; #endif /* INET6 */ struct enamemem { u_short e_addr0; u_short e_addr1; u_short e_addr2; const char *e_name; u_char *e_nsap; /* used only for nsaptable[] */ #define e_bs e_nsap /* for bytestringtable */ struct enamemem *e_nxt; }; struct enamemem enametable[HASHNAMESIZE]; struct enamemem nsaptable[HASHNAMESIZE]; struct enamemem bytestringtable[HASHNAMESIZE]; struct protoidmem { u_int32_t p_oui; u_short p_proto; const char *p_name; struct protoidmem *p_nxt; }; struct protoidmem protoidtable[HASHNAMESIZE]; /* * A faster replacement for inet_ntoa(). */ const char * intoa(u_int32_t addr) { register char *cp; register u_int byte; register int n; static char buf[sizeof(".xxx.xxx.xxx.xxx")]; NTOHL(addr); cp = buf + sizeof(buf); *--cp = '\0'; n = 4; do { byte = addr & 0xff; *--cp = byte % 10 + '0'; byte /= 10; if (byte > 0) { *--cp = byte % 10 + '0'; byte /= 10; if (byte > 0) *--cp = byte + '0'; } *--cp = '.'; addr >>= 8; } while (--n > 0); return cp + 1; } static u_int32_t f_netmask; static u_int32_t f_localnet; /* * Return a name for the IP address pointed to by ap. This address * is assumed to be in network byte order. * * NOTE: ap is *NOT* necessarily part of the packet data (not even if * this is being called with the "ipaddr_string()" macro), so you * *CANNOT* use the TCHECK{2}/TTEST{2} macros on it. Furthermore, * even in cases where it *is* part of the packet data, the caller * would still have to check for a null return value, even if it's * just printing the return value with "%s" - not all versions of * printf print "(null)" with "%s" and a null pointer, some of them * don't check for a null pointer and crash in that case. * * The callers of this routine should, before handing this routine * a pointer to packet data, be sure that the data is present in * the packet buffer. They should probably do those checks anyway, * as other data at that layer might not be IP addresses, and it * also needs to check whether they're present in the packet buffer. */ const char * getname(const u_char *ap) { register struct hostent *hp; u_int32_t addr; static struct hnamemem *p; /* static for longjmp() */ memcpy(&addr, ap, sizeof(addr)); p = &hnametable[addr & (HASHNAMESIZE-1)]; for (; p->nxt; p = p->nxt) { if (p->addr == addr) return (p->name); } p->addr = addr; p->nxt = newhnamemem(); /* * Print names unless: * (1) -n was given. * (2) Address is foreign and -f was given. (If -f was not * given, f_netmask and f_localnet are 0 and the test * evaluates to true) */ if (!nflag && (addr & f_netmask) == f_localnet) { hp = gethostbyaddr((char *)&addr, 4, AF_INET); if (hp) { char *dotp; p->name = strdup(hp->h_name); if (Nflag) { /* Remove domain qualifications */ dotp = strchr(p->name, '.'); if (dotp) *dotp = '\0'; } return (p->name); } } p->name = strdup(intoa(addr)); return (p->name); } #ifdef INET6 /* * Return a name for the IP6 address pointed to by ap. This address * is assumed to be in network byte order. */ const char * getname6(const u_char *ap) { register struct hostent *hp; struct in6_addr addr; static struct h6namemem *p; /* static for longjmp() */ register const char *cp; char ntop_buf[INET6_ADDRSTRLEN]; memcpy(&addr, ap, sizeof(addr)); p = &h6nametable[*(u_int16_t *)&addr.s6_addr[14] & (HASHNAMESIZE-1)]; for (; p->nxt; p = p->nxt) { if (memcmp(&p->addr, &addr, sizeof(addr)) == 0) return (p->name); } p->addr = addr; p->nxt = newh6namemem(); /* * Do not print names if -n was given. */ if (!nflag) { hp = gethostbyaddr((char *)&addr, sizeof(addr), AF_INET6); if (hp) { char *dotp; p->name = strdup(hp->h_name); if (Nflag) { /* Remove domain qualifications */ dotp = strchr(p->name, '.'); if (dotp) *dotp = '\0'; } return (p->name); } } cp = inet_ntop(AF_INET6, &addr, ntop_buf, sizeof(ntop_buf)); p->name = strdup(cp); return (p->name); } #endif /* INET6 */ static char hex[] = "0123456789abcdef"; /* Find the hash node that corresponds the ether address 'ep' */ static inline struct enamemem * lookup_emem(const u_char *ep) { register u_int i, j, k; struct enamemem *tp; k = (ep[0] << 8) | ep[1]; j = (ep[2] << 8) | ep[3]; i = (ep[4] << 8) | ep[5]; tp = &enametable[(i ^ j) & (HASHNAMESIZE-1)]; while (tp->e_nxt) if (tp->e_addr0 == i && tp->e_addr1 == j && tp->e_addr2 == k) return tp; else tp = tp->e_nxt; tp->e_addr0 = i; tp->e_addr1 = j; tp->e_addr2 = k; tp->e_nxt = (struct enamemem *)calloc(1, sizeof(*tp)); if (tp->e_nxt == NULL) error("lookup_emem: calloc"); return tp; } /* * Find the hash node that corresponds to the bytestring 'bs' * with length 'nlen' */ static inline struct enamemem * lookup_bytestring(register const u_char *bs, const unsigned int nlen) { struct enamemem *tp; register u_int i, j, k; if (nlen >= 6) { k = (bs[0] << 8) | bs[1]; j = (bs[2] << 8) | bs[3]; i = (bs[4] << 8) | bs[5]; } else if (nlen >= 4) { k = (bs[0] << 8) | bs[1]; j = (bs[2] << 8) | bs[3]; i = 0; } else i = j = k = 0; tp = &bytestringtable[(i ^ j) & (HASHNAMESIZE-1)]; while (tp->e_nxt) if (tp->e_addr0 == i && tp->e_addr1 == j && tp->e_addr2 == k && memcmp((const char *)bs, (const char *)(tp->e_bs), nlen) == 0) return tp; else tp = tp->e_nxt; tp->e_addr0 = i; tp->e_addr1 = j; tp->e_addr2 = k; tp->e_bs = (u_char *) calloc(1, nlen + 1); memcpy(tp->e_bs, bs, nlen); tp->e_nxt = (struct enamemem *)calloc(1, sizeof(*tp)); if (tp->e_nxt == NULL) error("lookup_bytestring: calloc"); return tp; } /* Find the hash node that corresponds the NSAP 'nsap' */ static inline struct enamemem * lookup_nsap(register const u_char *nsap) { register u_int i, j, k; unsigned int nlen = *nsap; struct enamemem *tp; const u_char *ensap = nsap + nlen - 6; if (nlen > 6) { k = (ensap[0] << 8) | ensap[1]; j = (ensap[2] << 8) | ensap[3]; i = (ensap[4] << 8) | ensap[5]; } else i = j = k = 0; tp = &nsaptable[(i ^ j) & (HASHNAMESIZE-1)]; while (tp->e_nxt) if (tp->e_addr0 == i && tp->e_addr1 == j && tp->e_addr2 == k && tp->e_nsap[0] == nlen && memcmp((const char *)&(nsap[1]), (char *)&(tp->e_nsap[1]), nlen) == 0) return tp; else tp = tp->e_nxt; tp->e_addr0 = i; tp->e_addr1 = j; tp->e_addr2 = k; tp->e_nsap = (u_char *)malloc(nlen + 1); if (tp->e_nsap == NULL) error("lookup_nsap: malloc"); memcpy((char *)tp->e_nsap, (const char *)nsap, nlen + 1); tp->e_nxt = (struct enamemem *)calloc(1, sizeof(*tp)); if (tp->e_nxt == NULL) error("lookup_nsap: calloc"); return tp; } /* Find the hash node that corresponds the protoid 'pi'. */ static inline struct protoidmem * lookup_protoid(const u_char *pi) { register u_int i, j; struct protoidmem *tp; /* 5 octets won't be aligned */ i = (((pi[0] << 8) + pi[1]) << 8) + pi[2]; j = (pi[3] << 8) + pi[4]; /* XXX should be endian-insensitive, but do big-endian testing XXX */ tp = &protoidtable[(i ^ j) & (HASHNAMESIZE-1)]; while (tp->p_nxt) if (tp->p_oui == i && tp->p_proto == j) return tp; else tp = tp->p_nxt; tp->p_oui = i; tp->p_proto = j; tp->p_nxt = (struct protoidmem *)calloc(1, sizeof(*tp)); if (tp->p_nxt == NULL) error("lookup_protoid: calloc"); return tp; } const char * etheraddr_string(register const u_char *ep) { register int i; register char *cp; register struct enamemem *tp; int oui; char buf[BUFSIZE]; tp = lookup_emem(ep); if (tp->e_name) return (tp->e_name); #ifdef USE_ETHER_NTOHOST if (!nflag) { char buf2[BUFSIZE]; /* * We don't cast it to "const struct ether_addr *" * because some systems fail to declare the second * argument as a "const" pointer, even though they * don't modify what it points to. */ if (ether_ntohost(buf2, (struct ether_addr *)ep) == 0) { tp->e_name = strdup(buf2); return (tp->e_name); } } #endif cp = buf; oui = EXTRACT_24BITS(ep); *cp++ = hex[*ep >> 4 ]; *cp++ = hex[*ep++ & 0xf]; for (i = 5; --i >= 0;) { *cp++ = ':'; *cp++ = hex[*ep >> 4 ]; *cp++ = hex[*ep++ & 0xf]; } if (!nflag) { snprintf(cp, BUFSIZE - (2 + 5*3), " (oui %s)", tok2str(oui_values, "Unknown", oui)); } else *cp = '\0'; tp->e_name = strdup(buf); return (tp->e_name); } const char * linkaddr_string(const u_char *ep, const unsigned int len) { register u_int i; register char *cp; register struct enamemem *tp; if (len == ETHER_ADDR_LEN) /* XXX not totally correct... */ return etheraddr_string(ep); tp = lookup_bytestring(ep, len); if (tp->e_name) return (tp->e_name); tp->e_name = cp = (char *)malloc(len*3); if (tp->e_name == NULL) error("linkaddr_string: malloc"); *cp++ = hex[*ep >> 4]; *cp++ = hex[*ep++ & 0xf]; for (i = len-1; i > 0 ; --i) { *cp++ = ':'; *cp++ = hex[*ep >> 4]; *cp++ = hex[*ep++ & 0xf]; } *cp = '\0'; return (tp->e_name); } const char * etherproto_string(u_short port) { register char *cp; register struct hnamemem *tp; register u_int32_t i = port; char buf[sizeof("0000")]; for (tp = &eprototable[i & (HASHNAMESIZE-1)]; tp->nxt; tp = tp->nxt) if (tp->addr == i) return (tp->name); tp->addr = i; tp->nxt = newhnamemem(); cp = buf; NTOHS(port); *cp++ = hex[port >> 12 & 0xf]; *cp++ = hex[port >> 8 & 0xf]; *cp++ = hex[port >> 4 & 0xf]; *cp++ = hex[port & 0xf]; *cp++ = '\0'; tp->name = strdup(buf); return (tp->name); } const char * protoid_string(register const u_char *pi) { register u_int i, j; register char *cp; register struct protoidmem *tp; char buf[sizeof("00:00:00:00:00")]; tp = lookup_protoid(pi); if (tp->p_name) return tp->p_name; cp = buf; if ((j = *pi >> 4) != 0) *cp++ = hex[j]; *cp++ = hex[*pi++ & 0xf]; for (i = 4; (int)--i >= 0;) { *cp++ = ':'; if ((j = *pi >> 4) != 0) *cp++ = hex[j]; *cp++ = hex[*pi++ & 0xf]; } *cp = '\0'; tp->p_name = strdup(buf); return (tp->p_name); } #define ISONSAP_MAX_LENGTH 20 const char * isonsap_string(const u_char *nsap, register u_int nsap_length) { register u_int nsap_idx; register char *cp; register struct enamemem *tp; if (nsap_length < 1 || nsap_length > ISONSAP_MAX_LENGTH) return ("isonsap_string: illegal length"); tp = lookup_nsap(nsap); if (tp->e_name) return tp->e_name; tp->e_name = cp = (char *)malloc(sizeof("xx.xxxx.xxxx.xxxx.xxxx.xxxx.xxxx.xxxx.xxxx.xxxx.xx")); if (cp == NULL) error("isonsap_string: malloc"); for (nsap_idx = 0; nsap_idx < nsap_length; nsap_idx++) { *cp++ = hex[*nsap >> 4]; *cp++ = hex[*nsap++ & 0xf]; if (((nsap_idx & 1) == 0) && (nsap_idx + 1 < nsap_length)) { *cp++ = '.'; } } *cp = '\0'; return (tp->e_name); } const char * tcpport_string(u_short port) { register struct hnamemem *tp; register u_int32_t i = port; char buf[sizeof("00000")]; for (tp = &tporttable[i & (HASHNAMESIZE-1)]; tp->nxt; tp = tp->nxt) if (tp->addr == i) return (tp->name); tp->addr = i; tp->nxt = newhnamemem(); (void)snprintf(buf, sizeof(buf), "%u", i); tp->name = strdup(buf); return (tp->name); } const char * udpport_string(register u_short port) { register struct hnamemem *tp; register u_int32_t i = port; char buf[sizeof("00000")]; for (tp = &uporttable[i & (HASHNAMESIZE-1)]; tp->nxt; tp = tp->nxt) if (tp->addr == i) return (tp->name); tp->addr = i; tp->nxt = newhnamemem(); (void)snprintf(buf, sizeof(buf), "%u", i); tp->name = strdup(buf); return (tp->name); } const char * ipxsap_string(u_short port) { register char *cp; register struct hnamemem *tp; register u_int32_t i = port; char buf[sizeof("0000")]; for (tp = &ipxsaptable[i & (HASHNAMESIZE-1)]; tp->nxt; tp = tp->nxt) if (tp->addr == i) return (tp->name); tp->addr = i; tp->nxt = newhnamemem(); cp = buf; NTOHS(port); *cp++ = hex[port >> 12 & 0xf]; *cp++ = hex[port >> 8 & 0xf]; *cp++ = hex[port >> 4 & 0xf]; *cp++ = hex[port & 0xf]; *cp++ = '\0'; tp->name = strdup(buf); return (tp->name); } static void init_servarray(void) { struct servent *sv; register struct hnamemem *table; register int i; char buf[sizeof("0000000000")]; while ((sv = getservent()) != NULL) { int port = ntohs(sv->s_port); i = port & (HASHNAMESIZE-1); if (strcmp(sv->s_proto, "tcp") == 0) table = &tporttable[i]; else if (strcmp(sv->s_proto, "udp") == 0) table = &uporttable[i]; else continue; while (table->name) table = table->nxt; if (nflag) { (void)snprintf(buf, sizeof(buf), "%d", port); table->name = strdup(buf); } else table->name = strdup(sv->s_name); table->addr = port; table->nxt = newhnamemem(); } endservent(); } /* in libpcap.a (nametoaddr.c) */ #if defined(WIN32) && !defined(USE_STATIC_LIBPCAP) __declspec(dllimport) #else extern #endif const struct eproto { const char *s; u_short p; } eproto_db[]; static void init_eprotoarray(void) { register int i; register struct hnamemem *table; for (i = 0; eproto_db[i].s; i++) { int j = htons(eproto_db[i].p) & (HASHNAMESIZE-1); table = &eprototable[j]; while (table->name) table = table->nxt; table->name = eproto_db[i].s; table->addr = htons(eproto_db[i].p); table->nxt = newhnamemem(); } } static struct protoidlist { const u_char protoid[5]; const char *name; } protoidlist[] = { {{ 0x00, 0x00, 0x0c, 0x01, 0x07 }, "CiscoMLS" }, {{ 0x00, 0x00, 0x0c, 0x20, 0x00 }, "CiscoCDP" }, {{ 0x00, 0x00, 0x0c, 0x20, 0x01 }, "CiscoCGMP" }, {{ 0x00, 0x00, 0x0c, 0x20, 0x03 }, "CiscoVTP" }, {{ 0x00, 0xe0, 0x2b, 0x00, 0xbb }, "ExtremeEDP" }, {{ 0x00, 0x00, 0x00, 0x00, 0x00 }, NULL } }; /* * SNAP proto IDs with org code 0:0:0 are actually encapsulated Ethernet * types. */ static void init_protoidarray(void) { register int i; register struct protoidmem *tp; struct protoidlist *pl; u_char protoid[5]; protoid[0] = 0; protoid[1] = 0; protoid[2] = 0; for (i = 0; eproto_db[i].s; i++) { u_short etype = htons(eproto_db[i].p); memcpy((char *)&protoid[3], (char *)&etype, 2); tp = lookup_protoid(protoid); tp->p_name = strdup(eproto_db[i].s); } /* Hardwire some SNAP proto ID names */ for (pl = protoidlist; pl->name != NULL; ++pl) { tp = lookup_protoid(pl->protoid); /* Don't override existing name */ if (tp->p_name != NULL) continue; tp->p_name = pl->name; } } static struct etherlist { const u_char addr[6]; const char *name; } etherlist[] = { {{ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff }, "Broadcast" }, {{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, NULL } }; /* * Initialize the ethers hash table. We take two different approaches * depending on whether or not the system provides the ethers name * service. If it does, we just wire in a few names at startup, * and etheraddr_string() fills in the table on demand. If it doesn't, * then we suck in the entire /etc/ethers file at startup. The idea * is that parsing the local file will be fast, but spinning through * all the ethers entries via NIS & next_etherent might be very slow. * * XXX pcap_next_etherent doesn't belong in the pcap interface, but * since the pcap module already does name-to-address translation, * it's already does most of the work for the ethernet address-to-name * translation, so we just pcap_next_etherent as a convenience. */ static void init_etherarray(void) { register struct etherlist *el; register struct enamemem *tp; #ifdef USE_ETHER_NTOHOST char name[256]; #else register struct pcap_etherent *ep; register FILE *fp; /* Suck in entire ethers file */ fp = fopen(PCAP_ETHERS_FILE, "r"); if (fp != NULL) { while ((ep = pcap_next_etherent(fp)) != NULL) { tp = lookup_emem(ep->addr); tp->e_name = strdup(ep->name); } (void)fclose(fp); } #endif /* Hardwire some ethernet names */ for (el = etherlist; el->name != NULL; ++el) { tp = lookup_emem(el->addr); /* Don't override existing name */ if (tp->e_name != NULL) continue; #ifdef USE_ETHER_NTOHOST /* * Use YP/NIS version of name if available. * * We don't cast it to "const struct ether_addr *" * because some systems don't modify the Ethernet * address but fail to declare the second argument * as a "const" pointer. */ if (ether_ntohost(name, (struct ether_addr *)el->addr) == 0) { tp->e_name = strdup(name); continue; } #endif tp->e_name = el->name; } } static struct tok ipxsap_db[] = { { 0x0000, "Unknown" }, { 0x0001, "User" }, { 0x0002, "User Group" }, { 0x0003, "PrintQueue" }, { 0x0004, "FileServer" }, { 0x0005, "JobServer" }, { 0x0006, "Gateway" }, { 0x0007, "PrintServer" }, { 0x0008, "ArchiveQueue" }, { 0x0009, "ArchiveServer" }, { 0x000a, "JobQueue" }, { 0x000b, "Administration" }, { 0x000F, "Novell TI-RPC" }, { 0x0017, "Diagnostics" }, { 0x0020, "NetBIOS" }, { 0x0021, "NAS SNA Gateway" }, { 0x0023, "NACS AsyncGateway" }, { 0x0024, "RemoteBridge/RoutingService" }, { 0x0026, "BridgeServer" }, { 0x0027, "TCP/IP Gateway" }, { 0x0028, "Point-to-point X.25 BridgeServer" }, { 0x0029, "3270 Gateway" }, { 0x002a, "CHI Corp" }, { 0x002c, "PC Chalkboard" }, { 0x002d, "TimeSynchServer" }, { 0x002e, "ARCserve5.0/PalindromeBackup" }, { 0x0045, "DI3270 Gateway" }, { 0x0047, "AdvertisingPrintServer" }, { 0x004a, "NetBlazerModems" }, { 0x004b, "BtrieveVAP" }, { 0x004c, "NetwareSQL" }, { 0x004d, "XtreeNetwork" }, { 0x0050, "BtrieveVAP4.11" }, { 0x0052, "QuickLink" }, { 0x0053, "PrintQueueUser" }, { 0x0058, "Multipoint X.25 Router" }, { 0x0060, "STLB/NLM" }, { 0x0064, "ARCserve" }, { 0x0066, "ARCserve3.0" }, { 0x0072, "WAN CopyUtility" }, { 0x007a, "TES-NetwareVMS" }, { 0x0092, "WATCOM Debugger/EmeraldTapeBackupServer" }, { 0x0095, "DDA OBGYN" }, { 0x0098, "NetwareAccessServer" }, { 0x009a, "Netware for VMS II/NamedPipeServer" }, { 0x009b, "NetwareAccessServer" }, { 0x009e, "PortableNetwareServer/SunLinkNVT" }, { 0x00a1, "PowerchuteAPC UPS" }, { 0x00aa, "LAWserve" }, { 0x00ac, "CompaqIDA StatusMonitor" }, { 0x0100, "PIPE STAIL" }, { 0x0102, "LAN ProtectBindery" }, { 0x0103, "OracleDataBaseServer" }, { 0x0107, "Netware386/RSPX RemoteConsole" }, { 0x010f, "NovellSNA Gateway" }, { 0x0111, "TestServer" }, { 0x0112, "HP PrintServer" }, { 0x0114, "CSA MUX" }, { 0x0115, "CSA LCA" }, { 0x0116, "CSA CM" }, { 0x0117, "CSA SMA" }, { 0x0118, "CSA DBA" }, { 0x0119, "CSA NMA" }, { 0x011a, "CSA SSA" }, { 0x011b, "CSA STATUS" }, { 0x011e, "CSA APPC" }, { 0x0126, "SNA TEST SSA Profile" }, { 0x012a, "CSA TRACE" }, { 0x012b, "NetwareSAA" }, { 0x012e, "IKARUS VirusScan" }, { 0x0130, "CommunicationsExecutive" }, { 0x0133, "NNS DomainServer/NetwareNamingServicesDomain" }, { 0x0135, "NetwareNamingServicesProfile" }, { 0x0137, "Netware386 PrintQueue/NNS PrintQueue" }, { 0x0141, "LAN SpoolServer" }, { 0x0152, "IRMALAN Gateway" }, { 0x0154, "NamedPipeServer" }, { 0x0166, "NetWareManagement" }, { 0x0168, "Intel PICKIT CommServer/Intel CAS TalkServer" }, { 0x0173, "Compaq" }, { 0x0174, "Compaq SNMP Agent" }, { 0x0175, "Compaq" }, { 0x0180, "XTreeServer/XTreeTools" }, { 0x018A, "NASI ServicesBroadcastServer" }, { 0x01b0, "GARP Gateway" }, { 0x01b1, "Binfview" }, { 0x01bf, "IntelLanDeskManager" }, { 0x01ca, "AXTEC" }, { 0x01cb, "ShivaNetModem/E" }, { 0x01cc, "ShivaLanRover/E" }, { 0x01cd, "ShivaLanRover/T" }, { 0x01ce, "ShivaUniversal" }, { 0x01d8, "CastelleFAXPressServer" }, { 0x01da, "CastelleLANPressPrintServer" }, { 0x01dc, "CastelleFAX/Xerox7033 FaxServer/ExcelLanFax" }, { 0x01f0, "LEGATO" }, { 0x01f5, "LEGATO" }, { 0x0233, "NMS Agent/NetwareManagementAgent" }, { 0x0237, "NMS IPX Discovery/LANternReadWriteChannel" }, { 0x0238, "NMS IP Discovery/LANternTrapAlarmChannel" }, { 0x023a, "LANtern" }, { 0x023c, "MAVERICK" }, { 0x023f, "NovellSMDR" }, { 0x024e, "NetwareConnect" }, { 0x024f, "NASI ServerBroadcast Cisco" }, { 0x026a, "NMS ServiceConsole" }, { 0x026b, "TimeSynchronizationServer Netware 4.x" }, { 0x0278, "DirectoryServer Netware 4.x" }, { 0x027b, "NetwareManagementAgent" }, { 0x0280, "Novell File and Printer Sharing Service for PC" }, { 0x0304, "NovellSAA Gateway" }, { 0x0308, "COM/VERMED" }, { 0x030a, "GalacticommWorldgroupServer" }, { 0x030c, "IntelNetport2/HP JetDirect/HP Quicksilver" }, { 0x0320, "AttachmateGateway" }, { 0x0327, "MicrosoftDiagnostiocs" }, { 0x0328, "WATCOM SQL Server" }, { 0x0335, "MultiTechSystems MultisynchCommServer" }, { 0x0343, "Xylogics RemoteAccessServer/LANModem" }, { 0x0355, "ArcadaBackupExec" }, { 0x0358, "MSLCD1" }, { 0x0361, "NETINELO" }, { 0x037e, "Powerchute UPS Monitoring" }, { 0x037f, "ViruSafeNotify" }, { 0x0386, "HP Bridge" }, { 0x0387, "HP Hub" }, { 0x0394, "NetWare SAA Gateway" }, { 0x039b, "LotusNotes" }, { 0x03b7, "CertusAntiVirus" }, { 0x03c4, "ARCserve4.0" }, { 0x03c7, "LANspool3.5" }, { 0x03d7, "LexmarkPrinterServer" }, { 0x03d8, "LexmarkXLE PrinterServer" }, { 0x03dd, "BanyanENS NetwareClient" }, { 0x03de, "GuptaSequelBaseServer/NetWareSQL" }, { 0x03e1, "UnivelUnixware" }, { 0x03e4, "UnivelUnixware" }, { 0x03fc, "IntelNetport" }, { 0x03fd, "PrintServerQueue" }, { 0x040A, "ipnServer" }, { 0x040D, "LVERRMAN" }, { 0x040E, "LVLIC" }, { 0x0414, "NET Silicon (DPI)/Kyocera" }, { 0x0429, "SiteLockVirus" }, { 0x0432, "UFHELPR???" }, { 0x0433, "Synoptics281xAdvancedSNMPAgent" }, { 0x0444, "MicrosoftNT SNA Server" }, { 0x0448, "Oracle" }, { 0x044c, "ARCserve5.01" }, { 0x0457, "CanonGP55" }, { 0x045a, "QMS Printers" }, { 0x045b, "DellSCSI Array" }, { 0x0491, "NetBlazerModems" }, { 0x04ac, "OnTimeScheduler" }, { 0x04b0, "CD-Net" }, { 0x0513, "EmulexNQA" }, { 0x0520, "SiteLockChecks" }, { 0x0529, "SiteLockChecks" }, { 0x052d, "CitrixOS2 AppServer" }, { 0x0535, "Tektronix" }, { 0x0536, "Milan" }, { 0x055d, "Attachmate SNA gateway" }, { 0x056b, "IBM8235 ModemServer" }, { 0x056c, "ShivaLanRover/E PLUS" }, { 0x056d, "ShivaLanRover/T PLUS" }, { 0x0580, "McAfeeNetShield" }, { 0x05B8, "NLM to workstation communication (Revelation Software)" }, { 0x05BA, "CompatibleSystemsRouters" }, { 0x05BE, "CheyenneHierarchicalStorageManager" }, { 0x0606, "JCWatermarkImaging" }, { 0x060c, "AXISNetworkPrinter" }, { 0x0610, "AdaptecSCSIManagement" }, { 0x0621, "IBM AntiVirus" }, { 0x0640, "Windows95 RemoteRegistryService" }, { 0x064e, "MicrosoftIIS" }, { 0x067b, "Microsoft Win95/98 File and Print Sharing for NetWare" }, { 0x067c, "Microsoft Win95/98 File and Print Sharing for NetWare" }, { 0x076C, "Xerox" }, { 0x079b, "ShivaLanRover/E 115" }, { 0x079c, "ShivaLanRover/T 115" }, { 0x07B4, "CubixWorldDesk" }, { 0x07c2, "Quarterdeck IWare Connect V2.x NLM" }, { 0x07c1, "Quarterdeck IWare Connect V3.x NLM" }, { 0x0810, "ELAN License Server Demo" }, { 0x0824, "ShivaLanRoverAccessSwitch/E" }, { 0x086a, "ISSC Collector" }, { 0x087f, "ISSC DAS AgentAIX" }, { 0x0880, "Intel Netport PRO" }, { 0x0881, "Intel Netport PRO" }, { 0x0b29, "SiteLock" }, { 0x0c29, "SiteLockApplications" }, { 0x0c2c, "LicensingServer" }, { 0x2101, "PerformanceTechnologyInstantInternet" }, { 0x2380, "LAI SiteLock" }, { 0x238c, "MeetingMaker" }, { 0x4808, "SiteLockServer/SiteLockMetering" }, { 0x5555, "SiteLockUser" }, { 0x6312, "Tapeware" }, { 0x6f00, "RabbitGateway" }, { 0x7703, "MODEM" }, { 0x8002, "NetPortPrinters" }, { 0x8008, "WordPerfectNetworkVersion" }, { 0x85BE, "Cisco EIGRP" }, { 0x8888, "WordPerfectNetworkVersion/QuickNetworkManagement" }, { 0x9000, "McAfeeNetShield" }, { 0x9604, "CSA-NT_MON" }, { 0xb6a8, "OceanIsleReachoutRemoteControl" }, { 0xf11f, "SiteLockMetering" }, { 0xf1ff, "SiteLock" }, { 0xf503, "Microsoft SQL Server" }, { 0xF905, "IBM TimeAndPlace" }, { 0xfbfb, "TopCallIII FaxServer" }, { 0xffff, "AnyService/Wildcard" }, { 0, (char *)0 } }; static void init_ipxsaparray(void) { register int i; register struct hnamemem *table; for (i = 0; ipxsap_db[i].s != NULL; i++) { int j = htons(ipxsap_db[i].v) & (HASHNAMESIZE-1); table = &ipxsaptable[j]; while (table->name) table = table->nxt; table->name = ipxsap_db[i].s; table->addr = htons(ipxsap_db[i].v); table->nxt = newhnamemem(); } } /* * Initialize the address to name translation machinery. We map all * non-local IP addresses to numeric addresses if fflag is true (i.e., * to prevent blocking on the nameserver). localnet is the IP address * of the local network. mask is its subnet mask. */ void init_addrtoname(u_int32_t localnet, u_int32_t mask) { if (fflag) { f_localnet = localnet; f_netmask = mask; } if (nflag) /* * Simplest way to suppress names. */ return; init_etherarray(); init_servarray(); init_eprotoarray(); init_protoidarray(); init_ipxsaparray(); } const char * dnaddr_string(u_short dnaddr) { register struct hnamemem *tp; for (tp = &dnaddrtable[dnaddr & (HASHNAMESIZE-1)]; tp->nxt != 0; tp = tp->nxt) if (tp->addr == dnaddr) return (tp->name); tp->addr = dnaddr; tp->nxt = newhnamemem(); if (nflag) tp->name = dnnum_string(dnaddr); else tp->name = dnname_string(dnaddr); return(tp->name); } /* Return a zero'ed hnamemem struct and cuts down on calloc() overhead */ struct hnamemem * newhnamemem(void) { register struct hnamemem *p; static struct hnamemem *ptr = NULL; static u_int num = 0; if (num <= 0) { num = 64; ptr = (struct hnamemem *)calloc(num, sizeof (*ptr)); if (ptr == NULL) error("newhnamemem: calloc"); } --num; p = ptr++; return (p); } #ifdef INET6 /* Return a zero'ed h6namemem struct and cuts down on calloc() overhead */ struct h6namemem * newh6namemem(void) { register struct h6namemem *p; static struct h6namemem *ptr = NULL; static u_int num = 0; if (num <= 0) { num = 64; ptr = (struct h6namemem *)calloc(num, sizeof (*ptr)); if (ptr == NULL) error("newh6namemem: calloc"); } --num; p = ptr++; return (p); } #endif /* INET6 */ tcpdump-3.9.8/./print-sl.c0000644000026300017500000001302210225052572013400 0ustar mcrmcr/* * Copyright (c) 1989, 1990, 1991, 1993, 1994, 1995, 1996, 1997 * The Regents of the University of California. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that: (1) source code distributions * retain the above copyright notice and this paragraph in its entirety, (2) * distributions including binary code include the above copyright notice and * this paragraph in its entirety in the documentation or other materials * provided with the distribution, and (3) all advertising materials mentioning * features or use of this software display the following acknowledgement: * ``This product includes software developed by the University of California, * Lawrence Berkeley Laboratory and its contributors.'' Neither the name of * the University nor the names of its contributors may be used to endorse * or promote products derived from this software without specific prior * written permission. * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. */ #ifndef lint static const char rcsid[] _U_ = "@(#) $Header: /tcpdump/master/tcpdump/print-sl.c,v 1.65 2005/04/06 21:32:42 mcr Exp $ (LBL)"; #endif #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include #include "interface.h" #include "addrtoname.h" #include "extract.h" /* must come after interface.h */ #include "ip.h" #include "tcp.h" #include "slip.h" #include "slcompress.h" static u_int lastlen[2][256]; static u_int lastconn = 255; static void sliplink_print(const u_char *, const struct ip *, u_int); static void compressed_sl_print(const u_char *, const struct ip *, u_int, int); u_int sl_if_print(const struct pcap_pkthdr *h, const u_char *p) { register u_int caplen = h->caplen; register u_int length = h->len; register const struct ip *ip; if (caplen < SLIP_HDRLEN) { printf("[|slip]"); return (caplen); } length -= SLIP_HDRLEN; ip = (struct ip *)(p + SLIP_HDRLEN); if (eflag) sliplink_print(p, ip, length); switch (IP_V(ip)) { case 4: ip_print(gndo, (u_char *)ip, length); break; #ifdef INET6 case 6: ip6_print((u_char *)ip, length); break; #endif default: printf ("ip v%d", IP_V(ip)); } return (SLIP_HDRLEN); } u_int sl_bsdos_if_print(const struct pcap_pkthdr *h, const u_char *p) { register u_int caplen = h->caplen; register u_int length = h->len; register const struct ip *ip; if (caplen < SLIP_HDRLEN) { printf("[|slip]"); return (caplen); } length -= SLIP_HDRLEN; ip = (struct ip *)(p + SLIP_HDRLEN); #ifdef notdef if (eflag) sliplink_print(p, ip, length); #endif ip_print(gndo, (u_char *)ip, length); return (SLIP_HDRLEN); } static void sliplink_print(register const u_char *p, register const struct ip *ip, register u_int length) { int dir; u_int hlen; dir = p[SLX_DIR]; putchar(dir == SLIPDIR_IN ? 'I' : 'O'); putchar(' '); if (nflag) { /* XXX just dump the header */ register int i; for (i = SLX_CHDR; i < SLX_CHDR + CHDR_LEN - 1; ++i) printf("%02x.", p[i]); printf("%02x: ", p[SLX_CHDR + CHDR_LEN - 1]); return; } switch (p[SLX_CHDR] & 0xf0) { case TYPE_IP: printf("ip %d: ", length + SLIP_HDRLEN); break; case TYPE_UNCOMPRESSED_TCP: /* * The connection id is stored in the IP protocol field. * Get it from the link layer since sl_uncompress_tcp() * has restored the IP header copy to IPPROTO_TCP. */ lastconn = ((struct ip *)&p[SLX_CHDR])->ip_p; hlen = IP_HL(ip); hlen += TH_OFF((struct tcphdr *)&((int *)ip)[hlen]); lastlen[dir][lastconn] = length - (hlen << 2); printf("utcp %d: ", lastconn); break; default: if (p[SLX_CHDR] & TYPE_COMPRESSED_TCP) { compressed_sl_print(&p[SLX_CHDR], ip, length, dir); printf(": "); } else printf("slip-%d!: ", p[SLX_CHDR]); } } static const u_char * print_sl_change(const char *str, register const u_char *cp) { register u_int i; if ((i = *cp++) == 0) { i = EXTRACT_16BITS(cp); cp += 2; } printf(" %s%d", str, i); return (cp); } static const u_char * print_sl_winchange(register const u_char *cp) { register short i; if ((i = *cp++) == 0) { i = EXTRACT_16BITS(cp); cp += 2; } if (i >= 0) printf(" W+%d", i); else printf(" W%d", i); return (cp); } static void compressed_sl_print(const u_char *chdr, const struct ip *ip, u_int length, int dir) { register const u_char *cp = chdr; register u_int flags, hlen; flags = *cp++; if (flags & NEW_C) { lastconn = *cp++; printf("ctcp %d", lastconn); } else printf("ctcp *"); /* skip tcp checksum */ cp += 2; switch (flags & SPECIALS_MASK) { case SPECIAL_I: printf(" *SA+%d", lastlen[dir][lastconn]); break; case SPECIAL_D: printf(" *S+%d", lastlen[dir][lastconn]); break; default: if (flags & NEW_U) cp = print_sl_change("U=", cp); if (flags & NEW_W) cp = print_sl_winchange(cp); if (flags & NEW_A) cp = print_sl_change("A+", cp); if (flags & NEW_S) cp = print_sl_change("S+", cp); break; } if (flags & NEW_I) cp = print_sl_change("I+", cp); /* * 'hlen' is the length of the uncompressed TCP/IP header (in words). * 'cp - chdr' is the length of the compressed header. * 'length - hlen' is the amount of data in the packet. */ hlen = IP_HL(ip); hlen += TH_OFF((struct tcphdr *)&((int32_t *)ip)[hlen]); lastlen[dir][lastconn] = length - (hlen << 2); printf(" %d (%ld)", lastlen[dir][lastconn], (long)(cp - chdr)); } tcpdump-3.9.8/./print-ascii.c0000644000026300017500000001270110264535440014060 0ustar mcrmcr/* $NetBSD: print-ascii.c,v 1.1 1999/09/30 14:49:12 sjg Exp $ */ /*- * Copyright (c) 1997, 1998 The NetBSD Foundation, Inc. * All rights reserved. * * This code is derived from software contributed to The NetBSD Foundation * by Alan Barrett and Simon J. Gerraty. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. All advertising materials mentioning features or use of this software * must display the following acknowledgement: * This product includes software developed by the NetBSD * Foundation, Inc. and its contributors. * 4. Neither the name of The NetBSD Foundation nor the names of its * contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #ifndef lint static const char rcsid[] _U_ = "@(#) $Header: /tcpdump/master/tcpdump/print-ascii.c,v 1.16.2.1 2005/07/06 20:54:49 guy Exp $"; #endif #include #include #include "interface.h" #define ASCII_LINELENGTH 300 #define HEXDUMP_BYTES_PER_LINE 16 #define HEXDUMP_SHORTS_PER_LINE (HEXDUMP_BYTES_PER_LINE / 2) #define HEXDUMP_HEXSTUFF_PER_SHORT 5 /* 4 hex digits and a space */ #define HEXDUMP_HEXSTUFF_PER_LINE \ (HEXDUMP_HEXSTUFF_PER_SHORT * HEXDUMP_SHORTS_PER_LINE) void ascii_print(register const u_char *cp, register u_int length) { register int s; putchar('\n'); while (length > 0) { s = *cp++; length--; if (!isgraph(s) && (s != '\t' && s != ' ' && s != '\n' && s != '\r')) putchar('.'); else putchar(s); } } void hex_and_ascii_print_with_offset(register const char *ident, register const u_char *cp, register u_int length, register u_int oset) { register u_int i; register int s1, s2; register int nshorts; char hexstuff[HEXDUMP_SHORTS_PER_LINE*HEXDUMP_HEXSTUFF_PER_SHORT+1], *hsp; char asciistuff[ASCII_LINELENGTH+1], *asp; nshorts = length / sizeof(u_short); i = 0; hsp = hexstuff; asp = asciistuff; while (--nshorts >= 0) { s1 = *cp++; s2 = *cp++; (void)snprintf(hsp, sizeof(hexstuff) - (hsp - hexstuff), " %02x%02x", s1, s2); hsp += HEXDUMP_HEXSTUFF_PER_SHORT; *(asp++) = (isgraph(s1) ? s1 : '.'); *(asp++) = (isgraph(s2) ? s2 : '.'); i++; if (i >= HEXDUMP_SHORTS_PER_LINE) { *hsp = *asp = '\0'; (void)printf("%s0x%04x: %-*s %s", ident, oset, HEXDUMP_HEXSTUFF_PER_LINE, hexstuff, asciistuff); i = 0; hsp = hexstuff; asp = asciistuff; oset += HEXDUMP_BYTES_PER_LINE; } } if (length & 1) { s1 = *cp++; (void)snprintf(hsp, sizeof(hexstuff) - (hsp - hexstuff), " %02x", s1); hsp += 3; *(asp++) = (isgraph(s1) ? s1 : '.'); ++i; } if (i > 0) { *hsp = *asp = '\0'; (void)printf("%s0x%04x: %-*s %s", ident, oset, HEXDUMP_HEXSTUFF_PER_LINE, hexstuff, asciistuff); } } void hex_and_ascii_print(register const char *ident, register const u_char *cp, register u_int length) { hex_and_ascii_print_with_offset(ident, cp, length, 0); } /* * telnet_print() wants this. It is essentially default_print_unaligned() */ void hex_print_with_offset(register const char *ident, register const u_char *cp, register u_int length, register u_int oset) { register u_int i, s; register int nshorts; nshorts = (u_int) length / sizeof(u_short); i = 0; while (--nshorts >= 0) { if ((i++ % 8) == 0) { (void)printf("%s0x%04x: ", ident, oset); oset += HEXDUMP_BYTES_PER_LINE; } s = *cp++; (void)printf(" %02x%02x", s, *cp++); } if (length & 1) { if ((i % 8) == 0) (void)printf("%s0x%04x: ", ident, oset); (void)printf(" %02x", *cp); } } /* * just for completeness */ void hex_print(register const char *ident, register const u_char *cp, register u_int length) { hex_print_with_offset(ident, cp, length, 0); } #ifdef MAIN int main(int argc, char *argv[]) { hex_print("\n\t", "Hello, World!\n", 14); printf("\n"); hex_and_ascii_print("\n\t", "Hello, World!\n", 14); printf("\n"); ascii_print("Hello, World!\n", 14); printf("\n"); #define TMSG "Now is the winter of our discontent...\n" hex_print_with_offset("\n\t", TMSG, sizeof(TMSG) - 1, 0x100); printf("\n"); hex_and_ascii_print_with_offset("\n\t", TMSG, sizeof(TMSG) - 1, 0x100); printf("\n"); exit(0); } #endif /* MAIN */ tcpdump-3.9.8/./FILES0000644000026300017500000000606110676336430012266 0ustar mcrmcrCHANGES CREDITS FILES INSTALL LICENSE Makefile.in README Readme.Win32 VERSION acconfig.h aclocal.m4 addrtoname.c addrtoname.h af.c af.h ah.h aodv.h appletalk.h arcnet.h atime.awk atm.h atmuni31.h bootp.h bpf_dump.c bgp.h chdlc.h config.guess config.h.in config.sub configure configure.in cpack.c cpack.h dccp.h decnet.h decode_prefix.h enc.h esp.h ether.h ethertype.h extract.h fddi.h gmpls.c gmpls.h gmt2local.c gmt2local.h icmp6.h ieee802_11.h ieee802_11_radio.h igrp.h install-sh interface.h ip.h ip6.h ipfc.h ipproto.c ipproto.h ipsec_doi.h ipx.h isakmp.h l2tp.h l2vpn.c l2vpn.h lane.h lbl/os-osf4.h lbl/os-solaris2.h lbl/os-sunos4.h lbl/os-ultrix4.h llc.h machdep.c machdep.h makemib mib.h missing/addrinfo.h missing/addrsize.h missing/bittypes.h missing/dlnames.c missing/datalinks.c missing/getaddrinfo.c missing/getnameinfo.c missing/inet_aton.c missing/inet_ntop.c missing/inet_pton.c missing/resolv6.h missing/resolv_ext.h missing/snprintf.c missing/sockstorage.h missing/strdup.c missing/strlcat.c missing/strlcpy.c missing/strsep.c mkdep mpls.h nameser.h netbios.h netdissect.h nfs.h nfsfh.h nlpid.c nlpid.h ntp.h oakley.h ospf.h ospf6.h oui.c oui.h packetdat.awk parsenfsfh.c pcap_dump_ftell.c pcap-missing.h pmap_prot.h ppp.h print-802_11.c print-ah.c print-aodv.c print-ap1394.c print-arcnet.c print-arp.c print-ascii.c print-atalk.c print-atm.c print-beep.c print-bfd.c print-bgp.c print-bootp.c print-cdp.c print-chdlc.c print-cip.c print-cnfp.c print-dccp.c print-decnet.c print-dhcp6.c print-domain.c print-dvmrp.c print-eap.c print-egp.c print-enc.c print-esp.c print-eigrp.c print-ether.c print-fddi.c print-fr.c print-frag6.c print-gre.c print-hsrp.c print-icmp.c print-icmp6.c print-igmp.c print-igrp.c print-ip.c print-ip6.c print-ip6opts.c print-ipcomp.c print-ipfc.c print-ipx.c print-isakmp.c print-isoclns.c print-juniper.c print-krb.c print-l2tp.c print-lane.c print-ldp.c print-llc.c print-lmp.c print-lspping.c print-lwres.c print-mobile.c print-mobility.c print-mpls.c print-msdp.c print-netbios.c print-nfs.c print-ntp.c print-null.c print-olsr.c print-ospf.c print-ospf6.c print-pflog.c print-pgm.c print-pim.c print-ppp.c print-pppoe.c print-pptp.c print-radius.c print-raw.c print-rip.c print-ripng.c print-rsvp.c print-rt6.c print-rx.c print-sctp.c print-sip.c print-sl.c print-sll.c print-slow.c print-smb.c print-snmp.c print-stp.c print-sunatm.c print-sunrpc.c print-symantec.c print-syslog.c print-tcp.c print-telnet.c print-tftp.c print-timed.c print-token.c print-udp.c print-vjc.c print-vrrp.c print-wb.c print-zephyr.c route6d.h rpc_auth.h rpc_msg.h rx.h sctpConstants.h sctpHeader.h send-ack.awk setsignal.c setsignal.h slcompress.h slip.h sll.h smb.h smbutil.c stime.awk strcasecmp.c tcp.h tcpdump.1 tcpdump.c tcpdump-stdinc.h telnet.h tftp.h timed.h token.h udp.h util.c vfprintf.c win32/Include/Arpa/tftp.h win32/Include/errno.h win32/Include/getopt.h win32/Include/inetprivate.h win32/Include/telnet.h win32/Include/w32_fzs.h win32/Include/Netinet/in_systm.h win32/Include/Netinet/ip.h win32/Src/getopt.c win32/prj/GNUmakefile win32/prj/WinDump.dsp win32/prj/WinDump.dsw tcpdump-3.9.8/./print-domain.c0000644000026300017500000004131110634111731014230 0ustar mcrmcr/* * Copyright (c) 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997 * The Regents of the University of California. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that: (1) source code distributions * retain the above copyright notice and this paragraph in its entirety, (2) * distributions including binary code include the above copyright notice and * this paragraph in its entirety in the documentation or other materials * provided with the distribution, and (3) all advertising materials mentioning * features or use of this software display the following acknowledgement: * ``This product includes software developed by the University of California, * Lawrence Berkeley Laboratory and its contributors.'' Neither the name of * the University nor the names of its contributors may be used to endorse * or promote products derived from this software without specific prior * written permission. * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. */ #ifndef lint static const char rcsid[] _U_ = "@(#) $Header: /tcpdump/master/tcpdump/print-domain.c,v 1.89.2.8 2007/02/13 19:19:27 guy Exp $ (LBL)"; #endif #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include "nameser.h" #include #include #include "interface.h" #include "addrtoname.h" #include "extract.h" /* must come after interface.h */ static const char *ns_ops[] = { "", " inv_q", " stat", " op3", " notify", " update", " op6", " op7", " op8", " updataA", " updateD", " updateDA", " updateM", " updateMA", " zoneInit", " zoneRef", }; static const char *ns_resp[] = { "", " FormErr", " ServFail", " NXDomain", " NotImp", " Refused", " YXDomain", " YXRRSet", " NXRRSet", " NotAuth", " NotZone", " Resp11", " Resp12", " Resp13", " Resp14", " NoChange", }; /* skip over a domain name */ static const u_char * ns_nskip(register const u_char *cp) { register u_char i; if (!TTEST2(*cp, 1)) return (NULL); i = *cp++; while (i) { if ((i & INDIR_MASK) == INDIR_MASK) return (cp + 1); if ((i & INDIR_MASK) == EDNS0_MASK) { int bitlen, bytelen; if ((i & ~INDIR_MASK) != EDNS0_ELT_BITLABEL) return(NULL); /* unknown ELT */ if (!TTEST2(*cp, 1)) return (NULL); if ((bitlen = *cp++) == 0) bitlen = 256; bytelen = (bitlen + 7) / 8; cp += bytelen; } else cp += i; if (!TTEST2(*cp, 1)) return (NULL); i = *cp++; } return (cp); } /* print a */ static const u_char * blabel_print(const u_char *cp) { int bitlen, slen, b; const u_char *bitp, *lim; char tc; if (!TTEST2(*cp, 1)) return(NULL); if ((bitlen = *cp) == 0) bitlen = 256; slen = (bitlen + 3) / 4; lim = cp + 1 + slen; /* print the bit string as a hex string */ printf("\\[x"); for (bitp = cp + 1, b = bitlen; bitp < lim && b > 7; b -= 8, bitp++) { TCHECK(*bitp); printf("%02x", *bitp); } if (b > 4) { TCHECK(*bitp); tc = *bitp++; printf("%02x", tc & (0xff << (8 - b))); } else if (b > 0) { TCHECK(*bitp); tc = *bitp++; printf("%1x", ((tc >> 4) & 0x0f) & (0x0f << (4 - b))); } printf("/%d]", bitlen); return lim; trunc: printf(".../%d]", bitlen); return NULL; } static int labellen(const u_char *cp) { register u_int i; if (!TTEST2(*cp, 1)) return(-1); i = *cp; if ((i & INDIR_MASK) == EDNS0_MASK) { int bitlen, elt; if ((elt = (i & ~INDIR_MASK)) != EDNS0_ELT_BITLABEL) { printf("", elt); return(-1); } if (!TTEST2(*(cp + 1), 1)) return(-1); if ((bitlen = *(cp + 1)) == 0) bitlen = 256; return(((bitlen + 7) / 8) + 1); } else return(i); } static const u_char * ns_nprint(register const u_char *cp, register const u_char *bp) { register u_int i, l; register const u_char *rp = NULL; register int compress = 0; int chars_processed; int elt; int data_size = snapend - bp; if ((l = labellen(cp)) == (u_int)-1) return(NULL); if (!TTEST2(*cp, 1)) return(NULL); chars_processed = 1; if (((i = *cp++) & INDIR_MASK) != INDIR_MASK) { compress = 0; rp = cp + l; } if (i != 0) while (i && cp < snapend) { if ((i & INDIR_MASK) == INDIR_MASK) { if (!compress) { rp = cp + 1; compress = 1; } if (!TTEST2(*cp, 1)) return(NULL); cp = bp + (((i << 8) | *cp) & 0x3fff); if ((l = labellen(cp)) == (u_int)-1) return(NULL); if (!TTEST2(*cp, 1)) return(NULL); i = *cp++; chars_processed++; /* * If we've looked at every character in * the message, this pointer will make * us look at some character again, * which means we're looping. */ if (chars_processed >= data_size) { printf(""); return (NULL); } continue; } if ((i & INDIR_MASK) == EDNS0_MASK) { elt = (i & ~INDIR_MASK); switch(elt) { case EDNS0_ELT_BITLABEL: if (blabel_print(cp) == NULL) return (NULL); break; default: /* unknown ELT */ printf("", elt); return(NULL); } } else { if (fn_printn(cp, l, snapend)) return(NULL); } cp += l; chars_processed += l; putchar('.'); if ((l = labellen(cp)) == (u_int)-1) return(NULL); if (!TTEST2(*cp, 1)) return(NULL); i = *cp++; chars_processed++; if (!compress) rp += l + 1; } else putchar('.'); return (rp); } /* print a */ static const u_char * ns_cprint(register const u_char *cp) { register u_int i; if (!TTEST2(*cp, 1)) return (NULL); i = *cp++; if (fn_printn(cp, i, snapend)) return (NULL); return (cp + i); } /* http://www.iana.org/assignments/dns-parameters */ struct tok ns_type2str[] = { { T_A, "A" }, /* RFC 1035 */ { T_NS, "NS" }, /* RFC 1035 */ { T_MD, "MD" }, /* RFC 1035 */ { T_MF, "MF" }, /* RFC 1035 */ { T_CNAME, "CNAME" }, /* RFC 1035 */ { T_SOA, "SOA" }, /* RFC 1035 */ { T_MB, "MB" }, /* RFC 1035 */ { T_MG, "MG" }, /* RFC 1035 */ { T_MR, "MR" }, /* RFC 1035 */ { T_NULL, "NULL" }, /* RFC 1035 */ { T_WKS, "WKS" }, /* RFC 1035 */ { T_PTR, "PTR" }, /* RFC 1035 */ { T_HINFO, "HINFO" }, /* RFC 1035 */ { T_MINFO, "MINFO" }, /* RFC 1035 */ { T_MX, "MX" }, /* RFC 1035 */ { T_TXT, "TXT" }, /* RFC 1035 */ { T_RP, "RP" }, /* RFC 1183 */ { T_AFSDB, "AFSDB" }, /* RFC 1183 */ { T_X25, "X25" }, /* RFC 1183 */ { T_ISDN, "ISDN" }, /* RFC 1183 */ { T_RT, "RT" }, /* RFC 1183 */ { T_NSAP, "NSAP" }, /* RFC 1706 */ { T_NSAP_PTR, "NSAP_PTR" }, { T_SIG, "SIG" }, /* RFC 2535 */ { T_KEY, "KEY" }, /* RFC 2535 */ { T_PX, "PX" }, /* RFC 2163 */ { T_GPOS, "GPOS" }, /* RFC 1712 */ { T_AAAA, "AAAA" }, /* RFC 1886 */ { T_LOC, "LOC" }, /* RFC 1876 */ { T_NXT, "NXT" }, /* RFC 2535 */ { T_EID, "EID" }, /* Nimrod */ { T_NIMLOC, "NIMLOC" }, /* Nimrod */ { T_SRV, "SRV" }, /* RFC 2782 */ { T_ATMA, "ATMA" }, /* ATM Forum */ { T_NAPTR, "NAPTR" }, /* RFC 2168, RFC 2915 */ { T_KX, "KX" }, /* RFC 2230 */ { T_CERT, "CERT" }, /* RFC 2538 */ { T_A6, "A6" }, /* RFC 2874 */ { T_DNAME, "DNAME" }, /* RFC 2672 */ { T_SINK, "SINK" }, { T_OPT, "OPT" }, /* RFC 2671 */ { T_APL, "APL" }, /* RFC 3123 */ { T_DS, "DS" }, /* RFC 4034 */ { T_SSHFP, "SSHFP" }, /* RFC 4255 */ { T_IPSECKEY, "IPSECKEY" }, /* RFC 4025 */ { T_RRSIG, "RRSIG" }, /* RFC 4034 */ { T_NSEC, "NSEC" }, /* RFC 4034 */ { T_DNSKEY, "DNSKEY" }, /* RFC 4034 */ { T_SPF, "SPF" }, /* RFC-schlitt-spf-classic-02.txt */ { T_UINFO, "UINFO" }, { T_UID, "UID" }, { T_GID, "GID" }, { T_UNSPEC, "UNSPEC" }, { T_UNSPECA, "UNSPECA" }, { T_TKEY, "TKEY" }, /* RFC 2930 */ { T_TSIG, "TSIG" }, /* RFC 2845 */ { T_IXFR, "IXFR" }, /* RFC 1995 */ { T_AXFR, "AXFR" }, /* RFC 1035 */ { T_MAILB, "MAILB" }, /* RFC 1035 */ { T_MAILA, "MAILA" }, /* RFC 1035 */ { T_ANY, "ANY" }, { 0, NULL } }; struct tok ns_class2str[] = { { C_IN, "IN" }, /* Not used */ { C_CHAOS, "CHAOS" }, { C_HS, "HS" }, { C_ANY, "ANY" }, { 0, NULL } }; /* print a query */ static const u_char * ns_qprint(register const u_char *cp, register const u_char *bp, int is_mdns) { register const u_char *np = cp; register u_int i, class; cp = ns_nskip(cp); if (cp == NULL || !TTEST2(*cp, 4)) return(NULL); /* print the qtype */ i = EXTRACT_16BITS(cp); cp += 2; printf(" %s", tok2str(ns_type2str, "Type%d", i)); /* print the qclass (if it's not IN) */ i = EXTRACT_16BITS(cp); cp += 2; if (is_mdns) class = (i & ~C_QU); else class = i; if (class != C_IN) printf(" %s", tok2str(ns_class2str, "(Class %d)", class)); if (is_mdns) { if (i & C_QU) printf(" (QU)"); else printf(" (QM)"); } fputs("? ", stdout); cp = ns_nprint(np, bp); return(cp ? cp + 4 : NULL); } /* print a reply */ static const u_char * ns_rprint(register const u_char *cp, register const u_char *bp, int is_mdns) { register u_int i, class, opt_flags = 0; register u_short typ, len; register const u_char *rp; if (vflag) { putchar(' '); if ((cp = ns_nprint(cp, bp)) == NULL) return NULL; } else cp = ns_nskip(cp); if (cp == NULL || !TTEST2(*cp, 10)) return (snapend); /* print the type/qtype */ typ = EXTRACT_16BITS(cp); cp += 2; /* print the class (if it's not IN and the type isn't OPT) */ i = EXTRACT_16BITS(cp); cp += 2; if (is_mdns) class = (i & ~C_CACHE_FLUSH); else class = i; if (class != C_IN && typ != T_OPT) printf(" %s", tok2str(ns_class2str, "(Class %d)", class)); if (is_mdns) { if (i & C_CACHE_FLUSH) printf(" (Cache flush)"); } /* ignore ttl */ cp += 2; /* if T_OPT, save opt_flags */ if (typ == T_OPT) opt_flags = EXTRACT_16BITS(cp); /* ignore rest of ttl */ cp += 2; len = EXTRACT_16BITS(cp); cp += 2; rp = cp + len; printf(" %s", tok2str(ns_type2str, "Type%d", typ)); if (rp > snapend) return(NULL); switch (typ) { case T_A: if (!TTEST2(*cp, sizeof(struct in_addr))) return(NULL); printf(" %s", ipaddr_string(cp)); break; case T_NS: case T_CNAME: case T_PTR: #ifdef T_DNAME case T_DNAME: #endif putchar(' '); if (ns_nprint(cp, bp) == NULL) return(NULL); break; case T_SOA: if (!vflag) break; putchar(' '); if ((cp = ns_nprint(cp, bp)) == NULL) return(NULL); putchar(' '); if ((cp = ns_nprint(cp, bp)) == NULL) return(NULL); if (!TTEST2(*cp, 5 * 4)) return(NULL); printf(" %u", EXTRACT_32BITS(cp)); cp += 4; printf(" %u", EXTRACT_32BITS(cp)); cp += 4; printf(" %u", EXTRACT_32BITS(cp)); cp += 4; printf(" %u", EXTRACT_32BITS(cp)); cp += 4; printf(" %u", EXTRACT_32BITS(cp)); cp += 4; break; case T_MX: putchar(' '); if (!TTEST2(*cp, 2)) return(NULL); if (ns_nprint(cp + 2, bp) == NULL) return(NULL); printf(" %d", EXTRACT_16BITS(cp)); break; case T_TXT: while (cp < rp) { printf(" \""); cp = ns_cprint(cp); if (cp == NULL) return(NULL); putchar('"'); } break; case T_SRV: putchar(' '); if (!TTEST2(*cp, 6)) return(NULL); if (ns_nprint(cp + 6, bp) == NULL) return(NULL); printf(":%d %d %d", EXTRACT_16BITS(cp + 4), EXTRACT_16BITS(cp), EXTRACT_16BITS(cp + 2)); break; #ifdef INET6 case T_AAAA: if (!TTEST2(*cp, sizeof(struct in6_addr))) return(NULL); printf(" %s", ip6addr_string(cp)); break; case T_A6: { struct in6_addr a; int pbit, pbyte; if (!TTEST2(*cp, 1)) return(NULL); pbit = *cp; pbyte = (pbit & ~7) / 8; if (pbit > 128) { printf(" %u(bad plen)", pbit); break; } else if (pbit < 128) { if (!TTEST2(*(cp + 1), sizeof(a) - pbyte)) return(NULL); memset(&a, 0, sizeof(a)); memcpy(&a.s6_addr[pbyte], cp + 1, sizeof(a) - pbyte); printf(" %u %s", pbit, ip6addr_string(&a)); } if (pbit > 0) { putchar(' '); if (ns_nprint(cp + 1 + sizeof(a) - pbyte, bp) == NULL) return(NULL); } break; } #endif /*INET6*/ case T_OPT: printf(" UDPsize=%u", class); if (opt_flags & 0x8000) printf(" OK"); break; case T_UNSPECA: /* One long string */ if (!TTEST2(*cp, len)) return(NULL); if (fn_printn(cp, len, snapend)) return(NULL); break; case T_TSIG: { if (cp + len > snapend) return(NULL); if (!vflag) break; putchar(' '); if ((cp = ns_nprint(cp, bp)) == NULL) return(NULL); cp += 6; if (!TTEST2(*cp, 2)) return(NULL); printf(" fudge=%u", EXTRACT_16BITS(cp)); cp += 2; if (!TTEST2(*cp, 2)) return(NULL); printf(" maclen=%u", EXTRACT_16BITS(cp)); cp += 2 + EXTRACT_16BITS(cp); if (!TTEST2(*cp, 2)) return(NULL); printf(" origid=%u", EXTRACT_16BITS(cp)); cp += 2; if (!TTEST2(*cp, 2)) return(NULL); printf(" error=%u", EXTRACT_16BITS(cp)); cp += 2; if (!TTEST2(*cp, 2)) return(NULL); printf(" otherlen=%u", EXTRACT_16BITS(cp)); cp += 2; } } return (rp); /* XXX This isn't always right */ } void ns_print(register const u_char *bp, u_int length, int is_mdns) { register const HEADER *np; register int qdcount, ancount, nscount, arcount; register const u_char *cp; u_int16_t b2; np = (const HEADER *)bp; TCHECK(*np); /* get the byte-order right */ qdcount = EXTRACT_16BITS(&np->qdcount); ancount = EXTRACT_16BITS(&np->ancount); nscount = EXTRACT_16BITS(&np->nscount); arcount = EXTRACT_16BITS(&np->arcount); if (DNS_QR(np)) { /* this is a response */ printf("%d%s%s%s%s%s%s", EXTRACT_16BITS(&np->id), ns_ops[DNS_OPCODE(np)], ns_resp[DNS_RCODE(np)], DNS_AA(np)? "*" : "", DNS_RA(np)? "" : "-", DNS_TC(np)? "|" : "", DNS_AD(np)? "$" : ""); if (qdcount != 1) printf(" [%dq]", qdcount); /* Print QUESTION section on -vv */ cp = (const u_char *)(np + 1); while (qdcount--) { if (qdcount < EXTRACT_16BITS(&np->qdcount) - 1) putchar(','); if (vflag > 1) { fputs(" q:", stdout); if ((cp = ns_qprint(cp, bp, is_mdns)) == NULL) goto trunc; } else { if ((cp = ns_nskip(cp)) == NULL) goto trunc; cp += 4; /* skip QTYPE and QCLASS */ } } printf(" %d/%d/%d", ancount, nscount, arcount); if (ancount--) { if ((cp = ns_rprint(cp, bp, is_mdns)) == NULL) goto trunc; while (cp < snapend && ancount--) { putchar(','); if ((cp = ns_rprint(cp, bp, is_mdns)) == NULL) goto trunc; } } if (ancount > 0) goto trunc; /* Print NS and AR sections on -vv */ if (vflag > 1) { if (cp < snapend && nscount--) { fputs(" ns:", stdout); if ((cp = ns_rprint(cp, bp, is_mdns)) == NULL) goto trunc; while (cp < snapend && nscount--) { putchar(','); if ((cp = ns_rprint(cp, bp, is_mdns)) == NULL) goto trunc; } } if (nscount > 0) goto trunc; if (cp < snapend && arcount--) { fputs(" ar:", stdout); if ((cp = ns_rprint(cp, bp, is_mdns)) == NULL) goto trunc; while (cp < snapend && arcount--) { putchar(','); if ((cp = ns_rprint(cp, bp, is_mdns)) == NULL) goto trunc; } } if (arcount > 0) goto trunc; } } else { /* this is a request */ printf("%d%s%s%s", EXTRACT_16BITS(&np->id), ns_ops[DNS_OPCODE(np)], DNS_RD(np) ? "+" : "", DNS_CD(np) ? "%" : ""); /* any weirdness? */ b2 = EXTRACT_16BITS(((u_short *)np)+1); if (b2 & 0x6cf) printf(" [b2&3=0x%x]", b2); if (DNS_OPCODE(np) == IQUERY) { if (qdcount) printf(" [%dq]", qdcount); if (ancount != 1) printf(" [%da]", ancount); } else { if (ancount) printf(" [%da]", ancount); if (qdcount != 1) printf(" [%dq]", qdcount); } if (nscount) printf(" [%dn]", nscount); if (arcount) printf(" [%dau]", arcount); cp = (const u_char *)(np + 1); if (qdcount--) { cp = ns_qprint(cp, (const u_char *)np, is_mdns); if (!cp) goto trunc; while (cp < snapend && qdcount--) { cp = ns_qprint((const u_char *)cp, (const u_char *)np, is_mdns); if (!cp) goto trunc; } } if (qdcount > 0) goto trunc; /* Print remaining sections on -vv */ if (vflag > 1) { if (ancount--) { if ((cp = ns_rprint(cp, bp, is_mdns)) == NULL) goto trunc; while (cp < snapend && ancount--) { putchar(','); if ((cp = ns_rprint(cp, bp, is_mdns)) == NULL) goto trunc; } } if (ancount > 0) goto trunc; if (cp < snapend && nscount--) { fputs(" ns:", stdout); if ((cp = ns_rprint(cp, bp, is_mdns)) == NULL) goto trunc; while (nscount-- && cp < snapend) { putchar(','); if ((cp = ns_rprint(cp, bp, is_mdns)) == NULL) goto trunc; } } if (nscount > 0) goto trunc; if (cp < snapend && arcount--) { fputs(" ar:", stdout); if ((cp = ns_rprint(cp, bp, is_mdns)) == NULL) goto trunc; while (cp < snapend && arcount--) { putchar(','); if ((cp = ns_rprint(cp, bp, is_mdns)) == NULL) goto trunc; } } if (arcount > 0) goto trunc; } } printf(" (%d)", length); return; trunc: printf("[|domain]"); return; } tcpdump-3.9.8/./README0000644000026300017500000002312610676336430012362 0ustar mcrmcr@(#) $Header: /tcpdump/master/tcpdump/README,v 1.65.2.1 2007/09/14 01:03:12 guy Exp $ (LBL) TCPDUMP 3.9 Now maintained by "The Tcpdump Group" See www.tcpdump.org Please send inquiries/comments/reports to tcpdump-workers@tcpdump.org Anonymous CVS is available via: cvs -d :pserver:cvs.tcpdump.org:/tcpdump/master login (password "anoncvs") cvs -d :pserver:cvs.tcpdump.org:/tcpdump/master checkout tcpdump Version 3.9 of TCPDUMP can be retrieved with the CVS tag "tcpdump_3_9rel1": cvs -d :pserver:cvs.tcpdump.org:/tcpdump/master checkout -r tcpdump_3_9rel1 tcpdump Please submit patches against the master copy to the tcpdump project on sourceforge.net. formerly from Lawrence Berkeley National Laboratory Network Research Group ftp://ftp.ee.lbl.gov/tcpdump.tar.Z (3.4) This directory contains source code for tcpdump, a tool for network monitoring and data acquisition. This software was originally developed by the Network Research Group at the Lawrence Berkeley National Laboratory. The original distribution is available via anonymous ftp to ftp.ee.lbl.gov, in tcpdump.tar.Z. More recent development is performed at tcpdump.org, http://www.tcpdump.org/ Tcpdump uses libpcap, a system-independent interface for user-level packet capture. Before building tcpdump, you must first retrieve and build libpcap, also originally from LBL and now being maintained by tcpdump.org; see http://www.tcpdump.org/ . Once libpcap is built (either install it or make sure it's in ../libpcap), you can build tcpdump using the procedure in the INSTALL file. The program is loosely based on SMI's "etherfind" although none of the etherfind code remains. It was originally written by Van Jacobson as part of an ongoing research project to investigate and improve tcp and internet gateway performance. The parts of the program originally taken from Sun's etherfind were later re-written by Steven McCanne of LBL. To insure that there would be no vestige of proprietary code in tcpdump, Steve wrote these pieces from the specification given by the manual entry, with no access to the source of tcpdump or etherfind. Over the past few years, tcpdump has been steadily improved by the excellent contributions from the Internet community (just browse through the CHANGES file). We are grateful for all the input. Richard Stevens gives an excellent treatment of the Internet protocols in his book ``TCP/IP Illustrated, Volume 1''. If you want to learn more about tcpdump and how to interpret its output, pick up this book. Some tools for viewing and analyzing tcpdump trace files are available from the Internet Traffic Archive: http://www.acm.org/sigcomm/ITA/ Another tool that tcpdump users might find useful is tcpslice: ftp://ftp.ee.lbl.gov/tcpslice.tar.Z It is a program that can be used to extract portions of tcpdump binary trace files. See the above distribution for further details and documentation. Problems, bugs, questions, desirable enhancements, etc. should be sent to the address "tcpdump-workers@tcpdump.org". Bugs, support requests, and feature requests may also be submitted on the SourceForge site for tcpdump at http://sourceforge.net/projects/tcpdump/ Source code contributions, etc. should be sent to the email address "patches@tcpdump.org", or submitted as patches on the SourceForge site for tcpdump. Current versions can be found at www.tcpdump.org, or the SourceForge site for tcpdump. - The TCPdump team original text by: Steve McCanne, Craig Leres, Van Jacobson ------------------------------------- This directory also contains some short awk programs intended as examples of ways to reduce tcpdump data when you're tracking particular network problems: send-ack.awk Simplifies the tcpdump trace for an ftp (or other unidirectional tcp transfer). Since we assume that one host only sends and the other only acks, all address information is left off and we just note if the packet is a "send" or an "ack". There is one output line per line of the original trace. Field 1 is the packet time in decimal seconds, relative to the start of the conversation. Field 2 is delta-time from last packet. Field 3 is packet type/direction. "Send" means data going from sender to receiver, "ack" means an ack going from the receiver to the sender. A preceding "*" indicates that the data is a retransmission. A preceding "-" indicates a hole in the sequence space (i.e., missing packet(s)), a "#" means an odd-size (not max seg size) packet. Field 4 has the packet flags (same format as raw trace). Field 5 is the sequence number (start seq. num for sender, next expected seq number for acks). The number in parens following an ack is the delta-time from the first send of the packet to the ack. A number in parens following a send is the delta-time from the first send of the packet to the current send (on duplicate packets only). Duplicate sends or acks have a number in square brackets showing the number of duplicates so far. Here is a short sample from near the start of an ftp: 3.00 0.20 send . 512 3.20 0.20 ack . 1024 (0.20) 3.20 0.00 send P 1024 3.40 0.20 ack . 1536 (0.20) 3.80 0.40 * send . 0 (3.80) [2] 3.82 0.02 * ack . 1536 (0.62) [2] Three seconds into the conversation, bytes 512 through 1023 were sent. 200ms later they were acked. Shortly thereafter bytes 1024-1535 were sent and again acked after 200ms. Then, for no apparent reason, 0-511 is retransmitted, 3.8 seconds after its initial send (the round trip time for this ftp was 1sec, +-500ms). Since the receiver is expecting 1536, 1536 is re-acked when 0 arrives. packetdat.awk Computes chunk summary data for an ftp (or similar unidirectional tcp transfer). [A "chunk" refers to a chunk of the sequence space -- essentially the packet sequence number divided by the max segment size.] A summary line is printed showing the number of chunks, the number of packets it took to send that many chunks (if there are no lost or duplicated packets, the number of packets should equal the number of chunks) and the number of acks. Following the summary line is one line of information per chunk. The line contains eight fields: 1 - the chunk number 2 - the start sequence number for this chunk 3 - time of first send 4 - time of last send 5 - time of first ack 6 - time of last ack 7 - number of times chunk was sent 8 - number of times chunk was acked (all times are in decimal seconds, relative to the start of the conversation.) As an example, here is the first part of the output for an ftp trace: # 134 chunks. 536 packets sent. 508 acks. 1 1 0.00 5.80 0.20 0.20 4 1 2 513 0.28 6.20 0.40 0.40 4 1 3 1025 1.16 6.32 1.20 1.20 4 1 4 1561 1.86 15.00 2.00 2.00 6 1 5 2049 2.16 15.44 2.20 2.20 5 1 6 2585 2.64 16.44 2.80 2.80 5 1 7 3073 3.00 16.66 3.20 3.20 4 1 8 3609 3.20 17.24 3.40 5.82 4 11 9 4097 6.02 6.58 6.20 6.80 2 5 This says that 134 chunks were transferred (about 70K since the average packet size was 512 bytes). It took 536 packets to transfer the data (i.e., on the average each chunk was transmitted four times). Looking at, say, chunk 4, we see it represents the 512 bytes of sequence space from 1561 to 2048. It was first sent 1.86 seconds into the conversation. It was last sent 15 seconds into the conversation and was sent a total of 6 times (i.e., it was retransmitted every 2 seconds on the average). It was acked once, 140ms after it first arrived. stime.awk atime.awk Output one line per send or ack, respectively, in the form