summaryrefslogtreecommitdiff
path: root/wiretap
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2016-07-15 13:57:35 -0700
committerGuy Harris <guy@alum.mit.edu>2016-07-15 20:58:07 +0000
commitea4a62df1fb2c50e34e8a297ba8cb8260aae7627 (patch)
treef695b1feb53827b3cb6f97f3fdc290e7013b454a /wiretap
parent29cecf27c438cb2a1203ee5d877cb38566c977ee (diff)
downloadwireshark-ea4a62df1fb2c50e34e8a297ba8cb8260aae7627.tar.gz
Update comments, give option numbers in decimal.
The pcapng spec gives option numbers in decimal, not hex. Get rid of the "XXX if not available" comments - if an option isn't present in a block, it's not present, and doesn't have *any* value. Change-Id: I1bf0c9a5aaad7dfadf9248e22b67e172625bdd0d Reviewed-on: https://code.wireshark.org/review/16480 Reviewed-by: Guy Harris <guy@alum.mit.edu>
Diffstat (limited to 'wiretap')
-rw-r--r--wiretap/wtap_opttypes.h54
1 files changed, 27 insertions, 27 deletions
diff --git a/wiretap/wtap_opttypes.h b/wiretap/wtap_opttypes.h
index 688de52aa5..a7d2fe8966 100644
--- a/wiretap/wtap_opttypes.h
+++ b/wiretap/wtap_opttypes.h
@@ -33,46 +33,46 @@ extern "C" {
/*
* We use the pcapng option codes for option type values.
*/
-#define OPT_EOFOPT 0x0000 /**< Appears in pcapng files, but not in blocks. */
-#define OPT_COMMENT 0x0001 /**< NULL if not available */
+
+/* Options for all blocks */
+#define OPT_EOFOPT 0 /**< Appears in pcapng files, but not in blocks. */
+#define OPT_COMMENT 1 /**< As the name says */
/* Section Header block (SHB) */
-#define OPT_SHB_HARDWARE 0x0002 /**< NULL if not available
- * UTF-8 string containing the description of the
+#define OPT_SHB_HARDWARE 2 /**< A UTF-8 string containing the description of the
* hardware used to create this section.
*/
-#define OPT_SHB_OS 0x0003 /**< NULL if not available, UTF-8 string containing the
+#define OPT_SHB_OS 3 /**< A UTF-8 string containing the
* name of the operating system used to create this section.
*/
-#define OPT_SHB_USERAPPL 0x0004 /**< NULL if not available, UTF-8 string containing the
+#define OPT_SHB_USERAPPL 4 /**< A UTF-8 string containing the
* name of the application used to create this section.
*/
/* Interface Description block (IDB) */
-#define OPT_IDB_NAME 0x0002 /**< NULL if not available, A UTF-8 string containing the name
+#define OPT_IDB_NAME 2 /**< A UTF-8 string containing the name
* of the device used to capture data.
* "eth0" / "\Device\NPF_{AD1CE675-96D0-47C5-ADD0-2504B9126B68}"
*/
-#define OPT_IDB_DESCR 0x0003 /**< NULL if not available, A UTF-8 string containing the description
+#define OPT_IDB_DESCR 3 /**< A UTF-8 string containing the description
* of the device used to capture data.
* "Broadcom NetXtreme" / "First Ethernet Interface"
*/
-#define OPT_IDB_IP4ADDR 0x0004 /**< XXX: if_IPv4addr Interface network address and netmask.
+#define OPT_IDB_IP4ADDR 4 /**< XXX: if_IPv4addr Interface network address and netmask.
* This option can be repeated multiple times within the same Interface Description Block
* when multiple IPv4 addresses are assigned to the interface.
* 192 168 1 1 255 255 255 0
*/
-#define OPT_IDB_IP6ADDR 0x0005 /* XXX: if_IPv6addr Interface network address and prefix length (stored in the last byte).
+#define OPT_IDB_IP6ADDR 5 /* XXX: if_IPv6addr Interface network address and prefix length (stored in the last byte).
* This option can be repeated multiple times within the same Interface
* Description Block when multiple IPv6 addresses are assigned to the interface.
* 2001:0db8:85a3:08d3:1319:8a2e:0370:7344/64 is written (in hex) as
* "20 01 0d b8 85 a3 08 d3 13 19 8a 2e 03 70 73 44 40"*/
-#define OPT_IDB_MACADDR 0x0006 /* XXX: if_MACaddr Interface Hardware MAC address (48 bits). */
-#define OPT_IDB_EUIADDR 0x0007 /* XXX: if_EUIaddr Interface Hardware EUI address (64 bits) */
-#define OPT_IDB_SPEED 0x0008 /**< 0xFFFFFFFF if unknown
- * Interface speed (in bps). 100000000 for 100Mbps
+#define OPT_IDB_MACADDR 6 /* XXX: if_MACaddr Interface Hardware MAC address (48 bits). */
+#define OPT_IDB_EUIADDR 7 /* XXX: if_EUIaddr Interface Hardware EUI address (64 bits) */
+#define OPT_IDB_SPEED 8 /**< Interface speed (in bps). 100000000 for 100Mbps
*/
-#define OPT_IDB_TSRESOL 0x0009 /**< Resolution of timestamps. If the Most Significant Bit is equal to zero,
+#define OPT_IDB_TSRESOL 9 /**< Resolution of timestamps. If the Most Significant Bit is equal to zero,
* the remaining bits indicates the resolution of the timestamp as as a
* negative power of 10 (e.g. 6 means microsecond resolution, timestamps
* are the number of microseconds since 1/1/1970). If the Most Significant Bit
@@ -81,15 +81,15 @@ extern "C" {
* If this option is not present, a resolution of 10^-6 is assumed
* (i.e. timestamps have the same resolution of the standard 'libpcap' timestamps).
*/
-#define OPT_IDB_TZONE 0x000A /* XXX: if_tzone Time zone for GMT support (TODO: specify better). */
-#define OPT_IDB_FILTER 0x000B /**< The filter (e.g. "capture only TCP traffic") used to capture traffic.
+#define OPT_IDB_TZONE 10 /* XXX: if_tzone Time zone for GMT support (TODO: specify better). */
+#define OPT_IDB_FILTER 11 /**< The filter (e.g. "capture only TCP traffic") used to capture traffic.
* The first byte of the Option Data keeps a code of the filter used
* (e.g. if this is a libpcap string, or BPF bytecode, and more).
* More details about this format will be presented in Appendix XXX (TODO).
* (TODO: better use different options for different fields?
* e.g. if_filter_pcap, if_filter_bpf, ...) 00 "tcp port 23 and host 10.0.0.5"
*/
-#define OPT_IDB_OS 0x000C /**< NULL if not available, A UTF-8 string containing the name of the operating system of the
+#define OPT_IDB_OS 12 /**< UTF-8 string containing the name of the operating system of the
* machine in which this interface is installed.
* This can be different from the same information that can be
* contained by the Section Header Block
@@ -97,12 +97,12 @@ extern "C" {
* the capture can have been done on a remote machine.
* "Windows XP SP2" / "openSUSE 10.2"
*/
-#define OPT_IDB_FCSLEN 0x000D /**< An integer value that specified the length of the
+#define OPT_IDB_FCSLEN 13 /**< An integer value that specified the length of the
* Frame Check Sequence (in bits) for this interface.
* For link layers whose FCS length can change during time,
* the Packet Block Flags Word can be used (see Appendix A (Packet Block Flags Word))
*/
-#define OPT_IDB_TSOFFSET 0x000E /**< XXX: A 64 bits integer value that specifies an offset (in seconds)
+#define OPT_IDB_TSOFFSET 14 /**< XXX: A 64 bits integer value that specifies an offset (in seconds)
* that must be added to the timestamp of each packet to obtain
* the absolute timestamp of a packet. If the option is missing,
* the timestamps stored in the packet must be considered absolute
@@ -115,13 +115,13 @@ extern "C" {
#define OPT_NS_DNSIP4ADDR 3
#define OPT_NS_DNSIP6ADDR 4
-#define OPT_ISB_STARTTIME 0x0002
-#define OPT_ISB_ENDTIME 0x0003
-#define OPT_ISB_IFRECV 0x0004
-#define OPT_ISB_IFDROP 0x0005
-#define OPT_ISB_FILTERACCEPT 0x0006
-#define OPT_ISB_OSDROP 0x0007
-#define OPT_ISB_USRDELIV 0x0008
+#define OPT_ISB_STARTTIME 2
+#define OPT_ISB_ENDTIME 3
+#define OPT_ISB_IFRECV 4
+#define OPT_ISB_IFDROP 5
+#define OPT_ISB_FILTERACCEPT 6
+#define OPT_ISB_OSDROP 7
+#define OPT_ISB_USRDELIV 8
struct wtap_block;
typedef struct wtap_block *wtap_block_t;