bundle.c (94d7be5294679c1ee2d2fb15b501744ca42c19ca) bundle.c (74457d3d4327f7169df5e5596a955d1862b76270)
1/*-
2 * Copyright (c) 1998 Brian Somers <brian@Awfulhak.org>
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 82 unchanged lines hidden (view full) ---

91#include "chap.h"
92#include "tun.h"
93#include "prompt.h"
94#include "chat.h"
95#include "cbcp.h"
96#include "datalink.h"
97#include "ip.h"
98#include "iface.h"
1/*-
2 * Copyright (c) 1998 Brian Somers <brian@Awfulhak.org>
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 82 unchanged lines hidden (view full) ---

91#include "chap.h"
92#include "tun.h"
93#include "prompt.h"
94#include "chat.h"
95#include "cbcp.h"
96#include "datalink.h"
97#include "ip.h"
98#include "iface.h"
99#include "server.h"
99
100#define SCATTER_SEGMENTS 7 /* version, datalink, name, physical,
101 throughput, throughput, device */
102
103#define SEND_MAXFD 3 /* Max file descriptors passed through
104 the local domain socket */
105
106static int bundle_RemainingIdleTime(struct bundle *);

--- 1065 unchanged lines hidden (view full) ---

1172 prompt_Printf(arg->prompt, ", up time %d:%02d:%02d", secs / 3600,
1173 (secs / 60) % 60, secs % 60);
1174 }
1175 prompt_Printf(arg->prompt, "\n Queued: %lu of %u\n",
1176 (unsigned long)ip_QueueLen(&arg->bundle->ncp.ipcp),
1177 arg->bundle->cfg.ifqueue);
1178
1179 prompt_Printf(arg->prompt, "\nDefaults:\n");
100
101#define SCATTER_SEGMENTS 7 /* version, datalink, name, physical,
102 throughput, throughput, device */
103
104#define SEND_MAXFD 3 /* Max file descriptors passed through
105 the local domain socket */
106
107static int bundle_RemainingIdleTime(struct bundle *);

--- 1065 unchanged lines hidden (view full) ---

1173 prompt_Printf(arg->prompt, ", up time %d:%02d:%02d", secs / 3600,
1174 (secs / 60) % 60, secs % 60);
1175 }
1176 prompt_Printf(arg->prompt, "\n Queued: %lu of %u\n",
1177 (unsigned long)ip_QueueLen(&arg->bundle->ncp.ipcp),
1178 arg->bundle->cfg.ifqueue);
1179
1180 prompt_Printf(arg->prompt, "\nDefaults:\n");
1180 prompt_Printf(arg->prompt, " Label: %s\n", arg->bundle->cfg.label);
1181 prompt_Printf(arg->prompt, " Auth name: %s\n",
1181 prompt_Printf(arg->prompt, " Label: %s\n",
1182 arg->bundle->cfg.label);
1183 prompt_Printf(arg->prompt, " Auth name: %s\n",
1182 arg->bundle->cfg.auth.name);
1184 arg->bundle->cfg.auth.name);
1185 prompt_Printf(arg->prompt, " Diagnostic socket: ");
1186 if (*server.cfg.sockname != '\0')
1187 prompt_Printf(arg->prompt, "%s, mask 0%03o%s\n",
1188 server.cfg.sockname, (int)server.cfg.mask,
1189 server.fd == -1 ? " (not open)" : "");
1190 else if (server.cfg.port != 0)
1191 prompt_Printf(arg->prompt, "TCP port %d%s\n", server.cfg.port,
1192 server.fd == -1 ? " (not open)" : "");
1193 else
1194 prompt_Printf(arg->prompt, "none\n");
1183
1195
1184 prompt_Printf(arg->prompt, " Choked Timer: %ds\n",
1196 prompt_Printf(arg->prompt, " Choked Timer: %ds\n",
1185 arg->bundle->cfg.choked.timeout);
1186
1187#ifndef NORADIUS
1188 radius_Show(&arg->bundle->radius, arg->prompt);
1189#endif
1190
1197 arg->bundle->cfg.choked.timeout);
1198
1199#ifndef NORADIUS
1200 radius_Show(&arg->bundle->radius, arg->prompt);
1201#endif
1202
1191 prompt_Printf(arg->prompt, " Idle Timer: ");
1203 prompt_Printf(arg->prompt, " Idle Timer: ");
1192 if (arg->bundle->cfg.idle.timeout) {
1193 prompt_Printf(arg->prompt, "%ds", arg->bundle->cfg.idle.timeout);
1194 if (arg->bundle->cfg.idle.min_timeout)
1195 prompt_Printf(arg->prompt, ", min %ds",
1196 arg->bundle->cfg.idle.min_timeout);
1197 remaining = bundle_RemainingIdleTime(arg->bundle);
1198 if (remaining != -1)
1199 prompt_Printf(arg->prompt, " (%ds remaining)", remaining);
1200 prompt_Printf(arg->prompt, "\n");
1201 } else
1202 prompt_Printf(arg->prompt, "disabled\n");
1204 if (arg->bundle->cfg.idle.timeout) {
1205 prompt_Printf(arg->prompt, "%ds", arg->bundle->cfg.idle.timeout);
1206 if (arg->bundle->cfg.idle.min_timeout)
1207 prompt_Printf(arg->prompt, ", min %ds",
1208 arg->bundle->cfg.idle.min_timeout);
1209 remaining = bundle_RemainingIdleTime(arg->bundle);
1210 if (remaining != -1)
1211 prompt_Printf(arg->prompt, " (%ds remaining)", remaining);
1212 prompt_Printf(arg->prompt, "\n");
1213 } else
1214 prompt_Printf(arg->prompt, "disabled\n");
1203 prompt_Printf(arg->prompt, " MTU: ");
1215 prompt_Printf(arg->prompt, " MTU: ");
1204 if (arg->bundle->cfg.mtu)
1205 prompt_Printf(arg->prompt, "%d\n", arg->bundle->cfg.mtu);
1206 else
1207 prompt_Printf(arg->prompt, "unspecified\n");
1208
1216 if (arg->bundle->cfg.mtu)
1217 prompt_Printf(arg->prompt, "%d\n", arg->bundle->cfg.mtu);
1218 else
1219 prompt_Printf(arg->prompt, "unspecified\n");
1220
1209 prompt_Printf(arg->prompt, " sendpipe: ");
1221 prompt_Printf(arg->prompt, " sendpipe: ");
1210 if (arg->bundle->ncp.ipcp.cfg.sendpipe > 0)
1211 prompt_Printf(arg->prompt, "%-20ld", arg->bundle->ncp.ipcp.cfg.sendpipe);
1212 else
1213 prompt_Printf(arg->prompt, "unspecified ");
1214 prompt_Printf(arg->prompt, " recvpipe: ");
1215 if (arg->bundle->ncp.ipcp.cfg.recvpipe > 0)
1216 prompt_Printf(arg->prompt, "%ld\n", arg->bundle->ncp.ipcp.cfg.recvpipe);
1217 else
1218 prompt_Printf(arg->prompt, "unspecified\n");
1219
1222 if (arg->bundle->ncp.ipcp.cfg.sendpipe > 0)
1223 prompt_Printf(arg->prompt, "%-20ld", arg->bundle->ncp.ipcp.cfg.sendpipe);
1224 else
1225 prompt_Printf(arg->prompt, "unspecified ");
1226 prompt_Printf(arg->prompt, " recvpipe: ");
1227 if (arg->bundle->ncp.ipcp.cfg.recvpipe > 0)
1228 prompt_Printf(arg->prompt, "%ld\n", arg->bundle->ncp.ipcp.cfg.recvpipe);
1229 else
1230 prompt_Printf(arg->prompt, "unspecified\n");
1231
1220 prompt_Printf(arg->prompt, " Sticky Routes: %-20.20s",
1232 prompt_Printf(arg->prompt, " Sticky Routes: %-20.20s",
1221 optval(arg->bundle, OPT_SROUTES));
1233 optval(arg->bundle, OPT_SROUTES));
1222 prompt_Printf(arg->prompt, " Filter Decap: %s\n",
1234 prompt_Printf(arg->prompt, " Filter Decap: %s\n",
1223 optval(arg->bundle, OPT_FILTERDECAP));
1235 optval(arg->bundle, OPT_FILTERDECAP));
1224 prompt_Printf(arg->prompt, " ID check: %-20.20s",
1236 prompt_Printf(arg->prompt, " ID check: %-20.20s",
1225 optval(arg->bundle, OPT_IDCHECK));
1237 optval(arg->bundle, OPT_IDCHECK));
1226 prompt_Printf(arg->prompt, " Keep-Session: %s\n",
1238 prompt_Printf(arg->prompt, " Keep-Session: %s\n",
1227 optval(arg->bundle, OPT_KEEPSESSION));
1239 optval(arg->bundle, OPT_KEEPSESSION));
1228 prompt_Printf(arg->prompt, " Loopback: %-20.20s",
1240 prompt_Printf(arg->prompt, " Loopback: %-20.20s",
1229 optval(arg->bundle, OPT_LOOPBACK));
1241 optval(arg->bundle, OPT_LOOPBACK));
1230 prompt_Printf(arg->prompt, " PasswdAuth: %s\n",
1242 prompt_Printf(arg->prompt, " PasswdAuth: %s\n",
1231 optval(arg->bundle, OPT_PASSWDAUTH));
1243 optval(arg->bundle, OPT_PASSWDAUTH));
1232 prompt_Printf(arg->prompt, " Proxy: %-20.20s",
1244 prompt_Printf(arg->prompt, " Proxy: %-20.20s",
1233 optval(arg->bundle, OPT_PROXY));
1245 optval(arg->bundle, OPT_PROXY));
1234 prompt_Printf(arg->prompt, " Proxyall: %s\n",
1246 prompt_Printf(arg->prompt, " Proxyall: %s\n",
1235 optval(arg->bundle, OPT_PROXYALL));
1247 optval(arg->bundle, OPT_PROXYALL));
1236 prompt_Printf(arg->prompt, " TCPMSS Fixup: %-20.20s",
1248 prompt_Printf(arg->prompt, " TCPMSS Fixup: %-20.20s",
1237 optval(arg->bundle, OPT_TCPMSSFIXUP));
1249 optval(arg->bundle, OPT_TCPMSSFIXUP));
1238 prompt_Printf(arg->prompt, " Throughput: %s\n",
1250 prompt_Printf(arg->prompt, " Throughput: %s\n",
1239 optval(arg->bundle, OPT_THROUGHPUT));
1251 optval(arg->bundle, OPT_THROUGHPUT));
1240 prompt_Printf(arg->prompt, " Utmp Logging: %-20.20s",
1252 prompt_Printf(arg->prompt, " Utmp Logging: %-20.20s",
1241 optval(arg->bundle, OPT_UTMP));
1253 optval(arg->bundle, OPT_UTMP));
1242 prompt_Printf(arg->prompt, " Iface-Alias: %s\n",
1254 prompt_Printf(arg->prompt, " Iface-Alias: %s\n",
1243 optval(arg->bundle, OPT_IFACEALIAS));
1244
1245 return 0;
1246}
1247
1248static void
1249bundle_IdleTimeout(void *v)
1250{

--- 789 unchanged lines hidden ---
1255 optval(arg->bundle, OPT_IFACEALIAS));
1256
1257 return 0;
1258}
1259
1260static void
1261bundle_IdleTimeout(void *v)
1262{

--- 789 unchanged lines hidden ---