Skip to content

Commit

Permalink
[SQUASH ME] uint16_t for demux context
Browse files Browse the repository at this point in the history
  • Loading branch information
miri64 committed Feb 8, 2015
1 parent f0cbd84 commit 32504d4
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions sys/include/net/ng_netreg.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ typedef struct ng_netreg_entry {
* E. g. protocol numbers / next header numbers in IPv4/IPv6,
* ports in UDP/TCP, or similar.
*/
uint32_t demux_ctx;
uint16_t demux_ctx;
kernel_pid_t target_pid; /**< The PID of the registering thread */
} ng_netreg_entry_t;

Expand All @@ -63,7 +63,7 @@ typedef struct ng_netreg_entry {
* @return 0 on success
* @return ENOMEM if no space is left in the registry.
*/
int ng_netreg_register(ng_nettype_t type, kernel_pid_t proto_pid, uint32_t demux_ctx,
int ng_netreg_register(ng_nettype_t type, kernel_pid_t proto_pid, uint16_t demux_ctx,
kernel_pid_t target_pid);

/**
Expand All @@ -75,7 +75,7 @@ int ng_netreg_register(ng_nettype_t type, kernel_pid_t proto_pid, uint32_t demux
* See ng_netreg_entry_t::demux_ctx.
* @param[in] target_pid The PID of the registered thread.
*/
void ng_netreg_unregister(ng_nettype_t type, kernel_pid_t proto_pid, uint32_t demux_ctx,
void ng_netreg_unregister(ng_nettype_t type, kernel_pid_t proto_pid, uint16_t demux_ctx,
kernel_pid_t target_pid);

/**
Expand All @@ -91,7 +91,7 @@ void ng_netreg_unregister(ng_nettype_t type, kernel_pid_t proto_pid, uint32_t de
* @return NULL if no entry can be found.
*/
ng_netreg_entry_t *ng_netreg_lookup(ng_nettype_t type, kernel_pid_t proto_pid,
uint32_t demux_ctx);
uint16_t demux_ctx);

/**
* @brief Returns number of entries with the same ng_netreg_entry_t::type,
Expand Down
8 changes: 4 additions & 4 deletions sys/net/crosslayer/ng_netreg/ng_netreg.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
static ng_netreg_entry_t *netreg[NG_NETTYPE_NUMOF];
static ng_netreg_entry_t netreg_entries[NG_NETREG_SIZE];

int ng_netreg_register(ng_nettype_t type, kernel_pid_t proto_pid, uint32_t demux_ctx,
int ng_netreg_register(ng_nettype_t type, kernel_pid_t proto_pid, uint16_t demux_ctx,
kernel_pid_t target_pid)
{
ng_netreg_entry_t *entry = NULL;
Expand Down Expand Up @@ -54,7 +54,7 @@ int ng_netreg_register(ng_nettype_t type, kernel_pid_t proto_pid, uint32_t demux
}

static ng_netreg_entry_t *_ng_netreg_getnext_internal(ng_netreg_entry_t *entry,
kernel_pid_t proto_pid, uint32_t demux_ctx)
kernel_pid_t proto_pid, uint16_t demux_ctx)
{
while (entry != NULL) {
if ((entry->proto_pid == proto_pid) && (entry->demux_ctx == demux_ctx)) {
Expand All @@ -67,7 +67,7 @@ static ng_netreg_entry_t *_ng_netreg_getnext_internal(ng_netreg_entry_t *entry,
return NULL;
}

void ng_netreg_unregister(ng_nettype_t type, kernel_pid_t proto_pid, uint32_t demux_ctx,
void ng_netreg_unregister(ng_nettype_t type, kernel_pid_t proto_pid, uint16_t demux_ctx,
kernel_pid_t target_pid)
{
ng_netreg_entry_t *entry = netreg[type];
Expand All @@ -83,7 +83,7 @@ void ng_netreg_unregister(ng_nettype_t type, kernel_pid_t proto_pid, uint32_t de
}

ng_netreg_entry_t *ng_netreg_lookup(ng_nettype_t type, kernel_pid_t proto_pid,
uint32_t demux_ctx)
uint16_t demux_ctx)
{
return _ng_netreg_getnext_internal(netreg[type], proto_pid, demux_ctx);
}
Expand Down

0 comments on commit 32504d4

Please sign in to comment.