//=========================================================================== // $Name: $ // $Id: ArtsBgp4AggregatorAttribute.hh,v 1.1.1.1 2000/03/29 22:53:56 kkeys Exp $ //=========================================================================== // CAIDA Copyright Notice // // By accessing this software, arts++, you are duly informed // of and agree to be bound by the conditions described below in this // notice: // // This software product, arts++, is developed by Daniel W. McRobb, and // copyrighted(C) 1998 by the University of California, San Diego // (UCSD), with all rights reserved. UCSD administers the CAIDA grant, // NCR-9711092, under which part of this code was developed. // // There is no charge for arts++ software. You can redistribute it // and/or modify it under the terms of the GNU General Public License, // v. 2 dated June 1991 which is incorporated by reference herein. // arts++ is distributed WITHOUT ANY WARRANTY, IMPLIED OR EXPRESS, OF // MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE or that the use // of it will not infringe on any third party's intellectual property // rights. // // You should have received a copy of the GNU GPL along with arts++. // Copies can also be obtained from: // // http://www.gnu.org/copyleft/gpl.html // // or by writing to: // // University of California, San Diego // // SDSC/CAIDA // 9500 Gilman Dr., MS-0505 // La Jolla, CA 92093 - 0505 USA // // Or contact: // // info@caida.org //=========================================================================== #ifndef _ARTSBGP4AGGREGATORATTRIBUTE_HH_ #define _ARTSBGP4AGGREGATORATTRIBUTE_HH_ extern "C" { #include "caida_t.h" } #include "ArtsBgp4Prefix.hh" //--------------------------------------------------------------------------- // class ArtsBgp4AggregatorAttribute //--------------------------------------------------------------------------- // This class abstracts a BGP4 aggregator attribute. An aggregator // attribute contains an AS number and an IP address. We use an // ArtsBgp4Prefix to hold the IP address, since the ArtsBgp4Prefix // class can encapsulate Ipv4 and IPv6 addresses. //--------------------------------------------------------------------------- class ArtsBgp4AggregatorAttribute { public: //------------------------------------------------------------------------- // uint16_t AS() const //......................................................................... // Returns the AS number in the ArtsBgp4AggregatorAttribute. //------------------------------------------------------------------------- uint16_t AS() const; //------------------------------------------------------------------------- // uint16_t AS(uint16_t as) //......................................................................... // Sets and returns the AS number in the ArtsBgp4AggregatorAttribute. //------------------------------------------------------------------------- uint16_t AS(uint16_t as); //------------------------------------------------------------------------- // ArtsBgp4Prefix & Prefix() const //......................................................................... // Returns the IP address in the ArtsBgp4AggregatorAttribute, as a // reference to an ArtsBgp4Prefix. //------------------------------------------------------------------------- ArtsBgp4Prefix & Prefix() const; //------------------------------------------------------------------------- // ArtsBgp4Prefix & Prefix (ArtsBgp4Prefix &) //......................................................................... // Sets and returns the IP address in the ArtsBgp4AggregatorAttribute, // as a reference to an ArtsBgp4Prefix. //------------------------------------------------------------------------- ArtsBgp4Prefix & Prefix (ArtsBgp4Prefix &); //------------------------------------------------------------------------- // ArtsBgp4AggregatorAttribute & // operator = (const ArtsBgp4AggregatorAttribute & aggregator) //......................................................................... // Overloaded '=' operator for assigning an ArtsBgp4AggregatorAttribute // to another. //------------------------------------------------------------------------- ArtsBgp4AggregatorAttribute & operator = (const ArtsBgp4AggregatorAttribute & aggregator); private: uint16_t _AS; mutable ArtsBgp4Prefix _prefix; }; #endif // _ARTSBGP4AGGREGATORATTRIBUTE_HH_