* License as published by the Free Software Foundation version 2.1
* of the License.
*
- * Copyright (c) 2003-2008 Thomas Graf <tgraf@suug.ch>
+ * Copyright (c) 2003-2010 Thomas Graf <tgraf@suug.ch>
*/
#ifndef NETLINK_ADDR_H_
extern int nl_addr_parse(const char *, int, struct nl_addr **);
extern struct nl_addr * nl_addr_clone(struct nl_addr *);
-/* Destroyage */
-extern void nl_addr_destroy(struct nl_addr *);
-
/* Usage Management */
extern struct nl_addr * nl_addr_get(struct nl_addr *);
extern void nl_addr_put(struct nl_addr *);
* License as published by the Free Software Foundation version 2.1
* of the License.
*
- * Copyright (c) 2003-2008 Thomas Graf <tgraf@suug.ch>
+ * Copyright (c) 2003-2010 Thomas Graf <tgraf@suug.ch>
*/
/**
return 1;
}
+static void addr_destroy(struct nl_addr *addr)
+{
+ if (!addr)
+ return;
+
+ if (addr->a_refcnt != 1)
+ BUG();
+
+ free(addr);
+}
+
/**
* @name Creating Abstract Addresses
* @{
char *p;
long pl = strtol(++prefix, &p, 0);
if (p == prefix) {
- nl_addr_destroy(addr);
+ addr_destroy(addr);
err = -NLE_INVAL;
goto errout;
}
/** @} */
-/**
- * @name Destroying Abstract Addresses
- * @{
- */
-
-/**
- * Destroy abstract address object.
- * @arg addr Abstract address object.
- */
-void nl_addr_destroy(struct nl_addr *addr)
-{
- if (!addr)
- return;
-
- if (addr->a_refcnt != 1)
- BUG();
-
- free(addr);
-}
-
-/** @} */
-
/**
* @name Managing Usage References
* @{
return;
if (addr->a_refcnt == 1)
- nl_addr_destroy(addr);
+ addr_destroy(addr);
else
addr->a_refcnt--;
}