Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Paste
P42721
(An Untitled Masterwork)
Active
Public
Actions
Authored by
jbond
on Dec 16 2022, 2:42 PM.
Edit Paste
Archive Paste
View Raw File
Subscribe
Mute Notifications
Award Token
Flag For Later
Tags
None
Referenced Files
F35870222: raw-paste-data.txt
Dec 16 2022, 2:42 PM
2022-12-16 14:42:05 (UTC+0)
Subscribers
None
# this is a different way of using directtion string mention in other comment
$_direction
=
(
$direction
==
'in'
)
.
bool2str
(
's'
,
'd'
)
$proto_str
=
$proto.then
|
$x|
{
"proto ${proto}"
}
$port_str
=
$port.then
|
$x|
{
"${_direction}port ${port}"
}
$addr_str
=
$addr.then
|
$x|
{
"${_direction}addr ${addr}"
}
$match_str
=
$match_dscp.then
|
$x|
{
"mod dscp dscp-class ${match_dscp}"
}
$dcsp
=
ferm
::
qos2dscp
(
$qos)
$rule
=
"${proto_str} ${port_str} ${addr_str} ${match_str} SCP set-dscp-class ${dcsp};"
ferm
::
rule
{
$title:
# will probably need a better title
ensure
=>
present
,
domain
=>
$domain,
# we shuld make the other patch i mentioned directly to ferm::rule
table
=>
'mangle'
,
chain
=>
'OUTPUT'
,
desc
=>
$desc,
prio
=>
$prio,
}
Event Timeline
jbond
created this paste.
Dec 16 2022, 2:42 PM
2022-12-16 14:42:05 (UTC+0)
Log In to Comment