The Design and Implementation of the FreeBSD Operating System, Second Edition
Now available: The Design and Implementation of the FreeBSD Operating System (Second Edition)


[ source navigation ] [ diff markup ] [ identifier search ] [ freetext search ] [ file search ] [ list types ] [ track identifier ]

FreeBSD/Linux Kernel Cross Reference
sys/i4b/include/i4b_l3l4.h

Version: -  FREEBSD  -  FREEBSD-13-STABLE  -  FREEBSD-13-0  -  FREEBSD-12-STABLE  -  FREEBSD-12-0  -  FREEBSD-11-STABLE  -  FREEBSD-11-0  -  FREEBSD-10-STABLE  -  FREEBSD-10-0  -  FREEBSD-9-STABLE  -  FREEBSD-9-0  -  FREEBSD-8-STABLE  -  FREEBSD-8-0  -  FREEBSD-7-STABLE  -  FREEBSD-7-0  -  FREEBSD-6-STABLE  -  FREEBSD-6-0  -  FREEBSD-5-STABLE  -  FREEBSD-5-0  -  FREEBSD-4-STABLE  -  FREEBSD-3-STABLE  -  FREEBSD22  -  l41  -  OPENBSD  -  linux-2.6  -  MK84  -  PLAN9  -  xnu-8792 
SearchContext: -  none  -  3  -  10 

    1 /*
    2  * Copyright (c) 1997, 2001 Hellmuth Michaelis. All rights reserved.
    3  *
    4  * Redistribution and use in source and binary forms, with or without
    5  * modification, are permitted provided that the following conditions
    6  * are met:
    7  * 1. Redistributions of source code must retain the above copyright
    8  *    notice, this list of conditions and the following disclaimer.
    9  * 2. Redistributions in binary form must reproduce the above copyright
   10  *    notice, this list of conditions and the following disclaimer in the
   11  *    documentation and/or other materials provided with the distribution.
   12  *
   13  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
   14  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
   15  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
   16  * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
   17  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
   18  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
   19  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
   20  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
   21  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
   22  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
   23  * SUCH DAMAGE.
   24  *
   25  *---------------------------------------------------------------------------
   26  *
   27  *      i4b_l3l4.h - layer 3 / layer 4 interface
   28  *      ------------------------------------------
   29  *
   30  *      $Id: i4b_l3l4.h,v 1.32 2000/08/24 11:48:57 hm Exp $
   31  *
   32  * $FreeBSD$
   33  *
   34  *      last edit-date: [Fri Jun  2 14:29:35 2000]
   35  *
   36  *---------------------------------------------------------------------------*/
   37 
   38 #ifndef _I4B_L3L4_H_
   39 #define _I4B_L3L4_H_
   40 
   41 #define T303VAL (hz*4)                  /* 4 seconds timeout            */
   42 #define T305VAL (hz*30)                 /* 30 seconds timeout           */
   43 #define T308VAL (hz*4)                  /* 4 seconds timeout            */
   44 #define T309VAL (hz*90)                 /* 90 seconds timeout           */
   45 #define T310VAL (hz*60)                 /* 30-120 seconds timeout       */
   46 #define T313VAL (hz*4)                  /* 4 seconds timeout            */
   47 #define T400DEF (hz*10)                 /* 10 seconds timeout           */
   48 
   49 #define MAX_BCHAN 30
   50 #define N_CALL_DESC (MAX_CONTROLLERS*MAX_BCHAN) /* no of call descriptors */
   51 
   52 extern int nctrl;               /* number of controllers detected in system */
   53 
   54 typedef struct bchan_statistics {
   55         int outbytes;
   56         int inbytes;
   57 } bchan_statistics_t;
   58 
   59 /*---------------------------------------------------------------------------*
   60  * table of things the driver needs to know about the b channel
   61  * it is connected to for data transfer
   62  *---------------------------------------------------------------------------*/
   63 typedef struct i4l_isdn_bchan_linktab {
   64         int unit;
   65         int channel;
   66         void (*bch_config)(int unit, int channel, int bprot, int updown);
   67         void (*bch_tx_start)(int unit, int channel);
   68         void (*bch_stat)(int unit, int channel, bchan_statistics_t *bsp);       
   69         struct ifqueue *tx_queue;
   70         struct ifqueue *rx_queue;       /* data xfer for NON-HDLC traffic   */
   71         struct mbuf **rx_mbuf;          /* data xfer for HDLC based traffic */
   72 } isdn_link_t;
   73 
   74 /*---------------------------------------------------------------------------*
   75  * table of things the b channel handler needs to know  about
   76  * the driver it is connected to for data transfer
   77  *---------------------------------------------------------------------------*/
   78 typedef struct i4l_driver_bchan_linktab {
   79         int unit;
   80         void (*bch_rx_data_ready)(int unit);
   81         void (*bch_tx_queue_empty)(int unit);
   82         void (*bch_activity)(int unit, int rxtx);
   83 #define ACT_RX 0
   84 #define ACT_TX 1
   85         void (*line_connected)(int unit, void *cde);
   86         void (*line_disconnected)(int unit, void *cde);
   87         void (*dial_response)(int unit, int stat, cause_t cause);
   88         void (*updown_ind)(int unit, int updown);               
   89 } drvr_link_t;
   90 
   91 /* global linktab functions for controller types (aka hardware drivers) */
   92 struct ctrl_type_desc {
   93         isdn_link_t* (*get_linktab)(int unit, int channel);
   94         void (*set_linktab)(int unit, int channel, drvr_link_t *dlt);
   95 };
   96 extern struct ctrl_type_desc ctrl_types[];
   97 
   98 /* global linktab functions for RBCH userland driver */
   99 
  100 drvr_link_t *rbch_ret_linktab(int unit);
  101 void rbch_set_linktab(int unit, isdn_link_t *ilt);
  102 
  103 /* global linktab functions for IPR network driver */
  104 
  105 drvr_link_t *ipr_ret_linktab(int unit);
  106 void ipr_set_linktab(int unit, isdn_link_t *ilt);
  107 
  108 /* global linktab functions for TEL userland driver */
  109 
  110 drvr_link_t *tel_ret_linktab(int unit);
  111 void tel_set_linktab(int unit, isdn_link_t *ilt);
  112 
  113 /* global linktab functions for ISPPP userland driver */
  114 
  115 drvr_link_t *i4bisppp_ret_linktab(int unit);
  116 void i4bisppp_set_linktab(int unit, isdn_link_t *ilt);
  117 
  118 #ifdef __bsdi__
  119 /* global linktab functions for IBC userland driver */
  120 
  121 drvr_link_t *ibc_ret_linktab(int unit);
  122 void ibc_set_linktab(int unit, isdn_link_t *ilt);
  123 #endif
  124 
  125 /* global linktab functions for ING network driver */
  126 
  127 drvr_link_t *ing_ret_linktab(int unit);
  128 void ing_set_linktab(int unit, isdn_link_t *ilt);
  129 
  130 
  131 /*---------------------------------------------------------------------------*
  132  *      this structure describes one call/connection on one B-channel
  133  *      and all its parameters
  134  *---------------------------------------------------------------------------*/
  135 typedef struct
  136 {
  137         u_int   cdid;                   /* call descriptor id           */
  138         int     controller;             /* isdn controller number       */
  139         int     cr;                     /* call reference value         */
  140 
  141         int     crflag;                 /* call reference flag          */
  142 #define CRF_ORIG        0               /* originating side             */
  143 #define CRF_DEST        1               /* destinating side             */
  144 
  145         int     channelid;              /* channel id value             */
  146         int     channelexcl;            /* channel exclusive            */
  147 
  148         int     bprot;                  /* B channel protocol BPROT_XXX */
  149 
  150         int     driver;                 /* driver to use for B channel  */
  151         int     driver_unit;            /* unit for above driver number */
  152         
  153         cause_t cause_in;               /* cause value from NT  */
  154         cause_t cause_out;              /* cause value to NT    */
  155 
  156         int     call_state;             /* from incoming SETUP  */
  157         
  158         u_char  dst_telno[TELNO_MAX];   /* destination number   */
  159         u_char  src_telno[TELNO_MAX];   /* source number        */
  160 
  161         int     scr_ind;                /* screening ind for incoming call */
  162         int     prs_ind;                /* presentation ind for incoming call */
  163         
  164         int     Q931state;              /* Q.931 state for call */
  165         int     event;                  /* event to be processed */
  166 
  167         int     response;               /* setup response type  */
  168 
  169         int     T303;                   /* SETUP sent response timeout  */
  170         int     T303_first_to;          /* first timeout flag           */
  171 
  172         int     T305;                   /* DISC without PROG IND        */
  173 
  174         int     T308;                   /* RELEASE sent response timeout*/
  175         int     T308_first_to;          /* first timeout flag           */
  176 
  177         int     T309;                   /* data link disconnect timeout */
  178 
  179         int     T310;                   /* CALL PROC received           */
  180 
  181         int     T313;                   /* CONNECT sent timeout         */ 
  182 
  183         int     T400;                   /* L4 timeout */
  184 
  185         isdn_link_t     *ilt;           /* isdn B channel linktab       */
  186         drvr_link_t     *dlt;           /* driver linktab               */
  187 
  188         int     dir;                    /* outgoing or incoming call    */
  189 #define DIR_OUTGOING    0
  190 #define DIR_INCOMING    1
  191 
  192         int     timeout_active;         /* idle timeout() active flag   */
  193 
  194 #if (defined(__FreeBSD_version) && __FreeBSD_version >= 300001) || \
  195         (!defined(__FreeBSD_version) && defined(__FreeBSD__) && __FreeBSD__ >= 3)
  196         struct  callout_handle  idle_timeout_handle;
  197         struct  callout_handle  T303_callout;
  198         struct  callout_handle  T305_callout;
  199         struct  callout_handle  T308_callout;
  200         struct  callout_handle  T309_callout;
  201         struct  callout_handle  T310_callout;
  202         struct  callout_handle  T313_callout;
  203         struct  callout_handle  T400_callout;
  204         int     callouts_inited;                /* must init before use */
  205 #endif
  206 #if defined(__NetBSD__) && __NetBSD_Version__ >= 104230000
  207         struct  callout idle_timeout_handle;
  208         struct  callout T303_callout;
  209         struct  callout T305_callout;
  210         struct  callout T308_callout;
  211         struct  callout T309_callout;
  212         struct  callout T310_callout;
  213         struct  callout T313_callout;
  214         struct  callout T400_callout;
  215         int     callouts_inited;                /* must init before use */
  216 #endif
  217 
  218         int     idletime_state;         /* wait for idle_time begin     */
  219 #define IST_IDLE        0       /* shorthold mode disabled      */
  220 #define IST_NONCHK      1       /* in non-checked window        */
  221 #define IST_CHECK       2       /* in idle check window         */
  222 #define IST_SAFE        3       /* in safety zone               */
  223 
  224         time_t  idletimechk_start;      /* check idletime window start  */
  225         time_t  connect_time;           /* time connect was made        */
  226         time_t  last_active_time;       /* last time with activity      */
  227 
  228                                         /* for incoming connections:    */
  229         time_t  max_idle_time;          /* max time without activity    */
  230 
  231                                         /* for outgoing connections:    */      
  232         msg_shorthold_t shorthold_data; /* shorthold data to use */
  233 
  234         int     aocd_flag;              /* AOCD used for unitlength calc*/
  235         time_t  last_aocd_time;         /* last time AOCD received      */
  236         int     units;                  /* number of AOCD charging units*/
  237         int     units_type;             /* units type: AOCD, AOCE       */
  238         int     cunits;                 /* calculated units             */
  239 
  240         int     isdntxdelay;            /* isdn tx delay after connect  */
  241 
  242         u_char  display[DISPLAY_MAX];   /* display information element  */
  243         char    datetime[DATETIME_MAX]; /* date/time information element*/
  244         u_char  keypad[KEYPAD_MAX];     /* keypad facility              */      
  245 } call_desc_t;
  246 
  247 extern call_desc_t call_desc[N_CALL_DESC];
  248 
  249 /* forward decl. */
  250 struct isdn_diagnostic_request;
  251 struct isdn_dr_prot;
  252 
  253 /*---------------------------------------------------------------------------*
  254  *      this structure "describes" one controller
  255  *---------------------------------------------------------------------------*/
  256 typedef struct
  257 {
  258         int     unit;                   /* unit number of this contr.   */
  259         int     ctrl_type;              /* controller type   (CTRL_XXX) */
  260         int     card_type;              /* card manufacturer (CARD_XXX) */
  261 
  262         int     protocol;               /* D-channel protocol type */
  263 
  264         int     dl_est;                 /* layer 2 established  */
  265 #define DL_DOWN 0
  266 #define DL_UP   1       
  267 
  268         int     nbch;                   /* number of b channels */
  269         int     bch_state[MAX_BCHAN];   /* states of the b channels */
  270 #define BCH_ST_FREE     0       /* free to be used, idle */
  271 #define BCH_ST_RSVD     1       /* reserved, may become free or used */
  272 #define BCH_ST_USED     2       /* in use for data transfer */
  273 
  274         int     tei;                    /* current tei or -1 if invalid */
  275 
  276         /* pointers to functions to be called from L4 */
  277         
  278         void    (*N_CONNECT_REQUEST)    (unsigned int); 
  279         void    (*N_CONNECT_RESPONSE)   (unsigned int, int, int);
  280         void    (*N_DISCONNECT_REQUEST) (unsigned int, int);
  281         void    (*N_ALERT_REQUEST)      (unsigned int); 
  282         int     (*N_DOWNLOAD)           (int unit, int numprotos, struct isdn_dr_prot *protocols);
  283         int     (*N_DIAGNOSTICS)        (int unit, struct isdn_diagnostic_request*);
  284         void    (*N_MGMT_COMMAND)       (int unit, int cmd, void *);
  285 } ctrl_desc_t;
  286 
  287 extern ctrl_desc_t ctrl_desc[MAX_CONTROLLERS];
  288 
  289 #endif /* _I4B_Q931_H_ */

Cache object: 8e9c4a86c8905359a8441cdf3d8a0cea


[ source navigation ] [ diff markup ] [ identifier search ] [ freetext search ] [ file search ] [ list types ] [ track identifier ]


This page is part of the FreeBSD/Linux Linux Kernel Cross-Reference, and was automatically generated using a modified version of the LXR engine.