1 /****************************************************************************
3 * $Id: rmaengin.h 7 2003-05-30 02:18:02Z gabest $
5 * Copyright (C) 1995-1999 RealNetworks, Inc. All rights reserved.
7 * http://www.real.com/devzone
9 * This program contains proprietary
10 * information of Progressive Networks, Inc, and is licensed
11 * subject to restrictions on use and distribution.
14 * RealMedia Architecture Callback, Networking, and Scheduling interfaces.
22 * Forward declarations of some interfaces used here-in.
25 typedef _INTERFACE IRMABuffer IRMABuffer
;
26 typedef _INTERFACE IRMACallback IRMACallback
;
27 typedef _INTERFACE IRMAScheduler IRMAScheduler
;
28 typedef _INTERFACE IRMATCPResponse IRMATCPResponse
;
29 typedef _INTERFACE IRMALBoundTCPSocket IRMALBoundTCPSocket
;
30 typedef _INTERFACE IRMATCPSocket IRMATCPSocket
;
31 typedef _INTERFACE IRMAListenResponse IRMAListenResponse
;
32 typedef _INTERFACE IRMAListenSocket IRMAListenSocket
;
33 typedef _INTERFACE IRMANetworkServices IRMANetworkServices
;
34 typedef _INTERFACE IRMANetworkServices2 IRMANetworkServices2
;
35 typedef _INTERFACE IRMAUDPResponse IRMAUDPResponse
;
36 typedef _INTERFACE IRMAUDPSocket IRMAUDPSocket
;
37 typedef _INTERFACE IRMAResolver IRMAResolver
;
38 typedef _INTERFACE IRMAResolverResponse IRMAResolverResponse
;
39 typedef _INTERFACE IRMAInterruptSafe IRMAInterruptSafe
;
40 typedef _INTERFACE IRMAAsyncIOSelection IRMAAsyncIOSelection
;
41 typedef _INTERFACE IRMAUDPMulticastInit IRMAUDPMulticastInit
;
42 typedef _INTERFACE IRMAInterruptState IRMAInterruptState
;
43 typedef _INTERFACE IRMAOptimizedScheduler IRMAOptimizedScheduler
;
47 * Address flags starting with PNR are depricated.
49 #define PNR_INADDR_ANY (UINT32)0x00000000 //THIS FLAG IS DEPRICATED
50 #define PN_INADDR_ANY (UINT32)0x00000000
55 * Bind to all ports in IPBindings list from
58 #define PNR_INADDR_IPBINDINGS (UINT32)0xfffffffe //THIS FLAG IS DEPRICATED
59 #define PN_INADDR_IPBINDINGS (UINT32)0xfffffffe
62 /* Async IO Selection Type (Unix Only) */
66 #define PNAIO_EXCEPTION 4
68 /****************************************************************************
76 * This interface defines a simple callback which will be used in
77 * various interfaces such as IRMAScheduler.
81 * {00000100-0901-11d1-8B06-00A024406D59}
84 DEFINE_GUID(IID_IRMACallback
, 0x00000100, 0x901, 0x11d1, 0x8b, 0x6, 0x0,
85 0xa0, 0x24, 0x40, 0x6d, 0x59);
88 #define INTERFACE IRMACallback
90 DECLARE_INTERFACE_(IRMACallback
, IUnknown
)
95 STDMETHOD(QueryInterface
) (THIS_
99 STDMETHOD_(ULONG
,AddRef
) (THIS
) PURE
;
101 STDMETHOD_(ULONG
,Release
) (THIS
) PURE
;
104 * IRMACallback methods
107 /************************************************************************
111 * This is the function that will be called when a callback is
114 STDMETHOD(Func
) (THIS
) PURE
;
118 /****************************************************************************
126 * This interface provides the user with a way of scheduling callbacks
127 * that will be executed at some time in the future.
131 * {00000101-0901-11d1-8B06-00A024406D59}
134 DEFINE_GUID(IID_IRMAScheduler
, 0x00000101, 0x901, 0x11d1, 0x8b, 0x6, 0x0,
135 0xa0, 0x24, 0x40, 0x6d, 0x59);
138 #define INTERFACE IRMAScheduler
140 typedef ULONG32 CallbackHandle
;
142 typedef struct _RMATimeval
148 DECLARE_INTERFACE_(IRMAScheduler
, IUnknown
)
153 STDMETHOD(QueryInterface
) (THIS_
157 STDMETHOD_(ULONG
,AddRef
) (THIS
) PURE
;
159 STDMETHOD_(ULONG
,Release
) (THIS
) PURE
;
162 * IRMAScheduler methods
165 /************************************************************************
167 * IRMAScheduler::RelativeEnter
169 * Schedule a callback to be executed "ms" milliseconds from now
170 * This function is less percise then AbsoluteEnter and should only
171 * be used when accurate timing is not critical.
173 STDMETHOD_(CallbackHandle
,RelativeEnter
) (THIS_
174 IRMACallback
* pCallback
,
177 /************************************************************************
179 * IRMAScheduler::AbsoluteEnter
181 * Schedule a callback to be executed at time "tVal".
183 STDMETHOD_(CallbackHandle
,AbsoluteEnter
) (THIS_
184 IRMACallback
* pCallback
,
185 RMATimeval tVal
) PURE
;
187 /************************************************************************
189 * IRMAScheduler::Remove
191 * Remove a callback from the scheduler.
193 STDMETHOD(Remove
) (THIS_
194 CallbackHandle Handle
) PURE
;
196 /************************************************************************
198 * IRMAScheduler::GetCurrentSchedulerTime
200 * Gives the current time (in the timeline of the scheduler).
202 STDMETHOD_(RMATimeval
,GetCurrentSchedulerTime
) (THIS
) PURE
;
206 /****************************************************************************
214 * This is the response interface for the asynchronous TCP networking
217 * IID_IRMATCPResponse:
219 * {00000102-0901-11d1-8B06-00A024406D59}
222 DEFINE_GUID(IID_IRMATCPResponse
, 0x00000102, 0x901, 0x11d1, 0x8b, 0x6, 0x0,
223 0xa0, 0x24, 0x40, 0x6d, 0x59);
226 #define INTERFACE IRMATCPResponse
228 DECLARE_INTERFACE_(IRMATCPResponse
, IUnknown
)
233 STDMETHOD(QueryInterface
) (THIS_
237 STDMETHOD_(ULONG
,AddRef
) (THIS
) PURE
;
239 STDMETHOD_(ULONG
,Release
) (THIS
) PURE
;
242 * IRMATCPResponse methods
245 /************************************************************************
247 * IRMATCPResponse::ConnectDone
249 * A Connect operation has been completed or an error has occurred.
251 STDMETHOD(ConnectDone
) (THIS_
252 PN_RESULT status
) PURE
;
254 /************************************************************************
256 * IRMATCPResponse::ReadDone
258 * A Read operation has been completed or an error has occurred.
259 * The data is returned in the IRMABuffer.
261 STDMETHOD(ReadDone
) (THIS_
263 IRMABuffer
* pBuffer
) PURE
;
265 /************************************************************************
267 * IRMATCPResponse::WriteReady
269 * This is the response method for WantWrite.
270 * If PN_RESULT is ok, then the TCP channel is ok to Write to.
272 STDMETHOD(WriteReady
) (THIS_
273 PN_RESULT status
) PURE
;
275 /************************************************************************
277 * IRMATCPResponse::Closed
279 * This method is called to inform you that the TCP channel has
280 * been closed by the peer or closed due to error.
282 STDMETHOD(Closed
) (THIS_
283 PN_RESULT status
) PURE
;
287 /****************************************************************************
295 * Provides the user with an asynchronous TCP networking interface.
299 * {00000103-0901-11d1-8B06-00A024406D59}
302 DEFINE_GUID(IID_IRMATCPSocket
, 0x00000103, 0x901, 0x11d1, 0x8b, 0x6, 0x0,
303 0xa0, 0x24, 0x40, 0x6d, 0x59);
306 #define INTERFACE IRMATCPSocket
308 DECLARE_INTERFACE_(IRMATCPSocket
, IUnknown
)
313 STDMETHOD(QueryInterface
) (THIS_
317 STDMETHOD_(ULONG
,AddRef
) (THIS
) PURE
;
319 STDMETHOD_(ULONG
,Release
) (THIS
) PURE
;
322 * IRMATCPSocket methods
324 * Network addresses and ports are in native byte order
328 STDMETHOD(Init
) (THIS_
329 IRMATCPResponse
* /*IN*/ pTCPResponse
) PURE
;
331 STDMETHOD(SetResponse
) (THIS_
332 IRMATCPResponse
* pTCPResponse
) PURE
;
334 STDMETHOD(Bind
) (THIS_
339 * pDestination is a string containing host name or dotted-ip notation
341 STDMETHOD(Connect
) (THIS_
342 const char* pDestination
,
345 STDMETHOD(Read
) (THIS_
348 STDMETHOD(Write
) (THIS_
349 IRMABuffer
* pBuffer
) PURE
;
351 /************************************************************************
353 * IRMATCPSocket::WantWrite
355 * This method is called when you wish to write a large amount of
356 * data. If you are only writing small amounts of data, you can
357 * just call Write (all data not ready to be transmitted will be
358 * buffered on your behalf). When the TCP channel is ready to be
359 * written to, the response interfaces WriteReady method will be
362 STDMETHOD(WantWrite
) (THIS
) PURE
;
364 /************************************************************************
366 * IRMATCPSocket::GetForeignAddress
368 * Returns the address of the other end of the TCP socket as a
369 * ULONG32 in local host order
371 STDMETHOD(GetForeignAddress
) (THIS_
372 REF(ULONG32
) lAddress
) PURE
;
374 STDMETHOD(GetLocalAddress
) (THIS_
375 REF(ULONG32
) lAddress
) PURE
;
377 /************************************************************************
379 * IRMATCPSocket::GetForeignPort
381 * Returns the port of the other end of the TCP socket in local
384 STDMETHOD(GetForeignPort
) (THIS_
385 REF(UINT16
) port
) PURE
;
387 STDMETHOD(GetLocalPort
) (THIS_
388 REF(UINT16
) port
) PURE
;
392 /****************************************************************************
400 * This is the response interface for the asynchronous TCP listening
403 * IID_IRMAListenResponse:
405 * {00000104-0901-11d1-8B06-00A024406D59}
408 DEFINE_GUID(IID_IRMAListenResponse
, 0x00000104, 0x901, 0x11d1, 0x8b, 0x6, 0x0,
409 0xa0, 0x24, 0x40, 0x6d, 0x59);
412 #define INTERFACE IRMAListenResponse
414 DECLARE_INTERFACE_(IRMAListenResponse
, IUnknown
)
419 STDMETHOD(QueryInterface
) (THIS_
423 STDMETHOD_(ULONG
,AddRef
) (THIS
) PURE
;
425 STDMETHOD_(ULONG
,Release
) (THIS
) PURE
;
428 * IRMAListenResponse methods
431 STDMETHOD(NewConnection
) (THIS_
433 IRMATCPSocket
* pTCPSocket
) PURE
;
436 /****************************************************************************
444 * This interfaces allows you to asynchronously listen on a port for
447 * IID_IRMAListenSocket:
449 * {00000105-0901-11d1-8B06-00A024406D59}
452 DEFINE_GUID(IID_IRMAListenSocket
, 0x00000105, 0x901, 0x11d1, 0x8b, 0x6, 0x0,
453 0xa0, 0x24, 0x40, 0x6d, 0x59);
456 #define INTERFACE IRMAListenSocket
458 DECLARE_INTERFACE_(IRMAListenSocket
, IUnknown
)
463 STDMETHOD(QueryInterface
) (THIS_
467 STDMETHOD_(ULONG
,AddRef
) (THIS
) PURE
;
469 STDMETHOD_(ULONG
,Release
) (THIS
) PURE
;
472 * IRMAListenSocket methods
475 STDMETHOD(Init
) (THIS_
478 IRMAListenResponse
* /*IN*/ pListenResponse
483 /****************************************************************************
487 * IRMANetworkServices
491 * This is a factory interface for the various types of networking
492 * interfaces described above.
494 * IID_IRMANetworkServices:
496 * {00000106-0901-11d1-8B06-00A024406D59}
499 DEFINE_GUID(IID_IRMANetworkServices
, 0x00000106, 0x901, 0x11d1, 0x8b, 0x6, 0x0,
500 0xa0, 0x24, 0x40, 0x6d, 0x59);
503 #define INTERFACE IRMANetworkServices
505 DECLARE_INTERFACE_(IRMANetworkServices
, IUnknown
)
510 STDMETHOD(QueryInterface
) (THIS_
514 STDMETHOD_(ULONG
,AddRef
) (THIS
) PURE
;
516 STDMETHOD_(ULONG
,Release
) (THIS
) PURE
;
519 * IRMANetworkServices methods
522 /************************************************************************
524 * IRMANetworkServices::CreateTCPSocket
526 * Create a new TCP socket.
528 STDMETHOD(CreateTCPSocket
) (THIS_
529 IRMATCPSocket
** /*OUT*/ ppTCPSocket
) PURE
;
531 /************************************************************************
533 * IRMANetworkServices::CreateUDPSocket
535 * Create a new UDP socket.
537 STDMETHOD(CreateUDPSocket
) (THIS_
538 IRMAUDPSocket
** /*OUT*/ ppUDPSocket
) PURE
;
540 /************************************************************************
542 * IRMANetworkServices::CreateListenSocket
544 * Create a new TCP socket that will listen for connections on a
547 STDMETHOD(CreateListenSocket
) (THIS_
548 IRMAListenSocket
** /*OUT*/ ppListenSocket
551 /************************************************************************
553 * IRMANetworkServices::CreateResolver
555 * Create a new resolver that can lookup host names
557 STDMETHOD(CreateResolver
) (THIS_
558 IRMAResolver
** /*OUT*/ ppResolver
) PURE
;
562 /****************************************************************************
566 * IRMANetworkServices2
570 * This is a factory interface for the various types of networking
571 * interfaces described above.
573 * IID_IRMANetworkServices:
575 * {17951551-5683-11d3-B6BA-00C0F031C237}
579 // {17951551-5683-11d3-B6BA-00C0F031C237}
580 DEFINE_GUID(IID_IRMANetworkServices2
, 0x17951551, 0x5683, 0x11d3, 0xb6, 0xba, 0x0, 0xc0, 0xf0, 0x31, 0xc2, 0x37);
583 #define INTERFACE IRMANetworkServices2
585 DECLARE_INTERFACE_(IRMANetworkServices2
, IRMANetworkServices
)
587 /************************************************************************
589 * IRMANetworkServices2::CreateLBoundTCPSocket
591 * Create a new local bound TCP socket.
593 STDMETHOD(CreateLBoundTCPSocket
) (THIS_
594 IRMATCPSocket
** /*OUT*/ ppTCPSocket
) PURE
;
599 /****************************************************************************
607 * This is the response interface for the asynchronous UDP networking
610 * IID_IRMAUDPResponse:
612 * {00000107-0901-11d1-8B06-00A024406D59}
615 DEFINE_GUID(IID_IRMAUDPResponse
, 0x00000107, 0x901, 0x11d1, 0x8b, 0x6, 0x0,
616 0xa0, 0x24, 0x40, 0x6d, 0x59);
619 #define INTERFACE IRMAUDPResponse
621 DECLARE_INTERFACE_(IRMAUDPResponse
, IUnknown
)
626 STDMETHOD(QueryInterface
) (THIS_
630 STDMETHOD_(ULONG
,AddRef
) (THIS
) PURE
;
632 STDMETHOD_(ULONG
,Release
) (THIS
) PURE
;
635 * IRMAUDPResponse methods
638 STDMETHOD(ReadDone
) (THIS_
646 /****************************************************************************
654 * Provides the user with an asynchronous UDP networking interface.
658 * {00000108-0901-11d1-8B06-00A024406D59}
661 DEFINE_GUID(IID_IRMAUDPSocket
, 0x00000108, 0x901, 0x11d1, 0x8b, 0x6, 0x0,
662 0xa0, 0x24, 0x40, 0x6d, 0x59);
665 #define INTERFACE IRMAUDPSocket
667 DECLARE_INTERFACE_(IRMAUDPSocket
, IUnknown
)
672 STDMETHOD(QueryInterface
) (THIS_
676 STDMETHOD_(ULONG
,AddRef
) (THIS
) PURE
;
678 STDMETHOD_(ULONG
,Release
) (THIS
) PURE
;
681 * IRMAUDPSocket methods
683 * Network addresses and ports are in native byte order
686 STDMETHOD(Init
) (THIS_
689 IRMAUDPResponse
* pUDPResponse
) PURE
;
691 STDMETHOD(Bind
) (THIS_
695 STDMETHOD(Read
) (THIS_
698 STDMETHOD(Write
) (THIS_
699 IRMABuffer
* pBuffer
) PURE
;
701 STDMETHOD(WriteTo
) (THIS_
704 IRMABuffer
* pBuffer
) PURE
;
706 STDMETHOD(GetLocalPort
) (THIS_
707 REF(UINT16
) port
) PURE
;
709 STDMETHOD(JoinMulticastGroup
) (THIS_
710 ULONG32 ulMulticastAddr
,
711 ULONG32 ulInterfaceAddr
) PURE
;
713 STDMETHOD(LeaveMulticastGroup
) (THIS_
714 ULONG32 ulMulticastAddr
,
715 ULONG32 ulInterfaceAddr
) PURE
;
719 /****************************************************************************
727 * This interface allows you to asynchronously resolve hostnames.
731 * {00000109-0901-11d1-8B06-00A024406D59}
734 DEFINE_GUID(IID_IRMAResolver
, 0x00000109, 0x901, 0x11d1, 0x8b, 0x6, 0x0,
735 0xa0, 0x24, 0x40, 0x6d, 0x59);
738 #define INTERFACE IRMAResolver
740 DECLARE_INTERFACE_(IRMAResolver
, IUnknown
)
745 STDMETHOD(QueryInterface
) (THIS_
749 STDMETHOD_(ULONG
,AddRef
) (THIS
) PURE
;
751 STDMETHOD_(ULONG
,Release
) (THIS
) PURE
;
754 * IRMAResolver methods
757 STDMETHOD(Init
) (THIS_
758 IRMAResolverResponse
* pResponse
) PURE
;
760 STDMETHOD(GetHostByName
) (THIS_
761 const char* pHostName
) PURE
;
765 /****************************************************************************
769 * IRMAResolverResponse
773 * This is the response interface for the asynchronous DNS hostname
776 * IID_IRMAResolverResponse:
778 * {0000010A-0901-11d1-8B06-00A024406D59}
781 DEFINE_GUID(IID_IRMAResolverResponse
, 0x0000010A, 0x901, 0x11d1, 0x8b, 0x6, 0x0,
782 0xa0, 0x24, 0x40, 0x6d, 0x59);
785 #define INTERFACE IRMAResolverResponse
787 DECLARE_INTERFACE_(IRMAResolverResponse
, IUnknown
)
792 STDMETHOD(QueryInterface
) (THIS_
796 STDMETHOD_(ULONG
,AddRef
) (THIS
) PURE
;
798 STDMETHOD_(ULONG
,Release
) (THIS
) PURE
;
801 * IRMAResolverResponse methods
804 STDMETHOD(GetHostByNameDone
) (THIS_
806 ULONG32 ulAddr
) PURE
;
810 /****************************************************************************
818 * This interface is used in Macintosh implementations of callback
819 * functions, renderers, etc... to determine if interrupt time execution
820 * is supported. If this interface is not implemented then it is assumed
821 * that interrupt time execution is NOT supported. There are restrictions
822 * on what may be executed at interrupt time; please consult the Macintosh
823 * Deferred Task Manager tech notes from Apple.
825 * IID_IRMAInterruptSafe:
827 * {0000010B-0901-11d1-8B06-00A024406D59}
830 DEFINE_GUID(IID_IRMAInterruptSafe
, 0x0000010B, 0x901, 0x11d1, 0x8b, 0x6, 0x0,
831 0xa0, 0x24, 0x40, 0x6d, 0x59);
834 #define INTERFACE IRMAInterruptSafe
836 DECLARE_INTERFACE_(IRMAInterruptSafe
, IUnknown
)
841 STDMETHOD(QueryInterface
) (THIS_
845 STDMETHOD_(ULONG
,AddRef
) (THIS
) PURE
;
847 STDMETHOD_(ULONG
,Release
) (THIS
) PURE
;
850 * IRMAInterruptSafe methods
853 /************************************************************************
855 * IRMAInterruptSafe::IsInterruptSafe
857 * This is the function that will be called to determine if
858 * interrupt time execution is supported.
860 STDMETHOD_(BOOL
,IsInterruptSafe
) (THIS
) PURE
;
864 /****************************************************************************
868 * IRMAAsyncIOSelection
872 * This interface is implemented by the server/player context on Unix
873 * platforms. This interface allows your plugin to get callbacks based
874 * I/O events that are normally handled by select(). This interface
875 * allows you to setup callbacks which will be executed when a file
876 * descriptor is ready for reading, writing, or has an exception.
878 * IID_IRMAAsyncIOSelection:
880 * {0000010C-0901-11d1-8B06-00A024406D59}
883 DEFINE_GUID(IID_IRMAAsyncIOSelection
, 0x0000010C, 0x901, 0x11d1, 0x8b, 0x6, 0x0,
884 0xa0, 0x24, 0x40, 0x6d, 0x59);
887 #define INTERFACE IRMAAsyncIOSelection
889 DECLARE_INTERFACE_(IRMAAsyncIOSelection
, IUnknown
)
894 STDMETHOD(QueryInterface
) (THIS_
898 STDMETHOD_(ULONG
,AddRef
) (THIS
) PURE
;
900 STDMETHOD_(ULONG
,Release
) (THIS
) PURE
;
903 * IRMAAsyncIOSelection methods
906 /************************************************************************
908 * IRMAAsyncIOSelection::Add
910 * This function will allow you to receive a callback when the
911 * given descriptor is ready for read, write, or has an
912 * exception. This function is only available on Unix, and is
913 * intended to replace the functionality of select().
915 STDMETHOD(Add
) (THIS_
916 IRMACallback
* pCallback
,
917 INT32 lFileDescriptor
,
920 /************************************************************************
922 * IRMAAsyncIOSelection::Remove
924 * This function will allow you remove the callback associated
925 * with the given descriptor from the event handler.
926 * This function is only available on Unix, and is intended to
927 * replace the functionality of select().
929 STDMETHOD(Remove
) (THIS_
930 INT32 lFileDescriptor
,
935 /****************************************************************************
939 * IRMAUDPMulticastInit
943 * Provides the user with a way to set the TTL for outgoing multicast
944 * UDP packets. Usually shared with IRMAUDPSocket.
946 * IID_IRMAUDPMulticastInit:
948 * {0000010D-0901-11d1-8B06-00A024406D59}
951 DEFINE_GUID(IID_IRMAUDPMulticastInit
, 0x0000010D, 0x901, 0x11d1, 0x8b, 0x6, 0x0,
952 0xa0, 0x24, 0x40, 0x6d, 0x59);
955 #define INTERFACE IRMAUDPMulticastInit
957 DECLARE_INTERFACE_(IRMAUDPMulticastInit
, IUnknown
)
962 STDMETHOD(QueryInterface
) (THIS_
966 STDMETHOD_(ULONG
,AddRef
) (THIS
) PURE
;
968 STDMETHOD_(ULONG
,Release
) (THIS
) PURE
;
971 * IRMAUDPMulticastInit methods
975 /************************************************************************
977 * IRMAUDPMulticastInit::InitMulticast
979 * This function will set the TTL (time to live) for the UDP socket
980 * so it can be used as a multicast socket, sending packets across
981 * the number of routers specified in the ulTTL parameter.
984 STDMETHOD(InitMulticast
) (THIS_
988 /****************************************************************************
996 * This interface is used in Macintosh implementations to inform the
997 * the client engine when entering & leaving an interupt task. It is
998 * also used to determine if it is currently at interrupt time.
999 * Please consult the Macintosh Deferred Task Manager tech notes from Apple
1000 * for information on interrupt tasks.
1002 * IID_IRMAInterruptState:
1004 * {0000010E-0901-11d1-8B06-00A024406D59}
1007 DEFINE_GUID(IID_IRMAInterruptState
, 0x0000010E, 0x901, 0x11d1, 0x8b, 0x6, 0x0,
1008 0xa0, 0x24, 0x40, 0x6d, 0x59);
1011 #define INTERFACE IRMAInterruptState
1013 DECLARE_INTERFACE_(IRMAInterruptState
, IUnknown
)
1018 STDMETHOD(QueryInterface
) (THIS_
1020 void** ppvObj
) PURE
;
1022 STDMETHOD_(ULONG
,AddRef
) (THIS
) PURE
;
1024 STDMETHOD_(ULONG
,Release
) (THIS
) PURE
;
1027 * IRMAInterruptState methods
1030 /************************************************************************
1032 * IRMAInterruptState::AtInterruptTime
1034 * This function is called to determine if we are currently at
1035 * interrupt task time.
1037 STDMETHOD_(BOOL
,AtInterruptTime
) (THIS
) PURE
;
1039 /************************************************************************
1041 * IRMAInterruptState::EnterInterruptState
1043 * This function is called when starting a deferred/interrupt task
1045 STDMETHOD(EnterInterruptState
) (THIS
) PURE
;
1047 /************************************************************************
1049 * IRMAInterruptState::LeaveInterruptState
1051 * This function is called when leaving a deferred/interrupt task
1053 STDMETHOD(LeaveInterruptState
) (THIS
) PURE
;
1055 /************************************************************************
1057 * IRMAInterruptState::EnableInterrupt
1059 * This function can be called to enable/disable interrupt time
1062 STDMETHOD(EnableInterrupt
) (THIS_
1065 /************************************************************************
1067 * IRMAInterruptState::IsInterruptEnabled
1069 * This function can be called to find if the core is currently
1070 * interrupt enabled.
1072 STDMETHOD_(BOOL
, IsInterruptEnabled
) (THIS
) PURE
;
1076 /****************************************************************************
1080 * IRMAOptimizedScheduler
1084 * This interface provides the user with a way of scheduling callbacks
1085 * that will be executed at some time in the future.
1087 * This interface should ONLY be used if you need accurately timed
1088 * callbacks. These callbacks should be efficient and should not consume
1089 * much time/CPU. This is not a thread safe interface. The user has to
1090 * take care of synchronization in their callbacks.
1092 * IID_IRMAOptimizedScheduler:
1094 * {0000010F-0901-11d1-8B06-00A024406D59}
1097 DEFINE_GUID(IID_IRMAOptimizedScheduler
, 0x0000010F, 0x901, 0x11d1, 0x8b, 0x6, 0x0,
1098 0xa0, 0x24, 0x40, 0x6d, 0x59);
1101 #define INTERFACE IRMAOptimizedScheduler
1103 DECLARE_INTERFACE_(IRMAOptimizedScheduler
, IUnknown
)
1108 STDMETHOD(QueryInterface
) (THIS_
1110 void** ppvObj
) PURE
;
1112 STDMETHOD_(ULONG
,AddRef
) (THIS
) PURE
;
1114 STDMETHOD_(ULONG
,Release
) (THIS
) PURE
;
1117 * IRMAOptimizedScheduler methods
1120 /************************************************************************
1122 * IRMAOptimizedScheduler::RelativeEnter
1124 * Schedule a callback to be executed "ms" milliseconds from now
1125 * This function is less percise then AbsoluteEnter and should only
1126 * be used when accurate timing is not critical.
1128 STDMETHOD_(CallbackHandle
,RelativeEnter
) (THIS_
1129 IRMACallback
* pCallback
,
1132 /************************************************************************
1134 * IRMAOptimizedScheduler::AbsoluteEnter
1136 * Schedule a callback to be executed at time "tVal".
1138 STDMETHOD_(CallbackHandle
,AbsoluteEnter
) (THIS_
1139 IRMACallback
* pCallback
,
1140 RMATimeval tVal
) PURE
;
1142 /************************************************************************
1144 * IRMAOptimizedScheduler::Remove
1146 * Remove a callback from the scheduler.
1148 STDMETHOD(Remove
) (THIS_
1149 CallbackHandle Handle
) PURE
;
1151 /************************************************************************
1153 * IRMAOptimizedScheduler::GetCurrentSchedulerTime
1155 * Gives the current time (in the timeline of the scheduler).
1157 STDMETHOD_(RMATimeval
,GetCurrentSchedulerTime
) (THIS
) PURE
;
1161 /****************************************************************************
1165 * IRMALoadBalancedListen
1169 * This interface is queried off of IRMAListenSocket. It allows
1170 * a plugin to specify that it wants the server to load balance
1171 * multiple instances of itself. The server will instantiate multiple
1172 * instances of the plugin as needed based on socket / descriptor limits.
1173 * Each plugin instance should attempt to listen on the same port as
1174 * other instances (they will share the port).
1176 * IID_IRMALoadBalancedListen:
1178 * {00000110-0901-11d1-8B06-00A024406D59}
1181 DEFINE_GUID(IID_IRMALoadBalancedListen
, 0x00000110, 0x901, 0x11d1, 0x8b, 0x6, 0x0,
1182 0xa0, 0x24, 0x40, 0x6d, 0x59);
1185 #define INTERFACE IRMALoadBalancedListen
1187 DECLARE_INTERFACE_(IRMALoadBalancedListen
, IUnknown
)
1192 STDMETHOD(QueryInterface
) (THIS_
1194 void** ppvObj
) PURE
;
1196 STDMETHOD_(ULONG
,AddRef
) (THIS
) PURE
;
1198 STDMETHOD_(ULONG
,Release
) (THIS
) PURE
;
1201 * IRMALoadBalancedListen methods
1204 /************************************************************************
1206 * IRMALoadBalancedListen::SetID
1208 * This function set's the unique ID for this listen socket. This
1209 * ID is used to determine whether or not different instances of
1210 * a plugin trying to listen on a single port are actually the
1211 * same plugin. Without this function, it would be possible for
1212 * two completely different plugins to listen on the same port using
1213 * the load balanced listener.
1215 STDMETHOD(SetID
) (THIS_
1218 /************************************************************************
1220 * IRMALoadBalancedListen::SetReserveLimit
1222 * Sets the reserve limit for descriptors / sockets. If less
1223 * than reserve limit descriptors / sockets are left then a new
1224 * instance of the plugin will be created.
1226 STDMETHOD(SetReserveLimit
) (THIS_
1227 UINT32 ulDescriptors
,
1228 UINT32 ulSockets
) PURE
;
1232 /****************************************************************************
1236 * IRMAOverrideDefaultServices
1240 * This interface is queried off of the context. It allows
1241 * a plugin to override any default services provided by the G2 system.
1242 * Currently, it is supported only on the client side.
1243 * You may currently override IRMANetworkServices using this interface
1244 * You can use the same interface to later restore back the overriden services.
1245 * This is done by calling the same OverrideServices() function with the
1246 * original service QIed before the initial override.
1248 * IID_IRMAOverrideDefaultServices:
1250 * {00000111-0901-11d1-8B06-00A024406D59}
1253 DEFINE_GUID(IID_IRMAOverrideDefaultServices
, 0x00000111, 0x901, 0x11d1, 0x8b, 0x6, 0x0,
1254 0xa0, 0x24, 0x40, 0x6d, 0x59);
1257 #define INTERFACE IRMAOverrideDefaultServices
1259 DECLARE_INTERFACE_(IRMAOverrideDefaultServices
, IUnknown
)
1264 STDMETHOD(QueryInterface
) (THIS_
1266 void** ppvObj
) PURE
;
1268 STDMETHOD_(ULONG
,AddRef
) (THIS
) PURE
;
1270 STDMETHOD_(ULONG
,Release
) (THIS
) PURE
;
1273 * IRMAOverrideDefaultServices methods
1276 /************************************************************************
1278 * IRMAOverrideDefaultServices::OverrideServices
1280 * Override default services provided by the G2 system.
1283 STDMETHOD(OverrideServices
) (THIS_
1284 IUnknown
* pContext
) PURE
;
1287 enum PN_SOCKET_OPTION
1289 PN_SOCKOPT_REUSE_ADDR
,
1290 PN_SOCKOPT_REUSE_PORT
,
1291 PN_SOCKOPT_BROADCAST
,
1292 PN_SOCKOPT_SET_RECVBUF_SIZE
,
1293 PN_SOCKOPT_SET_SENDBUF_SIZE
1296 /****************************************************************************
1300 * IRMASetSocketOption
1306 * IID_IRMASetSocketOption:
1308 * IID_IRMASetSocketOption: {00000114-0901-11d1-8B06-00A024406D59}
1311 DEFINE_GUID(IID_IRMASetSocketOption
,
1312 0x00000114, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 0xa0, 0x24, 0x40, 0x6d, 0x59);
1315 #define INTERFACE IRMASetSocketOption
1316 DECLARE_INTERFACE_(IRMASetSocketOption
, IUnknown
)
1321 STDMETHOD(QueryInterface
) (THIS_
1323 void** ppvObj
) PURE
;
1325 STDMETHOD_(ULONG
,AddRef
) (THIS
) PURE
;
1327 STDMETHOD_(ULONG
,Release
) (THIS
) PURE
;
1330 * IRMAListenSocket methods
1333 STDMETHOD(SetOption
) (THIS_
1334 PN_SOCKET_OPTION option
,
1335 UINT32 ulValue
) PURE
;
1338 #define RMA_THREADSAFE_METHOD_FF_GETPACKET 0x00000001
1340 * FileFormat::GetPacket() only calls:
1341 * CCF->CI(Buffer), CCF->CI(Packet), CCF->CI(Values), *Alloc, *Free,
1342 * FS->Read(), FS->Close(), FS->Seek(),
1343 * FFR->PacketReady(), FFR->StreamDone()
1344 * Context->Scheduler->*,
1345 * CCF->CI(Mutex), Mutex->*
1346 * Context->ErrorMessages
1351 #define RMA_THREADSAFE_METHOD_FS_READ 0x00000002
1353 * FileSystem::Read()/Seek()/Close() only calls:
1354 * CCF->CI(Buffer), CCF->CI(Packet), CCF->CI(Values), *Alloc, *Free,
1355 * FS->Read(), FS->Close(), FS->Seek(),
1356 * Context->Scheduler->*,
1357 * CCF->CI(Mutex), Mutex->*
1358 * Context->ErrorMessages
1362 #define RMA_THREADSAFE_METHOD_FSR_READDONE 0x00000004
1364 * FileFormat::ReadDone()/SeekDone()/CloseDone() only calls:
1365 * CCF->CI(Buffer), CCF->CI(Packet), CCF->CI(Values), *Alloc, *Free,
1366 * FS->Read(), FS->Close(), FS->Seek(),
1367 * FFR->PacketReady(), FFR->StreamDone()
1368 * Context->Scheduler->*,
1369 * CCF->CI(Mutex), Mutex->*
1370 * Context->ErrorMessages
1374 #define RMA_THREADSAFE_METHOD_CACHE_FILE 0x00000008
1376 * FileSystem::Read()/Seek()/Close() only calls:
1377 * CCF->CI(Buffer), CCF->CI(Packet), CCF->CI(Values), *Alloc, *Free,
1378 * FS->Read(), FS->Close(), FS->Seek(),
1379 * IRMACacheFile->*, IRMACacheFileResponse->*,
1380 * Context->Scheduler->*,
1381 * CCF->CI(Mutex), Mutex->*
1382 * Context->ErrorMessages
1386 #define RMA_THREADSAFE_METHOD_CACHE_FILE_RESPONSE 0x00000010
1388 * FileSystem::Read()/Seek()/Close() only calls:
1389 * CCF->CI(Buffer), CCF->CI(Packet), CCF->CI(Values), *Alloc, *Free,
1390 * FS->Read(), FS->Close(), FS->Seek(),
1391 * IRMACacheFile->*, IRMACacheFileResponse->*,
1392 * Context->Scheduler->*,
1393 * CCF->CI(Mutex), Mutex->*
1394 * Context->ErrorMessages
1399 /****************************************************************************
1403 * IRMAThreadSafeMethods
1409 * IID_IRMAThreadSafeMethods:
1411 * {00000115-0901-11d1-8B06-00A024406D59}
1414 DEFINE_GUID(IID_IRMAThreadSafeMethods
, 0x00000115, 0x901, 0x11d1, 0x8b, 0x6, 0x0,
1415 0xa0, 0x24, 0x40, 0x6d, 0x59);
1418 #define INTERFACE IRMAThreadSafeMethods
1420 DECLARE_INTERFACE_(IRMAThreadSafeMethods
, IUnknown
)
1425 STDMETHOD(QueryInterface
) (THIS_
1427 void** ppvObj
) PURE
;
1429 STDMETHOD_(ULONG
,AddRef
) (THIS
) PURE
;
1431 STDMETHOD_(ULONG
,Release
) (THIS
) PURE
;
1434 * IRMAThreadSafeMethods methods
1437 /************************************************************************
1439 * IRMAThreadSafeMethods::IsThreadSafe
1443 STDMETHOD_(UINT32
,IsThreadSafe
) (THIS
) PURE
;
1447 /****************************************************************************
1459 * {00000116-0901-11d1-8B06-00A024406D59}
1462 DEFINE_GUID(IID_IRMAMutex
, 0x00000116, 0x901, 0x11d1, 0x8b, 0x6, 0x0,
1463 0xa0, 0x24, 0x40, 0x6d, 0x59);
1466 #define INTERFACE IRMAMutex
1469 * The IRMACommonClassFactory supports creating an instance
1472 #define CLSID_IRMAMutex IID_IRMAMutex
1474 DECLARE_INTERFACE_(IRMAMutex
, IUnknown
)
1479 STDMETHOD(QueryInterface
) (THIS_
1481 void** ppvObj
) PURE
;
1483 STDMETHOD_(ULONG
,AddRef
) (THIS
) PURE
;
1485 STDMETHOD_(ULONG
,Release
) (THIS
) PURE
;
1491 /* XXXSMPNOW Comments */
1492 STDMETHOD(Lock
) (THIS
) PURE
;
1494 STDMETHOD(TryLock
) (THIS
) PURE
;
1496 STDMETHOD(Unlock
) (THIS
) PURE
;
1500 #endif /* _RMAENGIN_H_ */