ApparmorNotifications.hpp

Go to the documentation of this file.
00001 /*---------------------------------------------------------------------\
00002 |                                                                      |
00003 |                     _     _   _   _     __     _                     |
00004 |                    | |   | | | \_/ |   /  \   | |                    |
00005 |                    | |   | | | |_| |  / /\ \  | |                    |
00006 |                    | |__ | | | | | | / ____ \ | |__                  |
00007 |                    |____||_| |_| |_|/ /    \ \|____|                 |
00008 |                                                                      |
00009 |                             apparmor-notifications library                          |
00010 |                                                                      |
00011 |                                         (C) SUSE Linux Products GmbH |
00012 \----------------------------------------------------------------------/
00013 
00014   File:       ApparmorNotifications.hpp
00015 
00016   Author:     Matt Barringer <mbarringer@suse.de>
00017   Maintainer: Matt Barringer <mbarringer@suse.de>
00018 
00019   Purpose: Provides functions to work with AppArmor's internal notification
00020              configuration system.
00021 
00022 /-*/
00028 #ifndef   LIMAL_APPARMOR_NOTIFICATIONS_HPP
00029 #define   LIMAL_APPARMOR_NOTIFICATIONS_HPP
00030 
00031 #include <limal/apparmor-notifications/config.h>
00032 #include <blocxx/Map.hpp>
00033 #include <blocxx/String.hpp>
00034 #include <blocxx/COWIntrusiveReference.hpp>
00035 
00036 namespace LIMAL_NAMESPACE 
00037 {
00038 
00039 namespace APPARMOR_NOTIFICATIONS_NAMESPACE 
00040 { 
00041 
00042 typedef blocxx::Map<blocxx::String, blocxx::String> NotificationsMap;
00043 typedef NotificationsMap::value_type notification_value;
00044 
00045 class ApparmorNotifications 
00046 {
00047 
00048 public:
00049         // I couldn't think of a classier way to put this
00050         enum EConfigType
00051         {
00052                 E_ENABLED,
00053                 E_DISABLED
00054         };
00055 
00059         ApparmorNotifications();
00060         
00064         ~ApparmorNotifications();
00065 
00071         blocxx::String
00072         getNotificationsConfigFile();
00073 
00079         void 
00080         setNotificationsConfigFile(const blocxx::String & value);
00081 
00087         blocxx::String
00088         getNotificationsDisabledConfigFile();
00089 
00095         void
00096         setNotificationsDisabledConfigFile(const blocxx::String& value);
00097 
00104         bool
00105         canReadConfig();
00106 
00112         bool
00113         canWriteConfig();
00114 
00121         bool
00122         canReadDisabledConfig();
00123 
00129         blocxx::Int32
00130         deleteConfig();
00131 
00137         blocxx::Int32
00138         disableConfig();                
00139 
00149         blocxx::Int32
00150         readConfig(NotificationsMap &retMap,
00151                    EConfigType readConfigType);
00152                 
00153         
00161         blocxx::Int32
00162         writeConfig(NotificationsMap &notificationValues);
00163 
00164 private:
00165         class Data;
00166         blocxx::COWIntrusiveReference<Data> m_data;
00167 };
00168 }
00169 
00170 namespace Apparmor
00171 {
00172         using limal::apparmor_notifications::ApparmorNotifications;
00173 } 
00174 }
00175 #endif
00176 

Generated on Sat Sep 22 00:45:04 2007 by  doxygen 1.5.3