int pt, pl, al, num;
const u_char *endp = p + l;
#ifdef INET6
- static u_char prot_ipv6[] = {
+ static const u_char prot_ipv6[] = {
0xaa, 0xaa, 0x03, 0x00, 0x00, 0x00, 0x86, 0xdd
};
#endif
#define RFC1483LLC_LEN 8
-static unsigned char rfcllc[] = {
+static const unsigned char rfcllc[] = {
0xaa, /* DSAP: non-ISO */
0xaa, /* SSAP: non-ISO */
0x03, /* Ctrl: Unnumbered Information Command PDU */
#define egp_sourcenet egp_pands.egpu_sourcenet
};
-const char *egp_acquire_codes[] = {
+static const char *egp_acquire_codes[] = {
"request",
"confirm",
"refuse",
"cease_ack"
};
-const char *egp_acquire_status[] = {
+static const char *egp_acquire_status[] = {
"unspecified",
"active_mode",
"passive_mode",
"protocol_violation"
};
-const char *egp_reach_codes[] = {
+static const char *egp_reach_codes[] = {
"hello",
"i-h-u"
};
-const char *egp_status_updown[] = {
+static const char *egp_status_updown[] = {
"indeterminate",
"up",
"down"
};
-const char *egp_reasons[] = {
+static const char *egp_reasons[] = {
"unspecified",
"bad_EGP_header_format",
"bad_EGP_data_field_format",
* - vj
*/
-static u_char fddi_bit_swap[] = {
+static const u_char fddi_bit_swap[] = {
0x00, 0x80, 0x40, 0xc0, 0x20, 0xa0, 0x60, 0xe0,
0x10, 0x90, 0x50, 0xd0, 0x30, 0xb0, 0x70, 0xf0,
0x08, 0x88, 0x48, 0xc8, 0x28, 0xa8, 0x68, 0xe8,
const u_char *p);
/* array of 16 codepages - currently we only support codepage 1,5 */
-static codeset_pr_func_t fr_q933_print_ie_codeset[] = {
+static const codeset_pr_func_t fr_q933_print_ie_codeset[] = {
NULL,
fr_q933_print_ie_codeset5,
NULL,
NULL, "oui", "deflate", "lzs",
};
-const struct attrmap ipsec_t_map[] = {
+static const struct attrmap ipsec_t_map[] = {
{ NULL, 0, { NULL } },
{ "lifetype", 3, { NULL, "sec", "kb", }, },
{ "life", 0, { NULL } },
{ "privalg", 0, { NULL } },
};
-const struct attrmap encr_t_map[] = {
+static const struct attrmap encr_t_map[] = {
{ NULL, 0, { NULL } }, { NULL, 0, { NULL } }, /* 0, 1 */
{ NULL, 0, { NULL } }, { NULL, 0, { NULL } }, /* 2, 3 */
{ NULL, 0, { NULL } }, { NULL, 0, { NULL } }, /* 4, 5 */
{ "keylen", 14, { NULL }},
};
-const struct attrmap oakley_t_map[] = {
+static const struct attrmap oakley_t_map[] = {
{ NULL, 0, { NULL } },
{ "enc", 8, { NULL, "1des", "idea", "blowfish", "rc5",
"3des", "cast", "aes", }, },
const char *s; /* pic name */
};
-static struct juniper_cookie_table_t juniper_cookie_table[] = {
+static const struct juniper_cookie_table_t juniper_cookie_table[] = {
#ifdef DLT_JUNIPER_ATM1
{ DLT_JUNIPER_ATM1, 4, "ATM1"},
#endif
static int
juniper_parse_header (const u_char *p, const struct pcap_pkthdr *h, struct juniper_l2info_t *l2info) {
- struct juniper_cookie_table_t *lp = juniper_cookie_table;
+ const struct juniper_cookie_table_t *lp = juniper_cookie_table;
u_int idx, jnx_ext_len, jnx_header_len = 0;
u_int8_t tlv_type,tlv_len;
u_int32_t control_word;
return 1;
}
-static struct {
+static const struct {
const char *name;
int (*print)(const u_char *, u_int, u_char);
} mptcp_options[] = {
{ 0, NULL },
};
-static struct double_tok {
+static const struct double_tok {
int flag; /* Rx flag */
int packetType; /* Packet type */
const char *s; /* Flag string */
#define FLG_CHAIN (1 << 0)
-static struct smbfns *
-smbfind(int id, struct smbfns *list)
+static const struct smbfns *
+smbfind(int id, const struct smbfns *list)
{
int sindex;
return(&list[0]);
}
-static struct smbfnsint *
-smbfindint(int id, struct smbfnsint *list)
+static const struct smbfnsint *
+smbfindint(int id, const struct smbfnsint *list)
{
int sindex;
return;
}
-struct smbfnsint trans2_fns[] = {
+static const struct smbfnsint trans2_fns[] = {
{ 0, "TRANSACT2_OPEN", 0,
{ "Flags2=[w]\nMode=[w]\nSearchAttrib=[A]\nAttrib=[A]\nTime=[T2]\nOFun=[w]\nSize=[D]\nRes=([w, w, w, w, w])\nPath=[S]",
NULL,
print_trans2(const u_char *words, const u_char *dat, const u_char *buf, const u_char *maxbuf)
{
u_int bcc;
- static struct smbfnsint *fn = &trans2_fns[0];
+ static const struct smbfnsint *fn = &trans2_fns[0];
const u_char *data, *param;
const u_char *w = words + 1;
const char *f1 = NULL, *f2 = NULL;
}
-static struct smbfns smb_fns[] = {
+static const struct smbfns smb_fns[] = {
{ -1, "SMBunknown", 0, DEFDESCRIPT },
{ SMBtcon, "SMBtcon", 0,
int command;
u_int32_t nterror;
const u_char *words, *maxwords, *data;
- struct smbfns *fn;
+ const struct smbfns *fn;
const char *fmt_smbheader =
"[P4]SMB Command = [B]\nError class = [BP1]\nError code = [d]\nFlags1 = [B]\nFlags2 = [B][P13]\nTree ID = [d]\nProc ID = [d]\nUID = [d]\nMID = [d]\nWord Count = [b]\n";
int smboffset;
* Universal ASN.1 types
* (we only care about the tag values for those allowed in the Internet SMI)
*/
-const char *Universal[] = {
+static const char *Universal[] = {
"U-0",
"Boolean",
"Integer",
/*
* Application-wide ASN.1 types from the Internet SMI and their tags
*/
-const char *Application[] = {
+static const char *Application[] = {
"IpAddress",
#define IPADDR 0
"Counter",
/*
* Context-specific ASN.1 types for the SNMP PDUs and their tags
*/
-const char *Context[] = {
+static const char *Context[] = {
"GetRequest",
#define GETREQ 0
"GetNextRequest",
/*
* Context-specific ASN.1 types for the SNMP Exceptions and their tags
*/
-const char *Exceptions[] = {
+static const char *Exceptions[] = {
"noSuchObject",
#define NOSUCHOBJECT 0
"noSuchInstance",
* Private ASN.1 types
* The Internet SMI does not specify any
*/
-const char *Private[] = {
+static const char *Private[] = {
"P-0"
};
/*
* error-status values for any SNMP PDU
*/
-const char *ErrorStatus[] = {
+static const char *ErrorStatus[] = {
"noError",
"tooBig",
"noSuchName",
/*
* generic-trap values in the SNMP Trap-PDU
*/
-const char *GenericTrap[] = {
+static const char *GenericTrap[] = {
"coldStart",
"warmStart",
"linkDown",
* type definitions.
*/
#define defineCLASS(x) { "x", x, sizeof(x)/sizeof(x[0]) } /* not ANSI-C */
-struct {
+static const struct {
const char *name;
const char **Id;
int numIDs;
/*
* defined forms for ASN.1 types
*/
-const char *Form[] = {
+static const char *Form[] = {
"Primitive",
#define PRIMITIVE 0
"Constructed",
* Currently, this includes the prefixes for the Internet MIB, the
* private enterprises tree, and the experimental tree.
*/
-struct obj_abrev {
+static const struct obj_abrev {
const char *prefix; /* prefix for this abrev */
struct obj *node; /* pointer into object table */
const char *oid; /* ASN.1 encoded OID */
/*
* SNMP versions recognized by this module
*/
-const char *SnmpVersion[] = {
+static const char *SnmpVersion[] = {
"SNMPv1",
#define SNMP_VERSION_1 0
"SNMPv2c",
int o = 0, first = -1, i = asnlen;
if (!sflag && !nflag && asnlen > 2) {
- struct obj_abrev *a = &obj_abrev_list[0];
+ const struct obj_abrev *a = &obj_abrev_list[0];
size_t a_len = strlen(a->oid);
for (; a->node; a++) {
TCHECK2(*p, a_len);
int be;
};
-static struct smi2be smi2betab[] = {
+static const struct smi2be smi2betab[] = {
{ SMI_BASETYPE_INTEGER32, BE_INT },
{ SMI_BASETYPE_OCTETSTRING, BE_STR },
{ SMI_BASETYPE_OCTETSTRING, BE_INETADDR },
}
-const char *dopstr[] = {
+static const char *dopstr[] = {
"dop-0!",
"dop-1!",
"RECT",
};
-static struct printer printers[] = {
+static const struct printer printers[] = {
{ arcnet_if_print, DLT_ARCNET },
#ifdef DLT_ARCNET_LINUX
{ arcnet_linux_if_print, DLT_ARCNET_LINUX },
{ NULL, 0 },
};
-static struct ndo_printer ndo_printers[] = {
+static const struct ndo_printer ndo_printers[] = {
{ ether_if_print, DLT_EN10MB },
#ifdef DLT_IPNET
{ ipnet_if_print, DLT_IPNET },
if_printer
lookup_printer(int type)
{
- struct printer *p;
+ const struct printer *p;
for (p = printers; p->f; ++p)
if (type == p->type)
if_ndo_printer
lookup_ndo_printer(int type)
{
- struct ndo_printer *p;
+ const struct ndo_printer *p;
for (p = ndo_printers; p->f; ++p)
if (type == p->type)