\hypertarget{classOriginAttribute}{
\section{OriginAttribute Class Reference}
\label{classOriginAttribute}\index{OriginAttribute@{OriginAttribute}}
}


\hyperlink{classOriginAttribute}{OriginAttribute} has a payload of size 1 containing \hyperlink{protocolthe-p}{the} origin type.  




{\ttfamily \#include $<$path\_\-attribute.hh$>$}

Inheritance diagram for OriginAttribute:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[height=3.000000cm]{classOriginAttribute}
\end{center}
\end{figure}
\subsection*{Public Member Functions}
\begin{DoxyCompactItemize}
\item 
\hypertarget{classOriginAttribute_a0e142015a454d3e557e165810812eec8}{
\hyperlink{classOriginAttribute_a0e142015a454d3e557e165810812eec8}{OriginAttribute} (OriginType t)}
\label{classOriginAttribute_a0e142015a454d3e557e165810812eec8}

\begin{DoxyCompactList}\small\item\em \hyperlink{classOriginAttribute}{OriginAttribute}. \item\end{DoxyCompactList}\item 
\hypertarget{classOriginAttribute_ad70fefe7f9206d0c008b5ad2a7ac439c}{
{\bfseries OriginAttribute} (const uint8\_\-t $\ast$d)  throw (CorruptMessage)}
\label{classOriginAttribute_ad70fefe7f9206d0c008b5ad2a7ac439c}

\item 
\hyperlink{classPathAttribute}{PathAttribute} $\ast$ \hyperlink{classOriginAttribute_a447ba11ff572f56d785e3e5fe77ae729}{clone} () const 
\begin{DoxyCompactList}\small\item\em Make a copy of \hyperlink{protocolthe-p}{the} current attribute. \item\end{DoxyCompactList}\item 
string \hyperlink{classOriginAttribute_ae7bf70f883a98178d565d7e3a60cfd75}{str} () const 
\begin{DoxyCompactList}\small\item\em We need to encode an attribute to send to a peer. \item\end{DoxyCompactList}\item 
\hypertarget{classOriginAttribute_a11d840a5be7e7db15e536cacbf50b6c4}{
OriginType {\bfseries origin} () const }
\label{classOriginAttribute_a11d840a5be7e7db15e536cacbf50b6c4}

\item 
bool \hyperlink{classOriginAttribute_a1f2194ee4da0622a4bec31cbd3f6673b}{encode} (uint8\_\-t $\ast$buf, size\_\-t \&wire\_\-size, const \hyperlink{classBGPPeerData}{BGPPeerData} $\ast$peerdata) const 
\begin{DoxyCompactList}\small\item\em encode a path attribute. \item\end{DoxyCompactList}\end{DoxyCompactItemize}
\subsection*{Private Attributes}
\begin{DoxyCompactItemize}
\item 
\hypertarget{classOriginAttribute_a09caac1a019beafc9f4a9bd6e69b717e}{
OriginType {\bfseries \_\-origin}}
\label{classOriginAttribute_a09caac1a019beafc9f4a9bd6e69b717e}

\end{DoxyCompactItemize}


\subsection{Detailed Description}
\hyperlink{classOriginAttribute}{OriginAttribute} has a payload of size 1 containing \hyperlink{protocolthe-p}{the} origin type. 

\subsection{Member Function Documentation}
\hypertarget{classOriginAttribute_a447ba11ff572f56d785e3e5fe77ae729}{
\index{OriginAttribute@{OriginAttribute}!clone@{clone}}
\index{clone@{clone}!OriginAttribute@{OriginAttribute}}
\subsubsection[{clone}]{\setlength{\rightskip}{0pt plus 5cm}{\bf PathAttribute} $\ast$ OriginAttribute::clone (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
) const\hspace{0.3cm}{\ttfamily  \mbox{[}virtual\mbox{]}}}}
\label{classOriginAttribute_a447ba11ff572f56d785e3e5fe77ae729}


Make a copy of \hyperlink{protocolthe-p}{the} current attribute. 

The derived class should use new to generate a copy of itself. The wire format representation will not be used by \hyperlink{protocolthe-p}{the} caller. 

Implements \hyperlink{classPathAttribute_a17f0c215d2873317797a899b7ac58ef6}{PathAttribute}.

\hypertarget{classOriginAttribute_a1f2194ee4da0622a4bec31cbd3f6673b}{
\index{OriginAttribute@{OriginAttribute}!encode@{encode}}
\index{encode@{encode}!OriginAttribute@{OriginAttribute}}
\subsubsection[{encode}]{\setlength{\rightskip}{0pt plus 5cm}bool OriginAttribute::encode (
\begin{DoxyParamCaption}
\item[{uint8\_\-t $\ast$}]{buf, }
\item[{size\_\-t \&}]{wire\_\-size, }
\item[{const {\bf BGPPeerData} $\ast$}]{peerdata}
\end{DoxyParamCaption}
) const\hspace{0.3cm}{\ttfamily  \mbox{[}virtual\mbox{]}}}}
\label{classOriginAttribute_a1f2194ee4da0622a4bec31cbd3f6673b}


encode a path attribute. 

In a sane world, we'd use a virtual function for this. But we store so many path attributes that we can't afford \hyperlink{protocolthe-p}{the} overhead of a virtual function table for them, so we have to do this \hyperlink{protocolthe-p}{the} hard way

XXX THE ABOVE IS NO LONGER THE CASE. WE SHOULD REWRITE THIS TO USE VIRTUAL FUNCTIONS 

Implements \hyperlink{classPathAttribute_a5570039d9cd5e255bb187fd245861e09}{PathAttribute}.

\hypertarget{classOriginAttribute_ae7bf70f883a98178d565d7e3a60cfd75}{
\index{OriginAttribute@{OriginAttribute}!str@{str}}
\index{str@{str}!OriginAttribute@{OriginAttribute}}
\subsubsection[{str}]{\setlength{\rightskip}{0pt plus 5cm}string OriginAttribute::str (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
) const\hspace{0.3cm}{\ttfamily  \mbox{[}virtual\mbox{]}}}}
\label{classOriginAttribute_ae7bf70f883a98178d565d7e3a60cfd75}


We need to encode an attribute to send to a peer. 

However we only have \hyperlink{protocolthe-p}{the} canonically encoded byte stream data for it. Sometimes that is fine, and we should just send that; sometimes we need to decode and re-\/encode for this specific peer. 

Reimplemented from \hyperlink{classPathAttribute_aae2900e4b96589e10291f96d3f584b6e}{PathAttribute}.



The documentation for this class was generated from the following files:\begin{DoxyCompactItemize}
\item 
/home/greearb/git/xorp.ct.github/xorp/bgp/path\_\-attribute.hh\item 
/home/greearb/git/xorp.ct.github/xorp/bgp/path\_\-attribute.cc\end{DoxyCompactItemize}
