Home
last modified time | relevance | path

Searched refs:lsa (Results 1 – 18 of 18) sorted by relevance

/busybox-1.35.0/libbb/
Dxconnect.c76 len_and_sockaddr lsa; in get_lsa() local
79 lsa.len = LSA_SIZEOF_SA; in get_lsa()
80 if (get_name(fd, &lsa.u.sa, &lsa.len) != 0) in get_lsa()
83 lsa_ptr = xzalloc(LSA_LEN_SIZE + lsa.len); in get_lsa()
84 if (lsa.len > LSA_SIZEOF_SA) { /* rarely (if ever) happens */ in get_lsa()
85 lsa_ptr->len = lsa.len; in get_lsa()
88 memcpy(lsa_ptr, &lsa, LSA_LEN_SIZE + lsa.len); in get_lsa()
343 len_and_sockaddr *lsa; in xsocket_type() local
369 lsa = xzalloc(LSA_LEN_SIZE + len); in xsocket_type()
370 lsa->len = len; in xsocket_type()
[all …]
/busybox-1.35.0/networking/
Dping.c213 create_icmp_socket(len_and_sockaddr *lsa) in create_icmp_socket() argument
216 #define create_icmp_socket(lsa) create_icmp_socket() in create_icmp_socket()
221 if (lsa->u.sa.sa_family == AF_INET6) in create_icmp_socket()
253 static void ping4(len_and_sockaddr *lsa) in ping4() argument
264 xsendto(pingsock, G.packet, DEFDATALEN + ICMP_MINLEN, &lsa->u.sa, lsa->len); in ping4()
295 static void ping6(len_and_sockaddr *lsa) in ping6() argument
309 xsendto(pingsock, G.packet, DEFDATALEN + sizeof(struct icmp6_hdr), &lsa->u.sa, lsa->len); in ping6()
342 len_and_sockaddr *lsa; in common_ping_main() local
367 lsa = xhost_and_af2sockaddr(G.hostname, 0, af); in common_ping_main()
369 lsa = xhost_and_af2sockaddr(G.hostname, 0, AF_INET); in common_ping_main()
[all …]
Dftpgetput.c63 struct len_and_sockaddr *lsa; member
73 #define lsa (G.lsa ) macro
127 control_stream = fdopen(xconnect_stream(lsa), "r+"); in ftp_login()
166 set_nport(&lsa->u.sa, htons(port_num)); in xconnect_ftpdata()
167 return xconnect_stream(lsa); in xconnect_ftpdata()
330 lsa = xhost2sockaddr(argv[0], bb_lookup_port(port, "tcp", 21)); in ftpgetput_main()
333 xmalloc_sockaddr2dotted(&lsa->u.sa)); in ftpgetput_main()
Dinetd.c461 len_and_sockaddr *lsa; in xzalloc_lsa() local
471 lsa = xzalloc(LSA_LEN_SIZE + sz); in xzalloc_lsa()
472 lsa->len = sz; in xzalloc_lsa()
473 lsa->u.sa.sa_family = family; in xzalloc_lsa()
474 return lsa; in xzalloc_lsa()
970 len_and_sockaddr *lsa; in reread_config_file() local
1036 lsa = xzalloc_lsa(AF_UNIX); in reread_config_file()
1037 sun = (struct sockaddr_un*)&lsa->u.sa; in reread_config_file()
1077 lsa = xzalloc_lsa(sep->se_family); in reread_config_file()
1078 set_nport(&lsa->u.sa, port); in reread_config_file()
[all …]
Ddnsd.c515 len_and_sockaddr *lsa, *from, *to; in dnsd_main() local
539 lsa = xdotted2sockaddr(listen_interface, port); in dnsd_main()
540 udps = xsocket(lsa->u.sa.sa_family, SOCK_DGRAM, 0); in dnsd_main()
541 xbind(udps, &lsa->u.sa, lsa->len); in dnsd_main()
543 lsa_size = LSA_LEN_SIZE + lsa->len; in dnsd_main()
548 char *p = xmalloc_sockaddr2dotted(&lsa->u.sa); in dnsd_main()
560 memcpy(to, lsa, lsa_size); in dnsd_main()
561 r = recv_from_to(udps, buf, MAX_PACK_LEN + 1, 0, &from->u.sa, &to->u.sa, lsa->len); in dnsd_main()
572 send_to_from(udps, buf, r, 0, &from->u.sa, &to->u.sa, lsa->len); in dnsd_main()
Dnc.c203 len_and_sockaddr lsa; in nc_main()
204 lsa.len = LSA_SIZEOF_SA; in nc_main()
205 getsockname(sfd, &lsa.u.sa, &lsa.len); in nc_main()
206 lport = get_nport(&lsa.u.sa); in nc_main()
Dtcpudp.c268 len_and_sockaddr *lsa; in tcpudpsvd_main() local
367 lsa = xhost2sockaddr(argv[0], local_port); in tcpudpsvd_main()
370 sock = xsocket(lsa->u.sa.sa_family, tcp ? SOCK_STREAM : SOCK_DGRAM, 0); in tcpudpsvd_main()
372 sa_len = lsa->len; /* I presume sockaddr len stays the same */ in tcpudpsvd_main()
373 xbind(sock, &lsa->u.sa, sa_len); in tcpudpsvd_main()
391 char *addr = xmalloc_sockaddr2dotted(&lsa->u.sa); in tcpudpsvd_main()
423 local = *lsa; in tcpudpsvd_main()
461 sock = xsocket(lsa->u.sa.sa_family, SOCK_DGRAM, 0); in tcpudpsvd_main()
471 xbind(sock, &lsa->u.sa, sa_len); in tcpudpsvd_main()
Difconfig.c434 len_and_sockaddr *lsa; in ifconfig_main() local
445 lsa = xhost2sockaddr(host, 0); in ifconfig_main()
447 if (lsa->u.sa.sa_family != AF_INET6 && prefix) { in ifconfig_main()
454 if (lsa->u.sa.sa_family == AF_INET6) { in ifconfig_main()
463 &lsa->u.sin6.sin6_addr, in ifconfig_main()
467 free(lsa); in ifconfig_main()
471 sai.sin_addr = lsa->u.sin.sin_addr; in ifconfig_main()
473 free(lsa); in ifconfig_main()
Dnslookup.c167 len_and_sockaddr *lsa; in set_default_dns() local
173 lsa = xhost2sockaddr(server, 53); in set_default_dns()
175 if (lsa->u.sa.sa_family == AF_INET) { in set_default_dns()
178 _res.nsaddr_list[0] = lsa->u.sin; in set_default_dns()
185 if (lsa->u.sa.sa_family == AF_INET6) { in set_default_dns()
191 _res._u._ext.nsaddrs[0] = &lsa->u.sin6; in set_default_dns()
259 len_and_sockaddr *lsa; member
530 pfd.fd = xsocket_type(&local_lsa, ns->lsa->u.sa.sa_family, SOCK_DGRAM); in send_queries()
540 xconnect(pfd.fd, &ns->lsa->u.sa, ns->lsa->len); in send_queries()
583 auto_string(xmalloc_sockaddr2dotted(&ns->lsa->u.sa)) in send_queries()
[all …]
Dwget.c437 static FILE *open_socket(len_and_sockaddr *lsa) in open_socket() argument
443 fd = xconnect_stream(lsa); in open_socket()
826 static FILE* prepare_ftp_session(FILE **dfpp, struct host_info *target, len_and_sockaddr *lsa) in prepare_ftp_session() argument
832 sfp = open_socket(lsa); in prepare_ftp_session()
885 set_nport(&lsa->u.sa, htons(port)); in prepare_ftp_session()
887 *dfpp = open_socket(lsa); in prepare_ftp_session()
1101 len_and_sockaddr *lsa; in download_one_url() local
1171 lsa = xhost2sockaddr(server.host, server.port); in download_one_url()
1173 char *s = xmalloc_sockaddr2dotted(&lsa->u.sa); in download_one_url()
1198 sfp = open_socket(lsa); in download_one_url()
[all …]
Darping.c341 len_and_sockaddr *lsa; in arping_main() local
342 lsa = xhost_and_af2sockaddr(target, 0, AF_INET); in arping_main()
343 dst = lsa->u.sin.sin_addr; in arping_main()
345 free(lsa); in arping_main()
Dtelnetd.c523 len_and_sockaddr *lsa = get_peer_lsa(sock); in make_new_session() local
525 if (lsa) { in make_new_session()
526 hostname = xmalloc_sockaddr2dotted(&lsa->u.sa); in make_new_session()
527 free(lsa); in make_new_session()
Dntpd.c736 static uint32_t calculate_refid(len_and_sockaddr *lsa) in calculate_refid() argument
739 if (lsa->u.sa.sa_family == AF_INET6) { in calculate_refid()
744 md5_hash(&md5, &lsa->u.sin6.sin6_addr, sizeof(lsa->u.sin6.sin6_addr)); in calculate_refid()
749 return lsa->u.sin.sin_addr.s_addr; in calculate_refid()
756 len_and_sockaddr *lsa = host2sockaddr(p->p_hostname, 123); in resolve_peer_hostname() local
757 if (lsa) { in resolve_peer_hostname()
760 p->p_lsa = lsa; in resolve_peer_hostname()
761 p->p_dotted = xmalloc_sockaddr2dotted_noport(&lsa->u.sa); in resolve_peer_hostname()
768 return lsa; in resolve_peer_hostname()
771 return lsa; in resolve_peer_hostname()
Dhttpd.c2285 len_and_sockaddr *lsa; in handle_incoming_and_exit() local
2289 lsa = host2sockaddr(proxy_entry->host_port, 80); in handle_incoming_and_exit()
2290 if (!lsa) in handle_incoming_and_exit()
2292 proxy_fd = socket(lsa->u.sa.sa_family, SOCK_STREAM, 0); in handle_incoming_and_exit()
2295 if (connect(proxy_fd, &lsa->u.sa, lsa->len) < 0) in handle_incoming_and_exit()
/busybox-1.35.0/networking/udhcp/
Dcommon.c435 len_and_sockaddr *lsa; in udhcp_str2nip() local
437 lsa = host_and_af2sockaddr(str, 0, AF_INET); in udhcp_str2nip()
438 if (!lsa) in udhcp_str2nip()
441 move_to_unaligned32((uint32_t*)arg, lsa->u.sin.sin_addr.s_addr); in udhcp_str2nip()
442 free(lsa); in udhcp_str2nip()
Ddhcpd.c913 len_and_sockaddr *lsa = xhost_and_af2sockaddr(str_I, 0, AF_INET); in udhcpd_main() local
914 server_data.server_nip = lsa->u.sin.sin_addr.s_addr; in udhcpd_main()
915 free(lsa); in udhcpd_main()
/busybox-1.35.0/util-linux/
Dmount.c1881 len_and_sockaddr *lsa; in nfsmount() local
1897 lsa = xhost2sockaddr(mp->mnt_fsname, /*port:*/ 0); in nfsmount()
1899 dotted = xmalloc_sockaddr2dotted_noport(&lsa->u.sa); in nfsmount()
1900 if (ENABLE_FEATURE_CLEAN_UP) free(lsa); in nfsmount()
2025 len_and_sockaddr *lsa; in singlemount() local
2059 lsa = host2sockaddr(hostname, 0); in singlemount()
2061 if (!lsa) in singlemount()
2070 dotted = xmalloc_sockaddr2dotted_noport(&lsa->u.sa); in singlemount()
2071 if (ENABLE_FEATURE_CLEAN_UP) free(lsa); in singlemount()
/busybox-1.35.0/include/
Dlibbb.h791 int xconnect_stream(const len_and_sockaddr *lsa) FAST_FUNC;