sccp: Add a test case for GTI creation, set the SSN indicator bit

Make sure that creating an address that should be routed based on
the GTI can be created properly.
This commit is contained in:
Holger Hans Peter Freyther 2010-11-26 18:16:11 +01:00
parent 4698d27f4c
commit 039c7adcd5
2 changed files with 22 additions and 1 deletions

View File

@ -491,7 +491,7 @@ int sccp_create_sccp_addr(struct msgb *msg, const struct sockaddr_sccp *sock)
if (sock->gti)
ai[0] = 0 << 6 | (sock->gti_ind & 0x0f) << 2;
ai[0] = 0 << 6 | (sock->gti_ind & 0x0f) << 2 | 1 << 1;
else
ai[0] = 1 << 6 | 1 << 1;

View File

@ -914,6 +914,22 @@ static uint8_t poi_out[] = {
0x04, 0x43, 0x01, 0x00, 0xfe,
};
static uint8_t gti_dat[] = {
0x00, 0x12, 0x04, 0x53, 0x84, 0x09, 0x00, 0x17,
};
const struct sockaddr_sccp sccp_gti_bssap = {
.sccp_family = 0,
.sccp_ssn = 7,
.gti_ind = 4,
.gti_len = ARRAY_SIZE(gti_dat),
.gti = gti_dat,
};
static uint8_t gti_out[] = {
0x0a, 0x12, 0x07, 0x00, 0x12, 0x04, 0x53, 0x84, 0x09, 0x00, 0x17,
};
static struct sccp_addr_tst sccp_addr_tst[] = {
{
.addr = &sccp_ssn_bssap,
@ -925,6 +941,11 @@ static struct sccp_addr_tst sccp_addr_tst[] = {
.output = poi_out,
.output_len = ARRAY_SIZE(poi_out),
},
{
.addr = &sccp_gti_bssap,
.output = gti_out,
.output_len = ARRAY_SIZE(gti_out),
},
};
static void test_sccp_address()