summaryrefslogtreecommitdiffstats
path: root/usr.sbin/ppp/link.c
diff options
context:
space:
mode:
authorbrian <brian@FreeBSD.org>1999-09-04 00:00:21 +0000
committerbrian <brian@FreeBSD.org>1999-09-04 00:00:21 +0000
commitdcb79a71e6383c101218c59ed4feb6708a40b81a (patch)
tree8c060c30bd6bd3880f7c8ac84b8114e6b91f1603 /usr.sbin/ppp/link.c
parenta14fe466b1bc7f6e0a024da706d5f849e07a3b40 (diff)
downloadFreeBSD-src-dcb79a71e6383c101218c59ed4feb6708a40b81a.zip
FreeBSD-src-dcb79a71e6383c101218c59ed4feb6708a40b81a.tar.gz
o Split the two IPCP queues into three - one for FSM data
(LCP/CCP/IPCP), one for urgent IP traffic and one for everything else. o Add the ``set urgent'' command for adjusting the list of urgent port numbers. The default urgent ports are 21, 22, 23, 513, 514, 543 and 544 (Ports 80 and 81 have been removed from the default priority list). o Increase the buffered packet threshold from 20 to 30. o Report the number of packets in the IP output queue and the list of urgent ports under ``show ipcp''.
Diffstat (limited to 'usr.sbin/ppp/link.c')
-rw-r--r--usr.sbin/ppp/link.c22
1 files changed, 14 insertions, 8 deletions
diff --git a/usr.sbin/ppp/link.c b/usr.sbin/ppp/link.c
index 0cf4cfa..a96fb9a 100644
--- a/usr.sbin/ppp/link.c
+++ b/usr.sbin/ppp/link.c
@@ -82,17 +82,23 @@ link_AddOutOctets(struct link *l, int n)
void
link_SequenceQueue(struct link *l)
{
+ struct mqueue *queue, *highest;
+
log_Printf(LogDEBUG, "link_SequenceQueue\n");
- while (l->Queue[PRI_NORMAL].qlen)
- mbuf_Enqueue(l->Queue + PRI_LINK, mbuf_Dequeue(l->Queue + PRI_NORMAL));
+
+ highest = LINK_HIGHQ(l);
+ for (queue = l->Queue; queue < highest; queue++)
+ while (queue->qlen)
+ mbuf_Enqueue(highest, mbuf_Dequeue(queue));
}
void
link_DeleteQueue(struct link *l)
{
- struct mqueue *queue;
+ struct mqueue *queue, *highest;
- for (queue = l->Queue; queue < l->Queue + LINK_QUEUES; queue++)
+ highest = LINK_HIGHQ(l);
+ for (queue = l->Queue; queue <= highest; queue++)
while (queue->top)
mbuf_Free(mbuf_Dequeue(queue));
}
@@ -102,7 +108,7 @@ link_QueueLen(struct link *l)
{
int i, len;
- for (i = 0, len = 0; i < LINK_QUEUES; i++)
+ for (i = 0, len = 0; i < LINK_QUEUES(l); i++)
len += l->Queue[i].qlen;
return len;
@@ -115,7 +121,7 @@ link_QueueBytes(struct link *l)
struct mbuf *m;
bytes = 0;
- for (i = 0, len = 0; i < LINK_QUEUES; i++) {
+ for (i = 0, len = 0; i < LINK_QUEUES(l); i++) {
len = l->Queue[i].qlen;
m = l->Queue[i].top;
while (len--) {
@@ -133,7 +139,7 @@ link_Dequeue(struct link *l)
int pri;
struct mbuf *bp;
- for (bp = (struct mbuf *)0, pri = LINK_QUEUES - 1; pri >= 0; pri--)
+ for (bp = NULL, pri = LINK_QUEUES(l) - 1; pri >= 0; pri--)
if (l->Queue[pri].qlen) {
bp = mbuf_Dequeue(l->Queue + pri);
log_Printf(LogDEBUG, "link_Dequeue: Dequeued from queue %d,"
@@ -208,7 +214,7 @@ link_PushPacket(struct link *l, struct mbuf *bp, struct bundle *b, int pri,
* packet (as we do with ``pull''s).
*/
- if(pri < 0 || pri >= LINK_QUEUES)
+ if(pri < 0 || pri >= LINK_QUEUES(l))
pri = 0;
for (layer = l->nlayers; layer && bp; layer--)
OpenPOWER on IntegriCloud