i m working on a project at school. i m asked to translate a juniper firewall configuration file to another firewall syntax. My problem here is transforming the juniper conf file to a dictionary so i can work on it
i Tried spliting the text by "{" and "}" and bunch of different things, but doesn't seem to help
family inet {
replace:
/*
** $Id:$
** $Date:$
** $Revision:$
**
*/
filter bridge {
interface-specific;
term rule100 {
from {
source-address {
10.0.0.1/32;
}
destination-address {
10.0.0.1/32;
}
protocol tcp;
destination-port 80;
}
then {
discard;
}
}
}
}
}
i expect a python dictionary like this
dic = { "term rule100" : {
"from" :{
"source-address" : "10.0.0.1/32;",
"destination-address" : "10.0.0.1/32;",
"protocol" :"tcp;", "destination-port" : "80;",
"then" : "discard;"
},
}
}