|
1 | 1 | /* The RELP (reliable event logging protocol) core protocol library. |
2 | 2 | * |
3 | | - * Copyright 2008-2020 by Rainer Gerhards and Adiscon GmbH. |
| 3 | + * Copyright 2008-2025 by Rainer Gerhards and Adiscon GmbH. |
4 | 4 | * |
5 | 5 | * This file is part of librelp. |
6 | 6 | * |
@@ -442,24 +442,47 @@ relpEngineListnerConstructFinalize(relpEngine_t *const pThis, relpSrv_t *pSrv) |
442 | 442 |
|
443 | 443 | /* a dummy for callbacks not set by the caller */ |
444 | 444 | static relpRetVal relpSrvSyslogRcvDummy2(void LIBRELP_ATTR_UNUSED *pUsr, |
445 | | - unsigned char LIBRELP_ATTR_UNUSED *pHostName, |
446 | | - unsigned char LIBRELP_ATTR_UNUSED *pIP, unsigned char LIBRELP_ATTR_UNUSED *pMsg, |
447 | | - size_t LIBRELP_ATTR_UNUSED lenMsg) |
| 445 | + unsigned char LIBRELP_ATTR_UNUSED *pHostName, |
| 446 | + unsigned char LIBRELP_ATTR_UNUSED *pIP, unsigned char LIBRELP_ATTR_UNUSED *pMsg, |
| 447 | + size_t LIBRELP_ATTR_UNUSED lenMsg) |
448 | 448 | { return RELP_RET_NOT_IMPLEMENTED; |
449 | 449 | } |
| 450 | +static relpRetVal relpSrvSyslogRcvDummy3(void LIBRELP_ATTR_UNUSED *pUsr, |
| 451 | + unsigned char LIBRELP_ATTR_UNUSED *pHostName, |
| 452 | + unsigned char LIBRELP_ATTR_UNUSED *pIP, unsigned char LIBRELP_ATTR_UNUSED *pPort, |
| 453 | + unsigned char LIBRELP_ATTR_UNUSED *pMsg, |
| 454 | + size_t LIBRELP_ATTR_UNUSED lenMsg) |
| 455 | +{ return RELP_RET_NOT_IMPLEMENTED; } |
450 | 456 | /* set the syslog receive callback. If NULL is provided, it is set to the |
451 | 457 | * not implemented dummy. |
452 | 458 | */ |
453 | 459 | relpRetVal PART_OF_API |
454 | 460 | relpEngineSetSyslogRcv2(relpEngine_t *const pThis, relpRetVal (*pCB)(void *, unsigned char*, |
455 | | - unsigned char*, unsigned char*, size_t)) |
| 461 | + unsigned char*, unsigned char*, size_t)) |
456 | 462 | { |
457 | | - ENTER_RELPFUNC; |
458 | | - RELPOBJ_assert(pThis, Engine); |
| 463 | + ENTER_RELPFUNC; |
| 464 | + RELPOBJ_assert(pThis, Engine); |
459 | 465 |
|
460 | | - pThis->onSyslogRcv = NULL; |
461 | | - pThis->onSyslogRcv2 = (pCB == NULL) ? relpSrvSyslogRcvDummy2 : pCB; |
462 | | - LEAVE_RELPFUNC; |
| 466 | + pThis->onSyslogRcv = NULL; |
| 467 | + pThis->onSyslogRcv3 = NULL; |
| 468 | + pThis->onSyslogRcv2 = (pCB == NULL) ? relpSrvSyslogRcvDummy2 : pCB; |
| 469 | + LEAVE_RELPFUNC; |
| 470 | +} |
| 471 | + |
| 472 | +/* set the syslog receive callback. If NULL is provided, it is set to the |
| 473 | + * not implemented dummy. |
| 474 | + */ |
| 475 | +relpRetVal PART_OF_API |
| 476 | +relpEngineSetSyslogRcv3(relpEngine_t *const pThis, relpRetVal (*pCB)(void *, unsigned char*, |
| 477 | + unsigned char*, unsigned char*, unsigned char*, size_t)) |
| 478 | +{ |
| 479 | + ENTER_RELPFUNC; |
| 480 | + RELPOBJ_assert(pThis, Engine); |
| 481 | + |
| 482 | + pThis->onSyslogRcv = NULL; |
| 483 | + pThis->onSyslogRcv2 = NULL; |
| 484 | + pThis->onSyslogRcv3 = (pCB == NULL) ? relpSrvSyslogRcvDummy3 : pCB; |
| 485 | + LEAVE_RELPFUNC; |
463 | 486 | } |
464 | 487 |
|
465 | 488 | /** |
@@ -573,9 +596,10 @@ relpEngineSetSyslogRcv(relpEngine_t *const pThis, relpRetVal (*pCB)(unsigned cha |
573 | 596 | ENTER_RELPFUNC; |
574 | 597 | RELPOBJ_assert(pThis, Engine); |
575 | 598 |
|
576 | | - pThis->onSyslogRcv = (pCB == NULL) ? relpSrvSyslogRcvDummy : pCB; |
577 | | - pThis->onSyslogRcv2 = NULL; |
578 | | - LEAVE_RELPFUNC; |
| 599 | + pThis->onSyslogRcv = (pCB == NULL) ? relpSrvSyslogRcvDummy : pCB; |
| 600 | + pThis->onSyslogRcv2 = NULL; |
| 601 | + pThis->onSyslogRcv3 = NULL; |
| 602 | + LEAVE_RELPFUNC; |
579 | 603 | } |
580 | 604 |
|
581 | 605 | /* Deprecated, use relpEngineListnerConstruct() family of functions. |
|
0 commit comments