blob: 75bb092e5eac75dfeab5421dcf35d115a771c6b9 [file] [log] [blame]
Harald Welte71a36022017-12-04 18:55:58 +01001module IPCP_Types {
2
3import from Osmocom_Types all;
4
5/* RFC1331 Section 6 */
6type enumerated LcpCode {
7 LCP_Configure_Request ('01'O),
8 LCP_Configure_Ack ('02'O),
9 LCP_Configure_Nak ('03'O),
10 LCP_Configure_Reject ('04'O),
11 LCP_Terminate_Requeest ('05'O),
12 LCP_Terminate_Ack ('06'O),
13 LCP_Code_Reject ('07'O),
14 LCP_Protocol_Reject ('08'O),
15 LCP_Echo_Request ('09'O),
16 LCP_Echo_Reply ('10'O),
17 LCP_Discarded_Request ('11'O),
18 LCP_Reserved ('12'O)
19} with { variant "FIELDLENGTH(8)" };
20
21type record IpcpPacket {
22 LcpCode code,
23 uint8_t identifier,
24 uint16_t len,
25 IpcpOptionList options
26} with { variant (len) "LENGTHTO(code,identifier,len,options)" };
27
28/* RFC1332 */
29type enumerated IpcpConfigOptCode {
30 IPCP_OPT_IpAddresses ('01'O),
31 IPCP_OPT_IpCompressionProtocol ('02'O),
32 IPCP_OPT_IpAddress ('03'O),
33 IPCP_OPT_MobileIPv4 ('04'O),/* RFC 2290 */
34 IPCP_OPT_PrimaryDNS (129), /* RFC 1877 */
35 IPCP_OPT_PrimaryNBNS (130), /* RFC 1877 */
36 IPCP_OPT_SecondaryDNS (131), /* RFC 1877 */
37 IPCP_OPT_SecondaryNBNS (132) /* RFC 1877 */
38} with { variant "FIELDLENGTH(8)" };
39
40type record IpcpOption {
41 IpcpConfigOptCode code,
42 uint8_t len,
43 octetstring data
44} with { variant (len) "LENGTHTO(code,len,data)" };
45
46type record of IpcpOption IpcpOptionList;
47
48external function enc_IpcpPacket(in IpcpPacket inp) return octetstring
49with { extension "prototype(convert)" extension "encode(RAW)" };
50
51external function dec_IpcpPacket(in octetstring inp) return IpcpPacket
52with { extension "prototype(convert)" extension "decode(RAW)" };
53
54
55} with { encode "RAW" ; variant "FIELDORDER(msb)" }