blob: 513d7a70c3021443879345ddc44f32ee8624a421 [file] [log] [blame]
Sapan Bhatiaae9645c2017-05-05 15:35:54 +02001{% for k,v in options.iteritems() %}
2option {{ k }} = {{ v }};
3{% endfor %}
4
5{% for m in proto.messages %}
6message {{ m.name }} ({{ m.bases | join(",") }}){
7 {%- for f in m.fields %}
8 {% if not f.link %}
9 {{ f.modifier }} {{f.type}} {{f.name}} = {{ f.id }}{% if f.options %} [{% for k,v in f.options.iteritems() %} {{ k }} = {{ v }}{% if not loop.last %},{% endif %} {% endfor %}]{% endif %};
10 {% endif %}
11 {%- endfor %}
12
Sapan Bhatia3cfdf632017-06-08 05:14:03 +020013 {%- for l in m.links %}{% set peer_name=l.peer.name %}
Sapan Bhatiaae9645c2017-05-05 15:35:54 +020014 {{ l }}
Sapan Bhatia3cfdf632017-06-08 05:14:03 +020015 {{ l.modifier }} {{ l.link_type }} {{ l.name }} -> {{ l.peer.name }}:{{ l.dst_port }} = 1 {% if l.options %} [{% for k,v in l.options.iteritems() %} {{ k }} = {{ v }}{% if not loop.last %},{% endif %} {% endfor %}]{% endif %};
Sapan Bhatiaae9645c2017-05-05 15:35:54 +020016 {%- endfor -%}
17}
18{% endfor %}