Lines Matching refs:mgmt
56 struct net_mgmt_socket *mgmt = NULL; in znet_mgmt_socket() local
64 mgmt = &mgmt_sockets[i]; in znet_mgmt_socket()
67 if (mgmt == NULL) { in znet_mgmt_socket()
78 mgmt->is_in_use = true; in znet_mgmt_socket()
79 mgmt->proto = proto; in znet_mgmt_socket()
80 mgmt->alloc_timeout = MSG_ALLOC_TIMEOUT; in znet_mgmt_socket()
81 mgmt->wait_timeout = K_FOREVER; in znet_mgmt_socket()
83 zvfs_finalize_typed_fd(fd, mgmt, (const struct fd_op_vtable *)&net_mgmt_sock_fd_op_vtable, in znet_mgmt_socket()
89 static int znet_mgmt_bind(struct net_mgmt_socket *mgmt, in znet_mgmt_bind() argument
100 mgmt->iface = net_if_get_by_index(nm_addr->nm_ifindex); in znet_mgmt_bind()
101 if (!mgmt->iface) { in znet_mgmt_bind()
106 mgmt->iface = NULL; in znet_mgmt_bind()
109 mgmt->pid = nm_addr->nm_pid; in znet_mgmt_bind()
111 if (mgmt->proto == NET_MGMT_EVENT_PROTO) { in znet_mgmt_bind()
112 mgmt->mask = nm_addr->nm_mask; in znet_mgmt_bind()
114 if (mgmt->iface) { in znet_mgmt_bind()
115 mgmt->mask |= NET_MGMT_IFACE_BIT; in znet_mgmt_bind()
122 ssize_t znet_mgmt_sendto(struct net_mgmt_socket *mgmt, in znet_mgmt_sendto() argument
127 if (mgmt->proto == NET_MGMT_EVENT_PROTO) { in znet_mgmt_sendto()
141 static ssize_t znet_mgmt_recvfrom(struct net_mgmt_socket *mgmt, void *buf, in znet_mgmt_recvfrom() argument
147 k_timeout_t timeout = mgmt->wait_timeout; in znet_mgmt_recvfrom()
161 if (mgmt->iface == NULL) { in znet_mgmt_recvfrom()
162 ret = net_mgmt_event_wait(mgmt->mask, &raised_event, in znet_mgmt_recvfrom()
166 ret = net_mgmt_event_wait_on_iface(mgmt->iface, in znet_mgmt_recvfrom()
167 mgmt->mask, in znet_mgmt_recvfrom()
172 iface = mgmt->iface; in znet_mgmt_recvfrom()
185 if ((mgmt->mask & raised_event) != raised_event) { in znet_mgmt_recvfrom()
201 nm_addr->nm_pid = mgmt->pid; in znet_mgmt_recvfrom()
226 static int znet_mgmt_getsockopt(struct net_mgmt_socket *mgmt, int level, in znet_mgmt_getsockopt() argument
234 if (mgmt->iface == NULL) { in znet_mgmt_getsockopt()
244 mgmt->iface, (void *)optval, *optlen); in znet_mgmt_getsockopt()
262 static int znet_mgmt_setsockopt(struct net_mgmt_socket *mgmt, int level, in znet_mgmt_setsockopt() argument
271 if (mgmt->iface == NULL) { in znet_mgmt_setsockopt()
281 mgmt->iface, (void *)optval, optlen); in znet_mgmt_setsockopt()