Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F117885585
IP6Net.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Authored By
Unknown
Size
859 B
Referenced Files
None
Subscribers
None
IP6Net.php
View Options
<?php
namespace
App
;
use
Illuminate\Database\Eloquent\Model
;
use
Illuminate\Support\Facades\DB
;
class
IP6Net
extends
Model
{
protected
$table
=
"ip6nets"
;
protected
$fillable
=
[
'rir_name'
,
'net_number'
,
'net_mask'
,
'net_broadcast'
,
'country'
,
'serial'
,
'created_at'
,
'updated_at'
];
public
static
function
getNet
(
$ip
,
$mask
=
128
)
{
$query
=
"
SELECT id FROM ip6nets
WHERE INET6_ATON(net_number) <= INET6_ATON(?)
AND INET6_ATON(net_broadcast) >= INET6_ATON(?)
ORDER BY INET6_ATON(net_number), net_mask DESC LIMIT 1
"
;
$results
=
DB
::
select
(
$query
,
[
$ip
,
$ip
]);
if
(
sizeof
(
$results
)
==
0
)
{
return
null
;
}
return
\App\IP6Net
::
find
(
$results
[
0
]->
id
);
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Mon, Apr 6, 2:07 AM (1 w, 2 d ago)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
29/ab/ae36d5b529fbd28f092348428a0a
Default Alt Text
IP6Net.php (859 B)
Attached To
Mode
rK kolab
Attached
Detach File
Event Timeline