exit(fail ? 1 : 0);
}
-int open_and_lock(char *path)
+static int open_and_lock(char *path)
{
int fd;
struct flock lk;
}
-char *get_username(void)
+static char *get_username(void)
{
struct passwd *pwd = getpwuid(getuid());
* Return the count entry for the calling user if there is one. Else
* return -1.
*/
-int get_alloted(char *me, char *intype, char *link)
+static int get_alloted(char *me, char *intype, char *link)
{
FILE *fin = fopen(CONF_FILE, "r");
char *line = NULL;
return -1;
}
-char *get_eol(char *s)
+static char *get_eol(char *s)
{
while (*s && *s != '\n')
s++;
return s;
}
-char *get_eow(char *s)
+static char *get_eow(char *s)
{
while (*s && !isblank(*s) && *s != '\n')
s++;
return s;
}
-char *find_line(char *p, char *e, char *u, char *t, char *l)
+static char *find_line(char *p, char *e, char *u, char *t, char *l)
{
char *p1, *p2, *ret;
return NULL;
}
-bool nic_exists(char *nic)
+static bool nic_exists(char *nic)
{
char path[MAXPATHLEN];
int ret;
#if ! ISTEST
-int lxc_veth_create(const char *name1, const char *name2)
+static int lxc_veth_create(const char *name1, const char *name2)
{
struct nl_handler nlh;
struct nlmsg *nlmsg = NULL, *answer = NULL;
return err;
}
-int lxc_netdev_move(char *ifname, pid_t pid)
+static int lxc_netdev_move(char *ifname, pid_t pid)
{
struct nl_handler nlh;
struct nlmsg *nlmsg = NULL;
return netdev_set_flag(n1, IFF_UP);
}
-int lxc_bridge_attach(const char *bridge, const char *ifname)
+static int lxc_bridge_attach(const char *bridge, const char *ifname)
{
int fd, index, err;
struct ifreq ifr;
return err;
}
-int lxc_netdev_delete_by_index(int ifindex)
+static int lxc_netdev_delete_by_index(int ifindex)
{
struct nl_handler nlh;
struct nlmsg *nlmsg = NULL, *answer = NULL;
return err;
}
-int lxc_netdev_delete_by_name(const char *name)
+static int lxc_netdev_delete_by_name(const char *name)
{
int index;
return lxc_netdev_delete_by_index(index);
}
#else
-int lxc_netdev_delete_by_name(const char *name)
+static int lxc_netdev_delete_by_name(const char *name)
{
char path[200];
sprintf(path, "/tmp/lxcnettest/%s", name);
#endif
-bool create_nic(char *nic, char *br, int pid, char **cnic)
+static bool create_nic(char *nic, char *br, int pid, char **cnic)
{
#if ISTEST
char path[200];
* *dest will container the name (lxcuser-%d) which is attached
* on the host to the lxc bridge
*/
-void get_new_nicname(char **dest, char *br, int pid, char **cnic)
+static void get_new_nicname(char **dest, char *br, int pid, char **cnic)
{
int i = 0;
// TODO - speed this up. For large installations we won't
}
}
-bool get_nic_from_line(char *p, char **nic)
+static bool get_nic_from_line(char *p, char **nic)
{
char user[100], type[100], br[100];
int ret;
return true;
}
-bool cull_entries(int fd, char *me, char *t, char *br)
+static bool cull_entries(int fd, char *me, char *t, char *br)
{
struct stat sb;
char *buf, *p, *e, *nic;
return true;
}
-int count_entries(char *buf, off_t len, char *me, char *t, char *br)
+static int count_entries(char *buf, off_t len, char *me, char *t, char *br)
{
char *e = &buf[len];
int count = 0;
* The dbfile has lines of the format:
* user type bridge nicname
*/
-bool get_nic_if_avail(int fd, char *me, int pid, char *intype, char *br, int allowed, char **nicname, char **cnic)
+static bool get_nic_if_avail(int fd, char *me, int pid, char *intype, char *br, int allowed, char **nicname, char **cnic)
{
off_t len, slen;
struct stat sb;
return true;
}
-bool create_db_dir(char *fnam)
+static bool create_db_dir(char *fnam)
{
char *p = alloca(strlen(fnam)+1);
return lxc_netdev_rename_by_index(index, newname);
}
-int rename_in_ns(int pid, char *oldname, char *newname)
+static int rename_in_ns(int pid, char *oldname, char *newname)
{
char nspath[MAXPATHLEN];
int fd = -1, ofd = -1, ret;