diff options
Diffstat (limited to 'cmd/srv9p/gnet.h')
-rw-r--r-- | cmd/srv9p/gnet.h | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/cmd/srv9p/gnet.h b/cmd/srv9p/gnet.h new file mode 100644 index 0000000..a724128 --- /dev/null +++ b/cmd/srv9p/gnet.h @@ -0,0 +1,29 @@ +/* gnet.c - libnet implementation for libcr + GNU libc + * + * Copyright (C) 2024 Luke T. Shumaker <lukeshu@lukeshu.com> + * SPDX-Licence-Identifier: AGPL-3.0-or-later + */ + +#ifndef _GNET_H_ +#define _GNET_H_ + +#include <stdint.h> /* for uint16_6 */ + +#include <libnet/libnet.h> + +struct gnet_conn { + struct libnet_conn_vtable *vtable; + + int fd; +}; + +struct gnet_listener { + struct libnet_listener_vtable *vtable; + + int fd; + struct gnet_conn active_conn; +}; + +void gnet_listener_init(struct gnet_listener *self, uint16_t port); + +#endif /* _GNET_H_ */ |