aboutsummaryrefslogtreecommitdiffstats
path: root/hicn-light/src/hicn/core/listener.c
diff options
context:
space:
mode:
Diffstat (limited to 'hicn-light/src/hicn/core/listener.c')
-rw-r--r--hicn-light/src/hicn/core/listener.c36
1 files changed, 3 insertions, 33 deletions
diff --git a/hicn-light/src/hicn/core/listener.c b/hicn-light/src/hicn/core/listener.c
index 188f0c317..a3c5c8a12 100644
--- a/hicn-light/src/hicn/core/listener.c
+++ b/hicn-light/src/hicn/core/listener.c
@@ -247,38 +247,8 @@ unsigned listener_create_connection(listener_t *listener,
connection_table_print_by_pair(table);
})
-#if 0
- DEBUG("Notification for new connections");
- // Generate notification message
- flag_interface_type_t interface_type =
- FLAG_INTERFACE_TYPE_WIRED | FLAG_INTERFACE_TYPE_CELLULAR;
- struct {
- cmd_header_t header;
- hc_event_interface_update_t payload;
- } msg = {.header =
- {
- .message_type = NOTIFICATION_LIGHT,
- .command_id = EVENT_INTERFACE_UPDATE,
- .length = 0,
- .seq_num = 0,
- },
- .payload = {.interface_type = interface_type}};
- size_t size = sizeof(msg);
-
- // Retrieve subscribed connections
- subscription_table_t *subscriptions =
- forwarder_get_subscriptions(listener->forwarder);
- unsigned *subscribed_conn_ids = subscription_table_get_connections_for_topic(
- subscriptions, TOPIC_CONNECTION);
-
- // Send notification to subscribed connections
- for (int i = 0; i < vector_len(subscribed_conn_ids); i++) {
- DEBUG("Sending notification to connection: %u", subscribed_conn_ids[i]);
- const connection_t *conn =
- connection_table_at(table, subscribed_conn_ids[i]);
- connection_send_packet(conn, (uint8_t *)&msg, size);
- }
-#endif
+ forwarder_on_connection_event(listener->forwarder, connection,
+ CONNECTION_EVENT_CREATE);
return connection_id;
}
@@ -441,4 +411,4 @@ void listener_setup_local(forwarder_t *forwarder, uint16_t port) {
address_t localhost_ipv6_addr = ADDRESS6_LOCALHOST(port);
listener_create(FACE_TYPE_UDP_LISTENER, &localhost_ipv6_addr, "lo", "lo_udp6",
forwarder);
-} \ No newline at end of file
+}