]> git.ipfire.org Git - thirdparty/lldpd.git/blobdiff - tests/check_cdp.c
travis: disable integration tests
[thirdparty/lldpd.git] / tests / check_cdp.c
index cf6ce13fb18a93a4c89393c50da1be6370cc361b..ef11218bf9a4da0d1a91aa5fcff54226cccdcc21 100644 (file)
@@ -1,4 +1,20 @@
-#define _GNU_SOURCE 1
+/* -*- mode: c; c-file-style: "openbsd" -*- */
+/*
+ * Copyright (c) 2015 Vincent Bernat <bernat@luffy.cx>
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
 #include <stdlib.h>
 #include <sys/socket.h>
 #include <arpa/inet.h>
@@ -91,6 +107,11 @@ Cisco Discovery Protocol
        struct packet *pkt;
        in_addr_t addr;
        struct lldpd_mgmt *mgmt;
+       struct lldpd cfg = {
+               .g_config = {
+                       .c_platform = "Linux"
+               }
+       };
 
        /* Populate port and chassis */
        hardware.h_lport.p_id_subtype = LLDP_PORTID_SUBTYPE_IFNAME;
@@ -112,7 +133,7 @@ Cisco Discovery Protocol
        TAILQ_INSERT_TAIL(&chassis.c_mgmt, mgmt, m_entries);
 
        /* Build packet */
-       n = cdpv1_send(NULL, &hardware);
+       n = cdpv1_send(&cfg, &hardware);
        if (n != 0) {
                fail("unable to build packet");
                return;
@@ -220,6 +241,11 @@ Cisco Discovery Protocol
        in_addr_t addr2;
        struct lldpd_mgmt *mgmt1;
        struct lldpd_mgmt *mgmt2;
+       struct lldpd cfg = {
+               .g_config = {
+                       .c_platform = "Linux"
+               }
+       };
 
        /* Populate port and chassis */
        hardware.h_lport.p_id_subtype = LLDP_PORTID_SUBTYPE_LLADDR;
@@ -246,7 +272,7 @@ Cisco Discovery Protocol
        TAILQ_INSERT_TAIL(&chassis.c_mgmt, mgmt2, m_entries);
 
        /* Build packet */
-       n = cdpv2_send(NULL, &hardware);
+       n = cdpv2_send(&cfg, &hardware);
        if (n != 0) {
                fail("unable to build packet");
                return;