diff options
author | Jozsef Kadlecsik <kadlec@blackhole.kfki.hu> | 2010-04-22 16:52:29 +0200 |
---|---|---|
committer | Jozsef Kadlecsik <kadlec@blackhole.kfki.hu> | 2010-04-22 16:52:29 +0200 |
commit | 8e0608d31d988333ff04f3faaa6e851c0ecdbc6e (patch) | |
tree | b042fc732d7c784d298ed42496f88a2f164f413c /include/libipset/ui.h | |
parent | 1e6e8bd9a62aa7cd72e13db9355badc96df18ee8 (diff) |
Fourth stage to ipset-5
Add new userspace files: include/, lib/ and plus new files in src/.
Diffstat (limited to 'include/libipset/ui.h')
-rw-r--r-- | include/libipset/ui.h | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/include/libipset/ui.h b/include/libipset/ui.h new file mode 100644 index 0000000..044e586 --- /dev/null +++ b/include/libipset/ui.h @@ -0,0 +1,47 @@ +/* Copyright 2007-2010 Jozsef Kadlecsik (kadlec@blackhole.kfki.hu) + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + */ +#ifndef LIBIPSET_UI_H +#define LIBIPSET_UI_H + +/* Commands in userspace */ +struct ipset_commands { + const char *name[6]; + const char *help; + int has_arg; +}; + +extern const struct ipset_commands ipset_commands[]; + +/* Environment option flags */ +enum ipset_envopt { + IPSET_ENV_BIT_SORTED = 0, + IPSET_ENV_SORTED = (1 << IPSET_ENV_BIT_SORTED), + IPSET_ENV_BIT_QUIET = 1, + IPSET_ENV_QUIET = (1 << IPSET_ENV_BIT_QUIET), + IPSET_ENV_BIT_RESOLVE = 2, + IPSET_ENV_RESOLVE = (1 << IPSET_ENV_BIT_RESOLVE), + IPSET_ENV_BIT_EXIST = 3, + IPSET_ENV_EXIST = (1 << IPSET_ENV_BIT_EXIST), +}; + +struct ipset_session; +struct ipset_data; + +/* Environment options */ +struct ipset_envopts { + int flag; + int has_arg; + const char *name[3]; + const char *help; + int (*parse)(struct ipset_session *s, int flag, const char *str); + int (*print)(char *buf, unsigned int len, + const struct ipset_data *data, int flag, uint8_t env); +}; + +extern const struct ipset_envopts ipset_envopts[]; + +#endif /* LIBIPSET_UI_H */ |