Start of processing packets - implemented PING Responce to Netmail

This commit is contained in:
Deon George
2021-07-16 00:54:23 +10:00
parent fe2784f98f
commit a0d3c8d8ab
22 changed files with 1256 additions and 442 deletions

View File

@@ -2,10 +2,12 @@
namespace App\Classes;
use Illuminate\Support\Arr;
use App\Models\Domain;
abstract class FTN
{
protected ?Domain $domain; // Domain the packet is from
public function __get($key)
{
switch ($key) {
@@ -15,7 +17,7 @@ abstract class FTN
$this->fn,
$this->ff,
$this->fp,
);
).($this->domain ? sprintf('@%s',$this->domain->name) : '');
case 'tftn':
return sprintf('%d:%d/%d.%d',
@@ -23,7 +25,7 @@ abstract class FTN
$this->tn,
$this->tf,
$this->tp,
);
).($this->domain ? sprintf('@%s',$this->domain->name) : '');
default:
throw new \Exception('Unknown key: '.$key);
@@ -50,7 +52,7 @@ abstract class FTN
* @param array $pack
* @return string
*/
protected function unpackheader(array $pack): string
protected static function unpackheader(array $pack): string
{
return join('/',
collect($pack)