Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0 */
0002 /*
0003  * Lec arp cache
0004  *
0005  * Marko Kiiskila <mkiiskila@yahoo.com>
0006  */
0007 #ifndef _LEC_ARP_H_
0008 #define _LEC_ARP_H_
0009 #include <linux/atm.h>
0010 #include <linux/atmdev.h>
0011 #include <linux/if_ether.h>
0012 #include <linux/atmlec.h>
0013 
0014 struct lec_arp_table {
0015     struct hlist_node next;     /* Linked entry list */
0016     unsigned char atm_addr[ATM_ESA_LEN];    /* Atm address */
0017     unsigned char mac_addr[ETH_ALEN];   /* Mac address */
0018     int is_rdesc;           /* Mac address is a route descriptor */
0019     struct atm_vcc *vcc;        /* Vcc this entry is attached */
0020     struct atm_vcc *recv_vcc;   /* Vcc we receive data from */
0021 
0022     void (*old_push) (struct atm_vcc *vcc, struct sk_buff *skb);
0023                     /* Push that leads to daemon */
0024 
0025     void (*old_recv_push) (struct atm_vcc *vcc, struct sk_buff *skb);
0026                     /* Push that leads to daemon */
0027 
0028     unsigned long last_used;    /* For expiry */
0029     unsigned long timestamp;    /* Used for various timestamping things:
0030                      * 1. FLUSH started
0031                      *    (status=ESI_FLUSH_PENDING)
0032                      * 2. Counting to
0033                      *    max_unknown_frame_time
0034                      *    (status=ESI_ARP_PENDING||
0035                      *     status=ESI_VC_PENDING)
0036                      */
0037     unsigned char no_tries;     /* No of times arp retry has been tried */
0038     unsigned char status;       /* Status of this entry */
0039     unsigned short flags;       /* Flags for this entry */
0040     unsigned short packets_flooded; /* Data packets flooded */
0041     unsigned long flush_tran_id;    /* Transaction id in flush protocol */
0042     struct timer_list timer;    /* Arping timer */
0043     struct lec_priv *priv;      /* Pointer back */
0044     u8 *tlvs;
0045     u32 sizeoftlvs;         /*
0046                      * LANE2: Each MAC address can have TLVs
0047                      * associated with it.  sizeoftlvs tells
0048                      * the length of the tlvs array
0049                      */
0050     struct sk_buff_head tx_wait;    /* wait queue for outgoing packets */
0051     refcount_t usage;       /* usage count */
0052 };
0053 
0054 /*
0055  * LANE2: Template tlv struct for accessing
0056  * the tlvs in the lec_arp_table->tlvs array
0057  */
0058 struct tlv {
0059     u32 type;
0060     u8 length;
0061     u8 value[255];
0062 };
0063 
0064 /* Status fields */
0065 #define ESI_UNKNOWN 0       /*
0066                  * Next packet sent to this mac address
0067                  * causes ARP-request to be sent
0068                  */
0069 #define ESI_ARP_PENDING 1   /*
0070                  * There is no ATM address associated with this
0071                  * 48-bit address.  The LE-ARP protocol is in
0072                  * progress.
0073                  */
0074 #define ESI_VC_PENDING 2    /*
0075                  * There is a valid ATM address associated with
0076                  * this 48-bit address but there is no VC set
0077                  * up to that ATM address.  The signaling
0078                  * protocol is in process.
0079                  */
0080 #define ESI_FLUSH_PENDING 4 /*
0081                  * The LEC has been notified of the FLUSH_START
0082                  * status and it is assumed that the flush
0083                  * protocol is in process.
0084                  */
0085 #define ESI_FORWARD_DIRECT 5    /*
0086                  * Either the Path Switching Delay (C22) has
0087                  * elapsed or the LEC has notified the Mapping
0088                  * that the flush protocol has completed.  In
0089                  * either case, it is safe to forward packets
0090                  * to this address via the data direct VC.
0091                  */
0092 
0093 /* Flag values */
0094 #define LEC_REMOTE_FLAG      0x0001
0095 #define LEC_PERMANENT_FLAG   0x0002
0096 
0097 #endif /* _LEC_ARP_H_ */