static int condition_parse(int c, char **argv, int invert, unsigned int *flags,
const void *entry, struct xt_entry_match **match)
{
- struct condition_info *info =
- (struct condition_info *) (*match)->data;
+ struct condition_info *info = (void *)(*match)->data;
if (c == 'X') {
if (*flags)
static void condition_print(const void *ip, const struct xt_entry_match *match,
int numeric)
{
- const struct condition_info *info =
- (const struct condition_info *) match->data;
+ const struct condition_info *info = (const void *)match->data;
printf("condition %s%s ", (info->invert) ? "!" : "", info->name);
}
static void condition_save(const void *ip, const struct xt_entry_match *match)
{
- const struct condition_info *info =
- (const struct condition_info *) match->data;
+ const struct condition_info *info = (const void *)match->data;
printf("--condition %s\"%s\" ", (info->invert) ? "! " : "", info->name);
}
.extra_opts = condition_opts,
};
-void _init(void);
-void _init(void)
+static void _init(void)
{
xtables_register_match(&condition_match);
}
xt_condition_read_info(char __user *buffer, char **start, off_t offset,
int length, int *eof, void *data)
{
- struct condition_variable *var =
- (struct condition_variable *) data;
+ const struct condition_variable *var = data;
buffer[0] = (var->enabled) ? '1' : '0';
buffer[1] = '\n';
xt_condition_write_info(struct file *file, const char __user *buffer,
unsigned long length, void *data)
{
- struct condition_variable *var =
- (struct condition_variable *) data;
+ struct condition_variable *var = data;
char newval;
if (length>0) {
}
}
- return (int) length;
+ return length;
}
static bool
const void *matchinfo, int offset, unsigned int protoff,
bool *hotdrop)
{
- const struct condition_info *info =
- (const struct condition_info *) matchinfo;
+ const struct condition_info *info = matchinfo;
struct condition_variable *var;
int condition_status = 0;
unsigned int hook_mask)
{
static const char * const forbidden_names[]={ "", ".", ".." };
- struct condition_info *info = (struct condition_info *) matchinfo;
+ const struct condition_info *info = matchinfo;
struct list_head *pos;
struct condition_variable *var, *newvar;
static void condition_mt_destroy(const struct xt_match *match, void *matchinfo)
{
- struct condition_info *info = (struct condition_info *) matchinfo;
+ const struct condition_info *info = matchinfo;
struct list_head *pos;
struct condition_variable *var;