Ethernet Bridge development
 help / color / mirror / Atom feed
From: Stephen Hemminger <shemminger@osdl.org>
To: srinivas naga vutukuri <srinivas.vutukuri@gmail.com>
Cc: bridge@lists.osdl.org
Subject: Re: [Bridge] Can it possible to call the bridge ioctl calls from another module code...
Date: Fri, 13 May 2005 16:33:47 -0700	[thread overview]
Message-ID: <20050513163347.39097bb5@dxpl.pdx.osdl.net> (raw)
In-Reply-To: <ace3f33d05050917531641fb@mail.gmail.com>

On Tue, 10 May 2005 06:23:24 +0530
srinivas naga vutukuri <srinivas.vutukuri@gmail.com> wrote:

> Hi,
> 
>           I am using 2.4.x kernel and the kernel native bridge code
> (for bridging).
> I am creating Pseudo net_devices'  which should be added to the bridge
> interfaces.
> without intervention of bridge-utils (ie., brctl) to add interface
> from the userland,
> can i able to call the br_ioctl (), br_ioctl_deviceless_stub () which
> is calling the static br_ioctl_deviceless () function, which is
> adding/deleting the interface from the
> bridge. But my doubt is they are not defined as static, am thought global scope,
> but no where exported those function symbols, so using directly into
> another module is correct way of usage?
> 

What you need to do is have a socket around and feed sock_ioctl()
the appropriate request.  Alternatively, you could simulate user call like
the code in 2.6 br_if.c does to fake ethtool:
	strncpy(ifr.ifr_name, dev->name, IFNAMSIZ);
	ifr.ifr_data = (void __user *) &ecmd;

	old_fs = get_fs();
	set_fs(KERNEL_DS);
	err = dev_ethtool(&ifr);
	set_fs(old_fs);
	
	if (!err) {

Easier to just do something call_usermodehelper or do it all from user mode.


      reply	other threads:[~2005-05-13 23:33 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-05-10  0:53 [Bridge] Can it possible to call the bridge ioctl calls from another module code srinivas naga vutukuri
2005-05-13 23:33 ` Stephen Hemminger [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20050513163347.39097bb5@dxpl.pdx.osdl.net \
    --to=shemminger@osdl.org \
    --cc=bridge@lists.osdl.org \
    --cc=srinivas.vutukuri@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox