register const struct tcphdr *tp,
register u_int len)
{
- return nextproto4_cksum(ndo, ip, (const u_int8_t *)tp, len, len,
+ return nextproto4_cksum(ndo, ip, (const uint8_t *)tp, len, len,
IPPROTO_TCP);
}
register u_char flags;
register u_int hlen;
register char ch;
- u_int16_t sport, dport, win, urp;
- u_int32_t seq, ack, thseq, thack;
+ uint16_t sport, dport, win, urp;
+ uint32_t seq, ack, thseq, thack;
u_int utoval;
- u_int16_t magic;
+ uint16_t magic;
register int rev;
#ifdef INET6
register const struct ip6_hdr *ip6;
ch = '\0';
if (!ND_TTEST(tp->th_dport)) {
ND_PRINT((ndo, "%s > %s: [|tcp]",
- ipaddr_string(&ip->ip_src),
- ipaddr_string(&ip->ip_dst)));
+ ipaddr_string(ndo, &ip->ip_src),
+ ipaddr_string(ndo, &ip->ip_dst)));
return;
}
if (ip6) {
if (ip6->ip6_nxt == IPPROTO_TCP) {
ND_PRINT((ndo, "%s.%s > %s.%s: ",
- ip6addr_string(&ip6->ip6_src),
+ ip6addr_string(ndo, &ip6->ip6_src),
tcpport_string(sport),
- ip6addr_string(&ip6->ip6_dst),
+ ip6addr_string(ndo, &ip6->ip6_dst),
tcpport_string(dport)));
} else {
ND_PRINT((ndo, "%s > %s: ",
{
if (ip->ip_p == IPPROTO_TCP) {
ND_PRINT((ndo, "%s.%s > %s.%s: ",
- ipaddr_string(&ip->ip_src),
+ ipaddr_string(ndo, &ip->ip_src),
tcpport_string(sport),
- ipaddr_string(&ip->ip_dst),
+ ipaddr_string(ndo, &ip->ip_dst),
tcpport_string(dport)));
} else {
ND_PRINT((ndo, "%s > %s: ",
if (ndo->ndo_vflag && !ndo->ndo_Kflag && !fragmented) {
/* Check the checksum, if possible. */
- u_int16_t sum, tcp_sum;
+ uint16_t sum, tcp_sum;
if (IP_V(ip) == 4) {
if (ND_TTEST2(tp->th_sport, length)) {
#ifdef INET6
else if (IP_V(ip) == 6 && ip6->ip6_plen) {
if (ND_TTEST2(tp->th_sport, length)) {
- sum = nextproto6_cksum(ip6, (const u_int8_t *)tp,
+ sum = nextproto6_cksum(ip6, (const uint8_t *)tp,
length, length, IPPROTO_TCP);
tcp_sum = EXTRACT_16BITS(&tp->th_sum);
if (datalen % 8 != 0) {
ND_PRINT((ndo, "malformed sack"));
} else {
- u_int32_t s, e;
+ uint32_t s, e;
ND_PRINT((ndo, " %d ", datalen / 8));
for (i = 0; i < datalen; i += 8) {
switch(magic) {
case 0xf989:
- /* TCP Fast Open: draft-ietf-tcpm-fastopen-04 */
+ /* TCP Fast Open: RFC 7413 */
if (datalen == 2) {
/* Fast Open Cookie Request */
ND_PRINT((ndo, "tfo cookiereq"));
}
if (sport == TELNET_PORT || dport == TELNET_PORT) {
- if (!ndo->ndo_qflag && ndo->ndo_vflag)
- telnet_print(ndo, bp, length);
+ telnet_print(ndo, bp, length);
+ } else if (sport == SMTP_PORT || dport == SMTP_PORT) {
+ ND_PRINT((ndo, ": "));
+ smtp_print(ndo, bp, length);
} else if (sport == BGP_PORT || dport == BGP_PORT)
bgp_print(ndo, bp, length);
else if (sport == PPTP_PORT || dport == PPTP_PORT)
else if (sport == OPENFLOW_PORT_OLD || dport == OPENFLOW_PORT_OLD ||
sport == OPENFLOW_PORT_IANA || dport == OPENFLOW_PORT_IANA)
openflow_print(ndo, bp, length);
- else if (length > 2 &&
+ else if (sport == FTP_PORT || dport == FTP_PORT) {
+ ND_PRINT((ndo, ": "));
+ ftp_print(ndo, bp, length);
+ } else if (sport == HTTP_PORT || dport == HTTP_PORT ||
+ sport == HTTP_PORT_ALT || dport == HTTP_PORT_ALT) {
+ ND_PRINT((ndo, ": "));
+ http_print(ndo, bp, length);
+ } else if (sport == RTSP_PORT || dport == RTSP_PORT ||
+ sport == RTSP_PORT_ALT || dport == RTSP_PORT_ALT) {
+ ND_PRINT((ndo, ": "));
+ rtsp_print(ndo, bp, length);
+ } else if (length > 2 &&
(sport == NAMESERVER_PORT || dport == NAMESERVER_PORT ||
sport == MULTICASTDNS_PORT || dport == MULTICASTDNS_PORT)) {
/*
* Pass offset of data plus 4 bytes for RPC TCP msg length
* to NFS print routines.
*/
- u_int32_t fraglen;
+ uint32_t fraglen;
register struct sunrpc_msg *rp;
enum sunrpc_msg_type direction;
u_char sig[TCP_SIGLEN];
char zero_proto = 0;
MD5_CTX ctx;
- u_int16_t savecsum, tlen;
+ uint16_t savecsum, tlen;
#ifdef INET6
struct ip6_hdr *ip6;
- u_int32_t len32;
- u_int8_t nxt;
+ uint32_t len32;
+ uint8_t nxt;
#endif
if (data + length > ndo->ndo_snapend) {
tp1 = *tp;
if (ndo->ndo_sigsecret == NULL) {
- ND_PRINT((ndo, "shared secret not supplied with -M, ");
- return (CANT_CHECK_SIGNATURE));
+ ND_PRINT((ndo, "shared secret not supplied with -M, "));
+ return (CANT_CHECK_SIGNATURE);
}
MD5_Init(&ctx);