summaryrefslogtreecommitdiff
path: root/src/server_realm_struct.h
blob: 4ca21c132cf5ab99be8510c5d8809b1f88a39fa0 (plain)
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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
/*
 * active port forwarder - software for secure forwarding
 * Copyright (C) 2003-2006 jeremian <jeremian [at] poczta.fm>
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 *
 */

#include "activefor.h"

#ifndef _JS_SERVER_REALM_STRUCT_H
#define _JS_SERVER_REALM_STRUCT_H

typedef struct {
  char* hostName;
  char* sUsersLimit;
  char* sClientsLimit;
  char* sRaClientsLimit;
  char* sUsersPerClient;
  char* sClientMode;
  char* sTimeout;
  char* sMaxIdle;
  char* realmName;
  unsigned char password[4];
  int connectedUsers;
  int usersLimit;
  int connectedClients;
  int clientsLimit;
  int connectedRaClients;
  int raClientsLimit;
  int usersPerClient;
  int timeout;
  int maxIdle;
  int clientMode;
  int userClientPairs;
  int clientsCounter;
  int usersCounter;
  char realmType;
  char tunnelType;
  char dnsLookupsOn;
  char basePortOn;
  char auditOn;
  socklen_t addressLength;
  struct sockaddr* clientAddress;
  ConnectUser** usersTable;
  ConnectClient** clientsTable;
  ConnectClient** raClientsTable;
  UsrCli** usersClientsTable;
} ServerRealm;

/* 'constructor' */
ServerRealm* ServerRealm_new();
/* 'destructor' */
void ServerRealm_free(ServerRealm** sr);
/* setters */
void ServerRealm_set_hostName(ServerRealm* sr, char* hostName);
void ServerRealm_set_sUsersLimit(ServerRealm* sr, char* sUsersLimit);
void ServerRealm_set_sClientsLimit(ServerRealm* sr, char* sClientsLimit);
void ServerRealm_set_sRaClientsLimit(ServerRealm* sr, char* sRaClientsLimit);
void ServerRealm_set_sUsersPerClient(ServerRealm* sr, char* sUsersPerClient);
void ServerRealm_set_sClientMode(ServerRealm* sr, char* sClientMode);
void ServerRealm_set_sTimeout(ServerRealm* sr, char* sTimeout);
void ServerRealm_set_sMaxIdle(ServerRealm* sr, char* sMaxIdle);
void ServerRealm_set_realmName(ServerRealm* sr, char* realmName);
void ServerRealm_set_password(ServerRealm* sr, unsigned char* password);
void ServerRealm_set_connectedUsers(ServerRealm* sr, int connectedUsers);
void ServerRealm_set_usersLimit(ServerRealm* sr, int usersLimit);
void ServerRealm_set_connectedClients(ServerRealm* sr, int connectedClients);
void ServerRealm_set_clientsLimit(ServerRealm* sr, int clientsLimit);
void ServerRealm_set_connectedRaClients(ServerRealm* sr, int connectedRaClients);
void ServerRealm_set_raClientsLimit(ServerRealm* sr, int raClientsLimit);
void ServerRealm_set_usersPerClient(ServerRealm* sr, int usersPerClient);
void ServerRealm_set_timeout(ServerRealm* sr, int timeout);
void ServerRealm_set_maxIdle(ServerRealm* sr, int maxIdle);
void ServerRealm_set_clientMode(ServerRealm* sr, int clientMode);
void ServerRealm_set_userClientPairs(ServerRealm* sr, int userClientPairs);
void ServerRealm_set_clientsCounter(ServerRealm* sr, int clientsCounter);
void ServerRealm_set_usersCounter(ServerRealm* sr, int usersCounter);
void ServerRealm_set_realmType(ServerRealm* sr, char realmType);
void ServerRealm_set_tunnelType(ServerRealm* sr, char tunnelType);
void ServerRealm_set_dnsLookupsOn(ServerRealm* sr, char dnsLookupsOn);
void ServerRealm_set_basePortOn(ServerRealm* sr, char basePortOn);
void ServerRealm_set_auditOn(ServerRealm* sr, char auditOn);
void ServerRealm_set_addressLength(ServerRealm* sr, socklen_t addressLength);
void ServerRealm_set_clientAddress(ServerRealm* sr, struct sockaddr* clientAddress);
void ServerRealm_set_usersTable(ServerRealm* sr, ConnectUser** usersTable);
void ServerRealm_set_clientsTable(ServerRealm* sr, ConnectClient** clientsTable);
void ServerRealm_set_raClientsTable(ServerRealm* sr, ConnectClient** raClientsTable);
void ServerRealm_set_usersClientsTable(ServerRealm* sr, UsrCli** usersClientsTable);
/* getters */
char* ServerRealm_get_hostName(ServerRealm* sr);
char* ServerRealm_get_sUsersLimit(ServerRealm* sr);
char* ServerRealm_get_sClientsLimit(ServerRealm* sr);
char* ServerRealm_get_sRaClientsLimit(ServerRealm* sr);
char* ServerRealm_get_sUsersPerClient(ServerRealm* sr);
char* ServerRealm_get_sClientMode(ServerRealm* sr);
char* ServerRealm_get_sTimeout(ServerRealm* sr);
char* ServerRealm_get_sMaxIdle(ServerRealm* sr);
char* ServerRealm_get_realmName(ServerRealm* sr);
unsigned char* ServerRealm_get_password(ServerRealm* sr);
int ServerRealm_get_connectedUsers(ServerRealm* sr);
int ServerRealm_get_usersLimit(ServerRealm* sr);
int ServerRealm_get_connectedClients(ServerRealm* sr);
int ServerRealm_get_clientsLimit(ServerRealm* sr);
int ServerRealm_get_connectedRaClients(ServerRealm* sr);
int ServerRealm_get_raClientsLimit(ServerRealm* sr);
int ServerRealm_get_usersPerClient(ServerRealm* sr);
int ServerRealm_get_timeout(ServerRealm* sr);
int ServerRealm_get_maxIdle(ServerRealm* sr);
int ServerRealm_get_clientMode(ServerRealm* sr);
int ServerRealm_get_userClientPairs(ServerRealm* sr);
int ServerRealm_get_clientsCounter(ServerRealm* sr);
int ServerRealm_get_usersCounter(ServerRealm* sr);
char ServerRealm_get_realmType(ServerRealm* sr);
char ServerRealm_get_tunnelType(ServerRealm* sr);
char ServerRealm_get_dnsLookupsOn(ServerRealm* sr);
char ServerRealm_get_basePortOn(ServerRealm* sr);
char ServerRealm_get_auditOn(ServerRealm* sr);
socklen_t ServerRealm_get_addressLength(ServerRealm* sr);
struct sockaddr* ServerRealm_get_clientAddress(ServerRealm* sr);
ConnectUser** ServerRealm_get_usersTable(ServerRealm* sr);
ConnectClient** ServerRealm_get_clientsTable(ServerRealm* sr);
ConnectClient** ServerRealm_get_raClientsTable(ServerRealm* sr);
UsrCli** ServerRealm_get_usersClientsTable(ServerRealm* sr);
/* other */
void ServerRealm_increase_connectedUsers(ServerRealm* sr);
void ServerRealm_decrease_connectedUsers(ServerRealm* sr);
void ServerRealm_increase_connectedClients(ServerRealm* sr);
void ServerRealm_decrease_connectedClients(ServerRealm* sr);
void ServerRealm_increase_connectedRaClients(ServerRealm* sr);
void ServerRealm_decrease_connectedRaClients(ServerRealm* sr);
void ServerRealm_increase_usersCounter(ServerRealm* sr);
void ServerRealm_increase_clientsCounter(ServerRealm* sr);

#endif