Skip to content

Commit

Permalink
Merge pull request #88 from MortenSchou/update-json-format
Browse files Browse the repository at this point in the history
Update JSON format
  • Loading branch information
MortenSchou authored Feb 3, 2021
2 parents 02508c2 + 689ce44 commit 954813c
Show file tree
Hide file tree
Showing 7 changed files with 116 additions and 123 deletions.
34 changes: 26 additions & 8 deletions aalwines-mpls-network.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,11 @@
"bidirectional": {
"description": "If the bidirectional flag is set, then this link object also encodes the link in the opposite direction.",
"const": true
},
"weight": {
"description": "Optional weight of link. Currently ignored by AalWiNes.",
"type": "integer",
"minimum": 0
}
},
"required": [
Expand All @@ -67,13 +72,16 @@
"Router": {
"type": "object",
"properties": {
"names": {
"description": "Router names. Can contain multiple alternative names.",
"name": {
"description": "Primary name of the router. ",
"type": "string"
},
"alias": {
"description": "Alternative names for the router. ",
"type": "array",
"items": {
"type": "string"
},
"minItems": 1
}
},
"location": {
"$ref": "#/definitions/Location"
Expand All @@ -87,7 +95,7 @@
},
"required": [
"interfaces",
"names"
"name"
],
"title": "Router"
},
Expand All @@ -112,17 +120,27 @@
"type": "object",
"properties": {
"name": {
"description": "Name of the interface that use the routing_table",
"type": "string"
},
"names": {
"description": "If multiple interfaces use the same routing_table, the name of each interface can be specified here instead of using the 'name' property.",
"type": "array",
"items": {
"type": "string"
},
"minItems": 1
},
"routing_table": {
"$ref": "#/definitions/RoutingTable"
}
},
"additionalProperties": false,
"required": [
"name",
"routing_table"
"oneOf": [
{"required": ["name"]},
{"required": ["names"]}
],
"required": ["routing_table"],
"title": "Interface"
},
"RoutingTable": {
Expand Down
100 changes: 25 additions & 75 deletions example_net/Agis-network-pretty.json
Original file line number Diff line number Diff line change
Expand Up @@ -759,9 +759,7 @@
"latitude": 25.7743,
"longitude": -80.1937
},
"names": [
"Miami"
]
"name": "Miami"
},
{
"interfaces": [
Expand Down Expand Up @@ -1308,9 +1306,7 @@
"latitude": 29.7633,
"longitude": -95.3633
},
"names": [
"Houston"
]
"name": "Houston"
},
{
"interfaces": [
Expand Down Expand Up @@ -5944,9 +5940,7 @@
"latitude": 38.8951,
"longitude": -77.0364
},
"names": [
"Washington,_DC"
]
"name": "Washington,_DC"
},
{
"interfaces": [
Expand Down Expand Up @@ -15539,9 +15533,7 @@
"latitude": 33.749,
"longitude": -84.388
},
"names": [
"Atlanta"
]
"name": "Atlanta"
},
{
"interfaces": [
Expand Down Expand Up @@ -16088,9 +16080,7 @@
"latitude": 35.0845,
"longitude": -106.651
},
"names": [
"Mexico_City"
]
"name": "Mexico_City"
},
{
"interfaces": [
Expand Down Expand Up @@ -23056,9 +23046,7 @@
"latitude": 33.4484,
"longitude": -112.074
},
"names": [
"Phoenix"
]
"name": "Phoenix"
},
{
"interfaces": [
Expand Down Expand Up @@ -38169,9 +38157,7 @@
"latitude": 32.7831,
"longitude": -96.8067
},
"names": [
"Dallas"
]
"name": "Dallas"
},
{
"interfaces": [
Expand Down Expand Up @@ -43150,9 +43136,7 @@
"latitude": 38.6273,
"longitude": -90.1979
},
"names": [
"St_Louis"
]
"name": "St_Louis"
},
{
"interfaces": [
Expand Down Expand Up @@ -43699,9 +43683,7 @@
"latitude": 32.7153,
"longitude": -117.157
},
"names": [
"San_Diego"
]
"name": "San_Diego"
},
{
"interfaces": [
Expand Down Expand Up @@ -62186,9 +62168,7 @@
"latitude": 34.0522,
"longitude": -118.244
},
"names": [
"Los_Angeles"
]
"name": "Los_Angeles"
},
{
"interfaces": [
Expand Down Expand Up @@ -70674,9 +70654,7 @@
"latitude": 37.3541,
"longitude": -121.955
},
"names": [
"Santa_Clara"
]
"name": "Santa_Clara"
},
{
"interfaces": [
Expand Down Expand Up @@ -71223,9 +71201,7 @@
"latitude": 37.9577,
"longitude": -121.291
},
"names": [
"Stockton"
]
"name": "Stockton"
},
{
"interfaces": [
Expand Down Expand Up @@ -72661,9 +72637,7 @@
"latitude": 38.5816,
"longitude": -121.494
},
"names": [
"Sacramento"
]
"name": "Sacramento"
},
{
"interfaces": [
Expand Down Expand Up @@ -73210,9 +73184,7 @@
"latitude": 36.7477,
"longitude": -119.772
},
"names": [
"Fresno"
]
"name": "Fresno"
},
{
"interfaces": [
Expand Down Expand Up @@ -76864,9 +76836,7 @@
"latitude": 37.7749,
"longitude": -122.419
},
"names": [
"San_Francisco"
]
"name": "San_Francisco"
},
{
"interfaces": [
Expand Down Expand Up @@ -79535,9 +79505,7 @@
"latitude": 40.7143,
"longitude": -74.006
},
"names": [
"New_York"
]
"name": "New_York"
},
{
"interfaces": [
Expand Down Expand Up @@ -80084,9 +80052,7 @@
"latitude": 42.3584,
"longitude": -71.0598
},
"names": [
"Boston"
]
"name": "Boston"
},
{
"interfaces": [
Expand Down Expand Up @@ -82863,9 +82829,7 @@
"latitude": 47.6062,
"longitude": -122.332
},
"names": [
"Seattle"
]
"name": "Seattle"
},
{
"interfaces": [
Expand Down Expand Up @@ -83412,9 +83376,7 @@
"latitude": 40.7608,
"longitude": -111.891
},
"names": [
"Salt_Lake_City"
]
"name": "Salt_Lake_City"
},
{
"interfaces": [
Expand Down Expand Up @@ -92684,9 +92646,7 @@
"latitude": 41.85,
"longitude": -87.65
},
"names": [
"Chicago"
]
"name": "Chicago"
},
{
"interfaces": [
Expand Down Expand Up @@ -93233,9 +93193,7 @@
"latitude": 44.98,
"longitude": -93.2638
},
"names": [
"Minneapolis"
]
"name": "Minneapolis"
},
{
"interfaces": [
Expand Down Expand Up @@ -95986,9 +95944,7 @@
"latitude": 42.3314,
"longitude": -83.0457
},
"names": [
"Detroit"
]
"name": "Detroit"
},
{
"interfaces": [
Expand Down Expand Up @@ -97467,9 +97423,7 @@
"latitude": 38.028,
"longitude": -121.885
},
"names": [
"Pittsburg"
]
"name": "Pittsburg"
},
{
"interfaces": [
Expand Down Expand Up @@ -103216,9 +103170,7 @@
"latitude": 39.9523,
"longitude": -75.1638
},
"names": [
"Philadelphia"
]
"name": "Philadelphia"
},
{
"interfaces": [
Expand Down Expand Up @@ -106175,9 +106127,7 @@
"latitude": 39.9562,
"longitude": -75.058
},
"names": [
"Pennsauken"
]
"name": "Pennsauken"
}
]
}
Expand Down
2 changes: 1 addition & 1 deletion example_net/Agis-network.json

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions src/aalwines/model/Query.h
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,9 @@ namespace aalwines {
set_value(Query::IP6, 0, 64);
} else if(s == "ip") {
set_value(Query::ANYIP, 0, 64);
} else if(s == "null") {
// TODO: Implement a null label, that matches with an empty stack.
set_value(Query::ANYIP, 0, 0); // Dummy for now...
} else {
auto i = s.find_first_of(".:");
if (i != std::string::npos) {
Expand Down
Loading

0 comments on commit 954813c

Please sign in to comment.