aboutsummaryrefslogtreecommitdiff
path: root/lib/libnet
diff options
context:
space:
mode:
authorThomas Huth <thuth@redhat.com>2016-06-10 10:33:32 +0200
committerAlexey Kardashevskiy <aik@ozlabs.ru>2016-06-27 12:31:06 +1000
commit2435442ede44f2236ccdfec0a3704ab19cafb105 (patch)
tree117a49b1a44be5aa1327f4fd9fb43f0d91341cea /lib/libnet
parente7ac2e5f658831ca686badb8530b0160b827d800 (diff)
downloadSLOF-2435442ede44f2236ccdfec0a3704ab19cafb105.zip
SLOF-2435442ede44f2236ccdfec0a3704ab19cafb105.tar.gz
SLOF-2435442ede44f2236ccdfec0a3704ab19cafb105.tar.bz2
net: Remove remainders of the MTFTP code
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> Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
Diffstat (limited to 'lib/libnet')
-rw-r--r--lib/libnet/dhcp.h7
-rw-r--r--lib/libnet/udp.c38
-rw-r--r--lib/libnet/udp.h5
3 files changed, 1 insertions, 49 deletions
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