]> git.ipfire.org Git - thirdparty/systemd.git/blob - src/nspawn/nspawn-expose-ports.h
27cfccf015267e5a5c1cf14abd2fbc597429c827
[thirdparty/systemd.git] / src / nspawn / nspawn-expose-ports.h
1 /* SPDX-License-Identifier: LGPL-2.1-or-later */
2 #pragma once
3
4 #include <inttypes.h>
5
6 #include "sd-event.h"
7 #include "sd-netlink.h"
8
9 #include "firewall-util.h"
10 #include "in-addr-util.h"
11 #include "list.h"
12
13 typedef struct ExposePort {
14 int protocol;
15 uint16_t host_port;
16 uint16_t container_port;
17 LIST_FIELDS(struct ExposePort, ports);
18 } ExposePort;
19
20 void expose_port_free_all(ExposePort *p);
21 int expose_port_parse(ExposePort **l, const char *s);
22
23 int expose_port_watch_rtnl(sd_event *event, int recv_fd, sd_netlink_message_handler_t handler, void *userdata, sd_netlink **ret);
24 int expose_port_send_rtnl(int send_fd);
25
26 int expose_port_execute(sd_netlink *rtnl, FirewallContext **fw_ctx, ExposePort *l, int af, union in_addr_union *exposed);
27 int expose_port_flush(FirewallContext **fw_ctx, ExposePort* l, int af, union in_addr_union *exposed);