linux/net/llc/llc_station.c
<<
>2222 href="../linux+v3.7.5/net/llc/llc_sta v.c"> >22>> > >22 "> >22 >22Search22 onclick="return ajax_prefs();"> >22Prefs. 22 22 222 2 "> >22 222 2
2222 22 2
22 2.
2 21/*2 22 * llc_sta v.c - sta v component of LLC2 23 *2 24 * Copyright (c) 1997 by2Procom Technology, Inc.2 25 * 2001-2003 by2Arnaldo Car> ho de Melo <acme@conectiva.com.br>2 26 *2 27 * This program cav be redistributed or modified under the terms of the2 28 * GNU General Public License as published by2the Free Software Founda v.2 29 * This program is distributed without any warranty or implied warranty2 " a> * of merchantability or fitness for a par cular purpose.2 11 *2 12 * See the GNU General Public License for more details.2 13 */2 14#include <linux/init.h>.2 15#include <linux/module.h>.2 16#include <linux/slab.h>.2 17#include <net/llc.h>.2 18#include <net/llc_sap.h>.2 19#include <net/llc_conn.h>.2 20#include <net/llc_c_ac.h>.2 21#include <net/llc_s_ac.h>.2 22#include <net/llc_c_ev.h>.2 23#include <net/llc_c_st.h>.2 24#include <net/llc_s_ev.h>.2 25#include <net/llc_s_st.h>.2 26#include <net/llc_pdu.h>.2 27.2 28sta c int llc_sta _ev_rx_null_dsap_xid_c(struct sk_buff *skb).2 29{.2 30 struct llc_pdu_un *pdu = llc_pdu_un_hdr(skb);.2 31.2 32 return LLC_PDU_IS_CMD(pdu) && /* command PDU */2 33 LLC_PDU_TYPE_IS_U(pdu) && /* U typ PDU */2 34 LLC_U_PDU_CMD(pdu) == LLC_1_PDU_CMD_XID &&.2 35 !pdu->dsap ? 0 : 1; /* NULL DSAP > */2 36}.2 37.2 38sta c int llc_sta _ev_rx_null_dsap_test_c(struct sk_buff *skb).2 39{.2 40 struct llc_pdu_un *pdu = llc_pdu_un_hdr(skb);.2 41.2 42 return LLC_PDU_IS_CMD(pdu) && /* command PDU */2 43 LLC_PDU_TYPE_IS_U(pdu) && /* U typ PDU */2 44 LLC_U_PDU_CMD(pdu) == LLC_1_PDU_CMD_TEST &&.2 45 !pdu->dsap ? 0 : 1; /* NULL DSAP */2 46}.2 47.2 48sta c int llc_sta v_ac_send_xid_r(struct sk_buff *skb).2 49{.2 50 u8 mac_da[ETH_ALEN], dsap;.2 51 int rc = 1;.2 52 struct sk_buff *nskb = llc_alloc_fram (NULL, skb->dev, LLC_PDU_TYPE_U,.2 53 sizeof(struct llc_xid_info));.2 54.2 55 if (!nskb).2 56 goto out;.2 57 rc = 0;.2 58 llc_pdu_decode_sa(skb, mac_da);.2 59 llc_pdu_decode_ssap(skb, &dsap);.2 60 llc_pdu_header_init(nskb, LLC_PDU_TYPE_U, 0, dsap, LLC_PDU_RSP);.2 61 llc_pdu_init_as_xid_rsp(nskb, LLC_XID_NULL_CLASS_2, 127);.2 62 rc = llc_mac_hdr_init(nskb, skb->dev->dev_addr, mac_da);.2 63 if (unlikely(rc)).2 64 goto fre ;.2 65 nskb,dev_queueeGm="rca> class="sref">unhref="+code=a>,.a>a> class="sref">unhref="+code=f">out;.unlike/a>a> class="sref">unhref="+code=rc =60;.unhref="+code=ac_danskb,dev_queueeGm="rca> class="sref">unhref="+code7>dsap2 56 goto , 127);.2 48sest_cc int llc_sta v_ac_send_xid_r(struct sk_buff *rcfre ;.2 50 u8 mac_da[ETH_ALEN], 2 51 int *ETH_Aata_ ], 2 52 struct sk_buffdsapdsap ? 0 : 1; Tgram st L4hrest ; ismp; U (="lilen 3) /* NULL DS8U_RSPETH_Aata_ sk_tohse=dev_queueeGm="srefethss="sref">pdu =ethss="e=llc_pdu_un_hdr" class="sref">llc_pdu_un_hdr<->llc_pduh_prs="_CMD, 128);.sk_buff *nskb = llc_alloc_fram (NULL, skb->nskb, ETH_Aata_ a> class="sref">unhref="+code8ac_darc2 55 if (!fre ;.2 56 goto 2 57 *2 58 llc_pdu_decode_sa(skb, 8f the2 59 llc_pdu_decode_ssap(skb, &2 60 llc_pdu_header_init(nskb, LLC_PDU_TYPE_U, 0, dsap, llc_mac_hdr_init(nskb2 62 rc = llc_mac_hdr_init(nskb, skb->dev->dev_addr, 9, 129);.2 63 if (unlikely(2 64 goto rc2 65 nskb,dev_queueeGm="rca> class="sref">unhref="+code9">fre ;.a>a> class="sref">unhref="+code9a>,.unlike/a>a> class="sref">unhref="+code9t"> *unhref="+code9f thenskb,dev_queueeGm="rca> class="sref">unhref="+code9 v.2 56 goto *2 11e ddrh"ne" nam L11">2 11;a _s v.c#L5" id L5" class="lin GNU General Public License for more deta0e.h&g0t;.2 27 */2 48sest_cc int sk_buff *rc2 49{.2 63 /a>{.llc_sta _ev_rs="sref">sk_buff *rc2 8">2 48sest_cc int llc_sta lass="sref">nskb2 63 /a>{.llc_sta _ev_rxs="sref">sk_buff *rc2 8">2 48sest_cc int llc_sta lass="sref">nskb2 65 uk _>nse=dev_queueeGm="sref">nskb,dev_queueeGmb2 48sest_ref="+code=llc_mac_h_ass="sref 8">2 48sest_cc int rc2 49{.nskb,dev_qu="sref9U_RSP;a _s v.c#L5" id L5" class="lin Grde=dsap" class="sref9U_RSP *2 48sest_cc ext rc2 49{.2ef="n1eet/llc.LXR am e=nsyev_addt" o experi L7al versS_"el Ps="line" mailto:lx<@de/li.noc/lx<@de/li.noev_a. ss="seach_rec/llc_ssubfoot lx<.de/li.no ki idy hosteral Ps="line" http://www.redpill-de/pro.noc/Redpill Le/pro ASev_addprovie resta e/li amnarching ="lioper