1dcfb7a77f8709125e97c313cb8ab6ec4d87468f4San Mehat/* atm.h - general ATM declarations */ 2dcfb7a77f8709125e97c313cb8ab6ec4d87468f4San Mehat 3dcfb7a77f8709125e97c313cb8ab6ec4d87468f4San Mehat/* Written 1995-2000 by Werner Almesberger, EPFL LRC/ICA */ 4dcfb7a77f8709125e97c313cb8ab6ec4d87468f4San Mehat 5dcfb7a77f8709125e97c313cb8ab6ec4d87468f4San Mehat 6dcfb7a77f8709125e97c313cb8ab6ec4d87468f4San Mehat/* 7dcfb7a77f8709125e97c313cb8ab6ec4d87468f4San Mehat * WARNING: User-space programs should not #include <linux/atm.h> directly. 8dcfb7a77f8709125e97c313cb8ab6ec4d87468f4San Mehat * Instead, #include <atm.h> 9dcfb7a77f8709125e97c313cb8ab6ec4d87468f4San Mehat */ 10dcfb7a77f8709125e97c313cb8ab6ec4d87468f4San Mehat 11dcfb7a77f8709125e97c313cb8ab6ec4d87468f4San Mehat#ifndef _LINUX_ATM_H 12dcfb7a77f8709125e97c313cb8ab6ec4d87468f4San Mehat#define _LINUX_ATM_H 13dcfb7a77f8709125e97c313cb8ab6ec4d87468f4San Mehat 14dcfb7a77f8709125e97c313cb8ab6ec4d87468f4San Mehat/* 15dcfb7a77f8709125e97c313cb8ab6ec4d87468f4San Mehat * BEGIN_xx and END_xx markers are used for automatic generation of 16dcfb7a77f8709125e97c313cb8ab6ec4d87468f4San Mehat * documentation. Do not change them. 17dcfb7a77f8709125e97c313cb8ab6ec4d87468f4San Mehat */ 18dcfb7a77f8709125e97c313cb8ab6ec4d87468f4San Mehat 19dcfb7a77f8709125e97c313cb8ab6ec4d87468f4San Mehat 20dcfb7a77f8709125e97c313cb8ab6ec4d87468f4San Mehat#include <linux/atmapi.h> 21dcfb7a77f8709125e97c313cb8ab6ec4d87468f4San Mehat#include <linux/atmsap.h> 22dcfb7a77f8709125e97c313cb8ab6ec4d87468f4San Mehat#include <linux/atmioc.h> 23dcfb7a77f8709125e97c313cb8ab6ec4d87468f4San Mehat#include <linux/types.h> 24dcfb7a77f8709125e97c313cb8ab6ec4d87468f4San Mehat 25dcfb7a77f8709125e97c313cb8ab6ec4d87468f4San Mehat 26dcfb7a77f8709125e97c313cb8ab6ec4d87468f4San Mehat/* general ATM constants */ 27dcfb7a77f8709125e97c313cb8ab6ec4d87468f4San Mehat#define ATM_CELL_SIZE 53 /* ATM cell size incl. header */ 28dcfb7a77f8709125e97c313cb8ab6ec4d87468f4San Mehat#define ATM_CELL_PAYLOAD 48 /* ATM payload size */ 29dcfb7a77f8709125e97c313cb8ab6ec4d87468f4San Mehat#define ATM_AAL0_SDU 52 /* AAL0 SDU size */ 30dcfb7a77f8709125e97c313cb8ab6ec4d87468f4San Mehat#define ATM_MAX_AAL34_PDU 65535 /* maximum AAL3/4 PDU payload */ 31dcfb7a77f8709125e97c313cb8ab6ec4d87468f4San Mehat#define ATM_AAL5_TRAILER 8 /* AAL5 trailer size */ 32dcfb7a77f8709125e97c313cb8ab6ec4d87468f4San Mehat#define ATM_MAX_AAL5_PDU 65535 /* maximum AAL5 PDU payload */ 33dcfb7a77f8709125e97c313cb8ab6ec4d87468f4San Mehat#define ATM_MAX_CDV 9999 /* maximum (default) CDV */ 34dcfb7a77f8709125e97c313cb8ab6ec4d87468f4San Mehat#define ATM_NOT_RSV_VCI 32 /* first non-reserved VCI value */ 35dcfb7a77f8709125e97c313cb8ab6ec4d87468f4San Mehat 36dcfb7a77f8709125e97c313cb8ab6ec4d87468f4San Mehat#define ATM_MAX_VPI 255 /* maximum VPI at the UNI */ 37dcfb7a77f8709125e97c313cb8ab6ec4d87468f4San Mehat#define ATM_MAX_VPI_NNI 4096 /* maximum VPI at the NNI */ 38dcfb7a77f8709125e97c313cb8ab6ec4d87468f4San Mehat#define ATM_MAX_VCI 65535 /* maximum VCI */ 39dcfb7a77f8709125e97c313cb8ab6ec4d87468f4San Mehat 40dcfb7a77f8709125e97c313cb8ab6ec4d87468f4San Mehat 41dcfb7a77f8709125e97c313cb8ab6ec4d87468f4San Mehat/* "protcol" values for the socket system call */ 42dcfb7a77f8709125e97c313cb8ab6ec4d87468f4San Mehat#define ATM_NO_AAL 0 /* AAL not specified */ 43dcfb7a77f8709125e97c313cb8ab6ec4d87468f4San Mehat#define ATM_AAL0 13 /* "raw" ATM cells */ 44dcfb7a77f8709125e97c313cb8ab6ec4d87468f4San Mehat#define ATM_AAL1 1 /* AAL1 (CBR) */ 45dcfb7a77f8709125e97c313cb8ab6ec4d87468f4San Mehat#define ATM_AAL2 2 /* AAL2 (VBR) */ 46dcfb7a77f8709125e97c313cb8ab6ec4d87468f4San Mehat#define ATM_AAL34 3 /* AAL3/4 (data) */ 47dcfb7a77f8709125e97c313cb8ab6ec4d87468f4San Mehat#define ATM_AAL5 5 /* AAL5 (data) */ 48dcfb7a77f8709125e97c313cb8ab6ec4d87468f4San Mehat 49dcfb7a77f8709125e97c313cb8ab6ec4d87468f4San Mehat/* 50dcfb7a77f8709125e97c313cb8ab6ec4d87468f4San Mehat * socket option name coding functions 51dcfb7a77f8709125e97c313cb8ab6ec4d87468f4San Mehat * 52dcfb7a77f8709125e97c313cb8ab6ec4d87468f4San Mehat * Note that __SO_ENCODE and __SO_LEVEL are somewhat a hack since the 53dcfb7a77f8709125e97c313cb8ab6ec4d87468f4San Mehat * << 22 only reserves 9 bits for the level. On some architectures 54dcfb7a77f8709125e97c313cb8ab6ec4d87468f4San Mehat * SOL_SOCKET is 0xFFFF, so that's a bit of a problem 55dcfb7a77f8709125e97c313cb8ab6ec4d87468f4San Mehat */ 56dcfb7a77f8709125e97c313cb8ab6ec4d87468f4San Mehat 57dcfb7a77f8709125e97c313cb8ab6ec4d87468f4San Mehat#define __SO_ENCODE(l,n,t) ((((l) & 0x1FF) << 22) | ((n) << 16) | \ 58dcfb7a77f8709125e97c313cb8ab6ec4d87468f4San Mehat sizeof(t)) 59dcfb7a77f8709125e97c313cb8ab6ec4d87468f4San Mehat#define __SO_LEVEL_MATCH(c,m) (((c) >> 22) == ((m) & 0x1FF)) 60dcfb7a77f8709125e97c313cb8ab6ec4d87468f4San Mehat#define __SO_NUMBER(c) (((c) >> 16) & 0x3f) 61dcfb7a77f8709125e97c313cb8ab6ec4d87468f4San Mehat#define __SO_SIZE(c) ((c) & 0x3fff) 62dcfb7a77f8709125e97c313cb8ab6ec4d87468f4San Mehat 63dcfb7a77f8709125e97c313cb8ab6ec4d87468f4San Mehat/* 64dcfb7a77f8709125e97c313cb8ab6ec4d87468f4San Mehat * ATM layer 65dcfb7a77f8709125e97c313cb8ab6ec4d87468f4San Mehat */ 66dcfb7a77f8709125e97c313cb8ab6ec4d87468f4San Mehat 67dcfb7a77f8709125e97c313cb8ab6ec4d87468f4San Mehat#define SO_SETCLP __SO_ENCODE(SOL_ATM,0,int) 68dcfb7a77f8709125e97c313cb8ab6ec4d87468f4San Mehat /* set CLP bit value - TODO */ 69dcfb7a77f8709125e97c313cb8ab6ec4d87468f4San Mehat#define SO_CIRANGE __SO_ENCODE(SOL_ATM,1,struct atm_cirange) 70dcfb7a77f8709125e97c313cb8ab6ec4d87468f4San Mehat /* connection identifier range; socket must be 71dcfb7a77f8709125e97c313cb8ab6ec4d87468f4San Mehat bound or connected */ 72dcfb7a77f8709125e97c313cb8ab6ec4d87468f4San Mehat#define SO_ATMQOS __SO_ENCODE(SOL_ATM,2,struct atm_qos) 73dcfb7a77f8709125e97c313cb8ab6ec4d87468f4San Mehat /* Quality of Service setting */ 74dcfb7a77f8709125e97c313cb8ab6ec4d87468f4San Mehat#define SO_ATMSAP __SO_ENCODE(SOL_ATM,3,struct atm_sap) 75dcfb7a77f8709125e97c313cb8ab6ec4d87468f4San Mehat /* Service Access Point */ 76dcfb7a77f8709125e97c313cb8ab6ec4d87468f4San Mehat#define SO_ATMPVC __SO_ENCODE(SOL_ATM,4,struct sockaddr_atmpvc) 77dcfb7a77f8709125e97c313cb8ab6ec4d87468f4San Mehat /* "PVC" address (also for SVCs); get only */ 78dcfb7a77f8709125e97c313cb8ab6ec4d87468f4San Mehat#define SO_MULTIPOINT __SO_ENCODE(SOL_ATM, 5, int) 79dcfb7a77f8709125e97c313cb8ab6ec4d87468f4San Mehat /* make this vc a p2mp */ 80dcfb7a77f8709125e97c313cb8ab6ec4d87468f4San Mehat 81dcfb7a77f8709125e97c313cb8ab6ec4d87468f4San Mehat 82dcfb7a77f8709125e97c313cb8ab6ec4d87468f4San Mehat/* 83dcfb7a77f8709125e97c313cb8ab6ec4d87468f4San Mehat * Note @@@: since the socket layers don't really distinguish the control and 84dcfb7a77f8709125e97c313cb8ab6ec4d87468f4San Mehat * the data plane but generally seems to be data plane-centric, any layer is 85dcfb7a77f8709125e97c313cb8ab6ec4d87468f4San Mehat * about equally wrong for the SAP. If you have a better idea about this, 86dcfb7a77f8709125e97c313cb8ab6ec4d87468f4San Mehat * please speak up ... 87dcfb7a77f8709125e97c313cb8ab6ec4d87468f4San Mehat */ 88dcfb7a77f8709125e97c313cb8ab6ec4d87468f4San Mehat 89dcfb7a77f8709125e97c313cb8ab6ec4d87468f4San Mehat 90dcfb7a77f8709125e97c313cb8ab6ec4d87468f4San Mehat/* ATM cell header (for AAL0) */ 91dcfb7a77f8709125e97c313cb8ab6ec4d87468f4San Mehat 92dcfb7a77f8709125e97c313cb8ab6ec4d87468f4San Mehat/* BEGIN_CH */ 93dcfb7a77f8709125e97c313cb8ab6ec4d87468f4San Mehat#define ATM_HDR_GFC_MASK 0xf0000000 94dcfb7a77f8709125e97c313cb8ab6ec4d87468f4San Mehat#define ATM_HDR_GFC_SHIFT 28 95dcfb7a77f8709125e97c313cb8ab6ec4d87468f4San Mehat#define ATM_HDR_VPI_MASK 0x0ff00000 96dcfb7a77f8709125e97c313cb8ab6ec4d87468f4San Mehat#define ATM_HDR_VPI_SHIFT 20 97dcfb7a77f8709125e97c313cb8ab6ec4d87468f4San Mehat#define ATM_HDR_VCI_MASK 0x000ffff0 98dcfb7a77f8709125e97c313cb8ab6ec4d87468f4San Mehat#define ATM_HDR_VCI_SHIFT 4 99dcfb7a77f8709125e97c313cb8ab6ec4d87468f4San Mehat#define ATM_HDR_PTI_MASK 0x0000000e 100dcfb7a77f8709125e97c313cb8ab6ec4d87468f4San Mehat#define ATM_HDR_PTI_SHIFT 1 101dcfb7a77f8709125e97c313cb8ab6ec4d87468f4San Mehat#define ATM_HDR_CLP 0x00000001 102dcfb7a77f8709125e97c313cb8ab6ec4d87468f4San Mehat/* END_CH */ 103dcfb7a77f8709125e97c313cb8ab6ec4d87468f4San Mehat 104dcfb7a77f8709125e97c313cb8ab6ec4d87468f4San Mehat 105dcfb7a77f8709125e97c313cb8ab6ec4d87468f4San Mehat/* PTI codings */ 106dcfb7a77f8709125e97c313cb8ab6ec4d87468f4San Mehat 107dcfb7a77f8709125e97c313cb8ab6ec4d87468f4San Mehat/* BEGIN_PTI */ 108dcfb7a77f8709125e97c313cb8ab6ec4d87468f4San Mehat#define ATM_PTI_US0 0 /* user data cell, congestion not exp, SDU-type 0 */ 109dcfb7a77f8709125e97c313cb8ab6ec4d87468f4San Mehat#define ATM_PTI_US1 1 /* user data cell, congestion not exp, SDU-type 1 */ 110dcfb7a77f8709125e97c313cb8ab6ec4d87468f4San Mehat#define ATM_PTI_UCES0 2 /* user data cell, cong. experienced, SDU-type 0 */ 111dcfb7a77f8709125e97c313cb8ab6ec4d87468f4San Mehat#define ATM_PTI_UCES1 3 /* user data cell, cong. experienced, SDU-type 1 */ 112dcfb7a77f8709125e97c313cb8ab6ec4d87468f4San Mehat#define ATM_PTI_SEGF5 4 /* segment OAM F5 flow related cell */ 113dcfb7a77f8709125e97c313cb8ab6ec4d87468f4San Mehat#define ATM_PTI_E2EF5 5 /* end-to-end OAM F5 flow related cell */ 114dcfb7a77f8709125e97c313cb8ab6ec4d87468f4San Mehat#define ATM_PTI_RSV_RM 6 /* reserved for traffic control/resource mgmt */ 115dcfb7a77f8709125e97c313cb8ab6ec4d87468f4San Mehat#define ATM_PTI_RSV 7 /* reserved */ 116dcfb7a77f8709125e97c313cb8ab6ec4d87468f4San Mehat/* END_PTI */ 117dcfb7a77f8709125e97c313cb8ab6ec4d87468f4San Mehat 118dcfb7a77f8709125e97c313cb8ab6ec4d87468f4San Mehat 119dcfb7a77f8709125e97c313cb8ab6ec4d87468f4San Mehat/* 120dcfb7a77f8709125e97c313cb8ab6ec4d87468f4San Mehat * The following items should stay in linux/atm.h, which should be linked to 121dcfb7a77f8709125e97c313cb8ab6ec4d87468f4San Mehat * netatm/atm.h 122dcfb7a77f8709125e97c313cb8ab6ec4d87468f4San Mehat */ 123dcfb7a77f8709125e97c313cb8ab6ec4d87468f4San Mehat 124dcfb7a77f8709125e97c313cb8ab6ec4d87468f4San Mehat/* Traffic description */ 125dcfb7a77f8709125e97c313cb8ab6ec4d87468f4San Mehat 126dcfb7a77f8709125e97c313cb8ab6ec4d87468f4San Mehat#define ATM_NONE 0 /* no traffic */ 127dcfb7a77f8709125e97c313cb8ab6ec4d87468f4San Mehat#define ATM_UBR 1 128dcfb7a77f8709125e97c313cb8ab6ec4d87468f4San Mehat#define ATM_CBR 2 129dcfb7a77f8709125e97c313cb8ab6ec4d87468f4San Mehat#define ATM_VBR 3 130dcfb7a77f8709125e97c313cb8ab6ec4d87468f4San Mehat#define ATM_ABR 4 131dcfb7a77f8709125e97c313cb8ab6ec4d87468f4San Mehat#define ATM_ANYCLASS 5 /* compatible with everything */ 132dcfb7a77f8709125e97c313cb8ab6ec4d87468f4San Mehat 133dcfb7a77f8709125e97c313cb8ab6ec4d87468f4San Mehat#define ATM_MAX_PCR -1 /* maximum available PCR */ 134dcfb7a77f8709125e97c313cb8ab6ec4d87468f4San Mehat 135dcfb7a77f8709125e97c313cb8ab6ec4d87468f4San Mehatstruct atm_trafprm { 136dcfb7a77f8709125e97c313cb8ab6ec4d87468f4San Mehat unsigned char traffic_class; /* traffic class (ATM_UBR, ...) */ 137dcfb7a77f8709125e97c313cb8ab6ec4d87468f4San Mehat int max_pcr; /* maximum PCR in cells per second */ 138dcfb7a77f8709125e97c313cb8ab6ec4d87468f4San Mehat int pcr; /* desired PCR in cells per second */ 139dcfb7a77f8709125e97c313cb8ab6ec4d87468f4San Mehat int min_pcr; /* minimum PCR in cells per second */ 140dcfb7a77f8709125e97c313cb8ab6ec4d87468f4San Mehat int max_cdv; /* maximum CDV in microseconds */ 141dcfb7a77f8709125e97c313cb8ab6ec4d87468f4San Mehat int max_sdu; /* maximum SDU in bytes */ 142dcfb7a77f8709125e97c313cb8ab6ec4d87468f4San Mehat /* extra params for ABR */ 143dcfb7a77f8709125e97c313cb8ab6ec4d87468f4San Mehat unsigned int icr; /* Initial Cell Rate (24-bit) */ 144dcfb7a77f8709125e97c313cb8ab6ec4d87468f4San Mehat unsigned int tbe; /* Transient Buffer Exposure (24-bit) */ 145dcfb7a77f8709125e97c313cb8ab6ec4d87468f4San Mehat unsigned int frtt : 24; /* Fixed Round Trip Time (24-bit) */ 146dcfb7a77f8709125e97c313cb8ab6ec4d87468f4San Mehat unsigned int rif : 4; /* Rate Increment Factor (4-bit) */ 147dcfb7a77f8709125e97c313cb8ab6ec4d87468f4San Mehat unsigned int rdf : 4; /* Rate Decrease Factor (4-bit) */ 148dcfb7a77f8709125e97c313cb8ab6ec4d87468f4San Mehat unsigned int nrm_pres :1; /* nrm present bit */ 149dcfb7a77f8709125e97c313cb8ab6ec4d87468f4San Mehat unsigned int trm_pres :1; /* rm present bit */ 150dcfb7a77f8709125e97c313cb8ab6ec4d87468f4San Mehat unsigned int adtf_pres :1; /* adtf present bit */ 151dcfb7a77f8709125e97c313cb8ab6ec4d87468f4San Mehat unsigned int cdf_pres :1; /* cdf present bit*/ 152dcfb7a77f8709125e97c313cb8ab6ec4d87468f4San Mehat unsigned int nrm :3; /* Max # of Cells for each forward RM cell (3-bit) */ 153dcfb7a77f8709125e97c313cb8ab6ec4d87468f4San Mehat unsigned int trm :3; /* Time between forward RM cells (3-bit) */ 154dcfb7a77f8709125e97c313cb8ab6ec4d87468f4San Mehat unsigned int adtf :10; /* ACR Decrease Time Factor (10-bit) */ 155dcfb7a77f8709125e97c313cb8ab6ec4d87468f4San Mehat unsigned int cdf :3; /* Cutoff Decrease Factor (3-bit) */ 156dcfb7a77f8709125e97c313cb8ab6ec4d87468f4San Mehat unsigned int spare :9; /* spare bits */ 157dcfb7a77f8709125e97c313cb8ab6ec4d87468f4San Mehat}; 158dcfb7a77f8709125e97c313cb8ab6ec4d87468f4San Mehat 159dcfb7a77f8709125e97c313cb8ab6ec4d87468f4San Mehatstruct atm_qos { 160dcfb7a77f8709125e97c313cb8ab6ec4d87468f4San Mehat struct atm_trafprm txtp; /* parameters in TX direction */ 161dcfb7a77f8709125e97c313cb8ab6ec4d87468f4San Mehat struct atm_trafprm rxtp __ATM_API_ALIGN; 162dcfb7a77f8709125e97c313cb8ab6ec4d87468f4San Mehat /* parameters in RX direction */ 163dcfb7a77f8709125e97c313cb8ab6ec4d87468f4San Mehat unsigned char aal __ATM_API_ALIGN; 164dcfb7a77f8709125e97c313cb8ab6ec4d87468f4San Mehat}; 165dcfb7a77f8709125e97c313cb8ab6ec4d87468f4San Mehat 166dcfb7a77f8709125e97c313cb8ab6ec4d87468f4San Mehat/* PVC addressing */ 167dcfb7a77f8709125e97c313cb8ab6ec4d87468f4San Mehat 168dcfb7a77f8709125e97c313cb8ab6ec4d87468f4San Mehat#define ATM_ITF_ANY -1 /* "magic" PVC address values */ 169dcfb7a77f8709125e97c313cb8ab6ec4d87468f4San Mehat#define ATM_VPI_ANY -1 170dcfb7a77f8709125e97c313cb8ab6ec4d87468f4San Mehat#define ATM_VCI_ANY -1 171dcfb7a77f8709125e97c313cb8ab6ec4d87468f4San Mehat#define ATM_VPI_UNSPEC -2 172dcfb7a77f8709125e97c313cb8ab6ec4d87468f4San Mehat#define ATM_VCI_UNSPEC -2 173dcfb7a77f8709125e97c313cb8ab6ec4d87468f4San Mehat 174dcfb7a77f8709125e97c313cb8ab6ec4d87468f4San Mehat 175dcfb7a77f8709125e97c313cb8ab6ec4d87468f4San Mehatstruct sockaddr_atmpvc { 176dcfb7a77f8709125e97c313cb8ab6ec4d87468f4San Mehat unsigned short sap_family; /* address family, AF_ATMPVC */ 177dcfb7a77f8709125e97c313cb8ab6ec4d87468f4San Mehat struct { /* PVC address */ 178dcfb7a77f8709125e97c313cb8ab6ec4d87468f4San Mehat short itf; /* ATM interface */ 179dcfb7a77f8709125e97c313cb8ab6ec4d87468f4San Mehat short vpi; /* VPI (only 8 bits at UNI) */ 180dcfb7a77f8709125e97c313cb8ab6ec4d87468f4San Mehat int vci; /* VCI (only 16 bits at UNI) */ 181dcfb7a77f8709125e97c313cb8ab6ec4d87468f4San Mehat } sap_addr __ATM_API_ALIGN; /* PVC address */ 182dcfb7a77f8709125e97c313cb8ab6ec4d87468f4San Mehat}; 183dcfb7a77f8709125e97c313cb8ab6ec4d87468f4San Mehat 184dcfb7a77f8709125e97c313cb8ab6ec4d87468f4San Mehat/* SVC addressing */ 185dcfb7a77f8709125e97c313cb8ab6ec4d87468f4San Mehat 186dcfb7a77f8709125e97c313cb8ab6ec4d87468f4San Mehat#define ATM_ESA_LEN 20 /* ATM End System Address length */ 187dcfb7a77f8709125e97c313cb8ab6ec4d87468f4San Mehat#define ATM_E164_LEN 12 /* maximum E.164 number length */ 188dcfb7a77f8709125e97c313cb8ab6ec4d87468f4San Mehat 189dcfb7a77f8709125e97c313cb8ab6ec4d87468f4San Mehat#define ATM_AFI_DCC 0x39 /* DCC ATM Format */ 190dcfb7a77f8709125e97c313cb8ab6ec4d87468f4San Mehat#define ATM_AFI_ICD 0x47 /* ICD ATM Format */ 191dcfb7a77f8709125e97c313cb8ab6ec4d87468f4San Mehat#define ATM_AFI_E164 0x45 /* E.164 ATM Format */ 192dcfb7a77f8709125e97c313cb8ab6ec4d87468f4San Mehat#define ATM_AFI_LOCAL 0x49 /* Local ATM Format */ 193dcfb7a77f8709125e97c313cb8ab6ec4d87468f4San Mehat 194dcfb7a77f8709125e97c313cb8ab6ec4d87468f4San Mehat#define ATM_AFI_DCC_GROUP 0xBD /* DCC ATM Group Format */ 195dcfb7a77f8709125e97c313cb8ab6ec4d87468f4San Mehat#define ATM_AFI_ICD_GROUP 0xC5 /* ICD ATM Group Format */ 196dcfb7a77f8709125e97c313cb8ab6ec4d87468f4San Mehat#define ATM_AFI_E164_GROUP 0xC3 /* E.164 ATM Group Format */ 197dcfb7a77f8709125e97c313cb8ab6ec4d87468f4San Mehat#define ATM_AFI_LOCAL_GROUP 0xC7 /* Local ATM Group Format */ 198dcfb7a77f8709125e97c313cb8ab6ec4d87468f4San Mehat 199dcfb7a77f8709125e97c313cb8ab6ec4d87468f4San Mehat#define ATM_LIJ_NONE 0 /* no leaf-initiated join */ 200dcfb7a77f8709125e97c313cb8ab6ec4d87468f4San Mehat#define ATM_LIJ 1 /* request joining */ 201dcfb7a77f8709125e97c313cb8ab6ec4d87468f4San Mehat#define ATM_LIJ_RPJ 2 /* set to root-prompted join */ 202dcfb7a77f8709125e97c313cb8ab6ec4d87468f4San Mehat#define ATM_LIJ_NJ 3 /* set to network join */ 203dcfb7a77f8709125e97c313cb8ab6ec4d87468f4San Mehat 204dcfb7a77f8709125e97c313cb8ab6ec4d87468f4San Mehat 205dcfb7a77f8709125e97c313cb8ab6ec4d87468f4San Mehatstruct sockaddr_atmsvc { 206dcfb7a77f8709125e97c313cb8ab6ec4d87468f4San Mehat unsigned short sas_family; /* address family, AF_ATMSVC */ 207dcfb7a77f8709125e97c313cb8ab6ec4d87468f4San Mehat struct { /* SVC address */ 208dcfb7a77f8709125e97c313cb8ab6ec4d87468f4San Mehat unsigned char prv[ATM_ESA_LEN];/* private ATM address */ 209dcfb7a77f8709125e97c313cb8ab6ec4d87468f4San Mehat char pub[ATM_E164_LEN+1]; /* public address (E.164) */ 210dcfb7a77f8709125e97c313cb8ab6ec4d87468f4San Mehat /* unused addresses must be bzero'ed */ 211dcfb7a77f8709125e97c313cb8ab6ec4d87468f4San Mehat char lij_type; /* role in LIJ call; one of ATM_LIJ* */ 212dcfb7a77f8709125e97c313cb8ab6ec4d87468f4San Mehat __u32 lij_id; /* LIJ call identifier */ 213dcfb7a77f8709125e97c313cb8ab6ec4d87468f4San Mehat } sas_addr __ATM_API_ALIGN; /* SVC address */ 214dcfb7a77f8709125e97c313cb8ab6ec4d87468f4San Mehat}; 215dcfb7a77f8709125e97c313cb8ab6ec4d87468f4San Mehat 216dcfb7a77f8709125e97c313cb8ab6ec4d87468f4San Mehat 217dcfb7a77f8709125e97c313cb8ab6ec4d87468f4San Mehatstatic __inline__ int atmsvc_addr_in_use(struct sockaddr_atmsvc addr) 218dcfb7a77f8709125e97c313cb8ab6ec4d87468f4San Mehat{ 219dcfb7a77f8709125e97c313cb8ab6ec4d87468f4San Mehat return *addr.sas_addr.prv || *addr.sas_addr.pub; 220dcfb7a77f8709125e97c313cb8ab6ec4d87468f4San Mehat} 221dcfb7a77f8709125e97c313cb8ab6ec4d87468f4San Mehat 222dcfb7a77f8709125e97c313cb8ab6ec4d87468f4San Mehat 223dcfb7a77f8709125e97c313cb8ab6ec4d87468f4San Mehatstatic __inline__ int atmpvc_addr_in_use(struct sockaddr_atmpvc addr) 224dcfb7a77f8709125e97c313cb8ab6ec4d87468f4San Mehat{ 225dcfb7a77f8709125e97c313cb8ab6ec4d87468f4San Mehat return addr.sap_addr.itf || addr.sap_addr.vpi || addr.sap_addr.vci; 226dcfb7a77f8709125e97c313cb8ab6ec4d87468f4San Mehat} 227dcfb7a77f8709125e97c313cb8ab6ec4d87468f4San Mehat 228dcfb7a77f8709125e97c313cb8ab6ec4d87468f4San Mehat 229dcfb7a77f8709125e97c313cb8ab6ec4d87468f4San Mehat/* 230dcfb7a77f8709125e97c313cb8ab6ec4d87468f4San Mehat * Some stuff for linux/sockios.h 231dcfb7a77f8709125e97c313cb8ab6ec4d87468f4San Mehat */ 232dcfb7a77f8709125e97c313cb8ab6ec4d87468f4San Mehat 233dcfb7a77f8709125e97c313cb8ab6ec4d87468f4San Mehatstruct atmif_sioc { 234dcfb7a77f8709125e97c313cb8ab6ec4d87468f4San Mehat int number; 235dcfb7a77f8709125e97c313cb8ab6ec4d87468f4San Mehat int length; 236dcfb7a77f8709125e97c313cb8ab6ec4d87468f4San Mehat void *arg; 237dcfb7a77f8709125e97c313cb8ab6ec4d87468f4San Mehat}; 238dcfb7a77f8709125e97c313cb8ab6ec4d87468f4San Mehat 239dcfb7a77f8709125e97c313cb8ab6ec4d87468f4San Mehat 240dcfb7a77f8709125e97c313cb8ab6ec4d87468f4San Mehattypedef unsigned short atm_backend_t; 241dcfb7a77f8709125e97c313cb8ab6ec4d87468f4San Mehat#endif 242