Lines Matching refs:ext
398 struct sadb_ext *ext[SADB_EXT_MAX + 1];
1910 (mhp->ext[idx] == NULL || mhp->extlen[idx] == 0))
1998 if (mhp->ext[SADB_EXT_ADDRESS_SRC] == NULL ||
1999 mhp->ext[SADB_EXT_ADDRESS_DST] == NULL ||
2000 mhp->ext[SADB_X_EXT_POLICY] == NULL) {
2010 if (mhp->ext[SADB_EXT_LIFETIME_HARD] != NULL) {
2016 lft = (struct sadb_lifetime *)mhp->ext[SADB_EXT_LIFETIME_HARD];
2019 src0 = (struct sadb_address *)mhp->ext[SADB_EXT_ADDRESS_SRC];
2020 dst0 = (struct sadb_address *)mhp->ext[SADB_EXT_ADDRESS_DST];
2021 xpl0 = (struct sadb_x_policy *)mhp->ext[SADB_X_EXT_POLICY];
2293 if (mhp->ext[SADB_EXT_ADDRESS_SRC] == NULL ||
2294 mhp->ext[SADB_EXT_ADDRESS_DST] == NULL ||
2295 mhp->ext[SADB_X_EXT_POLICY] == NULL) {
2306 src0 = (struct sadb_address *)mhp->ext[SADB_EXT_ADDRESS_SRC];
2307 dst0 = (struct sadb_address *)mhp->ext[SADB_EXT_ADDRESS_DST];
2308 xpl0 = (struct sadb_x_policy *)mhp->ext[SADB_X_EXT_POLICY];
2393 if (mhp->ext[SADB_X_EXT_POLICY] == NULL ||
2400 id = ((struct sadb_x_policy *)mhp->ext[SADB_X_EXT_POLICY])->sadb_x_policy_id;
2495 if (mhp->ext[SADB_X_EXT_POLICY] == NULL ||
2501 id = ((struct sadb_x_policy *)mhp->ext[SADB_X_EXT_POLICY])->sadb_x_policy_id;
3107 if (mhp->ext[SADB_EXT_SA] == NULL) {
3113 xsa = (const struct sadb_sa *)mhp->ext[SADB_EXT_SA];
3373 if (mhp->ext[SADB_EXT_SA] != NULL) {
3376 sa0 = (const struct sadb_sa *)mhp->ext[SADB_EXT_SA];
3423 if (mhp->ext[SADB_EXT_KEY_AUTH] != NULL) {
3427 key0 = (const struct sadb_key *)mhp->ext[SADB_EXT_KEY_AUTH];
3432 ipseclog((LOG_DEBUG, "key_setsaval: invalid auth key ext len. len = %d\n", len));
3462 if (mhp->ext[SADB_EXT_KEY_ENCRYPT] != NULL) {
3466 key0 = (const struct sadb_key *)mhp->ext[SADB_EXT_KEY_ENCRYPT];
3471 ipseclog((LOG_DEBUG, "key_setsaval: invalid encryption key ext len. len = %d\n", len));
3575 lft0 = (struct sadb_lifetime *)mhp->ext[SADB_EXT_LIFETIME_HARD];
3578 ipseclog((LOG_DEBUG, "key_setsaval: invalid hard lifetime ext len.\n"));
3592 lft0 = (struct sadb_lifetime *)mhp->ext[SADB_EXT_LIFETIME_SOFT];
3595 ipseclog((LOG_DEBUG, "key_setsaval: invalid soft lifetime ext len.\n"));
5182 if (mhp->ext[SADB_EXT_ADDRESS_SRC] == NULL ||
5183 mhp->ext[SADB_EXT_ADDRESS_DST] == NULL) {
5192 if (mhp->ext[SADB_X_EXT_SA2] != NULL) {
5193 mode = ((struct sadb_x_sa2 *)mhp->ext[SADB_X_EXT_SA2])->sadb_x_sa2_mode;
5194 reqid = ((struct sadb_x_sa2 *)mhp->ext[SADB_X_EXT_SA2])->sadb_x_sa2_reqid;
5200 src0 = (struct sadb_address *)(mhp->ext[SADB_EXT_ADDRESS_SRC]);
5201 dst0 = (struct sadb_address *)(mhp->ext[SADB_EXT_ADDRESS_DST]);
5249 spi = key_do_getnewspi((struct sadb_spirange *)mhp->ext[SADB_EXT_SPIRANGE],
5482 if (mhp->ext[SADB_EXT_SA] == NULL ||
5483 mhp->ext[SADB_EXT_ADDRESS_SRC] == NULL ||
5484 mhp->ext[SADB_EXT_ADDRESS_DST] == NULL ||
5486 mhp->ext[SADB_EXT_KEY_ENCRYPT] == NULL) ||
5488 mhp->ext[SADB_EXT_KEY_AUTH] == NULL) ||
5489 (mhp->ext[SADB_EXT_LIFETIME_HARD] != NULL &&
5490 mhp->ext[SADB_EXT_LIFETIME_SOFT] == NULL) ||
5491 (mhp->ext[SADB_EXT_LIFETIME_HARD] == NULL &&
5492 mhp->ext[SADB_EXT_LIFETIME_SOFT] != NULL)) {
5502 if (mhp->ext[SADB_X_EXT_SA2] != NULL) {
5503 mode = ((struct sadb_x_sa2 *)mhp->ext[SADB_X_EXT_SA2])->sadb_x_sa2_mode;
5504 reqid = ((struct sadb_x_sa2 *)mhp->ext[SADB_X_EXT_SA2])->sadb_x_sa2_reqid;
5511 sa0 = (struct sadb_sa *)mhp->ext[SADB_EXT_SA];
5512 src0 = (struct sadb_address *)(mhp->ext[SADB_EXT_ADDRESS_SRC]);
5513 dst0 = (struct sadb_address *)(mhp->ext[SADB_EXT_ADDRESS_DST]);
5704 if (mhp->ext[SADB_EXT_SA] == NULL ||
5705 mhp->ext[SADB_EXT_ADDRESS_SRC] == NULL ||
5706 mhp->ext[SADB_EXT_ADDRESS_DST] == NULL ||
5708 mhp->ext[SADB_EXT_KEY_ENCRYPT] == NULL) ||
5710 mhp->ext[SADB_EXT_KEY_AUTH] == NULL) ||
5711 (mhp->ext[SADB_EXT_LIFETIME_HARD] != NULL &&
5712 mhp->ext[SADB_EXT_LIFETIME_SOFT] == NULL) ||
5713 (mhp->ext[SADB_EXT_LIFETIME_HARD] == NULL &&
5714 mhp->ext[SADB_EXT_LIFETIME_SOFT] != NULL)) {
5725 if (mhp->ext[SADB_X_EXT_SA2] != NULL) {
5726 mode = ((struct sadb_x_sa2 *)mhp->ext[SADB_X_EXT_SA2])->sadb_x_sa2_mode;
5727 reqid = ((struct sadb_x_sa2 *)mhp->ext[SADB_X_EXT_SA2])->sadb_x_sa2_reqid;
5733 sa0 = (struct sadb_sa *)mhp->ext[SADB_EXT_SA];
5734 src0 = (struct sadb_address *)mhp->ext[SADB_EXT_ADDRESS_SRC];
5735 dst0 = (struct sadb_address *)mhp->ext[SADB_EXT_ADDRESS_DST];
5828 if (mhp->ext[SADB_EXT_IDENTITY_SRC] == NULL &&
5829 mhp->ext[SADB_EXT_IDENTITY_DST] == NULL) {
5835 if (mhp->ext[SADB_EXT_IDENTITY_SRC] == NULL ||
5836 mhp->ext[SADB_EXT_IDENTITY_DST] == NULL) {
5841 idsrc = (const struct sadb_ident *)mhp->ext[SADB_EXT_IDENTITY_SRC];
5842 iddst = (const struct sadb_ident *)mhp->ext[SADB_EXT_IDENTITY_DST];
5968 if (mhp->ext[SADB_EXT_ADDRESS_SRC] == NULL ||
5969 mhp->ext[SADB_EXT_ADDRESS_DST] == NULL) {
5982 if (mhp->ext[SADB_EXT_SA] == NULL) {
5997 sa0 = (struct sadb_sa *)mhp->ext[SADB_EXT_SA];
5998 src0 = (struct sadb_address *)(mhp->ext[SADB_EXT_ADDRESS_SRC]);
5999 dst0 = (struct sadb_address *)(mhp->ext[SADB_EXT_ADDRESS_DST]);
6071 src0 = (struct sadb_address *)(mhp->ext[SADB_EXT_ADDRESS_SRC]);
6072 dst0 = (struct sadb_address *)(mhp->ext[SADB_EXT_ADDRESS_DST]);
6171 if (mhp->ext[SADB_EXT_SA] == NULL ||
6172 mhp->ext[SADB_EXT_ADDRESS_SRC] == NULL ||
6173 mhp->ext[SADB_EXT_ADDRESS_DST] == NULL) {
6184 sa0 = (struct sadb_sa *)mhp->ext[SADB_EXT_SA];
6185 src0 = (struct sadb_address *)mhp->ext[SADB_EXT_ADDRESS_SRC];
6186 dst0 = (struct sadb_address *)mhp->ext[SADB_EXT_ADDRESS_DST];
6885 if (mhp->ext[SADB_EXT_ADDRESS_SRC] == NULL ||
6886 mhp->ext[SADB_EXT_ADDRESS_DST] == NULL ||
6887 mhp->ext[SADB_EXT_PROPOSAL] == NULL) {
6902 src0 = (struct sadb_address *)mhp->ext[SADB_EXT_ADDRESS_SRC];
6903 dst0 = (struct sadb_address *)mhp->ext[SADB_EXT_ADDRESS_DST];
7735 if (mh.ext[SADB_EXT_ADDRESS_SRC] != NULL
7736 && mh.ext[SADB_EXT_ADDRESS_DST] != NULL) {
7740 src0 = (struct sadb_address *)(mh.ext[SADB_EXT_ADDRESS_SRC]);
7741 dst0 = (struct sadb_address *)(mh.ext[SADB_EXT_ADDRESS_DST]);
7864 struct sadb_ext *ext;
7879 mhp->ext[0] = (struct sadb_ext *)mhp->msg; /*XXX backward compat */
7889 ext = (struct sadb_ext *)(mtod(n, caddr_t) + toff);
7892 switch (ext->sadb_ext_type) {
7916 if (mhp->ext[ext->sadb_ext_type] != NULL) {
7919 "is passed.\n", ext->sadb_ext_type));
7928 ext->sadb_ext_type));
7934 extlen = PFKEY_UNUNIT64(ext->sadb_ext_len);
7936 if (key_validate_ext(ext, extlen)) {
7947 ext = (struct sadb_ext *)(mtod(n, caddr_t) + toff);
7949 mhp->ext[ext->sadb_ext_type] = ext;
7950 mhp->extoff[ext->sadb_ext_type] = off;
7951 mhp->extlen[ext->sadb_ext_type] = extlen;
7964 key_validate_ext(ext, len)
7965 const struct sadb_ext *ext;
7973 if (len != PFKEY_UNUNIT64(ext->sadb_ext_len))
7977 if (ext->sadb_ext_type >= sizeof(minsize) / sizeof(minsize[0]) ||
7978 ext->sadb_ext_type >= sizeof(maxsize) / sizeof(maxsize[0]))
7980 if (!minsize[ext->sadb_ext_type] || len < minsize[ext->sadb_ext_type])
7982 if (maxsize[ext->sadb_ext_type] && len > maxsize[ext->sadb_ext_type])
7986 switch (ext->sadb_ext_type) {
7995 if (((struct sadb_ident *)ext)->sadb_ident_type ==
8011 sa = (struct sockaddr *)((caddr_t)ext + baselen);