aboutgitcodebugslistschat
path: root/pif.h
diff options
context:
space:
mode:
Diffstat (limited to 'pif.h')
-rw-r--r--pif.h21
1 files changed, 20 insertions, 1 deletions
diff --git a/pif.h b/pif.h
index bd52936..f029282 100644
--- a/pif.h
+++ b/pif.h
@@ -7,6 +7,9 @@
#ifndef PIF_H
#define PIF_H
+union inany_addr;
+union sockaddr_inany;
+
/**
* enum pif_type - Type of passt/pasta interface ("pif")
*
@@ -38,10 +41,26 @@ static inline const char *pif_type(enum pif_type pt)
return "?";
}
-/* cppcheck-suppress unusedFunction */
static inline const char *pif_name(uint8_t pif)
{
return pif_type(pif);
}
+/**
+ * pif_is_socket() - Is interface implemented via L4 sockets?
+ * @pif: pif to check
+ *
+ * Return: true of @pif is an L4 socket based interface, otherwise false
+ */
+static inline bool pif_is_socket(uint8_t pif)
+{
+ return pif == PIF_HOST || pif == PIF_SPLICE;
+}
+
+void pif_sockaddr(const struct ctx *c, union sockaddr_inany *sa, socklen_t *sl,
+ uint8_t pif, const union inany_addr *addr, in_port_t port);
+int pif_sock_l4(const struct ctx *c, enum epoll_type type, uint8_t pif,
+ const union inany_addr *addr, const char *ifname,
+ in_port_t port, uint32_t data);
+
#endif /* PIF_H */