From eb9184ddb41d602fc1142a80d5801d0076e04456 Mon Sep 17 00:00:00 2001 From: Harald Welte Date: Mon, 4 Dec 2017 19:01:47 +0100 Subject: ggsn: Encode IPCP in IPCP Request, rather than using hard-coded hex string We now have a proper definition of IPCP in IPCP_Types and can thus encode/decode on the fly and avoid hand-crafted octetstrings. --- ggsn_tests/GGSN_Tests.ttcn | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'ggsn_tests/GGSN_Tests.ttcn') diff --git a/ggsn_tests/GGSN_Tests.ttcn b/ggsn_tests/GGSN_Tests.ttcn index 8b0d5e40..9e53e940 100644 --- a/ggsn_tests/GGSN_Tests.ttcn +++ b/ggsn_tests/GGSN_Tests.ttcn @@ -397,7 +397,8 @@ module GGSN_Tests { /* dummy PAP entry to check if our parser in the GGSN can properly iterate over * the list of protocols, see Change-Id Icc2e6716c33d78d3c3e000f529806228d8aa155e */ { protocolID := 'C023'O, lengthProtoID := 0, protoIDContents := ''O }, - { protocolID := '8021'O, lengthProtoID := 16, protoIDContents := '01000010810600000000830600000000'O } + { protocolID := '8021'O, lengthProtoID := 16, protoIDContents := + enc_IpcpPacket(valueof(ts_IPCP_ReqDNS)) } } } @@ -450,12 +451,20 @@ module GGSN_Tests { len := 6, data := addr } - template IpcpPacket tr_IPCP_Ack_DNS(template uint8_t identifier := ?, template OCT4 dns1 := ?, template OCT4 dns2 := ?) := tr_IPCP(LCP_Configure_Ack, identifier, { *, tr_IPCP_PrimaryDns(dns1), *, tr_IPCP_SecondaryDns(dns2), * }); + template IpcpPacket ts_IPCP(LcpCode code, uint8_t identifier, template IpcpOptionList opts) := { + code := code, + identifier := identifier, + len := 0, /* overwritten */ + options := opts + } + template IpcpPacket ts_IPCP_ReqDNS(uint8_t identifier := 0) := + ts_IPCP(LCP_Configure_Request, identifier, + { tr_IPCP_PrimaryDns('00000000'O), tr_IPCP_SecondaryDns('00000000'O) }); function f_teardown_ind_IE(in template BIT1 ind) return template TearDownInd { /* -- cgit v1.2.3