Lines Matching refs:context
99 typedef void (*net_context_recv_cb_t)(struct net_context *context,
120 typedef void (*net_context_send_cb_t)(struct net_context *context,
167 typedef void (*net_context_connect_cb_t)(struct net_context *context,
436 static inline bool net_context_is_used(struct net_context *context) in net_context_is_used() argument
438 NET_ASSERT(context); in net_context_is_used()
440 return context->flags & NET_CONTEXT_IN_USE; in net_context_is_used()
450 static inline bool net_context_is_bound_to_iface(struct net_context *context) in net_context_is_bound_to_iface() argument
452 NET_ASSERT(context); in net_context_is_bound_to_iface()
454 return context->flags & NET_CONTEXT_BOUND_TO_IFACE; in net_context_is_bound_to_iface()
464 static inline bool net_context_is_accepting(struct net_context *context) in net_context_is_accepting() argument
466 NET_ASSERT(context); in net_context_is_accepting()
468 return context->flags & NET_CONTEXT_ACCEPTING_SOCK; in net_context_is_accepting()
477 static inline void net_context_set_accepting(struct net_context *context, in net_context_set_accepting() argument
480 NET_ASSERT(context); in net_context_set_accepting()
483 context->flags |= NET_CONTEXT_ACCEPTING_SOCK; in net_context_set_accepting()
485 context->flags &= (uint16_t)~NET_CONTEXT_ACCEPTING_SOCK; in net_context_set_accepting()
496 static inline bool net_context_is_closing(struct net_context *context) in net_context_is_closing() argument
498 NET_ASSERT(context); in net_context_is_closing()
500 return context->flags & NET_CONTEXT_CLOSING_SOCK; in net_context_is_closing()
509 static inline void net_context_set_closing(struct net_context *context, in net_context_set_closing() argument
512 NET_ASSERT(context); in net_context_set_closing()
515 context->flags |= NET_CONTEXT_CLOSING_SOCK; in net_context_set_closing()
517 context->flags &= (uint16_t)~NET_CONTEXT_CLOSING_SOCK; in net_context_set_closing()
538 enum net_context_state net_context_get_state(struct net_context *context) in net_context_get_state() argument
540 NET_ASSERT(context); in net_context_get_state()
543 ((context->flags >> NET_CONTEXT_STATE_SHIFT) & in net_context_get_state()
555 static inline void net_context_set_state(struct net_context *context, in net_context_set_state() argument
558 NET_ASSERT(context); in net_context_set_state()
560 context->flags &= ~(NET_CONTEXT_STATE_MASK << NET_CONTEXT_STATE_SHIFT); in net_context_set_state()
561 context->flags |= ((state & NET_CONTEXT_STATE_MASK) << in net_context_set_state()
575 static inline sa_family_t net_context_get_family(struct net_context *context) in net_context_get_family() argument
577 NET_ASSERT(context); in net_context_get_family()
579 return ((context->flags & NET_CONTEXT_FAMILY) >> 3); in net_context_get_family()
591 static inline void net_context_set_family(struct net_context *context, in net_context_set_family() argument
596 NET_ASSERT(context); in net_context_set_family()
604 context->flags |= flag; in net_context_set_family()
618 enum net_sock_type net_context_get_type(struct net_context *context) in net_context_get_type() argument
620 NET_ASSERT(context); in net_context_get_type()
622 return (enum net_sock_type)((context->flags & NET_CONTEXT_TYPE) >> 6); in net_context_get_type()
634 static inline void net_context_set_type(struct net_context *context, in net_context_set_type() argument
639 NET_ASSERT(context); in net_context_set_type()
646 context->flags |= flag; in net_context_set_type()
658 static inline void net_context_set_can_filter_id(struct net_context *context, in net_context_set_can_filter_id() argument
661 NET_ASSERT(context); in net_context_set_can_filter_id()
663 context->can_filter_id = filter_id; in net_context_set_can_filter_id()
666 static inline void net_context_set_can_filter_id(struct net_context *context, in net_context_set_can_filter_id() argument
669 ARG_UNUSED(context); in net_context_set_can_filter_id()
684 static inline int net_context_get_can_filter_id(struct net_context *context) in net_context_get_can_filter_id() argument
686 NET_ASSERT(context); in net_context_get_can_filter_id()
688 return context->can_filter_id; in net_context_get_can_filter_id()
691 static inline int net_context_get_can_filter_id(struct net_context *context) in net_context_get_can_filter_id() argument
693 ARG_UNUSED(context); in net_context_get_can_filter_id()
709 static inline uint16_t net_context_get_proto(struct net_context *context) in net_context_get_proto() argument
711 return context->proto; in net_context_get_proto()
724 static inline void net_context_set_proto(struct net_context *context, in net_context_set_proto() argument
727 context->proto = proto; in net_context_set_proto()
741 struct net_if *net_context_get_iface(struct net_context *context) in net_context_get_iface() argument
743 NET_ASSERT(context); in net_context_get_iface()
745 return net_if_get_by_index(context->iface); in net_context_get_iface()
756 static inline void net_context_set_iface(struct net_context *context, in net_context_set_iface() argument
761 context->iface = (uint8_t)net_if_get_by_iface(iface); in net_context_set_iface()
772 static inline void net_context_bind_iface(struct net_context *context, in net_context_bind_iface() argument
777 context->flags |= NET_CONTEXT_BOUND_TO_IFACE; in net_context_bind_iface()
778 net_context_set_iface(context, iface); in net_context_bind_iface()
791 static inline uint8_t net_context_get_ipv4_ttl(struct net_context *context) in net_context_get_ipv4_ttl() argument
793 return context->ipv4_ttl; in net_context_get_ipv4_ttl()
805 static inline void net_context_set_ipv4_ttl(struct net_context *context, in net_context_set_ipv4_ttl() argument
808 context->ipv4_ttl = ttl; in net_context_set_ipv4_ttl()
821 static inline uint8_t net_context_get_ipv4_mcast_ttl(struct net_context *context) in net_context_get_ipv4_mcast_ttl() argument
823 return context->ipv4_mcast_ttl; in net_context_get_ipv4_mcast_ttl()
835 static inline void net_context_set_ipv4_mcast_ttl(struct net_context *context, in net_context_set_ipv4_mcast_ttl() argument
838 context->ipv4_mcast_ttl = ttl; in net_context_set_ipv4_mcast_ttl()
851 static inline uint8_t net_context_get_ipv6_hop_limit(struct net_context *context) in net_context_get_ipv6_hop_limit() argument
853 return context->ipv6_hop_limit; in net_context_get_ipv6_hop_limit()
864 static inline void net_context_set_ipv6_hop_limit(struct net_context *context, in net_context_set_ipv6_hop_limit() argument
867 context->ipv6_hop_limit = hop_limit; in net_context_set_ipv6_hop_limit()
880 static inline uint8_t net_context_get_ipv6_mcast_hop_limit(struct net_context *context) in net_context_get_ipv6_mcast_hop_limit() argument
882 return context->ipv6_mcast_hop_limit; in net_context_get_ipv6_mcast_hop_limit()
894 static inline void net_context_set_ipv6_mcast_hop_limit(struct net_context *context, in net_context_set_ipv6_mcast_hop_limit() argument
897 context->ipv6_mcast_hop_limit = hop_limit; in net_context_set_ipv6_mcast_hop_limit()
910 static inline void net_context_set_proxy_enabled(struct net_context *context, in net_context_set_proxy_enabled() argument
913 context->proxy_enabled = enable; in net_context_set_proxy_enabled()
916 static inline void net_context_set_proxy_enabled(struct net_context *context, in net_context_set_proxy_enabled() argument
919 ARG_UNUSED(context); in net_context_set_proxy_enabled()
935 static inline bool net_context_is_proxy_enabled(struct net_context *context) in net_context_is_proxy_enabled() argument
937 return context->proxy_enabled; in net_context_is_proxy_enabled()
940 static inline bool net_context_is_proxy_enabled(struct net_context *context) in net_context_is_proxy_enabled() argument
942 ARG_UNUSED(context); in net_context_is_proxy_enabled()
967 struct net_context **context);
982 int net_context_put(struct net_context *context);
996 int net_context_ref(struct net_context *context);
1011 int net_context_unref(struct net_context *context);
1024 int net_context_create_ipv4_new(struct net_context *context,
1029 static inline int net_context_create_ipv4_new(struct net_context *context, in net_context_create_ipv4_new() argument
1049 int net_context_create_ipv6_new(struct net_context *context,
1054 static inline int net_context_create_ipv6_new(struct net_context *context, in net_context_create_ipv6_new() argument
1059 ARG_UNUSED(context); in net_context_create_ipv6_new()
1078 int net_context_bind(struct net_context *context,
1092 int net_context_listen(struct net_context *context,
1123 int net_context_connect(struct net_context *context,
1155 int net_context_accept(struct net_context *context,
1179 int net_context_send(struct net_context *context,
1207 int net_context_sendto(struct net_context *context,
1234 int net_context_sendmsg(struct net_context *context,
1277 int net_context_recv(struct net_context *context,
1302 int net_context_update_recv_wnd(struct net_context *context,
1340 int net_context_set_option(struct net_context *context,
1354 int net_context_get_option(struct net_context *context,
1365 typedef void (*net_context_cb_t)(struct net_context *context, void *user_data);
1397 static inline void net_context_setup_pools(struct net_context *context, in net_context_setup_pools() argument
1401 NET_ASSERT(context); in net_context_setup_pools()
1403 context->tx_slab = tx_slab; in net_context_setup_pools()
1404 context->data_pool = data_pool; in net_context_setup_pools()
1407 #define net_context_setup_pools(context, tx_pool, data_pool) argument