-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3 from mkirchner/features/ipv6
Add IPv6 support
- Loading branch information
Showing
5 changed files
with
498 additions
and
185 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,165 @@ | ||
--- | ||
Language: Cpp | ||
AccessModifierOffset: -2 | ||
AlignAfterOpenBracket: Align | ||
AlignConsecutiveMacros: None | ||
AlignConsecutiveAssignments: None | ||
AlignConsecutiveBitFields: None | ||
AlignConsecutiveDeclarations: None | ||
AlignEscapedNewlines: Right | ||
AlignOperands: Align | ||
AlignTrailingComments: true | ||
AllowAllArgumentsOnNextLine: true | ||
AllowAllConstructorInitializersOnNextLine: true | ||
AllowAllParametersOfDeclarationOnNextLine: true | ||
AllowShortEnumsOnASingleLine: true | ||
AllowShortBlocksOnASingleLine: Never | ||
AllowShortCaseLabelsOnASingleLine: false | ||
AllowShortFunctionsOnASingleLine: All | ||
AllowShortLambdasOnASingleLine: All | ||
AllowShortIfStatementsOnASingleLine: Never | ||
AllowShortLoopsOnASingleLine: false | ||
AlwaysBreakAfterDefinitionReturnType: None | ||
AlwaysBreakAfterReturnType: None | ||
AlwaysBreakBeforeMultilineStrings: false | ||
AlwaysBreakTemplateDeclarations: MultiLine | ||
AttributeMacros: | ||
- __capability | ||
BinPackArguments: true | ||
BinPackParameters: true | ||
BraceWrapping: | ||
AfterCaseLabel: false | ||
AfterClass: false | ||
AfterControlStatement: Never | ||
AfterEnum: false | ||
AfterFunction: false | ||
AfterNamespace: false | ||
AfterObjCDeclaration: false | ||
AfterStruct: false | ||
AfterUnion: false | ||
AfterExternBlock: false | ||
BeforeCatch: false | ||
BeforeElse: false | ||
BeforeLambdaBody: false | ||
BeforeWhile: false | ||
IndentBraces: false | ||
SplitEmptyFunction: true | ||
SplitEmptyRecord: true | ||
SplitEmptyNamespace: true | ||
BreakBeforeBinaryOperators: None | ||
BreakBeforeConceptDeclarations: true | ||
BreakBeforeBraces: Linux | ||
BreakBeforeInheritanceComma: false | ||
BreakInheritanceList: BeforeColon | ||
BreakBeforeTernaryOperators: true | ||
BreakConstructorInitializersBeforeComma: false | ||
BreakConstructorInitializers: BeforeColon | ||
BreakAfterJavaFieldAnnotations: false | ||
BreakStringLiterals: true | ||
ColumnLimit: 80 | ||
CommentPragmas: '^ IWYU pragma:' | ||
CompactNamespaces: false | ||
ConstructorInitializerAllOnOneLineOrOnePerLine: false | ||
ConstructorInitializerIndentWidth: 4 | ||
ContinuationIndentWidth: 4 | ||
Cpp11BracedListStyle: true | ||
DeriveLineEnding: true | ||
DerivePointerAlignment: false | ||
DisableFormat: false | ||
EmptyLineBeforeAccessModifier: LogicalBlock | ||
ExperimentalAutoDetectBinPacking: false | ||
FixNamespaceComments: true | ||
ForEachMacros: | ||
- foreach | ||
- Q_FOREACH | ||
- BOOST_FOREACH | ||
StatementAttributeLikeMacros: | ||
- Q_EMIT | ||
IncludeBlocks: Preserve | ||
IncludeCategories: | ||
- Regex: '^"(llvm|llvm-c|clang|clang-c)/' | ||
Priority: 2 | ||
SortPriority: 0 | ||
CaseSensitive: false | ||
- Regex: '^(<|"(gtest|gmock|isl|json)/)' | ||
Priority: 3 | ||
SortPriority: 0 | ||
CaseSensitive: false | ||
- Regex: '.*' | ||
Priority: 1 | ||
SortPriority: 0 | ||
CaseSensitive: false | ||
IncludeIsMainRegex: '(Test)?$' | ||
IncludeIsMainSourceRegex: '' | ||
IndentCaseLabels: false | ||
IndentCaseBlocks: false | ||
IndentGotoLabels: true | ||
IndentPPDirectives: None | ||
IndentExternBlock: AfterExternBlock | ||
IndentRequires: false | ||
IndentWidth: 4 | ||
IndentWrappedFunctionNames: false | ||
InsertTrailingCommas: None | ||
JavaScriptQuotes: Leave | ||
JavaScriptWrapImports: true | ||
KeepEmptyLinesAtTheStartOfBlocks: true | ||
MacroBlockBegin: '' | ||
MacroBlockEnd: '' | ||
MaxEmptyLinesToKeep: 1 | ||
NamespaceIndentation: None | ||
ObjCBinPackProtocolList: Auto | ||
ObjCBlockIndentWidth: 2 | ||
ObjCBreakBeforeNestedBlockParam: true | ||
ObjCSpaceAfterProperty: false | ||
ObjCSpaceBeforeProtocolList: true | ||
PenaltyBreakAssignment: 2 | ||
PenaltyBreakBeforeFirstCallParameter: 19 | ||
PenaltyBreakComment: 300 | ||
PenaltyBreakFirstLessLess: 120 | ||
PenaltyBreakString: 1000 | ||
PenaltyBreakTemplateDeclaration: 10 | ||
PenaltyExcessCharacter: 1000000 | ||
PenaltyReturnTypeOnItsOwnLine: 60 | ||
PenaltyIndentedWhitespace: 0 | ||
PointerAlignment: Right | ||
ReflowComments: true | ||
SortIncludes: true | ||
SortJavaStaticImport: Before | ||
SortUsingDeclarations: true | ||
SpaceAfterCStyleCast: false | ||
SpaceAfterLogicalNot: false | ||
SpaceAfterTemplateKeyword: true | ||
SpaceBeforeAssignmentOperators: true | ||
SpaceBeforeCaseColon: false | ||
SpaceBeforeCpp11BracedList: false | ||
SpaceBeforeCtorInitializerColon: true | ||
SpaceBeforeInheritanceColon: true | ||
SpaceBeforeParens: ControlStatements | ||
SpaceAroundPointerQualifiers: Default | ||
SpaceBeforeRangeBasedForLoopColon: true | ||
SpaceInEmptyBlock: false | ||
SpaceInEmptyParentheses: false | ||
SpacesBeforeTrailingComments: 1 | ||
SpacesInAngles: false | ||
SpacesInConditionalStatement: false | ||
SpacesInContainerLiterals: true | ||
SpacesInCStyleCastParentheses: false | ||
SpacesInParentheses: false | ||
SpacesInSquareBrackets: false | ||
SpaceBeforeSquareBrackets: false | ||
BitFieldColonSpacing: Both | ||
Standard: Latest | ||
StatementMacros: | ||
- Q_UNUSED | ||
- QT_REQUIRE_VERSION | ||
TabWidth: 4 | ||
UseCRLF: false | ||
UseTab: Never | ||
WhitespaceSensitiveMacros: | ||
- STRINGIZE | ||
- PP_STRINGIZE | ||
- BOOST_PP_STRINGIZE | ||
- NS_SWIFT_NAME | ||
- CF_SWIFT_NAME | ||
... | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,45 +1,87 @@ | ||
TCPING(1) User Manuals TCPING(1) | ||
|
||
-=[ tcping README | ||
|
||
This software may be freely distributed under the terms of | ||
the MIT license. See LICENSE file for details. | ||
|
||
As of 2016, the tcping homepage is: | ||
https://github.com/mkirchner/tcping | ||
NAME | ||
tcping - non-blocking TCP connection test | ||
|
||
--=[ How to build | ||
SYNOPSIS | ||
tcping [-q] [-f <4|6> ] [-t timeout-sec | -u timeout-usec ] host port | ||
|
||
On LiNUX systems: make tcping.linux | ||
On OpenBSD: make tcping.openbsd | ||
On Solaris 7/8: make tcping.solaris | ||
On Solaris 2.6: make tcping.solaris26 | ||
On AIX: make tcping.aix | ||
DESCRIPTION | ||
tcping attempts to complete a TCP connection to a host:port combination | ||
within the time interval timeout-[u]sec. The result of the operation | ||
is encoded as a return value. | ||
|
||
-=[ Return values | ||
OPTIONS | ||
-q Quiet flag. Suppress all informational output. | ||
|
||
Return values to the shell are: | ||
-1 an error occured | ||
0 port is open | ||
1 port is closed | ||
2 connection establishment timed out | ||
-f <4|6> | ||
IP protocol family to use: 4 for IPv4, 6 for IPv6. If left | ||
unspecifed, the implementation will use the protocol family of | ||
the first record returned from getaddrinfo(3), based on the for- | ||
mat of the host parameter. Specifying host as dotted-decimal | ||
IPv4 or hex IPv6 address string will use the respective protocol | ||
stack. Specification as a hostname character string will cause a | ||
dependency on the order of IPv4 and IPv6 records returned from | ||
getaddrinfo(3). | ||
|
||
-=[ Notes | ||
-t timeout-sec | ||
Connection timeout in seconds. | ||
|
||
1. Non-blocking connetcs are one of the most non-portable areas | ||
of network programming. Hope for the best. | ||
2. I hope AIX support works out fine. The only AIX box I have access | ||
to returns "AIX aixterm3 3 4 0006404B4C00" (whatever this means) | ||
on a 'uname -a'. | ||
-u timeout-usec | ||
Connection timeout in microseconds. | ||
|
||
-=[ Acknowledgements | ||
host Destination host. Either a host name node name or a numeric host | ||
address string (i.e., a dotted-decimal IPv4 address or an IPv6 | ||
hex address), per RFC 2553. | ||
|
||
Many thanks to | ||
Kai Hambrecht | ||
John Smith | ||
Vincent Loriot | ||
port Destination port. Either a service name or a decimal port num- | ||
ber, per RFC 2553. | ||
|
||
-=[ Author notes | ||
RETURN VALUES | ||
tcping encodes the result of the connection attempt in its return | ||
value: | ||
|
||
Originally released in 2003. If you happen to find any bugs or you have | ||
improved my code, please be so kind to drop me a line. Thank you. | ||
Marc Kirchner <mail(at)marc(dash)kirchner(dot)de> | ||
0 The connection attempt was successful. | ||
|
||
1 The connection attempt was unsuccessful. | ||
|
||
2 The connection attempt timed out. | ||
|
||
255 An error occured. | ||
|
||
DIAGNOSTICS | ||
Unless the quiet (-q) flag is set, the following diagnostics are issued | ||
on stderr. The messages align with the program return value (see | ||
above). | ||
|
||
<host> port <port> open. | ||
The connection attempt to host:port was successful. | ||
<host> port <port> closed. | ||
The connection attempt to host:port was unsuccessful and the | ||
server side signaled a closed port. | ||
<host> port <port> user timeout. | ||
The connection attempt to host:port did not complete within the | ||
user-defined timeout interval. | ||
|
||
AUTHOR | ||
Marc Kirchner <mail at marc-kirchner dot de> | ||
|
||
HISTORY | ||
tcping came to be in 2002 as a utility to allow basic TCP connection | ||
checking and to enable failure shortcircutry before issuing network | ||
commands with long timeouts (on Solarix 2.x, Solaris 7/8, AIX and | ||
Linux). IPv6 functionality was added for 2.0.0 in 2023, which also | ||
dropped support for the AIX and Solaris OS. | ||
|
||
ACKNOWLEDGEMENTS | ||
Many thanks to Kai Hambrecht, John Smith and Vincent Loriot. | ||
|
||
SEE ALSO | ||
nc(1) | ||
|
||
|
||
|
||
|
||
Linux MARCH 2023 TCPING(1) |
Oops, something went wrong.