Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
F
ffbs-gluon
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
ffbs
ffbs-gluon
Commits
a2711065
Unverified
Commit
a2711065
authored
7 years ago
by
Matthias Schiffer
Browse files
Options
Downloads
Patches
Plain Diff
gluon-core: add VXLAN support for gluon_wired protocol
parent
0d6f9571
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
package/gluon-core/Makefile
+3
-1
3 additions, 1 deletion
package/gluon-core/Makefile
package/gluon-core/files/lib/netifd/proto/gluon_wired.sh
+35
-4
35 additions, 4 deletions
package/gluon-core/files/lib/netifd/proto/gluon_wired.sh
with
38 additions
and
5 deletions
package/gluon-core/Makefile
+
3
−
1
View file @
a2711065
...
...
@@ -15,7 +15,9 @@ define Package/gluon-core
SECTION
:=
gluon
CATEGORY
:=
Gluon
TITLE
:=
Base files of Gluon
DEPENDS
:=
+gluon-site +libgluonutil +lua-platform-info +lua-simple-uci +lua-hash +luci-lib-jsonc +luci-lib-nixio +odhcp6c +firewall +pretty-hostname
DEPENDS
:=
\
+gluon-site +libgluonutil +lua-platform-info +lua-simple-uci +lua-hash +luci-lib-jsonc +luci-lib-nixio
\
+vxlan +odhcp6c +firewall +pretty-hostname
endef
define
Package/gluon-core/description
...
...
This diff is collapsed.
Click to expand it.
package/gluon-core/files/lib/netifd/proto/gluon_wired.sh
+
35
−
4
View file @
a2711065
...
...
@@ -6,21 +6,52 @@ init_proto "$@"
proto_gluon_wired_init_config
()
{
proto_config_add_boolean transitive
proto_config_add_int index
proto_config_add_boolean legacy
}
xor2
()
{
echo
-n
"
${
1
:0:1
}
"
echo
-n
"
${
1
:1:1
}
"
|
tr
'0123456789abcdef'
'23016745ab89efcd'
}
interface_linklocal
()
{
local
macaddr
=
"
$(
ubus call network.device status
'{"name": "'
"
$1
"
'"}'
| jsonfilter
-e
'@.macaddr'
)
"
local
oldIFS
=
"
$IFS
"
;
IFS
=
':'
;
set
--
$macaddr
;
IFS
=
"
$oldIFS
"
echo
"fe80::
$(
xor2
"
$1
"
)
$2
:
$3ff
:fe
$4
:
$5$6
"
}
proto_gluon_wired_setup
()
{
local
config
=
"
$1
"
local
ifname
=
"
$2
"
local
transitive
json_get_vars transitive
local
meshif
=
"
$config
"
local
transitive index legacy
json_get_vars transitive index legacy
proto_init_update
"
$ifname
"
1
proto_send_update
"
$config
"
if
[
"
${
legacy
:-
0
}
"
-eq
0
]
;
then
meshif
=
"vx_
$config
"
json_init
json_add_string name
"
$meshif
"
[
-n
"
$index
"
]
&&
json_add_string macaddr
"
$(
lua
-lgluon
.util
-e
"print(gluon.util.generate_mac(
$index
))"
)
"
json_add_string proto
'vxlan6'
json_add_string tunlink
"
$config
"
json_add_string ip6addr
"
$(
interface_linklocal
"
$ifname
"
)
"
json_add_string peer6addr
'ff02::15c'
json_add_int vid
"
$(
lua
-lgluon
.util
-e
'print(tonumber(gluon.util.site_seed_bytes("gluon-mesh-vxlan", 3), 16))'
)
"
json_close_object
ubus call network add_dynamic
"
$(
json_dump
)
"
fi
json_init
json_add_string name
"
${
config
}
_mesh"
json_add_string ifname
"@
${
config
}
"
json_add_string ifname
"@
${
meshif
}
"
json_add_string proto
'gluon_mesh'
json_add_boolean fixed_mtu 1
[
-n
"
$transitive
"
]
&&
json_add_boolean transitive
"
$transitive
"
...
...
@@ -29,7 +60,7 @@ proto_gluon_wired_setup() {
}
proto_gluon_wired_teardown
()
{
export
config
=
"
$1
"
local
config
=
"
$1
"
proto_init_update
"*"
0
proto_send_update
"
$config
"
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment