commit-inetutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[SCM] GNU Inetutils branch, master, updated. inetutils-1_9_1-216-g0dc35


From: Mats Erik Andersson
Subject: [SCM] GNU Inetutils branch, master, updated. inetutils-1_9_1-216-g0dc3545
Date: Wed, 28 Nov 2012 19:44:22 +0000

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU Inetutils ".

The branch, master has been updated
       via  0dc3545ca84c8a713810a4b86555824332b3d500 (commit)
      from  e9a6037fb15d706a00a9212c1e3a3c1b89ab9429 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://git.savannah.gnu.org/cgit/inetutils.git/commit/?id=0dc3545ca84c8a713810a4b86555824332b3d500


commit 0dc3545ca84c8a713810a4b86555824332b3d500
Author: Mats Erik Andersson <address@hidden>
Date:   Wed Nov 28 18:32:53 2012 +0100

    Move if_nameindex to libinetutils.
    
    Build if_nametoindex() and if_nameindex() in libinetutils.a
    if they are missing in the system library.

diff --git a/ChangeLog b/ChangeLog
index ab9b7a1..787dd48 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,30 @@
+2012-11-28  Mats Erik Andersson  <address@hidden>
+
+       libinetutils.a: Build if_nametoindex(), if_nameindex(),
+       and if_freenameindex() into library, if they are missing
+       in the system library.
+
+       * libinetutils/Makefile.am (libinetutils_a_SOURCES):
+       Add if_index.c.
+       * libinetutils/if_index.c: Moved from old location at
+       `ifconfig/if_index.c'.  Do not include <ifconfig.h>.
+       * libinetutils/libinetutils.h (if_nameindex)
+       [!HAVE_STRUCT_IF_NAMEINDEX): New structure declaration.
+       (if_nametoindex, if_nameindex, if_freenameindex)
+       [!HAVE_STRUCT_IF_NAMEINDEX): New function declarations.
+
+       * ifconfig/Makefile.am (ifconfig_SOURCES): Remove if_index.c.
+       (noinst_HEADERS): Remove if_index.h.
+       * ifconfig/if_index.c, ifconfig/if_index.h: Deleted files.
+       * ifconfig/ifconfig.h: Do not include "if_index.h".
+       * ifconfig/system.h: Do not include <if_index.h>.
+
+       Test script for ifconfig utility.
+
+       * tests/ifconfig.sh: New file.
+       * tests/Makefile.am (dist_check_SCRIPTS) [ENABLE_ifconfig]:
+       Add ifconfig.sh.
+
 2012-11-23  Mats Erik Andersson  <address@hidden>
 
        syslogd: Reusable IP sockets.
diff --git a/TODO b/TODO
index 757daae..a296de9 100644
--- a/TODO
+++ b/TODO
@@ -129,7 +129,6 @@ Ability to ping multiple host in one go.
 * ifconfig
 
 ** Implement flags support in changeif.c and options.c
-** Fix and move if_index.c to libinetutils.
 ** Port to BSD.
 ** Make sure it is a drop in replacement at least for the most
    common options on Linux and BSD.
diff --git a/ifconfig/Makefile.am b/ifconfig/Makefile.am
index f01bf62..7cd0e16 100644
--- a/ifconfig/Makefile.am
+++ b/ifconfig/Makefile.am
@@ -23,9 +23,9 @@ bin_PROGRAMS = $(ifconfig_BUILD)
 
 EXTRA_PROGRAMS = ifconfig
 
-ifconfig_SOURCES = ifconfig.c flags.c changeif.c options.c printif.c system.c 
if_index.c
+ifconfig_SOURCES = ifconfig.c flags.c changeif.c options.c printif.c system.c
 
-noinst_HEADERS = ifconfig.h if_index.h flags.h options.h printif.h system.h
+noinst_HEADERS = ifconfig.h flags.h options.h printif.h system.h
 
 @PATHDEFS_MAKE@
 AM_CPPFLAGS = $(PATHDEF_PROCNET_DEV)
diff --git a/ifconfig/if_index.h b/ifconfig/if_index.h
deleted file mode 100644
index 280eae6..0000000
--- a/ifconfig/if_index.h
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
-  Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009,
-  2010, 2011, 2012 Free Software Foundation, Inc.
-
-  This file is part of GNU Inetutils.
-
-  GNU Inetutils is free software: you can redistribute it and/or modify
-  it under the terms of the GNU General Public License as published by
-  the Free Software Foundation, either version 3 of the License, or (at
-  your option) any later version.
-
-  GNU Inetutils is distributed in the hope that it will be useful, but
-  WITHOUT ANY WARRANTY; without even the implied warranty of
-  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-  General Public License for more details.
-
-  You should have received a copy of the GNU General Public License
-  along with this program.  If not, see `http://www.gnu.org/licenses/'. */
-
-#ifndef IF_INDEX_H
-# define IF_INDEX_H
-
-# ifndef HAVE_STRUCT_IF_NAMEINDEX
-struct if_nameindex
-{
-  char *if_name;
-  int if_index;
-};
-extern unsigned int if_nametoindex (const char *ifname);
-extern struct if_nameindex *if_nameindex (void);
-extern void if_freenameindex (struct if_nameindex *ptr);
-# endif
-
-#endif
diff --git a/ifconfig/ifconfig.h b/ifconfig/ifconfig.h
index 35045b7..6fb61d2 100644
--- a/ifconfig/ifconfig.h
+++ b/ifconfig/ifconfig.h
@@ -23,7 +23,6 @@
 # define IFCONFIG_IFCONFIG_H
 
 # include "flags.h"
-# include "if_index.h"
 # include "options.h"
 # include "printif.h"
 # include "system.h"
diff --git a/ifconfig/system.h b/ifconfig/system.h
index 0108aff..2352081 100644
--- a/ifconfig/system.h
+++ b/ifconfig/system.h
@@ -23,8 +23,6 @@
 # define IFCONFIG_SYSTEM_H
 
 
-# include <if_index.h>
-
 /* Option parsing.  */
 
 extern struct argp_child system_argp_child;
diff --git a/libinetutils/Makefile.am b/libinetutils/Makefile.am
index f674eeb..7c599bc 100644
--- a/libinetutils/Makefile.am
+++ b/libinetutils/Makefile.am
@@ -30,6 +30,7 @@ libinetutils_a_SOURCES = \
  daemon.c\
  defauthors.c\
  des_rw.c\
+ if_index.c \
  kcmd.c\
  krcmd.c\
  localhost.c\
diff --git a/ifconfig/if_index.c b/libinetutils/if_index.c
similarity index 99%
rename from ifconfig/if_index.c
rename to libinetutils/if_index.c
index b3dc590..a063101 100644
--- a/ifconfig/if_index.c
+++ b/libinetutils/if_index.c
@@ -36,8 +36,6 @@
 #include <sys/ioctl.h>
 #include <net/if.h>
 
-#include <ifconfig.h>
-
 #ifndef HAVE_STRUCT_IF_NAMEINDEX
 unsigned int
 if_nametoindex (const char *ifname)
diff --git a/libinetutils/libinetutils.h b/libinetutils/libinetutils.h
index 5dc329d..617cf5c 100644
--- a/libinetutils/libinetutils.h
+++ b/libinetutils/libinetutils.h
@@ -33,6 +33,18 @@ void logwtmp (const char *, const char *, const char *);
 void cleanup_session (char *tty, int pty_fd);
 void logwtmp_keep_open (char *line, char *name, char *host);
 
+#ifndef HAVE_STRUCT_IF_NAMEINDEX
+struct if_nameindex
+{
+  char *if_name;
+  int if_index;
+};
+
+unsigned int if_nametoindex (const char *ifname);
+struct if_nameindex *if_nameindex (void);
+void if_freenameindex (struct if_nameindex *ptr);
+#endif
+
 extern const char *default_program_authors[];
 
 #define iu_argp_init(name, authors)                            \
diff --git a/tests/Makefile.am b/tests/Makefile.am
index d7d72a1..1419a26 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -68,6 +68,10 @@ if ENABLE_dnsdomainname
 dist_check_SCRIPTS += dnsdomainname.sh
 endif
 
+if ENABLE_ifconfig
+dist_check_SCRIPTS += ifconfig.sh
+endif
+
 TESTS = localhost waitdaemon $(dist_check_SCRIPTS)
 
 TESTS_ENVIRONMENT = EXEEXT=$(EXEEXT)

-----------------------------------------------------------------------

Summary of changes:
 ChangeLog                             |   27 ++++++++++++++++++++++++++
 TODO                                  |    1 -
 ifconfig/Makefile.am                  |    4 +-
 ifconfig/if_index.h                   |   34 ---------------------------------
 ifconfig/ifconfig.h                   |    1 -
 ifconfig/system.h                     |    2 -
 libinetutils/Makefile.am              |    1 +
 {ifconfig => libinetutils}/if_index.c |    2 -
 libinetutils/libinetutils.h           |   12 +++++++++++
 tests/Makefile.am                     |    4 +++
 10 files changed, 46 insertions(+), 42 deletions(-)
 delete mode 100644 ifconfig/if_index.h
 rename {ifconfig => libinetutils}/if_index.c (99%)


hooks/post-receive
-- 
GNU Inetutils 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]