2020-11-09 05:23:58 +01:00
|
|
|
/* SPDX-License-Identifier: LGPL-2.1-or-later */
|
2015-09-07 16:52:24 +02:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <inttypes.h>
|
|
|
|
|
|
|
|
#include "sd-event.h"
|
|
|
|
#include "sd-netlink.h"
|
2015-11-18 22:46:33 +01:00
|
|
|
|
2020-12-18 05:21:07 +01:00
|
|
|
#include "firewall-util.h"
|
2015-09-07 16:52:24 +02:00
|
|
|
#include "in-addr-util.h"
|
2015-11-18 22:46:33 +01:00
|
|
|
#include "list.h"
|
2015-09-07 16:52:24 +02:00
|
|
|
|
|
|
|
typedef struct ExposePort {
|
|
|
|
int protocol;
|
|
|
|
uint16_t host_port;
|
|
|
|
uint16_t container_port;
|
|
|
|
LIST_FIELDS(struct ExposePort, ports);
|
|
|
|
} ExposePort;
|
|
|
|
|
|
|
|
void expose_port_free_all(ExposePort *p);
|
|
|
|
int expose_port_parse(ExposePort **l, const char *s);
|
|
|
|
|
2020-10-13 20:29:09 +02:00
|
|
|
int expose_port_watch_rtnl(sd_event *event, int recv_fd, sd_netlink_message_handler_t handler, void *userdata, sd_netlink **ret);
|
2015-09-07 16:52:24 +02:00
|
|
|
int expose_port_send_rtnl(int send_fd);
|
|
|
|
|
2020-09-15 19:58:44 +02:00
|
|
|
int expose_port_execute(sd_netlink *rtnl, FirewallContext **fw_ctx, ExposePort *l, union in_addr_union *exposed);
|
|
|
|
int expose_port_flush(FirewallContext **fw_ctx, ExposePort* l, union in_addr_union *exposed);
|