• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /netgear-R7000-V1.0.7.12_1.2.5/components/opensource/linux/linux-2.6.36/net/ipv4/

Lines Matching refs:doi_def

452  * @doi_def: the DOI structure
458 * ensure that the mapping table specified in @doi_def->map meets all of the
463 int cipso_v4_doi_add(struct cipso_v4_doi *doi_def,
472 doi = doi_def->doi;
473 doi_type = doi_def->type;
475 if (doi_def == NULL || doi_def->doi == CIPSO_V4_DOI_UNKNOWN)
478 switch (doi_def->tags[iter]) {
483 if (doi_def->type != CIPSO_V4_MAP_PASS)
487 if (doi_def->type != CIPSO_V4_MAP_LOCAL)
499 atomic_set(&doi_def->refcount, 1);
502 if (cipso_v4_doi_search(doi_def->doi) != NULL) {
507 list_add_tail_rcu(&doi_def->list, &cipso_v4_doi_list);
545 void cipso_v4_doi_free(struct cipso_v4_doi *doi_def)
547 if (doi_def == NULL)
550 switch (doi_def->type) {
552 kfree(doi_def->map.std->lvl.cipso);
553 kfree(doi_def->map.std->lvl.local);
554 kfree(doi_def->map.std->cat.cipso);
555 kfree(doi_def->map.std->cat.local);
558 kfree(doi_def);
573 struct cipso_v4_doi *doi_def;
575 doi_def = container_of(entry, struct cipso_v4_doi, rcu);
576 cipso_v4_doi_free(doi_def);
593 struct cipso_v4_doi *doi_def;
597 doi_def = cipso_v4_doi_search(doi);
598 if (doi_def == NULL) {
603 if (!atomic_dec_and_test(&doi_def->refcount)) {
608 list_del_rcu(&doi_def->list);
612 call_rcu(&doi_def->rcu, cipso_v4_doi_free_rcu);
640 struct cipso_v4_doi *doi_def;
643 doi_def = cipso_v4_doi_search(doi);
644 if (doi_def == NULL)
646 if (!atomic_inc_not_zero(&doi_def->refcount))
647 doi_def = NULL;
651 return doi_def;
656 * @doi_def: the DOI definition
662 void cipso_v4_doi_putdef(struct cipso_v4_doi *doi_def)
664 if (doi_def == NULL)
667 if (!atomic_dec_and_test(&doi_def->refcount))
670 list_del_rcu(&doi_def->list);
674 call_rcu(&doi_def->rcu, cipso_v4_doi_free_rcu);
691 int (*callback) (struct cipso_v4_doi *doi_def, void *arg),
722 * @doi_def: the DOI definition
731 static int cipso_v4_map_lvl_valid(const struct cipso_v4_doi *doi_def, u8 level)
733 switch (doi_def->type) {
737 if (doi_def->map.std->lvl.cipso[level] < CIPSO_V4_INV_LVL)
747 * @doi_def: the DOI definition
757 static int cipso_v4_map_lvl_hton(const struct cipso_v4_doi *doi_def,
761 switch (doi_def->type) {
766 if (host_lvl < doi_def->map.std->lvl.local_size &&
767 doi_def->map.std->lvl.local[host_lvl] < CIPSO_V4_INV_LVL) {
768 *net_lvl = doi_def->map.std->lvl.local[host_lvl];
779 * @doi_def: the DOI definition
789 static int cipso_v4_map_lvl_ntoh(const struct cipso_v4_doi *doi_def,
795 switch (doi_def->type) {
800 map_tbl = doi_def->map.std;
803 *host_lvl = doi_def->map.std->lvl.cipso[net_lvl];
814 * @doi_def: the DOI definition
824 static int cipso_v4_map_cat_rbm_valid(const struct cipso_v4_doi *doi_def,
833 switch (doi_def->type) {
837 cipso_cat_size = doi_def->map.std->cat.cipso_size;
838 cipso_array = doi_def->map.std->cat.cipso;
861 * @doi_def: the DOI definition
872 static int cipso_v4_map_cat_rbm_hton(const struct cipso_v4_doi *doi_def,
884 if (doi_def->type == CIPSO_V4_MAP_TRANS) {
885 host_cat_size = doi_def->map.std->cat.local_size;
886 host_cat_array = doi_def->map.std->cat.local;
895 switch (doi_def->type) {
922 * @doi_def: the DOI definition
933 static int cipso_v4_map_cat_rbm_ntoh(const struct cipso_v4_doi *doi_def,
945 if (doi_def->type == CIPSO_V4_MAP_TRANS) {
946 net_cat_size = doi_def->map.std->cat.cipso_size;
947 net_cat_array = doi_def->map.std->cat.cipso;
961 switch (doi_def->type) {
985 * @doi_def: the DOI definition
995 static int cipso_v4_map_cat_enum_valid(const struct cipso_v4_doi *doi_def,
1003 if (doi_def->type != CIPSO_V4_MAP_PASS || enumcat_len & 0x01)
1018 * @doi_def: the DOI definition
1030 static int cipso_v4_map_cat_enum_hton(const struct cipso_v4_doi *doi_def,
1055 * @doi_def: the DOI definition
1066 static int cipso_v4_map_cat_enum_ntoh(const struct cipso_v4_doi *doi_def,
1087 * @doi_def: the DOI definition
1097 static int cipso_v4_map_cat_rng_valid(const struct cipso_v4_doi *doi_def,
1106 if (doi_def->type != CIPSO_V4_MAP_PASS || rngcat_len & 0x01)
1127 * @doi_def: the DOI definition
1139 static int cipso_v4_map_cat_rng_hton(const struct cipso_v4_doi *doi_def,
1189 * @doi_def: the DOI definition
1200 static int cipso_v4_map_cat_rng_ntoh(const struct cipso_v4_doi *doi_def,
1234 * @doi_def: the DOI definition
1242 static void cipso_v4_gentag_hdr(const struct cipso_v4_doi *doi_def,
1248 *(__be32 *)&buf[2] = htonl(doi_def->doi);
1253 * @doi_def: the DOI definition
1265 static int cipso_v4_gentag_rbm(const struct cipso_v4_doi *doi_def,
1277 ret_val = cipso_v4_map_lvl_hton(doi_def,
1284 ret_val = cipso_v4_map_cat_rbm_hton(doi_def,
1310 * @doi_def: the DOI definition
1320 static int cipso_v4_parsetag_rbm(const struct cipso_v4_doi *doi_def,
1328 ret_val = cipso_v4_map_lvl_ntoh(doi_def, tag[3], &level);
1340 ret_val = cipso_v4_map_cat_rbm_ntoh(doi_def,
1357 * @doi_def: the DOI definition
1367 static int cipso_v4_gentag_enum(const struct cipso_v4_doi *doi_def,
1379 ret_val = cipso_v4_map_lvl_hton(doi_def,
1386 ret_val = cipso_v4_map_cat_enum_hton(doi_def,
1406 * @doi_def: the DOI definition
1416 static int cipso_v4_parsetag_enum(const struct cipso_v4_doi *doi_def,
1424 ret_val = cipso_v4_map_lvl_ntoh(doi_def, tag[3], &level);
1436 ret_val = cipso_v4_map_cat_enum_ntoh(doi_def,
1453 * @doi_def: the DOI definition
1463 static int cipso_v4_gentag_rng(const struct cipso_v4_doi *doi_def,
1475 ret_val = cipso_v4_map_lvl_hton(doi_def,
1482 ret_val = cipso_v4_map_cat_rng_hton(doi_def,
1502 * @doi_def: the DOI definition
1511 static int cipso_v4_parsetag_rng(const struct cipso_v4_doi *doi_def,
1519 ret_val = cipso_v4_map_lvl_ntoh(doi_def, tag[3], &level);
1531 ret_val = cipso_v4_map_cat_rng_ntoh(doi_def,
1548 * @doi_def: the DOI definition
1558 static int cipso_v4_gentag_loc(const struct cipso_v4_doi *doi_def,
1575 * @doi_def: the DOI definition
1584 static int cipso_v4_parsetag_loc(const struct cipso_v4_doi *doi_def,
1621 struct cipso_v4_doi *doi_def = NULL;
1632 doi_def = cipso_v4_doi_search(get_unaligned_be32(&opt[2]));
1633 if (doi_def == NULL) {
1641 for (tag_iter = 0; doi_def->tags[tag_iter] != tag[0];)
1642 if (doi_def->tags[tag_iter] == CIPSO_V4_TAG_INVALID ||
1669 if (cipso_v4_map_lvl_valid(doi_def,
1675 cipso_v4_map_cat_rbm_valid(doi_def,
1689 if (cipso_v4_map_lvl_valid(doi_def,
1695 cipso_v4_map_cat_enum_valid(doi_def,
1708 if (cipso_v4_map_lvl_valid(doi_def,
1714 cipso_v4_map_cat_rng_valid(doi_def,
1792 * @doi_def: the CIPSO DOI to use
1802 const struct cipso_v4_doi *doi_def,
1814 switch (doi_def->tags[iter]) {
1816 ret_val = cipso_v4_gentag_rbm(doi_def,
1822 ret_val = cipso_v4_gentag_enum(doi_def,
1828 ret_val = cipso_v4_gentag_rng(doi_def,
1834 ret_val = cipso_v4_gentag_loc(doi_def,
1846 doi_def->tags[iter] != CIPSO_V4_TAG_INVALID);
1849 cipso_v4_gentag_hdr(doi_def, buf, ret_val);
1856 * @doi_def: the CIPSO DOI to use
1868 const struct cipso_v4_doi *doi_def,
1896 ret_val = cipso_v4_genopt(buf, buf_len, doi_def, secattr);
1939 * @doi_def: the CIPSO DOI to use
1949 const struct cipso_v4_doi *doi_def,
1969 ret_val = cipso_v4_genopt(buf, buf_len, doi_def, secattr);
2131 struct cipso_v4_doi *doi_def;
2138 doi_def = cipso_v4_doi_search(doi);
2139 if (doi_def == NULL)
2143 ret_val = cipso_v4_parsetag_rbm(doi_def, &cipso[6], secattr);
2146 ret_val = cipso_v4_parsetag_enum(doi_def, &cipso[6], secattr);
2149 ret_val = cipso_v4_parsetag_rng(doi_def, &cipso[6], secattr);
2152 ret_val = cipso_v4_parsetag_loc(doi_def, &cipso[6], secattr);
2198 const struct cipso_v4_doi *doi_def,
2209 ret_val = cipso_v4_genopt(buf, buf_len, doi_def, secattr);