Changeset 26495 in vbox for trunk/src/VBox/Devices/Network/slirp/libalias/alias_mod.c
- Timestamp:
- Feb 14, 2010 7:59:48 AM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Network/slirp/libalias/alias_mod.c
r21864 r26495 63 63 struct rwlock handler_rw; 64 64 #endif 65 SLIST_HEAD(dll_chain, dll) dll_chain = SLIST_HEAD_INITIALIZER(foo); 65 SLIST_HEAD(dll_chain, dll) dll_chain = SLIST_HEAD_INITIALIZER(foo); 66 66 67 67 #ifdef _KERNEL … … 123 123 #define _handler_chain_init() ; 124 124 #define _handler_chain_destroy() ; 125 #endif 125 #endif 126 126 127 127 void … … 146 146 struct proto_handler *b = NULL; 147 147 148 LIBALIAS_WLOCK_ASSERT(); 148 LIBALIAS_WLOCK_ASSERT(); 149 149 LIST_FOREACH(b, &handler_chain, entries) { 150 if ((b->pri == p->pri) && 150 if ((b->pri == p->pri) && 151 151 (b->dir == p->dir) && 152 152 (b->proto == p->proto)) … … 174 174 struct proto_handler *b, *b_tmp;; 175 175 176 LIBALIAS_WLOCK_ASSERT(); 176 LIBALIAS_WLOCK_ASSERT(); 177 177 LIST_FOREACH_SAFE(b, &handler_chain, entries, b_tmp) { 178 178 if (b == p) { … … 195 195 LIBALIAS_WLOCK(); 196 196 for (i=0; 1; i++) { 197 if (*((int *)&_p[i]) == EOH) 197 if (*((int *)&_p[i]) == EOH) 198 198 break; 199 199 #ifdef VBOX … … 202 202 error = _attach_handler(&_p[i]); 203 203 #endif 204 if (error != 0) 204 if (error != 0) 205 205 break; 206 206 } … … 220 220 LIBALIAS_WLOCK(); 221 221 for (i=0; 1; i++) { 222 if (*((int *)&_p[i]) == EOH) 222 if (*((int *)&_p[i]) == EOH) 223 223 break; 224 224 #ifdef VBOX … … 227 227 error = _detach_handler(&_p[i]); 228 228 #endif 229 if (error != 0) 229 if (error != 0) 230 230 break; 231 231 } … … 254 254 255 255 int 256 find_handler(int8_t dir, int8_t proto, struct libalias *la, struct ip *pip, 256 find_handler(int8_t dir, int8_t proto, struct libalias *la, struct ip *pip, 257 257 struct alias_data *ad) 258 258 { … … 264 264 265 265 LIBALIAS_RLOCK(); 266 266 267 267 LIST_FOREACH(p, &handler_chain, entries) { 268 268 if ((p->dir & dir) && (p->proto & proto)) … … 273 273 } 274 274 LIBALIAS_RUNLOCK(); 275 return (error); 275 return (error); 276 276 } 277 277 … … 283 283 #endif 284 284 { 285 286 return (LIST_FIRST(&handler_chain)); 285 286 return (LIST_FIRST(&handler_chain)); 287 287 } 288 288 … … 310 310 SLIST_FOREACH_SAFE(b, &dll_chain, next, b_tmp) 311 311 if (!strncmp(b->name, p, DLL_LEN)) { 312 SLIST_REMOVE(&dll_chain, b, dll, next); 312 SLIST_REMOVE(&dll_chain, b, dll, next); 313 313 error = b; 314 314 break;
Note:
See TracChangeset
for help on using the changeset viewer.