Rich Lane | 2d6d482 | 2013-01-08 10:49:16 -0800 | [diff] [blame] | 1 | """ |
| 2 | Eth platform |
| 3 | |
| 4 | This platform uses the --interface command line option to choose the ethernet interfaces. |
| 5 | """ |
| 6 | |
| 7 | def platform_config_update(config): |
| 8 | """ |
| 9 | Update configuration for the local platform |
| 10 | |
| 11 | @param config The configuration dictionary to use/update |
| 12 | """ |
| 13 | |
| 14 | port_map = {} |
| 15 | |
| 16 | for (ofport, interface) in config["interfaces"]: |
| 17 | port_map[ofport] = interface |
| 18 | |
| 19 | # Default to a veth configuration compatible with the reference switch |
| 20 | if not port_map: |
| 21 | port_map = { |
| 22 | 1: 'veth1', |
| 23 | 2: 'veth3', |
| 24 | 3: 'veth5', |
| 25 | 4: 'veth7', |
| 26 | } |
| 27 | |
| 28 | config['port_map'] = port_map |