Changeset 21864 in vbox
- Timestamp:
- Jul 29, 2009 2:09:25 PM (16 years ago)
- svn:sync-xref-src-repo-rev:
- 50503
- Location:
- trunk/src/VBox/Devices/Network/slirp
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Network/slirp/libalias/alias_ftp.c
r20958 r21864 150 150 mod_handler(module_t mod, int type, void *data) 151 151 #else 152 static int ftp_alias_handler( int type);152 static int ftp_alias_handler(PNATState pData, int type); 153 153 154 154 int 155 ftp_alias_load( void)156 { 157 return ftp_alias_handler( MOD_LOAD);155 ftp_alias_load(PNATState pData) 156 { 157 return ftp_alias_handler(pData, MOD_LOAD); 158 158 } 159 159 160 160 int 161 ftp_alias_unload( void)162 { 163 return ftp_alias_handler( MOD_UNLOAD);161 ftp_alias_unload(PNATState pData) 162 { 163 return ftp_alias_handler(pData, MOD_UNLOAD); 164 164 } 165 165 static int 166 ftp_alias_handler( int type)166 ftp_alias_handler(PNATState pData, int type) 167 167 #endif 168 168 { … … 180 180 case MOD_LOAD: 181 181 error = 0; 182 #ifdef VBOX 183 LibAliasAttachHandlers(pData, handlers); 184 #else 182 185 LibAliasAttachHandlers(handlers); 186 #endif 183 187 break; 184 188 case MOD_UNLOAD: 185 189 error = 0; 190 #ifdef VBOX 191 LibAliasDetachHandlers(pData, handlers); 192 #else 186 193 LibAliasDetachHandlers(handlers); 194 #endif 187 195 break; 188 196 default: -
trunk/src/VBox/Devices/Network/slirp/libalias/alias_mod.c
r20958 r21864 52 52 #include "alias_mod.h" 53 53 #endif 54 55 /* Protocol and userland module handlers chains. */ 56 LIST_HEAD(handler_chain, proto_handler) handler_chain = LIST_HEAD_INITIALIZER(foo); 54 57 #else /* !VBOX */ 55 58 # include <slirp.h> … … 57 60 # include "alias_mod.h" 58 61 #endif /* VBOX */ 59 60 /* Protocol and userland module handlers chains. */61 LIST_HEAD(handler_chain, proto_handler) handler_chain = LIST_HEAD_INITIALIZER(foo);62 62 #ifdef _KERNEL 63 63 struct rwlock handler_rw; … … 138 138 139 139 static int 140 #ifdef VBOX 141 _attach_handler(PNATState pData, struct proto_handler *p) 142 #else 140 143 _attach_handler(struct proto_handler *p) 144 #endif 141 145 { 142 146 struct proto_handler *b = NULL; … … 162 166 163 167 static int 168 #ifdef VBOX 169 _detach_handler(PNATState pData, struct proto_handler *p) 170 #else 164 171 _detach_handler(struct proto_handler *p) 172 #endif 165 173 { 166 174 struct proto_handler *b, *b_tmp;; … … 177 185 178 186 int 187 #ifdef VBOX 188 LibAliasAttachHandlers(PNATState pData, struct proto_handler *_p) 189 #else 179 190 LibAliasAttachHandlers(struct proto_handler *_p) 191 #endif 180 192 { 181 193 int i, error = -1; … … 185 197 if (*((int *)&_p[i]) == EOH) 186 198 break; 199 #ifdef VBOX 200 error = _attach_handler(pData, &_p[i]); 201 #else 187 202 error = _attach_handler(&_p[i]); 203 #endif 188 204 if (error != 0) 189 205 break; … … 194 210 195 211 int 212 #ifdef VBOX 213 LibAliasDetachHandlers(PNATState pData, struct proto_handler *_p) 214 #else 196 215 LibAliasDetachHandlers(struct proto_handler *_p) 216 #endif 197 217 { 198 218 int i, error = -1; … … 202 222 if (*((int *)&_p[i]) == EOH) 203 223 break; 224 #ifdef VBOX 225 error = _detach_handler(pData, &_p[i]); 226 #else 204 227 error = _detach_handler(&_p[i]); 228 #endif 205 229 if (error != 0) 206 230 break; … … 211 235 212 236 int 237 #ifdef VBOX 238 detach_handler(PNATState pData, struct proto_handler *_p) 239 #else 213 240 detach_handler(struct proto_handler *_p) 241 #endif 214 242 { 215 243 int error = -1; 216 244 217 245 LIBALIAS_WLOCK(); 246 #ifdef VBOX 247 error = _detach_handler(pData, _p); 248 #else 218 249 error = _detach_handler(_p); 250 #endif 219 251 LIBALIAS_WUNLOCK(); 220 252 return (error); … … 225 257 struct alias_data *ad) 226 258 { 259 #ifdef VBOX 260 PNATState pData = la->pData; 261 #endif 227 262 struct proto_handler *p; 228 263 int error = ENOENT; … … 242 277 243 278 struct proto_handler * 279 #ifdef VBOX 280 first_handler(PNATState pData) 281 #else 244 282 first_handler(void) 283 #endif 245 284 { 246 285 -
trunk/src/VBox/Devices/Network/slirp/libalias/alias_mod.h
r20958 r21864 116 116 void handler_chain_init(void); 117 117 void handler_chain_destroy(void); 118 #ifdef VBOX 119 int LibAliasAttachHandlers(PNATState pData, struct proto_handler *); 120 int LibAliasDetachHandlers(PNATState pData, struct proto_handler *); 121 int detach_handler(PNATState pData, struct proto_handler *); 122 struct proto_handler *first_handler(PNATState pData); 123 #else 118 124 int LibAliasAttachHandlers(struct proto_handler *); 119 125 int LibAliasDetachHandlers(struct proto_handler *); 120 126 int detach_handler(struct proto_handler *); 127 struct proto_handler *first_handler(void); 128 #endif 121 129 int find_handler(int8_t, int8_t, struct libalias *, 122 struct ip *, struct alias_data *); 123 struct proto_handler *first_handler(void); 130 struct ip *, struct alias_data *); 124 131 125 132 /* Functions used with dll module. */ -
trunk/src/VBox/Devices/Network/slirp/libalias/alias_nbt.c
r20958 r21864 169 169 mod_handler(module_t mod, int type, void *data) 170 170 #else /*!VBOX*/ 171 static int nbt_alias_handler( int type);171 static int nbt_alias_handler(PNATState pData, int type); 172 172 173 173 int 174 nbt_alias_load( )175 { 176 return nbt_alias_handler( MOD_LOAD);174 nbt_alias_load(PNATState pData) 175 { 176 return nbt_alias_handler(pData, MOD_LOAD); 177 177 } 178 178 179 179 int 180 nbt_alias_unload( )181 { 182 return nbt_alias_handler( MOD_UNLOAD);180 nbt_alias_unload(PNATState pData) 181 { 182 return nbt_alias_handler(pData, MOD_UNLOAD); 183 183 } 184 184 static int 185 nbt_alias_handler( int type)185 nbt_alias_handler(PNATState pData, int type) 186 186 #endif /*VBOX*/ 187 187 { … … 215 215 case MOD_LOAD: 216 216 error = 0; 217 #ifdef VBOX 218 LibAliasAttachHandlers(pData, handlers); 219 #else 217 220 LibAliasAttachHandlers(handlers); 221 #endif 218 222 break; 219 223 case MOD_UNLOAD: 220 224 error = 0; 225 #ifdef VBOX 226 LibAliasDetachHandlers(pData, handlers); 227 #else 221 228 LibAliasDetachHandlers(handlers); 229 #endif 222 230 break; 223 231 default: -
trunk/src/VBox/Devices/Network/slirp/slirp.c
r21698 r21864 557 557 proxy_addr.s_addr = htonl(ntohl(special_addr.s_addr) | CTL_ALIAS); 558 558 LibAliasSetAddress(pData->proxy_alias, proxy_addr); 559 ftp_alias_load( );560 nbt_alias_load( );559 ftp_alias_load(pData); 560 nbt_alias_load(pData); 561 561 562 562 } … … 657 657 slirp_link_down(pData); 658 658 slirp_release_dns_list(pData); 659 ftp_alias_unload( );660 nbt_alias_unload( );659 ftp_alias_unload(pData); 660 nbt_alias_unload(pData); 661 661 #ifdef VBOX_WITH_SLIRP_ALIAS 662 662 while(!LIST_EMPTY(&instancehead)) { -
trunk/src/VBox/Devices/Network/slirp/slirp.h
r20959 r21864 407 407 408 408 #ifdef VBOX_WITH_SLIRP_ALIAS 409 int ftp_alias_load( void);410 int ftp_alias_unload( void);411 int nbt_alias_load( void);412 int nbt_alias_unload( void);409 int ftp_alias_load(PNATState); 410 int ftp_alias_unload(PNATState); 411 int nbt_alias_load(PNATState); 412 int nbt_alias_unload(PNATState); 413 413 #endif /*VBOX_WITH_SLIRP_ALIAS*/ 414 414 -
trunk/src/VBox/Devices/Network/slirp/slirp_state.h
r21101 r21864 229 229 LIST_HEAD(RT_NOTHING, libalias) instancehead; 230 230 struct libalias *proxy_alias; 231 LIST_HEAD(handler_chain, proto_handler) handler_chain; 231 232 #endif 232 233 … … 315 316 #ifndef VBOX_SLIRP_ALIAS 316 317 # define alias_addr pData->alias_addr 318 #else 319 # define handler_chain pData->handler_chain 317 320 #endif 318 321 #define special_addr pData->special_addr
Note:
See TracChangeset
for help on using the changeset viewer.