Commit 66231bad authored by Guido Casati's avatar Guido Casati

Refactor PDU address IE in PDU Session Establishment Accept

* take 3 bits for PDU session type value
* add define for SMF's IPv6 link local address
parent a85be06c
...@@ -124,8 +124,18 @@ void capture_pdu_session_establishment_accept_msg(uint8_t *buffer, uint32_t msg_ ...@@ -124,8 +124,18 @@ void capture_pdu_session_establishment_accept_msg(uint8_t *buffer, uint32_t msg_
case IEI_PDU_ADDRESS: case IEI_PDU_ADDRESS:
LOG_T(NAS, "PDU SESSION ESTABLISHMENT ACCEPT - Received PDU Address IE\n"); LOG_T(NAS, "PDU SESSION ESTABLISHMENT ACCEPT - Received PDU Address IE\n");
psea_msg.pdu_addr_ie.pdu_length = *curPtr++; psea_msg.pdu_addr_ie.pdu_length = *curPtr++;
psea_msg.pdu_addr_ie.pdu_type = *curPtr++;
/* Octet 3 */
// PDU type (3 bits)
psea_msg.pdu_addr_ie.pdu_type = *curPtr & 0x07;
// SMF's IPv6 link local address (1 bit)
uint8_t si6lla = (*curPtr >> 3) & 0x01;
if (si6lla)
LOG_E(NAS, "SMF's IPv6 link local address is not handled\n");
curPtr++;
/* Octet 4 to n */
// PDU address information
uint8_t *addr = psea_msg.pdu_addr_ie.pdu_addr_oct; uint8_t *addr = psea_msg.pdu_addr_ie.pdu_addr_oct;
if (psea_msg.pdu_addr_ie.pdu_type == PDU_SESSION_TYPE_IPV4) { if (psea_msg.pdu_addr_ie.pdu_type == PDU_SESSION_TYPE_IPV4) {
for (int i = 0; i < IPv4_ADDRESS_LENGTH; ++i) for (int i = 0; i < IPv4_ADDRESS_LENGTH; ++i)
......
...@@ -44,6 +44,7 @@ ...@@ -44,6 +44,7 @@
#define PDU_SESSION_TYPE_IPV4V6 0b011 #define PDU_SESSION_TYPE_IPV4V6 0b011
#define IPv4_ADDRESS_LENGTH 4 // length of the IPv4 address associated with a PDU session #define IPv4_ADDRESS_LENGTH 4 // length of the IPv4 address associated with a PDU session
#define IPv6_INTERFACE_ID_LENGTH 8 // interface identifier for the IPv6 link local address #define IPv6_INTERFACE_ID_LENGTH 8 // interface identifier for the IPv6 link local address
#define SMF_IPv6_LLA_LENGTH 16
/* Rule operation codes - TS 24.501 Table 9.11.4.13.1 */ /* Rule operation codes - TS 24.501 Table 9.11.4.13.1 */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment