3 karl 1.3 // Copyright (c) 2000, 2001, 2002 BMC Software; Hewlett-Packard Development
4 // Company, L.P.; IBM Corp.; The Open Group; Tivoli Systems.
5 // Copyright (c) 2003 BMC Software; Hewlett-Packard Development Company, L.P.;
|
9 marek 1.1 //
10 // Permission is hereby granted, free of charge, to any person obtaining a copy
11 // of this software and associated documentation files (the "Software"), to
12 // deal in the Software without restriction, including without limitation the
13 // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
14 // sell copies of the Software, and to permit persons to whom the Software is
15 // furnished to do so, subject to the following conditions:
16 //
17 // THE ABOVE COPYRIGHT NOTICE AND THIS PERMISSION NOTICE SHALL BE INCLUDED IN
18 // ALL COPIES OR SUBSTANTIAL PORTIONS OF THE SOFTWARE. THE SOFTWARE IS PROVIDED
19 // "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
20 // LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
21 // PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
22 // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
23 // ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
24 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
25 //
26 //==============================================================================
27 //
28 // Author: Marek Szermutzky (MSzermutzky@de.ibm.com)
29 //
30 marek 1.1 // Modified By:
31 //
32 //%/////////////////////////////////////////////////////////////////////////////
33 #ifndef SocketzOS_inline_h
34 #define SocketzOS_inline_h
35
36 // this inline method is needed as zOS does not support an ASCII enabled version
37 // of inet_addr() at the current time (16th Sep. 2003)
38 inline in_addr_t inet_addr_ebcdic(char * ip_inptr)
39 {
40 int array_size = 0;
41 in_addr_t return_addr;
42 while (ip_inptr[array_size] != 0) array_size++;
43 char * ip_ptr2 = (char *)malloc(array_size);
44 memcpy(ip_ptr2,ip_inptr,array_size);
45 __atoe_l(ip_ptr2,array_size);
46 return_addr = inet_addr(ip_ptr2);
47 free(ip_ptr2);
48 return return_addr;
49 }
50 #endif
51 marek 1.1
|