new_proto
new_proto();
ipsec_proto_t *protos, *current_proto, *new_proto;
new_proto = realloc(protos, num_protos *
if (new_proto == NULL) {
protos = new_proto;
new_proto += (num_protos - 1);
new_proto->proto_num = proto_num;
new_proto->proto_numalgs = 0;
new_proto->proto_algs = NULL;
new_proto->proto_name = strdup(proto_name);
if (new_proto->proto_name == NULL) {
new_proto->proto_pkg = NULL;
new_proto->proto_algs_pkgs = NULL;
new_proto->proto_algs_npkgs = 0;
new_proto->proto_exec_mode = proto_exec_mode;
ipsec_proto_t *rc = NULL, *new_proto = NULL;
new_proto = (ipsec_proto_t *)realloc(rc,
rc = new_proto;
if (new_proto == NULL)
new_proto += (rc_num - 1);
new_proto->proto_num = new_num;
new_proto->proto_algs = NULL;
new_proto->proto_numalgs = 0;
new_proto->proto_name = strdup(proto_name);
if (new_proto->proto_name == NULL)
new_proto->proto_exec_mode = exec_mode;
new_proto->proto_pkg = strdup(cur_pkg);
if (new_proto->proto_pkg == NULL)
new_proto->proto_pkg = NULL;
new_proto->proto_algs_pkgs = NULL;
new_proto->proto_algs_npkgs = 0;
for (new_proto = rc; new_proto < (rc + new_num);
new_proto++)
if (new_proto->proto_num == new_num)
if (new_proto == (rc + new_num)) {
new_proto->proto_num);
new_proto->proto_num);
new_proto->proto_num);
alg_num, new_proto->proto_num);
alg_num, new_proto->proto_num);
alg_num, new_proto->proto_num);
int npkgs = new_proto->proto_algs_npkgs;
new_proto->proto_algs_pkgs = realloc(
new_proto->proto_algs_pkgs,
if (new_proto->proto_algs_pkgs == NULL)
new_proto->proto_algs_pkgs[npkgs].alg_num =
new_proto->proto_algs_pkgs[npkgs].pkg_name =
if (new_proto->proto_algs_pkgs[npkgs].pkg_name
new_proto->proto_algs_npkgs = npkgs + 1;
newalglist = realloc(new_proto->proto_algs,
(new_proto->proto_numalgs + 1) *
newalglist[new_proto->proto_numalgs] = curalg;
new_proto->proto_numalgs++;
new_proto->proto_algs = newalglist;