softwarecontainer
0.18.0-739e8d7 2017-05-04
|
Developers guide to adding a config item: More...
Data Structures | |
class | BadSuffixError |
class | BaseConfigStore |
class | BoolConfig |
Represents a config item of type bool. More... | |
class | CapabilityParseError |
An error occured in ConfigStore when parsing a Capability in a Service Manifest. More... | |
class | CgroupsGateway |
The cgroups gateway sets cgroups related settings for the container. More... | |
class | CgroupsGatewayError |
class | CGroupsParser |
class | CleanUpHandler |
class | CommandJob |
Use this class to execute a command line in a SoftwareContainer. More... | |
class | CommandlineConfigSource |
A config source representing the commandline options. More... | |
class | Config |
Represents the configuration of SoftwareContainer (the component) More... | |
class | ConfigDefinition |
class | ConfigDependencyError |
class | ConfigError |
class | ConfigFileError |
An error occured in a Glib operation. More... | |
class | ConfigInternalError |
An error occured which is an internal error in the config code. More... | |
class | ConfigItem |
Base class for all config item types. More... | |
class | ConfigLoader |
class | ConfigMandatoryError |
class | ConfigNotFoundError |
A requested config item could not be found in any of the config sources. More... | |
class | ConfigSource |
Base class for all config sources. More... | |
class | ConfigStoreError |
class | ConfigTypes |
class | ConfigUnknownError |
A config is found which is not defined in ConfigDefinition. More... | |
class | Container |
The Container class is an abstraction of the specific containment technology used. More... | |
class | ContainerAbstractInterface |
class | ContainerError |
An error has occured in the underlying container implementation. More... | |
class | ContainerOptionParseError |
class | ContainerOptionParser |
class | ContainerUtilityInterface |
class | ContainerUtilityInterfaceError |
An error occured in ContainerUtilityInterface. More... | |
class | CreateDir |
The CreateDir class is responsible for creating new directories and removing them when it is necessary. More... | |
class | DBusGateway |
class | DBusGatewayInstance |
DBus Gateway takes care of spawning and killing the DBus proxies. More... | |
class | DBusGatewayParser |
class | DefaultConfigSource |
Represents the default config values. More... | |
class | DefaultConfigStore |
class | Device |
class | DeviceNodeGateway |
This gateway is responsible for exposing device nodes in an LXC container. More... | |
class | DeviceNodeGatewayError |
class | DeviceNodeLogic |
This class is responsible for storing all device node configurations in a well-formed list. More... | |
class | DirectoryCleanUpHandler |
class | DynamicContainerOptions |
class | EnvironmentGateway |
Environment Gateway is used to define environment variables to the container. More... | |
class | EnvironmentGatewayParser |
class | Executable |
class | FileCleanUpHandler |
The FileCleanUpHandler class is a subclass of CleanUpHandler that deletes a file. More... | |
class | FileConfigLoader |
class | FileGateway |
This gateway lets you map files (including socket files) or folders from the host into the container's filesystem. More... | |
class | FileGatewayParser |
class | FileGatewaySettingStore |
class | FileToolkitWithUndo |
class | FilteredConfigStore |
class | FunctionJob |
Run a C++ function lambda inside a SoftwareContainer. More... | |
class | Gateway |
Gateway base class for SoftwareContainer. More... | |
class | GatewayConfiguration |
class | GatewayError |
class | GatewayParserError |
class | IntConfig |
Represents a config item of type int. More... | |
class | InvalidContainerError |
The container instance is in an invalid state and should not be used. More... | |
class | InvalidInputError |
class | InvalidOperationError |
A method was called which is inappropriate in the current state. More... | |
class | IPAllocationError |
class | IPTableEntry |
A rules entry for the treatment of packets. More... | |
class | JobAbstract |
Abstract class for jobs which get executed inside a container. More... | |
class | JSonError |
class | JSONParser |
Convenience layer for the Jansson JSON parser. More... | |
class | LimitRangeError |
class | MainConfigSource |
class | MountCleanUpHandler |
class | Netlink |
Handles various network operations over netlink. More... | |
class | NetworkGateway |
Sets up and manages network access and routing to the container. More... | |
class | NetworkGatewayError |
class | NetworkGatewayFunctions |
Sets up and manages network access and routing to the container. More... | |
class | NetworkGatewayParser |
class | OverlaySyncCleanupHandler |
The OverlaySyncCleanupHandler class is used to copy files on cleanup and can be added to the CleanupHandler stack in the FileToolkitWithUndo class. More... | |
class | PulseGateway |
The PulseAudio Gateway is used to provide access to the host system PulseAudio server. More... | |
class | RecursiveCopy |
The RecursiveCopy class is a singleton class used to copy files recursively from a source to a destination. More... | |
class | RecursiveDelete |
The RecursiveDelete class is a singleton class used to delete files recursively in a directory. More... | |
class | ServiceManifestFileLoader |
class | ServiceManifestLoader |
Base class used for creating a service manifest loader. More... | |
class | ServiceManifestParseError |
An error occured in ConfigStore when parsing a Service Manifest. More... | |
class | ServiceManifestPathError |
An error occured in ConfigStore relating to the path to the Service Manifest(s) More... | |
class | SignalConnectionsHandler |
The SignalConnectionsHandler class contains references to sigc++ connections and automatically disconnects them on destruction. More... | |
class | SoftwareContainer |
An abstraction of concrete container implementations. More... | |
class | SoftwareContainerAbstractInterface |
class | SoftwareContainerAgent |
class | SoftwareContainerAgentAdaptor |
class | SoftwareContainerAgentError |
An error occured in SoftwareContainerAgent. More... | |
class | SoftwareContainerConfig |
Contains all values that should be passed to SoftwareContainer on creation. More... | |
class | SoftwareContainerError |
class | SoftwareContainerFactory |
class | StringConfig |
Represents a config item of type string. More... | |
class | WaylandGateway |
Typedefs | |
typedef std::vector< std::tuple< std::string, std::string, ConfigType, MandatoryFlag > > | ConfigItems |
typedef std::pair< std::string, std::string > | UniqueKey |
typedef std::vector< UniqueKey > | MandatoryConfigs |
typedef std::map< UniqueKey, std::vector< UniqueKey > > | ConfigDependencies |
typedef std::map< UniqueKey, ConfigType > | TypeMap |
typedef bool | MandatoryFlag |
typedef int32_t | ContainerID |
typedef std::map< std::string, std::string > | EnvironmentVariables |
typedef logging::DefaultLogContext | LogContext |
Enumerations | |
enum | ConfigType { String, Integer, Boolean } |
Represents the type of a config value. More... | |
enum | ConfigSourceType { Commandline, Main, Default } |
enum | ContainerState { READY, SUSPENDED, TERMINATED, INVALID } |
Functions | |
LOG_DEFINE_APP_IDS ("SCAG","SoftwareContainer agent") | |
LOG_DECLARE_DEFAULT_CONTEXT (PAM_DefaultLogContext,"MAIN","Main context") | |
int | copyFile (const char *, const struct stat, int) |
int | copyFile (const char *srcPath, const struct stat *sb, int typeflag) |
copy_file Copy files from src_path to dst_root global path More... | |
int | deleteFile (const char *, const struct stat, int, struct FTW *ftwbuf) |
int | deleteFile (const char *deletePath, const struct stat *sb, int typeflag, struct FTW *ftwbuf) |
deleteFile Delete files from the directory More... | |
void | addProcessListener (SignalConnectionsHandler &connections, pid_t pid, std::function< void(pid_t, int)> function, Glib::RefPtr< Glib::MainContext > context) |
addProcessListener Adds a glib child watch for a process. More... | |
LOG_DECLARE_DEFAULT_CONTEXT (defaultLogContext,"MAIN","Main context") | |
bool | getStat (const std::string &path, struct stat &st) |
bool | isDirectory (const std::string &path) |
isDirectory Check if path is a directory More... | |
bool | isDirectoryEmpty (const std::string &path) |
isDirectoryEmpty Check if path is empty More... | |
bool | isFile (const std::string &path) |
isFile Check if path is a file More... | |
bool | isPipe (const std::string &path) |
isPipe Check if path is a pipe More... | |
bool | isSocket (const std::string &path) |
isSocket Check if path is a socket More... | |
bool | existsInFileSystem (const std::string &path) |
existsInFileSystem Check if path exists More... | |
std::string | parentPath (const std::string &path_) |
std::string | baseName (const std::string &path) |
std::string | buildPath (const std::string &arg1, const std::string &arg2) |
std::string | buildPath (const std::string &arg1, const std::string &arg2, const std::string &arg3) |
bool | touch (const std::string &path) |
bool | writeToFile (const std::string &path, const std::string &content) |
bool | readFromFile (const std::string &path, std::string &content) |
bool | parseInt (const char *arg, int *result) |
int | waitForProcessTermination (pid_t pid) |
waitForProcessTermination Waits for a process to terminate and then returns the status of the process terminating. More... | |
Developers guide to adding a config item:
|
strong |
Represents the type of a config value.
This is used to specify the type of the a value when mandatory configs are defined. This information is later used to know how a key should be used to retrive a value, e.g. what type specific methods can be used.
Definition at line 32 of file configtypes.h.
int softwarecontainer::copyFile | ( | const char * | srcPath, |
const struct stat * | sb, | ||
int | typeflag | ||
) |
copy_file Copy files from src_path to dst_root global path
This function is wrapped and hidden in this separate code unit because of it's side effects and used by the RecursiveCopy::copy() function.
src_path | The path of the file to copy |
sb | not used in this function |
typeflag | Points to what type of node is traversed by ftw(). Uses the global variables dst_root and src_root to know the root directories being copied to and from. These must not be changed while ftw is running or the function will misbehave. |
Definition at line 49 of file recursivecopy.cpp.
int softwarecontainer::deleteFile | ( | const char * | deletePath, |
const struct stat * | sb, | ||
int | typeflag, | ||
struct FTW * | ftwbuf | ||
) |
deleteFile Delete files from the directory
deletePath | The path of the file to delete |
sb | not used in this function |
typeflag | Points to what type of node is traversed by ftw(). |
Definition at line 41 of file recursivedelete.cpp.
|
inline |
addProcessListener Adds a glib child watch for a process.
connections | Add the signal to this list of connections |
pid | The pid to watch for. |
function | A lambda/function pointer to run when the signal is sent for a process. |
context | glib context to attach the SignalChildWatch to. |
Definition at line 58 of file signalconnectionshandler.h.
References softwarecontainer::SignalConnectionsHandler::addConnection().
Referenced by softwarecontainer::SoftwareContainerAgent::execute().
bool softwarecontainer::isDirectory | ( | const std::string & | path | ) |
isDirectory Check if path is a directory
path | Path to check |
Definition at line 43 of file softwarecontainer-common.cpp.
Referenced by softwarecontainer::FileToolkitWithUndo::bindMount(), softwarecontainer::Container::bindMountInContainer(), softwarecontainer::ContainerUtilityInterface::checkWorkspace(), softwarecontainer::CreateDir::createDirectory(), softwarecontainer::ServiceManifestFileLoader::loadContent(), softwarecontainer::SoftwareContainer::previouslyConfigured(), and waitForProcessTermination().
bool softwarecontainer::isDirectoryEmpty | ( | const std::string & | path | ) |
isDirectoryEmpty Check if path is empty
path | The path to check |
Definition at line 53 of file softwarecontainer-common.cpp.
Referenced by softwarecontainer::ServiceManifestFileLoader::loadContent(), softwarecontainer::SoftwareContainer::previouslyConfigured(), softwarecontainer::FileToolkitWithUndo::tmpfsMount(), and waitForProcessTermination().
bool softwarecontainer::isFile | ( | const std::string & | path | ) |
isFile Check if path is a file
path | Path to check |
Definition at line 75 of file softwarecontainer-common.cpp.
Referenced by softwarecontainer::ServiceManifestFileLoader::loadContent(), and waitForProcessTermination().
bool softwarecontainer::isPipe | ( | const std::string & | path | ) |
isPipe Check if path is a pipe
path | Path to check |
Definition at line 85 of file softwarecontainer-common.cpp.
Referenced by waitForProcessTermination().
bool softwarecontainer::isSocket | ( | const std::string & | path | ) |
isSocket Check if path is a socket
path | Path to check |
Definition at line 95 of file softwarecontainer-common.cpp.
Referenced by waitForProcessTermination().
bool softwarecontainer::existsInFileSystem | ( | const std::string & | path | ) |
existsInFileSystem Check if path exists
path | Path to check |
Definition at line 105 of file softwarecontainer-common.cpp.
Referenced by softwarecontainer::FileToolkitWithUndo::bindMount(), softwarecontainer::Container::bindMountInContainer(), and waitForProcessTermination().
|
inline |
waitForProcessTermination Waits for a process to terminate and then returns the status of the process terminating.
pid | the process id to wait for. |
Definition at line 45 of file softwarecontainer-common.h.
References existsInFileSystem(), isDirectory(), isDirectoryEmpty(), isFile(), isPipe(), and isSocket().
Referenced by softwarecontainer::Container::executeSync().