\section{CGateway\-Security Klassenreferenz}
\label{classCGatewaySecurity}\index{CGatewaySecurity@{CGatewaySecurity}}
Von {\bf CTCPIPComm}{\rm (S.\,\pageref{classCTCPIPComm})} abgeleitete Klasse, die die Zugriffsberechtigung auf den Gateway-Servern implementiert.  


{\tt \#include $<$Gateway\-Security.h$>$}

Klassendiagramm f\"{u}r CGateway\-Security::\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[height=4cm]{classCGatewaySecurity}
\end{center}
\end{figure}
\subsection*{\"{O}ffentliche Methoden}
\begin{CompactItemize}
\item 
{\bf CGateway\-Security} (bool b\-Run\-As\-Service)
\begin{CompactList}\small\item\em Konstruktor. \item\end{CompactList}\item 
{\bf CGateway\-Security} ()\label{classCGatewaySecurity_a1}

\begin{CompactList}\small\item\em Konstruktor. \item\end{CompactList}\item 
virtual {\bf $\sim$CGateway\-Security} ()\label{classCGatewaySecurity_a2}

\begin{CompactList}\small\item\em Destruktor. \item\end{CompactList}\item 
virtual void {\bf Connect\-Indication} (void)\label{classCGatewaySecurity_a3}

\begin{CompactList}\small\item\em Von der Basisklasse {\bf CTCPIPComm}{\rm (S.\,\pageref{classCTCPIPComm})} abgeleitete virtuelle Methode, die anzeigt, dass eine Verbindung aufgebaut ist. \item\end{CompactList}\item 
virtual void {\bf Disconnect\-Indication} (void)\label{classCGatewaySecurity_a4}

\begin{CompactList}\small\item\em Von der Basisklasse {\bf CTCPIPComm}{\rm (S.\,\pageref{classCTCPIPComm})} abgeleitete virtuelle Methode, die anzeigt, dass eine Verbindung abgebaut ist. \item\end{CompactList}\item 
virtual void {\bf Receive} (void $\ast$p\-Data, long Data\-Len)
\begin{CompactList}\small\item\em Von der Basisklasse {\bf CTCPIPComm}{\rm (S.\,\pageref{classCTCPIPComm})} abgeleitete virtuelle Methode, die Daten von TCP/IP empf\"{a}ngt. \item\end{CompactList}\item 
bool {\bf Start\-Processing} (void)
\begin{CompactList}\small\item\em Startet die Security-Funktionalit\"{a}t. \item\end{CompactList}\item 
bool {\bf Stop\-Processing} (void)
\begin{CompactList}\small\item\em Stoppt die Security-Funktionalit\"{a}t. \item\end{CompactList}\item 
virtual void {\bf Add\-Trace} (const char $\ast$lpsz\-Msg, {\bf CTrace\-Object::e\-Trace\-Level} e\-Level=CTrace\-Object::MT\_\-ERROR)
\begin{CompactList}\small\item\em Macht eine Trace-Ausgabe auf dem angeforderten Trace-Level. \item\end{CompactList}\item 
void {\bf Set\-Parameter\-Input} (const char $\ast$lpsz\-Ini\-Filename, const char $\ast$lpsz\-Reg\-Key, bool b\-Run\-As\-Service)
\begin{CompactList}\small\item\em Legt die Eingabe f\"{u}r die Parameter fest. \item\end{CompactList}\item 
void {\bf Read\-Parameters} (void)\label{classCGatewaySecurity_a10}

\begin{CompactList}\small\item\em Liest Parameter. \item\end{CompactList}\item 
bool {\bf Get\-Security\-Port\-Active} (void) const
\begin{CompactList}\small\item\em \"{U}berpr\"{u}ft, ob die Security aktiviert ist. \item\end{CompactList}\item 
bool {\bf Get\-Security\-Running} (void) const
\begin{CompactList}\small\item\em \"{U}berpr\"{u}ft, ob die Security-Port bereits gestartet ist. \item\end{CompactList}\item 
bool {\bf Verify\-Remote\-Partner} (const char $\ast$lpsz\-IPAddress)
\begin{CompactList}\small\item\em \"{U}berpr\"{u}ft, ob der Zugriff des Remote Partner erlaubt ist. \item\end{CompactList}\end{CompactItemize}
\subsection*{Private Methoden}
\begin{CompactItemize}
\item 
void {\bf Add\-Valid\-Address} (const char $\ast$lpsz\-Valid\-Address)
\begin{CompactList}\small\item\em Speichert die IP-Adresse, die sich erfolgreich authentifiziert hat. \item\end{CompactList}\item 
void {\bf Remove\-Old\-Addresses} (void)\label{classCGatewaySecurity_d1}

\begin{CompactList}\small\item\em L\"{o}scht veraltete IP-Adressen aus dem Vektor mit den Remote-Partnern ( die IP-Addresse ist nur 10 Sekunden g\"{u}ltig ). \item\end{CompactList}\item 
bool {\bf Check\-Pass\-Phrase} (const char $\ast$lpsz\-Password)
\begin{CompactList}\small\item\em \"{U}berpr\"{u}ft die Pass\-Phrase eines remote-Partners. \item\end{CompactList}\item 
void {\bf Read\-Ini\-Parameters} (const char $\ast$psz\-Ini\-Filename=NULL)
\begin{CompactList}\small\item\em Liest Security-Parameter aus der angegebenen Konfigurationsdatei. \item\end{CompactList}\item 
void {\bf Read\-Reg\-Parameters} (const char $\ast$psz\-Reg\-Key=NULL)
\begin{CompactList}\small\item\em Liest Securtiy-Parameter aus der Registry. \item\end{CompactList}\end{CompactItemize}
\subsection*{Private Attribute}
\begin{CompactItemize}
\item 
bool {\bf m\_\-b\-Run\-As\-Service}\label{classCGatewaySecurity_r0}

\begin{CompactList}\small\item\em Running\-Mode: NT-Service oder Console-Application. \item\end{CompactList}\item 
short {\bf m\_\-n\-TCPPort}\label{classCGatewaySecurity_r1}

\begin{CompactList}\small\item\em Parametrierung TCPIP: Port. \item\end{CompactList}\item 
std::string {\bf m\_\-s\-IPAddress}\label{classCGatewaySecurity_r2}

\begin{CompactList}\small\item\em Parametrierung TCPIP: IP-Adresse. \item\end{CompactList}\item 
std::string {\bf m\_\-s\-File\-Path}\label{classCGatewaySecurity_r3}

\begin{CompactList}\small\item\em Pfad der Ini-Datei f\"{u}r Konfiguration (Console-Mode). \item\end{CompactList}\item 
std::string {\bf m\_\-s\-Reg\-Key}\label{classCGatewaySecurity_r4}

\begin{CompactList}\small\item\em Registry-Schluessel f\"{u}r Konfiguaration (Service-Mode). \item\end{CompactList}\item 
bool {\bf m\_\-b\-Wait\-For\-Parameters}\label{classCGatewaySecurity_r5}

\begin{CompactList}\small\item\em Kennzeichen, ob Security-Parameter bereits eingelesen wurden. \item\end{CompactList}\item 
bool {\bf m\_\-b\-Security\-Running}\label{classCGatewaySecurity_r6}

\begin{CompactList}\small\item\em Ist Security-Port bereits gestartet? \item\end{CompactList}\item 
bool {\bf m\_\-b\-Security\-Port\-Active}\label{classCGatewaySecurity_r7}

\begin{CompactList}\small\item\em Kennzeichen, ob Security verwendet wird. \item\end{CompactList}\item 
std::string {\bf m\_\-s\-Global\-Password}\label{classCGatewaySecurity_r8}

\begin{CompactList}\small\item\em Authenfication - Password. \item\end{CompactList}\item 
std::string {\bf m\_\-s\-Remote\-Password}\label{classCGatewaySecurity_r9}

\begin{CompactList}\small\item\em Aktuelles Password des Remote-Partners, der sich connektiert hat. \item\end{CompactList}\item 
std::vector$<$ struct s\-Valid\-Address $>$ {\bf m\_\-oa\-Remote\-Partner}\label{classCGatewaySecurity_r10}

\begin{CompactList}\small\item\em Vektor mit den bereits authenfizierten Remote-Partnern. \item\end{CompactList}\item 
CMutex {\bf m\_\-o\-Lock\-Remote}\label{classCGatewaySecurity_r11}

\begin{CompactList}\small\item\em Zugriffs-Sicherung auf Vektor mit den Remote-Addressen. \item\end{CompactList}\end{CompactItemize}


\subsection{Ausf\"{u}hrliche Beschreibung}
Von {\bf CTCPIPComm}{\rm (S.\,\pageref{classCTCPIPComm})} abgeleitete Klasse, die die Zugriffsberechtigung auf den Gateway-Servern implementiert. 

\begin{Desc}
\item[Autor:]: Axel Schmidt \begin{Desc}
\item[Revision]1.3 \end{Desc}
\end{Desc}




\subsection{Beschreibung der Konstruktoren und Destruktoren}
\index{CGatewaySecurity@{CGateway\-Security}!CGatewaySecurity@{CGatewaySecurity}}
\index{CGatewaySecurity@{CGatewaySecurity}!CGatewaySecurity@{CGateway\-Security}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}CGateway\-Security::CGateway\-Security (bool {\em b\-Run\-As\-Service})}\label{classCGatewaySecurity_a0}


Konstruktor. 

\begin{Desc}
\item[Parameter:]
\begin{description}
\item[{\em b\-Run\-As\-Service}]L\"{a}uft die Anwendung als Windows Service \end{description}
\end{Desc}


\subsection{Dokumentation der Elementfunktionen}
\index{CGatewaySecurity@{CGateway\-Security}!AddTrace@{AddTrace}}
\index{AddTrace@{AddTrace}!CGatewaySecurity@{CGateway\-Security}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void CGateway\-Security::Add\-Trace (const char $\ast$ {\em lpsz\-Msg}, {\bf CTrace\-Object::e\-Trace\-Level} {\em e\-Level} = {\tt CTraceObject::MT\_\-ERROR})\hspace{0.3cm}{\tt  [virtual]}}\label{classCGatewaySecurity_a8}


Macht eine Trace-Ausgabe auf dem angeforderten Trace-Level. 

Die Standard-Logik der Basisklasse {\bf CTrace\-Object}{\rm (S.\,\pageref{classCTraceObject})} wird ge\"{a}ndert. \begin{Desc}
\item[Parameter:]
\begin{description}
\item[{\em lpsz\-Msg}]Trace-Ausgabe \item[{\em e\-Level}]zu pruefende Trace-Level \end{description}
\end{Desc}
\begin{Desc}
\item[R\"{u}ckgabe:]true, false aktiv \end{Desc}


Erneute Implementation von {\bf CTrace\-Object} {\rm (S.\,\pageref{classCTraceObject_a2})}.\index{CGatewaySecurity@{CGateway\-Security}!AddValidAddress@{AddValidAddress}}
\index{AddValidAddress@{AddValidAddress}!CGatewaySecurity@{CGateway\-Security}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void CGateway\-Security::Add\-Valid\-Address (const char $\ast$ {\em lpsz\-Valid\-Address})\hspace{0.3cm}{\tt  [private]}}\label{classCGatewaySecurity_d0}


Speichert die IP-Adresse, die sich erfolgreich authentifiziert hat. 

\begin{Desc}
\item[Parameter:]
\begin{description}
\item[{\em lpsz\-Valid\-Address}]IP-Address \end{description}
\end{Desc}
\index{CGatewaySecurity@{CGateway\-Security}!CheckPassPhrase@{CheckPassPhrase}}
\index{CheckPassPhrase@{CheckPassPhrase}!CGatewaySecurity@{CGateway\-Security}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}bool CGateway\-Security::Check\-Pass\-Phrase (const char $\ast$ {\em lpsz\-Password})\hspace{0.3cm}{\tt  [private]}}\label{classCGatewaySecurity_d2}


\"{U}berpr\"{u}ft die Pass\-Phrase eines remote-Partners. 

\begin{Desc}
\item[Parameter:]
\begin{description}
\item[{\em lpsz\-Password}]lfd. Zeichen des Passwords \end{description}
\end{Desc}
\begin{Desc}
\item[R\"{u}ckgabe:]false, falls Password falsch \end{Desc}
\index{CGatewaySecurity@{CGateway\-Security}!GetSecurityPortActive@{GetSecurityPortActive}}
\index{GetSecurityPortActive@{GetSecurityPortActive}!CGatewaySecurity@{CGateway\-Security}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}bool CGateway\-Security::Get\-Security\-Port\-Active (void) const}\label{classCGatewaySecurity_a11}


\"{U}berpr\"{u}ft, ob die Security aktiviert ist. 

\begin{Desc}
\item[R\"{u}ckgabe:]true/false \end{Desc}
\index{CGatewaySecurity@{CGateway\-Security}!GetSecurityRunning@{GetSecurityRunning}}
\index{GetSecurityRunning@{GetSecurityRunning}!CGatewaySecurity@{CGateway\-Security}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}bool CGateway\-Security::Get\-Security\-Running (void) const}\label{classCGatewaySecurity_a12}


\"{U}berpr\"{u}ft, ob die Security-Port bereits gestartet ist. 

\begin{Desc}
\item[R\"{u}ckgabe:]true/false \end{Desc}
\index{CGatewaySecurity@{CGateway\-Security}!ReadIniParameters@{ReadIniParameters}}
\index{ReadIniParameters@{ReadIniParameters}!CGatewaySecurity@{CGateway\-Security}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void CGateway\-Security::Read\-Ini\-Parameters (const char $\ast$ {\em psz\-Ini\-Filename} = {\tt NULL})\hspace{0.3cm}{\tt  [private]}}\label{classCGatewaySecurity_d3}


Liest Security-Parameter aus der angegebenen Konfigurationsdatei. 

\begin{Desc}
\item[Parameter:]
\begin{description}
\item[{\em n\-Server\-Nr}]lfd. Nr des Gateway-Servers \item[{\em psz\-Ini\-Filename}]Konfigurationsdatei \end{description}
\end{Desc}
\index{CGatewaySecurity@{CGateway\-Security}!ReadRegParameters@{ReadRegParameters}}
\index{ReadRegParameters@{ReadRegParameters}!CGatewaySecurity@{CGateway\-Security}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void CGateway\-Security::Read\-Reg\-Parameters (const char $\ast$ {\em psz\-Reg\-Key} = {\tt NULL})\hspace{0.3cm}{\tt  [private]}}\label{classCGatewaySecurity_d4}


Liest Securtiy-Parameter aus der Registry. 

\begin{Desc}
\item[Parameter:]
\begin{description}
\item[{\em n\-Server\-Nr}]lfd. Nr des Gateway-Servers \item[{\em psz\-Reg\-Key}]Name des Registry-Schl\"{u}ssel \end{description}
\end{Desc}
\index{CGatewaySecurity@{CGateway\-Security}!Receive@{Receive}}
\index{Receive@{Receive}!CGatewaySecurity@{CGateway\-Security}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void CGateway\-Security::Receive (void $\ast$ {\em p\-Data}, long {\em Data\-Len})\hspace{0.3cm}{\tt  [virtual]}}\label{classCGatewaySecurity_a5}


Von der Basisklasse {\bf CTCPIPComm}{\rm (S.\,\pageref{classCTCPIPComm})} abgeleitete virtuelle Methode, die Daten von TCP/IP empf\"{a}ngt. 

\begin{Desc}
\item[Parameter:]
\begin{description}
\item[{\em p\-Data}]Zeiger auf den empfangenen Datenbereich. \item[{\em Data\-Len}]L\"{a}nge dieses Datenbereiches. \end{description}
\end{Desc}


Implementiert {\bf CTCPIPComm\-Receive} {\rm (S.\,\pageref{classCTCPIPCommReceive_b0})}.\index{CGatewaySecurity@{CGateway\-Security}!SetParameterInput@{SetParameterInput}}
\index{SetParameterInput@{SetParameterInput}!CGatewaySecurity@{CGateway\-Security}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void CGateway\-Security::Set\-Parameter\-Input (const char $\ast$ {\em lpsz\-Ini\-Filename}, const char $\ast$ {\em lpsz\-Reg\-Key}, bool {\em b\-Run\-As\-Service})}\label{classCGatewaySecurity_a9}


Legt die Eingabe f\"{u}r die Parameter fest. 

\begin{Desc}
\item[Parameter:]
\begin{description}
\item[{\em lpsz\-Ini\-Filename}]Name der INI-Datei (Service-Mode) \item[{\em lpsz\-Reg\-Key}]Name des Basis-Registrier-Schl\"{u}ssels (Console-Mode) \item[{\em b\-Run\-As\-Service}]L\"{a}uft die Anwendung als Windows Service \end{description}
\end{Desc}
\index{CGatewaySecurity@{CGateway\-Security}!StartProcessing@{StartProcessing}}
\index{StartProcessing@{StartProcessing}!CGatewaySecurity@{CGateway\-Security}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}bool CGateway\-Security::Start\-Processing (void)}\label{classCGatewaySecurity_a6}


Startet die Security-Funktionalit\"{a}t. 

\begin{Desc}
\item[R\"{u}ckgabe:]true, falls keine Fehler aufgetreten sind \end{Desc}
\index{CGatewaySecurity@{CGateway\-Security}!StopProcessing@{StopProcessing}}
\index{StopProcessing@{StopProcessing}!CGatewaySecurity@{CGateway\-Security}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}bool CGateway\-Security::Stop\-Processing (void)}\label{classCGatewaySecurity_a7}


Stoppt die Security-Funktionalit\"{a}t. 

\begin{Desc}
\item[R\"{u}ckgabe:]true, falls keine Fehler aufgetreten sind \end{Desc}
\index{CGatewaySecurity@{CGateway\-Security}!VerifyRemotePartner@{VerifyRemotePartner}}
\index{VerifyRemotePartner@{VerifyRemotePartner}!CGatewaySecurity@{CGateway\-Security}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}bool CGateway\-Security::Verify\-Remote\-Partner (const char $\ast$ {\em lpsz\-IPAddress})}\label{classCGatewaySecurity_a13}


\"{U}berpr\"{u}ft, ob der Zugriff des Remote Partner erlaubt ist. 

\begin{Desc}
\item[Parameter:]
\begin{description}
\item[{\em lpsz\-IPAddress}]IP-Address des Remote Partners \end{description}
\end{Desc}
\begin{Desc}
\item[R\"{u}ckgabe:]true/false \end{Desc}


Die Dokumentation f\"{u}r diese Klasse wurde erzeugt aufgrund der Dateien:\begin{CompactItemize}
\item 
Gateway\-Security.h\item 
Gateway\-Security.cpp\end{CompactItemize}
