//=========================================================================== // $Name: $ // $Id: ArtsBgp4AsPathSegment.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 _ARTSBGP4ASPATHSEGMENT_HH_ #define _ARTSBGP4ASPATHSEGMENT_HH_ extern "C" { #include "caida_t.h" } #include //--------------------------------------------------------------------------- // class ArtsBgp4AsPathSegment //--------------------------------------------------------------------------- // This class abstracts an AS path segement in a BGP AS path attribute. // An AS path segment may be of type SET or SEQUENCE; a SET segment is // unordered while a SEQUENCE segment is ordered. See RFC 1771 for // more details. //--------------------------------------------------------------------------- class ArtsBgp4AsPathSegment { public: //------------------------------------------------------------------------- // uint8_t Type() const //......................................................................... // Returns the type of the segment (1 == SET, 2 == SEQUENCE). //------------------------------------------------------------------------- uint8_t Type() const; //------------------------------------------------------------------------- // uint8_t Type(uint8_t type) //......................................................................... // Sets and returns the type of the segment (1 == SET, 2 == SEQUENCE). //------------------------------------------------------------------------- uint8_t Type(uint8_t type); //------------------------------------------------------------------------- // uint8_t Length() const //......................................................................... // Returns the length of the segment. This represents the number of // AS numbers in the segment. //------------------------------------------------------------------------- uint8_t Length() const; //------------------------------------------------------------------------- // uint8_t Length(uint8_t length) //......................................................................... // Sets and returns the length of the segment. //------------------------------------------------------------------------- uint8_t Length(uint8_t length); //------------------------------------------------------------------------- // vector & AS() const //......................................................................... // Returns a reference to the vector of AS numbers in the segment. // Note that this member can be called on a const object though we // don't return a const reference; the vector of AS numbers is // mutable. //------------------------------------------------------------------------- vector & AS() const; private: uint8_t _type; // the segment type mutable vector _AS; // the segment AS numbers }; #endif // _ARTSBGP4ASPATHSEGMENT_HH_