change linefeeds

git-svn-id: http://svn.openzap.org/svn/openzap/trunk@85 a93c3328-9c30-0410-af19-c9cd2b2d52af
This commit is contained in:
Anthony Minessale committed 2007-05-21 23:29:33 +00:00
1 parent b3551097c9
commit f969341e86
15 files changed
+12703 -12703

No files matched your search

+117 -117
View File
@@ -1,117 +1,117 @@
/*****************************************************************************
FileName: q921.h
Description: Contains headers of a Q.921 protocol on top of the Comet
Driver.
Most of the work required to execute a Q.921 protocol is
taken care of by the Comet ship and it's driver. This layer
will simply configure and make use of these features to
complete a Q.921 implementation.
Note: This header file is the only include file that should be
acessed by users of the Q.921 stack.
Interface: The Q.921 stack contains 2 layers.
- One interface layer.
- One driver layer.
The interface layer contains the interface functions required
for a layer 3 stack to be able to send and receive messages.
The driver layer will simply feed bytes into the ship as
required and queue messages received out from the ship.
Q921TimeTick The Q.921 like any other blackbox
modules contains no thread by it's own
and must therefore be called regularly
by an external 'thread' to do maintenance
etc.
Q921Rx32 Receive message from layer 3. Called by
the layer 3 stack to send a message.
Q921Tx23 Send a message to layer 3.
OnQ921Error Function called every if an error is
deteceted.
OnQ921Log Function called if logging is active.
<TODO> Maintenance/Configuration interface
Created: 27.dec.2000/JVB
License/Copyright:
Copyright (c) 2007, Jan Vidar Berger, Case Labs, Ltd. All rights reserved.
email:janvb@caselaboratories.com
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:
* Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
* Neither the name of the Case Labs, Ltd nor the names of its contributors
may be used to endorse or promote products derived from this software
without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
*****************************************************************************/
#ifndef _Q921
#define _Q921
#define Q921MAXTRUNK 4
#define Q921MAXHDLCSPACE 3000
/*****************************************************************************
Some speed optimization can be achieved by changing all variables to the
word size of your processor. A 32 bit processor have to do a lot of extra
work to read a packed 8 bit integer. Changing all fields to 32 bit integer
will ressult in usage of some extra space, but speed up the stack.
The stack have been designed to allow L3UCHAR etc. to be any size of 8 bit
or larger.
*****************************************************************************/
#define L2UCHAR unsigned char /* Min 8 bit */
#define L2INT int /* Min 16 bit signed */
typedef struct
{
L2UCHAR HDLCInQueue[Q921MAXHDLCSPACE];
L2UCHAR vs;
L2UCHAR vr;
int state;
}Q921Data;
void Q921Init();
void Q921SetHeaderSpace(int hspace);
void Q921SetTx21CB(int (*callback)(int dev, L2UCHAR *, int));
void Q921SetTx23CB(int (*callback)(int dev, L2UCHAR *, int));
int Q921QueueHDLCFrame(int trunk, L2UCHAR *b, int size);
int Q921Rx12(long trunk);
#endif
/*****************************************************************************
FileName: q921.h
Description: Contains headers of a Q.921 protocol on top of the Comet
Driver.
Most of the work required to execute a Q.921 protocol is
taken care of by the Comet ship and it's driver. This layer
will simply configure and make use of these features to
complete a Q.921 implementation.
Note: This header file is the only include file that should be
acessed by users of the Q.921 stack.
Interface: The Q.921 stack contains 2 layers.
- One interface layer.
- One driver layer.
The interface layer contains the interface functions required
for a layer 3 stack to be able to send and receive messages.
The driver layer will simply feed bytes into the ship as
required and queue messages received out from the ship.
Q921TimeTick The Q.921 like any other blackbox
modules contains no thread by it's own
and must therefore be called regularly
by an external 'thread' to do maintenance
etc.
Q921Rx32 Receive message from layer 3. Called by
the layer 3 stack to send a message.
Q921Tx23 Send a message to layer 3.
OnQ921Error Function called every if an error is
deteceted.
OnQ921Log Function called if logging is active.
<TODO> Maintenance/Configuration interface
Created: 27.dec.2000/JVB
License/Copyright:
Copyright (c) 2007, Jan Vidar Berger, Case Labs, Ltd. All rights reserved.
email:janvb@caselaboratories.com
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:
* Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
* Neither the name of the Case Labs, Ltd nor the names of its contributors
may be used to endorse or promote products derived from this software
without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
*****************************************************************************/
#ifndef _Q921
#define _Q921
#define Q921MAXTRUNK 4
#define Q921MAXHDLCSPACE 3000
/*****************************************************************************
Some speed optimization can be achieved by changing all variables to the
word size of your processor. A 32 bit processor have to do a lot of extra
work to read a packed 8 bit integer. Changing all fields to 32 bit integer
will ressult in usage of some extra space, but speed up the stack.
The stack have been designed to allow L3UCHAR etc. to be any size of 8 bit
or larger.
*****************************************************************************/
#define L2UCHAR unsigned char /* Min 8 bit */
#define L2INT int /* Min 16 bit signed */
typedef struct
{
L2UCHAR HDLCInQueue[Q921MAXHDLCSPACE];
L2UCHAR vs;
L2UCHAR vr;
int state;
}Q921Data;
void Q921Init();
void Q921SetHeaderSpace(int hspace);
void Q921SetTx21CB(int (*callback)(int dev, L2UCHAR *, int));
void Q921SetTx23CB(int (*callback)(int dev, L2UCHAR *, int));
int Q921QueueHDLCFrame(int trunk, L2UCHAR *b, int size);
int Q921Rx12(long trunk);
#endif
File diff suppressed because it is too large. Load diff
+191 -191
View File
@@ -1,191 +1,191 @@
/*****************************************************************************
FileName: Q932.h
Contents: Header w/structs for Q932 Suplementary Services.
NB: Do NOT include this header directly, include Q931.h
License/Copyright:
Copyright (c) 2007, Jan Vidar Berger, Case Labs, Ltd. All rights reserved.
email:janvb@caselaboratories.com
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:
* Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
* Neither the name of the Case Labs, Ltd nor the names of its contributors
may be used to endorse or promote products derived from this software
without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
*****************************************************************************/
/*****************************************************************************
Q.932 Additional Message codes
*****************************************************************************/
#define Q932mes_HOLD 0x24 /* 0010 0100 */
#define Q932mes_HOLD_ACKNOWLEDGE 0x28 /* 0010 1000 */
#define Q932mes_HOLD_REJECT 0x30 /* 0011 0000 */
#define Q932mes_RETRIEVE 0x31 /* 0011 0001 */
#define Q932mes_RETRIEVE_ACKNOWLEDGE 0x33 /* 0011 0011 */
#define Q932mes_RETRIEVE_REJECT 0x37 /* 0011 0111 */
#define Q932mes_FACILITY 0x62 /* 0110 0010 */
#define Q932mes_REGISTER 0x64 /* 0110 0100 */
/*****************************************************************************
Q.932 Additional EI Codes
*****************************************************************************/
#define Q932ie_FACILITY 0x1c /* 0001 1100 */
/*****************************************************************************
Struct: Q932ie_Facility
*****************************************************************************/
typedef struct
{
L3UINT Size; /* Size of message in bytes */
L3UCHAR ProtDisc; /* Protocol Discriminator */
L3UCHAR MesType; /* Message type */
L3USHORT CRV; /* Call reference value */
L3UCHAR buf[1]; /* Dynamic buffer */
}Q932mes_Facility;
/*****************************************************************************
Struct: Q932ie_Hold
*****************************************************************************/
typedef struct
{
L3UINT Size; /* Size of message in bytes */
L3UCHAR ProtDisc; /* Protocol Discriminator */
L3UCHAR MesType; /* Message type */
L3USHORT CRV; /* Call reference value */
L3UCHAR buf[1]; /* Dynamic buffer */
}Q932mes_Hold;
/*****************************************************************************
Struct: Q932ie_HoldAck
*****************************************************************************/
typedef struct
{
L3UINT Size; /* Size of message in bytes */
L3UCHAR ProtDisc; /* Protocol Discriminator */
L3UCHAR MesType; /* Message type */
L3USHORT CRV; /* Call reference value */
L3UCHAR buf[1]; /* Dynamic buffer */
}Q932mes_HoldAck;
/*****************************************************************************
Struct: Q932ie_HoldReject
*****************************************************************************/
typedef struct
{
L3UINT Size; /* Size of message in bytes */
L3UCHAR ProtDisc; /* Protocol Discriminator */
L3UCHAR MesType; /* Message type */
L3USHORT CRV; /* Call reference value */
L3UCHAR buf[1]; /* Dynamic buffer */
}Q932mes_HoldReject;
/*****************************************************************************
Struct: Q932ie_Register
*****************************************************************************/
typedef struct
{
L3UINT Size; /* Size of message in bytes */
L3UCHAR ProtDisc; /* Protocol Discriminator */
L3UCHAR MesType; /* Message type */
L3USHORT CRV; /* Call reference value */
L3UCHAR buf[1]; /* Dynamic buffer */
}Q932mes_Register;
/*****************************************************************************
Struct: Q932ie_Retrieve
*****************************************************************************/
typedef struct
{
L3UINT Size; /* Size of message in bytes */
L3UCHAR ProtDisc; /* Protocol Discriminator */
L3UCHAR MesType; /* Message type */
L3USHORT CRV; /* Call reference value */
L3UCHAR buf[1]; /* Dynamic buffer */
}Q932mes_Retrieve;
/*****************************************************************************
Struct: Q932ie_RetrieveAck
*****************************************************************************/
typedef struct
{
L3UINT Size; /* Size of message in bytes */
L3UCHAR ProtDisc; /* Protocol Discriminator */
L3UCHAR MesType; /* Message type */
L3USHORT CRV; /* Call reference value */
L3UCHAR buf[1]; /* Dynamic buffer */
}Q932mes_RetrieveAck;
/*****************************************************************************
Struct: Q932ie_RetrieveReject
*****************************************************************************/
typedef struct
{
L3UINT Size; /* Size of message in bytes */
L3UCHAR ProtDisc; /* Protocol Discriminator */
L3UCHAR MesType; /* Message type */
L3USHORT CRV; /* Call reference value */
L3UCHAR buf[1]; /* Dynamic buffer */
}Q932mes_RetrieveReject;
/*****************************************************************************
Function Prototypes.
*****************************************************************************/
L3INT Q932ProcFacilityTE(Q931_TrunkInfo *pTrunk, L3UCHAR * b, L3INT iFrom);
L3INT Q932ProcHoldTE(Q931_TrunkInfo *pTrunk, L3UCHAR * b, L3INT iFrom);
L3INT Q932ProcHoldAckTE(Q931_TrunkInfo *pTrunk, L3UCHAR * b, L3INT iFrom);
L3INT Q932ProcHoldRejectTE(Q931_TrunkInfo *pTrunk, L3UCHAR * b, L3INT iFrom);
L3INT Q932ProcRegisterTE(Q931_TrunkInfo *pTrunk, L3UCHAR * b, L3INT iFrom);
L3INT Q932ProcRetrieveTE(Q931_TrunkInfo *pTrunk, L3UCHAR * b, L3INT iFrom);
L3INT Q932ProcRetrieveAckTE(Q931_TrunkInfo *pTrunk, L3UCHAR * b, L3INT iFrom);
L3INT Q932ProcRetrieveRejectTE(Q931_TrunkInfo *pTrunk, L3UCHAR * b, L3INT iFrom);
L3INT Q932ProcFacilityNT(Q931_TrunkInfo *pTrunk, L3UCHAR * b, L3INT iFrom);
L3INT Q932ProcHoldNT(Q931_TrunkInfo *pTrunk, L3UCHAR * b, L3INT iFrom);
L3INT Q932ProcHoldAckNT(Q931_TrunkInfo *pTrunk, L3UCHAR * b, L3INT iFrom);
L3INT Q932ProcHoldRejectNT(Q931_TrunkInfo *pTrunk, L3UCHAR * b, L3INT iFrom);
L3INT Q932ProcRegisterNT(Q931_TrunkInfo *pTrunk, L3UCHAR * b, L3INT iFrom);
L3INT Q932ProcRetrieveNT(Q931_TrunkInfo *pTrunk, L3UCHAR * b, L3INT iFrom);
L3INT Q932ProcRetrieveAckNT(Q931_TrunkInfo *pTrunk, L3UCHAR * b, L3INT iFrom);
L3INT Q932ProcRetrieveRejectNT(Q931_TrunkInfo *pTrunk, L3UCHAR * b, L3INT iFrom);
L3INT Q932Pmes_Facility(Q931_TrunkInfo *pTrunk, L3UCHAR *IBuf, L3INT ISize, L3UCHAR *OBuf, L3INT *OSize);
L3INT Q932Pmes_Hold(Q931_TrunkInfo *pTrunk, L3UCHAR *IBuf, L3INT ISize, L3UCHAR *OBuf, L3INT *OSize);
L3INT Q932Pmes_HoldAck(Q931_TrunkInfo *pTrunk, L3UCHAR *IBuf, L3INT ISize, L3UCHAR *OBuf, L3INT *OSize);
L3INT Q932Pmes_HoldReject(Q931_TrunkInfo *pTrunk, L3UCHAR *IBuf, L3INT ISize, L3UCHAR *OBuf, L3INT *OSize);
L3INT Q932Pmes_Register(Q931_TrunkInfo *pTrunk, L3UCHAR *IBuf, L3INT ISize, L3UCHAR *OBuf, L3INT *OSize);
L3INT Q932Pmes_Retrieve(Q931_TrunkInfo *pTrunk, L3UCHAR *IBuf, L3INT ISize, L3UCHAR *OBuf, L3INT *OSize);
L3INT Q932Pmes_RetrieveAck(Q931_TrunkInfo *pTrunk, L3UCHAR *IBuf, L3INT ISize, L3UCHAR *OBuf, L3INT *OSize);
L3INT Q932Pmes_RetrieveReject(Q931_TrunkInfo *pTrunk, L3UCHAR *IBuf, L3INT ISize, L3UCHAR *OBuf, L3INT *OSize);
L3INT Q932Umes_Facility(Q931_TrunkInfo *pTrunk, L3UCHAR *IBuf, L3UCHAR * OBuf, L3INT I, L3INT O);
L3INT Q932Umes_Hold(Q931_TrunkInfo *pTrunk, L3UCHAR *IBuf, L3UCHAR * OBuf, L3INT I, L3INT O);
L3INT Q932Umes_HoldAck(Q931_TrunkInfo *pTrunk, L3UCHAR *IBuf, L3UCHAR * OBuf, L3INT I, L3INT O);
L3INT Q932Umes_HoldReject(Q931_TrunkInfo *pTrunk, L3UCHAR *IBuf, L3UCHAR * OBuf, L3INT I, L3INT O);
L3INT Q932Umes_Register(Q931_TrunkInfo *pTrunk, L3UCHAR *IBuf, L3UCHAR * OBuf, L3INT I, L3INT O);
L3INT Q932Umes_Retrieve(Q931_TrunkInfo *pTrunk, L3UCHAR *IBuf, L3UCHAR * OBuf, L3INT I, L3INT O);
L3INT Q932Umes_RetrieveAck(Q931_TrunkInfo *pTrunk, L3UCHAR *IBuf, L3UCHAR * OBuf, L3INT I, L3INT O);
L3INT Q932Umes_RetrieveReject(Q931_TrunkInfo *pTrunk, L3UCHAR *IBuf, L3UCHAR * OBuf, L3INT I, L3INT O);
/*****************************************************************************
FileName: Q932.h
Contents: Header w/structs for Q932 Suplementary Services.
NB: Do NOT include this header directly, include Q931.h
License/Copyright:
Copyright (c) 2007, Jan Vidar Berger, Case Labs, Ltd. All rights reserved.
email:janvb@caselaboratories.com
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:
* Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
* Neither the name of the Case Labs, Ltd nor the names of its contributors
may be used to endorse or promote products derived from this software
without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
*****************************************************************************/
/*****************************************************************************
Q.932 Additional Message codes
*****************************************************************************/
#define Q932mes_HOLD 0x24 /* 0010 0100 */
#define Q932mes_HOLD_ACKNOWLEDGE 0x28 /* 0010 1000 */
#define Q932mes_HOLD_REJECT 0x30 /* 0011 0000 */
#define Q932mes_RETRIEVE 0x31 /* 0011 0001 */
#define Q932mes_RETRIEVE_ACKNOWLEDGE 0x33 /* 0011 0011 */
#define Q932mes_RETRIEVE_REJECT 0x37 /* 0011 0111 */
#define Q932mes_FACILITY 0x62 /* 0110 0010 */
#define Q932mes_REGISTER 0x64 /* 0110 0100 */
/*****************************************************************************
Q.932 Additional EI Codes
*****************************************************************************/
#define Q932ie_FACILITY 0x1c /* 0001 1100 */
/*****************************************************************************
Struct: Q932ie_Facility
*****************************************************************************/
typedef struct
{
L3UINT Size; /* Size of message in bytes */
L3UCHAR ProtDisc; /* Protocol Discriminator */
L3UCHAR MesType; /* Message type */
L3USHORT CRV; /* Call reference value */
L3UCHAR buf[1]; /* Dynamic buffer */
}Q932mes_Facility;
/*****************************************************************************
Struct: Q932ie_Hold
*****************************************************************************/
typedef struct
{
L3UINT Size; /* Size of message in bytes */
L3UCHAR ProtDisc; /* Protocol Discriminator */
L3UCHAR MesType; /* Message type */
L3USHORT CRV; /* Call reference value */
L3UCHAR buf[1]; /* Dynamic buffer */
}Q932mes_Hold;
/*****************************************************************************
Struct: Q932ie_HoldAck
*****************************************************************************/
typedef struct
{
L3UINT Size; /* Size of message in bytes */
L3UCHAR ProtDisc; /* Protocol Discriminator */
L3UCHAR MesType; /* Message type */
L3USHORT CRV; /* Call reference value */
L3UCHAR buf[1]; /* Dynamic buffer */
}Q932mes_HoldAck;
/*****************************************************************************
Struct: Q932ie_HoldReject
*****************************************************************************/
typedef struct
{
L3UINT Size; /* Size of message in bytes */
L3UCHAR ProtDisc; /* Protocol Discriminator */
L3UCHAR MesType; /* Message type */
L3USHORT CRV; /* Call reference value */
L3UCHAR buf[1]; /* Dynamic buffer */
}Q932mes_HoldReject;
/*****************************************************************************
Struct: Q932ie_Register
*****************************************************************************/
typedef struct
{
L3UINT Size; /* Size of message in bytes */
L3UCHAR ProtDisc; /* Protocol Discriminator */
L3UCHAR MesType; /* Message type */
L3USHORT CRV; /* Call reference value */
L3UCHAR buf[1]; /* Dynamic buffer */
}Q932mes_Register;
/*****************************************************************************
Struct: Q932ie_Retrieve
*****************************************************************************/
typedef struct
{
L3UINT Size; /* Size of message in bytes */
L3UCHAR ProtDisc; /* Protocol Discriminator */
L3UCHAR MesType; /* Message type */
L3USHORT CRV; /* Call reference value */
L3UCHAR buf[1]; /* Dynamic buffer */
}Q932mes_Retrieve;
/*****************************************************************************
Struct: Q932ie_RetrieveAck
*****************************************************************************/
typedef struct
{
L3UINT Size; /* Size of message in bytes */
L3UCHAR ProtDisc; /* Protocol Discriminator */
L3UCHAR MesType; /* Message type */
L3USHORT CRV; /* Call reference value */
L3UCHAR buf[1]; /* Dynamic buffer */
}Q932mes_RetrieveAck;
/*****************************************************************************
Struct: Q932ie_RetrieveReject
*****************************************************************************/
typedef struct
{
L3UINT Size; /* Size of message in bytes */
L3UCHAR ProtDisc; /* Protocol Discriminator */
L3UCHAR MesType; /* Message type */
L3USHORT CRV; /* Call reference value */
L3UCHAR buf[1]; /* Dynamic buffer */
}Q932mes_RetrieveReject;
/*****************************************************************************
Function Prototypes.
*****************************************************************************/
L3INT Q932ProcFacilityTE(Q931_TrunkInfo *pTrunk, L3UCHAR * b, L3INT iFrom);
L3INT Q932ProcHoldTE(Q931_TrunkInfo *pTrunk, L3UCHAR * b, L3INT iFrom);
L3INT Q932ProcHoldAckTE(Q931_TrunkInfo *pTrunk, L3UCHAR * b, L3INT iFrom);
L3INT Q932ProcHoldRejectTE(Q931_TrunkInfo *pTrunk, L3UCHAR * b, L3INT iFrom);
L3INT Q932ProcRegisterTE(Q931_TrunkInfo *pTrunk, L3UCHAR * b, L3INT iFrom);
L3INT Q932ProcRetrieveTE(Q931_TrunkInfo *pTrunk, L3UCHAR * b, L3INT iFrom);
L3INT Q932ProcRetrieveAckTE(Q931_TrunkInfo *pTrunk, L3UCHAR * b, L3INT iFrom);
L3INT Q932ProcRetrieveRejectTE(Q931_TrunkInfo *pTrunk, L3UCHAR * b, L3INT iFrom);
L3INT Q932ProcFacilityNT(Q931_TrunkInfo *pTrunk, L3UCHAR * b, L3INT iFrom);
L3INT Q932ProcHoldNT(Q931_TrunkInfo *pTrunk, L3UCHAR * b, L3INT iFrom);
L3INT Q932ProcHoldAckNT(Q931_TrunkInfo *pTrunk, L3UCHAR * b, L3INT iFrom);
L3INT Q932ProcHoldRejectNT(Q931_TrunkInfo *pTrunk, L3UCHAR * b, L3INT iFrom);
L3INT Q932ProcRegisterNT(Q931_TrunkInfo *pTrunk, L3UCHAR * b, L3INT iFrom);
L3INT Q932ProcRetrieveNT(Q931_TrunkInfo *pTrunk, L3UCHAR * b, L3INT iFrom);
L3INT Q932ProcRetrieveAckNT(Q931_TrunkInfo *pTrunk, L3UCHAR * b, L3INT iFrom);
L3INT Q932ProcRetrieveRejectNT(Q931_TrunkInfo *pTrunk, L3UCHAR * b, L3INT iFrom);
L3INT Q932Pmes_Facility(Q931_TrunkInfo *pTrunk, L3UCHAR *IBuf, L3INT ISize, L3UCHAR *OBuf, L3INT *OSize);
L3INT Q932Pmes_Hold(Q931_TrunkInfo *pTrunk, L3UCHAR *IBuf, L3INT ISize, L3UCHAR *OBuf, L3INT *OSize);
L3INT Q932Pmes_HoldAck(Q931_TrunkInfo *pTrunk, L3UCHAR *IBuf, L3INT ISize, L3UCHAR *OBuf, L3INT *OSize);
L3INT Q932Pmes_HoldReject(Q931_TrunkInfo *pTrunk, L3UCHAR *IBuf, L3INT ISize, L3UCHAR *OBuf, L3INT *OSize);
L3INT Q932Pmes_Register(Q931_TrunkInfo *pTrunk, L3UCHAR *IBuf, L3INT ISize, L3UCHAR *OBuf, L3INT *OSize);
L3INT Q932Pmes_Retrieve(Q931_TrunkInfo *pTrunk, L3UCHAR *IBuf, L3INT ISize, L3UCHAR *OBuf, L3INT *OSize);
L3INT Q932Pmes_RetrieveAck(Q931_TrunkInfo *pTrunk, L3UCHAR *IBuf, L3INT ISize, L3UCHAR *OBuf, L3INT *OSize);
L3INT Q932Pmes_RetrieveReject(Q931_TrunkInfo *pTrunk, L3UCHAR *IBuf, L3INT ISize, L3UCHAR *OBuf, L3INT *OSize);
L3INT Q932Umes_Facility(Q931_TrunkInfo *pTrunk, L3UCHAR *IBuf, L3UCHAR * OBuf, L3INT I, L3INT O);
L3INT Q932Umes_Hold(Q931_TrunkInfo *pTrunk, L3UCHAR *IBuf, L3UCHAR * OBuf, L3INT I, L3INT O);
L3INT Q932Umes_HoldAck(Q931_TrunkInfo *pTrunk, L3UCHAR *IBuf, L3UCHAR * OBuf, L3INT I, L3INT O);
L3INT Q932Umes_HoldReject(Q931_TrunkInfo *pTrunk, L3UCHAR *IBuf, L3UCHAR * OBuf, L3INT I, L3INT O);
L3INT Q932Umes_Register(Q931_TrunkInfo *pTrunk, L3UCHAR *IBuf, L3UCHAR * OBuf, L3INT I, L3INT O);
L3INT Q932Umes_Retrieve(Q931_TrunkInfo *pTrunk, L3UCHAR *IBuf, L3UCHAR * OBuf, L3INT I, L3INT O);
L3INT Q932Umes_RetrieveAck(Q931_TrunkInfo *pTrunk, L3UCHAR *IBuf, L3UCHAR * OBuf, L3INT I, L3INT O);
L3INT Q932Umes_RetrieveReject(Q931_TrunkInfo *pTrunk, L3UCHAR *IBuf, L3UCHAR * OBuf, L3INT I, L3INT O);
+83 -83
View File
@@ -1,83 +1,83 @@
/*****************************************************************************
Filename: mfifo.h
Contents: header for MFIFO
License/Copyright:
Copyright (c) 2007, Jan Vidar Berger, Case Labs, Ltd. All rights reserved.
email:janvb@caselaboratories.com
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:
* Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
* Neither the name of the Case Labs, Ltd nor the names of its contributors
may be used to endorse or promote products derived from this software
without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
*****************************************************************************/
#ifndef _MFIFO
#define _MFIFO
/*****************************************************************************
Struct: MINDEX
Description: Message Index used to index a dynamic size Message FIFO.
*****************************************************************************/
typedef struct _mindex
{
int offset; /* offset to message in buf */
int size; /* size of message in bytes */
}MINDEX;
/*****************************************************************************
Struct: MFIFO
Description: Message FIFO. Provides a dynamic sized message based FIFO
queue.
*****************************************************************************/
typedef struct _mfifo
{
int first; /* first out */
int last; /* last in + 1 */
int bsize; /* buffer size */
unsigned char *buf; /* ptr to start of buffer */
int ixsize; /* index size */
MINDEX ix[1]; /* message index */
}MFIFO;
/*****************************************************************************
Function prototypes.
*****************************************************************************/
int MFIFOCreate(unsigned char *buf, int size, int index);
void MFIFOClear(unsigned char * buf);
int MFIFOGetLBOffset(unsigned char *buf);
int MFIFOGetFBOffset(unsigned char *buf);
void MFIFOWriteIX(unsigned char *buf, unsigned char *mes, int size, int ix, int off);
int MFIFOWriteMes(unsigned char *buf, unsigned char *mes, int size);
unsigned char * MFIFOGetMesPtr(unsigned char *buf, int *size);
void MFIFOKillNext(unsigned char *buf);
#endif
/*****************************************************************************
Filename: mfifo.h
Contents: header for MFIFO
License/Copyright:
Copyright (c) 2007, Jan Vidar Berger, Case Labs, Ltd. All rights reserved.
email:janvb@caselaboratories.com
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:
* Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
* Neither the name of the Case Labs, Ltd nor the names of its contributors
may be used to endorse or promote products derived from this software
without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
*****************************************************************************/
#ifndef _MFIFO
#define _MFIFO
/*****************************************************************************
Struct: MINDEX
Description: Message Index used to index a dynamic size Message FIFO.
*****************************************************************************/
typedef struct _mindex
{
int offset; /* offset to message in buf */
int size; /* size of message in bytes */
}MINDEX;
/*****************************************************************************
Struct: MFIFO
Description: Message FIFO. Provides a dynamic sized message based FIFO
queue.
*****************************************************************************/
typedef struct _mfifo
{
int first; /* first out */
int last; /* last in + 1 */
int bsize; /* buffer size */
unsigned char *buf; /* ptr to start of buffer */
int ixsize; /* index size */
MINDEX ix[1]; /* message index */
}MFIFO;
/*****************************************************************************
Function prototypes.
*****************************************************************************/
int MFIFOCreate(unsigned char *buf, int size, int index);
void MFIFOClear(unsigned char * buf);
int MFIFOGetLBOffset(unsigned char *buf);
int MFIFOGetFBOffset(unsigned char *buf);
void MFIFOWriteIX(unsigned char *buf, unsigned char *mes, int size, int ix, int off);
int MFIFOWriteMes(unsigned char *buf, unsigned char *mes, int size);
unsigned char * MFIFOGetMesPtr(unsigned char *buf, int *size);
void MFIFOKillNext(unsigned char *buf);
#endif