Home
last modified time | relevance | path

Searched +full:ip +full:- +full:addr (Results 1 – 25 of 153) sorted by relevance

1234567

/Zephyr-latest/samples/net/vlan/
Dvlan-setup-linux.sh9 # http://www.apache.org/licenses/LICENSE-2.0
19 if [ -z "$1" ]; then
26 if [ `id -u` != 0 ]; then
46 ip link add link ${IFACE} name ${VLAN_NAME_PREFIX}.100 type vlan id 100
47 ip link add link ${IFACE} name ${VLAN_NAME_PREFIX}.200 type vlan id 200
49 ip link set ${VLAN_NAME_PREFIX}.100 up
50 ip link set ${VLAN_NAME_PREFIX}.200 up
52 ip -6 addr add ${PREFIX_1_IPV6}::2/${PREFIXLEN_1_IPV6} dev ${VLAN_NAME_PREFIX}.100
53 ip -6 route add ${PREFIX_1_IPV6}::/${PREFIXLEN_1_IPV6} \
56 ip -6 addr add ${PREFIX_2_IPV6}::2/${PREFIXLEN_2_IPV6} dev ${VLAN_NAME_PREFIX}.200
[all …]
/Zephyr-latest/subsys/net/lib/zperf/
Dzperf_session.c5 * SPDX-License-Identifier: Apache-2.0
23 struct session *get_session(const struct sockaddr *addr, in get_session() argument
29 const struct sockaddr_in *addr4 = (const struct sockaddr_in *)addr; in get_session()
30 const struct sockaddr_in6 *addr6 = (const struct sockaddr_in6 *)addr; in get_session()
42 addr->sa_family == AF_INET && in get_session()
43 ptr->ip.family == AF_INET && in get_session()
44 ptr->port == addr4->sin_port && in get_session()
45 net_ipv4_addr_cmp(&ptr->ip.in_addr, &addr4->sin_addr)) { in get_session()
52 addr->sa_family == AF_INET6 && in get_session()
53 ptr->ip.family == AF_INET6 && in get_session()
[all …]
/Zephyr-latest/tests/net/ip-addr/
Dtestcase.yaml4 - net
5 - ip-addr
7 net.ip-addr:
DCMakeLists.txt1 # SPDX-License-Identifier: Apache-2.0
5 project(ip-addr) project
7 target_include_directories(app PRIVATE ${ZEPHYR_BASE}/subsys/net/ip)
/Zephyr-latest/subsys/net/lib/shell/
Dtcp.c5 * SPDX-License-Identifier: Apache-2.0
40 &net_sin6(myaddr)->sin6_addr); in get_my_ipv6_addr()
42 memcpy(&net_sin6(myaddr)->sin6_addr, my6addr, sizeof(struct in6_addr)); in get_my_ipv6_addr()
44 net_sin6(myaddr)->sin6_port = 0U; /* let the IP stack to select */ in get_my_ipv6_addr()
53 memcpy(&net_sin(myaddr)->sin_addr, in get_my_ipv4_addr()
54 &iface->config.ip.ipv4->unicast[0].ipv4.address.in_addr, in get_my_ipv4_addr()
57 net_sin(myaddr)->sin_port = 0U; /* let the IP stack to select */ in get_my_ipv4_addr()
64 struct sockaddr *addr) in print_connect_info() argument
70 net_sprint_ipv4_addr(&net_sin(myaddr)->sin_addr), in print_connect_info()
71 ntohs(net_sin(myaddr)->sin_port)); in print_connect_info()
[all …]
Dcapture.c5 * SPDX-License-Identifier: Apache-2.0
21 static void get_address_str(const struct sockaddr *addr, in get_address_str() argument
24 if (IS_ENABLED(CONFIG_NET_IPV6) && addr->sa_family == AF_INET6) { in get_address_str()
26 net_sprint_ipv6_addr(&net_sin6(addr)->sin6_addr), in get_address_str()
27 ntohs(net_sin6(addr)->sin6_port)); in get_address_str()
29 } else if (IS_ENABLED(CONFIG_NET_IPV4) && addr->sa_family == AF_INET) { in get_address_str()
31 net_sprint_ipv4_addr(&net_sin(addr)->sin_addr), in get_address_str()
32 ntohs(net_sin(addr)->sin_port)); in get_address_str()
35 addr->sa_family == AF_PACKET) { in get_address_str()
38 addr->sa_family == AF_CAN) { in get_address_str()
[all …]
/Zephyr-latest/include/zephyr/logging/
Dlog_backend_net.h4 * SPDX-License-Identifier: Apache-2.0
18 * @brief Allows user to set a server IP address, provided as string, at runtime
25 * @param addr String that contains the IP address.
29 bool log_backend_net_set_addr(const char *addr);
32 * @brief Allows user to set a server IP address, provided as sockaddr structure, at runtime
39 * @param addr Pointer to the sockaddr structure that contains the IP address.
43 bool log_backend_net_set_ip(const struct sockaddr *addr);
/Zephyr-latest/subsys/net/lib/ptp/
Dtransport.c4 * SPDX-License-Identifier: Apache-2.0
27 static int transport_socket_open(struct net_if *iface, struct sockaddr *addr) in transport_socket_open() argument
34 int socket = zsock_socket(addr->sa_family, SOCK_DGRAM, IPPROTO_UDP); in transport_socket_open()
38 return -1; in transport_socket_open()
42 return -1; in transport_socket_open()
50 if (zsock_bind(socket, addr, sizeof(*addr))) { in transport_socket_open()
78 return -1; in transport_socket_open()
87 mreqn.imr_ifindex = net_if_get_by_iface(port->iface); in transport_join_multicast()
89 zsock_setsockopt(port->socket[1], IPPROTO_IP, in transport_join_multicast()
95 mreqn.ipv6mr_ifindex = net_if_get_by_iface(port->iface); in transport_join_multicast()
[all …]
/Zephyr-latest/subsys/net/ip/
Dnet_if.c5 * SPDX-License-Identifier: Apache-2.0
44 * so that integer-based math works better
138 NET_ASSERT(pkt->frags); \
150 if (&_net_if_list_start[index - 1] >= _net_if_list_end) { in z_impl_net_if_get_by_index()
155 return &_net_if_list_start[index - 1]; in z_impl_net_if_get_by_index()
186 if (context->send_cb) { in net_context_send_cb()
187 context->send_cb(context, status, context->user_data); in net_context_send_cb()
210 val = net_pkt_stats_tick(pkt)[i] - prev; in update_txtime_stats_detail()
219 .addr = NULL in net_if_tx()
243 net_pkt_lladdr_dst(pkt)->addr, in net_if_tx()
[all …]
/Zephyr-latest/subsys/net/lib/capture/
Dcapture.c4 * SPDX-License-Identifier: Apache-2.0
77 * Peer (inner) tunnel IP address.
82 * Local (inner) tunnel IP address. This will be set
124 if (!ctx->in_use) { in net_capture_foreach()
128 info.capture_dev = ctx->dev; in net_capture_foreach()
129 info.capture_iface = ctx->capture_iface; in net_capture_foreach()
130 info.tunnel_iface = ctx->tunnel_iface; in net_capture_foreach()
131 info.peer = &ctx->peer; in net_capture_foreach()
132 info.local = &ctx->local; in net_capture_foreach()
133 info.is_enabled = ctx->is_enabled; in net_capture_foreach()
[all …]
/Zephyr-latest/drivers/net/
Dnsos.h2 * Copyright (c) 2023-2024 Marcin Niestroj
4 * SPDX-License-Identifier: Apache-2.0
15 #define NSOS_MID_PF_INET 1 /**< IP protocol family version 4. */
16 #define NSOS_MID_PF_INET6 2 /**< IP protocol family version 6. */
22 #define NSOS_MID_AF_INET NSOS_MID_PF_INET /**< IP protocol family version 4. */
23 #define NSOS_MID_AF_INET6 NSOS_MID_PF_INET6 /**< IP protocol family version 6. */
29 NSOS_MID_IPPROTO_IP = 0, /**< IP protocol (pseudo-val for setsockopt() */
38 NSOS_MID_IPPROTO_RAW = 255, /**< RAW IP packets */
79 uint16_t sll_protocol; /**< Physical-layer protocol */
84 uint8_t sll_addr[8]; /**< Physical-layer address, big endian */
[all …]
/Zephyr-latest/include/zephyr/net/
Dsntp.h5 * SPDX-License-Identifier: Apache-2.0
63 * @param addr IP address of NTP/SNTP server.
64 * @param addr_len IP address length of NTP/SNTP server.
68 int sntp_init(struct sntp_ctx *ctx, struct sockaddr *addr,
79 * @return 0 if ok, <0 if error (-ETIMEDOUT if timeout).
91 * @return 0 if ok, <0 if error (-ETIMEDOUT if timeout).
103 * @brief Convenience function to query SNTP in one-shot fashion
108 * @param server Address of server in format addr[:port]
113 * @return 0 if ok, <0 if error (-ETIMEDOUT if timeout).
119 * @brief Convenience function to query SNTP in one-shot fashion
[all …]
Dnet_if.h4 * SPDX-License-Identifier: Apache-2.0
52 * @brief Network Interface unicast IP addresses
54 * Stores the unicast IP addresses assigned to this network interface.
57 /** IP address */
69 /** How the IP address was set */
125 /** Is the IP address valid forever */
128 /** Is this IP address used or not */
131 /** Is this IP address usage limited to the subnet (mesh) or not */
134 /** Is this IP address temporary and generated for example by
143 * @brief Network Interface multicast IP addresses
[all …]
Dnet_offload.h4 * SPDX-License-Identifier: Apache-2.0
9 * @brief Public API for offloading IP stack
41 return -1; in timeout_to_int32()
62 * This function is called when user wants to bind to local IP address.
65 const struct sockaddr *addr,
79 const struct sockaddr *addr,
128 * @brief Get a network socket/context from the offloaded IP stack.
131 * 5-tuple (protocol, remote address, remote port, source
135 * @param iface Network interface where the offloaded IP stack can be
137 * @param family IP address family (AF_INET or AF_INET6)
[all …]
Dnet_ip.h10 * SPDX-License-Identifier: Apache-2.0
45 #define PF_INET 1 /**< IP protocol family version 4. */
46 #define PF_INET6 2 /**< IP protocol family version 6. */
50 #define PF_LOCAL 6 /**< Inter-process communication */
51 #define PF_UNIX PF_LOCAL /**< Inter-process communication */
55 #define AF_INET PF_INET /**< IP protocol family version 4. */
56 #define AF_INET6 PF_INET6 /**< IP protocol family version 6. */
60 #define AF_LOCAL PF_LOCAL /**< Inter-process communication */
61 #define AF_UNIX PF_UNIX /**< Inter-process communication */
65 IPPROTO_IP = 0, /**< IP protocol (pseudo-val for setsockopt() */
[all …]
/Zephyr-latest/subsys/net/l2/ethernet/
Darp.c8 * SPDX-License-Identifier: Apache-2.0
51 while (!k_fifo_is_empty(&entry->pending_queue)) { in arp_entry_cleanup()
52 pkt = k_fifo_get(&entry->pending_queue, K_FOREVER); in arp_entry_cleanup()
55 atomic_get(&pkt->atomic_ref) - 1); in arp_entry_cleanup()
60 entry->iface = NULL; in arp_entry_cleanup()
62 (void)memset(&entry->ip, 0, sizeof(struct in_addr)); in arp_entry_cleanup()
63 (void)memset(&entry->eth, 0, sizeof(struct net_eth_addr)); in arp_entry_cleanup()
76 net_sprint_ipv4_addr(&entry->ip)); in arp_entry_find()
78 if (entry->iface == iface && in arp_entry_find()
79 net_ipv4_addr_cmp(&entry->ip, dst)) { in arp_entry_find()
[all …]
/Zephyr-latest/drivers/modem/
Dmodem_context.h11 * SPDX-License-Identifier: Apache-2.0
76 * @brief IP address to string
78 * @param addr: sockaddr to be converted
79 * @param buf: Buffer to store IP in string form
84 int modem_context_sprint_ip_addr(const struct sockaddr *addr, char *buf, size_t buf_size);
87 * @brief Get port from IP address
89 * @param addr: sockaddr
94 int modem_context_get_addr_port(const struct sockaddr *addr, uint16_t *port);
/Zephyr-latest/tests/net/socket/reuseaddr_reuseport/src/
Dmain.c4 * SPDX-License-Identifier: Apache-2.0
36 static void test_add_local_ip_address(sa_family_t family, const char *ip) in test_add_local_ip_address() argument
39 struct sockaddr_in addr; in test_add_local_ip_address() local
42 zsock_inet_pton(AF_INET, ip, &addr.sin_addr); in test_add_local_ip_address()
45 &addr.sin_addr, in test_add_local_ip_address()
49 "Cannot add IPv4 address %s", ip); in test_add_local_ip_address()
51 struct sockaddr_in6 addr; in test_add_local_ip_address() local
53 zsock_inet_pton(AF_INET6, ip, &addr.sin6_addr); in test_add_local_ip_address()
56 &addr.sin6_addr, in test_add_local_ip_address()
59 "Cannot add IPv6 address %s", ip); in test_add_local_ip_address()
[all …]
/Zephyr-latest/subsys/net/lib/lwm2m/
Dlwm2m_util.h2 * Copyright (c) 2018-2019 Foundries.io
4 * SPDX-License-Identifier: Apache-2.0
32 * @brief Used for debugging to print ip addresses.
34 * @param addr sockaddr for socket using ipv4 or ipv6
35 * @return ip address in readable form
37 char *lwm2m_sprint_ip_addr(const struct sockaddr *addr);
/Zephyr-latest/doc/connectivity/networking/
Dnetwork_monitoring.rst16 See also the :zephyr:code-sample:`net-capture` sample application from the Zephyr
26 On the Linux Host, find the Zephyr `net-tools`_ project, which can either be
27 found in a Zephyr standard installation under the ``tools/net-tools`` directory
30 .. code-block:: console
32 git clone https://github.com/zephyrproject-rtos/net-tools
34 The ``net-tools`` project provides a configure file to setup IP-to-IP tunnel
39 .. code-block:: console
41 ./net-setup.sh -c zeth-tunnel.conf
45 .. csv-table::
49 "``zeth-ip6ip``", "IPv6-over-IPv4 tunnel"
[all …]
Dusbnet_setup.rst15 The :zephyr:code-sample:`sockets-echo-server` application from the Zephyr source
23 interface, we need to assign IP addresses and set up a routing table for
32 .. code-block:: console
34 …cdc_ether 1-2.7:1.0 eth0: register 'cdc_ether' at usb-0000:00:01.2-2.7, CDC Ethernet Device, 00:00…
36 We need to set it up and assign IP addresses as explained in the following
39 Choosing IP addresses
42 To establish network connection to the board we need to choose IP address
46 application. IP addresses usually set in the project configuration files
51 .. code-block:: console
57 Link addr : 00:00:5E:00:53:00
[all …]
/Zephyr-latest/tests/net/arp/src/
Dmain.c1 /* main.c - Application main entry point */
6 * SPDX-License-Identifier: Apache-2.0
46 static int send_status = -EINVAL;
55 struct net_arp_context *net_arp_context = dev->data; in net_arp_dev_init()
64 struct net_arp_context *context = dev->data; in net_arp_get_mac()
66 if (context->mac_addr[2] == 0x00) { in net_arp_get_mac()
67 /* 00-00-5E-00-53-xx Documentation RFC 7042 */ in net_arp_get_mac()
68 context->mac_addr[0] = 0x00; in net_arp_get_mac()
69 context->mac_addr[1] = 0x00; in net_arp_get_mac()
70 context->mac_addr[2] = 0x5E; in net_arp_get_mac()
[all …]
/Zephyr-latest/subsys/profiling/perf/backends/
Dperf_riscv.c4 * SPDX-License-Identifier: Apache-2.0
9 static bool valid_stack(uintptr_t addr, k_tid_t current) in valid_stack() argument
11 return current->stack_info.start <= addr && in valid_stack()
12 addr < current->stack_info.start + current->stack_info.size; in valid_stack()
15 static inline bool in_text_region(uintptr_t addr) in in_text_region() argument
19 return (addr >= (uintptr_t)&__text_region_start) && (addr < (uintptr_t)&__text_region_end); in in_text_region()
36 * In riscv (arch/riscv/core/isr.S) ra, ip($mepc) and fp($s0) are saved in arch_perf_current_stack_trace()
39 * _current_cpu->irq_stack and save $sp with offset -16 on irq stack in arch_perf_current_stack_trace()
41 * The following lines lines do the reverse things to get ra, ip anf fp in arch_perf_current_stack_trace()
45 *((struct arch_esf **)(((uintptr_t)_current_cpu->irq_stack) - 16)); in arch_perf_current_stack_trace()
[all …]
/Zephyr-latest/subsys/net/l2/ppp/
Dipcp.c5 * SPDX-License-Identifier: Apache-2.0
25 return ppp_fsm_input(&ctx->ipcp.fsm, PPP_IPCP, pkt); in ipcp_handle()
34 struct in_addr *addr) in ipcp_add_address() argument
36 net_pkt_write_u8(pkt, 1 + 1 + sizeof(addr->s_addr)); in ipcp_add_address()
37 return net_pkt_write(pkt, &addr->s_addr, sizeof(addr->s_addr)); in ipcp_add_address()
42 return ipcp_add_address(ctx, pkt, &ctx->ipcp.my_options.address); in ipcp_add_ip_address()
47 return ipcp_add_address(ctx, pkt, &ctx->ipcp.my_options.dns1_address); in ipcp_add_dns1()
52 return ipcp_add_address(ctx, pkt, &ctx->ipcp.my_options.dns2_address); in ipcp_add_dns2()
56 struct in_addr *addr) in ipcp_ack_check_address() argument
62 return -EINVAL; in ipcp_ack_check_address()
[all …]
/Zephyr-latest/subsys/net/lib/config/
Dinit.c6 * SPDX-License-Identifier: Apache-2.0
70 ARRAY_FOR_EACH(iface->config.ip.ipv4->unicast, i) { in print_dhcpv4_info()
72 &iface->config.ip.ipv4->unicast[i].ipv4; in print_dhcpv4_info()
74 if (if_addr->addr_type != NET_ADDR_DHCP || in print_dhcpv4_info()
75 !if_addr->is_used) { in print_dhcpv4_info()
81 net_addr_ntop(AF_INET, &if_addr->address.in_addr, in print_dhcpv4_info()
84 iface->config.dhcpv4.lease_time); in print_dhcpv4_info()
87 &iface->config.ip.ipv4->unicast[i].netmask, in print_dhcpv4_info()
90 net_addr_ntop(AF_INET, &iface->config.ip.ipv4->gw, in print_dhcpv4_info()
147 struct in_addr addr, netmask; in setup_ipv4() local
[all …]

1234567