sua: Support SUA_IEI_IPv6

Change-Id: I5bd69e8400fd2d9251b5d4edd9bf3514e1194b5a
This commit is contained in:
Pau Espin 2020-09-14 12:16:02 +02:00
parent b114b73e5d
commit 95e2ec698d
2 changed files with 8 additions and 2 deletions

View File

@ -467,6 +467,13 @@ int sua_addr_parse_part(struct osmo_sccp_addr *out,
out->ip.v4.s_addr = *p32;
out->presence |= OSMO_SCCP_ADDR_T_IPv4;
break;
case SUA_IEI_IPv6:
if (par_datalen != 16)
goto subpar_fail;
/* no endian conversion, both network order */
memcpy(&out->ip.v6, par->data, 16);
out->presence |= OSMO_SCCP_ADDR_T_IPv6;
break;
default:
LOGP(DLSUA, LOGL_ERROR, "SUA IEI 0x%04x: Unknown subpart tag %hd\n",
param->tag, par_tag);
@ -739,4 +746,3 @@ out:
return rc;
}

View File

@ -378,7 +378,7 @@ int xua_msg_add_sccp_addr(struct xua_msg *xua, uint16_t iei, const struct osmo_s
if (addr->presence & OSMO_SCCP_ADDR_T_IPv4) {
msgb_t16l16vp_put_u32(tmp, SUA_IEI_IPv4, ntohl(addr->ip.v4.s_addr));
} else if (addr->presence & OSMO_SCCP_ADDR_T_IPv6) {
/* FIXME: IPv6 address */
msgb_t16l16vp_put(tmp, SUA_IEI_IPv6, sizeof(addr->ip.v6), (const uint8_t *)&addr->ip.v6);
}
rc = xua_msg_add_data(xua, iei, msgb_length(tmp), tmp->data);
msgb_free(tmp);