From: Paul Mackerras Date: Mon, 22 Aug 1994 00:41:00 +0000 (+0000) Subject: add ccp_test X-Git-Tag: RELEASE_2_3_6~901 X-Git-Url: https://git.ozlabs.org/?p=ppp.git;a=commitdiff_plain;h=31e531a04e1f20c89aef30b0744bed4eb0c1806a add ccp_test --- diff --git a/pppd/sys-bsd.c b/pppd/sys-bsd.c index d0cd228..f07a3b7 100644 --- a/pppd/sys-bsd.c +++ b/pppd/sys-bsd.c @@ -19,7 +19,7 @@ */ #ifndef lint -static char rcsid[] = "$Id: sys-bsd.c,v 1.8 1994/08/09 06:30:38 paulus Exp $"; +static char rcsid[] = "$Id: sys-bsd.c,v 1.9 1994/08/22 00:41:00 paulus Exp $"; #endif /* @@ -277,6 +277,22 @@ ppp_recv_config(unit, mru, asyncmap, pcomp, accomp) } } +/* + * ccp_test - ask kernel whether a given compression method + * is acceptable for use. + */ +ccp_test(unit, opt_ptr, opt_len, for_transmit) + int unit, opt_len, for_transmit; + u_char *opt_ptr; +{ + struct ppp_comp_data data; + + data.ptr = opt_ptr; + data.length = opt_len; + data.transmit = for_transmit; + return ioctl(fd, PPPIOCSCOMPRESS, (caddr_t) &data) >= 0; +} + /* * ccp_flags_set - inform kernel about the current state of CCP. */