aboutgitcodebugslistschat
path: root/parse.h
diff options
context:
space:
mode:
Diffstat (limited to 'parse.h')
-rw-r--r--parse.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/parse.h b/parse.h
index 4f38c28..155b399 100644
--- a/parse.h
+++ b/parse.h
@@ -7,9 +7,22 @@
#define PARSE_H
#include <stdbool.h>
+#include <netinet/in.h>
+
+/**
+ * port_range() - Represents a non-empty range of ports
+ * @first: First port number in the range
+ * @last: Last port number in the range (inclusive)
+ *
+ * Invariant: @last >= @first
+ */
+struct port_range {
+ in_port_t first, last;
+};
bool parse_literal(const char **cursor, const char *lit);
bool parse_eoi(const char *cursor);
bool parse_unsigned(const char **cursor, int base, unsigned long *valp);
+bool parse_port_range(const char **cursor, struct port_range *range);
#endif /* _PARSE_H */