int
of_list_uint64_first(of_list_uint64_t *list, of_object_t *obj)
{
    int rv;

    of_uint64_init(obj, list->version, -1, 1);

    if ((rv = of_list_first(list, obj)) < 0) {
        return rv;
    }



    return rv;
}
Esempio n. 2
0
of_uint64_t *
of_uint64_new(of_version_t version)
{
    of_uint64_t *obj;
    int bytes;

    bytes = of_object_fixed_len[version][OF_UINT64] + of_object_extra_len[version][OF_UINT64];

    /* Allocate a maximum-length wire buffer assuming we'll be appending to it. */
    if ((obj = (of_uint64_t *)of_object_new(OF_WIRE_BUFFER_MAX_LENGTH)) == NULL) {
        return NULL;
    }

    of_uint64_init(obj, version, bytes, 0);

    if (of_uint64_push_wire_values(obj) < 0) {
        FREE(obj);
        return NULL;
    }

    return obj;
}