Skip to contentSkip to conversation

switch->netjig patch 3

uml-devel Michael Richardson 1 participant 1 message Jun 3, 2004 User-mode Linux (UML)

lore
Share & tools
lore
#0 lore raw

Jeff, this patch (also http://www.sandelman.ca/tmp/jig3.patch) adds the file nethub.c, and moves additional code from uml_switch.c/port.c to nethub.c. (Sorry, this moves code from port.c that jig2 moves to there. My mistake, I copied too much)

Again, no new functionality.

uml_router/Makefile +2 -2
diff -x CVS -x '*~' -u -N -r uml_tools.jig2/uml_router/Makefile uml_tools.jig3/uml_router/Makefile
@@ -1,8 +1,8 @@
 TUNTAP = $(shell [ -e /usr/include/linux/if_tun.h ] && echo -DTUNTAP)
 
-OBJS = hash.o port.o uml_switch.o 
+OBJS = hash.o port.o uml_switch.o nethub.o
 BIN = uml_switch
-CFLAGS = -g -Wall $(TUNTAP)
+CFLAGS = -g -Wall $(TUNTAP) 
 
 BIN_DIR ?= /usr/bin
 
uml_router/nethub.c +221 -0

221 lines not on this page · raw message

uml_router/nethub.h +6 -0
diff -x CVS -x '*~' -u -N -r uml_tools.jig2/uml_router/nethub.h uml_tools.jig3/uml_router/nethub.h
@@ -103,6 +103,12 @@
 
 extern struct sockaddr_un data_sun;
 extern void cleanup(void);
+extern void bind_sockets(int ctl_fd, const char *ctl_name, int data_fd);
+void bind_sockets_v0(int ctl_fd, const char *ctl_name, 
+		     int data_fd, const char *data_name);
+void add_fd(int fd);
+void accept_connection(int fd);
+void close_descriptor(int fd);
 
 
 #define _NETHUB_H_

Binary files uml_tools.jig2/uml_router/nethub.o and uml_tools.jig3/uml_router/nethub.o differ

uml_router/port.c +0 -190

199 lines not on this page · raw message

uml_router/port.h +0 -6
diff -x CVS -x '*~' -u -N -r uml_tools.jig2/uml_router/port.h uml_tools.jig3/uml_router/port.h
@@ -17,12 +17,6 @@
 extern void handle_tap_data(int fd, int hub);
 extern void handle_sock_data(int fd, int hub);
 extern void new_port(int fd, int data_fd);
-extern void bind_sockets(int ctl_fd, const char *ctl_name, int data_fd);
-void bind_sockets_v0(int ctl_fd, const char *ctl_name, 
-		     int data_fd, const char *data_name);
-void add_fd(int fd);
-void accept_connection(int fd);
-void close_descriptor(int fd);
 
 
 #endif

Binary files uml_tools.jig2/uml_router/port.o and uml_tools.jig3/uml_router/port.o differ Binary files uml_tools.jig2/uml_router/uml_switch and uml_tools.jig3/uml_router/uml_switch differ

uml_router/uml_switch.c +0 -12
diff -x CVS -x '*~' -u -N -r uml_tools.jig2/uml_router/uml_switch.c uml_tools.jig3/uml_router/uml_switch.c
@@ -35,18 +35,6 @@
 char *data_socket = NULL;
 struct sockaddr_un data_sun;
 
-void cleanup(void)
-{
-  if(unlink(ctl_socket) < 0){
-    printf("Couldn't remove control socket '%s' : ", ctl_socket);
-    perror("");
-  }
-  if((data_socket != NULL) && (unlink(data_socket) < 0)){
-    printf("Couldn't remove data socket '%s' : ", data_socket);
-    perror("");
-  }
-}
-
 static void sig_handler(int sig)
 {
   printf("Caught signal %d, cleaning up and exiting\n", sig);

Binary files uml_tools.jig2/uml_router/uml_switch.o and uml_tools.jig3/uml_router/uml_switch.o differ

-------------------------------------------------------
This SF.Net email is sponsored by the new InstallShield X. From Windows to Linux, servers to mobile, InstallShield X is the one installation-authoring solution that does it all. Learn more and evaluate today! http://www.installshield.com/Dev2Dev/0504
_______________________________________________
User-mode-linux-devel mailing list [email protected]
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel