Changeset 26495 in vbox for trunk/src/VBox/Devices/Network/slirp/dnsproxy
- Timestamp:
- Feb 14, 2010 7:59:48 AM (15 years ago)
- svn:sync-xref-src-repo-rev:
- 57665
- Location:
- trunk/src/VBox/Devices/Network/slirp/dnsproxy
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Network/slirp/dnsproxy/dnsproxy.c
r26404 r26495 102 102 #else /* VBOX */ 103 103 static void 104 timeout(PNATState pData, struct socket *so, void *arg) 104 timeout(PNATState pData, struct socket *so, void *arg) 105 105 { 106 106 struct request *req = (struct request *)arg; … … 119 119 struct udphdr *udp; 120 120 int iphlen; 121 struct socket *so1 = socreate(); 121 struct socket *so1 = socreate(); 122 122 struct mbuf *m = NULL; 123 123 char *data; … … 146 146 /* mbuf initialization */ 147 147 m->m_data += if_maxlinkhdr; 148 ip = mtod(m, struct ip *); 148 ip = mtod(m, struct ip *); 149 149 udp = (struct udphdr *)&ip[1]; /* ip attributes */ 150 150 data = (char *)&udp[1]; … … 175 175 * queue and send it to the correct server. 176 176 * 177 * Slirp: this routine should be called from udp_input 177 * Slirp: this routine should be called from udp_input 178 178 * socket is Slirp's construction (here we should set expiration time for socket) 179 179 * mbuf points on ip header to easy fetch information about source and destination. … … 268 268 269 269 /* fill the request structure */ 270 if (so->so_timeout_arg == NULL) 270 if (so->so_timeout_arg == NULL) 271 271 { 272 272 req->id = QUERYID; … … 280 280 if (fail_counter == 0) 281 281 LogRel(("NAT/dnsproxy: Empty DNS entry (suppressed 100 times)\n")); 282 else 282 else 283 283 fail_counter = (fail_counter == 100 ? 0 : fail_counter + 1); 284 284 return; 285 285 286 286 } 287 287 retransmit = 0; … … 290 290 req->nbyte = byte; 291 291 memcpy(req->byte, buf, byte); /* copying original request */ 292 } 293 else 292 } 293 else 294 294 { 295 295 retransmit = 1; … … 383 383 * server. Find the corresponding query and send answer back to querying 384 384 * host. 385 * 385 * 386 386 * Slirp: we call this from the routine from socrecvfrom routine handling UDP responses. 387 387 * So at the moment of call response already has been readed and packed into the mbuf … … 430 430 if ((query = hash_find_request(pData, *((unsigned short *)buf))) == NULL) { 431 431 ++late_answers; 432 /* Probably, this request wasn't serviced by 432 /* Probably, this request wasn't serviced by 433 433 * dnsproxy so we won't care about it here*/ 434 434 so->so_expire = curtime + SO_EXPIREFAST; … … 632 632 } 633 633 #else 634 int 634 int 635 635 dnsproxy_init(PNATState pData) 636 636 { -
trunk/src/VBox/Devices/Network/slirp/dnsproxy/dnsproxy.h
r18815 r26495 78 78 struct request *next; 79 79 #ifdef VBOX 80 /* this field used for saving last attempt 81 * to connect server, timeout function should change 80 /* this field used for saving last attempt 81 * to connect server, timeout function should change 82 82 * it's value on next server. And dnsproxy_query should 83 83 * initializate with first server in the list 84 84 */ 85 struct dns_entry *dns_server; 85 struct dns_entry *dns_server; 86 86 int nbyte; /* length of dns request */ 87 87 char byte[1]; /* copy of original request */
Note:
See TracChangeset
for help on using the changeset viewer.