From d600d4e3ae107d86fc60b4c7b345c76e95241a30 Mon Sep 17 00:00:00 2001 From: Sukchan Lee Date: Tue, 21 Mar 2017 12:19:46 +0900 Subject: [PATCH] update it --- lib/nas/support/cache/nas_msg_82.py | 6 +++--- lib/nas/support/cache/nas_msg_84.py | 2 -- lib/nas/support/cache/nas_msg_93.py | 4 ++-- lib/nas/support/nas_message.py | 18 ++++++++++-------- 4 files changed, 15 insertions(+), 15 deletions(-) delete mode 100644 lib/nas/support/cache/nas_msg_84.py diff --git a/lib/nas/support/cache/nas_msg_82.py b/lib/nas/support/cache/nas_msg_82.py index 26c1adc285..421ae72c72 100644 --- a/lib/nas/support/cache/nas_msg_82.py +++ b/lib/nas/support/cache/nas_msg_82.py @@ -1,5 +1,5 @@ ies = [] -ies.append({ "iei" : "", "value" : "NAS key set identifierASME ", "type" : "NAS key set identifier", "reference" : "9.9.3.21", "presence" : "M", "format" : "V", "length" : "1/2"}) -ies.append({ "iei" : "", "value" : "Authentication parameter RAND (EPS challenge)", "type" : "Authentication parameter RAND", "reference" : "9.9.3.3", "presence" : "M", "format" : "V", "length" : "16"}) -ies.append({ "iei" : "", "value" : "Authentication parameter AUTN (EPS challenge)", "type" : "Authentication parameter AUTN", "reference" : "9.9.3.2", "presence" : "M", "format" : "LV", "length" : "17"}) +ies.append({ "iei" : "", "value" : "NAS key set identifierASME", "type" : "key set identifier", "reference" : "9.9.3.21", "presence" : "M", "format" : "V", "length" : "1/2"}) +ies.append({ "iei" : "", "value" : "Authentication parameter RAND", "type" : "Authentication parameter RAND", "reference" : "9.9.3.3", "presence" : "M", "format" : "V", "length" : "16"}) +ies.append({ "iei" : "", "value" : "Authentication parameter AUTN", "type" : "Authentication parameter AUTN", "reference" : "9.9.3.2", "presence" : "M", "format" : "LV", "length" : "17"}) msg_list[key]["ies"] = ies diff --git a/lib/nas/support/cache/nas_msg_84.py b/lib/nas/support/cache/nas_msg_84.py deleted file mode 100644 index bdf2b4880f..0000000000 --- a/lib/nas/support/cache/nas_msg_84.py +++ /dev/null @@ -1,2 +0,0 @@ -ies = [] -msg_list[key]["ies"] = ies diff --git a/lib/nas/support/cache/nas_msg_93.py b/lib/nas/support/cache/nas_msg_93.py index 3c403a7038..5c10ee61d6 100644 --- a/lib/nas/support/cache/nas_msg_93.py +++ b/lib/nas/support/cache/nas_msg_93.py @@ -1,6 +1,6 @@ ies = [] -ies.append({ "iei" : "", "value" : "Selected NAS security algorithms", "type" : "NAS security algorithms", "reference" : "9.9.3.23", "presence" : "M", "format" : "V", "length" : "1"}) -ies.append({ "iei" : "", "value" : "NAS key set identifier", "type" : "NAS key set identifier", "reference" : "9.9.3.21", "presence" : "M", "format" : "V", "length" : "1/2"}) +ies.append({ "iei" : "", "value" : "Selected NAS security algorithms", "type" : "security algorithms", "reference" : "9.9.3.23", "presence" : "M", "format" : "V", "length" : "1"}) +ies.append({ "iei" : "", "value" : "NAS key set identifier", "type" : "key set identifier", "reference" : "9.9.3.21", "presence" : "M", "format" : "V", "length" : "1/2"}) ies.append({ "iei" : "", "value" : "Replayed UE security capabilities", "type" : "UE security capability", "reference" : "9.9.3.36", "presence" : "M", "format" : "LV", "length" : "3-6"}) ies.append({ "iei" : "C-", "value" : "IMEISV request", "type" : "IMEISV request", "reference" : "9.9.3.18", "presence" : "O", "format" : "TV", "length" : "1"}) ies.append({ "iei" : "55", "value" : "Replayed nonceUE", "type" : "Nonce", "reference" : "9.9.3.25", "presence" : "O", "format" : "TV", "length" : "5"}) diff --git a/lib/nas/support/nas_message.py b/lib/nas/support/nas_message.py index 07c788d745..499e88db90 100644 --- a/lib/nas/support/nas_message.py +++ b/lib/nas/support/nas_message.py @@ -109,8 +109,8 @@ def v_lower(v): def get_cells(cells): iei = cells[0].text.encode('ascii', 'ignore') - value = re.sub("'s", "", cells[1].text).encode('ascii', 'ignore') - type = re.sub("'s", "", re.sub('\s*\n\s*[a-zA-Z0-9.]*', '', cells[2].text)).encode('ascii', 'ignore') + value = re.sub("\s*$", "", re.sub("\s*\n*\s*\([^\)]*\)*", "", re.sub("'s", "", cells[1].text))).encode('ascii', 'ignore') + type = re.sub("^NAS ", "", re.sub("'s", "", re.sub('\s*\n\s*[a-zA-Z0-9.]*', '', cells[2].text))).encode('ascii', 'ignore') reference = re.sub('[a-zA-Z0-9\'\-\s]*\n\s*', '', cells[2].text).encode('ascii', 'ignore') presence = cells[3].text.encode('ascii', 'ignore') format = cells[4].text.encode('ascii', 'ignore') @@ -282,7 +282,7 @@ if os.path.isfile(cachefile) and os.access(cachefile, os.R_OK): tmp = [(k, v["reference"]) for k, v in type_list.items()] sorted_type_list = sorted(tmp, key=lambda tup: tup[1]) -f = open(outdir + 'nas_ies2.c', 'w') +f = open(outdir + 'nas_ies.c', 'w') output_header_to_file(f) f.write("""#define TRACE_MODULE _nasies @@ -397,7 +397,7 @@ for (k, v) in sorted_type_list: f.write("}\n\n"); f.close() -f = open(outdir + 'nas_message2.h', 'w') +f = open(outdir + 'nas_message.h', 'w') output_header_to_file(f) f.write("""#ifndef __NAS_MESSAGE_H__ #define __NAS_MESSAGE_H__ @@ -515,12 +515,12 @@ CORE_DECLARE(int) nas_plain_encode(pkbuf_t **pkbuf, nas_message_t *message); """) f.close() -f = open(outdir + 'nas_decoder2.c', 'w') +f = open(outdir + 'nas_decoder.c', 'w') output_header_to_file(f) f.write("""#define TRACE_MODULE _nasdec #include "core_debug.h" -#include "nas_message2.h" +#include "nas_message.h" """) @@ -625,12 +625,12 @@ f.write(""" default: f.close() -f = open(outdir + 'nas_encoder2.c', 'w') +f = open(outdir + 'nas_encoder.c', 'w') output_header_to_file(f) f.write("""#define TRACE_MODULE _nasenc #include "core_debug.h" -#include "nas_message2.h" +#include "nas_message.h" """) @@ -721,6 +721,8 @@ f.write(""" default: (*pkbuf)->len = encoded; return CORE_OK; +} + """) f.close()