diff options
author | Brian Somers <brian@FreeBSD.org> | 1999-05-24 16:39:17 +0000 |
---|---|---|
committer | Brian Somers <brian@FreeBSD.org> | 1999-05-24 16:39:17 +0000 |
commit | acbd1f00fdc28f346b99adc5ae8858e8d88a91a9 (patch) | |
tree | b3d6b0cccee4aaf4cb7726544d0f52813b59f8d9 /usr.sbin/ppp | |
parent | 497760a16ab7dba23bf40505df1b571f8f4f49e8 (diff) | |
download | src-test2-acbd1f00fdc28f346b99adc5ae8858e8d88a91a9.tar.gz src-test2-acbd1f00fdc28f346b99adc5ae8858e8d88a91a9.zip |
Notes
Diffstat (limited to 'usr.sbin/ppp')
-rw-r--r-- | usr.sbin/ppp/exec.c | 8 | ||||
-rw-r--r-- | usr.sbin/ppp/physical.c | 13 | ||||
-rw-r--r-- | usr.sbin/ppp/physical.h | 4 | ||||
-rw-r--r-- | usr.sbin/ppp/tcp.c | 8 | ||||
-rw-r--r-- | usr.sbin/ppp/tty.c | 11 | ||||
-rw-r--r-- | usr.sbin/ppp/udp.c | 20 |
6 files changed, 30 insertions, 34 deletions
diff --git a/usr.sbin/ppp/exec.c b/usr.sbin/ppp/exec.c index 8519107a2a5f..4f6bcc7b5531 100644 --- a/usr.sbin/ppp/exec.c +++ b/usr.sbin/ppp/exec.c @@ -23,7 +23,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: exec.c,v 1.1 1999/05/08 11:06:30 brian Exp $ + * $Id: exec.c,v 1.2 1999/05/12 09:48:49 brian Exp $ */ #include <sys/param.h> @@ -97,8 +97,10 @@ struct device * exec_iov2device(int type, struct physical *p, struct iovec *iov, int *niov, int maxiov) { - if (type == EXEC_DEVICE) + if (type == EXEC_DEVICE) { + physical_SetupStack(p, execdevice.name, PHYSICAL_FORCE_ASYNC); return &execdevice; + } return NULL; } @@ -162,7 +164,7 @@ exec_Create(struct physical *p) p->fd = fids[0]; waitpid(pid, &stat, 0); log_Printf(LogDEBUG, "Using descriptor %d for child\n", p->fd); - physical_SetupStack(p, PHYSICAL_FORCE_ASYNC); + physical_SetupStack(p, execdevice.name, PHYSICAL_FORCE_ASYNC); return &execdevice; } } diff --git a/usr.sbin/ppp/physical.c b/usr.sbin/ppp/physical.c index 498ede1227e0..dc4b4a5497cc 100644 --- a/usr.sbin/ppp/physical.c +++ b/usr.sbin/ppp/physical.c @@ -16,7 +16,7 @@ * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * $Id: physical.c,v 1.12 1999/05/13 19:29:40 brian Exp $ + * $Id: physical.c,v 1.13 1999/05/18 01:37:46 brian Exp $ * */ @@ -571,7 +571,7 @@ iov2physical(struct datalink *dl, struct iovec *iov, int *niov, int maxiov, p->handler = (*devices[h].iov2device)(type, p, iov, niov, maxiov); if (p->handler == NULL) - physical_SetupStack(p, PHYSICAL_NOFORCE); + physical_SetupStack(p, "unknown", PHYSICAL_NOFORCE); return p; } @@ -855,7 +855,7 @@ physical_Open(struct physical *p, struct bundle *bundle) p->handler = (*devices[h].create)(p); if (p->fd >= 0) { if (p->handler == NULL) { - physical_SetupStack(p, PHYSICAL_NOFORCE); + physical_SetupStack(p, "unknown", PHYSICAL_NOFORCE); log_Printf(LogDEBUG, "%s: stdin is unidentified\n", p->link.name); } physical_Found(p); @@ -893,7 +893,7 @@ physical_Open(struct physical *p, struct bundle *bundle) } void -physical_SetupStack(struct physical *p, int how) +physical_SetupStack(struct physical *p, const char *who, int how) { link_EmptyStack(&p->link); if (how == PHYSICAL_FORCE_SYNC || @@ -912,12 +912,11 @@ physical_SetupStack(struct physical *p, int how) link_Stack(&p->link, &aliaslayer); #endif if (how == PHYSICAL_FORCE_ASYNC && physical_IsSync(p)) { - log_Printf(LogWARN, "Sync device setting ignored for ``%s'' device\n", - p->handler ? p->handler->name : "unknown"); + log_Printf(LogWARN, "Sync device setting ignored for ``%s'' device\n", who); p->cfg.speed = MODEM_SPEED; } else if (how == PHYSICAL_FORCE_SYNC && !physical_IsSync(p)) { log_Printf(LogWARN, "Async device setting ignored for ``%s'' device\n", - p->handler ? p->handler->name : "unknown"); + who); physical_SetSync(p); } } diff --git a/usr.sbin/ppp/physical.h b/usr.sbin/ppp/physical.h index fef4ac0e6b92..59f0dcc0fe46 100644 --- a/usr.sbin/ppp/physical.h +++ b/usr.sbin/ppp/physical.h @@ -16,7 +16,7 @@ * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * $Id: physical.h,v 1.9 1999/05/08 11:07:24 brian Exp $ + * $Id: physical.h,v 1.10 1999/05/12 09:48:58 brian Exp $ * */ @@ -134,5 +134,5 @@ extern int physical_RemoveFromSet(struct physical *, fd_set *, fd_set *, fd_set *); extern int physical_SetMode(struct physical *, int); extern void physical_DeleteQueue(struct physical *); -extern void physical_SetupStack(struct physical *, int); +extern void physical_SetupStack(struct physical *, const char *, int); extern void physical_StopDeviceTimer(struct physical *); diff --git a/usr.sbin/ppp/tcp.c b/usr.sbin/ppp/tcp.c index 4fac92677022..ab7c32c6a2aa 100644 --- a/usr.sbin/ppp/tcp.c +++ b/usr.sbin/ppp/tcp.c @@ -23,7 +23,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: tcp.c,v 1.1 1999/05/08 11:07:45 brian Exp $ + * $Id: tcp.c,v 1.2 1999/05/12 09:49:04 brian Exp $ */ #include <sys/types.h> @@ -115,8 +115,10 @@ struct device * tcp_iov2device(int type, struct physical *p, struct iovec *iov, int *niov, int maxiov) { - if (type == TCP_DEVICE) + if (type == TCP_DEVICE) { + physical_SetupStack(p, tcpdevice.name, PHYSICAL_FORCE_ASYNC); return &tcpdevice; + } return NULL; } @@ -179,7 +181,7 @@ tcp_Create(struct physical *p) inet_ntoa(sock.sin_addr), ntohs(sock.sin_port)); p->name.base = p->name.full; } - physical_SetupStack(p, PHYSICAL_FORCE_ASYNC); + physical_SetupStack(p, tcpdevice.name, PHYSICAL_FORCE_ASYNC); return &tcpdevice; } } diff --git a/usr.sbin/ppp/tty.c b/usr.sbin/ppp/tty.c index 37024b652d63..e8ace579ec61 100644 --- a/usr.sbin/ppp/tty.c +++ b/usr.sbin/ppp/tty.c @@ -23,7 +23,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: tty.c,v 1.5 1999/05/16 11:58:48 brian Exp $ + * $Id: tty.c,v 1.6 1999/05/18 01:37:46 brian Exp $ */ #include <sys/param.h> @@ -324,15 +324,12 @@ tty_iov2device(int type, struct physical *p, struct iovec *iov, int *niov, int maxiov) { if (type == TTY_DEVICE) { - struct ttydevice *dev; + struct ttydevice *dev = (struct ttydevice *)iov[(*niov)++].iov_base; - /* It's one of ours ! Let's create the device */ - - dev = (struct ttydevice *)iov[(*niov)++].iov_base; /* Refresh function pointers etc */ memcpy(&dev->dev, &basettydevice, sizeof dev->dev); - physical_SetupStack(p, PHYSICAL_NOFORCE); + physical_SetupStack(p, dev->dev.name, PHYSICAL_NOFORCE); if (dev->Timer.state != TIMER_STOPPED) { dev->Timer.state = TIMER_STOPPED; tty_StartTimer(p); @@ -432,7 +429,7 @@ tty_Create(struct physical *p) } else fcntl(p->fd, F_SETFL, oldflag & ~O_NONBLOCK); - physical_SetupStack(p, PHYSICAL_NOFORCE); + physical_SetupStack(p, dev->dev.name, PHYSICAL_NOFORCE); return &dev->dev; } diff --git a/usr.sbin/ppp/udp.c b/usr.sbin/ppp/udp.c index 548ed1b57a70..38a82d431d72 100644 --- a/usr.sbin/ppp/udp.c +++ b/usr.sbin/ppp/udp.c @@ -23,7 +23,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: tcp.c,v 1.1 1999/05/08 11:07:45 brian Exp $ + * $Id: udp.c,v 1.1 1999/05/12 09:49:09 brian Exp $ */ #include <sys/types.h> @@ -135,21 +135,17 @@ struct device * udp_iov2device(int type, struct physical *p, struct iovec *iov, int *niov, int maxiov) { - struct device *dev; - if (type == UDP_DEVICE) { - /* It's one of ours ! Let's create the device */ + struct udpdevice *dev = (struct udpdevice *)iov[(*niov)++].iov_base; - dev = (struct device *)iov[(*niov)++].iov_base; /* Refresh function pointers etc */ - memcpy(dev, &baseudpdevice, sizeof *dev); - /* Remember, there's really more than (sizeof *dev) there */ + memcpy(&dev->dev, &baseudpdevice, sizeof dev->dev); - physical_SetupStack(p, PHYSICAL_FORCE_SYNC); - } else - dev = NULL; + physical_SetupStack(p, dev->dev.name, PHYSICAL_FORCE_SYNC); + return &dev->dev; + } - return dev; + return NULL; } static struct udpdevice * @@ -261,7 +257,7 @@ udp_Create(struct physical *p) if (dev) { memcpy(&dev->dev, &baseudpdevice, sizeof dev->dev); - physical_SetupStack(p, PHYSICAL_FORCE_SYNC); + physical_SetupStack(p, dev->dev.name, PHYSICAL_FORCE_SYNC); return &dev->dev; } |