+int sd_rtnl_open_fd(sd_rtnl **ret, int fd, unsigned n_groups, ...) {
+ va_list ap;
+ int r;
+
+ va_start(ap, n_groups);
+ r = rtnl_open_fd_ap(ret, fd, n_groups, ap);
+ va_end(ap);
+
+ return r;
+}
+
+int sd_rtnl_open(sd_rtnl **ret, unsigned n_groups, ...) {
+ va_list ap;
+ int fd, r;
+
+ fd = socket(PF_NETLINK, SOCK_RAW|SOCK_CLOEXEC|SOCK_NONBLOCK, NETLINK_ROUTE);
+ if (fd < 0)
+ return -errno;
+
+ va_start(ap, n_groups);
+ r = rtnl_open_fd_ap(ret, fd, n_groups, ap);
+ va_end(ap);
+
+ if (r < 0) {
+ safe_close(fd);
+ return r;
+ }
+
+ return 0;
+}
+
+int sd_rtnl_inc_rcvbuf(const sd_rtnl *const rtnl, const int size) {
+ return fd_inc_rcvbuf(rtnl->fd, size);
+}
+