OpenSS7 STREAMS Interface
This subsection contains a listing of the SDLI header files needed by implementations of both SDL user and SDL provider software.
/*****************************************************************************
 @(#) $Id: lmi.h,v 0.7.2.6 2001/02/03 05:48:58 brian Exp $
 -----------------------------------------------------------------------------
 Copyright (C) 1997-2001  Brian Bidulock <bidulock@dallas.net>
 All Rights Reserved.
 This program is free software; you can redistribute it and/or modify it under
 the terms of the GNU General Public License as published by the Free Software
 Foundation; either version 2 of the License, or (at your option) any later
 version.
 This program is distributed in the hope that it will be useful, but WITHOUT
 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
 details.
 You should have received a copy of the GNU General Public License along with
 this program; if not, write to the Free Software Foundation, Inc., 675 Mass
 Ave, Cambridge, MA 02139, USA.
 -----------------------------------------------------------------------------
 Last Modified $Date: 2001/02/03 05:48:58 $ by $Author: brian $
 *****************************************************************************/
#ifndef __LMI_H__
#define __LMI_H__
#define LMI_PROTO_BASE       0L
#define LMI_DSTR_FIRST      ( 1L + LMI_PROTO_BASE )
#define LMI_INFO_REQ        ( 1L + LMI_PROTO_BASE )
#define LMI_ATTACH_REQ      ( 2L + LMI_PROTO_BASE )
#define LMI_DETACH_REQ      ( 3L + LMI_PROTO_BASE )
#define LMI_ENABLE_REQ      ( 4L + LMI_PROTO_BASE )
#define LMI_DISABLE_REQ     ( 5L + LMI_PROTO_BASE )
#define LMI_DSTR_LAST       ( 5L + LMI_PROTO_BASE )
#define LMI_USTR_LAST       (-1L - LMI_PROTO_BASE )
#define LMI_INFO_ACK        (-1L - LMI_PROTO_BASE )
#define LMI_OK_ACK          (-2L - LMI_PROTO_BASE )
#define LMI_ERROR_ACK       (-3L - LMI_PROTO_BASE )
#define LMI_ENABLE_CON      (-4L - LMI_PROTO_BASE )
#define LMI_DISABLE_CON     (-5L - LMI_PROTO_BASE )
#define LMI_ERROR_IND       (-6L - LMI_PROTO_BASE )
#define LMI_STATS_IND       (-7L - LMI_PROTO_BASE )
#define LMI_EVENT_IND       (-8L - LMI_PROTO_BASE )
#define LMI_USTR_FIRST      (-8L - LMI_PROTO_BASE )
#define LMI_UNATTACHED       1L     /* No PPA attached, awating LMI_ATTACH_REQ      */
#define LMI_ATTACH_PENDING   2L     /* Waiting for attach                           */
#define LMI_UNUSABLE         3L     /* Device cannot be used, STREAM in hung state  */
#define LMI_DISABLED         4L     /* PPA attached, awaiting LMI_ENABLE_REQ        */
#define LMI_ENABLE_PENDING   5L     /* Waiting to send LMI_ENABLE_CON               */
#define LMI_ENABLED          6L     /* Ready for use, awaiting primtiive exchange   */
#define LMI_DISABLE_PENDING  7L     /* Waiting to send LMI_DISABLE_CON              */
#define LMI_DETACH_PENDING   8L     /* Waiting for detach                           */
/*
 *  LMI_ERROR_ACK and LMI_ERROR_IND reason codes
 */
#define LMI_UNSPEC         0x00000000 /* Unknown or unspecified                   */
#define LMI_BADADDRESS     0x00010000 /* Address was invalid                      */
#define LMI_BADADDRTYPE    0x00020000 /* Invalid address type                     */
#define LMI_BADDIAL        0x00030000 /* (not used)                               */
#define LMI_BADDIALTYPE    0x00040000 /* (not used)                               */
#define LMI_BADDISPOSAL    0x00050000 /* Invalid disposal parameter               */
#define LMI_BADFRAME       0x00060000 /* Defective SDU received                   */
#define LMI_BADPPA         0x00070000 /* Invalid PPA identifier                   */
#define LMI_BADPRIM        0x00080000 /* Unregognized primitive                   */
#define LMI_DISC           0x00090000 /* Disconnected                             */
#define LMI_EVENT          0x000a0000 /* Protocol-specific event ocurred          */
#define LMI_FATALERR       0x000b0000 /* Device has become unusable               */
#define LMI_INITFAILED     0x000c0000 /* Link initialization failed               */
#define LMI_NOTSUPP        0x000d0000 /* Primitive not supported by this device   */
#define LMI_OUTSTATE       0x000e0000 /* Primitive was issued from invalid state  */
#define LMI_PROTOSHORT     0x000f0000 /* M_PROTO block too short                  */
#define LMI_SYSERR         0x00100000 /* UNIX system error                        */
#define LMI_WRITEFAIL      0x00110000 /* Unitdata request failed                  */
#define LMI_CRCERR         0x00120000 /* CRC or FCS error                         */
#define LMI_DLE_EOT        0x00130000 /* DLE EOT detected                         */
#define LMI_FORMAT         0x00140000 /* Format error detected                    */
#define LMI_HDLC_ABORT     0x00150000 /* Aborted frame detected                   */
#define LMI_OVERRUN        0x00160000 /* Input overrun                            */
#define LMI_TOOSHORT       0x00170000 /* Frame too short                          */
#define LMI_INCOMPLETE     0x00180000 /* Partial frame received                   */
#define LMI_BUSY           0x00190000 /* Telephone was busy                       */
#define LMI_NOANSWER       0x001a0000 /* Connection went unanswered               */
#define LMI_CALLREJECT     0x001b0000 /* Connection rejected                      */
#define LMI_HDLC_IDLE      0x001c0000 /* HDLC line went idle                      */
#define LMI_HDLC_NOTIDLE   0x001d0000 /* HDLC link no longer idle                 */
#define LMI_QUIESCENT      0x001e0000 /* Line being reassigned                    */
#define LMI_RESUMED        0x001f0000 /* Line has been reassigned                 */
#define LMI_DSRTIMEOUT     0x00200000 /* Did not see DSR in time                  */
#define LMI_LAN_COLLISIONS 0x00210000 /* LAN excessive collisions                 */
#define LMI_LAN_REFUSED    0x00220000 /* LAN message refused                      */
#define LMI_LAN_NOSTATION  0x00230000 /* LAN no such station                      */
#define LMI_LOSTCTS        0x00240000 /* Lost Clear to Send signal                */
#define LMI_DEVERR         0x00250000 /* Start of device-specific error codes     */
typedef   signed long  lmi_long;
typedef unsigned long  lmi_ulong;
typedef unsigned short lmi_ushort;
typedef unsigned char  lmi_uchar;
/*
 *  LOCAL MANAGEMENT PRIMITIVES
 */
/* LMI_INFO_REQ, M_PROTO or M_PCPROTO */
typedef struct {
    lmi_long    lmi_primitive;  /* LMI_INFO_REQ */
} lmi_info_req_t;
/* LMI_INFO_ACK, M_PROTO or M_PCPROTO */
typedef struct {
    lmi_long    lmi_primitive;  /* LMI_INFO_ACK */
    lmi_ulong   lmi_version;
    lmi_ulong   lmi_state;
    lmi_ulong   lmi_max_sdu;
    lmi_ulong   lmi_min_sdu;
    lmi_ulong   lmi_header_len;
    lmi_ulong   lmi_ppa_style;
    lmi_uchar   lmi_ppa_addr[0];
} lmi_info_ack_t;
/*
 *  LMI provider style.
 *
 *  The LMI provider style which determines whether a provider requires an
 *  LMI_ATTACH_REQ to inform the provider which PPA user messages should be
 *  sent/received on.
 */
#define LMI_STYLE1  0x00    /* PPA is implicitly bound by open(2) */
#define LMI_STYLE2  0x01    /* PPA must be explicitly bound via STD_ATTACH_REQ */
/* LMI_ATTACH_REQ, M_PROTO or M_PCPROTO */
typedef struct {
    lmi_long    lmi_primitive;  /* LMI_ATTACH_REQ */
    lmi_uchar   lmi_ppa[0];
} lmi_attach_req_t;
/* LMI_DETACH_REQ, M_PROTO or M_PCPROTO */
typedef struct {
    lmi_long    lmi_primitive;  /* LMI_DETACH_REQ */
} lmi_detach_req_t;
/* LMI_ENABLE_REQ, M_PROTO or M_PCPROTO */
typedef struct {
    lmi_long    lmi_primitive;  /* LMI_ENABLE_REQ */
} lmi_enable_req_t;
/* LMI_DISABLE_REQ, M_PROTO or M_PCPROTO */
typedef struct {
    lmi_long    lmi_primitive;  /* LMI_DISABLE_REQ */
} lmi_disable_req_t;
/* LMI_OK_ACK, M_PROTO or M_PCPROTO */
typedef struct {
    lmi_long    lmi_primitive;  /* LMI_OK_ACK */
    lmi_ulong   lmi_correct_primitive;
    lmi_ulong   lmi_state;
} lmi_ok_ack_t;
/* LMI_ERROR_ACK, M_CTL */
typedef struct {
    lmi_long    lmi_primitive;  /* LMI_ERROR_ACK */
    lmi_ulong   lmi_errno;
    lmi_ulong   lmi_reason;
    lmi_ulong   lmi_error_primitive;
    lmi_ulong   lmi_state;
} lmi_error_ack_t;
/* LMI_ENABLE_CON, M_PROTO or M_PCPROTO */
typedef struct {
    lmi_long     lmi_primitive; /* LMI_ENABLE_CON */
    lmi_ulong    lmi_state;
} lmi_enable_con_t;
/* LMI_DISABLE_CON, M_PROTO or M_PCPROTO */
typedef struct {
    lmi_long     lmi_primitive; /* LMI_DISABLE_CON */
    lmi_ulong    lmi_state;
} lmi_disable_con_t;
/* LMI_ERROR_IND, M_PROTO or M_PCPROTO */
typedef struct {
    lmi_long    lmi_primitive;  /* LMI_ERROR_IND */
    lmi_ulong   lmi_errno;
    lmi_ulong   lmi_reason;
    lmi_ulong   lmi_state;
} lmi_error_ind_t;
/* LMI_STATS_IND, M_PROTO */
typedef struct {
    lmi_ulong   lmi_primitive;  /* LMI_STATS_IND */
    lmi_ulong   lmi_interval;
    lmi_ulong   lmi_timestamp;
} lmi_stats_ind_t;
/* LMI_EVENT_IND, M_PROTO */
typedef struct {
    lmi_ulong   lmi_primitive;  /* LMI_EVENT_IND */
    lmi_ulong   lmi_objectid;
    lmi_ulong   lmi_timestamp;
    lmi_ulong   lmi_severity;
} lmi_event_ind_t;
union LMI_primitive {
    lmi_ulong           lmi_primitive;
    lmi_ok_ack_t        ok_ack;
    lmi_error_ack_t     error_ack;
    lmi_error_ind_t     error_ind;
    lmi_stats_ind_t     stats_ind;
    lmi_event_ind_t     event_ind;
};
union LMI_primitives {
    lmi_ulong           lmi_primitive;
    lmi_info_req_t      info_req;
    lmi_info_ack_t      info_ack;
    lmi_attach_req_t    attach_req;
    lmi_detach_req_t    detach_req;
    lmi_enable_req_t    enable_req;
    lmi_disable_req_t   disable_req;
    lmi_ok_ack_t        ok_ack;
    lmi_error_ack_t     error_ack;
    lmi_enable_con_t    enable_con;
    lmi_disable_con_t   disable_con;
    lmi_error_ind_t     error_ind;
    lmi_stats_ind_t     stats_ind;
    lmi_event_ind_t     event_ind;
};
#define LMI_INFO_REQ_SIZE    sizeof(lmi_info_req_t)
#define LMI_INFO_ACK_SIZE    sizeof(lmi_info_ack_t)
#define LMI_ATTACH_REQ_SIZE  sizeof(lmi_attach_req_t)
#define LMI_DETACH_REQ_SIZE  sizeof(lmi_detach_req_t)
#define LMI_ENABLE_REQ_SIZE  sizeof(lmi_enable_req_t)
#define LMI_DISABLE_REQ_SIZE sizeof(lmi_disable_req_t)
#define LMI_OK_ACK_SIZE      sizeof(lmi_ok_ack_t)
#define LMI_ERROR_ACK_SIZE   sizeof(lmi_error_ack_t)
#define LMI_ENABLE_CON_SIZE  sizeof(lmi_enable_con_t)
#define LMI_DISABLE_CON_SIZE sizeof(lmi_disable_con_t)
#define LMI_ERROR_IND_SIZE   sizeof(lmi_error_ind_t)
#define LMI_STATS_IND_SIZE   sizeof(lmi_stats_ind_t)
#define LMI_EVENT_IND_SIZE   sizeof(lmi_event_ind_t)
#endif  __LMI_H__
/*****************************************************************************
 @(#) $Id: sdli.h,v 0.7.2.9 2001/02/03 05:48:58 brian Exp $
 -----------------------------------------------------------------------------
 Copyright (C) 1997-2001  Brian Bidulock <bidulock@dallas.net>
 All Rights Reserved.
 This program is free software; you can redistribute it and/or modify it under
 the terms of the GNU General Public License as published by the Free Software
 Foundation; either version 2 of the License, or (at your option) any later
 version.
 This program is distributed in the hope that it will be useful, but WITHOUT
 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
 details.
 You should have received a copy of the GNU General Public License along with
 this program; if not, write to the Free Software Foundation, Inc., 675 Mass
 Ave, Cambridge, MA 02139, USA.
 -----------------------------------------------------------------------------
 Last Modified $Date: 2001/02/03 05:48:58 $ by $Author: brian $
 *****************************************************************************/
#ifndef __SDLI_H__
#define __SDLI_H__
/*
 *  The purpose of the SDL interface is to provide separation between the
 *  SDTI (Signalling Data Terminal Interface) which provides SS7 Signalling
 *  Data Terminal (SDT) state machine services including AERM, SUERM and
 *  EIM, and the underlying driver which provides essentially HDLC
 *  capabilities (DAEDR and DAEDT).  The interface utilizes some FISU/LSSU
 *  compression techniques to increase the performance of the interface.
 */
typedef lmi_ulong   sdl_ulong;
typedef lmi_ushort  sdl_ushort;
typedef lmi_uchar   sdl_uchar;
#define SDL_PROTO_BASE                 16L
#define SDL_DSTR_FIRST                 ( 1L + SDL_PROTO_BASE)
#define SDL_DAEDT_TRANSMISSION_REQ     ( 1L + SDL_PROTO_BASE)
#define SDL_DAEDT_START_REQ            ( 2L + SDL_PROTO_BASE)
#define SDL_DAEDR_START_REQ            ( 3L + SDL_PROTO_BASE)
#define SDL_DSTR_LAST                  ( 3L + SDL_PROTO_BASE)
#define SDL_USTR_FIRST                 (-1L - SDL_PROTO_BASE)
#define SDL_DAEDR_RECEIVED_BITS_IND    (-1L - SDL_PROTO_BASE)
#define SDL_DAEDR_CORRECT_SU_IND       (-2L - SDL_PROTO_BASE)
#define SDL_DAEDR_SU_IN_ERROR_IND      (-3L - SDL_PROTO_BASE)
#define SDL_USTR_LAST                  (-3L - SDL_PROTO_BASE)
/*
 *  SDLI PROTOCOL PRIMITIVES
 */
/*
 *  SDL_DAEDR_RECEIVED_BITS_IND, M_PROTO, M_PCPROTO or M_DATA
 */
typedef struct {
    sdl_ulong   sdl_primitive;  /* SDL_DAEDR_RECEIVED_BITS_IND */
    sdl_ulong   sdl_count;
} sdl_daedr_received_bits_ind_t;
/*
 *  SDL_DAEDR_START_REQ, M_PROTO or M_PCPROTO
 */
typedef struct {
    sdl_ulong   sdl_primitive;  /* SDL_DAEDR_START_REQ */
} sdl_daedr_start_req_t;
/*
 *  SDL_DAEDR_CORRECT_SU_IND, M_PROTO or M_PCPROTO
 */
typedef struct {
    sdl_ulong   sdl_primitive;  /* SDL_DAEDR_CORRECT_SU_IND */
    sdl_ulong   sdl_count;
} sdl_daedr_correct_su_ind_t;
/*
 *  SDL_DAEDR_SU_IN_ERROR_IND, M_PROTO or M_PCPROTO
 */
typedef struct {
    sdl_ulong   sdl_primitive;  /* SDL_DAEDR_SU_IN_ERROR_IND */
} sdl_daedr_su_in_error_ind_t;
/*
 *  SDL_DAEDT_START_REQ, M_PROTO or M_PCPROTO
 */
typedef struct {
    sdl_ulong   sdl_primitive;  /* SDL_DAEDT_START_REQ */
} sdl_daedt_start_req_t;
/*
 *  SDL_DAEDT_TRANSMISSION_REQ, M_PROTO, M_PCPROTO or M_DATA
 */
typedef struct {
    sdl_ulong   sdl_primitive;  /* SDL_ */
} sdl_daedt_transmission_req_t;
union SDL_primitives {
    sdl_ulong                       sdl_primitive;
    sdl_daedr_received_bits_ind_t   daedr_received_bits_ind;
    sdl_daedr_start_req_t           daedr_start_req;
    sdl_daedr_correct_su_ind_t      daedr_correct_su_ind;
    sdl_daedr_su_in_error_ind_t     daedr_su_in_error_ind;
    sdl_daedt_start_req_t           daedt_start_req;
    sdl_daedt_transmission_req_t    daedt_transmission_req;
};
#define SDL_DAEDR_RECEIVED_BITS_IND_SIZE    sizeof(sdl_daedr_received_bits_ind_t)
#define SDL_DAEDR_START_REQ_SIZE            sizeof(sdl_daedr_start_req_t)
#define SDL_DAEDR_CORRECT_SU_IND_SIZE       sizeof(sdl_daedr_correct_su_ind_t)
#define SDL_DAEDR_SU_IN_ERROR_IND_SIZE      sizeof(sdl_daedr_su_in_error_ind_t)
#define SDL_DAEDT_START_REQ_SIZE            sizeof(sdl_daedt_start_req_t)
#define SDL_DAEDT_TRANSMISSION_REQ_SIZE     sizeof(sdl_daedt_transmission_req_t)
#endif  __SDLI_H__
/*****************************************************************************
 @(#) $Id: lmi_ioctl.h,v 0.7.2.5 2001/02/03 05:48:58 brian Exp $
 -----------------------------------------------------------------------------
 Copyright (C) 1997-2001  Brian Bidulock <bidulock@dallas.net>
 All Rights Reserved.
 This program is free software; you can redistribute it and/or modify it under
 the terms of the GNU General Public License as published by the Free Software
 Foundation; either version 2 of the License, or (at your option) any later
 version.
 This program is distributed in the hope that it will be useful, but WITHOUT
 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
 details.
 You should have received a copy of the GNU General Public License along with
 this program; if not, write to the Free Software Foundation, Inc., 675 Mass
 Ave, Cambridge, MA 02139, USA.
 -----------------------------------------------------------------------------
 Last Modified $Date: 2001/02/03 05:48:58 $ by $Author: brian $
 *****************************************************************************/
#ifndef __LMI_IOCTL_H__
#define __LMI_IOCTL_H__
/*
 *  COMMON IOCTL NUMBERS
 */
#define LMI_IOCGOPTIONS   0
#define LMI_IOCSOPTIONS   1
#define LMI_IOCGCONFIG    2
#define LMI_IOCSCONFIG    3
#define LMI_IOCTCONFIG    4
#define LMI_IOCCCONFIG    5
#define LMI_IOCGSTATEM    6
#define LMI_IOCCMRESET    7
#define LMI_IOCGSTATSP    8
#define LMI_IOCSSTATSP    9
#define LMI_IOCGSTATS    10
#define LMI_IOCCSTATS    11
#define LMI_IOCGNOTIFY   12
#define LMI_IOCSNOTIFY   13
#define LMI_IOCCNOTIFY   14
#define LMI_IOC_FIRST     0
#define LMI_IOC_LAST     14
#define LMI_IOC_PRIVATE  32
/*
 *  PROTOCOL VARIANT AND OPTIONS 
 */
typedef struct lmi_option {
    lmi_ulong   pvar;
    lmi_ulong   popt;
} lmi_option_t;
enum {
    SS7_PVAR_ITUT_88,  /* ITU-T protocol variant */
    SS7_PVAR_ITUT_93,  /* ITU-T protocol variant */
    SS7_PVAR_ITUT_96,  /* ITU-T protocol variant */
    SS7_PVAR_ITUT_00,  /* ITU-T protocol variant */
    SS7_PVAR_ANSI_88,  /* ANSI  protocol variant */
    SS7_PVAR_ANSI_92,  /* ANSI  protocol variant */
    SS7_PVAR_ANSI_96,  /* ANSI  protocol variant */
    SS7_PVAR_ANSI_00,  /* ANSI  protocol variant */
    SS7_PVAR_ETSI_88,  /* ETSI  protocol variant */
    SS7_PVAR_ETSI_93,  /* ETSI  protocol variant */
    SS7_PVAR_ETSI_96,  /* ETSI  protocol variant */
    SS7_PVAR_ETSI_00,  /* ETSI  protocol variant */
    SS7_PVAR_JTTC_94,  /* JTTC  protocol variant */
    SS7_PVAR_MAX = SS7_PVAR_JTTC_94
};
enum {
    SS7_POPT_MPLEV  = 0x00000001,   /* multiple priority/congestion levels  */
    SS7_POPT_PCR    = 0x00000002,   /* preventative cyclic retranlmission   */
    SS7_POPT_HSL    = 0x00000004,   /* high speed links                     */
    SS7_POPT_XSN    = 0x00000008,   /* extended sequence numbers            */
    SS7_POPT_ALL    = 0x0000000f    /* all options                          */
};
/*
 *  STATISTICS
 */
typedef struct lmi_sta {
    lmi_ulong   object_id;  /* object id for stats      */
    lmi_ulong   colperiod;  /* collection period        */
    lmi_ulong   timestamp;  /* timestamp end of period  */
} lmi_sta_t;
#endif  __LMI_IOCTL_H__
/*****************************************************************************
 @(#) $Id: sdli_ioctl.h,v 0.7.2.9 2001/02/04 10:41:31 brian Exp $
 -----------------------------------------------------------------------------
 Copyright (C) 1997-2001  Brian Bidulock <bidulock@dallas.net>
 All Rights Reserved.
 This program is free software; you can redistribute it and/or modify it under
 the terms of the GNU General Public License as published by the Free Software
 Foundation; either version 2 of the License, or (at your option) any later
 version.
 This program is distributed in the hope that it will be useful, but WITHOUT
 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
 details.
 You should have received a copy of the GNU General Public License along with
 this program; if not, write to the Free Software Foundation, Inc., 675 Mass
 Ave, Cambridge, MA 02139, USA.
 -----------------------------------------------------------------------------
 Last Modified $Date: 2001/02/04 10:41:31 $ by $Author: brian $
 *****************************************************************************/
#ifndef __SDLI_IOCTL_H__
#define __SDLI_IOCTL_H__
#include <linux/ioctl.h>
#define SDL_IOC_MAGIC 'd'
/*
 *  PROTOCOL VARIANT AND OPTIONS
 */
#define SDL_IOCGOPTIONS _IOR(  SDL_IOC_MAGIC,  0, lmi_option_t )
#define SDL_IOCSOPTIONS _IOW(  SDL_IOC_MAGIC,  1, lmi_option_t )
/*
 *  CONFIGURATION
 */
typedef struct sdl_config {
    sdl_ulong   N;      /* octets per su in octet-counting mode */
    sdl_ulong   m;      /* maximum SIF size                     */
} sdl_config_t;
#define SDL_IOCGCONFIG  _IOR(  SDL_IOC_MAGIC,  2, sdl_config_t )
#define SDL_IOCSCONFIG  _IOWR( SDL_IOC_MAGIC,  3, sdl_config_t )
#define SDL_IOCTCONFIG  _IOWR( SDL_IOC_MAGIC,  4, sdl_config_t )
#define SDL_IOCCCONFIG  _IOR(  SDL_IOC_MAGIC,  5, sdl_config_t )
/*
 *  STATE
 */
typedef struct sdl_statem {
    sdl_ulong   daedt_state;
    sdl_ulong   daedr_state;
    sdl_ulong   octet_counting_mode;
} sdl_statem_t;
#define SDL_STATE_IDLE          0x00
#define SDL_STATE_IN_SERVICE    0x01
#define SDL_IOCGSTATEM  _IOR(  SDL_IOC_MAGIC,  6, sdl_statem_t )
#define SDL_IOCCMRESET  _IOR(  SDL_IOC_MAGIC,  7, sdl_statem_t )
/*
 *  STATISTICS
 */
typedef struct sdl_stats {
    lmi_ulong   header;
    sdl_ulong   rx_bytes;
    sdl_ulong   tx_bytes;
    sdl_ulong   rx_sus;
    sdl_ulong   tx_sus;
    sdl_ulong   rx_overruns;
    sdl_ulong   tx_underruns;
    sdl_ulong   rx_aborts;
    sdl_ulong   tx_aborts;
    sdl_ulong   rx_buffer_overflows;
    sdl_ulong   tx_buffer_overflows;
    sdl_ulong   rx_sus_in_error;            /* Q.752 Table 1.8  5,30 min */
    sdl_ulong   tx_sus_in_error;
    sdl_ulong   rx_sync_transitions;
    sdl_ulong   rx_bits_octet_counted;
    sdl_ulong   rx_crc_errors;
    sdl_ulong   rx_frame_errors;
    sdl_ulong   rx_frame_overflows;
    sdl_ulong   rx_frame_too_long;
    sdl_ulong   rx_frame_too_short;
    sdl_ulong   rx_residue_errors;
    sdl_ulong   rx_length_error;            /* error in length indicator */
    sdl_ulong   lead_cts_lost;
    sdl_ulong   lead_dcd_lost;
    sdl_ulong   carrier_lost;
} sdl_stats_t;
#define SDL_IOCGSTATSP  _IOR(  SDL_IOC_MAGIC,  8, sdl_stats_t  )
#define SDL_IOCSSTATSP  _IOWR( SDL_IOC_MAGIC,  9, sdl_stats_t  )
#define SDL_IOCGSTATS   _IOR(  SDL_IOC_MAGIC, 10, sdl_stats_t  )
#define SDL_IOCCSTATS   _IOW(  SDL_IOC_MAGIC, 11, sdl_stats_t  )
/*
 *  EVENTS
 */
typedef struct sdl_notify {
    sdl_ulong   sdl_notifications;
} sdl_notify_t;
#define SDL_EVT_LOST_SYNC   0x0000001
#define SDL_EVT_SU_ERROR    0x0000002
#define SDL_EVT_TX_FAIL     0x0000004
#define SDL_EVT_RX_FAIL     0x0000008
#define SDL_IOCGNOTIFY  _IOR(  SDL_IOC_MAGIC, 12, sdl_notify_t )
#define SDL_IOCSNOTIFY  _IOW(  SDL_IOC_MAGIC, 13, sdl_notify_t )
#define SDL_IOCCNOTIFY  _IOW(  SDL_IOC_MAGIC, 14, sdl_notify_t )
#define SDL_IOC_FIRST    0
#define SDL_IOC_LAST    14
#define SDL_IOC_PRIVATE 32
#endif  __SDLI_IOCTL_H__
/*****************************************************************************
 @(#) $Id: devi_ioctl.h,v 0.7.2.8 2001/02/03 05:48:58 brian Exp $
 -----------------------------------------------------------------------------
 Copyright (C) 1997-2001  Brian Bidulock <bidulock@dallas.net>
 All Rights Reserved.
 This program is free software; you can redistribute it and/or modify it under
 the terms of the GNU General Public License as published by the Free Software
 Foundation; either version 2 of the License, or (at your option) any later
 version.
 This program is distributed in the hope that it will be useful, but WITHOUT
 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
 details.
 You should have received a copy of the GNU General Public License along with
 this program; if not, write to the Free Software Foundation, Inc., 675 Mass
 Ave, Cambridge, MA 02139, USA.
 -----------------------------------------------------------------------------
 Last Modified $Date: 2001/02/03 05:48:58 $ by $Author: brian $
 *****************************************************************************/
#ifndef __DEVI_IOCTL_H__
#define __DEVI_IOCTL_H__
#include <linux/ioctl.h>
#include <asm/spinlock.h>
#define DEV_IOC_MAGIC 'v'
/*
 *  DEVICE CONFIGURATION
 */
struct sdl;
#ifdef __KERNEL__
typedef struct dev_device {
    spinlock_t  iflock;     /* interface lock   */
    dev_ulong   ifflags;    /* interface flags  */
    dev_ulong   iftype;     /* interface type   */
    dev_ulong   ifgtype;    /* group type       */
    dev_ulong   ifmode;     /* interface mode   */
    dev_ulong   ifrate;     /* interface rate   */
    dev_ulong   ifclock;    /* interface clock  */
    dev_ulong   ifcoding;   /* interface coding */
    dev_ulong   ifleads;    /* interface leads  */
    dev_ulong   ifindex;    /* interface index  */
    dev_ulong   irq;        /* interrupt        */
    dev_ulong   iobase;     /* i/o base address */
    dev_ulong   dma_rx;     /* dma receive      */
    dev_ulong   dma_tx;     /* dma transmit     */
} dev_device_t;
#endif
#define DEV_IOCCIFRESET   _IO(  DEV_IOC_MAGIC,  0 )
#define DEV_IOCGIFFLAGS   _IOW( DEV_IOC_MAGIC,  1, dev_ulong )
#define DEV_IOCSIFFLAGS   _IOW( DEV_IOC_MAGIC,  2, dev_ulong )
#define DEV_IF_UP            0x00000001  /* device should set on enable  */
#define DEV_IF_RX_RUNNING    0x00000002  /* when Rx running              */
#define DEV_IF_TX_RUNNING    0x00000004  /* when Tx running              */
#define DEV_IF_SU_COMPRESS   0x00000008  /* when Rx compressing          */
#define DEV_IOCGIFTYPE    _IOR( DEV_IOC_MAGIC,  3, dev_ulong )
#define DEV_IOCSIFTYPE    _IOW( DEV_IOC_MAGIC,  4, dev_ulong )
enum {
    DEV_TYPE_NONE,
    DEV_TYPE_V35,
    DEV_TYPE_DS0,
    DEV_TYPE_DS0A,
    DEV_TYPE_E1,
    DEV_TYPE_T1,
    DEV_TYPE_J1,
    DEV_TYPE_ATM,
    DEV_TYPE_PACKET
};
#define DEV_IOCGGRPTYPE   _IOR( DEV_IOC_MAGIC,  5, dev_ulong )
#define DEV_IOCSGRPTYPE   _IOW( DEV_IOC_MAGIC,  6, dev_ulong )
enum {
    DEV_GTYPE_NONE,
    DEV_GTYPE_T1,
    DEV_GTYPE_E1,
    DEV_GTYPE_J1,
    DEV_GTYPE_ATM,
    DEV_GTYPE_ETH,
    DEV_GTYPE_IP,
    DEV_GTYPE_UDP,
    DEV_GTYPE_TCP,
    DEV_GTYPE_RTP,
    DEV_GTYPE_SCTP
};
#define DEV_IOCGIFMODE    _IOR( DEV_IOC_MAGIC,  7, dev_ulong )
#define DEV_IOCSIFMODE    _IOW( DEV_IOC_MAGIC,  8, dev_ulong )
enum {
    DEV_MODE_NONE,
    DEV_MODE_DSU,
    DEV_MODE_CSU,
    DEV_MODE_DTE,
    DEV_MODE_DCE,
    DEV_MODE_CLIENT,
    DEV_MODE_SERVER,
    DEV_MODE_PEER,
    DEV_MODE_ECHO,
    DEV_MODE_REM_LB,
    DEV_MODE_LOC_LB,
    DEV_MODE_LB_ECHO,
    DEV_MODE_TEST
};
#define DEV_IOCGIFRATE    _IOR( DEV_IOC_MAGIC,  9, dev_ulong )
#define DEV_IOCSIFRATE    _IOW( DEV_IOC_MAGIC, 10, dev_ulong )
#define DEV_IOCGIFCLOCK   _IOR( DEV_IOC_MAGIC, 11, dev_ulong )
#define DEV_IOCSIFCLOCK   _IOW( DEV_IOC_MAGIC, 12, dev_ulong )
enum {
    DEV_CLOCK_NONE,
    DEV_CLOCK_INT,
    DEV_CLOCK_EXT,
    DEV_CLOCK_LOOP,
    DEV_CLOCK_MASTER,
    DEV_CLOCK_SLAVE,
    DEV_CLOCK_DPLL,
    DEV_CLOCK_ABR,
    DEV_CLOCK_SHAPER
};
#define DEV_IOCGIFCODING  _IOR( DEV_IOC_MAGIC, 13, dev_ulong )
#define DEV_IOCSIFCODING  _IOW( DEV_IOC_MAGIC, 14, dev_ulong )
enum {
    DEV_CODING_NONE,
    DEV_CODING_NRZ,
    DEV_CODING_NRZI,
    DEV_CODING_AMI,
    DEV_CODING_B6ZS,
    DEV_CODING_B8ZS,
    DEV_CODING_ESF,     /* FIXME: this is actually a framing value */
    DEV_CODING_AAL1,
    DEV_CODING_AAL2,
    DEV_CODING_AAL5
};
#define DEV_IOCGIFLEADS   _IOR( DEV_IOC_MAGIC, 15, dev_ulong )
#define DEV_IOCSIFLEADS   _IOW( DEV_IOC_MAGIC, 16, dev_ulong )
#define DEV_IOCCIFLEADS   _IOW( DEV_IOC_MAGIC, 17, dev_ulong )
enum {
    DEV_LEAD_DTR = 0x01,    /* for V.35 DTR lead set or clr */
    DEV_LEAD_RTS = 0x02,    /* for V.35 RTS lead set or clr */
    DEV_LEAD_DCD = 0x04,    /* for V.35 DCD lead get */
    DEV_LEAD_CTS = 0x08,    /* for V.35 CTS lead get */
    DEV_LEAD_DSR = 0x10     /* for V.35 DSR lead get */
};
#define DEV_IOCCDISCTX    _IO(  DEV_IOC_MAGIC, 18 )
#define DEV_IOCCCONNTX    _IO(  DEV_IOC_MAGIC, 19 )
#define DEV_IOC_FIRST    0
#define DEV_IOC_LAST    19
#define DEV_IOC_PRIVATE 32
#endif  __DEVI_IOCTL_H__|  |  |  |  |  |  |  |  |  | 
| OpenSS7 | © Copyright 1997-2001, OpenSS7, All Rights Reserved. Last modified: $Date:$ |