コード例 #1
0
of_action_header_t *
of_action_header_new(of_version_t version)
{
    of_action_header_t *obj;
    int bytes;

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

    if ((obj = (of_action_header_t *)of_object_new(OF_WIRE_BUFFER_MAX_LENGTH)) == NULL) {
        return NULL;
    }

    of_action_header_init(obj, version, bytes, 0);

    return obj;
}
コード例 #2
0
of_action_header_t *
of_action_header_new(of_version_t version)
{
    of_action_header_t *obj;
    int bytes;

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

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

    of_action_header_init(obj, version, bytes, 0);

    return obj;
}