~james-page/ubuntu/saucy/openvswitch/1.12-snapshot

« back to all changes in this revision

Viewing changes to lib/nx-match.h

  • Committer: James Page
  • Date: 2013-08-21 10:16:57 UTC
  • mfrom: (1.1.20)
  • Revision ID: james.page@canonical.com-20130821101657-3o0z0qeiv5zkwlzi
New upstream snapshot

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*
2
 
 * Copyright (c) 2010, 2011, 2012 Nicira, Inc.
 
2
 * Copyright (c) 2010, 2011, 2012, 2013 Nicira, Inc.
3
3
 *
4
4
 * Licensed under the Apache License, Version 2.0 (the "License");
5
5
 * you may not use this file except in compliance with the License.
20
20
#include <stdint.h>
21
21
#include <sys/types.h>
22
22
#include <netinet/in.h>
 
23
#include "compiler.h"
23
24
#include "flow.h"
24
25
#include "ofp-errors.h"
25
26
#include "openvswitch/types.h"
29
30
struct mf_subfield;
30
31
struct ofpact_reg_move;
31
32
struct ofpact_reg_load;
 
33
struct ofpact_stack;
32
34
struct ofpbuf;
33
35
struct nx_action_reg_load;
34
36
struct nx_action_reg_move;
35
37
 
 
38
 
36
39
/* Nicira Extended Match (NXM) flexible flow match helper functions.
37
40
 *
38
41
 * See include/openflow/nicira-ext.h for NXM specification.
51
54
int oxm_put_match(struct ofpbuf *, const struct match *);
52
55
 
53
56
char *nx_match_to_string(const uint8_t *, unsigned int match_len);
54
 
char *oxm_match_to_string(const uint8_t *, unsigned int match_len);
 
57
char *oxm_match_to_string(const struct ofpbuf *, unsigned int match_len);
55
58
int nx_match_from_string(const char *, struct ofpbuf *);
56
59
int oxm_match_from_string(const char *, struct ofpbuf *);
57
60
 
58
 
void nxm_parse_reg_move(struct ofpact_reg_move *, const char *);
59
 
void nxm_parse_reg_load(struct ofpact_reg_load *, const char *);
 
61
char *nxm_parse_reg_move(struct ofpact_reg_move *, const char *)
 
62
    WARN_UNUSED_RESULT;
 
63
char *nxm_parse_reg_load(struct ofpact_reg_load *, const char *)
 
64
    WARN_UNUSED_RESULT;
60
65
 
61
66
void nxm_format_reg_move(const struct ofpact_reg_move *, struct ds *);
62
67
void nxm_format_reg_load(const struct ofpact_reg_load *, struct ds *);
78
83
void nxm_reg_load_to_nxast(const struct ofpact_reg_load *,
79
84
                           struct ofpbuf *openflow);
80
85
 
81
 
void nxm_execute_reg_move(const struct ofpact_reg_move *, struct flow *);
 
86
void nxm_execute_reg_move(const struct ofpact_reg_move *, struct flow *,
 
87
                          struct flow_wildcards *);
82
88
void nxm_execute_reg_load(const struct ofpact_reg_load *, struct flow *);
83
89
void nxm_reg_load(const struct mf_subfield *, uint64_t src_data,
84
 
                  struct flow *);
 
90
                  struct flow *, struct flow_wildcards *);
 
91
 
 
92
char *nxm_parse_stack_action(struct ofpact_stack *, const char *)
 
93
    WARN_UNUSED_RESULT;
 
94
 
 
95
void nxm_format_stack_push(const struct ofpact_stack *, struct ds *);
 
96
void nxm_format_stack_pop(const struct ofpact_stack *, struct ds *);
 
97
 
 
98
enum ofperr nxm_stack_push_from_openflow(const struct nx_action_stack *,
 
99
                                       struct ofpbuf *ofpacts);
 
100
enum ofperr nxm_stack_pop_from_openflow(const struct nx_action_stack *,
 
101
                                       struct ofpbuf *ofpacts);
 
102
enum ofperr nxm_stack_push_check(const struct ofpact_stack *,
 
103
                                 const  struct flow *);
 
104
enum ofperr nxm_stack_pop_check(const struct ofpact_stack *,
 
105
                               const struct flow *);
 
106
 
 
107
void nxm_stack_push_to_nxast(const struct ofpact_stack *,
 
108
                           struct ofpbuf *openflow);
 
109
void nxm_stack_pop_to_nxast(const struct ofpact_stack *,
 
110
                           struct ofpbuf *openflow);
 
111
 
 
112
void nxm_execute_stack_push(const struct ofpact_stack *,
 
113
                            const struct flow *, struct flow_wildcards *,
 
114
                            struct ofpbuf *);
 
115
void nxm_execute_stack_pop(const struct ofpact_stack *,
 
116
                            struct flow *, struct flow_wildcards *,
 
117
                            struct ofpbuf *);
85
118
 
86
119
int nxm_field_bytes(uint32_t header);
87
120
int nxm_field_bits(uint32_t header);