1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-14 10:09:48 +00:00

Output the correct protocol id from the physical link-level CCP

layer when we're in multilink mode.
This commit is contained in:
Brian Somers 1998-04-24 19:15:26 +00:00
parent 086760227f
commit ed32233ca5
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/cvs2svn/branches/MP/; revision=35430
6 changed files with 23 additions and 11 deletions

View File

@ -17,7 +17,7 @@
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*
* $Id: ccp.c,v 1.30.2.35 1998/04/19 02:23:15 brian Exp $
* $Id: ccp.c,v 1.30.2.36 1998/04/19 03:40:54 brian Exp $
*
* TODO:
* o Support other compression protocols
@ -53,6 +53,8 @@
#include "hdlc.h"
#include "link.h"
#include "mp.h"
#include "async.h"
#include "physical.h"
#include "bundle.h"
static void CcpSendConfigReq(struct fsm *);
@ -528,11 +530,11 @@ struct mbuf *
ccp_Decompress(struct ccp *ccp, u_short *proto, struct mbuf *bp)
{
/*
* If proto isn't PROTO_COMPD, we still want to pass it to the
* If proto isn't PROTO_[I]COMPD, we still want to pass it to the
* decompression routines so that the dictionary's updated
*/
if (ccp->fsm.state == ST_OPENED)
if (*proto == PROTO_COMPD) {
if (*proto == PROTO_COMPD || *proto == PROTO_ICOMPD) {
/* Decompress incoming data */
if (ccp->reset_sent != -1)
/* Send another REQ and put the packet in the bit bucket */
@ -549,3 +551,10 @@ ccp_Decompress(struct ccp *ccp, u_short *proto, struct mbuf *bp)
return bp;
}
u_short
ccp_Proto(struct ccp *ccp)
{
return !link2physical(ccp->fsm.link) || !ccp->fsm.bundle->ncp.mp.active ?
PROTO_COMPD : PROTO_ICOMPD;
}

View File

@ -15,7 +15,7 @@
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*
* $Id: ccp.h,v 1.14.2.16 1998/04/07 00:53:24 brian Exp $
* $Id: ccp.h,v 1.14.2.17 1998/04/16 00:25:51 brian Exp $
*
* TODO:
*/
@ -41,6 +41,7 @@
#define CCP_NEG_TOTAL 3
struct mbuf;
struct link;
struct ccp_config {
struct {
@ -122,3 +123,4 @@ extern void CcpInput(struct ccp *, struct bundle *, struct mbuf *);
extern int ccp_ReportStatus(struct cmdargs const *);
extern int ccp_Compress(struct ccp *, struct link *, int, u_short, struct mbuf *);
extern struct mbuf *ccp_Decompress(struct ccp *, u_short *, struct mbuf *);
extern u_short ccp_Proto(struct ccp *);

View File

@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* $Id: deflate.c,v 1.6.4.10 1998/04/07 00:53:37 brian Exp $
* $Id: deflate.c,v 1.6.4.11 1998/04/16 00:25:57 brian Exp $
*/
#include <sys/types.h>
@ -182,7 +182,7 @@ DeflateOutput(void *v, struct ccp *ccp, struct link *l, int pri, u_short proto,
LogPrintf(LogDEBUG, "DeflateOutput: %d => %d bytes, proto 0x%04x\n",
ilen, olen, proto);
HdlcOutput(l, PRI_NORMAL, PROTO_COMPD, mo_head);
HdlcOutput(l, PRI_NORMAL, ccp_Proto(ccp), mo_head);
return 1;
}

View File

@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* $Id: link.c,v 1.1.2.17 1998/04/06 09:12:31 brian Exp $
* $Id: link.c,v 1.1.2.18 1998/04/07 00:53:57 brian Exp $
*
*/
@ -154,6 +154,7 @@ static struct protostatheader {
{ PROTO_VJUNCOMP, "VJ_UNCOMP" },
{ PROTO_VJCOMP, "VJ_COMP" },
{ PROTO_COMPD, "COMPD" },
{ PROTO_ICOMPD, "ICOMPD" },
{ PROTO_LCP, "LCP" },
{ PROTO_IPCP, "IPCP" },
{ PROTO_CCP, "CCP" },

View File

@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* $Id: link.h,v 1.1.2.9 1998/04/18 01:01:22 brian Exp $
* $Id: link.h,v 1.1.2.10 1998/04/20 00:20:35 brian Exp $
*
*/
@ -32,7 +32,7 @@
#define MP_LINK 2
#define LINK_QUEUES (PRI_MAX + 1)
#define NPROTOSTAT 12
#define NPROTOSTAT 13
struct bundle;
struct prompt;

View File

@ -26,7 +26,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* $Id: pred.c,v 1.20.2.8 1998/04/07 00:54:15 brian Exp $
* $Id: pred.c,v 1.20.2.9 1998/04/16 00:26:17 brian Exp $
*/
#include <sys/types.h>
@ -204,7 +204,7 @@ Pred1Output(void *v, struct ccp *ccp, struct link *l, int pri, u_short proto,
*wp++ = fcs & 0377;
*wp++ = fcs >> 8;
mwp->cnt = wp - MBUF_CTOP(mwp);
HdlcOutput(l, PRI_NORMAL, PROTO_COMPD, mwp);
HdlcOutput(l, PRI_NORMAL, ccp_Proto(ccp), mwp);
return 1;
}