1 /*------------------------------------------------------------------------- 2 * Copyright (C) 2000 Caldera Systems, Inc 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 9 * Redistributions of source code must retain the above copyright 10 * notice, this list of conditions and the following disclaimer. 11 * 12 * Redistributions in binary form must reproduce the above copyright 13 * notice, this list of conditions and the following disclaimer in the 14 * documentation and/or other materials provided with the distribution. 15 * 16 * Neither the name of Caldera Systems nor the names of its 17 * contributors may be used to endorse or promote products derived 18 * from this software without specific prior written permission. 19 * 20 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 21 * `AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 22 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 23 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE CALDERA 24 * SYSTEMS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 25 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 26 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 27 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON 28 * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 29 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 30 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 31 *-------------------------------------------------------------------------*/ 32 33 /** Header file OpenSLP command line User Agent wrapper. 34 * 35 * @file slptool.h 36 * @author Matthew Peterson, John Calcote (jcalcote@novell.com) 37 * @attention Please submit patches to http://www.openslp.org 38 * @ingroup SlpToolCode 39 */ 40 41 #ifndef SLPTOOL_H_INCLUDED 42 #define SLPTOOL_H_INCLUDED 43 44 /*!@defgroup SlpToolCode Command Line Tool */ 45 46 /*!@addtogroup SlpToolCode 47 * @{ 48 */ 49 50 #include <slp.h> 51 52 #ifdef _WIN32 53 54 # include <string.h> 55 # include <stdio.h> 56 # include <stdlib.h> 57 58 # define strncasecmp _strnicmp 59 # define strcasecmp _stricmp 60 # define inet_aton(opt, bind) ((bind)->s_addr = inet_addr(opt)) 61 # define strdup _strdup 62 63 #else /* ! _WIN32 */ 64 65 # if HAVE_CONFIG_H 66 # include "config.h" 67 # endif 68 # if HAVE_STDIO_H 69 # include <stdio.h> 70 # endif 71 # if HAVE_STDLIB_H 72 # include <stdlib.h> 73 # endif 74 # if HAVE_STRING_H 75 # include <string.h> 76 # else 77 # if HAVE_STRINGS_H 78 # include <strings.h> 79 # endif 80 # endif 81 82 # define SLP_VERSION VERSION 83 84 #endif /* ! _WIN32 */ 85 86 typedef enum _SLPToolCommand 87 { 88 FINDSRVS = 1, 89 FINDATTRS, 90 FINDSRVTYPES, 91 FINDSCOPES, 92 GETPROPERTY, 93 REGISTER, 94 DEREGISTER, 95 PRINT_VERSION, 96 DUMMY 97 } SLPToolCommand; 98 99 typedef struct _SLPToolCommandLine 100 { 101 SLPToolCommand cmd; 102 const char * lang; 103 const char * time; 104 const char * interfaces; 105 const char * unicastifc; 106 const char * scopes; 107 const char * cmdparam1; 108 const char * cmdparam2; 109 const char * cmdparam3; 110 } SLPToolCommandLine; 111 112 void FindSrvs(SLPToolCommandLine * cmdline); 113 void FindAttrs(SLPToolCommandLine * cmdline); 114 void FindSrvTypes(SLPToolCommandLine * cmdline); 115 void GetProperty(SLPToolCommandLine * cmdline); 116 void Register(SLPToolCommandLine * cmdline); 117 void Deregister(SLPToolCommandLine * cmdline); 118 119 /*! @} */ 120 121 #endif /* SLPTOOL_H_INCLUDED */ 122 123 /*=========================================================================*/ 124