usb_moded-config.h 3.93 KB
Newer Older
1
/*
2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
 * Copyright (C) 2010 Nokia Corporation. All rights reserved.
 * Copyright (C) 2012-2018 Jolla. All rights reserved.
 *
 * author: Philippe De Swert <philippe.de-swert@nokia.com>
 * author: Philippe De Swert <phdeswer@lumi.maa>
 * author: Philippe De Swert <philippedeswert@gmail.com>
 * author: Philippe De Swert <philippe.deswert@jollamobile.com>
 * author: Thomas Perl <m@thp.io>
 * author: Slava Monich <slava.monich@jolla.com>
 * author: Simo Piiroinen <simo.piiroinen@jollamobile.com>
 * author: Andrew den Exter <andrew.den.exter@jolla.com>
 *
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the Lesser GNU General Public License
 * version 2 as published by the Free Software Foundation.
 *
 * This program is distributed in the hope that it will be useful, but
 * WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * General Public License for more details.
 *
 * You should have received a copy of the Lesser GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
 * 02110-1301 USA
 */
phdeswer's avatar
phdeswer committed
29

30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78
#ifndef  USB_MODED_CONFIG_H_
# define USB_MODED_CONFIG_H_

/* ========================================================================= *
 * Constants
 * ========================================================================= */

# define CONFIG_FILE_DIR                "/etc/usb-moded"
# define FS_MOUNT_CONFIG_FILE           CONFIG_FILE_DIR"/usb-moded.ini"

# define MODE_SETTING_ENTRY             "usbmode"
# define MODE_SETTING_KEY               "mode"
# define FS_MOUNT_DEFAULT               "/dev/mmcblk0p1"
# define FS_MOUNT_ENTRY                 "mountpoints"
# define FS_MOUNT_KEY                   "mount"
# define FS_SYNC_ENTRY                  "sync"
# define FS_SYNC_KEY                    "nofua"
# define ALT_MOUNT_ENTRY                "altmount"
# define ALT_MOUNT_KEY                  "mount"
# define UDEV_PATH_ENTRY                "udev"
# define UDEV_PATH_KEY                  "path"
# define UDEV_SUBSYSTEM_KEY             "subsystem"
# define CDROM_ENTRY                    "cdrom"
# define CDROM_PATH_KEY                 "path"
# define CDROM_TIMEOUT_KEY              "timeout"
# define TRIGGER_ENTRY                  "trigger"
# define TRIGGER_PATH_KEY               "path"
# define TRIGGER_UDEV_SUBSYSTEM         "udev_subsystem"
# define TRIGGER_MODE_KEY               "mode"
# define TRIGGER_PROPERTY_KEY           "property"
# define TRIGGER_PROPERTY_VALUE_KEY     "value"
# define NETWORK_ENTRY                  "network"
# define NETWORK_IP_KEY                 "ip"
# define NETWORK_INTERFACE_KEY          "interface"
# define NETWORK_GATEWAY_KEY            "gateway"
# define NETWORK_NAT_INTERFACE_KEY      "nat_interface"
# define NETWORK_NETMASK_KEY            "netmask"
# define NO_ROAMING_KEY                 "noroaming"
# define ANDROID_ENTRY                  "android"
# define ANDROID_MANUFACTURER_KEY       "iManufacturer"
# define ANDROID_VENDOR_ID_KEY          "idVendor"
# define ANDROID_PRODUCT_KEY            "iProduct"
# define ANDROID_PRODUCT_ID_KEY         "idProduct"
# define MODE_HIDE_KEY                  "hide"
# define MODE_WHITELIST_KEY             "whitelist"

/* ========================================================================= *
 * Types
 * ========================================================================= */
79

80 81
/** Configuration change result
 */
82
typedef enum set_config_result_t {
83 84 85
    SET_CONFIG_ERROR = -1,  /**< Value change failed */
    SET_CONFIG_UPDATED,     /**< Value change succeeded */
    SET_CONFIG_UNCHANGED,   /**< Value did not change */
86 87
} set_config_result_t;

88 89 90
/* ========================================================================= *
 * Prototypes
 * ========================================================================= */
91

92
// (in usb_moded-config-private.h)
93

94
#endif /* USB_MODED_CONFIG_H_ */