All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Add nl_open to libnetlink
@ 2004-07-03  9:46 Herbert Xu
  2004-07-05  7:05 ` Masahide NAKAMURA
  0 siblings, 1 reply; 15+ messages in thread
From: Herbert Xu @ 2004-07-03  9:46 UTC (permalink / raw)
  To: Stephen Hemminger, netdev

[-- Attachment #1: Type: text/plain, Size: 518 bytes --]

Hi Stephen:

I'm in the process of writing two new modules fo ip(8), ippolicy and
ipstate which will be a NETLINK based replacement for setkey.

In order to do so, I need to get libnetlink to speak the XFRM protocol.
Thus I've added a new nl_open function which allows the protocol to
be specified.

Cheers,
-- 
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmV>HI~} <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

[-- Attachment #2: p --]
[-- Type: text/plain, Size: 1548 bytes --]

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;

^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2004-07-16 23:05 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-07-03  9:46 [PATCH] Add nl_open to libnetlink Herbert Xu
2004-07-05  7:05 ` Masahide NAKAMURA
2004-07-05  8:07   ` Herbert Xu
2004-07-06 21:05   ` Stephen Hemminger
2004-07-07  4:09     ` Masahide NAKAMURA
2004-07-07  5:05       ` Masahide NAKAMURA
2004-07-07  6:56         ` Masahide NAKAMURA
2004-07-07 11:03           ` Herbert Xu
2004-07-09  3:51             ` Masahide NAKAMURA
2004-07-15  6:02               ` [PATCH 1/3] iproute2 and xfrm Masahide NAKAMURA
2004-07-16 22:22                 ` Stephen Hemminger
     [not found]               ` <20040714174233.2fc7dbc2@localhost>
2004-07-15  6:02                 ` [PATCH 2/3] " Masahide NAKAMURA
2004-07-16 23:05                   ` Herbert Xu
     [not found]               ` <20040714174637.0ce79ae1@localhost>
2004-07-15  6:02                 ` [PATCH 3/3] " Masahide NAKAMURA
2004-07-07 18:08           ` [PATCH] Add nl_open to libnetlink Stephen Hemminger

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.