Description: Code
#ifndef _SYS_TPI_H
#define _SYS_TPI_H
#ident "@(#) tpi.h,v openss7-0_9_2_G(0.9.2.9) Copyright (c) 2001-2008 OpenSS7 Corporation."
#if 0
#if !defined _XTI_H && !defined _TIUSER_H && !defined _TIHDR_H && !defined __KERNEL__
#error ****
#error **** Do not include system header files directly in user-space
#error **** programs. Likely you should have included <timod.h>
#error **** instead of <sys/timod.h>.
#error ****
#endif
#endif
#define TBADADDR 1
#define TBADOPT 2
#define TACCES 3
#define TBADF 4
#define TNOADDR 5
#define TOUTSTATE 6
#define TBADSEQ 7
#define TSYSERR 8
#define TLOOK 9
#define TBADDATA 10
#define TBUFOVFLW 11
#define TFLOW 12
#define TNODATA 13
#define TNODIS 14
#define TNOUDERR 15
#define TBADFLAG 16
#define TNOREL 17
#define TNOTSUPPORT 18
#define TSTATECHNG 19
#if defined _XPG3 || defined _XOPEN_SOURCE || defined __KERNEL__
#define TNOSTRUCTYPE 20
#define TBADNAME 21
#define TBADQLEN 22
#define TADDRBUSY 23
#endif
#if defined _XOPEN_SOURCE || defined __KERNEL__
#define TINDOUT 24
#define TPROVMISMATCH 25
#define TRESQLEN 26
#define TRESADDR 27
#define TQFULL 28
#define TPROTO 29
#endif
#define T_COTS 1
#define T_COTS_ORD 2
#define T_CLTS 3
#define T_SNDZERO 0x001
#define T_SENDZERO 0x001
#define T_ORDRELDATA 0x002
#define XPG4_1 0x100
#define T_XPG4_1 0x100
#define T_MORE 0x001
#define T_EXPEDITED 0x002
#define T_PUSH 0x004
#define T_NEGOTIATE 0x0004
#define T_CHECK 0x0008
#define T_DEFAULT 0x0010
#define T_SUCCESS 0x0020
#define T_FAILURE 0x0040
#if defined _XPG4_2 || defined _XOPEN_SOURCE || defined __KERNEL__
#define T_CURRENT 0x0080
#define T_PARTSUCCESS 0x0100
#define T_READONLY 0x0200
#define T_NOTSUPPORT 0x0400
#endif
#define T_ALLOPT 0
#define T_UNSPEC (~0-2)
#define T_INVALID (-2)
#define T_INFINITE (-1)
#define T_NO 0
#define T_YES 1
#define T_GARBAGE 2
#define T_UNUSED (-1)
#define T_NULL 0
#define T_ABSREQ 0x8000
#ifndef t_uscalar_t
#define t_uscalar_t uint32_t
#endif
#if !(defined _XPG4_2 || defined _XOPEN_SOURCE) || defined __KERNEL__
struct opthdr {
t_uscalar_t level;
t_uscalar_t name;
t_uscalar_t len;
char value[0];
};
#define OPTLEN(len) \
((((len) + sizeof(t_uscalar_t) - 1) sizeof(t_uscalar_t)) * sizeof(t_uscalar_t))
#define OPTVAL(opt) \
((char *)((struct opthdr *)opt + 1))
#endif
#if defined _XPG4_2 || defined _XOPEN_SOURCE || defined __KERNEL__
struct t_opthdr {
t_uscalar_t len;
t_uscalar_t level;
t_uscalar_t name;
t_uscalar_t status;
char value[0];
};
#define _T_ALIGN_SIZE sizeof(t_uscalar_t)
#define _T_ALIGN_OFS(p, o) \
((char *)(((unsigned long)(p) - (o) + _T_ALIGN_SIZE - 1) \
& ~(_T_ALIGN_SIZE - 1)) + (o))
#define _T_ALIGN_OFFSET(p) \
((unsigned long)(p) & (_T_ALIGN_SIZE - 1))
#define _T_ALIGN_OFS_OFS(p, l, o) _T_ALIGN_OFS((char *)(p) + l, (o))
#define _T_OPT_FIRSTHDR_OFS(b, l, o) \
((struct t_opthdr *)( \
(_T_ALIGN_OFS((b), (o)) + sizeof(struct t_opthdr) \
<= (char *)(b) + (l)) ? \
_T_ALIGN_OFS((b), (o)) : NULL))
#define _T_OPT_NEXTHDR_OFS(b, l, p, o) \
((struct t_opthdr *)( \
(_T_ALIGN_OFS_OFS((p), (p)->len + sizeof(struct t_opthdr), (o)) \
<= ((char *)(b) + (l))) ? \
_T_ALIGN_OFS_OFS((p), (p)->len, (o)) : NULL \
))
#define _T_OPT_DATA_OFS(p, o) \
((unsigned char *)(_T_ALIGN_OFS((struct t_opthdr *)(p)+1, (o))))
#define T_OPT_FIRSTHDR(b) _T_OPT_FIRSTHDR_OFS((b)->buf, (b)->len, 0)
#define T_OPT_NEXTHDR(b, p) _T_OPT_NEXTHDR_OFS((b)->buf, (b)->len, p, 0)
#define T_OPT_DATA(p) _T_OPT_DATA_OFS((p), 0)
#endif
#endif