summaryrefslogtreecommitdiffhomepage
path: root/dev/lib/net
diff options
context:
space:
mode:
Diffstat (limited to 'dev/lib/net')
-rw-r--r--dev/lib/net/modem.hpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/dev/lib/net/modem.hpp b/dev/lib/net/modem.hpp
index 80b3b7a..7c07191 100644
--- a/dev/lib/net/modem.hpp
+++ b/dev/lib/net/modem.hpp
@@ -8,6 +8,8 @@
#ifndef _OCL_NET_NETWORK_HPP
#define _OCL_NET_NETWORK_HPP
+#include <lib/tests/hpptest.hpp>
+
#include <unistd.h>
#include <arpa/inet.h>
#include <sys/socket.h>
@@ -110,6 +112,10 @@ namespace ocl::net
static_assert(af != 0, "Address family is zero");
static_assert(kind != 0, "Kind is zero");
+ must_pass<af == AF_INET || af == AF_INET6>();
+ must_pass<kind == SOCK_STREAM || kind == SOCK_DGRAM>();
+ must_pass<(port > 0) && (port < 65536)>();
+
fd_ = ::socket(af, kind, 0);
server_fd_ = is_server;