libisdn
Q931mes.c File Reference
#include <stdio.h>
#include <stdlib.h>
#include <assert.h>
#include <string.h>
#include <limits.h>
#include "Q931.h"
#include "Q931priv.h"
#include "Q932.h"
#include "utils/strstream.h"

Go to the source code of this file.

Data Structures

struct  Q931MesgErrorName

Defines

#define TMP_BUFSIZE   4096
#define TMP_PUTS(fmt)
#define TMP_APPEND(fmt, args...)   offset += snprintf(tmp + offset, sizeof(tmp) - offset, fmt, ##args);
#define TMP_MIN(x, y)   ((x) < (y)) ? (x) : (y)

Functions

L3INT Q931MesgHeader (Q931_TrunkInfo_t *trunk, Q931mes_Generic *mes, L3UCHAR *OBuf, L3INT Size, L3INT *IOff)
 Create Q.931 Message header.
L3INT Q931Umes_Generic (Q931_TrunkInfo_t *trunk, L3UCHAR *IBuf, Q931mes_Generic *mes, L3INT IOff, L3INT Size, struct Q931MesgErrors *Errs)
 A generic table driven codeset aware decode function for messages.
L3INT Q931Dmes_Generic (Q931_TrunkInfo_t *trunk, Q931mes_Generic *msg, q931_msg_direction_t direction)
 Print message debug information.
L3INT Q931Pmes_Generic (Q931_TrunkInfo_t *trunk, Q931mes_Generic *msg, L3INT ISize, L3UCHAR *OBuf, L3INT *OSize)
L3INT Q931MesgErrorsInit (struct Q931MesgErrors *merrs, const char id)
L3INT Q931MesgErrorsAddIE (struct Q931MesgErrors *merrs, const char id, const char size, const int offset, const int error)
L3INT Q931MesgErrorsCount (struct Q931MesgErrors *merrs)
L3INT Q931MesgErrorsPrint (Q931_TrunkInfo_t *trunk, const struct Q931MesgErrors *merrs, const unsigned char *IBuf, const int Size)

Variables

struct Q931MessageIE Q931MessageIEs []

Define Documentation

#define TMP_APPEND (   fmt,
  args... 
)    offset += snprintf(tmp + offset, sizeof(tmp) - offset, fmt, ##args);

Definition at line 1275 of file Q931mes.c.

Referenced by Q931MesgErrorsPrint().

#define TMP_BUFSIZE   4096

Definition at line 1271 of file Q931mes.c.

Referenced by Q931MesgErrorsPrint().

#define TMP_MIN (   x,
 
)    ((x) < (y)) ? (x) : (y)

Definition at line 1310 of file Q931mes.c.

Referenced by Q931MesgErrorsPrint().

#define TMP_PUTS (   fmt)
Value:
strncat(tmp + offset, fmt, sizeof(tmp) - offset - 1); \
        offset += strlen(tmp + offset);

Definition at line 1272 of file Q931mes.c.

Referenced by Q931MesgErrorsPrint().


Function Documentation

L3INT Q931MesgErrorsAddIE ( struct Q931MesgErrors merrs,
const char  id,
const char  size,
const int  offset,
const int  error 
)

Add IE error to message error buffer

Parameters:
merrsMessage error buffer
idIE id
sizeIE size
offsetIE offset
errorIE error code
Returns:
Q931E_NO_ERROR on success

Definition at line 1240 of file Q931mes.c.

References Q931MesgErrors::error, id, Q931MesgErrors::id, Q931MesgErrors::ie_errors, Q931MesgErrors::nr_errors, Q931MesgErrors::nr_overflow, Q931MesgErrors::offset, Q931_MSGE_ERR_MAX, Q931E_NO_ERROR, and Q931MesgErrors::size.

Referenced by Q931Umes_Generic().

Get number of errors

Parameters:
merrsMessage error buffer
Returns:
Q931E_NO_ERROR on success

Definition at line 1265 of file Q931mes.c.

References Q931MesgErrors::nr_errors.

L3INT Q931MesgErrorsInit ( struct Q931MesgErrors merrs,
const char  id 
)

Initialize message error buffer and set message id

Parameters:
merrsMessage error buffer
idMessage id
Returns:
Q931E_NO_ERROR on success

Definition at line 1220 of file Q931mes.c.

References id, Q931MesgErrors::id, and Q931E_NO_ERROR.

Referenced by Q931Rx23().

L3INT Q931MesgErrorsPrint ( Q931_TrunkInfo_t trunk,
const struct Q931MesgErrors merrs,
const unsigned char *  IBuf,
const int  Size 
)
L3INT Q931MesgHeader ( Q931_TrunkInfo_t trunk,
Q931mes_Generic mes,
L3UCHAR OBuf,
L3INT  Size,
L3INT IOff 
)

Create Q.931 Message header.

Q931MesgHeader

Definition at line 699 of file Q931mes.c.

References Q931mes_Generic::CRV, Q931mes_Generic::CRVFlag, L3INT, L3UCHAR, Q931mes_Generic::MesType, Q931mes_Generic::ProtDisc, Q931_IS_BRI, Q931_LOG_DEBUG, and Q931Log().

Referenced by Q931Pmes_Generic().


Variable Documentation

Definition at line 64 of file Q931mes.c.

Referenced by Q931CreateNT(), and Q931CreateTE().