Home
last modified time | relevance | path

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

12345678910>>...28

/freebsd-13.1/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-13.1/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-13.1/sbin/ipf/ipsend/
H A Diptests.c117 u->uh_sport = htons(1); in ip_test1()
118 u->uh_dport = htons(9); in ip_test1()
306 u->uh_dport = htons(9); in ip_test1()
337 u->uh_dport = htons(9); in ip_test1()
377 u->uh_dport = htons(9); in ip_test1()
758 u->uh_sport = htons(1); in ip_test4()
759 u->uh_dport = htons(1); in ip_test4()
913 t->th_sport = htons(1); in ip_test5()
914 t->th_dport = htons(1); in ip_test5()
1083 t->th_dport = htons(i); in ip_test5()
[all …]
H A Dip.c72 eh->ether_type = htons(ETHERTYPE_IP); in send_ether()
120 ip->ip_len = htons(iplen); in send_ip()
125 ip->ip_id = htons(id++); in send_ip()
197 ip->ip_off |= htons(IP_MF); in send_ip()
203 ip->ip_off ^= htons(IP_MF); in send_ip()
208 ip->ip_off &= htons(0xe000); in send_ip()
209 ip->ip_off |= htons(sent >> 3); in send_ip()
211 ip->ip_len = htons(ts); in send_ip()
264 t2->th_win = htons(4096); in send_tcp()
277 ip2->ip_len = htons(thlen); in send_tcp()
[all …]
/freebsd-13.1/sys/compat/linuxkpi/common/include/linux/
H A Dprintk.h38 #define GID_PRINT_ARGS(gid_raw) htons(((u16 *)gid_raw)[0]), htons(((u16 *)gid_raw)[1]),\
39 htons(((u16 *)gid_raw)[2]), htons(((u16 *)gid_raw)[3]),\
40 htons(((u16 *)gid_raw)[4]), htons(((u16 *)gid_raw)[5]),\
41 htons(((u16 *)gid_raw)[6]), htons(((u16 *)gid_raw)[7])
/freebsd-13.1/stand/libsa/
H A Darp.c104 ah->arp_hrd = htons(ARPHRD_ETHER); in arpwhohas()
105 ah->arp_pro = htons(ETHERTYPE_IP); in arpwhohas()
108 ah->arp_op = htons(ARPOP_REQUEST); in arpwhohas()
197 if (ah->arp_hrd != htons(ARPHRD_ETHER) || in arprecv()
198 ah->arp_pro != htons(ETHERTYPE_IP) || in arprecv()
210 if (ah->arp_op == htons(ARPOP_REQUEST)) { in arprecv()
220 if (ah->arp_op != htons(ARPOP_REPLY)) { in arprecv()
261 if (arp->arp_hrd != htons(ARPHRD_ETHER) || in arp_reply()
262 arp->arp_pro != htons(ETHERTYPE_IP) || in arp_reply()
273 if (arp->arp_op != htons(ARPOP_REQUEST)) { in arp_reply()
[all …]
H A Drarp.c91 ap->arp_hrd = htons(ARPHRD_ETHER); in rarp_getipaddress()
92 ap->arp_pro = htons(ETHERTYPE_IP); in rarp_getipaddress()
95 ap->arp_op = htons(ARPOP_REVREQUEST); in rarp_getipaddress()
179 if (ap->arp_hrd != htons(ARPHRD_ETHER) || in rarprecv()
180 ap->arp_pro != htons(ETHERTYPE_IP) || in rarprecv()
192 if (ap->arp_op != htons(ARPOP_REVREPLY)) { in rarprecv()
H A Dtftp.c158 wbuf.t.th_opcode = htons((u_short)ERROR); in tftp_senderr()
159 wbuf.t.th_code = htons(errcode); in tftp_senderr()
178 wbuf.t.th_opcode = htons((u_short)ACK); in tftp_sendack()
180 wbuf.t.th_block = htons(block); in tftp_sendack()
213 if (htons(t->th_block) < (u_short)d->xid) { in recvtftp()
217 tftp_sendack(h, htons(t->th_block)); in recvtftp()
221 if (htons(t->th_block) != (u_short)d->xid) { in recvtftp()
324 wbuf.t.th_opcode = htons((u_short)RRQ); in tftp_makereq()
350 h->iodesc->destport = htons(IPPORT_TFTP); in tftp_makereq()
409 wbuf.t.th_opcode = htons((u_short)ACK); in tftp_getnextblock()
[all …]
/freebsd-13.1/sys/netgraph/netflow/
H A Dnetflow_v9.c143 *p++ = htons(flowset_size); /* Total FlowSet length */ in generate_v9_templates()
151 *p++ = htons(_netflow_v9_record_ipv4_tcp[cnt].field_id); in generate_v9_templates()
154 *template_fields_cnt = htons(cnt); in generate_v9_templates()
165 *template_fields_cnt = htons(cnt); in generate_v9_templates()
192 *flowset_length = htons(len); in close_flowset()
226 header->count = htons(t->count); in export9_send()
274 rec->i_ifx = htons(fed->fle_i_ifx); in export9_add()
275 rec->o_ifx = htons(fed->fle_o_ifx); in export9_add()
305 rec->i_ifx = htons(fed6->fle_i_ifx); in export9_add()
306 rec->o_ifx = htons(fed6->fle_o_ifx); in export9_add()
[all …]
/freebsd-13.1/lib/libsdp/
H A Dservice.c70 pdu.tid = htons(++ss->tid); in sdp_register_service()
71 pdu.len = htons(sizeof(uuid) + sizeof(*bdaddr) + datalen); in sdp_register_service()
73 uuid = htons(uuid); in sdp_register_service()
134 pdu.tid = htons(++ss->tid); in sdp_unregister_service()
135 pdu.len = htons(sizeof(handle)); in sdp_unregister_service()
178 pdu.tid = htons(++ss->tid); in sdp_change_service()
179 pdu.len = htons(sizeof(handle) + datalen); in sdp_change_service()
181 handle = htons(handle); in sdp_change_service()
/freebsd-13.1/tests/sys/netinet/
H A Dip_reass_test.c74 ip->ip_sum = htons((uint16_t)cksum); in update_cksum()
95 ip->ip_len = htons(sizeof(*ip) + payloadlen); in alloc_lopacket()
214 ip->ip_off = htons(0x10); in ATF_TC_BODY()
220 ip->ip_off = htons(0x20); in ATF_TC_BODY()
226 ip->ip_off = htons(0x8); in ATF_TC_BODY()
232 ip->ip_off = htons(0x10); in ATF_TC_BODY()
244 packet2->hdr.ip_off = htons(IP_MF | 0x20); in ATF_TC_BODY()
297 ip->ip_off = htons(IP_MF | 0x10); in ATF_TC_BODY()
303 ip->ip_off = htons(0x10); in ATF_TC_BODY()
349 ip->ip_off = htons(IP_MF | 0x1fff); in ATF_TC_BODY()
[all …]
/freebsd-13.1/contrib/tcp_wrappers/
H A Drfc931.c156 ((struct sockaddr_in *)&our_query_sin)->sin_port = htons(ANY_PORT);
157 ((struct sockaddr_in *)&rmt_query_sin)->sin_port = htons(RFC931_PORT);
160 ((struct sockaddr_in6 *)&our_query_sin)->sin6_port = htons(ANY_PORT);
161 ((struct sockaddr_in6 *)&rmt_query_sin)->sin6_port = htons(RFC931_PORT);
171 our_query_sin.sin_port = htons(ANY_PORT);
173 rmt_query_sin.sin_port = htons(RFC931_PORT);
/freebsd-13.1/sbin/ipf/libipf/
H A Dipft_tx.c245 tcp->th_sport = htons(tx_portnum(last)); in parseline()
247 tcp->th_win = htons(4096); in parseline()
265 tcp->th_dport = htons(tx_portnum(last)); in parseline()
282 tcp->th_urp = htons(1); in parseline()
307 ic->icmp_id = htons(getpid()); in parseline()
329 ip->ip_len = htons(ip->ip_len); in parseline()
405 tcp->th_sport = htons(tx_portnum(last)); in parseipv6()
407 tcp->th_win = htons(4096); in parseipv6()
453 tcp->th_urp = htons(1); in parseipv6()
477 ic6->icmp6_id = htons(getpid()); in parseipv6()
[all …]
H A Dportname.c23 if ((sv = getservbyport(htons(port), "tcp"))) { in portname()
26 sv1 = getservbyport(htons(port), "udp"); in portname()
33 if ((sv = getservbyport(htons(port), p->p_name))) { in portname()
/freebsd-13.1/usr.bin/talk/
H A Dget_iface.c59 remote.sin_port = htons(60000); in get_iface()
64 local.sin_port = htons(60000); in get_iface()
74 local.sin_port = htons(ntohs(local.sin_port) + 1); in get_iface()
84 remote.sin_port = htons(ntohs(remote.sin_port) + 1); in get_iface()
/freebsd-13.1/usr.sbin/traceroute6/
H A Dtraceroute6.c846 Nxt.sin6_port = htons(DUMMY_PORT); in main()
872 Src.sin6_port = htons(0); in main()
1104 Dst.sin6_port = htons(port + seq); in send_probe()
1114 icp->icmp6_seq = htons(seq); in send_probe()
1118 outudp->uh_sport = htons(ident); in send_probe()
1120 outudp->uh_ulen = htons(datalen); in send_probe()
1130 sctp->src_port = htons(ident); in send_probe()
1165 htons((u_int16_t)(datalen - in send_probe()
1179 chk->chunk_length = htons(4); in send_probe()
1196 tcp->th_sport = htons(ident); in send_probe()
[all …]
/freebsd-13.1/share/examples/find_interface/
H A Dfind_interface.c75 remote.sin_port = htons(60000); in main()
80 local.sin_port = htons(60000); in main()
90 local.sin_port = htons(ntohs(local.sin_port) + 1); in main()
98 remote.sin_port = htons(ntohs(remote.sin_port) + 1); in main()
/freebsd-13.1/usr.sbin/bhyve/
H A Drfb.c244 sinfo.pixfmt.red_max = htons(255); in rfb_send_server_init_msg()
246 sinfo.pixfmt.blue_max = htons(255); in rfb_send_server_init_msg()
267 supdt_msg.numrects = htons(1); in rfb_send_resize_update_msg()
271 srect_hdr.x = htons(0); in rfb_send_resize_update_msg()
272 srect_hdr.y = htons(0); in rfb_send_resize_update_msg()
366 srect_hdr.x = htons(x); in rfb_send_rect()
367 srect_hdr.y = htons(y); in rfb_send_rect()
368 srect_hdr.width = htons(w); in rfb_send_rect()
369 srect_hdr.height = htons(h); in rfb_send_rect()
447 supdt_msg.numrects = htons(1); in rfb_send_all()
[all …]
/freebsd-13.1/libexec/tftpd/
H A Dtftp-io.c154 tp->th_opcode = htons((u_short)ERROR); in send_error()
155 tp->th_code = htons((u_short)error); in send_error()
196 tp->th_opcode = htons((u_short)WRQ); in send_wrq()
244 tp->th_opcode = htons((u_short)RRQ); in send_rrq()
297 tp->th_opcode = htons((u_short)OACK); in send_oack()
338 tp->th_opcode = htons((u_short)ACK); in send_ack()
339 tp->th_block = htons((u_short)block); in send_ack()
369 pkt->th_opcode = htons((u_short)DATA); in send_data()
370 pkt->th_block = htons((u_short)block); in send_data()
/freebsd-13.1/tools/tools/net80211/wesside/dics/
H A Ddics.c173 if ( htons(uh->uh_dport) != DPORT)
203 ph->ippseudo_len = htons(len); in udp_checksum()
241 iph->ip_len = htons(20+8+dlen); in send_stuff()
242 iph->ip_id = htons(666); in send_stuff()
253 dst.sin_port = htons(port); in send_stuff()
259 uh->uh_sport = htons(DPORT); in send_stuff()
260 uh->uh_dport = htons(port); in send_stuff()
261 uh->uh_ulen = htons(8+dlen); in send_stuff()
343 s_in.sin_port = htons(DPORT); in main()
/freebsd-13.1/contrib/traceroute/
H A Dtraceroute.c788 outip->ip_len = htons(packlen); in main()
789 outip->ip_off = htons(off); in main()
1523 outudp->uh_ulen = htons(8); in udplite_prep()
1547 tcp->th_sport = htons(ident); in tcp_prep()
1577 sctp->src_port = htons(ident); in sctp_prep()
1612 htons((u_int16_t)(protlen - in sctp_prep()
1627 chk->chunk_length = htons(4); in sctp_prep()
1670 gre->flags = htons(0x2001); in gre_prep()
1671 gre->proto = htons(port); in gre_prep()
1690 ptr[0] = htons(ident); in gen_prep()
[all …]
/freebsd-13.1/tests/sys/netinet/libalias/
H A Dutil.c102 p->ip_len = htons(len); in ip_packet()
118 u->uh_sport = htons(sport); in set_udp()
119 u->uh_dport = htons(dport); in set_udp()
120 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()
/freebsd-13.1/libexec/rbootd/
H A Drmpproto.c191 rpl->r_brpl.rmp_version = htons(RMP_VERSION); in SendServerID()
244 rpl->r_brpl.rmp_version = htons(RMP_VERSION); in SendFileNo()
313 rpl->r_brpl.rmp_session = htons(GenSessID()); in SendBootRepl()
314 rpl->r_brpl.rmp_version = htons(RMP_VERSION); in SendBootRepl()
445 req->r_rrq.rmp_size = htons(RMPREADDATA); in SendReadRepl()
566 rconn->rmp.hp_hdr.len = htons(rconn->rmplen - sizeof(struct hp_hdr)); in SendPacket()
571 rconn->rmp.hp_llc.dxsap = htons(HPEXT_SXSAP); in SendPacket()
572 rconn->rmp.hp_llc.sxsap = htons(HPEXT_DXSAP); in SendPacket()
/freebsd-13.1/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()

12345678910>>...28