Changeset 128 in MondoRescue for branches/2.05/mondo/mondo/common/mondostructures.h
- Timestamp:
- Nov 19, 2005, 2:27:41 AM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2.05/mondo/mondo/common/mondostructures.h
r30 r128 5 5 copyright : (C) 2002 by Stan Benoit 6 6 email : troff@nakedsoul.org 7 cvsid : $Id : mondostructures.h,v 1.3 2004/06/17 08:49:06 hugo Exp$7 cvsid : $Id$ 8 8 ***************************************************************************/ 9 9 … … 35 35 * There is one mountlist_line for each device we're keeping track of in the mountlist. 36 36 */ 37 struct mountlist_line 38 { 37 struct mountlist_line { 39 38 /** 40 39 * The name of the device (/dev entry) for this mountlist line. Guaranteed to be unique. 41 40 */ 42 41 char device[64]; 43 42 44 43 /** … … 46 45 * This can be "raid", for a RAID subdisk, or "lvm", for an LVM PV. 47 46 */ 48 47 char mountpoint[256]; 49 48 50 49 /** … … 52 51 * Also, this can be "raid", for a RAID subdisk, or "lvm", for an LVM PV. 53 52 */ 54 53 char format[64]; 55 54 56 55 /** 57 56 * The size in kilobytes of this device. 0 or -1 indicates LVM. 58 57 */ 59 58 long long size; 60 59 61 60 /** 62 61 * For ext2 and ext3, this is the filesystem label (if there is one). If not, this should be "". 63 62 */ 64 63 char label[256]; 65 64 }; 66 65 … … 70 69 * system, so we can recreate them in a nuke restore. 71 70 */ 72 struct mountlist_itself 73 { 71 struct mountlist_itself { 74 72 /** 75 73 * Number of entries in the mountlist. 76 74 */ 77 75 int entries; 78 76 79 77 /** 80 78 * The list of entries, all @p entries of them. 81 79 */ 82 80 struct mountlist_line el[MAX_TAPECATALOG_ENTRIES]; 83 81 }; 84 82 … … 88 86 * ensure accurate resizing. 89 87 */ 90 struct mountlist_reference 91 { 88 struct mountlist_reference { 92 89 /** 93 90 * The number of entries in the list of mountlist references. 94 91 */ 95 92 int entries; 96 93 97 94 /** 98 95 * The array of mountlist_line, allocated on demand. 99 96 */ 100 97 struct mountlist_line **el; 101 98 }; 102 99 … … 104 101 * A line in @p additional_raid_variables. 105 102 */ 106 struct raid_var_line 107 { 103 struct raid_var_line { 108 104 /** 109 105 * The label for this RAID variable. 110 106 */ 111 107 char label[64]; 112 108 113 109 /** 114 110 * The value for this RAID variable. 115 111 */ 116 112 char value[64]; 117 113 }; 118 114 … … 123 119 * Each @p raid_device_record has one. 124 120 */ 125 struct additional_raid_variables 126 { 121 struct additional_raid_variables { 127 122 /** 128 123 * The number of entries in the list. 129 124 */ 130 125 int entries; 131 126 132 127 /** 133 128 * The list of entries, all @p entries of them. 134 129 */ 135 130 struct raid_var_line el[MAXIMUM_ADDITIONAL_RAID_VARS]; 136 131 }; 137 132 … … 139 134 * One disk in a @p list_of_disks. 140 135 */ 141 struct s_disk 142 { 136 struct s_disk { 143 137 #ifdef __FreeBSD__ 144 138 /** 145 139 * The name of this disk. If blank it will eventually get filled in automatically. 146 140 */ 147 141 char name[64]; 148 142 #endif 149 143 /** 150 144 * The device this entry describes. 151 145 */ 152 146 char device[64]; 153 147 154 148 /** 155 149 * Index number of this entry in the whole disklist. 156 150 */ 157 151 int index; 158 152 }; 159 153 … … 161 155 * A list of @p s_disk. Every @p raid_device_record has four. 162 156 */ 163 struct list_of_disks 164 { 157 struct list_of_disks { 165 158 /** 166 159 * The number of entries in the disklist. 167 160 */ 168 161 int entries; 169 162 170 163 /** 171 164 * The entries themselves, all @p entries of them. 172 165 */ 173 166 struct s_disk el[MAXIMUM_DISKS_PER_RAID_DEV]; 174 167 }; 175 168 … … 177 170 * A type of media we're backing up to. 178 171 */ 179 typedef enum { none =0, ///< No type has been set yet.180 iso,///< Back up to ISO images.181 cdr,///< Back up to recordable CDs (do not erase them).182 cdrw,///< Back up to CD-RWs and blank them first.183 dvd,///< Back up to DVD+R[W] or DVD-R[W] disks.184 cdstream,///< Back up to recordable CDs but treat them like a tape streamer.185 nfs,///< Back up to an NFS mount on the local subnet.186 tape,///< Back up to tapes.187 udev///< Back up to another unsupported device; just send a stream of bytes.188 172 typedef enum { none = 0, ///< No type has been set yet. 173 iso, ///< Back up to ISO images. 174 cdr, ///< Back up to recordable CDs (do not erase them). 175 cdrw, ///< Back up to CD-RWs and blank them first. 176 dvd, ///< Back up to DVD+R[W] or DVD-R[W] disks. 177 cdstream, ///< Back up to recordable CDs but treat them like a tape streamer. 178 nfs, ///< Back up to an NFS mount on the local subnet. 179 tape, ///< Back up to tapes. 180 udev ///< Back up to another unsupported device; just send a stream of bytes. 181 } t_bkptype; 189 182 190 183 /** 191 184 * A type of file in the catalog of recent archives. 192 185 */ 193 typedef enum { other, ///< Some other kind of file.194 fileset,///< An afioball (fileset), optionally compressed.195 biggieslice///< A slice of a biggiefile, optionally compressed.196 186 typedef enum { other, ///< Some other kind of file. 187 fileset, ///< An afioball (fileset), optionally compressed. 188 biggieslice ///< A slice of a biggiefile, optionally compressed. 189 } t_archtype; 197 190 198 191 199 192 #ifdef __FreeBSD__ 200 193 201 struct vinum_subdisk 202 { 203 char which_device[64]; 204 }; 205 206 struct vinum_plex 207 { 208 int raidlevel; 209 int stripesize; 210 int subdisks; 211 struct vinum_subdisk sd[MAXIMUM_RAID_DEVS]; 212 }; 213 214 struct vinum_volume 215 { 216 char volname[64]; 217 int plexes; 218 struct vinum_plex plex[9]; 219 }; 220 221 struct raidlist_itself 222 { 223 int entries; 224 struct list_of_disks spares; 225 struct list_of_disks disks; 226 struct vinum_volume el[MAXIMUM_RAID_DEVS]; 227 }; 228 194 struct vinum_subdisk { 195 char which_device[64]; 196 }; 197 198 struct vinum_plex { 199 int raidlevel; 200 int stripesize; 201 int subdisks; 202 struct vinum_subdisk sd[MAXIMUM_RAID_DEVS]; 203 }; 204 205 struct vinum_volume { 206 char volname[64]; 207 int plexes; 208 struct vinum_plex plex[9]; 209 }; 210 211 struct raidlist_itself { 212 int entries; 213 struct list_of_disks spares; 214 struct list_of_disks disks; 215 struct vinum_volume el[MAXIMUM_RAID_DEVS]; 216 }; 217 229 218 #else 230 219 231 220 /** 232 221 * A RAID device in the raidlist. 233 222 */ 234 struct raid_device_record 235 { 223 struct raid_device_record { 236 224 /** 237 225 * The name of the RAID device (e.g. /dev/md0). 238 226 */ 239 227 char raid_device[64]; 240 228 241 229 /** 242 230 * The RAID level (-1 to 5) we're using. 243 231 */ 244 232 int raid_level; 245 233 246 234 /** 247 235 * Whether the disk has a persistent superblock. 248 236 */ 249 237 int persistent_superblock; 250 238 251 239 /** 252 240 * The chunk size of this RAID device. 253 241 */ 254 242 int chunk_size; 255 243 256 244 /** 257 245 * A list of the disks to use for storing data. 258 246 */ 259 247 struct list_of_disks data_disks; 260 248 261 249 /** 262 250 * A list of the disks to use as "hot spares" in case one dies. 263 251 */ 264 252 struct list_of_disks spare_disks; 265 253 266 254 /** 267 255 * A list of the disks to use for storing parity information. 268 256 */ 269 257 struct list_of_disks parity_disks; 270 258 271 259 /** 272 260 * A list of the disks in this RAID device that have failed\. Rare. 273 261 */ 274 262 struct list_of_disks failed_disks; 275 263 276 264 /** 277 265 * The additional RAID variables for this device. 278 266 */ 279 280 281 282 267 struct additional_raid_variables additional_vars; 268 }; 269 270 /** 283 271 * The list of RAID devices. 284 272 * This is intended to be used along with the mountlist, and it can be 285 273 * directly loaded from/saved to raidtab format. 286 274 */ 287 struct raidlist_itself 288 { 275 struct raidlist_itself { 289 276 /** 290 277 * The number of entries in the list. 291 278 */ 292 279 int entries; 293 280 294 281 /** 295 282 * The RAID devices in the raidlist, all @p entries of them. 296 283 */ 297 298 284 struct raid_device_record el[MAXIMUM_RAID_DEVS]; 285 }; 299 286 300 287 #endif … … 316 303 * extremely strange and hard-to-track errors in chop_filelist(), since optimal_set_size is 0. 317 304 */ 318 struct s_bkpinfo 319 { 305 struct s_bkpinfo { 320 306 /** 321 307 * The device we're backing up to. … … 324 310 * If backup_media_type is anything else, this should be blank. 325 311 */ 326 char media_device[MAX_STR_LEN/4];312 char media_device[MAX_STR_LEN / 4]; 327 313 328 314 /** … … 333 319 * @bug This should probably be only one variable, not an array. 334 320 */ 335 long media_size[MAX_NOOF_MEDIA+1];321 long media_size[MAX_NOOF_MEDIA + 1]; 336 322 337 323 /** … … 347 333 * The function which_boot_loader() can help you set this. 348 334 */ 349 335 char boot_loader; 350 336 351 337 /** … … 354 340 * to take truncate_to_drive_name() of where_is_root_mounted(). 355 341 */ 356 char boot_device[MAX_STR_LEN/4];342 char boot_device[MAX_STR_LEN / 4]; 357 343 358 344 /** … … 361 347 * compression_level is 0. 362 348 */ 363 char zip_exe[MAX_STR_LEN/4];349 char zip_exe[MAX_STR_LEN / 4]; 364 350 365 351 /** … … 367 353 * bz2, gzip uses gz, etc. Do not include the dot. 368 354 */ 369 char zip_suffix[MAX_STR_LEN/4];355 char zip_suffix[MAX_STR_LEN / 4]; 370 356 371 357 /** … … 382 368 * This is a useful feature, but use at your own risk. 383 369 */ 384 char image_devs[MAX_STR_LEN/4];370 char image_devs[MAX_STR_LEN / 4]; 385 371 386 372 /** 387 373 * The compression level (1-9) to use. 0 disables compression. 388 374 */ 389 375 int compression_level; 390 376 391 377 /** … … 395 381 * and @p zip_suffix. 396 382 */ 397 383 bool use_lzo; 398 384 399 385 /** … … 403 389 * will be recompressed again. 404 390 */ 405 char do_not_compress_these[MAX_STR_LEN/2];391 char do_not_compress_these[MAX_STR_LEN / 2]; 406 392 407 393 /** 408 394 * If TRUE, then we should verify a backup. 409 395 */ 410 396 bool verify_data; 411 397 412 398 /** 413 399 * If TRUE, then we should back up some data. 414 400 */ 415 401 bool backup_data; 416 402 417 403 /** 418 404 * If TRUE, then we should restore some data. 419 405 */ 420 421 422 406 bool restore_data; 407 408 423 409 /** 424 410 * If TRUE, then we should backup/restore using star, not afio 425 411 */ 426 427 412 bool use_star; 413 428 414 429 415 /** 430 416 * Size of internal block reads/writes 431 417 */ 432 433 418 long internal_tape_block_size; 419 434 420 /** 435 421 * If TRUE, we're making a CD that will autonuke without confirmation when booted. 436 422 */ 437 423 bool disaster_recovery; 438 424 439 425 /** … … 442 428 * If backup_media_type is anything else, this is ignored. 443 429 */ 444 char isodir[MAX_STR_LEN/4];430 char isodir[MAX_STR_LEN / 4]; 445 431 446 432 /** … … 449 435 * If backup_media_type is anything else, this is ignored. 450 436 */ 451 char prefix[MAX_STR_LEN/4];437 char prefix[MAX_STR_LEN / 4]; 452 438 453 439 /** … … 456 442 * As such, it needs to be at least as large as the largest CD/DVD/ISO. 457 443 */ 458 char scratchdir[MAX_STR_LEN/4];444 char scratchdir[MAX_STR_LEN / 4]; 459 445 460 446 /** … … 464 450 * of space here. 465 451 */ 466 char tmpdir[MAX_STR_LEN/4];452 char tmpdir[MAX_STR_LEN / 4]; 467 453 468 454 /** … … 471 457 * needn't set it yourself. 472 458 */ 473 459 long optimal_set_size; 474 460 475 461 /** 476 462 * The type of media we're backing up to. 477 463 */ 478 464 t_bkptype backup_media_type; 479 465 // bool blank_dvd_first; 480 466 … … 484 470 * If FALSE, then we use the filelist whose name is specified in @p include_paths. 485 471 */ 486 472 bool make_filelist; 487 473 488 474 /** … … 491 477 * If you do nothing, "/" will be used. 492 478 */ 493 479 char include_paths[MAX_STR_LEN]; 494 480 495 481 /** … … 498 484 * the scratchdir, and the tempdir are automatically excluded. 499 485 */ 500 486 char exclude_paths[MAX_STR_LEN]; 501 487 502 488 /** … … 505 491 * without overwriting the old ones. Ignored during a backup. 506 492 */ 507 493 char restore_path[MAX_STR_LEN]; 508 494 509 495 /** 510 496 * A command to call BEFORE making an ISO image. 511 497 */ 512 498 char call_before_iso[MAX_STR_LEN]; 513 499 514 500 /** 515 501 * A command to call to make an ISO image. 516 502 */ 517 503 char call_make_iso[MAX_STR_LEN]; 518 504 519 505 /** 520 506 * A command to call to burn the ISO image. 521 507 */ 522 508 char call_burn_iso[MAX_STR_LEN]; 523 509 524 510 /** 525 511 * A command to call AFTER making an ISO image. 526 512 */ 527 513 char call_after_iso[MAX_STR_LEN]; 528 514 529 515 /** … … 531 517 * included with Mindi. 532 518 */ 533 519 char kernel_path[MAX_STR_LEN]; 534 520 535 521 /** … … 539 525 * address form. (Domain names will be resolved in post_param_configuration().) 540 526 */ 541 527 char nfs_mount[MAX_STR_LEN]; 542 528 543 529 /** … … 545 531 * the backups in. 546 532 */ 547 533 char nfs_remote_dir[MAX_STR_LEN]; 548 534 549 535 /** … … 551 537 * after nuking the system. If "", do not use a post-nuke tarball. 552 538 */ 553 539 char postnuke_tarball[MAX_STR_LEN]; 554 540 555 541 /** … … 557 543 * writing to them. This has no effect for DVDs. 558 544 */ 559 545 bool wipe_media_first; 560 546 561 547 // patch by Herman Kuster … … 564 550 * (files changed since last full backup) are supported. 565 551 */ 566 552 int differential; 567 553 // end patch 568 554 … … 570 556 * If TRUE, then don't eject media when backing up or restoring. 571 557 */ 572 558 bool please_dont_eject; 573 559 574 560 /** 575 561 * The speed of the CD-R[W] drive. 576 562 */ 577 563 int cdrw_speed; 578 564 579 565 /** … … 582 568 * it probably falls into this category. 583 569 */ 584 570 bool manual_cd_tray; 585 571 586 572 /** … … 588 574 * or so. It is useful in testing. Use with care. 589 575 */ 590 576 bool nonbootable_backup; 591 577 592 578 /** 593 579 * If TRUE, make the bootable CD use LILO/ELILO. If FALSE, use isolinux (the default). 594 580 */ 595 581 bool make_cd_use_lilo; 596 582 }; 597 583 … … 603 589 * @bug My understanding of this structure is horrendously incomplete. Could you please fill in the details? 604 590 */ 605 struct s_node 606 { 591 struct s_node { 607 592 /** 608 593 * The character this node contains. 609 594 */ 610 595 char ch; 611 596 612 597 /** 613 598 * The node to the right of this one. 614 599 */ 615 600 struct s_node *right; 616 601 617 602 /** 618 603 * The node below this one. 619 604 */ 620 605 struct s_node *down; 621 606 622 607 /** 623 608 * If TRUE, then this node is selected (for restore, for example). 624 609 */ 625 610 bool selected; 626 611 627 612 /** 628 613 * If TRUE, then we want to see the directories below this one. 629 614 */ 630 615 bool expanded; 631 616 }; 632 617 … … 638 623 */ 639 624 struct s_wrapfifo { 640 625 /** 641 626 * The device we write to or read from (a FIFO). 642 627 */ 643 char public_device[MAX_STR_LEN /4];644 645 628 char public_device[MAX_STR_LEN / 4]; 629 630 /** 646 631 * The actual device that data from the FIFO should be buffered and written to. 647 632 */ 648 char private_device[MAX_STR_LEN /4];649 650 633 char private_device[MAX_STR_LEN / 4]; 634 635 /** 651 636 * A buffer for holding data read from the FIFO. 652 637 */ 653 char internal_buffer_IN_fifo[MAX_STR_LEN /4];654 655 638 char internal_buffer_IN_fifo[MAX_STR_LEN / 4]; 639 640 /** 656 641 * A buffer for holding data to be written to the FIFO. 657 642 */ 658 char internal_buffer_OUT_fifo[MAX_STR_LEN /4];659 660 643 char internal_buffer_OUT_fifo[MAX_STR_LEN / 4]; 644 645 /** 661 646 * If TRUE, then we're writing directly to the tape streamer; if FALSE, we're writing to the FIFO. 662 647 */ … … 672 657 */ 673 658 struct s_filename_and_lstat_info { 674 659 /** 675 660 * The filename of the file this structure is describing. 676 661 */ 677 662 char filename[MAX_STR_LEN]; 678 663 679 664 /** 680 665 * The MD5 checksum (32 hex digits) of this file. 681 666 */ 682 667 char checksum[64]; 683 668 684 669 /** 685 670 * Unused; kept for backwards compatibility. 686 671 */ 687 672 char for_backward_compatibility; 688 673 689 674 /** 690 675 * The stat buffer for this file. 691 676 * Generated with a call to <tt>lstat(&(struc->properties))</tt> where @p struc … … 701 686 */ 702 687 struct s_filelist_entry { 703 688 /** 704 689 * The name of the file. 705 690 */ 706 691 char filename[MAX_STR_LEN]; 707 692 /** 708 693 * The severity if the file has changed between the backup and live filesystem. 709 694 * This is on a scale from 1 to 3, 3 being the most important. File patterns which cause … … 737 722 * @see severity_of_difference 738 723 */ 739 724 int severity; 740 725 }; 741 726 … … 745 730 */ 746 731 struct s_filelist { 747 732 /** 748 733 * The number of entries in the list. 749 734 */ 750 751 752 735 int entries; 736 737 /** 753 738 * The entries themselves, all @p entries of them. 754 739 */ … … 761 746 */ 762 747 struct s_tapecat_entry { 763 748 /** 764 749 * The type of archive it is (afioball, slice, or something else). 765 750 */ 766 751 t_archtype type; 767 752 768 753 /** 769 754 * The filelist number or biggiefile (not slice!) number. 770 755 */ 771 756 int number; 772 757 773 758 /** 774 759 * The slice number if it's a biggiefile. 775 760 */ 776 761 long aux; 777 762 778 763 /** 779 764 * The tape position at the point this entry was added. 780 765 */ 781 766 long long tape_posK; 782 767 783 768 /** 784 769 * The filename of the file cataloged here. 785 770 */ 786 char fname[MAX_TAPECAT_FNAME_LEN +1];771 char fname[MAX_TAPECAT_FNAME_LEN + 1]; 787 772 }; 788 773 … … 792 777 */ 793 778 struct s_tapecatalog { 794 779 /** 795 780 * The number of entries in the tape catalog. 796 781 */ 797 782 int entries; 798 783 799 784 /** 800 785 * The entries themselves, all @p entries of them. 801 786 */ … … 806 791 807 792 struct s_mdrec { 808 int md; 809 int raidlevel; // 0, 1, 5793 int md; // /dev/mdN 794 int raidlevel; // 0, 1, 5 810 795 struct list_of_disks disks; 811 796 int progress; … … 816 801 struct s_mdrec el[MAXIMUM_RAID_DEVS]; 817 802 }; 818
Note:
See TracChangeset
for help on using the changeset viewer.