$NetBSD$ Also output the KSM error messages(!) --- enforcer/common/daemon.c.orig 2016-01-21 14:31:54.000000000 +0000 +++ enforcer/common/daemon.c @@ -58,6 +58,8 @@ #include "ksm/dbsdef.h" #include "ksm/kmemsg.h" #include "ksm/kmedef.h" +#include "ksm/ksmmsg.h" +#include "ksm/ksmdef.h" #include "ksm/message.h" #include "ksm/string_util.h" @@ -243,6 +245,7 @@ main(int argc, char *argv[]){ MsgInit(); MsgRegister(KME_MIN_VALUE, KME_MAX_VALUE, m_messages, ksm_log_msg); MsgRegister(DBS_MIN_VALUE, DBS_MAX_VALUE, d_messages, ksm_log_msg); + MsgRegister(KSM_MIN_VALUE, KSM_MAX_VALUE, s_messages, ksm_log_msg); /* Do something. You need to provide this function somewhere */ server_main(&config); $NetBSD$ Generate from ksmdef.h with perl status_messages.pl KSM ksmdef.h ksmmsg.h --- enforcer/ksm/include/ksm/ksmmsg.h.orig 2016-03-10 08:47:18.000000000 +0000 +++ enforcer/ksm/include/ksm/ksmmsg.h @@ -0,0 +1,70 @@ +#ifndef KSM_KSMMSG_H +#define KSM_KSMMSG_H + +/* This file is generated by a perl script - it should not be edited */ + +#define KSM_MIN_VALUE (KSM_BASE) +#define KSM_MAX_VALUE (KSM_BASE + 53) +#define KSM_ARRAY_SIZE (54) + +static const char* s_messages[] = { + "ERROR: Invalid command option -%c", + "ERROR: Unrecognised command", + "ERROR: Ambiguous command", + "WARNING: Command not implemented yet", + "ERROR: MySQL initialization failure", + "ERROR: Unable to connect to database: %s", + "INFO: not connected to a database", + "ERROR: too many command line arguments", + "ERROR: unable to create group %s - %s", + "ERROR: unable to get ID of %s - %s", + "ERROR: extra data in result set", + "ERROR: no groups specified", + "INFO: created group %s", + "INFO: created group %s", + "ERROR: failed to perform count of objects in database - %s", + "ERROR: object with name '%s' already exists", + "ERROR: failed to create '%s'", + "ERROR: unable to find object '%s'", + "ERROR: unable to delete group as child zones are attached to it", + "ERROR: insufficient command line arguments", + "ERROR: invalid argument", + "ERROR: database operation failed - %s", + "ERROR: program error - number of fields returned did not match number expected", + "WARNING: too much data in result set - excess ignored", + "ERROR: it is not permitted to delete the permanent object %s", + "ERROR: unable to delete %s because child objects are associated with it", + "ERROR: unable to delete %s - %s", + "ERROR: object name is invalid", + "ERROR: %s is not a group", + "ERROR: %s is not a zone", + "ERROR: not connected to the database", + "ERROR: unable to allocate space for prepared statement structure", + "ERROR: unable to create SQL statement - %s", + "ERROR: unable to bind parameters to statement - %s", + "ERROR: unable to execute SQL statement - %s", + "WARNING: unrecognised condition code %d: code ignored", + "ERROR: parameter '%' already exists attached to '%s'", + "ERROR: cannot find parameter with ID of %d", + "WARNING: no parameter named %s found on parent %s, default value used", + "WARNING: no parameter named %s found on parent with ID %d, default value used", + "WARNING: key ID %d is in unrecognised state %d", + "ERROR: internal error, buffer overflow in %s", + "INFO: requesting issue of %s signing keys", + "INFO: moving %d key(s) from '%s' state to '%s' state", + "INFO: %d 'active' keys will be retiring in the immediate future", + "INFO: %d keys current in 'publish', 'ready' and 'active' states", + "INFO: %d keys required, therefore %d new keys need to be put in 'publish' state", + "ERROR: only %d %ss available in 'generate' state - request abandoned", + "INFO: %d %ss available in 'generate' state", + "INFO: %d %ss remaining in 'active' state", + "INFO: %d %ss in the 'ready' state", + "WARNING: cannot continue with key rollover as there are no keys in the 'ready' state", + "INFO: %d keys in 'active' state will have their expected retire date modified", + "ERROR: no such parameter with name %s", + +/* ... and null-terminate the array to be on the safe side */ + + NULL +}; +#endif /* KSM_KSMMSG_H */ $NetBSD$ Also support the KSM error messages. --- enforcer/ksm/include/ksm/status_messages.pl.orig 2016-01-21 14:31:54.000000000 +0000 +++ enforcer/ksm/include/ksm/status_messages.pl @@ -91,6 +91,7 @@ print MESSAGE "#define $ARGV[0]_ARRAY_SI print MESSAGE "\n"; print MESSAGE "static const char* m_messages[] = {\n" if $ARGV[0] eq 'KME'; print MESSAGE "static const char* d_messages[] = {\n" if $ARGV[0] eq 'DBS'; +print MESSAGE "static const char* s_messages[] = {\n" if $ARGV[0] eq 'KSM'; # Print out the message assignments.