summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/net.h14
-rw-r--r--include/settings.h2
-rw-r--r--include/utils.h20
3 files changed, 33 insertions, 3 deletions
diff --git a/include/net.h b/include/net.h
index e4ca0a6..8385943 100644
--- a/include/net.h
+++ b/include/net.h
@@ -22,6 +22,13 @@
#ifndef USURPATION_NET_H_INCLUDED
#define USURPATION_NET_H_INCLUDED
+#ifdef unix
+#include <sys/socket.h>
+#include <netinet/in.h>
+#endif
+
+#include <stddef.h>
+
#define MTU 1500
enum response {
@@ -29,8 +36,6 @@ enum response {
A_OK = 0, /* would be "OK", but clashes with some lib definitions */
NONEWDATA,
DEAD,
- NO_ESPTOOL,
- TMPFILE,
};
/**
@@ -49,5 +54,10 @@ int net_close(int nd);
* and needs to be free()'d later. Otherwise, the supplied buffer is reused.
*/
int net_getlastdata(int nd, char ** const data);
+int net_send(int nd, const char * const buf, size_t buf_size);
+
+#ifdef unix
+int net_send_addr(int nd, const char * const buf, size_t buf_size, const struct sockaddr_in * const addr);
+#endif
#endif /* USURPATION_NET_H_INCLUDED */
diff --git a/include/settings.h b/include/settings.h
index e2e9644..538c7fd 100644
--- a/include/settings.h
+++ b/include/settings.h
@@ -26,7 +26,7 @@ enum verbosity {
SILENT = 0,
ERR = 1,
WARN,
- DEBUG,
+ INFO,
ALL
};
diff --git a/include/utils.h b/include/utils.h
index 95b553d..ba726ec 100644
--- a/include/utils.h
+++ b/include/utils.h
@@ -1,3 +1,23 @@
+/*
+ * Usurpation – utility functions.
+ *
+ * Copyright (C) 2019 Ramūnas Mažeikis
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; version 2.1
+ * of the License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
#ifndef USURPATION_UTILS_H
#define USURPATION_UTILS_H