Commit e0a40dc2 authored by Lutz Donnerhacke's avatar Lutz Donnerhacke
Browse files

libalias: Restructure

Clean up the database handling in order to switch to more efficient
data structures.  The development of this patch was artificially split
in to many small steps to ease reviewing.

- Common search terms
- Separate fully qualified search
- Separate table for partial links
- Cleanup _FindLinkIn
- Factor out the outgoing search function
- Factor out a common idiom to return found links
- Reorder incoming links by grouping of common search terms
- Remove LSNAT from outgoing search
- Group internal structure semantically
- Separate table for PPTP
- Use AliasRange instead of PORT_BASE
- Remove temporary state deleteAllLinks from global struct
- Avoid uninitialized expiration

Discussed with:	Dimitry Luhtionov
Differential Revision: https://reviews.freebsd.org/D30568
Differential Revision: https://reviews.freebsd.org/D30569
Differential Revision: https://reviews.freebsd.org/D30570
Differential Revision: https://reviews.freebsd.org/D30571
Differential Revision: https://reviews.freebsd.org/D30572
Differential Revision: https://reviews.freebsd.org/D30573
Differential Revision: https://reviews.freebsd.org/D30574
Differential Revision: https://reviews.freebsd.org/D30575
Differential Revision: https://reviews.freebsd.org/D30580
Differential Revision: https://reviews.freebsd.org/D30581
Differential Revision: https://reviews.freebsd.org/D30604
Differential Revision: https://reviews.freebsd.org/D30582

(cherry picked from commit d41044dd)
(cherry picked from commit 32f9c2ce)
(cherry picked from commit cac129e6)
(cherry picked from commit 19dcc4f2)
(cherry picked from commit d5419034)
(cherry picked from commit d4ab07d2)
(cherry picked from commit 492d3b71)
(cherry picked from commit 7b44ff4c)
(cherry picked from commit 1178dda5)
(cherry picked from commit 9efcad61)
(cherry picked from commit fe83900f)
(cherry picked from commit d989935b)
(cherry picked from commit b50a4dce)
(cherry picked from commit f2845534)
parent 8b7b86fa
......@@ -143,3 +143,7 @@ Version 3.1: May, 2000 (Erik Salander, erik@whistle.com)
Version 3.2: July, 2000 (Erik Salander, erik@whistle.com and
Junichi Satoh, junichi@junichi.org)
- Added support for streaming media (RTSP and PNA) aliasing.
Version 3.3: May 2021 (donner)
- Dropped LibAliasCheckNewLink
- Refactor the database handling, perfomance improvements.
This diff is collapsed.
......@@ -80,6 +80,14 @@
struct proxy_entry;
struct group_in {
struct in_addr alias_addr;
u_short alias_port;
int link_type;
LIST_ENTRY(group_in) group_in;
LIST_HEAD(, alias_link) full, partial;
};
struct libalias {
LIST_ENTRY(libalias) instancelist;
/* Mode flags documented in alias.h */
......@@ -92,8 +100,9 @@ struct libalias {
/* Lookup table of pointers to chains of link records.
* Each link record is doubly indexed into input and
* output lookup tables. */
LIST_HEAD (, alias_link) linkTableOut[LINK_TABLE_OUT_SIZE];
LIST_HEAD (, alias_link) linkTableIn[LINK_TABLE_IN_SIZE];
LIST_HEAD (, alias_link) linkTableOut[LINK_TABLE_OUT_SIZE];
LIST_HEAD (, group_in) groupTableIn[LINK_TABLE_IN_SIZE];
LIST_HEAD (, alias_link) pptpList;
/* HouseKeeping */
TAILQ_HEAD (, alias_link) checkExpire;
/* Link statistics */
......@@ -105,9 +114,6 @@ struct libalias {
unsigned int fragmentIdLinkCount;
unsigned int fragmentPtrLinkCount;
unsigned int sockCount;
/* If equal to zero, DeleteLink()
* will not remove permanent links */
int deleteAllLinks;
/* log descriptor */
#ifdef _KERNEL
char *logDesc;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment