DHCPServerRunner.h revision 8dbf6109fac87f14ee3ff40fa0c9e74e40c52492
/* $Id$ */
/** @file
* VirtualBox Main - interface for VBox DHCP server
*/
/*
* Copyright (C) 2009 Sun Microsystems, Inc.
*
* This file is part of VirtualBox Open Source Edition (OSE), as
* available from http://www.virtualbox.org. This file is free software;
* General Public License (GPL) as published by the Free Software
* Foundation, in version 2 as it comes in the "COPYING" file of the
* VirtualBox OSE distribution. VirtualBox OSE is distributed in the
* hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
*
* Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
* Clara, CA 95054 USA or visit http://www.sun.com if you need
* additional information or have any questions.
*/
//using namespace com;
typedef enum
{
DHCPCFG_NAME = 1,
}DHCPCFG;
#define TRUNKTYPE_WHATEVER "whatever"
#define TRUNKTYPE_NETFLT "netflt"
#define TRUNKTYPE_NETADP "netadp"
#define TRUNKTYPE_SRVNAT "srvnat"
{
enum CaseSensitivity
{
};
typedef char *String;
typedef const char *ConstString;
/** Shortcut that calls #alloc(aSize) right after object creation. */
{
if (str)
{
}
return *this;
}
{
{
}
return *this;
}
/**
* Allocates memory for a string capable to store \a aSize - 1 bytes (not characters!);
* in other words, aSize includes the terminating zero character. If \a aSize
* is zero, or if a memory allocation error occurs, this object will become null.
*/
{
setNull();
if (aSize)
{
#if !defined (VBOX_WITH_XPCOM)
#else
#endif
if (str)
str [0] = 0;
}
return *this;
}
{
if (cbThat)
{
// @todo optimize with realloc() once the memory management is fixed
char *pszTemp;
if (str)
{
setNull();
}
}
}
{
return 0;
return -1;
return 1;
if (cs == CaseSensitive)
else
}
{
}
{
return false;
return false;
if (cs == CaseSensitive)
else
}
{
return false;
return false;
if (cs == CaseSensitive)
else
}
/** Intended to to pass instances as input (|char *|) parameters to methods. */
/** The same as operator const char *(), but for situations where the compiler
cannot typecast implicitly (for example, in printf() argument list). */
/** The same as operator const char *(), but for situations where the compiler
cannot typecast implicitly (for example, in printf() argument list). */
/**
* Returns a non-const raw pointer that allows to modify the string directly.
* @warning
* Be sure not to modify data beyond the allocated memory! The
* guaranteed size of the allocated memory is at least #length()
* bytes after creation and after every assignment operation.
*/
char *mutableRaw() { return str; }
/**
* Intended to assign instances to |char *| out parameters from within the
* interface method. Transfers the ownership of the duplicated string to the
* caller.
*/
{
if (pstr)
{
}
return *this;
}
/**
* Intended to assign instances to |char *| out parameters from within the
* interface method. Transfers the ownership of the original string to the
* caller and resets the instance to null.
*
* As opposed to cloneTo(), this method doesn't create a copy of the
* string.
*/
{
return *this;
}
/**
* Intended to pass instances as out (|char **|) parameters to methods.
* Takes the ownership of the returned data.
*/
/**
* Static immutable null object. May be used for comparison purposes.
*/
void safe_assign (const char *s)
{
if (str != s)
{
setNull();
}
}
{
if (rs)
//#if !defined (VBOX_WITH_XPCOM)
//#else
// ls = (char *) nsMemory::Clone (rs, strlen (rs) + 1);
//#endif
}
char *str;
};
{
{
return VERR_INVALID_PARAMETER;
if(isRunning())
return VERR_INVALID_STATE;
#ifdef RT_OS_WINDOWS
if(val)
{
}
#endif
else
{
}
return VINF_SUCCESS;
}
int start();
int stop();
bool isRunning();
void detachFromServer();
};