aboutsummaryrefslogtreecommitdiff
path: root/util.c
diff options
context:
space:
mode:
Diffstat (limited to 'util.c')
-rw-r--r--util.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/util.c b/util.c
index 439bcf7..f2c464e 100644
--- a/util.c
+++ b/util.c
@@ -7,10 +7,16 @@
#include <errno.h>
#include <regex.h>
-uint16_t inet_atop(const char *port) {
+uint16_t atop(const char *port) {
return htons(atoi(port));
}
+struct in_addr aton(const char* cp, int* output) {
+ struct in_addr inp;
+ *output = inet_aton(cp, &inp);
+ return inp;
+}
+
void herrc(int output, const char* funcName) {
if (output < 0 && errno != EINTR) {
perror(funcName);