| 2985 | }; |
| 2986 | |
| 2987 | int |
| 2988 | ipfw_check_object_name(const char *name) |
| 2989 | { |
| 2990 | int c, i, l; |
| 2991 | |
| 2992 | /* |
| 2993 | * Check that name is null-terminated and contains |
| 2994 | * valid symbols only. Valid mask is: |
| 2995 | * [a-zA-Z0-9\-_\.]{1,63} |
| 2996 | */ |
| 2997 | l = strlen(name); |
| 2998 | if (l == 0 || l >= 64) |
| 2999 | return (EINVAL); |
| 3000 | for (i = 0; i < l; i++) { |
| 3001 | c = name[i]; |
| 3002 | if (isalpha(c) || isdigit(c) || c == '_' || |
| 3003 | c == '-' || c == '.') |
| 3004 | continue; |
| 3005 | return (EINVAL); |
| 3006 | } |
| 3007 | return (0); |
| 3008 | } |
| 3009 | |
| 3010 | static const char *default_state_name = "default"; |
| 3011 |
no test coverage detected