[lldp-devel] [PATCH 2/2] llpd remove function l2_packet_get_port_state

Thomas Richter tmricht at linux.vnet.ibm.com
Tue Mar 12 10:59:43 UTC 2013


Remove unneeded function. It is not referenced anymore.

Signed-off-by: Thomas Richter <tmricht at linux.vnet.ibm.com>
---
 lldp/l2_packet.h       |  2 --
 lldp/l2_packet_linux.c | 26 --------------------------
 2 files changed, 28 deletions(-)

diff --git a/lldp/l2_packet.h b/lldp/l2_packet.h
index 8ad363a..737ae54 100644
--- a/lldp/l2_packet.h
+++ b/lldp/l2_packet.h
@@ -128,6 +128,4 @@ void l2_packet_get_remote_addr(struct l2_packet_data *l2, u8 *addr);
 int l2_packet_send(struct l2_packet_data *l2, const u8 *dst_addr, u16 proto,
 			const u8 *buf, size_t len);
 
-void l2_packet_get_port_state(struct l2_packet_data *, u8 *);
-
 #endif /* L2_PACKET_H */
diff --git a/lldp/l2_packet_linux.c b/lldp/l2_packet_linux.c
index f7d6d95..a5fe8bf 100644
--- a/lldp/l2_packet_linux.c
+++ b/lldp/l2_packet_linux.c
@@ -282,29 +282,3 @@ void l2_packet_deinit(struct l2_packet_data *l2)
 		
 	free(l2);
 }
-
-void l2_packet_get_port_state(struct l2_packet_data *l2, u8  *portEnabled)
-{
-
-	int s;
-	struct ifreq ifr;
-
-	s = socket(PF_INET, SOCK_DGRAM, 0);
-	if (s < 0) {
-		perror("socket");
-		return;
-	}
-	memset(&ifr, 0, sizeof(ifr));
-	strncpy(ifr.ifr_name, l2->ifname, sizeof(ifr.ifr_name));
-
-	if (ioctl(s, SIOCGIFFLAGS, &ifr) < 0) {
-		perror("ioctl[SIOCGIFFLAGS]");
-		close(s);
-		*portEnabled = 0;
-		return;
-	}
-		
-	*portEnabled = ifr.ifr_flags & IFF_UP;
-	close(s);
-	return;
-}
-- 
1.8.1.4



More information about the lldp-devel mailing list