Dr Andrew Scott G7VAV

My photo
 
June 2025
Mo Tu We Th Fr Sa Su
26 27 28 29 30 31 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 1 2 3 4 5 6


atmmpc.h
001: #ifndef _ATMMPC_H_
002: #define _ATMMPC_H_
003: 
004: #include <linux/atmapi.h>
005: #include <linux/atmioc.h>
006: #include <linux/atm.h>
007: #include <linux/types.h>
008: 
009: #define ATMMPC_CTRL _IO('a', ATMIOC_MPOA)
010: #define ATMMPC_DATA _IO('a', ATMIOC_MPOA+1)
011: 
012: #define MPC_SOCKET_INGRESS 1
013: #define MPC_SOCKET_EGRESS  2
014: 
015: struct atmmpc_ioc {
016:         int dev_num;
017:         __be32 ipaddr;              /* the IP address of the shortcut    */
018:         int type;                     /* ingress or egress                 */
019: };
020: 
021: typedef struct in_ctrl_info {
022:         __u8   Last_NHRP_CIE_code;
023:         __u8   Last_Q2931_cause_value;
024:         __u8   eg_MPC_ATM_addr[ATM_ESA_LEN];
025:         __be32  tag;
026:         __be32  in_dst_ip;      /* IP address this ingress MPC sends packets to */
027:         __u16  holding_time;
028:         __u32  request_id;
029: } in_ctrl_info;
030: 
031: typedef struct eg_ctrl_info {
032:         __u8   DLL_header[256];
033:         __u8   DH_length;
034:         __be32  cache_id;
035:         __be32  tag;
036:         __be32  mps_ip;
037:         __be32  eg_dst_ip;      /* IP address to which ingress MPC sends packets */
038:         __u8   in_MPC_data_ATM_addr[ATM_ESA_LEN];
039:         __u16  holding_time;
040: } eg_ctrl_info;
041: 
042: struct mpc_parameters {
043:         __u16 mpc_p1;   /* Shortcut-Setup Frame Count    */
044:         __u16 mpc_p2;   /* Shortcut-Setup Frame Time     */
045:         __u8 mpc_p3[8]; /* Flow-detection Protocols      */
046:         __u16 mpc_p4;   /* MPC Initial Retry Time        */
047:         __u16 mpc_p5;   /* MPC Retry Time Maximum        */
048:         __u16 mpc_p6;   /* Hold Down Time                */
049: } ;
050: 
051: struct k_message {
052:         __u16 type;
053:         __be32 ip_mask;
054:         __u8  MPS_ctrl[ATM_ESA_LEN];
055:         union {
056:                 in_ctrl_info in_info;
057:                 eg_ctrl_info eg_info;
058:                 struct mpc_parameters params;
059:         } content;
060:         struct atm_qos qos;       
061: } __ATM_API_ALIGN;
062: 
063: struct llc_snap_hdr {
064:         /* RFC 1483 LLC/SNAP encapsulation for routed IP PDUs */
065:         __u8  dsap;    /* Destination Service Access Point (0xAA)     */
066:         __u8  ssap;    /* Source Service Access Point      (0xAA)     */
067:         __u8  ui;      /* Unnumbered Information           (0x03)     */
068:         __u8  org[3];  /* Organizational identification    (0x000000) */
069:         __u8  type[2]; /* Ether type (for IP)              (0x0800)   */
070: };
071: 
072: /* TLVs this MPC recognizes */
073: #define TLV_MPOA_DEVICE_TYPE         0x00a03e2a  
074: 
075: /* MPOA device types in MPOA Device Type TLV */
076: #define NON_MPOA    0
077: #define MPS         1
078: #define MPC         2
079: #define MPS_AND_MPC 3
080: 
081: 
082: /* MPC parameter defaults */
083: 
084: #define MPC_P1 10  /* Shortcut-Setup Frame Count  */ 
085: #define MPC_P2 1   /* Shortcut-Setup Frame Time   */
086: #define MPC_P3 0   /* Flow-detection Protocols    */
087: #define MPC_P4 5   /* MPC Initial Retry Time      */
088: #define MPC_P5 40  /* MPC Retry Time Maximum      */
089: #define MPC_P6 160 /* Hold Down Time              */
090: #define HOLDING_TIME_DEFAULT 1200 /* same as MPS-p7 */
091: 
092: /* MPC constants */
093: 
094: #define MPC_C1 2   /* Retry Time Multiplier       */
095: #define MPC_C2 60  /* Initial Keep-Alive Lifetime */
096: 
097: /* Message types - to MPOA daemon */
098: 
099: #define SND_MPOA_RES_RQST    201
100: #define SET_MPS_CTRL_ADDR    202
101: #define SND_MPOA_RES_RTRY    203 /* Different type in a retry due to req id         */
102: #define STOP_KEEP_ALIVE_SM   204
103: #define EGRESS_ENTRY_REMOVED 205
104: #define SND_EGRESS_PURGE     206
105: #define DIE                  207 /* tell the daemon to exit()                       */
106: #define DATA_PLANE_PURGE     208 /* Data plane purge because of egress cache hit miss or dead MPS */
107: #define OPEN_INGRESS_SVC     209
108: 
109: /* Message types - from MPOA daemon */
110: 
111: #define MPOA_TRIGGER_RCVD     101
112: #define MPOA_RES_REPLY_RCVD   102
113: #define INGRESS_PURGE_RCVD    103
114: #define EGRESS_PURGE_RCVD     104
115: #define MPS_DEATH             105
116: #define CACHE_IMPOS_RCVD      106
117: #define SET_MPC_CTRL_ADDR     107 /* Our MPC's control ATM address   */
118: #define SET_MPS_MAC_ADDR      108
119: #define CLEAN_UP_AND_EXIT     109
120: #define SET_MPC_PARAMS        110 /* MPC configuration parameters    */
121: 
122: /* Message types - bidirectional */       
123: 
124: #define RELOAD                301 /* kill -HUP the daemon for reload */
125: 
126: #endif /* _ATMMPC_H_ */
127: 


for client (none)
© Andrew Scott 2006 - 2025,
All Rights Reserved
http://www.andrew-scott.uk/
Andrew Scott
http://www.andrew-scott.co.uk/