2 *****************************************************************************
8 * Purpose: Provide validation functions for SPA messages
10 * Copyright 2012 Michael Rash (mbr@cipherdyne.org)
12 * License (GNU Public License):
14 * This program is free software; you can redistribute it and/or
15 * modify it under the terms of the GNU General Public License
16 * as published by the Free Software Foundation; either version 2
17 * of the License, or (at your option) any later version.
19 * This program is distributed in the hope that it will be useful,
20 * but WITHOUT ANY WARRANTY; without even the implied warranty of
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 * GNU General Public License for more details.
24 * You should have received a copy of the GNU General Public License
25 * along with this program; if not, write to the Free Software
26 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
29 *****************************************************************************
33 #define FKO_MESSAGE_H 1
36 #include <sys/types.h>
37 #include <netinet/in.h>
40 #include <sys/socket.h>
43 #include <arpa/inet.h>
45 #define MAX_PROTO_STR_LEN 4 /* tcp, udp, icmp for now */
46 #define MAX_PORT_STR_LEN 5
48 /* SPA message format validation functions.
50 int validate_cmd_msg(const char *msg);
51 int validate_access_msg(const char *msg);
52 int validate_proto_port_spec(const char *msg);
53 int validate_nat_access_msg(const char *msg);
54 int got_allow_ip(const char *msg);
56 #endif /* FKO_MESSAGE_H */