Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
0002 #ifndef _ATMMPC_H_
0003 #define _ATMMPC_H_
0004 
0005 #include <linux/atmapi.h>
0006 #include <linux/atmioc.h>
0007 #include <linux/atm.h>
0008 #include <linux/types.h>
0009 
0010 #define ATMMPC_CTRL _IO('a', ATMIOC_MPOA)
0011 #define ATMMPC_DATA _IO('a', ATMIOC_MPOA+1)
0012 
0013 #define MPC_SOCKET_INGRESS 1
0014 #define MPC_SOCKET_EGRESS  2
0015 
0016 struct atmmpc_ioc {
0017         int dev_num;
0018         __be32 ipaddr;              /* the IP address of the shortcut    */
0019         int type;                     /* ingress or egress                 */
0020 };
0021 
0022 typedef struct in_ctrl_info {
0023         __u8   Last_NHRP_CIE_code;
0024         __u8   Last_Q2931_cause_value;
0025         __u8   eg_MPC_ATM_addr[ATM_ESA_LEN];
0026         __be32  tag;
0027         __be32  in_dst_ip;      /* IP address this ingress MPC sends packets to */
0028         __u16  holding_time;
0029         __u32  request_id;
0030 } in_ctrl_info;
0031 
0032 typedef struct eg_ctrl_info {
0033         __u8   DLL_header[256];
0034         __u8   DH_length;
0035         __be32  cache_id;
0036         __be32  tag;
0037         __be32  mps_ip;
0038         __be32  eg_dst_ip;      /* IP address to which ingress MPC sends packets */
0039         __u8   in_MPC_data_ATM_addr[ATM_ESA_LEN];
0040         __u16  holding_time;
0041 } eg_ctrl_info;
0042 
0043 struct mpc_parameters {
0044         __u16 mpc_p1;   /* Shortcut-Setup Frame Count    */
0045         __u16 mpc_p2;   /* Shortcut-Setup Frame Time     */
0046         __u8 mpc_p3[8]; /* Flow-detection Protocols      */
0047         __u16 mpc_p4;   /* MPC Initial Retry Time        */
0048         __u16 mpc_p5;   /* MPC Retry Time Maximum        */
0049         __u16 mpc_p6;   /* Hold Down Time                */
0050 } ;
0051 
0052 struct k_message {
0053         __u16 type;
0054         __be32 ip_mask;
0055         __u8  MPS_ctrl[ATM_ESA_LEN];
0056         union {
0057                 in_ctrl_info in_info;
0058                 eg_ctrl_info eg_info;
0059                 struct mpc_parameters params;
0060         } content;
0061         struct atm_qos qos;       
0062 } __ATM_API_ALIGN;
0063 
0064 struct llc_snap_hdr {
0065     /* RFC 1483 LLC/SNAP encapsulation for routed IP PDUs */
0066         __u8  dsap;    /* Destination Service Access Point (0xAA)     */
0067         __u8  ssap;    /* Source Service Access Point      (0xAA)     */
0068         __u8  ui;      /* Unnumbered Information           (0x03)     */
0069         __u8  org[3];  /* Organizational identification    (0x000000) */
0070         __u8  type[2]; /* Ether type (for IP)              (0x0800)   */
0071 };
0072 
0073 /* TLVs this MPC recognizes */
0074 #define TLV_MPOA_DEVICE_TYPE         0x00a03e2a  
0075 
0076 /* MPOA device types in MPOA Device Type TLV */
0077 #define NON_MPOA    0
0078 #define MPS         1
0079 #define MPC         2
0080 #define MPS_AND_MPC 3
0081 
0082 
0083 /* MPC parameter defaults */
0084 
0085 #define MPC_P1 10  /* Shortcut-Setup Frame Count  */ 
0086 #define MPC_P2 1   /* Shortcut-Setup Frame Time   */
0087 #define MPC_P3 0   /* Flow-detection Protocols    */
0088 #define MPC_P4 5   /* MPC Initial Retry Time      */
0089 #define MPC_P5 40  /* MPC Retry Time Maximum      */
0090 #define MPC_P6 160 /* Hold Down Time              */
0091 #define HOLDING_TIME_DEFAULT 1200 /* same as MPS-p7 */
0092 
0093 /* MPC constants */
0094 
0095 #define MPC_C1 2   /* Retry Time Multiplier       */
0096 #define MPC_C2 60  /* Initial Keep-Alive Lifetime */
0097 
0098 /* Message types - to MPOA daemon */
0099 
0100 #define SND_MPOA_RES_RQST    201
0101 #define SET_MPS_CTRL_ADDR    202
0102 #define SND_MPOA_RES_RTRY    203 /* Different type in a retry due to req id         */
0103 #define STOP_KEEP_ALIVE_SM   204
0104 #define EGRESS_ENTRY_REMOVED 205
0105 #define SND_EGRESS_PURGE     206
0106 #define DIE                  207 /* tell the daemon to exit()                       */
0107 #define DATA_PLANE_PURGE     208 /* Data plane purge because of egress cache hit miss or dead MPS */
0108 #define OPEN_INGRESS_SVC     209
0109 
0110 /* Message types - from MPOA daemon */
0111 
0112 #define MPOA_TRIGGER_RCVD     101
0113 #define MPOA_RES_REPLY_RCVD   102
0114 #define INGRESS_PURGE_RCVD    103
0115 #define EGRESS_PURGE_RCVD     104
0116 #define MPS_DEATH             105
0117 #define CACHE_IMPOS_RCVD      106
0118 #define SET_MPC_CTRL_ADDR     107 /* Our MPC's control ATM address   */
0119 #define SET_MPS_MAC_ADDR      108
0120 #define CLEAN_UP_AND_EXIT     109
0121 #define SET_MPC_PARAMS        110 /* MPC configuration parameters    */
0122 
0123 /* Message types - bidirectional */       
0124 
0125 #define RELOAD                301 /* kill -HUP the daemon for reload */
0126 
0127 #endif /* _ATMMPC_H_ */