ntohs
(caddr_t)ntohl(rfp->mode.wreqb.dest_lo), ntohs(rfp->mode.wreqb.len));
xfer->send.len = 16 + ntohs(rfp->mode.rreqb.len);
sfp->mode.rresb.payload, (uint16_t)ntohs(rfp->mode.rreqb.len));
xfer->dst = ntohs(rfp->mode.hdr.src);
int16 packetSize = ntohs(((remote_disk_header*)fPacket)->size);
int16 packetSize = ntohs(reply.size);
uint32 packetSize = ntohs(header->size);
*ptr = ntohs(word);
m->m_pkthdr.ether_vtag = ntohs(vtag);
__func__, ntohs(pi->ipi_etype));
if (ntohs(ip->ip_len) < hlen)
if (ntohs(ip->ip_len) != pktlen)
ntohs(rfa->rfax_vlan_id);
__func__, ntohs(pi->ipi_etype));
if (ntohs(ip->ip_len) < hlen)
if (ntohs(ip->ip_len) != pktlen)
sc_if->msk_vtag = ntohs(len);
sc_if->msk_vtag = ntohs(len);
ntohs(eh.ether_type));
ntohs(eh.ether_type));
ntohs(eh.ether_type));
ntohs(eh.ether_type));
ntohs(extsts & RGE_RDEXTSTS_VLAN_MASK);
*ptr = ntohs(word);
ntohs(eh->ether_type) != ETHERTYPE_IP) {
ntohs(eh->ether_type));
*ptr = ntohs(word);
if (ntohs(ip->ip_len) < hlen)
if (ntohs(ip->ip_len) != pktlen)
etherType = ntohs(etherType);
*ptr = ntohs(word);
if ((ntohs(eh->ether_type) == ETHERTYPE_IP)) {
dprintf("nfs: mountd at %08x:%d\n", ns->mountAddr.sin_addr.s_addr, ntohs(ns->mountAddr.sin_port));
dprintf("nfs: nfsd at %08x:%d\n", ns->nfsAddr.sin_addr.s_addr, ntohs(ns->nfsAddr.sin_port));
return ntohs(port);
uint16 opcode = ntohs(header.opcode);
if (ntohs(header.protocol_type) != ETHER_TYPE_IP
|| ntohs(header.hardware_type) != ARP_HARDWARE_TYPE_ETHER)
if (ntohs(data.length) < 4)
if (nak && ntohs(lcpHdrNakLength) > 3)
else if (reject && ntohs(lcpHdrRejectLength) > 3)
length -= ntohs(data.length);
if (ntohs(data.length) < 4)
int32 length = ntohs(request.length);
|| item->length != 4 || ntohs(item->protocolNumber) != PAP_PROTOCOL)
uint16 length = ntohs(header.length);
position += ntohs(tag->length) + 4;
AddTag(ntohs(tag->type), tag->data, ntohs(tag->length));
ntohs(source.sdl_e_type));
uint16 ppppoe_payload = ntohs(header.length);
ntohs(linkAddress.sdl_e_type));
&& ntohs(header.length) <= PPPoE_QUERY_REPORT_SIZE) {
uint16 length = ntohs(header.length);
uint16 protocolNumber = ntohs(header); // copy the protocol number
if (ntohs(data.length) < 4)
if (ntohs(item->protocolNumber) ==
KPPPProtocol *authenticator = Interface().ProtocolFor(ntohs(item->protocolNumber));
|| ntohs(item->protocolNumber) != fPeerAuthenticator->ProtocolNumber())
TRACE("KPPPAuthHandler: ParseRequest(%X)\n", ntohs(item->protocolNumber));
fLocalAuthenticator = Interface().ProtocolFor(ntohs(item->protocolNumber));
MRU = ntohs(item->MRU);
uint16 MRU = ntohs(item->MRU);
MRU = ntohs(item->MRU);
ntohs(header.checksum));
data->mtu = ntohs(header.path_mtu.next_mtu);
dprintf(" id: %d\n", ntohs(header.id));
dprintf(" checksum: %d\n", ntohs(header.checksum));
uint16 TotalLength() const { return ntohs(total_length); }
uint16 FragmentOffset() const { return ntohs(fragment_offset); }
addr & 0xff, ntohs(address->sin_port));
uint16 start = ntohs(fragmentHeader.ip6f_offlg & IP6F_OFF_MASK);
uint16 PayloadLength() const { return ntohs(header.ip6_plen); }
snprintf(port, sizeof(port), "]:%d", ntohs(address->sin6_port));
if (ntohs(port) <= kLastReservedPort && geteuid() != 0)
segment.max_segment_size = ntohs(option->max_segment_size);
dprintf(" source port: %u\n", ntohs(header.source_port));
dprintf(" dest port: %u\n", ntohs(header.destination_port));
ntohs(otherEndpoint->LocalAddress().Port()));
uint16 udpLength = ntohs(header.udp_length);
ntohs(linkAddress.sdl_e_type));
ntohs(linkAddress.sdl_e_type));
len = ntohs(len);
version = ntohs(version);
operation_id = ntohs(operation_id);
r += format_number(ntohs(sin->sin_port));
fprintf(stderr, "0x%04x\n", ntohs(ciph->fdf.dv.cyc));
((ntohs(data_dest.su_port) < IPPORT_RESERVED) ||
((ntohs(data_dest.su_port) < IPPORT_RESERVED) ||
ntohs(pasv_addr.su_port));
dataport = ntohs(ctrl_addr.su_port) - 1; /* as per RFC 959 */
data_source.su_port = htons(ntohs(ctrl_addr.su_port) - 1);
seq = ntohs(icp.icmp_seq);
ntohs(icp->icmp_nextmtu));
ip->ip_v, ip->ip_hl, ip->ip_tos, ntohs(ip->ip_len),
ntohs(ip->ip_id));
(ntohs(ip->ip_off) & 0xe000) >> 13,
ntohs(ip->ip_off) & 0x1fff);
ntohs(ip->ip_sum));
src.sin6_port = ntohs(DUMMY_PORT);
if (ntohs(icp->icmp6_id) == ident)
seq = ntohs(icp->icmp6_seq);
seq = ntohs(seq);
switch (ntohs(ni->ni_code)) {
printf("refused, type 0x%x", ntohs(ni->ni_type));
printf("unknown, type 0x%x", ntohs(ni->ni_type));
ntohs(ni->ni_code), ntohs(ni->ni_type));
switch (ntohs(ni->ni_qtype)) {
ntohs(value2));
if (sizeof(cbit) + ntohs(cbit.words) * sizeof(v) >
clen = ntohs(cbit.words) * sizeof(v);
if (cur + clen * 8 + (u_long)ntohs(cbit.skip) * 32 >
cur += ntohs(cbit.skip) * 32;
switch (ntohs(ni->ni_qtype)) {
switch (ntohs(ni->ni_qtype)) {
ntohs(ip6->ip6_plen), ip6->ip6_nxt, ip6->ip6_hlim);
Printf(" %04x", ntohs(*sp++));
pmtu = ntohs(icp->icmp_nextmtu);
return (ntohs(udp->uh_sport) == ident + (fixedPort ? seq : 0) &&
ntohs(udp->uh_dport) == port + (fixedPort ? 0 : seq));
return (ntohs(udp->uh_sport) == ident + (fixedPort ? seq : 0) &&
ntohs(udp->uh_dport) == port + (fixedPort ? 0 : seq));
return (ntohs(tcp->th_sport) == ident
&& ntohs(tcp->th_dport) == port + (fixedPort ? 0 : seq)
if (ntohs(sctp->src_port) != ident ||
ntohs(sctp->dest_port) != port + (fixedPort ? 0 : seq))
return (ntohs(gre->proto) == port
&& ntohs(gre->callId) == ident + seq);
return (ntohs(ptr[0]) == ident
&& ntohs(ptr[1]) == port + seq);
srcport = ntohs(Src.sin6_port);
*port = ntohs(fPort);
*port = ntohs(fPort);
return ntohs(((sockaddr_in&)fAddress).sin_port);
return ntohs(((sockaddr_in6&)fAddress).sin6_port);
return ntohs(((sockaddr_dl&)fAddress).sdl_e_type);
fPort = ntohs(servent->s_port);
pi->ipi_etype = ntohs(eh->evl_proto);
pi->ipi_etype = ntohs(eh->evl_encap_proto);
*framelen = ntohs(eh->ether_type) /* encap'd frame size */
switch (ntohs(eh->ether_type)) {
len = ntohs(eh->ether_type);
header->destination.ToUInt64(), ntohs(header->type),
if (service->EthernetProtocol() == ntohs(header->type)) {
ntohs(header->total_length) - headerLength);
|| ntohs(header->total_length) > size
int16 packetSize = ntohs(((remote_disk_header*)packet->Data())->size);
error = remoteDisk->Init(packet->SourceAddress(), ntohs(reply->port),
uint32 packetSize = ntohs(header->size);
uint16 source = ntohs(header->source);
uint16 destination = ntohs(header->destination);
uint16 source = ntohs(header->source);
uint16 destination = ntohs(header->destination);
uint16 length = ntohs(header->length);
ancount = ntohs(hp->ancount);
qdcount = ntohs(hp->qdcount);
h_errno = ntohs(hp->ancount) > 0? NO_DATA : NO_RECOVERY;
if (n < 0 || hp->rcode != NOERROR || ntohs(hp->ancount) == 0) {
ntohs(hp->ancount),
ntohs(hp->nscount),
ntohs(hp->arcount));
ancount += ntohs(hp->ancount);
ancount = ntohs(hp->ancount);
qdcount = ntohs(hp->qdcount);
ntohs(sat->sat_addr.s_net), sat->sat_addr.s_node);
ntohs(sat->sat_range.r_netrange.nr_firstnet),
ntohs(sat->sat_range.r_netrange.nr_lastnet ));
snprintf(numserv, sizeof(numserv), "%u", ntohs(port));
ancount = ntohs(hp->ancount); /* #/records in the answer section */
qdcount = ntohs(hp->qdcount); /* #/entries in the question section */
port = ntohs(port);
ancount = ntohs(hp->ancount);
qdcount = ntohs(hp->qdcount);
hp->arcount = htons(ntohs(hp->arcount) + 1);
if (hp->rcode != NOERROR || ntohs(hp->ancount) == 0) {
ntohs(hp->ancount),
ntohs(hp->nscount),
ntohs(hp->arcount));
int qdcount = ntohs(((const HEADER*)(const void *)buf)->qdcount);
int qdcount = ntohs(((const HEADER*)(const void *)buf1)->qdcount);
if (qdcount != ntohs(((const HEADER*)(const void *)buf2)->qdcount))
uint16 hostPort = ntohs(nwPort);
fServerPort = ntohs(server_address.sin_port);
fServerPort = ntohs(server_address.sin_port);
init_sockaddr(address, INADDR_LOOPBACK, ntohs(listenAddress.sin_port));
ntohs(serverAddr.sin_port),
previousPort = ntohs(clientAddr.sin_port);
printf(" <mss %u>", ntohs(option->max_segment_size));
printf("addr=%lx port=%u\n", serverAddr.sin_addr.s_addr, ntohs(serverAddr.sin_port));
printf("binding to port %u\n", ntohs(clientAddr.sin_port));
ntohs(((sockaddr_in&)ours).sin_port));
ntohs(((sockaddr_in&)ours).sin_port));
ntohs(serverAddr.sin_port));
printf("binding to port %u\n", ntohs(localAddr.sin_port));
#define B2H16 ntohs
int16_t size = ntohs(fRequest->size);
int16_t size = ntohs(fRequest->size);