Barrelfish
Functions
portalloc.h File Reference

Port allocator for netd. More...

Functions

void init_free_ports (void)
 Initialization code for port allocator.
 
uint16_t alloc_tcp_port (void)
 allocates a tcp port
 
uint16_t alloc_udp_port (void)
 allocates a tcp port
 
uint16_t alloc_specific_port (uint16_t port, net_ports_port_type_t type)
 allocates a specific port. this is the backend function for bind More...
 
void free_port (uint16_t port, net_ports_port_type_t type)
 frees a port and does not care whether it is allocated before or not! More...
 

Detailed Description

Port allocator for netd.

This file is part of the net "daemon"

Function Documentation

uint16_t alloc_specific_port ( uint16_t  port,
net_ports_port_type_t  type 
)
inline

allocates a specific port. this is the backend function for bind

Parameters
portthe port number
typeUDP or TCP
Returns
0 in case port is in use and the port number other wise
void free_port ( uint16_t  port,
net_ports_port_type_t  type 
)
inline

frees a port and does not care whether it is allocated before or not!

Parameters
portthe port number
typeUDP or TCP