#!/usr/bin/ruby
#
# DO NOT MODIFY!!!!
# This file is automatically generated by Racc 1.4.14
# from Racc grammer file "".
#

require 'racc/parser.rb'

$drbd = Hash.new()

class DrbdParser < Racc::Parser

module_eval(<<'...end drbd.rb.yy/module_eval...', 'drbd.rb.yy', 219)
	def parse(str)
		@yydebug = false
		@q = []
		until str.empty? || !str
			case str
			when /\A\s+/
			when /\Adisable-ip-verification/
				@q.push [:TK_DISABLE_IP_VERIFICATION, 'disable-ip-verification']
			when /\Audev-always-use-vnr/
				@q.push [:TK_UDEV_ALWAYS_USE_VNR, 'udev-always-use-vnr']
			when /\Ausage-count/
				@q.push [:TK_USAGE_COUNT, 'usage-count']
			when /\Adialog-refresh/
				@q.push [:TK_DIALOG_REFRESH, 'dialog-refresh']	
			when /\Aon-io-error/
				@q.push [:TK_ON_IO_ERROR, 'on-io-error']
			when /\Aglobal/
				@q.push [:TK_GLOBAL, 'global']
			when /\Aminor-count/
				@q.push [:TK_MINOR_COUNT, 'minor-count']
			when /\Aresource[ \t\n]/
				@q.push [:TK_RESOURCE, 'resource']
			when /\Acommon/
				@q.push [:TK_COMMON, 'common']	
			when /\Aprotocol/
				@q.push [:TK_PROTOCOL, 'protocol']
			when /\Adisk\s*\{/
				@q.push [:TK_DISK_S, 'disk_s']
			when /\Adisk/
				@q.push [:TK_DISK, 'disk']
			when /\Anet/
				@q.push [:TK_NET, 'net']
			when /\Aconnection-mesh/
				@q.push [:TK_CONNECTION_MESH, 'connection-mesh']
			when /\Aconnection/
				@q.push [:TK_CONNECTION, 'connection']
			when /\Ahosts\s+[\w\-_ ]+/
				@q.push [:TK_HOSTS, 'hosts']
			when /\Ahost/
				@q.push [:TK_HOST, 'host']
			when /\Aminor/
				@q.push [:TK_MINOR, 'minor']
			when /\Asyncer/
				@q.push [:TK_SYNCER, 'syncer']
			when /\Astartup/
				@q.push [:TK_STARTUP, 'startup']
			when /\Aoptions/
				@q.push [:TK_OPTIONS, 'options']
			when /\Ahandlers/
				@q.push [:TK_HANDLERS, 'handlers']	
			when /\Afencing/
				@q.push [:TK_FENCING, 'fencing']	
			when /\Ause-bmbv/
				@q.push [:TK_USE_BMBV, 'use-bmbv']
			when /\Ause-rle/
				@q.push [:TK_USE_RLE, 'use-rle']
			when /\Ano-disk-barrier/
				@q.push [:TK_NO_DISK_BARRIER, 'no-disk-barrier']
			when /\Ano-disk-flushes/
				@q.push [:TK_NO_DISK_FLUSHES, 'no-disk-flushes']
			when /\Ano-disk-drain/
				@q.push [:TK_NO_DISK_DRAIN, 'no-disk-drain']
			when /\Amd-flushes/
				@q.push [:TK_MD_FLUSHES, 'md-flushes']
			when /\Amax-bio-bvecs/
				@q.push [:TK_MAX_BIO_BVECS, 'max-bio-bvecs']
			when /\Aping-timeout/
				@q.push [:TK_PING_TIMEOUT, 'ping-timeout']
			when /\Aallow-two-primaries/
				@q.push [:TK_ALLOW_TWO_PRIMARIES, 'allow-two-primaries']
			when /\Acram-hmac-alg/
				@q.push [:TK_CRAM_HMAC_ALG, 'cram-hmac-alg']
			when /\Ashared-secret/
				@q.push [:TK_SHARED_SECRET, 'shared-secret']
			when /\Aafter-sb-0pri/
				@q.push [:TK_AFTER_SB_0PRI, 'after-sb-0pri']
			when /\Aafter-sb-1pri/
				@q.push [:TK_AFTER_SB_0PRI, 'after-sb-1pri']
			when /\Aafter-sb-2pri/
				@q.push [:TK_AFTER_SB_0PRI, 'after-sb-2pri']
			when /\Adata-integrity-alg/
				@q.push [:TK_DATA_INTEGRITY_ALG, 'data-integrity-alg']	
			when /\Arr-conflict/
				@q.push [:TK_RR_CONFLICT, 'rr-conflict']
			when /\Apri-on-incon-degr/
				@q.push [:TK_PRI_ON_INCON_DEGR, 'pri-on-incon-degr']
			when /\Apri-lost-after-sb/
				@q.push [:TK_PRI_LOST_AFTER_SB, 'pri-lost-after-sb']
			when /\Apri-lost/
				@q.push [:TK_PRI_LOST, 'pri-lost']	
			when /\Afence-peer/
				@q.push [:TK_FENCE_PEER, 'fence-peer']
			when /\Alocal-io-error/
				@q.push [:TK_LOCAL_IO_ERROR, 'local-io-error']
			when /\Asplit-brain/
				@q.push [:TK_SPLIT_BRAIN, 'split-brain']
			when /\Abefore-resync-target/
				@q.push [:TK_BEFORE_RESYNC_TARGET, 'before-rsync-target']
			when /\Aafter-resync-target/
				@q.push [:TK_AFTER_RESYNC_TARGET, 'after-resync-target']
			when /\Await-after-sb/
				@q.push [:TK_WAIT_AFTER_SB, 'wait-after-sb']
			when /\Abecome-primary-on/
				@q.push [:TK_BECOME_PRIMARY_ON, 'become-primary-on']	
			when /\Ano-tcp-cork/
				@q.push [:TK_NO_TCP_CORK, 'no-tcp-cork']
			when /\Acpu-mask/
				@q.push [:TK_CPU_MASK, 'cpu-mask']
			when /\Aquorum/
				@q.push [:TK_QUORUM, 'quorum']
			when /\Averify-alg/
				@q.push [:TK_VERIFY_ALG, 'verify-alg']	
			when /\Afloating/
			    @q.push [:TK_FLOATING, 'floating']
			when /\Astacked-on-top-of/
				@q.push [:TK_STACK_ON_TOP_OF, 'stacked-on-top-of']
			when /\Asize/
				@q.push [:TK_SIZE, 'size']
			when /\Atimeout/
				@q.push [:TK_TIMEOUT, 'timeout']
			when /\Aconnect-int/
				@q.push [:TK_CONNECT_INT, 'connect-int']
			when /\Aafter-sb-0pri/
				@q.push [:TK_AFTER_SB_0PRI, 'after-sb-0pri']
			when /\Aafter-sb-1pri/
				@q.push [:TK_AFTER_SB_0PRI, 'after-sb-1pri']
			when /\Aafter-sb-2pri/
				@q.push [:TK_AFTER_SB_0PRI, 'after-sb-2pri']
			when /\Arr-conflict/
				@q.push [:TK_RR_CONFLICT, 'rr-conflict']	
			when /\Aping-int/
				@q.push [:TK_PING_INT, 'ping-int']
			when /\Amax-buffers/
				@q.push [:TK_MAX_BUFFERS, 'max-buffers']
			when /\Aunplug-watermark/
				@q.push [:TK_UNPLUG_WATERMARK, 'unplug-watermark']
			when /\Amax-epoch-size/
				@q.push [:TK_MAX_EPOCH_SIZE, 'max-epoch-size']
			when /\Asndbuf-size/
				@q.push [:TK_SNDBUF_SIZE, 'sndbuf-size']
			when /\Ako-count/
				@q.push [:TK_KO_COUNT, 'ko-count']
			when /\Aresync-rate/
				@q.push [:TK_RESYNC_RATE, 'resync-rate']
			when /\Arate/
				@q.push [:TK_RATE, 'rate']
			when /\Aal-extents/
				@q.push [:TK_AL_EXTENTS, 'al-extents']
			when /\Aafter/
				@q.push [:TK_AFTER, 'after']	
			when /\Adevice/
				@q.push [:TK_DEVICE, 'device']
			when /\Aaddress/
				@q.push [:TK_ADDRESS, 'address']
			when /\Aport/
				@q.push [:TK_PORT, 'port']
			when /\Anode-id/
				@q.push [:TK_NODE_ID, 'node-id']
			when /\Ameta-disk/
				@q.push [:TK_META_DISK, 'meta-disk']
			when /\Aflexible-meta-disk/
				@q.push [:TK_FLEXIBLE_META_DISK, 'flexible-meta-disk']	
			when /\Adegr-wfc-timeout/
				@q.push [:TK_DEGR_WFC_TIMEOUT, 'degr-wfc-timeout']
			when /\Aon-no-data-accessible/
				@q.push [:TK_NO_DATA_ACCESSIBLE, 'on-no-data-accessible']
			when /\Awfc-timeout/
				@q.push [:TK_WFC_TIMEOUT, 'wfc-timeout']
			when /\Aipv6/
				@q.push [:TK_IPV6, 'ipv6']	
			when /\Aon\s*/
				@q.push [:TK_ON, 'on']
			when /\A"[^"]*"/
				@q.push [:TK_STRING, $&]
			when /\A\[[\w\.\/:]+:[\w\.\/:]+\]/
				@q.push [:TK_IPV6ADDR, $&]	
			when /\A[\w\.\/\[\]-]+/
				@q.push [:TK_STRING, $&]
			when /\A.|\n/o
				s = $&
				@q.push [s, s]
			end
			str = $'
		end
		@q.push [false, '$end']	
		do_parse
	end

	def next_token
		@q.shift
	end	
			
...end drbd.rb.yy/module_eval...
##### State transition tables begin ###

racc_action_table = [
    79,    74,    73,    75,    76,   243,    68,     3,    71,    69,
    70,    27,    26,    28,    29,   289,    32,   215,   266,    18,
   265,   120,   124,   153,    86,    20,   259,   257,   258,   260,
   153,   120,   124,    78,    87,   133,   249,   250,   251,    88,
   153,   133,    89,    31,    21,    17,   246,   121,   122,   123,
    90,    91,   244,    92,    93,   134,    94,   121,   122,   123,
    84,   134,    85,    83,    64,   135,    72,    80,   235,    77,
    44,   135,   261,    81,   131,   154,    82,   146,   242,    30,
   233,   252,   154,    65,   127,   130,   288,   239,   115,   214,
   118,   262,   154,    24,   263,    19,   147,    15,    97,    98,
    99,   101,   255,   102,   103,   104,   148,   150,   151,    43,
   105,   247,   156,   157,   158,   159,   160,   162,    23,   164,
   128,   129,   100,   106,   107,   108,   109,   110,   111,   112,
   113,   114,   115,   116,   165,   166,   167,   168,   169,    48,
    49,   234,    97,    98,    99,   101,   170,   102,   103,   104,
    57,   171,   172,   173,   105,   174,   175,   117,   176,    50,
    51,    52,    53,    54,    56,    95,   100,   106,   107,   108,
   109,   110,   111,   112,   113,   114,   115,   116,   138,   139,
   140,   141,   142,   143,   144,   145,    97,    98,    99,   101,
   177,   102,   103,   104,   178,   179,    55,   180,   105,   127,
   130,   117,   181,   182,    58,   183,   184,   236,    46,   232,
   100,   106,   107,   108,   109,   110,   111,   112,   113,   114,
   185,   116,   186,   187,   188,   189,    48,    49,   190,   191,
   192,   193,   194,   195,   196,   128,   129,    57,   197,   198,
   199,   200,   201,   202,   203,   117,    50,    51,    52,    53,
    54,    56,   204,   291,   205,   206,   125,   138,   139,   140,
   141,   142,   143,   144,   145,   207,   208,   209,   211,   212,
   213,    42,   216,    41,   223,   224,   227,   229,   230,   231,
    40,    39,    37,    55,    36,    35,   136,    34,    33,    23,
   253,    58,   254,    13,    10,   217,   267,   268,   269,   162,
   271,   272,   273,   150,   276,   277,   278,   279,     8,   150,
   276,   283,   284,   285,     7,     6,   211,     4,   292,   293,
   294,   295 ]

racc_action_check = [
    45,    45,    45,    45,    45,   225,    45,     0,    45,    45,
    45,    14,    14,    14,    14,   270,    14,   153,   238,    11,
   238,   219,   219,   266,    50,    11,   237,   237,   237,   237,
    72,    60,    60,    45,    51,   221,   228,   228,   228,    52,
   259,    62,    53,    14,    11,    11,   226,   219,   219,   219,
    54,    55,   226,    56,    57,   221,    58,    60,    60,    60,
    48,    62,    49,    47,    44,   221,    45,    45,   221,    45,
    32,    62,   237,    45,    62,   266,    45,    66,   225,    14,
   219,   228,    72,    45,   220,   220,   270,   225,    59,   153,
    60,   237,   259,    14,   238,    11,    68,    11,    59,    59,
    59,    59,   237,    59,    59,    59,    69,    70,    71,    31,
    59,   228,    74,    75,    76,    77,    78,    79,    80,    81,
   220,   220,    59,    59,    59,    59,    59,    59,    59,    59,
    59,    59,   218,    59,    82,    96,    97,    98,    99,    38,
    38,   220,   218,   218,   218,   218,   100,   218,   218,   218,
    38,   101,   102,   103,   218,   104,   105,    59,   106,    38,
    38,    38,    38,    38,    38,    59,   218,   218,   218,   218,
   218,   218,   218,   218,   218,   218,   287,   218,   222,   222,
   222,   222,   222,   222,   222,   222,   287,   287,   287,   287,
   107,   287,   287,   287,   108,   109,    38,   110,   287,    61,
    61,   218,   111,   112,    38,   113,   115,   222,    38,   218,
   287,   287,   287,   287,   287,   287,   287,   287,   287,   287,
   116,   287,   117,   119,   120,   121,   155,   155,   122,   123,
   124,   126,   127,   129,   130,    61,    61,   155,   132,   133,
   134,   135,   137,   138,   139,   287,   155,   155,   155,   155,
   155,   155,   140,   287,   141,   142,    61,    63,    63,    63,
    63,    63,    63,    63,    63,   143,   144,   145,   148,   150,
   152,    30,   154,    29,   161,   163,   211,   214,   215,   216,
    28,    27,    22,   155,    21,    20,    63,    17,    16,    13,
   230,   155,   231,     9,     6,   155,   240,   243,   245,   246,
   248,   249,   250,   251,   252,   256,   257,   258,     4,   260,
   261,   262,   264,   265,     3,     2,   279,     1,   288,   289,
   293,   294 ]

racc_action_pointer = [
     5,   317,   279,   228,   308,   nil,   208,   nil,   nil,   290,
   nil,    10,   nil,   272,     6,   nil,   200,   270,   nil,   nil,
   268,   267,   196,   nil,   nil,   nil,   nil,   195,   194,   187,
   185,    23,    53,   nil,   nil,   nil,   nil,   nil,   121,   nil,
   nil,   nil,   nil,   nil,   -24,    -4,   nil,   -25,    43,    45,
     7,    17,    22,    25,    33,    34,    36,    37,    39,    78,
     3,   169,   -13,   199,   nil,   nil,   -11,   nil,    79,    89,
    90,    91,    13,   nil,    26,    27,    28,    29,    30,   100,
   101,    33,    48,   nil,   nil,   nil,   nil,   nil,   nil,   nil,
   nil,   nil,   nil,   nil,   nil,   nil,    47,   119,   120,   121,
   129,   134,   135,   136,   138,   139,   141,   173,   177,   178,
   180,   185,   186,   188,   nil,   189,   203,   205,   nil,   135,
   207,   208,   211,   212,   213,   nil,   143,   215,   nil,   216,
   217,   nil,   150,   222,   223,   224,   nil,   154,   226,   227,
   235,   237,   238,   248,   249,   250,   nil,   nil,   196,   nil,
   252,   nil,   184,     0,   204,   208,   nil,   nil,   nil,   nil,
   nil,   188,   nil,   189,   nil,   nil,   nil,   nil,   nil,   nil,
   nil,   nil,   nil,   nil,   nil,   nil,   nil,   nil,   nil,   nil,
   nil,   nil,   nil,   nil,   nil,   nil,   nil,   nil,   nil,   nil,
   nil,   nil,   nil,   nil,   nil,   nil,   nil,   nil,   nil,   nil,
   nil,   nil,   nil,   nil,   nil,   nil,   nil,   nil,   nil,   nil,
   nil,   259,   nil,   nil,   260,   189,   190,   nil,   122,    -7,
    54,   -19,   120,   nil,   nil,     0,   -35,   nil,    24,   nil,
   273,   275,   nil,   nil,   nil,   nil,   nil,    15,     7,   nil,
   208,   nil,   nil,   211,   nil,   210,   282,   nil,   212,   284,
   285,   286,   287,   nil,   nil,   nil,   217,   289,   290,    23,
   292,   293,   294,   nil,   224,   296,     6,   nil,   nil,   nil,
     4,   nil,   nil,   nil,   nil,   nil,   nil,   nil,   nil,   244,
   nil,   nil,   nil,   nil,   nil,   nil,   nil,   166,   301,   302,
   nil,   nil,   nil,   238,   304,   nil ]

racc_action_default = [
    -2,  -146,   -11,  -146,  -146,   -22,  -146,    -4,   296,    -1,
   -13,  -146,   -23,  -146,  -146,    -3,  -146,  -146,    -7,    -8,
  -146,  -146,  -146,   -25,   -12,   -14,   -48,  -146,  -146,  -146,
  -146,  -146,  -146,    -5,    -6,    -9,   -10,   -26,  -146,   -70,
   -93,  -135,  -141,  -118,  -146,  -146,   -15,  -146,  -146,  -146,
  -146,  -146,  -146,  -146,  -146,  -146,  -146,  -146,  -146,  -146,
  -146,  -146,  -146,  -146,   -21,   -24,  -146,   -28,  -146,  -146,
  -146,  -146,  -146,   -48,  -146,  -146,  -146,  -146,  -146,  -146,
  -146,  -146,  -146,   -49,   -50,   -51,   -52,   -53,   -54,   -55,
   -56,   -57,   -58,   -59,   -60,   -16,  -146,  -146,  -146,  -146,
  -146,  -146,  -146,  -146,  -146,  -146,  -146,  -146,  -146,  -146,
  -146,  -146,  -146,  -146,   -89,  -146,  -146,  -146,   -17,  -146,
  -146,  -146,  -146,  -146,  -146,   -18,  -146,  -146,  -138,  -146,
  -146,   -19,  -146,  -146,  -146,  -146,   -20,  -146,  -146,  -146,
  -146,  -146,  -146,  -146,  -146,  -146,   -27,   -29,   -34,   -31,
  -133,   -32,   -33,  -131,  -146,  -146,   -70,   -93,  -135,  -141,
  -118,  -146,   -47,  -146,   -61,   -66,   -71,   -72,   -73,   -74,
   -75,   -76,   -77,   -78,   -79,   -80,   -81,   -82,   -83,   -84,
   -85,   -86,   -87,   -88,   -90,   -91,   -92,   -94,   -95,   -96,
   -97,   -98,   -99,  -136,  -137,  -139,  -140,  -142,  -143,  -144,
  -145,  -119,  -120,  -121,  -122,  -123,  -124,  -125,  -126,  -127,
   -30,  -146,  -132,  -100,  -146,  -146,  -146,   -36,  -146,  -146,
  -146,  -146,  -146,  -110,  -106,  -146,  -146,   -35,  -146,  -128,
  -146,  -146,   -37,   -38,   -39,   -40,   -41,  -146,  -146,   -45,
  -146,   -63,   -64,  -146,   -46,  -146,  -146,   -43,  -146,  -146,
  -146,  -146,  -146,  -130,  -129,   -42,  -146,  -146,  -146,  -146,
  -146,  -146,  -146,   -44,  -146,  -146,  -146,   -62,   -70,   -67,
  -146,  -101,  -102,  -103,  -104,  -105,  -134,  -111,  -112,   -34,
  -114,  -115,  -116,  -117,  -107,  -108,  -109,  -146,  -146,  -146,
  -113,   -65,   -68,  -146,  -146,   -69 ]

racc_goto_table = [
    59,   152,   149,   161,   210,    61,    60,    63,    62,    22,
    38,   275,    66,    25,    12,    14,    45,     1,    67,    16,
   282,    11,     9,     5,   237,   228,   238,   225,   226,   240,
   241,   245,   248,     2,   264,   256,   nil,   nil,   nil,   nil,
   nil,   nil,   nil,   nil,   nil,   nil,   nil,   nil,   nil,   nil,
   nil,   nil,   nil,   nil,   nil,   nil,   nil,   155,   nil,   nil,
   nil,   nil,   nil,   nil,   nil,   nil,   nil,   nil,   nil,   nil,
   nil,   nil,   nil,   nil,   nil,   nil,   163,   nil,   nil,   nil,
   nil,   nil,   nil,   nil,   nil,   nil,   nil,   nil,   nil,   nil,
   nil,   nil,   nil,   nil,   nil,   nil,   nil,   nil,   nil,   nil,
   nil,   nil,   nil,   nil,   nil,   nil,   nil,   nil,   nil,   nil,
   nil,   nil,   nil,   nil,   nil,   nil,   nil,   218,   nil,   nil,
   nil,   nil,   220,   219,   222,   221,   nil,   nil,   nil,   nil,
   nil,   nil,   nil,   nil,   nil,   290,   nil,   nil,   nil,   nil,
   nil,   nil,   nil,   nil,   nil,   nil,   nil,   nil,   nil,   nil,
   nil,   nil,   nil,   nil,   nil,   nil,   nil,   nil,   nil,   nil,
   nil,   nil,   nil,   nil,   nil,   nil,   nil,   nil,   nil,   nil,
   270,   nil,   nil,   nil,   nil,   nil,   nil,   nil,   nil,   nil,
   nil,   nil,   nil,   274,   nil,   nil,   nil,   nil,   280,   nil,
   nil,   nil,   281,   nil,   nil,   286,   nil,   nil,   nil,   nil,
   nil,   nil,   nil,   nil,   nil,   nil,   nil,   nil,   nil,   nil,
   nil,   nil,   nil,   nil,   nil,   nil,   nil,   nil,   nil,   nil,
   nil,   nil,   nil,   nil,   nil,   nil,   nil,   nil,   nil,   287 ]

racc_goto_check = [
    10,    22,    21,    23,    20,    12,    11,    14,    13,    16,
     9,    36,    18,     8,    15,     7,    17,     1,    19,     6,
    36,     5,     4,     3,    24,    25,    26,    27,    28,    30,
    31,    32,    35,     2,    37,    38,   nil,   nil,   nil,   nil,
   nil,   nil,   nil,   nil,   nil,   nil,   nil,   nil,   nil,   nil,
   nil,   nil,   nil,   nil,   nil,   nil,   nil,     9,   nil,   nil,
   nil,   nil,   nil,   nil,   nil,   nil,   nil,   nil,   nil,   nil,
   nil,   nil,   nil,   nil,   nil,   nil,    16,   nil,   nil,   nil,
   nil,   nil,   nil,   nil,   nil,   nil,   nil,   nil,   nil,   nil,
   nil,   nil,   nil,   nil,   nil,   nil,   nil,   nil,   nil,   nil,
   nil,   nil,   nil,   nil,   nil,   nil,   nil,   nil,   nil,   nil,
   nil,   nil,   nil,   nil,   nil,   nil,   nil,    10,   nil,   nil,
   nil,   nil,    12,    11,    14,    13,   nil,   nil,   nil,   nil,
   nil,   nil,   nil,   nil,   nil,    20,   nil,   nil,   nil,   nil,
   nil,   nil,   nil,   nil,   nil,   nil,   nil,   nil,   nil,   nil,
   nil,   nil,   nil,   nil,   nil,   nil,   nil,   nil,   nil,   nil,
   nil,   nil,   nil,   nil,   nil,   nil,   nil,   nil,   nil,   nil,
    23,   nil,   nil,   nil,   nil,   nil,   nil,   nil,   nil,   nil,
   nil,   nil,   nil,    21,   nil,   nil,   nil,   nil,    22,   nil,
   nil,   nil,    21,   nil,   nil,    22,   nil,   nil,   nil,   nil,
   nil,   nil,   nil,   nil,   nil,   nil,   nil,   nil,   nil,   nil,
   nil,   nil,   nil,   nil,   nil,   nil,   nil,   nil,   nil,   nil,
   nil,   nil,   nil,   nil,   nil,   nil,   nil,   nil,   nil,    10 ]

racc_goto_pointer = [
   nil,    17,    33,    21,    17,    14,     8,     5,    -1,   -16,
   -39,   -34,   -36,   -34,   -36,     5,    -4,   -21,   -33,   -27,
  -144,   -68,   -71,   -76,  -199,  -188,  -198,  -137,  -137,   nil,
  -196,  -195,  -195,   nil,   nil,  -196,  -241,  -204,  -202,   nil,
   nil,   nil ]

racc_goto_default = [
   nil,   nil,   nil,   nil,   nil,   nil,   nil,   nil,   nil,   nil,
   nil,   nil,   nil,   nil,   nil,   nil,   nil,   nil,   nil,   nil,
   nil,   nil,   nil,   nil,   nil,   nil,   nil,   nil,   nil,    47,
   nil,   nil,   nil,    96,   119,   nil,   nil,   nil,   nil,   137,
   126,   132 ]

racc_reduce_table = [
  0, 0, :racc_error,
  3, 91, :_reduce_1,
  0, 92, :_reduce_2,
  4, 92, :_reduce_3,
  0, 95, :_reduce_4,
  3, 95, :_reduce_5,
  2, 96, :_reduce_6,
  1, 96, :_reduce_7,
  1, 96, :_reduce_8,
  2, 96, :_reduce_9,
  2, 96, :_reduce_10,
  0, 93, :_reduce_11,
  4, 93, :_reduce_12,
  0, 97, :_reduce_13,
  2, 97, :_reduce_14,
  3, 98, :_reduce_15,
  4, 98, :_reduce_16,
  4, 98, :_reduce_17,
  4, 98, :_reduce_18,
  4, 98, :_reduce_19,
  4, 98, :_reduce_20,
  3, 98, :_reduce_21,
  0, 94, :_reduce_22,
  2, 94, :_reduce_23,
  5, 105, :_reduce_24,
  1, 106, :_reduce_25,
  0, 107, :_reduce_26,
  3, 107, :_reduce_27,
  2, 107, :_reduce_28,
  2, 108, :_reduce_29,
  3, 108, :_reduce_30,
  2, 108, :_reduce_31,
  2, 108, :_reduce_32,
  2, 108, :_reduce_33,
  0, 110, :_reduce_34,
  2, 110, :_reduce_35,
  3, 109, :_reduce_36,
  4, 109, :_reduce_37,
  4, 109, :_reduce_38,
  4, 109, :_reduce_39,
  4, 109, :_reduce_40,
  4, 109, :_reduce_41,
  5, 109, :_reduce_42,
  5, 109, :_reduce_43,
  5, 109, :_reduce_44,
  4, 109, :_reduce_45,
  4, 109, :_reduce_46,
  1, 113, :_reduce_47,
  0, 99, :_reduce_48,
  3, 99, :_reduce_49,
  2, 119, :_reduce_50,
  2, 119, :_reduce_51,
  2, 119, :_reduce_52,
  2, 119, :_reduce_53,
  2, 119, :_reduce_54,
  2, 119, :_reduce_55,
  2, 119, :_reduce_56,
  2, 119, :_reduce_57,
  2, 119, :_reduce_58,
  2, 119, :_reduce_59,
  2, 119, :_reduce_60,
  0, 117, :_reduce_61,
  3, 117, :_reduce_62,
  2, 117, :_reduce_63,
  1, 120, :_reduce_64,
  4, 121, :_reduce_65,
  0, 118, :_reduce_66,
  3, 118, :_reduce_67,
  4, 122, :_reduce_68,
  6, 122, :_reduce_69,
  0, 100, :_reduce_70,
  3, 100, :_reduce_71,
  2, 123, :_reduce_72,
  2, 123, :_reduce_73,
  2, 123, :_reduce_74,
  2, 123, :_reduce_75,
  2, 123, :_reduce_76,
  2, 123, :_reduce_77,
  2, 123, :_reduce_78,
  2, 123, :_reduce_79,
  2, 123, :_reduce_80,
  2, 123, :_reduce_81,
  2, 123, :_reduce_82,
  2, 123, :_reduce_83,
  2, 123, :_reduce_84,
  2, 123, :_reduce_85,
  2, 123, :_reduce_86,
  2, 123, :_reduce_87,
  2, 123, :_reduce_88,
  1, 123, :_reduce_89,
  2, 123, :_reduce_90,
  2, 123, :_reduce_91,
  2, 123, :_reduce_92,
  0, 101, :_reduce_93,
  3, 101, :_reduce_94,
  2, 124, :_reduce_95,
  2, 124, :_reduce_96,
  2, 124, :_reduce_97,
  2, 124, :_reduce_98,
  2, 124, :_reduce_99,
  0, 115, :_reduce_100,
  3, 115, :_reduce_101,
  2, 125, :_reduce_102,
  2, 125, :_reduce_103,
  2, 125, :_reduce_104,
  2, 125, :_reduce_105,
  0, 116, :_reduce_106,
  3, 116, :_reduce_107,
  2, 127, :_reduce_108,
  2, 127, :_reduce_109,
  0, 114, :_reduce_110,
  3, 114, :_reduce_111,
  2, 128, :_reduce_112,
  3, 128, :_reduce_113,
  2, 128, :_reduce_114,
  2, 128, :_reduce_115,
  2, 128, :_reduce_116,
  2, 128, :_reduce_117,
  0, 104, :_reduce_118,
  3, 104, :_reduce_119,
  2, 129, :_reduce_120,
  2, 129, :_reduce_121,
  2, 129, :_reduce_122,
  2, 129, :_reduce_123,
  2, 129, :_reduce_124,
  2, 129, :_reduce_125,
  2, 129, :_reduce_126,
  2, 129, :_reduce_127,
  3, 112, :_reduce_128,
  4, 112, :_reduce_129,
  4, 112, :_reduce_130,
  1, 112, :_reduce_131,
  2, 111, :_reduce_132,
  1, 111, :_reduce_133,
  1, 126, :_reduce_134,
  0, 102, :_reduce_135,
  3, 102, :_reduce_136,
  2, 130, :_reduce_137,
  1, 130, :_reduce_138,
  2, 130, :_reduce_139,
  2, 130, :_reduce_140,
  0, 103, :_reduce_141,
  3, 103, :_reduce_142,
  2, 131, :_reduce_143,
  2, 131, :_reduce_144,
  2, 131, :_reduce_145 ]

racc_reduce_n = 146

racc_shift_n = 296

racc_token_table = {
  false => 0,
  :error => 1,
  :TK_GLOBAL => 2,
  :TK_RESOURCE => 3,
  :TK_ON => 4,
  :TK_NET => 5,
  :TK_DISK_S => 6,
  :TK_SYNCER => 7,
  :TK_STARTUP => 8,
  :TK_DISABLE_IP_VERIFICATION => 9,
  :TK_PROTOCOL => 10,
  :TK_ADDRESS => 11,
  :TK_DISK => 12,
  :TK_DEVICE => 13,
  :TK_META_DISK => 14,
  :TK_MINOR_COUNT => 15,
  :TK_INTEGER => 16,
  :TK_STRING => 17,
  :TK_ON_IO_ERROR => 18,
  :TK_SIZE => 19,
  :TK_TIMEOUT => 20,
  :TK_CONNECT_INT => 21,
  :TK_PING_INT => 22,
  :TK_MAX_BUFFERS => 23,
  :TK_IPADDR => 24,
  :TK_UNPLUG_WATERMARK => 25,
  :TK_MAX_EPOCH_SIZE => 26,
  :TK_SNDBUF_SIZE => 27,
  :TK_RATE => 28,
  :TK_AL_EXTENTS => 29,
  :TK_WFC_TIMEOUT => 30,
  :TK_DEGR_WFC_TIMEOUT => 31,
  :TK_KO_COUNT => 32,
  :TK_ON_DISCONNECT => 33,
  :TK_DIALOG_REFRESH => 34,
  :TK_USAGE_COUNT => 35,
  :TK_COMMON => 36,
  :TK_HANDLERS => 37,
  :TK_FENCING => 38,
  :TK_USE_BMBV => 39,
  :TK_NO_DISK_BARRIER => 40,
  :TK_NO_DISK_FLUSHES => 41,
  :TK_NO_DISK_DRAIN => 42,
  :TK_MAX_BIO_BVECS => 43,
  :TK_PINT_TIMEOUT => 44,
  :TK_ALLOW_TWO_PRIMARIES => 45,
  :TK_CRAM_HMAC_ALG => 46,
  :TK_SHARED_SECRET => 47,
  :TK_AFTER_SB_0PRI => 48,
  :TK_AFTER_SB_1PRI => 49,
  :TK_AFTER_SB_2PRI => 50,
  :TK_DATA_INTEGRITY_ALG => 51,
  :TK_RR_CONFLICT => 52,
  :TK_NO_TCP_CORK => 53,
  :TK_CPU_MASK => 54,
  :TK_VERIFY_ALG => 55,
  :TK_AFTER => 56,
  :TK_FLEXIBLE_META_DISK => 57,
  :TK_PRI_ON_INCON_DEGR => 58,
  :TK_PRI_LOST_AFTER_SB => 59,
  :TK_PRI_LOST => 60,
  :TK_FENCE_PEER => 61,
  :TK_LOCAL_IO_ERROR => 62,
  :TK_SPLIT_BRAIN => 63,
  :TK_BEFORE_RESYNC_TARGET => 64,
  :TK_AFTER_RESYNC_TARGET => 65,
  :TK_WAIT_AFTER_SB => 66,
  :TK_BECOME_PRIMARY_ON => 67,
  :TK_IPV6ADDR => 68,
  :TK_IPV6 => 69,
  :TK_FLOATING => 70,
  :TK_STACK_ON_TOP_OF => 71,
  :TK_MINOR => 72,
  :TK_OPTIONS => 73,
  :TK_NO_DATA_ACCESSIBLE => 74,
  :TK_MD_FLUSHES => 75,
  :TK_NODE_ID => 76,
  :TK_CONNECTION_MESH => 77,
  :TK_HOSTS => 78,
  :TK_USE_RLE => 79,
  :TK_CONNECTION => 80,
  :TK_HOST => 81,
  :TK_PORT => 82,
  :TK_RESYNC_RATE => 83,
  :TK_QUORUM => 84,
  :TK_UDEV_ALWAYS_USE_VNR => 85,
  "{" => 86,
  "}" => 87,
  ";" => 88,
  ":" => 89 }

racc_nt_base = 90

racc_use_result_var = true

Racc_arg = [
  racc_action_table,
  racc_action_check,
  racc_action_default,
  racc_action_pointer,
  racc_goto_table,
  racc_goto_check,
  racc_goto_default,
  racc_goto_pointer,
  racc_nt_base,
  racc_reduce_table,
  racc_token_table,
  racc_shift_n,
  racc_reduce_n,
  racc_use_result_var ]

Racc_token_to_s_table = [
  "$end",
  "error",
  "TK_GLOBAL",
  "TK_RESOURCE",
  "TK_ON",
  "TK_NET",
  "TK_DISK_S",
  "TK_SYNCER",
  "TK_STARTUP",
  "TK_DISABLE_IP_VERIFICATION",
  "TK_PROTOCOL",
  "TK_ADDRESS",
  "TK_DISK",
  "TK_DEVICE",
  "TK_META_DISK",
  "TK_MINOR_COUNT",
  "TK_INTEGER",
  "TK_STRING",
  "TK_ON_IO_ERROR",
  "TK_SIZE",
  "TK_TIMEOUT",
  "TK_CONNECT_INT",
  "TK_PING_INT",
  "TK_MAX_BUFFERS",
  "TK_IPADDR",
  "TK_UNPLUG_WATERMARK",
  "TK_MAX_EPOCH_SIZE",
  "TK_SNDBUF_SIZE",
  "TK_RATE",
  "TK_AL_EXTENTS",
  "TK_WFC_TIMEOUT",
  "TK_DEGR_WFC_TIMEOUT",
  "TK_KO_COUNT",
  "TK_ON_DISCONNECT",
  "TK_DIALOG_REFRESH",
  "TK_USAGE_COUNT",
  "TK_COMMON",
  "TK_HANDLERS",
  "TK_FENCING",
  "TK_USE_BMBV",
  "TK_NO_DISK_BARRIER",
  "TK_NO_DISK_FLUSHES",
  "TK_NO_DISK_DRAIN",
  "TK_MAX_BIO_BVECS",
  "TK_PINT_TIMEOUT",
  "TK_ALLOW_TWO_PRIMARIES",
  "TK_CRAM_HMAC_ALG",
  "TK_SHARED_SECRET",
  "TK_AFTER_SB_0PRI",
  "TK_AFTER_SB_1PRI",
  "TK_AFTER_SB_2PRI",
  "TK_DATA_INTEGRITY_ALG",
  "TK_RR_CONFLICT",
  "TK_NO_TCP_CORK",
  "TK_CPU_MASK",
  "TK_VERIFY_ALG",
  "TK_AFTER",
  "TK_FLEXIBLE_META_DISK",
  "TK_PRI_ON_INCON_DEGR",
  "TK_PRI_LOST_AFTER_SB",
  "TK_PRI_LOST",
  "TK_FENCE_PEER",
  "TK_LOCAL_IO_ERROR",
  "TK_SPLIT_BRAIN",
  "TK_BEFORE_RESYNC_TARGET",
  "TK_AFTER_RESYNC_TARGET",
  "TK_WAIT_AFTER_SB",
  "TK_BECOME_PRIMARY_ON",
  "TK_IPV6ADDR",
  "TK_IPV6",
  "TK_FLOATING",
  "TK_STACK_ON_TOP_OF",
  "TK_MINOR",
  "TK_OPTIONS",
  "TK_NO_DATA_ACCESSIBLE",
  "TK_MD_FLUSHES",
  "TK_NODE_ID",
  "TK_CONNECTION_MESH",
  "TK_HOSTS",
  "TK_USE_RLE",
  "TK_CONNECTION",
  "TK_HOST",
  "TK_PORT",
  "TK_RESYNC_RATE",
  "TK_QUORUM",
  "TK_UDEV_ALWAYS_USE_VNR",
  "\"{\"",
  "\"}\"",
  "\";\"",
  "\":\"",
  "$start",
  "config",
  "global_sec",
  "common_sec",
  "resources",
  "glob_stmts",
  "glob_stmt",
  "common_stmts",
  "common_stmt",
  "disk_stmts",
  "net_stmts",
  "sync_stmts",
  "startup_stmts",
  "options_stmts",
  "handlers_stmts",
  "resource",
  "resource_name",
  "res_stmts",
  "res_stmt",
  "section",
  "minor_stmt",
  "meta_disk_and_index",
  "ip_and_port",
  "hostname",
  "host_stmts",
  "floating_stmts",
  "stack_on_top_of_stmts",
  "conn_mesh_stmts",
  "conn_stmts",
  "disk_stmt",
  "conn_mesh_stmt",
  "conn_mesh_section",
  "conn_stmt",
  "net_stmt",
  "sync_stmt",
  "floating_stmt",
  "flexible_meta_disk",
  "stack_on_top_of_stmt",
  "host_stmt",
  "handlers_stmt",
  "startup_stmt",
  "options_stmt" ]

Racc_debug_parser = true

##### State transition tables end #####

# reduce 0 omitted

module_eval(<<'.,.,', 'drbd.rb.yy', 6)
  def _reduce_1(val, _values, result)
     $drbd['global'] = val[0]; $drbd['common'] = val[1]; $drbd['resources'] = val[2]; return $drbd; 
    result
  end
.,.,

module_eval(<<'.,.,', 'drbd.rb.yy', 8)
  def _reduce_2(val, _values, result)
     return {}; 
    result
  end
.,.,

module_eval(<<'.,.,', 'drbd.rb.yy', 9)
  def _reduce_3(val, _values, result)
     return val[2]; 
    result
  end
.,.,

module_eval(<<'.,.,', 'drbd.rb.yy', 10)
  def _reduce_4(val, _values, result)
     return {}; 
    result
  end
.,.,

module_eval(<<'.,.,', 'drbd.rb.yy', 11)
  def _reduce_5(val, _values, result)
     nk = val[1][0]; val[0][nk] = val[1][1]; return val[0]; 
    result
  end
.,.,

module_eval(<<'.,.,', 'drbd.rb.yy', 12)
  def _reduce_6(val, _values, result)
     return ["#{val[0]}", val[1]]; 
    result
  end
.,.,

module_eval(<<'.,.,', 'drbd.rb.yy', 13)
  def _reduce_7(val, _values, result)
     return ["#{val[0]}", true]; 
    result
  end
.,.,

module_eval(<<'.,.,', 'drbd.rb.yy', 14)
  def _reduce_8(val, _values, result)
     return ["#{val[0]}", true]; 
    result
  end
.,.,

module_eval(<<'.,.,', 'drbd.rb.yy', 15)
  def _reduce_9(val, _values, result)
     return ["#{val[0]}", val[1]]; 
    result
  end
.,.,

module_eval(<<'.,.,', 'drbd.rb.yy', 16)
  def _reduce_10(val, _values, result)
     return ["#{val[0]}", val[1]];
    result
  end
.,.,

module_eval(<<'.,.,', 'drbd.rb.yy', 18)
  def _reduce_11(val, _values, result)
     return {}; 
    result
  end
.,.,

module_eval(<<'.,.,', 'drbd.rb.yy', 19)
  def _reduce_12(val, _values, result)
     return val[2]; 
    result
  end
.,.,

module_eval(<<'.,.,', 'drbd.rb.yy', 20)
  def _reduce_13(val, _values, result)
     return {}; 
    result
  end
.,.,

module_eval(<<'.,.,', 'drbd.rb.yy', 21)
  def _reduce_14(val, _values, result)
     nk = val[1][0]; val[0][nk] = val[1][1]; return val[0]; 
    result
  end
.,.,

module_eval(<<'.,.,', 'drbd.rb.yy', 23)
  def _reduce_15(val, _values, result)
     return ["#{val[0]}", val[1]]; 
    result
  end
.,.,

module_eval(<<'.,.,', 'drbd.rb.yy', 24)
  def _reduce_16(val, _values, result)
     return ["#{val[0]}", val[2]]; 
    result
  end
.,.,

module_eval(<<'.,.,', 'drbd.rb.yy', 25)
  def _reduce_17(val, _values, result)
     return ["#{val[0]}", val[2]]; 
    result
  end
.,.,

module_eval(<<'.,.,', 'drbd.rb.yy', 26)
  def _reduce_18(val, _values, result)
     return ["#{val[0]}", val[2]]; 
    result
  end
.,.,

module_eval(<<'.,.,', 'drbd.rb.yy', 27)
  def _reduce_19(val, _values, result)
     return ["#{val[0]}", val[2]]; 
    result
  end
.,.,

module_eval(<<'.,.,', 'drbd.rb.yy', 28)
  def _reduce_20(val, _values, result)
     return ["#{val[0]}", val[2]]; 
    result
  end
.,.,

module_eval(<<'.,.,', 'drbd.rb.yy', 29)
  def _reduce_21(val, _values, result)
     return ["#{val[0]}", val[1]]; 
    result
  end
.,.,

module_eval(<<'.,.,', 'drbd.rb.yy', 31)
  def _reduce_22(val, _values, result)
     return {}; 
    result
  end
.,.,

module_eval(<<'.,.,', 'drbd.rb.yy', 32)
  def _reduce_23(val, _values, result)
     nk = val[1][0]; val[0][nk] = val[1][1]; return val[0]; 
    result
  end
.,.,

module_eval(<<'.,.,', 'drbd.rb.yy', 34)
  def _reduce_24(val, _values, result)
     return ["#{val[1]}", val[3]]; 
    result
  end
.,.,

module_eval(<<'.,.,', 'drbd.rb.yy', 36)
  def _reduce_25(val, _values, result)
     return val[0]; 
    result
  end
.,.,

module_eval(<<'.,.,', 'drbd.rb.yy', 38)
  def _reduce_26(val, _values, result)
     return {}; 
    result
  end
.,.,

module_eval(<<'.,.,', 'drbd.rb.yy', 39)
  def _reduce_27(val, _values, result)
     nk = val[1][0]; 
			                      if nk == "floating" then
								    if (!val[0]["floating"]) then val[0]["floating"] = {}; end
									val[0]["floating"][val[1][1]] = {}
								  else
			                        val[0][nk] = val[1][1]; 
								  end
								  return val[0]; 
    result
  end
.,.,

module_eval(<<'.,.,', 'drbd.rb.yy', 47)
  def _reduce_28(val, _values, result)
    nk = val[1][0]; 
                                  if nk == "on" then 
				                      if (!val[0]["on"]) then val[0]["on"] = {}; end
                                      val[0]["on"][val[1][1]] = val[1][2];  
								  elsif nk == "floating" then
									  if (!val[0]["floating"]) then val[0]["floating"] = {}; end
									  val[0]["floating"][val[1][1]] = val[1][2];
								  elsif nk == "stacked-on-top-of" then
									  if (!val[0]["stacked-on-top-of"]) then val[0]["stacked-on-top-of"] = {}; end
									  val[0]["stacked-on-top-of"][val[1][1]] = val[1][2]
                                  else
                                      val[0][nk] = val[1][1]; 
                                  end
                                  return val[0]; 
    result
  end
.,.,

module_eval(<<'.,.,', 'drbd.rb.yy', 62)
  def _reduce_29(val, _values, result)
     return ["#{val[0]}", val[1]]; 
    result
  end
.,.,

module_eval(<<'.,.,', 'drbd.rb.yy', 63)
  def _reduce_30(val, _values, result)
     return ["#{val[0]}", "#{val[1]} #{val[2]}"]; 
    result
  end
.,.,

module_eval(<<'.,.,', 'drbd.rb.yy', 64)
  def _reduce_31(val, _values, result)
     return ["#{val[0]}", val[1]]; 
    result
  end
.,.,

module_eval(<<'.,.,', 'drbd.rb.yy', 65)
  def _reduce_32(val, _values, result)
     return ["#{val[0]}", val[1]]; 
    result
  end
.,.,

module_eval(<<'.,.,', 'drbd.rb.yy', 66)
  def _reduce_33(val, _values, result)
     return ["#{val[0]}", val[1]]; 
    result
  end
.,.,

module_eval(<<'.,.,', 'drbd.rb.yy', 68)
  def _reduce_34(val, _values, result)
     return ""; 
    result
  end
.,.,

module_eval(<<'.,.,', 'drbd.rb.yy', 69)
  def _reduce_35(val, _values, result)
     return "minor #{val[1]}"; 
    result
  end
.,.,

module_eval(<<'.,.,', 'drbd.rb.yy', 71)
  def _reduce_36(val, _values, result)
     return ["#{val[0]}", val[1]]; 
    result
  end
.,.,

module_eval(<<'.,.,', 'drbd.rb.yy', 72)
  def _reduce_37(val, _values, result)
     return ["#{val[0]}", val[2]]; 
    result
  end
.,.,

module_eval(<<'.,.,', 'drbd.rb.yy', 73)
  def _reduce_38(val, _values, result)
     return ["#{val[0]}", val[2]]; 
    result
  end
.,.,

module_eval(<<'.,.,', 'drbd.rb.yy', 74)
  def _reduce_39(val, _values, result)
     return ["#{val[0]}", val[2]]; 
    result
  end
.,.,

module_eval(<<'.,.,', 'drbd.rb.yy', 75)
  def _reduce_40(val, _values, result)
     return ["#{val[0]}", val[2]]; 
    result
  end
.,.,

module_eval(<<'.,.,', 'drbd.rb.yy', 76)
  def _reduce_41(val, _values, result)
     return ["#{val[0]}", val[2]]; 
    result
  end
.,.,

module_eval(<<'.,.,', 'drbd.rb.yy', 77)
  def _reduce_42(val, _values, result)
     return ["#{val[0]}", "#{val[1]}", val[3]]; 
    result
  end
.,.,

module_eval(<<'.,.,', 'drbd.rb.yy', 78)
  def _reduce_43(val, _values, result)
     return ["#{val[0]}", "#{val[1]}", val[3]]; 
    result
  end
.,.,

module_eval(<<'.,.,', 'drbd.rb.yy', 79)
  def _reduce_44(val, _values, result)
     return ["#{val[0]}", "#{val[1]}", val[3]]; 
    result
  end
.,.,

module_eval(<<'.,.,', 'drbd.rb.yy', 80)
  def _reduce_45(val, _values, result)
     return ["#{val[0]}", val[2]]; 
    result
  end
.,.,

module_eval(<<'.,.,', 'drbd.rb.yy', 81)
  def _reduce_46(val, _values, result)
     return ["#{val[0]}", val[2]]; 
    result
  end
.,.,

module_eval(<<'.,.,', 'drbd.rb.yy', 83)
  def _reduce_47(val, _values, result)
     return val[0]; 
    result
  end
.,.,

module_eval(<<'.,.,', 'drbd.rb.yy', 85)
  def _reduce_48(val, _values, result)
     return {}; 
    result
  end
.,.,

module_eval(<<'.,.,', 'drbd.rb.yy', 86)
  def _reduce_49(val, _values, result)
     nk = val[1][0]; val[0][nk] = val[1][1]; return val[0]; 
    result
  end
.,.,

module_eval(<<'.,.,', 'drbd.rb.yy', 88)
  def _reduce_50(val, _values, result)
     return ["#{val[0]}", val[1]]; 
    result
  end
.,.,

module_eval(<<'.,.,', 'drbd.rb.yy', 89)
  def _reduce_51(val, _values, result)
     return ["#{val[0]}", val[1]]; 
    result
  end
.,.,

module_eval(<<'.,.,', 'drbd.rb.yy', 90)
  def _reduce_52(val, _values, result)
     return ["#{val[0]}", val[1]]; 
    result
  end
.,.,

module_eval(<<'.,.,', 'drbd.rb.yy', 91)
  def _reduce_53(val, _values, result)
     return ["#{val[0]}", val[1]]; 
    result
  end
.,.,

module_eval(<<'.,.,', 'drbd.rb.yy', 92)
  def _reduce_54(val, _values, result)
     return ["#{val[0]}", val[1]]; 
    result
  end
.,.,

module_eval(<<'.,.,', 'drbd.rb.yy', 93)
  def _reduce_55(val, _values, result)
     return ["#{val[0]}", val[1]]; 
    result
  end
.,.,

module_eval(<<'.,.,', 'drbd.rb.yy', 94)
  def _reduce_56(val, _values, result)
     return ["#{val[0]}", val[1]]; 
    result
  end
.,.,

module_eval(<<'.,.,', 'drbd.rb.yy', 95)
  def _reduce_57(val, _values, result)
     return ["#{val[0]}", val[1]]; 
    result
  end
.,.,

module_eval(<<'.,.,', 'drbd.rb.yy', 96)
  def _reduce_58(val, _values, result)
     return ["#{val[0]}", val[1]]; 
    result
  end
.,.,

module_eval(<<'.,.,', 'drbd.rb.yy', 97)
  def _reduce_59(val, _values, result)
     return ["#{val[0]}", val[1]]; 
    result
  end
.,.,

module_eval(<<'.,.,', 'drbd.rb.yy', 98)
  def _reduce_60(val, _values, result)
     return ["#{val[0]}", val[1]]; 
    result
  end
.,.,

module_eval(<<'.,.,', 'drbd.rb.yy', 101)
  def _reduce_61(val, _values, result)
     return {}; 
    result
  end
.,.,

module_eval(<<'.,.,', 'drbd.rb.yy', 102)
  def _reduce_62(val, _values, result)
     nk = val[1][0]; val[0][nk] = val[1][1]; return val[0]; 
    result
  end
.,.,

module_eval(<<'.,.,', 'drbd.rb.yy', 103)
  def _reduce_63(val, _values, result)
     nk = val[1][0]; val[0][nk] = val[1][1]; return val[0]; 
    result
  end
.,.,

module_eval(<<'.,.,', 'drbd.rb.yy', 106)
  def _reduce_64(val, _values, result)
     return ["#{val[0]}", "none"]; 
    result
  end
.,.,

module_eval(<<'.,.,', 'drbd.rb.yy', 108)
  def _reduce_65(val, _values, result)
     return ["#{val[0]}", val[2]]; 
    result
  end
.,.,

module_eval(<<'.,.,', 'drbd.rb.yy', 111)
  def _reduce_66(val, _values, result)
     return {}; 
    result
  end
.,.,

module_eval(<<'.,.,', 'drbd.rb.yy', 112)
  def _reduce_67(val, _values, result)
     nk = val[1][0]; val[0][nk] = val[1][1]; return val[0]; 
    result
  end
.,.,

module_eval(<<'.,.,', 'drbd.rb.yy', 114)
  def _reduce_68(val, _values, result)
     return ["#{val[1]}", val[3]]; 
    result
  end
.,.,

module_eval(<<'.,.,', 'drbd.rb.yy', 115)
  def _reduce_69(val, _values, result)
     return ["#{val[1]}", "#{val[3]}:#{val[5]}"]; 
    result
  end
.,.,

module_eval(<<'.,.,', 'drbd.rb.yy', 117)
  def _reduce_70(val, _values, result)
     return {}; 
    result
  end
.,.,

module_eval(<<'.,.,', 'drbd.rb.yy', 118)
  def _reduce_71(val, _values, result)
     nk = val[1][0]; val[0][nk] = val[1][1]; return val[0]; 
    result
  end
.,.,

module_eval(<<'.,.,', 'drbd.rb.yy', 120)
  def _reduce_72(val, _values, result)
     return ["#{val[0]}", val[1]]; 
    result
  end
.,.,

module_eval(<<'.,.,', 'drbd.rb.yy', 121)
  def _reduce_73(val, _values, result)
     return ["#{val[0]}", val[1]]; 
    result
  end
.,.,

module_eval(<<'.,.,', 'drbd.rb.yy', 122)
  def _reduce_74(val, _values, result)
     return ["#{val[0]}", val[1]]; 
    result
  end
.,.,

module_eval(<<'.,.,', 'drbd.rb.yy', 123)
  def _reduce_75(val, _values, result)
     return ["#{val[0]}", val[1]]; 
    result
  end
.,.,

module_eval(<<'.,.,', 'drbd.rb.yy', 124)
  def _reduce_76(val, _values, result)
     return ["#{val[0]}", val[1]]; 
    result
  end
.,.,

module_eval(<<'.,.,', 'drbd.rb.yy', 125)
  def _reduce_77(val, _values, result)
     return ["#{val[0]}", val[1]]; 
    result
  end
.,.,

module_eval(<<'.,.,', 'drbd.rb.yy', 126)
  def _reduce_78(val, _values, result)
     return ["#{val[0]}", val[1]]; 
    result
  end
.,.,

module_eval(<<'.,.,', 'drbd.rb.yy', 127)
  def _reduce_79(val, _values, result)
     return ["#{val[0]}", val[1]]; 
    result
  end
.,.,

module_eval(<<'.,.,', 'drbd.rb.yy', 128)
  def _reduce_80(val, _values, result)
     return ["#{val[0]}", val[1]]; 
    result
  end
.,.,

module_eval(<<'.,.,', 'drbd.rb.yy', 129)
  def _reduce_81(val, _values, result)
     return ["#{val[0]}", val[1]]; 
    result
  end
.,.,

module_eval(<<'.,.,', 'drbd.rb.yy', 130)
  def _reduce_82(val, _values, result)
     return ["#{val[0]}", val[1]]; 
    result
  end
.,.,

module_eval(<<'.,.,', 'drbd.rb.yy', 131)
  def _reduce_83(val, _values, result)
     return ["#{val[0]}", val[1]]; 
    result
  end
.,.,

module_eval(<<'.,.,', 'drbd.rb.yy', 132)
  def _reduce_84(val, _values, result)
     return ["#{val[0]}", val[1]]; 
    result
  end
.,.,

module_eval(<<'.,.,', 'drbd.rb.yy', 133)
  def _reduce_85(val, _values, result)
     return ["#{val[0]}", val[1]]; 
    result
  end
.,.,

module_eval(<<'.,.,', 'drbd.rb.yy', 134)
  def _reduce_86(val, _values, result)
     return ["#{val[0]}", val[1]]; 
    result
  end
.,.,

module_eval(<<'.,.,', 'drbd.rb.yy', 135)
  def _reduce_87(val, _values, result)
     return ["#{val[0]}", val[1]]; 
    result
  end
.,.,

module_eval(<<'.,.,', 'drbd.rb.yy', 136)
  def _reduce_88(val, _values, result)
     return ["#{val[0]}", val[1]]; 
    result
  end
.,.,

module_eval(<<'.,.,', 'drbd.rb.yy', 137)
  def _reduce_89(val, _values, result)
     return ["#{val[0]}", true]; 
    result
  end
.,.,

module_eval(<<'.,.,', 'drbd.rb.yy', 138)
  def _reduce_90(val, _values, result)
     return ["#{val[0]}", val[1]]; 
    result
  end
.,.,

module_eval(<<'.,.,', 'drbd.rb.yy', 139)
  def _reduce_91(val, _values, result)
     return ["#{val[0]}", val[1]]; 
    result
  end
.,.,

module_eval(<<'.,.,', 'drbd.rb.yy', 140)
  def _reduce_92(val, _values, result)
     return ["#{val[0]}", val[1]]; 
    result
  end
.,.,

module_eval(<<'.,.,', 'drbd.rb.yy', 142)
  def _reduce_93(val, _values, result)
     return {}; 
    result
  end
.,.,

module_eval(<<'.,.,', 'drbd.rb.yy', 143)
  def _reduce_94(val, _values, result)
     nk = val[1][0]; val[0][nk] = val[1][1]; return val[0]; 
    result
  end
.,.,

module_eval(<<'.,.,', 'drbd.rb.yy', 145)
  def _reduce_95(val, _values, result)
     return ["#{val[0]}", val[1]]; 
    result
  end
.,.,

module_eval(<<'.,.,', 'drbd.rb.yy', 146)
  def _reduce_96(val, _values, result)
     return ["#{val[0]}", vavl[1]]; 
    result
  end
.,.,

module_eval(<<'.,.,', 'drbd.rb.yy', 147)
  def _reduce_97(val, _values, result)
     return ["#{val[0]}", val[1]]; 
    result
  end
.,.,

module_eval(<<'.,.,', 'drbd.rb.yy', 148)
  def _reduce_98(val, _values, result)
     return ["#{val[0]}", val[1]]; 
    result
  end
.,.,

module_eval(<<'.,.,', 'drbd.rb.yy', 149)
  def _reduce_99(val, _values, result)
     return ["#{val[0]}", val[1]]; 
    result
  end
.,.,

module_eval(<<'.,.,', 'drbd.rb.yy', 151)
  def _reduce_100(val, _values, result)
     return {}; 
    result
  end
.,.,

module_eval(<<'.,.,', 'drbd.rb.yy', 152)
  def _reduce_101(val, _values, result)
     nk = val[1][0]; val[0][nk] = val[1][1]; return val[0]; 
    result
  end
.,.,

module_eval(<<'.,.,', 'drbd.rb.yy', 154)
  def _reduce_102(val, _values, result)
     return ["#{val[0]}", val[1]]; 
    result
  end
.,.,

module_eval(<<'.,.,', 'drbd.rb.yy', 155)
  def _reduce_103(val, _values, result)
     return ["#{val[0]}", val[1]]; 
    result
  end
.,.,

module_eval(<<'.,.,', 'drbd.rb.yy', 156)
  def _reduce_104(val, _values, result)
     return ["#{val[0]}", val[1]]; 
    result
  end
.,.,

module_eval(<<'.,.,', 'drbd.rb.yy', 157)
  def _reduce_105(val, _values, result)
     return ["#{val[0]}", val[1]]; 
    result
  end
.,.,

module_eval(<<'.,.,', 'drbd.rb.yy', 159)
  def _reduce_106(val, _values, result)
     return {}; 
    result
  end
.,.,

module_eval(<<'.,.,', 'drbd.rb.yy', 160)
  def _reduce_107(val, _values, result)
     nk = val[1][0]; val[0][nk] = val[1][1]; return val[0]; 
    result
  end
.,.,

module_eval(<<'.,.,', 'drbd.rb.yy', 162)
  def _reduce_108(val, _values, result)
     return ["#{val[0]}", val[1]]; 
    result
  end
.,.,

module_eval(<<'.,.,', 'drbd.rb.yy', 163)
  def _reduce_109(val, _values, result)
     return ["#{val[0]}", val[1]]; 
    result
  end
.,.,

module_eval(<<'.,.,', 'drbd.rb.yy', 165)
  def _reduce_110(val, _values, result)
     return {}; 
    result
  end
.,.,

module_eval(<<'.,.,', 'drbd.rb.yy', 166)
  def _reduce_111(val, _values, result)
     nk = val[1][0]; val[0][nk] = val[1][1]; return val[0]; 
    result
  end
.,.,

module_eval(<<'.,.,', 'drbd.rb.yy', 168)
  def _reduce_112(val, _values, result)
     return ["#{val[0]}", val[1]]; 
    result
  end
.,.,

module_eval(<<'.,.,', 'drbd.rb.yy', 169)
  def _reduce_113(val, _values, result)
     return ["#{val[0]}", "#{val[1]} #{val[2]}"]; 
    result
  end
.,.,

module_eval(<<'.,.,', 'drbd.rb.yy', 170)
  def _reduce_114(val, _values, result)
     return ["#{val[0]}", val[1]]; 
    result
  end
.,.,

module_eval(<<'.,.,', 'drbd.rb.yy', 171)
  def _reduce_115(val, _values, result)
     return ["#{val[0]}", val[1]]; 
    result
  end
.,.,

module_eval(<<'.,.,', 'drbd.rb.yy', 172)
  def _reduce_116(val, _values, result)
     return ["#{val[0]}", val[1]]; 
    result
  end
.,.,

module_eval(<<'.,.,', 'drbd.rb.yy', 173)
  def _reduce_117(val, _values, result)
     return ["#{val[0]}", val[1]]; 
    result
  end
.,.,

module_eval(<<'.,.,', 'drbd.rb.yy', 175)
  def _reduce_118(val, _values, result)
     return {}; 
    result
  end
.,.,

module_eval(<<'.,.,', 'drbd.rb.yy', 176)
  def _reduce_119(val, _values, result)
     nk = val[1][0]; val[0][nk] = val[1][1]; return val[0]; 
    result
  end
.,.,

module_eval(<<'.,.,', 'drbd.rb.yy', 178)
  def _reduce_120(val, _values, result)
     return ["#{val[0]}", val[1]]; 
    result
  end
.,.,

module_eval(<<'.,.,', 'drbd.rb.yy', 179)
  def _reduce_121(val, _values, result)
     return ["#{val[0]}", val[1]]; 
    result
  end
.,.,

module_eval(<<'.,.,', 'drbd.rb.yy', 180)
  def _reduce_122(val, _values, result)
     return ["#{val[0]}", val[1]]; 
    result
  end
.,.,

module_eval(<<'.,.,', 'drbd.rb.yy', 181)
  def _reduce_123(val, _values, result)
     return ["#{val[0]}", val[1]]; 
    result
  end
.,.,

module_eval(<<'.,.,', 'drbd.rb.yy', 182)
  def _reduce_124(val, _values, result)
     return ["#{val[0]}", val[1]]; 
    result
  end
.,.,

module_eval(<<'.,.,', 'drbd.rb.yy', 183)
  def _reduce_125(val, _values, result)
     return ["#{val[0]}", val[1]]; 
    result
  end
.,.,

module_eval(<<'.,.,', 'drbd.rb.yy', 184)
  def _reduce_126(val, _values, result)
     return ["#{val[0]}", val[1]]; 
    result
  end
.,.,

module_eval(<<'.,.,', 'drbd.rb.yy', 185)
  def _reduce_127(val, _values, result)
     return ["#{val[0]}", val[1]]; 
    result
  end
.,.,

module_eval(<<'.,.,', 'drbd.rb.yy', 187)
  def _reduce_128(val, _values, result)
     return "#{val[0]}:#{val[2]}"; 
    result
  end
.,.,

module_eval(<<'.,.,', 'drbd.rb.yy', 188)
  def _reduce_129(val, _values, result)
     return "#{val[0]} #{val[1]}:#{val[3]}"; 
    result
  end
.,.,

module_eval(<<'.,.,', 'drbd.rb.yy', 189)
  def _reduce_130(val, _values, result)
     return "#{val[0]} #{val[1]}:#{val[3]}"; 
    result
  end
.,.,

module_eval(<<'.,.,', 'drbd.rb.yy', 190)
  def _reduce_131(val, _values, result)
     return "#{val[0]}"; 
    result
  end
.,.,

module_eval(<<'.,.,', 'drbd.rb.yy', 192)
  def _reduce_132(val, _values, result)
     return "#{val[0]} #{val[1]}"; 
    result
  end
.,.,

module_eval(<<'.,.,', 'drbd.rb.yy', 193)
  def _reduce_133(val, _values, result)
     return val[0]; 
    result
  end
.,.,

module_eval(<<'.,.,', 'drbd.rb.yy', 195)
  def _reduce_134(val, _values, result)
     return val[0]; 
    result
  end
.,.,

module_eval(<<'.,.,', 'drbd.rb.yy', 197)
  def _reduce_135(val, _values, result)
     return {}; 
    result
  end
.,.,

module_eval(<<'.,.,', 'drbd.rb.yy', 198)
  def _reduce_136(val, _values, result)
     nk = val[1][0]; val[0][nk] = val[1][1]; return val[0]; 
    result
  end
.,.,

module_eval(<<'.,.,', 'drbd.rb.yy', 200)
  def _reduce_137(val, _values, result)
     return ["#{val[0]}", val[1]]; 
    result
  end
.,.,

module_eval(<<'.,.,', 'drbd.rb.yy', 201)
  def _reduce_138(val, _values, result)
     return ["#{val[0]}", true]; 
    result
  end
.,.,

module_eval(<<'.,.,', 'drbd.rb.yy', 202)
  def _reduce_139(val, _values, result)
     return ["#{val[0]}", val[1]]; 
    result
  end
.,.,

module_eval(<<'.,.,', 'drbd.rb.yy', 203)
  def _reduce_140(val, _values, result)
     return ["#{val[0]}", val[1]]; 
    result
  end
.,.,

module_eval(<<'.,.,', 'drbd.rb.yy', 205)
  def _reduce_141(val, _values, result)
     return {}; 
    result
  end
.,.,

module_eval(<<'.,.,', 'drbd.rb.yy', 206)
  def _reduce_142(val, _values, result)
     nk = val[1][0]; val[0][nk] = val[1][1]; return val[0]; 
    result
  end
.,.,

module_eval(<<'.,.,', 'drbd.rb.yy', 208)
  def _reduce_143(val, _values, result)
     return ["#{val[0]}", val[1]]; 
    result
  end
.,.,

module_eval(<<'.,.,', 'drbd.rb.yy', 209)
  def _reduce_144(val, _values, result)
     return ["#{val[0]}", val[1]]; 
    result
  end
.,.,

module_eval(<<'.,.,', 'drbd.rb.yy', 210)
  def _reduce_145(val, _values, result)
     return ["#{val[0]}", val[1]]; 
    result
  end
.,.,

def _reduce_none(val, _values, result)
  val[0]
end

end   # class DrbdParser

dp = DrbdParser.new

$drbdcfg = "/etc/drbd.conf"
$configstr = ""
in_skip = false

if !File.exist?($drbdcfg+".YaST2prepare")
	file = File.open($drbdcfg+".YaST2prepare", "w")
        file.close
end


File.open($drbdcfg+".YaST2prepare", "r") do |file|
   file.each_line do |line| 
      line = line.gsub(/#.*$/, '').chomp
      if (line =~ /^skip\s+/) then in_skip = true end
      if (line =~ /^\}/ && in_skip == true)
      	 in_skip = false 
         line = ""
      end
      if (! in_skip )
         $configstr += line.gsub(/#.*$/, '').chomp
      end
   end
end

dp.parse($configstr)



$debug = 0
def errlog (str)
    if $debug == 1
	$stderr.puts str
    end
end	

def convertYcp (str)
    return str.gsub(/"/, '\"')
end

def doList (path)
  if path.length == 0
    puts "[ \"global\", \"resources\", \"common\" ]"
    return
  end

  res = $drbd
  begin
    path.each do |it|
	  errlog it.to_s
	  errlog "xxx"+res.to_s
	  if res.has_key?(it.chomp)
		res = res[it.chomp]
      else
	    errlog "quit as not key. " + it
        puts "false"
        return
      end
    end

	errlog "xxx"+res.to_s
	errlog "xxx"+$drbd.to_s

	if res == nil
		puts "false"
		return
	end

    if res.length == 0
       str = "[]"
    else
       str = "[ "
       res.keys.each do |key|
          str = str + "\"" + convertYcp(key.to_s) + "\", "
       end
       str = str.chop.chop + " ]"
    end
	puts str
    return

  rescue NoMethodError
    errlog "quit as exceptions happends."
    puts "false"
    return
  end
end

def doRead(path)
  if path.length == 0
    puts "false"
    return
  end

  res = $drbd
  begin
    path.each do |it|
      if res.has_key?(it.chomp)
        res = res[it.chomp]
      else
        puts "false"
        return
      end
    end

    puts '"'+convertYcp(res.to_s)+'"'
    return 
  rescue NoMethodError
    puts "false"
    return
  end

end

def stripQuote(path)
  path.each_index do |it|
    if ! path[it] == "" and path[it][0] == '"'
	  path[it]=path[it][1..-2]
	end
  end
  return path
end

def doWrite(path, args)
  errlog "write path is "+path.to_s
  errlog "write args is "+args

  if path.length == 0
    commitChange()
    puts "true"
    return
  end

  path.each_index do |it|
    errlog "found "+path[it]
    if path[it] != "" and path[it][0] == '"'
	  errlog path[it]+" is changed to "+path[it].chomp()[1..-2]
      path[it]=path[it].chomp()[1..-2]
    end
	if path[it] != "" and path[it][0..1] == "\\\""
		errlog path[it]+" is changed to "+path[it].chomp()[1..-3]+"\""
		path[it]=path[it].chomp()[1..-3]+"\""
	end
  end

  if args[0..1] == "\\\""
    errlog "args is changed to " + args[1..-3] + "\""
	args = args.chomp()[1..-3]+"\""
  end

  errlog path.to_s

  if path.length < 2
    puts "false"
    return
  end

  if path[-2].chomp == "on"
    errlog "prepare to change the node name"
    res = $drbd
    res_b = res
    begin
      path.each do |it|
        if res.has_key?(it.chomp)
          res_b = res
          res = res[it.chomp]
        else
		  puts "false"
		  return
        end
      end

      errlog "found the node name, change it"
	  if args != "nil"
        res_b.delete(args)
        res_b[args] = res_b[path[-1].chomp]
        res_b.delete(path[-1].chomp)
	  else
	    res_b.delete(path[-1].chomp)
	  end
      writeFile
      puts "true"
      return
    rescue
      puts "false"
      return
    end

  elsif path[-2].chomp == "resources"
    errlog "prepare to change the resource name"
    if $drbd["resources"].has_key?(path[-1].chomp)
	  if args != "nil"
        $drbd["resources"].delete(args)
        $drbd["resources"][args] = $drbd["resources"][path[-1].chomp]
        $drbd["resources"].delete(path[-1].chomp)
	  else
	    $drbd["resources"].delete(path[-1].chomp)
      end	  
      writeFile
      puts "true"
      return
    end

  else
    errlog "prepare to change the attribute"
    res = $drbd
    res_b = res
    begin
      path.each do |it|
        if res.has_key?(it.chomp)
          res_b = res
          res = res[it.chomp]
        else
		  res[it.chomp] = Hash.new()
		  res_b = res
		  res = res[it.chomp]
        end
      end

      errlog "found the attribute name, change it"
	  if args != "nil"
        res_b[path[-1].chomp] = args
	  else
        res_b.delete(path[-1].chomp)
      end	
      writeFile
      puts "true"
      return
    rescue
      puts "false"
      return
    end
  end
  puts "nil"
end

def writeFile()
  errlog $drbd.to_s	
  errlog "start to writeFile"
  File.open($drbdcfg+".YaST2new", "w") do |file|
    file.puts "# YaST2 created seperated configuration file"
    file.puts "include \"/etc/drbd.d/global_common.conf\";"
	File.open("/etc/drbd.d/global_common.conf.YaST2new", "w") do |gccfile|

    if $drbd.has_key?("global")
      gccfile.puts "global {"
      $drbd["global"].each_key do |key|
	    if key == "disable-ip-verification" or key == "udev-always-use-vnr"
		  if $drbd["global"][key] == "" or $drbd["global"][key] == "true"
		    gccfile.puts "   "+key+";"
		  end
		else
          gccfile.puts "   "+key+"\t"+$drbd["global"][key]+";"
		end
      end
      gccfile.puts "}"
    end # <-- has global

	if $drbd.has_key?("common")
		gccfile.puts "common {"

        if $drbd["common"].has_key?("disk_s")
          gccfile.puts "   disk {"
          $drbd["common"]["disk_s"].each_key do |key|
            gccfile.puts "      "+key+"\t"+$drbd["common"]["disk_s"][key]+";"
          end
          gccfile.puts "   }"
        end

        if $drbd["common"].has_key?("syncer")
          gccfile.puts "   syncer {"
          $drbd["common"]["syncer"].each_key do |key|
            gccfile.puts "      "+key+"\t"+$drbd["common"]["syncer"][key]+";"
          end
          gccfile.puts "   }"
        end

        if $drbd["common"].has_key?("net")
          gccfile.puts "   net {"
          $drbd["common"]["net"].each_key do |key|
            gccfile.puts "      "+key+"\t"+$drbd["common"]["net"][key]+";"
          end
          gccfile.puts "   }"
        end

        if $drbd["common"].has_key?("startup")
          gccfile.puts "   startup {"
          $drbd["common"]["startup"].each_key do |key|
            gccfile.puts "      "+key+"\t"+$drbd["common"]["startup"][key]+";"
          end
          gccfile.puts "   }"
        end

        if $drbd["common"].has_key?("options")
          gccfile.puts "   options {"
          $drbd["common"]["options"].each_key do |key|
            gccfile.puts "      "+key+"\t"+$drbd["common"]["options"][key]+";"
          end
          gccfile.puts "   }"
        end

        if $drbd["common"].has_key?("handlers")
          gccfile.puts "   handlers {"
          $drbd["common"]["handlers"].each_key do |key|
            gccfile.puts "      "+key+"\t"+$drbd["common"]["handlers"][key]+";"
          end
          gccfile.puts "   }"
        end

		gccfile.puts "}"
	end # <-- has common

	end # <-- end of File.open(gccfile)

    if $drbd.has_key?("resources")
      $drbd["resources"].each_key do |res_name|

	    file.puts "include \"/etc/drbd.d/"+res_name+".res\";" # <-- put the config of resource into a split file.

		File.open("/etc/drbd.d/"+res_name+".res.YaST2new", "w") do |resfile|

        resfile.puts "resource "+res_name+" {"

        if $drbd["resources"][res_name].has_key?("protocol")
          resfile.puts "   protocol\t"+$drbd["resources"][res_name]["protocol"]+";"
        end
		if $drbd["resources"][res_name].has_key?("device")
          resfile.puts "   device\t"+$drbd["resources"][res_name]["device"]+";"
        end
		if $drbd["resources"][res_name].has_key?("disk")
          resfile.puts "   disk\t"+$drbd["resources"][res_name]["disk"]+";"
        end
		if $drbd["resources"][res_name].has_key?("meta-disk")
          resfile.puts "   meta-disk\t"+$drbd["resources"][res_name]["meta-disk"]+";"
        end
        if $drbd["resources"][res_name].has_key?("node-id")
          resfile.puts "   node-id\t"+$drbd["resources"][res_name]["node-id"]+";"
        end

        if $drbd["resources"][res_name].has_key?("disk_s")
          resfile.puts "   disk {"
          $drbd["resources"][res_name]["disk_s"].each_key do |key|
            resfile.puts "      "+key+"\t"+$drbd["resources"][res_name]["disk_s"][key]+";"
          end
          resfile.puts "   }"
        end

        if $drbd["resources"][res_name].has_key?("syncer")
          resfile.puts "   syncer {"
          $drbd["resources"][res_name]["syncer"].each_key do |key|
            resfile.puts "      "+key+"\t"+$drbd["resources"][res_name]["syncer"][key]+";"
          end
          resfile.puts "   }"
        end

        if $drbd["resources"][res_name].has_key?("net")
          resfile.puts "   net {"
          $drbd["resources"][res_name]["net"].each_key do |key|
            resfile.puts "      "+key+"\t"+$drbd["resources"][res_name]["net"][key]+";"
          end
          resfile.puts "   }"
        end

        if $drbd["resources"][res_name].has_key?("startup")
          resfile.puts "   startup {"
          $drbd["resources"][res_name]["startup"].each_key do |key|
            resfile.puts "      "+key+"\t"+$drbd["resources"][res_name]["startup"][key]+";"
          end
          resfile.puts "   }"
        end

        if $drbd["resources"][res_name].has_key?("options")
          resfile.puts "   options {"
          $drbd["resources"][res_name]["options"].each_key do |key|
            resfile.puts "      "+key+"\t"+$drbd["resources"][res_name]["options"][key]+";"
          end
          resfile.puts "   }"
        end

        if $drbd["resources"][res_name].has_key?("handlers")
          resfile.puts "   handlers {"
          $drbd["resources"][res_name]["handlers"].each_key do |key|
            resfile.puts "      "+key+"\t"+$drbd["resources"][res_name]["handlers"][key]+";"
          end
          resfile.puts "   }"
        end

        if $drbd["resources"][res_name].has_key?("connection-mesh")
          resfile.puts "   connection-mesh {"
          $drbd["resources"][res_name]["connection-mesh"].each_key do |key|
            if key == "net"
              resfile.puts "      net"+"\t"" {"
              $drbd["resources"][res_name]["connection-mesh"]["net"].each_key do |key|
                resfile.puts "         "+key+"\t"+$drbd["resources"][res_name]["connection-mesh"]["net"][key]+";"
              end
            else
              resfile.puts "      "+key+"\t"+$drbd["resources"][res_name]["connection-mesh"][key]+";"
            end
          end
          resfile.puts "   }"
        end

        if $drbd["resources"][res_name].has_key?("on")
          $drbd["resources"][res_name]["on"].each_key do |node_name|
            resfile.puts "   on "+node_name+" {"
            $drbd["resources"][res_name]["on"][node_name].each_key do |key|
              resfile.puts "      "+key+"\t"+$drbd["resources"][res_name]["on"][node_name][key]+";"
            end
            resfile.puts "   }"
          end
        end

		if $drbd["resources"][res_name].has_key?("stacked-on-top-of")
		  $drbd["resources"][res_name]["stacked-on-top-of"].each_key do |rn|
		    resfile.puts "   stack_on_top_of "+rn+" {"
			$drbd["resources"][res_name]["stacked-on-top-of"][rn].each_key do |key|
			  resfile.puts "      "+key+"\t"+$drbd["resources"][res_name]["stacked-on-top-of"][rn][key]+";"
			end
			resfile.puts "   }"
		  end
		end

		if $drbd["resources"][res_name].has_key?("floating")
		  $drbd["resources"][res_name]["floating"].each_key do |ipp|
		    if $drbd["resources"][res_name]["floating"][ipp] == {}
			  resfile.puts "   floating "+ipp+";"
			else
			  resfile.puts "   floating "+ipp+" {"
			  $drbd["resources"][res_name]["floating"][ipp].each_key do |key|
			    resfile.puts "      "+key+"\t"+$drbd["resources"][res_name]["floating"][ipp][key]+";"
			  end
			  resfile.puts "   }"
			end
		  end
		end # <-- floating key
        resfile.puts "}"
		end # <-- File.open(seperate cfg file)
      end # <-- each resource section
    end # <-- has resources
  end # <-- File.open($drbdcfg)
end # <-- end of function

def commitChange()
  Dir.glob("/etc/drbd.d/*.YaST2new") { |newfile|
    origfile = newfile.split(".")[0..-2].join(".")
    if File.exist?(origfile) then
      File.rename(origfile, origfile+".YaST2save")
    end
    File.rename(newfile, origfile)
  }
  if not File.exist?($drbdcfg+".YaST2new") then
    return
  elsif File.exist?($drbdcfg) then
    File.rename($drbdcfg, $drbdcfg+".YaST2save")
  end
  File.rename($drbdcfg+".YaST2new", $drbdcfg)
end

# `Write (.drbd) means to write the file, other wise, the file is not written anyway

errlog($drbd.to_s)

$stdin.each do |line|
  errlog(line)
  line.chomp
  cmd = line.gsub(/^`?([a-zA-Z]+)\s+.*$/, '\1')
  path = line.gsub(/^`?([a-zA-Z]+)\s+\(([^,]*)(,.*)?\)$/, '\2').split('.')-[""]-["\n"]
  args = line.gsub(/^`?([a-zA-Z]+)\s+\(([^,]*)(,.*)?\)$/, '\3')
  if args.length != 0 then
    args[0] = ' '
    args = args.lstrip().rstrip()
    if args[0] == '"' then
      args = args[1..-2]
    end
  end
  case cmd
    when /Dir/
      doList(path)
    when /Read/
      doRead(path)
	when /Write/
	  doWrite(path, args)
	when /result/
	  exit
    when /.*/
      puts "nil"
  end
  $stdout.flush
end
