diff options
author | Nathan Skrzypczak <nathan.skrzypczak@gmail.com> | 2022-03-23 18:08:53 +0100 |
---|---|---|
committer | Damjan Marion <dmarion@me.com> | 2022-03-23 18:29:08 +0000 |
commit | e2d0c6e51ed29949260ae89c1a69cec39a14048f (patch) | |
tree | 7631a92c7905148c3edcc24da9d6a65e2604bb12 /src/vppinfra/format.h | |
parent | 8e0af7a7ffb0d6208c91e74eeaa0e46f3ac29026 (diff) |
ip: Add unformat for flow_hash_config
Type: improvement
This also makes the is_white_space function
public
Change-Id: Ifc1c0d4509f3ecae14f09bb5fa7a2eea33c49b09
Signed-off-by: Nathan Skrzypczak <nathan.skrzypczak@gmail.com>
Diffstat (limited to 'src/vppinfra/format.h')
-rw-r--r-- | src/vppinfra/format.h | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/vppinfra/format.h b/src/vppinfra/format.h index ee47a2099c2..2cd636d0be8 100644 --- a/src/vppinfra/format.h +++ b/src/vppinfra/format.h @@ -200,6 +200,22 @@ unformat_put_input (unformat_input_t * input) input->index -= 1; } +always_inline uword +is_white_space (uword c) +{ + switch (c) + { + case ' ': + case '\t': + case '\n': + case '\r': + return 1; + + default: + return 0; + } +} + /* Peek current input character without advancing. */ always_inline uword unformat_peek_input (unformat_input_t * input) |