Lines Matching refs:local
85 struct sockaddr local; member
132 info.local = &ctx->local; in net_capture_foreach()
285 struct sockaddr local = { 0 }; in net_capture_setup() local
382 ret = setup_iface(ipip_iface, my_local_addr, &local, &local_addr_len); in net_capture_setup()
389 if (peer.sa_family != local.sa_family) { in net_capture_setup()
391 "(%d vs %d)", peer.sa_family, local.sa_family); in net_capture_setup()
412 memcpy(&ctx->local, &local, local_addr_len); in net_capture_setup()
418 if (net_sin(&ctx->local)->sin_port == 0) { in net_capture_setup()
419 net_sin(&ctx->local)->sin_port = htons(DEFAULT_PORT); in net_capture_setup()
458 (void)cleanup_iface(ctx->tunnel_iface, &ctx->local); in capture_cleanup()
622 if (IS_ENABLED(CONFIG_NET_IPV4) && ctx->local.sa_family == AF_INET) { in capture_send()
624 } else if (IS_ENABLED(CONFIG_NET_IPV6) && ctx->local.sa_family == AF_INET6) { in capture_send()
639 net_pkt_set_family(ip, ctx->local.sa_family); in capture_send()
648 if (IS_ENABLED(CONFIG_NET_IPV4) && ctx->local.sa_family == AF_INET) { in capture_send()
652 ret = net_ipv4_create(ip, &net_sin(&ctx->local)->sin_addr, in capture_send()
654 } else if (IS_ENABLED(CONFIG_NET_IPV6) && ctx->local.sa_family == AF_INET6) { in capture_send()
655 ret = net_ipv6_create(ip, &net_sin6(&ctx->local)->sin6_addr, in capture_send()
666 (void)net_udp_create(ip, net_sin(&ctx->local)->sin_port, in capture_send()
680 net_pkt_set_family(pkt, ctx->local.sa_family); in capture_send()
685 if (IS_ENABLED(CONFIG_NET_IPV4) && ctx->local.sa_family == AF_INET) { in capture_send()
690 } else if (IS_ENABLED(CONFIG_NET_IPV6) && ctx->local.sa_family == AF_INET6) { in capture_send()