From 611a7b37ed80aac42f4157a41ced96643188b7b2 Mon Sep 17 00:00:00 2001 From: winckel Date: Wed, 22 Jan 2014 09:31:58 +0000 Subject: [PATCH] Modify NAS log point format to cope with possible non printable first character in APN. git-svn-id: http://svn.eurecom.fr/openair4G/trunk@4928 818b1a75-f10b-46b9-bf7c-635c3b92a50f --- .../NAS/EURECOM-NAS/src/esm/PdnConnectivity.c | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/openair-cn/NAS/EURECOM-NAS/src/esm/PdnConnectivity.c b/openair-cn/NAS/EURECOM-NAS/src/esm/PdnConnectivity.c index 7d91863c48..98ad89dead 100644 --- a/openair-cn/NAS/EURECOM-NAS/src/esm/PdnConnectivity.c +++ b/openair-cn/NAS/EURECOM-NAS/src/esm/PdnConnectivity.c @@ -31,6 +31,7 @@ Description Defines the PDN connectivity ESM procedure executed by the #include // malloc, free #include // memset, memcpy, memcmp +#include // isprint #include "esm_proc.h" #include "commonDef.h" @@ -233,7 +234,7 @@ int esm_proc_pdn_connectivity(int cid, int is_to_define, "already exists", (_esm_data.pdn[pid].data->type != ESM_PDN_TYPE_IPV4)? (_esm_data.pdn[pid].data->type != ESM_PDN_TYPE_IPV6)? - "IPv4v6" : "IPv6" : "IPv4", apn->value); + "IPv4v6" : "IPv6" : "IPv4", apn->value); LOG_FUNC_RETURN (RETURNerror); } } @@ -349,11 +350,18 @@ int esm_proc_pdn_connectivity_accept(int pti, esm_proc_pdn_type_t pdn_type, { LOG_FUNC_IN; - int rc; - int pid = RETURNerror; + int rc; + int pid = RETURNerror; + char apn_first_char[4]; + + if (isprint(apn->value[0])) { + apn_first_char[0] = '\0'; + } else { + sprintf (apn_first_char, "%02X", apn->value[0]); + } LOG_TRACE(INFO, "ESM-PROC - PDN connectivity accepted by the network " - "(pti=%d) APN = %s, IP address = %s", pti, apn->value, + "(pti=%d) APN = %s\"%s\", IP address = %s", pti, apn_first_char, isprint(apn->value[0]) ? &apn->value[0] : &apn->value[1], (pdn_type == ESM_PDN_TYPE_IPV4)? esm_data_get_ipv4_addr(pdn_addr) : (pdn_type == ESM_PDN_TYPE_IPV6)? esm_data_get_ipv6_addr(pdn_addr) : esm_data_get_ipv4v6_addr(pdn_addr));