Index: uspace/lib/c/include/inet/endpoint.h
===================================================================
--- uspace/lib/c/include/inet/endpoint.h	(revision 2f191031fcab086a16c63f216f15b26eabcb7c1e)
+++ uspace/lib/c/include/inet/endpoint.h	(revision 58e9dec38facb087ef357050fc85631d17323e92)
@@ -40,4 +40,29 @@
 #include <loc.h>
 
+/** Internet port number ranges
+ *
+ * Port number ranges per RFC 6335 section 6 (Port Number Ranges.
+ * Technically port zero is a system port. But since it is reserved,
+ * we will use it as a special value denoting no port is specified
+ * and we will exclude it from the system port range to disallow
+ * ever assigning it.
+ */
+enum inet_port_ranges {
+	/** Special value meaning no specific port */
+	inet_port_any = 0,
+	/** Lowest system port (a.k.a. well known port) */
+	inet_port_sys_lo = 1,
+	/** Highest system port (a.k.a. well known port) */
+	inet_port_sys_hi = 1023,
+	/** Lowest user port (a.k.a. registered port) */
+	inet_port_user_lo = 1024,
+	/** Highest user port (a.k.a. registered port) */
+	inet_port_user_hi = 49151,
+	/** Lowest dynamic port (a.k.a. private or ephemeral port) */
+	inet_port_dyn_lo = 49152,
+	/** Highest dynamic port (a.k.a. private or ephemeral port) */
+	inet_port_dyn_hi = 65535
+};
+
 /** Internet endpoint (address-port pair), a.k.a. socket */
 typedef struct {
Index: uspace/srv/net/tcp/conn.c
===================================================================
--- uspace/srv/net/tcp/conn.c	(revision 2f191031fcab086a16c63f216f15b26eabcb7c1e)
+++ uspace/srv/net/tcp/conn.c	(revision 58e9dec38facb087ef357050fc85631d17323e92)
@@ -344,5 +344,5 @@
 		return false;
 
-	if ((patt->port != TCP_PORT_ANY) &&
+	if ((patt->port != inet_port_any) &&
 	    (patt->port != ep->port))
 		return false;
Index: uspace/srv/net/tcp/tcp_type.h
===================================================================
--- uspace/srv/net/tcp/tcp_type.h	(revision 2f191031fcab086a16c63f216f15b26eabcb7c1e)
+++ uspace/srv/net/tcp/tcp_type.h	(revision 58e9dec38facb087ef357050fc85631d17323e92)
@@ -113,8 +113,4 @@
 } tcp_control_t;
 
-enum tcp_port {
-	TCP_PORT_ANY = 0
-};
-
 /** Connection incoming segments queue */
 typedef struct {
Index: uspace/srv/net/tcp/ucall.c
===================================================================
--- uspace/srv/net/tcp/ucall.c	(revision 2f191031fcab086a16c63f216f15b26eabcb7c1e)
+++ uspace/srv/net/tcp/ucall.c	(revision 58e9dec38facb087ef357050fc85631d17323e92)
@@ -342,5 +342,5 @@
 		conn->ident.remote.addr = epp->remote.addr;
 
-	if (conn->ident.remote.port == TCP_PORT_ANY)
+	if (conn->ident.remote.port == inet_port_any)
 		conn->ident.remote.port = epp->remote.port;
 
Index: uspace/srv/net/udp/assoc.c
===================================================================
--- uspace/srv/net/udp/assoc.c	(revision 2f191031fcab086a16c63f216f15b26eabcb7c1e)
+++ uspace/srv/net/udp/assoc.c	(revision 58e9dec38facb087ef357050fc85631d17323e92)
@@ -39,4 +39,5 @@
 #include <stdbool.h>
 #include <fibril_synch.h>
+#include <inet/endpoint.h>
 #include <io/log.h>
 #include <stdlib.h>
@@ -270,5 +271,5 @@
 
 	if ((inet_addr_is_any(&epp.remote.addr)) ||
-	    (epp.remote.port == UDP_PORT_ANY))
+	    (epp.remote.port == inet_port_any))
 		return EINVAL;
 
@@ -422,5 +423,5 @@
 	log_msg(LOG_DEFAULT, LVL_NOTE, "addr OK");
 
-	if ((patt->port != UDP_PORT_ANY) &&
+	if ((patt->port != inet_port_any) &&
 	    (patt->port != ep->port))
 		return false;
@@ -476,5 +477,5 @@
 		    aepp, la, ra);
 		/* Skip unbound associations */
-		if (aepp->local.port == UDP_PORT_ANY) {
+		if (aepp->local.port == inet_port_any) {
 			log_msg(LOG_DEFAULT, LVL_NOTE, "skip unbound");
 			continue;
Index: uspace/srv/net/udp/udp_type.h
===================================================================
--- uspace/srv/net/udp/udp_type.h	(revision 2f191031fcab086a16c63f216f15b26eabcb7c1e)
+++ uspace/srv/net/udp/udp_type.h	(revision 58e9dec38facb087ef357050fc85631d17323e92)
@@ -61,8 +61,4 @@
 	XF_DUMMY = 0x1
 } xflags_t;
-
-enum udp_port {
-	UDP_PORT_ANY = 0
-};
 
 /** Unencoded UDP message (datagram) */
