Compare commits

...

9 Commits

Author SHA1 Message Date
jacky1100002
bcde6a7155 Merge branch 'main' into link_aggregation 2024-08-13 18:36:32 +08:00
Olexandr, Mazur
82f5eb7740 Merge pull request #19 from Telecominfraproject/jumbo_frames
support jumbo frames
2024-08-13 11:09:26 +03:00
Olexandr, Mazur
ceccdef561 Merge pull request #18 from Telecominfraproject/lacp
support LACP
2024-08-13 11:09:15 +03:00
jacky1100002
81e8cd5706 Merge branch 'main' into link_aggregation 2024-08-12 17:40:36 +08:00
jacky1100002
8a4815187f Merge branch 'main' into jumbo_frames 2024-08-12 17:32:34 +08:00
jacky_chang
e8da89616e generate corresponding json files 2024-08-12 10:33:59 +08:00
jacky_chang
5da5b090be generate corresponding json files 2024-08-12 10:32:10 +08:00
jacky_chang
5dc634f78e support link aggregation 2024-08-06 13:29:06 +08:00
jacky_chang
4d03a432c1 support jumbo frmaes 2024-08-06 11:08:10 +08:00
9 changed files with 186 additions and 1 deletions

View File

@@ -161,6 +161,11 @@ properties:
type: integer
minimum: 1
maximum: 4094
trunk-group:
description: Associates this port to a trunk or a port-channel.
type: integer
minimum: 1
maximum: 64
lacp-config:
description:
This section describes the 802.3ad Link Aggregation Control Protocol (LACP) configuration for the current interface.

View File

@@ -223,3 +223,20 @@ properties:
type: array
items:
type: string
trunk-balance-method:
description:
Sets the load-distribution method among ports in aggregated links for both static and LACP based trunks.
type: string
enum:
- dst-ip
- dst-mac
- src-dst-ip
- src-dst-mac
- src-ip
- src-mac
default: src-dst-mac
jumbo-frames:
description:
Enables Jumbo frames
type: boolean
default: false

View File

@@ -1215,6 +1215,26 @@ function instantiateEthernet(location, value, errors) {
obj.lacp_config = parseLacpConfig(location + "/lacp-config", value["lacp-config"], errors);
}
function parseTrunkGroup(location, value, errors) {
if (type(value) in [ "int", "double" ]) {
if (value > 64)
push(errors, [ location, "must be lower than or equal to 64" ]);
if (value < 1)
push(errors, [ location, "must be bigger than or equal to 1" ]);
}
if (type(value) != "int")
push(errors, [ location, "must be of type integer" ]);
return value;
}
if (exists(value, "trunk-group")) {
obj.trunk_group = parseTrunkGroup(location + "/trunk-group", value["trunk-group"], errors);
}
return obj;
}
@@ -1849,6 +1869,37 @@ function instantiateSwitch(location, value, errors) {
obj.port_isolation = parsePortIsolation(location + "/port-isolation", value["port-isolation"], errors);
}
function parseJumboFrames(location, value, errors) {
if (type(value) != "bool")
push(errors, [ location, "must be of type boolean" ]);
return value;
}
if (exists(value, "jumbo-frames")) {
obj.jumbo_frames = parseJumboFrames(location + "/jumbo-frames", value["jumbo-frames"], errors);
}
else {
obj.jumbo_frames = false;
}
function parseTrunkBalanceMethod(location, value, errors) {
if (type(value) != "string")
push(errors, [ location, "must be of type string" ]);
if (!(value in [ "dst-ip", "dst-mac", "src-dst-ip", "src-dst-mac", "src-ip", "src-mac" ]))
push(errors, [ location, "must be one of \"dst-ip\", \"dst-mac\", \"src-dst-ip\", \"src-dst-mac\", \"src-ip\" or \"src-mac\"" ]);
return value;
}
if (exists(value, "trunk-balance-method")) {
obj.trunk_balance_method = parseTrunkBalanceMethod(location + "/trunk-balance-method", value["trunk-balance-method"], errors);
}
else {
obj.trunk_balance_method = "src-dst-mac";
}
return obj;
}

View File

@@ -54,6 +54,7 @@ properties:
$ref: "https://ucentral.io/state/v1/link-state/"
mac-address-list:
$ref: "https://ucentral.io/state/v1/mac-address-list/"
static-trunks:
$ref: "https://ucentral.io/state/v1/static-trunks/"
lacp-trunks:
$ref: "https://ucentral.io/state/v1/lacp-trunks/"

18
state/static-trunks.yml Normal file
View File

@@ -0,0 +1,18 @@
type: array
items:
type: object
description:
List of statically created trunks.
properties:
trunk-identifier:
type: integer
description:
Logical identifier for the trunk.
minimum: 1
maximum: 64
member-ports:
type: array
description:
List of member ports under this static trunk.
items:
type: string

View File

@@ -686,6 +686,12 @@
}
}
},
"trunk-group": {
"description": "Associates this port to a trunk or a port-channel.",
"type": "integer",
"minimum": 1,
"maximum": 64
},
"lacp-config": {
"description": "This section describes the 802.3ad Link Aggregation Control Protocol (LACP) configuration for the current interface.",
"type": "object",
@@ -990,6 +996,23 @@
}
}
}
},
"trunk-balance-method": {
"description": "Sets the load-distribution method among ports in aggregated links for both static and LACP based trunks.",
"type": "string",
"enum": [
"dst-ip",
"dst-mac",
"src-dst-ip",
"src-dst-mac",
"src-ip",
"src-mac"
],
"default": "src-dst-mac"
"jumbo-frames": {
"description": "Enables Jumbo frames",
"type": "boolean",
"default": false
}
}
},

View File

@@ -478,6 +478,11 @@
}
}
},
"trunk-group": {
"type": "integer",
"minimum": 1,
"maximum": 64
},
"lacp-config": {
"type": "object",
"properties": {
@@ -734,6 +739,22 @@
}
}
}
},
"trunk-balance-method": {
"type": "string",
"enum": [
"dst-ip",
"dst-mac",
"src-dst-ip",
"src-dst-mac",
"src-ip",
"src-mac"
],
"default": "src-dst-mac"
},
"jumbo-frames": {
"type": "boolean",
"default": false
}
}
},

View File

@@ -538,6 +538,12 @@
}
}
},
"trunk-group": {
"description": "Associates this port to a trunk or a port-channel.",
"type": "integer",
"minimum": 1,
"maximum": 64
},
"lacp-config": {
"description": "This section describes the 802.3ad Link Aggregation Control Protocol (LACP) configuration for the current interface.",
"type": "object",
@@ -841,6 +847,24 @@
}
}
}
},
"trunk-balance-method": {
"description": "Sets the load-distribution method among ports in aggregated links for both static and LACP based trunks.",
"type": "string",
"enum": [
"dst-ip",
"dst-mac",
"src-dst-ip",
"src-dst-mac",
"src-ip",
"src-mac"
],
"default": "src-dst-mac"
},
"jumbo-frames": {
"description": "Enables Jumbo frames",
"type": "boolean",
"default": false
}
}
},

View File

@@ -79,6 +79,9 @@
"mac-address-list": {
"$ref": "#/$defs/mac-address-list"
},
"static-trunks": {
"$ref": "#/$defs/static-trunks"
},
"lacp-trunks": {
"$ref": "#/$defs/lacp-trunks"
}
@@ -1102,6 +1105,28 @@
}
]
},
"static-trunks": {
"type": "array",
"items": {
"type": "object",
"description": "List of statically created trunks.",
"properties": {
"trunk-identifier": {
"type": "integer",
"description": "Logical identifier for the trunk.",
"minimum": 1,
"maximum": 64
},
"member-ports": {
"type": "array",
"description": "List of member ports under this static trunk.",
"items": {
"type": "string"
}
}
}
}
},
"lacp-trunks": {
"type": "array",
"items": {