// Copyright 2013, Big Switch Networks, Inc.
//
// LoxiGen is licensed under the Eclipse Public License, version 1.0 (EPL), with
// the following special exception:
//
// LOXI Exception
//
// As a special exception to the terms of the EPL, you may distribute libraries
// generated by LoxiGen (LoxiGen Libraries) under the terms of your choice, provided
// that copyright and licensing notices generated by LoxiGen are not altered or removed
// from the LoxiGen Libraries and the notice provided below is (i) included in
// the LoxiGen Libraries, if distributed in source code form and (ii) included in any
// documentation for the LoxiGen Libraries, if distributed in binary form.
//
// Notice: "Copyright 2013, Big Switch Networks, Inc. This library was generated by the LoxiGen Compiler."
//
// You may not use this file except in compliance with the EPL or LOXI Exception. You may obtain
// a copy of the EPL at:
//
// http://www.eclipse.org/legal/epl-v10.html
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
// EPL for the specific language governing permissions and limitations
// under the EPL.

#version 1

struct of_bsn_set_ip_mask {
    uint8_t version;
    uint8_t type;
    uint16_t length;
    uint32_t xid;
    uint32_t experimenter;  // bsn 0x005c16c7,
    uint32_t subtype;       // 0
    uint8_t index;
    uint8_t[3] pad;
    uint32_t mask;
};

struct of_bsn_get_ip_mask_request {
    uint8_t version;
    uint8_t type;
    uint16_t length;
    uint32_t xid;
    uint32_t experimenter;  // bsn 0x005c16c7,
    uint32_t subtype;       // 1
    uint8_t index;
    uint8_t[7] pad;
};

struct of_bsn_get_ip_mask_reply {
    uint8_t version;
    uint8_t type;
    uint16_t length;
    uint32_t xid;
    uint32_t experimenter;  // bsn 0x005c16c7,
    uint32_t subtype;       // 2
    uint8_t index;
    uint8_t[3] pad;
    uint32_t mask;
};
