]> git.ipfire.org Git - thirdparty/systemd.git/blob - src/nspawn/nspawn-expose-ports.h
741ad9765c284cf189f03554ab9aa607b747a75d
[thirdparty/systemd.git] / src / nspawn / nspawn-expose-ports.h
1 #pragma once
2
3 /***
4 This file is part of systemd.
5
6 Copyright 2015 Lennart Poettering
7
8 systemd is free software; you can redistribute it and/or modify it
9 under the terms of the GNU Lesser General Public License as published by
10 the Free Software Foundation; either version 2.1 of the License, or
11 (at your option) any later version.
12
13 systemd is distributed in the hope that it will be useful, but
14 WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 Lesser General Public License for more details.
17
18 You should have received a copy of the GNU Lesser General Public License
19 along with systemd; If not, see <http://www.gnu.org/licenses/>.
20 ***/
21
22 #include <inttypes.h>
23
24 #include "sd-event.h"
25 #include "sd-netlink.h"
26
27 #include "in-addr-util.h"
28 #include "list.h"
29
30 typedef struct ExposePort {
31 int protocol;
32 uint16_t host_port;
33 uint16_t container_port;
34 LIST_FIELDS(struct ExposePort, ports);
35 } ExposePort;
36
37 void expose_port_free_all(ExposePort *p);
38 int expose_port_parse(ExposePort **l, const char *s);
39
40 int expose_port_watch_rtnl(sd_event *event, int recv_fd, sd_netlink_message_handler_t handler, union in_addr_union *exposed, sd_netlink **ret);
41 int expose_port_send_rtnl(int send_fd);
42
43 int expose_port_execute(sd_netlink *rtnl, ExposePort *l, union in_addr_union *exposed);
44 int expose_port_flush(ExposePort* l, union in_addr_union *exposed);