-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlibunxsvz.h
90 lines (85 loc) · 3.91 KB
/
libunxsvz.h
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
/*
FILE
unxsVZ/libunxsvz.h
svn ID removed
PURPOSE
Header for libunxsvz.c linunxsvz.a library.
Move the jobqueue out of the cgi.
NOTES
AUTHOR/LEGAL
(C) 2011-2016 Gary Wallis for Unixservice, LLC.
GPLv2 license applies. See LICENSE file included.
FREE HELP
support @ openisp . net
supportgrp @ unixservice . com
Join mailing list: https://lists.openisp.net/mailman/listinfo/unxsvz
*/
#include "mysqlrad.h"
void ErrorMsg(const char *cText);
void SetContainerStatus(unsigned uContainer,unsigned uStatus);
void SetContainerNode(unsigned uContainer,unsigned uNode);
void SetContainerDatacenter(unsigned uContainer,unsigned uDatacenter);
unsigned uCheckMaxContainers(unsigned uNode);
unsigned uCheckMaxCloneContainers(unsigned uNode);
void GetNodeProp(const unsigned uNode,const char *cName,char *cValue);
const char *ForeignKey(const char *cTableName, const char *cFieldName, unsigned uKey);
unsigned GetConfiguration(const char *cName,char *cValue,
unsigned uDatacenter,
unsigned uNode,
unsigned uContainer,
unsigned uHtml);
unsigned ConnectToOptionalUBCDb(unsigned uDatacenter,unsigned uPrivate);
void unxsVZFake(const char *cText);
unsigned CreateDNSJob(unsigned uIPv4,unsigned uOwner,char const *cOptionalIPv4,char const *cHostname,
unsigned uDatacenter,unsigned uCreatedBy,unsigned uContainer,unsigned uNode);
unsigned uNodeCommandJob(unsigned uDatacenter, unsigned uNode, unsigned uContainer,
unsigned uOwner, unsigned uLoginClient, unsigned uConfiguration, char *cArgs);
void SetNodeProp(char const *cName,char const *cValue,unsigned uNode);
void SetDatacenterProp(char const *cName,char const *cValue,unsigned uDatacenter);
unsigned SetContainerProperty(const unsigned uContainer,const char *cPropertyName,const char *cPropertyValue);
unsigned uGetPrimaryContainerGroup(unsigned uContainer);
time_t cStartDateToUnixTime(char *cStartDate);
time_t cStartTimeToUnixTime(char *cStartTime);
char *ToLower(char *cInput);
void unxsVZLog(unsigned uTablePK, char *cTableName, char *cLogEntry);
unsigned unxsBindPBXRecordJob(unsigned uDatacenter,unsigned uNode,unsigned uContainer,const char *cJobData,
unsigned uOwner,unsigned uCreatedBy);
unsigned unxsBindARecordJob(unsigned uDatacenter,unsigned uNode,unsigned uContainer,const char *cJobData,
unsigned uOwner,unsigned uCreatedBy);
void GetNodeProp(const unsigned uNode,const char *cName,char *cValue);
void GetNodePropUBC(const unsigned uNode,const char *cName,char *cValue);
void GetDatacenterProp(const unsigned uDatacenter,const char *cName,char *cValue);
void logfileLine(const char *cFunction,const char *cLogline);
void GetContainerProp(const unsigned uContainer,const char *cName,char *cValue);
void GetContainerPropUBC(const unsigned uContainer,const char *cName,char *cValue);
unsigned SetContainerPropertyUBC(const unsigned uContainer,const char *cPropertyName,const char *cPropertyValue);
unsigned SetContainerProperty(const unsigned uContainer,const char *cPropertyName,const char *cPropertyValue);
void GetGroupProp(const unsigned uGroup,const char *cName,char *cValue);
void GetClientProp(const unsigned uClient,const char *cName,char *cValue);
void GetIPProp(const unsigned uIP,const char *cName,char *cValue);
void GetIPPropFromHost(const char *cHostIP,const char *cName,char *cValue);
char *base64encode (const void *b64_encode_this, int encode_this_many_bytes);
//Global vars
extern MYSQL gMysql;
extern MYSQL gMysqlUBC;
extern char *gcUBCDBIP0;//must be set to DBIP0 to be used as alternative
extern char *gcUBCDBIP1;
extern char gcUBCDBIP0Buffer[];
extern char gcUBCDBIP1Buffer[];
extern FILE *gLfp;
extern char gcCommand[];
extern char cLogKey[];
extern int guPermLevel;
extern unsigned guLoginClient;
extern unsigned guReseller;
extern unsigned guCompany;
extern char gcCompany[];
extern char gcUser[];
extern char gcLogin[];
extern char gcHost[];
extern char gcHostname[];
extern unsigned guDatacenter;
extern char gcFunction[];
extern char gcQuery[];
extern char cStartDate[];
extern char cStartTime[];