aboutsummaryrefslogtreecommitdiff
path: root/usr.sbin/ppp/physical.c
diff options
context:
space:
mode:
authorBrian Somers <brian@FreeBSD.org>1999-08-06 20:04:08 +0000
committerBrian Somers <brian@FreeBSD.org>1999-08-06 20:04:08 +0000
commiteb6e5e05f99108605df1aab67c0985f869dd12e7 (patch)
tree144bd3b2299bb3f3ae244a50357d1c6be8290dfb /usr.sbin/ppp/physical.c
parent2203dc00302283becdc4d18e2922fa2228132140 (diff)
downloadsrc-eb6e5e05f99108605df1aab67c0985f869dd12e7.tar.gz
src-eb6e5e05f99108605df1aab67c0985f869dd12e7.zip
Add ISDN support via isdnd & i4b. This requires version
0.81.1 of the i4b code - namely support of the I4B_VR_REQ ioctl via the i4brbchX device. Ppp controls the phone number, but idle timers and SYNC/RAW decisions are still made by isdnd (in isdnd.rc). This involves a new datalink state machine phase. The ``wait for carrier'' phase happens after dialing but before logging in. The whole dial state should really be abstracted so that each device type can deal with it in its own way (thinking about PPPoE) - but that'll have to wait. The ``set cd'' symantics remain the same for tty devices, but we now delay until we either get CD or timeout waiting (at which time we drop the link if we require CD). For i4b devices we always insist on carrier. Thanks to hm@ for his help, and especially for pointing out that I *don't* need to re-implement isdnd (that was a huge waste of time !) :-]
Notes
Notes: svn path=/head/; revision=49472
Diffstat (limited to 'usr.sbin/ppp/physical.c')
-rw-r--r--usr.sbin/ppp/physical.c21
1 files changed, 16 insertions, 5 deletions
diff --git a/usr.sbin/ppp/physical.c b/usr.sbin/ppp/physical.c
index 05e1afddaac3..3e10f152fd56 100644
--- a/usr.sbin/ppp/physical.c
+++ b/usr.sbin/ppp/physical.c
@@ -16,15 +16,12 @@
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*
- * $Id: physical.c,v 1.18 1999/06/11 13:28:29 brian Exp $
+ * $Id: physical.c,v 1.19 1999/08/05 10:32:13 brian Exp $
*
*/
#include <sys/param.h>
-#include <sys/socket.h>
#include <netinet/in.h>
-#include <arpa/inet.h>
-#include <netdb.h>
#include <netinet/in_systm.h>
#include <netinet/ip.h>
#include <sys/un.h>
@@ -37,7 +34,6 @@
#include <string.h>
#include <sys/tty.h> /* TIOCOUTQ */
#include <sys/uio.h>
-#include <sys/wait.h>
#include <time.h>
#include <unistd.h>
#include <utmp.h>
@@ -91,6 +87,9 @@
#include "udp.h"
#include "exec.h"
#include "tty.h"
+#ifndef NOI4B
+#include "i4b.h"
+#endif
static int physical_DescriptorWrite(struct descriptor *, struct bundle *,
@@ -110,6 +109,9 @@ struct {
int *niov, int maxiov);
int (*DeviceSize)(void);
} devices[] = {
+#ifndef NOI4B
+ { i4b_Create, i4b_iov2device, i4b_DeviceSize },
+#endif
{ tty_Create, tty_iov2device, tty_DeviceSize },
{ tcp_Create, tcp_iov2device, tcp_DeviceSize },
{ udp_Create, udp_iov2device, udp_DeviceSize },
@@ -1002,3 +1004,12 @@ physical_StopDeviceTimer(struct physical *p)
if (p->handler && p->handler->stoptimer)
(*p->handler->stoptimer)(p);
}
+
+int
+physical_AwaitCarrier(struct physical *p)
+{
+ if (p->handler && p->handler->awaitcarrier)
+ return (*p->handler->awaitcarrier)(p);
+
+ return CARRIER_OK;
+}