• Home
  • Raw
  • Download

Lines Matching +full:ipv4 +full:- +full:second +full:- +full:language +full:- +full:is +full:- +full:cpp

1 /* -*- Mode: C; tab-width: 4 -*-
3 * Copyright (c) 1997-2004 Apple Computer, Inc. All rights reserved.
9 * http://www.apache.org/licenses/LICENSE-2.0
12 * distributed under the License is distributed on an "AS IS" BASIS,
14 * See the License for the specific language governing permissions and
18 //-------------------------------------------------------------------------------------------------…
101 // No predefined macro for VxWorks so just assume VxWorks if nothing else is set.
260 …#pragma warning( disable:4127 ) // Disable "conditional expression is constant" warning for debug…
274 #error unknown OS - update this file to support your OS
328 #error unknown CPU - update this file to support your CPU
384 #error unknown byte order - update this file to support your byte order
431 // Macros to allow the same code to work on Windows and other sockets API-compatible platforms.
453 #define kInvalidSocketRef -1
459 // socklen_t is not defined on the following platforms so emulate it if not defined:
461 // - Pre-Panther Mac OS X. Panther defines SO_NOADDRERR so trigger off that.
462 // - Windows SDK prior to 2003. 2003+ SDK's define EAI_AGAIN so trigger off that.
463 // - VxWorks
471 // ssize_t is not defined on the following platforms so emulate it if not defined:
473 // - Mac OS X when not building with BSD headers
474 // - Windows
482 // sockaddr_storage is not supported on non-IPv6 machines so alias it to an IPv4-compatible structu…
491 //-------------------------------------------------------------------------------------------------…
494 @abstract Determines if a sockaddr is an IPv4 or IPv6 loopback address (if IPv6 is supported).
499 ( ( (const struct sockaddr *)( SA ) )->sa_family == AF_INET ) \
500 ? ( ( (const struct sockaddr_in *)( SA ) )->sin_addr.s_addr == htonl( INADDR_LOOPBACK ) ) \
501 : ( ( (const struct sockaddr *)( SA ) )->sa_family == AF_INET6 ) \
502 ? IN6_IS_ADDR_LOOPBACK( &( (const struct sockaddr_in6 *)( SA ) )->sin6_addr ) \
506 ( ( (const struct sockaddr *)( SA ) )->sa_family == AF_INET ) \
507 ? ( ( (const struct sockaddr_in *)( SA ) )->sin_addr.s_addr == htonl( INADDR_LOOPBACK ) ) \
511 //-------------------------------------------------------------------------------------------------…
514 @abstract Determines if a sockaddr is an IPv4 or IPv6 link-local address (if IPv6 is supported).
519 ( ( ( (const struct sockaddr *)( SA ) )->sa_family == AF_INET ) \
520 ? ( ( ( (uint8_t *)( &( (const struct sockaddr_in *)( SA ) )->sin_addr ) )[ 0 ] == 169 ) && \
521 ( ( (uint8_t *)( &( (const struct sockaddr_in *)( SA ) )->sin_addr ) )[ 1 ] == 254 ) ) \
522 : IN6_IS_ADDR_LOOPBACK( &( (const struct sockaddr_in6 *)( SA ) )->sin6_addr ) )
525 ( ( ( (const struct sockaddr *)( SA ) )->sa_family == AF_INET ) \
526 ? ( ( ( (uint8_t *)( &( (const struct sockaddr_in *)( SA ) )->sin_addr ) )[ 0 ] == 169 ) && \
527 ( ( (uint8_t *)( &( (const struct sockaddr_in *)( SA ) )->sin_addr ) )[ 1 ] == 254 ) ) \
546 // The C99 "inline" keyword is not supported by Microsoft compilers, but they do support __inline s…
568 //-------------------------------------------------------------------------------------------------…
571 …@abstract A meta-value to pass to supported routines to indicate the size should be calculated wit…
574 #define kSizeCString ( (size_t) -1 )
576 //-------------------------------------------------------------------------------------------------…
584 //-------------------------------------------------------------------------------------------------…
592 //-------------------------------------------------------------------------------------------------…
598 #define sizeof_string( X ) ( sizeof( ( X ) ) - 1 )
600 //-------------------------------------------------------------------------------------------------…
606 #define sizeof_field( TYPE, FIELD ) sizeof( ( ( (TYPE *) 0 )->FIELD ) )
608 //-------------------------------------------------------------------------------------------------…
614 #define RoundUp( X, Y ) ( ( X ) + ( ( Y ) - ( ( X ) % ( Y ) ) ) )
616 //-------------------------------------------------------------------------------------------------…
619 …@abstract Returns non-zero if X is aligned to a Y byte boundary and 0 if not. Y must be a power of…
622 #define IsAligned( X, Y ) ( ( ( X ) & ( ( Y ) - 1 ) ) == 0 )
624 //-------------------------------------------------------------------------------------------------…
627 …@abstract Returns non-zero if FIELD of type TYPE is aligned to a Y byte boundary and 0 if not. Y m…
632 //-------------------------------------------------------------------------------------------------…
638 #define AlignDown( X, Y ) ( ( X ) & ~( ( Y ) - 1 ) )
640 //-------------------------------------------------------------------------------------------------…
646 #define AlignUp( X, Y ) ( ( ( X ) + ( ( Y ) - 1 ) ) & ~( ( Y ) - 1 ) )
648 //-------------------------------------------------------------------------------------------------…
658 //-------------------------------------------------------------------------------------------------…
668 //-------------------------------------------------------------------------------------------------…
675 MASK is the bitmask of the bits in the final position.
676 SHIFT is the number of bits to shift left for 1 to reach the first bit position of MASK.
678 For example, if you wanted to insert 0x3 into the leftmost 4 bits of a 32-bit value:
685 //-------------------------------------------------------------------------------------------------…
692 MASK is the bitmask of the bits in the final position.
693 SHIFT is the number of bits to shift right to right justify MASK.
695 …For example, if you had a 32-bit value (e.g. 0x30000000) wanted the left-most 4 bits (e.g. 3 in th…
702 //-------------------------------------------------------------------------------------------------…
709 …Stringify macros to process raw text passed via -D options to C string constants. The double-wrapp…
710 …because the C preprocessor doesn't perform its normal argument expansion pre-scan with stringified…
711-D macro needs to be expanded once via the wrapper macro then stringified so the raw text is strin…
721 Non-preprocessor symbols do not have this issue. For example:
731 …See <http://gcc.gnu.org/onlinedocs/cpp/Argument-Prescan.html> for more info on C preprocessor pre-
795 // Macros for minimum-width integer constants
850 // short-circuit and gets confused by the option( bool ) portion of the conditional.
854 …// Note: The following test is done on separate lines because CodeWarrior doesn't like it all on o…
893 // IOKit IOTypes.h typedef's bool if TYPE_BOOL is not defined so define it here to prevent redefini…
899 //-------------------------------------------------------------------------------------------------…
902 @abstract 255 character null-terminated (C-style) string.
911 //-------------------------------------------------------------------------------------------------…
914 …@abstract Defines whether long long (or its equivalent) is natively supported or requires special …
925 //-------------------------------------------------------------------------------------------------…
933 …"__int64" and "unsigned __int64" equivalents so map to those types if the real long long is not su…
950 //-------------------------------------------------------------------------------------------------…
957 @constant kUnknownErr -6700 Unknown error occurred.
958 @constant kOptionErr -6701 Option was not acceptable.
959 @constant kSelectorErr -6702 Selector passed in is invalid or unknown.
960 …@constant kExecutionStateErr -6703 Call made in the wrong execution state (e.g. called at interr…
961 @constant kPathErr -6704 Path is invalid, too long, or otherwise not usable.
962 @constant kParamErr -6705 Parameter is incorrect, missing, or not appropriate.
963 @constant kParamCountErr -6706 Incorrect or unsupported number of parameters.
964 @constant kCommandErr -6707 Command invalid or not supported.
965 @constant kIDErr -6708 Unknown, invalid, or inappropriate identifier.
966 @constant kStateErr -6709 Not in appropriate state to perform operation.
967 @constant kRangeErr -6710 Index is out of range or not valid.
968 @constant kRequestErr -6711 Request was improperly formed or not appropriate.
969 @constant kResponseErr -6712 Response was incorrect or out of sequence.
970 @constant kChecksumErr -6713 Checksum does not match the actual data.
971 @constant kNotHandledErr -6714 Operation was not handled (or not handled completely).
972 @constant kVersionErr -6715 Version is not incorrect or not compatibile.
973 @constant kSignatureErr -6716 Signature did not match what was expected.
974 @constant kFormatErr -6717 Unknown, invalid, or inappropriate file/data format.
975 @constant kNotInitializedErr -6718 Action request before needed services were initialized.
976 @constant kAlreadyInitializedErr -6719 Attempt made to initialize when already initialized.
977 @constant kNotInUseErr -6720 Object not in use (e.g. cannot abort if not already in use).
978 @constant kInUseErr -6721 Object is in use (e.g. cannot reuse active param blocks).
979 @constant kTimeoutErr -6722 Timeout occurred.
980 @constant kCanceledErr -6723 Operation canceled (successful cancel).
981 @constant kAlreadyCanceledErr -6724 Operation has already been canceled.
982 @constant kCannotCancelErr -6725 Operation could not be canceled (maybe already done or invalid).
983 @constant kDeletedErr -6726 Object has already been deleted.
984 @constant kNotFoundErr -6727 Something was not found.
985 @constant kNoMemoryErr -6728 Not enough memory was available to perform the operation.
986 @constant kNoResourcesErr -6729 Resources unavailable to perform the operation.
987 @constant kDuplicateErr -6730 Duplicate found or something is a duplicate.
988 @constant kImmutableErr -6731 Entity is not changeable.
989 @constant kUnsupportedDataErr -6732 Data is unknown or not supported.
990 @constant kIntegrityErr -6733 Data is corrupt.
991 @constant kIncompatibleErr -6734 Data is not compatible or it is in an incompatible format.
992 @constant kUnsupportedErr -6735 Feature or option is not supported.
993 @constant kUnexpectedErr -6736 Error occurred that was not expected.
994 @constant kValueErr -6737 Value is not appropriate.
995 @constant kNotReadableErr -6738 Could not read or reading is not allowed.
996 @constant kNotWritableErr -6739 Could not write or writing is not allowed.
997 @constant kBadReferenceErr -6740 An invalid or inappropriate reference was specified.
998 @constant kFlagErr -6741 An invalid, inappropriate, or unsupported flag was specified.
999 @constant kMalformedErr -6742 Something was not formed correctly.
1000 @constant kSizeErr -6743 Size was too big, too small, or not appropriate.
1001 @constant kNameErr -6744 Name was not correct, allowed, or appropriate.
1002 @constant kNotReadyErr -6745 Device or service is not ready.
1003 @constant kReadErr -6746 Could not read.
1004 @constant kWriteErr -6747 Could not write.
1005 @constant kMismatchErr -6748 Something does not match.
1006 @constant kDateErr -6749 Date is invalid or out-of-range.
1007 @constant kUnderrunErr -6750 Less data than expected.
1008 @constant kOverrunErr -6751 More data than expected.
1009 @constant kEndingErr -6752 Connection, session, or something is ending.
1010 @constant kConnectionErr -6753 Connection failed or could not be established.
1011 @constant kAuthenticationErr -6754 Authentication failed or is not supported.
1012 @constant kOpenErr -6755 Could not open file, pipe, device, etc.
1013 @constant kTypeErr -6756 Incorrect or incompatible type (e.g. file, data, etc.).
1014 @constant kSkipErr -6757 Items should be or was skipped.
1015 @constant kNoAckErr -6758 No acknowledge.
1016 @constant kCollisionErr -6759 Collision occurred (e.g. two on bus at same time).
1017 @constant kBackoffErr -6760 Backoff in progress and operation intentionally failed.
1018 @constant kNoAddressAckErr -6761 No acknowledge of address.
1019 @constant kBusyErr -6762 Cannot perform because something is busy.
1020 @constant kNoSpaceErr -6763 Not enough space to perform operation.
1032 // Generic error codes are in the range -6700 to -6779.
1034 #define kGenericErrorBase -6700 // Starting error code for all generic errors.
1036 #define kUnknownErr -6700
1037 #define kOptionErr -6701
1038 #define kSelectorErr -6702
1039 #define kExecutionStateErr -6703
1040 #define kPathErr -6704
1041 #define kParamErr -6705
1042 #define kParamCountErr -6706
1043 #define kCommandErr -6707
1044 #define kIDErr -6708
1045 #define kStateErr -6709
1046 #define kRangeErr -6710
1047 #define kRequestErr -6711
1048 #define kResponseErr -6712
1049 #define kChecksumErr -6713
1050 #define kNotHandledErr -6714
1051 #define kVersionErr -6715
1052 #define kSignatureErr -6716
1053 #define kFormatErr -6717
1054 #define kNotInitializedErr -6718
1055 #define kAlreadyInitializedErr -6719
1056 #define kNotInUseErr -6720
1057 #define kInUseErr -6721
1058 #define kTimeoutErr -6722
1059 #define kCanceledErr -6723
1060 #define kAlreadyCanceledErr -6724
1061 #define kCannotCancelErr -6725
1062 #define kDeletedErr -6726
1063 #define kNotFoundErr -6727
1064 #define kNoMemoryErr -6728
1065 #define kNoResourcesErr -6729
1066 #define kDuplicateErr -6730
1067 #define kImmutableErr -6731
1068 #define kUnsupportedDataErr -6732
1069 #define kIntegrityErr -6733
1070 #define kIncompatibleErr -6734
1071 #define kUnsupportedErr -6735
1072 #define kUnexpectedErr -6736
1073 #define kValueErr -6737
1074 #define kNotReadableErr -6738
1075 #define kNotWritableErr -6739
1076 #define kBadReferenceErr -6740
1077 #define kFlagErr -6741
1078 #define kMalformedErr -6742
1079 #define kSizeErr -6743
1080 #define kNameErr -6744
1081 #define kNotReadyErr -6745
1082 #define kReadErr -6746
1083 #define kWriteErr -6747
1084 #define kMismatchErr -6748
1085 #define kDateErr -6749
1086 #define kUnderrunErr -6750
1087 #define kOverrunErr -6751
1088 #define kEndingErr -6752
1089 #define kConnectionErr -6753
1090 #define kAuthenticationErr -6754
1091 #define kOpenErr -6755
1092 #define kTypeErr -6756
1093 #define kSkipErr -6757
1094 #define kNoAckErr -6758
1095 #define kCollisionErr -6759
1096 #define kBackoffErr -6760
1097 #define kNoAddressAckErr -6761
1098 #define kBusyErr -6762
1099 #define kNoSpaceErr -6763
1101 #define kGenericErrorEnd -6779 // Last generic error code (inclusive)
1111 //-------------------------------------------------------------------------------------------------…
1119 @constant kDurationSecond Second units.
1138 #define kDurationMicrosecond -1L
1146 // Seconds <-> Minutes <-> Hours <-> Days <-> Weeks <-> Months <-> Years conversions
1165 //-------------------------------------------------------------------------------------------------…
1168 @abstract NumVersion-style version stages.
1176 //-------------------------------------------------------------------------------------------------…
1179 …@abstract Builds a 32-bit Mac-style NumVersion value (e.g. NumVersionBuild( 1, 2, 3, kVersionStage…
1196 //-------------------------------------------------------------------------------------------------…
1201 left < right -> -1
1202 left > right -> 1
1203 left = right -> 0
1214 //-------------------------------------------------------------------------------------------------…
1217 @abstract Macro to generate an 4-bit constant using binary notation (e.g. binary_4( 1010 ) == 0xA).
1224 //-------------------------------------------------------------------------------------------------…
1227 …@abstract Macro to generate an 8-bit constant using binary notation (e.g. binary_8( 01111011 ) == …
1234 //-------------------------------------------------------------------------------------------------…
1237 …@abstract Macro to generate an 16-bit constant using binary notation (e.g. binary_16( 01111011, 01…
1244 //-------------------------------------------------------------------------------------------------…
1247 @abstract Macro to generate an 32-bit constant using binary notation
1521 //-------------------------------------------------------------------------------------------------…