Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
0002 #ifndef _LINUX_ATMBR2684_H
0003 #define _LINUX_ATMBR2684_H
0004 
0005 #include <linux/types.h>
0006 #include <linux/atm.h>
0007 #include <linux/if.h>       /* For IFNAMSIZ */
0008 
0009 /*
0010  * Type of media we're bridging (ethernet, token ring, etc)  Currently only
0011  * ethernet is supported
0012  */
0013 #define BR2684_MEDIA_ETHERNET   (0) /* 802.3 */
0014 #define BR2684_MEDIA_802_4  (1) /* 802.4 */
0015 #define BR2684_MEDIA_TR     (2) /* 802.5 - token ring */
0016 #define BR2684_MEDIA_FDDI   (3)
0017 #define BR2684_MEDIA_802_6  (4) /* 802.6 */
0018 
0019                     /* used only at device creation:  */
0020 #define BR2684_FLAG_ROUTED  (1<<16) /* payload is routed, not bridged */
0021 
0022 /*
0023  * Is there FCS inbound on this VC?  This currently isn't supported.
0024  */
0025 #define BR2684_FCSIN_NO     (0)
0026 #define BR2684_FCSIN_IGNORE (1)
0027 #define BR2684_FCSIN_VERIFY (2)
0028 
0029 /*
0030  * Is there FCS outbound on this VC?  This currently isn't supported.
0031  */
0032 #define BR2684_FCSOUT_NO    (0)
0033 #define BR2684_FCSOUT_SENDZERO  (1)
0034 #define BR2684_FCSOUT_GENERATE  (2)
0035 
0036 /*
0037  * Does this VC include LLC encapsulation?
0038  */
0039 #define BR2684_ENCAPS_VC    (0) /* VC-mux */
0040 #define BR2684_ENCAPS_LLC   (1)
0041 #define BR2684_ENCAPS_AUTODETECT (2)    /* Unsuported */
0042 
0043 /*
0044  * Is this VC bridged or routed?
0045  */
0046 
0047 #define BR2684_PAYLOAD_ROUTED   (0)
0048 #define BR2684_PAYLOAD_BRIDGED  (1)
0049 
0050 /*
0051  * This is for the ATM_NEWBACKENDIF call - these are like socket families:
0052  * the first element of the structure is the backend number and the rest
0053  * is per-backend specific
0054  */
0055 struct atm_newif_br2684 {
0056     atm_backend_t backend_num;  /* ATM_BACKEND_BR2684 */
0057     int media;      /* BR2684_MEDIA_*, flags in upper bits */
0058     char ifname[IFNAMSIZ];
0059     int mtu;
0060 };
0061 
0062 /*
0063  * This structure is used to specify a br2684 interface - either by a
0064  * positive integer (returned by ATM_NEWBACKENDIF) or the interfaces name
0065  */
0066 #define BR2684_FIND_BYNOTHING   (0)
0067 #define BR2684_FIND_BYNUM   (1)
0068 #define BR2684_FIND_BYIFNAME    (2)
0069 struct br2684_if_spec {
0070     int method;     /* BR2684_FIND_* */
0071     union {
0072         char ifname[IFNAMSIZ];
0073         int devnum;
0074     } spec;
0075 };
0076 
0077 /*
0078  * This is for the ATM_SETBACKEND call - these are like socket families:
0079  * the first element of the structure is the backend number and the rest
0080  * is per-backend specific
0081  */
0082 struct atm_backend_br2684 {
0083     atm_backend_t backend_num;  /* ATM_BACKEND_BR2684 */
0084     struct br2684_if_spec ifspec;
0085     int fcs_in;     /* BR2684_FCSIN_* */
0086     int fcs_out;        /* BR2684_FCSOUT_* */
0087     int fcs_auto;       /* 1: fcs_{in,out} disabled if no FCS rx'ed */
0088     int encaps;     /* BR2684_ENCAPS_* */
0089     int has_vpiid;      /* 1: use vpn_id - Unsupported */
0090     __u8 vpn_id[7];
0091     int send_padding;   /* unsupported */
0092     int min_size;       /* we will pad smaller packets than this */
0093 };
0094 
0095 /*
0096  * The BR2684_SETFILT ioctl is an experimental mechanism for folks
0097  * terminating a large number of IP-only vcc's.  When netfilter allows
0098  * efficient per-if in/out filters, this support will be removed
0099  */
0100 struct br2684_filter {
0101     __be32 prefix;      /* network byte order */
0102     __be32 netmask;     /* 0 = disable filter */
0103 };
0104 
0105 struct br2684_filter_set {
0106     struct br2684_if_spec ifspec;
0107     struct br2684_filter filter;
0108 };
0109 
0110 enum br2684_payload {
0111     p_routed = BR2684_PAYLOAD_ROUTED,
0112     p_bridged = BR2684_PAYLOAD_BRIDGED,
0113 };
0114 
0115 #define BR2684_SETFILT  _IOW( 'a', ATMIOC_BACKEND + 0, \
0116                 struct br2684_filter_set)
0117 
0118 #endif /* _LINUX_ATMBR2684_H */