aboutsummaryrefslogtreecommitdiff
path: root/src/net/privinc
diff options
context:
space:
mode:
authorXavier Del Campo Romero <xavi.dcr@tutanota.com>2022-09-27 17:03:06 +0200
committerXavier Del Campo Romero <xavi.dcr@tutanota.com>2022-11-01 16:26:16 +0100
commit980858186149651df5543b6fc99a4f7db0cdd089 (patch)
treed347200b0a562d84df505097651ad0642f207fdd /src/net/privinc
parent39f50e601d395bbd2d78d0147ac530b756da2fff (diff)
downloadjancity-980858186149651df5543b6fc99a4f7db0cdd089.tar.gz
WIP
Diffstat (limited to 'src/net/privinc')
-rw-r--r--src/net/privinc/net_private.h34
-rw-r--r--src/net/privinc/net_serial_private.h19
2 files changed, 39 insertions, 14 deletions
diff --git a/src/net/privinc/net_private.h b/src/net/privinc/net_private.h
index 53d7cd1..bc405d1 100644
--- a/src/net/privinc/net_private.h
+++ b/src/net/privinc/net_private.h
@@ -2,29 +2,35 @@
#define NET_PRIVATE_H
#include <net.h>
+#include <transport.h>
+#include <stddef.h>
-struct net_socket
+struct net_host
{
enum net_domain d;
- struct net_socket_domain *s;
+ struct net_host_domain *h;
};
int net_init_ipv4(void);
void net_deinit_ipv4(void);
-struct net_socket_domain *net_server_ipv4(const union net_server *srv);
-struct net_socket_domain *net_connect_ipv4(const union net_connect *c);
-int net_read_ipv4(struct net_socket_domain *h, void *buf, size_t n);
-int net_write_ipv4(struct net_socket_domain *h, const void *buf, size_t n);
-int net_close_ipv4(struct net_socket_domain *h);
-int net_update_ipv4(struct net_socket_domain *h);
+struct net_host_domain *net_server_ipv4(const union net_server *srv);
+struct net_host_domain *net_connect_ipv4(const union net_connect *c);
+int net_write_ipv4(struct net_host_domain *h, net_peer p, const void *buf, size_t n);
+int net_close_ipv4(struct net_host_domain *h);
+int net_update_ipv4(struct net_host_domain *h);
+enum net_role net_role_ipv4(const struct net_host_domain *h);
+int net_set_event_ipv4(struct net_host_domain *d, const struct net_event *ev);
int net_init_serial(void);
void net_deinit_serial(void);
-struct net_socket_domain *net_server_serial(const union net_server *srv);
-struct net_socket_domain *net_connect_serial(const union net_connect *c);
-int net_read_serial(struct net_socket_domain *h, void *buf, size_t n);
-int net_write_serial(struct net_socket_domain *h, const void *buf, size_t n);
-int net_close_serial(struct net_socket_domain *h);
-int net_update_serial(struct net_socket_domain *h);
+struct net_host_domain *net_server_serial(const union net_server *srv);
+struct net_host_domain *net_connect_serial(const union net_connect *c);
+int net_write_serial(struct net_host_domain *h, net_peer p, const void *buf, size_t n);
+int net_close_serial(struct net_host_domain *h);
+int net_update_serial(struct net_host_domain *h);
+enum net_role net_role_serial(const struct net_host_domain *h);
+int net_set_event_serial(struct net_host_domain *d, const struct net_event *ev);
+void net_serial_on_received(const struct transport_event *t_ev,
+ const struct net_event *n_ev);
#endif /* NET_PRIVATE_H */
diff --git a/src/net/privinc/net_serial_private.h b/src/net/privinc/net_serial_private.h
new file mode 100644
index 0000000..74eee55
--- /dev/null
+++ b/src/net/privinc/net_serial_private.h
@@ -0,0 +1,19 @@
+#ifndef NET_SERIAL_PRIVATE_H
+#define NET_SERIAL_PRIVATE_H
+
+#include <net.h>
+#include <transport.h>
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+
+void net_serial_on_received(const struct transport_event *t_ev,
+ const struct net_event *n_ev);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* NET_SERIAL_PRIVATE_H */