From patchwork Fri Jun 10 08:33:32 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Huth X-Patchwork-Id: 633577 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [103.22.144.68]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3rQwSC3BWNz9sDC for ; Fri, 10 Jun 2016 18:33:47 +1000 (AEST) Received: from ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 3rQwSC2GfwzDqVv for ; Fri, 10 Jun 2016 18:33:47 +1000 (AEST) X-Original-To: slof@lists.ozlabs.org Delivered-To: slof@lists.ozlabs.org Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 3rQwS42n9pzDqPD for ; Fri, 10 Jun 2016 18:33:40 +1000 (AEST) Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id C10B2B8BBB for ; Fri, 10 Jun 2016 08:33:38 +0000 (UTC) Received: from thh440s.fritz.box (vpn1-6-25.ams2.redhat.com [10.36.6.25]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u5A8XXTj002623 for ; Fri, 10 Jun 2016 04:33:38 -0400 From: Thomas Huth To: slof@lists.ozlabs.org Date: Fri, 10 Jun 2016 10:33:32 +0200 Message-Id: <1465547612-2529-5-git-send-email-thuth@redhat.com> In-Reply-To: <1465547612-2529-1-git-send-email-thuth@redhat.com> References: <1465547612-2529-1-git-send-email-thuth@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Fri, 10 Jun 2016 08:33:38 +0000 (UTC) Subject: [SLOF] [PATCH v2 4/4] net: Remove remainders of the MTFTP code X-BeenThere: slof@lists.ozlabs.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "Patches for https://github.com/aik/SLOF" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: slof-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "SLOF" 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 --- lib/libnet/dhcp.h | 7 +------ lib/libnet/udp.c | 38 -------------------------------------- lib/libnet/udp.h | 5 ----- 3 files changed, 1 insertion(+), 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 - -#ifdef USE_MTFTP -#include -#else -#include -#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 #include #include -#ifdef USE_MTFTP -#include -#else #include -#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