mirror of
https://repo.or.cz/socat.git
synced 2025-07-26 20:12:56 +00:00
Corrected UNIX client NAMED options to work on bind address
This commit is contained in:
parent
5570bf4d62
commit
d9d320cb47
13 changed files with 232 additions and 45 deletions
25
xioopts.c
25
xioopts.c
|
@ -2514,6 +2514,31 @@ int parseopts_table(const char **a, unsigned int groups, struct opt **opts,
|
|||
return 0;
|
||||
}
|
||||
|
||||
|
||||
/* look for an option with the given properties
|
||||
return a pointer to the first matching valid option in the list
|
||||
Returns NULL when no matching option found */
|
||||
const struct opt *searchopt(const struct opt *opts, unsigned int groups, enum e_phase from, enum e_phase to,
|
||||
enum e_func func) {
|
||||
int i;
|
||||
|
||||
if (!opts) return NULL;
|
||||
|
||||
/* remember: struct opt are in an array */
|
||||
i = 0;
|
||||
while (opts[i].desc != ODESC_END) {
|
||||
if (opts[i].desc != ODESC_DONE &&
|
||||
(groups == 0 || (groups && (opts[i].desc->group&groups))) &&
|
||||
(from == 0 || (from <= opts[i].desc->phase)) &&
|
||||
(to == 0 || (opts[i].desc->phase <= to)) &&
|
||||
(func == 0 || (opts[i].desc->func == func))) {
|
||||
return &opts[i];
|
||||
}
|
||||
++i;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* copy the already parsed options for repeated application, but only those
|
||||
matching groups ANY and <groups> */
|
||||
struct opt *copyopts(const struct opt *opts, unsigned int groups) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue