ClearFoundation

ClearOS API

Class Bnetd

Description

Bnetd class.

Located in /api/Bnetd.class.php (line 56)

Engine
   |
   --Bnetd
Class Constant Summary
 CMD_DAEMON = '/usr/webconfig/bin/bnetd'
 FILE_LOCKFILE = '/var/run/bnetd.pid'
 FILE_SOCKET = '/tmp/.bnetd-socket'
 SERVER_OK = 1
Variable Summary
string $host
handle $sock
Method Summary
void Connect (string $passwd, [string $host = null])
boolean IsRunning ()
integer RecvResponse ( &$code,  &$length,  &$payload, integer $code, integer $length, string $payload)
integer SendCommand (integer $code, [string $payload = null])
Bnetd __construct ([integer $session_timeout = 0])
void __destruct ()
void Shutdown ()
Variables
string $host = 'localhost' (line 87)
  • var: Bacula director host
  • access: protected
integer $session_timeout = 1800 (line 93)
  • var: Session timeout in seconds
  • access: protected
handle $sock = null (line 81)
  • var: socket stream handle
  • access: protected

Inherited Variables

Inherited from Engine

Engine::$errors
Methods
Connect (line 166)

Open a connection to bnetd and attempt to authenticate with Bacula.

  • throws: EngineException
  • access: public
void Connect (string $passwd, [string $host = null])
  • string $passwd: Bacula director password
  • string $host: Optional Bacula director host (default localhost)
IsRunning (line 127)

Check if lock file is present and bnetd is running...

  • return: true if bnetd is running
  • throws: EngineException
  • access: public
boolean IsRunning ()
RecvResponse (line 287)

Receive Bacula director response via bnetd.

  • return: 0 on success, -1 on failure
  • throws: EngineException
  • access: public
integer RecvResponse ( &$code,  &$length,  &$payload, integer $code, integer $length, string $payload)
  • integer $code: bnetd server response variable address.
  • integer $length: Payload length variable address.
  • string $payload: Conditional response variable address.
  • &$code
  • &$length
  • &$payload
SendCommand (line 255)

Send command to Bacula director via bnetd.

  • return: 0 on success, -1 on failure
  • throws: EngineException
  • access: public
integer SendCommand (integer $code, [string $payload = null])
  • integer $code: bnetd client code.
  • string $payload: Optional command payload.
Constructor __construct (line 105)

Bnetd constructor.

Bnetd __construct ([integer $session_timeout = 0])
  • integer $session_timeout: Optional session time-out value in seconds

Redefinition of:
Engine::__construct()
Engine constructor.
Destructor __destruct (line 359)
  • access: public
void __destruct ()

Redefinition of:
Engine::__destruct()
Shutdown (line 218)

Shutdown the running bnetd server.

  • throws: EngineException
  • access: public
void Shutdown ()

Inherited Methods

Inherited From Engine

Engine::__construct()
Engine::AddValidationError()
Engine::CheckValidationErrors()
Engine::CopyValidationErrors()
Engine::GetValidationErrors()
Engine::Log()
Engine::__destruct()
Class Constants
CLIENT_AUTH = 1 (line 69)
CLIENT_CLOSE = 3 (line 71)
CLIENT_COMMAND = 2 (line 70)
CMD_DAEMON = '/usr/webconfig/bin/bnetd' (line 62)
FILE_LOCKFILE = '/var/run/bnetd.pid' (line 65)
FILE_SOCKET = '/tmp/.bnetd-socket' (line 64)
SERVER_ERROR = 2 (line 74)
SERVER_OK = 1 (line 73)
SERVER_REPLY = 3 (line 75)
SOCKET_TIMEOUT = 5 (line 67)

Inherited Constants

Inherited from Engine

Engine::COMMAND_API

Documentation generated on Fri, 28 Aug 2009 20:32:00 -0400 by phpDocumentor 1.3.2