Commit bd9f0c66 authored by Tomek Mrugalski's avatar Tomek Mrugalski 🛰
Browse files

[3553] Changes after review:

- copyright year updated
- comment clarified
- added @todo in Pkt::setHWAddrMember()
- getMACfromDocsis*() don't use intermediate members, will accept
  options with length 1
parent 517420e7
// 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
......@@ -52,7 +52,6 @@
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
......@@ -39,7 +39,6 @@
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
......@@ -54,7 +54,7 @@ static const uint16_t BOOTP_BROADCAST = 32768L;
/* 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
......@@ -129,6 +129,8 @@ HWAddrPtr
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
......@@ -644,8 +644,8 @@ Pkt6::getMACFromDocsisModem() {
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());
......@@ -675,8 +675,8 @@ Pkt6::getMACFromDocsisCMTS() {
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
......@@ -37,7 +37,7 @@ public:
/// @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
......@@ -18,7 +18,7 @@
#include <dhcp/tests/pkt_captures.h>
#include <string>
/// @file wireshark.cc
/// @file pkt_captures6.cc
///
/// @brief contains packet captures imported from Wireshark
///
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment