12 #include <sys/termios.h>
19 static int slip_user_init(
void *
data,
void *
dev)
27 static int set_up_tty(
int fd)
32 if (tcgetattr(fd, &tios) < 0) {
42 for (i = 0; i <
NCCS; i++)
47 cfsetospeed(&tios,
B38400);
48 cfsetispeed(&tios,
B38400);
50 if (tcsetattr(fd,
TCSAFLUSH, &tios) < 0) {
63 static void slip_pre_exec(
void *
arg)
74 static int slip_tramp(
char **argv,
int fd)
78 int pid, fds[2],
err, output_len;
89 pe_data.stdout = fds[1];
90 pe_data.close_me = fds[0];
91 err =
run_helper(slip_pre_exec, &pe_data, argv);
96 output_len = UM_KERN_PAGE_SIZE;
123 static int slip_open(
void *
data)
126 char version_buf[
sizeof(
"nnnnn\0")];
127 char gate_buf[
sizeof(
"nnn.nnn.nnn.nnn\0")];
128 char *argv[] = {
"uml_net", version_buf,
"slip",
"up", gate_buf,
158 err = slip_tramp(argv, sfd);
177 "encapsulation - err = %d\n", -err);
190 static void slip_close(
int fd,
void *data)
193 char version_buf[
sizeof(
"nnnnn\0")];
194 char *argv[] = {
"uml_net", version_buf,
"slip",
"down", pri->
name,
203 err = slip_tramp(argv, pri->
slave);
222 static void slip_add_addr(
unsigned char *
addr,
unsigned char *netmask,
232 static void slip_del_addr(
unsigned char *addr,
unsigned char *netmask,
243 .init = slip_user_init,
247 .add_address = slip_add_addr,
248 .delete_address = slip_del_addr,