Home
last modified time | relevance | path

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

12345

/Zephyr-Core-3.5.0/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 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 dev ${VLAN_NAME_PREFIX}.200
[all …]
/Zephyr-Core-3.5.0/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 …]
Dzperf_tcp_receiver.c5 * SPDX-License-Identifier: Apache-2.0
52 static void tcp_received(const struct sockaddr *addr, size_t datalen) in tcp_received() argument
59 session = get_session(addr, SESSION_TCP); in tcp_received()
65 switch (session->state) { in tcp_received()
69 session->start_time = k_uptime_ticks(); in tcp_received()
70 session->state = STATE_ONGOING; in tcp_received()
79 session->counter++; in tcp_received()
80 session->length += datalen; in tcp_received()
85 session->state = STATE_COMPLETED; in tcp_received()
87 results.total_len = session->length; in tcp_received()
[all …]
Dzperf_shell.c4 * SPDX-License-Identifier: Apache-2.0
130 struct sockaddr_in6 *addr) in parse_ipv6_addr() argument
135 return -EINVAL; in parse_ipv6_addr()
138 ret = net_addr_pton(AF_INET6, host, &addr->sin6_addr); in parse_ipv6_addr()
142 return -EINVAL; in parse_ipv6_addr()
145 addr->sin6_port = htons(strtoul(port, NULL, 10)); in parse_ipv6_addr()
146 if (!addr->sin6_port) { in parse_ipv6_addr()
149 return -EINVAL; in parse_ipv6_addr()
156 struct sockaddr_in *addr) in parse_ipv4_addr() argument
161 return -EINVAL; in parse_ipv4_addr()
[all …]
/Zephyr-Core-3.5.0/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-Core-3.5.0/samples/net/telnet/src/
Dtelnet.c4 * SPDX-License-Identifier: Apache-2.0
36 &iface->config.ip.ipv4->unicast[i]; in ipv4_addr_add_handler()
38 if (if_addr->addr_type != NET_ADDR_DHCP || !if_addr->is_used) { in ipv4_addr_add_handler()
44 &if_addr->address.in_addr, in ipv4_addr_add_handler()
47 iface->config.dhcpv4.lease_time); in ipv4_addr_add_handler()
50 &iface->config.ip.ipv4->netmask, in ipv4_addr_add_handler()
54 &iface->config.ip.ipv4->gw, in ipv4_addr_add_handler()
84 struct in_addr addr; in setup_ipv4() local
86 if (net_addr_pton(AF_INET, CONFIG_NET_CONFIG_MY_IPV4_ADDR, &addr)) { in setup_ipv4()
91 net_if_ipv4_addr_add(iface, &addr, NET_ADDR_MANUAL, 0); in setup_ipv4()
[all …]
/Zephyr-Core-3.5.0/subsys/net/lib/capture/
Dcapture.c4 * SPDX-License-Identifier: Apache-2.0
73 * Peer (inner) tunnel IP address.
78 * Local (inner) tunnel IP address. This will be set
120 if (!ctx->in_use) { in net_capture_foreach()
124 info.capture_dev = ctx->dev; in net_capture_foreach()
125 info.capture_iface = ctx->capture_iface; in net_capture_foreach()
126 info.tunnel_iface = ctx->tunnel_iface; in net_capture_foreach()
127 info.peer = &ctx->peer; in net_capture_foreach()
128 info.local = &ctx->local; in net_capture_foreach()
129 info.is_enabled = ctx->is_enabled; in net_capture_foreach()
[all …]
/Zephyr-Core-3.5.0/include/zephyr/logging/
Dlog_backend_net.h4 * SPDX-License-Identifier: Apache-2.0
17 * @brief Allows user to set a server IP address at runtime
24 * @param addr String that contains the IP address.
28 bool log_backend_net_set_addr(const char *addr);
/Zephyr-Core-3.5.0/subsys/net/l2/ethernet/
Darp.c8 * SPDX-License-Identifier: Apache-2.0
44 while (!k_fifo_is_empty(&entry->pending_queue)) { in arp_entry_cleanup()
45 pkt = k_fifo_get(&entry->pending_queue, K_FOREVER); in arp_entry_cleanup()
48 atomic_get(&pkt->atomic_ref) - 1); in arp_entry_cleanup()
53 entry->iface = NULL; in arp_entry_cleanup()
55 (void)memset(&entry->ip, 0, sizeof(struct in_addr)); in arp_entry_cleanup()
56 (void)memset(&entry->eth, 0, sizeof(struct net_eth_addr)); in arp_entry_cleanup()
68 iface, net_sprint_ipv4_addr(&entry->ip)); in arp_entry_find()
70 if (entry->iface == iface && in arp_entry_find()
71 net_ipv4_addr_cmp(&entry->ip, dst)) { in arp_entry_find()
[all …]
/Zephyr-Core-3.5.0/include/zephyr/net/
Dnet_if.h4 * SPDX-License-Identifier: Apache-2.0
48 * @brief Network Interface unicast IP addresses
50 * Stores the unicast IP addresses assigned to this network interface.
53 /** IP address */
65 /** How the IP address was set */
76 /** Is the IP address valid forever */
79 /** Is this IP address used or not */
82 /** Is this IP address usage limited to the subnet (mesh) or not */
89 * @brief Network Interface multicast IP addresses
91 * Stores the multicast IP addresses assigned to this network interface.
[all …]
Dnet_ip.h10 * SPDX-License-Identifier: Apache-2.0
43 #define PF_INET 1 /**< IP protocol family version 4. */
44 #define PF_INET6 2 /**< IP protocol family version 6. */
48 #define PF_LOCAL 6 /**< Inter-process communication */
49 #define PF_UNIX PF_LOCAL /**< Inter-process communication */
53 #define AF_INET PF_INET /**< IP protocol family version 4. */
54 #define AF_INET6 PF_INET6 /**< IP protocol family version 6. */
58 #define AF_LOCAL PF_LOCAL /**< Inter-process communication */
59 #define AF_UNIX PF_UNIX /**< Inter-process communication */
63 IPPROTO_IP = 0, /**< IP protocol (pseudo-val for setsockopt() */
[all …]
Dnet_offload.h4 * SPDX-License-Identifier: Apache-2.0
9 * @brief Public API for offloading IP stack
39 return -1; in timeout_to_int32()
60 * This function is called when user wants to bind to local IP address.
63 const struct sockaddr *addr,
77 const struct sockaddr *addr,
126 * @brief Get a network socket/context from the offloaded IP stack.
129 * 5-tuple (protocol, remote address, remote port, source
133 * @param iface Network interface where the offloaded IP stack can be
135 * @param family IP address family (AF_INET or AF_INET6)
[all …]
Dsntp.h5 * SPDX-License-Identifier: Apache-2.0
49 * @param addr IP address of NTP/SNTP server.
50 * @param addr_len IP address length of NTP/SNTP server.
54 int sntp_init(struct sntp_ctx *ctx, struct sockaddr *addr,
65 * @return 0 if ok, <0 if error (-ETIMEDOUT if timeout).
78 * @brief Convenience function to query SNTP in one-shot fashion
83 * @param server Address of server in format addr[:port]
88 * @return 0 if ok, <0 if error (-ETIMEDOUT if timeout).
/Zephyr-Core-3.5.0/subsys/net/ip/
Dnet_if.c5 * SPDX-License-Identifier: Apache-2.0
39 * so that integer-based math works better
131 NET_ASSERT(pkt->frags); \
143 if (&_net_if_list_start[index - 1] >= _net_if_list_end) { in z_impl_net_if_get_by_index()
148 return &_net_if_list_start[index - 1]; in z_impl_net_if_get_by_index()
178 if (context->send_cb) { in net_context_send_cb()
179 context->send_cb(context, status, context->user_data); in net_context_send_cb()
202 val = net_pkt_stats_tick(pkt)[i] - prev; in update_txtime_stats_detail()
211 .addr = NULL in net_if_tx()
235 net_pkt_lladdr_dst(pkt)->addr, in net_if_tx()
[all …]
/Zephyr-Core-3.5.0/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);
Dmodem_context.c11 * SPDX-License-Identifier: Apache-2.0
23 int modem_context_sprint_ip_addr(const struct sockaddr *addr, char *buf, size_t buf_size) in modem_context_sprint_ip_addr() argument
27 if (addr->sa_family == AF_INET6) { in modem_context_sprint_ip_addr()
29 return -ENOMEM; in modem_context_sprint_ip_addr()
32 if (net_addr_ntop(AF_INET6, &net_sin6(addr)->sin6_addr, in modem_context_sprint_ip_addr()
34 return -ENOMEM; in modem_context_sprint_ip_addr()
39 if (addr->sa_family == AF_INET) { in modem_context_sprint_ip_addr()
41 return -ENOMEM; in modem_context_sprint_ip_addr()
43 if (net_addr_ntop(AF_INET, &net_sin(addr)->sin_addr, in modem_context_sprint_ip_addr()
45 return -ENOMEM; in modem_context_sprint_ip_addr()
[all …]
/Zephyr-Core-3.5.0/tests/net/socket/reuseaddr_reuseport/src/
Dmain.c4 * SPDX-License-Identifier: Apache-2.0
35 static void test_add_local_ip_address(sa_family_t family, const char *ip) in test_add_local_ip_address() argument
38 struct sockaddr_in addr; in test_add_local_ip_address() local
40 zsock_inet_pton(AF_INET, ip, &addr.sin_addr); in test_add_local_ip_address()
43 &addr.sin_addr, in test_add_local_ip_address()
46 "Cannot add IPv4 address %s", ip); in test_add_local_ip_address()
48 struct sockaddr_in6 addr; in test_add_local_ip_address() local
50 zsock_inet_pton(AF_INET6, ip, &addr.sin6_addr); in test_add_local_ip_address()
53 &addr.sin6_addr, in test_add_local_ip_address()
56 "Cannot add IPv6 address %s", ip); in test_add_local_ip_address()
[all …]
/Zephyr-Core-3.5.0/doc/connectivity/networking/
Dnetwork_monitoring.rst16 See also the :zephyr:code-sample:`net-capture` sample application from the Zephyr
25 On the Linux Host, fetch the Zephyr ``net-tools`` project, which is located
28 .. code-block:: console
30 git clone https://github.com/zephyrproject-rtos/net-tools
32 The ``net-tools`` project provides a configure file to setup IP-to-IP tunnel
37 .. code-block:: console
39 ./net-setup.sh -c zeth-tunnel.conf
43 .. csv-table::
47 "``zeth-ip6ip``", "IPv6-over-IPv4 tunnel"
48 "``zeth-ipip``", "IPv4-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-Core-3.5.0/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-Core-3.5.0/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-Core-3.5.0/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-Core-3.5.0/samples/net/dns_resolve/src/
Dmain.c4 * SPDX-License-Identifier: Apache-2.0
39 void *addr; in dns_result_cb() local
65 if (info->ai_family == AF_INET) { in dns_result_cb()
67 addr = &net_sin(&info->ai_addr)->sin_addr; in dns_result_cb()
68 } else if (info->ai_family == AF_INET6) { in dns_result_cb()
70 addr = &net_sin6(&info->ai_addr)->sin6_addr; in dns_result_cb()
72 LOG_ERR("Invalid IP address family %d", info->ai_family); in dns_result_cb()
78 net_addr_ntop(info->ai_family, addr, in dns_result_cb()
88 void *addr; in mdns_result_cb() local
114 if (info->ai_family == AF_INET) { in mdns_result_cb()
[all …]
/Zephyr-Core-3.5.0/subsys/net/lib/config/
Dinit.c6 * SPDX-License-Identifier: Apache-2.0
73 &iface->config.ip.ipv4->unicast[i]; in ipv4_addr_add_handler()
75 if (if_addr->addr_type != NET_ADDR_DHCP || !if_addr->is_used) { in ipv4_addr_add_handler()
82 &if_addr->address.in_addr, in ipv4_addr_add_handler()
85 iface->config.dhcpv4.lease_time); in ipv4_addr_add_handler()
88 &iface->config.ip.ipv4->netmask, in ipv4_addr_add_handler()
92 &iface->config.ip.ipv4->gw, in ipv4_addr_add_handler()
144 struct in_addr addr; in setup_ipv4() local
151 if (net_addr_pton(AF_INET, CONFIG_NET_CONFIG_MY_IPV4_ADDR, &addr)) { in setup_ipv4()
159 * of "there should be a static IP address for DHCP-less setups", in setup_ipv4()
[all …]

12345