~ubuntu-branches/ubuntu/trusty/keepalived/trusty

« back to all changes in this revision

Viewing changes to keepalived/libipvs-2.6/libipvs.c

  • Committer: Bazaar Package Importer
  • Author(s): Alexander Wirt
  • Date: 2005-04-29 23:22:40 UTC
  • mfrom: (1.1.1 upstream) (2.1.1 hoary)
  • Revision ID: james.westby@ubuntu.com-20050429232240-a8m3jtpi3cvuyyy2
Tags: 1.1.11-3
Added a warning about sarge kernels to README.Debian and 
the package description 

Show diffs side-by-side

added added

removed removed

Lines of Context:
32
32
static void* ipvs_func = NULL;
33
33
struct ip_vs_getinfo ipvs_info;
34
34
 
35
 
 
36
35
int ipvs_init(void)
37
36
{
38
37
        socklen_t len;
142
141
}
143
142
 
144
143
 
145
 
int ipvs_start_daemon(ipvs_daemon_t *dm)
 
144
static int _ipvs_start_daemon(void *dm)
146
145
{
147
146
        ipvs_func = ipvs_start_daemon;
148
 
        return setsockopt(sockfd, IPPROTO_IP, IP_VS_SO_SET_STARTDAEMON,
149
 
                          (char *)dm, sizeof(*dm));
 
147
        setsockopt(sockfd, IPPROTO_IP, IP_VS_SO_SET_STARTDAEMON,
 
148
                   (char *)dm, sizeof(struct ip_vs_daemon_user));
 
149
        exit(0);
150
150
}
151
151
 
152
152
 
153
 
extern int ipvs_stop_daemon(ipvs_daemon_t *dm)
 
153
static int _ipvs_stop_daemon(void *dm)
154
154
{
155
155
        ipvs_func = ipvs_stop_daemon;
156
 
        return setsockopt(sockfd, IPPROTO_IP, IP_VS_SO_SET_STOPDAEMON,
157
 
                          (char *)dm, sizeof(*dm));
158
 
}
159
 
 
 
156
        setsockopt(sockfd, IPPROTO_IP, IP_VS_SO_SET_STOPDAEMON,
 
157
                   (char *)dm, sizeof(struct ip_vs_daemon_user));
 
158
        exit(0);
 
159
}
 
160
 
 
161
int ipvs_start_daemon(ipvs_daemon_t *dm)
 
162
{
 
163
        pid_t pid;
 
164
 
 
165
        pid = fork();
 
166
        if (pid == 0) {
 
167
                _ipvs_start_daemon(dm);
 
168
                exit(0);
 
169
        } else if (pid > 0)
 
170
                return 0;
 
171
        return 1;
 
172
}
 
173
 
 
174
int ipvs_stop_daemon(ipvs_daemon_t *dm)
 
175
{
 
176
        pid_t pid;
 
177
 
 
178
        pid = fork();
 
179
        if (pid == 0) {
 
180
                _ipvs_stop_daemon(dm);
 
181
                exit(0);
 
182
        } else if (pid > 0)
 
183
                return 0;
 
184
        return 1;
 
185
}
160
186
 
161
187
struct ip_vs_get_services *ipvs_get_services(void)
162
188
{