Lines Matching refs:fp
286 FILE *fp;
301 if ((fp = ID0fopen(_PATH_RESCONF, "w")) != NULL) {
304 fputs(ipcp->ns.resolv_nons, fp);
307 fprintf(fp, "\nnameserver %s\n", paddr);
313 fprintf(fp, "nameserver %s\n", paddr);
315 if (fclose(fp) == EOF) {
732 IpcpInitRestartCounter(struct fsm *fp, int what)
735 struct ipcp *ipcp = fsm2ipcp(fp);
737 fp->FsmTimer.load = ipcp->cfg.fsm.timeout * SECTICKS;
740 fp->restart = ipcp->cfg.fsm.maxreq;
743 fp->restart = ipcp->cfg.fsm.maxtrm;
746 fp->restart = 1;
752 IpcpSendConfigReq(struct fsm *fp)
755 struct physical *p = link2physical(fp->link);
756 struct ipcp *ipcp = fsm2ipcp(fp);
796 fsm_Output(fp, CODE_CONFIGREQ, fp->reqid, buff, (u_char *)o - buff,
801 IpcpSentTerminateReq(struct fsm *fp __unused)
807 IpcpSendTerminateAck(struct fsm *fp, u_char id)
810 fsm_Output(fp, CODE_TERMACK, id, NULL, 0, MB_IPCPOUT);
814 IpcpLayerStart(struct fsm *fp)
817 struct ipcp *ipcp = fsm2ipcp(fp);
819 log_Printf(LogIPCP, "%s: LayerStart.\n", fp->link->name);
821 Enabled(fp->bundle, OPT_THROUGHPUT));
822 fp->more.reqs = fp->more.naks = fp->more.rejs = ipcp->cfg.fsm.maxreq * 3;
827 IpcpLayerFinish(struct fsm *fp)
830 struct ipcp *ipcp = fsm2ipcp(fp);
832 log_Printf(LogIPCP, "%s: LayerFinish.\n", fp->link->name);
862 IpcpLayerDown(struct fsm *fp)
865 struct ipcp *ipcp = fsm2ipcp(fp);
871 log_Printf(LogIPCP, "%s: LayerDown: %s\n", fp->link->name, addr);
874 radius_Flush(&fp->bundle->radius);
875 radius_Account(&fp->bundle->radius, &fp->bundle->radacct,
876 fp->bundle->links, RAD_STOP, &ipcp->throughput);
878 if (fp->bundle->radius.cfg.file && fp->bundle->radius.filterid)
879 system_Select(fp->bundle, fp->bundle->radius.filterid, LINKDOWNFILE,
881 radius_StopTimer(&fp->bundle->radius);
888 if (system_Select(fp->bundle, addr, LINKDOWNFILE, NULL, NULL) < 0) {
889 if (bundle_GetLabel(fp->bundle)) {
890 if (system_Select(fp->bundle, bundle_GetLabel(fp->bundle),
892 system_Select(fp->bundle, "MYADDR", LINKDOWNFILE, NULL, NULL);
894 system_Select(fp->bundle, "MYADDR", LINKDOWNFILE, NULL, NULL);
925 IpcpLayerUp(struct fsm *fp)
928 struct ipcp *ipcp = fsm2ipcp(fp);
931 log_Printf(LogIPCP, "%s: LayerUp.\n", fp->link->name);
943 radius_Account_Set_Ip(&fp->bundle->radacct, &ipcp->peer_ip, &ipcp->ifmask);
944 radius_Account(&fp->bundle->radius, &fp->bundle->radacct, fp->bundle->links,
947 if (fp->bundle->radius.cfg.file && fp->bundle->radius.filterid)
948 system_Select(fp->bundle, fp->bundle->radius.filterid, LINKUPFILE,
950 radius_StartTimer(fp->bundle);
957 if (system_Select(fp->bundle, tbuff, LINKUPFILE, NULL, NULL) < 0) {
958 if (bundle_GetLabel(fp->bundle)) {
959 if (system_Select(fp->bundle, bundle_GetLabel(fp->bundle),
961 system_Select(fp->bundle, "MYADDR", LINKUPFILE, NULL, NULL);
963 system_Select(fp->bundle, "MYADDR", LINKUPFILE, NULL, NULL);
966 fp->more.reqs = fp->more.naks = fp->more.rejs = ipcp->cfg.fsm.maxreq * 3;
1049 IpcpDecodeConfig(struct fsm *fp, u_char *cp, u_char *end, int mode_type,
1054 struct ipcp *ipcp = fsm2ipcp(fp);
1090 bundle_AdjustFilters(fp->bundle, &ncpaddr, NULL);
1309 bundle_AdjustDNS(fp->bundle);
1312 bundle_AdjustDNS(fp->bundle);