summaryrefslogtreecommitdiff
path: root/cmd/srv9p/gnet.h
blob: 341ccd2ef7c14939bacaf0bb099331aef463ec79 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
/* gnet.h - 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_ */