summaryrefslogtreecommitdiff
path: root/libsyslog/src/facility.rs
blob: 679403a26dc365bbffae33b7544be896d27af14d (plain)
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
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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
use libsyslog_sys::*;

/// Typesafe representation of syslog facility constants.
#[derive(Debug)]
pub enum Facility {
    /// [LOG_KERN][`libsyslog_sys::LOG_KERN`]  
    /// Kernel messages. Not to sent from userland processes.
    #[cfg(any(target_os = "freebsd", target_os="haiku", target_os = "linux", target_os = "netbsd", target_os = "illumos", target_os = "openbsd"))]
    Kern     = LOG_KERN     as isize,
    /// [LOG_MAIL][`libsyslog_sys::LOG_MAIL`]  
    /// Email system.
    #[cfg(any(target_os = "freebsd", target_os="haiku", target_os = "linux", target_os = "netbsd", target_os = "illumos", target_os = "openbsd"))]
    Mail     = LOG_MAIL     as isize,
    /// [LOG_DAEMON][`libsyslog_sys::LOG_DAEMON`]  
    /// Daemons.
    #[cfg(any(target_os = "freebsd", target_os="haiku", target_os = "linux", target_os = "netbsd", target_os = "illumos", target_os = "openbsd"))]
    Daemon   = LOG_DAEMON   as isize,
    /// [LOG_AUTH][`libsyslog_sys::LOG_AUTH`]  
    /// Authentication.
    #[cfg(any(target_os = "freebsd", target_os="haiku", target_os = "linux", target_os = "netbsd", target_os = "illumos", target_os = "openbsd"))]
    Auth     = LOG_AUTH     as isize,
    /// [LOG_SYSLOG][`libsyslog_sys::LOG_SYSLOG`]  
    /// Internal messages from syslog. Not to be sent from other processes.
    #[cfg(any(target_os = "freebsd", target_os="haiku", target_os = "linux", target_os = "netbsd", target_os = "illumos", target_os = "openbsd"))]
    Syslog   = LOG_SYSLOG   as isize,
    /// [LOG_LPR][`libsyslog_sys::LOG_LPR`]  
    /// Printing.
    #[cfg(any(target_os = "freebsd", target_os="haiku", target_os = "linux", target_os = "netbsd", target_os = "illumos", target_os = "openbsd"))]
    Lpr      = LOG_LPR      as isize,
    /// [LOG_NEWS][`libsyslog_sys::LOG_NEWS`]  
    /// Usenet.
    #[cfg(any(target_os = "freebsd", target_os="haiku", target_os = "linux", target_os = "netbsd", target_os = "illumos", target_os = "openbsd"))]
    News     = LOG_NEWS     as isize,
    /// [LOG_UUCP][`libsyslog_sys::LOG_UUCP`]  
    /// Unix to unix copy
    #[cfg(any(target_os = "freebsd", target_os="haiku", target_os = "linux", target_os = "netbsd", target_os = "illumos", target_os = "openbsd"))]
    Uucp     = LOG_UUCP     as isize,
    /// [LOG_CRON][`libsyslog_sys::LOG_CRON`]  
    /// Scheduled jobs (at and cron).
    #[cfg(any(target_os = "freebsd", target_os="haiku", target_os = "linux", target_os = "netbsd", target_os = "illumos", target_os = "openbsd"))]
    Cron     = LOG_CRON     as isize,
    /// [LOG_AUTHPRIV][`libsyslog_sys::LOG_AUTHPRIV`]  
    /// Authentication, sensitive data.
    #[cfg(any(target_os = "freebsd", target_os="haiku", target_os = "linux", target_os = "netbsd", target_os = "illumos", target_os = "openbsd"))]
    AuthPriv = LOG_AUTHPRIV as isize,
    /// [LOG_FTP][`libsyslog_sys::LOG_FTP`]  
    /// File transfer protocol system.
    #[cfg(any(target_os = "freebsd", target_os="haiku", target_os = "linux", target_os = "netbsd", target_os = "illumos", target_os = "openbsd"))]
    Ftp      = LOG_FTP      as isize,

    /// [LOG_ALTCRON][`libsyslog_sys::LOG_ALTCRON`]  
    /// Scheduled jobs, BSD (at and cron).
    #[cfg(target_os = "illumos")]
    AltCron  = LOG_ALTCRON  as isize,
    /// [LOG_NTP][`libsyslog_sys::LOG_NTP`]  
    /// Network time protocol.
    #[cfg(any(target_os = "freebsd", target_os = "illumos"))]
    Ntp      = LOG_NTP      as isize,
    /// [LOG_AUDIT][`libsyslog_sys::LOG_AUDIT`] or LOG_SECURITY  
    /// Security/Audit. Low level constant varies between platforms.
    #[cfg(target_os = "illumos")]
    Security = LOG_AUDIT    as isize,
    /// LOG_AUDIT or [LOG_SECURITY][`libsyslog_sys::LOG_SECURITY`]  
    /// Security/Audit. Low level constant varies between platforms.
    #[cfg(target_os = "freebsd")]
    Security = LOG_SECURITY as isize,
    /// [LOG_CONSOLE][`libsyslog_sys::LOG_CONSOLE`]  
    /// Console, BSD.
    #[cfg(any(target_os = "freebsd", target_os = "illumos"))]
    Console  = LOG_CONSOLE  as isize,

    /// [LOG_USER][`libsyslog_sys::LOG_USER`]  
    /// Default facility.
    User     = LOG_USER     as isize,
    /// [LOG_LOCAL0][`libsyslog_sys::LOG_LOCAL0`]  
    /// Site specific facility 0.
    Local0   = LOG_LOCAL0   as isize,
    /// [LOG_LOCAL1][`libsyslog_sys::LOG_LOCAL1`]  
    /// Site specific facility 1.
    Local1   = LOG_LOCAL1   as isize,
    /// [LOG_LOCAL2][`libsyslog_sys::LOG_LOCAL2`]  
    /// Site specific facility 2.
    Local2   = LOG_LOCAL2   as isize,
    /// [LOG_LOCAL3][`libsyslog_sys::LOG_LOCAL3`]  
    /// Site specific facility 3.
    Local3   = LOG_LOCAL3   as isize,
    /// [LOG_LOCAL4][`libsyslog_sys::LOG_LOCAL4`]  
    /// Site specific facility 4.
    Local4   = LOG_LOCAL4   as isize,
    /// [LOG_LOCAL5][`libsyslog_sys::LOG_LOCAL5`]  
    /// Site specific facility 5.
    Local5   = LOG_LOCAL5   as isize,
    /// [LOG_LOCAL6][`libsyslog_sys::LOG_LOCAL6`]  
    /// Site specific facility 6.
    Local6   = LOG_LOCAL6   as isize,
    /// [LOG_LOCAL7][`libsyslog_sys::LOG_LOCAL7`]  
    /// Site specific facility 7.
    Local7   = LOG_LOCAL7   as isize,
}

impl Default for Facility {
    fn default() -> Facility {
    //! Returns [`Facility::User`].

      Facility::User
    }
}