aboutsummaryrefslogtreecommitdiffstats
path: root/src/bpfswitch/usrc/str_utils.h
blob: 817eb5f6f49a9f4e18b1d3850419d369cc918ab5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
/* SPDX-License-Identifier: GPL-2.0 */
#ifndef __STR_UTILS_H
#define __STR_UTILS_H

int str_to_int(const char *str, int min, int max, int *value);
int str_to_ushort(const char *str, unsigned short *us);
int str_to_ulong(const char *str, unsigned long *ul);
int str_to_ulong_base(const char *str, unsigned long *ul, int base);
int str_to_ullong(const char *str, unsigned long long *ul);
int str_to_mac(const char *str, unsigned char *mac);
int get_ifidx(const char *arg);

int parsestr(char *str, char *delims, char *fields[], int nmax);
void print_mac(const __u8 *mac, bool reverse);
#endif