Changeset 34209 in vbox for trunk/src/VBox
- Timestamp:
- Nov 19, 2010 4:04:55 PM (14 years ago)
- Location:
- trunk/src/VBox/Devices/Network
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Network/DrvNAT.cpp
r34014 r34209 991 991 992 992 /** 993 * Info handler. 994 */ 995 static DECLCALLBACK(void) drvNATInfo(PPDMDRVINS pDrvIns, PCDBGFINFOHLP pHlp, const char *pszArgs) 996 { 997 PDRVNAT pThis = PDMINS_2_DATA(pDrvIns, PDRVNAT); 998 slirp_info(pThis->pNATState, pHlp, pszArgs); 999 } 1000 1001 1002 /** 993 1003 * Sets up the redirectors. 994 1004 * … … 1313 1323 rc = RTCritSectInit(&pThis->XmitLock); 1314 1324 AssertRCReturn(rc, rc); 1325 1326 char szTmp[128]; 1327 RTStrPrintf(szTmp, sizeof(szTmp), "nat%d", pDrvIns->iInstance); 1328 PDMDrvHlpDBGFInfoRegister(pDrvIns, szTmp, "NAT info.", drvNATInfo); 1315 1329 1316 1330 #ifndef RT_OS_WINDOWS -
trunk/src/VBox/Devices/Network/slirp/debug.c
r34103 r34209 279 279 if (so->so_state == SS_NOFDREF || so->s == -1) 280 280 return RTStrFormat(pfnOutput, pvArgOutput, NULL, 0, 281 "socket(%d) SS_NODREF",so->s); 281 "socket(%d) SS_NOFDREF", so->s); 282 282 283 status = getsockname(so->s, &addr, &socklen); 283 284 284 if(status != 0 || addr.sa_family != AF_INET) 285 285 { 286 286 return RTStrFormat(pfnOutput, pvArgOutput, NULL, 0, 287 "socket(%d) is invalid(probably closed)", so->s);287 "socket(%d) is invalid(probably closed)", so->s); 288 288 } 289 289 290 290 in_addr = (struct sockaddr_in *)&addr; 291 291 ip = RT_N2H_U32(so->so_faddr.s_addr); 292 return RTStrFormat(pfnOutput, pvArgOutput, NULL, 0, "socket % 4d:(proto:%u) "292 return RTStrFormat(pfnOutput, pvArgOutput, NULL, 0, "socket %d:(proto:%u) " 293 293 "state=%04x ip=" IP4_ADDR_PRINTF_FORMAT ":%d " 294 294 "name=" IP4_ADDR_PRINTF_FORMAT ":%d", -
trunk/src/VBox/Devices/Network/slirp/libslirp.h
r33825 r34209 38 38 39 39 #include <VBox/types.h> 40 #include <VBox/dbgf.h> 40 41 41 42 typedef struct NATState *PNATState; … … 90 91 void slirp_set_tcp_sndspace(PNATState pData, int kilobytes); 91 92 92 int slirp_set_binding_address(PNATState, char *addr);93 int slirp_set_binding_address(PNATState, char *addr); 93 94 void slirp_set_mtu(PNATState, int); 95 void slirp_info(PNATState pData, PCDBGFINFOHLP pHlp, const char *pszArgs); 94 96 95 97 #if defined(RT_OS_WINDOWS) -
trunk/src/VBox/Devices/Network/slirp/slirp.c
r34103 r34209 2071 2071 if_mru = mtu; 2072 2072 } 2073 2074 /** 2075 * Info handler. 2076 */ 2077 void slirp_info(PNATState pData, PCDBGFINFOHLP pHlp, const char *pszArgs) 2078 { 2079 struct socket *so, *so_next; 2080 struct arp_cache_entry *ac; 2081 struct port_forward_rule *rule; 2082 2083 pHlp->pfnPrintf(pHlp, "NAT parameters: MTU=%d\n", if_mtu); 2084 pHlp->pfnPrintf(pHlp, "NAT TCP ports:\n"); 2085 QSOCKET_FOREACH(so, so_next, tcp) 2086 /* { */ 2087 pHlp->pfnPrintf(pHlp, " %R[natsock]\n", so); 2088 } 2089 2090 pHlp->pfnPrintf(pHlp, "NAT UDP ports:\n"); 2091 QSOCKET_FOREACH(so, so_next, udp) 2092 /* { */ 2093 pHlp->pfnPrintf(pHlp, " %R[natsock]\n", so); 2094 } 2095 2096 pHlp->pfnPrintf(pHlp, "NAT ARP cache:\n"); 2097 LIST_FOREACH(ac, &pData->arp_cache, list) 2098 { 2099 pHlp->pfnPrintf(pHlp, " %R[IP4] %R[ether]\n", &ac->ip, &ac->ether); 2100 } 2101 2102 pHlp->pfnPrintf(pHlp, "NAT rules:\n"); 2103 LIST_FOREACH(rule, &pData->port_forward_rule_head, list) 2104 { 2105 pHlp->pfnPrintf(pHlp, " %s %d => %R[IP4]:%d %c\n", 2106 rule->proto == IPPROTO_UDP ? "UDP" : "TCP", 2107 rule->host_port, &rule->guest_addr.s_addr, rule->guest_port, 2108 rule->activated ? ' ' : '*'); 2109 } 2110 }
Note:
See TracChangeset
for help on using the changeset viewer.