]> git.ipfire.org Git - thirdparty/systemd.git/blobdiff - src/core/loopback-setup.c
dns-domain: add code for verifying validity of DNS-SD service names and types
[thirdparty/systemd.git] / src / core / loopback-setup.c
index 67ce160c1982f9cb7084cc3e9b7898cc6d4c7c64..4a57793104e075ea9985a4d2f6c6b47c36bc55d5 100644 (file)
   along with systemd; If not, see <http://www.gnu.org/licenses/>.
 ***/
 
-#include <sys/socket.h>
 #include <net/if.h>
-#include <asm/types.h>
-#include <netinet/in.h>
-#include <string.h>
 #include <stdlib.h>
-#include <unistd.h>
 
-#include "sd-rtnl.h"
-#include "util.h"
-#include "macro.h"
-#include "socket-util.h"
-#include "rtnl-util.h"
-#include "missing.h"
+#include "sd-netlink.h"
+
 #include "loopback-setup.h"
+#include "missing.h"
+#include "netlink-util.h"
 
-static int start_loopback(sd_rtnl *rtnl) {
-        _cleanup_rtnl_message_unref_ sd_rtnl_message *req = NULL;
+static int start_loopback(sd_netlink *rtnl) {
+        _cleanup_netlink_message_unref_ sd_netlink_message *req = NULL;
         int r;
 
         r = sd_rtnl_message_new_link(rtnl, &req, RTM_SETLINK, LOOPBACK_IFINDEX);
@@ -47,15 +40,15 @@ static int start_loopback(sd_rtnl *rtnl) {
         if (r < 0)
                 return r;
 
-        r = sd_rtnl_call(rtnl, req, 0, NULL);
+        r = sd_netlink_call(rtnl, req, 0, NULL);
         if (r < 0)
                 return r;
 
         return 0;
 }
 
-static bool check_loopback(sd_rtnl *rtnl) {
-        _cleanup_rtnl_message_unref_ sd_rtnl_message *req = NULL, *reply = NULL;
+static bool check_loopback(sd_netlink *rtnl) {
+        _cleanup_netlink_message_unref_ sd_netlink_message *req = NULL, *reply = NULL;
         unsigned flags;
         int r;
 
@@ -63,7 +56,7 @@ static bool check_loopback(sd_rtnl *rtnl) {
         if (r < 0)
                 return false;
 
-        r = sd_rtnl_call(rtnl, req, 0, &reply);
+        r = sd_netlink_call(rtnl, req, 0, &reply);
         if (r < 0)
                 return false;
 
@@ -75,10 +68,10 @@ static bool check_loopback(sd_rtnl *rtnl) {
 }
 
 int loopback_setup(void) {
-        _cleanup_rtnl_unref_ sd_rtnl *rtnl = NULL;
+        _cleanup_netlink_unref_ sd_netlink *rtnl = NULL;
         int r;
 
-        r = sd_rtnl_open(&rtnl, 0);
+        r = sd_netlink_open(&rtnl);
         if (r < 0)
                 return r;