From owner-freebsd-hackers Tue Nov 21 7:37:22 2000 Delivered-To: freebsd-hackers@freebsd.org Received: from ringworld.nanolink.com (pool34-tch-1.Sofia.0rbitel.net [212.95.170.34]) by hub.freebsd.org (Postfix) with SMTP id 06A8737B479 for ; Tue, 21 Nov 2000 07:37:15 -0800 (PST) Received: (qmail 31990 invoked by uid 1000); 21 Nov 2000 15:36:51 -0000 Date: Tue, 21 Nov 2000 17:36:51 +0200 From: Peter Pentchev To: markm@gbonline.com Cc: questions@freebsd.org, hackers@freebsd.org Subject: Re: Systems programming questions... Message-ID: <20001121173651.C9661@ringworld.oblivion.bg> Mail-Followup-To: markm@gbonline.com, questions@freebsd.org, hackers@freebsd.org References: <20001121092902.A6568@online.dct.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <20001121092902.A6568@online.dct.com>; from markm@online.dct.com on Tue, Nov 21, 2000 at 09:29:02AM -0600 Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On Tue, Nov 21, 2000 at 09:29:02AM -0600, Mark wrote: > Hey all -- > > I'm trying to find a "correct" way to add virtual interfaces to my network > card via a C program. right now, I've come up with 3 system() calls to do the > work. I don't know if there is a better way or not, but if there is, I'd like > to use it. Is there a better way to create and make active a virtual > interface in a C program other than using system() to call an ifconfig, route, > and arp command? Generally, the 'most correct' way to do almost anything regarding interfaces can be found in the /sbin/ifconfig source. I do not really know why you also need to do a route and arp though; I admin I know nothing about arp, but I'm pretty sure that the FreeBSD kernel automagically installs a new route for each newly-upped interface. Hope that helps.. G'luck, Peter -- "yields falsehood, when appended to its quotation." yields falsehood, when appended to its quotation. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message