Q921.h File Reference

Go to the source code of this file.

Data Structures

struct  Q921Data
 Q.921 Trunk context. More...

Defines

#define Q921_STATISTICS
#define Q921_STATISTICS_VERBOSE
#define Q921MAXHDLCSPACE   3000
#define L2UCHAR   unsigned char
#define L2USHORT   unsigned short
#define L2INT   int
#define L2ULONG   unsigned long
#define L2TRUNK   Q921Data_t *
#define Q921_TEI_BCAST   127
#define Q921_TEI_MAX   Q921_TEI_BCAST
#define Q921_TEI_DYN_MIN   64
#define Q921_TEI_DYN_MAX   126
#define Q921StatsGetCounterSum(tr, st)   Q921StatsGetCounter(tr, st, Q921_TEI_BCAST)

Typedefs

typedef int(* Q921Tx21CB_t )(void *, L2UCHAR *, L2INT)
typedef int(* Q921Tx23CB_t )(void *, Q921DLMsg_t ind, L2UCHAR tei, L2UCHAR *, L2INT)
typedef int(* Q921LogCB_t )(void *, Q921LogLevel_t, char *, L2INT)
typedef struct Q921Data Q921Data_t

Enumerations

enum  Q921NetUser_t { Q921_TE = 0, Q921_NT = 1 }
enum  Q921NetType_t { Q921_PTP = 0, Q921_PTMP = 1 }
enum  Q921LogLevel_t {
  Q921_LOG_NONE = 0, Q921_LOG_EMERG, Q921_LOG_ALERT, Q921_LOG_CRIT,
  Q921_LOG_ERROR, Q921_LOG_WARNING, Q921_LOG_NOTICE, Q921_LOG_INFO,
  Q921_LOG_DEBUG
}
enum  Q921DLMsg_t {
  Q921_DL_ESTABLISH = 0, Q921_DL_ESTABLISH_CONFIRM, Q921_DL_RELEASE, Q921_DL_RELEASE_CONFIRM,
  Q921_DL_DATA, Q921_DL_UNIT_DATA
}
enum  {
  Q921_STATS_NONE = 0, Q921_STATS_ST01, Q921_STATS_ST02, Q921_STATS_ST03,
  Q921_STATS_ST04, Q921_STATS_ST05, Q921_STATS_ST06, Q921_STATS_ST07,
  Q921_STATS_ST08, Q921_STATS_T200, Q921_STATS_T201, Q921_STATS_T202,
  Q921_STATS_T203, Q921_STATS_TM01, Q921_STATS_N200, Q921_STATS_N201,
  Q921_STATS_N202, Q921_STATS_SEND_S, Q921_STATS_SEND_U, Q921_STATS_SEND_I,
  Q921_STATS_SEND_RR, Q921_STATS_SEND_RNR, Q921_STATS_SEND_REJ, Q921_STATS_SEND_SABME,
  Q921_STATS_SEND_DM, Q921_STATS_SEND_DISC, Q921_STATS_SEND_UA, Q921_STATS_SEND_UN,
  Q921_STATS_RECV_S, Q921_STATS_RECV_U, Q921_STATS_RECV_I, Q921_STATS_RECV_INVALID_S,
  Q921_STATS_RECV_INVALID_U, Q921_STATS_RECV_INVALID_I, Q921_STATS_RECV_SABME, Q921_STATS_RECV_DM,
  Q921_STATS_RECV_UA, Q921_STATS_RECV_DISC, Q921_STATS_RECV_RR, Q921_STATS_RECV_REJ,
  Q921_STATS_RECV_RNR, Q921_STATS_MAX
}

Functions

int Q921_InitTrunk (L2TRUNK trunk, L2UCHAR sapi, L2UCHAR tei, Q921NetUser_t NetUser, Q921NetType_t NetType, L2INT hsize, Q921Tx21CB_t cb21, Q921Tx23CB_t cb23, void *priv21, void *priv23)
int Q921Start (L2TRUNK trunk)
 Start trunk.
int Q921Stop (L2TRUNK trunk)
 Stop trunk.
void Q921SetLogCB (L2TRUNK trunk, Q921LogCB_t func, void *priv)
 Set logging callback.
void Q921SetLogLevel (L2TRUNK trunk, Q921LogLevel_t level)
 Set loglevel of Q.921 logging functions.
int Q921Rx12 (L2TRUNK trunk)
int Q921Rx32 (L2TRUNK trunk, Q921DLMsg_t ind, L2UCHAR tei, L2UCHAR *Mes, L2INT Size)
int Q921QueueHDLCFrame (L2TRUNK trunk, L2UCHAR *b, L2INT size)
void Q921SetGetTimeCB (L2ULONG(*callback)(void))
void Q921TimerTick (L2TRUNK trunk)
unsigned int Q921StatsGetCounter (const L2TRUNK trunk, const int id, const int tei)
void Q921StatsResetCounters (L2TRUNK trunk)
const char * Q921StatsCounterGetName (const int id)
const char * Q921StatsCounterGetDescription (const int id)
int Q921StatsCounterIsGlobal (const int id)
int Q921StatsReport (const L2TRUNK trunk, const int tei)


Define Documentation

#define L2INT   int

Definition at line 100 of file Q921.h.

Referenced by Q921Rx12().

#define L2TRUNK   Q921Data_t *

Definition at line 102 of file Q921.h.

#define L2UCHAR   unsigned char

Definition at line 98 of file Q921.h.

Referenced by Q921Rx12().

#define L2ULONG   unsigned long

Definition at line 101 of file Q921.h.

Referenced by Q921TimerTick().

#define L2USHORT   unsigned short

Definition at line 99 of file Q921.h.

#define Q921_STATISTICS

Definition at line 94 of file Q921.h.

#define Q921_STATISTICS_VERBOSE

Definition at line 95 of file Q921.h.

#define Q921_TEI_BCAST   127

Definition at line 104 of file Q921.h.

Referenced by Q921Rx12().

#define Q921_TEI_DYN_MAX   126

Definition at line 108 of file Q921.h.

#define Q921_TEI_DYN_MIN   64

Definition at line 107 of file Q921.h.

#define Q921_TEI_MAX   Q921_TEI_BCAST

Definition at line 105 of file Q921.h.

Referenced by Q921_InitTrunk(), and Q921TimerTick().

#define Q921MAXHDLCSPACE   3000

Definition at line 97 of file Q921.h.

Referenced by Q921_InitTrunk().


Typedef Documentation

typedef struct Q921Data Q921Data_t

typedef int(* Q921LogCB_t)(void *, Q921LogLevel_t, char *, L2INT)

Definition at line 160 of file Q921.h.

typedef int(* Q921Tx21CB_t)(void *, L2UCHAR *, L2INT)

Definition at line 158 of file Q921.h.

typedef int(* Q921Tx23CB_t)(void *, Q921DLMsg_t ind, L2UCHAR tei, L2UCHAR *, L2INT)

Definition at line 159 of file Q921.h.


Enumeration Type Documentation

anonymous enum

Enumerator:
Q921_STATS_NONE 
Q921_STATS_ST01 
Q921_STATS_ST02 
Q921_STATS_ST03 
Q921_STATS_ST04 
Q921_STATS_ST05 
Q921_STATS_ST06 
Q921_STATS_ST07 
Q921_STATS_ST08 
Q921_STATS_T200 
Q921_STATS_T201 
Q921_STATS_T202 
Q921_STATS_T203 
Q921_STATS_TM01 
Q921_STATS_N200 
Q921_STATS_N201 
Q921_STATS_N202 
Q921_STATS_SEND_S 
Q921_STATS_SEND_U 
Q921_STATS_SEND_I 
Q921_STATS_SEND_RR 
Q921_STATS_SEND_RNR 
Q921_STATS_SEND_REJ 
Q921_STATS_SEND_SABME 
Q921_STATS_SEND_DM 
Q921_STATS_SEND_DISC 
Q921_STATS_SEND_UA 
Q921_STATS_SEND_UN 
Q921_STATS_RECV_S 
Q921_STATS_RECV_U 
Q921_STATS_RECV_I 
Q921_STATS_RECV_INVALID_S 
Q921_STATS_RECV_INVALID_U 
Q921_STATS_RECV_INVALID_I 
Q921_STATS_RECV_SABME 
Q921_STATS_RECV_DM 
Q921_STATS_RECV_UA 
Q921_STATS_RECV_DISC 
Q921_STATS_RECV_RR 
Q921_STATS_RECV_REJ 
Q921_STATS_RECV_RNR 
Q921_STATS_MAX 

Definition at line 165 of file Q921.h.

enum Q921DLMsg_t

Enumerator:
Q921_DL_ESTABLISH 
Q921_DL_ESTABLISH_CONFIRM 
Q921_DL_RELEASE 
Q921_DL_RELEASE_CONFIRM 
Q921_DL_DATA 
Q921_DL_UNIT_DATA 

Definition at line 149 of file Q921.h.

enum Q921LogLevel_t

Log levels

Enumerator:
Q921_LOG_NONE 
Q921_LOG_EMERG 
Q921_LOG_ALERT 
Q921_LOG_CRIT 
Q921_LOG_ERROR 
Q921_LOG_WARNING 
Q921_LOG_NOTICE 
Q921_LOG_INFO 
Q921_LOG_DEBUG 

Definition at line 132 of file Q921.h.

enum Q921NetType_t

Link type

Enumerator:
Q921_PTP  Point-To-Point
Q921_PTMP  Point-To-Multipoint

Definition at line 123 of file Q921.h.

enum Q921NetUser_t

Mode

Enumerator:
Q921_TE  User Mode
Q921_NT  Network Mode

Definition at line 114 of file Q921.h.


Function Documentation

int Q921_InitTrunk ( L2TRUNK  trunk,
L2UCHAR  sapi,
L2UCHAR  tei,
Q921NetUser_t  NetUser,
Q921NetType_t  NetType,
L2INT  hsize,
Q921Tx21CB_t  cb21,
Q921Tx23CB_t  cb23,
void *  priv21,
void *  priv23 
)

Public functions Initialize Q.921 Trunk

Definition at line 366 of file Q921.c.

References INITIALIZED_MAGIC, MFIFOCreate(), Q921_IS_PTMP, Q921_IS_PTMP_NT, Q921_TEI_MAX, and Q921MAXHDLCSPACE.

int Q921QueueHDLCFrame ( L2TRUNK  trunk,
L2UCHAR *  b,
L2INT  size 
)

Definition at line 1367 of file Q921.c.

References MFIFOWriteMes().

int Q921Rx12 ( L2TRUNK  trunk  ) 

Receive incoming data from Layer 1

Definition at line 3004 of file Q921.c.

References L2INT, L2UCHAR, MFIFOGetMesPtr(), MFIFOKillNext(), Q921_IS_PTMP_TE, Q921_LINK_CONTEXT, Q921_LOG_DEBUG, Q921_LOG_ERROR, Q921_STATE_TEI_ASSIGNED, Q921_STATE_TEI_UNASSIGNED, Q921_TEI_BCAST, Q921_Link::state, and Q921_Link::tei.

int Q921Rx32 ( L2TRUNK  trunk,
Q921DLMsg_t  ind,
L2UCHAR  tei,
L2UCHAR *  Mes,
L2INT  Size 
)

Receive data from Layer 3

TODO: NT mode handling? Need a way to get Link context from Q.931

Definition at line 1535 of file Q921.c.

void Q921SetGetTimeCB ( L2ULONG(*)(void)  callback  ) 

Set custom callback to get current time in ms

Definition at line 1343 of file Q921.c.

void Q921SetLogCB ( L2TRUNK  trunk,
Q921LogCB_t  func,
void *  priv 
)

Set logging callback.

Set logging callback and private data

Q921SetLogCB

Parameters:
[in] trunk pointer to Q921 data struct
[in] func pointer to logging callback function
[in] priv pointer to private data
Author:
Stefan Knoblich

Definition at line 3069 of file Q921.c.

void Q921SetLogLevel ( L2TRUNK  trunk,
Q921LogLevel_t  level 
)

Set loglevel of Q.921 logging functions.

Set loglevel

Q921SetLogLevel

Parameters:
[in] trunk pointer to Q921 data struct
[in] level new loglevel
Author:
Stefan Knoblich

Definition at line 3086 of file Q921.c.

int Q921Start ( L2TRUNK  trunk  ) 

Start trunk.

Start Q.921 Trunk

Q921Start

Parameters:
[in] trunk pointer to Q921 data struct
Returns:
> 0 on success; <= 0 on error

Definition at line 1776 of file Q921.c.

int Q921Stop ( L2TRUNK  trunk  ) 

Stop trunk.

Stop Q.921 Trunk

Q921Stop

Parameters:
[in] trunk pointer to Q921 data struct
Returns:
> 0 on success; <= 0 on error
Author:
Stefan Knoblich

Definition at line 1855 of file Q921.c.

void Q921TimerTick ( L2TRUNK  trunk  ) 

Update internal timers

Definition at line 1301 of file Q921.c.

References L2ULONG, Q921_IS_PTMP_NT, Q921_LINK_CONTEXT, Q921_STATE_STOPPED, Q921_TEI_MAX, Q921_Link::state, Q921_Link::T200, Q921_Link::T201, Q921_Link::T203, and Q921_Link::tei.


Generated on Tue Apr 7 17:38:19 2009 for mod_ssh by  doxygen 1.5.4