Home
last modified time | relevance | path

Searched refs:htons (Results 1 – 25 of 714) sorted by relevance

12345678910>>...29

/freebsd/tests/sys/netgraph/
H A Dvlan_rotate.c61 .vlan[0] = {htons(ETHERTYPE_VLAN), htons(EVL_MAKETAG(1, 0, 0))},
62 .vlan[1] = {htons(ETHERTYPE_VLAN), htons(EVL_MAKETAG(2, 0, 0))},
63 .vlan[2] = {htons(ETHERTYPE_VLAN), htons(EVL_MAKETAG(3, 0, 0))},
64 .vlan[3] = {htons(ETHERTYPE_VLAN), htons(EVL_MAKETAG(4, 0, 0))},
65 .vlan[4] = {htons(ETHERTYPE_VLAN), htons(EVL_MAKETAG(5, 0, 0))},
66 .vlan[5] = {htons(ETHERTYPE_VLAN), htons(EVL_MAKETAG(6, 0, 0))},
67 .vlan[6] = {htons(ETHERTYPE_VLAN), htons(EVL_MAKETAG(7, 0, 0))},
68 .vlan[7] = {htons(ETHERTYPE_VLAN), htons(EVL_MAKETAG(8, 0, 0))},
69 .vlan[8] = {htons(ETHERTYPE_VLAN), htons(EVL_MAKETAG(9, 0, 0))},
106 msg.vlan[len].proto = htons(ETHERTYPE_IP); in _basic()
[all …]
/freebsd/sbin/ipf/ipsend/
H A Diptests.c112 u->uh_sport = htons(1); in ip_test1()
113 u->uh_dport = htons(9); in ip_test1()
115 u->uh_ulen = htons(sizeof(*u) + 4); in ip_test1()
197 ip->ip_id = htons(id++); in ip_test1()
208 ip->ip_id = htons(id++); in ip_test1()
227 ip->ip_id = htons(id++); in ip_test1()
240 ip->ip_id = htons(id++); in ip_test1()
258 ip->ip_off = htons(IP_MF); in ip_test1()
266 ip->ip_off = htons(IP_MF); in ip_test1()
274 ip->ip_off = htons(0xa000); in ip_test1()
[all …]
H A Dip.c67 eh->ether_type = htons(ETHERTYPE_IP); in send_ether()
110 eh->ether_type = htons(ETHERTYPE_IP); in send_ip()
115 ip->ip_len = htons(iplen); in send_ip()
120 ip->ip_id = htons(id++); in send_ip()
192 ip->ip_off |= htons(IP_MF); in send_ip()
198 ip->ip_off ^= htons(IP_MF); in send_ip()
203 ip->ip_off &= htons(0xe000); in send_ip()
204 ip->ip_off |= htons(sent >> 3); in send_ip()
206 ip->ip_len = htons(ts); in send_ip()
217 else if (!(ip->ip_off & htons(0x1fff))) in send_ip()
[all …]
/freebsd/contrib/sendmail/libsm/
H A Dinet6_ntop.c45 , htons(u16[0])
46 , htons(u16[1])
47 , htons(u16[2])
48 , htons(u16[3])
49 , htons(u16[4])
50 , htons(u16[5])
51 , htons(u16[6])
52 , htons(u16[7])
/freebsd/sys/netpfil/pf/
H A Dpflow.c266 htons(PFLOW_IPFIX_TMPL_SET_ID); in pflow_create()
268 htons(sizeof(struct pflow_ipfix_tmpl)); in pflow_create()
272 htons(PFLOW_IPFIX_TMPL_IPV4_ID); in pflow_create()
274 = htons(PFLOW_IPFIX_TMPL_IPV4_FIELD_COUNT); in pflow_create()
276 htons(PFIX_IE_sourceIPv4Address); in pflow_create()
277 pflowif->sc_tmpl_ipfix.ipv4_tmpl.src_ip.len = htons(4); in pflow_create()
279 htons(PFIX_IE_destinationIPv4Address); in pflow_create()
280 pflowif->sc_tmpl_ipfix.ipv4_tmpl.dest_ip.len = htons(4); in pflow_create()
282 htons(PFIX_IE_ingressInterface); in pflow_create()
283 pflowif->sc_tmpl_ipfix.ipv4_tmpl.if_index_in.len = htons(4); in pflow_create()
[all …]
/freebsd/sys/compat/linuxkpi/common/include/linux/
H A Dprintk.h36 #define GID_PRINT_ARGS(gid_raw) htons(((u16 *)gid_raw)[0]), htons(((u16 *)gid_raw)[1]),\
37 htons(((u16 *)gid_raw)[2]), htons(((u16 *)gid_raw)[3]),\
38 htons(((u16 *)gid_raw)[4]), htons(((u16 *)gid_raw)[5]),\
39 htons(((u16 *)gid_raw)[6]), htons(((u16 *)gid_raw)[7])
/freebsd/stand/libsa/
H A Darp.c99 ah->arp_hrd = htons(ARPHRD_ETHER); in arpwhohas()
100 ah->arp_pro = htons(ETHERTYPE_IP); in arpwhohas()
103 ah->arp_op = htons(ARPOP_REQUEST); in arpwhohas()
192 if (ah->arp_hrd != htons(ARPHRD_ETHER) || in arprecv()
193 ah->arp_pro != htons(ETHERTYPE_IP) || in arprecv()
205 if (ah->arp_op == htons(ARPOP_REQUEST)) { in arprecv()
215 if (ah->arp_op != htons(ARPOP_REPLY)) { in arprecv()
256 if (arp->arp_hrd != htons(ARPHRD_ETHER) || in arp_reply()
257 arp->arp_pro != htons(ETHERTYPE_IP) || in arp_reply()
268 if (arp->arp_op != htons(ARPOP_REQUEST)) { in arp_reply()
[all …]
H A Drarp.c86 ap->arp_hrd = htons(ARPHRD_ETHER); in rarp_getipaddress()
87 ap->arp_pro = htons(ETHERTYPE_IP); in rarp_getipaddress()
90 ap->arp_op = htons(ARPOP_REVREQUEST); in rarp_getipaddress()
174 if (ap->arp_hrd != htons(ARPHRD_ETHER) || in rarprecv()
175 ap->arp_pro != htons(ETHERTYPE_IP) || in rarprecv()
187 if (ap->arp_op != htons(ARPOP_REVREPLY)) { in rarprecv()
H A Dtftp.c155 wbuf.t.th_opcode = htons((u_short)ERROR); in tftp_senderr()
156 wbuf.t.th_code = htons(errcode); in tftp_senderr()
175 wbuf.t.th_opcode = htons((u_short)ACK); in tftp_sendack()
177 wbuf.t.th_block = htons(block); in tftp_sendack()
210 if (htons(t->th_block) < (u_short)d->xid) { in recvtftp()
214 tftp_sendack(h, htons(t->th_block)); in recvtftp()
218 if (htons(t->th_block) != (u_short)d->xid) { in recvtftp()
321 wbuf.t.th_opcode = htons((u_short)RRQ); in tftp_makereq()
346 h->iodesc->myport = htons(tftpport + (getsecs() & 0x3ff)); in tftp_makereq()
347 h->iodesc->destport = htons(IPPORT_TFTP); in tftp_makereq()
[all …]
/freebsd/sys/netgraph/netflow/
H A Dnetflow_v9.c139 *p++ = htons(flowset_size); /* Total FlowSet length */ in generate_v9_templates()
144 *p++ = htons(NETFLOW_V9_MAX_RESERVED_FLOWSET + NETFLOW_V9_FLOW_V4_L4); in generate_v9_templates()
147 *p++ = htons(_netflow_v9_record_ipv4_tcp[cnt].field_id); in generate_v9_templates()
148 *p++ = htons(_netflow_v9_record_ipv4_tcp[cnt].field_length); in generate_v9_templates()
150 *template_fields_cnt = htons(cnt); in generate_v9_templates()
155 *p++ = htons(NETFLOW_V9_MAX_RESERVED_FLOWSET + NETFLOW_V9_FLOW_V6_L4); in generate_v9_templates()
158 *p++ = htons(_netflow_v9_record_ipv6_tcp[cnt].field_id); in generate_v9_templates()
159 *p++ = htons(_netflow_v9_record_ipv6_tcp[cnt].field_length); in generate_v9_templates()
161 *template_fields_cnt = htons(cnt); in generate_v9_templates()
188 *flowset_length = htons(len); in close_flowset()
[all …]
/freebsd/lib/libsdp/
H A Dservice.c69 pdu.tid = htons(++ss->tid); in sdp_register_service()
70 pdu.len = htons(sizeof(uuid) + sizeof(*bdaddr) + datalen); in sdp_register_service()
72 uuid = htons(uuid); in sdp_register_service()
133 pdu.tid = htons(++ss->tid); in sdp_unregister_service()
134 pdu.len = htons(sizeof(handle)); in sdp_unregister_service()
177 pdu.tid = htons(++ss->tid); in sdp_change_service()
178 pdu.len = htons(sizeof(handle) + datalen); in sdp_change_service()
180 handle = htons(handle); in sdp_change_service()
/freebsd/tests/sys/netinet/
H A Dip_reass_test.c71 ip->ip_sum = htons((uint16_t)cksum); in update_cksum()
92 ip->ip_len = htons(sizeof(*ip) + payloadlen); in alloc_lopacket()
211 ip->ip_off = htons(0x10); in ATF_TC_BODY()
217 ip->ip_off = htons(0x20); in ATF_TC_BODY()
223 ip->ip_off = htons(0x8); in ATF_TC_BODY()
229 ip->ip_off = htons(0x10); in ATF_TC_BODY()
241 packet2->hdr.ip_off = htons(IP_MF | 0x20); in ATF_TC_BODY()
294 ip->ip_off = htons(IP_MF | 0x10); in ATF_TC_BODY()
300 ip->ip_off = htons(0x10); in ATF_TC_BODY()
346 ip->ip_off = htons(IP_MF | 0x1fff); in ATF_TC_BODY()
[all …]
/freebsd/sbin/ipf/libipf/
H A Dipft_tx.c240 tcp->th_sport = htons(tx_portnum(last)); in parseline()
242 tcp->th_win = htons(4096); in parseline()
260 tcp->th_dport = htons(tx_portnum(last)); in parseline()
278 tcp->th_urp = htons(1); in parseline()
303 ic->icmp_id = htons(getpid()); in parseline()
325 ip->ip_len = htons(ip->ip_len); in parseline()
401 tcp->th_sport = htons(tx_portnum(last)); in parseipv6()
403 tcp->th_win = htons(4096); in parseipv6()
426 tcp->th_dport = htons(tx_portnum(last)); in parseipv6()
450 tcp->th_urp = htons(1); in parseipv6()
[all …]
/freebsd/contrib/tcp_wrappers/
H A Drfc931.c150 ((struct sockaddr_in *)&our_query_sin)->sin_port = htons(ANY_PORT);
151 ((struct sockaddr_in *)&rmt_query_sin)->sin_port = htons(RFC931_PORT);
154 ((struct sockaddr_in6 *)&our_query_sin)->sin6_port = htons(ANY_PORT);
155 ((struct sockaddr_in6 *)&rmt_query_sin)->sin6_port = htons(RFC931_PORT);
165 our_query_sin.sin_port = htons(ANY_PORT);
167 rmt_query_sin.sin_port = htons(RFC931_PORT);
/freebsd/usr.sbin/bhyve/
H A Drfb.c272 sinfo.width = htons(gc_image->width); in rfb_send_server_init_msg()
273 sinfo.height = htons(gc_image->height); in rfb_send_server_init_msg()
278 sinfo.pixfmt.red_max = htons(255); in rfb_send_server_init_msg()
279 sinfo.pixfmt.green_max = htons(255); in rfb_send_server_init_msg()
280 sinfo.pixfmt.blue_max = htons(255); in rfb_send_server_init_msg()
301 supdt_msg.numrects = htons(1); in rfb_send_resize_update_msg()
305 srect_hdr.x = htons(0); in rfb_send_resize_update_msg()
306 srect_hdr.y = htons(0); in rfb_send_resize_update_msg()
307 srect_hdr.width = htons(rc->width); in rfb_send_resize_update_msg()
308 srect_hdr.height = htons(rc->height); in rfb_send_resize_update_msg()
[all …]
/freebsd/usr.sbin/traceroute/
H A Dtraceroute.c763 outip->ip_len = htons(packlen); in main()
764 outip->ip_off = htons(off); in main()
1258 outip->ip_id = htons(ident + seq); in send_probe()
1421 icmpheader->icmp_id = htons(ident); in icmp_prep()
1422 icmpheader->icmp_seq = htons(outdata->seq); in icmp_prep()
1434 return (icmpheader->icmp_id == htons(ident) in icmp_check()
1435 && icmpheader->icmp_seq == htons(seq)); in icmp_check()
1443 outudp->uh_sport = htons(ident + (fixedPort ? outdata->seq : 0)); in udp_prep()
1444 outudp->uh_dport = htons(port + (fixedPort ? 0 : outdata->seq)); in udp_prep()
1445 outudp->uh_ulen = htons((u_short)protlen); in udp_prep()
[all …]
/freebsd/usr.sbin/traceroute6/
H A Dtraceroute6.c403 ident = htons(getpid() & 0xffff); /* same as ping6 */ in main()
844 Nxt.sin6_port = htons(DUMMY_PORT); in main()
870 Src.sin6_port = htons(0); in main()
1119 Dst.sin6_port = htons(port + seq); in send_probe()
1129 icp->icmp6_seq = htons(seq); in send_probe()
1133 outudp->uh_sport = htons(ident); in send_probe()
1134 outudp->uh_dport = htons(port + seq); in send_probe()
1135 outudp->uh_ulen = htons(datalen); in send_probe()
1145 sctp->src_port = htons(ident); in send_probe()
1146 sctp->dest_port = htons(port + seq); in send_probe()
[all …]
/freebsd/usr.bin/talk/
H A Dget_iface.c56 remote.sin_port = htons(60000); in get_iface()
61 local.sin_port = htons(60000); in get_iface()
71 local.sin_port = htons(ntohs(local.sin_port) + 1); in get_iface()
81 remote.sin_port = htons(ntohs(remote.sin_port) + 1); in get_iface()
/freebsd/share/examples/find_interface/
H A Dfind_interface.c73 remote.sin_port = htons(60000); in main()
78 local.sin_port = htons(60000); in main()
88 local.sin_port = htons(ntohs(local.sin_port) + 1); in main()
96 remote.sin_port = htons(ntohs(remote.sin_port) + 1); in main()
/freebsd/tools/tools/net80211/wesside/dics/
H A Ddics.c171 if ( htons(uh->uh_dport) != DPORT)
201 ph->ippseudo_len = htons(len); in udp_checksum()
239 iph->ip_len = htons(20+8+dlen); in send_stuff()
240 iph->ip_id = htons(666); in send_stuff()
251 dst.sin_port = htons(port); in send_stuff()
257 uh->uh_sport = htons(DPORT); in send_stuff()
258 uh->uh_dport = htons(port); in send_stuff()
259 uh->uh_ulen = htons(8+dlen); in send_stuff()
341 s_in.sin_port = htons(DPORT); in main()
/freebsd/libexec/tftpd/
H A Dtftp-io.c150 tp->th_opcode = htons((u_short)ERROR); in send_error()
151 tp->th_code = htons((u_short)error); in send_error()
190 tp->th_opcode = htons((u_short)WRQ); in send_wrq()
238 tp->th_opcode = htons((u_short)RRQ); in send_rrq()
291 tp->th_opcode = htons((u_short)OACK); in send_oack()
331 tp->th_opcode = htons((u_short)ACK); in send_ack()
332 tp->th_block = htons((u_short)block); in send_ack()
362 pkt->th_opcode = htons((u_short)DATA); in send_data()
363 pkt->th_block = htons((u_short)block); in send_data()
/freebsd/libexec/rbootd/
H A Drmpproto.c181 rpl->r_brpl.rmp_version = htons(RMP_VERSION); in SendServerID()
234 rpl->r_brpl.rmp_version = htons(RMP_VERSION); in SendFileNo()
303 rpl->r_brpl.rmp_session = htons(GenSessID()); in SendBootRepl()
304 rpl->r_brpl.rmp_version = htons(RMP_VERSION); in SendBootRepl()
435 req->r_rrq.rmp_size = htons(RMPREADDATA); in SendReadRepl()
556 rconn->rmp.hp_hdr.len = htons(rconn->rmplen - sizeof(struct hp_hdr)); in SendPacket()
561 rconn->rmp.hp_llc.dxsap = htons(HPEXT_SXSAP); in SendPacket()
562 rconn->rmp.hp_llc.sxsap = htons(HPEXT_DXSAP); in SendPacket()
/freebsd/sys/dev/mlx4/mlx4_core/
H A Dmlx4_fw_qos.c134 htons(MLX4_RATELIMIT_100M_UNITS); in mlx4_SET_PORT_SCHEDULER()
138 htons(MLX4_RATELIMIT_1G_UNITS); in mlx4_SET_PORT_SCHEDULER()
140 tc->max_bw_value = htons(r); in mlx4_SET_PORT_SCHEDULER()
142 tc->max_bw_value = htons(MLX4_RATELIMIT_DEFAULT); in mlx4_SET_PORT_SCHEDULER()
143 tc->max_bw_units = htons(MLX4_RATELIMIT_1G_UNITS); in mlx4_SET_PORT_SCHEDULER()
146 tc->pg = htons(pg[i]); in mlx4_SET_PORT_SCHEDULER()
147 tc->bw_precentage = htons(tc_tx_bw[i]); in mlx4_SET_PORT_SCHEDULER()
/freebsd/tests/sys/netinet/libalias/
H A Dutil.c103 p->ip_len = htons(len); in ip_packet()
119 u->uh_sport = htons(sport); in set_udp()
120 u->uh_dport = htons(dport); in set_udp()
121 u->uh_ulen = htons(payload); in set_udp()
H A Dperf.c122 int aport = htons(rand_range(1000, 2000)); in main()
123 int sport = htons(rand_range(1000, 2000)); in main()
160 batch[i].aport = htons(u->uh_sport); in main()
163 u->uh_dport == htons(batch[i].dport) && in main()
244 u->uh_sport == htons(batch[k].dport) && in main()
245 u->uh_dport == htons(batch[k].sport) && in main()
258 u->uh_sport == htons(batch[k].aport) && in main()
259 u->uh_dport == htons(batch[k].dport) && in main()

12345678910>>...29