Lines Matching defs:sav
109 struct secasvar *sav = NULL;
148 if ((sav = key_allocsa(AF_INET,
158 printf("DP ah4_input called to allocate SA:%p\n", sav));
159 if (sav->state != SADB_SASTATE_MATURE
160 && sav->state != SADB_SASTATE_DYING) {
168 algo = ah_algorithm_lookup(sav->alg_auth);
177 siz = (*algo->sumsiz)(sav);
186 sizoff = (sav->flags & SADB_X_EXT_OLD) ? 0 : 4;
252 if ((sav->flags & SADB_X_EXT_OLD) == 0 && sav->replay) {
253 if (ipsec_chkreplay(ntohl(((struct newah *)ah)->ah_seq), sav))
259 ipsec4_logpacketstr(ip, spi), ipsec_logsastr(sav)));
282 if (ah4_calccksum(m, (caddr_t)cksum, siz1, algo, sav)) {
287 IPSEC_STAT_INCREMENT(ipsecstat.in_ahhist[sav->alg_auth]);
297 if (sav->flags & SADB_X_EXT_OLD) {
308 ipsec4_logpacketstr(ip, spi), ipsec_logsastr(sav)));
329 sizoff = (sav->flags & SADB_X_EXT_OLD) ? 0 : 4;
367 ipsec4_logpacketstr(ip, spi), ipsec_logsastr(sav)));
375 if ((sav->flags & SADB_X_EXT_OLD) == 0 && sav->replay) {
376 if (ipsec_updatereplay(ntohl(((struct newah *)ah)->ah_seq), sav)) {
383 if (sav->flags & SADB_X_EXT_OLD) {
390 if (ipsec4_tunnel_validate(m, off + stripsiz, nxt, sav, &ifamily)) {
402 "in IPv4 AH input: %s\n", ipsec_logsastr(sav)));
417 if (!key_checktunnelsanity(sav, AF_INET,
421 ipsec4_logpacketstr(ip, spi), ipsec_logsastr(sav)));
450 key_sa_recordxfer(sav, m);
518 key_sa_recordxfer(sav, m);
536 if (sav) {
538 printf("DP ah4_input call free SA:%p\n", sav));
539 key_freesav(sav, KEY_SADB_UNLOCKED);
545 if (sav) {
547 printf("DP ah4_input call free SA:%p\n", sav));
548 key_freesav(sav, KEY_SADB_UNLOCKED);
571 struct secasvar *sav = NULL;
600 if ((sav = key_allocsa(AF_INET6,
610 printf("DP ah6_input called to allocate SA:%p\n", sav));
611 if (sav->state != SADB_SASTATE_MATURE
612 && sav->state != SADB_SASTATE_DYING) {
620 algo = ah_algorithm_lookup(sav->alg_auth);
629 siz = (*algo->sumsiz)(sav);
638 sizoff = (sav->flags & SADB_X_EXT_OLD) ? 0 : 4;
678 if ((sav->flags & SADB_X_EXT_OLD) == 0 && sav->replay) {
679 if (ipsec_chkreplay(ntohl(((struct newah *)ah)->ah_seq), sav))
686 ipsec_logsastr(sav)));
703 if (ah6_calccksum(m, (caddr_t)cksum, siz1, algo, sav)) {
708 IPSEC_STAT_INCREMENT(ipsec6stat.in_ahhist[sav->alg_auth]);
713 if (sav->flags & SADB_X_EXT_OLD) {
724 ipsec6_logpacketstr(ip6, spi), ipsec_logsastr(sav)));
745 sizoff = (sav->flags & SADB_X_EXT_OLD) ? 0 : 4;
776 ipsec6_logpacketstr(ip6, spi), ipsec_logsastr(sav)));
784 if ((sav->flags & SADB_X_EXT_OLD) == 0 && sav->replay) {
785 if (ipsec_updatereplay(ntohl(((struct newah *)ah)->ah_seq), sav)) {
792 if (sav->flags & SADB_X_EXT_OLD) {
799 if (ipsec6_tunnel_validate(m, off + stripsiz, nxt, sav)) {
825 if (!key_checktunnelsanity(sav, AF_INET6,
830 ipsec_logsastr(sav)));
844 key_sa_recordxfer(sav, m);
908 key_sa_recordxfer(sav, m);
918 if (sav) {
920 printf("DP ah6_input call free SA:%p\n", sav));
921 key_freesav(sav, KEY_SADB_UNLOCKED);
927 if (sav) {
929 printf("DP ah6_input call free SA:%p\n", sav));
930 key_freesav(sav, KEY_SADB_UNLOCKED);
945 struct secasvar *sav;
998 sav = key_allocsa(AF_INET6,
1002 if (sav) {
1003 if (sav->state == SADB_SASTATE_MATURE ||
1004 sav->state == SADB_SASTATE_DYING)
1006 key_freesav(sav, KEY_SADB_UNLOCKED);