Commit aedcaf49 authored by Leigh B. Stoller's avatar Leigh B. Stoller

Move constant defs to separate include file so that they can be

included on the client side (no mysql setup).
parent 1d6af9ba
...@@ -23,6 +23,8 @@ loginit(int slog, char *name) ...@@ -23,6 +23,8 @@ loginit(int slog, char *name)
{ {
if (slog) { if (slog) {
usesyslog = 1; usesyslog = 1;
if (! name)
name = "Testbed";
openlog(name, LOG_PID, LOG_USER); openlog(name, LOG_PID, LOG_USER);
return 0; return 0;
} }
...@@ -32,7 +34,7 @@ loginit(int slog, char *name) ...@@ -32,7 +34,7 @@ loginit(int slog, char *name)
if (name) { if (name) {
int fd; int fd;
if ((fd = open(name, O_RDWR|O_CREAT|O_APPEND, 0)) != -1) { if ((fd = open(name, O_RDWR|O_CREAT|O_APPEND, 0640)) != -1) {
(void)dup2(fd, STDOUT_FILENO); (void)dup2(fd, STDOUT_FILENO);
(void)dup2(fd, STDERR_FILENO); (void)dup2(fd, STDERR_FILENO);
if (fd > 2) if (fd > 2)
......
...@@ -3,6 +3,7 @@ ...@@ -3,6 +3,7 @@
*/ */
#include <stdarg.h> #include <stdarg.h>
#include <mysql/mysql.h> #include <mysql/mysql.h>
#include "tbdefs.h"
/* /*
* Generic interface. * Generic interface.
...@@ -23,23 +24,3 @@ int mydb_seteventschedulerpid(char *pid, char *eid, int processid); ...@@ -23,23 +24,3 @@ int mydb_seteventschedulerpid(char *pid, char *eid, int processid);
MYSQL_RES *mydb_query(char *query, int ncols, ...); MYSQL_RES *mydb_query(char *query, int ncols, ...);
int mydb_update(char *query, ...); int mydb_update(char *query, ...);
/*
* Various constants.
*/
#define TBDB_FLEN_NODEID 64
#define TBDB_FLEN_EVOBJTYPE 128
#define TBDB_FLEN_EVOBJNAME 128
#define TBDB_FLEN_EVEVENTTYPE 128
/*
* Event system stuff
*/
#define TBDB_OBJECTTYPE_TESTBED "TBCONTROL"
#define TBDB_OBJECTTYPE_LINK "LINK"
#define TBDB_OBJECTTYPE_TRAFGEN "TRAFGEN"
#define TBDB_EVENTTYPE_ISUP "ISUP"
#define TBDB_EVENTTYPE_REBOOT "REBOOT"
#define TBDB_EVENTTYPE_UP "UP"
#define TBDB_EVENTTYPE_DOWN "DOWN"
#define TBDB_EVENTTYPE_MODIFY "MODIFY"
/*
* Various constants that are reflected in the DB!
*/
#define TBDB_FLEN_NODEID 64
#define TBDB_FLEN_EVOBJTYPE 128
#define TBDB_FLEN_EVOBJNAME 128
#define TBDB_FLEN_EVEVENTTYPE 128
/*
* Event system stuff
*/
#define TBDB_OBJECTTYPE_TESTBED "TBCONTROL"
#define TBDB_OBJECTTYPE_LINK "LINK"
#define TBDB_OBJECTTYPE_TRAFGEN "TRAFGEN"
#define TBDB_EVENTTYPE_ISUP "ISUP"
#define TBDB_EVENTTYPE_REBOOT "REBOOT"
#define TBDB_EVENTTYPE_UP "UP"
#define TBDB_EVENTTYPE_DOWN "DOWN"
#define TBDB_EVENTTYPE_MODIFY "MODIFY"
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment