summaryrefslogtreecommitdiffstats
path: root/usr.sbin/ppp/mp.c
diff options
context:
space:
mode:
authorbrian <brian@FreeBSD.org>2001-08-14 16:05:52 +0000
committerbrian <brian@FreeBSD.org>2001-08-14 16:05:52 +0000
commitde3feff3f8839f8f26a69dfb7cd667332a8536dc (patch)
treeb09d46345a558a45e66b435c4386d76cf53405d3 /usr.sbin/ppp/mp.c
parentdbc6471fad42e595668d0f00254797ef89e618b0 (diff)
downloadFreeBSD-src-de3feff3f8839f8f26a69dfb7cd667332a8536dc.zip
FreeBSD-src-de3feff3f8839f8f26a69dfb7cd667332a8536dc.tar.gz
o Add ipv6 support, abstracting most NCP addresses into opaque
structures (well, they're treated as opaque). It's now possible to manage IPv6 interface addresses and routing table entries and to filter IPV6 traffic whether encapsulated or not. IPV6CP support is crude for now, and hasn't been tested against any other implementations. RADIUS and IPv6 are independent of eachother for now. ppp.linkup/ppp.linkdown aren't currently used by IPV6CP o Understand all protocols(5) in filter rules rather than only a select few. o Allow a mask specification for the ``delete'' command. It's now possible to specifically delete one of two conflicting routes. o When creating and deleting proxy arp entries, do it for all IPv4 interface addresses rather than doing it just for the ``current'' peer address. o When iface-alias isn't in effect, don't blow away manually (via ``iface add'') added interface addresses. o When listening on a tcp server (diagnostic) socket, bind so that a tcp46 socket is created -- allowing both IPv4 and IPv6 connections. o When displaying ICMP traffic, don't display the icmp type twice. When display traffic, display at least some information about unrecognised traffic. o Bump version Inspired after filtering work by: Makoto MATSUSHITA <matusita@jp.FreeBSD.org>
Diffstat (limited to 'usr.sbin/ppp/mp.c')
-rw-r--r--usr.sbin/ppp/mp.c35
1 files changed, 21 insertions, 14 deletions
diff --git a/usr.sbin/ppp/mp.c b/usr.sbin/ppp/mp.c
index 8892cd2..ac9321b 100644
--- a/usr.sbin/ppp/mp.c
+++ b/usr.sbin/ppp/mp.c
@@ -61,6 +61,8 @@
#include "slcompress.h"
#include "lqr.h"
#include "hdlc.h"
+#include "ncpaddr.h"
+#include "ip.h"
#include "ipcp.h"
#include "auth.h"
#include "lcp.h"
@@ -79,8 +81,9 @@
#ifndef NORADIUS
#include "radius.h"
#endif
+#include "ipv6cp.h"
+#include "ncp.h"
#include "bundle.h"
-#include "ip.h"
#include "prompt.h"
#include "id.h"
#include "arp.h"
@@ -243,6 +246,7 @@ mp_Init(struct mp *mp, struct bundle *bundle)
mp->out.seq = 0;
mp->out.link = 0;
+ mp->out.af = AF_INET;
mp->seq.min_in = 0;
mp->seq.next_in = 0;
mp->inbufs = NULL;
@@ -336,6 +340,7 @@ mp_Up(struct mp *mp, struct datalink *dl)
mp->out.seq = 0;
mp->out.link = 0;
+ mp->out.af = AF_INET;
mp->seq.min_in = 0;
mp->seq.next_in = 0;
@@ -355,8 +360,8 @@ mp_Up(struct mp *mp, struct datalink *dl)
log_Printf(LogPHASE, "mp: Listening on %s\n", mp->server.socket.sun_path);
log_Printf(LogPHASE, " First link: %s\n", dl->name);
- /* Re-point our IPCP layer at our MP link */
- ipcp_SetLink(&mp->bundle->ncp.ipcp, &mp->link);
+ /* Re-point our NCP layers at our MP link */
+ ncp_SetLink(&mp->bundle->ncp, &mp->link);
/* Our lcp's already up 'cos of the NULL parent */
if (ccp_SetOpenMode(&mp->link.ccp)) {
@@ -657,7 +662,7 @@ mp_Output(struct mp *mp, struct bundle *bundle, struct link *l,
}
int
-mp_FillQueues(struct bundle *bundle)
+mp_FillPhysicalQueues(struct bundle *bundle)
{
struct mp *mp = &bundle->ncp.mp;
struct datalink *dl, *fdl;
@@ -665,6 +670,7 @@ mp_FillQueues(struct bundle *bundle)
int thislink, nlinks;
u_int32_t begin, end;
struct mbuf *m, *mo;
+ struct link *bestlink;
thislink = nlinks = 0;
for (fdl = NULL, dl = bundle->links; dl; dl = dl->next) {
@@ -706,7 +712,7 @@ mp_FillQueues(struct bundle *bundle)
continue;
}
- if (!link_QueueLen(&mp->link)) {
+ if (!mp_QueueLen(mp)) {
struct datalink *other;
int mrutoosmall;
@@ -714,7 +720,8 @@ mp_FillQueues(struct bundle *bundle)
* If there's only a single open link in our bundle and we haven't got
* MP level link compression, queue outbound traffic directly via that
* link's protocol stack rather than using the MP link. This results
- * in the outbound traffic going out as PROTO_IP rather than PROTO_MP.
+ * in the outbound traffic going out as PROTO_IP or PROTO_IPV6 rather
+ * than PROTO_MP.
*/
for (other = dl->next; other; other = other->next)
if (other->state == DATALINK_OPEN)
@@ -734,9 +741,9 @@ mp_FillQueues(struct bundle *bundle)
}
}
- if (!ip_PushPacket(other ? &mp->link : &dl->physical->link, bundle))
- /* Nothing else to send */
- break;
+ bestlink = other ? &mp->link : &dl->physical->link;
+ if (!ncp_PushPacket(&bundle->ncp, &mp->out.af, bestlink))
+ break; /* Nothing else to send */
if (mrutoosmall)
log_Printf(LogDEBUG, "Don't send data as PROTO_IP, MRU < MRRU\n");
@@ -978,7 +985,7 @@ mp_SetEnddisc(struct cmdargs const *arg)
mp->cfg.enddisc.len = strlen(mp->cfg.enddisc.address);
} else if (!strcasecmp(arg->argv[arg->argn], "ip")) {
if (arg->bundle->ncp.ipcp.my_ip.s_addr == INADDR_ANY)
- addr = arg->bundle->ncp.ipcp.cfg.my_range.ipaddr;
+ ncprange_getip4addr(&arg->bundle->ncp.ipcp.cfg.my_range, &addr);
else
addr = arg->bundle->ncp.ipcp.my_ip;
memcpy(mp->cfg.enddisc.address, &addr.s_addr, sizeof addr.s_addr);
@@ -989,7 +996,7 @@ mp_SetEnddisc(struct cmdargs const *arg)
int s;
if (arg->bundle->ncp.ipcp.my_ip.s_addr == INADDR_ANY)
- addr = arg->bundle->ncp.ipcp.cfg.my_range.ipaddr;
+ ncprange_getip4addr(&arg->bundle->ncp.ipcp.cfg.my_range, &addr);
else
addr = arg->bundle->ncp.ipcp.my_ip;
@@ -1195,8 +1202,8 @@ mp_LinkLost(struct mp *mp, struct datalink *dl)
mp_Assemble(mp, NULL, NULL);
}
-void
-mp_DeleteQueue(struct mp *mp)
+size_t
+mp_QueueLen(struct mp *mp)
{
- link_DeleteQueue(&mp->link);
+ return link_QueueLen(&mp->link);
}
OpenPOWER on IntegriCloud