aboutsummaryrefslogtreecommitdiffstats
path: root/library/IPCP_Types.ttcn
blob: 75bb092e5eac75dfeab5421dcf35d115a771c6b9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
module IPCP_Types {

import from Osmocom_Types all;

/* RFC1331 Section 6 */
type enumerated LcpCode {
	LCP_Configure_Request		('01'O),
	LCP_Configure_Ack		('02'O),
	LCP_Configure_Nak		('03'O),
	LCP_Configure_Reject		('04'O),
	LCP_Terminate_Requeest		('05'O),
	LCP_Terminate_Ack		('06'O),
	LCP_Code_Reject			('07'O),
	LCP_Protocol_Reject		('08'O),
	LCP_Echo_Request		('09'O),
	LCP_Echo_Reply			('10'O),
	LCP_Discarded_Request		('11'O),
	LCP_Reserved			('12'O)
} with { variant "FIELDLENGTH(8)" };

type record IpcpPacket {
	LcpCode		code,
	uint8_t		identifier,
	uint16_t	len,
	IpcpOptionList	options
} with { variant (len) "LENGTHTO(code,identifier,len,options)" };

/* RFC1332 */
type enumerated IpcpConfigOptCode {
	IPCP_OPT_IpAddresses		('01'O),
	IPCP_OPT_IpCompressionProtocol	('02'O),
	IPCP_OPT_IpAddress		('03'O),
	IPCP_OPT_MobileIPv4		('04'O),/* RFC 2290 */
	IPCP_OPT_PrimaryDNS		(129),	/* RFC 1877 */
	IPCP_OPT_PrimaryNBNS		(130),	/* RFC 1877 */
	IPCP_OPT_SecondaryDNS		(131),	/* RFC 1877 */
	IPCP_OPT_SecondaryNBNS		(132)	/* RFC 1877 */
} with { variant "FIELDLENGTH(8)" };

type record IpcpOption {
	IpcpConfigOptCode	code,
	uint8_t			len,
	octetstring		data
} with { variant (len) "LENGTHTO(code,len,data)" };

type record of IpcpOption IpcpOptionList;

external function enc_IpcpPacket(in IpcpPacket inp) return octetstring
with { extension "prototype(convert)" extension "encode(RAW)" };

external function dec_IpcpPacket(in octetstring inp) return IpcpPacket
with { extension "prototype(convert)" extension "decode(RAW)" };


} with { encode "RAW" ; variant "FIELDORDER(msb)" }