blob: fdb2629b61890b0326ef151e53eedc4bfbfad851 [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001#ifndef _LINUX_ATMBR2684_H
2#define _LINUX_ATMBR2684_H
3
Jaswinder Singh Rajputf757f602009-01-30 20:29:11 +05304#include <linux/types.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -07005#include <linux/atm.h>
6#include <linux/if.h> /* For IFNAMSIZ */
7
8/*
9 * Type of media we're bridging (ethernet, token ring, etc) Currently only
10 * ethernet is supported
11 */
12#define BR2684_MEDIA_ETHERNET (0) /* 802.3 */
13#define BR2684_MEDIA_802_4 (1) /* 802.4 */
14#define BR2684_MEDIA_TR (2) /* 802.5 - token ring */
15#define BR2684_MEDIA_FDDI (3)
16#define BR2684_MEDIA_802_6 (4) /* 802.6 */
17
Eric Kinzie097b19a2007-12-30 23:17:53 -080018 /* used only at device creation: */
Chas Williamsfb64c732007-12-30 23:18:29 -080019#define BR2684_FLAG_ROUTED (1<<16) /* payload is routed, not bridged */
Eric Kinzie097b19a2007-12-30 23:17:53 -080020
Linus Torvalds1da177e2005-04-16 15:20:36 -070021/*
22 * Is there FCS inbound on this VC? This currently isn't supported.
23 */
24#define BR2684_FCSIN_NO (0)
25#define BR2684_FCSIN_IGNORE (1)
26#define BR2684_FCSIN_VERIFY (2)
27
28/*
29 * Is there FCS outbound on this VC? This currently isn't supported.
30 */
31#define BR2684_FCSOUT_NO (0)
32#define BR2684_FCSOUT_SENDZERO (1)
33#define BR2684_FCSOUT_GENERATE (2)
34
35/*
36 * Does this VC include LLC encapsulation?
37 */
38#define BR2684_ENCAPS_VC (0) /* VC-mux */
39#define BR2684_ENCAPS_LLC (1)
40#define BR2684_ENCAPS_AUTODETECT (2) /* Unsuported */
41
42/*
Eric Kinzie097b19a2007-12-30 23:17:53 -080043 * Is this VC bridged or routed?
44 */
45
46#define BR2684_PAYLOAD_ROUTED (0)
47#define BR2684_PAYLOAD_BRIDGED (1)
48
Eric Kinzie097b19a2007-12-30 23:17:53 -080049/*
Linus Torvalds1da177e2005-04-16 15:20:36 -070050 * This is for the ATM_NEWBACKENDIF call - these are like socket families:
51 * the first element of the structure is the backend number and the rest
52 * is per-backend specific
53 */
54struct atm_newif_br2684 {
Chas Williamsfb64c732007-12-30 23:18:29 -080055 atm_backend_t backend_num; /* ATM_BACKEND_BR2684 */
56 int media; /* BR2684_MEDIA_*, flags in upper bits */
57 char ifname[IFNAMSIZ];
58 int mtu;
Linus Torvalds1da177e2005-04-16 15:20:36 -070059};
60
61/*
62 * This structure is used to specify a br2684 interface - either by a
63 * positive integer (returned by ATM_NEWBACKENDIF) or the interfaces name
64 */
65#define BR2684_FIND_BYNOTHING (0)
66#define BR2684_FIND_BYNUM (1)
67#define BR2684_FIND_BYIFNAME (2)
68struct br2684_if_spec {
Chas Williamsfb64c732007-12-30 23:18:29 -080069 int method; /* BR2684_FIND_* */
Linus Torvalds1da177e2005-04-16 15:20:36 -070070 union {
Chas Williamsfb64c732007-12-30 23:18:29 -080071 char ifname[IFNAMSIZ];
72 int devnum;
Linus Torvalds1da177e2005-04-16 15:20:36 -070073 } spec;
74};
75
76/*
77 * This is for the ATM_SETBACKEND call - these are like socket families:
78 * the first element of the structure is the backend number and the rest
79 * is per-backend specific
80 */
81struct atm_backend_br2684 {
Chas Williamsfb64c732007-12-30 23:18:29 -080082 atm_backend_t backend_num; /* ATM_BACKEND_BR2684 */
Linus Torvalds1da177e2005-04-16 15:20:36 -070083 struct br2684_if_spec ifspec;
Chas Williamsfb64c732007-12-30 23:18:29 -080084 int fcs_in; /* BR2684_FCSIN_* */
85 int fcs_out; /* BR2684_FCSOUT_* */
86 int fcs_auto; /* 1: fcs_{in,out} disabled if no FCS rx'ed */
87 int encaps; /* BR2684_ENCAPS_* */
88 int has_vpiid; /* 1: use vpn_id - Unsupported */
89 __u8 vpn_id[7];
90 int send_padding; /* unsupported */
91 int min_size; /* we will pad smaller packets than this */
Linus Torvalds1da177e2005-04-16 15:20:36 -070092};
93
94/*
95 * The BR2684_SETFILT ioctl is an experimental mechanism for folks
96 * terminating a large number of IP-only vcc's. When netfilter allows
97 * efficient per-if in/out filters, this support will be removed
98 */
99struct br2684_filter {
Chas Williamsfb64c732007-12-30 23:18:29 -0800100 __be32 prefix; /* network byte order */
101 __be32 netmask; /* 0 = disable filter */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700102};
103
104struct br2684_filter_set {
105 struct br2684_if_spec ifspec;
106 struct br2684_filter filter;
107};
108
Eric Kinzie097b19a2007-12-30 23:17:53 -0800109enum br2684_payload {
Chas Williamsfb64c732007-12-30 23:18:29 -0800110 p_routed = BR2684_PAYLOAD_ROUTED,
111 p_bridged = BR2684_PAYLOAD_BRIDGED,
Eric Kinzie097b19a2007-12-30 23:17:53 -0800112};
113
Linus Torvalds1da177e2005-04-16 15:20:36 -0700114#define BR2684_SETFILT _IOW( 'a', ATMIOC_BACKEND + 0, \
115 struct br2684_filter_set)
116
117#endif /* _LINUX_ATMBR2684_H */