\hypertarget{classNextHopAttribute}{
\section{NextHopAttribute$<$ A $>$ Class Template Reference}
\label{classNextHopAttribute}\index{NextHopAttribute@{NextHopAttribute}}
}


\hyperlink{classNextHopAttribute}{NextHopAttribute} contains \hyperlink{protocolthe-p}{the} IP address of \hyperlink{protocolthe-p}{the} next hop.  




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

Inheritance diagram for NextHopAttribute$<$ A $>$:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[height=3.000000cm]{classNextHopAttribute}
\end{center}
\end{figure}
\subsection*{Public Member Functions}
\begin{DoxyCompactItemize}
\item 
\hypertarget{classNextHopAttribute_ad2767d38299cd4601107c057686086b7}{
\hyperlink{classNextHopAttribute_ad2767d38299cd4601107c057686086b7}{NextHopAttribute} (const A \&n)  throw (CorruptMessage)}
\label{classNextHopAttribute_ad2767d38299cd4601107c057686086b7}

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

\item 
\hyperlink{classPathAttribute}{PathAttribute} $\ast$ \hyperlink{classNextHopAttribute_ad15f98415d3613f01c940405b1b7d5c5}{clone} () const 
\begin{DoxyCompactList}\small\item\em Make a copy of \hyperlink{protocolthe-p}{the} current attribute. \item\end{DoxyCompactList}\item 
\hypertarget{classNextHopAttribute_aef56db67915dca08c063973a2bfb863f}{
void {\bfseries verify} ()  throw (CorruptMessage)}
\label{classNextHopAttribute_aef56db67915dca08c063973a2bfb863f}

\item 
string \hyperlink{classNextHopAttribute_a6667c634f52e4fbebcdea30c473fd827}{str} () const 
\begin{DoxyCompactList}\small\item\em We need to encode an attribute to send to a peer. \item\end{DoxyCompactList}\item 
\hypertarget{classNextHopAttribute_a7169b69b91c1501ff2179598b513d42c}{
A \& {\bfseries nexthop} ()}
\label{classNextHopAttribute_a7169b69b91c1501ff2179598b513d42c}

\item 
\hypertarget{classNextHopAttribute_aa06b083e7ede500364d441c93f6a85b5}{
void {\bfseries set\_\-nexthop} (const A \&n)}
\label{classNextHopAttribute_aa06b083e7ede500364d441c93f6a85b5}

\item 
bool \hyperlink{classNextHopAttribute_a108d84d90c4194b9ad09ffe21d9c6341}{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{classNextHopAttribute_ac6769435b2efad4b95e1c19279c15ca6}{
A {\bfseries \_\-next\_\-hop}}
\label{classNextHopAttribute_ac6769435b2efad4b95e1c19279c15ca6}

\end{DoxyCompactItemize}


\subsection{Detailed Description}
\subsubsection*{template$<$class A$>$ class NextHopAttribute$<$ A $>$}

\hyperlink{classNextHopAttribute}{NextHopAttribute} contains \hyperlink{protocolthe-p}{the} IP address of \hyperlink{protocolthe-p}{the} next hop. 

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


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{classNextHopAttribute_a108d84d90c4194b9ad09ffe21d9c6341}{
\index{NextHopAttribute@{NextHopAttribute}!encode@{encode}}
\index{encode@{encode}!NextHopAttribute@{NextHopAttribute}}
\subsubsection[{encode}]{\setlength{\rightskip}{0pt plus 5cm}template$<$class A $>$ bool {\bf NextHopAttribute}$<$ A $>$::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{classNextHopAttribute_a108d84d90c4194b9ad09ffe21d9c6341}


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{classNextHopAttribute_a6667c634f52e4fbebcdea30c473fd827}{
\index{NextHopAttribute@{NextHopAttribute}!str@{str}}
\index{str@{str}!NextHopAttribute@{NextHopAttribute}}
\subsubsection[{str}]{\setlength{\rightskip}{0pt plus 5cm}template$<$class A$>$ string {\bf NextHopAttribute}$<$ A $>$::str (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
) const\hspace{0.3cm}{\ttfamily  \mbox{[}inline, virtual\mbox{]}}}}
\label{classNextHopAttribute_a6667c634f52e4fbebcdea30c473fd827}


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}
