This file is indexed.

/usr/src/openvswitch-1.4.0/lib/ofp-errors.c is in openvswitch-datapath-dkms 1.4.0-1ubuntu1.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
/* -*- buffer-read-only: t -*- */
#include <config.h>
#include "ofp-errors.h"
#include <inttypes.h>
#include <stdio.h>
#include "openflow/openflow.h"
#include "openflow/nicira-ext.h"
#include "type-props.h"

static const char *
ofp_bad_action_code_to_string(uint16_t value)
{
    switch (value) {
    case OFPBAC_BAD_TYPE: return "OFPBAC_BAD_TYPE";
    case OFPBAC_BAD_LEN: return "OFPBAC_BAD_LEN";
    case OFPBAC_BAD_VENDOR: return "OFPBAC_BAD_VENDOR";
    case OFPBAC_BAD_VENDOR_TYPE: return "OFPBAC_BAD_VENDOR_TYPE";
    case OFPBAC_BAD_OUT_PORT: return "OFPBAC_BAD_OUT_PORT";
    case OFPBAC_BAD_ARGUMENT: return "OFPBAC_BAD_ARGUMENT";
    case OFPBAC_EPERM: return "OFPBAC_EPERM";
    case OFPBAC_TOO_MANY: return "OFPBAC_TOO_MANY";
    case OFPBAC_BAD_QUEUE: return "OFPBAC_BAD_QUEUE";
    }
    return NULL;
}

static const char *
ofp_bad_request_code_to_string(uint16_t value)
{
    switch (value) {
    case OFPBRC_BAD_VERSION: return "OFPBRC_BAD_VERSION";
    case OFPBRC_BAD_TYPE: return "OFPBRC_BAD_TYPE";
    case OFPBRC_BAD_STAT: return "OFPBRC_BAD_STAT";
    case OFPBRC_BAD_VENDOR: return "OFPBRC_BAD_VENDOR";
    case OFPBRC_BAD_SUBTYPE: return "OFPBRC_BAD_SUBTYPE";
    case OFPBRC_EPERM: return "OFPBRC_EPERM";
    case OFPBRC_BAD_LEN: return "OFPBRC_BAD_LEN";
    case OFPBRC_BUFFER_EMPTY: return "OFPBRC_BUFFER_EMPTY";
    case OFPBRC_BUFFER_UNKNOWN: return "OFPBRC_BUFFER_UNKNOWN";
    case NXBRC_NXM_INVALID: return "NXBRC_NXM_INVALID";
    case NXBRC_NXM_BAD_TYPE: return "NXBRC_NXM_BAD_TYPE";
    case NXBRC_NXM_BAD_VALUE: return "NXBRC_NXM_BAD_VALUE";
    case NXBRC_NXM_BAD_MASK: return "NXBRC_NXM_BAD_MASK";
    case NXBRC_NXM_BAD_PREREQ: return "NXBRC_NXM_BAD_PREREQ";
    case NXBRC_NXM_DUP_TYPE: return "NXBRC_NXM_DUP_TYPE";
    case NXBRC_BAD_TABLE_ID: return "NXBRC_BAD_TABLE_ID";
    case NXBRC_BAD_ROLE: return "NXBRC_BAD_ROLE";
    case NXBRC_BAD_IN_PORT: return "NXBRC_BAD_IN_PORT";
    }
    return NULL;
}

static const char *
ofp_flow_mod_failed_code_to_string(uint16_t value)
{
    switch (value) {
    case OFPFMFC_ALL_TABLES_FULL: return "OFPFMFC_ALL_TABLES_FULL";
    case OFPFMFC_OVERLAP: return "OFPFMFC_OVERLAP";
    case OFPFMFC_EPERM: return "OFPFMFC_EPERM";
    case OFPFMFC_BAD_EMERG_TIMEOUT: return "OFPFMFC_BAD_EMERG_TIMEOUT";
    case OFPFMFC_BAD_COMMAND: return "OFPFMFC_BAD_COMMAND";
    case OFPFMFC_UNSUPPORTED: return "OFPFMFC_UNSUPPORTED";
    case NXFMFC_HARDWARE: return "NXFMFC_HARDWARE";
    case NXFMFC_BAD_TABLE_ID: return "NXFMFC_BAD_TABLE_ID";
    }
    return NULL;
}

static const char *
ofp_hello_failed_code_to_string(uint16_t value)
{
    switch (value) {
    case OFPHFC_INCOMPATIBLE: return "OFPHFC_INCOMPATIBLE";
    case OFPHFC_EPERM: return "OFPHFC_EPERM";
    }
    return NULL;
}

static const char *
ofp_port_mod_failed_code_to_string(uint16_t value)
{
    switch (value) {
    case OFPPMFC_BAD_PORT: return "OFPPMFC_BAD_PORT";
    case OFPPMFC_BAD_HW_ADDR: return "OFPPMFC_BAD_HW_ADDR";
    }
    return NULL;
}

static const char *
ofp_queue_op_failed_code_to_string(uint16_t value)
{
    switch (value) {
    case OFPQOFC_BAD_PORT: return "OFPQOFC_BAD_PORT";
    case OFPQOFC_BAD_QUEUE: return "OFPQOFC_BAD_QUEUE";
    case OFPQOFC_EPERM: return "OFPQOFC_EPERM";
    }
    return NULL;
}

const char *
ofp_error_type_to_string(uint16_t value)
{
    switch (value) {
    case OFPET_FLOW_MOD_FAILED: return "OFPET_FLOW_MOD_FAILED";
    case OFPET_BAD_REQUEST: return "OFPET_BAD_REQUEST";
    case OFPET_BAD_ACTION: return "OFPET_BAD_ACTION";
    case OFPET_QUEUE_OP_FAILED: return "OFPET_QUEUE_OP_FAILED";
    case OFPET_PORT_MOD_FAILED: return "OFPET_PORT_MOD_FAILED";
    case OFPET_HELLO_FAILED: return "OFPET_HELLO_FAILED";
    }
    return NULL;
}

const char *
ofp_error_code_to_string(uint16_t type, uint16_t code)
{
    switch (type) {
    case OFPET_FLOW_MOD_FAILED:
        return ofp_flow_mod_failed_code_to_string(code);
    case OFPET_BAD_REQUEST:
        return ofp_bad_request_code_to_string(code);
    case OFPET_BAD_ACTION:
        return ofp_bad_action_code_to_string(code);
    case OFPET_QUEUE_OP_FAILED:
        return ofp_queue_op_failed_code_to_string(code);
    case OFPET_PORT_MOD_FAILED:
        return ofp_port_mod_failed_code_to_string(code);
    case OFPET_HELLO_FAILED:
        return ofp_hello_failed_code_to_string(code);
    }
    return NULL;
}