/* * NetLabel Control Utility, netlabelctl * * Author: Paul Moore * */ /* * (c) Copyright Hewlett-Packard Development Company, L.P., 2006 * * This program is free software: you can redistribute it and/or modify * it under the terms of version 2 of the GNU General Public License as * published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . * */ #include #include #include #include #include #include #include #include #include #include "netlabelctl.h" /* return values */ #define RET_OK 0 #define RET_ERR 1 #define RET_USAGE 2 /* option variables */ uint32_t opt_verbose = 0; uint32_t opt_timeout = 10; uint32_t opt_pretty = 0; /* program name */ char *nlctl_name = NULL; /** * Display usage information * @param fp the output file pointer * * Display brief usage information. * */ static void nlctl_usage_print(FILE *fp) { fprintf(fp, "usage: %s [] []\n", nlctl_name); } /** * Display version information * @param fp the output file pointer * * Display the version string. * */ static void nlctl_ver_print(FILE *fp) { fprintf(fp, "NetLabel Control Utility, version %s\n", VERSION); } /** * Display help information * @param fp the output file pointer * * Display help and usage information. * */ static void nlctl_help_print(FILE *fp) { nlctl_ver_print(fp); fprintf(fp, " Usage: %s [] []\n" "\n" " Flags:\n" " -h : help/usage message\n" " -p : make the output pretty\n" " -t : timeout\n" " -v : verbose mode\n" "\n" " Modules and Commands:\n" " mgmt : NetLabel management\n" " version\n" " protocols\n" " map : Domain/Protocol mapping\n" " add default|domain: [address:[/]]\n" " protocol:[,]\n" " del default|domain:\n" " list\n" " unlbl : Unlabeled packet handling\n" " accept on|off\n" " add default|interface: address:[/]\n" " label: