Page Menu
Home
ClusterLabs Projects
Search
Configure Global Search
Log In
Files
F2019989
links_acl.c
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
2 KB
Referenced Files
None
Subscribers
None
links_acl.c
View Options
/*
* Copyright (C) 2016-2020 Red Hat, Inc. All rights reserved.
*
* Author: Christine Caulfield <ccaulfie@redhat.com>
*
* This software licensed under LGPL-2.0+
*/
#include "config.h"
#include <errno.h>
#include <stdint.h>
#include <string.h>
#include <stdlib.h>
#include "internals.h"
#include "logging.h"
#include "transports.h"
#include "transport_common.h"
#include "links_acl.h"
#include "links_acl_ip.h"
#include "links_acl_loopback.h"
static check_ops_t proto_check_modules_cmds[] = {
{ TRANSPORT_PROTO_LOOPBACK, loopbackcheck_validate, loopbackcheck_add, loopbackcheck_rm, loopbackcheck_rmall },
{ TRANSPORT_PROTO_IP_PROTO, ipcheck_validate, ipcheck_addip, ipcheck_rmip, ipcheck_rmall }
};
/*
* all those functions will return errno from the
* protocol specific functions
*/
int check_add(knet_handle_t knet_h, int sock, uint8_t transport, int index,
struct sockaddr_storage *ss1, struct sockaddr_storage *ss2,
check_type_t type, check_acceptreject_t acceptreject)
{
return proto_check_modules_cmds[transport_get_proto(knet_h, transport)].protocheck_add(
&knet_h->knet_transport_fd_tracker[sock].access_list_match_entry_head, index,
ss1, ss2, type, acceptreject);
}
int check_rm(knet_handle_t knet_h, int sock, uint8_t transport,
struct sockaddr_storage *ss1, struct sockaddr_storage *ss2,
check_type_t type, check_acceptreject_t acceptreject)
{
return proto_check_modules_cmds[transport_get_proto(knet_h, transport)].protocheck_rm(
&knet_h->knet_transport_fd_tracker[sock].access_list_match_entry_head,
ss1, ss2, type, acceptreject);
}
void check_rmall(knet_handle_t knet_h, int sock, uint8_t transport)
{
proto_check_modules_cmds[transport_get_proto(knet_h, transport)].protocheck_rmall(
&knet_h->knet_transport_fd_tracker[sock].access_list_match_entry_head);
}
/*
* return 0 to reject and 1 to accept a packet
*/
int check_validate(knet_handle_t knet_h, int sock, uint8_t transport, struct sockaddr_storage *checkip)
{
return proto_check_modules_cmds[transport_get_proto(knet_h, transport)].protocheck_validate(
&knet_h->knet_transport_fd_tracker[sock].access_list_match_entry_head, checkip);
}
File Metadata
Details
Attached
Mime Type
text/x-c
Expires
Mon, Dec 23, 12:01 PM (1 d, 7 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1125718
Default Alt Text
links_acl.c (2 KB)
Attached To
Mode
rK kronosnet
Attached
Detach File
Event Timeline
Log In to Comment