\hypertarget{classPolicyList}{
\section{PolicyList Class Reference}
\label{classPolicyList}\index{PolicyList@{PolicyList}}
}


The list of policies associated with a protocol.  




{\ttfamily \#include $<$policy\_\-list.hh$>$}

Inheritance diagram for PolicyList:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[height=2.000000cm]{classPolicyList}
\end{center}
\end{figure}
\subsection*{Public Types}
\begin{DoxyCompactItemize}
\item 
enum {\bfseries PolicyType} \{ {\bfseries IMPORT}, 
{\bfseries EXPORT}
 \}
\item 
\hypertarget{classPolicyList_a27fdf73a3e620a2c457a557cca71c85a}{
typedef set$<$ uint32\_\-t $>$ {\bfseries TagSet}}
\label{classPolicyList_a27fdf73a3e620a2c457a557cca71c85a}

\item 
\hypertarget{classPolicyList_a89eae4a60f4596311a1272280e1cd691}{
typedef map$<$ string, TagSet $\ast$ $>$ {\bfseries TagMap}}
\label{classPolicyList_a89eae4a60f4596311a1272280e1cd691}

\end{DoxyCompactItemize}
\subsection*{Public Member Functions}
\begin{DoxyCompactItemize}
\item 
\hyperlink{classPolicyList_a3dec976bb4f250ca68a8f88ae6e8efed}{PolicyList} (const string \&p, PolicyType pt, \hyperlink{classPolicyMap}{PolicyMap} \&pmap, \hyperlink{classSetMap}{SetMap} \&smap, \hyperlink{classVarMap}{VarMap} \&vmap, string mod)
\item 
void \hyperlink{classPolicyList_abc85fb8a27c2fd7976464e5abc9fa631}{push\_\-back} (const string \&policyname)
\begin{DoxyCompactList}\small\item\em Append a policy to \hyperlink{protocolthe-p}{the} list. \item\end{DoxyCompactList}\item 
void \hyperlink{classPolicyList_a4f33c0677940e87b6ead9c55db05a9cc}{compile\_\-policy} (\hyperlink{classPolicyStatement}{PolicyStatement} \&ps, Code::TargetSet \&mod, uint32\_\-t \&tagstart, map$<$ string, set$<$ uint32\_\-t $>$ $>$ \&ptags)
\begin{DoxyCompactList}\small\item\em Compiles a specific policy. \item\end{DoxyCompactList}\item 
void \hyperlink{classPolicyList_ac976d1aaef4011fe5b5ead18ccf589a9}{compile} (Code::TargetSet \&mod, uint32\_\-t \&tagstart, map$<$ string, set$<$ uint32\_\-t $>$ $>$ \&ptags)
\begin{DoxyCompactList}\small\item\em Compile all policies which were not previously compiled. \item\end{DoxyCompactList}\item 
string \hyperlink{classPolicyList_add22a0964580d54cc4c5a750933aacb5}{str} ()
\item 
void \hyperlink{classPolicyList_a79ae644899b40a82ac61022ccd35e8ff}{link\_\-code} (\hyperlink{classCode}{Code} \&ret)
\begin{DoxyCompactList}\small\item\em Link \hyperlink{protocolthe-p}{the} all \hyperlink{protocolthe-p}{the} code avialable in this policy list with code supplied. \item\end{DoxyCompactList}\item 
void \hyperlink{classPolicyList_a869bda548a59971020cdbf84d164ab0d}{get\_\-targets} (Code::TargetSet \&targets)
\begin{DoxyCompactList}\small\item\em Return all targets in this policy list. \item\end{DoxyCompactList}\item 
void \hyperlink{classPolicyList_a04a11f9653d3fccfed522541eb16ef53}{get\_\-redist\_\-tags} (const string \&protocol, Code::TagSet \&ts)
\begin{DoxyCompactList}\small\item\em Return \hyperlink{protocolthe-p}{the} policy tags used by a specific protocol for route redistribution. \item\end{DoxyCompactList}\end{DoxyCompactItemize}
\subsection*{Private Types}
\begin{DoxyCompactItemize}
\item 
\hypertarget{classPolicyList_a39c34158734fead7f88f705681f36133}{
typedef pair$<$ string, \hyperlink{classCodeList}{CodeList} $\ast$ $>$ {\bfseries PolicyCode}}
\label{classPolicyList_a39c34158734fead7f88f705681f36133}

\item 
\hypertarget{classPolicyList_aede2e27b07cd4558237dbe6d18c6f9e2}{
typedef list$<$ PolicyCode $>$ {\bfseries PolicyCodeList}}
\label{classPolicyList_aede2e27b07cd4558237dbe6d18c6f9e2}

\item 
\hypertarget{classPolicyList_a9f1beab03e24a7eee828b01d39ba7b4a}{
typedef set$<$ string $>$ {\bfseries POLICIES}}
\label{classPolicyList_a9f1beab03e24a7eee828b01d39ba7b4a}

\end{DoxyCompactItemize}
\subsection*{Private Member Functions}
\begin{DoxyCompactItemize}
\item 
void \hyperlink{classPolicyList_a1680b98a1e2f16e9680813ae026b1565}{semantic\_\-check} (\hyperlink{classPolicyStatement}{PolicyStatement} \&ps, VisitorSemantic::PolicyType type)
\begin{DoxyCompactList}\small\item\em Semantically check \hyperlink{protocolthe-p}{the} policy for this instantiation. \item\end{DoxyCompactList}\item 
void \hyperlink{classPolicyList_a688d76dff4e9a97fce5d41207f714040}{compile\_\-import} (PolicyCodeList::iterator \&iter, \hyperlink{classPolicyStatement}{PolicyStatement} \&ps, Code::TargetSet \&modified\_\-targets)
\begin{DoxyCompactList}\small\item\em Compile an import policy. \item\end{DoxyCompactList}\item 
void \hyperlink{classPolicyList_a141b278121bcffc36602a458a5e96654}{compile\_\-export} (PolicyCodeList::iterator \&iter, \hyperlink{classPolicyStatement}{PolicyStatement} \&ps, Code::TargetSet \&modified\_\-targets, uint32\_\-t \&tagstart, map$<$ string, set$<$ uint32\_\-t $>$ $>$ \&ptags)
\begin{DoxyCompactList}\small\item\em Compile an export policy. \item\end{DoxyCompactList}\item 
\hypertarget{classPolicyList_ac10d16e1d0e5c41cb6e6315d126cfd4d}{
\hyperlink{classTerm}{Term} $\ast$ {\bfseries create\_\-mod} (Term::BLOCKS block)}
\label{classPolicyList_ac10d16e1d0e5c41cb6e6315d126cfd4d}

\item 
\hypertarget{classPolicyList_a8e5d8a66630370bd725e3e8b4fd641d1}{
void {\bfseries add\_\-policy\_\-expression} (const string \&exp)}
\label{classPolicyList_a8e5d8a66630370bd725e3e8b4fd641d1}

\end{DoxyCompactItemize}
\subsection*{Private Attributes}
\begin{DoxyCompactItemize}
\item 
\hypertarget{classPolicyList_a0249a54bd1b15dd03e9161af8892d084}{
string {\bfseries \_\-protocol}}
\label{classPolicyList_a0249a54bd1b15dd03e9161af8892d084}

\item 
\hypertarget{classPolicyList_a8329b60e24144f9107b454a92bcd26b5}{
PolicyType {\bfseries \_\-type}}
\label{classPolicyList_a8329b60e24144f9107b454a92bcd26b5}

\item 
\hypertarget{classPolicyList_a069ced8b34a2544aa05eb2f57451787a}{
PolicyCodeList {\bfseries \_\-policies}}
\label{classPolicyList_a069ced8b34a2544aa05eb2f57451787a}

\item 
\hypertarget{classPolicyList_a12d0e19a223db7c14933a5eb25c61062}{
\hyperlink{classPolicyMap}{PolicyMap} \& {\bfseries \_\-pmap}}
\label{classPolicyList_a12d0e19a223db7c14933a5eb25c61062}

\item 
\hypertarget{classPolicyList_a2aa91805423f4f86fb461d13a7824254}{
\hyperlink{classSetMap}{SetMap} \& {\bfseries \_\-smap}}
\label{classPolicyList_a2aa91805423f4f86fb461d13a7824254}

\item 
\hypertarget{classPolicyList_ac1e9645177f95e36b2fbbdc1ec45c858}{
\hyperlink{classVarMap}{VarMap} \& {\bfseries \_\-varmap}}
\label{classPolicyList_ac1e9645177f95e36b2fbbdc1ec45c858}

\item 
\hypertarget{classPolicyList_a6c75324706ee02796ceb4a3d080a0e0c}{
string {\bfseries \_\-mod}}
\label{classPolicyList_a6c75324706ee02796ceb4a3d080a0e0c}

\item 
\hypertarget{classPolicyList_aa477585f704ff5f0e39d8d4fb09f0aee}{
\hyperlink{classTerm}{Term} $\ast$ {\bfseries \_\-mod\_\-term}}
\label{classPolicyList_aa477585f704ff5f0e39d8d4fb09f0aee}

\item 
\hypertarget{classPolicyList_adc6312e5169e8f41241b38c4a7e92953}{
\hyperlink{classTerm}{Term} $\ast$ {\bfseries \_\-mod\_\-term\_\-import}}
\label{classPolicyList_adc6312e5169e8f41241b38c4a7e92953}

\item 
\hypertarget{classPolicyList_ac1be106345e9d800fa685396ee6118aa}{
\hyperlink{classTerm}{Term} $\ast$ {\bfseries \_\-mod\_\-term\_\-export}}
\label{classPolicyList_ac1be106345e9d800fa685396ee6118aa}

\item 
\hypertarget{classPolicyList_a23736f1ed734fc6e6756381a353217d7}{
POLICIES {\bfseries \_\-pe\_\-policies}}
\label{classPolicyList_a23736f1ed734fc6e6756381a353217d7}

\end{DoxyCompactItemize}
\subsection*{Static Private Attributes}
\begin{DoxyCompactItemize}
\item 
\hypertarget{classPolicyList_ab243079b011f532511bd140a4f81e4b3}{
static uint32\_\-t {\bfseries \_\-pe} = 0}
\label{classPolicyList_ab243079b011f532511bd140a4f81e4b3}

\end{DoxyCompactItemize}


\subsection{Detailed Description}
The list of policies associated with a protocol. This relates to \hyperlink{protocolthe-p}{the} import/export directives of protocols.

Depending on what protocols support, they will normally have a single import/export policy list associated with them.

Each policy list is an instantiation of a policy, and thus it hold \hyperlink{protocolthe-p}{the} specific code for this instantiation. 

\subsection{Constructor \& Destructor Documentation}
\hypertarget{classPolicyList_a3dec976bb4f250ca68a8f88ae6e8efed}{
\index{PolicyList@{PolicyList}!PolicyList@{PolicyList}}
\index{PolicyList@{PolicyList}!PolicyList@{PolicyList}}
\subsubsection[{PolicyList}]{\setlength{\rightskip}{0pt plus 5cm}PolicyList::PolicyList (
\begin{DoxyParamCaption}
\item[{const string \&}]{p, }
\item[{PolicyType}]{pt, }
\item[{{\bf PolicyMap} \&}]{pmap, }
\item[{{\bf SetMap} \&}]{smap, }
\item[{{\bf VarMap} \&}]{vmap, }
\item[{string}]{mod}
\end{DoxyParamCaption}
)}}
\label{classPolicyList_a3dec976bb4f250ca68a8f88ae6e8efed}

\begin{DoxyParams}{Parameters}
{\em p} & protocol for which this list applies. \\
\hline
{\em pt} & \hyperlink{protocolthe-p}{the} type of policy list \mbox{[}import/export\mbox{]}. \\
\hline
{\em pmap} & \hyperlink{protocolthe-p}{the} container of all policies. \\
\hline
{\em smap} & \hyperlink{protocolthe-p}{the} container of all sets. \\
\hline
{\em vmap} & \hyperlink{protocolthe-p}{the} \hyperlink{classVarMap}{VarMap}. \\
\hline
\end{DoxyParams}


\subsection{Member Function Documentation}
\hypertarget{classPolicyList_ac976d1aaef4011fe5b5ead18ccf589a9}{
\index{PolicyList@{PolicyList}!compile@{compile}}
\index{compile@{compile}!PolicyList@{PolicyList}}
\subsubsection[{compile}]{\setlength{\rightskip}{0pt plus 5cm}void PolicyList::compile (
\begin{DoxyParamCaption}
\item[{Code::TargetSet \&}]{mod, }
\item[{uint32\_\-t \&}]{tagstart, }
\item[{map$<$ string, set$<$ uint32\_\-t $>$ $>$ \&}]{ptags}
\end{DoxyParamCaption}
)}}
\label{classPolicyList_ac976d1aaef4011fe5b5ead18ccf589a9}


Compile all policies which were not previously compiled. 

Throws an exception on semantic / compile errors.


\begin{DoxyParams}{Parameters}
{\em mod} & set filled with targets which are modified by compilation. \\
\hline
{\em tagstart} & first policy tag available. \\
\hline
\end{DoxyParams}
\hypertarget{classPolicyList_a141b278121bcffc36602a458a5e96654}{
\index{PolicyList@{PolicyList}!compile\_\-export@{compile\_\-export}}
\index{compile\_\-export@{compile\_\-export}!PolicyList@{PolicyList}}
\subsubsection[{compile\_\-export}]{\setlength{\rightskip}{0pt plus 5cm}void PolicyList::compile\_\-export (
\begin{DoxyParamCaption}
\item[{PolicyCodeList::iterator \&}]{iter, }
\item[{{\bf PolicyStatement} \&}]{ps, }
\item[{Code::TargetSet \&}]{modified\_\-targets, }
\item[{uint32\_\-t \&}]{tagstart, }
\item[{map$<$ string, set$<$ uint32\_\-t $>$ $>$ \&}]{ptags}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily  \mbox{[}private\mbox{]}}}}
\label{classPolicyList_a141b278121bcffc36602a458a5e96654}


Compile an export policy. 


\begin{DoxyParams}{Parameters}
{\em iter} & position in code list which needs to be replaced with code. \\
\hline
{\em ps} & policy to compile. \\
\hline
{\em modified\_\-targets} & set filled with targets modified by compilation. \\
\hline
{\em tagstart} & first policy tag available. \\
\hline
\end{DoxyParams}
\hypertarget{classPolicyList_a688d76dff4e9a97fce5d41207f714040}{
\index{PolicyList@{PolicyList}!compile\_\-import@{compile\_\-import}}
\index{compile\_\-import@{compile\_\-import}!PolicyList@{PolicyList}}
\subsubsection[{compile\_\-import}]{\setlength{\rightskip}{0pt plus 5cm}void PolicyList::compile\_\-import (
\begin{DoxyParamCaption}
\item[{PolicyCodeList::iterator \&}]{iter, }
\item[{{\bf PolicyStatement} \&}]{ps, }
\item[{Code::TargetSet \&}]{modified\_\-targets}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily  \mbox{[}private\mbox{]}}}}
\label{classPolicyList_a688d76dff4e9a97fce5d41207f714040}


Compile an import policy. 


\begin{DoxyParams}{Parameters}
{\em iter} & position in code list which needs to be replaced with code. \\
\hline
{\em ps} & policy to compile. \\
\hline
{\em modified\_\-targets} & set filled with targets modified by compilation. \\
\hline
\end{DoxyParams}
\hypertarget{classPolicyList_a4f33c0677940e87b6ead9c55db05a9cc}{
\index{PolicyList@{PolicyList}!compile\_\-policy@{compile\_\-policy}}
\index{compile\_\-policy@{compile\_\-policy}!PolicyList@{PolicyList}}
\subsubsection[{compile\_\-policy}]{\setlength{\rightskip}{0pt plus 5cm}void PolicyList::compile\_\-policy (
\begin{DoxyParamCaption}
\item[{{\bf PolicyStatement} \&}]{ps, }
\item[{Code::TargetSet \&}]{mod, }
\item[{uint32\_\-t \&}]{tagstart, }
\item[{map$<$ string, set$<$ uint32\_\-t $>$ $>$ \&}]{ptags}
\end{DoxyParamCaption}
)}}
\label{classPolicyList_a4f33c0677940e87b6ead9c55db05a9cc}


Compiles a specific policy. 

Throws an exception on semantic / compile errors.


\begin{DoxyParams}{Parameters}
{\em ps} & policy to compile. \\
\hline
{\em mod} & set filled with targets which are modified by compilation. \\
\hline
{\em tagstart} & first policy tag available. \\
\hline
\end{DoxyParams}
\hypertarget{classPolicyList_a04a11f9653d3fccfed522541eb16ef53}{
\index{PolicyList@{PolicyList}!get\_\-redist\_\-tags@{get\_\-redist\_\-tags}}
\index{get\_\-redist\_\-tags@{get\_\-redist\_\-tags}!PolicyList@{PolicyList}}
\subsubsection[{get\_\-redist\_\-tags}]{\setlength{\rightskip}{0pt plus 5cm}void PolicyList::get\_\-redist\_\-tags (
\begin{DoxyParamCaption}
\item[{const string \&}]{protocol, }
\item[{Code::TagSet \&}]{ts}
\end{DoxyParamCaption}
)}}
\label{classPolicyList_a04a11f9653d3fccfed522541eb16ef53}


Return \hyperlink{protocolthe-p}{the} policy tags used by a specific protocol for route redistribution. 


\begin{DoxyParams}{Parameters}
{\em protocol} & protocol for which tags are requested. \\
\hline
{\em ts} & set filled with policy-\/tags used by \hyperlink{protocolthe-p}{the} protocol. \\
\hline
\end{DoxyParams}
\hypertarget{classPolicyList_a869bda548a59971020cdbf84d164ab0d}{
\index{PolicyList@{PolicyList}!get\_\-targets@{get\_\-targets}}
\index{get\_\-targets@{get\_\-targets}!PolicyList@{PolicyList}}
\subsubsection[{get\_\-targets}]{\setlength{\rightskip}{0pt plus 5cm}void PolicyList::get\_\-targets (
\begin{DoxyParamCaption}
\item[{Code::TargetSet \&}]{targets}
\end{DoxyParamCaption}
)}}
\label{classPolicyList_a869bda548a59971020cdbf84d164ab0d}


Return all targets in this policy list. 


\begin{DoxyParams}{Parameters}
{\em targets} & set filled with all targets in this policy instantiation. \\
\hline
\end{DoxyParams}
\hypertarget{classPolicyList_a79ae644899b40a82ac61022ccd35e8ff}{
\index{PolicyList@{PolicyList}!link\_\-code@{link\_\-code}}
\index{link\_\-code@{link\_\-code}!PolicyList@{PolicyList}}
\subsubsection[{link\_\-code}]{\setlength{\rightskip}{0pt plus 5cm}void PolicyList::link\_\-code (
\begin{DoxyParamCaption}
\item[{{\bf Code} \&}]{ret}
\end{DoxyParamCaption}
)}}
\label{classPolicyList_a79ae644899b40a82ac61022ccd35e8ff}


Link \hyperlink{protocolthe-p}{the} all \hyperlink{protocolthe-p}{the} code avialable in this policy list with code supplied. 

The code supplied will normally contain a target, so only relevant code is linked.


\begin{DoxyParams}{Parameters}
{\em ret} & code to link with. \\
\hline
\end{DoxyParams}
\hypertarget{classPolicyList_abc85fb8a27c2fd7976464e5abc9fa631}{
\index{PolicyList@{PolicyList}!push\_\-back@{push\_\-back}}
\index{push\_\-back@{push\_\-back}!PolicyList@{PolicyList}}
\subsubsection[{push\_\-back}]{\setlength{\rightskip}{0pt plus 5cm}void PolicyList::push\_\-back (
\begin{DoxyParamCaption}
\item[{const string \&}]{policyname}
\end{DoxyParamCaption}
)}}
\label{classPolicyList_abc85fb8a27c2fd7976464e5abc9fa631}


Append a policy to \hyperlink{protocolthe-p}{the} list. 


\begin{DoxyParams}{Parameters}
{\em policyname} & \hyperlink{protocolthe-p}{the} name of \hyperlink{protocolthe-p}{the} policy \\
\hline
\end{DoxyParams}
\hypertarget{classPolicyList_a1680b98a1e2f16e9680813ae026b1565}{
\index{PolicyList@{PolicyList}!semantic\_\-check@{semantic\_\-check}}
\index{semantic\_\-check@{semantic\_\-check}!PolicyList@{PolicyList}}
\subsubsection[{semantic\_\-check}]{\setlength{\rightskip}{0pt plus 5cm}void PolicyList::semantic\_\-check (
\begin{DoxyParamCaption}
\item[{{\bf PolicyStatement} \&}]{ps, }
\item[{VisitorSemantic::PolicyType}]{type}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily  \mbox{[}private\mbox{]}}}}
\label{classPolicyList_a1680b98a1e2f16e9680813ae026b1565}


Semantically check \hyperlink{protocolthe-p}{the} policy for this instantiation. 

Throws an exception on error.


\begin{DoxyParams}{Parameters}
{\em ps} & policy to check. \\
\hline
{\em type} & type of policy \mbox{[}import/export\mbox{]}. \\
\hline
\end{DoxyParams}
\hypertarget{classPolicyList_add22a0964580d54cc4c5a750933aacb5}{
\index{PolicyList@{PolicyList}!str@{str}}
\index{str@{str}!PolicyList@{PolicyList}}
\subsubsection[{str}]{\setlength{\rightskip}{0pt plus 5cm}string PolicyList::str (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
)}}
\label{classPolicyList_add22a0964580d54cc4c5a750933aacb5}
\begin{DoxyReturn}{Returns}
string representation of list 
\end{DoxyReturn}


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