Move Domain_Controller::NUMBER_MAX to Address::ADDRESS_FIELD_MAX
This commit is contained in:
@@ -12,7 +12,6 @@ use Illuminate\Support\Facades\Log;
|
||||
|
||||
use App\Classes\FTN\{Message,Packet};
|
||||
use App\Exceptions\InvalidFTNException;
|
||||
use App\Http\Controllers\DomainController;
|
||||
use App\Traits\ScopeActive;
|
||||
|
||||
class Address extends Model
|
||||
@@ -38,6 +37,9 @@ class Address extends Model
|
||||
public const NODE_UNKNOWN = 1<<15; // Unknown
|
||||
public const NODE_ALL = 0xFFF; // Mask to catch all nodes
|
||||
|
||||
// http://ftsc.org/docs/frl-1002.001
|
||||
public const ADDRESS_FIELD_MAX = 0x7fff; // Maximum value for a field in the address
|
||||
|
||||
public static function boot()
|
||||
{
|
||||
parent::boot();
|
||||
@@ -968,10 +970,10 @@ class Address extends Model
|
||||
|
||||
// Check our numbers are correct.
|
||||
foreach ([1,2,3] as $i)
|
||||
if ((! is_numeric($matches[$i])) || ($matches[$i] > DomainController::NUMBER_MAX))
|
||||
if ((! is_numeric($matches[$i])) || ($matches[$i] > self::ADDRESS_FIELD_MAX))
|
||||
throw new InvalidFTNException(sprintf('Invalid FTN: [%s] - zone, host, or node address invalid [%d]',$ftn,$matches[$i]));
|
||||
|
||||
if ((! empty($matches[4])) AND ((! is_numeric($matches[$i])) || ($matches[4] > DomainController::NUMBER_MAX)))
|
||||
if ((! empty($matches[4])) AND ((! is_numeric($matches[$i])) || ($matches[4] > self::ADDRESS_FIELD_MAX)))
|
||||
throw new InvalidFTNException(sprintf('Invalid FTN: [%s] - point address invalid [%d]',$ftn,$matches[4]));
|
||||
|
||||
return [
|
||||
|
Reference in New Issue
Block a user