Skip to content

Commit

Permalink
Added print_ndpi_address_port in nDPi API
Browse files Browse the repository at this point in the history
  • Loading branch information
lucaderi committed Aug 27, 2024
1 parent 5436ddd commit d769b23
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
12 changes: 6 additions & 6 deletions example/ndpiReader.c
Original file line number Diff line number Diff line change
Expand Up @@ -1548,7 +1548,7 @@ void print_bin(FILE *fout, const char *label, struct ndpi_bin *b) {

/* ********************************** */

static void print_ndpi_address_port(FILE *out, const char *label, ndpi_address_port *ap) {
static void print_ndpi_address_port_file(FILE *out, const char *label, ndpi_address_port *ap) {
if(ap->port != 0) {
char buf[INET6_ADDRSTRLEN];

Expand Down Expand Up @@ -1932,11 +1932,11 @@ static void printFlow(u_int32_t id, struct ndpi_flow_info *flow, u_int16_t threa
}
}

print_ndpi_address_port(out, "Mapped IP/Port", &flow->stun.mapped_address);
print_ndpi_address_port(out, "Peer IP/Port", &flow->stun.peer_address);
print_ndpi_address_port(out, "Relayed IP/Port", &flow->stun.relayed_address);
print_ndpi_address_port(out, "Rsp Origin IP/Port", &flow->stun.response_origin);
print_ndpi_address_port(out, "Other IP/Port", &flow->stun.other_address);
print_ndpi_address_port_file(out, "Mapped IP/Port", &flow->stun.mapped_address);
print_ndpi_address_port_file(out, "Peer IP/Port", &flow->stun.peer_address);
print_ndpi_address_port_file(out, "Relayed IP/Port", &flow->stun.relayed_address);
print_ndpi_address_port_file(out, "Rsp Origin IP/Port", &flow->stun.response_origin);
print_ndpi_address_port_file(out, "Other IP/Port", &flow->stun.other_address);

if(flow->http.url[0] != '\0') {
ndpi_risk_enum risk = ndpi_validate_url(flow->http.url);
Expand Down
2 changes: 1 addition & 1 deletion src/include/ndpi_api.h
Original file line number Diff line number Diff line change
Expand Up @@ -1807,7 +1807,7 @@ extern "C" {
ndpi_risk_info* ndpi_risk2severity(ndpi_risk_enum risk);
u_int16_t ndpi_risk2score(ndpi_risk risk,
u_int16_t *client_score, u_int16_t *server_score);

char* print_ndpi_address_port(ndpi_address_port *ap, char *buf, u_int buf_len);
u_int8_t ndpi_check_issuerdn_risk_exception(struct ndpi_detection_module_struct *ndpi_str,
char *issuerDN);
u_int8_t ndpi_check_flow_risk_exceptions(struct ndpi_detection_module_struct *ndpi_str,
Expand Down
2 changes: 1 addition & 1 deletion src/lib/ndpi_utils.c
Original file line number Diff line number Diff line change
Expand Up @@ -1236,7 +1236,7 @@ static void ndpi_tls2json(ndpi_serializer *serializer, struct ndpi_flow_struct *

/* ********************************** */

static char* print_ndpi_address_port(ndpi_address_port *ap, char *buf, u_int buf_len) {
char* print_ndpi_address_port(ndpi_address_port *ap, char *buf, u_int buf_len) {
char ipbuf[INET6_ADDRSTRLEN];

if(ap->is_ipv6) {
Expand Down

0 comments on commit d769b23

Please sign in to comment.