Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 21 Nov 2000 09:50:53 -0600
From:      Mark <markm@online.dct.com>
To:        Peter Pentchev <roam@orbitel.bg>
Cc:        questions@FreeBSD.ORG, hackers@FreeBSD.ORG
Subject:   Re: Systems programming questions...
Message-ID:  <20001121095053.B6568@online.dct.com>
In-Reply-To: <20001121173651.C9661@ringworld.oblivion.bg>; from roam@orbitel.bg on Tue, Nov 21, 2000 at 05:36:51PM %2B0200
References:  <20001121092902.A6568@online.dct.com> <20001121173651.C9661@ringworld.oblivion.bg>

next in thread | previous in thread | raw e-mail | index | archive | help
Thus spake Peter Pentchev (roam@orbitel.bg):

> 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..

Sure does... I guess I don't need the route and arp commands.  Works just fine
with the "ifconfig ... alias" system call.  I guess the next step is to look
at the source for /sbin/ifconfig, like you suggested.

Thanks for the help,

-- 
Mark Maurer  markm@solinus.com   Programmer, Solinus Inc. 
Play:        markm@gbonline.com  http://www.dct.com/~markm/
Other:       mark@thecity.com    mark@mail2go.com


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?20001121095053.B6568>