Skip to content

Commit

Permalink
- eep: Support for EEP traffic with UUID chunks (Asterisk)
Browse files Browse the repository at this point in the history
  • Loading branch information
sergej authored and Kaian committed May 5, 2017
1 parent 982d6e5 commit 302429f
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 2 deletions.
11 changes: 10 additions & 1 deletion src/capture_eep.c
Original file line number Diff line number Diff line change
Expand Up @@ -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] ;
Expand Down Expand Up @@ -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);
Expand Down
3 changes: 2 additions & 1 deletion src/curses/ui_settings.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 },
};
Expand All @@ -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));
Expand Down
2 changes: 2 additions & 0 deletions src/curses/ui_settings.h
Original file line number Diff line number Diff line change
Expand Up @@ -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,
};
Expand Down
1 change: 1 addition & 0 deletions src/setting.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
};

Expand Down
1 change: 1 addition & 0 deletions src/setting.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
};
Expand Down

0 comments on commit 302429f

Please sign in to comment.