1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-23 11:18:54 +00:00
freebsd/sys/netatm/atm_ioctl.h

439 lines
13 KiB
C
Raw Normal View History

/*
*
* ===================================
* HARP | Host ATM Research Platform
* ===================================
*
*
* This Host ATM Research Platform ("HARP") file (the "Software") is
* made available by Network Computing Services, Inc. ("NetworkCS")
* "AS IS". NetworkCS does not provide maintenance, improvements or
* support of any kind.
*
* NETWORKCS MAKES NO WARRANTIES OR REPRESENTATIONS, EXPRESS OR IMPLIED,
* INCLUDING, BUT NOT LIMITED TO, IMPLIED WARRANTIES OF MERCHANTABILITY
* AND FITNESS FOR A PARTICULAR PURPOSE, AS TO ANY ELEMENT OF THE
* SOFTWARE OR ANY SUPPORT PROVIDED IN CONNECTION WITH THIS SOFTWARE.
* In no event shall NetworkCS be responsible for any damages, including
* but not limited to consequential damages, arising from or relating to
* any use of the Software or related support.
*
* Copyright 1994-1998 Network Computing Services, Inc.
*
* Copies of this Software may be made, however, the above copyright
* notice must be reproduced on all copies.
*
1999-08-28 01:08:13 +00:00
* @(#) $FreeBSD$
*
*/
/*
* Core ATM Services
* -----------------
*
* PF_ATM socket ioctl definitions
*
*/
#ifndef _NETATM_ATM_IOCTL_H
#define _NETATM_ATM_IOCTL_H
/*
* Structure for PF_ATM configure (AIOCCFG) socket ioctls
*/
struct atmcfgreq {
int acr_opcode; /* Sub-operation */
union {
struct {
/* Configure - attach */
char acru_att_intf[IFNAMSIZ];/* Interface name */
u_char acru_att_proto; /* Signalling protocol */
} acru_att;
struct {
/* Configure - detach */
char acru_det_intf[IFNAMSIZ];/* Interface name */
} acru_det;
} acr_u;
};
#define acr_att_intf acr_u.acru_att.acru_att_intf
#define acr_att_proto acr_u.acru_att.acru_att_proto
#define acr_det_intf acr_u.acru_det.acru_det_intf
/*
* Structure for PF_ATM set (AIOCSET) socket ioctls
*/
struct atmsetreq {
int asr_opcode; /* Sub-operation */
union {
/* ARP server */
struct {
char asru_arp_intf[IFNAMSIZ];/* Interface name */
Atm_addr asru_arp_addr; /* ARP srvr address */
Atm_addr asru_arp_subaddr;/* ARP srvr subaddr */
caddr_t asru_arp_pbuf; /* Prefix buffer addr */
size_t asru_arp_plen; /* Prefix buffer len */
} asru_asrvr;
/* MAC address */
struct {
char asru_mac_intf[IFNAMSIZ];/* Interface name */
struct mac_addr asru_mac_addr; /* MAC address */
} asru_mac;
/* Network interface */
struct {
char asru_nif_intf[IFNAMSIZ];/* Interface name */
char asru_nif_pref[IFNAMSIZ];/* I/f prefix name */
u_int asru_nif_cnt; /* Number of i/fs */
} asru_nif;
/* NSAP prefix */
struct {
char asru_prf_intf[IFNAMSIZ];/* Interface name */
u_char asru_prf_pref[13]; /* NSAP prefix */
} asru_prf;
} asr_u;
};
#define asr_arp_intf asr_u.asru_asrvr.asru_arp_intf
#define asr_arp_addr asr_u.asru_asrvr.asru_arp_addr
#define asr_arp_pbuf asr_u.asru_asrvr.asru_arp_pbuf
#define asr_arp_plen asr_u.asru_asrvr.asru_arp_plen
#define asr_arp_subaddr asr_u.asru_asrvr.asru_arp_subaddr
#define asr_mac_intf asr_u.asru_mac.asru_mac_intf
#define asr_mac_addr asr_u.asru_mac.asru_mac_addr
#define asr_nif_intf asr_u.asru_nif.asru_nif_intf
#define asr_nif_pref asr_u.asru_nif.asru_nif_pref
#define asr_nif_cnt asr_u.asru_nif.asru_nif_cnt
#define asr_prf_intf asr_u.asru_prf.asru_prf_intf
#define asr_prf_pref asr_u.asru_prf.asru_prf_pref
/*
* Structure for PF_ATM add (AIOCADD) socket ioctls
*/
struct atmaddreq {
int aar_opcode; /* Sub-operation */
union {
/* Add PVC */
struct {
char aaru_pvc_intf[IFNAMSIZ];/* Interface name */
u_short aaru_pvc_vpi; /* VPI value */
u_short aaru_pvc_vci; /* VCI value */
struct sockaddr aaru_pvc_dst; /* Destination addr */
Sap_t aaru_pvc_sap; /* Endpoint SAP */
Aal_t aaru_pvc_aal; /* AAL */
Encaps_t aaru_pvc_encaps; /* Encapsulation */
u_char aaru_pvc_flags; /* Flags (see below) */
uint8_t aaru_pvc_traffic_type; /* traffic type */
struct t_atm_traffic aaru_pvc_traffic; /* traffic parameters */
} aaru_add_pvc;
/* Add ARP table entry */
struct {
char aaru_arp_intf[IFNAMSIZ];/* Interface name */
struct sockaddr aaru_arp_dst; /* IP addr */
Atm_addr aaru_arp_addr; /* ATM addr */
u_char aaru_arp_origin; /* Entry origin */
} aaru_add_arp;
} aar_u;
};
#define aar_pvc_intf aar_u.aaru_add_pvc.aaru_pvc_intf
#define aar_pvc_vpi aar_u.aaru_add_pvc.aaru_pvc_vpi
#define aar_pvc_vci aar_u.aaru_add_pvc.aaru_pvc_vci
#define aar_pvc_dst aar_u.aaru_add_pvc.aaru_pvc_dst
#define aar_pvc_sap aar_u.aaru_add_pvc.aaru_pvc_sap
#define aar_pvc_aal aar_u.aaru_add_pvc.aaru_pvc_aal
#define aar_pvc_encaps aar_u.aaru_add_pvc.aaru_pvc_encaps
#define aar_pvc_flags aar_u.aaru_add_pvc.aaru_pvc_flags
#define aar_pvc_traffic_type aar_u.aaru_add_pvc.aaru_pvc_traffic_type
#define aar_pvc_traffic aar_u.aaru_add_pvc.aaru_pvc_traffic
#define aar_arp_intf aar_u.aaru_add_arp.aaru_arp_intf
#define aar_arp_dst aar_u.aaru_add_arp.aaru_arp_dst
#define aar_arp_addr aar_u.aaru_add_arp.aaru_arp_addr
#define aar_arp_origin aar_u.aaru_add_arp.aaru_arp_origin
/* PVC flags */
#define PVC_DYN 0x01 /* Dest addr is dynamic */
/*
* Structure for PF_ATM delete (AIOCDEL) socket ioctls
*/
struct atmdelreq {
int adr_opcode; /* Sub-operation */
union {
/* Delete PVC */
struct {
char adru_pvc_intf[IFNAMSIZ];/* Interface name */
u_short adru_pvc_vpi; /* VPI value */
u_short adru_pvc_vci; /* VCI value */
} adru_del_pvc;
/* Delete SVC */
struct {
char adru_svc_intf[IFNAMSIZ];/* Interface name */
u_short adru_svc_vpi; /* VPI value */
u_short adru_svc_vci; /* VCI value */
} adru_del_svc;
/* Delete ARP table entry */
struct {
char adru_arp_intf[IFNAMSIZ];/* Interface name */
struct sockaddr adru_arp_dst; /* IP addr */
} adru_del_arp;
} adr_u;
};
#define adr_pvc_intf adr_u.adru_del_pvc.adru_pvc_intf
#define adr_pvc_vpi adr_u.adru_del_pvc.adru_pvc_vpi
#define adr_pvc_vci adr_u.adru_del_pvc.adru_pvc_vci
#define adr_svc_intf adr_u.adru_del_svc.adru_svc_intf
#define adr_svc_vpi adr_u.adru_del_svc.adru_svc_vpi
#define adr_svc_vci adr_u.adru_del_svc.adru_svc_vci
#define adr_arp_intf adr_u.adru_del_arp.adru_arp_intf
#define adr_arp_dst adr_u.adru_del_arp.adru_arp_dst
/*
* Structure for PF_ATM information (AIOCINFO) socket ioctls
*/
struct atminfreq {
int air_opcode; /* Sub-operation */
caddr_t air_buf_addr; /* Buffer for returned info */
size_t air_buf_len; /* Buffer length */
union {
/* Vendor info */
char airu_vinfo_intf[IFNAMSIZ];/* Interface name */
/* IP VCC */
struct sockaddr airu_ip_addr; /* Destination host */
/* ARP table */
struct {
struct sockaddr airu_arp_addr; /* Destination host */
u_char airu_arp_flags; /* Flags (see below) */
} airu_arp;
/* ARP server */
char airu_asrv_intf[IFNAMSIZ];/* Interface name */
/* Interface */
char airu_int_intf[IFNAMSIZ];/* Interface name */
/* VCC */
char airu_vcc_intf[IFNAMSIZ];/* Interface name */
/* Configuration */
char airu_cfg_intf[IFNAMSIZ];/* Interface name */
/* Network interface */
char airu_netif_intf[IFNAMSIZ];/* Interface name */
/* Physical interface statistics */
char airu_physt_intf[IFNAMSIZ];/* Interface name */
} air_u;
};
#define air_vinfo_intf air_u.airu_vinfo_intf
#define air_ip_addr air_u.airu_ip_addr
#define air_arp_addr air_u.airu_arp.airu_arp_addr
#define air_arp_flags air_u.airu_arp.airu_arp_flags
#define air_asrv_intf air_u.airu_asrv_intf
#define air_int_intf air_u.airu_int_intf
#define air_vcc_intf air_u.airu_vcc_intf
#define air_cfg_intf air_u.airu_cfg_intf
#define air_netif_intf air_u.airu_netif_intf
#define air_physt_intf air_u.airu_physt_intf
/* ARP table info flags */
#define ARP_RESET_REF 0x01 /* Reset refresh status */
/*
* Structures returned by information requests
*/
/*
* Vendor-specific interface information
*/
struct air_vinfo_rsp {
char avsp_intf[IFNAMSIZ]; /* Interface name */
size_t avsp_len; /* Length of returned
Vendor Info block */
/* Vendor info ... */
};
/*
* ARP table information
*/
struct air_arp_rsp {
struct sockaddr aap_arp_addr; /* Destination host */
char aap_intf[IFNAMSIZ]; /* Interface name */
u_char aap_flags; /* Flags (see below) */
u_char aap_origin; /* Entry origin (see below) */
u_char aap_age; /* Aging timeout (minutes) */
Atm_addr aap_addr; /* ATM address */
Atm_addr aap_subaddr; /* ATM subaddress */
};
/*
* ARP entry flags
*/
#define ARPF_VALID 0x01 /* Entry is valid */
#define ARPF_REFRESH 0x02 /* Entry has been refreshed */
/*
* ARP entry origin
*/
#define ARP_ORIG_PERM 50 /* Permanent entry */
/*
* IP VCC information
*/
struct air_ip_vcc_rsp {
struct sockaddr aip_dst_addr; /* Destination host */
char aip_intf[IFNAMSIZ]; /* Interface name */
u_short aip_vpi; /* VPI value */
u_short aip_vci; /* VCI value */
u_char aip_sig_proto; /* Signalling protocol */
u_char aip_flags; /* Flags (IVF_*) */
u_char aip_state; /* IP VCC state */
};
/*
* ARP server information
*/
struct air_asrv_rsp {
char asp_intf[IFNAMSIZ]; /* Interface name */
Atm_addr asp_addr; /* Server ATM address */
Atm_addr asp_subaddr; /* Server ATM subaddress */
int asp_state; /* Server state */
int asp_nprefix; /* Number of prefix entries */
};
/*
* Interface information
*/
struct air_int_rsp {
char anp_intf[IFNAMSIZ]; /* Interface name */
Atm_addr anp_addr; /* ATM address */
Atm_addr anp_subaddr; /* ATM subaddress */
u_char anp_sig_proto; /* Signalling protocol */
u_char anp_sig_state; /* Signalling protocol state */
char anp_nif_pref[IFNAMSIZ]; /* Netif prefix */
u_int anp_nif_cnt; /* No. of netifs */
};
/*
* Network interface information
*/
struct air_netif_rsp {
char anp_intf[IFNAMSIZ]; /* Interface name */
struct sockaddr anp_proto_addr; /* Protocol address */
char anp_phy_intf[IFNAMSIZ]; /* Interface name */
};
/*
* VCC information
* Todo: add avp_traffic_type and avp_traffic. Update unisig_if.c,
* spans_if.c and sigpvc_if.c
*/
#define O_CNT 8
struct air_vcc_rsp {
char avp_intf[IFNAMSIZ]; /* Interface name */
u_short avp_vpi; /* VPI value */
u_short avp_vci; /* VCI value */
u_char avp_type; /* Type (SVC or PVC) */
u_char avp_aal; /* AAL */
u_char avp_sig_proto; /* Signalling protocol */
Encaps_t avp_encaps; /* Encapsulation */
u_char avp_state; /* State (sig mgr specific) */
char avp_owners[(T_ATM_APP_NAME_LEN+1)*O_CNT];/* VCC users */
Atm_addr avp_daddr; /* Address of far end */
Atm_addr avp_dsubaddr; /* Subaddress of far end */
u_long avp_ipdus; /* PDUs received from VCC */
u_long avp_opdus; /* PDUs sent to VCC */
u_long avp_ibytes; /* Bytes received from VCC */
u_long avp_obytes; /* Bytes sent to VCC */
u_long avp_ierrors; /* Errors receiving from VCC */
u_long avp_oerrors; /* Errors sending to VCC */
time_t avp_tstamp; /* State transition timestamp */
};
/*
* Adapter configuration information
*/
struct air_cfg_rsp {
char acp_intf[IFNAMSIZ]; /* Interface name */
Atm_config acp_cfg; /* Config info */
};
#define acp_vendor acp_cfg.ac_vendor
#define acp_vendapi acp_cfg.ac_vendapi
#define acp_device acp_cfg.ac_device
#define acp_media acp_cfg.ac_media
#define acp_serial acp_cfg.ac_serial
#define acp_bustype acp_cfg.ac_bustype
#define acp_busslot acp_cfg.ac_busslot
#define acp_ram acp_cfg.ac_ram
#define acp_ramsize acp_cfg.ac_ramsize
#define acp_macaddr acp_cfg.ac_macaddr
#define acp_hard_vers acp_cfg.ac_hard_vers
#define acp_firm_vers acp_cfg.ac_firm_vers
/*
* Version information
*/
struct air_version_rsp {
int avp_version; /* Software version */
};
/*
* Physical interface statistics
*/
struct air_phy_stat_rsp {
char app_intf[IFNAMSIZ]; /* Interface name */
u_quad_t app_ipdus; /* PDUs received from I/F */
u_quad_t app_opdus; /* PDUs sent to I/F */
u_quad_t app_ibytes; /* Bytes received from I/F */
u_quad_t app_obytes; /* Bytes sent to I/F */
u_quad_t app_ierrors; /* Errors receiving from I/F */
u_quad_t app_oerrors; /* Errors sending to I/F */
u_quad_t app_cmderrors; /* I/F command errors */
};
/*
* PF_ATM sub-operation codes
*/
#define AIOCS_CFG_ATT 1
#define AIOCS_CFG_DET 2
#define AIOCS_ADD_PVC 32
#define AIOCS_ADD_ARP 33
#define AIOCS_DEL_PVC 64
#define AIOCS_DEL_SVC 65
#define AIOCS_DEL_ARP 66
#define AIOCS_SET_ASV 96
#define AIOCS_SET_NIF 97
#define AIOCS_SET_PRF 98
#define AIOCS_SET_MAC 99
#define AIOCS_INF_VST 160
#define AIOCS_INF_IPM 161
#define AIOCS_INF_ARP 162
#define AIOCS_INF_ASV 163
#define AIOCS_INF_INT 164
#define AIOCS_INF_VCC 165
#define AIOCS_INF_CFG 166
#define AIOCS_INF_NIF 167
#define AIOCS_INF_PIS 168
#define AIOCS_INF_VER 169
/*
* PF_ATM ioctls
*/
These are changes to allow to use the Intel C/C++ compiler (lang/icc) to build the kernel. It doesn't affect the operation if gcc. Most of the changes are just adding __INTEL_COMPILER to #ifdef's, as icc v8 may define __GNUC__ some parts may look strange but are necessary. Additional changes: - in_cksum.[ch]: * use a generic C version instead of the assembly version in the !gcc case (ASM code breaks with the optimizations icc does) -> no bad checksums with an icc compiled kernel Help from: andre, grehan, das Stolen from: alpha version via ppc version The entire checksum code should IMHO be replaced with the DragonFly version (because it isn't guaranteed future revisions of gcc will include similar optimizations) as in: ---snip--- Revision Changes Path 1.12 +1 -0 src/sys/conf/files.i386 1.4 +142 -558 src/sys/i386/i386/in_cksum.c 1.5 +33 -69 src/sys/i386/include/in_cksum.h 1.5 +2 -0 src/sys/netinet/igmp.c 1.6 +0 -1 src/sys/netinet/in.h 1.6 +2 -0 src/sys/netinet/ip_icmp.c 1.4 +3 -4 src/contrib/ipfilter/ip_compat.h 1.3 +1 -2 src/sbin/natd/icmp.c 1.4 +0 -1 src/sbin/natd/natd.c 1.48 +1 -0 src/sys/conf/files 1.2 +0 -1 src/sys/conf/files.amd64 1.13 +0 -1 src/sys/conf/files.i386 1.5 +0 -1 src/sys/conf/files.pc98 1.7 +1 -1 src/sys/contrib/ipfilter/netinet/fil.c 1.10 +2 -3 src/sys/contrib/ipfilter/netinet/ip_compat.h 1.10 +1 -1 src/sys/contrib/ipfilter/netinet/ip_fil.c 1.7 +1 -1 src/sys/dev/netif/txp/if_txp.c 1.7 +1 -1 src/sys/net/ip_mroute/ip_mroute.c 1.7 +1 -2 src/sys/net/ipfw/ip_fw2.c 1.6 +1 -2 src/sys/netinet/igmp.c 1.4 +158 -116 src/sys/netinet/in_cksum.c 1.6 +1 -1 src/sys/netinet/ip_gre.c 1.7 +1 -2 src/sys/netinet/ip_icmp.c 1.10 +1 -1 src/sys/netinet/ip_input.c 1.10 +1 -2 src/sys/netinet/ip_output.c 1.13 +1 -2 src/sys/netinet/tcp_input.c 1.9 +1 -2 src/sys/netinet/tcp_output.c 1.10 +1 -1 src/sys/netinet/tcp_subr.c 1.10 +1 -1 src/sys/netinet/tcp_syncache.c 1.9 +1 -2 src/sys/netinet/udp_usrreq.c 1.5 +1 -2 src/sys/netinet6/ipsec.c 1.5 +1 -2 src/sys/netproto/ipsec/ipsec.c 1.5 +1 -1 src/sys/netproto/ipsec/ipsec_input.c 1.4 +1 -2 src/sys/netproto/ipsec/ipsec_output.c and finally remove sys/i386/i386 in_cksum.c sys/i386/include in_cksum.h ---snip--- - endian.h: * DTRT in C++ mode - quad.h: * we don't use gcc v1 anymore, remove support for it Suggested by: bde (long ago) - assym.h: * avoid zero-length arrays (remove dependency on a gcc specific feature) This change changes the contents of the object file, but as it's only used to generate some values for a header, and the generator knows how to handle this, there's no impact in the gcc case. Explained by: bde Submitted by: Marius Strobl <marius@alchemy.franken.de> - aicasm.c: * minor change to teach it about the way icc spells "-nostdinc" Not approved by: gibbs (no reply to my mail) - bump __FreeBSD_version (lang/icc needs to know about the changes) Incarnations of this patch survive gcc compiles since a loooong time, I use it on my desktop. An icc compiled kernel works since Nov. 2003 (exceptions: snd_* if used as modules), it survives a build of the entire ports collection with icc. Parts of this commit contains suggestions or submissions from Marius Strobl <marius@alchemy.franken.de>. Reviewed by: -arch Submitted by: netchild
2004-03-12 21:45:33 +00:00
#if !(defined(__GNUC__) || defined(__INTEL_COMPILER))
#define AIOCCFG _IOW(A, 128, struct atmcfgreq) /* Configure i/f */
#define AIOCADD _IOW(A, 129, struct atmaddreq) /* Add (e.g. PVC) */
#define AIOCDEL _IOW(A, 130, struct atmdelreq) /* Delete */
#define AIOCSET _IOW(A, 132, struct atmsetreq) /* Set (e.g. net i/f) */
#define AIOCINFO _IOWR(A, 133, struct atminfreq) /* Show kernel info */
#else
#define AIOCCFG _IOW('A', 128, struct atmcfgreq)/* Configure i/f */
#define AIOCADD _IOW('A', 129, struct atmaddreq)/* Add (e.g. PVC) */
#define AIOCDEL _IOW('A', 130, struct atmdelreq)/* Delete */
#define AIOCSET _IOW('A', 132, struct atmsetreq)/* Set (e.g. net i/f) */
#define AIOCINFO _IOWR('A', 133, struct atminfreq)/* Show kernel info */
#endif
#endif /* _NETATM_ATM_IOCTL_H */