[PATCH 07/13] idiag: deprecate IDIAG_TIMER_* value for IDIAGNL_TIMER_*

Thomas Haller thaller at redhat.com
Mon Nov 24 08:14:51 PST 2014


Signed-off-by: Thomas Haller <thaller at redhat.com>
---
 include/netlink/idiag/idiagnl.h | 20 ++++++++++++++------
 lib/idiag/idiag.c               | 14 +++++++-------
 2 files changed, 21 insertions(+), 13 deletions(-)

diff --git a/include/netlink/idiag/idiagnl.h b/include/netlink/idiag/idiagnl.h
index 3b3b57e..e6bc650 100644
--- a/include/netlink/idiag/idiagnl.h
+++ b/include/netlink/idiag/idiagnl.h
@@ -101,17 +101,25 @@ enum {
 #define	IDIAG_SK_MEMINFO_BACKLOG SK_MEMINFO_BACKLOG
 #define	IDIAG_SK_MEMINFO_VARS SK_MEMINFO_VARS
 
+/* deprecated names. */
+#define IDIAG_TIMER_OFF                 IDIAGNL_TIMER_OFF
+#define IDIAG_TIMER_ON                  IDIAGNL_TIMER_ON
+#define IDIAG_TIMER_KEEPALIVE           IDIAGNL_TIMER_KEEPALIVE
+#define IDIAG_TIMER_TIMEWAIT            IDIAGNL_TIMER_TIMEWAIT
+#define IDIAG_TIMER_PERSIST             IDIAGNL_TIMER_PERSIST
+#define IDIAG_TIMER_UNKNOWN             IDIAGNL_TIMER_UNKNOWN
+
 /**
  * Socket timer indentifiers
  * @ingroupd idiag
  */
 enum {
-	IDIAG_TIMER_OFF,
-	IDIAG_TIMER_ON,
-	IDIAG_TIMER_KEEPALIVE,
-	IDIAG_TIMER_TIMEWAIT,
-	IDIAG_TIMER_PERSIST,
-	IDIAG_TIMER_UNKNOWN,
+	IDIAGNL_TIMER_OFF               = 0,
+	IDIAGNL_TIMER_ON                = 1,
+	IDIAGNL_TIMER_KEEPALIVE         = 2,
+	IDIAGNL_TIMER_TIMEWAIT          = 3,
+	IDIAGNL_TIMER_PERSIST           = 4,
+	IDIAGNL_TIMER_UNKNOWN           = 5,
 };
 
 extern char *	idiagnl_state2str(int, char *, size_t);
diff --git a/lib/idiag/idiag.c b/lib/idiag/idiag.c
index 303ffea..d8f5065 100644
--- a/lib/idiag/idiag.c
+++ b/lib/idiag/idiag.c
@@ -123,17 +123,17 @@ int idiagnl_str2state(const char *name)
 }
 
 static const struct trans_tbl idiag_timers[] = {
-	__ADD(IDIAG_TIMER_OFF, off),
-	__ADD(IDIAG_TIMER_ON, on),
-	__ADD(IDIAG_TIMER_KEEPALIVE, keepalive),
-	__ADD(IDIAG_TIMER_TIMEWAIT, timewait),
-	__ADD(IDIAG_TIMER_PERSIST, persist),
-	__ADD(IDIAG_TIMER_UNKNOWN, unknown),
+	__ADD(IDIAGNL_TIMER_OFF, off),
+	__ADD(IDIAGNL_TIMER_ON, on),
+	__ADD(IDIAGNL_TIMER_KEEPALIVE, keepalive),
+	__ADD(IDIAGNL_TIMER_TIMEWAIT, timewait),
+	__ADD(IDIAGNL_TIMER_PERSIST, persist),
+	__ADD(IDIAGNL_TIMER_UNKNOWN, unknown),
 };
 
 /**
  * Convert inet diag timer types to strings.
- * @arg timer	  inetdiag timer (e.g., IDIAG_TIMER_ON)
+ * @arg timer	  inetdiag timer (e.g., IDIAGNL_TIMER_ON)
  * @arg buf	  output buffer which will hold string result
  * @arg len	  length in bytes of the output buffer
  *
-- 
1.9.3




More information about the libnl mailing list