diff mbox

[v2,4/4] net: Remove remainders of the MTFTP code

Message ID 1465547612-2529-5-git-send-email-thuth@redhat.com
State Accepted
Headers show

Commit Message

Thomas Huth June 10, 2016, 8:33 a.m. UTC
The separate mtftp.h and mtftp.c files (for doing multicast TFTP)
never really got included into the SLOF repository, so it does
not make sense to keep the "#ifdef USE_MTFTP" code snippets around.

Signed-off-by: Thomas Huth <thuth@redhat.com>
---
 lib/libnet/dhcp.h |  7 +------
 lib/libnet/udp.c  | 38 --------------------------------------
 lib/libnet/udp.h  |  5 -----
 3 files changed, 1 insertion(+), 49 deletions(-)
diff mbox

Patch

diff --git a/lib/libnet/dhcp.h b/lib/libnet/dhcp.h
index 645fdd1..4432c9b 100644
--- a/lib/libnet/dhcp.h
+++ b/lib/libnet/dhcp.h
@@ -14,12 +14,7 @@ 
 #define _DHCP_H_
 
 #include <stdint.h>
-
-#ifdef USE_MTFTP
-#include <mtftp.h>
-#else
-#include <tftp.h>
-#endif
+#include "tftp.h"
 
 /** \struct btphdr
  *  A header for BootP/DHCP-messages.
diff --git a/lib/libnet/udp.c b/lib/libnet/udp.c
index 1203947..d6982ea 100644
--- a/lib/libnet/udp.c
+++ b/lib/libnet/udp.c
@@ -17,34 +17,9 @@ 
 #include <dhcp.h>
 #include <dhcpv6.h>
 #include <dns.h>
-#ifdef USE_MTFTP
-#include <mtftp.h>
-#else
 #include <tftp.h>
-#endif
 
 
-
-/****************************** LOCAL VARIABLES **************************/
-
-
-#ifdef USE_MTFTP
-
-uint16_t net_tftp_uport;
-uint16_t net_mtftp_uport;
-
-void net_set_tftp_port(uint16_t tftp_port)
-{
-	net_tftp_uport = tftp_port;
-}
-
-void net_set_mtftp_port(uint16_t tftp_port)
-{
-	net_mtftp_uport = tftp_port;
-}
-
-#endif
-
 /****************************** IMPLEMENTATION ***************************/
 
 
@@ -82,21 +57,8 @@  int8_t handle_udp(int fd, uint8_t * udp_packet, uint32_t packetsize)
 		return handle_dhcpv6(udp_packet+sizeof(struct udphdr),
 		                     packetsize - sizeof(struct udphdr));
 	case UDPPORT_TFTPC:
-#ifdef USE_MTFTP
-		return handle_tftp(fd, udp_packet + sizeof(struct udphdr),
-			               packetsize - sizeof(struct udphdr));
-#else
 		return handle_tftp(fd, udp_packet, packetsize);
-#endif
 	default:
-#ifdef USE_MTFTP
-		if (htons(udph -> uh_dport) == net_tftp_uport)
-			return handle_tftp(fd, udp_packet + sizeof(struct udphdr),
-                       packetsize - sizeof(struct udphdr));
-		else if (htons(udph -> uh_dport) == net_mtftp_uport)
-			return handle_tftp(fd, udp_packet + sizeof(struct udphdr),
-                       packetsize - sizeof(struct udphdr));
-#endif
 		return -1;
 	}
 }
diff --git a/lib/libnet/udp.h b/lib/libnet/udp.h
index f154542..e716e04 100644
--- a/lib/libnet/udp.h
+++ b/lib/libnet/udp.h
@@ -50,9 +50,4 @@  extern void handle_udp_dun(uint8_t * udp_packet, uint32_t packetsize, uint8_t er
 extern void fill_udphdr(uint8_t *packet, uint16_t packetsize,
                         uint16_t src_port, uint16_t dest_port);
 
-#ifdef USE_MTFTP
-extern void net_set_tftp_port(uint16_t tftp_port);
-extern void net_set_mtftp_port(uint16_t tftp_port);
-#endif
-
 #endif