{
 superclass=> 'lvs_client_msg',      

				# note: no types for perl because perl
 types =>			# gets along fine without types
 {				# also there are no C bindings yet :(
  'string' =>			
  { cpp => 'char *',
    c => 'char *', 
    read => 'read_string',
    write => 'write_string'
  },
  
  'boolean' => 
  { cpp => 'bool',
    c => 'int', 
    read => 'read_boolean',
    write => 'write_boolean'
  },
  
  'string array' => 
  { cpp => 'char **',
    c => 'char **', 
    read => 'read_string_array',
    write => 'write_string_array'
  },
  
  'int' => 
  { cpp => 'int',
    c => 'int', 
    read => 'read_int',
    write => 'write_int'
  },
  
  'float' => 
  { cpp => 'float',
    c => 'float', 
    read => 'read_float',
    write => 'write_float'
  },
  
  'int array' => 
  { cpp => 'int *',
    c => 'int *', 
    read => 'read_int_array',
    write => 'write_int_array'
  },

  'float array' => 
  { cpp => 'float *',
    c => 'float *', 
    read => 'read_float_array',
    write => 'write_float_array'
  },
  
  'message' => 
  { cpp => 'lvs_client_msg *',
    c => 'lvs_client_msg *',
    read => 'read_message',
    write => 'write_message'
  },
  
  'message array' => 
  { cpp => 'lvs_client_msg **',
    c => 'lvs_client_msg **',
    read => 'read_message_array',
    write => 'write_message_array'
  }
 },
 
 messages =>			
 {
				# login stuff
  'session login' => 
  {
   fields => {session_key => {type => 'string'},},
  },

  'password login' => 
  {
   fields => {passwd => { type => 'string' }}, # sha1 hash
   between => 'from client to server',
   response => 'login status',
  },

  'login status' => 
  {
   fields => {ok     => { type => 'boolean' },
	      session_key => {type => 'string'},
              reason => { type => 'string' }},
   between => 'from server to client',
   comments => ' '
  },

  'logout' =>
  {
   fields => { },
   between => 'from client to server',
   comments => ' '
  },

  'add node' =>
  {
   fields => {name => {type => 'string'},},
  },

  'delete node' =>
  {
   fields => {name => {type => 'string'},},
  },

  'list nodes' => 
  {
   fields => { },
   response => 'message array of node info messages',
  },

  'node info' => 
  {
   fields => {node => {type => 'string'},
	      hbstatus => {type => 'string'},
	      lvsdstatus => {type => 'string'},
	      type => {type => 'string'},
	      ip => {type => 'string'},}
  },

  'add vip' => 
  {
   fields => {ip => {type => 'string'},
	      port => {type => 'int'},
	      primary_dir => {type => 'string'},
	      secondary_dir => {type => 'string'},
	      forwarding => {type => 'int'},
	      nat_ip => {type => 'string'},
	      nat_mask => {type => 'string'},},
  },

  'delete vip' => 
  {
   fields => {ip => {type => 'string'},
	      port => {type => 'int'},},
  },

  'add realserver' =>
  {
   fields => {vip_ip => {type => 'string'},
	      vip_port => {type => 'int'},
	      name => {type => 'string'},
	      weight => {type => 'int'},
	      forward => {type => 'int'},},
  },

  'delete realserver' =>
  {
   fields => {vip_ip => {type => 'string'},
	      vip_port => {type => 'int'},
	      name => {type => 'string'},},
  },

  'change vip director' =>
  {
   fields => {vip_ip => {type => 'string'},
	      vip_port => {type => 'int'},
	      dir_type => {type => 'string'},
	      new_dir => {type => 'string'},},
  },

  'change vip sched' =>
  {
   fields => {vip_ip => {type => 'string'},
	      vip_port => {type => 'int'},
	      new_sched => {type => 'string'},},
  },

  'change vip persist' =>
  {
   fields => {vip_ip => {type => 'string'},
	      vip_port => {type => 'int'},
	      new_persist => {type => 'int'},},
  },

  'change vip persist mask' =>
  {
   fields => {vip_ip => {type => 'string'},
	      vip_port => {type => 'int'},
	      new_persist_mask => {type => 'string'},},
  },

  'change vip monitor' =>
  {
   fields => {vip_ip => {type => 'string'},
	      vip_port => {type => 'int'},
	      new_monitor => {type => 'string'},},
  },

  'change vip ip' =>
  {
   fields => {vip_ip => {type => 'string'},
	      vip_port => {type => 'int'},
	      new_ip => {type => 'string'},},
  },

  'change vip port' =>
  {
   fields => {vip_ip => {type => 'string'},
	      vip_port => {type => 'int'},
	      new_port => {type => 'int'},},
  },

  'change rs weight' =>
  {
   fields => {vip_ip => {type => 'string'},
	      vip_port => {type => 'int'},
	      name => {type => 'string'},
	      weight => {type => 'int'},},
  },

  'change rs forward' =>
  {
   fields => {vip_ip => {type => 'string'},
	      vip_port => {type => 'int'},
	      name => {type => 'string'},
	      forward => {type => 'int'},},
  },

  'change nat ip' =>
  {
   fields => {old_ip => {type => 'string'},
	      new_ip => {type => 'string'},},
   
  },

  'change nat mask' =>
  {
   fields => {nat_ip => {type => 'string'},
	      new_mask => {type => 'string'},},
  },

  'change session timeout' =>
  {
   fields => {session_timeout => {type => 'int'}},
  },

  'change cookie timeout' =>
  {
   fields => {cookie_timeout => {type => 'int'}},
  },
  
  'change client port' =>
  {
   fields => {client_port => {type => 'int'}},
  },

  'change stat update' =>
  {
   fields => {interval => {type => 'int'}},
  },

  'change admin pw' =>
  {
   fields => {old_pw => {type => 'string'}, # hashes
	      new_pw => {type => 'string'},},
  },

  'save config' =>
  {
   fields => {},
  },
  
  'global cfg req' =>
  {
   fields => {},
   response => 'global cfg',
  },
  
  'global cfg' =>
  {
   fields => {session_timeout => {type => 'int'},
	      client_port => {type => 'int'},
	      changed => {type => 'boolean'},
	      cookie_timeout => {type => 'int'},
	      stat_update_interval => {type => 'int'},},
  },
  
  'list vips' =>
  {
   fields => { },
   response => 'message array of vip info messages',
  },
  
  'query vip' =>
  {
   fields => {ip => {type => 'string'},
	      port => {type => 'int'},},
   response => 'vip info'
  },
  
  'vip info' =>
  {
   fields => {primary_dir => {type => 'string'},
	      secondary_dir => {type => 'string'},
	      sched => {type => 'string'},
	      persist => {type => 'int'},
	      persist_mask => {type => 'string'},
	      ip => {type => 'string'},
	      port => {type => 'int'},
	      monitor => {type => 'string'},
	      changed => {type => 'boolean'},
	      realservers => {type => 'message array'},
	      status => {type => 'string'},
	      forwarding => {type => 'int'},
	      nat_ip => {type => 'string'},
	      nat_mask => {type => 'string'},},
  },
  
  'realserver info' =>
  {
   fields => {name => {type => 'string'},
	      weight => {type => 'int'},
	      forward => {type => 'int'},
	      status => {type => 'string'},},
  },
  
  'message array' =>
  { 
   fields => {messages => { type => 'message array' }}
  },
  
  'status' =>
  {
   fields => {status => {type => 'boolean'},
	      msg => {type => 'string'},},
  },
				# status and stats are different :)
  'get stats' =>
  {
   fields => {},
  },

  'stat list' => 
  {
   fields => {node_stats => {type => 'string array'},
	      vip_stats => {type => 'string array'},},
  },
  
  'list stat' =>
  {
   fields => {name => {type => 'string'},},
  },

  'stat listing' =>
  {
   fields => {name => {type => 'string'},
	      values => {type => 'float array'},},
  },
 }
}
