#include <netx25/x25_proto.h> #include <netx25/xnetdb.h> int padtos ( struct padent *p, unsigned char *strp );
Converts a PAD structure into a string containing all the facilities, CUGs, RPOAs and call user data defined in the PAD structure. The validity of the structure is checked before conversion.
The parameters are:
Table 8-15 padtos parameters
Parameter |
Description |
---|---|
p |
A pointer to the padent structure for conversion. |
strp |
A pointer to the character string that will hold the result. |
The character string pointed to by strp takes this format:
~CUD facilities year CUG RPOA
All of the values are optional:
Table 8-16 strp character string values
Value |
Description |
---|---|
CUD |
Call User Data. This is always preceded by a tilde (~). |
Facilities |
Holds the values for packet size, window size, fast select and reverse charging. |
Year |
Possible values are 80, 84 and 88. These correspond to the X.29(80) Yellow Book, X.29(84) Red Book and X.29(88) Blue Book. |
CUG |
Specifies any call user groups that apply to this call. Preceded by g, G, b or B. b and B signify bilateral CUGs. |
RPOA |
Signifies any Recognized Private Operating Agency. Always preceded by T or t. |
For example this string:
~hello p7/9w4/2fr 80 B1234 T5678
has the following meaning:
The CUD is hello. There is a local-to-remote packet size of 7 a remote-to-local packet size of 9, a local-to-remote window size of 4 a remote -to-local window size of 2. Fast select and reverse charging are set. The X.29(80) Yellow Book recommendation is being used. The bilateral CUG is 1234 and the RPOA is 5678.
On success this function returns 0. A negative return value indicates that the pad structure was invalid.