~ubuntu-branches/ubuntu/karmic/vzctl/karmic

« back to all changes in this revision

Viewing changes to include/net.h

  • Committer: Bazaar Package Importer
  • Author(s): Ola Lundqvist
  • Date: 2007-04-10 18:08:16 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20070410180816-0uuzj9fnna7gmzxv
Tags: 3.0.16-4
Etch has been released which means that this version can be uploaded
to unstable.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*
2
 
 *  Copyright (C) 2000-2006 SWsoft. All rights reserved.
 
2
 *  Copyright (C) 2000-2007 SWsoft. All rights reserved.
3
3
 *
4
4
 *  This program is free software; you can redistribute it and/or modify
5
5
 *  it under the terms of the GNU General Public License as published by
18
18
#ifndef _NET_H_
19
19
#define _NET_H_
20
20
 
21
 
#include <linux/config.h>
22
 
#if defined(CONFIG_VZ_LIST) || defined(CONFIG_VZ_LIST_MODULE)
23
 
#include <linux/vzlist.h>
24
 
#if defined(VZCTL_GET_VEIDS) && defined(VZCTL_GET_VEIPS)
25
 
#define HAVE_VZLIST_IOCTL 1
26
 
#endif
27
 
#endif
 
21
/* #include <linux/vzlist.h> */
 
22
#define HAVE_VZLIST_IOCTL 0
28
23
 
29
24
#include "list.h"
30
25
#include "types.h"
36
31
/** Data structure for network parameters.
37
32
 */
38
33
typedef struct {
39
 
        list_head_t ip;         /**< VPS ip adresses list. */
40
 
        list_head_t dev;        /**< VPS network devices list. */
 
34
        list_head_t ip;         /**< VE IP adresses list. */
 
35
        list_head_t dev;        /**< VE network devices list. */
41
36
        int delall;             /**< flag to delete all ip addresses. */
42
37
        int skip_arpdetect;
43
38
        int skip_route_cleanup;
 
39
        int ipv6_net;
44
40
        
45
41
} net_param;
46
42
 
47
 
/** Setup VPS network.
 
43
/** Setup VE network.
48
44
 *
49
 
 * @param h             VPS handler.
50
 
 * @param veid          VPS id.
 
45
 * @param h             VE handler.
 
46
 * @param veid          VE id.
51
47
 * @param op            operation (ADD|DEL).
52
48
 * @param net           network parameters.
53
49
 * @param actions       distribution action scripts.
54
 
 * @param root          VPS root.
55
 
 * @param state         VPS state (STATE_STARTING|STATE_RUNNING).
 
50
 * @param root          VE root.
 
51
 * @param state         VE state (STATE_STARTING|STATE_RUNNING).
56
52
 * @retun               0 on success.
57
53
 */
58
54
int vps_net_ctl(vps_handler *h, envid_t veid, int op, net_param *net,
60
56
 
61
57
/** Setup access to Host system network devices.
62
58
 *
63
 
 * @param h             VPS handler.
64
 
 * @param veid          VPS id.
 
59
 * @param h             VE handler.
 
60
 * @param veid          VE id.
65
61
 * @param op            operation (ADD|DEL).
66
62
 * @param net           network parameters.
67
63
 * @return              0 on success.
70
66
 
71
67
int find_ip(list_head_t *ip_h,  char *ipaddr);
72
68
 
73
 
/** Abtain ip list belong to VPS.
 
69
/** Obtain list of IP addresses belonging to the VE.
74
70
 *
75
 
 * @param h             VPS handler.
76
 
 * @param veid          VPS id.
77
 
 * @param ip_h          ip list head.
 
71
 * @param h             VE handler.
 
72
 * @param veid          VE id.
 
73
 * @param ip_h          IP list head.
78
74
 * @return              0 on success.
79
75
 */
80
76
int get_vps_ip(vps_handler *h, envid_t veid, list_head_t *ip_h);