Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
O
OpnSense
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kulya
OpnSense
Commits
c00c8ba2
Commit
c00c8ba2
authored
Aug 19, 2016
by
Franco Fichtner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ipsec: small style updates
parent
629ead66
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
12 deletions
+13
-12
ipsec.inc
src/etc/inc/ipsec.inc
+13
-12
No files found.
src/etc/inc/ipsec.inc
View file @
c00c8ba2
...
...
@@ -63,7 +63,6 @@ $p2_halgos = array(
'aesxcbc'
=>
'AES-XCBC'
);
$p2_protos
=
array
(
'esp'
=>
'ESP'
,
'ah'
=>
'AH'
...
...
@@ -84,7 +83,8 @@ $p2_pfskeygroups = array(
/*
* Return phase1 local address
*/
function
ipsec_get_phase1_src
(
&
$ph1ent
)
{
function
ipsec_get_phase1_src
(
&
$ph1ent
)
{
if
(
!
empty
(
$ph1ent
[
'interface'
]))
{
if
(
$ph1ent
[
'interface'
]
==
'any'
)
{
return
'%any'
;
...
...
@@ -114,11 +114,11 @@ function ipsec_get_phase1_src(& $ph1ent) {
}
}
/*
* Return phase2 idinfo in cidr format
*/
function
ipsec_idinfo_to_cidr
(
&
$idinfo
,
$addrbits
=
false
,
$mode
=
""
)
{
function
ipsec_idinfo_to_cidr
(
&
$idinfo
,
$addrbits
=
false
,
$mode
=
''
)
{
global
$config
;
switch
(
$idinfo
[
'type'
])
{
...
...
@@ -160,7 +160,6 @@ function ipsec_idinfo_to_cidr(& $idinfo, $addrbits = false, $mode = "") {
}
}
/*
* Return phase1 association for phase2
*/
...
...
@@ -191,7 +190,8 @@ function ipsec_lookup_phase1(&$ph2ent, &$ph1ent)
/*
* Check phase1 communications status
*/
function
ipsec_phase1_status
(
$ipsec_status
,
$ikeid
)
{
function
ipsec_phase1_status
(
$ipsec_status
,
$ikeid
)
{
foreach
(
$ipsec_status
as
$ike
)
{
if
(
$ike
[
'id'
]
!=
$ikeid
)
{
continue
;
...
...
@@ -314,7 +314,8 @@ function ipsec_dump_sad()
return
$sad
;
}
function
ipsec_mobilekey_sort
()
{
function
ipsec_mobilekey_sort
()
{
global
$config
;
function
mobilekeycmp
(
$a
,
$b
)
{
...
...
@@ -324,7 +325,8 @@ function ipsec_mobilekey_sort() {
usort
(
$config
[
'ipsec'
][
'mobilekey'
],
"mobilekeycmp"
);
}
function
ipsec_get_number_of_phase2
(
$ikeid
)
{
function
ipsec_get_number_of_phase2
(
$ikeid
)
{
global
$config
;
$a_phase2
=
$config
[
'ipsec'
][
'phase2'
];
$nbph2
=
0
;
...
...
@@ -338,8 +340,8 @@ function ipsec_get_number_of_phase2($ikeid) {
return
$nbph2
;
}
function
ipsec_find_id
(
&
$ph1ent
,
$side
=
"local"
,
$rgmap
=
array
())
{
function
ipsec_find_id
(
&
$ph1ent
,
$side
=
'local'
,
$rgmap
=
array
())
{
$id_data
=
null
;
if
(
$side
==
"local"
)
{
$id_type
=
$ph1ent
[
'myid_type'
];
...
...
@@ -960,7 +962,6 @@ EOD;
$ealgoAHsp2arr
=
array
();
$ealgoESPsp2arr
=
array
();
if
(
count
(
$a_phase2
))
{
foreach
(
$a_phase2
as
$ph2ent
)
{
if
(
$ph1ent
[
'ikeid'
]
!=
$ph2ent
[
'ikeid'
]
||
isset
(
$ph2ent
[
'disabled'
]))
{
...
...
@@ -1148,7 +1149,7 @@ EOD;
// suffix connection with sequence number
$tmpconf
=
str_replace
(
'<<connectionId>>'
,
"
{
$ph1ent
[
'ikeid'
]
}
-00
{
$idx
}
"
,
$connEntry
);
}
$tmpconf
.=
"
\t
rightsubnet ="
.
$rightsubnet_spec
[
$idx
]
.
"
\n
"
;
$tmpconf
.=
"
\t
rightsubnet =
"
.
$rightsubnet_spec
[
$idx
]
.
"
\n
"
;
$tmpconf
.=
"
\t
leftsubnet = "
.
$leftsubnet_spec
[
$idx
]
.
"
\n
"
;
if
(
!
empty
(
$ealgoESPsp2arr
[
$idx
]))
{
$tmpconf
.=
"
\t
esp = "
.
join
(
','
,
$ealgoESPsp2arr
[
$idx
])
.
"!
\n
"
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment