]> git.ipfire.org Git - thirdparty/libnl.git/commitdiff
Consistent naming of socket functions
authorThomas Graf <tgr@plip.localdomain>
Wed, 10 Dec 2008 17:00:11 +0000 (18:00 +0100)
committerThomas Graf <tgr@plip.localdomain>
Wed, 10 Dec 2008 17:00:11 +0000 (18:00 +0100)
include/netlink/socket.h
lib/socket.c

index 5eefa083c558646e026d6f23e3db5bcc66d21356..4c0589d25a3c34cf1ccc9e1a71e11b2c7d673714 100644 (file)
@@ -22,55 +22,45 @@ extern "C" {
 /* backwards compatibility for now */
 #define nl_handle      nl_sock
 
-extern struct nl_sock *                nl_socket_alloc(void);
-extern struct nl_sock *                nl_socket_alloc_cb(struct nl_cb *);
-extern void                    nl_socket_free(struct nl_sock *);
+extern struct nl_sock *        nl_socket_alloc(void);
+extern struct nl_sock *        nl_socket_alloc_cb(struct nl_cb *);
+extern void            nl_socket_free(struct nl_sock *);
 
-extern uint32_t                        nl_socket_get_local_port(struct nl_sock *);
-extern void                    nl_socket_set_local_port(struct nl_sock *,
-                                                        uint32_t);
+extern uint32_t                nl_socket_get_local_port(struct nl_sock *);
+extern void            nl_socket_set_local_port(struct nl_sock *, uint32_t);
 
-extern int                     nl_socket_add_memberships(struct nl_sock *,
-                                                        int, ...);
-extern int                     nl_socket_drop_memberships(struct nl_sock *,
-                                                         int, ...);
-extern void                    nl_join_groups(struct nl_sock *, int);
+extern int             nl_socket_add_memberships(struct nl_sock *, int, ...);
+extern int             nl_socket_add_membership(struct nl_sock *, int);
+extern int             nl_socket_drop_memberships(struct nl_sock *, int, ...);
+extern int             nl_socket_drop_membership(struct nl_sock *,
+                                                         int);
+extern void            nl_join_groups(struct nl_sock *, int);
 
-static inline int nl_socket_add_membership(struct nl_sock *sk, int group) {
-       return nl_socket_add_memberships(sk, group, 0);
-}
-
-static inline int nl_socket_drop_membership(struct nl_sock *sk, int group) {
-       return nl_socket_drop_memberships(sk, group, 0);
-}
 
-extern uint32_t                        nl_socket_get_peer_port(struct nl_sock *);
-extern void                    nl_socket_set_peer_port(struct nl_sock *,
+extern uint32_t                nl_socket_get_peer_port(struct nl_sock *);
+extern void            nl_socket_set_peer_port(struct nl_sock *,
                                                        uint32_t);
 
-extern struct nl_cb *          nl_socket_get_cb(struct nl_sock *);
-extern void                    nl_socket_set_cb(struct nl_sock *,
+extern struct nl_cb *  nl_socket_get_cb(struct nl_sock *);
+extern void            nl_socket_set_cb(struct nl_sock *,
                                                 struct nl_cb *);
-extern int                     nl_socket_modify_cb(struct nl_sock *,
-                                                   enum nl_cb_type,
-                                                   enum nl_cb_kind,
-                                                   nl_recvmsg_msg_cb_t,
-                                                   void *);
-
-extern int                     nl_set_buffer_size(struct nl_sock *,
-                                                  int, int);
-extern int                     nl_set_passcred(struct nl_sock *, int);
-extern int                     nl_socket_recv_pktinfo(struct nl_sock *, int);
-
-extern void                    nl_disable_sequence_check(struct nl_sock *);
-extern unsigned int            nl_socket_use_seq(struct nl_sock *);
-extern void                    nl_socket_disable_auto_ack(struct nl_sock *);
-extern void                    nl_socket_enable_auto_ack(struct nl_sock *);
-
-extern int                     nl_socket_get_fd(struct nl_sock *);
-extern int                     nl_socket_set_nonblocking(struct nl_sock *);
-extern void                    nl_socket_enable_msg_peek(struct nl_sock *);
-extern void                    nl_socket_disable_msg_peek(struct nl_sock *);
+extern int             nl_socket_modify_cb(struct nl_sock *, enum nl_cb_type,
+                                           enum nl_cb_kind,
+                                           nl_recvmsg_msg_cb_t, void *);
+
+extern int             nl_socket_set_buffer_size(struct nl_sock *, int, int);
+extern int             nl_socket_set_passcred(struct nl_sock *, int);
+extern int             nl_socket_recv_pktinfo(struct nl_sock *, int);
+
+extern void            nl_socket_disable_seq_check(struct nl_sock *);
+extern unsigned int    nl_socket_use_seq(struct nl_sock *);
+extern void            nl_socket_disable_auto_ack(struct nl_sock *);
+extern void            nl_socket_enable_auto_ack(struct nl_sock *);
+
+extern int             nl_socket_get_fd(struct nl_sock *);
+extern int             nl_socket_set_nonblocking(struct nl_sock *);
+extern void            nl_socket_enable_msg_peek(struct nl_sock *);
+extern void            nl_socket_disable_msg_peek(struct nl_sock *);
 
 #ifdef __cplusplus
 }
index 1fcf17dcdfb7d75ea51e8f7d76ff15d55eeb9f88..2cebf2795996eda8cb0094ec4f5a974b0ca860c6 100644 (file)
@@ -185,7 +185,7 @@ static int noop_seq_check(struct nl_msg *msg, void *arg)
  * @note This function modifies the NL_CB_SEQ_CHECK configuration in
  * the callback handle associated with the socket.
  */
-void nl_disable_sequence_check(struct nl_sock *sk)
+void nl_socket_disable_seq_check(struct nl_sock *sk)
 {
        nl_cb_set(sk->s_cb, NL_CB_SEQ_CHECK,
                  NL_CB_CUSTOM, noop_seq_check, NULL);
@@ -316,6 +316,11 @@ int nl_socket_add_memberships(struct nl_sock *sk, int group, ...)
        return 0;
 }
 
+int nl_socket_add_membership(struct nl_sock *sk, int group)
+{
+       return nl_socket_add_memberships(sk, group, 0);
+}
+
 /**
  * Leave groups
  * @arg sk             Netlink socket
@@ -355,6 +360,12 @@ int nl_socket_drop_memberships(struct nl_sock *sk, int group, ...)
        return 0;
 }
 
+int nl_socket_drop_membership(struct nl_sock *sk, int group)
+{
+       return nl_socket_drop_memberships(sk, group, 0);
+}
+
+
 /**
  * Join multicast groups (deprecated)
  * @arg sk             Netlink socket.
@@ -489,7 +500,7 @@ int nl_socket_modify_cb(struct nl_sock *sk, enum nl_cb_type type,
  * @note It is not required to call this function prior to nl_connect().
  * @return 0 on sucess or a negative error code.
  */
-int nl_set_buffer_size(struct nl_sock *sk, int rxbuf, int txbuf)
+int nl_socket_set_buffer_size(struct nl_sock *sk, int rxbuf, int txbuf)
 {
        int err;
 
@@ -524,7 +535,7 @@ int nl_set_buffer_size(struct nl_sock *sk, int rxbuf, int txbuf)
  *
  * @return 0 on success or a negative error code
  */
-int nl_set_passcred(struct nl_sock *sk, int state)
+int nl_socket_set_passcred(struct nl_sock *sk, int state)
 {
        int err;