+/* Add the PPP streams modules to the pool of available modules.
+ * If for some reason we can't add one of them, then remove the
+ * ones we did succeed in adding.
+ */
+static int
+ppp_initialize()
+{
+ dev_t devno = NODEV;
+ int ret = ESUCCESS;
+
+ if (!configured) {
+ strcpy(tmpl_sa.sa_name, "if_ppp");
+ if ((devno = strmod_add(NODEV, &if_pppinfo, &tmpl_sa)) == NODEV)
+ ret = ENODEV;
+
+ strcpy(tmpl_sa.sa_name, "ppp_ahdl");
+ if ((devno = strmod_add(NODEV, &ppp_ahdlcinfo, &tmpl_sa)) == NODEV) {
+ strcpy(tmpl_sa.sa_name, "if_ppp");
+ strmod_del(NODEV, &if_pppinfo, &tmpl_sa);
+ ret = ENODEV;
+ }
+
+ strcpy(tmpl_sa.sa_name, "pppcomp");
+ if ((devno = strmod_add(NODEV, &ppp_compinfo, &tmpl_sa)) == NODEV) {
+ strcpy(tmpl_sa.sa_name, "if_ppp");
+ strmod_del(NODEV, &if_pppinfo, &tmpl_sa);
+ strcpy(tmpl_sa.sa_name, "ppp_ahdl");
+ strmod_del(NODEV, &ppp_ahdlcinfo, &tmpl_sa);
+ ret = ENODEV;
+ }
+
+ strcpy(tmpl_sa.sa_name, "ppp");
+ tmpl_sa.sa_flags = STR_IS_DEVICE;
+ if ((devno = strmod_add(NODEV, &pppinfo, &tmpl_sa)) == NODEV) {
+ tmpl_sa.sa_flags = STR_IS_MODULE;
+ strcpy(tmpl_sa.sa_name, "if_ppp");
+ strmod_del(NODEV, &if_pppinfo, &tmpl_sa);
+ strcpy(tmpl_sa.sa_name, "ppp_ahdl");
+ strmod_del(NODEV, &ppp_ahdlcinfo, &tmpl_sa);
+ strcpy(tmpl_sa.sa_name, "pppcomp");
+ strmod_del(NODEV, &ppp_compinfo, &tmpl_sa);
+ ret = ENODEV;
+ }
+ configured = 1;
+ } else
+ ret = EINVAL;
+
+ return(ret);
+}
+
+#ifdef CFG_PT_VM_AVAIL
+static void
+ppp_callback(point, order, arg, event_arg)
+int point;
+int order;
+ulong arg;
+ulong event_arg;
+{
+ int ret;
+
+ ret = ppp_initialize();
+
+ return; /* _callback returns void, losing info */
+}
+#endif /* CFG_PT_VM_AVAIL */
+