tunctl.c revision f309874c5f4441f296eb806ef95b9e1a4b9e0f32
/* Copyright 2002 Jeff Dike
* Licensed under the GPL
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <errno.h>
#include <fcntl.h>
#include <unistd.h>
#include <pwd.h>
#include <grp.h>
/* TUNSETGROUP appeared in 2.6.23 */
#ifndef TUNSETGROUP
#endif
{
"[-f tun-clone-device]\n", name);
name);
exit(1);
}
{
switch(opt) {
case 'b':
brief = 1;
break;
case 'd':
delete = 1;
break;
case 'f':
break;
case 'u':
break;
}
if(*end != '\0'){
optarg);
}
break;
case 'g':
break;
}
if(*end != '\0'){
optarg);
}
break;
case 't':
break;
case 'h':
default:
}
}
if(argc > 0)
perror("");
exit(1);
}
perror("TUNSETIFF");
exit(1);
}
if(delete){
perror("disabling TUNSETPERSIST");
exit(1);
}
}
else {
/* emulate behaviour prior to TUNSETGROUP */
}
perror("TUNSETOWNER");
exit(1);
}
}
perror("TUNSETGROUP");
exit(1);
}
}
perror("enabling TUNSETPERSIST");
exit(1);
}
if(brief)
else {
printf("\n");
}
}
return(0);
}