You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

598 lines
22 KiB

  1. /* /////////////////////////////////////////////////////////////////////////
  2. * File: pantheios/backends/bec.WindowsSyslog.h
  3. *
  4. * Purpose: Declaration of the Pantheios Windows-SysLog Stock Back-end API.
  5. *
  6. * Created: 23rd September 2005
  7. * Updated: 30th April 2010
  8. *
  9. * Home: http://www.pantheios.org/
  10. *
  11. * Copyright (c) 2005-2010, Matthew Wilson and Synesis Software
  12. * All rights reserved.
  13. *
  14. * Redistribution and use in source and binary forms, with or without
  15. * modification, are permitted provided that the following conditions are
  16. * met:
  17. *
  18. * - Redistributions of source code must retain the above copyright notice,
  19. * this list of conditions and the following disclaimer.
  20. * - Redistributions in binary form must reproduce the above copyright
  21. * notice, this list of conditions and the following disclaimer in the
  22. * documentation and/or other materials provided with the distribution.
  23. * - Neither the name(s) of Matthew Wilson and Synesis Software nor the
  24. * names of any contributors may be used to endorse or promote products
  25. * derived from this software without specific prior written permission.
  26. *
  27. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
  28. * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
  29. * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
  30. * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
  31. * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
  32. * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
  33. * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
  34. * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
  35. * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  36. * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
  37. * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  38. *
  39. * ////////////////////////////////////////////////////////////////////// */
  40. /** \file pantheios/backends/bec.WindowsSyslog.h
  41. *
  42. * [C, C++] Pantheios Windows-SysLog Back-end Common API
  43. */
  44. #ifndef PANTHEIOS_INCL_PANTHEIOS_BACKENDS_H_BEC_WINDOWSSYSLOG
  45. #define PANTHEIOS_INCL_PANTHEIOS_BACKENDS_H_BEC_WINDOWSSYSLOG
  46. /* /////////////////////////////////////////////////////////////////////////
  47. * Version information
  48. */
  49. #ifndef PANTHEIOS_DOCUMENTATION_SKIP_SECTION
  50. # define PANTHEIOS_VER_PANTHEIOS_BACKENDS_H_BEC_WINDOWSSYSLOG_MAJOR 4
  51. # define PANTHEIOS_VER_PANTHEIOS_BACKENDS_H_BEC_WINDOWSSYSLOG_MINOR 1
  52. # define PANTHEIOS_VER_PANTHEIOS_BACKENDS_H_BEC_WINDOWSSYSLOG_REVISION 2
  53. # define PANTHEIOS_VER_PANTHEIOS_BACKENDS_H_BEC_WINDOWSSYSLOG_EDIT 22
  54. #endif /* !PANTHEIOS_DOCUMENTATION_SKIP_SECTION */
  55. /* /////////////////////////////////////////////////////////////////////////
  56. * Includes
  57. */
  58. #ifndef PANTHEIOS_INCL_PANTHEIOS_H_PANTHEIOS
  59. # include <pantheios/pantheios.h>
  60. #endif /* !PANTHEIOS_INCL_PANTHEIOS_H_PANTHEIOS */
  61. #ifndef PANTHEIOS_INCL_PANTHEIOS_H_BACKEND
  62. # include <pantheios/backend.h>
  63. #endif /* !PANTHEIOS_INCL_PANTHEIOS_H_BACKEND */
  64. /* /////////////////////////////////////////////////////////////////////////
  65. * Documentation
  66. */
  67. /** \defgroup group__backend__stock_backends__WindowsSyslog Pantheios Windows-SysLog Stock Back-end
  68. * \ingroup group__backend__stock_backends
  69. * Back-end library that provides a custom implementation of the
  70. * <b>SysLog</b>-protocol for Windows.
  71. */
  72. /* /////////////////////////////////////////////////////////////////////////
  73. * Constants
  74. */
  75. /** \defgroup group__backend__stock_backends__WindowsSyslog__flags Pantheios Windows syslog Stock Back-end Flags
  76. * \ingroup group__backend__stock_backends__WindowsSyslog
  77. * Flags for the \ref group__backend__stock_backends__WindowsSyslog
  78. */
  79. /** \def PANTHEIOS_BE_WINDOWSSYSLOG_F_USE_SYSTEM_TIME
  80. * Causes the \ref group__backend__stock_backends__WindowsSyslog to
  81. * use system time, rather than local time, from emitted log statements.
  82. * \ingroup group__backend__stock_backends__WindowsSyslog__flags
  83. */
  84. #define PANTHEIOS_BE_WINDOWSSYSLOG_F_USE_SYSTEM_TIME PANTHEIOS_BE_INIT_F_USE_SYSTEM_TIME
  85. /** \def PANTHEIOS_BE_WINDOWSSYSLOG_F_PERROR
  86. * Causes the \ref group__backend__stock_backends__WindowsSyslog to
  87. * write to the calling process' standard error, in addition to submitting
  88. * it to SysLog.
  89. * \ingroup group__backend__stock_backends__WindowsSyslog__flags
  90. *
  91. * Specifying this flag causes the pan_be_WindowsSyslog_init_t::options member to
  92. * contain the SysLog <code>LOG_PERROR</code> flag.
  93. */
  94. #define PANTHEIOS_BE_WINDOWSSYSLOG_F_PERROR (0x00100000)
  95. /** \def PANTHEIOS_BE_WINDOWSSYSLOG_F_CONS
  96. * Causes the \ref group__backend__stock_backends__WindowsSyslog to
  97. * write any message that fails to be submitted to SysLog to the system
  98. * console.
  99. * \ingroup group__backend__stock_backends__WindowsSyslog__flags
  100. *
  101. * Specifying this flag causes the pan_be_WindowsSyslog_init_t::options member to
  102. * contain the SysLog <code>LOG_CONS</code> flag.
  103. */
  104. #define PANTHEIOS_BE_WINDOWSSYSLOG_F_CONS (0x00200000)
  105. /** \def PANTHEIOS_BE_WINDOWSSYSLOG_F_PID
  106. * Causes the \ref group__backend__stock_backends__WindowsSyslog to include
  107. * the process Id in the statement.
  108. * \ingroup group__backend__stock_backends__WindowsSyslog__flags
  109. *
  110. * Specifying this flag causes the pan_be_WindowsSyslog_init_t::options member to
  111. * contain the SysLog <code>LOG_PID</code> flag.
  112. */
  113. #define PANTHEIOS_BE_WINDOWSSYSLOG_F_PID (0x00400000)
  114. /** \def PANTHEIOS_BE_WINDOWSSYSLOG_F_NDELAY
  115. * Causes the \ref group__backend__stock_backends__WindowsSyslog to
  116. * connect to the syslog socket immediately, rather than on the first call
  117. * to <code>syslog()</code>.
  118. * \ingroup group__backend__stock_backends__WindowsSyslog__flags
  119. *
  120. * Specifying this flag causes the pan_be_WindowsSyslog_init_t::options member to
  121. * contain the SysLog <code>LOG_NDELAY</code> flag.
  122. */
  123. #define PANTHEIOS_BE_WINDOWSSYSLOG_F_NDELAY (0x00800000)
  124. /** \defgroup group__backend__stock_backends__WindowsSyslog__facilities Pantheios Windows syslog Facility Codes
  125. * \ingroup group__backend__stock_backends__WindowsSyslog
  126. * Facility levels for the \ref group__backend__stock_backends__WindowsSyslog
  127. */
  128. /** \def PANTHEIOS_SYSLOG_FAC_KERN
  129. * Kernel messages
  130. * \remarks Equivalent to the SysLog facility <code>LOG_KERN</code>.
  131. * \ingroup group__backend__stock_backends__WindowsSyslog__facilities
  132. */
  133. #ifdef LOG_KERN
  134. # define PANTHEIOS_SYSLOG_FAC_KERN LOG_KERN
  135. #else /* ? LOG_KERN */
  136. # define PANTHEIOS_SYSLOG_FAC_KERN (0)
  137. #endif /* LOG_KERN */
  138. /** \def PANTHEIOS_SYSLOG_FAC_USER
  139. * Arbitrary user-level messages (the default)
  140. * \remarks Equivalent to the SysLog facility <code>LOG_USER</code>.
  141. * \ingroup group__backend__stock_backends__WindowsSyslog__facilities
  142. */
  143. #ifdef LOG_USER
  144. # define PANTHEIOS_SYSLOG_FAC_USER LOG_USER
  145. #else /* ? LOG_USER */
  146. # define PANTHEIOS_SYSLOG_FAC_USER (1)
  147. #endif /* LOG_USER */
  148. /** \def PANTHEIOS_SYSLOG_FAC_MAIL
  149. * Mail system messages
  150. * \remarks Equivalent to the SysLog facility <code>LOG_MAIL</code>.
  151. * \ingroup group__backend__stock_backends__WindowsSyslog__facilities
  152. */
  153. #ifdef LOG_MAIL
  154. # define PANTHEIOS_SYSLOG_FAC_MAIL LOG_MAIL
  155. #else /* ? LOG_MAIL */
  156. # define PANTHEIOS_SYSLOG_FAC_MAIL (2)
  157. #endif /* LOG_MAIL */
  158. /** \def PANTHEIOS_SYSLOG_FAC_DAEMON
  159. * System daemon messages
  160. * \remarks Equivalent to the SysLog facility <code>LOG_DAEMON</code>.
  161. * \ingroup group__backend__stock_backends__WindowsSyslog__facilities
  162. */
  163. #ifdef LOG_DAEMON
  164. # define PANTHEIOS_SYSLOG_FAC_DAEMON LOG_DAEMON
  165. #else /* ? LOG_DAEMON */
  166. # define PANTHEIOS_SYSLOG_FAC_DAEMON (3)
  167. #endif /* LOG_DAEMON */
  168. /** \def PANTHEIOS_SYSLOG_FAC_AUTH
  169. * Security / authorisation messages
  170. * \remarks Equivalent to the SysLog facility <code>LOG_AUTH</code>.
  171. * \ingroup group__backend__stock_backends__WindowsSyslog__facilities
  172. */
  173. #ifdef LOG_AUTH
  174. # define PANTHEIOS_SYSLOG_FAC_AUTH LOG_AUTH
  175. #else /* ? LOG_AUTH */
  176. # define PANTHEIOS_SYSLOG_FAC_AUTH (4)
  177. #endif /* LOG_AUTH */
  178. /** \def PANTHEIOS_SYSLOG_FAC_SYSLOG
  179. * SysLog (or Pantheios) messages
  180. * \remarks Equivalent to the SysLog facility <code>LOG_SYSLOG</code>.
  181. * \ingroup group__backend__stock_backends__WindowsSyslog__facilities
  182. */
  183. #ifdef LOG_SYSLOG
  184. # define PANTHEIOS_SYSLOG_FAC_SYSLOG LOG_SYSLOG
  185. #else /* ? LOG_SYSLOG */
  186. # define PANTHEIOS_SYSLOG_FAC_SYSLOG (5)
  187. #endif /* LOG_SYSLOG */
  188. /** \def PANTHEIOS_SYSLOG_FAC_LPR
  189. * Printer messages
  190. * \remarks Equivalent to the SysLog facility <code>LOG_LPR</code>.
  191. * \ingroup group__backend__stock_backends__WindowsSyslog__facilities
  192. */
  193. #ifdef LOG_LPR
  194. # define PANTHEIOS_SYSLOG_FAC_LPR LOG_LPR
  195. #else /* ? LOG_LPR */
  196. # define PANTHEIOS_SYSLOG_FAC_LPR (6)
  197. #endif /* LOG_LPR */
  198. /** \def PANTHEIOS_SYSLOG_FAC_NEWS
  199. * Network news subsystem messages
  200. * \remarks Equivalent to the SysLog facility <code>LOG_NEWS</code>.
  201. * \ingroup group__backend__stock_backends__WindowsSyslog__facilities
  202. */
  203. #ifdef LOG_NEWS
  204. # define PANTHEIOS_SYSLOG_FAC_NEWS LOG_NEWS
  205. #else /* ? LOG_NEWS */
  206. # define PANTHEIOS_SYSLOG_FAC_NEWS (7)
  207. #endif /* LOG_NEWS */
  208. /** \def PANTHEIOS_SYSLOG_FAC_UUCP
  209. * UUCP subsystem messages
  210. * \remarks Equivalent to the SysLog facility <code>LOG_UUCP</code>.
  211. * \ingroup group__backend__stock_backends__WindowsSyslog__facilities
  212. */
  213. #ifdef LOG_UUCP
  214. # define PANTHEIOS_SYSLOG_FAC_UUCP LOG_UUCP
  215. #else /* ? LOG_UUCP */
  216. # define PANTHEIOS_SYSLOG_FAC_UUCP (8)
  217. #endif /* LOG_UUCP */
  218. /** \def PANTHEIOS_SYSLOG_FAC_CRON
  219. * Scheduler daemon messages
  220. * \remarks Equivalent to the SysLog facility <code>LOG_CRON</code>.
  221. * \ingroup group__backend__stock_backends__WindowsSyslog__facilities
  222. */
  223. #ifdef LOG_CRON
  224. # define PANTHEIOS_SYSLOG_FAC_CRON LOG_CRON
  225. #else /* ? LOG_CRON */
  226. # define PANTHEIOS_SYSLOG_FAC_CRON (9)
  227. #endif /* LOG_CRON */
  228. /** \def PANTHEIOS_SYSLOG_FAC_AUTHPRIV
  229. * Private security / authorisation messages
  230. * \remarks Equivalent to the SysLog facility <code>LOG_AUTHPRIV</code>.
  231. * \ingroup group__backend__stock_backends__WindowsSyslog__facilities
  232. */
  233. #ifdef LOG_AUTHPRIV
  234. # define PANTHEIOS_SYSLOG_FAC_AUTHPRIV LOG_AUTHPRIV
  235. #else /* ? LOG_AUTHPRIV */
  236. # define PANTHEIOS_SYSLOG_FAC_AUTHPRIV (10)
  237. #endif /* LOG_AUTHPRIV */
  238. /** \def PANTHEIOS_SYSLOG_FAC_FTP
  239. * FTP daemon messages
  240. * \remarks Equivalent to the SysLog facility <code>LOG_FTP</code>.
  241. * \ingroup group__backend__stock_backends__WindowsSyslog__facilities
  242. */
  243. #ifdef LOG_FTP
  244. # define PANTHEIOS_SYSLOG_FAC_FTP LOG_FTP
  245. #else /* ? LOG_FTP */
  246. # define PANTHEIOS_SYSLOG_FAC_FTP (11)
  247. #endif /* LOG_FTP */
  248. /** \def PANTHEIOS_SYSLOG_FAC_NETINFO
  249. * NetInfo subsystem messages
  250. * \remarks Equivalent to the SysLog facility <code>LOG_NETINFO</code>.
  251. * \ingroup group__backend__stock_backends__WindowsSyslog__facilities
  252. */
  253. #ifdef LOG_NETINFO
  254. # define PANTHEIOS_SYSLOG_FAC_NETINFO LOG_NETINFO
  255. #else /* ? LOG_NETINFO */
  256. # define PANTHEIOS_SYSLOG_FAC_NETINFO (12)
  257. #endif /* LOG_NETINFO */
  258. /** \def PANTHEIOS_SYSLOG_FAC_REMOTEAUTH
  259. * Remote authentication / authorisation subsystem messages
  260. * \remarks Equivalent to the SysLog facility <code>LOG_REMOTEAUTH</code>.
  261. * \ingroup group__backend__stock_backends__WindowsSyslog__facilities
  262. */
  263. #ifdef LOG_REMOTEAUTH
  264. # define PANTHEIOS_SYSLOG_FAC_REMOTEAUTH LOG_REMOTEAUTH
  265. #else /* ? LOG_REMOTEAUTH */
  266. # define PANTHEIOS_SYSLOG_FAC_REMOTEAUTH (13)
  267. #endif /* LOG_REMOTEAUTH */
  268. /** \def PANTHEIOS_SYSLOG_FAC_INSTALL
  269. * Installer subsystem messages
  270. * \remarks Equivalent to the SysLog facility <code>LOG_INSTALL</code>.
  271. * \ingroup group__backend__stock_backends__WindowsSyslog__facilities
  272. */
  273. #ifdef LOG_INSTALL
  274. # define PANTHEIOS_SYSLOG_FAC_INSTALL LOG_INSTALL
  275. #else /* ? LOG_INSTALL */
  276. # define PANTHEIOS_SYSLOG_FAC_INSTALL (14)
  277. #endif /* LOG_INSTALL */
  278. /** \def PANTHEIOS_SYSLOG_FAC_RAS
  279. * RAS subsystem messages
  280. * \remarks Equivalent to the SysLog facility <code>LOG_RAS</code>.
  281. * \ingroup group__backend__stock_backends__WindowsSyslog__facilities
  282. */
  283. #ifdef LOG_RAS
  284. # define PANTHEIOS_SYSLOG_FAC_RAS LOG_RAS
  285. #else /* ? LOG_RAS */
  286. # define PANTHEIOS_SYSLOG_FAC_RAS (15)
  287. #endif /* LOG_RAS */
  288. /** \def PANTHEIOS_SYSLOG_FAC_LOCAL0
  289. * Reserved for local use
  290. * \remarks Equivalent to the SysLog facility <code>LOG_LOCAL0</code>.
  291. * \ingroup group__backend__stock_backends__WindowsSyslog__facilities
  292. */
  293. #ifdef LOG_LOCAL0
  294. # define PANTHEIOS_SYSLOG_FAC_LOCAL0 LOG_LOCAL0
  295. #else /* ? LOG_LOCAL0 */
  296. # define PANTHEIOS_SYSLOG_FAC_LOCAL0 (16)
  297. #endif /* LOG_LOCAL0 */
  298. /** \def PANTHEIOS_SYSLOG_FAC_LOCAL1
  299. * Reserved for local use
  300. * \remarks Equivalent to the SysLog facility <code>LOG_LOCAL1</code>.
  301. * \ingroup group__backend__stock_backends__WindowsSyslog__facilities
  302. */
  303. #ifdef LOG_LOCAL1
  304. # define PANTHEIOS_SYSLOG_FAC_LOCAL1 LOG_LOCAL1
  305. #else /* ? LOG_LOCAL1 */
  306. # define PANTHEIOS_SYSLOG_FAC_LOCAL1 (17)
  307. #endif /* LOG_LOCAL1 */
  308. /** \def PANTHEIOS_SYSLOG_FAC_LOCAL2
  309. * Reserved for local use
  310. * \remarks Equivalent to the SysLog facility <code>LOG_LOCAL2</code>.
  311. * \ingroup group__backend__stock_backends__WindowsSyslog__facilities
  312. */
  313. #ifdef LOG_LOCAL2
  314. # define PANTHEIOS_SYSLOG_FAC_LOCAL2 LOG_LOCAL2
  315. #else /* ? LOG_LOCAL2 */
  316. # define PANTHEIOS_SYSLOG_FAC_LOCAL2 (18)
  317. #endif /* LOG_LOCAL2 */
  318. /** \def PANTHEIOS_SYSLOG_FAC_LOCAL3
  319. * Reserved for local use
  320. * \remarks Equivalent to the SysLog facility <code>LOG_LOCAL3</code>.
  321. * \ingroup group__backend__stock_backends__WindowsSyslog__facilities
  322. */
  323. #ifdef LOG_LOCAL3
  324. # define PANTHEIOS_SYSLOG_FAC_LOCAL3 LOG_LOCAL3
  325. #else /* ? LOG_LOCAL3 */
  326. # define PANTHEIOS_SYSLOG_FAC_LOCAL3 (19)
  327. #endif /* LOG_LOCAL3 */
  328. /** \def PANTHEIOS_SYSLOG_FAC_LOCAL4
  329. * Reserved for local use
  330. * \remarks Equivalent to the SysLog facility <code>LOG_LOCAL4</code>.
  331. * \ingroup group__backend__stock_backends__WindowsSyslog__facilities
  332. */
  333. #ifdef LOG_LOCAL4
  334. # define PANTHEIOS_SYSLOG_FAC_LOCAL4 LOG_LOCAL4
  335. #else /* ? LOG_LOCAL4 */
  336. # define PANTHEIOS_SYSLOG_FAC_LOCAL4 (20)
  337. #endif /* LOG_LOCAL4 */
  338. /** \def PANTHEIOS_SYSLOG_FAC_LOCAL5
  339. * Reserved for local use
  340. * \remarks Equivalent to the SysLog facility <code>LOG_LOCAL5</code>.
  341. * \ingroup group__backend__stock_backends__WindowsSyslog__facilities
  342. */
  343. #ifdef LOG_LOCAL5
  344. # define PANTHEIOS_SYSLOG_FAC_LOCAL5 LOG_LOCAL5
  345. #else /* ? LOG_LOCAL5 */
  346. # define PANTHEIOS_SYSLOG_FAC_LOCAL5 (21)
  347. #endif /* LOG_LOCAL5 */
  348. /** \def PANTHEIOS_SYSLOG_FAC_LOCAL6
  349. * Reserved for local use
  350. * \remarks Equivalent to the SysLog facility <code>LOG_LOCAL6</code>.
  351. * \ingroup group__backend__stock_backends__WindowsSyslog__facilities
  352. */
  353. #ifdef LOG_LOCAL6
  354. # define PANTHEIOS_SYSLOG_FAC_LOCAL6 LOG_LOCAL6
  355. #else /* ? LOG_LOCAL6 */
  356. # define PANTHEIOS_SYSLOG_FAC_LOCAL6 (22)
  357. #endif /* LOG_LOCAL6 */
  358. /** \def PANTHEIOS_SYSLOG_FAC_LOCAL7
  359. * Reserved for local use
  360. * \remarks Equivalent to the SysLog facility <code>LOG_LOCAL7</code>.
  361. * \ingroup group__backend__stock_backends__WindowsSyslog__facilities
  362. */
  363. #ifdef LOG_LOCAL7
  364. # define PANTHEIOS_SYSLOG_FAC_LOCAL7 LOG_LOCAL7
  365. #else /* ? LOG_LOCAL7 */
  366. # define PANTHEIOS_SYSLOG_FAC_LOCAL7 (23)
  367. #endif /* LOG_LOCAL7 */
  368. /** \def PANTHEIOS_SYSLOG_FAC_LAUNCHD
  369. * Boostrap daemon subsystem messages
  370. * \remarks Equivalent to the SysLog facility <code>LOG_LAUNCHD</code>.
  371. * \ingroup group__backend__stock_backends__WindowsSyslog__facilities
  372. */
  373. #ifdef LOG_LAUNCHD
  374. # define PANTHEIOS_SYSLOG_FAC_LAUNCHD LOG_LAUNCHD
  375. #else /* ? LOG_LAUNCHD */
  376. # define PANTHEIOS_SYSLOG_FAC_LAUNCHD (24)
  377. #endif /* LOG_LAUNCHD */
  378. /* /////////////////////////////////////////////////////////////////////////
  379. * Typedefs
  380. */
  381. /** Structure used for specifying initialisation information to the
  382. * be.WindowsSyslog library.
  383. * \ingroup group__backend__stock_backends__WindowsSyslog
  384. */
  385. struct pan_be_WindowsSyslog_init_t
  386. {
  387. #if !defined(PANTHEIOS_DOCUMENTATION_SKIP_SECTION) && \
  388. !defined(PANTHEIOS_NO_NAMESPACE)
  389. typedef pantheios::pan_uint8_t pan_uint8_t;
  390. typedef pantheios::pan_uint16_t pan_uint16_t;
  391. typedef pantheios::pan_uint32_t pan_uint32_t;
  392. #endif /* !PANTHEIOS_DOCUMENTATION_SKIP_SECTION && !PANTHEIOS_NO_NAMESPACE */
  393. pan_uint32_t version; /*!< Must be initialised to the value of PANTHEIOS_VER */
  394. pan_uint32_t flags; /*!< \ref group__backend__stock_backends__WindowsSyslog__flags "Flags" that control the information displayed. */
  395. size_t addrSize; /*!< Number of elements in array. Must be 0, 4 or 16. 0 means hostName is used; 4 means IPv4; 16 means IPv6. \note IPv6 is not currently supported. */
  396. pan_uint8_t bytes[16]; /*!< IPv4 or IPv6 address elements. */
  397. char const* hostName; /*!< Host name. Must be non-NULL when 0 == addrSize. */
  398. pan_uint16_t port; /*!< Port to be used for transmission. */
  399. pan_uint8_t facility; /*!< The facility used by the process. Must be <= 124. Defaults to PANTHEIOS_SYSLOG_FAC_USER */
  400. char hostNameBuff[101]; /*!< Buffer for use by client to write host name, to which \link pan_be_WindowsSyslog_init_t::hostName hostName\endlink can be pointed. */
  401. #ifdef __cplusplus
  402. public: /* Construction */
  403. # ifndef PANTHEIOS_BE_INIT_NO_CPP_STRUCT_INIT
  404. pan_be_WindowsSyslog_init_t();
  405. # endif /* !PANTHEIOS_BE_INIT_NO_CPP_STRUCT_INIT */
  406. #endif /* __cplusplus */
  407. };
  408. #if !defined(__cplusplus)
  409. typedef struct pan_be_WindowsSyslog_init_t pan_be_WindowsSyslog_init_t;
  410. #endif /* !__cplusplus */
  411. /* /////////////////////////////////////////////////////////////////////////
  412. * Application-defined functions
  413. */
  414. /** \ref page__backend__callbacks "Callback" function defined by
  415. * the application, invoked when the
  416. * API is initialised with a NULL <code>init</code> parameter.
  417. * \ingroup group__backend__stock_backends__WindowsSyslog
  418. *
  419. * \note This function is only required when the
  420. * \ref page__backend__callbacks "callback" version of the library is
  421. * used.
  422. */
  423. PANTHEIOS_CALL(void) pantheios_be_WindowsSyslog_getAppInit(
  424. int backEndId
  425. , pan_be_WindowsSyslog_init_t* init
  426. ) /* throw() */;
  427. /* /////////////////////////////////////////////////////////////////////////
  428. * API
  429. */
  430. /** Fills out a copy of the initialisation structure with default
  431. * values (representative of the default behaviour of the library),
  432. * ready to be customised and passed to the API initialiser function
  433. * pantheios_be_WindowsSyslog_init().
  434. * \ingroup group__backend__stock_backends__WindowsSyslog
  435. *
  436. * \note This function should <b>not</b> be called on an
  437. * already-initialised instance, as is the case in the implementation
  438. * of the pantheios_be_WindowsSyslog_getAppInit() function, as it will
  439. * already have been called by pantheios_be_WindowsSyslog_init() prior
  440. * to the callback.
  441. */
  442. PANTHEIOS_CALL(void) pantheios_be_WindowsSyslog_getDefaultAppInit(
  443. pan_be_WindowsSyslog_init_t* init
  444. ) /* throw() */;
  445. /** Implements the functionality for pantheios_be_init() over the Windows-SysLog API.
  446. * \ingroup group__backend__stock_backends__WindowsSyslog
  447. *
  448. * \remarks This function will fail to initialise if the host does not
  449. * have network connectivity. Users should consider using with be.N
  450. * and applying the
  451. * \c PANTHEIOS_BE_N_F_IGNORE_INIT_FAILURE
  452. * and
  453. * \c PANTHEIOS_BE_N_F_INIT_ONLY_IF_PREVIOUS_FAILED
  454. * flags, so that initialisation failure will not prevent the
  455. * application from initialising.
  456. */
  457. PANTHEIOS_CALL(int) pantheios_be_WindowsSyslog_init(
  458. PAN_CHAR_T const* processIdentity
  459. , int id
  460. , pan_be_WindowsSyslog_init_t const* init
  461. , void* reserved
  462. , void** ptoken
  463. );
  464. /** Implements the functionality for pantheios_be_uninit() over the Windows-SysLog API.
  465. * \ingroup group__backend__stock_backends__WindowsSyslog
  466. */
  467. PANTHEIOS_CALL(void) pantheios_be_WindowsSyslog_uninit(
  468. void* token
  469. );
  470. /** Implements the functionality for pantheios_be_logEntry() over the Windows-SysLog API.
  471. * \ingroup group__backend__stock_backends__WindowsSyslog
  472. */
  473. PANTHEIOS_CALL(int) pantheios_be_WindowsSyslog_logEntry(
  474. void* feToken
  475. , void* beToken
  476. , int severity
  477. , PAN_CHAR_T const* entry
  478. , size_t cchEntry
  479. );
  480. /** Parses the be.WindowsSyslog back-end flags
  481. *
  482. * \ingroup group__backend
  483. *
  484. * Processes an argument list in the same way as
  485. * pantheios_be_parseStockArgs(), filling out the
  486. * pan_be_COMErrorObject_init_t in accordance with the arguments
  487. * found.
  488. *
  489. * Recognises the following standard argument names:
  490. * - "showProcessId" (Boolean)
  491. * - "showTime" (Boolean)
  492. * - "showSeverity" (Boolean)
  493. * - "useSystemTime" (Boolean)
  494. * - "showDetailsAtStart" (Boolean)
  495. * - "useUnixFormat" (Boolean)
  496. * - "showDate" (Boolean)
  497. * - "showTime" (Boolean)
  498. * - "highResolution" (Boolean)
  499. * - "lowResolution" (Boolean)
  500. *
  501. * Recognises the following back-end specific argument names:
  502. * - "address" (String: hostname or dotted IPv4 address)
  503. * - "port" (Number)
  504. * - "facility" (Number)
  505. * - "useStderr" (Boolean)
  506. * - "useConsole" (Boolean)
  507. * - "showPid" (Boolean)
  508. * - "connectImmediately" (Boolean)
  509. */
  510. PANTHEIOS_CALL(int) pantheios_be_WindowsSyslog_parseArgs(
  511. size_t numArgs
  512. #ifdef PANTHEIOS_NO_NAMESPACE
  513. , struct pan_slice_t* const args
  514. #else /* ? PANTHEIOS_NO_NAMESPACE */
  515. , pantheios::pan_slice_t* const args
  516. #endif /* PANTHEIOS_NO_NAMESPACE */
  517. , pan_be_WindowsSyslog_init_t* init
  518. );
  519. /* ////////////////////////////////////////////////////////////////////// */
  520. #ifdef __cplusplus
  521. # ifndef PANTHEIOS_BE_INIT_NO_CPP_STRUCT_INIT
  522. inline pan_be_WindowsSyslog_init_t::pan_be_WindowsSyslog_init_t()
  523. {
  524. pantheios_be_WindowsSyslog_getDefaultAppInit(this);
  525. }
  526. # endif /* !PANTHEIOS_BE_INIT_NO_CPP_STRUCT_INIT */
  527. #endif /* __cplusplus */
  528. /* ////////////////////////////////////////////////////////////////////// */
  529. #endif /* PANTHEIOS_INCL_PANTHEIOS_BACKENDS_H_BEC_WINDOWSSYSLOG */
  530. /* ///////////////////////////// end of file //////////////////////////// */