Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions | Variables
llc.h File Reference
#include <linux/if.h>
#include <linux/if_ether.h>
#include <linux/list.h>
#include <linux/spinlock.h>
#include <linux/rculist_nulls.h>
#include <linux/hash.h>
#include <linux/jhash.h>
#include <linux/atomic.h>

Go to the source code of this file.

Data Structures

struct  llc_addr
 
struct  llc_sap
 

Macros

#define LLC_SAP_STATE_INACTIVE   1
 
#define LLC_SAP_STATE_ACTIVE   2
 
#define LLC_SK_DEV_HASH_BITS   6
 
#define LLC_SK_DEV_HASH_ENTRIES   (1<<LLC_SK_DEV_HASH_BITS)
 
#define LLC_SK_LADDR_HASH_BITS   6
 
#define LLC_SK_LADDR_HASH_ENTRIES   (1<<LLC_SK_LADDR_HASH_BITS)
 
#define LLC_DEST_INVALID   0 /* Invalid LLC PDU type */
 
#define LLC_DEST_SAP   1 /* Type 1 goes here */
 
#define LLC_DEST_CONN   2 /* Type 2 goes here */
 
#define llc_proc_init()   (0)
 
#define llc_proc_exit()   do { } while(0)
 
#define llc_sysctl_init()   (0)
 
#define llc_sysctl_exit()   do { } while(0)
 

Functions

int llc_rcv (struct sk_buff *skb, struct net_device *dev, struct packet_type *pt, struct net_device *orig_dev)
 
int llc_mac_hdr_init (struct sk_buff *skb, const unsigned char *sa, const unsigned char *da)
 
void llc_add_pack (int type, void(*handler)(struct llc_sap *sap, struct sk_buff *skb))
 
void llc_remove_pack (int type)
 
void llc_set_station_handler (void(*handler)(struct sk_buff *skb))
 
struct llc_sapllc_sap_open (unsigned char lsap, int(*rcv)(struct sk_buff *skb, struct net_device *dev, struct packet_type *pt, struct net_device *orig_dev))
 
void llc_sap_close (struct llc_sap *sap)
 
struct llc_sapllc_sap_find (unsigned char sap_value)
 
int llc_build_and_send_ui_pkt (struct llc_sap *sap, struct sk_buff *skb, unsigned char *dmac, unsigned char dsap)
 
void llc_sap_handler (struct llc_sap *sap, struct sk_buff *skb)
 
void llc_conn_handler (struct llc_sap *sap, struct sk_buff *skb)
 
void llc_station_init (void)
 
void llc_station_exit (void)
 

Variables

struct list_head llc_sap_list
 
spinlock_t llc_sap_list_lock
 

Macro Definition Documentation

#define LLC_DEST_CONN   2 /* Type 2 goes here */

Definition at line 93 of file llc.h.

#define LLC_DEST_INVALID   0 /* Invalid LLC PDU type */

Definition at line 91 of file llc.h.

#define LLC_DEST_SAP   1 /* Type 1 goes here */

Definition at line 92 of file llc.h.

#define llc_proc_exit (   void)    do { } while(0)

Definition at line 144 of file llc.h.

#define llc_proc_init (   void)    (0)

Definition at line 143 of file llc.h.

#define LLC_SAP_STATE_ACTIVE   2

Definition at line 35 of file llc.h.

#define LLC_SAP_STATE_INACTIVE   1

Definition at line 34 of file llc.h.

#define LLC_SK_DEV_HASH_BITS   6

Definition at line 37 of file llc.h.

#define LLC_SK_DEV_HASH_ENTRIES   (1<<LLC_SK_DEV_HASH_BITS)

Definition at line 38 of file llc.h.

#define LLC_SK_LADDR_HASH_BITS   6

Definition at line 40 of file llc.h.

#define LLC_SK_LADDR_HASH_ENTRIES   (1<<LLC_SK_LADDR_HASH_BITS)

Definition at line 41 of file llc.h.

#define llc_sysctl_exit (   void)    do { } while(0)

Definition at line 156 of file llc.h.

#define llc_sysctl_init (   void)    (0)

Definition at line 155 of file llc.h.

Function Documentation

void llc_add_pack ( int  type,
void(*)(struct llc_sap *sap, struct sk_buff *skb handler 
)

Definition at line 42 of file llc_input.c.

int llc_build_and_send_ui_pkt ( struct llc_sap sap,
struct sk_buff skb,
unsigned char dmac,
unsigned char  dsap 
)

llc_build_and_send_ui_pkt - unitdata request interface for upper layers : sap to use : packet to send : destination mac address : destination sap

Upper layers calls this function when upper layer wants to send data using connection-less mode communication (UI pdu).

Accept data frame from network layer to be sent using connection- less mode communication; timeout/retries handled by network layer; package primitive as an event and send to SAP event handler

Definition at line 65 of file llc_output.c.

void llc_conn_handler ( struct llc_sap sap,
struct sk_buff skb 
)

Definition at line 787 of file llc_conn.c.

int llc_mac_hdr_init ( struct sk_buff skb,
const unsigned char sa,
const unsigned char da 
)

llc_mac_hdr_init - fills MAC header fields : Address of the frame to initialize its MAC header

See Also
: The MAC source address : The MAC destination address

Fills MAC header fields, depending on MAC type. Returns 0, If MAC type is a valid type and initialization completes correctly 1, otherwise.

Definition at line 32 of file llc_output.c.

int llc_rcv ( struct sk_buff skb,
struct net_device dev,
struct packet_type pt,
struct net_device orig_dev 
)

llc_rcv - 802.2 entry point from net lower layers : received pdu : device that receive pdu : packet type

When the system receives a 802.2 frame this function is called. It checks SAP and connection of received pdu and passes frame to llc_{station,sap,conn}_rcv for sending to proper state machine. If the frame is related to a busy connection (a connection is sending data now), it queues this frame in the connection's backlog.

Definition at line 154 of file llc_input.c.

void llc_remove_pack ( int  type)

Definition at line 50 of file llc_input.c.

void llc_sap_close ( struct llc_sap sap)

llc_sap_close - close interface for upper layers. : SAP to be closed.

Close interface function to upper layer. Each one who wants to close an open SAP (for example NetBEUI) should call this function. Removes this sap from the list of saps in the station and then frees the memory for this sap.

Definition at line 122 of file llc_core.c.

struct llc_sap* llc_sap_find ( unsigned char  sap_value)
read

llc_sap_find - searchs a SAP in station : sap to be found

Searchs for a sap in the sap list of the LLC's station upon the sap ID. If the sap is found it will be refcounted and the user will have to do a llc_sap_put after use. Returns the sap or NULL if not found.

Definition at line 70 of file llc_core.c.

void llc_sap_handler ( struct llc_sap sap,
struct sk_buff skb 
)

Definition at line 422 of file llc_sap.c.

struct llc_sap* llc_sap_open ( unsigned char  lsap,
int(*)(struct sk_buff *skb, struct net_device *dev, struct packet_type *pt, struct net_device *orig_dev)  func 
)
read

llc_sap_open - open interface to the upper layers. : SAP number. : rcv func for datalink protos

Interface function to upper layer. Each one who wants to get a SAP (for example NetBEUI) should call this function. Returns the opened SAP for success, NULL for failure.

Definition at line 91 of file llc_core.c.

void llc_set_station_handler ( void(*)(struct sk_buff *skb handler)

Definition at line 57 of file llc_input.c.

void llc_station_exit ( void  )

Definition at line 122 of file llc_station.c.

void llc_station_init ( void  )

Definition at line 117 of file llc_station.c.

Variable Documentation

struct list_head llc_sap_list
spinlock_t llc_sap_list_lock