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
;
16 union network_endpoint endpoint
;
21 struct list_head hosts
;
22 struct uloop_timeout request_update_timer
;
27 PEX_EV_ENDPOINT_CHANGE
,
32 void network_pex_init(struct network
*net
);
33 int network_pex_open(struct network
*net
);
34 void network_pex_close(struct network
*net
);
35 void network_pex_free(struct network
*net
);
37 void network_pex_event(struct network
*net
, struct network_peer
*peer
,
39 void network_pex_create_host(struct network
*net
, union network_endpoint
*ep
,
40 unsigned int timeout
);
42 static inline bool network_pex_active(struct network_pex
*pex
)
44 return pex
->fd
.fd
>= 0;
47 int global_pex_open(const char *unix_path
);