Lines Matching refs:newpr
200 struct saproto *pr1, *pr2, *newpr = NULL; local
485 newpr = newsaproto();
486 if (newpr == NULL) {
491 newpr->proto_id = pr1->proto_id;
492 newpr->spisize = pr1->spisize;
493 newpr->encmode = pr1->encmode;
494 newpr->spi = pr2->spi; /* copy my SPI */
495 newpr->spi_p = pr1->spi; /* copy peer's SPI */
496 newpr->reqid_in = pr2->reqid_in;
497 newpr->reqid_out = pr2->reqid_out;
499 newpr->udp_encap = pr1->udp_encap | pr2->udp_encap;
506 racoon_free(newpr);
514 inssatrns(newpr, newtr);
515 inssaproto(newpp, newpr);
748 struct saproto *newpr; local
768 newpr = newsaproto();
769 if (newpr == NULL) {
777 if (sizeof(newpr->spi) < p->prop->spi_size) {
780 racoon_free(newpr);
788 newpr->proto_id = p->prop->proto_id;
789 newpr->spisize = p->prop->spi_size;
790 memset(&newpr->spi, 0, sizeof(newpr->spi));
791 spi = (u_int8_t *)&newpr->spi;
792 spi += sizeof(newpr->spi);
795 newpr->reqid_in = 0;
796 newpr->reqid_out = 0;
815 racoon_free(newpr);
820 newpp, newpr, newtr) < 0) {
823 racoon_free(newpr);
827 inssatrns(newpr, newtr);
837 if (newpr->encmode == 0)
838 newpr->encmode = IPSECDOI_ATTR_ENC_MODE_TRNS;
840 inssaproto(newpp, newpr);
1073 struct saproto *newpr; local
1095 newpr = newsaproto();
1096 if (newpr == NULL) {
1102 newpr->proto_id = ipproto2doi(req->saidx.proto);
1103 if (newpr->proto_id == IPSECDOI_PROTO_IPCOMP)
1104 newpr->spisize = 2;
1106 newpr->spisize = 4;
1108 newpr->encmode = pfkey2ipsecdoi_mode(req->saidx.mode);
1111 newpr->encmode +=
1116 newpr->encmode = encmodesv;
1119 newpr->reqid_out = req->saidx.reqid;
1121 newpr->reqid_in = req->saidx.reqid;
1123 if (set_satrnsbysainfo(newpr, iph2->sainfo) < 0) {
1126 racoon_free(newpr);
1131 inssaprotorev(newpp, newpr);
1175 struct saproto *newpr = NULL, *pr; local
1231 newpr = newsaproto();
1232 if (newpr == NULL)
1239 newpr->proto_id = pr->proto_id;
1240 newpr->spisize = pr->spisize;
1241 newpr->encmode = pr->encmode;
1242 newpr->spi = 0;
1243 newpr->spi_p = pr->spi; /* copy peer's SPI */
1244 newpr->reqid_in = 0;
1245 newpr->reqid_out = 0;
1250 newpr->reqid_in = g_nextreqid ;
1251 newpr->reqid_out = g_nextreqid ++;
1260 newpr->reqid_in = 0;
1261 newpr->reqid_out = 0;
1264 if (set_satrnsbysainfo(newpr, iph2->sainfo) < 0)
1268 racoon_free(newpr);
1272 inssaproto(pp0, newpr);