]> The Tcpdump Group git mirrors - tcpdump/commitdiff
Commit more changes from the previous two.
authorGuy Harris <[email protected]>
Mon, 30 Dec 2013 23:52:13 +0000 (15:52 -0800)
committerGuy Harris <[email protected]>
Mon, 30 Dec 2013 23:52:13 +0000 (15:52 -0800)
Makefile.in
print-ipx.c
print-tftp.c

index 60bf091776225bea0a2f2fbe613b3419d9c798b4..0015e58bd807cfd8073a08d1009c250be1562b6e 100644 (file)
@@ -148,7 +148,6 @@ HDR = \
        ipnet.h \
        ipproto.h \
        ipsec_doi.h \
-       ipx.h \
        isakmp.h \
        l2tp.h \
        l2vpn.h \
@@ -190,7 +189,6 @@ HDR = \
        tcp.h \
        tcpdump-stdinc.h \
        telnet.h \
-       tftp.h \
        timed.h \
        token.h \
        udp.h
index c9bde235a1fbc896892b71dec7e0d5395d908743..bc597d402609f9d0ed0b4849d2de81a3554c9644 100644 (file)
@@ -39,9 +39,32 @@ static const char rcsid[] _U_ =
 
 #include "interface.h"
 #include "addrtoname.h"
-#include "ipx.h"
 #include "extract.h"
 
+/* 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
 
 static const char *ipxaddr_string(u_int32_t, const u_char *);
 void ipx_decode(const struct ipxHdr *, const u_char *, u_int);
index fcd009d9d94a2d5494ebcd34cad73c4ede70e69f..a7c8da5f0aeb3f1bbda4ee2afea4a2b0a121c356 100644 (file)
@@ -42,7 +42,48 @@ static const char rcsid[] _U_ =
 #include "interface.h"
 #include "addrtoname.h"
 #include "extract.h"
-#include "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        TFTP_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 */
 
 static const char tstr[] = " [|tftp]";