Files
xen/tools/misc/policyprocessor/XmlToBinInterface.java
T
kaf24@firebug.cl.cam.ac.uk e39ba51523 - allows to optionally boot the system with a policy already being
active at startup; this works by adding a module line into the grub
  configuration file and placing the binary policy generated by the
  policy tool into the boot directory; This assumes that a maximum of
  one module line is used for the initrd in the grub configuration
  file - Question: do users pass more than one module to the kernel?
- enables the policy hypervisor call on x86/64
- some function prototypes moved to include files
- moves the version number in the java tool up to the current
  version (a better way of doing this will be submitted soon)

Signed-off-by: Stefan Berger <stefanb@us.ibm.com>
Signed-off-by: Reiner Sailer <sailer@us.ibm.com>
2005-07-25 21:19:14 +00:00

136 lines
3.2 KiB
Java

/**
* (C) Copyright IBM Corp. 2005
*
* $Id: XmlToBinInterface.java,v 1.3 2005/06/20 21:07:37 rvaldez Exp $
*
* Author: Ray Valdez
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation, version 2 of the
* License.
*
* XmlToBinInterface Class.
* <p>
*
* Defines constants used by XmToBin.
*
* <p>
*
* policy binary structures
*
* typedef struct {
* u32 magic;
*
* u32 policyversion;
* u32 len;
*
* u16 primary_policy_code;
* u16 primary_buffer_offset;
* u16 secondary_policy_code;
* u16 secondary_buffer_offset;
* u16 resource_offset;
*
* } acm_policy_buffer_t;
*
* typedef struct {
* u16 policy_code;
* u16 ste_max_types;
* u16 ste_max_ssidrefs;
* u16 ste_ssid_offset;
* } acm_ste_policy_buffer_t;
*
* typedef struct {
* uint16 policy_code;
* uint16 chwall_max_types;
* uint16 chwall_max_ssidrefs;
* uint16 chwall_max_conflictsets;
* uint16 chwall_ssid_offset;
* uint16 chwall_conflict_sets_offset;
* uint16 chwall_running_types_offset;
* uint16 chwall_conflict_aggregate_offset;
* } acm_chwall_policy_buffer_t;
*
* typedef struct {
* u16 partition_max;
* u16 partition_offset;
* u16 vlan_max;
* u16 vlan_offset;
* u16 slot_max;
* u16 slot_offset;
* } acm_resource_buffer_t;
*
* typedef struct {
* u16 id;
* u16 ssid_ste;
* u16 ssid_chwall;
* } acm_partition_entry_t;
*
* typedef struct {
* u16 vlan;
* u16 ssid_ste;
* } acm_vlan_entry_t;
*
* typedef struct {
* u16 bus;
* u16 slot;
* u16 ssid_ste;
* } acm_slot_entry_t;
*
*
*
*/
public interface XmlToBinInterface
{
/* policy code (uint16) */
final int policyCodeSize = 2;
/* max_types (uint16) */
final int maxTypesSize = 2;
/* max_ssidrefs (uint16) */
final int maxSsidrefSize = 2;
/* ssid_offset (uint32) */
final int ssidOffsetSize = 2;
final short markSymbol = 0x0001;
final int u32Size = 4;
final int u16Size = 2;
/* num of bytes for acm_ste_policy_buffer_t */
final short steHeaderSize = (4 * u16Size);
/* byte for acm_chinese_wall_policy_buffer_t */
final short chwHeaderSize = (8 * u16Size);
final short primaryPolicyCodeSize = u16Size;
final short primaryBufferOffsetSize = u16Size ;
final int secondaryPolicyCodeSz = u16Size;
final int secondaryBufferOffsetSz = u16Size;
final short resourceOffsetSz = u16Size;
final short partitionBufferSz = (2 * u16Size);
final short partitionEntrySz = (3 * u16Size);
final short slotBufferSz = (2 * u16Size);
final short slotEntrySz = (3 * u16Size);
final short vlanBufferSz = (2 * u16Size);
final short vlanEntrySz = (2 * u16Size);
final short binaryBufferHeaderSz = (3 * u32Size + 4* u16Size);
/* copied directlty from policy_ops.h */
final int POLICY_INTERFACE_VERSION = 0xAAAA0003;
/* copied directly from acm.h */
final int ACM_MAGIC = 0x0001debc;
final short ACM_NULL_POLICY = 0;
final short ACM_CHINESE_WALL_POLICY = 1;
final short ACM_SIMPLE_TYPE_ENFORCEMENT_POLICY = 2;
final short ACM_CHINESE_WALL_AND_SIMPLE_TYPE_ENFORCEMENT_POLICY = 3;
final short ACM_EMPTY_POLICY = 4;
}