\hypertarget{classLocalPrefAttribute}{
\section{LocalPrefAttribute Class Reference}
\label{classLocalPrefAttribute}\index{LocalPrefAttribute@{LocalPrefAttribute}}
}


\hyperlink{classLocalPrefAttribute}{LocalPrefAttribute} is a well-\/known uint32.  




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

Inheritance diagram for LocalPrefAttribute:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[height=3.000000cm]{classLocalPrefAttribute}
\end{center}
\end{figure}
\subsection*{Public Member Functions}
\begin{DoxyCompactItemize}
\item 
\hypertarget{classLocalPrefAttribute_a508e4e2c27c4cf30229a367d669962df}{
\hyperlink{classLocalPrefAttribute_a508e4e2c27c4cf30229a367d669962df}{LocalPrefAttribute} (const uint32\_\-t localpref)}
\label{classLocalPrefAttribute_a508e4e2c27c4cf30229a367d669962df}

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

\item 
\hyperlink{classPathAttribute}{PathAttribute} $\ast$ \hyperlink{classLocalPrefAttribute_a77b3902cadd95173b6913a4b1be12182}{clone} () const 
\begin{DoxyCompactList}\small\item\em Make a copy of \hyperlink{protocolthe-p}{the} current attribute. \item\end{DoxyCompactList}\item 
string \hyperlink{classLocalPrefAttribute_aea9aa793c10eb3ceb1ecc6d6145879fe}{str} () const 
\begin{DoxyCompactList}\small\item\em We need to encode an attribute to send to a peer. \item\end{DoxyCompactList}\item 
\hypertarget{classLocalPrefAttribute_a90e608a76bd8936ea8052cc7feb0d4fe}{
uint32\_\-t {\bfseries localpref} () const }
\label{classLocalPrefAttribute_a90e608a76bd8936ea8052cc7feb0d4fe}

\item 
bool \hyperlink{classLocalPrefAttribute_ab6b55e9c3e888b8eaa34e9f1c6f48e31}{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*{Static Public Member Functions}
\begin{DoxyCompactItemize}
\item 
\hypertarget{classLocalPrefAttribute_a51d0f0d64391a99f2bc45d26f2c5329c}{
static uint32\_\-t {\bfseries default\_\-value} ()}
\label{classLocalPrefAttribute_a51d0f0d64391a99f2bc45d26f2c5329c}

\end{DoxyCompactItemize}
\subsection*{Private Attributes}
\begin{DoxyCompactItemize}
\item 
\hypertarget{classLocalPrefAttribute_abe50fca257cb6dadbcda1a2e1daef5bc}{
uint32\_\-t {\bfseries \_\-localpref}}
\label{classLocalPrefAttribute_abe50fca257cb6dadbcda1a2e1daef5bc}

\end{DoxyCompactItemize}


\subsection{Detailed Description}
\hyperlink{classLocalPrefAttribute}{LocalPrefAttribute} is a well-\/known uint32. 

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


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{classLocalPrefAttribute_ab6b55e9c3e888b8eaa34e9f1c6f48e31}{
\index{LocalPrefAttribute@{LocalPrefAttribute}!encode@{encode}}
\index{encode@{encode}!LocalPrefAttribute@{LocalPrefAttribute}}
\subsubsection[{encode}]{\setlength{\rightskip}{0pt plus 5cm}bool LocalPrefAttribute::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{classLocalPrefAttribute_ab6b55e9c3e888b8eaa34e9f1c6f48e31}


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{classLocalPrefAttribute_aea9aa793c10eb3ceb1ecc6d6145879fe}{
\index{LocalPrefAttribute@{LocalPrefAttribute}!str@{str}}
\index{str@{str}!LocalPrefAttribute@{LocalPrefAttribute}}
\subsubsection[{str}]{\setlength{\rightskip}{0pt plus 5cm}string LocalPrefAttribute::str (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
) const\hspace{0.3cm}{\ttfamily  \mbox{[}virtual\mbox{]}}}}
\label{classLocalPrefAttribute_aea9aa793c10eb3ceb1ecc6d6145879fe}


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}
