Changeset 14526 in vbox for trunk/include
- Timestamp:
- Nov 24, 2008 3:16:01 PM (16 years ago)
- svn:sync-xref-src-repo-rev:
- 39814
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/VBox/VBoxHDD-new.h
r13988 r14526 216 216 * provide the mandatory configuration parts this way. */ 217 217 #define VD_CAP_CONFIG RT_BIT(7) 218 /** The backend uses the network stack interface. The caller has to provide 219 * the appropriate interface. */ 220 #define VD_CAP_TCPNET RT_BIT(8) 218 221 /** @}*/ 219 222 … … 233 236 /** Interface for configuration information. Per-image. */ 234 237 VDINTERFACETYPE_CONFIG, 238 /** Interface for TCP network stack. Per-disk. */ 239 VDINTERFACETYPE_TCPNET, 235 240 /** invalid interface. */ 236 241 VDINTERFACETYPE_INVALID … … 252 257 /** Opaque user data which is passed on every call. */ 253 258 void *pvUser; 254 /** Pointer to the function call table of the interface. 259 /** Pointer to the function call table of the interface. 255 260 * As this is opaque this must be casted to the right interface 256 261 * struct defined below based on the interface type in enmInterface. */ … … 288 293 AssertMsgBreak(pVDIfs->cbSize == sizeof(VDINTERFACE), 289 294 ("cbSize=%u\n", pVDIfs->cbSize)); 290 295 291 296 if (pVDIfs->enmInterface == enmInterface) 292 297 return pVDIfs; … … 395 400 } 396 401 397 /** 402 /** 398 403 * Completion callback which is called by the interface owner 399 404 * to inform the backend that a task finished. … … 455 460 * @param pcbWritten Where to store how many bytes where actually written. 456 461 */ 457 DECLR3CALLBACKMEMBER(int, pfnWrite, (void *pvUser, void *pStorage, uint64_t uOffset, 462 DECLR3CALLBACKMEMBER(int, pfnWrite, (void *pvUser, void *pStorage, uint64_t uOffset, 458 463 size_t cbWrite, const void *pvBuf, size_t *pcbWritten)); 459 464 … … 469 474 * @param pcbRead Where to store how many bytes where actually read. 470 475 */ 471 DECLR3CALLBACKMEMBER(int, pfnRead, (void *pvUser, void *pStorage, uint64_t uOffset, 476 DECLR3CALLBACKMEMBER(int, pfnRead, (void *pvUser, void *pStorage, uint64_t uOffset, 472 477 size_t cbRead, void *pvBuf, size_t *pcbRead)); 473 478 … … 492 497 * @param ppTask Where to store the opaque task handle. 493 498 */ 494 DECLR3CALLBACKMEMBER(int, pfnPrepareRead, (void *pvUser, void *pStorage, uint64_t uOffset, 499 DECLR3CALLBACKMEMBER(int, pfnPrepareRead, (void *pvUser, void *pStorage, uint64_t uOffset, 495 500 void *pvBuf, size_t cbRead, void **ppTask)); 496 501 … … 506 511 * @param ppTask Where to store the opaque task handle. 507 512 */ 508 DECLR3CALLBACKMEMBER(int, pfnPrepareWrite, (void *pvUser, void *pStorage, uint64_t uOffset, 513 DECLR3CALLBACKMEMBER(int, pfnPrepareWrite, (void *pvUser, void *pStorage, uint64_t uOffset, 509 514 void *pvBuf, size_t cbWrite, void **ppTask)); 510 515 … … 550 555 /** 551 556 * Progress notification interface 552 * 557 * 553 558 * Per-operation. Optional. 554 559 */ … … 687 692 DECLINLINE(PVDINTERFACECONFIG) VDGetInterfaceConfig(PVDINTERFACE pInterface) 688 693 { 689 /* Check that the interface descriptor is a progressinterface. */694 /* Check that the interface descriptor is a config interface. */ 690 695 AssertMsgReturn( (pInterface->enmInterface == VDINTERFACETYPE_CONFIG) 691 696 && (pInterface->cbSize == sizeof(VDINTERFACE)), … … 705 710 * Query configuration, validates that the values are within a set of valid names. 706 711 * 707 * @return strue if all names are found in pszzAllowed.708 * @return sfalse if not.712 * @return true if all names are found in pszzAllowed. 713 * @return false if not. 709 714 * @param pCfgIf Pointer to configuration callback table. 710 715 * @param pNode The node which values should be examined. … … 721 726 /** 722 727 * Query configuration, unsigned 64-bit integer value with default. 723 * 728 * 724 729 * @return VBox status code. 725 730 * @param pCfgIf Pointer to configuration callback table. … … 738 743 /** 739 744 * Query configuration, unsigned 32-bit integer value with default. 740 * 745 * 741 746 * @return VBox status code. 742 747 * @param pCfgIf Pointer to configuration callback table. … … 764 769 /** 765 770 * Query configuration, bool value with default. 766 * 771 * 767 772 * @return VBox status code. 768 773 * @param pCfgIf Pointer to configuration callback table. … … 786 791 * Query configuration, dynamically allocated (RTMemAlloc) zero terminated 787 792 * character value. 788 * 793 * 789 794 * @return VBox status code. 790 795 * @param pCfgIf Pointer to configuration callback table. … … 821 826 * Query configuration, dynamically allocated (RTMemAlloc) zero terminated 822 827 * character value with default. 823 * 828 * 824 829 * @return VBox status code. 825 830 * @param pCfgIf Pointer to configuration callback table. … … 862 867 /** 863 868 * Query configuration, dynamically allocated (RTMemAlloc) byte string value. 864 * 869 * 865 870 * @return VBox status code. 866 871 * @param pCfgIf Pointer to configuration callback table. … … 898 903 899 904 905 /** 906 * TCP network stack interface 907 * 908 * Per-disk. Mandatory for backends which have the VD_CAP_TCPNET bit set. 909 */ 910 typedef struct VDINTERFACETCPNET 911 { 912 /** 913 * Size of the configuration interface. 914 */ 915 uint32_t cbSize; 916 917 /** 918 * Interface type. 919 */ 920 VDINTERFACETYPE enmInterface; 921 922 /** 923 * Connect as a client to a TCP port. 924 * 925 * @return iprt status code. 926 * @param pszAddress The address to connect to. 927 * @param uPort The port to connect to. 928 * @param pSock Where to store the handle to the established connect 929 ion. 930 */ 931 DECLR3CALLBACKMEMBER(int, pfnClientConnect, (const char *pszAddress, uint32_t uPort, PRTSOCKET pSock)); 932 933 /** 934 * Close a TCP connection. 935 * 936 * @return iprt status code. 937 * @param Sock Socket descriptor. 938 ion. 939 */ 940 DECLR3CALLBACKMEMBER(int, pfnClientClose, (RTSOCKET Sock)); 941 942 /** 943 * Socket I/O multiplexing. 944 * Checks if the socket is ready for reading. 945 * 946 * @return iprt status code. 947 * @param Sock Socket descriptor. 948 * @param cMillies Number of milliseconds to wait for the socket. 949 * Use RT_INDEFINITE_WAIT to wait for ever. 950 */ 951 DECLR3CALLBACKMEMBER(int, pfnSelectOne, (RTSOCKET Sock, unsigned cMillies)); 952 953 /** 954 * Receive data from a socket. 955 * 956 * @return iprt status code. 957 * @param Sock Socket descriptor. 958 * @param pvBuffer Where to put the data we read. 959 * @param cbBuffer Read buffer size. 960 * @param pcbRead Number of bytes read. 961 * If NULL the entire buffer will be filled upon successful return. 962 * If not NULL a partial read can be done successfully. 963 */ 964 DECLR3CALLBACKMEMBER(int, pfnRead, (RTSOCKET Sock, void *pvBuffer, size_t cbBuffer, size_t *pcbRead)); 965 966 /** 967 * Send data from a socket. 968 * 969 * @return iprt status code. 970 * @param Sock Socket descriptor. 971 * @param pvBuffer Buffer to write data to socket. 972 * @param cbBuffer How much to write. 973 * @param pcbRead Number of bytes read. 974 */ 975 DECLR3CALLBACKMEMBER(int, pfnWrite, (RTSOCKET Sock, const void *pvBuffer, size_t cbBuffer)); 976 977 /** 978 * Flush socket write buffers. 979 * 980 * @return iprt status code. 981 * @param Sock Socket descriptor. 982 */ 983 DECLR3CALLBACKMEMBER(int, pfnFlush, (RTSOCKET Sock)); 984 985 } VDINTERFACETCPNET, *PVDINTERFACETCPNET; 986 987 /** 988 * Get TCP network stack interface from opaque callback table. 989 * 990 * @return Pointer to the callback table. 991 * @param pInterface Pointer to the interface descriptor. 992 */ 993 DECLINLINE(PVDINTERFACETCPNET) VDGetInterfaceTcpNet(PVDINTERFACE pInterface) 994 { 995 /* Check that the interface descriptor is a TCP network stack interface. */ 996 AssertMsgReturn( (pInterface->enmInterface == VDINTERFACETYPE_TCPNET) 997 && (pInterface->cbSize == sizeof(VDINTERFACE)), 998 ("Not a TCP network stack interface"), NULL); 999 1000 PVDINTERFACETCPNET pInterfaceTcpNet = (PVDINTERFACETCPNET)pInterface->pCallbacks; 1001 1002 /* Do basic checks. */ 1003 AssertMsgReturn( (pInterfaceTcpNet->cbSize == sizeof(VDINTERFACETCPNET)) 1004 && (pInterfaceTcpNet->enmInterface == VDINTERFACETYPE_TCPNET), 1005 ("A non TCP network stack callback table attached to a TCP network stack interface descriptor\n"), NULL); 1006 1007 return pInterfaceTcpNet; 1008 } 1009 1010 900 1011 /** @name Configuration interface key handling flags. 901 1012 * @{ … … 1495 1606 * @param pvUser User data which is passed on completion 1496 1607 */ 1497 VBOXDDU_DECL(int) VDAsyncRead(PVBOXHDD pDisk, uint64_t uOffset, size_t cbRead, 1608 VBOXDDU_DECL(int) VDAsyncRead(PVBOXHDD pDisk, uint64_t uOffset, size_t cbRead, 1498 1609 PPDMDATASEG paSeg, unsigned cSeg, 1499 1610 void *pvUser);
Note:
See TracChangeset
for help on using the changeset viewer.