}
}
+// USR9108 Retrieve current status.
+void
+savestatus()
+{
+ struct ph1handle *ph1;
+ struct ph2handle *ph2;
+ int i = 0;
+ FILE * fp;
+
+ if ((fp = fopen("/var/racoon.sts", "w+"))) {
+ LIST_FOREACH(ph1, &ph1tree, chain) {
+ if (ph1->status == PHASE1ST_ESTABLISHED) {
+ LIST_FOREACH(ph2, &ph2tree, chain) {
+ if (ph2->ph1 != ph1)
+ continue;
+
+ fprintf(fp, "%s 2 %d\n",
+ saddrwop2str(ph2->dst), ph2->status);
+ }
+ }
+ else
+ fprintf(fp, "%s 1 %d\n",
+ saddrwop2str(ph1->remote), ph1->status);
+ }
+ fclose(fp);
+ }
+}
+
+void cleanstatus()
+{
+ FILE *fp = fopen("/var/racoon.sts", "w+");
+ if ( fp )
+ fclose(fp);
+}
+
/* %%% management contacted list */
/*
* search contacted list.