• Home
  • Raw
  • Download

Lines Matching refs:skb

81 static void dn_log_martian(struct sk_buff *skb, const char *msg)  in dn_log_martian()  argument
84 char *devname = skb->dev ? skb->dev->name : "???"; in dn_log_martian()
85 struct dn_skb_cb *cb = DN_SKB_CB(skb); in dn_log_martian()
100 static void dn_ack(struct sock *sk, struct sk_buff *skb, unsigned short ack) in dn_ack() argument
110 wakeup |= dn_nsp_check_xmit_queue(sk, skb, in dn_ack()
120 wakeup |= dn_nsp_check_xmit_queue(sk, skb, in dn_ack()
136 static int dn_process_ack(struct sock *sk, struct sk_buff *skb, int oth) in dn_process_ack() argument
138 __le16 *ptr = (__le16 *)skb->data; in dn_process_ack()
142 if (skb->len < 2) in dn_process_ack()
146 skb_pull(skb, 2); in dn_process_ack()
152 dn_ack(sk, skb, ack); in dn_process_ack()
156 if (skb->len < 2) in dn_process_ack()
160 skb_pull(skb, 2); in dn_process_ack()
165 dn_ack(sk, skb, ack); in dn_process_ack()
225 static struct sock *dn_find_listener(struct sk_buff *skb, unsigned short *reason) in dn_find_listener() argument
227 struct dn_skb_cb *cb = DN_SKB_CB(skb); in dn_find_listener()
228 struct nsp_conn_init_msg *msg = (struct nsp_conn_init_msg *)skb->data; in dn_find_listener()
251 if (!pskb_may_pull(skb, sizeof(*msg))) in dn_find_listener()
254 skb_pull(skb, sizeof(*msg)); in dn_find_listener()
256 len = skb->len; in dn_find_listener()
257 ptr = skb->data; in dn_find_listener()
326 dn_log_martian(skb, ci_err_table[err].text); in dn_find_listener()
332 static void dn_nsp_conn_init(struct sock *sk, struct sk_buff *skb) in dn_nsp_conn_init() argument
335 kfree_skb(skb); in dn_nsp_conn_init()
340 skb_queue_tail(&sk->sk_receive_queue, skb); in dn_nsp_conn_init()
344 static void dn_nsp_conn_conf(struct sock *sk, struct sk_buff *skb) in dn_nsp_conn_conf() argument
346 struct dn_skb_cb *cb = DN_SKB_CB(skb); in dn_nsp_conn_conf()
350 if (skb->len < 4) in dn_nsp_conn_conf()
353 ptr = skb->data; in dn_nsp_conn_conf()
370 if (skb->len > 0) { in dn_nsp_conn_conf()
371 u16 dlen = *skb->data; in dn_nsp_conn_conf()
372 if ((dlen <= 16) && (dlen <= skb->len)) { in dn_nsp_conn_conf()
374 skb_copy_from_linear_data_offset(skb, 1, in dn_nsp_conn_conf()
384 kfree_skb(skb); in dn_nsp_conn_conf()
387 static void dn_nsp_conn_ack(struct sock *sk, struct sk_buff *skb) in dn_nsp_conn_ack() argument
396 kfree_skb(skb); in dn_nsp_conn_ack()
399 static void dn_nsp_disc_init(struct sock *sk, struct sk_buff *skb) in dn_nsp_disc_init() argument
402 struct dn_skb_cb *cb = DN_SKB_CB(skb); in dn_nsp_disc_init()
405 if (skb->len < 2) in dn_nsp_disc_init()
408 reason = le16_to_cpu(*(__le16 *)skb->data); in dn_nsp_disc_init()
409 skb_pull(skb, 2); in dn_nsp_disc_init()
415 if (skb->len > 0) { in dn_nsp_disc_init()
416 u16 dlen = *skb->data; in dn_nsp_disc_init()
417 if ((dlen <= 16) && (dlen <= skb->len)) { in dn_nsp_disc_init()
419 skb_copy_from_linear_data_offset(skb, 1, scp->discdata_in.opt_data, dlen); in dn_nsp_disc_init()
460 kfree_skb(skb); in dn_nsp_disc_init()
467 static void dn_nsp_disc_conf(struct sock *sk, struct sk_buff *skb) in dn_nsp_disc_conf() argument
472 if (skb->len != 2) in dn_nsp_disc_conf()
475 reason = le16_to_cpu(*(__le16 *)skb->data); in dn_nsp_disc_conf()
508 kfree_skb(skb); in dn_nsp_disc_conf()
511 static void dn_nsp_linkservice(struct sock *sk, struct sk_buff *skb) in dn_nsp_linkservice() argument
518 char *ptr = skb->data; in dn_nsp_linkservice()
521 if (skb->len != 4) in dn_nsp_linkservice()
577 kfree_skb(skb); in dn_nsp_linkservice()
585 static __inline__ int dn_queue_skb(struct sock *sk, struct sk_buff *skb, int sig, struct sk_buff_he… in dn_queue_skb() argument
592 if (atomic_read(&sk->sk_rmem_alloc) + skb->truesize >= in dn_queue_skb()
598 err = sk_filter(sk, skb); in dn_queue_skb()
602 skb_set_owner_r(skb, sk); in dn_queue_skb()
603 skb_queue_tail(queue, skb); in dn_queue_skb()
611 static void dn_nsp_otherdata(struct sock *sk, struct sk_buff *skb) in dn_nsp_otherdata() argument
615 struct dn_skb_cb *cb = DN_SKB_CB(skb); in dn_nsp_otherdata()
618 if (skb->len < 2) in dn_nsp_otherdata()
621 cb->segnum = segnum = le16_to_cpu(*(__le16 *)skb->data); in dn_nsp_otherdata()
622 skb_pull(skb, 2); in dn_nsp_otherdata()
626 if (dn_queue_skb(sk, skb, SIGURG, &scp->other_receive_queue) == 0) { in dn_nsp_otherdata()
636 kfree_skb(skb); in dn_nsp_otherdata()
639 static void dn_nsp_data(struct sock *sk, struct sk_buff *skb) in dn_nsp_data() argument
643 struct dn_skb_cb *cb = DN_SKB_CB(skb); in dn_nsp_data()
646 if (skb->len < 2) in dn_nsp_data()
649 cb->segnum = segnum = le16_to_cpu(*(__le16 *)skb->data); in dn_nsp_data()
650 skb_pull(skb, 2); in dn_nsp_data()
653 if (dn_queue_skb(sk, skb, SIGIO, &sk->sk_receive_queue) == 0) { in dn_nsp_data()
667 kfree_skb(skb); in dn_nsp_data()
675 static void dn_returned_conn_init(struct sock *sk, struct sk_buff *skb) in dn_returned_conn_init() argument
686 kfree_skb(skb); in dn_returned_conn_init()
689 static int dn_nsp_no_socket(struct sk_buff *skb, unsigned short reason) in dn_nsp_no_socket() argument
691 struct dn_skb_cb *cb = DN_SKB_CB(skb); in dn_nsp_no_socket()
702 dn_nsp_return_disc(skb, NSP_DISCINIT, reason); in dn_nsp_no_socket()
706 dn_nsp_return_disc(skb, NSP_DISCCONF, reason); in dn_nsp_no_socket()
713 kfree_skb(skb); in dn_nsp_no_socket()
717 static int dn_nsp_rx_packet(struct sk_buff *skb) in dn_nsp_rx_packet() argument
719 struct dn_skb_cb *cb = DN_SKB_CB(skb); in dn_nsp_rx_packet()
721 unsigned char *ptr = (unsigned char *)skb->data; in dn_nsp_rx_packet()
724 if (!pskb_may_pull(skb, 2)) in dn_nsp_rx_packet()
727 skb_reset_transport_header(skb); in dn_nsp_rx_packet()
749 sk = dn_find_listener(skb, &reason); in dn_nsp_rx_packet()
754 if (!pskb_may_pull(skb, 3)) in dn_nsp_rx_packet()
767 if (pskb_may_pull(skb, 5)) { in dn_nsp_rx_packet()
770 skb_pull(skb, 5); in dn_nsp_rx_packet()
789 sk = dn_find_by_skb(skb); in dn_nsp_rx_packet()
801 if (unlikely(skb_linearize(skb))) in dn_nsp_rx_packet()
805 return sk_receive_skb(sk, skb, 0); in dn_nsp_rx_packet()
808 return dn_nsp_no_socket(skb, reason); in dn_nsp_rx_packet()
811 kfree_skb(skb); in dn_nsp_rx_packet()
815 int dn_nsp_rx(struct sk_buff *skb) in dn_nsp_rx() argument
817 return NF_HOOK(NFPROTO_DECNET, NF_DN_LOCAL_IN, skb, skb->dev, NULL, in dn_nsp_rx()
826 int dn_nsp_backlog_rcv(struct sock *sk, struct sk_buff *skb) in dn_nsp_backlog_rcv() argument
829 struct dn_skb_cb *cb = DN_SKB_CB(skb); in dn_nsp_backlog_rcv()
833 dn_returned_conn_init(sk, skb); in dn_nsp_backlog_rcv()
835 kfree_skb(skb); in dn_nsp_backlog_rcv()
846 dn_nsp_conn_init(sk, skb); in dn_nsp_backlog_rcv()
849 dn_nsp_conn_conf(sk, skb); in dn_nsp_backlog_rcv()
852 dn_nsp_disc_init(sk, skb); in dn_nsp_backlog_rcv()
855 dn_nsp_disc_conf(sk, skb); in dn_nsp_backlog_rcv()
864 dn_nsp_conn_ack(sk, skb); in dn_nsp_backlog_rcv()
885 dn_process_ack(sk, skb, other); in dn_nsp_backlog_rcv()
899 dn_nsp_linkservice(sk, skb); in dn_nsp_backlog_rcv()
902 dn_nsp_otherdata(sk, skb); in dn_nsp_backlog_rcv()
905 dn_nsp_data(sk, skb); in dn_nsp_backlog_rcv()
910 kfree_skb(skb); in dn_nsp_backlog_rcv()