nl: improve nl_sendto() docs and error checks

Make nl_sendto() return NLE_INVAL if provided buffer is NULL
and make it return NLE_BAD_SOCK if the socket is not connected.

Add note in docs about lack of NL_CB_MSG_OUT invokation
doc: increase dot max graph nodes to 100
nl: improve API doc of transmit functions

Signed-off-by: Thomas Graf <tgraf@redhat.com>
nl: Allow to overwrite nl_send()

Up to now only calls to nl_send_auto() could be overwritten with
nl_cb_overwrite_send(). This patch extends the capability to
nl_send()

Signed-off-by: Thomas Graf <tgraf@redhat.com>
nl: Improve API doc of nl_connect() and nl_close()

Signed-off-by: Thomas Graf <tgraf@redhat.com>
nl: Improve API doc of nl_send_simple()

Signed-off-by: Thomas Graf <tgraf@redhat.com>
Add hash function

This patch adds a hash function for hashing libnl objects.

This hash function is from:
http://ccodearchive.net/info/hash.html

The original code was modified to remove unwanted dependencies,
unwanted code and fixes to header file locations

One requirement with this hash function is, hashing over multiple fields of an
un-packed struct requires that the struct be zeroed, otherwise random padding
bytes will change the hash.

Signed-off-by: Shrijeet Mukherjee <shm@cumulusnetworks.com>
Signed-off-by: Nolan Leake <nolan@cumulusnetworks.com>
Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
Reviewed-by: Wilson Kok <wkok@cumulusnetworks.com>
Signed-off-by: Thomas Graf <tgraf@suug.ch>
Add nl hashtable structures and access functions

This patch adds the required structures and access functions to create
and manage hashtables for netlink cache objects

Signed-off-by: Shrijeet Mukherjee <shm@cumulusnetworks.com>
Signed-off-by: Nolan Leake <nolan@cumulusnetworks.com>
Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
Reviewed-by: Wilson Kok <wkok@cumulusnetworks.com>
Signed-off-by: Thomas Graf <tgraf@suug.ch>
Add hash support in cache mngr

This patch adds support to create, delete modify hash table for a cache

Signed-off-by: Shrijeet Mukherjee <shm@cumulusnetworks.com>
Signed-off-by: Nolan Leake <nolan@cumulusnetworks.com>
Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
Reviewed-by: Wilson Kok <wkok@cumulusnetworks.com>
Signed-off-by: Thomas Graf <tgraf@suug.ch>
Add hash support to link cache

This patch adds keygen function to link cache

Signed-off-by: Shrijeet Mukherjee <shm@cumulusnetworks.com>
Signed-off-by: Nolan Leake <nolan@cumulusnetworks.com>
Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
Reviewed-by: Wilson Kok <wkok@cumulusnetworks.com>
Signed-off-by: Thomas Graf <tgraf@suug.ch>
Add hash support to neigh cache

This patch adds keygen function to the neigh object

Signed-off-by: Shrijeet Mukherjee <shm@cumulusnetworks.com>
Signed-off-by: Nolan Leake <nolan@cumulusnetworks.com>
Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
Reviewed-by: Wilson Kok <wkok@cumulusnetworks.com>
Signed-off-by: Thomas Graf <tgraf@suug.ch>
Add hash support to route cache

This patch adds keygen function to route object

Signed-off-by: Shrijeet Mukherjee <shm@cumulusnetworks.com>
Signed-off-by: Nolan Leake <nolan@cumulusnetworks.com>
Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
Reviewed-by: Wilson Kok <wkok@cumulusnetworks.com>
Signed-off-by: Thomas Graf <tgraf@suug.ch>
Hash: Properly prefix hash functions

Do not pollute public namespace with unprefixed functions.

Signed-off-by: Thomas Graf <tgraf@suug.ch>
hashtable: Add API reference documentation

Signed-off-by: Thomas Graf <tgraf@suug.ch>
hashtable: Fix reference leak in nl_hashtable_free()

The reference counter of the linked object must be dec'ed
before freeing the node or the reference is leaked.

Signed-off-by: Thomas Graf <tgraf@suug.ch>
hashtable: remove doc section crashing doxygen

Signed-off-by: Thomas Graf <tgraf@suug.ch>
doc: update Doxygen layout file to latest format

Sigend-off-by: Thomas Graf <tgraf@suug.ch>
addr: Return -NLE_AF_NOSUPPORT when trying to set unsupported attributes

- multicast and anycast address only supported with IPv6
- brodcast address only supported with IPv4

Signed-off-by: Thomas Graf <tgraf@suug.ch>
addr: rtnl_addr_set_peer() is limited to IPv4

Signed-off-by: Thomas Graf <tgraf@suug.ch>
doc: Revert to default stylesheet

Use of a custom stylesheet breaks with almost every release of doxygen
and is thus completely unuseable.

Signed-off-by: Thomas Graf <tgraf@suug.ch>