/* packet-ip.c
* Routines for IP and miscellaneous IP protocol packet disassembly
*
- * $Id: packet-ip.c,v 1.9 1998/10/20 05:31:00 guy Exp $
+ * $Id: packet-ip.c,v 1.10 1998/10/28 01:16:47 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@zing.org>
{
GtkWidget *field_tree = NULL, *tf;
guint val;
- static value_string secl_vals[] = {
+ static const value_string secl_vals[] = {
{IPSEC_UNCLASSIFIED, "Unclassified"},
{IPSEC_CONFIDENTIAL, "Confidential"},
{IPSEC_EFTO, "EFTO" },
int ptr;
int optoffset = 0;
int flg;
- static value_string flag_vals[] = {
+ static const value_string flag_vals[] = {
{IPOPT_TS_TSONLY, "Time stamps only" },
{IPOPT_TS_TSANDADDR, "Time stamp and address" },
{IPOPT_TS_PRESPEC, "Time stamps for prespecified addresses"},
GtkWidget *ip_tree, *ti, *field_tree, *tf;
gchar tos_str[32];
guint hlen, optlen;
- static value_string proto_vals[] = { {IP_PROTO_ICMP, "ICMP"},
- {IP_PROTO_IGMP, "IGMP"},
- {IP_PROTO_TCP, "TCP" },
- {IP_PROTO_UDP, "UDP" },
- {IP_PROTO_OSPF, "OSPF"},
- {0, NULL } };
+ static const value_string proto_vals[] = { {IP_PROTO_ICMP, "ICMP"},
+ {IP_PROTO_IGMP, "IGMP"},
+ {IP_PROTO_TCP, "TCP" },
+ {IP_PROTO_UDP, "UDP" },
+ {IP_PROTO_OSPF, "OSPF"},
+ {0, NULL } };
/* To do: check for runts, errs, etc. */
case IPTOS_NONE:
strcpy(tos_str, "None");
break;
- case IPTOS_LOWDELAY:
- strcpy(tos_str, "Minimize delay");
+ case IPTOS_LOWCOST:
+ strcpy(tos_str, "Minimize cost");
+ break;
+ case IPTOS_RELIABILITY:
+ strcpy(tos_str, "Maximize reliability");
break;
case IPTOS_THROUGHPUT:
strcpy(tos_str, "Maximize throughput");
break;
- case IPTOS_RELIABILITY:
- strcpy(tos_str, "Maximize reliability");
+ case IPTOS_LOWDELAY:
+ strcpy(tos_str, "Minimize delay");
break;
- case IPTOS_LOWCOST:
- strcpy(tos_str, "Minimize cost");
+ case IPTOS_SECURITY:
+ strcpy(tos_str, "Maximize security");
break;
default:
strcpy(tos_str, "Unknown. Malformed?");
/* packet.c
* Routines for packet disassembly
*
- * $Id: packet.c,v 1.8 1998/10/20 05:31:02 guy Exp $
+ * $Id: packet.c,v 1.9 1998/10/28 01:16:48 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@zing.org>
Returns the associated string ptr on a match.
Formats val with fmt, and returns the resulting string, on failure. */
gchar*
-val_to_str(guint32 val, value_string *vs, char *fmt) {
+val_to_str(guint32 val, const value_string *vs, const char *fmt) {
gchar *ret;
static gchar str[3][64];
static gchar *cur;
/* Tries to match val against each element in the value_string array vs.
Returns the associated string ptr on a match, or NULL on failure. */
gchar*
-match_strval(guint32 val, value_string *vs) {
+match_strval(guint32 val, const value_string *vs) {
gint i = 0;
while (vs[i].strptr) {
/* packet.h
* Definitions for packet disassembly structures and routines
*
- * $Id: packet.h,v 1.21 1998/10/20 05:31:03 guy Exp $
+ * $Id: packet.h,v 1.22 1998/10/28 01:16:49 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@zing.org>
#define IPTOS_TOS_MASK 0x1E
#define IPTOS_TOS(tos) ((tos) & IPTOS_TOS_MASK)
#define IPTOS_NONE 0x00
-#define IPTOS_LOWDELAY 0x10
-#define IPTOS_THROUGHPUT 0x08
-#define IPTOS_RELIABILITY 0x04
#define IPTOS_LOWCOST 0x02
+#define IPTOS_RELIABILITY 0x04
+#define IPTOS_THROUGHPUT 0x08
+#define IPTOS_LOWDELAY 0x10
+#define IPTOS_SECURITY 0x1E
#define IPTOS_PREC_MASK 0xE0
#define IPTOS_PREC(tos) ((tos)&IPTOS_PREC_MASK)
#else
GtkWidget* add_item_to_tree(GtkWidget *, gint, gint, gchar *, ...);
#endif
-gchar* val_to_str(guint32 val, value_string *vs, char *fmt);
-gchar* match_strval(guint32, value_string*);
+gchar* val_to_str(guint32, const value_string *, const char *);
+gchar* match_strval(guint32, const value_string*);
/* Routines in packet.c */