mirror of
http://git.haproxy.org/git/haproxy.git/
synced 2025-03-04 02:19:09 +00:00
[MINOR] stick-table: provide a table lookup function
We'll often need to lookup a table by its name. This will change in the future once we can resolve these names on startup.
This commit is contained in:
parent
9ba2dcc86c
commit
4a0347add0
@ -46,6 +46,7 @@ struct stktable_key *stktable_fetch_key(struct proxy *px, struct session *l4,
|
||||
unsigned long table_type);
|
||||
int stktable_compatible_pattern(struct pattern_expr *expr, unsigned long table_type);
|
||||
int stktable_get_data_type(char *name);
|
||||
struct proxy *find_stktable(const char *name);
|
||||
|
||||
/* reserve some space for data type <type>. Return non-0 if OK, or 0 if already
|
||||
* allocated (or impossible type).
|
||||
|
@ -544,3 +544,14 @@ int stktable_get_data_type(char *name)
|
||||
return -1;
|
||||
}
|
||||
|
||||
/* Returns pointer to proxy containing table <name> or NULL if not found */
|
||||
struct proxy *find_stktable(const char *name)
|
||||
{
|
||||
struct proxy *px;
|
||||
|
||||
for (px = proxy; px; px = px->next) {
|
||||
if (px->table.size && strcmp(px->id, name) == 0)
|
||||
return px;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user