% include( '/elements/header.html', 'Developer Documentation' ) %> <& /elements/menubar.html, 'Freeside Perl Modules' => $fsurl.'docs/library/FS.html', 'Complete Index' => $fsurl.'docs/library/index.html', &>
FS::port - Object methods for port records
use FS::port;
$record = new FS::port \%hash;
$record = new FS::port { 'column' => 'value' };
$error = $record->insert;
$error = $new_record->replace($old_record);
$error = $record->delete;
$error = $record->check;
$session = $port->session;
An FS::port object represents an individual port on a NAS. FS::port inherits from FS::Record. The following fields are currently supported:
Creates a new port. To add the port to the database, see "insert".
Note that this stores the hash reference, not a distinct copy of the hash it points to. You can ask the object for a copy with the hash method.
Adds this record to the database. If there is an error, returns the error, otherwise returns false.
Delete this record from the database.
Replaces the OLD_RECORD with this one in the database. If there is an error, returns the error, otherwise returns false.
Checks all fields to make sure this is a valid port. If there is an error, returns the error, otherwise returns false. Called by the insert and replace methods.
Returns the currently open session on this port, or if no session is currently open, the most recent session. See FS::session.
The session method won't deal well if you have multiple open sessions on a port, for example if your RADIUS server drops stop records. Suggestions for how to deal with this sort of lossage welcome; should we close the session when we get a new session on that port? Tag it as invalid somehow? Close it one second after it was opened? *sigh* Maybe FS::session shouldn't let you create overlapping sessions, at least folks will find out their logging is dropping records.
If you think the above refers multiple user logins you need to read the manpages again.
FS::Record, schema.html from the base documentation.