-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow filtering based on TCPFlags values
Signed-off-by: Mohamed Mahmoud <mmahmoud@redhat.com>
- Loading branch information
1 parent
3d6a89a
commit 197fbdf
Showing
4 changed files
with
49 additions
and
1 deletion.
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
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
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,33 @@ | ||
import { ReadOnlyValues } from './values'; | ||
|
||
export const getTCPFlagsDocUrl = () => { | ||
return 'https://www.rfc-editor.org/rfc/rfc9293'; | ||
}; | ||
|
||
export const TCPFlags_VALUES: ReadOnlyValues = [ | ||
{ value: 1, name: 'FIN', description: 'No more data from sender' }, | ||
{ value: 2, name: 'SYN', description: 'Synchronize sequence numbers' }, | ||
{ value: 4, name: 'RST', description: 'Reset the connection' }, | ||
{ value: 8, name: 'PSH', description: 'Push function' }, | ||
{ value: 16, name: 'ACK', description: 'Acknowledgement field is significant' }, | ||
{ value: 32, name: 'URG', description: 'Urgent pointer field is significant' }, | ||
{ value: 64, name: 'ECE', description: 'ECN-Echo' }, | ||
{ value: 128, name: 'CWR', description: 'Congestion Window Reduced' }, | ||
{ value: 256, name: 'SYN_ACK', description: 'Custom flag indicating both SYN and ACK flags are set' }, | ||
{ value: 512, name: 'FIN_ACK', description: 'Custom flag indicating both FIN and ACK flags are set' }, | ||
{ value: 1024, name: 'RST_ACK', description: 'Custom flag indicating both RST and ACK flags are set' } | ||
] as const; | ||
|
||
const tcpFlagsNames = TCPFlags_VALUES.map(v => v.name); | ||
export type TCPFLAGS_SERVICE_CLASS_NAMES = typeof tcpFlagsNames[number]; | ||
|
||
export const gettcpFlagsServiceClassName = (flags: number): TCPFLAGS_SERVICE_CLASS_NAMES | undefined => { | ||
return TCPFlags_VALUES.find(v => v.value === flags)?.name; | ||
}; | ||
|
||
const tcpFlagsDescriptions = TCPFlags_VALUES.map(v => v.description); | ||
export type TCPFLAGS_SERVICE_CLASS_DESCRIPTIONS = typeof tcpFlagsDescriptions[number]; | ||
|
||
export const gettcpFlagsServiceClassDescription = (flags: number): TCPFLAGS_SERVICE_CLASS_DESCRIPTIONS | undefined => { | ||
return TCPFlags_VALUES.find(v => v.value === flags)?.description; | ||
}; |