1 #
   2 # CDDL HEADER START
   3 #
   4 # The contents of this file are subject to the terms of the
   5 # Common Development and Distribution License (the "License").
   6 # You may not use this file except in compliance with the License.
   7 #
   8 # You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
   9 # or http://www.opensolaris.org/os/licensing.
  10 # See the License for the specific language governing permissions
  11 # and limitations under the License.
  12 #
  13 # When distributing Covered Code, include this CDDL HEADER in each
  14 # file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  15 # If applicable, add the following below this CDDL HEADER, with the
  16 # fields enclosed by brackets "[]" replaced with your own identifying
  17 # information: Portions Copyright [yyyy] [name of copyright owner]
  18 #
  19 # CDDL HEADER END
  20 #
  21 
  22 #
  23 # Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
  24 # Use is subject to license terms.
  25 #
  26 
  27 #
  28 # A number of functions to create each of the different pieces
  29 # that will make up a manifest.
  30 #
  31 
  32 #
  33 # Create a service_bundle piece
  34 #
  35 sub SERVICEBUNDLE() {
  36         my $values = shift;
  37 
  38         if ($pieces eq "uninitialized") {
  39                 $pieces = piece->new();
  40         }
  41 
  42         $p = $pieces;
  43 
  44         $p->type($SERVICEBUNDLE);
  45         $p->write(\&write_service_bundle);
  46         @{$p->associations};
  47 
  48         my $setident = 0;
  49         @vals = split(/,/, $values);
  50         foreach $val (@vals) {
  51                 ($l, $r) = split(/=/, $val);
  52 
  53                 if ($l eq "name") {
  54                         $setident = 1;
  55                         $p->ident($r);
  56                 }
  57 
  58                 $v = value->new();
  59                 $v->leftside($l);
  60                 $v->rightside($r);
  61 
  62                 push(@{$p->values}, $v);
  63         }
  64 }
  65 
  66 #
  67 # Create a service piece
  68 #
  69 sub SERVICE() {
  70         my $association = shift;
  71         my $values = shift;
  72 
  73         $p = piece->new();
  74         $p->type($SERVICE);
  75         $p->write(\&write_service);
  76         @{$p->associations};
  77 
  78         my $setident = 0;
  79         @vals = split(/,/, $values);
  80         foreach $val (@vals) {
  81                 ($l, $r) = split(/=/, $val);
  82 
  83                 if ($l eq "name") {
  84                         $setident = 1;
  85                         $p->ident($r);
  86                 }
  87 
  88                 $v = value->new();
  89                 $v->leftside($l);
  90                 $v->rightside($r);
  91 
  92                 push(@{$p->values}, $v);
  93         }
  94 
  95         ($asstype, $assname) = split(/:/, $association);
  96         &associate_piece($asstype, $assname, $p);
  97 }
  98         
  99 #
 100 # Create a exec_method piece
 101 #
 102 sub EXECMETHOD() {
 103         my $association = shift;
 104         my $values = shift;
 105 
 106         $p = piece->new();
 107         $p->type($EXECMETHOD);
 108         $p->write(\&write_exec_method);
 109         @{$p->associations};
 110 
 111         my $setident = 0;
 112         @vals = split(/,/, $values);
 113         foreach $val (@vals) {
 114                 ($l, $r) = split(/=/, $val);
 115 
 116                 if ($l eq "name") {
 117                         $setident = 1;
 118                         $p->ident($r);
 119                 }
 120 
 121                 $v = value->new();
 122                 $v->leftside($l);
 123                 $v->rightside($r);
 124 
 125                 push(@{$p->values}, $v);
 126         }
 127 
 128         ($asstype, $assname) = split(/:/, $association);
 129         &associate_piece($asstype, $assname, $p);
 130 }
 131 
 132 
 133 
 134 #
 135 # Create a property group piece
 136 #
 137 sub PROPERTYGROUP() {
 138         my $association = shift;
 139         my $values = shift;
 140 
 141         $p = piece->new();
 142         $p->type($PROPERTYGROUP);
 143         $p->write(\&write_property_group);
 144         @{$p->associations};
 145 
 146         my $setident = 0;
 147         @vals = split(/,/, $values);
 148         foreach $val (@vals) {
 149                 ($l, $r) = split(/=/, $val);
 150 
 151                 if ($l eq "name") {
 152                         $setident = 1;
 153                         $p->ident($r);
 154                 }
 155 
 156                 $v = value->new();
 157                 $v->leftside($l);
 158                 $v->rightside($r);
 159 
 160                 push(@{$p->values}, $v);
 161         }
 162 
 163         ($asstype, $assname) = split(/:/, $association);
 164         &associate_piece($asstype, $assname, $p);
 165 }
 166 
 167 #
 168 # Create a createdefaultinstance piece
 169 #
 170 sub CREATEDEFAULTINSTANCE() {
 171         my $association = shift;
 172         my $values = shift;
 173 
 174         $p = piece->new();
 175         $p->type($CREATEDEFAULTINSTANCE);
 176         $p->write(\&write_create_default_instance);
 177         @{$p->associations};
 178 
 179         my $setident = 0;
 180         if ($values ne "true" && $values ne "false") {
 181                 return();
 182         }
 183 
 184         $v = value->new();
 185         $v->leftside($values);
 186         push(@{$p->values}, $v);
 187 
 188         ($asstype, $assname) = split(/:/, $association);
 189         &associate_piece($asstype, $assname, $p);
 190 }
 191 
 192 #
 193 # Create a single_instance piece
 194 #
 195 sub SINGLEINSTANCE() {
 196         my $association = shift;
 197         my $values = shift;
 198 
 199         $p = piece->new();
 200         $p->type($SINGLEINSTANCE);
 201         $p->write(\&write_single_instance);
 202         @{$p->associations};
 203 
 204         my $setident = 0;
 205         @vals = split(/,/, $values);
 206         foreach $val (@vals) {
 207                 ($l, $r) = split(/=/, $val);
 208 
 209                 if ($l eq "name") {
 210                         $setident = 1;
 211                         $p->ident($r);
 212                 }
 213 
 214                 $v = value->new();
 215                 $v->leftside($l);
 216                 $v->rightside($r);
 217 
 218                 push(@{$p->values}, $v);
 219         }
 220 
 221         ($asstype, $assname) = split(/:/, $association);
 222         &associate_piece($asstype, $assname, $p);
 223 }
 224 
 225 #
 226 # Create a restarter piece
 227 #
 228 sub RESTARTER() {
 229         my $association = shift;
 230         my $values = shift;
 231 
 232         $p = piece->new();
 233         $p->type($RESTARTER);
 234         $p->write(\&write_restarter);
 235         @{$p->associations};
 236 
 237         my $setident = 0;
 238         @vals = split(/,/, $values);
 239         foreach $val (@vals) {
 240                 ($l, $r) = split(/=/, $val);
 241 
 242                 if ($l eq "name") {
 243                         $setident = 1;
 244                         $p->ident($r);
 245                 }
 246 
 247                 $v = value->new();
 248                 $v->leftside($l);
 249                 $v->rightside($r);
 250 
 251                 push(@{$p->values}, $v);
 252         }
 253 
 254         ($asstype, $assname) = split(/:/, $association);
 255         &associate_piece($asstype, $assname, $p);
 256 }
 257 
 258 #
 259 # Create a dependency piece
 260 #
 261 sub DEPENDENCY() {
 262         my $association = shift;
 263         my $values = shift;
 264 
 265         $p = piece->new();
 266         $p->type($DEPENDENCY);
 267         $p->write(\&write_dependency);
 268         @{$p->associations};
 269 
 270         my $setident = 0;
 271         @vals = split(/,/, $values);
 272         foreach $val (@vals) {
 273                 ($l, $r) = split(/=/, $val);
 274 
 275                 if ($l eq "name") {
 276                         $setident = 1;
 277                         $p->ident($r);
 278                 }
 279 
 280                 $v = value->new();
 281                 $v->leftside($l);
 282                 $v->rightside($r);
 283 
 284                 push(@{$p->values}, $v);
 285         }
 286 
 287         ($asstype, $assname) = split(/:/, $association);
 288         &associate_piece($asstype, $assname, $p);
 289 }
 290 
 291 #
 292 # Create a dependent piece
 293 #
 294 sub DEPENDENT() {
 295         my $association = shift;
 296         my $values = shift;
 297 
 298         $p = piece->new();
 299         $p->type($DEPENDENT);
 300         $p->write(\&write_dependent);
 301         @{$p->associations};
 302 
 303         my $setident = 0;
 304         @vals = split(/,/, $values);
 305         foreach $val (@vals) {
 306                 ($l, $r) = split(/=/, $val);
 307 
 308                 if ($l eq "name") {
 309                         $setident = 1;
 310                         $p->ident($r);
 311                 }
 312 
 313                 $v = value->new();
 314                 $v->leftside($l);
 315                 $v->rightside($r);
 316 
 317                 push(@{$p->values}, $v);
 318         }
 319 
 320         ($asstype, $assname) = split(/:/, $association);
 321         &associate_piece($asstype, $assname, $p);
 322 }
 323 
 324 #
 325 # Create a method_context piece
 326 #
 327 sub METHODCONTEXT() {
 328         my $association = shift;
 329         my $values = shift;
 330 
 331         $p = piece->new();
 332         $p->type($METHODCONTEXT);
 333         $p->write(\&write_method_context);
 334         @{$p->associations};
 335 
 336         my $setident = 0;
 337         @vals = split(/,/, $values);
 338         foreach $val (@vals) {
 339                 ($l, $r) = split(/=/, $val);
 340 
 341                 if ($l eq "name") {
 342                         $setident = 1;
 343                         $p->ident($r);
 344                 }
 345 
 346                 $v = value->new();
 347                 $v->leftside($l);
 348                 $v->rightside($r);
 349 
 350                 push(@{$p->values}, $v);
 351         }
 352 
 353         ($asstype, $assname) = split(/:/, $association);
 354         &associate_piece($asstype, $assname, $p);
 355 }
 356 
 357 #
 358 # Create a instance piece
 359 #
 360 sub INSTANCE() {
 361         my $association = shift;
 362         my $values = shift;
 363 
 364         $p = piece->new();
 365         $p->type($INSTANCE);
 366         $p->write(\&write_instance);
 367         @{$p->associations};
 368 
 369         my $setident = 0;
 370         @vals = split(/,/, $values);
 371         foreach $val (@vals) {
 372                 ($l, $r) = split(/=/, $val);
 373 
 374                 if ($l eq "name") {
 375                         $setident = 1;
 376                         $p->ident($r);
 377                 }
 378 
 379                 $v = value->new();
 380                 $v->leftside($l);
 381                 $v->rightside($r);
 382 
 383                 push(@{$p->values}, $v);
 384         }
 385 
 386         ($asstype, $assname) = split(/:/, $association);
 387         &associate_piece($asstype, $assname, $p);
 388 }
 389 
 390 #
 391 # Create a stability piece
 392 #
 393 sub STABILITY() {
 394         my $association = shift;
 395         my $values = shift;
 396 
 397         $p = piece->new();
 398         $p->type($STABILITY);
 399         $p->write(\&write_stability);
 400         @{$p->associations};
 401 
 402         my $setident = 0;
 403         @vals = split(/,/, $values);
 404         foreach $val (@vals) {
 405                 ($l, $r) = split(/=/, $val);
 406 
 407                 if ($l eq "name") {
 408                         $setident = 1;
 409                         $p->ident($r);
 410                 }
 411 
 412                 $v = value->new();
 413                 $v->leftside($l);
 414                 $v->rightside($r);
 415 
 416                 push(@{$p->values}, $v);
 417         }
 418 
 419         ($asstype, $assname) = split(/:/, $association);
 420         &associate_piece($asstype, $assname, $p);
 421 }
 422 
 423 #
 424 # Create a template piece
 425 #
 426 sub TEMPLATE() {
 427         my $association = shift;
 428         my $values = shift;
 429 
 430         $template_piece = 1;
 431         $p = piece->new();
 432         $p->type($TEMPLATE);
 433         $p->write(\&write_template);
 434         @{$p->associations};
 435 
 436         my $setident = 0;
 437         @vals = split(/,/, $values);
 438         foreach $val (@vals) {
 439                 ($l, $r) = split(/=/, $val);
 440 
 441                 if ($l eq "name") {
 442                         $setident = 1;
 443                         $p->ident($r);
 444                 }
 445 
 446                 $v = value->new();
 447                 $v->leftside($l);
 448                 $v->rightside($r);
 449 
 450                 push(@{$p->values}, $v);
 451         }
 452 
 453         if ($setident != 1) {
 454                 $p->ident("DEFAULT");
 455         }
 456 
 457         ($asstype, $assname) = split(/:/, $association);
 458         &associate_piece($asstype, $assname, $p);
 459 }
 460 
 461 #
 462 # Create a common_name piece
 463 #
 464 sub COMMONNAME() {
 465         my $association = shift;
 466         my $values = shift;
 467 
 468         $p = piece->new();
 469         $p->type($COMMONNAME);
 470         $p->write(\&write_common_name);
 471         @{$p->associations};
 472 
 473         my $setident = 0;
 474         while ($values) {
 475                 ($lang, $cname, $values) = split(/,/, $values, 3);
 476                 $v = value->new();
 477                 $v->leftside("lang");
 478                 $v->rightside($lang);
 479 
 480                 push(@{$p->values}, $v);
 481 
 482                 $v = value->new();
 483                 $v->leftside("${lang}_cname");
 484                 $v->rightside($cname);
 485 
 486                 push(@{$p->values}, $v);
 487         }
 488 
 489         $p->ident("$cname");
 490 
 491         ($asstype, $assname) = split(/:/, $association);
 492         &associate_piece($asstype, $assname, $p);
 493 }
 494 
 495 #
 496 # Create a description piece
 497 #
 498 sub DESCRIPTION() {
 499         my $association = shift;
 500         my $values = shift;
 501 
 502         $p = piece->new();
 503         $p->type($DESCRIPTION);
 504         $p->write(\&write_description);
 505         @{$p->associations};
 506 
 507         my $setident = 0;
 508         @vals = split(/,/, $values);
 509         foreach $val (@vals) {
 510                 ($l, $r) = split(/=/, $val);
 511 
 512                 if ($l eq "name") {
 513                         $setident = 1;
 514                         $p->ident($r);
 515                 }
 516 
 517                 $v = value->new();
 518                 $v->leftside($l);
 519                 $v->rightside($r);
 520 
 521                 push(@{$p->values}, $v);
 522         }
 523 
 524         ($asstype, $assname) = split(/:/, $association);
 525         &associate_piece($asstype, $assname, $p);
 526 }
 527 
 528 #
 529 # Create a documentation piece
 530 #
 531 sub DOCUMENTATION() {
 532         my $association = shift;
 533         my $values = shift;
 534 
 535         $p = piece->new();
 536         $p->type($DOCUMENTATION);
 537         $p->write(\&write_documentation);
 538         @{$p->associations};
 539 
 540         my $setident = 0;
 541         @vals = split(/,/, $values);
 542         foreach $val (@vals) {
 543                 ($l, $r) = split(/=/, $val);
 544 
 545                 if ($l eq "name") {
 546                         $setident = 1;
 547                         $p->ident($r);
 548                 }
 549 
 550                 $v = value->new();
 551                 $v->leftside($l);
 552                 $v->rightside($r);
 553 
 554                 push(@{$p->values}, $v);
 555         }
 556 
 557         ($asstype, $assname) = split(/:/, $association);
 558         &associate_piece($asstype, $assname, $p);
 559 }
 560 
 561 #
 562 # Create a pg_pattern piece
 563 #
 564 sub PGPATTERN() {
 565         my $association = shift;
 566         my $values = shift;
 567 
 568         $p = piece->new();
 569         $p->type($PGPATTERN);
 570         $p->write(\&write_pg_pattern);
 571         @{$p->associations};
 572 
 573         my $setident = 0;
 574         @vals = split(/,/, $values);
 575         foreach $val (@vals) {
 576                 ($l, $r) = split(/=/, $val);
 577 
 578                 if ($l eq "name") {
 579                         $setident = 1;
 580                         $p->ident($r);
 581                 }
 582 
 583                 $v = value->new();
 584                 $v->leftside($l);
 585                 $v->rightside($r);
 586 
 587                 push(@{$p->values}, $v);
 588         }
 589 
 590         ($asstype, $assname) = split(/:/, $association);
 591         &associate_piece($asstype, $assname, $p);
 592 }
 593 
 594 #
 595 # Create a prop_pattern piece
 596 #
 597 sub PROPPATTERN() {
 598         my $association = shift;
 599         my $values = shift;
 600 
 601         $p = piece->new();
 602         $p->type($PROPPATTERN);
 603         $p->write(\&write_prop_pattern);
 604         @{$p->associations};
 605 
 606         my $setident = 0;
 607         @vals = split(/,/, $values);
 608         foreach $val (@vals) {
 609                 ($l, $r) = split(/=/, $val);
 610 
 611                 if ($l eq "name") {
 612                         $setident = 1;
 613                         $p->ident($r);
 614                 }
 615 
 616                 $v = value->new();
 617                 $v->leftside($l);
 618                 $v->rightside($r);
 619 
 620                 push(@{$p->values}, $v);
 621         }
 622 
 623         ($asstype, $assname) = split(/:/, $association);
 624         &associate_piece($asstype, $assname, $p);
 625 }
 626 
 627 #
 628 # Create a units piece
 629 #
 630 sub UNITS() {
 631         my $association = shift;
 632         my $values = shift;
 633 
 634         $p = piece->new();
 635         $p->type($UNITS);
 636         $p->write(\&write_units);
 637         @{$p->associations};
 638 
 639         my $setident = 0;
 640         @vals = split(/,/, $values);
 641         foreach $val (@vals) {
 642                 ($l, $r) = split(/=/, $val);
 643 
 644                 if ($l eq "name") {
 645                         $setident = 1;
 646                         $p->ident($r);
 647                 }
 648 
 649                 $v = value->new();
 650                 $v->leftside($l);
 651                 $v->rightside($r);
 652 
 653                 push(@{$p->values}, $v);
 654         }
 655 
 656         ($asstype, $assname) = split(/:/, $association);
 657         &associate_piece($asstype, $assname, $p);
 658 }
 659 
 660 #
 661 # Create a visibility piece
 662 #
 663 sub VISIBILITY() {
 664         my $association = shift;
 665         my $values = shift;
 666 
 667         $p = piece->new();
 668         $p->type($VISIBILITY);
 669         $p->write(\&write_visibility);
 670         @{$p->associations};
 671 
 672         my $setident = 0;
 673         @vals = split(/,/, $values);
 674         foreach $val (@vals) {
 675                 ($l, $r) = split(/=/, $val);
 676 
 677                 if ($l eq "name") {
 678                         $setident = 1;
 679                         $p->ident($r);
 680                 }
 681 
 682                 $v = value->new();
 683                 $v->leftside($l);
 684                 $v->rightside($r);
 685 
 686                 push(@{$p->values}, $v);
 687         }
 688 
 689         ($asstype, $assname) = split(/:/, $association);
 690         &associate_piece($asstype, $assname, $p);
 691 }
 692 
 693 #
 694 # Create a cardinality piece
 695 #
 696 sub CARDINALITY() {
 697         my $association = shift;
 698         my $values = shift;
 699 
 700         $p = piece->new();
 701         $p->type($CARDINALITY);
 702         $p->write(\&write_cardinality);
 703         @{$p->associations};
 704 
 705         my $setident = 0;
 706         @vals = split(/,/, $values);
 707         foreach $val (@vals) {
 708                 ($l, $r) = split(/=/, $val);
 709 
 710                 if ($l eq "name") {
 711                         $setident = 1;
 712                         $p->ident($r);
 713                 }
 714 
 715                 $v = value->new();
 716                 $v->leftside($l);
 717                 $v->rightside($r);
 718 
 719                 push(@{$p->values}, $v);
 720         }
 721 
 722         ($asstype, $assname) = split(/:/, $association);
 723         &associate_piece($asstype, $assname, $p);
 724 }
 725 
 726 #
 727 # Create a internal_separator piece
 728 #
 729 sub INTERNALSEPARATORS() {
 730         my $association = shift;
 731         my $values = shift;
 732 
 733         $p = piece->new();
 734         $p->type($INTERNALSEPARATORS);
 735         $p->write(\&write_internal_separators);
 736         @{$p->associations};
 737 
 738         my $setident = 0;
 739         @vals = split(/,/, $values);
 740         foreach $val (@vals) {
 741                 ($l, $r) = split(/=/, $val);
 742 
 743                 if ($l eq "name") {
 744                         $setident = 1;
 745                         $p->ident($r);
 746                 }
 747 
 748                 $v = value->new();
 749                 $v->leftside($l);
 750                 $v->rightside($r);
 751 
 752                 push(@{$p->values}, $v);
 753         }
 754 
 755         ($asstype, $assname) = split(/:/, $association);
 756         &associate_piece($asstype, $assname, $p);
 757 }
 758 
 759 #
 760 # Create a values piece
 761 #
 762 sub VALUES() {
 763         my $association = shift;
 764         my $values = shift;
 765 
 766         $p = piece->new();
 767         $p->type($VALUES);
 768         $p->write(\&write_values);
 769         @{$p->associations};
 770 
 771         my $setident = 0;
 772         @vals = split(/,/, $values);
 773         foreach $val (@vals) {
 774                 ($l, $r) = split(/=/, $val);
 775 
 776                 if ($l eq "ident") {
 777                         $setident = 1;
 778                         $p->ident($r);
 779                 }
 780         }
 781 
 782         ($asstype, $assname) = split(/:/, $association);
 783         &associate_piece($asstype, $assname, $p);
 784 }
 785 
 786 #
 787 # Create a constraints piece
 788 #
 789 sub CONSTRAINTS() {
 790         my $association = shift;
 791         my $values = shift;
 792 
 793         $p = piece->new();
 794         $p->type($CONSTRAINTS);
 795         $p->write(\&write_constraints);
 796         @{$p->associations};
 797 
 798         my $setident = 0;
 799         @vals = split(/,/, $values);
 800         foreach $val (@vals) {
 801                 ($l, $r) = split(/=/, $val);
 802 
 803                 if ($l eq "ident") {
 804                         $setident = 1;
 805                         $p->ident($r);
 806                 }
 807         }
 808 
 809         ($asstype, $assname) = split(/:/, $association);
 810         &associate_piece($asstype, $assname, $p);
 811 }
 812 
 813 #
 814 # Create a value piece
 815 #
 816 sub VALUE() {
 817         my $association = shift;
 818         my $values = shift;
 819 
 820         $p = piece->new();
 821         $p->type($VALUE);
 822         $p->write(\&write_value);
 823         @{$p->associations};
 824 
 825         my $setident = 0;
 826         @vals = split(/,/, $values);
 827         foreach $val (@vals) {
 828                 ($l, $r) = split(/=/, $val);
 829 
 830                 if ($l eq "name") {
 831                         $setident = 1;
 832                         $p->ident($r);
 833                 }
 834 
 835                 $v = value->new();
 836                 $v->leftside($l);
 837                 $v->rightside($r);
 838 
 839                 push(@{$p->values}, $v);
 840         }
 841 
 842         ($asstype, $assname) = split(/:/, $association);
 843         &associate_piece($asstype, $assname, $p);
 844 }
 845 
 846 #
 847 # Create a range piece
 848 #
 849 sub RANGE() {
 850         my $association = shift;
 851         my $values = shift;
 852 
 853         $p = piece->new();
 854         $p->type($RANGE);
 855         $p->write(\&write_range);
 856         @{$p->associations};
 857 
 858         my $setident = 0;
 859         @vals = split(/,/, $values);
 860         foreach $val (@vals) {
 861                 ($l, $r) = split(/=/, $val);
 862 
 863                 if ($l eq "name") {
 864                         $setident = 1;
 865                         $p->ident($r);
 866                 }
 867 
 868                 $v = value->new();
 869                 $v->leftside($l);
 870                 $v->rightside($r);
 871 
 872                 push(@{$p->values}, $v);
 873         }
 874 
 875         ($asstype, $assname) = split(/:/, $association);
 876         &associate_piece($asstype, $assname, $p);
 877 }
 878 
 879 #
 880 # Create a value_set piece
 881 #
 882 sub VALUESET() {
 883         my $association = shift;
 884         my $values = shift;
 885 
 886         $p = piece->new();
 887         $p->type($VALUESET);
 888         $p->write(\&write_valueset);
 889         @{$p->associations};
 890 
 891         my $setident = 0;
 892         @vals = split(/,/, $values);
 893         foreach $val (@vals) {
 894                 ($l, $r) = split(/=/, $val);
 895 
 896                 if ($l eq "name") {
 897                         $setident = 1;
 898                         $p->ident($r);
 899                 }
 900 
 901                 $v = value->new();
 902                 $v->leftside($l);
 903                 $v->rightside($r);
 904 
 905                 push(@{$p->values}, $v);
 906         }
 907 
 908         ($asstype, $assname) = split(/:/, $association);
 909         &associate_piece($asstype, $assname, $p);
 910 }
 911 
 912 #
 913 # Create a all_values piece
 914 #
 915 sub ALLVALUES() {
 916         my $association = shift;
 917         my $values = shift;
 918 
 919         $p = piece->new();
 920         $p->type($ALLVALUES);
 921         $p->write(\&write_allvalues);
 922         @{$p->associations};
 923 
 924         my $setident = 0;
 925         @vals = split(/,/, $values);
 926         foreach $val (@vals) {
 927                 ($l, $r) = split(/=/, $val);
 928 
 929                 if ($l eq "name") {
 930                         $setident = 1;
 931                         $p->ident($r);
 932                 }
 933 
 934                 $v = value->new();
 935                 $v->leftside($l);
 936                 $v->rightside($r);
 937 
 938                 push(@{$p->values}, $v);
 939         }
 940 
 941         ($asstype, $assname) = split(/:/, $association);
 942         &associate_piece($asstype, $assname, $p);
 943 }
 944 
 945 #
 946 # Create a doclink piece
 947 #
 948 sub DOCLINK() {
 949         my $association = shift;
 950         my $values = shift;
 951 
 952         $p = piece->new();
 953         $p->type($DOCLINK);
 954         $p->write(\&write_doclink);
 955         @{$p->associations};
 956 
 957         my $setident = 0;
 958         @vals = split(/,/, $values);
 959         foreach $val (@vals) {
 960                 ($l, $r) = split(/=/, $val);
 961 
 962                 if ($l eq "name") {
 963                         $setident = 1;
 964                         $p->ident($r);
 965                 }
 966 
 967                 $v = value->new();
 968                 $v->leftside($l);
 969                 $v->rightside($r);
 970 
 971                 push(@{$p->values}, $v);
 972         }
 973 
 974         ($asstype, $assname) = split(/:/, $association);
 975         &associate_piece($asstype, $assname, $p);
 976 }
 977 
 978 #
 979 # Create a manpage piece
 980 #
 981 sub MANPAGE() {
 982         my $association = shift;
 983         my $values = shift;
 984 
 985         $p = piece->new();
 986         $p->type($MANPAGE);
 987         $p->write(\&write_manpage);
 988         @{$p->associations};
 989 
 990         my $setident = 0;
 991         @vals = split(/,/, $values);
 992         foreach $val (@vals) {
 993                 ($l, $r) = split(/=/, $val);
 994 
 995                 if ($l eq "name") {
 996                         $setident = 1;
 997                         $p->ident($r);
 998                 }
 999 
1000                 $v = value->new();
1001                 $v->leftside($l);
1002                 $v->rightside($r);
1003 
1004                 push(@{$p->values}, $v);
1005         }
1006 
1007         ($asstype, $assname) = split(/:/, $association);
1008         &associate_piece($asstype, $assname, $p);
1009 }
1010 
1011 #
1012 # Create a service_fmri piece
1013 #
1014 sub SERVICEFMRI() {
1015         my $association = shift;
1016         my $values = shift;
1017 
1018         $p = piece->new();
1019         $p->type($SERVICEFMRI);
1020         $p->write(\&write_service_fmri);
1021         @{$p->associations};
1022 
1023         my $setident = 0;
1024         @vals = split(/,/, $values);
1025         foreach $val (@vals) {
1026                 ($l, $r) = split(/=/, $val);
1027 
1028                 if ($l eq "name") {
1029                         $setident = 1;
1030                         $p->ident($r);
1031                 }
1032 
1033                 $v = value->new();
1034                 $v->leftside($l);
1035                 $v->rightside($r);
1036 
1037                 push(@{$p->values}, $v);
1038         }
1039 
1040         ($asstype, $assname) = split(/:/, $association);
1041         &associate_piece($asstype, $assname, $p);
1042 }
1043 
1044 #
1045 # Create a method_profile piece
1046 #
1047 sub METHODPROFILE() {
1048         my $association = shift;
1049         my $values = shift;
1050 
1051         $p = piece->new();
1052         $p->type($METHODPROFILE);
1053         $p->write(\&write_method_profile);
1054         @{$p->associations};
1055 
1056         my $setident = 0;
1057         @vals = split(/,/, $values);
1058         foreach $val (@vals) {
1059                 ($l, $r) = split(/=/, $val);
1060 
1061                 if ($l eq "name") {
1062                         $setident = 1;
1063                         $p->ident($r);
1064                 }
1065 
1066                 $v = value->new();
1067                 $v->leftside($l);
1068                 $v->rightside($r);
1069 
1070                 push(@{$p->values}, $v);
1071         }
1072 
1073         ($asstype, $assname) = split(/:/, $association);
1074         &associate_piece($asstype, $assname, $p);
1075 }
1076 
1077 #
1078 # Create a method_credential piece
1079 #
1080 sub METHODCREDENTIAL() {
1081         my $association = shift;
1082         my $values = shift;
1083 
1084         $p = piece->new();
1085         $p->type($METHODCREDENTIAL);
1086         $p->write(\&write_method_credential);
1087         @{$p->associations};
1088 
1089         my $setident = 0;
1090         @vals = split(/,/, $values);
1091         foreach $val (@vals) {
1092                 ($l, $r) = split(/=/, $val);
1093 
1094                 if ($l eq "name") {
1095                         $setident = 1;
1096                         $p->ident($r);
1097                 }
1098 
1099                 $v = value->new();
1100                 $v->leftside($l);
1101                 $v->rightside($r);
1102 
1103                 push(@{$p->values}, $v);
1104         }
1105 
1106         ($asstype, $assname) = split(/:/, $association);
1107         &associate_piece($asstype, $assname, $p);
1108 }
1109 
1110 #
1111 # Create a method_environment piece
1112 #
1113 sub METHODENVIRONMENT() {
1114         my $association = shift;
1115         my $values = shift;
1116 
1117         $p = piece->new();
1118         $p->type($METHODENVIRONMENT);
1119         $p->write(\&write_method_environment);
1120         @{$p->associations};
1121 
1122         my $setident = 0;
1123         @vals = split(/,/, $values);
1124         foreach $val (@vals) {
1125                 ($l, $r) = split(/=/, $val);
1126 
1127                 if ($l eq "name") {
1128                         $setident = 1;
1129                         $p->ident($r);
1130                 }
1131 
1132                 $v = value->new();
1133                 $v->leftside($l);
1134                 $v->rightside($r);
1135 
1136                 push(@{$p->values}, $v);
1137         }
1138 
1139         ($asstype, $assname) = split(/:/, $association);
1140         &associate_piece($asstype, $assname, $p);
1141 }
1142 
1143 #
1144 # Create a prop_val piece
1145 #
1146 sub PROPVAL() {
1147         my $association = shift;
1148         my $values = shift;
1149 
1150         $p = piece->new();
1151         $p->type($PROPVAL);
1152         $p->write(\&write_propval);
1153         @{$p->associations};
1154 
1155         my $setident = 0;
1156         @vals = split(/,/, $values);
1157         foreach $val (@vals) {
1158                 ($l, $r) = split(/=/, $val);
1159 
1160                 if ($l eq "name") {
1161                         $setident = 1;
1162                         $p->ident($r);
1163                 }
1164 
1165                 $v = value->new();
1166                 $v->leftside($l);
1167                 $v->rightside($r);
1168 
1169                 push(@{$p->values}, $v);
1170         }
1171 
1172         ($asstype, $assname) = split(/:/, $association);
1173         &associate_piece($asstype, $assname, $p);
1174 }
1175 
1176 #
1177 # Create a property piece
1178 #
1179 sub PROPERTY() {
1180         my $association = shift;
1181         my $values = shift;
1182 
1183         $p = piece->new();
1184         $p->type($PROPERTY);
1185         $p->write(\&write_property);
1186         @{$p->associations};
1187 
1188         my $setident = 0;
1189         @vals = split(/,/, $values);
1190         foreach $val (@vals) {
1191                 ($l, $r) = split(/=/, $val);
1192 
1193                 if ($l eq "name") {
1194                         $setident = 1;
1195                         $p->ident($r);
1196                 }
1197 
1198                 $v = value->new();
1199                 $v->leftside($l);
1200                 $v->rightside($r);
1201 
1202                 push(@{$p->values}, $v);
1203         }
1204 
1205         ($asstype, $assname) = split(/:/, $association);
1206         &associate_piece($asstype, $assname, $p);
1207 }
1208 
1209 #
1210 # Create a count_list piece
1211 #
1212 sub COUNTLIST() {
1213         my $association = shift;
1214         my $values = shift;
1215 
1216         $p = piece->new();
1217         $p->type($COUNTLIST);
1218         $p->write(\&write_count_list);
1219         @{$p->associations};
1220 
1221         my $setident = 0;
1222         @vals = split(/,/, $values);
1223         foreach $val (@vals) {
1224                 $v = value->new();
1225                 $v->rightside($val);
1226 
1227                 push(@{$p->values}, $v);
1228         }
1229 
1230         ($asstype, $assname) = split(/:/, $association);
1231         &associate_piece($asstype, $assname, $p);
1232 }
1233 
1234 #
1235 # Create a interger_list piece
1236 #
1237 sub INTEGERLIST() {
1238         my $association = shift;
1239         my $values = shift;
1240 
1241         $p = piece->new();
1242         $p->type($INTEGERLIST);
1243         $p->write(\&write_integer_list);
1244         @{$p->associations};
1245 
1246         my $setident = 0;
1247         @vals = split(/,/, $values);
1248         foreach $val (@vals) {
1249                 $v = value->new();
1250                 $v->rightside($val);
1251 
1252                 push(@{$p->values}, $v);
1253         }
1254 
1255         ($asstype, $assname) = split(/:/, $association);
1256         &associate_piece($asstype, $assname, $p);
1257 }
1258 
1259 #
1260 # Create a opaque_list piece
1261 #
1262 sub OPAQUELIST() {
1263         my $association = shift;
1264         my $values = shift;
1265 
1266         $p = piece->new();
1267         $p->type($OPAQUELIST);
1268         $p->write(\&write_opaque_list);
1269         @{$p->associations};
1270 
1271         my $setident = 0;
1272         @vals = split(/,/, $values);
1273         foreach $val (@vals) {
1274                 $v = value->new();
1275                 $v->rightside($val);
1276 
1277                 push(@{$p->values}, $v);
1278         }
1279 
1280         ($asstype, $assname) = split(/:/, $association);
1281         &associate_piece($asstype, $assname, $p);
1282 }
1283 
1284 #
1285 # Create a host_list piece
1286 #
1287 sub HOSTLIST() {
1288         my $association = shift;
1289         my $values = shift;
1290 
1291         $p = piece->new();
1292         $p->type($HOSTLIST);
1293         $p->write(\&write_host_list);
1294         @{$p->associations};
1295 
1296         my $setident = 0;
1297         @vals = split(/,/, $values);
1298         foreach $val (@vals) {
1299                 $v = value->new();
1300                 $v->rightside($val);
1301 
1302                 push(@{$p->values}, $v);
1303         }
1304 
1305         ($asstype, $assname) = split(/:/, $association);
1306         &associate_piece($asstype, $assname, $p);
1307 }
1308 
1309 #
1310 # Create a hostname_list piece
1311 #
1312 sub HOSTNAMELIST() {
1313         my $association = shift;
1314         my $values = shift;
1315 
1316         $p = piece->new();
1317         $p->type($HOSTNAMELIST);
1318         $p->write(\&write_host_name_list);
1319         @{$p->associations};
1320 
1321         my $setident = 0;
1322         @vals = split(/,/, $values);
1323         foreach $val (@vals) {
1324                 $v = value->new();
1325                 $v->rightside($val);
1326 
1327                 push(@{$p->values}, $v);
1328         }
1329 
1330         ($asstype, $assname) = split(/:/, $association);
1331         &associate_piece($asstype, $assname, $p);
1332 }
1333 
1334 #
1335 # Create a netaddress4_list piece
1336 #
1337 sub NETADDRESSV4LIST() {
1338         my $association = shift;
1339         my $values = shift;
1340 
1341         $p = piece->new();
1342         $p->type($NETADDRESSV4LIST);
1343         $p->write(\&write_net_address_v4_list);
1344         @{$p->associations};
1345 
1346         my $setident = 0;
1347         @vals = split(/,/, $values);
1348         foreach $val (@vals) {
1349                 $v = value->new();
1350                 $v->rightside($val);
1351 
1352                 push(@{$p->values}, $v);
1353         }
1354 
1355         ($asstype, $assname) = split(/:/, $association);
1356         &associate_piece($asstype, $assname, $p);
1357 }
1358 
1359 #
1360 # Create a netaddressv6_list piece
1361 #
1362 sub NETADDRESSV6LIST() {
1363         my $association = shift;
1364         my $values = shift;
1365 
1366         $p = piece->new();
1367         $p->type($NETADDRESSV6LIST);
1368         $p->write(\&write_net_address_v6_list);
1369         @{$p->associations};
1370 
1371         my $setident = 0;
1372         @vals = split(/,/, $values);
1373         foreach $val (@vals) {
1374                 $v = value->new();
1375                 $v->rightside($val);
1376 
1377                 push(@{$p->values}, $v);
1378         }
1379 
1380         ($asstype, $assname) = split(/:/, $association);
1381         &associate_piece($asstype, $assname, $p);
1382 }
1383 
1384 #
1385 # Create a time_list piece
1386 #
1387 sub TIMELIST() {
1388         my $association = shift;
1389         my $values = shift;
1390 
1391         $p = piece->new();
1392         $p->type($TIMELIST);
1393         $p->write(\&write_time_list);
1394         @{$p->associations};
1395 
1396         my $setident = 0;
1397         @vals = split(/,/, $values);
1398         foreach $val (@vals) {
1399                 $v = value->new();
1400                 $v->rightside($val);
1401 
1402                 push(@{$p->values}, $v);
1403         }
1404 
1405         ($asstype, $assname) = split(/:/, $association);
1406         &associate_piece($asstype, $assname, $p);
1407 }
1408 
1409 #
1410 # Create a astring_list piece
1411 #
1412 sub ASTRINGLIST() {
1413         my $association = shift;
1414         my $values = shift;
1415 
1416         $p = piece->new();
1417         $p->type($ASTRINGLIST);
1418         $p->write(\&write_astring_list);
1419         @{$p->associations};
1420 
1421         my $setident = 0;
1422         @vals = split(/,/, $values);
1423         foreach $val (@vals) {
1424                 $v = value->new();
1425                 $v->rightside($val);
1426 
1427                 push(@{$p->values}, $v);
1428         }
1429 
1430         ($asstype, $assname) = split(/:/, $association);
1431         &associate_piece($asstype, $assname, $p);
1432 }
1433 
1434 #
1435 # Create a ustring_list piece
1436 #
1437 sub USTRINGLIST() {
1438         my $association = shift;
1439         my $values = shift;
1440 
1441         $p = piece->new();
1442         $p->type($USTRINGLIST);
1443         $p->write(\&write_ustring_list);
1444         @{$p->associations};
1445 
1446         my $setident = 0;
1447         @vals = split(/,/, $values);
1448         foreach $val (@vals) {
1449                 $v = value->new();
1450                 $v->rightside($val);
1451 
1452                 push(@{$p->values}, $v);
1453         }
1454 
1455         ($asstype, $assname) = split(/:/, $association);
1456         &associate_piece($asstype, $assname, $p);
1457 }
1458 
1459 #
1460 # Create a boolean_list piece
1461 #
1462 sub BOOLEANLIST() {
1463         my $association = shift;
1464         my $values = shift;
1465 
1466         $p = piece->new();
1467         $p->type($BOOLEANLIST);
1468         $p->write(\&write_boolean_list);
1469         @{$p->associations};
1470 
1471         my $setident = 0;
1472         @vals = split(/,/, $values);
1473         foreach $val (@vals) {
1474                 $v = value->new();
1475                 $v->rightside($val);
1476 
1477                 push(@{$p->values}, $v);
1478         }
1479 
1480         ($asstype, $assname) = split(/:/, $association);
1481         &associate_piece($asstype, $assname, $p);
1482 }
1483 
1484 #
1485 # Create a fmri_list piece
1486 #
1487 sub FMRILIST() {
1488         my $association = shift;
1489         my $values = shift;
1490 
1491         $p = piece->new();
1492         $p->type($FMRILIST);
1493         $p->write(\&write_fmri_list);
1494         @{$p->associations};
1495 
1496         my $setident = 0;
1497         @vals = split(/,/, $values);
1498         foreach $val (@vals) {
1499                 $v = value->new();
1500                 $v->rightside($val);
1501 
1502                 push(@{$p->values}, $v);
1503         }
1504 
1505         ($asstype, $assname) = split(/:/, $association);
1506         &associate_piece($asstype, $assname, $p);
1507 }
1508 
1509 #
1510 # Create a uri_list piece
1511 #
1512 sub URILIST() {
1513         my $association = shift;
1514         my $values = shift;
1515 
1516         $p = piece->new();
1517         $p->type($URILIST);
1518         $p->write(\&write_uri_list);
1519         @{$p->associations};
1520 
1521         my $setident = 0;
1522         @vals = split(/,/, $values);
1523         foreach $val (@vals) {
1524                 $v = value->new();
1525                 $v->rightside($val);
1526 
1527                 push(@{$p->values}, $v);
1528         }
1529 
1530         ($asstype, $assname) = split(/:/, $association);
1531         &associate_piece($asstype, $assname, $p);
1532 }
1533 return (1);