/linux/net/llc/ |
H A D | llc_core.c | 35 struct llc_sap *sap = kzalloc(sizeof(*sap), GFP_ATOMIC); in llc_sap_alloc() local 38 if (sap) { in llc_sap_alloc() 40 sap->state = LLC_SAP_STATE_ACTIVE; in llc_sap_alloc() 41 spin_lock_init(&sap->sk_lock); in llc_sap_alloc() 43 INIT_HLIST_NULLS_HEAD(&sap->sk_laddr_hash[i], i); in llc_sap_alloc() 44 refcount_set(&sap->refcnt, 1); in llc_sap_alloc() 46 return sap; in llc_sap_alloc() 51 struct llc_sap *sap; in __llc_sap_find() local 53 list_for_each_entry(sap, &llc_sap_list, node) in __llc_sap_find() 54 if (sap->laddr.lsap == sap_value) in __llc_sap_find() [all …]
|
H A D | llc_sap.c | 92 void llc_sap_rtn_pdu(struct llc_sap *sap, struct sk_buff *skb) in llc_sap_rtn_pdu() argument 117 static const struct llc_sap_state_trans *llc_find_sap_trans(struct llc_sap *sap, in llc_find_sap_trans() argument 123 struct llc_sap_state *curr_state = &llc_sap_state_table[sap->state - 1]; in llc_find_sap_trans() 129 if (!next_trans[i]->ev(sap, skb)) { in llc_find_sap_trans() 145 static int llc_exec_sap_trans_actions(struct llc_sap *sap, in llc_exec_sap_trans_actions() argument 153 if ((*next_action)(sap, skb)) in llc_exec_sap_trans_actions() 167 static int llc_sap_next_state(struct llc_sap *sap, struct sk_buff *skb) in llc_sap_next_state() argument 172 if (sap->state > LLC_NR_SAP_STATES) in llc_sap_next_state() 174 trans = llc_find_sap_trans(sap, skb); in llc_sap_next_state() 182 rc = llc_exec_sap_trans_actions(sap, trans, skb); in llc_sap_next_state() [all …]
|
H A D | llc_proc.c | 36 struct llc_sap *sap; in llc_get_sk_idx() local 40 list_for_each_entry_rcu(sap, &llc_sap_list, node) { in llc_get_sk_idx() 41 spin_lock_bh(&sap->sk_lock); in llc_get_sk_idx() 43 struct hlist_nulls_head *head = &sap->sk_laddr_hash[i]; in llc_get_sk_idx() 52 spin_unlock_bh(&sap->sk_lock); in llc_get_sk_idx() 67 static struct sock *laddr_hash_next(struct llc_sap *sap, int bucket) in laddr_hash_next() argument 73 sk_nulls_for_each(sk, node, &sap->sk_laddr_hash[bucket]) in laddr_hash_next() 84 struct llc_sap *sap; in llc_seq_next() local 98 sap = llc->sap; in llc_seq_next() 99 sk = laddr_hash_next(sap, llc_sk_laddr_hashfn(sap, &llc->laddr)); in llc_seq_next() [all …]
|
H A D | llc_c_ac.c | 205 struct llc_sap *sap = llc->sap; in llc_conn_ac_send_disc_cmd_p_set_x() local 207 llc_pdu_header_init(nskb, LLC_PDU_TYPE_U, sap->laddr.lsap, in llc_conn_ac_send_disc_cmd_p_set_x() 230 struct llc_sap *sap = llc->sap; in llc_conn_ac_send_dm_rsp_f_set_p() local 234 llc_pdu_header_init(nskb, LLC_PDU_TYPE_U, sap->laddr.lsap, in llc_conn_ac_send_dm_rsp_f_set_p() 256 struct llc_sap *sap = llc->sap; in llc_conn_ac_send_dm_rsp_f_set_1() local 258 llc_pdu_header_init(nskb, LLC_PDU_TYPE_U, sap->laddr.lsap, in llc_conn_ac_send_dm_rsp_f_set_1() 289 struct llc_sap *sap = llc->sap; in llc_conn_ac_send_frmr_rsp_f_set_x() local 291 llc_pdu_header_init(nskb, LLC_PDU_TYPE_U, sap->laddr.lsap, in llc_conn_ac_send_frmr_rsp_f_set_x() 315 struct llc_sap *sap = llc->sap; in llc_conn_ac_resend_frmr_rsp_f_set_0() local 318 llc_pdu_header_init(nskb, LLC_PDU_TYPE_U, sap->laddr.lsap, in llc_conn_ac_resend_frmr_rsp_f_set_0() [all …]
|
H A D | llc_s_ac.c | 37 int llc_sap_action_unitdata_ind(struct llc_sap *sap, struct sk_buff *skb) in llc_sap_action_unitdata_ind() argument 39 llc_sap_rtn_pdu(sap, skb); in llc_sap_action_unitdata_ind() 52 int llc_sap_action_send_ui(struct llc_sap *sap, struct sk_buff *skb) in llc_sap_action_send_ui() argument 77 int llc_sap_action_send_xid_c(struct llc_sap *sap, struct sk_buff *skb) in llc_sap_action_send_xid_c() argument 101 int llc_sap_action_send_xid_r(struct llc_sap *sap, struct sk_buff *skb) in llc_sap_action_send_xid_r() argument 114 llc_pdu_header_init(nskb, LLC_PDU_TYPE_U, sap->laddr.lsap, dsap, in llc_sap_action_send_xid_r() 133 int llc_sap_action_send_test_c(struct llc_sap *sap, struct sk_buff *skb) in llc_sap_action_send_test_c() argument 149 int llc_sap_action_send_test_r(struct llc_sap *sap, struct sk_buff *skb) in llc_sap_action_send_test_r() argument 168 llc_pdu_header_init(nskb, LLC_PDU_TYPE_U, sap->laddr.lsap, dsap, in llc_sap_action_send_test_r() 186 int llc_sap_action_report_status(struct llc_sap *sap, struct sk_buff *skb) in llc_sap_action_report_status() argument [all …]
|
H A D | llc_conn.c | 454 static inline bool llc_estab_match(const struct llc_sap *sap, in llc_estab_match() argument 481 static struct sock *__llc_lookup_established(struct llc_sap *sap, in __llc_lookup_established() argument 488 int slot = llc_sk_laddr_hashfn(sap, laddr); in __llc_lookup_established() 489 struct hlist_nulls_head *laddr_hb = &sap->sk_laddr_hash[slot]; in __llc_lookup_established() 494 if (llc_estab_match(sap, daddr, laddr, rc, net)) { in __llc_lookup_established() 498 if (unlikely(llc_sk(rc)->sap != sap || in __llc_lookup_established() 499 !llc_estab_match(sap, daddr, laddr, rc, net))) { in __llc_lookup_established() 519 struct sock *llc_lookup_established(struct llc_sap *sap, in llc_lookup_established() argument 527 sk = __llc_lookup_established(sap, daddr, laddr, net); in llc_lookup_established() 532 static inline bool llc_listener_match(const struct llc_sap *sap, in llc_listener_match() argument [all …]
|
H A D | llc_s_ev.c | 23 int llc_sap_ev_activation_req(struct llc_sap *sap, struct sk_buff *skb) in llc_sap_ev_activation_req() argument 31 int llc_sap_ev_rx_ui(struct llc_sap *sap, struct sk_buff *skb) in llc_sap_ev_rx_ui() argument 41 int llc_sap_ev_unitdata_req(struct llc_sap *sap, struct sk_buff *skb) in llc_sap_ev_unitdata_req() argument 51 int llc_sap_ev_xid_req(struct llc_sap *sap, struct sk_buff *skb) in llc_sap_ev_xid_req() argument 60 int llc_sap_ev_rx_xid_c(struct llc_sap *sap, struct sk_buff *skb) in llc_sap_ev_rx_xid_c() argument 70 int llc_sap_ev_rx_xid_r(struct llc_sap *sap, struct sk_buff *skb) in llc_sap_ev_rx_xid_r() argument 80 int llc_sap_ev_test_req(struct llc_sap *sap, struct sk_buff *skb) in llc_sap_ev_test_req() argument 89 int llc_sap_ev_rx_test_c(struct llc_sap *sap, struct sk_buff *skb) in llc_sap_ev_rx_test_c() argument 99 int llc_sap_ev_rx_test_r(struct llc_sap *sap, struct sk_buff *skb) in llc_sap_ev_rx_test_r() argument 109 int llc_sap_ev_deactivation_req(struct llc_sap *sap, struct sk_buff *skb) in llc_sap_ev_deactivation_req() argument
|
H A D | llc_input.c | 39 static void (*llc_type_handlers[2])(struct llc_sap *sap, 42 void llc_add_pack(int type, void (*handler)(struct llc_sap *sap, in llc_add_pack() argument 164 struct llc_sap *sap; in llc_rcv() local 170 void (*sap_handler)(struct llc_sap *sap, struct sk_buff *skb); in llc_rcv() 188 sap = llc_sap_find(pdu->dsap); in llc_rcv() 189 if (unlikely(!sap)) {/* unknown SAP */ in llc_rcv() 198 rcv = rcu_dereference(sap->rcv_func); in llc_rcv() 212 sap_handler(sap, skb); in llc_rcv() 214 llc_sap_put(sap); in llc_rcv()
|
H A D | af_llc.c | 63 static inline u16 llc_ui_next_link_no(int sap) in llc_ui_next_link_no() argument 65 return llc_ui_sap_link_no_max[sap]++; in llc_ui_next_link_no() 215 struct llc_sap *sap = llc->sap; in llc_ui_release() local 220 llc_sap_hold(sap); in llc_ui_release() 221 llc_sap_remove_socket(llc->sap, sk); in llc_ui_release() 223 llc_sap_put(sap); in llc_ui_release() 245 struct llc_sap *sap; in llc_ui_autoport() local 251 sap = llc_sap_find(i); in llc_ui_autoport() 252 if (!sap) { in llc_ui_autoport() 256 llc_sap_put(sap); in llc_ui_autoport() [all …]
|
/linux/net/sunrpc/ |
H A D | addr.c | 28 static size_t rpc_ntop6_noscopeid(const struct sockaddr *sap, in rpc_ntop6_noscopeid() argument 31 const struct sockaddr_in6 *sin6 = (struct sockaddr_in6 *)sap; in rpc_ntop6_noscopeid() 66 static size_t rpc_ntop6(const struct sockaddr *sap, in rpc_ntop6() argument 69 const struct sockaddr_in6 *sin6 = (struct sockaddr_in6 *)sap; in rpc_ntop6() 74 len = rpc_ntop6_noscopeid(sap, buf, buflen); in rpc_ntop6() 98 static size_t rpc_ntop6_noscopeid(const struct sockaddr *sap, in rpc_ntop6_noscopeid() argument 104 static size_t rpc_ntop6(const struct sockaddr *sap, in rpc_ntop6() argument 112 static int rpc_ntop4(const struct sockaddr *sap, in rpc_ntop4() argument 115 const struct sockaddr_in *sin = (struct sockaddr_in *)sap; in rpc_ntop4() 129 size_t rpc_ntop(const struct sockaddr *sap, char *buf, const size_t buflen) in rpc_ntop() argument [all …]
|
H A D | rpcb_clnt.c | 483 const struct sockaddr *sap, in rpcb_register_inet4() argument 486 const struct sockaddr_in *sin = (const struct sockaddr_in *)sap; in rpcb_register_inet4() 492 map->r_addr = rpc_sockaddr2uaddr(sap, GFP_KERNEL); in rpcb_register_inet4() 509 const struct sockaddr *sap, in rpcb_register_inet6() argument 512 const struct sockaddr_in6 *sin6 = (const struct sockaddr_in6 *)sap; in rpcb_register_inet6() 518 map->r_addr = rpc_sockaddr2uaddr(sap, GFP_KERNEL); in rpcb_register_inet6() 679 struct sockaddr *sap = (struct sockaddr *)&addr; in rpcb_getport_async() local 705 salen = rpc_peeraddr(clnt, sap, sizeof(addr)); in rpcb_getport_async() 708 switch (sap->sa_family) { in rpcb_getport_async() 731 xprt->servername, sap, salen, in rpcb_getport_async() [all …]
|
/linux/include/net/ |
H A D | llc.h | 73 struct hlist_head *llc_sk_dev_hash(struct llc_sap *sap, int ifindex) in llc_sk_dev_hash() argument 77 return &sap->sk_dev_hash[bucket]; in llc_sk_dev_hash() 81 u32 llc_sk_laddr_hashfn(struct llc_sap *sap, const struct llc_addr *laddr) in llc_sk_laddr_hashfn() argument 88 struct hlist_nulls_head *llc_sk_laddr_hash(struct llc_sap *sap, in llc_sk_laddr_hash() argument 91 return &sap->sk_laddr_hash[llc_sk_laddr_hashfn(sap, laddr)]; in llc_sk_laddr_hash() 107 void (*handler)(struct llc_sap *sap, struct sk_buff *skb)); 117 static inline void llc_sap_hold(struct llc_sap *sap) in llc_sap_hold() argument 119 refcount_inc(&sap->refcnt); in llc_sap_hold() 122 static inline bool llc_sap_hold_safe(struct llc_sap *sap) in llc_sap_hold_safe() argument 124 return refcount_inc_not_zero(&sap->refcnt); in llc_sap_hold_safe() [all …]
|
H A D | llc_s_ac.h | 30 typedef int (*llc_sap_action_t)(struct llc_sap *sap, struct sk_buff *skb); 32 int llc_sap_action_unitdata_ind(struct llc_sap *sap, struct sk_buff *skb); 33 int llc_sap_action_send_ui(struct llc_sap *sap, struct sk_buff *skb); 34 int llc_sap_action_send_xid_c(struct llc_sap *sap, struct sk_buff *skb); 35 int llc_sap_action_send_xid_r(struct llc_sap *sap, struct sk_buff *skb); 36 int llc_sap_action_send_test_c(struct llc_sap *sap, struct sk_buff *skb); 37 int llc_sap_action_send_test_r(struct llc_sap *sap, struct sk_buff *skb); 38 int llc_sap_action_report_status(struct llc_sap *sap, struct sk_buff *skb); 39 int llc_sap_action_xid_ind(struct llc_sap *sap, struct sk_buff *skb); 40 int llc_sap_action_test_ind(struct llc_sap *sap, struct sk_buff *skb);
|
H A D | llc_s_ev.h | 55 typedef int (*llc_sap_ev_t)(struct llc_sap *sap, struct sk_buff *skb); 57 int llc_sap_ev_activation_req(struct llc_sap *sap, struct sk_buff *skb); 58 int llc_sap_ev_rx_ui(struct llc_sap *sap, struct sk_buff *skb); 59 int llc_sap_ev_unitdata_req(struct llc_sap *sap, struct sk_buff *skb); 60 int llc_sap_ev_xid_req(struct llc_sap *sap, struct sk_buff *skb); 61 int llc_sap_ev_rx_xid_c(struct llc_sap *sap, struct sk_buff *skb); 62 int llc_sap_ev_rx_xid_r(struct llc_sap *sap, struct sk_buff *skb); 63 int llc_sap_ev_test_req(struct llc_sap *sap, struct sk_buff *skb); 64 int llc_sap_ev_rx_test_c(struct llc_sap *sap, struct sk_buff *skb); 65 int llc_sap_ev_rx_test_r(struct llc_sap *sap, struct sk_buff *skb); [all …]
|
H A D | llc_sap.h | 22 void llc_sap_rtn_pdu(struct llc_sap *sap, struct sk_buff *skb); 28 void llc_build_and_send_test_pkt(struct llc_sap *sap, struct sk_buff *skb, 30 void llc_build_and_send_xid_pkt(struct llc_sap *sap, struct sk_buff *skb,
|
H A D | llc_conn.h | 37 struct llc_sap *sap; /* pointer to parent SAP */ member 113 struct sock *llc_lookup_established(struct llc_sap *sap, struct llc_addr *daddr, 115 void llc_sap_add_socket(struct llc_sap *sap, struct sock *sk); 116 void llc_sap_remove_socket(struct llc_sap *sap, struct sock *sk);
|
/linux/include/linux/sunrpc/ |
H A D | addr.h | 23 static inline unsigned short rpc_get_port(const struct sockaddr *sap) in rpc_get_port() argument 25 switch (sap->sa_family) { in rpc_get_port() 27 return ntohs(((struct sockaddr_in *)sap)->sin_port); in rpc_get_port() 29 return ntohs(((struct sockaddr_in6 *)sap)->sin6_port); in rpc_get_port() 34 static inline void rpc_set_port(struct sockaddr *sap, in rpc_set_port() argument 37 switch (sap->sa_family) { in rpc_set_port() 39 ((struct sockaddr_in *)sap)->sin_port = htons(port); in rpc_set_port() 42 ((struct sockaddr_in6 *)sap)->sin6_port = htons(port); in rpc_set_port()
|
/linux/fs/lockd/ |
H A D | host.c | 55 const struct sockaddr *sap; /* address to search for */ member 75 static unsigned int __nlm_hash_addr4(const struct sockaddr *sap) in __nlm_hash_addr4() argument 77 const struct sockaddr_in *sin = (struct sockaddr_in *)sap; in __nlm_hash_addr4() 81 static unsigned int __nlm_hash_addr6(const struct sockaddr *sap) in __nlm_hash_addr6() argument 83 const struct sockaddr_in6 *sin6 = (struct sockaddr_in6 *)sap; in __nlm_hash_addr6() 91 static unsigned int nlm_hash_address(const struct sockaddr *sap) in nlm_hash_address() argument 95 switch (sap->sa_family) { in nlm_hash_address() 97 hash = __nlm_hash_addr4(sap); in nlm_hash_address() 100 hash = __nlm_hash_addr6(sap); in nlm_hash_address() 120 nsm = nsm_get_handle(ni->net, ni->sap, ni->salen, in nlm_alloc_host() [all …]
|
/linux/net/802/ |
H A D | p8022.c | 28 llc_build_and_send_ui_pkt(dl->sap, skb, dest, dl->sap->laddr.lsap); in p8022_request() 45 proto->sap = llc_sap_open(type, func); in register_8022_client() 46 if (!proto->sap) { in register_8022_client() 56 llc_sap_put(proto->sap); in unregister_8022_client()
|
H A D | stp.c | 25 static struct llc_sap *sap __read_mostly; 68 sap = llc_sap_open(LLC_SAP_BSPAN, stp_pdu_rcv); in stp_proto_register() 69 if (!sap) { in stp_proto_register() 96 llc_sap_put(sap); in stp_proto_unregister()
|
/linux/include/linux/lockd/ |
H A D | lockd.h | 231 struct nlm_host *nlmclnt_lookup_host(const struct sockaddr *sap, 259 const struct sockaddr *sap, 321 static inline int __nlm_privileged_request4(const struct sockaddr *sap) in __nlm_privileged_request4() argument 323 const struct sockaddr_in *sin = (struct sockaddr_in *)sap; in __nlm_privileged_request4() 332 static inline int __nlm_privileged_request6(const struct sockaddr *sap) in __nlm_privileged_request6() argument 334 const struct sockaddr_in6 *sin6 = (struct sockaddr_in6 *)sap; in __nlm_privileged_request6() 345 static inline int __nlm_privileged_request6(const struct sockaddr *sap) in __nlm_privileged_request6() argument 359 const struct sockaddr *sap = svc_addr(rqstp); in nlm_privileged_requester() local 361 switch (sap->sa_family) { in nlm_privileged_requester() 363 return __nlm_privileged_request4(sap); in nlm_privileged_requester() [all...] |
/linux/net/sunrpc/xprtrdma/ |
H A D | transport.c | 147 xprt_rdma_format_addresses4(struct rpc_xprt *xprt, struct sockaddr *sap) in xprt_rdma_format_addresses4() argument 149 struct sockaddr_in *sin = (struct sockaddr_in *)sap; in xprt_rdma_format_addresses4() 159 xprt_rdma_format_addresses6(struct rpc_xprt *xprt, struct sockaddr *sap) in xprt_rdma_format_addresses6() argument 161 struct sockaddr_in6 *sin6 = (struct sockaddr_in6 *)sap; in xprt_rdma_format_addresses6() 171 xprt_rdma_format_addresses(struct rpc_xprt *xprt, struct sockaddr *sap) in xprt_rdma_format_addresses() argument 175 switch (sap->sa_family) { in xprt_rdma_format_addresses() 177 xprt_rdma_format_addresses4(xprt, sap); in xprt_rdma_format_addresses() 180 xprt_rdma_format_addresses6(xprt, sap); in xprt_rdma_format_addresses() 187 (void)rpc_ntop(sap, buf, sizeof(buf)); in xprt_rdma_format_addresses() 190 snprintf(buf, sizeof(buf), "%u", rpc_get_port(sap)); in xprt_rdma_format_addresses() [all …]
|
H A D | svc_rdma_transport.c | 128 svc_rdma_create_listen_id(struct net *net, struct sockaddr *sap, in svc_rdma_create_listen_id() argument 147 ret = rdma_bind_addr(listen_id, sap); in svc_rdma_create_listen_id() 294 struct sockaddr *sap = (struct sockaddr *)&cma_id->route.addr.src_addr; in svc_rdma_listen_handler() local 305 sap, cma_xprt); in svc_rdma_listen_handler() 417 RPC_IFDEBUG(struct sockaddr *sap); in svc_rdma_accept() 559 sap = (struct sockaddr *)&newxprt->sc_cm_id->route.addr.src_addr; in svc_rdma_accept() 560 dprintk(" local address : %pIS:%u\n", sap, rpc_get_port(sap)); in svc_rdma_accept() 561 sap = (struct sockaddr *)&newxprt->sc_cm_id->route.addr.dst_addr; in svc_rdma_accept() 562 dprintk(" remote address : %pIS:%u\n", sap, rpc_get_port(sap)); in svc_rdma_accept()
|
/linux/net/bridge/netfilter/ |
H A D | ebt_arp.c | 40 const __be32 *sap, *dap; in ebt_arp_mt() local 45 sap = skb_header_pointer(skb, sizeof(struct arphdr) + in ebt_arp_mt() 48 if (sap == NULL) in ebt_arp_mt() 57 info->saddr != (*sap & info->smsk))) in ebt_arp_mt() 64 NF_INVF(info, EBT_ARP_GRAT, *dap != *sap)) in ebt_arp_mt()
|
/linux/fs/nfs/ |
H A D | nfs4namespace.c | 488 struct sockaddr_storage *sap; in nfs4_try_replacing_one_location() local 493 sap = kmalloc(sizeof(*sap), GFP_KERNEL); in nfs4_try_replacing_one_location() 494 if (sap == NULL) in nfs4_try_replacing_one_location() 509 sap, sizeof(*sap), net, 0); in nfs4_try_replacing_one_location() 512 rpc_set_port((struct sockaddr *)sap, NFS_PORT); in nfs4_try_replacing_one_location() 519 error = nfs4_update_server(server, hostname, sap, salen, net); in nfs4_try_replacing_one_location() 525 kfree(sap); in nfs4_try_replacing_one_location()
|