{
	"$id": "https://www.atsc.org/XMLSchemas/ATSC3/a324/dsmapping-20210820.json",
	"$schema": "http://json-schema.org/draft/2019-09/schema#",
	"title": "DSTP Mapping Data Structure",
	"description": "DSTP Mapping Data Structure provided by a System Manager to the ALP generator. See A/324:2021 Section 7.1.1",
	"type": "object",
	"properties": {
		"dsmapping": {
			"type": "object",
			"properties": {
				"dstunnel": {
					"type": "array",
					"items": {
						"type": "object",
						"properties": {
							"destAddr": {
								"type": "string",
								"format": "ipv4"
							},
							"destPort": {
								"type": "integer"
							},
							"srcAddr": {
								"type": "string",
								"format": "ipv4"
							},
							"igmpVersion": {
								"type": "integer",
								"minimum": 2,
								"maximum": 3
							},
							"defaultPlp": {
								"type": "integer",
								"default": 0
							},
							"dstBackup": {
								"type": "array",
								"items": {
									"type": "object",
									"properties": {
										"srcAddr": {
											"type": "string",
											"format": "ipv4"
										}
									},
									"required": [ "srcAddr" ]
								}
							},
							"tps": {
								"type": "array",
								"items": {
									"type": "object",
									"properties": {
										"destAddr": {
											"type": "string",
											"format": "ipv4"
										},
										"destPort": {
											"type": "integer"
										},
										"plp": {
											"type": "integer"
										}
									},
									"required": [ "destAddr", "destPort", "plp" ]
								}
							}
						},
						"allOf": [
							{
								"if": {
									"properties": { "igmpVersion": { "const": [3] } }
								},
								"then": {
									"required": [ "destAddr", "destPort", "srcAddr" ]
								},
								"else": {
									"required": [ "destAddr", "destPort" ]
								}
							}
						]
					}
				}
			},
			"required": [ "dstunnel" ]
		}
	},
	"required": [ "dsmapping" ]
}