Vitezslav Samel <vitezslav(a)samel.cz> writes:
On Tue, Apr 24, 2012 at 11:04:52AM +0200, Nikola Pajkovsky wrote:
> Vitezslav Samel <vitezslav(a)samel.cz> writes:
>
> > On Tue, Apr 24, 2012 at 10:44:52AM +0200, Nikola Pajkovsky wrote:
> >> Vitezslav Samel <vitezslav(a)samel.cz> writes:
> >>
> >> > Move these functions into more appropriate file.
> >> >
> >> > Signed-off-by: Vitezslav Samel <vitezslav(a)samel.cz>
> >> > ---
> >> > src/ifaces.c | 24 ++++++++++++++++++++++++
> >> > src/ifaces.h | 4 +++-
> >> > src/iptraf-ng-compat.h | 3 ---
> >> > src/wrapper.c | 24 ------------------------
> >> > 4 files changed, 27 insertions(+), 28 deletions(-)
> >>
> >> maybe better name is
> >>
> >> int dev_bind_ifname(...)
> >> int dev_bind_ifindex(...)
> >
> > I was thinking about it very much when I was creating this patch:
> > we are binding SOCKET to an INTERFACE. And your proposed names are not that
> > good in describing this.
>
> the idea comes from the kernel. all interfaces are named netdev_ or dev_
> and I'd like to have the names in same way.
>
> see more in net/core/dev.c
I see. But we are binding socket to an interface and not interface to a
socket! Bind operation is on socket not on interface!
I know. Looks like we are seeing the naming differently :)
prefix: *dev_* we are doing something with device (interface) [I somehow
don't like _iface_]
operations *bind* by ifname/ifindex and return success or error.
and const int is same as int in fn argument. fn can't change the value
of int (it can internaly, but the result is not propagate from fn)
--
Nikola