@@ -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.
@@ -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;
}
}
@@ -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
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(-)