diff options
author | Luke T. Shumaker <lukeshu@lukeshu.com> | 2024-10-14 18:29:15 -0600 |
---|---|---|
committer | Luke T. Shumaker <lukeshu@lukeshu.com> | 2024-10-14 18:29:15 -0600 |
commit | 3dcbd43ecd77c28762b0595475893ff052c0444a (patch) | |
tree | 9823d647e98811bc33f19152217b0bfc72edb8ed /cmd/srv9p/gnet.h | |
parent | 1427269e8650964713505728eda84bfec1f685e1 (diff) |
wip libnet rewrite
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_ */ |