Lines Matching refs:af

91 	u_int8_t af = target->family;
93 mutex_lock(&xt[af].mutex);
94 list_add(&target->list, &xt[af].target);
95 mutex_unlock(&xt[af].mutex);
103 u_int8_t af = target->family;
105 mutex_lock(&xt[af].mutex);
107 mutex_unlock(&xt[af].mutex);
141 u_int8_t af = match->family;
143 mutex_lock(&xt[af].mutex);
144 list_add(&match->list, &xt[af].match);
145 mutex_unlock(&xt[af].mutex);
153 u_int8_t af = match->family;
155 mutex_lock(&xt[af].mutex);
157 mutex_unlock(&xt[af].mutex);
197 struct xt_match *xt_find_match(u8 af, const char *name, u8 revision)
205 mutex_lock(&xt[af].mutex);
206 list_for_each_entry(m, &xt[af].match, list) {
210 mutex_unlock(&xt[af].mutex);
217 mutex_unlock(&xt[af].mutex);
219 if (af != NFPROTO_UNSPEC)
246 static struct xt_target *xt_find_target(u8 af, const char *name, u8 revision)
254 mutex_lock(&xt[af].mutex);
255 list_for_each_entry(t, &xt[af].target, list) {
259 mutex_unlock(&xt[af].mutex);
266 mutex_unlock(&xt[af].mutex);
268 if (af != NFPROTO_UNSPEC)
275 struct xt_target *xt_request_find_target(u8 af, const char *name, u8 revision)
282 target = xt_find_target(af, name, revision);
284 request_module("%st_%s", xt_prefix[af], name);
285 target = xt_find_target(af, name, revision);
348 static int match_revfn(u8 af, const char *name, u8 revision, int *bestp)
353 mutex_lock(&xt[af].mutex);
354 list_for_each_entry(m, &xt[af].match, list) {
362 mutex_unlock(&xt[af].mutex);
364 if (af != NFPROTO_UNSPEC && !have_rev)
370 static int target_revfn(u8 af, const char *name, u8 revision, int *bestp)
375 mutex_lock(&xt[af].mutex);
376 list_for_each_entry(t, &xt[af].target, list) {
384 mutex_unlock(&xt[af].mutex);
386 if (af != NFPROTO_UNSPEC && !have_rev)
393 int xt_find_revision(u8 af, const char *name, u8 revision, int target,
399 have_rev = target_revfn(af, name, revision, &best);
401 have_rev = match_revfn(af, name, revision, &best);
665 int xt_compat_add_offset(u_int8_t af, unsigned int offset, int delta)
667 struct xt_af *xp = &xt[af];
669 WARN_ON(!mutex_is_locked(&xt[af].compat_mutex));
686 void xt_compat_flush_offsets(u_int8_t af)
688 WARN_ON(!mutex_is_locked(&xt[af].compat_mutex));
690 if (xt[af].compat_tab) {
691 vfree(xt[af].compat_tab);
692 xt[af].compat_tab = NULL;
693 xt[af].number = 0;
694 xt[af].cur = 0;
699 int xt_compat_calc_jump(u_int8_t af, unsigned int offset)
701 struct compat_delta *tmp = xt[af].compat_tab;
702 int mid, left = 0, right = xt[af].cur - 1;
717 int xt_compat_init_offsets(u8 af, unsigned int number)
721 WARN_ON(!mutex_is_locked(&xt[af].compat_mutex));
726 if (WARN_ON(xt[af].compat_tab))
733 xt[af].compat_tab = vmalloc(mem);
734 if (!xt[af].compat_tab)
737 xt[af].number = number;
738 xt[af].cur = 0;
1217 struct xt_table *xt_find_table(struct net *net, u8 af, const char *name)
1222 mutex_lock(&xt[af].mutex);
1223 list_for_each_entry(t, &xt_net->tables[af], list) {
1225 mutex_unlock(&xt[af].mutex);
1229 mutex_unlock(&xt[af].mutex);
1235 struct xt_table *xt_find_table_lock(struct net *net, u_int8_t af,
1243 mutex_lock(&xt[af].mutex);
1244 list_for_each_entry(t, &xt_net->tables[af], list)
1249 list_for_each_entry(tmpl, &xt_templates[af], list) {
1259 mutex_unlock(&xt[af].mutex);
1266 mutex_lock(&xt[af].mutex);
1271 list_for_each_entry(t, &xt_net->tables[af], list)
1277 mutex_unlock(&xt[af].mutex);
1282 struct xt_table *xt_request_find_table_lock(struct net *net, u_int8_t af,
1285 struct xt_table *t = xt_find_table_lock(net, af, name);
1289 int err = request_module("%stable_%s", xt_prefix[af], name);
1292 t = xt_find_table_lock(net, af, name);
1302 mutex_unlock(&xt[table->af].mutex);
1307 void xt_compat_lock(u_int8_t af)
1309 mutex_lock(&xt[af].compat_mutex);
1313 void xt_compat_unlock(u_int8_t af)
1315 mutex_unlock(&xt[af].compat_mutex);
1443 audit_log_nfcfg(table->name, table->af, private->number,
1468 mutex_lock(&xt[table->af].mutex);
1470 list_for_each_entry(t, &xt_net->tables[table->af], list) {
1489 list_add(&table->list, &xt_net->tables[table->af]);
1490 mutex_unlock(&xt[table->af].mutex);
1494 mutex_unlock(&xt[table->af].mutex);
1505 mutex_lock(&xt[table->af].mutex);
1508 mutex_unlock(&xt[table->af].mutex);
1509 audit_log_nfcfg(table->name, table->af, private->number,
1521 u8 af = (unsigned long)pde_data(file_inode(seq->file));
1527 mutex_lock(&xt[af].mutex);
1528 return seq_list_start(&xt_net->tables[af], *pos);
1533 u8 af = (unsigned long)pde_data(file_inode(seq->file));
1539 return seq_list_next(v, &xt_net->tables[af], pos);
1544 u_int8_t af = (unsigned long)pde_data(file_inode(seq->file));
1546 mutex_unlock(&xt[af].mutex);
1752 ops[i].pf = table->af;
1765 int ret = -EEXIST, af = table->af;
1768 mutex_lock(&xt[af].mutex);
1770 list_for_each_entry(t, &xt_templates[af], list) {
1785 list_add(&t->list, &xt_templates[af]);
1788 mutex_unlock(&xt[af].mutex);
1796 int af = table->af;
1798 mutex_lock(&xt[af].mutex);
1799 list_for_each_entry(t, &xt_templates[af], list) {
1804 mutex_unlock(&xt[af].mutex);
1809 mutex_unlock(&xt[af].mutex);
1814 int xt_proto_init(struct net *net, u_int8_t af)
1823 if (af >= ARRAY_SIZE(xt_prefix))
1831 strscpy(buf, xt_prefix[af], sizeof(buf));
1835 (void *)(unsigned long)af);
1841 strscpy(buf, xt_prefix[af], sizeof(buf));
1845 (void *)(unsigned long)af);
1851 strscpy(buf, xt_prefix[af], sizeof(buf));
1855 (void *)(unsigned long)af);
1866 strscpy(buf, xt_prefix[af], sizeof(buf));
1871 strscpy(buf, xt_prefix[af], sizeof(buf));
1880 void xt_proto_fini(struct net *net, u_int8_t af)
1885 strscpy(buf, xt_prefix[af], sizeof(buf));
1889 strscpy(buf, xt_prefix[af], sizeof(buf));
1893 strscpy(buf, xt_prefix[af], sizeof(buf));