Lines Matching refs:bundle
289 bundle_DatalinkClone(arg->bundle, arg->cx, name); in CloneCommand()
306 bundle_DatalinkRemove(arg->bundle, arg->cx); in RemoveCommand()
316 if (bundle_RenameDatalink(arg->bundle, arg->cx, arg->argv[arg->argn])) in RenameCommand()
330 mode = arg->bundle->phys_type.all; in LoadCommand()
340 bundle_SetLabel(arg->bundle, arg->argv[arg->argc - 1]); in LoadCommand()
341 system_Select(arg->bundle, arg->argv[n], CONFFILE, arg->prompt, arg->cx); in LoadCommand()
343 bundle_SetLabel(arg->bundle, arg->argv[arg->argc - 1]); in LoadCommand()
348 bundle_SetLabel(arg->bundle, "default"); in LoadCommand()
349 system_Select(arg->bundle, "default", CONFFILE, arg->prompt, arg->cx); in LoadCommand()
350 bundle_SetLabel(arg->bundle, "default"); in LoadCommand()
369 command_Expand(argv, argc, arg->argv + arg->argn, arg->bundle, 1, getpid()); in LogCommand()
393 (arg->bundle->phys_type.all & ~(PHYS_INTERACTIVE|PHYS_AUTO)))) { in DialCommand()
402 bundle_Open(arg->bundle, arg->cx ? arg->cx->name : NULL, PHYS_ALL, 1); in DialCommand()
499 struct bundle *bundle, int inc0, pid_t pid) in command_Expand() argument
512 secs = bundle_Uptime(bundle); in command_Expand()
515 oin = bundle->ncp.ipcp.throughput.OctetsIn; in command_Expand()
516 oout = bundle->ncp.ipcp.throughput.OctetsOut; in command_Expand()
517 pin = bundle->ncp.ipcp.throughput.PacketsIn; in command_Expand()
518 pout = bundle->ncp.ipcp.throughput.PacketsOut; in command_Expand()
520 oin += bundle->ncp.ipv6cp.throughput.OctetsIn; in command_Expand()
521 oout += bundle->ncp.ipv6cp.throughput.OctetsOut; in command_Expand()
522 pin += bundle->ncp.ipv6cp.throughput.PacketsIn; in command_Expand()
523 pout += bundle->ncp.ipv6cp.throughput.PacketsOut; in command_Expand()
528 nargv[arg] = subst(nargv[arg], "AUTHNAME", bundle->cfg.auth.name); in command_Expand()
530 nargv[arg] = substip(nargv[arg], "DNS0", bundle->ncp.ipcp.ns.dns[0]); in command_Expand()
531 nargv[arg] = substip(nargv[arg], "DNS1", bundle->ncp.ipcp.ns.dns[1]); in command_Expand()
533 mp_Enddisc(bundle->ncp.mp.cfg.enddisc.class, in command_Expand()
534 bundle->ncp.mp.cfg.enddisc.address, in command_Expand()
535 bundle->ncp.mp.cfg.enddisc.len)); in command_Expand()
536 nargv[arg] = substip(nargv[arg], "HISADDR", bundle->ncp.ipcp.peer_ip); in command_Expand()
538 nargv[arg] = substipv6(nargv[arg], "HISADDR6", &bundle->ncp.ipv6cp.hisaddr); in command_Expand()
540 nargv[arg] = subst(nargv[arg], "INTERFACE", bundle->iface->name); in command_Expand()
542 bundle->ncp.ipcp.throughput.OctetsIn); in command_Expand()
544 bundle->ncp.ipcp.throughput.OctetsOut); in command_Expand()
546 bundle->ncp.ipcp.throughput.PacketsIn); in command_Expand()
548 bundle->ncp.ipcp.throughput.PacketsOut); in command_Expand()
551 bundle->ncp.ipv6cp.throughput.OctetsIn); in command_Expand()
553 bundle->ncp.ipv6cp.throughput.OctetsOut); in command_Expand()
555 bundle->ncp.ipv6cp.throughput.PacketsIn); in command_Expand()
557 bundle->ncp.ipv6cp.throughput.PacketsOut); in command_Expand()
559 nargv[arg] = subst(nargv[arg], "LABEL", bundle_GetLabel(bundle)); in command_Expand()
560 nargv[arg] = substip(nargv[arg], "MYADDR", bundle->ncp.ipcp.my_ip); in command_Expand()
562 nargv[arg] = substipv6(nargv[arg], "MYADDR6", &bundle->ncp.ipv6cp.myaddr); in command_Expand()
569 mp_Enddisc(bundle->ncp.mp.peer.enddisc.class, in command_Expand()
570 bundle->ncp.mp.peer.enddisc.address, in command_Expand()
571 bundle->ncp.mp.peer.enddisc.len)); in command_Expand()
578 nargv[arg] = subst(nargv[arg], "USER", bundle->ncp.mp.peer.authname); in command_Expand()
658 command_Expand(argv, argc, arg->argv + arg->argn, arg->bundle, 0, pid); in ShellCommand()
715 ipcp_LoadDNS(&arg->bundle->ncp.ipcp); in ResolvCommand()
717 ipcp_RestoreDNS(&arg->bundle->ncp.ipcp); in ResolvCommand()
719 ipcp_WriteDNS(&arg->bundle->ncp.ipcp); in ResolvCommand()
721 arg->bundle->ncp.ipcp.ns.writable = 0; in ResolvCommand()
723 arg->bundle->ncp.ipcp.ns.writable = 1; in ResolvCommand()
1055 FindExec(struct bundle *bundle, struct cmdtab const *cmds, int argc, int argn, in FindExec() argument
1071 cx = bundle2datalink(bundle, NULL); in FindExec()
1087 arg.bundle = bundle; in FindExec()
1159 command_Run(struct bundle *bundle, int argc, char const *const *argv, in command_Run() argument
1190 FindExec(bundle, Commands, argc, 0, argv, prompt, cx); in command_Run()
1195 command_Decode(struct bundle *bundle, char *buff, int nb, struct prompt *prompt, in command_Decode() argument
1204 command_Run(bundle, argc, (char const *const *)argv, prompt, label, NULL); in command_Decode()
1214 FindExec(arg->bundle, ShowCommands, arg->argc, arg->argn, arg->argv, in ShowCommand()
1258 bundle_Open(arg->bundle, arg->cx ? arg->cx->name : NULL, PHYS_ALL, 1); in OpenCommand()
1262 arg->cx : bundle2datalink(arg->bundle, NULL); in OpenCommand()
1267 bundle_Open(arg->bundle, cx->name, PHYS_ALL, 1); in OpenCommand()
1291 if (arg->bundle->ncp.ipcp.fsm.state == ST_OPENED) in OpenCommand()
1292 fsm_Reopen(&arg->bundle->ncp.ipcp.fsm); in OpenCommand()
1294 bundle_Open(arg->bundle, NULL, PHYS_ALL, 1); in OpenCommand()
1307 bundle_Close(arg->bundle, arg->cx ? arg->cx->name : NULL, CLOSE_STAYDOWN); in CloseCommand()
1310 bundle_Close(arg->bundle, arg->cx ? arg->cx->name : NULL, CLOSE_LCP); in CloseCommand()
1338 bundle_Down(arg->bundle, CLOSE_STAYDOWN); in DownCommand()
1344 bundle_Down(arg->bundle, CLOSE_LCP); in DownCommand()
1347 &arg->bundle->ncp.mp.link.ccp.fsm; in DownCommand()
1433 if (server_Clear(arg->bundle)) in SetServer()
1437 switch (server_Reopen(arg->bundle)) { in SetServer()
1451 if (server_Close(arg->bundle)) in SetServer()
1475 (int)(ptr - port), port, arg->bundle->unit, ptr + 2); in SetServer()
1478 res = server_LocalOpen(arg->bundle, port, imask); in SetServer()
1502 iport += arg->bundle->unit; in SetServer()
1503 res = server_TcpOpen(arg->bundle, iport); in SetServer()
1534 struct ncp *ncp = &arg->bundle->ncp; in SetInterfaceAddr()
1569 bundle_AdjustFilters(arg->bundle, &ncpaddr, NULL); in SetInterfaceAddr()
1571 if (hisaddr && !ipcp_UseHisaddr(arg->bundle, hisaddr, in SetInterfaceAddr()
1572 arg->bundle->phys_type.all & PHYS_AUTO)) in SetInterfaceAddr()
1650 strncpy(arg->bundle->cfg.auth.key, argp, in SetVariable()
1651 sizeof arg->bundle->cfg.auth.key - 1); in SetVariable()
1652 arg->bundle->cfg.auth.key[sizeof arg->bundle->cfg.auth.key - 1] = '\0'; in SetVariable()
1656 switch (bundle_Phase(arg->bundle)) { in SetVariable()
1659 bundle_PhaseName(arg->bundle)); in SetVariable()
1663 strncpy(arg->bundle->cfg.auth.name, argp, in SetVariable()
1664 sizeof arg->bundle->cfg.auth.name - 1); in SetVariable()
1665 arg->bundle->cfg.auth.name[sizeof arg->bundle->cfg.auth.name-1] = '\0'; in SetVariable()
1704 arg->bundle->ncp.mp.cfg.autoload.min = v1; in SetVariable()
1705 arg->bundle->ncp.mp.cfg.autoload.max = v2; in SetVariable()
1706 arg->bundle->ncp.mp.cfg.autoload.period = v3; in SetVariable()
1707 mp_RestartAutoloadTimer(&arg->bundle->ncp.mp); in SetVariable()
1817 bundle_SetMode(arg->bundle, cx, mode); in SetVariable()
1821 switch (bundle_Phase(arg->bundle)) { in SetVariable()
1826 if (bundle_HighestState(arg->bundle) >= DATALINK_LCP) { in SetVariable()
1849 arg->bundle->ncp.mp.cfg.mrru = long_val; in SetVariable()
1990 arg->bundle->cfg.ifqueue = long_val < 0 ? 0 : long_val; in SetVariable()
2009 min = arg->bundle->cfg.idle.min_timeout; in SetVariable()
2012 bundle_SetIdleTimer(arg->bundle, timeout, min); in SetVariable()
2053 &arg->bundle->ncp.ipcp.cfg.fsm.timeout, in SetVariable()
2054 &arg->bundle->ncp.ipcp.cfg.fsm.maxreq, in SetVariable()
2055 &arg->bundle->ncp.ipcp.cfg.fsm.maxtrm, DEF_FSMTRIES); in SetVariable()
2061 &arg->bundle->ncp.ipv6cp.cfg.fsm.timeout, in SetVariable()
2062 &arg->bundle->ncp.ipv6cp.cfg.fsm.maxreq, in SetVariable()
2063 &arg->bundle->ncp.ipv6cp.cfg.fsm.maxtrm, DEF_FSMTRIES); in SetVariable()
2070 ipaddr = arg->bundle->ncp.ipcp.cfg.ns.dns; in SetVariable()
2073 ipaddr = arg->bundle->ncp.ipcp.cfg.ns.nbns; in SetVariable()
2078 ncpaddr_aton(ncpaddr, &arg->bundle->ncp, arg->argv[arg->argn]); in SetVariable()
2082 ncpaddr_aton(ncpaddr + 1, &arg->bundle->ncp, arg->argv[arg->argn + 1]); in SetVariable()
2148 arg->bundle->cfg.choked.timeout = atoi(argp); in SetVariable()
2149 if (arg->bundle->cfg.choked.timeout <= 0) in SetVariable()
2150 arg->bundle->cfg.choked.timeout = CHOKED_TIMEOUT; in SetVariable()
2155 arg->bundle->ncp.cfg.sendpipe = long_val; in SetVariable()
2160 arg->bundle->ncp.cfg.recvpipe = long_val; in SetVariable()
2166 *arg->bundle->radius.cfg.file = '\0'; in SetVariable()
2172 strncpy(arg->bundle->radius.cfg.file, argp, in SetVariable()
2173 sizeof arg->bundle->radius.cfg.file - 1); in SetVariable()
2174 arg->bundle->radius.cfg.file in SetVariable()
2175 [sizeof arg->bundle->radius.cfg.file - 1] = '\0'; in SetVariable()
2219 ncp_SetUrgentTOS(&arg->bundle->ncp); in SetVariable()
2220 ncp_ClearUrgentTcpPorts(&arg->bundle->ncp); in SetVariable()
2221 ncp_ClearUrgentUdpPorts(&arg->bundle->ncp); in SetVariable()
2223 ncp_SetUrgentTOS(&arg->bundle->ncp); in SetVariable()
2225 ncp_ClearUrgentUdpPorts(&arg->bundle->ncp); in SetVariable()
2228 ncp_AddUrgentUdpPort(&arg->bundle->ncp, atoi(arg->argv[f] + 1)); in SetVariable()
2230 ncp_RemoveUrgentUdpPort(&arg->bundle->ncp, atoi(arg->argv[f] + 1)); in SetVariable()
2233 ncp_ClearUrgentUdpPorts(&arg->bundle->ncp); in SetVariable()
2234 ncp_AddUrgentUdpPort(&arg->bundle->ncp, atoi(arg->argv[f])); in SetVariable()
2238 ncp_ClearUrgentTcpPorts(&arg->bundle->ncp); in SetVariable()
2239 ncp_ClearUrgentUdpPorts(&arg->bundle->ncp); in SetVariable()
2240 ncp_ClearUrgentTOS(&arg->bundle->ncp); in SetVariable()
2242 ncp_SetUrgentTOS(&arg->bundle->ncp); in SetVariable()
2245 ncp_ClearUrgentTcpPorts(&arg->bundle->ncp); in SetVariable()
2249 ncp_AddUrgentTcpPort(&arg->bundle->ncp, atoi(arg->argv[f] + 1)); in SetVariable()
2251 ncp_RemoveUrgentTcpPort(&arg->bundle->ncp, atoi(arg->argv[f] + 1)); in SetVariable()
2254 ncp_ClearUrgentTcpPorts(&arg->bundle->ncp); in SetVariable()
2255 ncp_AddUrgentTcpPort(&arg->bundle->ncp, atoi(arg->argv[f])); in SetVariable()
2392 FindExec(arg->bundle, SetCommands, arg->argc, arg->argn, arg->argv, in SetCommand()
2423 if (!ncprange_aton(&dest, &arg->bundle->ncp, arg->argv[arg->argn])) in AddCommand()
2442 host = arg->bundle->ncp.ipcp.my_ip; in AddCommand()
2445 host = arg->bundle->ncp.ipcp.peer_ip; in AddCommand()
2448 host = arg->bundle->ncp.ipcp.ns.dns[0]; in AddCommand()
2451 host = arg->bundle->ncp.ipcp.ns.dns[1]; in AddCommand()
2465 ncpaddr_setip4(&gw, arg->bundle->ncp.ipcp.peer_ip); in AddCommand()
2469 if (!ncpaddr_getip6(&arg->bundle->ncp.ipv6cp.hisaddr, &host6)) in AddCommand()
2475 if (!ncpaddr_aton(&gw, &arg->bundle->ncp, arg->argv[arg->argn + gw_arg])) { in AddCommand()
2485 if (rt_Set(arg->bundle, RTM_ADD, &dest, &gw, arg->cmd->args ? 1 : 0, in AddCommand()
2488 route_Add(&arg->bundle->ncp.route, addrs, &dest, &gw); in AddCommand()
2501 route_IfDelete(arg->bundle, 0); in DeleteCommand()
2502 route_DeleteAll(&arg->bundle->ncp.route); in DeleteCommand()
2506 ncprange_setip4host(&dest, arg->bundle->ncp.ipcp.my_ip); in DeleteCommand()
2510 ncprange_sethost(&dest, &arg->bundle->ncp.ipv6cp.myaddr); in DeleteCommand()
2514 ncprange_setip4host(&dest, arg->bundle->ncp.ipcp.peer_ip); in DeleteCommand()
2518 ncprange_sethost(&dest, &arg->bundle->ncp.ipv6cp.hisaddr); in DeleteCommand()
2522 ncprange_setip4host(&dest, arg->bundle->ncp.ipcp.ns.dns[0]); in DeleteCommand()
2525 ncprange_setip4host(&dest, arg->bundle->ncp.ipcp.ns.dns[1]); in DeleteCommand()
2528 ncprange_aton(&dest, &arg->bundle->ncp, arg->argv[arg->argn]); in DeleteCommand()
2531 rt_Set(arg->bundle, RTM_DELETE, &dest, NULL, arg->cmd->args ? 1 : 0, 0); in DeleteCommand()
2532 route_Delete(&arg->bundle->ncp.route, addrs, &dest); in DeleteCommand()
2546 if (!arg->bundle->NatEnabled) { in NatEnable()
2547 if (arg->bundle->ncp.ipcp.fsm.state == ST_OPENED) in NatEnable()
2548 PacketAliasSetAddress(arg->bundle->ncp.ipcp.my_ip); in NatEnable()
2549 arg->bundle->NatEnabled = 1; in NatEnable()
2553 arg->bundle->NatEnabled = 0; in NatEnable()
2554 arg->bundle->cfg.opt &= ~OPT_IFACEALIAS; in NatEnable()
2571 if (arg->bundle->NatEnabled) { in NatOption()
2577 if (arg->bundle->NatEnabled) { in NatOption()
2600 cx = arg->bundle->links; in LinkCommand()
2604 FindExec(arg->bundle, Commands, arg->argc, arg->argn+1, arg->argv, in LinkCommand()
2606 for (cx = arg->bundle->links; cx; cx = cx->next) in LinkCommand()
2614 if (!bundle2datalink(arg->bundle, name)) { in LinkCommand()
2622 cx = bundle2datalink(arg->bundle, name); in LinkCommand()
2624 FindExec(arg->bundle, Commands, arg->argc, arg->argn+1, arg->argv, in LinkCommand()
2644 else if (!arg->bundle->ncp.mp.cfg.mrru) { in command_ChooseLink()
2645 struct datalink *dl = bundle2datalink(arg->bundle, NULL); in command_ChooseLink()
2649 return &arg->bundle->ncp.mp.link; in command_ChooseLink()
2714 arg->bundle->cfg.opt |= bit; in OptSet()
2716 arg->bundle->cfg.opt &= ~bit; in OptSet()
2724 unsigned save = arg->bundle->cfg.opt; in IfaceAliasOptSet()
2728 if (Enabled(arg->bundle, OPT_IFACEALIAS) && !arg->bundle->NatEnabled) { in IfaceAliasOptSet()
2729 arg->bundle->cfg.opt = save; in IfaceAliasOptSet()
2792 arg->bundle->ncp.ipcp.cfg.ns.dns_neg &= keep; in NegotiateSet()
2793 arg->bundle->ncp.ipcp.cfg.ns.dns_neg |= add; in NegotiateSet()
2796 arg->bundle->ncp.mp.cfg.negenddisc &= keep; in NegotiateSet()
2797 arg->bundle->ncp.mp.cfg.negenddisc |= add; in NegotiateSet()
2820 switch (bundle_Phase(arg->bundle)) { in NegotiateSet()
2825 if (bundle_HighestState(arg->bundle) >= DATALINK_LCP) { in NegotiateSet()
2836 arg->bundle->ncp.mp.cfg.shortseq &= keep; in NegotiateSet()
2837 arg->bundle->ncp.mp.cfg.shortseq |= add; in NegotiateSet()
2840 arg->bundle->ncp.ipcp.cfg.vj.neg &= keep; in NegotiateSet()
2841 arg->bundle->ncp.ipcp.cfg.vj.neg |= add; in NegotiateSet()
2956 FindExec(arg->bundle, NegotiateCommands + (keep == NEG_HISMASK ? in NegotiateCommand()
2993 cx = bundle2datalink(arg->bundle, NULL); in ClearCommand()
3000 t = &arg->bundle->ncp.ipcp.throughput; in ClearCommand()
3003 t = &arg->bundle->ncp.ipv6cp.throughput; in ClearCommand()
3042 FindExec(arg->bundle, arg->cmd->args, arg->argc, arg->argn, arg->argv, in RunListCommand()
3100 return !iface_Add(arg->bundle->iface, &arg->bundle->ncp, &ifa, &peer, how); in IfaceAddCommand()
3116 if (arg->bundle->ncp.ipcp.fsm.state == ST_OPENED && in IfaceDeleteCommand()
3118 arg->bundle->ncp.ipcp.my_ip.s_addr == ifa4.s_addr) { in IfaceDeleteCommand()
3124 ok = iface_Delete(arg->bundle->iface, &arg->bundle->ncp, &ifa); in IfaceDeleteCommand()
3157 how = arg->bundle->ncp.ipcp.fsm.state == ST_OPENED || in IfaceClearCommand()
3158 arg->bundle->phys_type.all & PHYS_AUTO ? in IfaceClearCommand()
3160 iface_Clear(arg->bundle->iface, &arg->bundle->ncp, family, how); in IfaceClearCommand()
3181 command_Expand(argv, argc, arg->argv + arg->argn, arg->bundle, 1, getpid()); in SetProcTitle()