Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 21 Nov 2000 17:36:51 +0200
From:      Peter Pentchev <roam@orbitel.bg>
To:        markm@gbonline.com
Cc:        questions@freebsd.org, hackers@freebsd.org
Subject:   Re: Systems programming questions...
Message-ID:  <20001121173651.C9661@ringworld.oblivion.bg>
In-Reply-To: <20001121092902.A6568@online.dct.com>; from markm@online.dct.com on Tue, Nov 21, 2000 at 09:29:02AM -0600
References:  <20001121092902.A6568@online.dct.com>

next in thread | previous in thread | raw e-mail | index | archive | help
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-questions" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20001121173651.C9661>