X-Git-Url: http://git.ozlabs.org/?p=ppp.git;a=blobdiff_plain;f=pppd%2Fsys-ultrix.c;h=691b38695e8dcee8a52ba9ccce153cbf911cf527;hp=50c91cf1e7ecca13dfe76a48229ef5fe2ebf6e13;hb=bd8c9068a51050844e7db5e20df354db1c884f77;hpb=6bc4d0f6371848be1a79d7c741db029605e7dbdc diff --git a/pppd/sys-ultrix.c b/pppd/sys-ultrix.c index 50c91cf..691b386 100644 --- a/pppd/sys-ultrix.c +++ b/pppd/sys-ultrix.c @@ -21,7 +21,7 @@ */ #ifndef lint -static char rcsid[] = "$Id: sys-ultrix.c,v 1.16 1996/04/04 04:04:19 paulus Exp $"; +static char rcsid[] = "$Id: sys-ultrix.c,v 1.23 1998/11/07 06:59:32 paulus Exp $"; #endif /* @@ -88,8 +88,6 @@ static int get_ether_addr __P((u_int32_t, struct sockaddr *)); void sys_init() { - openlog("pppd", LOG_PID); - /* Get an internet socket for doing socket ioctl's on. */ if ((sockfd = socket(AF_INET, SOCK_DGRAM, 0)) < 0) { syslog(LOG_ERR, "Couldn't create IP socket: %m"); @@ -118,7 +116,7 @@ sys_cleanup() if (ifaddrs[0]) cifaddr(0, ifaddrs[0], ifaddrs[1]); if (default_route_gateway) - cifdefaultroute(0, default_route_gateway); + cifdefaultroute(0, 0, default_route_gateway); if (proxy_arp_addr) cifproxyarp(0, proxy_arp_addr); } @@ -134,29 +132,19 @@ sys_close() close(loop_slave); close(loop_master); } - closelog(); } /* * sys_check_options - check the options that the user specified */ -void +int sys_check_options() { if (demand) { - fprintf(stderr, - "Sorry - demand-dialling is not supported under Ultrix\n"); - exit(1); + option_error("Sorry - demand-dialling is not supported under Ultrix\n"); + return 0; } -} - - -/* - * note_debug_level - note a change in the debug level. - */ -void -note_debug_level() -{ + return 1; } @@ -575,7 +563,7 @@ output(unit, p, len) int len; { if (debug) - log_packet(p, len, "sent "); + log_packet(p, len, "sent ", LOG_DEBUG); if (write(ttyfd, p, len) < 0) { if (errno != EIO) @@ -611,6 +599,7 @@ wait_input(timo) * loopback, for the length of time specified by *timo (indefinite * if timo is NULL). */ +void wait_loop_output(timo) struct timeval *timo; { @@ -622,6 +611,7 @@ wait_loop_output(timo) * wait_time - wait for a given length of time or until a * signal is received. */ +void wait_time(timo) struct timeval *timo; { @@ -815,31 +805,6 @@ get_idle_time(u, ip) } -/* - * set_filters - transfer the pass and active filters to the kernel. - */ -int -set_filters(pass, active) - struct bpf_program *pass, *active; -{ - int ret = 1; - - if (pass->bf_len > 0) { - if (ioctl(ppp_fd, PPPIOCSPASS, pass) < 0) { - syslog(LOG_ERR, "Couldn't set pass-filter in kernel: %m"); - ret = 0; - } - } - if (active->bf_len > 0) { - if (ioctl(ppp_fd, PPPIOCSACTIVE, active) < 0) { - syslog(LOG_ERR, "Couldn't set active-filter in kernel: %m"); - ret = 0; - } - } - return ret; -} - - /* * sifvjcomp - config tcp header compression */ @@ -874,7 +839,6 @@ sifup(u) int u; { struct ifreq ifr; - struct npioctl npi; strncpy(ifr.ifr_name, ifname, sizeof (ifr.ifr_name)); if (ioctl(sockfd, SIOCGIFFLAGS, (caddr_t) &ifr) < 0) { @@ -887,12 +851,6 @@ sifup(u) return 0; } if_is_up = 1; - npi.protocol = PPP_IP; - npi.mode = NPMODE_PASS; - if (ioctl(ppp_fd, PPPIOCSNPMODE, &npi) < 0) { - syslog(LOG_ERR, "ioctl(set IP mode to PASS): %m"); - return 0; - } return 1; } @@ -1022,7 +980,9 @@ cifaddr(u, o, h) * sifdefaultroute - assign a default route through the address given. */ int -sifdefaultroute(u, g) +sifdefaultroute(u, l, g) + int u; + u_int32_t l, g; { struct rtentry rt; @@ -1043,7 +1003,9 @@ sifdefaultroute(u, g) * cifdefaultroute - delete a default route through the address given. */ int -cifdefaultroute(u, g) +cifdefaultroute(u, l, g) + int u; + u_int32_t l, g; { struct rtentry rt; @@ -1256,6 +1218,16 @@ GetMask(addr) } +/* + * Use the hostid as part of the random number seed. + */ +int +get_host_seed() +{ + return gethostid(); +} + + /* Seems like strdup() is not part of string package in Ultrix. If I understood the man-page on the sun this should work. @@ -1292,9 +1264,9 @@ char *strdup( in ) char *in; #define WTMPFILE "/usr/adm/wtmp" -int +void logwtmp(line, name, host) - char *line, *name, *host; + const char *line, *name, *host; { int fd; struct stat buf;