Resguardo inicial

This commit is contained in:
lastdragon
2026-09-06 12:53:21 -06:00
parent 662efe3c2a
commit ad2088d178
94853 changed files with 43200404 additions and 0 deletions
@@ -0,0 +1,6 @@
{# SPDX-License-Identifier: GPL-2.0 #}
{% if annotate %}
/* member {{ name }} (basic) */
{% endif %}
if (!xdrgen_decode_{{ type }}(xdr, &ptr->u.{{ name }}))
return false;
@@ -0,0 +1,7 @@
{# SPDX-License-Identifier: GPL-2.0 #}
{% if annotate %}
/* discriminant {{ name }} */
{% endif %}
if (!xdrgen_decode_{{ type }}(xdr, &ptr->{{ name }}))
return false;
if (ptr->{{ name }}) {
@@ -0,0 +1,2 @@
{# SPDX-License-Identifier: GPL-2.0 #}
break;
@@ -0,0 +1,2 @@
{# SPDX-License-Identifier: GPL-2.0 #}
case {{ case }}:
@@ -0,0 +1,2 @@
{# SPDX-License-Identifier: GPL-2.0 #}
case __constant_cpu_to_be32({{ case }}):
@@ -0,0 +1,4 @@
{# SPDX-License-Identifier: GPL-2.0 #}
}
return true;
}
@@ -0,0 +1,2 @@
{# SPDX-License-Identifier: GPL-2.0 #}
default:
@@ -0,0 +1,12 @@
{# SPDX-License-Identifier: GPL-2.0 #}
{% if annotate %}
/* union {{ name }} */
{% endif %}
{% if name in public_apis %}
bool
{% else %}
static bool __maybe_unused
{% endif %}
xdrgen_decode_{{ name }}(struct xdr_stream *xdr, struct {{ name }} *ptr)
{
@@ -0,0 +1,6 @@
{# SPDX-License-Identifier: GPL-2.0 #}
{% if annotate %}
/* member {{ name }} (optional data) */
{% endif %}
if (!xdrgen_decode_{{ type }}(xdr, &ptr->u.{{ name }}))
return false;
@@ -0,0 +1,6 @@
{# SPDX-License-Identifier: GPL-2.0 #}
{% if annotate %}
/* member {{ name }} (variable-length string) */
{% endif %}
if (!xdrgen_decode_string(xdr, (struct string *)ptr->u.{{ name }}, {{ maxsize }}))
return false;
@@ -0,0 +1,7 @@
{# SPDX-License-Identifier: GPL-2.0 #}
{% if annotate %}
/* discriminant {{ name }} */
{% endif %}
if (!xdrgen_decode_{{ type }}(xdr, &ptr->{{ name }}))
return false;
switch (ptr->{{ name }}) {
@@ -0,0 +1,15 @@
{# SPDX-License-Identifier: GPL-2.0 #}
{% if annotate %}
/* member {{ name }} (variable-length array) */
{% endif %}
if (xdr_stream_decode_u32(xdr, &count) < 0)
return false;
{% if maxsize != "0" %}
if (count > {{ maxsize }})
return false;
{% endif %}
for (u32 i = 0; i < count; i++) {
if (xdrgen_decode_{{ type }}(xdr, &ptr->{{ name }}.items[i]) < 0)
return false;
}
ptr->{{ name }}.len = count;
@@ -0,0 +1,6 @@
{# SPDX-License-Identifier: GPL-2.0 #}
{% if annotate %}
/* member {{ name }} (variable-length opaque) */
{% endif %}
if (!xdrgen_decode_opaque(xdr, (struct opaque *)ptr->u.{{ name }}, {{ maxsize }}))
return false;
@@ -0,0 +1,3 @@
{# SPDX-License-Identifier: GPL-2.0 #}
if (!xdrgen_decode_void(xdr))
return false;