From owner-freebsd-net Thu Jun 7 5:36:49 2001 Delivered-To: freebsd-net@freebsd.org Received: from info.iet.unipi.it (info.iet.unipi.it [131.114.9.184]) by hub.freebsd.org (Postfix) with ESMTP id 0905637B407 for ; Thu, 7 Jun 2001 05:36:42 -0700 (PDT) (envelope-from luigi@info.iet.unipi.it) Received: (from luigi@localhost) by info.iet.unipi.it (8.9.3/8.9.3) id OAA41296; Thu, 7 Jun 2001 14:32:41 +0200 (CEST) (envelope-from luigi) From: Luigi Rizzo Message-Id: <200106071232.OAA41296@info.iet.unipi.it> Subject: Re: How to count frames transmitted through the ethernet card. In-Reply-To: <3B1F67A8.2676289D@it.uc3m.es> from Juan Fco Rodriguez Hervella at "Jun 7, 2001 01:38:16 pm" To: Juan Fco Rodriguez Hervella Date: Thu, 7 Jun 2001 14:32:41 +0200 (CEST) Cc: freebsd-net@FreeBSD.ORG X-Mailer: ELM [version 2.4ME+ PL61 (25)] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-freebsd-net@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org > That is my problem, If sendto() *not* always returns ENOBUFS, I > need to know the packets what are actually transmited... you don't have a way to know. The transmission can fail in the device driver (e.g. because of excessive collisions) and you only know it at a later time. cheers luigi > > >> Hello: > >> > >> I am doing a program that sends udp packets. I have a counter > >> and each time I send a packet with "sendto()", I increment the value > >> of this variable. > >> > >> But I would like to count the frames that are being actually > >> transmitted, through the ethernet card, some like the ifconfig/netstat. > > > > In principle sendto() can return you an ENOBUFS error when the > > interface queue is full, but not always (depending on how the > > firewall plays with the packet). > > > cheers > > luigi > > > ********************************* > Juan F. Rodriguez Hervella > Universidad Carlos III de Madrid > ******************************** > > To Unsubscribe: send mail to majordomo@FreeBSD.org > with "unsubscribe freebsd-net" in the body of the message > To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-net" in the body of the message