Created
June 3, 2013 11:13
-
-
Save liveforeverx/5697501 to your computer and use it in GitHub Desktop.
https://github.com/travelping/flower/blob/master/src/flower_packet.erl#L202-L220
https://github.com/travelping/flower/blob/master/src/flower_packet.erl#L239-L257
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
to_generate = | |
[bad_request: [bad_version: 0, | |
bad_type: 1, | |
bad_stat: 2, | |
bad_experimenter: 3, | |
bad_subtype: 4, | |
eperm: 5, | |
bad_len: 6, | |
buffer_empty: 7, | |
buffer_unknown: 8], | |
bad_action: [bad_type: 0, | |
bad_len: 1, | |
bad_vendor: 2, | |
bad_vendor_type: 3, | |
bad_out_port: 4, | |
bad_argument: 5, | |
eperm: 6, | |
too_many: 7, | |
bad_queue: 8]] | |
lc {error_type, values} inlist to_generate do | |
lc {atom, num} inlist values do | |
def ofp_error_code_type(unquote(error_type), unquote(atom)), do: unquote(num) | |
def ofp_error_code_type(unquote(error_type), unquote(num)), do: unquote(atom) | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment