summaryrefslogtreecommitdiffstats
path: root/ggsn_tests/GGSN_Tests.ttcn
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2017-12-04 19:01:47 +0100
committerHarald Welte <laforge@gnumonks.org>2017-12-04 19:04:24 +0100
commiteb9184ddb41d602fc1142a80d5801d0076e04456 (patch)
tree75c6492fb3906567a705d9e9a3e8ab0ed85c9edc /ggsn_tests/GGSN_Tests.ttcn
parent71a36023dce72dd69aa110e09e1130a4b3cece67 (diff)
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.
Diffstat (limited to 'ggsn_tests/GGSN_Tests.ttcn')
-rw-r--r--ggsn_tests/GGSN_Tests.ttcn13
1 files changed, 11 insertions, 2 deletions
diff --git a/ggsn_tests/GGSN_Tests.ttcn b/ggsn_tests/GGSN_Tests.ttcn
index 8b0d5e4..9e53e94 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 {
/*