From owner-freebsd-current Fri Oct 9 16:23:34 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id QAA17577 for freebsd-current-outgoing; Fri, 9 Oct 1998 16:23:34 -0700 (PDT) (envelope-from owner-freebsd-current@FreeBSD.ORG) Received: from awfulhak.org (awfulhak.force9.co.uk [195.166.136.63]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id QAA17518 for ; Fri, 9 Oct 1998 16:23:20 -0700 (PDT) (envelope-from brian@Awfulhak.org) Received: from woof.lan.awfulhak.org (brian@woof.lan.awfulhak.org [172.16.0.7]) by awfulhak.org (8.8.8/8.8.8) with ESMTP id TAA17498; Fri, 9 Oct 1998 19:13:46 +0100 (BST) (envelope-from brian@Awfulhak.org) Received: from woof.lan.awfulhak.org (brian@localhost [127.0.0.1]) by woof.lan.awfulhak.org (8.9.1/8.9.1) with ESMTP id KAA00774; Fri, 9 Oct 1998 10:58:49 +0100 (BST) (envelope-from brian@woof.lan.awfulhak.org) Message-Id: <199810090958.KAA00774@woof.lan.awfulhak.org> X-Mailer: exmh version 2.0.2 2/24/98 To: Bill Fenner cc: Eivind Eklund , Brian Somers , Kris Kennaway , current@FreeBSD.ORG Subject: Re: Improper sharing of modem bandwidth In-reply-to: Your message of "Thu, 08 Oct 1998 15:21:21 PDT." <98Oct8.152124pdt.177476@crevenia.parc.xerox.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Fri, 09 Oct 1998 10:58:48 +0100 From: Brian Somers Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG > In message <19981008211441.00286@follo.net> Eivind wrote: > >#2 is probably the best (from the view of which possibilities it > >gives), but I also suspect it is what would give most work (unless bpf > >already can be used this way; then it would just be a question of > >making PPP use it.) > > [Jumping straight in where I know none of the context...] > > i = bpf_filter(program, (u_char *)m, ip->ip_len, 0) > > is all you need to do to run BPF program "program" on the packet in > mbuf m. > > The BPF program can return the packet's priority (i.e. by looking at > TCP ports or IP TOS or whatever) and then you could order the packets > in the queue by their priority. Maybe this is over-flexible ? It would be far easier (IMHO anyway) and wouldn't require any bpf code to create an ioctl something like struct portlist { int nports; u_short port[1]; }; struct portlist *p = (struct portlist *) malloc(sizeof *p + (nports-1) * sizeof p->port); p->nports = nports; for (i = 0; i < nports; i++) p->port[i] = ...; ioctl(tunfd, TIOCSETINTERACTIVEPORTS, p); Closing the device would clear the list, and ppp could simply #ifdef TIOCSETINTERACTIVEPORTS to see if it needs to do this... > Bill Having said all that, I suspect it would be easier to s/20/100/ as I originally suggested. If you've got more than 100 packets queued at a given time, surely the TCP window is way to large. -- Brian , , Don't _EVER_ lose your sense of humour.... To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message