3
A brief file description
5
@section license License
7
Licensed to the Apache Software Foundation (ASF) under one
8
or more contributor license agreements. See the NOTICE file
9
distributed with this work for additional information
10
regarding copyright ownership. The ASF licenses this file
11
to you under the Apache License, Version 2.0 (the
12
"License"); you may not use this file except in compliance
13
with the License. You may obtain a copy of the License at
15
http://www.apache.org/licenses/LICENSE-2.0
17
Unless required by applicable law or agreed to in writing, software
18
distributed under the License is distributed on an "AS IS" BASIS,
19
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
20
See the License for the specific language governing permissions and
21
limitations under the License.
24
/*****************************************************************************
26
* MgmtAllow.h - Interface to Manager IP Access Control systtem
29
****************************************************************************/
31
#ifndef _MGMT_ALLOW_H_
32
#define _MGMT_ALLOW_H_
36
#include "P_RecCore.h"
38
#define PATH_NAME_MAX 511
50
class MgmtAllow:public IpLookup
53
MgmtAllow(const char *config_var, const char *name, const char *action_val);
57
bool match(ip_addr_t ip);
59
const char *config_file_var;
60
char config_file_path[PATH_NAME_MAX];
61
const char *module_name;
66
extern MgmtAllow *mgmt_allow_table;
70
MgmtAllow::match(ip_addr_t ip)
72
if (err_allow_all == true) {
75
MgmtAllowRecord *cur = NULL, *result = NULL;
78
found = IpLookup::MatchFirst(ip, &s, (void **) &cur);
81
if (cur->line_num < result->line_num) {
84
found = IpLookup::MatchNext(&s, (void **) &cur);
86
return ((result != NULL) && (result->access == MGMT_ALLOW));