| /netbsd/src/external/bsd/ipf/dist/lib/ |
| D | printpacket6.c | 32 plen = ntohs(*((u_short *)buf +2)); 44 ntohs(addrs[0]), ntohs(addrs[1]), ntohs(addrs[2]), 45 ntohs(addrs[3]), ntohs(addrs[4]), ntohs(addrs[5]), 46 ntohs(addrs[6]), ntohs(addrs[7])); 49 (void)PRINTF(",%d", ntohs(tcp->th_sport)); 53 ntohs(addrs[0]), ntohs(addrs[1]), ntohs(addrs[2]), 54 ntohs(addrs[3]), ntohs(addrs[4]), ntohs(addrs[5]), 55 ntohs(addrs[6]), ntohs(addrs[7])); 58 PRINTF(",%d", ntohs(tcp->th_dport));
|
| D | printactivenat.c | 39 PRINTF(" %-5hu", ntohs(nat->nat_osport)); 46 PRINTF(" %-5hu", ntohs(nat->nat_odport)); 53 PRINTF(" %-5hu", ntohs(nat->nat_nsport)); 59 PRINTF(" %-5hu", ntohs(nat->nat_ndport)); 66 PRINTF(" %-5hu", ntohs(nat->nat_osport)); 73 PRINTF(" %-5hu", ntohs(nat->nat_nsport)); 80 PRINTF(" %hu", ntohs(nat->nat_odport)); 87 PRINTF(" %-5hu", ntohs(nat->nat_ndport)); 94 PRINTF(" %-5hu", ntohs(nat->nat_odport)); 101 PRINTF(" %hu", ntohs(nat->nat_osport));
|
| D | printpacket.c | 31 len = ntohs(((ip6_t *)ip)->ip6_plen); 33 len = ntohs(((u_short *)ip)[2]); 37 len = ntohs(ip->ip_len); 73 off = ntohs(ip->ip_off); 75 PRINTF("ip #%d %d(%d) %d", ntohs(ip->ip_id), ntohs(ip->ip_len), 82 PRINTF(",%d", ntohs(tcp->th_sport)); 87 PRINTF(",%d", ntohs(tcp->th_dport));
|
| D | printnatfield.c | 200 PRINTF("%hu", ntohs(n->nat_odport)); 204 PRINTF("%hu", ntohs(n->nat_osport)); 208 PRINTF("%hu", ntohs(n->nat_ndport)); 212 PRINTF("%hu", ntohs(n->nat_nsport));
|
| /netbsd/src/sys/netatalk/ |
| D | at_control.c | 369 ntohs(aa->aa_firstnet), ntohs(aa->aa_lastnet), in at_scrub() 406 nnets = ntohs(nr.nr_lastnet) - ntohs(nr.nr_firstnet) + 1; in at_ifinit() 413 ntohs(sat->sat_addr.s_net), sat->sat_addr.s_node, in at_ifinit() 414 ntohs(aa->aa_firstnet), ntohs(aa->aa_lastnet), in at_ifinit() 458 net = ntohs(nr.nr_firstnet) + in at_ifinit() 461 net = ntohs(nr.nr_firstnet); in at_ifinit() 469 if (ntohs(sat->sat_addr.s_net) < in at_ifinit() 470 ntohs(nr.nr_firstnet) || in at_ifinit() 471 ntohs(sat->sat_addr.s_net) > in at_ifinit() 472 ntohs(nr.nr_lastnet)) { in at_ifinit() [all …]
|
| D | ddp_output.c | 135 if (ntohs(net) >= ntohs(aa->aa_firstnet) && in ddp_route() 136 ntohs(net) <= ntohs(aa->aa_lastnet)) { in ddp_route() 177 if (ntohs(satocsat(rtcache_getdst(ro))->sat_addr.s_net) >= in ddp_route() 178 ntohs(aa->aa_firstnet) && in ddp_route() 179 ntohs(satocsat(rtcache_getdst(ro))->sat_addr.s_net) <= in ddp_route() 180 ntohs(aa->aa_lastnet)) { in ddp_route() 188 if (ntohs(satocsat(rtcache_getdst(ro))->sat_addr.s_net) >= in ddp_route() 189 ntohs(aa->aa_firstnet) && in ddp_route() 190 ntohs(satocsat(rtcache_getdst(ro))->sat_addr.s_net) <= in ddp_route() 191 ntohs(aa->aa_lastnet)) { in ddp_route()
|
| /netbsd/src/usr.sbin/ldpd/ |
| D | tlv.c | 55 if (ntohs(t->type) != LDP_HELLO) in get_hello_tlv() 59 if (ntohs(t->length) + TLV_TYPE_LENGTH > max) in get_hello_tlv() 62 t->type = ntohs(t->type); in get_hello_tlv() 63 t->length = ntohs(t->length); in get_hello_tlv() 73 warnp("TLV type %.4X, Length %d, Message ID %.8X\n", ntohs(t->type), in debug_tlv() 74 ntohs(t->length), ntohs(t->messageid)); in debug_tlv()
|
| D | pdu.c | 50 p->version = ntohs(p1->version); in get_pdu() 51 p->length = ntohs(p1->length); in get_pdu() 53 p->label_space = ntohs(p1->label_space); in get_pdu() 80 if (ntohs(rpdu->version) != LDP_VERSION) { in check_recv_pdu() 82 satos(p->address), ntohs(rpdu->version)); in check_recv_pdu() 90 if (ntohs(rpdu->length) > c - PDU_VER_LENGTH) { in check_recv_pdu() 93 ntohs(rpdu->length), (int) (c - PDU_VER_LENGTH)); in check_recv_pdu()
|
| D | tlv_stack.c | 68 if (ntohs(f->type) != TLV_FEC) { in map_label() 72 if (ntohs(l->type) != TLV_GENERIC_LABEL) { in map_label() 73 debugp("Invalid LABEL TLV! (0x%.4X)\n", ntohs(l->type)); in map_label() 81 n = ntohs(f->length); in map_label() 101 if (ntohs(pref->af) == LDP_AF_INET) { in map_label() 104 } else if (ntohs(pref->af) == LDP_AF_INET6) { in map_label() 109 "length %d)\n", ntohs(pref->af), pref->type, in map_label() 162 if (ntohs(f->type) != TLV_FEC) { in withdraw_label() 166 n = ntohs(f->length); in withdraw_label() 173 if (ntohs(pref->af) == LDP_AF_INET) { in withdraw_label() [all …]
|
| D | socketops.c | 542 ntohs(spdu->length), ntohs(t->length), in send_hello() 543 ntohs(cht->length), ntohs(trtlv->length)); in send_hello() 1139 ntohs(rpdu->length) + PDU_VER_LENGTH, MSG_WAITALL); in recv_session_pdu() 1146 debugp("Read %d bytes, PDU size: %d bytes\n", c, ntohs(rpdu->length)); in recv_session_pdu() 1153 if ((ntohs(ttmp->type) != LDP_KEEPALIVE) && in recv_session_pdu() 1154 (ntohs(ttmp->type) != LDP_LABEL_MAPPING)) { in recv_session_pdu() 1156 ntohs(ttmp->type), ntohs(ttmp->length), in recv_session_pdu() 1160 ntohs(ttmp->type), ntohs(ttmp->length), in recv_session_pdu() 1165 ntohs(ttmp->type) != LDP_INITIALIZE && in recv_session_pdu() 1166 ntohs(ttmp->type) != LDP_KEEPALIVE && in recv_session_pdu() [all …]
|
| D | fsm.c | 74 " Hold time: %d\n", ntohs(ht->ch.type), ntohs(ht->ch.length), in run_ldp_hello() 94 ntohs(trtlv->type)); in run_ldp_hello() 121 hi->keepalive = ntohs(ht->ch.holdtime); in run_ldp_hello() 123 if (ntohs(ht->ch.res) >> 15 == 0) in run_ldp_hello() 141 ntohs(ht->ch.holdtime), 0); in run_ldp_hello()
|
| /netbsd/src/usr.sbin/rbootd/ |
| D | utils.c | 117 rmp->hp_llc.dsap, rmp->hp_llc.ssap, ntohs(rmp->hp_llc.cntrl)); in DispPkt() 121 ntohs(rmp->hp_llc.dxsap), ntohs(rmp->hp_llc.sxsap)); in DispPkt() 131 if (ntohs(rmp->r_brq.rmp_session) == RMP_PROBESID) { in DispPkt() 139 (unsigned long)t, ntohs(rmp->r_brq.rmp_session), in DispPkt() 140 ntohs(rmp->r_brq.rmp_version)); in DispPkt() 150 (unsigned long)t, ntohs(rmp->r_brpl.rmp_session), in DispPkt() 151 ntohs(rmp->r_brpl.rmp_version)); in DispPkt() 158 (unsigned long)t, ntohs(rmp->r_rrq.rmp_session)); in DispPkt() 160 ntohs(rmp->r_rrq.rmp_size)); in DispPkt() 166 (unsigned long)t, ntohs(rmp->r_rrpl.rmp_session)); in DispPkt() [all …]
|
| D | rmpproto.c | 115 if (ntohs(rmp->r_brq.rmp_session) == RMP_PROBESID) { in ProcessPacket() 434 if (ntohs(req->r_rrq.rmp_session) != in SendReadRepl() 435 ((rpl->r_type == RMP_BOOT_REPL)? ntohs(rpl->r_brpl.rmp_session): in SendReadRepl() 436 ntohs(rpl->r_rrpl.rmp_session))) { in SendReadRepl() 452 if (ntohs(req->r_rrq.rmp_size) > RMPREADDATA) in SendReadRepl() 471 (int) ntohs(req->r_rrq.rmp_size))) <= 0) { in SendReadRepl() 538 if (ntohs(rconn->rmp.r_rrq.rmp_session) != in BootDone() 539 ((rpl->r_type == RMP_BOOT_REPL)? ntohs(rpl->r_brpl.rmp_session): in BootDone() 540 ntohs(rpl->r_rrpl.rmp_session))) { in BootDone()
|
| /netbsd/src/dist/pf/libexec/tftp-proxy/ |
| D | tftp-proxy.c | 232 if (!(ntohs(tp->th_opcode) == RRQ || ntohs(tp->th_opcode) == WRQ)) { in main() 289 ntohs(((struct sockaddr_in *)&from)->sin_port), in main() 291 ntohs(((struct sockaddr_in *)&proxy)->sin_port), in main() 293 ntohs(((struct sockaddr_in *)&proxy_to_server)->sin_port), in main() 295 ntohs(((struct sockaddr_in *)&server)->sin_port), in main() 296 opcode(ntohs(tp->th_opcode)), in main() 307 (struct sockaddr *)&proxy_to_server, ntohs(sock_out.sin_port), in main() 309 ntohs(((struct sockaddr_in *)&from)->sin_port), in main() 319 ntohs(((struct sockaddr_in *)&from)->sin_port), in main() 326 ntohs(((struct sockaddr_in *)&from)->sin_port), in main() [all …]
|
| /netbsd/src/sys/lib/libsa/ |
| D | udp.c | 77 inet_ntoa(d->myip), ntohs(d->myport)); in sendudp() 79 inet_ntoa(d->destip), ntohs(d->destport)); in sendudp() 120 ntohs(d->myport), ntohs(uh->uh_dport)); in readudp() 125 if (ntohs(uh->uh_ulen) < sizeof(*uh)) { in readudp() 129 ntohs(uh->uh_ulen), sizeof(*uh)); in readudp()
|
| D | tftp.c | 115 switch (ntohs(t->th_opcode)) { in recvtftp() 117 if (ntohs(t->th_block) != d->xid) { in recvtftp() 133 if ((unsigned int)ntohs(t->th_code) >= 8) { in recvtftp() 134 printf("illegal tftp error %d\n", ntohs(t->th_code)); in recvtftp() 138 printf("tftp-error %d\n", ntohs(t->th_code)); in recvtftp() 140 errno = tftperrors[ntohs(t->th_code)]; in recvtftp() 145 printf("tftp type %d not handled\n", ntohs(t->th_opcode)); in recvtftp()
|
| /netbsd/src/sys/kern/ |
| D | uipc_mbufdebug.c | 247 (*pr)("ETHER: TYPE = 0x%04x(", ntohs(eh.ether_type)); in m_examine_ether() 248 switch (ntohs(eh.ether_type)) { in m_examine_ether() 316 if (ntohs(pt.tag) == PPPOE_TAG_EOL) in m_examine_pppoe() 318 off += ntohs(pt.len); in m_examine_pppoe() 348 (*pr)("PPPoE: Session = 0x%04x\n", ntohs(ph.session)); in m_examine_pppoe() 349 (*pr)("PPPoE: Payload Length = %u\n", ntohs(ph.plen)); in m_examine_pppoe() 390 protocol = ntohs(h.protocol); in m_examine_ppp() 483 hrd = ntohs(ar.ar_hrd); in m_examine_arp() 497 (*pr)("ARP: Protocol Address Format = %u\n", ntohs(ar.ar_pro)); in m_examine_arp() 500 op = ntohs(ar.ar_op); in m_examine_arp() [all …]
|
| /netbsd/src/sys/net/ |
| D | slcompress.c | 157 (f) = htons(ntohs(f) + ((cp[1] << 8) | cp[2])); \ 160 (f) = htons(ntohs(f) + (uint32_t)*cp++); \ 294 deltaS = ntohs(th->th_urp); in sl_compress_tcp() 305 deltaS = (uint16_t)(ntohs(th->th_win) - ntohs(oth->th_win)); in sl_compress_tcp() 338 ntohs(cs->cs_ip.ip_len) == hlen) in sl_compress_tcp() 353 deltaS == ntohs(cs->cs_ip.ip_len) - hlen) { in sl_compress_tcp() 361 if (deltaS == ntohs(cs->cs_ip.ip_len) - hlen) { in sl_compress_tcp() 369 deltaS = ntohs(ip->ip_id) - ntohs(cs->cs_ip.ip_id); in sl_compress_tcp() 380 deltaA = ntohs(th->th_sum); in sl_compress_tcp() 557 u_int i = ntohs(cs->cs_ip.ip_len) - cs->cs_hlen; in sl_uncompress_tcp_core() [all …]
|
| /netbsd/src/crypto/dist/ipsec-tools/src/racoon/ |
| D | security.c | 115 len = ntohs(prop->h.len) - 130 len = ntohs(trns->h.len) - sizeof(struct isakmp_pl_t); 134 type = ntohs(d->type) & ~ISAKMP_GEN_MASK; 135 flag = ntohs(d->type) & ISAKMP_GEN_MASK; 136 lorv = ntohs(d->lorv); 149 flag = ntohs(d->type & ISAKMP_GEN_MASK); 156 p->sec_ctx.ctx_strlen = ntohs(p->sec_ctx.ctx_strlen);
|
| D | ipsec_doi.c | 400 tlen = ntohs(trns->h.len) - sizeof(*trns); in t2isakmpsa() 414 type = ntohs(d->type) & ~ISAKMP_GEN_MASK; in t2isakmpsa() 415 flag = ntohs(d->type) & ISAKMP_GEN_MASK; in t2isakmpsa() 420 s_oakley_attr_v(type, ntohs(d->lorv))); in t2isakmpsa() 435 len = ntohs(d->lorv); in t2isakmpsa() 450 sa->enctype = (uint16_t)ntohs(d->lorv); in t2isakmpsa() 454 sa->hashtype = (uint16_t)ntohs(d->lorv); in t2isakmpsa() 458 sa->authmethod = ntohs(d->lorv); in t2isakmpsa() 467 sa->dh_group = (uint16_t)ntohs(d->lorv); in t2isakmpsa() 472 int xtype = (int)ntohs(d->lorv); in t2isakmpsa() [all …]
|
| D | isakmp_cfg.c | 199 if (tlen < ntohs(ph->len)) { in isakmp_cfg_r() 206 plogdump(LLV_DEBUG, ph, ntohs(ph->len)); in isakmp_cfg_r() 215 plen = ntohs(ph->len); in isakmp_cfg_r() 217 plen = ntohs(nph->len); in isakmp_cfg_r() 262 tlen -= ntohs(ph->len); in isakmp_cfg_r() 264 ph = (struct isakmp_gen *)(npp + ntohs(ph->len)); in isakmp_cfg_r() 314 tlen = ntohs(attrpl->h.len); in isakmp_cfg_reply() 319 type = ntohs(attr->type); in isakmp_cfg_reply() 327 s_isakmp_cfg_type(type), ntohs(attr->lorv)); in isakmp_cfg_reply() 332 attr, ntohs(attrpl->id))) != 0) in isakmp_cfg_reply() [all …]
|
| /netbsd/src/sys/external/bsd/ipf/netinet/ |
| D | ip_dns_pxy.c | 52 #define DNS_QR(x) ((ntohs(x) & 0x8000) >> 15) 53 #define DNS_OPCODE(x) ((ntohs(x) & 0x7800) >> 11) 54 #define DNS_AA(x) ((ntohs(x) & 0x0400) >> 10) 55 #define DNS_TC(x) ((ntohs(x) & 0x0200) >> 9) 56 #define DNS_RD(x) ((ntohs(x) & 0x0100) >> 8) 57 #define DNS_RA(x) ((ntohs(x) & 0x0080) >> 7) 58 #define DNS_Z(x) ((ntohs(x) & 0x0070) >> 4) 59 #define DNS_RCODE(x) ((ntohs(x) & 0x000f) >> 0)
|
| /netbsd/src/external/bsd/ipf/dist/ |
| D | ip_dns_pxy.c | 52 #define DNS_QR(x) ((ntohs(x) & 0x8000) >> 15) 53 #define DNS_OPCODE(x) ((ntohs(x) & 0x7800) >> 11) 54 #define DNS_AA(x) ((ntohs(x) & 0x0400) >> 10) 55 #define DNS_TC(x) ((ntohs(x) & 0x0200) >> 9) 56 #define DNS_RD(x) ((ntohs(x) & 0x0100) >> 8) 57 #define DNS_RA(x) ((ntohs(x) & 0x0080) >> 7) 58 #define DNS_Z(x) ((ntohs(x) & 0x0070) >> 4) 59 #define DNS_RCODE(x) ((ntohs(x) & 0x000f) >> 0)
|
| /netbsd/src/usr.sbin/npf/npftest/ |
| D | npfstream.c | 49 if (ntohs(eth->ether_type) != ETHERTYPE_IP) { in process_tcpip() 59 tcpdlen = ntohs(ip->ip_len) - hlen - (th->th_off << 2); in process_tcpip() 78 len = ntohs(ip->ip_len); in process_tcpip() 84 tcpdlen, ntohs(th->th_win), (uintptr_t)result[0]); in process_tcpip()
|
| /netbsd/src/sys/dist/pf/net/ |
| D | pf_norm.c | 356 #define FR_IP_OFF(fr) ((ntohs((fr)->fr_ip->ip_off) & IP_OFFMASK) << 3) 366 u_int16_t off = (ntohs(ip->ip_off) & IP_OFFMASK) << 3; in pf_reassemble() 367 u_int16_t ip_len = ntohs(ip->ip_len) - ip->ip_hl * 4; in pf_reassemble() 416 FR_IP_OFF(frep) + ntohs(frep->fr_ip->ip_len) - frep->fr_ip->ip_hl * in pf_reassemble() 421 precut = FR_IP_OFF(frep) + ntohs(frep->fr_ip->ip_len) - in pf_reassemble() 428 ip->ip_off = htons(ntohs(ip->ip_off) + (precut >> 3)); in pf_reassemble() 429 off = (ntohs(ip->ip_off) & IP_OFFMASK) << 3; in pf_reassemble() 441 if (aftercut < ntohs(frea->fr_ip->ip_len) - frea->fr_ip->ip_hl in pf_reassemble() 445 htons(ntohs(frea->fr_ip->ip_len) - aftercut); in pf_reassemble() 446 frea->fr_ip->ip_off = htons(ntohs(frea->fr_ip->ip_off) + in pf_reassemble() [all …]
|