1 /*---------------------------------------------------------------------------*
2 Project: RevolutionSDK Extensions - Network base library
3 File: NETMisc.h
4
5 Copyright (C) 2006, 2007 Nintendo. All Rights Reserved.
6
7 These coded instructions, statements, and computer programs contain
8 proprietary information of Nintendo of America Inc. and/or Nintendo
9 Company Ltd., and are protected by Federal copyright law. They may
10 not be disclosed to third parties or copied or duplicated in any form,
11 in whole or in part, without the prior written consent of Nintendo.
12
13 $Log: NETMisc.h,v $
14 Revision 1.13 2007/10/26 09:28:51 seiki_masashi
15 Added NETSwapAndCopyMemory16().
16
17 Revision 1.12 2007/09/07 00:50:37 hirose_kazuki
18 Added NETMemSet().
19
20 Revision 1.11 2007/09/06 02:36:12 hirose_kazuki
21 Added NETMemCpy.
22
23 Revision 1.10 2007/02/14 07:43:05 hirose_kazuki
24 Removed some functions.
25
26 Revision 1.9 2007/01/31 02:49:06 okubata_ryoma
27 Small fix
28
29 Revision 1.8 2007/01/31 02:32:05 okubata_ryoma
30 Changed NCDGetWirelessMacAddress to NETGetWirelessMacAddress
31
32 Revision 1.7 2006/10/26 11:00:43 yasu
33 Added a 'get version information' function for REX.
34
35 Revision 1.6 2006/09/19 12:40:44 terui
36 Added NETIsValidVersion() prototype declaration
37
38 Revision 1.5 2006/09/16 06:32:01 hirose_kazuki
39 Fixed a typo in definition of NETGetUniversalSeconds().
40
41 Revision 1.4 2006/09/15 12:06:15 shirakae
42 Renamed NETGetUniversalSecond() to NETGetUniversalSeconds()
43
44 Revision 1.3 2006/09/15 12:00:42 shirakae
45 Renamed NETGetUniversalTime() to NETGetUniversalSecond()
46
47 Revision 1.2 2006/09/15 10:27:26 adachi_hiroaki
48 Implemented universal time APIs.
49
50 Revision 1.1 2006/09/08 12:00:22 seiki_masashi
51 Split net.h into multiple header files
52
53 $NoKeywords: $
54 *---------------------------------------------------------------------------*/
55
56 /*---------------------------------------------------------------------------*
57 Header file for network misc API.
58 *---------------------------------------------------------------------------*/
59
60 #ifndef __NETMISC_H__
61 #define __NETMISC_H__
62
63 #ifdef RVL_OS
64 #include <revolution/os.h>
65 #endif // RVL_OS
66
67 #include <stddef.h>
68
69 #ifdef __cplusplus
70 extern "C" {
71 #endif
72
73 #define NET_MACADDRESS_LENGTH 6
74
75 /*---------------------------------------------------------------------------*/
76
77 #ifdef RVL_OS
78 s32 NETGetWirelessMacAddress( u8* pAddr );
79
80 #if 0 // no more supported
81 BOOL NETIsValidVersion( void );
82 #endif
83 u8* NETGetRexIOPVersion( void );
84 u8* NETGetRexPPCVersion( void );
85 char* NETGetRexPPCVersionPrintable( void );
86
87 void* NETMemCpy( void* dst, const void* src, size_t size );
88 void* NETMemSet( void* buf, int ch, size_t size );
89 #endif // RVL_OS
90
91 void NETSwapAndCopyMemory16(void* dst, const void* src, u32 len);
92
93 /*---------------------------------------------------------------------------*/
94
NETMinU32(u32 a,u32 b)95 static inline u32 NETMinU32(u32 a, u32 b)
96 {
97 return (a <= b) ? a : b;
98 }
99
100 /*---------------------------------------------------------------------------*/
101
102 #ifdef __cplusplus
103 }
104 #endif
105
106 #endif // __NETMISC_H__
107
108