LOCAL_SITES := $(addprefix raddb/sites-enabled/,$(DEFAULT_SITES))
DEFAULT_MODULES := always attr_filter cache_eap chap client \
- detail detail.log digest dhcp eap \
+ detail detail.log digest dhcpv4 eap \
eap_inner echo exec expiration expr files linelog logintime \
mschap ntlm_auth pam pap passwd preprocess radutmp realm \
replicate soh sradutmp unix unpack utf8
# * Alcatel lucent SR - Alc-ToServer-Dhcp-Options
# - Alc-ToClient-Dhcp-Options
#
-dhcp {
+dhcpv4 {
}
/**
* $Id$
*
- * @file udp.c
+ * @file util/udp.c
* @brief Functions to send/receive UDP packets.
*
* @copyright 2000-2003,2006 The FreeRADIUS server project
#ifdef HAVE_LIBPCAP
static fr_pcap_t *pcap;
-static uint8_t eth_bcast[ETH_ADDR_LEN] = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff };
#endif
static char *iface = NULL;
#ifdef HAVE_LINUX_IF_PACKET_H
if (raw_mode) {
- sockfd = fr_dhcpv4_raw_socket_open(iface_ind, &ll);
+ sockfd = fr_dhcpv4_raw_socket_open(&ll, iface_ind);
if (sockfd < 0) {
ERROR("Error opening socket");
return -1;
sprintf(pcap_filter, "udp and dst port %d", request->src_port);
if (fr_pcap_apply_filter(pcap, pcap_filter) < 0) {
- ERROR("dhcoclient: Failed setting filter for interface");
+ ERROR("Failing setting filter");
talloc_free(pcap);
return -1;
}
if (fr_dhcpv4_pcap_send(pcap, eth_bcast, request) < 0) {
- ERROR("Failed sending packet via PCAP: %s", pcap_geterr(pcap->handle));
+ ERROR("Failed sending packet");
talloc_free(pcap);
return -1;
}
TARGET := dhcpclient
SOURCES := dhcpclient.c
-TGT_PREREQS := libfreeradius-dhcpv4.a
+TGT_PREREQS := libfreeradius-util.a libfreeradius-dhcpv4.a
TGT_LDLIBS := $(LIBS)
* a lot cleaner to do so, and a pointer to the structure can
* be used as the instance handle.
*/
-typedef struct rlm_dhcp_t {
+typedef struct rlm_dhcpv4_t {
int nothing;
-} rlm_dhcp_t;
+} rlm_dhcpv4_t;
/*
*/
static int mod_bootstrap(void *instance, UNUSED CONF_SECTION *conf)
{
- rlm_dhcp_t *inst = instance;
+ rlm_dhcpv4_t *inst = instance;
fr_dict_attr_t const *da;
xlat_register(inst, "dhcp_options", dhcp_options_xlat, NULL, NULL, 0, XLAT_DEFAULT_BUF_LEN);
* is single-threaded.
*/
extern rad_module_t rlm_dhcp;
-rad_module_t rlm_dhcp = {
+rad_module_t rlm_dhcpv4 = {
.magic = RLM_MODULE_INIT,
- .name = "dhcp",
- .inst_size = sizeof(rlm_dhcp_t),
+ .name = "dhcpv4",
+ .inst_size = sizeof(rlm_dhcpv4_t),
.load = dhcp_load,
.bootstrap = mod_bootstrap,
udp.c
SRC_CFLAGS := -I$(top_builddir)/src
-
+TGT_LDLIBS := $(PCAP_LIBS)
+TGT_LDFLAGS := $(PCAP_LDFLAGS)
TGT_PREREQS := libfreeradius-util.a
/**
* $Id$
*
- * @file dhcpv4/base.c
+ * @file protocols/dhcpv4/base.c
* @brief Functions to send/receive dhcp packets.
*
* @copyright 2008 The FreeRADIUS server project
DHCP_FILE_LEN /* file */
};
+uint8_t eth_bcast[ETH_ADDR_LEN] = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff };
+
fr_dict_attr_t const *dhcp_option_82;
int8_t fr_dhcpv4_attr_cmp(void const *a, void const *b)
/**
* $Id$
*
- * @file dhcpv4/decode.c
+ * @file protocols/dhcpv4/decode.c
* @brief Functions to decode DHCP options.
*
* @copyright 2008,2017 The FreeRADIUS server project
/**
* $Id$
*
- * @file dhcpv4/dhcpv4.h
+ * @file protocols/dhcpv4/dhcpv4.h
* @brief Implementation of the DHCPv4 protocol.
*
* @copyright 2008 The FreeRADIUS server project
extern char const *dhcp_header_names[];
extern char const *dhcp_message_types[];
extern int dhcp_header_sizes[];
+extern uint8_t eth_bcast[ETH_ADDR_LEN];
extern fr_dict_attr_t const *dhcp_option_82;
#ifdef HAVE_LINUX_IF_PACKET_H
# define ETH_HDR_SIZE 14
-static uint8_t eth_bcast[ETH_ADDR_LEN] = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff };
-
/* Discard raw packets which we are not interested in. Allow to trace why we discard. */
# define DISCARD_RP(...) { \
if (fr_debug_lvl > 2) { \
* raw.c
*/
#include <linux/if_packet.h>
-int fr_dhcpv4_raw_socket_open(int iface_index, struct sockaddr_ll *p_ll);
+int fr_dhcpv4_raw_socket_open(struct sockaddr_ll *p_ll, int iface_index);
int fr_dhcpv4_raw_packet_send(int sockfd, struct sockaddr_ll *p_ll, RADIUS_PACKET *packet);
/**
* $Id$
*
- * @file dhcpv4/encode.c
+ * @file protocols/dhcpv4/encode.c
* @brief Functions to encode DHCP options.
*
* @copyright 2008,2017 The FreeRADIUS server project
/**
* $Id$
*
- * @file dhcpv4/packet.c
+ * @file protocols/dhcpv4/packet.c
* @brief Functions to encode/decode DHCP packets.
*
* @copyright 2008,2017 The FreeRADIUS server project
/**
* $Id$
*
- * @file dhcpv4/pcap.c
+ * @file protocols/dhcpv4/pcap.c
* @brief Alternative mechanism to send/recv DHCP packets using libpcap.
*
* @copyright 2008,2017 The FreeRADIUS server project
/**
* $Id$
*
- * @file dhcpv4/raw.c
+ * @file protocols/dhcpv4/raw.c
* @brief Send/recv DHCP packets using raw sockets.
*
* @copyright 2008,2017 The FreeRADIUS server project
/**
* $Id$
*
- * @file dhcpv4/udp.c
+ * @file protocols/dhcpv4/udp.c
* @brief Send/recv DHCP packets using udp sockets.
*
* @copyright 2008,2017 The FreeRADIUS server project
/**
* $Id$
*
- * @file base.c
+ * @file protocols/radius/base.c
* @brief Functions to send/receive radius packets.
*
* @copyright 2000-2003,2006 The FreeRADIUS server project
/**
* $Id$
*
- * @file decode.c
+ * @file protocols/radius/decode.c
* @brief Functions to decode RADIUS attributes
*
* @copyright 2000-2003,2006-2015 The FreeRADIUS server project
/**
* $Id$
*
- * @file encode.c
+ * @file protocols/radius/encode.c
* @brief Functions to encode RADIUS attributes
*
* @copyright 2000-2003,2006-2015 The FreeRADIUS server project
/**
* $Id$
*
- * @file list.c
+ * @file protocols/radius/list.c
* @brief Functions to deal with outgoing lists / sets of packets.
*
* @copyright 2000-2017 The FreeRADIUS server project
/**
* $Id$
*
- * @file packet.c
+ * @file protocols/radius/packet.c
* @brief Functions to deal with RADIUS_PACKET data structures.
*
* @copyright 2000-2017 The FreeRADIUS server project
*/
-
RCSID("$Id$")
#include <freeradius-devel/libradius.h>
/*
* $Id$
*
- * @file radius/radius.h
+ * @file protocols/radius/radius.h
* @brief Structures and prototypes for base RADIUS functionality.
*
* @copyright 1999-2017 The FreeRADIUS server project
/*
- * tcp.c TCP-specific functions.
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
*
- * Version: $Id$
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
*
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/**
+ * $Id$
*
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ * @file protocols/radius/packet.c
+ * @brief TCP-specific functions.
*
- * Copyright (C) 2009 Dante http://dante.net
+ * @copyright (C) 2009 Dante http://dante.net
*/
-
RCSID("$Id$")
-#include <freeradius-devel/libradius.h>
+#include <freeradius-devel/libradius.h>
#ifdef WITH_TCP
return packet;
}
-
/*
* Receives a packet, assuming that the RADIUS_PACKET structure
* has been filled out already.