Add the "Maximize security" type of service for IP, from RFC
1455. Make the arguments to "val_to_str()" and "match_strval()" that point to things those routines don't modify pointers to "const", and make the "value_string" tables passed into those routines in "packet-ip.c" "const". svn path=/trunk/; revision=72
This commit is contained in:
parent
4dc16ca678
commit
6f241463be
35
packet-ip.c
35
packet-ip.c
|
@ -1,7 +1,7 @@
|
|||
/* 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>
|
||||
|
@ -53,7 +53,7 @@ dissect_ipopt_security(GtkWidget *opt_tree, const char *name,
|
|||
{
|
||||
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" },
|
||||
|
@ -161,7 +161,7 @@ dissect_ipopt_timestamp(GtkWidget *opt_tree, const char *name, const u_char *opd
|
|||
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"},
|
||||
|
@ -386,12 +386,12 @@ dissect_ip(const u_char *pd, int offset, frame_data *fd, GtkTree *tree) {
|
|||
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. */
|
||||
|
@ -427,17 +427,20 @@ dissect_ip(const u_char *pd, int offset, frame_data *fd, GtkTree *tree) {
|
|||
case IPTOS_NONE:
|
||||
strcpy(tos_str, "None");
|
||||
break;
|
||||
case IPTOS_LOWDELAY:
|
||||
strcpy(tos_str, "Minimize delay");
|
||||
break;
|
||||
case IPTOS_THROUGHPUT:
|
||||
strcpy(tos_str, "Maximize throughput");
|
||||
case IPTOS_LOWCOST:
|
||||
strcpy(tos_str, "Minimize cost");
|
||||
break;
|
||||
case IPTOS_RELIABILITY:
|
||||
strcpy(tos_str, "Maximize reliability");
|
||||
break;
|
||||
case IPTOS_LOWCOST:
|
||||
strcpy(tos_str, "Minimize cost");
|
||||
case IPTOS_THROUGHPUT:
|
||||
strcpy(tos_str, "Maximize throughput");
|
||||
break;
|
||||
case IPTOS_LOWDELAY:
|
||||
strcpy(tos_str, "Minimize delay");
|
||||
break;
|
||||
case IPTOS_SECURITY:
|
||||
strcpy(tos_str, "Maximize security");
|
||||
break;
|
||||
default:
|
||||
strcpy(tos_str, "Unknown. Malformed?");
|
||||
|
|
6
packet.c
6
packet.c
|
@ -1,7 +1,7 @@
|
|||
/* 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>
|
||||
|
@ -198,7 +198,7 @@ collapse_tree(GtkWidget *w, gpointer data) {
|
|||
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;
|
||||
|
@ -220,7 +220,7 @@ val_to_str(guint32 val, value_string *vs, char *fmt) {
|
|||
/* 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) {
|
||||
|
|
13
packet.h
13
packet.h
|
@ -1,7 +1,7 @@
|
|||
/* 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>
|
||||
|
@ -209,10 +209,11 @@ typedef struct _e_ip {
|
|||
#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)
|
||||
|
@ -486,8 +487,8 @@ GtkWidget* add_item_to_tree(GtkWidget *, gint, gint, gchar *, ...)
|
|||
#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 */
|
||||
|
||||
|
|
Loading…
Reference in New Issue