Changeset 10126 in vbox
- Timestamp:
- Jul 3, 2008 12:50:07 AM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/VBox/intnet.h
r10084 r10126 246 246 /** Owner data, don't touch! */ 247 247 void *pvOwnerData; 248 /** User data. */ 249 void *pvUserData; 250 /** User data 2 in case anyone needs it. */ 251 void *pvUserData2; 248 252 /** The total length of the scatter gather list. */ 249 253 uint32_t cbTotal; … … 297 301 298 302 303 /** @name Direction (packet source or destination) 304 * @{ */ 305 /** To/From the wire. */ 306 #define INTNETTRUNKDIR_WIRE RT_BIT_32(1) 307 /** To/From the host. */ 308 #define INTNETTRUNKDIR_HOST RT_BIT_32(2) 309 /** Mask of valid bits. */ 310 #define INTNETTRUNKDIR_VALID_MASK UINT32_C(0x3) 311 /** @} */ 312 299 313 300 314 /** Pointer to the switch side of a trunk port. */ … … 331 345 332 346 /** 333 * Frame from the host that's about to hit the wire.347 * Incoming frame. 334 348 * 335 349 * @returns true if we've handled it and it should be dropped. … … 340 354 * This will only be use during the call, so a temporary one can 341 355 * be used. The Phys member will not be used. 356 * @param fSrc Where this frame comes from. Only one bit should be set! 342 357 * 343 358 * @remarks Will grab the network semaphore. … … 345 360 * @remark NAT and TAP will use this interface. 346 361 */ 347 DECLR0CALLBACKMEMBER(bool, pfnRecvHost,(PINTNETTRUNKSWPORT pIfPort, PINTNETSG pSG)); 348 349 /** 350 * Frame from the wire that's about to hit the network stack. 351 * 352 * @returns true if we've handled it and it should be dropped. 353 * false if it should hit the network stack. 354 * 355 * @param pIfPort Pointer to this structure. 356 * @param pSG The (scatter /) gather structure for the frame. 357 * This will only be use during the call, so a temporary one can 358 * be used. The Phys member will not be used. 359 * 360 * @remarks Will grab the network semaphore. 361 * 362 * @remark NAT and TAP will not this interface. 363 */ 364 DECLR0CALLBACKMEMBER(bool, pfnRecvWire,(PINTNETTRUNKSWPORT pIfPort, PINTNETSG pSG)); 365 366 /** 367 * This is called by the pfnSendToHost and pfnSendToWire code when they are 368 * done with a SG. 369 * 370 * It may be called after they return if the frame was pushed in an 371 * async manner. 362 DECLR0CALLBACKMEMBER(bool, pfnRecv,(PINTNETTRUNKSWPORT pIfPort, PINTNETSG pSG, uint32_t fSrc)); 363 364 /** 365 * Retain a SG. 366 * 367 * @param pIfPort Pointer to this structure. 368 * @param pSG Pointer to the (scatter /) gather structure. 369 * 370 * @remarks Will not grab any locks. 371 */ 372 DECLR0CALLBACKMEMBER(void, pfnSGRetain,(PINTNETTRUNKSWPORT pIfPort, PINTNETSG pSG)); 373 374 /** 375 * Release a SG. 376 * 377 * This is called by the pfnXmit code when done with a SG. This may safe 378 * be done in an asynchronous manner. 372 379 * 373 380 * @param pIfPort Pointer to this structure. … … 483 490 /** 484 491 * Tests if the mac address belongs to any of the host NICs 485 * and should take the pfnSendToHost route.492 * and should take the host route. 486 493 * 487 494 * @returns true / false. … … 493 500 * 494 501 * @remarks TAP and NAT will compare with their own MAC address and let all their 495 * traffic go over the pfnSendToHost method.502 * traffic take the host direction. 496 503 */ 497 504 DECLR0CALLBACKMEMBER(bool, pfnIsHostMac,(PINTNETTRUNKIFPORT pIfPort, PCPDMMAC pMac)); … … 517 524 518 525 /** 519 * Send the frame to the host. 520 * 521 * This path is taken if pfnIsHostMac returns true and the trunk port on the 522 * internal network is configured to let traffic thru to the host. It may also 523 * be taken if the host is in promiscuous mode and the internal network is 524 * configured to respect this for internal targets. 526 * Transmit a frame. 525 527 * 526 528 * @return VBox status code. Error generally means we'll drop the packet. … … 530 532 * do this asynchronously to save unnecessary buffer 531 533 * allocating and copying. 534 * @param fDst The destination mask. At least one bit will be set. 532 535 * 533 536 * @remarks Called holding the out-bound trunk port lock. … … 535 538 * @remarks TAP and NAT will use this interface for all their traffic, see pfnIsHostMac. 536 539 */ 537 DECLR0CALLBACKMEMBER(int, pfnSendToHost,(PINTNETTRUNKIFPORT pIfPort, PINTNETSG pSG)); 538 539 /** 540 * Put the frame on the wire. 541 * 542 * This path is taken if pfnIsHostMac returns false and the trunk port on the 543 * internal network is configured to let traffic out on the wire. This may also 544 * be taken for both internal and host traffic if the trunk port is configured 545 * to be in promiscuous mode. 546 * 547 * @return VBox status code. Error generally means we'll drop the packet. 548 * @param pIfPort Pointer to this structure. 549 * @param pSG Pointer to the (scatter /) gather structure for the frame. 550 * This will never be a temporary one, so, it's safe to 551 * do this asynchronously to save unnecessary buffer 552 * allocating and copying. 553 * 554 * @remarks Called holding the out-bound trunk port lock. 555 * 556 * @remarks TAP and NAT will call pfnSGRelease and return successfully. 557 */ 558 DECLR0CALLBACKMEMBER(int, pfnSendToWire,(PINTNETTRUNKIFPORT pIfPort, PINTNETSG pSG)); 540 DECLR0CALLBACKMEMBER(int, pfnXmit,(PINTNETTRUNKIFPORT pIfPort, PINTNETSG pSG, uint32_t fDst)); 559 541 560 542 /** Structure version number. (INTNETTRUNKIFPORT_VERSION) */
Note:
See TracChangeset
for help on using the changeset viewer.