tools/adflib: build only host variant which is used by Sam440 target
[AROS.git] / workbench / network / stacks / AROSTCP / bsdsocket / kern / accesscontrol.h
blob39851ea0f804b46f2e5dfe8aeb57516707d3fbb7
1 /*
2 * Copyright (C) 1993,1994 AmiTCP/IP Group, <amitcp-group@hut.fi>
3 * Helsinki University of Technology, Finland.
4 * All rights reserved.
5 * Copyright (C) 2005 Neil Cafferkey
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation.
11 * This program is distributed in the hope that it will be useful, but
12 * WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place - Suite 330, Boston,
19 * MA 02111-1307, USA.
23 #ifndef ACCESSCONTROL_H
24 #define ACCESSCONTROL_H
26 #include <sys/syslog.h>
27 #ifndef AMIGA_NETDB_H
28 #include <kern/amiga_netdb.h>
29 #endif
31 int controlaccess(struct in_addr shost, unsigned short sport);
33 static inline void setup_accesscontroltable(struct NetDataBase * ndb)
35 void * new_AccessTable;
36 *((ULONG *)&ndb->ndb_AccessTable[ndb->ndb_AccessCount]) = 0; /*mark default*/
38 new_AccessTable =
39 bsd_realloc(ndb->ndb_AccessTable,
40 ndb->ndb_AccessCount * sizeof (struct AccessItem) +
41 sizeof (ULONG), M_NETDB, M_WAITOK);
42 if (new_AccessTable)
44 ndb->ndb_AccessTable = new_AccessTable;
45 #ifdef DEBUG_NETDB
46 __log(7, "Reallocated accesscontroltable to 0x%08x:", new_AccessTable);
48 int i;
49 #define host ndb->ndb_AccessTable[i].ai_host
50 #define mask ndb->ndb_AccessTable[i].ai_mask
51 for (i = 0; i < ndb->ndb_AccessCount; i++)
52 __log(7, "%ld %ld.%ld.%ld.%ld/%ld.%ld.%ld.%ld %lx",
53 ndb->ndb_AccessTable[i].ai_port,
54 host>>24 & 0xff, host>>16 & 0xff, host>>8 & 0xff, host & 0xff,
55 mask>>24 & 0xff, mask>>16 & 0xff, mask>>8 & 0xff, mask & 0xff,
56 ndb->ndb_AccessTable[i].ai_flags);
58 __log(7, "%ld %ld", ndb->ndb_AccessTable[i].ai_flags,
59 /* */ ndb->ndb_AccessTable[i].ai_port);
60 #undef mask
61 #undef host
63 #endif
65 else
66 __log(LOG_EMERG, "Memory exhausted while reallocating access control table");
68 #endif /* ACCESSCONTROL_H */