extern uint16_t in_cksum_shouldbe(uint16_t, uint16_t);
/* IP protocol demuxing routines */
-extern void ip_print_demux(netdissect_options *, const u_char *, u_int, u_int, int, u_int, u_int, const u_char *);
+extern void ip_print_demux(netdissect_options *, const u_char *, u_int, u_int, int, u_int, uint8_t, const u_char *);
-extern uint16_t nextproto4_cksum(netdissect_options *, const struct ip *, const uint8_t *, u_int, u_int, u_int);
+extern uint16_t nextproto4_cksum(netdissect_options *, const struct ip *, const uint8_t *, u_int, u_int, uint8_t);
/* in print-ip6.c */
-extern uint16_t nextproto6_cksum(netdissect_options *, const struct ip6_hdr *, const uint8_t *, u_int, u_int, u_int);
+extern uint16_t nextproto6_cksum(netdissect_options *, const struct ip6_hdr *, const uint8_t *, u_int, u_int, uint8_t);
/* Utilities */
extern void nd_print_trunc(netdissect_options *);
i = 0;
while(i < bodylen) {
const u_char *message;
- u_int type, len;
+ uint8_t type, len;
message = cp + 4 + i;
static int
bgp_attr_print(netdissect_options *ndo,
- u_int atype, const u_char *pptr, u_int len)
+ uint8_t atype, const u_char *pptr, u_int len)
{
u_int i;
uint16_t af;
if (len) {
/* do something more useful!*/
while (len) {
- u_int aflags, atype, alenlen, alen;
+ uint8_t aflags, atype, alenlen;
+ uint16_t alen;
ND_TCHECK_2(p);
if (length < 2)
{
const union routehdr *rhp;
u_int mflags;
- u_int dst, src, hops;
+ uint16_t dst, src;
+ u_int hops;
u_int nsplen, pktlen;
const u_char *nspp;
/*XXX: 15 top level tlvs will probably be fine
You are nuts if you send more ;-> */
while (rlen != 0) {
- u_int type, tlvl;
+ uint16_t type, tlvl;
ND_TCHECK_SIZE(tltlv);
type = GET_BE_U_2(tltlv->type);
uint32_t raw_label;
const u_char *snapend_save;
const struct icmp_mpls_ext_object_header_t *icmp_mpls_ext_object_header;
- u_int hlen, dport, mtu, obj_tlen, obj_class_num, obj_ctype;
+ u_int hlen, mtu, obj_tlen, obj_class_num, obj_ctype;
+ uint16_t dport;
char buf[MAXHOSTNAMELEN + 100];
struct cksum_vec vec[1];
const struct ip6_hdr *ip;
const struct ip6_hdr *oip;
const struct udphdr *ouh;
- u_int dport;
+ uint16_t dport;
const u_char *ep;
u_int prot;
void
ip_print_demux(netdissect_options *ndo,
const u_char *bp,
- u_int length, u_int ver, int fragmented, u_int ttl_hl, u_int nh,
- const u_char *iph)
+ u_int length, u_int ver, int fragmented, u_int ttl_hl,
+ uint8_t nh, const u_char *iph)
{
int advance;
const char *p_name;
uint16_t
nextproto4_cksum(netdissect_options *ndo,
const struct ip *ip, const uint8_t *data,
- u_int len, u_int covlen, u_int next_proto)
+ u_int len, u_int covlen, uint8_t next_proto)
{
struct phdr {
uint32_t src;
uint32_t dst;
- u_char mbz;
- u_char proto;
+ uint8_t mbz;
+ uint8_t proto;
uint16_t len;
} ph;
struct cksum_vec vec[2];
uint16_t
nextproto6_cksum(netdissect_options *ndo,
const struct ip6_hdr *ip6, const uint8_t *data,
- u_int len, u_int covlen, u_int next_proto)
+ u_int len, u_int covlen, uint8_t next_proto)
{
struct {
struct in6_addr ph_src;
* it is called from various MT-TLVs (222,229,235,237)
*/
-static u_int
+static uint8_t
isis_print_mtid(netdissect_options *ndo,
const uint8_t *tptr, const char *ident)
{
uint8_t version, pdu_version, fixed_len;
uint8_t pdu_type, pdu_max_area, max_area, pdu_id_length, id_length, tlv_type, tlv_len, tlen, alen, lan_alen, prefix_len;
- u_int ext_is_len, ext_ip_len, mt_len;
+ u_int ext_is_len, ext_ip_len;
+ uint8_t mt_len;
uint8_t isis_subtlv_idrp;
const uint8_t *optr, *pptr, *tptr;
u_int packet_len;
uint32_t caplen;
uint32_t pictype;
uint8_t direction;
- uint8_t header_len;
+ u_int header_len;
uint8_t cookie_len;
uint8_t cookie_type;
uint8_t cookie[8];
#define TLV_TCHECK(minlen) \
ND_TCHECK_LEN(tptr, minlen); if (tlv_tlen < minlen) goto badtlv;
-static int
+static u_int
ldp_tlv_print(netdissect_options *ndo,
const u_char *tptr,
u_short msg_tlen)
const struct ldp_msg_header *ldp_msg_header;
const u_char *tptr,*msg_tptr;
u_short tlen;
- u_short pdu_len,msg_len,msg_type,msg_tlen;
+ u_short pdu_len,msg_len,msg_type;
+ u_int msg_tlen;
int hexdump,processed;
ldp_com_header = (const struct ldp_common_header *)pptr;
uint8_t tval;
uint16_t tlv;
uint32_t i, pgval, uval;
- u_int tlen, tlv_type, tlv_len;
+ u_int tlen, tlv_type;
+ uint16_t tlv_len;
const u_char *tptr, *mptr;
if (len < 4) {
uint32_t wildcards;
uint16_t dl_type;
uint8_t nw_proto;
- u_char nw_bits;
+ u_int nw_bits;
const char *field_name;
/* wildcards */
const struct rsvp_obj_frr_t *rsvp_obj_frr;
} obj_ptr;
- u_short rsvp_obj_len,rsvp_obj_ctype,rsvp_obj_class_num,obj_tlen;
- u_int intserv_serv_tlen;
+ u_short rsvp_obj_len,rsvp_obj_ctype,rsvp_obj_class_num;
+ u_int obj_tlen,intserv_serv_tlen;
int hexdump;
u_int processed,padbytes,error_code,error_value,i,sigcheck;
union {
const struct sctpDataPart *dataHdrPtr;
uint8_t chunkFlg;
uint32_t ppid;
- u_int payload_size;
+ uint16_t payload_size;
chunkFlg = GET_U_1(chunkDescPtr->chunkFlg);
if ((chunkFlg & SCTP_DATA_UNORDERED) == SCTP_DATA_UNORDERED)
} else {
ND_PRINT("%s.%s > %s.%s: ",
ip6addr_string(ndo, ip6->ip6_src),
- udpport_string(ndo, sport),
+ udpport_string(ndo, (uint16_t)sport),
ip6addr_string(ndo, ip6->ip6_dst),
- udpport_string(ndo, dport));
+ udpport_string(ndo, (uint16_t)dport));
}
} else {
if (sport != -1) {
} else {
ND_PRINT("%s.%s > %s.%s: ",
ipaddr_string(ndo, ip->ip_src),
- udpport_string(ndo, sport),
+ udpport_string(ndo, (uint16_t)sport),
ipaddr_string(ndo, ip->ip_dst),
- udpport_string(ndo, dport));
+ udpport_string(ndo, (uint16_t)dport));
}
} else {
if (sport != -1) {
ND_PRINT("%s > %s: ",
- udpport_string(ndo, sport),
- udpport_string(ndo, dport));
+ udpport_string(ndo, (uint16_t)sport),
+ udpport_string(ndo, (uint16_t)dport));
}
}
}