Home
last modified time | relevance | path

Searched refs:addr (Results 1 – 25 of 98) sorted by relevance

1234

/systemd-251/src/basic/
Dether-addr-util.h40 const struct hw_addr_data *addr,
43 static inline char *hw_addr_to_string(const struct hw_addr_data *addr, char buffer[static HW_ADDR_T… in hw_addr_to_string() argument
44 return hw_addr_to_string_full(addr, 0, buffer); in hw_addr_to_string()
60 static inline bool hw_addr_is_null(const struct hw_addr_data *addr) { in hw_addr_is_null() argument
61 assert(addr); in hw_addr_is_null()
62 return addr->length == 0 || memeqzero(addr->bytes, addr->length); in hw_addr_is_null()
72 char* ether_addr_to_string(const struct ether_addr *addr, char buffer[ETHER_ADDR_TO_STRING_MAX]);
73 int ether_addr_to_string_alloc(const struct ether_addr *addr, char **ret);
75 #define ETHER_ADDR_TO_STR(addr) ether_addr_to_string((addr), (char[ETHER_ADDR_TO_STRING_MAX]){}) argument
84 static inline bool ether_addr_is_null(const struct ether_addr *addr) { in ether_addr_is_null() argument
[all …]
Dether-addr-util.c15 const struct hw_addr_data *addr, in hw_addr_to_string_full() argument
19 assert(addr); in hw_addr_to_string_full()
21 assert(addr->length <= HW_ADDR_MAX_SIZE); in hw_addr_to_string_full()
23 for (size_t i = 0, j = 0; i < addr->length; i++) { in hw_addr_to_string_full()
24 buffer[j++] = hexchar(addr->bytes[i] >> 4); in hw_addr_to_string_full()
25 buffer[j++] = hexchar(addr->bytes[i] & 0x0f); in hw_addr_to_string_full()
30 buffer[addr->length == 0 || FLAGS_SET(flags, HW_ADDR_TO_STRING_NO_COLON) ? in hw_addr_to_string_full()
31 addr->length * 2 : in hw_addr_to_string_full()
32 addr->length * 3 - 1] = '\0'; in hw_addr_to_string_full()
60 char* ether_addr_to_string(const struct ether_addr *addr, char buffer[ETHER_ADDR_TO_STRING_MAX]) { in ether_addr_to_string() argument
[all …]
Din-addr-util.c579 unsigned char in4_addr_netmask_to_prefixlen(const struct in_addr *addr) { in in4_addr_netmask_to_prefixlen() argument
580 assert(addr); in in4_addr_netmask_to_prefixlen()
582 return 32U - u32ctz(be32toh(addr->s_addr)); in in4_addr_netmask_to_prefixlen()
585 struct in_addr* in4_addr_prefixlen_to_netmask(struct in_addr *addr, unsigned char prefixlen) { in in4_addr_prefixlen_to_netmask() argument
586 assert(addr); in in4_addr_prefixlen_to_netmask()
591 addr->s_addr = 0; in in4_addr_prefixlen_to_netmask()
593 addr->s_addr = htobe32((0xffffffff << (32 - prefixlen)) & 0xffffffff); in in4_addr_prefixlen_to_netmask()
595 return addr; in in4_addr_prefixlen_to_netmask()
598 int in4_addr_default_prefixlen(const struct in_addr *addr, unsigned char *prefixlen) { in in4_addr_default_prefixlen() argument
599 uint8_t msb_octet = *(uint8_t*) addr; in in4_addr_default_prefixlen()
[all …]
Dsigbus.c25 static void sigbus_push(void *addr) { in sigbus_push() argument
26 assert(addr); in sigbus_push()
30 if (__sync_bool_compare_and_swap(&sigbus_queue[u], NULL, addr)) { in sigbus_push()
67 void *addr; in sigbus_pop() local
69 addr = sigbus_queue[u]; in sigbus_pop()
70 if (!addr) in sigbus_pop()
73 if (__sync_bool_compare_and_swap(&sigbus_queue[u], addr, NULL)) { in sigbus_pop()
75 *ret = addr; in sigbus_pop()
Din-addr-util.h89 unsigned char in4_addr_netmask_to_prefixlen(const struct in_addr *addr);
90 struct in_addr* in4_addr_prefixlen_to_netmask(struct in_addr *addr, unsigned char prefixlen);
91 int in4_addr_default_prefixlen(const struct in_addr *addr, unsigned char *prefixlen);
92 int in4_addr_default_subnet_mask(const struct in_addr *addr, struct in_addr *mask);
93 int in4_addr_mask(struct in_addr *addr, unsigned char prefixlen);
94 int in6_addr_mask(struct in6_addr *addr, unsigned char prefixlen);
95 int in_addr_mask(int family, union in_addr_union *addr, unsigned char prefixlen);
129 void in6_addr_hash_func(const struct in6_addr *addr, struct siphash *state);
Dnss-util.h45 const void* addr, socklen_t len, \
52 const void* addr, socklen_t len, \
104 const void* addr, socklen_t len, \
110 addr, len, \
240 const void* addr, socklen_t len,
247 const void* addr, socklen_t len,
/systemd-251/src/network/
Dnetworkd-address-generation.c76 static bool stable_private_address_is_valid(const struct in6_addr *addr) { in stable_private_address_is_valid() argument
77 assert(addr); in stable_private_address_is_valid()
81 … if (in6_addr_prefix_covers(&SUBNET_ROUTER_ANYCAST_ADDRESS, SUBNET_ROUTER_ANYCAST_PREFIXLEN, addr)) in stable_private_address_is_valid()
84 …ix_covers(&RESERVED_INTERFACE_IDENTIFIERS_ADDRESS, RESERVED_INTERFACE_IDENTIFIERS_PREFIXLEN, addr)) in stable_private_address_is_valid()
87 …n6_addr_prefix_covers(&RESERVED_SUBNET_ANYCAST_ADDRESSES, RESERVED_SUBNET_ANYCAST_PREFIXLEN, addr)) in stable_private_address_is_valid()
136 struct in6_addr addr; in generate_stable_private_address() local
159 generate_stable_private_address_one(link, secret_key, prefix, i, &addr); in generate_stable_private_address()
161 if (stable_private_address_is_valid(&addr)) in generate_stable_private_address()
169 *ret = addr; in generate_stable_private_address()
196 struct in6_addr addr, *copy; in generate_addresses() local
[all …]
Dnetworkd-dhcp6.c208 _cleanup_(address_freep) Address *addr = NULL; in dhcp6_request_address()
212 r = address_new(&addr); in dhcp6_request_address()
216 addr->source = NETWORK_CONFIG_SOURCE_DHCP6; in dhcp6_request_address()
217 addr->provider.in6 = *server_address; in dhcp6_request_address()
218 addr->family = AF_INET6; in dhcp6_request_address()
219 addr->in_addr.in6 = *ip6_addr; in dhcp6_request_address()
220 addr->flags = IFA_F_NOPREFIXROUTE; in dhcp6_request_address()
221 addr->prefixlen = 128; in dhcp6_request_address()
222 addr->lifetime_preferred_usec = lifetime_preferred_usec; in dhcp6_request_address()
223 addr->lifetime_valid_usec = lifetime_valid_usec; in dhcp6_request_address()
[all …]
Dnetworkd-dhcp4.c834 _cleanup_(address_freep) Address *addr = NULL; in dhcp4_request_address()
899 r = address_new(&addr); in dhcp4_request_address()
903 addr->source = NETWORK_CONFIG_SOURCE_DHCP4; in dhcp4_request_address()
904 addr->provider.in = server; in dhcp4_request_address()
905 addr->family = AF_INET; in dhcp4_request_address()
906 addr->in_addr.in.s_addr = address.s_addr; in dhcp4_request_address()
907 addr->lifetime_preferred_usec = lifetime_usec; in dhcp4_request_address()
908 addr->lifetime_valid_usec = lifetime_usec; in dhcp4_request_address()
909 addr->prefixlen = prefixlen; in dhcp4_request_address()
910 address_set_broadcast(addr, link); in dhcp4_request_address()
[all …]
/systemd-251/src/systemd/
Dsd-dhcp-lease.h49 int sd_dhcp_lease_get_address(sd_dhcp_lease *lease, struct in_addr *addr);
53 int sd_dhcp_lease_get_broadcast(sd_dhcp_lease *lease, struct in_addr *addr);
54 int sd_dhcp_lease_get_netmask(sd_dhcp_lease *lease, struct in_addr *addr);
55 int sd_dhcp_lease_get_router(sd_dhcp_lease *lease, const struct in_addr **addr);
56 int sd_dhcp_lease_get_next_server(sd_dhcp_lease *lease, struct in_addr *addr);
57 int sd_dhcp_lease_get_server_identifier(sd_dhcp_lease *lease, struct in_addr *addr);
58 …e_get_servers(sd_dhcp_lease *lease, sd_dhcp_lease_server_type_t what, const struct in_addr **addr);
59 int sd_dhcp_lease_get_dns(sd_dhcp_lease *lease, const struct in_addr **addr);
60 int sd_dhcp_lease_get_ntp(sd_dhcp_lease *lease, const struct in_addr **addr);
61 int sd_dhcp_lease_get_sip(sd_dhcp_lease *lease, const struct in_addr **addr);
[all …]
/systemd-251/src/test/
Dtest-sigbus.c20 void *addr = NULL; in main() local
35 assert_se(sigbus_pop(&addr) == 0); in main()
44 assert_se(sigbus_pop(&addr) == 0); in main()
47 assert_se(sigbus_pop(&addr) == 0); in main()
50 assert_se(sigbus_pop(&addr) == 0); in main()
55 assert_se(sigbus_pop(&addr) > 0); in main()
56 assert_se(addr == p + page_size() * 8); in main()
57 assert_se(sigbus_pop(&addr) > 0); in main()
58 assert_se(addr == p + page_size() * 10); in main()
59 assert_se(sigbus_pop(&addr) == 0); in main()
Dtest-nss-hosts.c53 memcpy(&u, it->addr, 16); in print_gaih_addrtuples()
57 assert_se(a = hexmem(it->addr, 16)); in print_gaih_addrtuples()
245 const void* addr, socklen_t len, in test_gethostbyaddr2_r() argument
268 assert_se(in_addr_to_string(af, addr, &addr_pretty) >= 0); in test_gethostbyaddr2_r()
270 status = f(addr, len, af, &host, buffer, sizeof buffer, &errno1, &errno2, &ttl); in test_gethostbyaddr2_r()
283 const void* addr, socklen_t len, in test_gethostbyaddr_r() argument
305 assert_se(in_addr_to_string(af, addr, &addr_pretty) >= 0); in test_gethostbyaddr_r()
307 status = f(addr, len, af, &host, buffer, sizeof buffer, &errno1, &errno2); in test_gethostbyaddr_r()
345 const void* addr, socklen_t len, in test_byaddr() argument
347 test_gethostbyaddr2_r(handle, module, addr, len, af); in test_byaddr()
[all …]
/systemd-251/src/libsystemd-network/
Dsd-dhcp-lease.c34 int sd_dhcp_lease_get_address(sd_dhcp_lease *lease, struct in_addr *addr) { in sd_dhcp_lease_get_address() argument
36 assert_return(addr, -EINVAL); in sd_dhcp_lease_get_address()
41 addr->s_addr = lease->address; in sd_dhcp_lease_get_address()
45 int sd_dhcp_lease_get_broadcast(sd_dhcp_lease *lease, struct in_addr *addr) { in sd_dhcp_lease_get_broadcast() argument
47 assert_return(addr, -EINVAL); in sd_dhcp_lease_get_broadcast()
52 addr->s_addr = lease->broadcast; in sd_dhcp_lease_get_broadcast()
103 const struct in_addr **addr) { in sd_dhcp_lease_get_servers() argument
112 if (addr) in sd_dhcp_lease_get_servers()
113 *addr = lease->servers[what].addr; in sd_dhcp_lease_get_servers()
118 int sd_dhcp_lease_get_dns(sd_dhcp_lease *lease, const struct in_addr **addr) { in sd_dhcp_lease_get_dns() argument
[all …]
Dsd-ipv4ll.c142 int sd_ipv4ll_set_mac(sd_ipv4ll *ll, const struct ether_addr *addr) { in sd_ipv4ll_set_mac() argument
146 assert_return(addr, -EINVAL); in sd_ipv4ll_set_mac()
147 assert_return(!ether_addr_is_null(addr), -EINVAL); in sd_ipv4ll_set_mac()
149 r = sd_ipv4acd_set_mac(ll->acd, addr); in sd_ipv4ll_set_mac()
153 ll->mac = *addr; in sd_ipv4ll_set_mac()
244 be32_t addr; in ipv4ll_pick_address() local
256 addr = htobe32((h & UINT32_C(0x0000FFFF)) | IPV4LL_NETWORK); in ipv4ll_pick_address()
257 } while (addr == ll->address || in ipv4ll_pick_address()
258 IN_SET(be32toh(addr) & 0x0000FF00U, 0x0000U, 0xFF00U)); in ipv4ll_pick_address()
260 (void) in_addr_to_string(AF_INET, &(union in_addr_union) { .in.s_addr = addr }, &address); in ipv4ll_pick_address()
[all …]
Dtest-dhcp6-client.c794 struct in6_addr addr; in test_lease_managed() local
805 assert_se(sd_dhcp6_lease_get_address(lease, &addr, &lt_pref, &lt_valid) >= 0); in test_lease_managed()
806 assert_se(in6_addr_equal(&addr, &ia_na_address1)); in test_lease_managed()
809 assert_se(sd_dhcp6_lease_get_address(lease, &addr, &lt_pref, &lt_valid) >= 0); in test_lease_managed()
810 assert_se(in6_addr_equal(&addr, &ia_na_address2)); in test_lease_managed()
813 assert_se(sd_dhcp6_lease_get_address(lease, &addr, &lt_pref, &lt_valid) == -ENODATA); in test_lease_managed()
816 assert_se(sd_dhcp6_lease_get_address(lease, &addr, &lt_pref, &lt_valid) >= 0); in test_lease_managed()
817 assert_se(in6_addr_equal(&addr, &ia_na_address1)); in test_lease_managed()
820 assert_se(sd_dhcp6_lease_get_address(lease, &addr, &lt_pref, &lt_valid) >= 0); in test_lease_managed()
821 assert_se(in6_addr_equal(&addr, &ia_na_address2)); in test_lease_managed()
[all …]
Ddhcp-identifier.c67 static int dhcp_identifier_set_duid_llt(const uint8_t *addr, size_t addr_len, uint16_t arp_type, us… in dhcp_identifier_set_duid_llt() argument
70 assert(addr); in dhcp_identifier_set_duid_llt()
92 memcpy(ret_duid->llt.haddr, addr, addr_len); in dhcp_identifier_set_duid_llt()
99 static int dhcp_identifier_set_duid_ll(const uint8_t *addr, size_t addr_len, uint16_t arp_type, str… in dhcp_identifier_set_duid_ll() argument
100 assert(addr); in dhcp_identifier_set_duid_ll()
116 memcpy(ret_duid->ll.haddr, addr, addr_len); in dhcp_identifier_set_duid_ll()
178 const uint8_t *addr, in dhcp_identifier_set_duid() argument
188 … return dhcp_identifier_set_duid_llt(addr, addr_len, arp_type, llt_time, ret_duid, ret_len); in dhcp_identifier_set_duid()
192 return dhcp_identifier_set_duid_ll(addr, addr_len, arp_type, ret_duid, ret_len); in dhcp_identifier_set_duid()
Dtest-dhcp-client.c234 const uint8_t *addr, size_t addr_len, in dhcp_network_bind_raw_socket() argument
398 struct in_addr addr; in test_addr_acq_acquired() local
407 assert_se(sd_dhcp_lease_get_address(lease, &addr) >= 0); in test_addr_acq_acquired()
408 assert_se(memcmp(&addr.s_addr, &test_addr_acq_ack[44], in test_addr_acq_acquired()
409 sizeof(addr.s_addr)) == 0); in test_addr_acq_acquired()
411 assert_se(sd_dhcp_lease_get_netmask(lease, &addr) >= 0); in test_addr_acq_acquired()
412 assert_se(memcmp(&addr.s_addr, &test_addr_acq_ack[285], in test_addr_acq_acquired()
413 sizeof(addr.s_addr)) == 0); in test_addr_acq_acquired()
Dicmp6-util.c164 struct in6_addr addr = {}; in icmp6_receive() local
180 addr = sa.in6.sin6_addr; in icmp6_receive()
181 if (!in6_addr_is_link_local(&addr)) in icmp6_receive()
210 *ret_dst = addr; in icmp6_receive()
/systemd-251/src/boot/efi/
Ddevicetree.c17 err = BS->AllocatePages(AllocateAnyPages, EfiACPIReclaimMemory, pages, &state->addr); in devicetree_allocate()
43 err = fixup->Fixup(fixup, PHYSICAL_ADDRESS_TO_POINTER(state->addr), &size, in devicetree_fixup()
46 EFI_PHYSICAL_ADDRESS oldaddr = state->addr; in devicetree_fixup()
48 void *oldptr = PHYSICAL_ADDRESS_TO_POINTER(state->addr); in devicetree_fixup()
54 CopyMem(PHYSICAL_ADDRESS_TO_POINTER(state->addr), oldptr, len); in devicetree_fixup()
60 err = fixup->Fixup(fixup, PHYSICAL_ADDRESS_TO_POINTER(state->addr), &size, in devicetree_fixup()
98 err = handle->Read(handle, &len, PHYSICAL_ADDRESS_TO_POINTER(state->addr)); in devicetree_install()
106 … return BS->InstallConfigurationTable(&EfiDtbTableGuid, PHYSICAL_ADDRESS_TO_POINTER(state->addr)); in devicetree_install()
125 CopyMem(PHYSICAL_ADDRESS_TO_POINTER(state->addr), dtb_buffer, dtb_length); in devicetree_install_from_memory()
131 … return BS->InstallConfigurationTable(&EfiDtbTableGuid, PHYSICAL_ADDRESS_TO_POINTER(state->addr)); in devicetree_install_from_memory()
[all …]
Dlinux_x86.c132 EFI_PHYSICAL_ADDRESS addr; in linux_exec() local
152 addr = UINT32_MAX; /* Below the 32bit boundary */ in linux_exec()
157 &addr); in linux_exec()
161 boot_params = (struct boot_params *) PHYSICAL_ADDRESS_TO_POINTER(addr); in linux_exec()
169 addr = 0xA0000; in linux_exec()
175 &addr); in linux_exec()
179 CopyMem(PHYSICAL_ADDRESS_TO_POINTER(addr), cmdline, cmdline_len); in linux_exec()
180 ((CHAR8 *) PHYSICAL_ADDRESS_TO_POINTER(addr))[cmdline_len] = 0; in linux_exec()
181 boot_params->hdr.cmd_line_ptr = (UINT32) addr; in linux_exec()
Dlinux.c102 EFI_PHYSICAL_ADDRESS addr; member
107 if (p->addr == 0) in cleanup_pages()
109 (void) BS->FreePages(p->addr, p->num); in cleanup_pages()
149 err = BS->AllocatePages(AllocateAnyPages, EfiLoaderData, kernel.num, &kernel.addr); in linux_exec()
152 new_buffer = PHYSICAL_ADDRESS_TO_POINTER(ALIGN_TO(kernel.addr, kernel_alignment)); in linux_exec()
/systemd-251/src/journal-remote/
Djournal-remote.c483 SocketAddress *addr, in accept_connection() argument
490 fd2 = accept4(fd, &addr->sockaddr.sa, &addr->size, SOCK_NONBLOCK|SOCK_CLOEXEC); in accept_connection()
498 switch (socket_address_family(addr)) { in accept_connection()
504 r = socket_address_print(addr, &a); in accept_connection()
508 r = socknameinfo_pretty(&addr->sockaddr, addr->size, &b); in accept_connection()
514 af_to_ipv4_ipv6(socket_address_family(addr)), in accept_connection()
524 type, socket_address_family(addr)); in accept_connection()
536 SocketAddress addr = { in dispatch_raw_connection_event() local
542 fd2 = accept_connection("raw", fd, &addr, &hostname); in dispatch_raw_connection_event()
/systemd-251/src/shared/
Dquota-util.c11 int quotactl_devnum(int cmd, dev_t devnum, int id, void *addr) { in quotactl_devnum() argument
22 if (quotactl(cmd, devnode, id, addr) < 0) in quotactl_devnum()
28 int quotactl_path(int cmd, const char *path, int id, void *addr) { in quotactl_path() argument
41 return quotactl_devnum(cmd, devno, id, addr); in quotactl_path()
/systemd-251/src/nss-myhostname/
Dnss-myhostname.c120 memcpy(r_tuple->addr, LOCALADDRESS_IPV6, 16); in _nss_myhostname_gethostbyname4_r()
132 *(uint32_t*) r_tuple->addr = local_address_ipv4; in _nss_myhostname_gethostbyname4_r()
148 memcpy(r_tuple->addr, &a->address, 16); in _nss_myhostname_gethostbyname4_r()
411 const void* addr, socklen_t len, in _nss_myhostname_gethostbyaddr2_r() argument
430 assert(addr); in _nss_myhostname_gethostbyaddr2_r()
451 if ((*(uint32_t*) addr) == LOCALADDRESS_IPV4) in _nss_myhostname_gethostbyaddr2_r()
454 if ((*(uint32_t*) addr) == htobe32(INADDR_LOOPBACK)) { in _nss_myhostname_gethostbyaddr2_r()
466 if (memcmp(addr, LOCALADDRESS_IPV6, 16) == 0) { in _nss_myhostname_gethostbyaddr2_r()
475 if (memcmp(addr, &a->address, FAMILY_ADDRESS_SIZE(af)) == 0) in _nss_myhostname_gethostbyaddr2_r()
482 if (memcmp(addr, &a->address, FAMILY_ADDRESS_SIZE(af)) == 0) { in _nss_myhostname_gethostbyaddr2_r()
/systemd-251/src/network/generator/
Dnetwork-generator.c86 union in_addr_union *addr, union in_addr_union *peer, Address **ret) { in address_new() argument
98 .address = *addr, in address_new()
388 union in_addr_union *addr, union in_addr_union *peer) { in network_set_address() argument
391 if (!in_addr_is_set(family, addr)) in network_set_address()
398 return address_new(network, family, prefixlen, addr, peer, NULL); in network_set_address()
592 union in_addr_union addr = {}, peer = {}, gateway = {}; in parse_cmdline_ip_address() local
600 r = parse_ip_address_one(family, &value, &addr); in parse_cmdline_ip_address()
651 r = network_set_address(context, ifname, family, prefixlen, &addr, &peer); in parse_cmdline_ip_address()
739 union in_addr_union addr = {}, gateway = {}; in parse_cmdline_rd_route() local
770 r = in_addr_prefix_from_string(buf, family, &addr, &prefixlen); in parse_cmdline_rd_route()
[all …]

1234