blob: 3568f2887aa8cdbf1d09cefdaacac4804d01852b [file] [log] [blame]
Brian Silverman14fd0fb2014-01-14 21:42:01 -08001#ifndef AOS_LINUX_CODE_CONFIGURATION_H_
2#define AOS_LINUX_CODE_CONFIGURATION_H_
Brian Silverman66f079a2013-08-26 16:24:30 -07003
4#include <stdint.h>
5#include <sys/socket.h>
6#include <netinet/in.h>
7#include <arpa/inet.h>
8
9namespace aos {
10
11// Holds global configuration data. All of the functions are safe to call
12// from wherever.
13namespace configuration {
14
15// Returns "our" IP address.
16const in_addr &GetOwnIPAddress();
17
18// Returns the "root directory" for this run. Under linux, this is the
19// directory where the executable is located (from /proc/self/exe)
20// The return value will always be to a static string, so no freeing is
21// necessary.
22const char *GetRootDirectory();
23// Returns the directory where logs get written. Relative to GetRootDirectory().
24// The return value will always be to a static string, so no freeing is
25// necessary.
26const char *GetLoggingDirectory();
27
28} // namespace configuration
29} // namespace aos
30
Brian Silverman14fd0fb2014-01-14 21:42:01 -080031#endif // AOS_LINUX_CODE_CONFIGURATION_H_