summaryrefslogtreecommitdiff
path: root/main/acl.c
diff options
context:
space:
mode:
Diffstat (limited to 'main/acl.c')
-rw-r--r--main/acl.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/main/acl.c b/main/acl.c
index 8d7dc4277..55654f714 100644
--- a/main/acl.c
+++ b/main/acl.c
@@ -278,6 +278,20 @@ static const struct dscp_codepoint dscp_pool1[] = {
{ "EF", 0x2E },
};
+int ast_str2cos(const char *value, unsigned int *cos)
+{
+ int fval;
+
+ if (sscanf(value, "%d", &fval) == 1) {
+ if (fval < 8) {
+ *cos = fval;
+ return 0;
+ }
+ }
+
+ return -1;
+}
+
int ast_str2tos(const char *value, unsigned int *tos)
{
int fval;