-// Copyright (C) 2011-2014 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2011-2015 Internet Systems Consortium, Inc. ("ISC")
//
// Permission to use, copy, modify, and/or distribute this software for any
// purpose with or without fee is hereby granted, provided that the above
using namespace isc;
using namespace isc::data;
-//using namespace isc::config;
using namespace isc::test;
using namespace isc::asiolink;
using namespace isc::dhcp;
-// Copyright (C) 2013-2014 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2013-2015 Internet Systems Consortium, Inc. ("ISC")
//
// Permission to use, copy, modify, and/or distribute this software for any
// purpose with or without fee is hereby granted, provided that the above
using namespace isc;
using namespace isc::data;
-//using namespace isc::config;
using namespace isc::test;
using namespace isc::asiolink;
using namespace isc::dhcp;
/*
- * Copyright (c) 2004-2011, 2014 by Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (c) 2004-2011, 2014-2015 by Internet Systems Consortium, Inc. ("ISC")
* Copyright (c) 1995-2003 by Internet Software Consortium
*
* Permission to use, copy, modify, and distribute this software for any
/* Possible values for hardware type (htype) field... */
enum HType {
HTYPE_ETHER = 1, /* Ethernet 10Mbps */
- HTYPE_DOCSIS = 1, /* the traffic captures we have from cable modems as well
+ HTYPE_DOCSIS = 1, /* The traffic captures we have from cable modems as well
as this list by IANA: http://www.iana.org/assignments/
arp-parameters/arp-parameters.xhtml suggest that
Ethernet (1) should be used in DOCSIS environment. */
-// Copyright (C) 2014 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2014-2015 Internet Systems Consortium, Inc. ("ISC")
//
// Permission to use, copy, modify, and/or distribute this software for any
// purpose with or without fee is hereby granted, provided that the above
Pkt::getMAC(uint32_t hw_addr_src) {
HWAddrPtr mac;
+ /// @todo: Implement an array of method pointers instead of set of ifs
+
// Method 1: from raw sockets.
if (hw_addr_src & HWAddr::HWADDR_SOURCE_RAW) {
mac = getRemoteHWAddr();
-// Copyright (C) 2011-2014 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2011-2015 Internet Systems Consortium, Inc. ("ISC")
//
// Permission to use, copy, modify, and/or distribute this software for any
// purpose with or without fee is hereby granted, provided that the above
return (HWAddrPtr());
}
- OptionBuffer buf = device_id->getData();
- if (buf.size() > 1) {
+ // If the option contains any data, use it as MAC address
+ if (!device_id->getData().empty()) {
return (HWAddrPtr(new HWAddr(device_id->getData(), HTYPE_DOCSIS)));
} else {
return (HWAddrPtr());
return (HWAddrPtr());
}
- OptionBuffer buf = cm_mac->getData();
- if (buf.size() > 1) {
+ // If the option contains any data, use it as MAC address
+ if (!cm_mac->getData().empty()) {
return (HWAddrPtr(new HWAddr(cm_mac->getData(), HTYPE_DOCSIS)));
} else {
return (HWAddrPtr());
-// Copyright (C) 2014 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2014-2015 Internet Systems Consortium, Inc. ("ISC")
//
// Permission to use, copy, modify, and/or distribute this software for any
// purpose with or without fee is hereby granted, provided that the above
/// @return relayed DISCOVER
static isc::dhcp::Pkt4Ptr captureRelayedDiscover2();
- // see wireshark.cc for descriptions
+ // see pkt_captures6.cc for descriptions
// The descriptions are too large and too closely related to the
// code, so it is kept in .cc rather than traditionally in .h
static isc::dhcp::Pkt6Ptr captureSimpleSolicit();
-// Copyright (C) 2013 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2013-2015 Internet Systems Consortium, Inc. ("ISC")
//
// Permission to use, copy, modify, and/or distribute this software for any
// purpose with or without fee is hereby granted, provided that the above
-// Copyright (C) 2013-2014 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2013-2015 Internet Systems Consortium, Inc. ("ISC")
//
// Permission to use, copy, modify, and/or distribute this software for any
// purpose with or without fee is hereby granted, provided that the above
#include <dhcp/tests/pkt_captures.h>
#include <string>
-/// @file wireshark.cc
+/// @file pkt_captures6.cc
///
/// @brief contains packet captures imported from Wireshark
///