//===- Module.proto -------------------------------------------*- Proto -*-===//
//
//  Copyright (C) 2020 GrammaTech, Inc.
//
//  This code is licensed under the MIT license. See the LICENSE file in the
//  project root for license terms.
//
//  This project is sponsored by the Office of Naval Research, One Liberty
//  Center, 875 N. Randolph Street, Arlington, VA 22203 under contract #
//  N68335-17-C-0700.  The content of the information does not necessarily
//  reflect the position or policy of the Government and no official
//  endorsement should be inferred.
//
//===----------------------------------------------------------------------===//
syntax = "proto3";
package gtirb.proto;
option java_package = "com.grammatech.gtirb.proto";

import "AuxData.proto";
import "ProxyBlock.proto";
import "Section.proto";
import "Symbol.proto";

enum FileFormat {
  Format_Undefined = 0;
  COFF = 1;
  ELF = 2;
  PE = 3;
  IdaProDb32 = 4;
  IdaProDb64 = 5;
  XCOFF = 6;
  MACHO = 7;
  RAW = 8;
};

enum ISA {
  ISA_Undefined = 0;
  IA32 = 1;
  PPC32 = 2;
  X64 = 3;
  ARM = 4;
  ValidButUnsupported = 5;
  PPC64 = 6;
  ARM64 = 7;
  MIPS32 = 8;
  MIPS64 = 9;
};

enum ByteOrder {
  ByteOrder_Undefined = 0;
  BigEndian = 1;
  LittleEndian = 2;
}

message Module {
  reserved "image_byte_map", "data", "symbolic_operands", "aux_data_container",
      "blocks", "cfg";
  reserved 8, 10, 11, 13, 14, 15;

  bytes uuid = 1;
  string binary_path = 2;
  uint64 preferred_addr = 3;
  int64 rebase_delta = 4;
  FileFormat file_format = 5;
  ISA isa = 6;
  string name = 7;
  repeated Symbol symbols = 9;
  repeated ProxyBlock proxies = 16;
  repeated Section sections = 12;
  map<string, AuxData> aux_data = 17;
  bytes entry_point = 18;
  ByteOrder byte_order = 19;
}
