Changeset 28397 in vbox
- Timestamp:
- Apr 16, 2010 8:01:19 AM (15 years ago)
- svn:sync-xref-src-repo-rev:
- 60158
- Location:
- trunk/src/VBox/Devices/Network/slirp
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Network/slirp/misc.c
r28394 r28397 55 55 element->qh_rlink = NULL; 56 56 /* element->qh_link = NULL; TCP FIN1 crashes if you do this. Why ? */ 57 }58 59 int60 add_exec(struct ex_list **ex_ptr, int do_pty, char *exec, int addr, int port)61 {62 struct ex_list *tmp_ptr;63 64 /* First, check if the port is "bound" */65 for (tmp_ptr = *ex_ptr; tmp_ptr; tmp_ptr = tmp_ptr->ex_next)66 {67 if (port == tmp_ptr->ex_fport && addr == tmp_ptr->ex_addr)68 return -1;69 }70 71 tmp_ptr = *ex_ptr;72 *ex_ptr = (struct ex_list *)RTMemAlloc(sizeof(struct ex_list));73 (*ex_ptr)->ex_fport = port;74 (*ex_ptr)->ex_addr = addr;75 (*ex_ptr)->ex_pty = do_pty;76 (*ex_ptr)->ex_exec = RTStrDup(exec);77 (*ex_ptr)->ex_next = tmp_ptr;78 return 0;79 57 } 80 58 -
trunk/src/VBox/Devices/Network/slirp/misc.h
r26404 r28397 8 8 #ifndef _MISC_H_ 9 9 #define _MISC_H_ 10 11 struct ex_list12 {13 int ex_pty; /* Do we want a pty? */14 int ex_addr; /* The last byte of the address */15 int ex_fport; /* Port to telnet to */16 char *ex_exec; /* Command line of what to exec */17 struct ex_list *ex_next;18 };19 20 extern struct ex_list *exec_list;21 10 22 11 #define EMU_NONE 0x0 … … 65 54 void slirp_insque (PNATState, void *, void *); 66 55 void slirp_remque (PNATState, void *); 67 int add_exec (struct ex_list **, int, char *, int, int);68 56 int slirp_openpty (int *, int *); 69 57 int fork_exec (PNATState, struct socket *, char *, int); -
trunk/src/VBox/Devices/Network/slirp/slirp.c
r28365 r28397 1389 1389 struct arphdr *rah; 1390 1390 int ar_op; 1391 struct ex_list *ex_ptr;1392 1391 uint32_t htip; 1393 1392 uint32_t tip; … … 1434 1433 || CTL_CHECK(htip, CTL_TFTP)) 1435 1434 goto arp_ok; 1436 for (ex_ptr = exec_list; ex_ptr; ex_ptr = ex_ptr->ex_next)1437 {1438 if ((htip & ~pData->netmask) == ex_ptr->ex_addr)1439 {1440 goto arp_ok;1441 }1442 }1443 1435 m_free(pData, m); 1444 1436 m_free(pData, mr); … … 1801 1793 pData->cRedirectionsStored++; 1802 1794 return 0; 1803 }1804 1805 int slirp_add_exec(PNATState pData, int do_pty, const char *args, int addr_low_byte,1806 int guest_port)1807 {1808 return add_exec(&exec_list, do_pty, (char *)args,1809 addr_low_byte, RT_H2N_U16(guest_port));1810 1795 } 1811 1796 -
trunk/src/VBox/Devices/Network/slirp/slirp_state.h
r28365 r28397 184 184 #endif 185 185 const uint8_t *slirp_ethaddr; 186 struct ex_list *exec_list;187 186 char slirp_hostname[33]; 188 187 bool fPassDomain; … … 407 406 #define loopback_addr pData->loopback_addr 408 407 #define client_ethaddr pData->client_ethaddr 409 #define exec_list pData->exec_list410 408 #define slirp_hostname pData->slirp_hostname 411 409
Note:
See TracChangeset
for help on using the changeset viewer.