diff --git a/examples/gnrc_networking/udp.c b/examples/gnrc_networking/udp.c index a422934e48a037d29df151455acf8e9b5fbe16b3..f7619a8fc3fa8cb606ee5e8451293b783d429eda 100644 --- a/examples/gnrc_networking/udp.c +++ b/examples/gnrc_networking/udp.c @@ -94,7 +94,7 @@ static void start_server(char *port_str) uint16_t port; /* check if server is already running */ - if (server.pid != KERNEL_PID_UNDEF) { + if (server.target.pid != KERNEL_PID_UNDEF) { printf("Error: server already running on port %" PRIu32 "\n", server.demux_ctx); return; @@ -106,7 +106,7 @@ static void start_server(char *port_str) return; } /* start server (which means registering pktdump for the chosen port) */ - server.pid = gnrc_pktdump_pid; + server.target.pid = gnrc_pktdump_pid; server.demux_ctx = (uint32_t)port; gnrc_netreg_register(GNRC_NETTYPE_UDP, &server); printf("Success: started UDP server on port %" PRIu16 "\n", port); @@ -115,13 +115,13 @@ static void start_server(char *port_str) static void stop_server(void) { /* check if server is running at all */ - if (server.pid == KERNEL_PID_UNDEF) { + if (server.target.pid == KERNEL_PID_UNDEF) { printf("Error: server was not running\n"); return; } /* stop server */ gnrc_netreg_unregister(GNRC_NETTYPE_UDP, &server); - server.pid = KERNEL_PID_UNDEF; + server.target.pid = KERNEL_PID_UNDEF; puts("Success: stopped UDP server"); } diff --git a/sys/net/gnrc/conn/ip/gnrc_conn_ip.c b/sys/net/gnrc/conn/ip/gnrc_conn_ip.c index b2311b7b2e097260e2c7e2fa34bea4f40f3f243a..d616f3b013756db35ee9e3c99f2a8f6b49015b31 100644 --- a/sys/net/gnrc/conn/ip/gnrc_conn_ip.c +++ b/sys/net/gnrc/conn/ip/gnrc_conn_ip.c @@ -52,7 +52,7 @@ int conn_ip_create(conn_ip_t *conn, const void *addr, size_t addr_len, int famil void conn_ip_close(conn_ip_t *conn) { assert(conn->l4_type == GNRC_NETTYPE_UNDEF); - if (conn->netreg_entry.pid != KERNEL_PID_UNDEF) { + if (conn->netreg_entry.target.pid != KERNEL_PID_UNDEF) { gnrc_netreg_unregister(conn->l3_type, &conn->netreg_entry); } } diff --git a/sys/net/gnrc/conn/udp/gnrc_conn_udp.c b/sys/net/gnrc/conn/udp/gnrc_conn_udp.c index fc18a950ced8458b1b885d8d121cf06607182c29..89ee02443bbae144bb353e4b660dd7e772ea8e16 100644 --- a/sys/net/gnrc/conn/udp/gnrc_conn_udp.c +++ b/sys/net/gnrc/conn/udp/gnrc_conn_udp.c @@ -56,9 +56,9 @@ int conn_udp_create(conn_udp_t *conn, const void *addr, size_t addr_len, void conn_udp_close(conn_udp_t *conn) { assert(conn->l4_type == GNRC_NETTYPE_UDP); - if (conn->netreg_entry.pid != KERNEL_PID_UNDEF) { + if (conn->netreg_entry.target.pid != KERNEL_PID_UNDEF) { gnrc_netreg_unregister(GNRC_NETTYPE_UDP, &conn->netreg_entry); - conn->netreg_entry.pid = KERNEL_PID_UNDEF; + conn->netreg_entry.target.pid = KERNEL_PID_UNDEF; } } diff --git a/sys/net/gnrc/routing/rpl/gnrc_rpl.c b/sys/net/gnrc/routing/rpl/gnrc_rpl.c index df4e5ab89a7bfc238d8568fd472032a20b847231..29fffd03b5be164a9783f35b2b061d5079a50786 100644 --- a/sys/net/gnrc/routing/rpl/gnrc_rpl.c +++ b/sys/net/gnrc/routing/rpl/gnrc_rpl.c @@ -68,7 +68,7 @@ kernel_pid_t gnrc_rpl_init(kernel_pid_t if_pid) } _me_reg.demux_ctx = ICMPV6_RPL_CTRL; - _me_reg.pid = gnrc_rpl_pid; + _me_reg.target.pid = gnrc_rpl_pid; /* register interest in all ICMPv6 packets */ gnrc_netreg_register(GNRC_NETTYPE_ICMPV6, &_me_reg); diff --git a/tests/slip/main.c b/tests/slip/main.c index 6d7299ef9943aea9273399309e6a6d90ca248d32..89fbaf88c0d4ce56d62f628efe14774bbc874e30 100644 --- a/tests/slip/main.c +++ b/tests/slip/main.c @@ -36,7 +36,7 @@ int main(void) puts("SLIP test"); /* register pktdump */ - if (dump.pid <= KERNEL_PID_UNDEF) { + if (dump.target.pid <= KERNEL_PID_UNDEF) { puts("Error starting pktdump thread"); return -1; } diff --git a/tests/unittests/tests-netreg/tests-netreg.c b/tests/unittests/tests-netreg/tests-netreg.c index d6b2d8a9a470dcf0184de59f4088097ba922948e..b56a68861f9fc85335fe8a5bf8d73fb1d6ca62ee 100644 --- a/tests/unittests/tests-netreg/tests-netreg.c +++ b/tests/unittests/tests-netreg/tests-netreg.c @@ -45,7 +45,7 @@ static void test_netreg_register__success(void) TEST_ASSERT_EQUAL_INT(0, gnrc_netreg_register(GNRC_NETTYPE_TEST, &entries[0])); TEST_ASSERT_NOT_NULL((res = gnrc_netreg_lookup(GNRC_NETTYPE_TEST, TEST_UINT16))); TEST_ASSERT_EQUAL_INT(TEST_UINT16, res->demux_ctx); - TEST_ASSERT_EQUAL_INT(TEST_UINT8, res->pid); + TEST_ASSERT_EQUAL_INT(TEST_UINT8, res->target.pid); TEST_ASSERT_NULL((gnrc_netreg_getnext(res))); } @@ -66,7 +66,7 @@ void test_netreg_unregister__success2(void) gnrc_netreg_unregister(GNRC_NETTYPE_TEST, &entries[0]); TEST_ASSERT_NOT_NULL((res = gnrc_netreg_lookup(GNRC_NETTYPE_TEST, TEST_UINT16))); TEST_ASSERT_EQUAL_INT(TEST_UINT16, res->demux_ctx); - TEST_ASSERT_EQUAL_INT(TEST_UINT8 + 1, res->pid); + TEST_ASSERT_EQUAL_INT(TEST_UINT8 + 1, res->target.pid); gnrc_netreg_unregister(GNRC_NETTYPE_TEST, &entries[1]); TEST_ASSERT_NULL(gnrc_netreg_lookup(GNRC_NETTYPE_TEST, TEST_UINT16)); } @@ -80,7 +80,7 @@ void test_netreg_unregister__success3(void) gnrc_netreg_unregister(GNRC_NETTYPE_TEST, &entries[1]); TEST_ASSERT_NOT_NULL((res = gnrc_netreg_lookup(GNRC_NETTYPE_TEST, TEST_UINT16))); TEST_ASSERT_EQUAL_INT(TEST_UINT16, res->demux_ctx); - TEST_ASSERT_EQUAL_INT(TEST_UINT8, res->pid); + TEST_ASSERT_EQUAL_INT(TEST_UINT8, res->target.pid); gnrc_netreg_unregister(GNRC_NETTYPE_TEST, &entries[0]); TEST_ASSERT_NULL(gnrc_netreg_lookup(GNRC_NETTYPE_TEST, TEST_UINT16)); }