简体   繁体   English

ASN.1 模式兼容性

[英]ASN.1 schema compatibility

Does ASN.1 schema support some form of well-defined set of backward/forward-compatible changes? ASN.1模式是否支持某种形式的明确定义的向后/向前兼容的更改集?

I worked with protobuf and it allows changing schema in a way that clients using old schema would continue to work normally.我使用了protobuf ,它允许以使用旧模式的客户端继续正常工作的方式更改模式。 Is there the same for ASN.1 , I mean some set of rules which one has to follow to be sure he won't break clients using old schema? ASN.1是否也一样,我的意思是必须遵循一些规则以确保他不会破坏使用旧模式的客户端?

In particular is that possible to add new (probably optional) field to SEQUENCE or add/remove CHOICE ?特别是可以将新的(可能是可选的)字段添加到SEQUENCE或添加/删除CHOICE吗? Tried googling that, but didn't find appropriate article regarding this.尝试谷歌搜索,但没有找到关于此的适当文章。

Yes, ASN.1 supports forward/backward capability.是的,ASN.1 支持前向/后向功能。 However, it starts with the original definition.但是,它从原始定义开始。 Eg for a sequence, if a client is built based on the following definition例如,对于一个序列,如果客户端是基于以下定义构建的

NetworkLocation ::= [APPLICATION 156] SEQUENCE
{
   recEntityCode RecEntityCode OPTIONAL,
   callReference CallReference OPTIONAL,
   locationArea LocationArea OPTIONAL,
   cellId CellId OPTIONAL,
   ...                            -- future versions may add fields here
}

it should be built in a was, that it accepts further fields as part of this type where the ellipsis is.它应该构建在一个 was 中,它接受更多字段作为省略号所在的这种类型的一部分。 Naturally, in any future version of the specification, additional fields should be OPTIONAL.自然,在规范的任何未来版本中,附加字段应该是可选的。 The same is true for the definition of CHOICEs and ENUMERATED types. CHOICE 和 ENUMERATED 类型的定义也是如此。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM