Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F7058508
IP6Net.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
879 B
Referenced Files
None
Subscribers
None
IP6Net.php
View Options
<?php
namespace
App
;
use
Illuminate\Database\Eloquent\Model
;
class
IP6Net
extends
Model
{
protected
$table
=
"ip6nets"
;
/** @var array<int, string> The attributes that are mass assignable */
protected
$fillable
=
[
'rir_name'
,
'net_number'
,
'net_mask'
,
'net_broadcast'
,
'country'
,
'serial'
,
'created_at'
,
'updated_at'
];
/**
* Get IP network by IP address
*
* @param string $ip IPv6 address
*
* @return ?\App\IP6Net IPv6 network record, Null if not found
*/
public
static
function
getNet
(
$ip
)
{
$where
=
'INET6_ATON(net_number) <= INET6_ATON(?) and INET6_ATON(net_broadcast) >= INET6_ATON(?)'
;
return
IP6Net
::
whereRaw
(
$where
,
[
$ip
,
$ip
])
->
orderByRaw
(
'INET6_ATON(net_number), net_mask DESC'
)
->
first
();
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Fri, Jun 12, 5:02 AM (1 h, 56 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
914854
Default Alt Text
IP6Net.php (879 B)
Attached To
Mode
R2 kolab
Attached
Detach File
Event Timeline
Log In to Comment