From 302429fee12f0df43cfea825c706f0e6cd8b09d8 Mon Sep 17 00:00:00 2001 From: Sergej Date: Thu, 4 May 2017 21:41:37 +0200 Subject: [PATCH] - eep: Support for EEP traffic with UUID chunks (Asterisk) --- src/capture_eep.c | 11 ++++++++++- src/curses/ui_settings.c | 3 ++- src/curses/ui_settings.h | 2 ++ src/setting.c | 1 + src/setting.h | 1 + 5 files changed, 16 insertions(+), 2 deletions(-) diff --git a/src/capture_eep.c b/src/capture_eep.c index d41c733..3cec776 100644 --- a/src/capture_eep.c +++ b/src/capture_eep.c @@ -588,9 +588,10 @@ capture_eep_receive_v3() #endif hep_chunk_t payload_chunk; hep_chunk_t authkey_chunk; + hep_chunk_t uuid_chunk; uint8_t family, proto; char password[100]; - int password_len; + int password_len, uuid_len; unsigned char *payload = 0; uint32_t len, pos; char buffer[MAX_CAPTURE_LEN] ; @@ -674,6 +675,14 @@ capture_eep_receive_v3() return NULL; } + if (setting_enabled(SETTING_EEP_LISTEN_UUID)) { + memcpy(&uuid_chunk, (void*) buffer + pos, sizeof(uuid_chunk)); + pos += sizeof(uuid_chunk); + + uuid_len = ntohs(uuid_chunk.length) - sizeof(uuid_chunk); + pos += uuid_len; + } + /* Payload */ memcpy(&payload_chunk, (void*) buffer + pos, sizeof(payload_chunk)); pos += sizeof(payload_chunk); diff --git a/src/curses/ui_settings.c b/src/curses/ui_settings.c index 3aba988..5761843 100644 --- a/src/curses/ui_settings.c +++ b/src/curses/ui_settings.c @@ -87,6 +87,7 @@ settings_entry_t entries[] = { { CAT_SETTINGS_EEP_HOMER, FLD_SETTINGS_EEP_LISTEN_ADDR, SETTING_EEP_LISTEN_ADDR, "Listen EEP packet address ................." }, { CAT_SETTINGS_EEP_HOMER, FLD_SETTINGS_EEP_LISTEN_PORT, SETTING_EEP_LISTEN_PORT, "Listen EEP packet port ...................." }, { CAT_SETTINGS_EEP_HOMER, FLD_SETTINGS_EEP_LISTEN_PASS, SETTING_EEP_LISTEN_PASS, "EEP server password ......................." }, + { CAT_SETTINGS_EEP_HOMER, FLD_SETTINGS_EEP_LISTEN_UUID, SETTING_EEP_LISTEN_UUID, "EEP server expects UUID (Asterisk) ........" }, #endif { 0 , 0, 0, NULL }, }; @@ -100,7 +101,7 @@ settings_create(ui_t *ui) int field = 0; // Cerate a new window for the panel and form - ui_panel_create(ui, 22, 70); + ui_panel_create(ui, 24, 70); // Initialize Filter panel specific data info = sng_malloc(sizeof(settings_info_t)); diff --git a/src/curses/ui_settings.h b/src/curses/ui_settings.h index 5c90fc0..714c864 100644 --- a/src/curses/ui_settings.h +++ b/src/curses/ui_settings.h @@ -119,6 +119,8 @@ enum settings_field_list { FLD_SETTINGS_EEP_LISTEN_PORT_LB, FLD_SETTINGS_EEP_LISTEN_PASS, FLD_SETTINGS_EEP_LISTEN_PASS_LB, + FLD_SETTINGS_EEP_LISTEN_UUID, + FLD_SETTINGS_EEP_LISTEN_UUID_LB, #endif FLD_SETTINGS_COUNT, }; diff --git a/src/setting.c b/src/setting.c index 4343f1d..7c139ae 100644 --- a/src/setting.c +++ b/src/setting.c @@ -85,6 +85,7 @@ setting_t settings[SETTING_COUNT] = { { SETTING_EEP_LISTEN_ADDR, "eep.listen.address", SETTING_FMT_STRING, "0.0.0.0", NULL }, { SETTING_EEP_LISTEN_PORT, "eep.listen.port", SETTING_FMT_NUMBER, "9060", NULL }, { SETTING_EEP_LISTEN_PASS, "eep.listen.pass", SETTING_FMT_STRING, "myHep", NULL }, + { SETTING_EEP_LISTEN_UUID, "eep.listen.uuid", SETTING_FMT_ENUM, SETTING_OFF, SETTING_ENUM_ONOFF }, #endif }; diff --git a/src/setting.h b/src/setting.h index 65d7341..170f1b6 100644 --- a/src/setting.h +++ b/src/setting.h @@ -121,6 +121,7 @@ enum setting_id { SETTING_EEP_LISTEN_ADDR, SETTING_EEP_LISTEN_PORT, SETTING_EEP_LISTEN_PASS, + SETTING_EEP_LISTEN_UUID, #endif SETTING_COUNT };