Index: include/libnetlink.h =================================================================== RCS file: /home/gondolin/herbert/src/CVS/iproute/include/libnetlink.h,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- include/libnetlink.h 2 Jul 2004 17:53:03 -0000 1.1.1.1 +++ include/libnetlink.h 3 Jul 2004 09:34:05 -0000 1.2 @@ -15,6 +15,7 @@ }; extern int rtnl_open(struct rtnl_handle *rth, unsigned subscriptions); +extern int nl_open(struct rtnl_handle *rth, unsigned subscriptions, int proto); extern void rtnl_close(struct rtnl_handle *rth); extern int rtnl_wilddump_request(struct rtnl_handle *rth, int fam, int type); extern int rtnl_dump_request(struct rtnl_handle *rth, int type, void *req, int len); Index: lib/libnetlink.c =================================================================== RCS file: /home/gondolin/herbert/src/CVS/iproute/lib/libnetlink.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- lib/libnetlink.c 2 Jul 2004 17:53:03 -0000 1.1.1.1 +++ lib/libnetlink.c 3 Jul 2004 09:34:06 -0000 1.2 @@ -32,11 +32,16 @@ int rtnl_open(struct rtnl_handle *rth, unsigned subscriptions) { + return nl_open(rth, subscriptions, NETLINK_ROUTE); +} + +int nl_open(struct rtnl_handle *rth, unsigned subscriptions, int proto) +{ int addr_len; memset(rth, 0, sizeof(rth)); - rth->fd = socket(AF_NETLINK, SOCK_RAW, NETLINK_ROUTE); + rth->fd = socket(AF_NETLINK, SOCK_RAW, proto); if (rth->fd < 0) { perror("Cannot open netlink socket"); return -1;