in makefile).
Updated ppp_mod so that it will work with Solaris 10 and beyond
(identify entry point is now obsolete).
Fixed warnings in chat, bsd-comp, deflate, vjcompress, chap-new,
sys-solaris, tty, pppdump, ppp_comp.
15 files changed:
-static const char rcsid[] = "$Id: chat.c,v 1.29 2003/03/04 06:17:21 fcusack Exp $";
+static const char rcsid[] = "$Id: chat.c,v 1.30 2004/01/17 05:47:55 carlsonj Exp $";
#endif
#include <stdio.h>
#endif
#include <stdio.h>
void *copy_of __P((char *s));
char *grow __P((char *s, char **p, size_t len));
void usage __P((void));
void *copy_of __P((char *s));
char *grow __P((char *s, char **p, size_t len));
void usage __P((void));
-void logf __P((const char *fmt, ...));
+void msgf __P((const char *fmt, ...));
void fatal __P((int code, const char *fmt, ...));
SIGTYPE sigalrm __P((int signo));
SIGTYPE sigint __P((int signo));
void fatal __P((int code, const char *fmt, ...));
SIGTYPE sigalrm __P((int signo));
SIGTYPE sigint __P((int signo));
/*
* Send a message to syslog and/or stderr.
*/
/*
* Send a message to syslog and/or stderr.
*/
-void logf __V((const char *fmt, ...))
+void msgf __V((const char *fmt, ...))
fatal(2, "Can't set file mode flags on stdin: %m");
if (verbose)
fatal(2, "Can't set file mode flags on stdin: %m");
if (verbose)
* The expectation did not occur. This is terminal.
*/
if (fail_reason)
* The expectation did not occur. This is terminal.
*/
if (fail_reason)
- logf("Failed (%s)", fail_reason);
+ msgf("Failed (%s)", fail_reason);
abort_string[n_aborts++] = s1;
if (verbose)
abort_string[n_aborts++] = s1;
if (verbose)
- logf("abort on (%v)", s);
+ msgf("abort on (%v)", s);
pack++;
n_aborts--;
if (verbose)
pack++;
n_aborts--;
if (verbose)
- logf("clear abort on (%v)", s);
+ msgf("clear abort on (%v)", s);
report_string[n_reports++] = s1;
if (verbose)
report_string[n_reports++] = s1;
if (verbose)
- logf("report (%v)", s);
+ msgf("report (%v)", s);
pack++;
n_reports--;
if (verbose)
pack++;
n_reports--;
if (verbose)
- logf("clear report (%v)", s);
+ msgf("clear report (%v)", s);
timeout = DEFAULT_CHAT_TIMEOUT;
if (verbose)
timeout = DEFAULT_CHAT_TIMEOUT;
if (verbose)
- logf("timeout set to %d seconds", timeout);
+ msgf("timeout set to %d seconds", timeout);
return ((int)c & 0x7F);
default:
return ((int)c & 0x7F);
default:
- logf("warning: read() on stdin returned %d", status);
+ msgf("warning: read() on stdin returned %d", status);
case -1:
if ((status = fcntl(0, F_GETFL, 0)) == -1)
case -1:
if ((status = fcntl(0, F_GETFL, 0)) == -1)
- logf("warning: write() on stdout returned %d", status);
+ msgf("warning: write() on stdout returned %d", status);
case -1:
if ((status = fcntl(0, F_GETFL, 0)) == -1)
case -1:
if ((status = fcntl(0, F_GETFL, 0)) == -1)
if (verbose) {
if (errno == EINTR || errno == EWOULDBLOCK)
if (verbose) {
if (errno == EINTR || errno == EWOULDBLOCK)
- logf(" -- write timed out");
+ msgf(" -- write timed out");
- logf(" -- write failed: %m");
+ msgf(" -- write failed: %m");
if (verbose) {
if (quiet)
if (verbose) {
if (quiet)
}
alarm(timeout); alarmed = 0;
}
alarm(timeout); alarmed = 0;
minlen = (len > sizeof(fail_buffer)? len: sizeof(fail_buffer)) - 1;
if (verbose)
minlen = (len > sizeof(fail_buffer)? len: sizeof(fail_buffer)) - 1;
if (verbose)
- logf("expect (%v)", string);
+ msgf("expect (%v)", string);
- logf("expect string is too long");
+ msgf("expect string is too long");
exit_code = 1;
return 0;
}
if (len == 0) {
if (verbose)
exit_code = 1;
return 0;
}
if (len == 0) {
if (verbose)
echo_stderr(c);
if (verbose && c == '\n') {
if (s == logged)
echo_stderr(c);
if (verbose && c == '\n') {
if (s == logged)
- logf(""); /* blank line */
+ msgf(""); /* blank line */
- logf("%0.*v", s - logged, logged);
+ msgf("%0.*v", s - logged, logged);
logged = s + 1;
}
*s++ = c;
if (verbose && s >= logged + 80) {
logged = s + 1;
}
*s++ = c;
if (verbose && s >= logged + 80) {
- logf("%0.*v", s - logged, logged);
+ msgf("%0.*v", s - logged, logged);
strncmp(s - len, string, len) == 0) {
if (verbose) {
if (s > logged)
strncmp(s - len, string, len) == 0) {
if (verbose) {
if (s > logged)
- logf("%0.*v", s - logged, logged);
- logf(" -- got it\n");
+ msgf("%0.*v", s - logged, logged);
+ msgf(" -- got it\n");
strncmp(s - abort_len, abort_string[n], abort_len) == 0) {
if (verbose) {
if (s > logged)
strncmp(s - abort_len, abort_string[n], abort_len) == 0) {
if (verbose) {
if (s > logged)
- logf("%0.*v", s - logged, logged);
- logf(" -- failed");
+ msgf("%0.*v", s - logged, logged);
+ msgf(" -- failed");
if (s >= end) {
if (logged < s - minlen) {
if (verbose)
if (s >= end) {
if (logged < s - minlen) {
if (verbose)
- logf("%0.*v", s - logged, logged);
+ msgf("%0.*v", s - logged, logged);
logged = s;
}
s -= minlen;
logged = s;
}
s -= minlen;
}
if (alarmed && verbose)
}
if (alarmed && verbose)
- logf("warning: alarm synchronization problem");
+ msgf("warning: alarm synchronization problem");
}
alarm(0);
if (verbose && printed) {
if (alarmed)
}
alarm(0);
if (verbose && printed) {
if (alarmed)
- logf(" -- read timed out");
+ msgf(" -- read timed out");
- logf(" -- read failed: %m");
+ msgf(" -- read failed: %m");
-# $Id: configure,v 1.30 2002/11/02 19:48:12 carlsonj Exp $
+# $Id: configure,v 1.31 2004/01/17 05:47:55 carlsonj Exp $
# if [ -d /NextApps ]; then
# system="NeXTStep"
# if [ -d /NextApps ]; then
# system="NeXTStep"
esac;;
5.[1-6]*) state="known"; ksrc="solaris"; makext="sol2";;
esac
esac;;
5.[1-6]*) state="known"; ksrc="solaris"; makext="sol2";;
esac
- if [ -x /opt/SUNWspro/bin/cc ] &&
+ if [ -x /opt/SUNWspro/bin/cc -a "$1" != "gcc" ] &&
/opt/SUNWspro/bin/cc -flags >/dev/null 2>&1; then
: # use Sun WorkShop compiler
elif gcc --version >/dev/null 2>&1; then
/opt/SUNWspro/bin/cc -flags >/dev/null 2>&1; then
: # use Sun WorkShop compiler
elif gcc --version >/dev/null 2>&1; then
* This version is for use with STREAMS under SunOS 4.x,
* Digital UNIX, AIX 4.x, and SVR4 systems including Solaris 2.
*
* This version is for use with STREAMS under SunOS 4.x,
* Digital UNIX, AIX 4.x, and SVR4 systems including Solaris 2.
*
- * $Id: bsd-comp.c,v 1.20 1996/08/28 06:31:57 paulus Exp $
+ * $Id: bsd-comp.c,v 1.21 2004/01/17 05:47:55 carlsonj Exp $
#define BSD_LITTLE_ENDIAN
#endif
#define BSD_LITTLE_ENDIAN
#endif
+#ifdef SOL2
+#include <sys/sunddi.h>
+#endif
+
#define PACKETPTR mblk_t *
#include <net/ppp-comp.h>
#define PACKETPTR mblk_t *
#include <net/ppp-comp.h>
* AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*
* AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*
- * $Id: deflate.c,v 1.11 2002/12/06 09:49:15 paulus Exp $
+ * $Id: deflate.c,v 1.12 2004/01/17 05:47:55 carlsonj Exp $
#include "../common/zlib.h"
#endif
#include "../common/zlib.h"
#endif
+#ifdef SOL2
+#include <sys/sunddi.h>
+#endif
+
#if DO_DEFLATE
#define DEFLATE_DEBUG 1
#if DO_DEFLATE
#define DEFLATE_DEBUG 1
* This version is used under SunOS 4.x, Digital UNIX, AIX 4.x,
* and SVR4 systems including Solaris 2.
*
* This version is used under SunOS 4.x, Digital UNIX, AIX 4.x,
* and SVR4 systems including Solaris 2.
*
- * $Id: vjcompress.c,v 1.10 1999/09/15 23:49:06 masputra Exp $
+ * $Id: vjcompress.c,v 1.11 2004/01/17 05:47:55 carlsonj Exp $
*/
#include <sys/types.h>
*/
#include <sys/types.h>
#include <netinet/in_systm.h>
#endif
#include <netinet/in_systm.h>
#endif
+#ifdef SOL2
+#include <sys/sunddi.h>
+#endif
+
#include <netinet/ip.h>
#include <netinet/tcp.h>
#include <netinet/ip.h>
#include <netinet/tcp.h>
#
# Makefile for pppd under Solaris 2.
#
# Makefile for pppd under Solaris 2.
-# $Id: Makefile.sol2,v 1.24 2003/11/27 21:25:25 paulus Exp $
+# $Id: Makefile.sol2,v 1.25 2004/01/17 05:47:55 carlsonj Exp $
#
include ../Makedefs.com
#
include ../Makedefs.com
LIBS = -lsocket -lnsl
OBJS = main.o magic.o fsm.o lcp.o ipcp.o upap.o chap-new.o eap.o md5.o \
LIBS = -lsocket -lnsl
OBJS = main.o magic.o fsm.o lcp.o ipcp.o upap.o chap-new.o eap.o md5.o \
- tty.o ccp.o ecp.o auth.o options.o demand.o utils.o sys-solaris.o
+ tty.o ccp.o ecp.o auth.o options.o demand.o utils.o sys-solaris.o \
+ chap-md5.o
#
# uncomment the following to enable plugins
#
# uncomment the following to enable plugins
* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
-#define RCSID "$Id: chap-new.c,v 1.3 2003/11/27 22:22:36 paulus Exp $"
+#define RCSID "$Id: chap-new.c,v 1.4 2004/01/17 05:47:55 carlsonj Exp $"
#include <stdlib.h>
#include <string.h>
#include <stdlib.h>
#include <string.h>
int (*chap_verify_hook)(char *name, char *ourname, int id,
struct chap_digest_type *digest,
unsigned char *challenge, unsigned char *response,
int (*chap_verify_hook)(char *name, char *ourname, int id,
struct chap_digest_type *digest,
unsigned char *challenge, unsigned char *response,
- unsigned char *message, int message_space) = NULL;
+ char *message, int message_space) = NULL;
static int chap_verify_response(char *name, char *ourname, int id,
struct chap_digest_type *digest,
unsigned char *challenge, unsigned char *response,
static int chap_verify_response(char *name, char *ourname, int id,
struct chap_digest_type *digest,
unsigned char *challenge, unsigned char *response,
- unsigned char *message, int message_space);
+ char *message, int message_space);
static void chap_respond(struct chap_client_state *cs, int id,
unsigned char *pkt, int len);
static void chap_handle_status(struct chap_client_state *cs, int code, int id,
static void chap_respond(struct chap_client_state *cs, int id,
unsigned char *pkt, int len);
static void chap_handle_status(struct chap_client_state *cs, int code, int id,
{
int response_len, ok, mlen;
unsigned char *response, *p;
{
int response_len, ok, mlen;
unsigned char *response, *p;
- unsigned char *name = NULL; /* initialized to shut gcc up */
+ char *name = NULL; /* initialized to shut gcc up */
int (*verifier)(char *, char *, int, struct chap_digest_type *,
int (*verifier)(char *, char *, int, struct chap_digest_type *,
- unsigned char *, unsigned char *, unsigned char *, int);
+ unsigned char *, unsigned char *, char *, int);
char rname[MAXNAMELEN+1];
char rname[MAXNAMELEN+1];
- unsigned char message[256];
if ((ss->flags & LOWERUP) == 0)
return;
if ((ss->flags & LOWERUP) == 0)
return;
response = pkt;
GETCHAR(response_len, pkt);
len -= response_len + 1; /* length of name */
response = pkt;
GETCHAR(response_len, pkt);
len -= response_len + 1; /* length of name */
- name = pkt + response_len;
+ name = (char *)pkt + response_len;
chap_verify_response(char *name, char *ourname, int id,
struct chap_digest_type *digest,
unsigned char *challenge, unsigned char *response,
chap_verify_response(char *name, char *ourname, int id,
struct chap_digest_type *digest,
unsigned char *challenge, unsigned char *response,
- unsigned char *message, int message_space)
+ char *message, int message_space)
- char secret[MAXSECRETLEN];
+ unsigned char secret[MAXSECRETLEN];
int secret_len;
/* Get the secret that the peer is supposed to know */
int secret_len;
/* Get the secret that the peer is supposed to know */
- if (!get_secret(0, name, ourname, secret, &secret_len, 1)) {
+ if (!get_secret(0, name, ourname, (char *)secret, &secret_len, 1)) {
error("No CHAP secret found for authenticating %q", name);
return 0;
}
error("No CHAP secret found for authenticating %q", name);
return 0;
}
extern int (*chap_verify_hook)(char *name, char *ourname, int id,
struct chap_digest_type *digest,
unsigned char *challenge, unsigned char *response,
extern int (*chap_verify_hook)(char *name, char *ourname, int id,
struct chap_digest_type *digest,
unsigned char *challenge, unsigned char *response,
- unsigned char *message, int message_space);
+ char *message, int message_space);
/* Called by digest code to register a digest type */
extern void chap_register_digest(struct chap_digest_type *);
/* Called by digest code to register a digest type */
extern void chap_register_digest(struct chap_digest_type *);
* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
-#define RCSID "$Id: sys-solaris.c,v 1.11 2003/04/07 00:01:46 paulus Exp $"
+#define RCSID "$Id: sys-solaris.c,v 1.12 2004/01/17 05:47:55 carlsonj Exp $"
#include <limits.h>
#include <stdio.h>
#include <limits.h>
#include <stdio.h>
#endif
#include <signal.h>
#include <utmpx.h>
#endif
#include <signal.h>
#include <utmpx.h>
#include <sys/types.h>
#include <sys/ioccom.h>
#include <sys/stream.h>
#include <sys/types.h>
#include <sys/ioccom.h>
#include <sys/stream.h>
* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
-#define RCSID "$Id: tty.c,v 1.13 2004/01/13 04:17:59 paulus Exp $"
+#define RCSID "$Id: tty.c,v 1.14 2004/01/17 05:47:55 carlsonj Exp $"
#include <stdio.h>
#include <ctype.h>
#include <stdio.h>
#include <ctype.h>
{
char *connector;
int fdflags;
{
char *connector;
int fdflags;
- * $Id: bsd-comp.c,v 1.3 1999/04/16 11:35:59 paulus Exp $
+ * $Id: bsd-comp.c,v 1.4 2004/01/17 05:47:55 carlsonj Exp $
*/
#include <sys/types.h>
*/
#include <sys/types.h>
#include <stddef.h>
#include <stdlib.h>
#include <stddef.h>
#include <stdlib.h>
#include "ppp_defs.h"
#include "ppp-comp.h"
#include "ppp_defs.h"
#include "ppp-comp.h"
* AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*
* AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*
- * $Id: deflate.c,v 1.4 2002/12/06 09:49:16 paulus Exp $
+ * $Id: deflate.c,v 1.5 2004/01/17 05:47:55 carlsonj Exp $
*/
#include <sys/types.h>
*/
#include <sys/types.h>
#include <stddef.h>
#include <stdlib.h>
#include <stddef.h>
#include <stdlib.h>
#include "ppp_defs.h"
#include "ppp-comp.h"
#include "zlib.h"
#include "ppp_defs.h"
#include "ppp-comp.h"
#include "zlib.h"
*/
#include <stdio.h>
#include <unistd.h>
*/
#include <stdio.h>
#include <unistd.h>
#include <time.h>
#include <sys/types.h>
#include "ppp_defs.h"
#include <time.h>
#include <sys/types.h>
#include "ppp_defs.h"
extern int optind;
extern char *optarg;
extern int optind;
extern char *optarg;
+void dumplog();
+void dumpppp();
+void show_time();
+void handle_ccp();
+
+int
main(ac, av)
int ac;
char **av;
main(ac, av)
int ac;
char **av;
unsigned char dbuf[8192];
unsigned char dbuf[8192];
handle_ccp(cp, dp, len)
struct pkt *cp;
u_char *dp;
handle_ccp(cp, dp, len)
struct pkt *cp;
u_char *dp;
show_time(f, c)
FILE *f;
int c;
show_time(f, c)
FILE *f;
int c;
* AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*
* AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*
- * $Id: ppp_comp.c,v 1.2 2002/12/06 09:49:16 paulus Exp $
+ * $Id: ppp_comp.c,v 1.3 2004/01/17 05:47:55 carlsonj Exp $
if (!bcanputnext(q,mp->b_band))
#else
if (!canputnext(q))
if (!bcanputnext(q,mp->b_band))
#else
if (!canputnext(q))
if (cmp != NULL) {
#ifdef PRIOQ
cmp->b_band=mp->b_band;
if (cmp != NULL) {
#ifdef PRIOQ
cmp->b_band=mp->b_band;
* AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*
* AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*
- * $Id: ppp_mod.c,v 1.2 2002/12/06 09:49:16 paulus Exp $
+ * $Id: ppp_mod.c,v 1.3 2004/01/17 05:47:55 carlsonj Exp $
ppp_identify(dip)
dev_info_t *dip;
{
ppp_identify(dip)
dev_info_t *dip;
{
+ /* This entry point is not used as of Solaris 10 */
+#ifdef DDI_IDENTIFIED
return strcmp(ddi_get_name(dip), "ppp") == 0? DDI_IDENTIFIED:
DDI_NOT_IDENTIFIED;
return strcmp(ddi_get_name(dip), "ppp") == 0? DDI_IDENTIFIED:
DDI_NOT_IDENTIFIED;
+#else
+ return 0;
+#endif