]> The Tcpdump Group git mirrors - libpcap/blobdiff - rpcap-protocol.h
Update config.{guess,sub}, timestamps 2023-01-01,2023-01-21
[libpcap] / rpcap-protocol.h
index 6d3259106095fc87b2474e4af031f7fcf0677b2c..a93b0a8b432805708ecd36a83518a483b1d973c5 100644 (file)
  * XXX - use the C99 types?  Microsoft's newer versions of Visual Studio
  * support them.
  */
+#ifndef __HAIKU__
 typedef unsigned char uint8;   /* 8-bit unsigned integer */
 typedef unsigned short uint16; /* 16-bit unsigned integer */
 typedef unsigned int uint32;   /* 32-bit unsigned integer */
 typedef int int32;             /* 32-bit signed integer */
+#endif
 
 /* Common header for all the RPCAP messages */
 struct rpcap_header
@@ -154,6 +156,25 @@ struct rpcap_header
  * Older servers don't provide this; they support only version 0.
  */
 struct rpcap_authreply
+{
+       uint8 minvers;                  /* Minimum version supported */
+       uint8 maxvers;                  /* Maximum version supported */
+       uint8 pad[2];                   /* Pad to 4-byte boundary **/
+       uint32 byte_order_magic;        /* RPCAP_BYTE_ORDER_MAGIC, in server byte order */
+};
+
+/*
+ * Any resemblance between this and the pcap file magic number
+ * is purely coincidental, trust me.
+ */
+#define RPCAP_BYTE_ORDER_MAGIC         0xa1b2c3d4U
+#define RPCAP_BYTE_ORDER_MAGIC_SWAPPED 0xd4c3b2a1U
+
+/*
+ * Older version of authentication reply, without byte order indication
+ * and padding.
+ */
+struct rpcap_authreply_old
 {
        uint8 minvers;  /* Minimum version supported */
        uint8 maxvers;  /* Maximum version supported */
@@ -294,7 +315,7 @@ struct rpcap_pkthdr
        uint32 timestamp_sec;   /* 'struct timeval' compatible, it represents the 'tv_sec' field */
        uint32 timestamp_usec;  /* 'struct timeval' compatible, it represents the 'tv_usec' field */
        uint32 caplen;          /* Length of portion present in the capture */
-       uint32 len;             /* Real length this packet (off wire) */
+       uint32 len;             /* Real length of this packet (off wire) */
        uint32 npkt;            /* Ordinal number of the packet (i.e. the first one captured has '1', the second one '2', etc) */
 };
 
@@ -306,7 +327,7 @@ struct rpcap_filter
        uint32 nitems;          /* Number of items contained into the filter (e.g. BPF instructions for BPF filters) */
 };
 
-/* Structure that keeps a single BPF instuction; it is repeated 'ninsn' times according to the 'rpcap_filterbpf' header */
+/* Structure that keeps a single BPF instruction; it is repeated 'ninsn' times according to the 'rpcap_filterbpf' header */
 struct rpcap_filterbpf_insn
 {
        uint16 code;    /* opcode of the instruction */