1 // SPDX-License-Identifier: GPL-2.0-or-later
3 * Copyright (C) 2022 Felix Fietkau <nbd@nbd.name>
8 #include <libubox/uloop.h>
12 struct network_pex_host
{
13 struct list_head list
;
15 union network_endpoint endpoint
;
20 struct list_head hosts
;
21 struct uloop_timeout request_update_timer
;
26 PEX_EV_ENDPOINT_CHANGE
,
31 void network_pex_init(struct network
*net
);
32 int network_pex_open(struct network
*net
);
33 void network_pex_close(struct network
*net
);
34 void network_pex_free(struct network
*net
);
36 void network_pex_event(struct network
*net
, struct network_peer
*peer
,
38 void network_pex_create_host(struct network
*net
, union network_endpoint
*ep
,
39 unsigned int timeout
);
41 static inline bool network_pex_active(struct network_pex
*pex
)
43 return pex
->fd
.fd
>= 0;
46 int global_pex_open(void);