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