pax_global_header00006660000000000000000000000064133273773210014522gustar00rootroot0000000000000052 comment=86c44e3fa02f1d5b4902991e7edb1f76ee3c2da8 UnixAgent-2.4.2/000077500000000000000000000000001332737732100134315ustar00rootroot00000000000000UnixAgent-2.4.2/.github/000077500000000000000000000000001332737732100147715ustar00rootroot00000000000000UnixAgent-2.4.2/.github/Contributing.md000066400000000000000000000123101332737732100177570ustar00rootroot00000000000000

Banner

OCS Inventory

Some Links:
Ask question | Installation | Website

# OCS Inventory Contributing Guidelines ## Pull Request Process 1. Fork it! 2. Create your feature branch: `git checkout -b my-new-feature` 3. Add your changes: `git add folder/file1.php` 4. Commit your changes: `git commit -m 'Add some feature'` 5. Push to the branch: `git push origin my-new-feature` 6. Submit a pull request ! ## Pull Request Informations When contributing, please open an issue before or contact the team using mail. This will prevent all the duplicate of work. Also, check if your contribution is not already in the roadmap or affiliated to an issue. If you are contributing on a small scale (translation, a few line modification), you don't need open an issue or contact the team but you will need to explain what you've done in the Pull Request comment and provide as accurate commit messages as possible. Cf. Commits Messages Name Informations If you need to discuss about a big change or need some help of our team during the development of your contribution, we can use other communication method like Telegram, IRC, Skype. ## Commits Messages Name Informations Try to create as accurate as possible commit messages. This will help us to speed up the review process and to reduce the misunderstanding (which can lead to a Pull Request to be rejected) There is no commit messages convention but here are some examples : 1. Create as short as possible commit name 2. One commit for one modification 3. Always leave the second commit line blank If it seems difficult to summarize what your commit does, it may be because it includes several logical changes or bug fixes, and are better split up into several commits using `git add -p`. ## Code of Conduct ### Our Pledge In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation. ### Our Standards Examples of behavior that contributes to creating a positive environment include: * Using welcoming and inclusive language * Being respectful of differing viewpoints and experiences * Gracefully accepting constructive criticism * Focusing on what is best for the community * Showing empathy towards other community members Examples of unacceptable behavior by participants include: * The use of sexualized language or imagery and unwelcome sexual attention or advances * Trolling, insulting/derogatory comments, and personal or political attacks * Public or private harassment * Publishing others' private information, such as a physical or electronic address, without explicit permission * Other conduct which could reasonably be considered inappropriate in a professional setting ### Our Responsibilities Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior. Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful. ### Scope This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers. ### Enforcement Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at `contact@ocsinventory-ng.org` . All complaints will be reviewed and investigated and will result in a response that is deemed necessary and appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately. Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership. ### Attribution This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [http://contributor-covenant.org/version/1/4][version] [homepage]: http://contributor-covenant.org [version]: http://contributor-covenant.org/version/1/4/ UnixAgent-2.4.2/.github/ISSUE_TEMPLATE.md000066400000000000000000000005661332737732100175050ustar00rootroot00000000000000*It's hard to solve a problem when important details are missing, that why we added this template, to help you and us.* ### General informations Operating system : Perl version : ### OCS Inventory informations Unix agent version : ### Problem's description *Describe your problem here* ### Inventory log file ( optional ) *Use github cloud or trusted upload website* UnixAgent-2.4.2/.github/PULL_REQUEST_TEMPLATE.md000066400000000000000000000020301332737732100205650ustar00rootroot00000000000000## Must read before submitting Please, take a look to our contributing guidelines before submitting your pull request. There's some simple rules that will help us to speed up the review process and avoid any misunderstanding [Contributors GuideLines](https://github.com/OCSInventory-NG/OCSInventory-ocsreports/blob/master/.github/Contributing.md) ## Status **READY/IN DEVELOPMENT/HOLD** ## Description A few sentences describing the overall goals of the pull request's commits. ## Related Issues Put here all the related issues link ## Todos - [ ] Tests - [ ] Documentation ## Test environment If some tests has been already made, please give us your test environment' specs #### General informations Operating system : Perl version : #### OCS Inventory informations Unix agent version : ## Deploy Notes Notes regarding deployment the contained body of work. These should note any dependencies changes, logical changes, etc. 1. ## Impacted Areas in Application List general components of the application that this PR will affect: * UnixAgent-2.4.2/.gitignore000066400000000000000000000007571332737732100154320ustar00rootroot00000000000000# Mac OS Specific dir .DS_Store build/ *.old # Iceberg specific dir tools/macosx/installer_gui/iceberg/OCSNG.app/ tools/macosx/installer_gui/iceberg/ocscontact tools/macosx/installer_gui/iceberg/plugins/ # Ignore darwin perl lib if un tar from script repository tools/macosx/scripts/darwin-perl-lib/ # Xcworkspace and user data project.xcworkspace/ xcuserdata/ # perl Makefile.PL /MYMETA.json /MYMETA.yml /Makefile /ipdiscover /run-postinst # make /blib/ /pm_to_blib # make dist /*.tar.gz UnixAgent-2.4.2/AUTHORS000066400000000000000000000006601332737732100145030ustar00rootroot00000000000000Maintainer: Frank Bourdeau Former maintainers: Guillaume PROTET Gonéri LE BOUDER Based on the legacy OCS Linux agent (Copyright (C) 2005-2008 Pascal DANEK ) Copyright 2006-2018 OCS Inventory contributors Website: http://www.ocsinventory-ng.org Please read THANKS to get the list of the contributors UnixAgent-2.4.2/Changes000066400000000000000000001434541332737732100147370ustar00rootroot00000000000000Revision history for Ocsinventory::Agent 2.4.2 * Fix warning argument freebsd isn't numeric * Fix Debian repository * Update manifest * Fix name and url in Repository * Fix for Ubuntu and older Debian version * Merge PR #141,#135,#143 * Fix spelling errors * Add arcconf for Adaptec * Fix issue #124 * Replace hpacucli with ssacli * Merge PR #144,#145,#146,#147,#148,#150 * Make use of EDID utilities optional on modern kernels * Fallback to mainboard serial if bios serial is not available * Merge PR #152, #156, #158, #159 * Fix issue for ipdiscover * Indicate god value for memory * Use now Parse::EDID module to retrieve monitor infomrations * Merge PR #161, #163, #164, #165, #169, #170, #172, #173, #174 2.4.1 * Add the date of installation for debian/ubuntu packages * Add support for zfs * Rewrite cpu bsd * Fix some bugs on Repository/Deb.pm file * Ipmi.pm : fix fatal typo * Bios.pm : fix "invalid" message * UUID.pm : fix "invalid" message * Virtualization : fix for Proxmox * Fix for vlans * Fix virsh out 2.4 * Add test to switch 'waitpid command' according to OS * change bazar revision number to git revision number * ipdiscover: fix default latency * Ignore files which are created during installation * Fix and improve comments in module.conf * Fix some typos * Update MANIFEST * Fix code which disables SSL certificate verification * Fix storage parameters from smartctl * Fix markdown syntax and typo in README.md * Use pkg command on Solaris 11 to create the Software Inventory * Upgraded memconf to v3.14 (support for SPARC T7-4 and S7-2) * New feature: repositories inventory * Fix problem line 280 * Issues corrections * Retrieve info for apfs formatted drive * correct df check for AIX * Fix regexp for listing network interfaces on macOS * Update Mem.pm * Update Agent.pm 2.3 * Suppress functions can_run, can_load, can_read from Backend. Those from Common.pm are now used * Update libraries snapshot for release 2.2 * Suppress reference message to support "No support detected. Registration key: N/A" * Linux storages now supports Megacli raid * Merge Mysteq PR "centos-release is the correct file to check" * Merge XANI PR "read edid from sysfs, fallback to old method if no monitor is found" * Fix bugs in Network.pm and IP.pm files (OS Linux) * Correction for usb inventory * Retrieve Docker container informations * Update memconf command to last revision * Add enhancement support for Xen xl command (xm command already present) 2.2rc1 * Update memconf command to last revision * Fix Bug #1466748 Interface Detection Infiniband MAC wrong * Fix Bug #1423905 Failed HTTP auth if password contains # character * Fix syntax error in BSDpkg.pm file * HPUX/Solaris: use --nosoftware instead of --nosoft * Correction of graphics resolution * Retrieve speed and duplex from a different way * Enhancement: unix agent can now report battery inventory * Enhancement: unified agent can retrieve lxc container * Suppress --nosoft option * Fix Bug #1440626 Typo error in Alpha/CPU.pm * Fix Bug #1438719 pkg_list has been deprecated on FreeBSD so no software inventory is gathered on those systems * Fix Bug #1438021 Support s390x processors * Fix Bug #1436702 Wrong disk size * Fix Bug #1435675 AIX typo error in Hardware.pm * Fix Bug #1431844 données de HDD SAS/SAN manquantes AIX 5.3, 6.1 et 7.1 * Fix Bug #1420073 Linux/Archs/i386/CPU.pm reports incorrect CPU information * Fix Bug #1409671 PROCESSORS bad value on PowerPC arch * Fix Bug #1405167 Presentation of OS Name and OS Version * Fix Bug #1389255 Nombre d'interfaces recherchees * Fix Bug #1376787 [UNIX Agent] Feature request: report Fusion-io cards * Fix Bug #1364123 created script perl for xenserver * Fix Bug #1350240 --nosoftware does'nt work on aix * Fix Bug #1342038 Wrong data for cores on Unix Agent 2.1.1 * Fix Bug #1322088 CPU show 0 on VM libvirt * Fix Bug #1319683 libvirt VM partial detection * Fix Bug #1293588 CPU on Ubuntu may not be detected because of `arch` command and Dumper reference * Fix Bug #1246427 CentOS Linux 6 not identified * Fix Bug #1201734 Hyper-V virtual machines not recognized as "Virtual Machine" by agent * Fix Bug #1159742 Ipmi.pm does not load Net::IP at the right place * Fix Bug #1064296 ipv4 handling fix 2.1.1 * Add number of socket in Linux/Archs/i386/CPU.pm * Add hyperthreading support in Linux/Archs/i386/CPU.pm * Fix Bug #1312830 about missing CPU information * Update memconf command to last revision * Add new file to detect Oracle distro * Fix CPU.pm which couldn't retrieve multi socket processors * Fix Bug #1045356 about regression in ifconfig parsing * Fix a mistake in tag in 6876.xml * Move lib/Ocsinventory/Oracle and lib/Ocsinventory/Apache directories in lib/Ocsinventory/agent/Modules directory * Fix a mistake in Hooks.pm which makes Download.pm and Snmp.pm not loaded by agent * Fix problem on path of arch command * Fix debug trace in CPU.pm * Fix a translation mistake in MacOSX agent French installer 2.1 * Fix #Bug 1272425 about status of libvirt virtual machines not reported * Fix blueprint about installation date in the report of the installed software * Fix blueprint about UUID value in the hardware Table * Fix Bug #1247190 about default gateway as gateway for all interfaces under Linux * Add new screen code for edid (PTS) * Add new module to retrieve Nvidia cards * Add new module to retrieve virtual machines on vmware workstation * Return corrected values for storage under Fedora 19 * Fix Bug #1247190 about default gateway as gateway for all interfaces under Linux * Add new screen code for edid (PTS) * Add new module to retrieve Nvidia cards * Add new file to detect CentOS distro * Add new module to retrieve virtual machines on vmware workstation * Return corrected values for storage under Fedora 19 * Fix Bug #1206514 about enhancing modules loading to allow directories * Fix a bug in Common.pm about processes data marked as virtualmachines data * Fix Bug #1216935 about Mac user agent not generating UUID * Fix Bug #1237682 about RPM.pm INSTALLDATE format not always accepted by MySQL * Retrieve the speed of network card * Add a new log message when unable to scan a SNMP devices in Snmp.pm * Fix problem about IP address tests in Snmp.pm * Remove "-pP" option passed to nmap in Snmp.pm * New module to retrieve NetApp devices using SNMP * New module to retrieve Sun devices using SNMP * Add new value to BIOS.pm * Fix bugs in CUPS.pm and Usb.pm files * Retrieve new values for CPU * Update memconf command to latest version * Fix bugs about usb in Lsusb.pm and Common.pm * Add retrieve of usb connected devices * Fix Bug #1198088 about wrong data for processors under 2.1 RC1 * Fix bug about SNMP v3 in 9.pm * Fix bug about custom network scanning in Snmp.pm * Add retrieve of video memory size * Fix Bug #1169675 about error message about SSL_verify_mode of SSL_VERIFY_NONE under Fedora 18 2.1rc1 * Fix Bug #1095989 about a bad regex in Libvirt.pm * Fix Bug #1032393 about softwares bot inventoried vi dpkg-query * Add custom SNMP MIBs XML copy from sources in postinst.pl * Getting monitor serial number in MacOS/Video.pm * Add a new configuration option for SSL certificate check in MacOSX agent installer * Add new screen codes for edid * Fix Bug ##1117110 about missing number of CPU socket * Add availibility to reforce a package deployment * Code rewrite in Common.pm to prevent sending empty XML tags to OCS server * Fix Bug #1086086 about uses of initialized value in Snmp.pm * Fix Bug #1087270 about zombie processes when running in daemon mode * Fix Bug #1086078 about use of initialized value * Fix Bug #1070788 about zip packages support * Fix Bug #1045356 about ifconfig parsing issue (Fedora >=17) * New availability to scan custom network with SNMP using a network address received from server * Fix Bug #1049626 about Qemu virtualization not detected on proxmox * Fix Bug #1040197 about VLAN interface AIX support * Add detect CPU architecture * AIX memory module change * Add many informations about CPU (l2cachesize, status, socket designation, cores number) * Fix Bug #882574 about parsing of dmidecode fails on SMBIOS warning * Fix Bug #984699 about the Output of 'ps' in VirtualBox module is displayed in stdout * Fix Bug #571655 about the Wrong Sys:Syslog usage * Retrieve family, serial number, number of processors, clockrate for BSDsystems * New module for inventoring Oracle databases * Multiples monitors patch added * Fix Bug #1023670 about memconf not working with HP-UX 11.31 * New version of Gentoo.pm * New Backend/Virtualization/Parallels.pm module for Parallels virtual machines inventory * Plugin Processes moved as module * Fix Bug #911492 about Freebsd Storage drives not being reported * Fix Bug #911491 about Freebsd CPU info not reporting properly * Fix Bug #873377 about Installed packages on Gentoo * Add OS/Linux/LVM.pm module for Logical Volume Manager support * New Snmp/231.pm module for Fujistu devices * postinst.pl can now be launched in non-interactive mode using new "--nowizard" launch option * Adding all the configuration options as launching arguments in postinst.pl * Adding new interactive questions about "debug", "logfile", "ssl" and "ca" configuration options in postinst.pl * Download.pm uses LWP useragent initiated by Network.pm for SSL checks * Download.pm uses LWP useragent initiated by Network.pm for info and frags files downloads * Network.pm can use LWP version 6 SSL useragent options * New --ca configuration option to specify a CA certificate path for SSL certificate checks * New --ssl configuration option to enable/disable SSL certificate checks * Customize SNMP scans using a special XML format received from server * Getting network devices MAC address during SNMP scans * Availibity to scan any networks SNMP devices using nmap or ping scans * SNMP v3 available for SNMP scans * Add new --ssl configuration option to enable or disable certificate check during SSL communications * Change 'SERIAL' field name and add checksum for inventory XML CPUS section * Now getting MANUFACTURER and SERIALNUMBER in Snmp/3375.pm * Add new fields in setSnmpLoadBalancer() method in Common.pm * Fix Bug #1085020 about ERR_ALREADY_IN_HISTORY message that should be success * Fix bug with SNMP cartridges and trays in Common.pm * Add new MacOS/Controller.pm module to get controllers inventory under MacOSX * Add new MacOS/Slots.pm module to get slots inventory under MacOSX * Add missing DESCRIPTION field in addController() in Common.pm * Set debug and lazy options to 0, in generated ocsinventory-agent.cfg file by macOSX graphic installer, if check boxes are not selected * Add a new configuration option to set lazy mode in MacOSX graphic installer * Improve MacOSX postinstall script to able to deploy MacOSX agent using NetInstall 2.0.5 * Fix Bug #953968 about MacOSX OCSNG.app crash under MacOSX 10.4 64 bits * Fix bug about illegal hexadecimal digit in Snmp/Host_Resources_Mib.pm * Fix segfault and buffer overflow bugs in ipdiscover.c * Improve OCS MacOSX agent internationalization support * Back to previous pane after wrong OCS server address warning in MacOSX installer 2.0.4 * Improve memory slots detection under MacOSX 10.7 in MacOS/Mem.pm * Force OCSNG.app to become the topmost window in tools/macosx/ocsng_app-xcode/main.m * Fix Bug #901570 about wrong printer name if no printer found in MacOS/Printers.pm * Solving CPU and memories inventory detection under MacOSX Snow Leopard and MacOSX Lion * Modifying MacOSX backend files to use the new Mac::Sysprole Perl module version * Fix Bug #887534 about invalid CREATEDATE in lib/Ocsinventory/Agent/Backend/OS/Linux/Drives.pm 2.0.3 * Fix Bug #881406 about security issue due to snmp_com.txt file which is no longer used * Fix Bug #874269 about wrong conversion if hard drive >= TB in MacOS/Storages.pm * Fix Bug #879487 about a misplaced object release in ocs_agent_configPane.m 2.0.2 * Fix bug on "Debug Mode" checkbox in MacoSX installer * Fix bug while sending ERR_DOWNLOAD_INFO message in Donwload.pm * Fix Bug #856161 about installer problems on MacOSX Tiger 2.0.1 * New SNMP data using If_Mib.pm: IP address, netmask, gateway and routing informations * Use the "public" SNMP community if no community defined in OCS server configuration * Various bug fixes in Snmp.pm * New 2.0 MacOSX integration * Bug #798428 about standalone agent building * Change variable names to lowercase in Snmp/3375.pm * Fix a closedir omission in Solaris/Packages.pm * Modify releases tarball name when building it using make dist command * Various patches for CPU, Bios and Drives detection for HPUX systems * Fix Bug #781732 about a missing chomp() in Processes.pm 2.0 * Fix Bug #778692 about using authentication when sending messages in Download.pm * Patch from Yoann Le Bihan for Solaris zones support * Fix Bug #586321 about wrong version comparison in Vmsystem.pm * Bug #772436 about download end message report in Download.pm * Display support log received from PROLOG * Various patches for Snmp/9.pm module (Cisco) * Add --nolocal option to desactivate local mode even if it is set in config file or command line * Fix Bug #767290 about /etc/sysconfig/ocsinventory-agent server settings ignore (only for Redhat like distributions) * Only inventory vitualmachines which have an UUID in VirtualBox.pm to prevent inventoring USB devices or shared folders as virtualmachines 2.0rc4 * Complety clean the disastrous treatments of accountinfos while receiving it from server,storing it in file and adding it in inventory * Fix UTF8 problems due to XML::Simple::XMLIn() 2.0rc3 * Fix Bug #720635 about lspci usage on old Linux distributions * Fix Bug #720626 about Gentoo packages with hyphen in their names * Fix a bug with the use of pacman tool on ArchLinux. We now launch the real packages manager instead of the famous game ;) ;) * Avoid perl errors when no answer from OCS server * Enhance logging in Snmp.pm and Download.pm when disabling this modules (local mode or prerequisites not OK) * Patches from Bernhard Denner to enhance CPU and memry detection on old SUN solaris workstations * Patch from Bernhard Denner to enhance dhcp-leases files detection on Linux systems 2.0rc2 * Add a new cleanXml() subroutine in Common.pm to clean non printable characters in both standard inventory and SNMP inventory * Various patches for Snmp/9.pm module (Cisco) * Add a new addSnmpCPU() subroutine in Common.pm * Disabling Download.pm if agent running in local mode 2.0rc1 * Add download_start_handler to check if Net::SSLeay can be load and disable Download.pm if not * Add Net::SNMP optional dependency in README file. * Delete Win32 from backend * Various patches for 9.pm and If_Mib.pm to enhance ethernet ports speed display (Françs Mermet) * New SNMP modules for Juniper, Futjitsu and F5 vendors (Françs Mermet) * Fix Bug #682689 about missing data for disk when can't run lshal command (Bernhard Denner) * Add a warning message about user privacy in man page for --scan-homedirs option * Various patches for 8072.pm an If_Mib.pm (Françs Mermet) * Change timeout for Backend modules from 180 to 600 seconds * Change timeout for Backend modules from 180 to 600 seconds * Back on the ipdiscover binary from the old OCS Linux Agent to make network scans lighter than Nmap. Ipdiscover binary is only available under Linux systems * Use LaunchDaemons instead of LaunchAgents in MacOSX package * Fix SSL errors if no URL is given by the server in Snmp.pm * Do SNMP scans and treatments only if asked by the server * Delete some useless logs in debug for SNMP constructors and standard MIBs modules * Change oid_value in snmp_info subroutine in Printer_Mib.pm * New SNMP 2620.pm module for Checkpoint Software Technologies constructor (Françs Mermet) * Add new "DEVICEPORT" and "DEVICETYPE" fields in addSnmpnetwork() in Common.pm * 311.pm and 8072.pm use setSnmpComputer() to set the type of SNMP device * Add a new addSnmpInput() subroutine in Common.pm * Fix a bug in addSnmpSwitch subroutine in Common.pm * Replace SetSnmpSwitch() subroutine by SetSnmpSwitchInfos() in Common.pm * Set right fields for AddSnmpSwitch() subroutine in Common.pm * Fix various bug on snmp_oid_run subroutine for constructors and standard MIB modules * Fix various mistakes and missing fields in snmp subroutines in Common.pm * Fix a warning due to deprecated syntax in 3ware.pm * Fix a warning due to deprecated syntax in 3ware.pm * Fix a catastrophic performance issue by preventing to run sysctl at every line of demidecode output to get CPU informations on BSD systems * Snmp.pm now download snmp_com.txt file to get informations about SNMP communities for scans using HTTPS * New subroutines called "getHttpFile" and "getHttpsFile" in Network.pm to download files easily using HTTP or HTTPS. * Fix bugs and minor mistakes in Common.pm and If_Mib.pm * Add Lenovo EDID for monitors (Adam Buchbinder) * Disabling Snmp.pm if agent running in local mode * Fix a warning if network interface is down in Ipdiscover.pm * Enhance inventory initialization for a better modularity * Local mode can now use the "inventory_handler" hook * Various patches for SNMP constructors or standard MIB module (Françs Mermet) * Prevent a bug in using Default.pm (Françs Mermet) * Add "ACR" and "EPI" EDID ID for monitors (Adam Buchbinder) * Fix Bug #597752 about TYPE and VOLUMN fiels reversal for BSD systems. * Fix Bug #612515 to report network interface that don't have an IP address (Mick K) * Don't take care of host with no MAC address in Nmap.pm * Add the SOFTWARE field in addSnmpCard subroutine * Enhance Printer_Mib.pm to add information about printer status and printer error state * Snmp.pm now use Default.pm to launch standard MIB modules by default (Françs Mermet) * Upgrade several SNMP contructors/standard MIB modules * Add a new SNMP constructor module for Lexmark * Add a new SNMP module for the standard Entity MIB. * Add a new SNMP module to load standard MIB modules by default * Add new subroutines for SNMP XML feeding for informations about switches, network cards, blades, firewalls etc.... * Correct a log mistacke in Printer_Mib.pm * New 11.pm module to enable SNMP scans on HP devices * Get the SNMP device MACADDR from PROLOG resp to generate the SNMPDEVICEID in Snmp.pm * Add new subroutines in Common.pm for special SNMP XML feed or SNMP special treatments * New Printer_Mib.pm module to get SNMP printers informations 2.0 alpha Tue, 27 Jul 2010 22:27:27 +0100 * Snmp.pm use flushXMLTags() from Common.pm to flush the content of $common->{xmltags} * Modifying the inventory backend to use functions from Common.pm instead of Inventory.pm * New Snmp.pm for SNMP scans integration. It comes with its constructors modules to enhance scans results (a lot of beers to Françs Mermet to thank himfor his help) * Modifying postinst.pl to include Ocsinventory::Agent::Modules::Snmp * Agent.pm : add $logger object in Ocsinventory::Agent::Common instantiation * Common.pm : adding the can_run(), can_load(), can_read() and runcmdi() generic methods. Adding the use of the $logger object * Common.pm : add a new field 'TYPE' in setSnmpCommons() * Agent.pm now uses the new Networks.pm methods and add the $network object in the $context hash * Networks.pm now gives generic methods to send a XML to OCS server and receive a XML from OCS server * New addInput() method in Common.pm to add mouses and keyboards in inventory * Donwload.pm now use 'get_path' and 'already_in_array' functions from the new Common.pm * Common.pm : Replace the former Common.pm by a new one. Common.pm now give a lot of methods for other agent modules * Agent.pm : instanciate Ocsinventory::Agent::Common object and add a reference to it in $context * Use of the Nmap::Parser perl module to correct the very buggy Nmap implementation for Ipdiscover * Various patches for Solaris support (Lucas MASSE) * Fix the network speed data oblivion in Inventory.pm. The network speed can now be added in Network.pm of the several OS backends * Put the prolog_reader hook run at the right place to avoid an error if the agent failed to reach the server * Enhance dom0 support for Xen support (Guillaume ROUSSE) * Add bios informations for Xen PV hosts (Guillaume ROUSSE) * Fix Bug #552727 about getting processes that are running in Solaris (Emengao) * Add the availiability to disable a module using start_handler hook * Debug and code cleaning in Download.pm * Fix Bug #552097 * Add XML::SAX::Expat module include * Replace {REQUEST} and {ADM} by {xmlroot} in xml handling for a better and better readability * Remove text about Win32 port in the README file * Correct a bug in Hooks.pm to pass inventory or prolog to modules * Add headers for the modules logs * Correct a bug in postinst.pl when removing the old Linux agent * Ocsinventory::Agent::Option:: namespace is now Ocsinventory::Agent::Modules:: * Modules now use Perl's object system * Hooks are now methods and not simple subroutines * Hook.pm is now Hooks.pm * Use of a new context hash in Agent.pm * CompatibilityLayer.pm is now Hook.pm * Calling hooks only in Agent.pm * Update HPUX support (Francois Mermet) * Verify ID value received by server in Download.pm * Verify the network syntax in Nmap.pm * Replace an hard coded pattern in Linux/devices.pm * Removing non posix cp option in Download.pm * Upgrade to memconf V2.13 * Add an in contrib example of script to identify specific software (Simon CLARA) * An example of script to use tarball to identify installed software * HP-UX: initial support, tested on RP3440 * Solaris/Network: support Zone * Solaris: use regex to identify CPU class * Improve the README about non-interactive installation * MacOSX: Correctly identify the CPU frequency on MacOSX 1.6 French 1.1.2.1 Tue, 12 Oct 2010 19:42:41 +0100 * Fix a secutiry bug due to the use of ExtUtils::Installed in Backend.pm. See http://bugs.debian.org/590879 and http://www.debian.org/security/2009/dsa-1828 for more informations. Thanks to Remi Collet for his report. 1.1.2 Sun, 27 Dec 2009 17:24:43 +0100 * Avoid problem with dmidecode -V output on RHEL3.9 (Remi COLLET) * Fix internal --delaytime handling. That's seconds, not hours! * Download.pm: improve a error message 1.1.1 Mon, 21 Dec 2009 22:38:12 +0100 * NETWORKS/VIRTUALDEV should be 1 or 0 * FreeBSD: Fix CPU detection (David DURIEUX) * Virtualization::Qemu, fix kvm detection * Don't run brctl if it's not installed * Various wording fixes (Vincent KNECHT) * Improve README (Barius DRUBECK) * Get serial number from ext4 partition if ext4dev driver is used * LP: #494908 Agent fails to retrieve info file when a package is activated only with the server name (Pascal DANEK) * LP: #495398 Fix RedHat version detection (Stéane URBANOVSKI) * LP: #490774 Fix PowerPC CPU detection on Linux, thanks darkpep for the bug report 1.1 Fri, 06 Nov 2009 16:07:08 +0100 * addMemorie() renamed to addMemories(), this had been broken during the addMemories() . addMemory() transition * Debug mode: msg "check function failed" changed to "ignored" since the fails may be wanted by the check() function * CompatibilityLayer: $self->{params} changed to $self->{config}, this restore the debug mode in Download.pm * Continue XML::Inventory functions name clean up. Rename: - addSlots() calls to addSlot() - addMemories() calls to addMemory() * Move ocsinventory-agent POD documentation frol Ocsinventory::Agent to the ocsinventory-agent shell script. So now the manpage has the correct name * Fix RPM output parsing (Remi COLLET) * VMWareESX: avoid breakage is VM has spaces in its name (Christian Michallek) * Try to detect kvm --uuid value * Makefile.PL, check for Net::SSLeay * Move Ocsinventory::Agent in a .pm and add a wrapper script to load in order to by able to process --devlib * Parallels.pm: doesn't use sudo anymore and check for --scan-homedirs * Prune 'Mac OS X' from the version on Mac + typo fixes (Scott HANNAHS) * POD doc, add a paragraph about the config file * LP: #462529, Fix EDID screen detection, thanks Sergio MERINO * Use boolean for networks/virtualdev * Generic/Screen: chomp uuencode output * Generic/Screen: HSD code for "Hanns.G" (Remi COLLET) * postinst.pl, put user $PATH in /etc/cron.d/ocsinventory-agent 1.1_beta1 Fri, 18 Sep 2009 11:54:12 +0200 * Can use Net::CUPS to find the default printer * AIX: Hide procfs in Filesystem * OS::Linux::Storages, correctly retrieve the serial (Vladimir ELISSEEV) * load $http_proxy env settings and --proxy option is available * Add OS::Linux::Distro::NonLSB::ArchLinux (Julien SAFAR) * New Backend OS::Generic::Processes * Linux/BSD: detect DNS servers config * Solaris: Better output for $OSVErsion (Vladimir ELISSEEV) * Solaris: Sun Fire T1000 patches for memory (Vladimir ELISSEEV) * Solaris: memory SPARC Enterprise T5220 (Vladimir ELISSEEV) * Solaris: CPU SPARC Enterprise T5220 (Vladimir ELISSEEV) * Solaris: CPU SPARC Enterprise T5220 (Vladimir ELISSEEV) * Linux: split the /proc/cpuinfo parsing depending on the arch * Linux: drop Linux::Controllers which is duplicated with Generic::Lspci::Controllers (Vladimir ELISSEEV) * AIX: Various fixes in Memory.pm (Sebastien DAGNICOURT) * AIX: Storages.pm, Virtual disks support and fixes (Sebastien DAGNICOURT) * Backend.pm: Bump the default timeout from 30 to 180 secondes * Agent/XML/Inventory: Fix when version == 0, bug found by neisen * AIX: device type adjustment (Sebastien DAGNICOURT) * Solaris: Sun-Fire-V440 support (Sebastien DAGNICOURT) * Add a missing space if the name banner in --debug mode * Agent/XML/Inventory.pm: Add FROM and INSTALLDATE fields in software list and LASTLOGGEDUSER DATELASTLOGGEDUSER in HARDWARE (Nicolas EISEN) * Initialize etcdir key even if there is no config file * CompatibilityLayer: correctly set $debug * CompatibilityLayer: better log messages * getOptionInfoByName return an array ref now * rename getOptionInfoByName to getOptionsInfoByName * --debug print the XML on STDERR * Rename the params key to config to avoid ambiguity with $params * set HARDWARE/DEFAULTGATEWAY (Nicolas EISEN) * RPM: collect the install date and the size (Nicolas EISEN) * Linux: Collect LASTLOGGEDUSER and DATELASTLOGGEDUSER (Nicolas EISEN) * DPKG: collect the Installed-Size (Nicolas EISEN) * Linux: Collect the ext{2,3,4} and xfs serial number * Linux: Collect the ext{2,3,4} creation date * Add a warning when no certificat is found * Turns off alarm once it's backend run is finish * Fix the IPMI module detection * Linux: Store the PCISLOT and the driver name * NETWORKDS, only store Networks with an address * Linux: detect virtual network device * Linux: Store CONTROLLERS/DRIVER and CONTROLLERS/PCISLOT * Linux: Collects xfs, ext{2,3,4} and vfat label * runs the backend module from main() it's possible to reuse the Backend object. * Linux: filter non standard MAC address returned by ifconfig like 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00 mac * Linux: Fix the Uptime check() * Preliminary libvirt support * Partial rewrite of the Download.pm backend * Add a warning if the user is no root, thanks Nicolas EISEN and Sylvain LUCE * SPARC-Enterprise M4000 and M5000 support (Sylvain LUCE) * Libvirt: collect VCPU info (Philippe LIBAT) * Add Virtualization::Xen module (Philippe LIBAT) * Solaris: add a warning if memconf is not in $PATH * Switch the XML content from ISO-8859-1 to UTF-8, BTW we force LC_ALL=C... * Fix the history flood in Download.pm (Pascal DANEK) https://sourceforge.net/tracker/index.php?func=detail&aid=2806585&group_id=58373&atid=487492 * Stores PCIID in CONTROLLERS/PCIID * Storage the monitor EDID string in BASE64 and UUENCODE * Linux: Storages: reorganize the code base and use lshal * Linux: Drives, complete inforamtions with lshal (Nicolas EISEN) * Linux: fix the PowerPC CPU detection https://sourceforge.net/tracker/?func=detail&atid=487492&aid=2043221&group_id=58373 * Warns the user during the install process if one of the recommended module is not installed * Update out copy of memconf, thanks WeatherDave who notified the new revision and of course Tom Schmidt who do a great job * MacOSX: Avoid a scalar used has hash ref error, thanks Adadov * Save VIDEOS/MEMORY and VIDEOS/RESOLUTION * MacOSX: Correctilly detect Up/Down network interfaces (David OLIVIER) * AddNetwork() doesn't ignore network with no IP address (David OLIVIER) * add --backend-collect-timeout parameter (Nicolas EISEN) * MacOSX: convert the IP mask from hex (David OLIVIER) * MacOSX: add a workaround to avoid Mac::SysProfile failure on MacOSX 10.5.7 (David OLIVIER) * Add Virtualization::VirtualBox module (Nicolas EISEN) * Add Virtualization::Qemu module (Nicolas EISEN) * Add Virtualization::Vmsystem module (Nicolas EISEN) * Better smartctl detection (Nicolas EISEN) * optimization and vm users detection Virtualization::VirtualBox (Nicolas EISEN) * Add Virtualization::VmwareFusion module (Walid NOUH) * Don't use hdparm prior 9.2.2 anymore to avoid crap in kernel log, see http://forums.ocsinventory-ng.org/viewtopic.php?pid=20768 * Correctly detect ipmitool * Solaris: i86pc Memory support (Jean-Françs BOUCHER) * Solaris Zone support (Maurizio BERTABONI) * Always send tag, even if server already has one * Add the byHand software collect method (Séstien DAGNICOURT) * add logging to can_read(), can_load() and can_run() * use addUser() instead of setHardware() * Add the runcmd() in the Backend modules 1.0.1 Sun, 22 Mar 2009 20:48:49 +0100 * Fix a typo in Ocsinventory::Agent::Backend::OS::AIX::Memory 1.0 Sun, 22 Mar 2009 20:14:26 +0100 * Hide warning messages when tw_cli or hpacucli are not present on CentOS * Avoid unnecessary about missing 'http://' in local mode * Ipmi.pm: use can_run do detect ipmitool * LSB.pm: properly use can_run * Avoid a warning in CompatibilityLayer.pm in local mode * Improve the README file * Avoid a warning at runtime if rpm is not correctly installed * BSD: Detect AMD64 arch (David DURIEUX) * HP.pm: force detection even if slot 1 is 0 (Remi COLLET) * HP.pm minor clean up + indentation * HP.pm send the $model as NAME to avoid NAME == 'unknown' (Remi COLLET) * New backend module ServeRaid for IBM ServeRAID card (Remi COLLET) * Linux::Storages, fix the hdparm call (Remi COLLET) * OS::Generic::Dmidecode::Bios, fix for RHEL2 dmidecode (Remi COLLET) * launch backend modules with a 30sec timeout * post-inst.pl: use prompt() from ExtUtils::MakeMaker to avoid unexpected error with cpan * avoid the "No LSB modules are available." warning message * Backend: --debug print a warning when arun() function is not found * Fix the Debian/Ubuntu detection for non lsb system * postinst.pl also drops /etc/cron.d/ocsinventory-client if the user wants to drop the old linux_agent * Backend::OS::Solaris::Memory: use the Logger instead of "print" * Solaris: Drop unwanted spaces around OSVERSION and STORAGES/DESCRIPTION * Solaris: Avoid warning if the user can't use fstyp * MANIFEST.SKIP: ignore .git/ and .gitignore * add a workaround for http://rt.cpan.org/Ticket/Display.html?id=38067 * build-perl-tree.sh use cpanp and perl 5.10 now * Backend.pm: do a eval around require File::Find * Add a workaround to find the backend modules for PAR::Packer * Backend.pm: internal change, now do eval 'use $pmodule' instead of require * fix serialnum detection in Lsilogic.pm and Adaptec.pm (Edouard GAMIN) * Makefile.PL: drop wait(), not used * Makefile.PL: fix a syntax error * add tools/makedist.sh to document the workaround used to avoid http://rt.cpan.org/Public/Bug/Display.html?id=43060 * Fix --logfile=/somewhere.log, see http://forums.ocsinventory-ng.org/viewtopic.php?id=3092 * tools/build-perl-tree.sh, add a new script * Don't print ugly error if next_timefile can't be saved * OS::Linux::Domains, improve the way it deals with multiple domaine entries (Remi COLLET) * AIX: Record the last memory Slot (Wilfried BRUNKEN) http://sourceforge.net/tracker/?func=detail&atid=487492&aid=2350694&group_id=58373 * Bump 0.0.10 to 1.0 because it's the first release to be officially part of the OCSInventory distribution 0.0.10beta2 Wed, 24 Sep 2008 23:41:21 +0200 * README: add a not about the $PATH varible on Solaris. * Added extra section support for backends (Pascal DANEK) * Fix the way submodules are disabled with $runMeIfTheseChecksFailed * Linux: Use lsb_release if presents to detect the OS, this will fix the Ubuntu detection * Hide a Perl warning if the agent is run by the user want the last_state file is missing * Add Ipmi backend module (Jean PARPAILLON) * Drop the control characters from the inventory XML https://sourceforge.net/tracker/index.php?func=detail&aid=2100606&group_id=58373&atid=487492 * Apply a little change in standalone.sh that may fix the ParserDetails.ini problem, thanks tharoun 0.0.10beta1 Thu, 04 Sep 2008 18:16:49 +0200 * Fix a "ocs server name" => URI side effect (Pascal DANEK) * Download::Store: used absolute path to "cp" on STORE action (Pascal DANEK) * Download::Store: set -dpR flags to "cp" (Pascal DANEK) * Solaris: Replaced hostid in serialnumber by real serialnumber (Nicolas DORFSMAN) (SUNWsneep becomes mandatory on sparc) * Solaris: Return only one IP address (trying to guess which one corresponds to hostname) (Nicolas DORFSMAN) * Solaris: return disks SERIALNUMBER and FIRMWARE as XML fields (Nicolas DORFSMAN) * Redirection and stderr issue on Solaris (Nicolas DORFSMAN) - Removed close of stderr fd - Modified lspci and screen check() to avoid pollution of stdout/stderr * fix the previous changelog entry, the 0.0.9.1 fix had been done by Nicolas DORFSMAN * postinst.pl checks for MANIFEST present * improve the backend module detection by also scanning the symlinked directory * add the --devlib flag to load ./lib only if wanted and remove '.' from the directory to scan with File::Find. * import the can_run, can_load and can_read functions in the Backend modules * the backend module can have no check function, in this case OCS assume it's ok * apply a patch by Etienne GUILLAUMONT to fix CPU detection on AIX 4 * standalone.sh checks PAR::Packer presence now * only inventory installed .deb * postinst.pl: accept another vardir if the first one was invalide https://sourceforge.net/tracker/?func=detail&atid=487492&aid=1961771&group_id=58373 * postinst.pl Download.pm correctly activated in modules.conf if the user needs it * add MacOSX support thanks to Wes YOUNG (Wes YOUNG) - Added tools/darwin/ support scripts/code for OS X enterprise deployment * add the follow_skip==2 flag to File::Find in Backend.pm so it doesn't detect the same file two time * import of backend module for RAID controller on Linux (3ware, Adaptec, HP and Lsilogic) (Edouard GAMIN) * remove a warning in Debug mod, if a backend module has no run() function * don't crash in Daemon mode if the server is unreachable (Wes YOUNG) * Net::IP is just (strongly) suggested now * fix --basevardir so it really accepts a parameter, thanks Gubluts from the forum who pointed out the bug * postinst.pl use which to find ocsinventory-agent location * Makefile.PL, Perl 5.6 doesn't have Config::config_re, I call it from an eval now * Added --delaytime option as commandline / .cfg file adjustable (Wes YOUNG) * standalone.sh, don't use grep -v since it's not POSIX * doesn't die if Storable.pm is missing like with perl 5.6 * avoid a warning with gzip -h on AIX if Compress::Zlib is missing * README: depends on Perl 5.8 * README: On solaris the Makefile needs gmake * README: Add a note about crontab and PATH * Linux: redirect hdparm error to /dev/null * postinst.pl yes/no questions have a default value now * postinst.pl fix a bug in the import of the old ocsinv.adm https://sourceforge.net/tracker/index.php?func=detail&aid=1991668&group_id=58373&atid=487492 * postinst.pl doesn't create two vardir directories anymore * do not print a wrning is --nosoftware is used. Thanks Knarfling and Remi who pointed the issue out. http://forums.ocsinventory-ng.org/viewtopic.php?pid=12569 * fix the POD documentation, some mistakes were detected by Perl 5.10's perldoc. * the agent doesn't crash anymore if ocsinv.adm or ocsinv.conf is corrupted * Makefile.pl: install memconf on Solaris * Solaris: apply patches to use memconf for CPU, Drives and Memory (Christoph HALMES) 0.0.9.2 04/18/2008 Bug fix * Add /ocsinventory in the server path if the user enter just the hostname https://sourceforge.net/tracker/?func=detail&atid=487492&aid=1945865&group_id=58373 0.0.9.1 04/03/2008 Bug fix * fix a error in the previous release that was forcing the local mode (Nicolas DORFSMAN) https://sourceforge.net/tracker/?func=detail&atid=487492&aid=1945863&group_id=58373 0.0.9 04/01/2008 April Fool release! * Added fallback for --lazy if no prolog freq was found and server error (Pascal DANEK) * Fixed accountinfos handling bugs (Pascal DANEK) * Changed --wait behaviour (--wait=number_of_seconds || "server") (Pascal DANEK) * PROLOG_FREQ is handled in prolog phase (Pascal DANEK) * the random value for file_nexttime is computed only if prolog_freq has changed since last prolog (Pascal DANEK) * import the documentation documentation by adding a description of the agent and pointer to the official website * --nosoft option renamed to --nosoftware, --nosoft still works but with a warning * add --basevardir to be able to use a specific place to store the var file * add the --lazy parameter: send an inventory only if the a random delay between 0 and PROLOG_FREQ had been run over. Useful for package maintainer (Remi COLLET) * return 1 to the shell if the agent failed to contact the server * postinst.pl asks for the basevardir * postinst.pl write the modules.conf * OS::Linux::Network::Networks, correctly reset the ipaddress before every loop so now a network can't have the address of the previous one * rename the key $params->{conffile} to $params->{accountconfig} * fix the way accountinfo information are stored * improve (a bit) tools/standalone.sh to avoid error if people launch it from the tools directory * --server is ignore if --local is in use * adjust Backend::OS::Generic::Screen to be able to use monitor-edid with DVI link (Remi COLLET) * OS::Linux::Storages, add NEC as a know manufacturer add assume the manifacturer is Seagate if the model doesn't match the others and begin with ST (rjhill) * fix the CPU detection on Linux Sparc64 and ARM (Linksys NSLU2) * improve the Solaris version detection by reading the /etc/release file (Nicolas DORFSMAN) * Solaris: fix the MAC addresses when the leading zeros is missing (Jean-Jacques MICHEL) * Solaris: Add publisher is possible in the software list (Nicolas DORFSMAN) * Solaris: improve the hard drive detection (Nicolas DORFSMAN) * postinst.pl can remove the previous linux_agent * postinst.pl reuse linux_agent old config file to set the default server and tag * return the SERIALNUMBER and the FIRMWARE on Linux with hdparm, the feature is not supported yet by the server (egamin) 0.0.8.1 02/20/2008 * postinst.pl, correctly save the realm, do not override the password * Added "CAPTION" field to memory (Pascal DANEK) * Fix a bug with "NUMSLOTS" memory field (Pascal DANEK) * improve the parsing of the config file to accept quote and spaces in the value * postinst.pl save the configfile with 0600 right since the server password maybe be stored in it * standalone.sh doesn't scan the inc/ directory anymore * remove the BUNDLE packages which seem to break the install process * change Solaris::CPU to use psrinfo -v to get the CPUs which works fine on x86 * fix a path error in Ocsinventory::LoggerBackend::File (Remi COLLET) * fix: don't send the inventory if the server doesn't need it (Remi COLLET) 0.0.8 02/05/2008 * fix the deviceid and old_deviceid handling (Pascal DANEK) * fix a debug message in Network.pm (Pascal DANEK) * different fixes on Compress.pm (Pascal DANEK) * fix an event message name in Option/Download.pm (Pascal DANEK) * fix the Compatibility Layer with prolog_read hook (Pascal DANEK) * merge PowerPC and PC code to detect the CPU and improve/fix the regex * looks for config file in /etc/ocsinventory /usr/local/etc/ocsinventory and /etc/ocsinventory-agent * add a pod documentation about the different config files and directories * Compress::Zlib is required but recommended now. In fact, you need it with ocs server prior 1.02 0.0.7.2 01/16/2008 * fix the post installation script to avoid invalid cron time 0.0.7.1 01/14/2008 * add setup.sh in the MANIFEST.SKIP to keep it out of the tarball 0.0.7 01/13/2008 * Ocsinventory::Agent::AccountInfo does not warn accountinfofile if runned in debug mode without root privilege * fix params->{etcdir} to /etc/ocsinventory, /etc/ocsinventory-agent/modules.conf must be moved to /etc/ocsinventory/modules.conf * Solaris: Improve the CPU detection (Olivier ROUSSY) * AIX: Return the directory with the AIX package name (Olivier ROUSSY) * Ocsinventory::Agent::XML::Inventory can now write software inventory value of FILESIZE, FOLDER and PUBLISHER * processChecksum() and feedInventory() are called by Ocsinventory::Agent::XML::Inventory directly now * the server responses are not parsed in the main script anymore * do not create an inventory if the server doesnn't need it * new parameters for the backend modules (run and check functions): - prologresp, the Ocsinventory::Agent::XML::Response::Prolog object returned by the prolog - storage: an hashref stored on the harddrive at the end of the execution of the module * a backend module without a run function is accepted now * Inventory.pm: add addIpDiscoverEntry() to add host from the same network * @runMeIfTheseChecksFailed: new optional setting for Backend module * Ipdiscover is now a backend module and nmap can be used instead of ipdiscover * --nosoft disable the Ocsinventory::Agent::Backend::OS::Generic::Packaging modules * Remove the deprecated modules Ocsinventory::Agent::Option::Ipdiscover and Ocsinventory::Agent::Option::Update * the check function of the backend accepts the same parameter than the run function * Linux::Archs::I386 regex are more robust * perldoc documentation for the ocsinventory-agent command * minor improvment on the Makefile.PL * change the way --server parameter is read. Now we can have a full URL, --remotedir is now useless * fix: correctly load the last_state * improve the Makefile.PL by using inc::Module::Install and adding new check * add a --version parameter and improve the --help * come with bundled dependency to simply the build process * fix the login/passwd/realm authentification * remove Agent/Pid.pm, I've to prepare a better system to keep the pid first * try to read the config in /usr/local/etc/ocsinventory/ocsinventory-agent.cfg if the standard one is missing 0.0.6.2 07/16/2007 Bug fix release * remove a debug "die" in the code 0.0.6.1 06/12/2007 Bug fix release * Fix an undef value in Ocsinventory::Agent::Backend::OS::BSD::Mem * AIX: retrieve correctly the MAC address of some FibberChannel card * now standalone.sh will try to find every module before the build to avoid unexplicated error 0.0.6 06/07/2007 * Enable "verbose" is debug is turned on * AIX: Ocsinventory::Agent::Backend::OS::AIX::Networks rewrote * AIX: Memory.pm, remove the spaces from the end of the DESCRIPTION * add standalone.sh, a script designed to prepare a stand-alone binary of the agent * AIX: Retrieve all the gateway of every subnet instead of just the default one * Config.pm renamed to AccountConfig.pm * New flag: --stdout to print the inventory directly on STDOUT * If the use want write on the system var directory, the agent create one in ~/.ocsinventory/var * The agent setting can be preinitialised with /etc/ocsinventory/ocsinventory-agent.cfg or ~/ocsinventory/ocsinventory-agent.cfg. * remove two debug messages printed during accountinfo rewrite and the daemon starting process * remove a stupid check in Ocsinventory::Agent::AccountConfig, the accountconfig file was not written unless the file was already present * add a recMkdir function in ocsinventory-agent to create directory recursivly * do not process checksum in local mode 0.0.5 04/17/2007 * AIX: use lslpp -c -l to find installed packages * AIX: fixes on CPU.pm, Networks.pm and Memory.pm * AIX: fetch the serial number with lscfg unless it was found with lsvpd * add the .ocs extension to local written files * with --local flag: don't not warn if last_state doesn't exit * Solaris: retrieve installed package * downgrade some message important from info to debug * read screen serial number in the EDID (DDC screen) * Xorg.pm replaced by Screen.pm * Screen.pm all the data are read from EDID now * Initial Linux PPC support (tested in Debian Etch). thanks Walid Nouh for the hardware * Apply patch by Remi Collet to fix an issue with Linux distro detection and Perl 5.6.1 * Turn of STDERR during the module execution to avoid useless message (e.g: foo: not found) use --debug to turn them back * If the system side vardir can't be created. The agent try to create one in ~/.ocs-inventory-agent * Add a THANKS file 0.0.4 03/20/2007 * use of gzip when Compress:Zlib is not avalaible. OCS server 1.01 and prior are not supported. * dmidecode parsing improved * lspci stuffs moved to generic * Linux: find Wifi connection * fix: pass correctly the logger to the modules * don't write the last_state if the connexion failed * Deals correctly with the accountinfo if it's internaly stored in a array ref * BSD support by Thierry Lacoste UnixAgent-2.4.2/LICENSE000066400000000000000000000431031332737732100144370ustar00rootroot00000000000000 GNU GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Lesser General Public License instead.) You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. The precise terms and conditions for copying, distribution and modification follow. GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you". Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does. 1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License. c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program. In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following: a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.) The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. 4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it. 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation. 10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Also add information on how to contact you by electronic and paper mail. If the program is interactive, make it output a short notice like this when it starts in an interactive mode: Gnomovision version 69, Copyright (C) year name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (which makes passes at compilers) written by James Hacker. , 1 April 1989 Ty Coon, President of Vice This General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Lesser General Public License instead of this License. UnixAgent-2.4.2/MANIFEST.SKIP000077500000000000000000000004121332737732100153270ustar00rootroot00000000000000CVS/ .git .bzr ^00 ^.gitignore$ ^.cvsignore$ .svn .merge ^blib ^_build ^Build$ ^cover_db ^nytprof ^Makefile(\.old)?$ ^MANIFEST\. ^MYMETA\. ^pm_to_blib$ ^run-postinst ~$ \.bak$ \.old$ \.sw[a-z]$ \.# \.swp ^Ocsinventory-agent.* /tarballs/ ^setup.sh .*\.tmp var/ UnixAgent-2.4.2/META.yml000077500000000000000000000016431332737732100147110ustar00rootroot00000000000000--- abstract: 'Ocs-Inventory unified Agent for UNIX, Linux and MacOSX' author: - 'OCS Inventory Team' build_requires: ExtUtils::MakeMaker: 6.59 configure_requires: ExtUtils::MakeMaker: 6.59 distribution_type: module dynamic_config: 1 generated_by: 'Module::Install version 1.19' license: gpl meta-spec: url: http://module-build.sourceforge.net/META-spec-v1.4.html version: 1.4 name: Ocsinventory-Unix-Agent no_index: directory: - inc recommends: Compress::Zlib: 0 Net::IP: 0 Nvidia::ml: 0 Proc::Daemon: 0 Proc::PID::File: 0 requires: Digest::MD5: 0 File::Temp: 0 LWP: 0 XML::Simple: 0 perl: 5.6.0 resources: homepage: http://www.ocsinventory-ng.org bugtracker: https://github.com/OCSInventory-NG/UnixAgent/issues repository: https://github.com/OCSInventory-NG/UnixAgent irc: irc://irc.freenode.net/#ocsinventory-ng license: http://opensource.org/licenses/gpl-license.php version: 2.4.2 UnixAgent-2.4.2/Makefile.PL000077500000000000000000000115071332737732100154120ustar00rootroot00000000000000BEGIN { # Avoid installation issue introduced by perl 5.24.1 removing '.' path from # @INC to avoid possible module injection in normal running perl scripts push @INC, '.' if ( $^V && $^V gt 'v5.24' ); } use inc::Module::Install; use English qw(-no_match_vars); use Config; require 'lib/Ocsinventory/Agent/Config.pm'; # Hack to be able to run a post install script sub MY::postamble { my $re; $re = ' install :: all pure_install doc_install $(NOECHO) $(NOOP)'; $re .= "\n\t[ ! -f run-postinst ] || $^X postinst.pl\n"; return $re; } my $version = $Ocsinventory::Agent::Config::VERSION; name 'Ocsinventory-Unix-Agent'; include 'Module::AutoInstall'; abstract 'OCS Inventory unified Agent for UNIX, Linux and MacOSX'; license 'gpl'; repository 'https://github.com/OCSInventory-NG/UnixAgent/'; version $version; perl_version '5.006'; authors 'OCS Inventory Team'; # mandatory dependencies requires 'Digest::MD5' => undef; requires 'XML::Simple' => undef; requires 'LWP' => undef; requires 'File::Temp' => undef; requires 'Data::UUID' => undef; requires 'Net::IP' => undef; recommends 'IO::Socket::SSL' => undef; recommends 'Compress::Zlib' => undef; recommends 'Proc::Daemon' => undef; recommends 'Proc::PID::File' => undef; # deployement or https communication recommends 'Crypt::SSLeay' => undef; recommends 'LWP::Protocol::https' => undef; # inventory recommends 'Net::CUPS' => undef; recommends 'Parse::EDID' => undef; recommends 'Nvidia::ml' => undef; # network recommends 'Net::SNMP' => undef; recommends 'Net::Netmask' => undef; recommends 'Net::Ping' => undef; recommends 'Nmap::Parser' => undef; resources bugtracker => 'https://github.com/OCSinventory-NG/Unixagent/issues', homepage => 'http://www.ocsinventory-ng.org', IRC => 'irc://irc.freenode.net/#ocsinventory-ng', repository => 'https://github.com/OCSinventory-NG/Unixagent'; install_script 'ocsinventory-agent'; # We want a release bundled with the needed dependency to be able to # prepare a standalone binary with PAR::Packer if ($ENV{OCS_BUNDLE_RELEASE}) { foreach my $module (qw/Archive::Zip HTML::Parser LWP URI XML::NamespaceSupport Net::IP Net::Netmask HTML::Tagset Proc::Daemon Module::ScanDeps PAR::Packer AutoLoader PAR PAR::Dist File::Remove YAML::Tiny Getopt::ArgvFile ExtUtils::Install ExtUtils::ParseXS XML::SAX XML::Simple/) { bundle $module; requires $module; } } #Ugly hack to include ipdiscover binary compilation and install for Linux systems if ($^O =~ /^linux$/i && can_cc()) { my $cc=$Config::Config{cc}; system("$cc resources/ipdiscover/ipdiscover.c -o ipdiscover"); if (-f 'ipdiscover') { install_script 'ipdiscover'; } } if (defined ($ENV{PERL_AUTOINSTALL}) || defined ($ENV{PERL_AUTOINSTALL})) { unlink 'run-postinst'; } else { open POSTINST, '>run-postinst' or die $!; close POSTINST; } if (!can_use('Compress::Zlib')) { print "Please install Compress::Zlib if you use an OCS server prior 1.02.\n"; } if (!can_use('Crypt::SSLeay')) { print "Please install Crypt::SSLeay if you want to use SSL.\n"; } if (!can_use('Net::SSLeay')) { print "Please install Net::SSLeay if you want to use the software deployment.\n"; } if (!can_run('ipdiscover') && !can_run('nmap')) { print "Please install nmap "; print "or ipdiscover " if $^O =~ /^linux$/i; print "if you want to use the network ". "discover feature.\n"; } if (!can_use('Net::IP')) { print "Net::IP is strongly recommended since it's required to retrieve " ."network information\n"; } if (!can_use('Net::Netmask')) { print "Net::Netmask is strongly recommended since it's required to retrieve " ."snmp information\n"; } if (!can_use('Proc::Daemon') || !can_use('Proc::PID::File')) { print "Please install Proc::Daemon and Proc::PID::File if you ". "want to use the daemon mode.\n"; } if (!can_use('Nvidia::ml')){ print "Nvidia::ml is recommended if you want to retrieve " ."memory, speed, bios information for Nvidia cards.\n"; } my $archname; eval { # config_re is not available on Perl 5.6 my @t = Config::config_re('archname'); $archname = $t[0]; }; if ($^O =~ /(linux|bsd)/i && (!$archname ||$archname =~ /(i[3456x]86|x86_64|amd64)/i)) { foreach (qw/dmidecode lspci/) { if (!can_run($_)) { print "\n"; print "[WARNING] $_ is needed if you want a complete inventory on x86 and AMD64/x86_64.\n"; print "\n"; } } } if ($^O =~ /^darwin$/ && !can_use('Mac::SysProfile')) { print "\n"; print "[WARNING] Mac::SysProfile are needed on MacOS to detect most of the device information.\n"; print "\n"; requires 'Mac::SysProfile' => undef; } # memconf is needed by Solaris backend module if ($^O =~ /^solaris$/i) { install_script 'memconf'; } #for i in inc/BUNDLES/* ; do rm -rf `basename $i` ;done` #auto_install; WriteAll; UnixAgent-2.4.2/README.md000066400000000000000000000131541332737732100147140ustar00rootroot00000000000000

Banner

OCS Inventory UnixAgent

Some Links:
Ask question | Installation | Website | OCS Professional

Ocsinventory-Agent is an agent for ocsinventory NG. It supports Linux, Solaris and AIX. *BSD support is in progress.

Prerequisites

- Perl 5.8 minimum #### The following modules are needed: - Digest::MD5 - XML::Simple - Net::IP optional, it is only needed to compute the network information - LWP - Mac::SysProfile 0.0.5 : this module is need on MacOSX to collect the device informations. - To get SSL communications working (for packages deployment or HTTPS communications to OCS server), you need these modules: - Crypt::SSLeay if you use LWP prior to version 6 - LWP::Protocol::https if you use LWP version 6 or more - Net::CUPS is used to detect the printer - Net::SNMP to scan network devices using SNMP - To enhance SNMP feature with custom networks scans, you need these modules: - Net::Netmask - Net::Ping or Nmap::Parser - Data::UUID is used to create a unique id for every machine - Parse::EDID is used to inventory monitor and will replace monitor-edid from Mandriva. #### The following commands are needed: - dmidecode on Linux and *BSD (i386, amd64, ia64) => dmidecode is required to read the BIOS stats. - lspci on Linux and *BSD (pciutils package) => lspci is required to list PCI devices. - sneep on Solaris/sparc, you must install sneep and record the Serial Number with it (download it from http://www.sun.com/download/products.xml?id=4304155a) - To get the serial number of the screen you will need one of these tools: - monitor-edid from Mandriva is needed to fetch the monitor. A package is available in Fedora repository. information http://wiki.mandriva.com/en/Tools/monitor-edid - get-edid from the read-edid package - ipmitool if you want to collect information about IPMI - Nmap (v3.90 or superior) to scan network devices for Ipdiscover #### The following PERL modules are optional: - Proc::Daemon Daemon mode - Proc::PID::File brings the pid file support if Proc::Daemon is installed - nvidia::ml brings you some informations on Nvidia Graphic Cards such as memory size, cpu speed, bios version and driver version. - Compress::Zlib #### The following module is needed if you plan to prepare a tarball or install directly from the Bazaar devel branch. (See SOURCES below.): - Module::Install

Build / Install

Once the archive is unpacked, use these commands: ``` perl Makefile.PL make make install ``` If you want to turn off the interactive post install script, just do (instead of perl Makefile.PL) ``` PERL_AUTOINSTALL=1 perl Makefile.PL ``` You can also run the agent from the tarball directory. In this case, use the `--devlib` flag to load the library from the local directory. You need to launch the agent with root privilege. For debugging you can try to launch it with the `-l` flag: Ex: `ocsinventory-agent -l /tmp --debug` It's also possible to run directly from the tarball directory: `sudo ./ocsinventory-agent --devlib --server http://foo/ocsinventory`

Note

Solaris: - Sun Studio seems to be needed to build the dependency. - The generated Makefile needs gmake to be exectuted - The default installation will install the binary in /usr/perl5/5.XXXXX/bin, set your $PATH variable according to that. Crontab: - If you use crontab to launch the agent you'll probably have to redefine the PATH. For example, just add something like: `PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin` At the beginning of the cron file.
## Contributing 1. Fork it! 2. Create your feature branch: `git checkout -b my-new-feature` 3. Add your changes: `git add folder/file1.php` 4. Commit your changes: `git commit -m 'Add some feature'` 5. Push to the branch: `git push origin my-new-feature` 6. Submit a pull request ! ## License OCS Inventory is GPLv2 licensed The memconf script is maintained by Tom Schmidt http://www.4schmidts.com/memconf.html Copyright © 1996-2017 Tom Schmidt memconf is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. Ocsinventory::Agent::Backend::Virtualization::Vmsystem uses code from imvirt: Authors: Thomas Liske Copyright Holder: 2008 (C) IBH IT-Service GmbH [http://www.ibh.de/] License: This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. Ocsinventory::Agent::Backend::OS::Linux::Storages::Adaptec uses code from Parse-Arcconf: https://github.com/kumy/Parse-Arcconf License and Copyright: Copyright (C) 2012 Mathieu Alorent This program is free software; you can redistribute it and/or modify it under the terms of either: the GNU General Public License as published by the Free Software Foundation; or the Artistic License. See http://dev.perl.org/licenses/ for more information. UnixAgent-2.4.2/THANKS000066400000000000000000000044331332737732100143500ustar00rootroot00000000000000Olivier ANDREOTTI: AIX, Solaris patches Thierry LACOSTE: BSD portage Didier LIROULET: Installation script Remi COLLET: bug fixes and Fedora/RedHat maintainer Walid NOUH: gave access to PowerPC hardware to help the portage Olivier ROUSSY: minor patches Dennis CABOOTER: FreeBSD maintainer Pierre CHIFFLIER: Debian maintainer Nicolas DORFSMAN: Solaris patches Jean-Jacques MICHEL: Solaris patches Etienne GUILLAUMONT: AIX4 CPU detection Wes YOUNG: MacOSX support and patches Edouard GAMIN: RAID devices support for Linux Christoph HALMES: Solaris patches Jean PARPAILLON: IPMI backends and patches David DURIEUX: AMD64 detection on BSD systems Wilfried BRUNKEN: patch for memory detection on AIX Vladimir ELISSEEV: various patches Julien SAFAR: ArchLinux support Damien MAURAN: MacOSX packaging, doc and support Sebastien DAGNICOURT: AIX and Solaris patches Nicolas EISEN: patches Sylvain LUCE: Sun M5000 and M4000 support Philippe LIBAT: patchs and Xen support David OLIVIER: MacOSX patches Jean-François BOUCHER: Solaris patch Scott HANNAHS: MacOSX patches Maurizio Bertaboni: Solaris Zone support Scott HANNAHS: patch Sergio MERINO: patch Vincent KNECHT: wording patch Barius DRUBECK: documentation patch Stéphane URBANOVSKI: patch Jerome LEBASE: Solaris patches François MERMET: HP-UX support and SNMP integration Dmitry ILYIN: Patches Guillaume ROUSSE: various patches for Xen support Lucas MASSE: various patches for Solaris support Adam BUCHBINDER: various patches Bernhard Denner: various patches Yoann Le Bihan: Solaris patches Andreas Xenos: MacOSX patches and Parallels support Francois Laupetre: LVM modules Christophe Borivant Viper233: patch monitor edid Alexandre Bossot: oracle module Javier Barroso: VLAN interface on AIX Yves GUIMARD: download.pm patch for zip files Marco Tizzoni: Host_Resources_Mib.pm and Agent.pm patches Matthias Vedrines: patch + various modules Trois Six: patch DerJoern: patch Serge Roux: patch Guillaume Lecerf: Xen support Mikkel Paulson: patch XANI: patch Philippe Beaumont: patch lhchin: patch pilch-cit: patch lj6: patch nerijus: patch GSponda: patch JHeidinga: patch Unrankar: patch jfcoz: patch xalasys-luc: patch stweil: patch ivmaks: patches MikaelUranker: patches nnn-dev: patches jmechnich: patches matt335672: patches temperatur: patch RudyLaurent: patches guimard: patches UnixAgent-2.4.2/contrib/000077500000000000000000000000001332737732100150715ustar00rootroot00000000000000UnixAgent-2.4.2/contrib/Tarballs.pm000066400000000000000000000027461332737732100172040ustar00rootroot00000000000000# Write by Simon CLARA 2010-01-25 # # The complete name of the package # the path MUST be valid or the package won't be loaded package Ocsinventory::Agent::Backend::OS::Generic::Tarballs; use strict; # I need to declare $runAfter because of the strict mode use vars qw($runAfter); # The package must be run after OS::Generic $runAfter = ["Ocsinventory::Agent::Backend::OS::Generic"]; # This is the check function. The agent runs it just once the module is loaded. # If the function return false, the module and its children are not executed # eg: OS::Linux and OS::Linux::* won't executed if this run() function return # false # Check if we are on a linux server sub check { $^O =~ /^linux$/ } # uncomment this if you want check for FreeBSD server # sub check {can_run("pkg_info")} # its the main function of the script, it's called during the hardware inventory sub run { my $params = shift; # I need to get the inventory object to update it my $inventory = $params->{inventory}; # our software are in /usr/local/src/ foreach (`ls /usr/local/src/*.{bz2,tar.gz}`){ /^(\/.*\/)(\S+)-(\d+\S*)(\.tar.gz|\.bz2)$/i; my $name = $2; my $version = $3; my $comments = "Software in /usr/local/src/ \n".`$2 --version`; # and I updated the information collected $inventory->addSoftwares({ COMMENTS => $comments, NAME => $name, VERSION => $version }); } } 1; UnixAgent-2.4.2/etc/000077500000000000000000000000001332737732100142045ustar00rootroot00000000000000UnixAgent-2.4.2/etc/cron.d/000077500000000000000000000000001332737732100153675ustar00rootroot00000000000000UnixAgent-2.4.2/etc/cron.d/ocsinventory-agent000066400000000000000000000012521332737732100211500ustar00rootroot00000000000000# # File generated by OCS Inventory NG Unified Unix Agent setup # ################################################################################ # # OCS Inventory NG Unified Unix Agent # # Copyleft 2007 Didier LIROULET # Web: http://www.ocsinventory-ng.org # # This code is open source and may be copied and modified as long as the source # code is always made freely available. # Please refer to the General Public Licence http://www.gnu.org/ or Licence.txt ################################################################################ # # Launch OCS Inventory NG Agent once a day under root account, at HH:MM # MM HH * * * root /usr/bin/ocsinventory-agent > /dev/null 2>&1 UnixAgent-2.4.2/etc/default/000077500000000000000000000000001332737732100156305ustar00rootroot00000000000000UnixAgent-2.4.2/etc/default/ocsinventory-agent000066400000000000000000000000231332737732100214040ustar00rootroot00000000000000SERVER="localhost" UnixAgent-2.4.2/etc/init.d/000077500000000000000000000000001332737732100153715ustar00rootroot00000000000000UnixAgent-2.4.2/etc/init.d/ocsinventory-agent000077500000000000000000000104011332737732100211510ustar00rootroot00000000000000#! /bin/sh ### BEGIN INIT INFO # Provides: ocs-inventory-agent # Required-Start: $local_fs $remote_fs # Required-Stop: $local_fs $remote_fs # Default-Start: 2 3 4 5 # Default-Stop: 0 1 6 # Short-Description: OCS-Inventory Agent # Description: This script launches OCS Agent as daemon ### END INIT INFO # Author: Gonéri Le Bouder # # Do NOT "set -e" # PATH should only include /usr/* if it runs after the mountnfs.sh script PATH=/sbin:/usr/sbin:/bin:/usr/bin DESC="OCS Inventory Agent" NAME=ocsinventory-agent DAEMON=/usr/sbin/$NAME PIDFILE=/var/run/$NAME.pid SCRIPTNAME=/etc/init.d/$NAME # Exit if the package is not installed [ -x "$DAEMON" ] || exit 0 # Read configuration variable file if it is present [ -r /etc/default/$NAME ] && . /etc/default/$NAME DAEMON_ARGS="-d -s $SERVER" # Load the VERBOSE setting and other rcS variables . /lib/init/vars.sh # Define LSB log_* functions. # Depend on lsb-base (>= 3.0-6) to ensure that this file is present. . /lib/lsb/init-functions # # Function that starts the daemon/service # do_start() { # Return # 0 if daemon has been started # 1 if daemon was already running # 2 if daemon could not be started start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $DAEMON --test > /dev/null \ || return 1 start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $DAEMON -- \ $DAEMON_ARGS \ || return 2 # Add code here, if necessary, that waits for the process to be ready # to handle requests from services started subsequently which depend # on this one. As a last resort, sleep for some time. } # # Function that stops the daemon/service # do_stop() { # Return # 0 if daemon has been stopped # 1 if daemon was already stopped # 2 if daemon could not be stopped # other if a failure occurred start-stop-daemon --stop --quiet --retry=TERM/30/KILL/5 --pidfile $PIDFILE --name $NAME RETVAL="$?" [ "$RETVAL" = 2 ] && return 2 # Wait for children to finish too if this is a daemon that forks # and if the daemon is only ever run from this initscript. # If the above conditions are not satisfied then add some other code # that waits for the process to drop all resources that could be # needed by services started subsequently. A last resort is to # sleep for some time. start-stop-daemon --stop --quiet --oknodo --retry=0/30/KILL/5 --exec $DAEMON [ "$?" = 2 ] && return 2 # Many daemons don't delete their pidfiles when they exit. rm -f $PIDFILE return "$RETVAL" } # # Function that sends a SIGHUP to the daemon/service # do_reload() { # # If the daemon can reload its configuration without # restarting (for example, when it is sent a SIGHUP), # then implement that here. # start-stop-daemon --stop --signal 1 --quiet --pidfile $PIDFILE --name $NAME return 0 } case "$1" in start) [ "$VERBOSE" != no ] && log_daemon_msg "Starting $DESC" "$NAME" do_start case "$?" in 0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;; 2) [ "$VERBOSE" != no ] && log_end_msg 1 ;; esac ;; stop) [ "$VERBOSE" != no ] && log_daemon_msg "Stopping $DESC" "$NAME" do_stop case "$?" in 0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;; 2) [ "$VERBOSE" != no ] && log_end_msg 1 ;; esac ;; #reload|force-reload) # # If do_reload() is not implemented then leave this commented out # and leave 'force-reload' as an alias for 'restart'. # #log_daemon_msg "Reloading $DESC" "$NAME" #do_reload #log_end_msg $? #;; restart|force-reload) # # If the "reload" option is implemented then remove the # 'force-reload' alias # log_daemon_msg "Restarting $DESC" "$NAME" do_stop case "$?" in 0|1) do_start case "$?" in 0) log_end_msg 0 ;; 1) log_end_msg 1 ;; # Old process is still running *) log_end_msg 1 ;; # Failed to start esac ;; *) # Failed to stop log_end_msg 1 ;; esac ;; *) #echo "Usage: $SCRIPTNAME {start|stop|restart|reload|force-reload}" >&2 echo "Usage: $SCRIPTNAME {start|stop|restart|force-reload}" >&2 exit 3 ;; esac : UnixAgent-2.4.2/etc/logrotate.d/000077500000000000000000000000001332737732100164265ustar00rootroot00000000000000UnixAgent-2.4.2/etc/logrotate.d/ocsinventory-agent000066400000000000000000000013541332737732100222120ustar00rootroot00000000000000# # File generated by OCS Inventory NG Unified Unix Agent setup # ################################################################################ # # OCS Inventory NG Unified Unix Agent # # Copyleft 2007 Didier LIROULET # Web: http://www.ocsinventory-ng.org # # This code is open source and may be copied and modified as long as the source # code is always made freely available. # Please refer to the General Public Licence http://www.gnu.org/ or Licence.txt ################################################################################ # # Rotate OCS Inventory NG agent logs daily, only if not empty # Save 7 days old logs under compressed mode PATH_TO_LOG_DIRECTORY/*.log { daily rotate 7 compress notifempty missingok } UnixAgent-2.4.2/etc/ocsinventory-agent/000077500000000000000000000000001332737732100200425ustar00rootroot00000000000000UnixAgent-2.4.2/etc/ocsinventory-agent/modules.conf000066400000000000000000000004331332737732100223610ustar00rootroot00000000000000# This list of modules will be loaded by the agent at run time. # To check its syntax do: # $perl modules.conf # You must have NO error, else the content will be ignored. use Ocsinventory::Agent::Modules::Download; use Ocsinventory::Agent::Modules::Snmp; # DO NOT REMOVE the 1; 1; UnixAgent-2.4.2/etc/ocsinventory-agent/softwares/000077500000000000000000000000001332737732100220575ustar00rootroot00000000000000UnixAgent-2.4.2/etc/ocsinventory-agent/softwares/example.sh000077500000000000000000000007101332737732100240470ustar00rootroot00000000000000#! /bin/bash # This is an example script for the byHand software collect method # # You can create your own script to detect the installed software # and install them in /etc/ocsinventory/softwares # #ligne=$(ls --version| head -n 1) # #soft=$(echo $ligne | cut -f1 -d'('| sed 's/ //') #vendor=$(echo $ligne | cut -f2 -d'('| cut -f1 -d')') #version=$(echo $ligne | cut -f2 -d'('| cut -f2 -d')'|sed 's/ //') # #echo "$vendor#$soft#$version#simple test" # # UnixAgent-2.4.2/inc/000077500000000000000000000000001332737732100142025ustar00rootroot00000000000000UnixAgent-2.4.2/inc/Module/000077500000000000000000000000001332737732100154275ustar00rootroot00000000000000UnixAgent-2.4.2/inc/Module/AutoInstall.pm000066400000000000000000000630161332737732100202320ustar00rootroot00000000000000#line 1 package Module::AutoInstall; use strict; use Cwd (); use File::Spec (); use ExtUtils::MakeMaker (); use vars qw{$VERSION}; BEGIN { $VERSION = '1.14'; } # special map on pre-defined feature sets my %FeatureMap = ( '' => 'Core Features', # XXX: deprecated '-core' => 'Core Features', ); # various lexical flags my ( @Missing, @Existing, %DisabledTests, $UnderCPAN, $InstallDepsTarget, $HasCPANPLUS ); my ( $Config, $CheckOnly, $SkipInstall, $AcceptDefault, $TestOnly, $AllDeps, $UpgradeDeps ); my ( $PostambleActions, $PostambleActionsNoTest, $PostambleActionsUpgradeDeps, $PostambleActionsUpgradeDepsNoTest, $PostambleActionsListDeps, $PostambleActionsListAllDeps, $PostambleUsed, $NoTest); # See if it's a testing or non-interactive session _accept_default( $ENV{AUTOMATED_TESTING} or ! -t STDIN ); _init(); sub _accept_default { $AcceptDefault = shift; } sub _installdeps_target { $InstallDepsTarget = shift; } sub missing_modules { return @Missing; } sub do_install { __PACKAGE__->install( [ $Config ? ( UNIVERSAL::isa( $Config, 'HASH' ) ? %{$Config} : @{$Config} ) : () ], @Missing, ); } # initialize various flags, and/or perform install sub _init { foreach my $arg ( @ARGV, split( /[\s\t]+/, $ENV{PERL_AUTOINSTALL} || $ENV{PERL_EXTUTILS_AUTOINSTALL} || '' ) ) { if ( $arg =~ /^--config=(.*)$/ ) { $Config = [ split( ',', $1 ) ]; } elsif ( $arg =~ /^--installdeps=(.*)$/ ) { __PACKAGE__->install( $Config, @Missing = split( /,/, $1 ) ); exit 0; } elsif ( $arg =~ /^--upgradedeps=(.*)$/ ) { $UpgradeDeps = 1; __PACKAGE__->install( $Config, @Missing = split( /,/, $1 ) ); exit 0; } elsif ( $arg =~ /^--default(?:deps)?$/ ) { $AcceptDefault = 1; } elsif ( $arg =~ /^--check(?:deps)?$/ ) { $CheckOnly = 1; } elsif ( $arg =~ /^--skip(?:deps)?$/ ) { $SkipInstall = 1; } elsif ( $arg =~ /^--test(?:only)?$/ ) { $TestOnly = 1; } elsif ( $arg =~ /^--all(?:deps)?$/ ) { $AllDeps = 1; } } } # overrides MakeMaker's prompt() to automatically accept the default choice sub _prompt { goto &ExtUtils::MakeMaker::prompt unless $AcceptDefault; my ( $prompt, $default ) = @_; my $y = ( $default =~ /^[Yy]/ ); print $prompt, ' [', ( $y ? 'Y' : 'y' ), '/', ( $y ? 'n' : 'N' ), '] '; print "$default\n"; return $default; } # the workhorse sub import { my $class = shift; my @args = @_ or return; my $core_all; print "*** $class version " . $class->VERSION . "\n"; print "*** Checking for Perl dependencies...\n"; my $cwd = Cwd::getcwd(); $Config = []; my $maxlen = length( ( sort { length($b) <=> length($a) } grep { /^[^\-]/ } map { ref($_) ? ( ( ref($_) eq 'HASH' ) ? keys(%$_) : @{$_} ) : '' } map { +{@args}->{$_} } grep { /^[^\-]/ or /^-core$/i } keys %{ +{@args} } )[0] ); # We want to know if we're under CPAN early to avoid prompting, but # if we aren't going to try and install anything anyway then skip the # check entirely since we don't want to have to load (and configure) # an old CPAN just for a cosmetic message $UnderCPAN = _check_lock(1) unless $SkipInstall || $InstallDepsTarget; while ( my ( $feature, $modules ) = splice( @args, 0, 2 ) ) { my ( @required, @tests, @skiptests ); my $default = 1; my $conflict = 0; if ( $feature =~ m/^-(\w+)$/ ) { my $option = lc($1); # check for a newer version of myself _update_to( $modules, @_ ) and return if $option eq 'version'; # sets CPAN configuration options $Config = $modules if $option eq 'config'; # promote every features to core status $core_all = ( $modules =~ /^all$/i ) and next if $option eq 'core'; next unless $option eq 'core'; } print "[" . ( $FeatureMap{ lc($feature) } || $feature ) . "]\n"; $modules = [ %{$modules} ] if UNIVERSAL::isa( $modules, 'HASH' ); unshift @$modules, -default => &{ shift(@$modules) } if ( ref( $modules->[0] ) eq 'CODE' ); # XXX: bugward compatibility while ( my ( $mod, $arg ) = splice( @$modules, 0, 2 ) ) { if ( $mod =~ m/^-(\w+)$/ ) { my $option = lc($1); $default = $arg if ( $option eq 'default' ); $conflict = $arg if ( $option eq 'conflict' ); @tests = @{$arg} if ( $option eq 'tests' ); @skiptests = @{$arg} if ( $option eq 'skiptests' ); next; } printf( "- %-${maxlen}s ...", $mod ); if ( $arg and $arg =~ /^\D/ ) { unshift @$modules, $arg; $arg = 0; } # XXX: check for conflicts and uninstalls(!) them. my $cur = _version_of($mod); if (_version_cmp ($cur, $arg) >= 0) { print "loaded. ($cur" . ( $arg ? " >= $arg" : '' ) . ")\n"; push @Existing, $mod => $arg; $DisabledTests{$_} = 1 for map { glob($_) } @skiptests; } else { if (not defined $cur) # indeed missing { print "missing." . ( $arg ? " (would need $arg)" : '' ) . "\n"; } else { # no need to check $arg as _version_cmp ($cur, undef) would satisfy >= above print "too old. ($cur < $arg)\n"; } push @required, $mod => $arg; } } next unless @required; my $mandatory = ( $feature eq '-core' or $core_all ); if ( !$SkipInstall and ( $CheckOnly or ($mandatory and $UnderCPAN) or $AllDeps or $InstallDepsTarget or _prompt( qq{==> Auto-install the } . ( @required / 2 ) . ( $mandatory ? ' mandatory' : ' optional' ) . qq{ module(s) from CPAN?}, $default ? 'y' : 'n', ) =~ /^[Yy]/ ) ) { push( @Missing, @required ); $DisabledTests{$_} = 1 for map { glob($_) } @skiptests; } elsif ( !$SkipInstall and $default and $mandatory and _prompt( qq{==> The module(s) are mandatory! Really skip?}, 'n', ) =~ /^[Nn]/ ) { push( @Missing, @required ); $DisabledTests{$_} = 1 for map { glob($_) } @skiptests; } else { $DisabledTests{$_} = 1 for map { glob($_) } @tests; } } if ( @Missing and not( $CheckOnly or $UnderCPAN) ) { require Config; my $make = $Config::Config{make}; if ($InstallDepsTarget) { print "*** To install dependencies type '$make installdeps' or '$make installdeps_notest'.\n"; } else { print "*** Dependencies will be installed the next time you type '$make'.\n"; } # make an educated guess of whether we'll need root permission. print " (You may need to do that as the 'root' user.)\n" if eval '$>'; } print "*** $class configuration finished.\n"; chdir $cwd; # import to main:: no strict 'refs'; *{'main::WriteMakefile'} = \&Write if caller(0) eq 'main'; return (@Existing, @Missing); } sub _running_under { my $thing = shift; print <<"END_MESSAGE"; *** Since we're running under ${thing}, I'll just let it take care of the dependency's installation later. END_MESSAGE return 1; } # Check to see if we are currently running under CPAN.pm and/or CPANPLUS; # if we are, then we simply let it taking care of our dependencies sub _check_lock { return unless @Missing or @_; if ($ENV{PERL5_CPANM_IS_RUNNING}) { return _running_under('cpanminus'); } my $cpan_env = $ENV{PERL5_CPAN_IS_RUNNING}; if ($ENV{PERL5_CPANPLUS_IS_RUNNING}) { return _running_under($cpan_env ? 'CPAN' : 'CPANPLUS'); } require CPAN; if ($CPAN::VERSION > '1.89') { if ($cpan_env) { return _running_under('CPAN'); } return; # CPAN.pm new enough, don't need to check further } # last ditch attempt, this -will- configure CPAN, very sorry _load_cpan(1); # force initialize even though it's already loaded # Find the CPAN lock-file my $lock = MM->catfile( $CPAN::Config->{cpan_home}, ".lock" ); return unless -f $lock; # Check the lock local *LOCK; return unless open(LOCK, $lock); if ( ( $^O eq 'MSWin32' ? _under_cpan() : == getppid() ) and ( $CPAN::Config->{prerequisites_policy} || '' ) ne 'ignore' ) { print <<'END_MESSAGE'; *** Since we're running under CPAN, I'll just let it take care of the dependency's installation later. END_MESSAGE return 1; } close LOCK; return; } sub install { my $class = shift; my $i; # used below to strip leading '-' from config keys my @config = ( map { s/^-// if ++$i; $_ } @{ +shift } ); my ( @modules, @installed, @modules_to_upgrade ); while (my ($pkg, $ver) = splice(@_, 0, 2)) { # grep out those already installed if (_version_cmp(_version_of($pkg), $ver) >= 0) { push @installed, $pkg; if ($UpgradeDeps) { push @modules_to_upgrade, $pkg, $ver; } } else { push @modules, $pkg, $ver; } } if ($UpgradeDeps) { push @modules, @modules_to_upgrade; @installed = (); @modules_to_upgrade = (); } return @installed unless @modules; # nothing to do return @installed if _check_lock(); # defer to the CPAN shell print "*** Installing dependencies...\n"; return unless _connected_to('cpan.org'); my %args = @config; my %failed; local *FAILED; if ( $args{do_once} and open( FAILED, '.#autoinstall.failed' ) ) { while () { chomp; $failed{$_}++ } close FAILED; my @newmod; while ( my ( $k, $v ) = splice( @modules, 0, 2 ) ) { push @newmod, ( $k => $v ) unless $failed{$k}; } @modules = @newmod; } if ( _has_cpanplus() and not $ENV{PERL_AUTOINSTALL_PREFER_CPAN} ) { _install_cpanplus( \@modules, \@config ); } else { _install_cpan( \@modules, \@config ); } print "*** $class installation finished.\n"; # see if we have successfully installed them while ( my ( $pkg, $ver ) = splice( @modules, 0, 2 ) ) { if ( _version_cmp( _version_of($pkg), $ver ) >= 0 ) { push @installed, $pkg; } elsif ( $args{do_once} and open( FAILED, '>> .#autoinstall.failed' ) ) { print FAILED "$pkg\n"; } } close FAILED if $args{do_once}; return @installed; } sub _install_cpanplus { my @modules = @{ +shift }; my @config = _cpanplus_config( @{ +shift } ); my $installed = 0; require CPANPLUS::Backend; my $cp = CPANPLUS::Backend->new; my $conf = $cp->configure_object; return unless $conf->can('conf') # 0.05x+ with "sudo" support or _can_write($conf->_get_build('base')); # 0.04x # if we're root, set UNINST=1 to avoid trouble unless user asked for it. my $makeflags = $conf->get_conf('makeflags') || ''; if ( UNIVERSAL::isa( $makeflags, 'HASH' ) ) { # 0.03+ uses a hashref here $makeflags->{UNINST} = 1 unless exists $makeflags->{UNINST}; } else { # 0.02 and below uses a scalar $makeflags = join( ' ', split( ' ', $makeflags ), 'UNINST=1' ) if ( $makeflags !~ /\bUNINST\b/ and eval qq{ $> eq '0' } ); } $conf->set_conf( makeflags => $makeflags ); $conf->set_conf( prereqs => 1 ); while ( my ( $key, $val ) = splice( @config, 0, 2 ) ) { $conf->set_conf( $key, $val ); } my $modtree = $cp->module_tree; while ( my ( $pkg, $ver ) = splice( @modules, 0, 2 ) ) { print "*** Installing $pkg...\n"; MY::preinstall( $pkg, $ver ) or next if defined &MY::preinstall; my $success; my $obj = $modtree->{$pkg}; if ( $obj and _version_cmp( $obj->{version}, $ver ) >= 0 ) { my $pathname = $pkg; $pathname =~ s/::/\\W/; foreach my $inc ( grep { m/$pathname.pm/i } keys(%INC) ) { delete $INC{$inc}; } my $rv = $cp->install( modules => [ $obj->{module} ] ); if ( $rv and ( $rv->{ $obj->{module} } or $rv->{ok} ) ) { print "*** $pkg successfully installed.\n"; $success = 1; } else { print "*** $pkg installation cancelled.\n"; $success = 0; } $installed += $success; } else { print << "."; *** Could not find a version $ver or above for $pkg; skipping. . } MY::postinstall( $pkg, $ver, $success ) if defined &MY::postinstall; } return $installed; } sub _cpanplus_config { my @config = (); while ( @_ ) { my ($key, $value) = (shift(), shift()); if ( $key eq 'prerequisites_policy' ) { if ( $value eq 'follow' ) { $value = CPANPLUS::Internals::Constants::PREREQ_INSTALL(); } elsif ( $value eq 'ask' ) { $value = CPANPLUS::Internals::Constants::PREREQ_ASK(); } elsif ( $value eq 'ignore' ) { $value = CPANPLUS::Internals::Constants::PREREQ_IGNORE(); } else { die "*** Cannot convert option $key = '$value' to CPANPLUS version.\n"; } push @config, 'prereqs', $value; } elsif ( $key eq 'force' ) { push @config, $key, $value; } elsif ( $key eq 'notest' ) { push @config, 'skiptest', $value; } else { die "*** Cannot convert option $key to CPANPLUS version.\n"; } } return @config; } sub _install_cpan { my @modules = @{ +shift }; my @config = @{ +shift }; my $installed = 0; my %args; _load_cpan(); require Config; if (CPAN->VERSION < 1.80) { # no "sudo" support, probe for writableness return unless _can_write( MM->catfile( $CPAN::Config->{cpan_home}, 'sources' ) ) and _can_write( $Config::Config{sitelib} ); } # if we're root, set UNINST=1 to avoid trouble unless user asked for it. my $makeflags = $CPAN::Config->{make_install_arg} || ''; $CPAN::Config->{make_install_arg} = join( ' ', split( ' ', $makeflags ), 'UNINST=1' ) if ( $makeflags !~ /\bUNINST\b/ and eval qq{ $> eq '0' } ); # don't show start-up info $CPAN::Config->{inhibit_startup_message} = 1; # set additional options while ( my ( $opt, $arg ) = splice( @config, 0, 2 ) ) { ( $args{$opt} = $arg, next ) if $opt =~ /^(?:force|notest)$/; # pseudo-option $CPAN::Config->{$opt} = $arg; } if ($args{notest} && (not CPAN::Shell->can('notest'))) { die "Your version of CPAN is too old to support the 'notest' pragma"; } local $CPAN::Config->{prerequisites_policy} = 'follow'; while ( my ( $pkg, $ver ) = splice( @modules, 0, 2 ) ) { MY::preinstall( $pkg, $ver ) or next if defined &MY::preinstall; print "*** Installing $pkg...\n"; my $obj = CPAN::Shell->expand( Module => $pkg ); my $success = 0; if ( $obj and _version_cmp( $obj->cpan_version, $ver ) >= 0 ) { my $pathname = $pkg; $pathname =~ s/::/\\W/; foreach my $inc ( grep { m/$pathname.pm/i } keys(%INC) ) { delete $INC{$inc}; } my $rv = do { if ($args{force}) { CPAN::Shell->force( install => $pkg ) } elsif ($args{notest}) { CPAN::Shell->notest( install => $pkg ) } else { CPAN::Shell->install($pkg) } }; $rv ||= eval { $CPAN::META->instance( 'CPAN::Distribution', $obj->cpan_file, ) ->{install} if $CPAN::META; }; if ( $rv eq 'YES' ) { print "*** $pkg successfully installed.\n"; $success = 1; } else { print "*** $pkg installation failed.\n"; $success = 0; } $installed += $success; } else { print << "."; *** Could not find a version $ver or above for $pkg; skipping. . } MY::postinstall( $pkg, $ver, $success ) if defined &MY::postinstall; } return $installed; } sub _has_cpanplus { return ( $HasCPANPLUS = ( $INC{'CPANPLUS/Config.pm'} or _load('CPANPLUS::Shell::Default') ) ); } # make guesses on whether we're under the CPAN installation directory sub _under_cpan { require Cwd; require File::Spec; my $cwd = File::Spec->canonpath( Cwd::getcwd() ); my $cpan = File::Spec->canonpath( $CPAN::Config->{cpan_home} ); return ( index( $cwd, $cpan ) > -1 ); } sub _update_to { my $class = __PACKAGE__; my $ver = shift; return if _version_cmp( _version_of($class), $ver ) >= 0; # no need to upgrade if ( _prompt( "==> A newer version of $class ($ver) is required. Install?", 'y' ) =~ /^[Nn]/ ) { die "*** Please install $class $ver manually.\n"; } print << "."; *** Trying to fetch it from CPAN... . # install ourselves _load($class) and return $class->import(@_) if $class->install( [], $class, $ver ); print << '.'; exit 1; *** Cannot bootstrap myself. :-( Installation terminated. . } # check if we're connected to some host, using inet_aton sub _connected_to { my $site = shift; return ( ( _load('Socket') and Socket::inet_aton($site) ) or _prompt( qq( *** Your host cannot resolve the domain name '$site', which probably means the Internet connections are unavailable. ==> Should we try to install the required module(s) anyway?), 'n' ) =~ /^[Yy]/ ); } # check if a directory is writable; may create it on demand sub _can_write { my $path = shift; mkdir( $path, 0755 ) unless -e $path; return 1 if -w $path; print << "."; *** You are not allowed to write to the directory '$path'; the installation may fail due to insufficient permissions. . if ( eval '$>' and lc(`sudo -V`) =~ /version/ and _prompt( qq( ==> Should we try to re-execute the autoinstall process with 'sudo'?), ((-t STDIN) ? 'y' : 'n') ) =~ /^[Yy]/ ) { # try to bootstrap ourselves from sudo print << "."; *** Trying to re-execute the autoinstall process with 'sudo'... . my $missing = join( ',', @Missing ); my $config = join( ',', UNIVERSAL::isa( $Config, 'HASH' ) ? %{$Config} : @{$Config} ) if $Config; return unless system( 'sudo', $^X, $0, "--config=$config", "--installdeps=$missing" ); print << "."; *** The 'sudo' command exited with error! Resuming... . } return _prompt( qq( ==> Should we try to install the required module(s) anyway?), 'n' ) =~ /^[Yy]/; } # load a module and return the version it reports sub _load { my $mod = pop; # method/function doesn't matter my $file = $mod; $file =~ s|::|/|g; $file .= '.pm'; local $@; return eval { require $file; $mod->VERSION } || ( $@ ? undef: 0 ); } # report version without loading a module sub _version_of { my $mod = pop; # method/function doesn't matter my $file = $mod; $file =~ s|::|/|g; $file .= '.pm'; foreach my $dir ( @INC ) { next if ref $dir; my $path = File::Spec->catfile($dir, $file); next unless -e $path; require ExtUtils::MM_Unix; return ExtUtils::MM_Unix->parse_version($path); } return undef; } # Load CPAN.pm and it's configuration sub _load_cpan { return if $CPAN::VERSION and $CPAN::Config and not @_; require CPAN; # CPAN-1.82+ adds CPAN::Config::AUTOLOAD to redirect to # CPAN::HandleConfig->load. CPAN reports that the redirection # is deprecated in a warning printed at the user. # CPAN-1.81 expects CPAN::HandleConfig->load, does not have # $CPAN::HandleConfig::VERSION but cannot handle # CPAN::Config->load # Which "versions expect CPAN::Config->load? if ( $CPAN::HandleConfig::VERSION || CPAN::HandleConfig->can('load') ) { # Newer versions of CPAN have a HandleConfig module CPAN::HandleConfig->load; } else { # Older versions had the load method in Config directly CPAN::Config->load; } } # compare two versions, either use Sort::Versions or plain comparison # return values same as <=> sub _version_cmp { my ( $cur, $min ) = @_; return -1 unless defined $cur; # if 0 keep comparing return 1 unless $min; $cur =~ s/\s+$//; # check for version numbers that are not in decimal format if ( ref($cur) or ref($min) or $cur =~ /v|\..*\./ or $min =~ /v|\..*\./ ) { if ( ( $version::VERSION or defined( _load('version') )) and version->can('new') ) { # use version.pm if it is installed. return version->new($cur) <=> version->new($min); } elsif ( $Sort::Versions::VERSION or defined( _load('Sort::Versions') ) ) { # use Sort::Versions as the sorting algorithm for a.b.c versions return Sort::Versions::versioncmp( $cur, $min ); } warn "Cannot reliably compare non-decimal formatted versions.\n" . "Please install version.pm or Sort::Versions.\n"; } # plain comparison local $^W = 0; # shuts off 'not numeric' bugs return $cur <=> $min; } # nothing; this usage is deprecated. sub main::PREREQ_PM { return {}; } sub _make_args { my %args = @_; $args{PREREQ_PM} = { %{ $args{PREREQ_PM} || {} }, @Existing, @Missing } if $UnderCPAN or $TestOnly; if ( $args{EXE_FILES} and -e 'MANIFEST' ) { require ExtUtils::Manifest; my $manifest = ExtUtils::Manifest::maniread('MANIFEST'); $args{EXE_FILES} = [ grep { exists $manifest->{$_} } @{ $args{EXE_FILES} } ]; } $args{test}{TESTS} ||= 't/*.t'; $args{test}{TESTS} = join( ' ', grep { !exists( $DisabledTests{$_} ) } map { glob($_) } split( /\s+/, $args{test}{TESTS} ) ); my $missing = join( ',', @Missing ); my $config = join( ',', UNIVERSAL::isa( $Config, 'HASH' ) ? %{$Config} : @{$Config} ) if $Config; $PostambleActions = ( ($missing and not $UnderCPAN) ? "\$(PERL) $0 --config=$config --installdeps=$missing" : "\$(NOECHO) \$(NOOP)" ); my $deps_list = join( ',', @Missing, @Existing ); $PostambleActionsUpgradeDeps = "\$(PERL) $0 --config=$config --upgradedeps=$deps_list"; my $config_notest = join( ',', (UNIVERSAL::isa( $Config, 'HASH' ) ? %{$Config} : @{$Config}), 'notest', 1 ) if $Config; $PostambleActionsNoTest = ( ($missing and not $UnderCPAN) ? "\$(PERL) $0 --config=$config_notest --installdeps=$missing" : "\$(NOECHO) \$(NOOP)" ); $PostambleActionsUpgradeDepsNoTest = "\$(PERL) $0 --config=$config_notest --upgradedeps=$deps_list"; $PostambleActionsListDeps = '@$(PERL) -le "print for @ARGV" ' . join(' ', map $Missing[$_], grep $_ % 2 == 0, 0..$#Missing); my @all = (@Missing, @Existing); $PostambleActionsListAllDeps = '@$(PERL) -le "print for @ARGV" ' . join(' ', map $all[$_], grep $_ % 2 == 0, 0..$#all); return %args; } # a wrapper to ExtUtils::MakeMaker::WriteMakefile sub Write { require Carp; Carp::croak "WriteMakefile: Need even number of args" if @_ % 2; if ($CheckOnly) { print << "."; *** Makefile not written in check-only mode. . return; } my %args = _make_args(@_); no strict 'refs'; $PostambleUsed = 0; local *MY::postamble = \&postamble unless defined &MY::postamble; ExtUtils::MakeMaker::WriteMakefile(%args); print << "." unless $PostambleUsed; *** WARNING: Makefile written with customized MY::postamble() without including contents from Module::AutoInstall::postamble() -- auto installation features disabled. Please contact the author. . return 1; } sub postamble { $PostambleUsed = 1; my $fragment; $fragment .= <<"AUTO_INSTALL" if !$InstallDepsTarget; config :: installdeps \t\$(NOECHO) \$(NOOP) AUTO_INSTALL $fragment .= <<"END_MAKE"; checkdeps :: \t\$(PERL) $0 --checkdeps installdeps :: \t$PostambleActions installdeps_notest :: \t$PostambleActionsNoTest upgradedeps :: \t$PostambleActionsUpgradeDeps upgradedeps_notest :: \t$PostambleActionsUpgradeDepsNoTest listdeps :: \t$PostambleActionsListDeps listalldeps :: \t$PostambleActionsListAllDeps END_MAKE return $fragment; } 1; __END__ #line 1197 UnixAgent-2.4.2/inc/Module/Install.pm000066400000000000000000000327441332737732100174050ustar00rootroot00000000000000#line 1 package Module::Install; # For any maintainers: # The load order for Module::Install is a bit magic. # It goes something like this... # # IF ( host has Module::Install installed, creating author mode ) { # 1. Makefile.PL calls "use inc::Module::Install" # 2. $INC{inc/Module/Install.pm} set to installed version of inc::Module::Install # 3. The installed version of inc::Module::Install loads # 4. inc::Module::Install calls "require Module::Install" # 5. The ./inc/ version of Module::Install loads # } ELSE { # 1. Makefile.PL calls "use inc::Module::Install" # 2. $INC{inc/Module/Install.pm} set to ./inc/ version of Module::Install # 3. The ./inc/ version of Module::Install loads # } use 5.006; use strict 'vars'; use Cwd (); use File::Find (); use File::Path (); use vars qw{$VERSION $MAIN}; BEGIN { # All Module::Install core packages now require synchronised versions. # This will be used to ensure we don't accidentally load old or # different versions of modules. # This is not enforced yet, but will be some time in the next few # releases once we can make sure it won't clash with custom # Module::Install extensions. $VERSION = '1.14'; # Storage for the pseudo-singleton $MAIN = undef; *inc::Module::Install::VERSION = *VERSION; @inc::Module::Install::ISA = __PACKAGE__; } sub import { my $class = shift; my $self = $class->new(@_); my $who = $self->_caller; #------------------------------------------------------------- # all of the following checks should be included in import(), # to allow "eval 'require Module::Install; 1' to test # installation of Module::Install. (RT #51267) #------------------------------------------------------------- # Whether or not inc::Module::Install is actually loaded, the # $INC{inc/Module/Install.pm} is what will still get set as long as # the caller loaded module this in the documented manner. # If not set, the caller may NOT have loaded the bundled version, and thus # they may not have a MI version that works with the Makefile.PL. This would # result in false errors or unexpected behaviour. And we don't want that. my $file = join( '/', 'inc', split /::/, __PACKAGE__ ) . '.pm'; unless ( $INC{$file} ) { die <<"END_DIE" } Please invoke ${\__PACKAGE__} with: use inc::${\__PACKAGE__}; not: use ${\__PACKAGE__}; END_DIE # This reportedly fixes a rare Win32 UTC file time issue, but # as this is a non-cross-platform XS module not in the core, # we shouldn't really depend on it. See RT #24194 for detail. # (Also, this module only supports Perl 5.6 and above). eval "use Win32::UTCFileTime" if $^O eq 'MSWin32' && $] >= 5.006; # If the script that is loading Module::Install is from the future, # then make will detect this and cause it to re-run over and over # again. This is bad. Rather than taking action to touch it (which # is unreliable on some platforms and requires write permissions) # for now we should catch this and refuse to run. if ( -f $0 ) { my $s = (stat($0))[9]; # If the modification time is only slightly in the future, # sleep briefly to remove the problem. my $a = $s - time; if ( $a > 0 and $a < 5 ) { sleep 5 } # Too far in the future, throw an error. my $t = time; if ( $s > $t ) { die <<"END_DIE" } Your installer $0 has a modification time in the future ($s > $t). This is known to create infinite loops in make. Please correct this, then run $0 again. END_DIE } # Build.PL was formerly supported, but no longer is due to excessive # difficulty in implementing every single feature twice. if ( $0 =~ /Build.PL$/i ) { die <<"END_DIE" } Module::Install no longer supports Build.PL. It was impossible to maintain duel backends, and has been deprecated. Please remove all Build.PL files and only use the Makefile.PL installer. END_DIE #------------------------------------------------------------- # To save some more typing in Module::Install installers, every... # use inc::Module::Install # ...also acts as an implicit use strict. $^H |= strict::bits(qw(refs subs vars)); #------------------------------------------------------------- unless ( -f $self->{file} ) { foreach my $key (keys %INC) { delete $INC{$key} if $key =~ /Module\/Install/; } local $^W; require "$self->{path}/$self->{dispatch}.pm"; File::Path::mkpath("$self->{prefix}/$self->{author}"); $self->{admin} = "$self->{name}::$self->{dispatch}"->new( _top => $self ); $self->{admin}->init; @_ = ($class, _self => $self); goto &{"$self->{name}::import"}; } local $^W; *{"${who}::AUTOLOAD"} = $self->autoload; $self->preload; # Unregister loader and worker packages so subdirs can use them again delete $INC{'inc/Module/Install.pm'}; delete $INC{'Module/Install.pm'}; # Save to the singleton $MAIN = $self; return 1; } sub autoload { my $self = shift; my $who = $self->_caller; my $cwd = Cwd::getcwd(); my $sym = "${who}::AUTOLOAD"; $sym->{$cwd} = sub { my $pwd = Cwd::getcwd(); if ( my $code = $sym->{$pwd} ) { # Delegate back to parent dirs goto &$code unless $cwd eq $pwd; } unless ($$sym =~ s/([^:]+)$//) { # XXX: it looks like we can't retrieve the missing function # via $$sym (usually $main::AUTOLOAD) in this case. # I'm still wondering if we should slurp Makefile.PL to # get some context or not ... my ($package, $file, $line) = caller; die <<"EOT"; Unknown function is found at $file line $line. Execution of $file aborted due to runtime errors. If you're a contributor to a project, you may need to install some Module::Install extensions from CPAN (or other repository). If you're a user of a module, please contact the author. EOT } my $method = $1; if ( uc($method) eq $method ) { # Do nothing return; } elsif ( $method =~ /^_/ and $self->can($method) ) { # Dispatch to the root M:I class return $self->$method(@_); } # Dispatch to the appropriate plugin unshift @_, ( $self, $1 ); goto &{$self->can('call')}; }; } sub preload { my $self = shift; unless ( $self->{extensions} ) { $self->load_extensions( "$self->{prefix}/$self->{path}", $self ); } my @exts = @{$self->{extensions}}; unless ( @exts ) { @exts = $self->{admin}->load_all_extensions; } my %seen; foreach my $obj ( @exts ) { while (my ($method, $glob) = each %{ref($obj) . '::'}) { next unless $obj->can($method); next if $method =~ /^_/; next if $method eq uc($method); $seen{$method}++; } } my $who = $self->_caller; foreach my $name ( sort keys %seen ) { local $^W; *{"${who}::$name"} = sub { ${"${who}::AUTOLOAD"} = "${who}::$name"; goto &{"${who}::AUTOLOAD"}; }; } } sub new { my ($class, %args) = @_; delete $INC{'FindBin.pm'}; { # to suppress the redefine warning local $SIG{__WARN__} = sub {}; require FindBin; } # ignore the prefix on extension modules built from top level. my $base_path = Cwd::abs_path($FindBin::Bin); unless ( Cwd::abs_path(Cwd::getcwd()) eq $base_path ) { delete $args{prefix}; } return $args{_self} if $args{_self}; $args{dispatch} ||= 'Admin'; $args{prefix} ||= 'inc'; $args{author} ||= ($^O eq 'VMS' ? '_author' : '.author'); $args{bundle} ||= 'inc/BUNDLES'; $args{base} ||= $base_path; $class =~ s/^\Q$args{prefix}\E:://; $args{name} ||= $class; $args{version} ||= $class->VERSION; unless ( $args{path} ) { $args{path} = $args{name}; $args{path} =~ s!::!/!g; } $args{file} ||= "$args{base}/$args{prefix}/$args{path}.pm"; $args{wrote} = 0; bless( \%args, $class ); } sub call { my ($self, $method) = @_; my $obj = $self->load($method) or return; splice(@_, 0, 2, $obj); goto &{$obj->can($method)}; } sub load { my ($self, $method) = @_; $self->load_extensions( "$self->{prefix}/$self->{path}", $self ) unless $self->{extensions}; foreach my $obj (@{$self->{extensions}}) { return $obj if $obj->can($method); } my $admin = $self->{admin} or die <<"END_DIE"; The '$method' method does not exist in the '$self->{prefix}' path! Please remove the '$self->{prefix}' directory and run $0 again to load it. END_DIE my $obj = $admin->load($method, 1); push @{$self->{extensions}}, $obj; $obj; } sub load_extensions { my ($self, $path, $top) = @_; my $should_reload = 0; unless ( grep { ! ref $_ and lc $_ eq lc $self->{prefix} } @INC ) { unshift @INC, $self->{prefix}; $should_reload = 1; } foreach my $rv ( $self->find_extensions($path) ) { my ($file, $pkg) = @{$rv}; next if $self->{pathnames}{$pkg}; local $@; my $new = eval { local $^W; require $file; $pkg->can('new') }; unless ( $new ) { warn $@ if $@; next; } $self->{pathnames}{$pkg} = $should_reload ? delete $INC{$file} : $INC{$file}; push @{$self->{extensions}}, &{$new}($pkg, _top => $top ); } $self->{extensions} ||= []; } sub find_extensions { my ($self, $path) = @_; my @found; File::Find::find( sub { my $file = $File::Find::name; return unless $file =~ m!^\Q$path\E/(.+)\.pm\Z!is; my $subpath = $1; return if lc($subpath) eq lc($self->{dispatch}); $file = "$self->{path}/$subpath.pm"; my $pkg = "$self->{name}::$subpath"; $pkg =~ s!/!::!g; # If we have a mixed-case package name, assume case has been preserved # correctly. Otherwise, root through the file to locate the case-preserved # version of the package name. if ( $subpath eq lc($subpath) || $subpath eq uc($subpath) ) { my $content = Module::Install::_read($subpath . '.pm'); my $in_pod = 0; foreach ( split /\n/, $content ) { $in_pod = 1 if /^=\w/; $in_pod = 0 if /^=cut/; next if ($in_pod || /^=cut/); # skip pod text next if /^\s*#/; # and comments if ( m/^\s*package\s+($pkg)\s*;/i ) { $pkg = $1; last; } } } push @found, [ $file, $pkg ]; }, $path ) if -d $path; @found; } ##################################################################### # Common Utility Functions sub _caller { my $depth = 0; my $call = caller($depth); while ( $call eq __PACKAGE__ ) { $depth++; $call = caller($depth); } return $call; } # Done in evals to avoid confusing Perl::MinimumVersion eval( $] >= 5.006 ? <<'END_NEW' : <<'END_OLD' ); die $@ if $@; sub _read { local *FH; open( FH, '<', $_[0] ) or die "open($_[0]): $!"; binmode FH; my $string = do { local $/; }; close FH or die "close($_[0]): $!"; return $string; } END_NEW sub _read { local *FH; open( FH, "< $_[0]" ) or die "open($_[0]): $!"; binmode FH; my $string = do { local $/; }; close FH or die "close($_[0]): $!"; return $string; } END_OLD sub _readperl { my $string = Module::Install::_read($_[0]); $string =~ s/(?:\015{1,2}\012|\015|\012)/\n/sg; $string =~ s/(\n)\n*__(?:DATA|END)__\b.*\z/$1/s; $string =~ s/\n\n=\w+.+?\n\n=cut\b.+?\n+/\n\n/sg; return $string; } sub _readpod { my $string = Module::Install::_read($_[0]); $string =~ s/(?:\015{1,2}\012|\015|\012)/\n/sg; return $string if $_[0] =~ /\.pod\z/; $string =~ s/(^|\n=cut\b.+?\n+)[^=\s].+?\n(\n=\w+|\z)/$1$2/sg; $string =~ s/\n*=pod\b[^\n]*\n+/\n\n/sg; $string =~ s/\n*=cut\b[^\n]*\n+/\n\n/sg; $string =~ s/^\n+//s; return $string; } # Done in evals to avoid confusing Perl::MinimumVersion eval( $] >= 5.006 ? <<'END_NEW' : <<'END_OLD' ); die $@ if $@; sub _write { local *FH; open( FH, '>', $_[0] ) or die "open($_[0]): $!"; binmode FH; foreach ( 1 .. $#_ ) { print FH $_[$_] or die "print($_[0]): $!"; } close FH or die "close($_[0]): $!"; } END_NEW sub _write { local *FH; open( FH, "> $_[0]" ) or die "open($_[0]): $!"; binmode FH; foreach ( 1 .. $#_ ) { print FH $_[$_] or die "print($_[0]): $!"; } close FH or die "close($_[0]): $!"; } END_OLD # _version is for processing module versions (eg, 1.03_05) not # Perl versions (eg, 5.8.1). sub _version { my $s = shift || 0; my $d =()= $s =~ /(\.)/g; if ( $d >= 2 ) { # Normalise multipart versions $s =~ s/(\.)(\d{1,3})/sprintf("$1%03d",$2)/eg; } $s =~ s/^(\d+)\.?//; my $l = $1 || 0; my @v = map { $_ . '0' x (3 - length $_) } $s =~ /(\d{1,3})\D?/g; $l = $l . '.' . join '', @v if @v; return $l + 0; } sub _cmp { _version($_[1]) <=> _version($_[2]); } # Cloned from Params::Util::_CLASS sub _CLASS { ( defined $_[0] and ! ref $_[0] and $_[0] =~ m/^[^\W\d]\w*(?:::\w+)*\z/s ) ? $_[0] : undef; } 1; # Copyright 2008 - 2012 Adam Kennedy. UnixAgent-2.4.2/inc/Module/Install/000077500000000000000000000000001332737732100170355ustar00rootroot00000000000000UnixAgent-2.4.2/inc/Module/Install/Base.pm000066400000000000000000000022571332737732100202530ustar00rootroot00000000000000#line 1 package Module::Install::Base; use strict 'vars'; use vars qw{$VERSION}; BEGIN { $VERSION = '1.14'; } # Suspend handler for "redefined" warnings BEGIN { my $w = $SIG{__WARN__}; $SIG{__WARN__} = sub { $w }; } #line 42 sub new { my $class = shift; unless ( defined &{"${class}::call"} ) { *{"${class}::call"} = sub { shift->_top->call(@_) }; } unless ( defined &{"${class}::load"} ) { *{"${class}::load"} = sub { shift->_top->load(@_) }; } bless { @_ }, $class; } #line 61 sub AUTOLOAD { local $@; my $func = eval { shift->_top->autoload } or return; goto &$func; } #line 75 sub _top { $_[0]->{_top}; } #line 90 sub admin { $_[0]->_top->{admin} or Module::Install::Base::FakeAdmin->new; } #line 106 sub is_admin { ! $_[0]->admin->isa('Module::Install::Base::FakeAdmin'); } sub DESTROY {} package Module::Install::Base::FakeAdmin; use vars qw{$VERSION}; BEGIN { $VERSION = $Module::Install::Base::VERSION; } my $fake; sub new { $fake ||= bless(\@_, $_[0]); } sub AUTOLOAD {} sub DESTROY {} # Restore warning handler BEGIN { $SIG{__WARN__} = $SIG{__WARN__}->(); } 1; #line 159 UnixAgent-2.4.2/inc/Module/Install/Can.pm000066400000000000000000000067731332737732100201110ustar00rootroot00000000000000#line 1 package Module::Install::Can; use strict; use Config (); use ExtUtils::MakeMaker (); use Module::Install::Base (); use vars qw{$VERSION @ISA $ISCORE}; BEGIN { $VERSION = '1.14'; @ISA = 'Module::Install::Base'; $ISCORE = 1; } # check if we can load some module ### Upgrade this to not have to load the module if possible sub can_use { my ($self, $mod, $ver) = @_; $mod =~ s{::|\\}{/}g; $mod .= '.pm' unless $mod =~ /\.pm$/i; my $pkg = $mod; $pkg =~ s{/}{::}g; $pkg =~ s{\.pm$}{}i; local $@; eval { require $mod; $pkg->VERSION($ver || 0); 1 }; } # Check if we can run some command sub can_run { my ($self, $cmd) = @_; my $_cmd = $cmd; return $_cmd if (-x $_cmd or $_cmd = MM->maybe_command($_cmd)); for my $dir ((split /$Config::Config{path_sep}/, $ENV{PATH}), '.') { next if $dir eq ''; require File::Spec; my $abs = File::Spec->catfile($dir, $cmd); return $abs if (-x $abs or $abs = MM->maybe_command($abs)); } return; } # Can our C compiler environment build XS files sub can_xs { my $self = shift; # Ensure we have the CBuilder module $self->configure_requires( 'ExtUtils::CBuilder' => 0.27 ); # Do we have the configure_requires checker? local $@; eval "require ExtUtils::CBuilder;"; if ( $@ ) { # They don't obey configure_requires, so it is # someone old and delicate. Try to avoid hurting # them by falling back to an older simpler test. return $self->can_cc(); } # Do we have a working C compiler my $builder = ExtUtils::CBuilder->new( quiet => 1, ); unless ( $builder->have_compiler ) { # No working C compiler return 0; } # Write a C file representative of what XS becomes require File::Temp; my ( $FH, $tmpfile ) = File::Temp::tempfile( "compilexs-XXXXX", SUFFIX => '.c', ); binmode $FH; print $FH <<'END_C'; #include "EXTERN.h" #include "perl.h" #include "XSUB.h" int main(int argc, char **argv) { return 0; } int boot_sanexs() { return 1; } END_C close $FH; # Can the C compiler access the same headers XS does my @libs = (); my $object = undef; eval { local $^W = 0; $object = $builder->compile( source => $tmpfile, ); @libs = $builder->link( objects => $object, module_name => 'sanexs', ); }; my $result = $@ ? 0 : 1; # Clean up all the build files foreach ( $tmpfile, $object, @libs ) { next unless defined $_; 1 while unlink; } return $result; } # Can we locate a (the) C compiler sub can_cc { my $self = shift; my @chunks = split(/ /, $Config::Config{cc}) or return; # $Config{cc} may contain args; try to find out the program part while (@chunks) { return $self->can_run("@chunks") || (pop(@chunks), next); } return; } # Fix Cygwin bug on maybe_command(); if ( $^O eq 'cygwin' ) { require ExtUtils::MM_Cygwin; require ExtUtils::MM_Win32; if ( ! defined(&ExtUtils::MM_Cygwin::maybe_command) ) { *ExtUtils::MM_Cygwin::maybe_command = sub { my ($self, $file) = @_; if ($file =~ m{^/cygdrive/}i and ExtUtils::MM_Win32->can('maybe_command')) { ExtUtils::MM_Win32->maybe_command($file); } else { ExtUtils::MM_Unix->maybe_command($file); } } } } 1; __END__ #line 236 UnixAgent-2.4.2/inc/Module/Install/Fetch.pm000066400000000000000000000046401332737732100204300ustar00rootroot00000000000000#line 1 package Module::Install::Fetch; use strict; use Module::Install::Base (); use vars qw{$VERSION @ISA $ISCORE}; BEGIN { $VERSION = '1.14'; @ISA = 'Module::Install::Base'; $ISCORE = 1; } sub get_file { my ($self, %args) = @_; my ($scheme, $host, $path, $file) = $args{url} =~ m|^(\w+)://([^/]+)(.+)/(.+)| or return; if ( $scheme eq 'http' and ! eval { require LWP::Simple; 1 } ) { $args{url} = $args{ftp_url} or (warn("LWP support unavailable!\n"), return); ($scheme, $host, $path, $file) = $args{url} =~ m|^(\w+)://([^/]+)(.+)/(.+)| or return; } $|++; print "Fetching '$file' from $host... "; unless (eval { require Socket; Socket::inet_aton($host) }) { warn "'$host' resolve failed!\n"; return; } return unless $scheme eq 'ftp' or $scheme eq 'http'; require Cwd; my $dir = Cwd::getcwd(); chdir $args{local_dir} or return if exists $args{local_dir}; if (eval { require LWP::Simple; 1 }) { LWP::Simple::mirror($args{url}, $file); } elsif (eval { require Net::FTP; 1 }) { eval { # use Net::FTP to get past firewall my $ftp = Net::FTP->new($host, Passive => 1, Timeout => 600); $ftp->login("anonymous", 'anonymous@example.com'); $ftp->cwd($path); $ftp->binary; $ftp->get($file) or (warn("$!\n"), return); $ftp->quit; } } elsif (my $ftp = $self->can_run('ftp')) { eval { # no Net::FTP, fallback to ftp.exe require FileHandle; my $fh = FileHandle->new; local $SIG{CHLD} = 'IGNORE'; unless ($fh->open("|$ftp -n")) { warn "Couldn't open ftp: $!\n"; chdir $dir; return; } my @dialog = split(/\n/, <<"END_FTP"); open $host user anonymous anonymous\@example.com cd $path binary get $file $file quit END_FTP foreach (@dialog) { $fh->print("$_\n") } $fh->close; } } else { warn "No working 'ftp' program available!\n"; chdir $dir; return; } unless (-f $file) { warn "Fetching failed: $@\n"; chdir $dir; return; } return if exists $args{size} and -s $file != $args{size}; system($args{run}) if exists $args{run}; unlink($file) if $args{remove}; print(((!exists $args{check_for} or -e $args{check_for}) ? "done!" : "failed! ($!)"), "\n"); chdir $dir; return !$?; } 1; UnixAgent-2.4.2/inc/Module/Install/Include.pm000066400000000000000000000010451332737732100207560ustar00rootroot00000000000000#line 1 package Module::Install::Include; use strict; use Module::Install::Base (); use vars qw{$VERSION @ISA $ISCORE}; BEGIN { $VERSION = '1.14'; @ISA = 'Module::Install::Base'; $ISCORE = 1; } sub include { shift()->admin->include(@_); } sub include_deps { shift()->admin->include_deps(@_); } sub auto_include { shift()->admin->auto_include(@_); } sub auto_include_deps { shift()->admin->auto_include_deps(@_); } sub auto_include_dependent_dists { shift()->admin->auto_include_dependent_dists(@_); } 1; UnixAgent-2.4.2/inc/Module/Install/Makefile.pm000066400000000000000000000321001332737732100211040ustar00rootroot00000000000000#line 1 package Module::Install::Makefile; use strict 'vars'; use ExtUtils::MakeMaker (); use Module::Install::Base (); use Fcntl qw/:flock :seek/; use vars qw{$VERSION @ISA $ISCORE}; BEGIN { $VERSION = '1.14'; @ISA = 'Module::Install::Base'; $ISCORE = 1; } sub Makefile { $_[0] } my %seen = (); sub prompt { shift; # Infinite loop protection my @c = caller(); if ( ++$seen{"$c[1]|$c[2]|$_[0]"} > 3 ) { die "Caught an potential prompt infinite loop ($c[1]|$c[2]|$_[0])"; } # In automated testing or non-interactive session, always use defaults if ( ($ENV{AUTOMATED_TESTING} or -! -t STDIN) and ! $ENV{PERL_MM_USE_DEFAULT} ) { local $ENV{PERL_MM_USE_DEFAULT} = 1; goto &ExtUtils::MakeMaker::prompt; } else { goto &ExtUtils::MakeMaker::prompt; } } # Store a cleaned up version of the MakeMaker version, # since we need to behave differently in a variety of # ways based on the MM version. my $makemaker = eval $ExtUtils::MakeMaker::VERSION; # If we are passed a param, do a "newer than" comparison. # Otherwise, just return the MakeMaker version. sub makemaker { ( @_ < 2 or $makemaker >= eval($_[1]) ) ? $makemaker : 0 } # Ripped from ExtUtils::MakeMaker 6.56, and slightly modified # as we only need to know here whether the attribute is an array # or a hash or something else (which may or may not be appendable). my %makemaker_argtype = ( C => 'ARRAY', CONFIG => 'ARRAY', # CONFIGURE => 'CODE', # ignore DIR => 'ARRAY', DL_FUNCS => 'HASH', DL_VARS => 'ARRAY', EXCLUDE_EXT => 'ARRAY', EXE_FILES => 'ARRAY', FUNCLIST => 'ARRAY', H => 'ARRAY', IMPORTS => 'HASH', INCLUDE_EXT => 'ARRAY', LIBS => 'ARRAY', # ignore '' MAN1PODS => 'HASH', MAN3PODS => 'HASH', META_ADD => 'HASH', META_MERGE => 'HASH', PL_FILES => 'HASH', PM => 'HASH', PMLIBDIRS => 'ARRAY', PMLIBPARENTDIRS => 'ARRAY', PREREQ_PM => 'HASH', CONFIGURE_REQUIRES => 'HASH', SKIP => 'ARRAY', TYPEMAPS => 'ARRAY', XS => 'HASH', # VERSION => ['version',''], # ignore # _KEEP_AFTER_FLUSH => '', clean => 'HASH', depend => 'HASH', dist => 'HASH', dynamic_lib=> 'HASH', linkext => 'HASH', macro => 'HASH', postamble => 'HASH', realclean => 'HASH', test => 'HASH', tool_autosplit => 'HASH', # special cases where you can use makemaker_append CCFLAGS => 'APPENDABLE', DEFINE => 'APPENDABLE', INC => 'APPENDABLE', LDDLFLAGS => 'APPENDABLE', LDFROM => 'APPENDABLE', ); sub makemaker_args { my ($self, %new_args) = @_; my $args = ( $self->{makemaker_args} ||= {} ); foreach my $key (keys %new_args) { if ($makemaker_argtype{$key}) { if ($makemaker_argtype{$key} eq 'ARRAY') { $args->{$key} = [] unless defined $args->{$key}; unless (ref $args->{$key} eq 'ARRAY') { $args->{$key} = [$args->{$key}] } push @{$args->{$key}}, ref $new_args{$key} eq 'ARRAY' ? @{$new_args{$key}} : $new_args{$key}; } elsif ($makemaker_argtype{$key} eq 'HASH') { $args->{$key} = {} unless defined $args->{$key}; foreach my $skey (keys %{ $new_args{$key} }) { $args->{$key}{$skey} = $new_args{$key}{$skey}; } } elsif ($makemaker_argtype{$key} eq 'APPENDABLE') { $self->makemaker_append($key => $new_args{$key}); } } else { if (defined $args->{$key}) { warn qq{MakeMaker attribute "$key" is overridden; use "makemaker_append" to append values\n}; } $args->{$key} = $new_args{$key}; } } return $args; } # For mm args that take multiple space-separated args, # append an argument to the current list. sub makemaker_append { my $self = shift; my $name = shift; my $args = $self->makemaker_args; $args->{$name} = defined $args->{$name} ? join( ' ', $args->{$name}, @_ ) : join( ' ', @_ ); } sub build_subdirs { my $self = shift; my $subdirs = $self->makemaker_args->{DIR} ||= []; for my $subdir (@_) { push @$subdirs, $subdir; } } sub clean_files { my $self = shift; my $clean = $self->makemaker_args->{clean} ||= {}; %$clean = ( %$clean, FILES => join ' ', grep { length $_ } ($clean->{FILES} || (), @_), ); } sub realclean_files { my $self = shift; my $realclean = $self->makemaker_args->{realclean} ||= {}; %$realclean = ( %$realclean, FILES => join ' ', grep { length $_ } ($realclean->{FILES} || (), @_), ); } sub libs { my $self = shift; my $libs = ref $_[0] ? shift : [ shift ]; $self->makemaker_args( LIBS => $libs ); } sub inc { my $self = shift; $self->makemaker_args( INC => shift ); } sub _wanted_t { } sub tests_recursive { my $self = shift; my $dir = shift || 't'; unless ( -d $dir ) { die "tests_recursive dir '$dir' does not exist"; } my %tests = map { $_ => 1 } split / /, ($self->tests || ''); require File::Find; File::Find::find( sub { /\.t$/ and -f $_ and $tests{"$File::Find::dir/*.t"} = 1 }, $dir ); $self->tests( join ' ', sort keys %tests ); } sub write { my $self = shift; die "&Makefile->write() takes no arguments\n" if @_; # Check the current Perl version my $perl_version = $self->perl_version; if ( $perl_version ) { eval "use $perl_version; 1" or die "ERROR: perl: Version $] is installed, " . "but we need version >= $perl_version"; } # Make sure we have a new enough MakeMaker require ExtUtils::MakeMaker; if ( $perl_version and $self->_cmp($perl_version, '5.006') >= 0 ) { # This previous attempted to inherit the version of # ExtUtils::MakeMaker in use by the module author, but this # was found to be untenable as some authors build releases # using future dev versions of EU:MM that nobody else has. # Instead, #toolchain suggests we use 6.59 which is the most # stable version on CPAN at time of writing and is, to quote # ribasushi, "not terminally fucked, > and tested enough". # TODO: We will now need to maintain this over time to push # the version up as new versions are released. $self->build_requires( 'ExtUtils::MakeMaker' => 6.59 ); $self->configure_requires( 'ExtUtils::MakeMaker' => 6.59 ); } else { # Allow legacy-compatibility with 5.005 by depending on the # most recent EU:MM that supported 5.005. $self->build_requires( 'ExtUtils::MakeMaker' => 6.36 ); $self->configure_requires( 'ExtUtils::MakeMaker' => 6.36 ); } # Generate the MakeMaker params my $args = $self->makemaker_args; $args->{DISTNAME} = $self->name; $args->{NAME} = $self->module_name || $self->name; $args->{NAME} =~ s/-/::/g; $args->{VERSION} = $self->version or die <<'EOT'; ERROR: Can't determine distribution version. Please specify it explicitly via 'version' in Makefile.PL, or set a valid $VERSION in a module, and provide its file path via 'version_from' (or 'all_from' if you prefer) in Makefile.PL. EOT if ( $self->tests ) { my @tests = split ' ', $self->tests; my %seen; $args->{test} = { TESTS => (join ' ', grep {!$seen{$_}++} @tests), }; } elsif ( $Module::Install::ExtraTests::use_extratests ) { # Module::Install::ExtraTests doesn't set $self->tests and does its own tests via harness. # So, just ignore our xt tests here. } elsif ( -d 'xt' and ($Module::Install::AUTHOR or $ENV{RELEASE_TESTING}) ) { $args->{test} = { TESTS => join( ' ', map { "$_/*.t" } grep { -d $_ } qw{ t xt } ), }; } if ( $] >= 5.005 ) { $args->{ABSTRACT} = $self->abstract; $args->{AUTHOR} = join ', ', @{$self->author || []}; } if ( $self->makemaker(6.10) ) { $args->{NO_META} = 1; #$args->{NO_MYMETA} = 1; } if ( $self->makemaker(6.17) and $self->sign ) { $args->{SIGN} = 1; } unless ( $self->is_admin ) { delete $args->{SIGN}; } if ( $self->makemaker(6.31) and $self->license ) { $args->{LICENSE} = $self->license; } my $prereq = ($args->{PREREQ_PM} ||= {}); %$prereq = ( %$prereq, map { @$_ } # flatten [module => version] map { @$_ } grep $_, ($self->requires) ); # Remove any reference to perl, PREREQ_PM doesn't support it delete $args->{PREREQ_PM}->{perl}; # Merge both kinds of requires into BUILD_REQUIRES my $build_prereq = ($args->{BUILD_REQUIRES} ||= {}); %$build_prereq = ( %$build_prereq, map { @$_ } # flatten [module => version] map { @$_ } grep $_, ($self->configure_requires, $self->build_requires) ); # Remove any reference to perl, BUILD_REQUIRES doesn't support it delete $args->{BUILD_REQUIRES}->{perl}; # Delete bundled dists from prereq_pm, add it to Makefile DIR my $subdirs = ($args->{DIR} || []); if ($self->bundles) { my %processed; foreach my $bundle (@{ $self->bundles }) { my ($mod_name, $dist_dir) = @$bundle; delete $prereq->{$mod_name}; $dist_dir = File::Basename::basename($dist_dir); # dir for building this module if (not exists $processed{$dist_dir}) { if (-d $dist_dir) { # List as sub-directory to be processed by make push @$subdirs, $dist_dir; } # Else do nothing: the module is already present on the system $processed{$dist_dir} = undef; } } } unless ( $self->makemaker('6.55_03') ) { %$prereq = (%$prereq,%$build_prereq); delete $args->{BUILD_REQUIRES}; } if ( my $perl_version = $self->perl_version ) { eval "use $perl_version; 1" or die "ERROR: perl: Version $] is installed, " . "but we need version >= $perl_version"; if ( $self->makemaker(6.48) ) { $args->{MIN_PERL_VERSION} = $perl_version; } } if ($self->installdirs) { warn qq{old INSTALLDIRS (probably set by makemaker_args) is overridden by installdirs\n} if $args->{INSTALLDIRS}; $args->{INSTALLDIRS} = $self->installdirs; } my %args = map { ( $_ => $args->{$_} ) } grep {defined($args->{$_} ) } keys %$args; my $user_preop = delete $args{dist}->{PREOP}; if ( my $preop = $self->admin->preop($user_preop) ) { foreach my $key ( keys %$preop ) { $args{dist}->{$key} = $preop->{$key}; } } my $mm = ExtUtils::MakeMaker::WriteMakefile(%args); $self->fix_up_makefile($mm->{FIRST_MAKEFILE} || 'Makefile'); } sub fix_up_makefile { my $self = shift; my $makefile_name = shift; my $top_class = ref($self->_top) || ''; my $top_version = $self->_top->VERSION || ''; my $preamble = $self->preamble ? "# Preamble by $top_class $top_version\n" . $self->preamble : ''; my $postamble = "# Postamble by $top_class $top_version\n" . ($self->postamble || ''); local *MAKEFILE; open MAKEFILE, "+< $makefile_name" or die "fix_up_makefile: Couldn't open $makefile_name: $!"; eval { flock MAKEFILE, LOCK_EX }; my $makefile = do { local $/; }; $makefile =~ s/\b(test_harness\(\$\(TEST_VERBOSE\), )/$1'inc', /; $makefile =~ s/( -I\$\(INST_ARCHLIB\))/ -Iinc$1/g; $makefile =~ s/( "-I\$\(INST_LIB\)")/ "-Iinc"$1/g; $makefile =~ s/^(FULLPERL = .*)/$1 "-Iinc"/m; $makefile =~ s/^(PERL = .*)/$1 "-Iinc"/m; # Module::Install will never be used to build the Core Perl # Sometimes PERL_LIB and PERL_ARCHLIB get written anyway, which breaks # PREFIX/PERL5LIB, and thus, install_share. Blank them if they exist $makefile =~ s/^PERL_LIB = .+/PERL_LIB =/m; #$makefile =~ s/^PERL_ARCHLIB = .+/PERL_ARCHLIB =/m; # Perl 5.005 mentions PERL_LIB explicitly, so we have to remove that as well. $makefile =~ s/(\"?)-I\$\(PERL_LIB\)\1//g; # XXX - This is currently unused; not sure if it breaks other MM-users # $makefile =~ s/^pm_to_blib\s+:\s+/pm_to_blib :: /mg; seek MAKEFILE, 0, SEEK_SET; truncate MAKEFILE, 0; print MAKEFILE "$preamble$makefile$postamble" or die $!; close MAKEFILE or die $!; 1; } sub preamble { my ($self, $text) = @_; $self->{preamble} = $text . $self->{preamble} if defined $text; $self->{preamble}; } sub postamble { my ($self, $text) = @_; $self->{postamble} ||= $self->admin->postamble; $self->{postamble} .= $text if defined $text; $self->{postamble} } 1; __END__ #line 544 UnixAgent-2.4.2/inc/Module/Install/Metadata.pm000066400000000000000000000501071332737732100211160ustar00rootroot00000000000000#line 1 package Module::Install::Metadata; use strict 'vars'; use Module::Install::Base (); use vars qw{$VERSION @ISA $ISCORE}; BEGIN { $VERSION = '1.14'; @ISA = 'Module::Install::Base'; $ISCORE = 1; } my @boolean_keys = qw{ sign }; my @scalar_keys = qw{ name module_name abstract version distribution_type tests installdirs }; my @tuple_keys = qw{ configure_requires build_requires requires recommends bundles resources }; my @resource_keys = qw{ homepage bugtracker repository }; my @array_keys = qw{ keywords author }; *authors = \&author; sub Meta { shift } sub Meta_BooleanKeys { @boolean_keys } sub Meta_ScalarKeys { @scalar_keys } sub Meta_TupleKeys { @tuple_keys } sub Meta_ResourceKeys { @resource_keys } sub Meta_ArrayKeys { @array_keys } foreach my $key ( @boolean_keys ) { *$key = sub { my $self = shift; if ( defined wantarray and not @_ ) { return $self->{values}->{$key}; } $self->{values}->{$key} = ( @_ ? $_[0] : 1 ); return $self; }; } foreach my $key ( @scalar_keys ) { *$key = sub { my $self = shift; return $self->{values}->{$key} if defined wantarray and !@_; $self->{values}->{$key} = shift; return $self; }; } foreach my $key ( @array_keys ) { *$key = sub { my $self = shift; return $self->{values}->{$key} if defined wantarray and !@_; $self->{values}->{$key} ||= []; push @{$self->{values}->{$key}}, @_; return $self; }; } foreach my $key ( @resource_keys ) { *$key = sub { my $self = shift; unless ( @_ ) { return () unless $self->{values}->{resources}; return map { $_->[1] } grep { $_->[0] eq $key } @{ $self->{values}->{resources} }; } return $self->{values}->{resources}->{$key} unless @_; my $uri = shift or die( "Did not provide a value to $key()" ); $self->resources( $key => $uri ); return 1; }; } foreach my $key ( grep { $_ ne "resources" } @tuple_keys) { *$key = sub { my $self = shift; return $self->{values}->{$key} unless @_; my @added; while ( @_ ) { my $module = shift or last; my $version = shift || 0; push @added, [ $module, $version ]; } push @{ $self->{values}->{$key} }, @added; return map {@$_} @added; }; } # Resource handling my %lc_resource = map { $_ => 1 } qw{ homepage license bugtracker repository }; sub resources { my $self = shift; while ( @_ ) { my $name = shift or last; my $value = shift or next; if ( $name eq lc $name and ! $lc_resource{$name} ) { die("Unsupported reserved lowercase resource '$name'"); } $self->{values}->{resources} ||= []; push @{ $self->{values}->{resources} }, [ $name, $value ]; } $self->{values}->{resources}; } # Aliases for build_requires that will have alternative # meanings in some future version of META.yml. sub test_requires { shift->build_requires(@_) } sub install_requires { shift->build_requires(@_) } # Aliases for installdirs options sub install_as_core { $_[0]->installdirs('perl') } sub install_as_cpan { $_[0]->installdirs('site') } sub install_as_site { $_[0]->installdirs('site') } sub install_as_vendor { $_[0]->installdirs('vendor') } sub dynamic_config { my $self = shift; my $value = @_ ? shift : 1; if ( $self->{values}->{dynamic_config} ) { # Once dynamic we never change to static, for safety return 0; } $self->{values}->{dynamic_config} = $value ? 1 : 0; return 1; } # Convenience command sub static_config { shift->dynamic_config(0); } sub perl_version { my $self = shift; return $self->{values}->{perl_version} unless @_; my $version = shift or die( "Did not provide a value to perl_version()" ); # Normalize the version $version = $self->_perl_version($version); # We don't support the really old versions unless ( $version >= 5.005 ) { die "Module::Install only supports 5.005 or newer (use ExtUtils::MakeMaker)\n"; } $self->{values}->{perl_version} = $version; } sub all_from { my ( $self, $file ) = @_; unless ( defined($file) ) { my $name = $self->name or die( "all_from called with no args without setting name() first" ); $file = join('/', 'lib', split(/-/, $name)) . '.pm'; $file =~ s{.*/}{} unless -e $file; unless ( -e $file ) { die("all_from cannot find $file from $name"); } } unless ( -f $file ) { die("The path '$file' does not exist, or is not a file"); } $self->{values}{all_from} = $file; # Some methods pull from POD instead of code. # If there is a matching .pod, use that instead my $pod = $file; $pod =~ s/\.pm$/.pod/i; $pod = $file unless -e $pod; # Pull the different values $self->name_from($file) unless $self->name; $self->version_from($file) unless $self->version; $self->perl_version_from($file) unless $self->perl_version; $self->author_from($pod) unless @{$self->author || []}; $self->license_from($pod) unless $self->license; $self->abstract_from($pod) unless $self->abstract; return 1; } sub provides { my $self = shift; my $provides = ( $self->{values}->{provides} ||= {} ); %$provides = (%$provides, @_) if @_; return $provides; } sub auto_provides { my $self = shift; return $self unless $self->is_admin; unless (-e 'MANIFEST') { warn "Cannot deduce auto_provides without a MANIFEST, skipping\n"; return $self; } # Avoid spurious warnings as we are not checking manifest here. local $SIG{__WARN__} = sub {1}; require ExtUtils::Manifest; local *ExtUtils::Manifest::manicheck = sub { return }; require Module::Build; my $build = Module::Build->new( dist_name => $self->name, dist_version => $self->version, license => $self->license, ); $self->provides( %{ $build->find_dist_packages || {} } ); } sub feature { my $self = shift; my $name = shift; my $features = ( $self->{values}->{features} ||= [] ); my $mods; if ( @_ == 1 and ref( $_[0] ) ) { # The user used ->feature like ->features by passing in the second # argument as a reference. Accommodate for that. $mods = $_[0]; } else { $mods = \@_; } my $count = 0; push @$features, ( $name => [ map { ref($_) ? ( ref($_) eq 'HASH' ) ? %$_ : @$_ : $_ } @$mods ] ); return @$features; } sub features { my $self = shift; while ( my ( $name, $mods ) = splice( @_, 0, 2 ) ) { $self->feature( $name, @$mods ); } return $self->{values}->{features} ? @{ $self->{values}->{features} } : (); } sub no_index { my $self = shift; my $type = shift; push @{ $self->{values}->{no_index}->{$type} }, @_ if $type; return $self->{values}->{no_index}; } sub read { my $self = shift; $self->include_deps( 'YAML::Tiny', 0 ); require YAML::Tiny; my $data = YAML::Tiny::LoadFile('META.yml'); # Call methods explicitly in case user has already set some values. while ( my ( $key, $value ) = each %$data ) { next unless $self->can($key); if ( ref $value eq 'HASH' ) { while ( my ( $module, $version ) = each %$value ) { $self->can($key)->($self, $module => $version ); } } else { $self->can($key)->($self, $value); } } return $self; } sub write { my $self = shift; return $self unless $self->is_admin; $self->admin->write_meta; return $self; } sub version_from { require ExtUtils::MM_Unix; my ( $self, $file ) = @_; $self->version( ExtUtils::MM_Unix->parse_version($file) ); # for version integrity check $self->makemaker_args( VERSION_FROM => $file ); } sub abstract_from { require ExtUtils::MM_Unix; my ( $self, $file ) = @_; $self->abstract( bless( { DISTNAME => $self->name }, 'ExtUtils::MM_Unix' )->parse_abstract($file) ); } # Add both distribution and module name sub name_from { my ($self, $file) = @_; if ( Module::Install::_read($file) =~ m/ ^ \s* package \s* ([\w:]+) [\s|;]* /ixms ) { my ($name, $module_name) = ($1, $1); $name =~ s{::}{-}g; $self->name($name); unless ( $self->module_name ) { $self->module_name($module_name); } } else { die("Cannot determine name from $file\n"); } } sub _extract_perl_version { if ( $_[0] =~ m/ ^\s* (?:use|require) \s* v? ([\d_\.]+) \s* ; /ixms ) { my $perl_version = $1; $perl_version =~ s{_}{}g; return $perl_version; } else { return; } } sub perl_version_from { my $self = shift; my $perl_version=_extract_perl_version(Module::Install::_read($_[0])); if ($perl_version) { $self->perl_version($perl_version); } else { warn "Cannot determine perl version info from $_[0]\n"; return; } } sub author_from { my $self = shift; my $content = Module::Install::_read($_[0]); if ($content =~ m/ =head \d \s+ (?:authors?)\b \s* ([^\n]*) | =head \d \s+ (?:licen[cs]e|licensing|copyright|legal)\b \s* .*? copyright .*? \d\d\d[\d.]+ \s* (?:\bby\b)? \s* ([^\n]*) /ixms) { my $author = $1 || $2; # XXX: ugly but should work anyway... if (eval "require Pod::Escapes; 1") { # Pod::Escapes has a mapping table. # It's in core of perl >= 5.9.3, and should be installed # as one of the Pod::Simple's prereqs, which is a prereq # of Pod::Text 3.x (see also below). $author =~ s{ E<( (\d+) | ([A-Za-z]+) )> } { defined $2 ? chr($2) : defined $Pod::Escapes::Name2character_number{$1} ? chr($Pod::Escapes::Name2character_number{$1}) : do { warn "Unknown escape: E<$1>"; "E<$1>"; }; }gex; } elsif (eval "require Pod::Text; 1" && $Pod::Text::VERSION < 3) { # Pod::Text < 3.0 has yet another mapping table, # though the table name of 2.x and 1.x are different. # (1.x is in core of Perl < 5.6, 2.x is in core of # Perl < 5.9.3) my $mapping = ($Pod::Text::VERSION < 2) ? \%Pod::Text::HTML_Escapes : \%Pod::Text::ESCAPES; $author =~ s{ E<( (\d+) | ([A-Za-z]+) )> } { defined $2 ? chr($2) : defined $mapping->{$1} ? $mapping->{$1} : do { warn "Unknown escape: E<$1>"; "E<$1>"; }; }gex; } else { $author =~ s{E}{<}g; $author =~ s{E}{>}g; } $self->author($author); } else { warn "Cannot determine author info from $_[0]\n"; } } #Stolen from M::B my %license_urls = ( perl => 'http://dev.perl.org/licenses/', apache => 'http://apache.org/licenses/LICENSE-2.0', apache_1_1 => 'http://apache.org/licenses/LICENSE-1.1', artistic => 'http://opensource.org/licenses/artistic-license.php', artistic_2 => 'http://opensource.org/licenses/artistic-license-2.0.php', lgpl => 'http://opensource.org/licenses/lgpl-license.php', lgpl2 => 'http://opensource.org/licenses/lgpl-2.1.php', lgpl3 => 'http://opensource.org/licenses/lgpl-3.0.html', bsd => 'http://opensource.org/licenses/bsd-license.php', gpl => 'http://opensource.org/licenses/gpl-license.php', gpl2 => 'http://opensource.org/licenses/gpl-2.0.php', gpl3 => 'http://opensource.org/licenses/gpl-3.0.html', mit => 'http://opensource.org/licenses/mit-license.php', mozilla => 'http://opensource.org/licenses/mozilla1.1.php', open_source => undef, unrestricted => undef, restrictive => undef, unknown => undef, ); sub license { my $self = shift; return $self->{values}->{license} unless @_; my $license = shift or die( 'Did not provide a value to license()' ); $license = __extract_license($license) || lc $license; $self->{values}->{license} = $license; # Automatically fill in license URLs if ( $license_urls{$license} ) { $self->resources( license => $license_urls{$license} ); } return 1; } sub _extract_license { my $pod = shift; my $matched; return __extract_license( ($matched) = $pod =~ m/ (=head \d \s+ L(?i:ICEN[CS]E|ICENSING)\b.*?) (=head \d.*|=cut.*|)\z /xms ) || __extract_license( ($matched) = $pod =~ m/ (=head \d \s+ (?:C(?i:OPYRIGHTS?)|L(?i:EGAL))\b.*?) (=head \d.*|=cut.*|)\z /xms ); } sub __extract_license { my $license_text = shift or return; my @phrases = ( '(?:under )?the same (?:terms|license) as (?:perl|the perl (?:\d )?programming language)' => 'perl', 1, '(?:under )?the terms of (?:perl|the perl programming language) itself' => 'perl', 1, 'Artistic and GPL' => 'perl', 1, 'GNU general public license' => 'gpl', 1, 'GNU public license' => 'gpl', 1, 'GNU lesser general public license' => 'lgpl', 1, 'GNU lesser public license' => 'lgpl', 1, 'GNU library general public license' => 'lgpl', 1, 'GNU library public license' => 'lgpl', 1, 'GNU Free Documentation license' => 'unrestricted', 1, 'GNU Affero General Public License' => 'open_source', 1, '(?:Free)?BSD license' => 'bsd', 1, 'Artistic license 2\.0' => 'artistic_2', 1, 'Artistic license' => 'artistic', 1, 'Apache (?:Software )?license' => 'apache', 1, 'GPL' => 'gpl', 1, 'LGPL' => 'lgpl', 1, 'BSD' => 'bsd', 1, 'Artistic' => 'artistic', 1, 'MIT' => 'mit', 1, 'Mozilla Public License' => 'mozilla', 1, 'Q Public License' => 'open_source', 1, 'OpenSSL License' => 'unrestricted', 1, 'SSLeay License' => 'unrestricted', 1, 'zlib License' => 'open_source', 1, 'proprietary' => 'proprietary', 0, ); while ( my ($pattern, $license, $osi) = splice(@phrases, 0, 3) ) { $pattern =~ s#\s+#\\s+#gs; if ( $license_text =~ /\b$pattern\b/i ) { return $license; } } return ''; } sub license_from { my $self = shift; if (my $license=_extract_license(Module::Install::_read($_[0]))) { $self->license($license); } else { warn "Cannot determine license info from $_[0]\n"; return 'unknown'; } } sub _extract_bugtracker { my @links = $_[0] =~ m#L<( https?\Q://rt.cpan.org/\E[^>]+| https?\Q://github.com/\E[\w_]+/[\w_]+/issues| https?\Q://code.google.com/p/\E[\w_\-]+/issues/list )>#gx; my %links; @links{@links}=(); @links=keys %links; return @links; } sub bugtracker_from { my $self = shift; my $content = Module::Install::_read($_[0]); my @links = _extract_bugtracker($content); unless ( @links ) { warn "Cannot determine bugtracker info from $_[0]\n"; return 0; } if ( @links > 1 ) { warn "Found more than one bugtracker link in $_[0]\n"; return 0; } # Set the bugtracker bugtracker( $links[0] ); return 1; } sub requires_from { my $self = shift; my $content = Module::Install::_readperl($_[0]); my @requires = $content =~ m/^use\s+([^\W\d]\w*(?:::\w+)*)\s+(v?[\d\.]+)/mg; while ( @requires ) { my $module = shift @requires; my $version = shift @requires; $self->requires( $module => $version ); } } sub test_requires_from { my $self = shift; my $content = Module::Install::_readperl($_[0]); my @requires = $content =~ m/^use\s+([^\W\d]\w*(?:::\w+)*)\s+([\d\.]+)/mg; while ( @requires ) { my $module = shift @requires; my $version = shift @requires; $self->test_requires( $module => $version ); } } # Convert triple-part versions (eg, 5.6.1 or 5.8.9) to # numbers (eg, 5.006001 or 5.008009). # Also, convert double-part versions (eg, 5.8) sub _perl_version { my $v = $_[-1]; $v =~ s/^([1-9])\.([1-9]\d?\d?)$/sprintf("%d.%03d",$1,$2)/e; $v =~ s/^([1-9])\.([1-9]\d?\d?)\.(0|[1-9]\d?\d?)$/sprintf("%d.%03d%03d",$1,$2,$3 || 0)/e; $v =~ s/(\.\d\d\d)000$/$1/; $v =~ s/_.+$//; if ( ref($v) ) { # Numify $v = $v + 0; } return $v; } sub add_metadata { my $self = shift; my %hash = @_; for my $key (keys %hash) { warn "add_metadata: $key is not prefixed with 'x_'.\n" . "Use appopriate function to add non-private metadata.\n" unless $key =~ /^x_/; $self->{values}->{$key} = $hash{$key}; } } ###################################################################### # MYMETA Support sub WriteMyMeta { die "WriteMyMeta has been deprecated"; } sub write_mymeta_yaml { my $self = shift; # We need YAML::Tiny to write the MYMETA.yml file unless ( eval { require YAML::Tiny; 1; } ) { return 1; } # Generate the data my $meta = $self->_write_mymeta_data or return 1; # Save as the MYMETA.yml file print "Writing MYMETA.yml\n"; YAML::Tiny::DumpFile('MYMETA.yml', $meta); } sub write_mymeta_json { my $self = shift; # We need JSON to write the MYMETA.json file unless ( eval { require JSON; 1; } ) { return 1; } # Generate the data my $meta = $self->_write_mymeta_data or return 1; # Save as the MYMETA.yml file print "Writing MYMETA.json\n"; Module::Install::_write( 'MYMETA.json', JSON->new->pretty(1)->canonical->encode($meta), ); } sub _write_mymeta_data { my $self = shift; # If there's no existing META.yml there is nothing we can do return undef unless -f 'META.yml'; # We need Parse::CPAN::Meta to load the file unless ( eval { require Parse::CPAN::Meta; 1; } ) { return undef; } # Merge the perl version into the dependencies my $val = $self->Meta->{values}; my $perl = delete $val->{perl_version}; if ( $perl ) { $val->{requires} ||= []; my $requires = $val->{requires}; # Canonize to three-dot version after Perl 5.6 if ( $perl >= 5.006 ) { $perl =~ s{^(\d+)\.(\d\d\d)(\d*)}{join('.', $1, int($2||0), int($3||0))}e } unshift @$requires, [ perl => $perl ]; } # Load the advisory META.yml file my @yaml = Parse::CPAN::Meta::LoadFile('META.yml'); my $meta = $yaml[0]; # Overwrite the non-configure dependency hashes delete $meta->{requires}; delete $meta->{build_requires}; delete $meta->{recommends}; if ( exists $val->{requires} ) { $meta->{requires} = { map { @$_ } @{ $val->{requires} } }; } if ( exists $val->{build_requires} ) { $meta->{build_requires} = { map { @$_ } @{ $val->{build_requires} } }; } return $meta; } 1; UnixAgent-2.4.2/inc/Module/Install/Scripts.pm000066400000000000000000000011211332737732100210150ustar00rootroot00000000000000#line 1 package Module::Install::Scripts; use strict 'vars'; use Module::Install::Base (); use vars qw{$VERSION @ISA $ISCORE}; BEGIN { $VERSION = '1.14'; @ISA = 'Module::Install::Base'; $ISCORE = 1; } sub install_script { my $self = shift; my $args = $self->makemaker_args; my $exe = $args->{EXE_FILES} ||= []; foreach ( @_ ) { if ( -f $_ ) { push @$exe, $_; } elsif ( -d 'script' and -f "script/$_" ) { push @$exe, "script/$_"; } else { die("Cannot find script '$_'"); } } } 1; UnixAgent-2.4.2/inc/Module/Install/Win32.pm000066400000000000000000000035571332737732100203070ustar00rootroot00000000000000#line 1 package Module::Install::Win32; use strict; use Module::Install::Base (); use vars qw{$VERSION @ISA $ISCORE}; BEGIN { $VERSION = '1.14'; @ISA = 'Module::Install::Base'; $ISCORE = 1; } # determine if the user needs nmake, and download it if needed sub check_nmake { my $self = shift; $self->load('can_run'); $self->load('get_file'); require Config; return unless ( $^O eq 'MSWin32' and $Config::Config{make} and $Config::Config{make} =~ /^nmake\b/i and ! $self->can_run('nmake') ); print "The required 'nmake' executable not found, fetching it...\n"; require File::Basename; my $rv = $self->get_file( url => 'http://download.microsoft.com/download/vc15/Patch/1.52/W95/EN-US/Nmake15.exe', ftp_url => 'ftp://ftp.microsoft.com/Softlib/MSLFILES/Nmake15.exe', local_dir => File::Basename::dirname($^X), size => 51928, run => 'Nmake15.exe /o > nul', check_for => 'Nmake.exe', remove => 1, ); die <<'END_MESSAGE' unless $rv; ------------------------------------------------------------------------------- Since you are using Microsoft Windows, you will need the 'nmake' utility before installation. It's available at: http://download.microsoft.com/download/vc15/Patch/1.52/W95/EN-US/Nmake15.exe or ftp://ftp.microsoft.com/Softlib/MSLFILES/Nmake15.exe Please download the file manually, save it to a directory in %PATH% (e.g. C:\WINDOWS\COMMAND\), then launch the MS-DOS command line shell, "cd" to that directory, and run "Nmake15.exe" from there; that will create the 'nmake.exe' file needed by this module. You may then resume the installation process described in README. ------------------------------------------------------------------------------- END_MESSAGE } 1; UnixAgent-2.4.2/inc/Module/Install/WriteAll.pm000066400000000000000000000026701332737732100211230ustar00rootroot00000000000000#line 1 package Module::Install::WriteAll; use strict; use Module::Install::Base (); use vars qw{$VERSION @ISA $ISCORE}; BEGIN { $VERSION = '1.14'; @ISA = qw{Module::Install::Base}; $ISCORE = 1; } sub WriteAll { my $self = shift; my %args = ( meta => 1, sign => 0, inline => 0, check_nmake => 1, @_, ); $self->sign(1) if $args{sign}; $self->admin->WriteAll(%args) if $self->is_admin; $self->check_nmake if $args{check_nmake}; unless ( $self->makemaker_args->{PL_FILES} ) { # XXX: This still may be a bit over-defensive... unless ($self->makemaker(6.25)) { $self->makemaker_args( PL_FILES => {} ) if -f 'Build.PL'; } } # Until ExtUtils::MakeMaker support MYMETA.yml, make sure # we clean it up properly ourself. $self->realclean_files('MYMETA.yml'); if ( $args{inline} ) { $self->Inline->write; } else { $self->Makefile->write; } # The Makefile write process adds a couple of dependencies, # so write the META.yml files after the Makefile. if ( $args{meta} ) { $self->Meta->write; } # Experimental support for MYMETA if ( $ENV{X_MYMETA} ) { if ( $ENV{X_MYMETA} eq 'JSON' ) { $self->Meta->write_mymeta_json; } else { $self->Meta->write_mymeta_yaml; } } return 1; } 1; UnixAgent-2.4.2/lib/000077500000000000000000000000001332737732100141775ustar00rootroot00000000000000UnixAgent-2.4.2/lib/Ocsinventory/000077500000000000000000000000001332737732100167015ustar00rootroot00000000000000UnixAgent-2.4.2/lib/Ocsinventory/Agent.pm000066400000000000000000000354051332737732100203040ustar00rootroot00000000000000#!/usr/bin/perl package Ocsinventory::Agent; use strict; use warnings; use POSIX ":sys_wait_h"; # THIS IS AN UGLY WORKAROUND FOR # http://rt.cpan.org/Ticket/Display.html?id=38067 use XML::Simple; eval {XMLout("b");}; if ($@){ no strict 'refs'; ${*{"XML::SAX::"}{HASH}{'parsers'}} = sub { return [ { 'Features' => { 'http://xml.org/sax/features/namespaces' => '1' }, 'Name' => 'XML::SAX::PurePerl' }] }; } # END OF THE UGLY FIX! require Exporter; use Ocsinventory::Logger; use Ocsinventory::Agent::XML::Inventory; use Ocsinventory::Agent::XML::Prolog; use Ocsinventory::Agent::Network; use Ocsinventory::Agent::Backend; use Ocsinventory::Agent::AccountConfig; use Ocsinventory::Agent::AccountInfo; use Ocsinventory::Agent::Config; use Ocsinventory::Agent::Hooks; #use Ocsinventory::Agent::Pid; use Ocsinventory::Agent::Common; sub run { # Load setting from the config file my $config = new Ocsinventory::Agent::Config; #$params->{$_} = $config->{$_} foreach (keys %$config); $ENV{LC_ALL} = 'C'; # Turn off localised output for commands $ENV{LANG} = 'C'; # Turn off localised output for commands ##################################### ################ MAIN ############### ##################################### ############################ #### CLI parameters ######## ############################ $config->loadUserParams(); # I close STDERR to avoid error message during the module execution # at the beginning I was doing shell redirection: # my @ret = `cmd 2> /dev/null`; # but this syntax is not supported on (at least) FreeBSD and Solaris # c.f: http://www.perlmonks.org/?node_id=571072 #my $tmp; #open ($tmp, ">&STDERR"); #$params->{"savedstderr"} = $tmp; #if($params->{debug}) { # $params->{verbose} = 1; #} else { # close(STDERR); #} if ($config->{config}{logfile}) { $config->{config}{logger} = 'File'; } my $logger = new Ocsinventory::Logger ({ config => $config->{config} }); my $common = new Ocsinventory::Agent::Common({ logger => $logger, config => $config->{config}, }); # $< == $REAL_USER_ID if ( $< ne '0' ) { $logger->info("You should run this program as super-user."); } if (not $config->{config}{scanhomedirs}) { $logger->debug("--scan-homedirs missing. Don't scan user directories"); } if ($config->{config}{nosoftware}) { $config->{config}{nosoftware} = 1 } # desactivate local mode even if it is set in config file or command line if (defined($config->{config}{nolocal})) { undef $config->{config}{'local'}; } # TODO put that in Ocsinventory::Agent::Config if (!$config->{config}{'stdout'} && !$config->{config}{'local'} && $config->{config}{server} !~ /^http(|s):\/\//) { $logger->debug("the --server passed doesn't have a protocol, assume http as default"); $config->{config}{server} = "http://".$config->{config}{server}.'/ocsinventory'; } ######################## Objects initilisation ############################################################### # The agent can contact different servers. Each server accountconfig is # stored in a specific file: if (!recMkdir ($config->{config}{basevardir})) { if (! -d $ENV{HOME}."/.ocsinventory/var") { $logger->info("Failed to create ".$config->{config}{basevardir}." directory: $!. ". "I'm going to use the home directory instead (~/.ocsinventory/var)."); } $config->{config}{basevardir} = $ENV{HOME}."/.ocsinventory/var"; if (!recMkdir ($config->{config}{basevardir})) { $logger->error("Failed to create ".$config->{config}{basedir}." directory: $!". "The HOSTID will not be written on the harddrive. You may have duplicated ". "entry of this computer in your OCS database"); } $logger->debug("var files are stored in ".$config->{config}{basevardir}); } if (defined($config->{config}{server}) && $config->{config}{server}) { my $dir = $config->{config}{server}; $dir =~ s/\//_/g; $config->{config}{vardir} = $config->{config}{basevardir}."/".$dir; if (defined ($config->{config}{local}) && $config->{config}{local}) { $logger->debug ("--server ignored since you also use --local"); $config->{config}{server} = undef; } } elsif (defined($config->{config}{local}) && $config->{config}{local}) { $config->{config}{vardir} = $config->{config}{basevardir}."/__LOCAL__"; } if (!recMkdir ($config->{config}{vardir})) { $logger->error("Failed to create ".$config->{config}{vardir}." directory: $!"); } if (-d $config->{config}{vardir}) { $config->{config}{accountconfig} = $config->{config}{vardir}."/ocsinv.conf"; $config->{config}{accountinfofile} = $config->{config}{vardir}."/ocsinv.adm"; $config->{config}{last_statefile} = $config->{config}{vardir}."/last_state"; $config->{config}{next_timefile} = $config->{config}{vardir}."/next_timefile"; } # Setting SSL CA file path if not set in configuration unless ($config->{config}{ca}) { $config->{config}{ca} = $config->{config}{vardir}."/cacert.pem"; } ################################################################################################################ ########################## load CFG files ###################################################################### my $accountconfig = new Ocsinventory::Agent::AccountConfig({ logger => $logger, config => $config->{config}, }); my $srv = $accountconfig->get('OCSFSERVER'); $config->{config}{server} = $srv if $srv; $config->{config}{deviceid} = $accountconfig->get('DEVICEID'); # Should I create a new deviceID? chomp(my $hostname = `uname -n| cut -d . -f 1`); if ((!$config->{config}{deviceid}) || $config->{config}{deviceid} !~ /\Q$hostname\E-(?:\d{4})(?:-\d{2}){5}/) { my ($YEAR, $MONTH , $DAY, $HOUR, $MIN, $SEC) = (localtime(time))[5,4,3,2,1,0]; $config->{config}{old_deviceid} = $config->{config}{deviceid}; $config->{config}{deviceid} =sprintf "%s-%02d-%02d-%02d-%02d-%02d-%02d", $hostname, ($YEAR+1900), ($MONTH+1), $DAY, $HOUR, $MIN, $SEC; $accountconfig->set('DEVICEID',$config->{config}{deviceid}); } my $accountinfo = new Ocsinventory::Agent::AccountInfo({ logger => $logger, # TODOparams => $params, config => $config->{config}, common => $common, }); # --lazy if ($config->{config}{lazy}) { my $nexttime = (stat($config->{config}{next_timefile}))[9]; if ($nexttime && $nexttime > time) { $logger->info("[Lazy] Must wait until ".localtime($nexttime)." exiting..."); exit 0; } } if ($config->{config}{daemon}) { $logger->debug("Time to call Proc::Daemon"); eval { require Proc::Daemon; }; if ($@) { print "Can't load Proc::Daemon. Is the module installed?"; exit 1; } Proc::Daemon::Init(); $logger->debug("Daemon started"); if (isAgentAlreadyRunning({ logger => $logger, })) { $logger->debug("An agent is already runnnig, exiting..."); exit 1; } } $logger->debug("OCS Agent initialised"); ################# Now we can create a context hash ######################################################### my $context = { installpath => $config->{config}->{vardir}, servername => $config->{config}->{server}, authuser => $config->{config}->{user}, authpwd => $config->{config}->{password}, authrealm => $config->{config}->{realm}, deviceid => $config->{config}->{deviceid}, version => $config->{VERSION}, config => $config->{config}, accountconfig => $accountconfig, accountinfo => $accountinfo, logger => $logger, common => $common, # OCS_AGENT_CMDL => "TOTO", # TODO cmd line parameter changed with the unified agent }; ################################# HERE WE GO !!! ################################################### while (1) { my $exitcode = 0; my $wait; my $child; if ($config->{config}{daemon} || $config->{config}{wait}) { my $serverdelay; if(($config->{config}{wait} eq 'server') || ($config->{config}{wait}!~/^\d+$/)){ $serverdelay = $accountconfig->get('PROLOG_FREQ')*3600; } else { $serverdelay = $config->{config}{wait}; } $wait = int rand($serverdelay?$serverdelay:$config->{config}{delaytime}); $logger->info("Going to sleep for $wait second(s)"); sleep ($wait); } # Create an hook object to use handlers of modules. my $hooks = new Ocsinventory::Agent::Hooks($context); # Using start_handler hook $hooks->run({name => 'start_handler'}); #################### Local Mode ####################### if ($config->{config}{stdout} || $config->{config}{local}) { # TODO, avoid to create Backend at two different places my $backend = new Ocsinventory::Agent::Backend ({ context => $context, }); my $inventory = new Ocsinventory::Agent::XML::Inventory ({ # TODO, check if the accoun{info,config} are needed in localmode backend => $backend, context => $context, }); # Launching inventory $inventory->initialise(); # Using inventory_writer hook $hooks->run({name => 'inventory_handler'}, $inventory); if ($config->{config}{stdout}) { $inventory->printXML(); } elsif ($config->{config}{local}) { $inventory->writeXML(); } } else { ############ I've to contact the server ########################" my $network = new Ocsinventory::Agent::Network ({ accountconfig => $accountconfig, accountinfo => $accountinfo, logger => $logger, config => $config->{config}, common => $common, }); # Adding the network object in $context $context->{network}= $network; my $sendInventory = 1; my $httpresp; my $prologresp; if (!$config->{config}{force}) { my $prolog = new Ocsinventory::Agent::XML::Prolog({ context => $context, }); # Using prolog_writer hook $hooks->run({name => 'prolog_writer'}, $prolog); # Formatting the XML my $prologXML = $prolog->getContent(); $httpresp = $network->sendXML({message => $prologXML}); $prologresp = $network->getXMLResp($httpresp,'Prolog'); if ($prologresp) { # Using prolog_reader hook $hooks->run({name => 'prolog_reader'}, $prologresp->getRawXML()); if (!$prologresp->isInventoryAsked()) { $sendInventory = 0; } } else { # Failed to reach the server if ($config->{config}{lazy}) { # To avoid flooding a heavy loaded server my $previousPrologFreq; if (!($previousPrologFreq = $accountconfig->get('PROLOG_FREQ'))){ $previousPrologFreq = $config->{config}{delaytime}; $logger->info("No previous PROLOG_FREQ found - using fallback delay(".$config->{config}{delaytime}." seconds)"); } else { $logger->info("Previous PROLOG_FREQ found ($previousPrologFreq)"); $previousPrologFreq = $previousPrologFreq*3600; } my $time = time + $previousPrologFreq; utime $time,$time,$config->{config}{next_timefile}; } exit 1 unless $config->{config}{daemon}; $sendInventory = 0; } } if (!$sendInventory) { $logger->info("Don't send the inventory"); } else { # Send the inventory! my $backend = new Ocsinventory::Agent::Backend ({ prologresp => $prologresp, context => $context, }); my $inventory = new Ocsinventory::Agent::XML::Inventory ({ # TODO, check if the accoun{info,config} are needed in localmode backend => $backend, context => $context, }); # Launching inventory $inventory->initialise(); # Using inventory_writer hook $hooks->run({name => 'inventory_handler'}, $inventory); # Formatting the XML my $inventoryXML = $inventory->getContent(); # Sending Inventory $httpresp = $network->sendXML({message => $inventoryXML}); if (my $invresp = $network->getXMLResp($httpresp,'Inventory')) { $inventory->saveLastState(); } else { exit (1) unless $config->{config}{daemon}; } } } # Using end_handler_hook $hooks->run({name => 'end_handler'}); # Avoid zombie process if ($^O ne 'darwin'){ do { $child = waitpid(-1, WNOHANG); } while $child > 0; } else { waitpid(-1, 0); } exit (0) unless $config->{config}{daemon}; } } ########################################## ############Functions##################### ########################################## sub recMkdir { my $dir = shift; my @t = split /\//, $dir; shift @t; return unless @t; my $t; foreach (@t) { $t .= '/'.$_; if ((!-d $t) && (!mkdir $t)) { return; } } 1; } sub isAgentAlreadyRunning { my $params = shift; my $logger = $params->{logger}; # TODO add a workaround if Proc::PID::File is not installed eval { require Proc::PID::File; }; if(!$@) { $logger->debug('Proc::PID::File available, checking for pid file'); if (Proc::PID::File->running()) { $logger->debug('parent process already exists'); return 1; } } return 0; } 1; UnixAgent-2.4.2/lib/Ocsinventory/Agent/000077500000000000000000000000001332737732100177375ustar00rootroot00000000000000UnixAgent-2.4.2/lib/Ocsinventory/Agent/AccountConfig.pm000066400000000000000000000036141332737732100230230ustar00rootroot00000000000000package Ocsinventory::Agent::AccountConfig; use strict; use warnings; # AccountConfig read and write the setting for the client given by the server # This file will be overwrite and is not designed to be changed by the user # DESPITE ITS NAME, ACCOUNTCONFIG IS NOT A CONFIG FILE! sub new { my (undef,$params) = @_; my $self = {}; bless $self; $self->{config} = $params->{config}; my $logger = $self->{logger} = $params->{logger}; # Configuration reading $self->{xml} = {}; if ($self->{config}->{accountconfig}) { if (! -f $self->{config}->{accountconfig}) { $logger->debug ('accountconfig file: `'. $self->{config}->{accountconfig}. " doesn't exist. I create an empty one"); $self->write(); } else { eval { $self->{xml} = XML::Simple::XMLin( $self->{config}->{accountconfig}, SuppressEmpty => undef ); }; } } $self; } sub get { my ($self, $name) = @_; my $logger = $self->{logger}; return $self->{xml}->{$name} if $name; return $self->{xml}; } sub set { my ($self, $name, $value) = @_; my $logger = $self->{logger}; $self->{xml}->{$name} = $value; $self->write(); # save the change } sub write { my ($self, $args) = @_; my $logger = $self->{logger}; return unless $self->{config}->{accountconfig}; my $xml = XML::Simple::XMLout( $self->{xml} , RootName => 'CONF', NoAttr => 1 ); my $fault; if (!open CONF, ">".$self->{config}->{accountconfig}) { $fault = 1; } else { print CONF $xml; $fault = 1 if (!close CONF); } if (!$fault) { $logger->debug ("ocsinv.conf updated successfully"); } else { $logger->error ("Can't save setting change in `".$self->{config}->{accountconfig}."'"); } } 1; UnixAgent-2.4.2/lib/Ocsinventory/Agent/AccountInfo.pm000066400000000000000000000072031332737732100225070ustar00rootroot00000000000000package Ocsinventory::Agent::AccountInfo; use strict; use warnings; sub new { my (undef,$params) = @_; my $self = {}; bless $self; $self->{config} = $params->{config}; $self->{logger} = $params->{logger}; $self->{common} = $params->{common}; my $logger = $self->{logger} = $params->{logger}; if ($self->{config}->{accountinfofile}) { $logger->debug ('Accountinfo file: '. $self->{config}->{accountinfofile}); if (! -f $self->{config}->{accountinfofile}) { $logger->info ("Accountinfo file doesn't exist. I create an empty one."); $self->writeAccountInfoFile(); } else { my $xmladm; eval { $xmladm = $self->{common}->readXml($self->{config}->{accountinfofile}, [ 'ACCOUNTINFO' ]); }; if ($xmladm && exists($xmladm->{ACCOUNTINFO})) { # Store the XML content in a local HASH for(@{$xmladm->{ACCOUNTINFO}}){ if (!$_->{KEYNAME}) { $logger->debug ("Incorrect KEYNAME in ACCOUNTINFO"); } $self->{accountinfo}{ $_->{KEYNAME} } = $_->{KEYVALUE}; } } } } else { $logger->debug("No accountinfo file defined"); } if ($self->{config}->{tag}) { if ($self->{accountinfo}->{TAG}) { $logger->debug("A TAG seems to already exist in the ocsinv.adm file. ". "The -t parameter will be ignored. Don't forget that the TAG value ". "will be ignored by the server unless it has OCS_OPT_ACCEPT_TAG_UPDATE_FROM_CLIENT=1."); } else { $self->{accountinfo}->{TAG} = $self->{config}->{tag}; } } $self; #Because we have already blessed the object } # Add accountinfo stuff to an inventory sub setAccountInfo { my $self = shift; my $inventory = shift; #my $ai = $self->getAll(); $self->{xmlroot}{'CONTENT'}{ACCOUNTINFO} = []; my $ai = $self->{accountinfo}; return unless $ai; foreach (keys %$ai) { push @{$inventory->{xmlroot}{'CONTENT'}{ACCOUNTINFO}}, { KEYNAME => [$_], KEYVALUE => [$ai->{$_}], }; } } sub writeAccountInfoFile { my ($self, $ref) = @_; my $logger = $self->{logger}; my $content; $content->{ACCOUNTINFO} = []; #We clear accountinfo to store the new one undef $self->{accountinfo}; #We get values sent by server if (ref ($ref) =~ /^ARRAY$/) { foreach (@$ref) { $self->{accountinfo}->{$_->{KEYNAME}} = $_->{KEYVALUE} if defined ($_->{KEYNAME}) && defined ($_->{KEYVALUE}); } } elsif (ref ($ref) =~ /^HASH$/) { $self->{accountinfo}->{$ref->{KEYNAME}} = $ref->{KEYVALUE} if defined ($ref->{KEYNAME}) && defined ($ref->{KEYVALUE}); } else { $logger->debug ("Invalid parameter while writing accountinfo file"); } #We feed our XML for accountinfo file foreach (keys %{$self->{accountinfo}}) { push @{$content->{ACCOUNTINFO}}, {KEYNAME => [$_], KEYVALUE => [$self->{accountinfo}{$_}]}; } my $xml=XML::Simple::XMLout($content, RootName => 'ADM', XMLDecl=> ''); #We write accountinfo file my $fault; if (!open ADM, ">".$self->{config}->{accountinfofile}) { $fault = 1; } else { print ADM $xml; $fault = 1 unless close ADM; } if (!$fault) { $logger->debug ("Account info updated successfully"); } else { $logger->error ("Can't save account info in `". $self->{config}->{accountinfofile}); } } 1; UnixAgent-2.4.2/lib/Ocsinventory/Agent/Backend.pm000066400000000000000000000274231332737732100216340ustar00rootroot00000000000000package Ocsinventory::Agent::Backend; use strict; no strict 'refs'; use warnings; #use ExtUtils::Installed; sub new { my (undef, $params) = @_; my $self = {}; $self->{accountconfig} = $params->{context}->{accountconfig}; $self->{accountinfo} = $params->{context}->{accountinfo}; $self->{config} = $params->{context}->{config}; $self->{inventory} = $params->{inventory}; $self->{common} = $params->{context}->{common}; my $logger = $self->{logger} = $params->{context}->{logger}; $self->{prologresp} = $params->{prologresp}; $self->{modules} = {}; $self->{backendSharedFuncs} = { can_run => sub { my $binary = shift; my $calling_namespace = caller(0); chomp(my $binpath=`which $binary 2>/dev/null`); return unless -x $binpath; $self->{logger}->debug(" - $binary found"); 1 }, can_load => sub { my $module = shift; my $calling_namespace = caller(0); eval "package $calling_namespace; use $module;"; # print STDERR "$module not loaded in $calling_namespace! $!: $@\n" if $@; return if $@; $self->{logger}->debug(" - $module loaded"); # print STDERR "$module loaded in $calling_namespace!\n"; 1; }, can_read => sub { my $file = shift; return unless -r $file; $self->{logger}->debug(" - $file can be read"); 1; }, runcmd => sub { my $cmd = shift; return unless $cmd; # $self->{logger}->debug(" - run $cmd"); return `$cmd`; } }; bless $self; } sub initModList { my $self = shift; my $logger = $self->{logger}; my $config = $self->{config}; my @dirToScan; my @installed_mods; my @installed_files; # This is a workaround for PAR::Packer. Since it resets @INC # I can't find the backend modules to load dynamically. So # I prepare a list and include it. eval "use Ocsinventory::Agent::Backend::ModuleToLoad;"; if (!$@) { $logger->debug("use Ocsinventory::Agent::Backend::ModuleToLoad to get the modules ". "to load. This should not append unless you use the standalone agent built with ". "PAR::Packer (pp)"); push @installed_mods, @Ocsinventory::Agent::Backend::ModuleToLoad::list; } if ($config->{devlib}) { # devlib enable, I only search for backend module in ./lib push (@dirToScan, './lib'); } else { # my ($inst) = ExtUtils::Installed->new(); # eval {@installed_files = # $inst->files('Ocsinventory')}; # ExtUtils::Installed is nice but it needs properly installed package with # .packlist # This is a workaround for 'invalide' installations... foreach (@INC) { next if ! -d || (-l && -d readlink) || /^(\.|lib)$/; push @dirToScan, $_; } } if (@dirToScan) { eval {require File::Find}; if ($@) { $logger->debug("Failed to load File::Find"); } else { # here I need to use $d to avoid a bug with AIX 5.2's perl 5.8.0. It # changes the @INC content if i use $_ directly # thanks to @rgs on irc.perl.org File::Find::find( { wanted => sub { push @installed_files, $File::Find::name if $File::Find::name =~ /Ocsinventory\/Agent\/Backend\/.*\.pm$/; }, follow => 1, follow_skip => 2 } , @dirToScan); } } foreach my $file (@installed_files) { my $t = $file; next unless $t =~ s!.*?(Ocsinventory/Agent/Backend/)(.*?)\.pm$!$1$2!; my $m = join ('::', split /\//, $t); push @installed_mods, $m; } if (!@installed_mods) { $logger->info("ZERO backend module found! Is Ocsinventory-Agent ". "correctly installed? Use the --devlib flag if you want to run the agent ". "directly from the source directory.") } foreach my $m (@installed_mods) { my @runAfter; my @runMeIfTheseChecksFailed; my $enable = 1; if (exists ($self->{modules}->{$m}->{name})) { $logger->debug($m." already loaded."); next; } eval "use $m;"; if ($@) { $logger->debug ("Failed to load $m: $@"); $enable = 0; } my $package = $m."::"; # Load in the module the backendSharedFuncs # foreach my $func (keys %{$self->{backendSharedFuncs}}) { # $package->{$func} = $self->{backendSharedFuncs}->{$func}; # } $self->{modules}->{$m}->{name} = $m; $self->{modules}->{$m}->{done} = 0; $self->{modules}->{$m}->{inUse} = 0; $self->{modules}->{$m}->{enable} = $enable; $self->{modules}->{$m}->{checkFunc} = $package->{"check"}; $self->{modules}->{$m}->{runAfter} = $package->{'runAfter'}; $self->{modules}->{$m}->{runMeIfTheseChecksFailed} = $package->{'runMeIfTheseChecksFailed'}; # $self->{modules}->{$m}->{replace} = \@replace; $self->{modules}->{$m}->{runFunc} = $package->{'run'}; $self->{modules}->{$m}->{mem} = {}; # Load the Storable object is existing or return undef $self->{modules}->{$m}->{storage} = $self->retrieveStorage($m); } # the sort is just for the presentation foreach my $m (sort keys %{$self->{modules}}) { next unless $self->{modules}->{$m}->{checkFunc}; # find modules to disable and their submodules if($self->{modules}->{$m}->{enable} && !$self->runWithTimeout( $m, $self->{modules}->{$m}->{checkFunc}, { accountconfig => $self->{accountconfig}, accountinfo => $self->{accountinfo}, config => $self->{config}, inventory => $self->{inventory}, logger => $self->{logger}, params => $self->{params}, # Compatibiliy with agent 0.0.10 <= prologresp => $self->{prologresp}, mem => $self->{modules}->{$m}->{mem}, storage => $self->{modules}->{$m}->{storage}, common => $self->{common}, })) { $logger->debug ($m." ignored"); foreach (keys %{$self->{modules}}) { $self->{modules}->{$_}->{enable} = 0 if /^$m($|::)/; } } # add submodule in the runAfter array my $t; foreach (split /::/,$m) { $t .= "::" if $t; $t .= $_; if (exists $self->{modules}->{$t} && $m ne $t) { push @{$self->{modules}->{$m}->{runAfter}}, \%{$self->{modules}->{$t}} } } } # Remove the runMeIfTheseChecksFailed if needed foreach my $m (sort keys %{$self->{modules}}) { next unless $self->{modules}->{$m}->{enable}; next unless $self->{modules}->{$m}->{runMeIfTheseChecksFailed}; foreach my $condmod (@{${$self->{modules}->{$m}->{runMeIfTheseChecksFailed}}}) { if ($self->{modules}->{$condmod}->{enable}) { foreach (keys %{$self->{modules}}) { next unless /^$m($|::)/ && $self->{modules}->{$_}->{enable}; $self->{modules}->{$_}->{enable} = 0; $logger->debug ("$_ disabled because of a 'runMeIfTheseChecksFailed' in '$m'\n"); } } } } } sub runMod { my ($self, $params) = @_; my $logger = $self->{logger}; my $m = $params->{modname}; my $common = $params->{common}; return if (!$self->{modules}->{$m}->{enable}); return if ($self->{modules}->{$m}->{done}); $self->{modules}->{$m}->{inUse} = 1; # lock the module # first I run its "runAfter" foreach (@{$self->{modules}->{$m}->{runAfter}}) { if (!$_->{name}) { # The name is defined during module initialisation so if I # can't read it, I can suppose it had not been initialised. $logger->fault ("Module `$m' need to be runAfter a module not found.". "Please fix its runAfter entry or add the module."); } if ($_->{inUse}) { # In use 'lock' is taken during the mod execution. If a module # need a module also in use, we have provable an issue :). $logger->fault ("Circular dependency hell with $m and $_->{name}"); } $self->runMod({ common => $common, modname => $_->{name}, }); } $logger->debug ("Running $m"); if ($self->{modules}->{$m}->{runFunc}) { $self->runWithTimeout( $m, $self->{modules}->{$m}->{runFunc}, { accountconfig => $self->{accountconfig}, accountinfo => $self->{accountinfo}, config => $self->{config}, common => $common, logger => $logger, params => $self->{params}, # For compat with agent 0.0.10 <= prologresp => $self->{prologresp}, mem => $self->{modules}->{$m}->{mem}, storage => $self->{modules}->{$m}->{storage}, common => $self->{common}, } ); } else { $logger->debug("$m has no run() function -> ignored"); } $self->{modules}->{$m}->{done} = 1; $self->{modules}->{$m}->{inUse} = 0; # unlock the module $self->saveStorage($m, $self->{modules}->{$m}->{storage}); } sub feedInventory { my ($self, $params) = @_; my $common = $self->{common}; my $inventory; if ($params->{inventory}) { $inventory = $params->{inventory}; } if (!keys %{$self->{modules}}) { $self->initModList(); } my $begin = time(); foreach my $m (sort keys %{$self->{modules}}) { die ">$m Houston!!!" unless $m; $self->runMod ({ common => $common, modname => $m, }); } # Execution time # $common->setHardware({ETIME => time() - $begin}); $inventory->{xmlroot}->{CONTENT} = $common->{xmltags}; } sub retrieveStorage { my ($self, $m) = @_; my $logger = $self->{logger}; my $storagefile = $self->{config}->{vardir}."/$m.storage"; if (!exists &retrieve) { eval "use Storable;"; if ($@) { $logger->debug("Storable.pm is not available, can't load Backend module data"); return; } } return (-f $storagefile)?retrieve($storagefile):{}; } sub saveStorage { my ($self, $m, $data) = @_; my $logger = $self->{logger}; # Perl 5.6 doesn't provide Storable.pm if (!exists &store) { eval "use Storable;"; if ($@) { $logger->debug("Storable.pm is not available, can't save Backend module data"); return; } } my $storagefile = $self->{config}->{vardir}."/$m.storage"; if ($data && keys (%$data)>0) { store ($data, $storagefile) or die; } elsif (-f $storagefile) { unlink $storagefile; } } sub runWithTimeout { my ($self, $m, $func, $params) = @_; my $logger = $self->{logger}; my $ret; eval { local $SIG{ALRM} = sub { die "alarm\n" }; # NB: \n require my $timeout = $params->{config}{backendCollectTimeout}; alarm $timeout; $ret = &{$func}($params); }; alarm 0; if ($@) { if ($@ ne "alarm\n") { $logger->debug("runWithTimeout(): unexpected error: $@"); } else { $logger->debug("$m killed by a timeout."); return; } } else { return $ret; } } 1; UnixAgent-2.4.2/lib/Ocsinventory/Agent/Backend/000077500000000000000000000000001332737732100212665ustar00rootroot00000000000000UnixAgent-2.4.2/lib/Ocsinventory/Agent/Backend/AccessLog.pm000066400000000000000000000006301332737732100234660ustar00rootroot00000000000000package Ocsinventory::Agent::Backend::AccessLog; sub run { my $params = shift; my $common = $params->{common}; my ($YEAR, $MONTH , $DAY, $HOUR, $MIN, $SEC) = (localtime (time))[5,4,3,2,1,0]; my $date=sprintf "%02d-%02d-%02d %02d:%02d:%02d", ($YEAR+1900), ($MONTH+1), $DAY, $HOUR, $MIN, $SEC; $common->setAccessLog ({ USERID => 'N/A', LOGDATE => $date }); } 1; UnixAgent-2.4.2/lib/Ocsinventory/Agent/Backend/DeviceID.pm000066400000000000000000000007551332737732100232470ustar00rootroot00000000000000package Ocsinventory::Agent::Backend::DeviceID; # Initialise the DeviceID. In fact this value is a bit specific since # it generates in the main script. sub run { my $params = shift; my $common = $params->{common}; my $config = $params->{config}; my $UsersLoggedIn = join "/", keys %user; if ($config->{old_deviceid}) { $common->setHardware({ OLD_DEVICEID => $config->{old_deviceid} }); } $common->setHardware({ DEVICEID => $config->{deviceid} }); } 1; UnixAgent-2.4.2/lib/Ocsinventory/Agent/Backend/IpDiscover.pm000066400000000000000000000004231332737732100236720ustar00rootroot00000000000000package Ocsinventory::Agent::Backend::IpDiscover; use strict; sub check { my $params = shift; my $prologresp = $params->{prologresp}; my $mem = $params->{mem}; return unless ($prologresp && $prologresp->getOptionsInfoByName("IPDISCOVER")); 1; } 1; UnixAgent-2.4.2/lib/Ocsinventory/Agent/Backend/IpDiscover/000077500000000000000000000000001332737732100233355ustar00rootroot00000000000000UnixAgent-2.4.2/lib/Ocsinventory/Agent/Backend/IpDiscover/IpDiscover.pm000066400000000000000000000041631332737732100257460ustar00rootroot00000000000000package Ocsinventory::Agent::Backend::IpDiscover::IpDiscover; use strict; use warnings; sub check { my $params = shift; my $common = $params->{common}; $common->can_run ("ipdiscover"); } sub run { my $params = shift; my $common = $params->{common}; my $prologresp = $params->{prologresp}; my $logger = $params->{logger}; # Let's find network interfaces and call ipdiscover on it my $options = $prologresp->getOptionsInfoByName("IPDISCOVER"); my $ipdisc_lat; my $network; if ($options->[0] && exists($options->[0]->{IPDISC_LAT}) && $options->[0]->{IPDISC_LAT}) { $ipdisc_lat = $options->[0]->{IPDISC_LAT}; } if ($options->[0] && exists($options->[0]->{content})) { $network = $options->[0]->{content}; } else { return; } $logger->debug("Scanning the $network network"); my $legacymode; if ( `ipdiscover` =~ /binary ver. (\d+)/ ){ if (!($1>3)) { $legacymode = 1; $logger->debug("ipdiscover ver.$1: legacymode"); } } my $ifname; if ($common->can_run("ip")) { foreach (`ip route`) { if (/^default via (\d+\d.\d+\.\d+\.\d+) dev (\S+).*/) { if ($network = $1 ){ $ifname = $2; last; } } } } elsif ($common->can_run("route")){ foreach (`route -n`) { if (/^(\d+\.\d+\.\d+\.\d+).*?\s(\S+)$/) { if ($network eq $1) { $ifname = $2; last; } elsif (!$ifname && $1 eq "0.0.0.0") { $ifname = $2; } } } } if ($ifname) { my $cmd = "ipdiscover $ifname "; $cmd .= $ipdisc_lat if ($ipdisc_lat && !$legacymode); foreach (`$cmd`) { if (/([\d\.]*)<\/I>([\w\:]*)<\/M>(\S*)<\/N><\/H>/) { $common->addIpDiscoverEntry({ IPADDRESS => $1, MACADDR => $2, NAME => $3 }); } } } } 1; UnixAgent-2.4.2/lib/Ocsinventory/Agent/Backend/IpDiscover/Nmap.pm000066400000000000000000000037751332737732100246020ustar00rootroot00000000000000package Ocsinventory::Agent::Backend::IpDiscover::Nmap; use vars qw($runMeIfTheseChecksFailed); $runMeIfTheseChecksFailed = ["Ocsinventory::Agent::Backend::IpDiscover::IpDiscover"]; use strict; use warnings; sub check { my $params = shift; my $common = $params->{common}; return unless $common->can_run("nmap"); return unless $common->can_load("Nmap::Parser"); # Do we have nmap 3.90 (or >) foreach (`nmap -v 2>&1`) { if (/^Starting Nmap (\d+)\.(\d+)/) { my $release = $1; my $minor = $2; if ($release > 3 || ($release > 3 && $minor >= 90)) { return 1; } } } 0; } sub run { my $params = shift; my $common = $params->{common}; my $prologresp = $params->{prologresp}; my $logger = $params->{logger}; # Let's find network interfaces and call ipdiscover on it my $options = $prologresp->getOptionsInfoByName("IPDISCOVER"); my $network; if ($options->[0] && exists($options->[0]->{content})) { $network = $options->[0]->{content}; } else { return; } unless ($network =~ /^\d+\.\d+\.\d+\.\d+$/) { return; } #Let's go scanning the network and parsing the results $logger->debug("Scanning the $network network"); my $nmaparser = new Nmap::Parser; $nmaparser->parsescan("nmap","-sn","-PR","$network/24"); for my $host ($nmaparser->all_hosts("up")){ my $ip = $host->addr; my $mac = $host->mac_addr; my $hostname = $host->hostname; if ($hostname eq 0) { $hostname = undef; #it's better to send nothing instead of a '0' } if ($mac) { $logger->debug("Host $ip found using Nmap. Adding informations in XML"); # Feeding the Inventory XML $common->addIpDiscoverEntry({ IPADDRESS => $ip, MACADDR => lc($mac), NAME => $hostname, }); } } } 1; UnixAgent-2.4.2/lib/Ocsinventory/Agent/Backend/OS/000077500000000000000000000000001332737732100216075ustar00rootroot00000000000000UnixAgent-2.4.2/lib/Ocsinventory/Agent/Backend/OS/AIX.pm000066400000000000000000000015071332737732100225710ustar00rootroot00000000000000package Ocsinventory::Agent::Backend::OS::AIX; use strict; use vars qw($runAfter); $runAfter = ["Ocsinventory::Agent::Backend::OS::Generic"]; sub check { my $r; $r = 1 if $^O =~ /^aix$/; $r; } sub run { my $params = shift; my $common = $params->{common}; my @tabOS; my $OSName; my $OSComment; my $OSVersion; my $OSLevel; # Operating system informations chomp($OSName=`uname -s`); # AIX OSVersion = oslevel, OSComment=oslevel -r affiche niveau de maintenance chomp($OSVersion=`oslevel`); chomp($OSLevel=`oslevel -r`); @tabOS=split(/-/,$OSLevel); $OSComment="Maintenance Level :".@tabOS[1]; $OSVersion =~ s/(.0)*$//; $common->setHardware({ OSNAME => "$OSName $OSVersion", OSCOMMENTS => $OSComment, OSVERSION => $OSLevel, }); } 1; UnixAgent-2.4.2/lib/Ocsinventory/Agent/Backend/OS/AIX/000077500000000000000000000000001332737732100222305ustar00rootroot00000000000000UnixAgent-2.4.2/lib/Ocsinventory/Agent/Backend/OS/AIX/CPU.pm000066400000000000000000000043031332737732100232150ustar00rootroot00000000000000package Ocsinventory::Agent::Backend::OS::AIX::CPU; use strict; use warnings; sub check { 1 } # try to simulate a modern lsattr output on AIX4 sub lsattrForAIX4 { my $device = shift; my @lsattr; my @lsattrtemp=`lsattr -EOl $device -a 'state:type'`; for (@lsattrtemp) { chomp; my $frequency; my (undef,$type)=split /:/; # # On older models, frequency is based on cpu model and uname # if ( $type eq "PowerPC" or $type eq "PowerPC_601" or $type eq "PowerPC_604") { my $uname=`uname -m`; $frequency=112000000 if ($uname=~/E1D|EAD|C1D|R04|C4D|R4D/); $frequency=133000000 if ($uname=~/34M/); $frequency=150000000 if ($uname=~/N4D/); $frequency=200000000 if ($uname=~/X4M|X4D/); $frequency=225000000 if ($uname=~/N4E|K04|K44/); $frequency=320000000 if ($uname=~/N4F/); $frequency=360000000 if ($uname=~/K45/); } elsif ( $type eq "PowerPC_RS64_III" ) { $frequency=400000000; } elsif ( $type eq "PowerPC_620" ) { $frequency=172000000; } else { $frequency=225000000; } push @lsattr,"$device:$frequency\n"; } } sub run { my $params = shift; my $common = $params->{common}; # TODO Need to be able to register different CPU speed! my $processort; my $processorn; my $processors; my $frequency; my @lsdev; my @lsattr; #lsdev -Cc processor -F name #lsattr -EOl proc16 my $aixversion=`uname -v`; for (`lsdev -Cc processor -F name`){ chomp(my $device = $_); if ( $aixversion < 5 ) { @lsattr=lsattrForAIX4($device); } else { @lsattr=`lsattr -EOl $device -a 'state:type:frequency'`; } for (@lsattr) { if ( ! /^#/ && /(.+):(.+):(.+)/ ) { $processorn++; $processort=$2; if ( ($3 % 1000000) >= 50000){ $processors=int (($3/1000000) +1); } else { $processors=int (($3/1000000)); } } } } $processort =~ s/_/ /; $common->setHardware({ PROCESSORT => $processort, PROCESSORN => $processorn, PROCESSORS => $processors }); } 1 UnixAgent-2.4.2/lib/Ocsinventory/Agent/Backend/OS/AIX/Controller.pm000066400000000000000000000014141332737732100247110ustar00rootroot00000000000000package Ocsinventory::Agent::Backend::OS::AIX::Controller; use strict; sub check { my $params = shift; my $common = $params->{common}; return unless $common->can_run('lsdev'); my @lsdev = `lsdev -Cc adapter -F 'name:type:description'`; return 1 if @lsdev; 0 } sub run { my $params = shift; my $common = $params->{common}; my $name; my $type; my $manufacturer; for (`lsdev -Cc adapter -F 'name:type:description'`){ chomp($_); /^(.+):(.+):(.+)/; my $name = $1; my $type = $2; my $manufacturer = $3; $common->addController({ 'NAME' => $name, 'MANUFACTURER' => $manufacturer, 'TYPE' => $type, }); } } 1; UnixAgent-2.4.2/lib/Ocsinventory/Agent/Backend/OS/AIX/Domains.pm000066400000000000000000000012231332737732100241560ustar00rootroot00000000000000package Ocsinventory::Agent::Backend::OS::AIX::Domains; use strict; sub run { my $params = shift; my $common = $params->{common}; my $domain; # Domain name open RESOLV, "/etc/resolv.conf"; while(){ if (/^(domain|search)\s+(.+)/){ $domain=$2; chomp($domain); } } # If no domain name and no workgroup name (samba), we send "WORKGROUP" # TODO:Check if samba is present and get the windows workgroup or NT domain name unless (defined($domain)){chomp($domain="WORKGROUP");} $domain=~s/^.\.(.)/$1/; $common->setHardware({ WORKGROUP => $domain }); } 1; UnixAgent-2.4.2/lib/Ocsinventory/Agent/Backend/OS/AIX/Drives.pm000066400000000000000000000021061332737732100240210ustar00rootroot00000000000000package Ocsinventory::Agent::Backend::OS::AIX::Drives; use strict; sub check { my $params = shift; my $common = $params->{common}; return unless $common->can_run("df"); 1; } sub run { my $params = shift; my $common = $params->{common}; my $free; my $filesystem; my $total; my $type; my $volumn; my @fs; my @fstype; #Looking for mount points and disk space # Aix option -kP for (`df -kP`) { next if /^Filesystem\s*1024-blocks.*/; if (/^(\S+)\s+(\S+)\s+(\S+)\s+(\S+)\s+(\S+)\s+(\S+)\n/) { $type = $1; @fs=`lsfs -c $6`; @fstype = split /:/,$fs[1]; $filesystem = $fstype[2]; $total = sprintf("%i",($2/1024)); $free = sprintf("%i",($4/1024)); $volumn = $6; } next if $filesystem =~ /procfs/; $common->addDrive({ FREE => $free, FILESYSTEM => $filesystem, TOTAL => $total, TYPE => $type, VOLUMN => $volumn }); } } 1; UnixAgent-2.4.2/lib/Ocsinventory/Agent/Backend/OS/AIX/Hardware.pm000066400000000000000000000037231332737732100243300ustar00rootroot00000000000000package Ocsinventory::Agent::Backend::OS::AIX::Hardware; use strict; sub check { 1 } # NOTE: # Q: SSN can also use `uname -n`? What is the best? # A: uname -n since it doesn't need root priv sub run { my $params = shift; my $common = $params->{common}; # Using "type 0" section my( $SystemSerial , $SystemModel, $SystemManufacturer, $BiosManufacturer, $BiosVersion, $BiosDate); # lsvpd my @lsvpd = `lsvpd`; # Remove * (star) at the beginning of lines s/^\*// for (@lsvpd); # Search Firmware Hard my $flag=0; my $fw; for (@lsvpd){ if (/^DS Platform Firmware/) { $flag=1 }; if ( ($flag) && /^RM (.+)/) {$fw=$1;chomp($fw);$fw =~ s/(\s+)$//g;last}; } $flag=0; for (@lsvpd){ if (/^DS System Firmware/) { $flag=1 }; if ( ($flag) && /^RM (.+)/) {$BiosVersion=$1;chomp($BiosVersion);$BiosVersion =~ s/(\s+)$//g;last}; } $flag=0; for (@lsvpd){ if (/^DS System VPD/) { $flag=1 }; if ( ($flag) && /^TM (.+)/) {$SystemModel=$1;chomp($SystemModel);$SystemModel =~ s/(\s+)$//g;}; if ( ($flag) && /^SE (.+)/) {$SystemSerial=$1;chomp($SystemSerial);$SystemSerial =~ s/(\s+)$//g;}; if ( ($flag) && /^FC .+/) {$flag=0;last} } # Fetch the serial number like prtconf do if (! $SystemSerial) { $flag=0; foreach (`lscfg -vpl sysplanr00`) { if ($flag) { if (/\.+(\S*?)$/) { $SystemSerial = $1; } last; } else { $flag = 1 if /\s+System\ VPD/; } } } $BiosManufacturer='IBM'; $SystemManufacturer='IBM'; $BiosVersion .= "(Firmware :".$fw.")"; # Writing data $common->setBios ({ SMANUFACTURER => $SystemManufacturer, SMODEL => $SystemModel, SSN => $SystemSerial, BMANUFACTURER => $BiosManufacturer, BVERSION => $BiosVersion, BDATE => $BiosDate, }); } 1; UnixAgent-2.4.2/lib/Ocsinventory/Agent/Backend/OS/AIX/IPv4.pm000066400000000000000000000011021332737732100233420ustar00rootroot00000000000000package Ocsinventory::Agent::Backend::OS::AIX::IPv4; sub check { my $params = shift; my $common = $params->{common}; $common->can_run("ifconfig") } # Initialise the distro entry sub run { my $params = shift; my $common = $params->{common}; my @ip; # Looking for ip addresses with ifconfig, except loopback # AIX need -a option for (`ifconfig -a`){#ifconfig in the path # AIX ligne inet if(/^\s*inet\s+(\S+).*/){($1=~/127.+/)?next:push @ip, $1}; } $ip=join "/", @ip; $common->setHardware({IPADDR => $ip}); } 1; UnixAgent-2.4.2/lib/Ocsinventory/Agent/Backend/OS/AIX/LVM.pm000066400000000000000000000073021332737732100232260ustar00rootroot00000000000000package Ocsinventory::Agent::Backend::OS::AIX::LVM; use strict; use vars qw($runAfter); $runAfter = ["Ocsinventory::Agent::Backend::OS::AIX::Drives"]; sub check { my $params = shift; my $common = $params->{common}; return unless $common->can_run ("lspv") || $common->can_run('lsvg') || $common->can_run('lslv'); 1 } my $line; sub run { my $params = shift; my $common = $params->{common}; my @physvol; my @volgrp; my $format; my $total; my $total_pps; my $free; my $free_pps; my $lps; my $volume_name; my $volume_size; my $volume_uuid; my $status; my $vg_name; my $type; use constant MB => (1024*1024); # We retrieve the disk list foreach my $line (`lspv`) { chomp; my $name = split(/\s+/, $line); push @physvol, $name; } foreach my $nom (@physvol) { foreach my $line (`lspv $nom`){ if ($line =~ /PHYSICAL VOLUME:\s+(\S+)/) { $format = "AIX PV"; } if ($line =~ /PV STATE:\ss+(\S+)/) { $status = $1; } if ($line =~ /FREE PPs:\s+(\d+)/) { $free_pps = $1; } if ($line =~ /TOTAL PPs:\s+(\d+)/) { $total_pps = $1; } if ($line =~ /VOLUME GROUP:\s+(\S+)/) { $vg_name = "VG $1"; } if ($line =~ /PP SIZE:\s+(\d+)/) { $volume_size = $1; } if ($line =~ /PV IDENTIFIER:\s+(\S+)/) { $volume_uuid = $1; } if ($volume_size){ $total = $total_pps * $volume_size; $free = $free_pps * $volume_size; } $common->addDrive({ FREE => $free, FILESYSTEM => $format, TOTAL => $total, TYPE => "DISK", VOLUMN => $status, SERIAL => $volume_uuid }); } } foreach my $nom (@physvol) { foreach my $line (`lslv $nom`){ if ($line =~ /LV IDENTIFIER:\s+(\S+)/) { $volume_uuid = $1; } if ($line =~ /LV STATE:\s+(\S+)/) { $status = $1; } if ($line =~ /PP SIZE:\s+(\d+)/) { $volume_size = $1; } if ($line =~ /LPs:\s+(\d+)/) { $lps = $1; } if ($line =~ /TYPE:\s+(\S+)/) { $type = $1; } $total = $lps * $volume_size; $common->addDrive({ FREE => "", FILESYSTEM => "", TOTAL => $total, TYPE => $type, VOLUMN => $status, SERIAL => $volume_uuid }); } } # We retrieve the disk list foreach my $line (`lsvg`) { chomp; my $name = split(/\s+/, $line); push @volgrp, $name; } foreach my $nom (@volgrp) { foreach my $line (`lsvg $nom`){ if ($line =~ /VG IDENTIFIER:\s+(\S+)/) { $volume_uuid = $1; } if ($line =~ /VG STATE:\s+(\S+)/) { $status = $1; } if ($line =~ /TOTAL PPs:\s+(\d+)/) { $volume_size = $1; } if ($line =~ /FREE PPs:\s+(\d+)/) { $free = $1; } $common->addDrive({ FREE => $free, FILESYSTEM => "", TOTAL => $volume_size, TYPE => "AIX VG", VOLUMN => $status, SERIAL => $volume_uuid }); } } } 1; UnixAgent-2.4.2/lib/Ocsinventory/Agent/Backend/OS/AIX/Mem.pm000066400000000000000000000016071332737732100233100ustar00rootroot00000000000000package Ocsinventory::Agent::Backend::OS::AIX::Mem; use strict; sub check { my $params = shift; my $common = $params->{common}; return unless $common->can_run("lsdev"); return unless $common->can_run("which"); return unless $common->can_run("lsattr"); } sub run { my $params = shift; my $common = $params->{common}; my $memory; my $swap; # Memory informations # lsdev -Cc memory -F 'name' -t totmem # lsattr -EOlmem0 my (@lsdev, @lsattr, @grep); $memory=0; @lsdev=`lsdev -Cc memory -F 'name' -t totmem`; for (@lsdev){ $memory += `lsattr -a size -F value -El$_`; } # Paging Space @grep=`lsps -s`; for (@grep){ if ( ! /^Total/){ /^\s*(\d+)\w*\s+\d+.+/; $swap=$1; } } $common->setHardware({ MEMORY => $memory, SWAP => $swap }); } 1; UnixAgent-2.4.2/lib/Ocsinventory/Agent/Backend/OS/AIX/Memory.pm000066400000000000000000000035561332737732100240470ustar00rootroot00000000000000package Ocsinventory::Agent::Backend::OS::AIX::Memory; use strict; sub check { 1 } # TODO create a better check here sub run { my $params = shift; my $common = $params->{common}; my $capacity; my $description; my $numslots; my $speed; my $type; my $n; my $serial; my $mversion; my $caption; my $flag=0; #lsvpd my @lsvpd = `lsvpd`; # Remove * (star) at the beginning of lines s/^\*// for (@lsvpd); $numslots = -1; for (@lsvpd){ if (/^DS Memory DIMM/){ $description = $_; $flag=1; (defined($n))?($n++):($n=0); $description =~ s/DS //; $description =~ s/\n//; } if((/^SZ (.+)/) && ($flag)) {$capacity = $1;} if((/^PN (.+)/) && ($flag)) {$type = $1;} # localisation slot dans type if((/^YL\s(.+)/) && ($flag)) {$caption = "Slot ".$1;} if((/^SN (.+)/) && ($flag)) {$serial = $1;} if((/^VK (.+)/) && ($flag)) {$mversion = $1}; #print $numslots."\n"; # On rencontre un champ FC alors c'est la fin pour ce device if ((/^FC .+/) && ($flag)) { $flag=0; $numslots = $numslots +1; $common->addMemory({ CAPACITY => $capacity, DESCRIPTION => $description, CAPTION => $caption, NUMSLOTS => $numslots, VERSION => $mversion, TYPE => $type, SERIALNUMBER=> $serial, }); } } #$numslots = $numslots +1; # End of Loop # The last *FC ???????? missing # $common->addMemory({ # CAPACITY => $capacity, # DESCRIPTION => $description, # CAPTION => $caption, # NUMSLOTS => $numslots, # VERSION => $mversion, # TYPE => $type, # SERIALNUMBER=> $serial, #}); } 1; UnixAgent-2.4.2/lib/Ocsinventory/Agent/Backend/OS/AIX/Modems.pm000066400000000000000000000010671332737732100240160ustar00rootroot00000000000000package Ocsinventory::Agent::Backend::OS::AIX::Modems; use strict; sub check { my $params = shift; my $common = $params->{common}; $common->can_run("lsdev") } sub run { my $params = shift; my $common = $params->{common}; for (`lsdev -Cc adapter -F 'name:type:description'`){ if (/modem/i && /\d+\s(.+):(.+)$/){ my $name = $1; my $description = $2; $common->addModems({ 'DESCRIPTION' => $description, 'NAME' => $name, }); } } } 1 UnixAgent-2.4.2/lib/Ocsinventory/Agent/Backend/OS/AIX/Networks.pm000066400000000000000000000100211332737732100243740ustar00rootroot00000000000000package Ocsinventory::Agent::Backend::OS::AIX::Networks; use strict; sub check { my $params = shift; my $common = $params->{common}; $common->can_load("Net::IP qw(:PROC)"); } sub run { my $params = shift; my $common = $params->{common}; my %info; my $ifname; foreach (`lscfg -v -l en*`) { $ifname = "en".$1 if /^\s+ent(\d+)\s+\S+\s+(.+)/; if ($ifname) { $info{$ifname}{type} = $2; $info{$ifname}{status} = "Down"; # default is down if (/Network Address\.+(\w{2})(\w{2})(\w{2})(\w{2})(\w{2})(\w{2})/) { $info{$ifname}{macaddr} = "$1:$2:$3:$4:$5:$6" } } } # Retrieve VLAN information on AIX # Only tested on AIX 6.1 my $pifname; foreach (`lsdev`) { if (/^ent(\d+).*VLAN$/) { $ifname = "en".$1; $pifname = "ent".$1; $info{$ifname}{type} = "VLAN"; $info{$ifname}{status} = "Down"; foreach (`entstat -d $ifname`) { if (/Hardware Address:\s+(.+)$/) { $info{$ifname}{macaddr}="$1"; last; } } foreach (`lsattr -El $pifname`) { if (/^vlan_tag_id\s+(\d+)/) { $info{$ifname}{type}.="$1"; } } } } # uncomment if you prefere verbose information about the link # e.g: 0xe8120000:0xe80c0000:741:3:512:1024:8192:Auto_Negotiation:2048:no:0x000000000000:10000:10:1000:yes:yes:no:no:yes:2048 # etherchannel interfaces # my @lsdev=`lsdev -Cc adapter -s pseudo -t ibm_ech`; # foreach (`lsdev -Cc adapter`) { # next unless /^ent(\d*)\s*(\w*)\s*.*/; # my $ifname = "en".$1; # my $tmpifname = "ent".$1; # #@lsattr=`lsattr -EOl $1 -a 'adapter_names mode netaddr'`; # foreach (`lsattr -EOl $tmpifname`) { # if (/(.+):(.+):(.*)/) { # $info{$ifname}{type}="EtherChannel with : ".$1." (mode :".$2.", ping :".$3.")"; # } # } # $info{$ifname}{status} = 'Down'; # The same # } foreach (split / /,`ifconfig -l`) { # AIX: network interface naming is enX if (/^(en\d+)/) { my $ifname = $1; foreach (`lsattr -E -l $ifname`) { $info{$ifname}{ip} = $1 if /^netaddr \s*([\d*\.?]*).*/i; $info{$ifname}{netmask} = $1 if /^netmask\s*([\d*\.?]*).*/i; $info{$ifname}{status} = $1 if /^state\s*(\w*).*/i; } } } # Looking for the gateways # AIX: the route command doesn't exist. We use netstat -rn instead foreach (`netstat -rn`) { if (/\S+\s+(\S+)\s+\S+\s+\S+\s+\S+\s+(\S+)/) { my $ifname = $2; my $gateway = $1; if (exists ($info{$ifname})) { $info{$ifname}{gateway} = $gateway; } } } foreach my $ifname (sort keys %info) { my $description = $ifname; my $type = $info{$ifname}{type}; my $macaddr = $info{$ifname}{macaddr}; my $status = $info{$ifname}{status}; my $ipaddress = $info{$ifname}{ip}; my $ipmask = $info{$ifname}{netmask}; my $gateway = $info{$ifname}{gateway}; my $ipdhcp = "No"; my $ipsubnet; $status = "Down" unless $ipaddress; # Retrieving ip of the subnet for each interface if ($ipmask and $ipaddress) { # To retrieve the subnet for this iface my $binip = &ip_iptobin ($ipaddress ,4); my $binmask = &ip_iptobin ($ipmask ,4); my $subnet = $binip & $binmask; $ipsubnet = ip_bintoip($subnet,4); } $common->addNetwork({ DESCRIPTION => $description, IPADDRESS => $ipaddress, IPDHCP => $ipdhcp, IPGATEWAY => $gateway, IPMASK => $ipmask, IPSUBNET => $ipsubnet, MACADDR => $macaddr, STATUS => $status, TYPE => $type, }); } } 1; UnixAgent-2.4.2/lib/Ocsinventory/Agent/Backend/OS/AIX/Slots.pm000066400000000000000000000020271332737732100236730ustar00rootroot00000000000000package Ocsinventory::Agent::Backend::OS::AIX::Slots; use strict; sub check { my $params = shift; my $common = $params->{common}; $common->can_run("lsdev") } sub run { my $params = shift; my $common = $params->{common}; my $description; my $designation; my $name; my $status; my @slot; my $flag=0; @slot=`lsdev -Cc bus -F 'name:description'`; for (@slot){ /^(.+):(.+)/; $name = $1; $status = 'available'; $designation = $2; $flag=0; my @lsvpd = `lsvpd`; s/^\*// for (@lsvpd); for (@lsvpd){ if ((/^AX $name/) ) {$flag=1} if ((/^YL (.+)/) && ($flag)){ $description = $2; } if ((/^FC .+/) && $flag) {$flag=0;last} } $common->addSlot({ DESCRIPTION => $description, DESIGNATION => $designation, NAME => $name, STATUS => $status, }); } } 1; UnixAgent-2.4.2/lib/Ocsinventory/Agent/Backend/OS/AIX/Software.pm000066400000000000000000000014521332737732100243620ustar00rootroot00000000000000package Ocsinventory::Agent::Backend::OS::AIX::Software; use strict; use warnings; sub check { my $params = shift; my $common = $params->{common}; # Do not run an package inventory if there is the --nosoftware parameter return if ($params->{config}->{nosoftware}); return unless $common->can_run("lslpp"); 1; } sub run { my $params = shift; my $common = $params->{common}; my @list; my $buff; foreach (`lslpp -c -l`) { my @entry = split /:/,$_; next unless (@entry); next unless ($entry[1]); next if $entry[1] =~ /^device/; $common->addSoftware({ 'COMMENTS' => $entry[6], 'FOLDER' => $entry[0], 'NAME' => $entry[1], 'VERSION' => $entry[2], }); } } 1; UnixAgent-2.4.2/lib/Ocsinventory/Agent/Backend/OS/AIX/Sounds.pm000066400000000000000000000011211332737732100240340ustar00rootroot00000000000000package Ocsinventory::Agent::Backend::OS::AIX::Sounds; use strict; sub check { my $params = shift; my $common = $params->{common}; $common->can_run("lsdev") } sub run { my $params = shift; my $common = $params->{common}; for (`lsdev -Cc adapter -F 'name:type:description'`){ if (/audio/i){ if (/^\S+\s([^:]+):\s*(.+?)(?:\(([^()]+)\))?$/i){ $common->addSound({ 'DESCRIPTION' => $3, 'MANUFACTURER' => $2, 'NAME' => $1, }); } } } } 1; UnixAgent-2.4.2/lib/Ocsinventory/Agent/Backend/OS/AIX/Storages.pm000066400000000000000000000177761332737732100243770ustar00rootroot00000000000000package Ocsinventory::Agent::Backend::OS::AIX::Storages; use strict; #use warning; sub check { `which lsdev 2>&1`; return if($? >> 8)!=0; `which lsattr 2>&1`; ($? >> 8)?0:1} sub run { my $params = shift; my $common = $params->{common}; my(@disques, $device, $model, $capacity, $description, $manufacturer, $n, $i, $flag, @rep, @scsi, @values, @lsattr, $FRU, $status); #lsvpd my @lsvpd = `lsvpd`; s/^\*// for (@lsvpd); #FCP MPIO FC 2145 disks. IBM SDDPCM MPIO Storwize @scsi= (); @lsattr= (); $n=0; @scsi=`lsdev -Cc disk -s fcp -F 'name:description'`; for (@scsi){ chomp $scsi[$n]; /^(.+):(.+)/; $device=$1; $description=$2; @lsattr=`lspv $device 2>&1`; for (@lsattr){ if ( ! ( /^0516-320.*/ ) ){ if (/TOTAL PPs:/ ) { ($capacity,$model) = split(/\(/, $_); ($capacity,$model) = split(/ /,$model); } } else{ $capacity=0; } } $common->addStorages({ MANUFACTURER => "FCP", MODEL => "MPIO Disk", DESCRIPTION => $description, TYPE => 'disk', NAME => $device, DISKSIZE => $capacity }); $n++; } # SAS disks $n=0; @scsi=`lsdev -Cc disk -s sas -F 'name:description'`; for (@scsi){ chomp $scsi[$n]; /^(.+):(.+)/; $device=$1; $description=$2; @lsattr=`lsattr -EOl $device -a 'size_in_mb'`; for (@lsattr){ if (! /^#/ ){ $capacity=$_; chomp($capacity);$capacity =~ s/(\s+)$//; } } for (@lsvpd){ if (/^AX $device/){$flag=1} if ((/^MF (.+)/) && $flag){$manufacturer=$1;chomp($manufacturer);$manufacturer =~ s/(\s+)$//;} if ((/^TM (.+)/) && $flag){$model=$1;chomp($model);$model =~ s/(\s+)$//;} if ((/^FN (.+)/) && $flag){$FRU=$1;chomp($FRU);$FRU =~ s/(\s+)$//;$manufacturer .= ",FRU number :".$FRU} if ((/^FC .+/) && $flag) {$flag=0;last} } $common->addStorages({ MANUFACTURER => $manufacturer, MODEL => $model, DESCRIPTION => $description, TYPE => 'disk', NAME => $device, DISKSIZE => $capacity }); $n++; } #SCSI disks $n=0; @scsi=`lsdev -Cc disk -s scsi -F 'name:description'`; for (@scsi){ chomp $scsi[$n]; /^(.+):(.+)/; $device=$1; $description=$2; @lsattr=`lsattr -EOl $device -a 'size_in_mb'`; for (@lsattr){ if (! /^#/ ){ $capacity= $_; chomp($capacity);$capacity =~ s/(\s+)$//; } } for (@lsvpd){ if(/^AX $device/){$flag=1} if ((/^MF (.+)/) && $flag){$manufacturer=$1;chomp($manufacturer);$manufacturer =~ s/(\s+)$//;} if ((/^TM (.+)/) && $flag){$model=$1;chomp($model);$model =~ s/(\s+)$//;} if ((/^FN (.+)/) && $flag){$FRU=$1;chomp($FRU);$FRU =~ s/(\s+)$//;$manufacturer .= ",FRU number :".$FRU} if ((/^FC .+/) && $flag) {$flag=0;last} } $common->addStorages({ NAME => $device, MANUFACTURER => $manufacturer, MODEL => $model, DESCRIPTION => $description, TYPE => 'disk', DISKSIZE => $capacity }); $n++; } #Virtual disks @scsi= (); @lsattr= (); $n=0; @scsi=`lsdev -Cc disk -s vscsi -F 'name:description'`; for (@scsi){ chomp $scsi[$n]; /^(.+):(.+)/; $device=$1; $description=$2; @lsattr=`lspv $device 2>&1`; for (@lsattr){ if ( ! ( /^0516-320.*/ ) ) { if (/TOTAL PPs:/ ) { ($capacity,$model) = split(/\(/, $_); ($capacity,$model) = split(/ /,$model); } } else { $capacity=0; } } $common->addStorages({ MANUFACTURER => "VIO Disk", MODEL => "Virtual Disk", DESCRIPTION => $description, TYPE => 'disk', NAME => $device, DISKSIZE => $capacity }); $n++; } #CDROM @scsi= (); @lsattr= (); @scsi=`lsdev -Cc cdrom -s scsi -F 'name:description:status'`; $i=0; for (@scsi){ chomp $scsi[$i]; /^(.+):(.+):(.+)/; $device=$1; $status=$3; $description=$2; $capacity=""; if (($status =~ /Available/)){ @lsattr=`lsattr -EOl $device -a 'size_in_mb'`; for (@lsattr){ if (! /^#/ ){ $capacity= $_; chomp($capacity);$capacity =~ s/(\s+)$//; } } $description = $scsi[$n]; for (@lsvpd){ if(/^AX $device/){$flag=1} if ((/^MF (.+)/) && $flag){$manufacturer=$1;chomp($manufacturer);$manufacturer =~ s/(\s+)$//;} if ((/^TM (.+)/) && $flag){$model=$1;chomp($model);$model =~ s/(\s+)$//;} if ((/^FN (.+)/) && $flag){$FRU=$1;chomp($FRU);$FRU =~ s/(\s+)$//;$manufacturer .= ",FRU number :".$FRU} if ((/^FC .+/) && $flag) {$flag=0;last} } $common->addStorages({ NAME => $device, MANUFACTURER => $manufacturer, MODEL => $model, DESCRIPTION => $description, TYPE => 'cd', DISKSIZE => $capacity }); $n++; } $i++; } #TAPE @scsi= (); @lsattr= (); @scsi=`lsdev -Cc tape -s scsi -F 'name:description:status'`; $i=0; for (@scsi){ chomp $scsi[$i]; /^(.+):(.+):(.+)/; $device=$1; $status=$3; $description=$2; $capacity=""; if (($status =~ /Available/)){ @lsattr=`lsattr -EOl $device -a 'size_in_mb'`; for (@lsattr){ if (! /^#/ ){ $capacity= $_; chomp($capacity);$capacity =~ s/(\s+)$//; } } for (@lsvpd){ if(/^AX $device/){$flag=1} if ((/^MF (.+)/) && $flag){$manufacturer=$1;chomp($manufacturer);$manufacturer =~ s/(\s+)$//;} if ((/^TM (.+)/) && $flag){$model=$1;chomp($model);$model =~ s/(\s+)$//;} if ((/^FN (.+)/) && $flag){$FRU=$1;chomp($FRU);$FRU =~ s/(\s+)$//;$manufacturer .= ",FRU number :".$FRU} if ((/^FC .+/) && $flag) {$flag=0;last} } $common->addStorages({ NAME => $device, MANUFACTURER => $manufacturer, MODEL => $model, DESCRIPTION => $description, TYPE => 'tape', DISKSIZE => $capacity }); $n++; } $i++; } #Disquette @scsi= (); @lsattr= (); @scsi=`lsdev -Cc diskette -F 'name:description:status'`; $i=0; for (@scsi){ chomp $scsi[$i]; /^(.+):(.+):(.+)/; $device=$1; $status=$3; $description=$2; $capacity=""; if (($status =~ /Available/)){ @lsattr=`lsattr -EOl $device -a 'fdtype'`; for (@lsattr){ if (! /^#/ ){ $capacity= $_; chomp($capacity);$capacity =~ s/(\s+)$//; } } # On le force en retour taille disquette non affichable $capacity =""; $common->addStorages({ NAME => $device, MANUFACTURER => 'N/A', MODEL => 'N/A', DESCRIPTION => $description, TYPE => 'floppy', DISKSIZE => '' }); $n++; } $i++; } } 1; UnixAgent-2.4.2/lib/Ocsinventory/Agent/Backend/OS/AIX/Users.pm000066400000000000000000000007621332737732100236740ustar00rootroot00000000000000package Ocsinventory::Agent::Backend::OS::AIX::Users; sub check { # Useless check for a posix system i guess my @who = `who 2>/dev/null`; return 1 if @who; return; } # Initialise the distro entry sub run { my $params = shift; my $common = $params->{common}; my %user; # Logged on users for (`who`){ $user{$1} = 1 if /^(\S+)./; } my $UsersLoggedIn = join "/", keys %user; $common->setHardware ({ USERID => $UsersLoggedIn }); } 1; UnixAgent-2.4.2/lib/Ocsinventory/Agent/Backend/OS/AIX/Videos.pm000066400000000000000000000010731332737732100240200ustar00rootroot00000000000000package Ocsinventory::Agent::Backend::OS::AIX::Videos; use strict; sub check { my $params = shift; my $common = $params->{common}; $common->can_run("lsdev"); } sub run { my $params = shift; my $common = $params->{common}; for (`lsdev -Cc adapter -F 'name:type:description'`){ if (/graphics|vga|video/i){ if (/^\S+\s([^:]+):\s*(.+?)(?:\(([^()]+)\))?$/i){ $common->addVideo({ 'CHIPSET' => $1, 'NAME' => $2, }); } } } } 1; UnixAgent-2.4.2/lib/Ocsinventory/Agent/Backend/OS/BSD.pm000066400000000000000000000021201332737732100225500ustar00rootroot00000000000000package Ocsinventory::Agent::Backend::OS::BSD; use strict; use vars qw($runAfter); $runAfter = ["Ocsinventory::Agent::Backend::OS::Generic"]; sub check { $^O =~ /freebsd|openbsd|netbsd|gnukfreebsd|gnuknetbsd/ } sub run { my $params = shift; my $common = $params->{common}; my $OSName; my $OSComment; my $OSVersion; my $OSLevel; my $OSArchi; # Operating system informations chomp($OSName=`uname -s`); chomp($OSVersion=`uname -r`); chomp($OSArchi=`uname -p`); # Retrieve the origin of the kernel configuration file my ($date, $origin, $kernconf); for (`sysctl -n kern.version`) { $date = $1 if /^\S.*\#\d+:\s*(.*)/; ($origin,$kernconf) = ($1,$2) if /^\s+(.+):(.+)$/; } $kernconf =~ s/\/.*\///; # remove the path $OSComment = $kernconf." (".$date.")\n".$origin; # if there is a problem use uname -v chomp($OSComment=`uname -v`) unless $OSComment; $common->setHardware({ OSNAME => $OSName." ".$OSArchi, OSCOMMENTS => $OSComment, OSVERSION => $OSVersion, }); } 1; UnixAgent-2.4.2/lib/Ocsinventory/Agent/Backend/OS/BSD/000077500000000000000000000000001332737732100222175ustar00rootroot00000000000000UnixAgent-2.4.2/lib/Ocsinventory/Agent/Backend/OS/BSD/Archs/000077500000000000000000000000001332737732100232575ustar00rootroot00000000000000UnixAgent-2.4.2/lib/Ocsinventory/Agent/Backend/OS/BSD/Archs/Alpha.pm000066400000000000000000000031541332737732100246450ustar00rootroot00000000000000package Ocsinventory::Agent::Backend::OS::BSD::Archs::Alpha; use strict; sub check{ my $arch; chomp($arch=`sysctl -n hw.machine`); $arch eq "alpha"; } sub run { my $params = shift; my $common = $params->{common}; my ($SystemSerial, $SystemModel, $SystemManufacturer, $BiosManufacturer, $BiosVersion, $BiosDate); my ($processort, $processorn, $processors); ### Get system model with "sysctl hw.model" # # example on *BSD # hw.model = AlphaStation 255 4/232 chomp($SystemModel=`sysctl -n hw.model`); $SystemManufacturer = "DEC"; ### Get processor type and speed in dmesg # # NetBSD: AlphaStation 255 4/232, 232MHz, s/n # cpu0 at mainbus0: ID 0 (primary), 21064A-2 # OpenBSD: AlphaStation 255 4/232, 232MHz # cpu0 at mainbus0: ID 0 (primary), 21064A-2 (pass 1.1) # FreeBSD: AlphaStation 255 4/232, 232MHz # CPU: EV45 (21064A) major=6 minor=2 for (`dmesg`) { if (/^cpu[^:]*:\s*(.*)$/i) { $processort = $1; } if (/$SystemModel,\s*(\S+)\s*MHz.*$/) { $processors = $1; } } # number of procs with sysctl (hw.ncpu) chomp($processorn=`sysctl -n hw.ncpu`); # Writing data $common->setBios ({ SMANUFACTURER => $SystemManufacturer, SMODEL => $SystemModel, SSN => $SystemSerial, BMANUFACTURER => $BiosManufacturer, BVERSION => $BiosVersion, BDATE => $BiosDate, }); $common->setHardware({ PROCESSORT => $processort, PROCESSORN => $processorn, PROCESSORS => $processors }); } 1; UnixAgent-2.4.2/lib/Ocsinventory/Agent/Backend/OS/BSD/Archs/I386.pm000066400000000000000000000030421332737732100242450ustar00rootroot00000000000000package Ocsinventory::Agent::Backend::OS::BSD::Archs::I386; # for i386 in case dmidecode is not available use strict; sub check{ my $arch; chomp($arch=`sysctl -n hw.machine`); return if (($arch ne "i386") && ($arch ne "amd64")); # dmidecode must not be present `dmidecode 2>&1`; return if ($? >> 8)==0; 1; } sub run { my $params = shift; my $common = $params->{common}; my ($SystemSerial , $SystemModel, $SystemManufacturer, $BiosManufacturer, $BiosVersion, $BiosDate); my ($processort , $processorn , $processors); # use hw.machine for the system model # TODO see if we can do better chomp($SystemModel=`sysctl -n hw.machine`); # number of procs with sysctl (hw.ncpu) chomp($processorn=`sysctl -n hw.ncpu`); # proc type with sysctl (hw.model) chomp($processort=`sysctl -n hw.model`); # XXX quick and dirty _attempt_ to get proc speed through dmesg for (`dmesg`){ my $tmp; if (/^cpu\S*\s.*\D[\s|\(]([\d|\.]+)[\s|-]mhz/i) { # XXX unsure $tmp = $1; $tmp =~ s/\..*//; $processors=$tmp; last } } # Writing data $common->setBios ({ SMANUFACTURER => $SystemManufacturer, SMODEL => $SystemModel, SSN => $SystemSerial, BMANUFACTURER => $BiosManufacturer, BVERSION => $BiosVersion, BDATE => $BiosDate, }); $common->setHardware({ PROCESSORT => $processort, PROCESSORN => $processorn, PROCESSORS => $processors }); } 1; UnixAgent-2.4.2/lib/Ocsinventory/Agent/Backend/OS/BSD/Archs/Sgimips.pm000066400000000000000000000040101332737732100252230ustar00rootroot00000000000000package Ocsinventory::Agent::Backend::OS::BSD::Archs::Sgimips; use strict; sub check{ my $arch; chomp($arch=`sysctl -n hw.machine`); $arch =~ m/^sgi/; } sub run { my $params = shift; my $common = $params->{common}; my ($SystemSerial , $SystemModel, $SystemManufacturer, $BiosManufacturer, $BiosVersion, $BiosDate); my ($processort , $processorn , $processors ); ### Get system model with "sysctl hw.model" # # example on NetBSD # hw.model = SGI-IP22 # example on OpenBSD # hw.model=SGI-O2 (IP32) chomp($SystemModel=`sysctl -n hw.model`); $SystemManufacturer = "SGI"; ### Get processor type and speed in dmesg # # Examples of dmesg output : # # I) Indy # a) NetBSD # mainbus0 (root): SGI-IP22 [SGI, 6906e152], 1 processor # cpu0 at mainbus0: MIPS R4400 CPU (0x450) Rev. 5.0 with MIPS R4010 FPC Rev. 0.0 # int0 at mainbus0 addr 0x1fbd9880: bus 75MHz, CPU 150MHz # # II) O2 # a) NetBSD # mainbus0 (root): SGI-IP32 [SGI, 8], 1 processor # cpu0 at mainbus0: MIPS R5000 CPU (0x2321) Rev. 2.1 with built-in FPU Rev. 1.0 # b) OpenBSD # mainbus0 (root) # cpu0 at mainbus0: MIPS R5000 CPU rev 2.1 180 MHz with R5000 based FPC rev 1.0 # cpu0: cache L1-I 32KB D 32KB 2 way, L2 512KB direct for (`dmesg`) { if (/$SystemModel\s*\[\S*\s*(\S*)\]/) { $SystemSerial = $1; } if (/cpu0 at mainbus0:\s*(.*)$/) { $processort = $1; } if (/CPU\s*.*\D(\d+)\s*MHz/) { $processors = $1; } } # number of procs with sysctl (hw.ncpu) chomp($processorn=`sysctl -n hw.ncpu`); # Writing data $common->setBios ({ SMANUFACTURER => $SystemManufacturer, SMODEL => $SystemModel, SSN => $SystemSerial, BMANUFACTURER => $BiosManufacturer, BVERSION => $BiosVersion, BDATE => $BiosDate, }); $common->setHardware({ PROCESSORT => $processort, PROCESSORN => $processorn, PROCESSORS => $processors }); } 1; UnixAgent-2.4.2/lib/Ocsinventory/Agent/Backend/OS/BSD/Archs/Sparc.pm000066400000000000000000000056311332737732100246720ustar00rootroot00000000000000package Ocsinventory::Agent::Backend::OS::BSD::Archs::Sparc; use strict; sub check{ my $arch; chomp($arch=`sysctl -n hw.machine`); $arch =~ /^sparc/; } sub run { my $params = shift; my $common = $params->{common}; my( $SystemSerial , $SystemModel, $SystemManufacturer, $BiosManufacturer, $BiosVersion, $BiosDate); my ( $processort , $processorn , $processors ); ### Get system serial with "sysctl kern.hostid" # # sysctl -n kern.hostid gives e.g. 0x807b65c on NetBSD # and 2155570635 on OpenBSD; we keep the hex form chomp ($SystemSerial = `sysctl -n kern.hostid`); if ( $SystemSerial =~ /^\d*$/ ) { # convert to NetBSD format $SystemSerial = sprintf ("0x%x",$SystemSerial); } $SystemSerial =~ s/^0x//; # remove 0x to make it appear as in the firmware ### Get system model and processor type in dmesg # # cannot use "sysctl hw.model" to get SystemModel # because it gives only the CPU on OpenBSD/sparc64 # # Examples of dmesg output : # # I) SPARC # a) NetBSD # mainbus0 (root): SUNW,SPARCstation-20: hostid 72362bb1 # cpu0 at mainbus0: TMS390Z50 v0 or TMS390Z55 @ 50 MHz, on-chip FPU # b) OpenBSD # mainbus0 (root): SUNW,SPARCstation-20 # cpu0 at mainbus0: TMS390Z50 v0 or TMS390Z55 @ 50 MHz, on-chip FPU # # II) SPARC64 # a) NetBSD # mainbus0 (root): SUNW,Ultra-1: hostid 807b65cb # cpu0 at mainbus0: SUNW,UltraSPARC @ 166.999 MHz, version 0 FPU # b) OpenBSD # mainbus0 (root): Sun Ultra 1 SBus (UltraSPARC 167MHz) # cpu0 at mainbus0: SUNW,UltraSPARC @ 166.999 MHz, version 0 FPU # c) FreeBSD # cpu0: Sun Microsystems UltraSparc-I Processor (167.00 MHz CPU) for (`dmesg`) { if (/^mainbus0 \(root\):\s*(.*)$/) { $SystemModel = $1; } if (/^cpu[^:]*:\s*(.*)$/i) { $processort = $1 unless $processort; } } $SystemModel || chomp ($SystemModel = `sysctl -n hw.model`); # for FreeBSD $SystemManufacturer = "SUN"; # some cleanup $SystemModel =~ s/SUNW,//; $SystemModel =~ s/[:\(].*$//; $SystemModel =~ s/^\s*//; $SystemModel =~ s/\s*$//; $processort =~ s/SUNW,//; $processort =~ s/^\s*//; $processort =~ s/\s*$//; # number of procs with "sysctl hw.ncpu" chomp($processorn=`sysctl -n hw.ncpu`); # XXX quick and dirty _attempt_ to get proc speed if ( $processort =~ /(\d+)(\.\d+|)\s*mhz/i ) { # possible decimal point $processors = sprintf("%.0f", "$1$2"); # round number } # Writing data $common->setBios ({ SMANUFACTURER => $SystemManufacturer, SMODEL => $SystemModel, SSN => $SystemSerial, BMANUFACTURER => $BiosManufacturer, BVERSION => $BiosVersion, BDATE => $BiosDate, }); $common->setHardware({ PROCESSORT => $processort, PROCESSORN => $processorn, PROCESSORS => $processors }); } 1; UnixAgent-2.4.2/lib/Ocsinventory/Agent/Backend/OS/BSD/CPU.pm000066400000000000000000000020301332737732100231770ustar00rootroot00000000000000package Ocsinventory::Agent::Backend::OS::BSD::CPU; use strict; sub check { return unless -r "/dev/mem"; 1; } sub run { my $params = shift; my $common = $params->{common}; my $os; my $processort; my $processorn; my $processors; my $family; my $manufacturer; my $serial; chomp($os = `uname -s`); if ($os eq "FreeBSD") { $processors = `sysctl -n hw.clockrate`; } else { $processors = `sysctl -n hw.cpuspeed`; } $processorn = `sysctl -n hw.ncpu`; $processort = `sysctl -n hw.model`; $family = `sysctl -n hw.machine`; $serial = `sysctl -n hw.serialno`; chomp($processort); if ($processort =~ /Intel/) { $manufacturer = "Intel"; } if ($processort =~ /Advanced Micro|AMD/) { $manufacturer = "AMD"; } $common->addCPU({ CPUARCH => $family, MANUFACTURER => $manufacturer, CORES => $processorn, TYPE => $processort, SPEED => $processors, SERIAL => $serial }); } 1; UnixAgent-2.4.2/lib/Ocsinventory/Agent/Backend/OS/BSD/Domains.pm000066400000000000000000000021061332737732100241460ustar00rootroot00000000000000package Ocsinventory::Agent::Backend::OS::BSD::Domains; use strict; sub check { my $hostname; chomp ($hostname = `hostname`); my @domain = split (/\./, $hostname); shift (@domain); return 1 if @domain; -f "/etc/resolv.conf" } sub run { my $params = shift; my $common = $params->{common}; my $domain; my %domain; my @dns_list; my $dns; my $hostname; chomp ($hostname = `hostname`); my @domain = split (/\./, $hostname); shift (@domain); $domain = join ('.',@domain); open RESOLV, "/etc/resolv.conf" or warn; while(){ if (/^nameserver\s+(\S+)/i) { push(@dns_list,$1); } elsif (!$domain) { $domain{$2} = 1 if (/^(domain|search)\s+(.+)/); } } close RESOLV; if (!$domain) { $domain = join "/", keys %domain; } $dns=join("/",@dns_list); # If no domain name, we send "WORKGROUP" $domain = 'WORKGROUP' unless $domain; $common->setHardware({ WORKGROUP => $domain, DNS => $dns }); } 1; UnixAgent-2.4.2/lib/Ocsinventory/Agent/Backend/OS/BSD/Drives.pm000066400000000000000000000016171332737732100240160ustar00rootroot00000000000000package Ocsinventory::Agent::Backend::OS::BSD::Drives; use strict; sub run { my $params = shift; my $common = $params->{common}; my $free; my $filesystem; my $total; my $type; my $volumn; for my $t ("ffs","ufs","zfs") { # OpenBSD has no -m option so use -k to obtain results in kilobytes for (`df -P -t $t -k`){ if (/^(\S+)\s+(\S+)\s+(\S+)\s+(\S+)\s+(\S+)\s+(\S+)\n/){ $volumn = $1; $filesystem = $t; $total = sprintf("%i",$2/1024); $free = sprintf("%i",$4/1024); $type = $6; $common->addDrive({ FREE => $free, FILESYSTEM => $filesystem, TOTAL => $total, TYPE => $type, VOLUMN => $volumn }); } } } } 1; UnixAgent-2.4.2/lib/Ocsinventory/Agent/Backend/OS/BSD/IPv4.pm000066400000000000000000000010611332737732100233350ustar00rootroot00000000000000package Ocsinventory::Agent::Backend::OS::BSD::IPv4; sub check { my @ifconfig = `ifconfig -a 2>/dev/null`; return 1 if @ifconfig; return; } # Initialise the distro entry sub run { my $params = shift; my $common = $params->{common}; my @ip; # Looking for ip addresses with ifconfig, except loopback # *BSD need -a option foreach (`ifconfig -a`){ if (/^\s*inet\s+(\S+)/){ ($1=~/127.+/)?next:push @ip, $1 }; } my $ip=join "/", @ip; $common->setHardware({IPADDR => $ip}); } 1; UnixAgent-2.4.2/lib/Ocsinventory/Agent/Backend/OS/BSD/Mem.pm000066400000000000000000000013321332737732100232720ustar00rootroot00000000000000package Ocsinventory::Agent::Backend::OS::BSD::Mem; use strict; sub check { `which sysctl 2>&1`; return 0 if($? >> 8); `which swapctl 2>&1`; return 0 if($? >> 8); 1; }; sub run { my $params = shift; my $common = $params->{common}; my $PhysicalMemory; my $SwapFileSize; # Swap my @bsd_swapctl= `swapctl -sk`; for (@bsd_swapctl){ $SwapFileSize=$1 if /total:\s*(\d+)/i; } # RAM chomp($PhysicalMemory=`sysctl -n hw.physmem`); $PhysicalMemory=$PhysicalMemory/1024; # Send it to inventory object $common->setHardware({ MEMORY => sprintf("%i",$PhysicalMemory/1024), SWAP => sprintf("%i", $SwapFileSize/1024), }); } 1; UnixAgent-2.4.2/lib/Ocsinventory/Agent/Backend/OS/BSD/Networks.pm000066400000000000000000000067741332737732100244070ustar00rootroot00000000000000package Ocsinventory::Agent::Backend::OS::BSD::Networks; use strict; sub check { my $params = shift; my $common = $params->{common}; $common->can_run("ifconfig") && $common->can_load("Net::IP qw(:PROC)") } sub _ipdhcp { my $if = shift; my $path; my $ipdhcp; my $leasepath; foreach ( # XXX BSD paths "/var/db/dhclient.leases.%s", "/var/db/dhclient.leases", # Linux path for some kFreeBSD based GNU system "/var/lib/dhcp3/dhclient.%s.leases", "/var/lib/dhcp3/dhclient.%s.leases", "/var/lib/dhcp/dhclient.leases") { $leasepath = sprintf($_,$if); last if (-e $leasepath); } return undef unless -e $leasepath; if (open DHCP, $leasepath) { my $lease; my $dhcp; my $expire; # find the last lease for the interface with its expire date while(){ $lease = 1 if(/lease\s*{/i); $lease = 0 if(/^\s*}\s*$/); if ($lease) { #inside a lease section if(/interface\s+"(.+?)"\s*/){ $dhcp = ($1 =~ /^$if$/); } #Server IP if(/option\s+dhcp-server-identifier\s+(\d{1,3}(?:\.\d{1,3}){3})\s*;/ and $dhcp){ $ipdhcp = $1; } if (/^\s*expire\s*\d\s*(\d*)\/(\d*)\/(\d*)\s*(\d*):(\d*):(\d*)/ and $dhcp) { $expire=sprintf "%04d%02d%02d%02d%02d%02d",$1,$2,$3,$4,$5,$6; } } } close DHCP or warn; chomp (my $currenttime = `date +"%Y%m%d%H%M%S"`); undef $ipdhcp unless $currenttime <= $expire; } else { warn "Can't open $leasepath\n"; } return $ipdhcp; } # Initialise the distro entry sub run { my $params = shift; my $common = $params->{common}; my $description; my $ipaddress; my $ipgateway; my $ipmask; my $ipsubnet; my $macaddr; my $status; my $type; # Looking for the gateway # 'route show' doesn't work on FreeBSD so we use netstat # XXX IPV4 only for (`netstat -nr -f inet`){ $ipgateway=$1 if /^default\s+(\S+)/i; } my @ifconfig = `ifconfig -a`; # -a option required on *BSD # first make the list available interfaces # too bad there's no -l option on OpenBSD my @list; foreach (@ifconfig){ # skip loopback, pseudo-devices and point-to-point interfaces next if /^(lo|fwe|vmnet|sit|pflog|pfsync|enc|strip|plip|sl|ppp)\d+/; if (/^(\S+):/) { push @list , $1; } # new interface name } # for each interface get it's parameters foreach $description (@list) { $ipaddress = $ipmask = $macaddr = $status = $type = undef; # search interface infos @ifconfig = `ifconfig $description`; foreach (@ifconfig){ $ipaddress = $1 if /inet (\S+)/i; $ipmask = $1 if /netmask\s+(\S+)/i; $macaddr = $2 if /(address:|ether|lladdr)\s+(\S+)/i; $status = 1 if /addNetwork({ DESCRIPTION => $description, IPADDRESS => $ipaddress, IPDHCP => _ipdhcp($description), IPGATEWAY => ($status?$ipgateway:undef), IPMASK => $ipmask, IPSUBNET => ($status?$ipsubnet:undef), MACADDR => $macaddr, STATUS => $status?"Up":"Down", TYPE => $type }); } } 1; UnixAgent-2.4.2/lib/Ocsinventory/Agent/Backend/OS/BSD/Storages.pm000066400000000000000000000040401332737732100243420ustar00rootroot00000000000000package Ocsinventory::Agent::Backend::OS::BSD::Storages; use strict; sub check { -x '/usr/local/bin/smartctl'; } sub run { my $params = shift; my $common = $params->{common}; my @values; my $devlist; my $osname = `uname -s`; if (chomp($osname) eq "FreeBSD") { $devlist = `/sbin/sysctl -n kern.disks`; } else { $devlist = `/sbin/sysctl -n hw.disknames`; } chomp($devlist); my @devices = split( /\s+/, $devlist ); for my $dev (@devices) { open( CMD, "smartctl -i /dev/$dev |" ); my ( $manufacturer, $serialnumber, $model, $size, $firmware, $type, $desc, $luwwnid ); while () { chomp(); if (/^Vendor:\s+|^Model Family:\s+/i) { $manufacturer = ( split( /:\s+/, $_ ) )[1]; } if (/^Product:\s+|^Device Model:\s+/i) { $model = ( split( /:\s+/, $_ ) )[1]; } if (/^Serial number:\s+/i) { $serialnumber = ( split( /:\s+/, $_ ) )[1]; } if (/^User Capacity:\s+/i) { s/,//g; my $out = ( split( /:\s+/, $_ ) )[1]; $size = ( split( ' ', $out ) )[0] / ( 1024 * 1024 ); } if (/^Revision:\s+|^Firmware Version:\s+/) { $firmware = ( split( /:\s+/, $_ ) )[1]; } if (/^Device type:\s+/) { $type = ( split( /:\s+/, $_ ) )[1]; } if (/^Transport protocol:\s+/) { $desc = ( split( /:\s+/, $_ ) )[1]; } if (/^LU WWN Device Id:\s+/) { $luwwnid = ( split( /:\s+/, $_ ) )[1]; } } $common->addStorages({ NAME => $dev, MANUFACTURER => $manufacturer, MODEL => $model, DESCRIPTION => $desc, TYPE => $type, DISKSIZE => $size, SERIALNUMBER => $serialnumber, FIRMWARE => $firmware, SCSI_UNID => $luwwnid, }); } } 1; UnixAgent-2.4.2/lib/Ocsinventory/Agent/Backend/OS/BSD/Sys.pm000066400000000000000000000004051332737732100233320ustar00rootroot00000000000000package Ocsinventory::Agent::Backend::OS::BSD::Sys; #$LunchAfter = "Ocsinventory::Agent::Backend::OS::Linux::VirtualFs::Sys"; sub check { foreach (`mount`) { return 1 if (/type\ sysfs/); } return; } sub run { # Hum? return ""; } 1 UnixAgent-2.4.2/lib/Ocsinventory/Agent/Backend/OS/BSD/Uptime.pm000066400000000000000000000016051332737732100240220ustar00rootroot00000000000000package Ocsinventory::Agent::Backend::OS::BSD::Uptime; use strict; sub check { my $boottime = `sysctl -n kern.boottime 2>/dev/null`; return 1 if $boottime; return; } sub run { my $params = shift; my $common = $params->{common}; chomp (my $boottime = `sysctl -n kern.boottime`); $boottime = $1 if $boottime =~ /sec\s*=\s*(\d+)/; chomp (my $currenttime = `date +%s`); my $uptime = $currenttime - $boottime; # Uptime conversion my ($UYEAR, $UMONTH , $UDAY, $UHOUR, $UMIN, $USEC) = (gmtime ($uptime))[5,4,3,2,1,0]; # Write in ISO format $uptime=sprintf "%02d-%02d-%02d %02d:%02d:%02d", ($UYEAR-70), $UMONTH, ($UDAY-1), $UHOUR, $UMIN, $USEC; chomp(my $DeviceType =`uname -m`); # TODO$h->{'CONTENT'}{'HARDWARE'}{'DESCRIPTION'} = [ "$DeviceType/$uptime" ]; $common->setHardware({ DESCRIPTION => "$DeviceType/$uptime" }); } 1; UnixAgent-2.4.2/lib/Ocsinventory/Agent/Backend/OS/Generic.pm000066400000000000000000000001201332737732100235120ustar00rootroot00000000000000package Ocsinventory::Agent::Backend::OS::Generic; use strict; sub run {} 1; UnixAgent-2.4.2/lib/Ocsinventory/Agent/Backend/OS/Generic/000077500000000000000000000000001332737732100231635ustar00rootroot00000000000000UnixAgent-2.4.2/lib/Ocsinventory/Agent/Backend/OS/Generic/Dmidecode.pm000066400000000000000000000003761332737732100254040ustar00rootroot00000000000000package Ocsinventory::Agent::Backend::OS::Generic::Dmidecode; use strict; sub check { my $params = shift; my $common = $params->{common}; return unless -r "/dev/mem"; return unless $common->can_run("dmidecode"); 1; } sub run {} 1; UnixAgent-2.4.2/lib/Ocsinventory/Agent/Backend/OS/Generic/Dmidecode/000077500000000000000000000000001332737732100250405ustar00rootroot00000000000000UnixAgent-2.4.2/lib/Ocsinventory/Agent/Backend/OS/Generic/Dmidecode/Batteries.pm000066400000000000000000000046011332737732100273210ustar00rootroot00000000000000package Ocsinventory::Agent::Backend::OS::Generic::Dmidecode::Batteries; use strict; sub run { my $params = shift; my $common = $params->{common}; my $dmidecode = `dmidecode`; # TODO retrieve error # some versions of dmidecode do not separate items with new lines # so add a new line before each handle $dmidecode =~ s/\nHandle/\n\nHandle/g; my @dmidecode = split (/\n/, $dmidecode); # add a new line at the end push @dmidecode, "\n"; s/^\s+// for (@dmidecode); my $flag; my $location; my $manufacturer; my $manufacturedate; my $serialnumber; my $name; my $chemistry; my $designcapacity; my $designvoltage; my $sbdsversion; my $maxerror; my $oemspecific; my $numslot; foreach (@dmidecode) { if (/dmi type 22,/i) { # beginning of Memory Device section $flag = 1; $numslot++; } elsif ($flag && /^$/) { # end of section $flag = 0; $common->addBatteries({ LOCATION => $location, MANUFACTURER => $manufacturer, MANUFACTUREDATE => $manufacturedate, SERIALNUMBER => $serialnumber, NAME => $name, CHEMISTRY => $chemistry, DESIGNCAPACITY => $designcapacity, DESIGNVOLTAGE => $designvoltage, SBDSVERSION => $sbdsversion, MAXERROR => $maxerror, OEMSPECIFIC => $oemspecific, }); $location = $manufacturer = $manufacturedate = $serialnumber = $name = $chemistry = $designcapacity = $designvoltage = $sbdsversion = $maxerror = $oemspecific = undef; } elsif ($flag) { # in the section $location = $1 if /^Location:\s*(\S+)/i; $manufacturer = $1 if /^Manufacturer:\s*(.+)/i; $manufacturedate = $1 if /^Manufacture Date:\s*(.+)/i; $serialnumber = $1 if /^Serial Number:\s*(.+)/i; $name = $1 if /^Name:\s*(.+)/i; $chemistry = $1 if /^Chemistry:\s*(.+)/i; $designcapacity = $1 if /^Design Capacity:\s*(.+)/i; $designvoltage = $1 if /^Design Voltage:\s*(.+)/i; $sbdsversion = $1 if /^SBDS Version:\s*(.+)/i; $maxerror = $1 if /^Maximum Error:\s*(.+)/i; $oemspecific = $1 if /^OEM-specific Information:\s*(.+)/i; } } } 1; UnixAgent-2.4.2/lib/Ocsinventory/Agent/Backend/OS/Generic/Dmidecode/Bios.pm000066400000000000000000000063251332737732100263000ustar00rootroot00000000000000package Ocsinventory::Agent::Backend::OS::Generic::Dmidecode::Bios; use strict; sub run { my $params = shift; my $common = $params->{common}; # Parsing dmidecode output # Using "type 0" section my( $SystemSerial , $SystemModel, $SystemManufacturer, $BiosManufacturer, $BiosVersion, $BiosDate, $AssetTag, $MotherboardManufacturer, $MotherboardModel, $MotherboardSerial, $Type ); #System DMI $SystemManufacturer = `dmidecode -s system-manufacturer`; $SystemModel = `dmidecode -s system-product-name`; $SystemSerial = `dmidecode -s system-serial-number`; $AssetTag = `dmidecode -s chassis-asset-tag`; $Type = `dmidecode -s chassis-type`; chomp($SystemModel); $SystemModel =~ s/^(#.*\n)+//g; $SystemModel =~ s/Invalid.*$//g; chomp($SystemManufacturer); $SystemManufacturer =~ s/^(#.*\n)+//g; $SystemManufacturer =~ s/Invalid.*$//g; chomp($SystemSerial); $SystemSerial =~ s/^(#.*\n)+//g; $SystemSerial =~ s/Invalid.*$//g; # System serial number can be filled with whitespace (e.g. Intel NUC) $SystemSerial =~ s/^\s+|\s+$//g; chomp($AssetTag); $AssetTag =~ s/^(#.*\n)+//g; $AssetTag =~ s/Invalid.*$//g; chomp($Type); $Type =~ s/^(#.*\n)+//g; $Type =~ s/Invalid.*$//g; #Motherboard DMI $MotherboardManufacturer = `dmidecode -s baseboard-manufacturer`; $MotherboardModel = `dmidecode -s baseboard-product-name`; $MotherboardSerial = `dmidecode -s baseboard-serial-number`; chomp($MotherboardModel); $MotherboardModel =~ s/^(#.*\n)+//g; $MotherboardModel =~ s/Invalid.*$//g; chomp($MotherboardManufacturer); $MotherboardManufacturer =~ s/^(#.*\n)+//g; $MotherboardManufacturer =~ s/Invalid.*$//g; chomp($MotherboardSerial); $MotherboardSerial =~ s/^(#.*\n)+//g; $MotherboardSerial =~ s/Invalid.*$//g; #BIOS DMI $BiosManufacturer = `dmidecode -s bios-vendor`; $BiosVersion = `dmidecode -s bios-version`; $BiosDate = `dmidecode -s bios-release-date`; chomp($BiosManufacturer); $BiosManufacturer =~ s/^(#.*\n)+//g; $BiosManufacturer =~ s/Invalid.*$//g; chomp($BiosVersion); $BiosVersion =~ s/^(#.*\n)+//g; $BiosVersion =~ s/Invalid.*$//g; chomp($BiosDate); $BiosDate =~ s/^(#.*\n)+//g; $BiosDate =~ s/Invalid.*$//g; # If serial number is empty, assign mainboard serial (e.g Intel NUC) if (!$SystemSerial) { $SystemSerial = $MotherboardSerial; } # Some bioses don't provide a serial number so I check for CPU ID (e.g: server from dedibox.fr) my @cpu; if (!$SystemSerial || $SystemSerial =~ /^0+$/) { @cpu = `dmidecode -t processor`; for (@cpu){ if (/ID:\s*(.*)/i){ $SystemSerial = $1; } } } # Writing data $common->setBios ({ ASSETTAG => $AssetTag, SMANUFACTURER => $SystemManufacturer, SMODEL => $SystemModel, SSN => $SystemSerial, BMANUFACTURER => $BiosManufacturer, BVERSION => $BiosVersion, BDATE => $BiosDate, MMANUFACTURER => $MotherboardManufacturer, MMODEL => $MotherboardModel, MSN => $MotherboardSerial, TYPE => $Type, }); } 1; UnixAgent-2.4.2/lib/Ocsinventory/Agent/Backend/OS/Generic/Dmidecode/Memory.pm000066400000000000000000000074231332737732100266540ustar00rootroot00000000000000package Ocsinventory::Agent::Backend::OS::Generic::Dmidecode::Memory; use strict; sub run { my $params = shift; my $common = $params->{common}; my $dmidecode; my @dmidecode; my %dmidecode; my $capacity; my $speed; my $type; my $numslot; my $serialnumber; my $manufacturer; my $caption; my $description; # DMI type 17 $dmidecode = `dmidecode -t 17`; @dmidecode = split (/Handle\s/i, $dmidecode); shift @dmidecode; $numslot = 0; foreach (@dmidecode) { $capacity = $speed = $type = $serialnumber = $manufacturer = $caption = $description = 0; $caption = $1 if /\s\sLocator:\s([\w\d_\-\s#]+)\n/i; $speed = $1 if /Speed:\s([\w\d]+)/i; $type = $1 if /Type:\s([\s\w]+)\n/i; $description = $1 if /Type\sDetail:\s([\s\w]+)\n/i; $manufacturer = $1 if /Manufacturer:\s([\w\d\-\_\s]+)\n/i; $serialnumber = $1 if /Serial\sNumber:\s([\w\d\-\_\s]+)\n/i; if (/Size:\s(\d+)\s(MB|GB|TB|MByte|GByte|TByte)/i) { if($2 eq "MB" or $2 eq "MByte") { $capacity = $1; } elsif($2 eq "GB" or $2 eq "GByte") { $capacity = $1*1024; } elsif($2 eq "TB" or $2 eq "TByte") { $capacity = $1*1024*1024; } } if (/DMI type 17/i) { $dmidecode{$numslot}{caption} = $caption ? $caption : ""; $dmidecode{$numslot}{description} = $description ? $description : ""; $dmidecode{$numslot}{speed} = $speed ? $speed : ""; $dmidecode{$numslot}{type} = $type ? $type : ""; $dmidecode{$numslot}{manufacturer} = $manufacturer ? $manufacturer : ""; $dmidecode{$numslot}{serialnumber} = $serialnumber ? $serialnumber : ""; $dmidecode{$numslot}{capacity} = $capacity ? $capacity : ""; $numslot++; } } # DMI type 6 if type 17 is not available if (!$numslot) { $dmidecode = `dmidecode -t 6`; # TODO retrieve error @dmidecode = split (/Handle\s/i, $dmidecode); shift @dmidecode; $numslot = 0; foreach (@dmidecode) { $capacity = $speed = $type = $caption = 0; $caption = $1 if /Socket Designation:\s([\w\d_\-\s#]+)\n/i; $capacity = $1 if /Installed\sSize:\s(\d+)/i; $speed = $1 if /Speed:\s([\w\d]+)/i; $type = $1 if /Type:\s([\s\w]+)\n/i; if (/Size:\s(\d+)\s(MB|GB|TB|MByte|GByte|TByte)/i) { if($2 eq "MB" or $2 eq "MByte") { $capacity = $1; } elsif($2 eq "GB" or $2 eq "GByte") { $capacity = $1*1024; } elsif($2 eq "TB" or $2 eq "TByte") { $capacity = $1*1024*1024; } } if (/DMI type 6/i) { $dmidecode{$numslot}{caption} = $caption ? $caption : ""; $dmidecode{$numslot}{description} = $description ? $description : ""; $dmidecode{$numslot}{speed} = $speed ? $speed : ""; $dmidecode{$numslot}{type} = $type ? $type : ""; $dmidecode{$numslot}{capacity} = $capacity ? $capacity : ""; $numslot++; } } } foreach (sort {$a <=> $b} keys %dmidecode) { $common->addMemory({ CAPACITY => $dmidecode{$_}{capacity}, SPEED => $dmidecode{$_}{speed}, TYPE => $dmidecode{$_}{type}, MANUFACTURER => $dmidecode{$_}{manufacturer}, SERIALNUMBER => $dmidecode{$_}{serialnumber}, NUMSLOTS => $_, CAPTION => $dmidecode{$_}{caption}, DESCRIPTION => $dmidecode{$_}{description}, }); } } 1; UnixAgent-2.4.2/lib/Ocsinventory/Agent/Backend/OS/Generic/Dmidecode/Ports.pm000066400000000000000000000024431332737732100265100ustar00rootroot00000000000000package Ocsinventory::Agent::Backend::OS::Generic::Dmidecode::Ports; use strict; sub run { my $params = shift; my $common = $params->{common}; my $dmidecode = `dmidecode`; # TODO retrieve error # some versions of dmidecode do not separate items with new lines # so add a new line before each handle $dmidecode =~ s/\nHandle/\n\nHandle/g; my @dmidecode = split (/\n/, $dmidecode); # add a new line at the end push @dmidecode, "\n"; s/^\s+// for (@dmidecode); my $flag; my $caption; my $description; my $name; my $type; foreach (@dmidecode) { if (/dmi type 8,/i) { $flag = 1; } elsif ($flag && /^$/){ # end of section $flag = 0; $common->addPorts({ CAPTION => $caption, DESCRIPTION => $description, NAME => $name, TYPE => $type, }); $caption = $description = $name = $type = undef; } elsif ($flag) { $caption = $1 if /^external connector type\s*:\s*(.+)/i; $description = $1 if /^internal connector type\s*:\s*(.+)/i; $name = $1 if /^internal reference designator\s*:\s*(.+)/i; $type = $1 if /^port type\s*:\s*(.+)/i; } } } 1; UnixAgent-2.4.2/lib/Ocsinventory/Agent/Backend/OS/Generic/Dmidecode/Slots.pm000066400000000000000000000023511332737732100265030ustar00rootroot00000000000000package Ocsinventory::Agent::Backend::OS::Generic::Dmidecode::Slots; use strict; sub run { my $params = shift; my $common = $params->{common}; my $dmidecode = `dmidecode`; # some versions of dmidecode do not separate items with new lines # so add a new line before each handle $dmidecode =~ s/\nHandle/\n\nHandle/g; my @dmidecode = split (/\n/, $dmidecode); # add a new line at the end push @dmidecode, "\n"; s/^\s+// for (@dmidecode); my $flag; my $description; my $designation; my $name; my $status; foreach (@dmidecode) { if (/dmi type 9,/i) { $flag=1; } elsif ($flag && /^$/) { $flag=0; $common->addSlot({ DESCRIPTION => $description, DESIGNATION => $designation, NAME => $name, STATUS => $status, }); $description = $designation = $name = $status = undef; } elsif ($flag) { $description = $1 if /^type\s*:\s*(.+)/i; $designation = $1 if /^id\s*:\s*(.+)/i; $name = $1 if /^designation\s*:\s*(.+)/i; $status = $1 if /^current usage\s*:\s*(.+)/i; }; } } 1; UnixAgent-2.4.2/lib/Ocsinventory/Agent/Backend/OS/Generic/Dmidecode/UUID.pm000066400000000000000000000007221332737732100261450ustar00rootroot00000000000000package Ocsinventory::Agent::Backend::OS::Generic::Dmidecode::UUID; use strict; sub check { my $params = shift; my $common = $params->{common}; return $common->can_run('dmidecode') } sub run { my $params = shift; my $common = $params->{common}; my $uuid; $uuid = `dmidecode -s system-uuid`; chomp($uuid); $uuid =~ s/^#+\s+$//g; $uuid =~ s/Invalid.*$//g; $common->setHardware({ UUID => $uuid, }); } 1; UnixAgent-2.4.2/lib/Ocsinventory/Agent/Backend/OS/Generic/Hostname.pm000066400000000000000000000012241332737732100252760ustar00rootroot00000000000000package Ocsinventory::Agent::Backend::OS::Generic::Hostname; sub check { my $params = shift; my $common = $params->{common}; return 1 if $common->can_load ("Sys::Hostname"); return 1 if $common->can_run ("hostname"); 0; } # Initialise the distro entry sub run { my $params = shift; my $common = $params->{common}; my $hostname; if ($common->can_load("Sys::Hostname")) { $hostname = Sys::Hostname::hostname(); } else { chomp ( $hostname = `hostname` ); # TODO: This is not generic. } $hostname =~ s/\..*//; # keep just the hostname $common->setHardware ({NAME => $hostname}); } 1; UnixAgent-2.4.2/lib/Ocsinventory/Agent/Backend/OS/Generic/Ipmi.pm000066400000000000000000000044021332737732100244170ustar00rootroot00000000000000# # OcsInventory agent - IPMI lan channel report # # Copyright (c) 2008 Jean Parpaillon # # The Intelligent Platform Management Interface (IPMI) specification # defines a set of common interfaces to a computer system which system # administrators can use to monitor system health and manage the # system. The IPMI consists of a main controller called the Baseboard # Management Controller (BMC) and other satellite controllers. # # The BMC can be fetched through client like OpenIPMI drivers or # through the network. Though, the BMC hold a proper MAC address. # # This module reports the MAC address and, if any, the IP # configuration of the BMC. This is reported as a standard NIC. # package Ocsinventory::Agent::Backend::OS::Generic::Ipmi; sub check { my $params = shift; my $common = $params->{common}; return unless $common->can_run("ipmitool") && $common->can_load("Net::IP qw(:PROC)"); my @ipmitool = `ipmitool lan print 2> /dev/null`; return unless @ipmitool; } # Initialise the distro entry sub run { my $params = shift; my $common = $params->{common}; my $description; my $ipaddress; my $ipgateway; my $ipmask; my $ipsubnet; my $macaddr; my $status; my $type; foreach (`LANG=C ipmitool lan print 2> /dev/null`) { if (/^IP Address\s+:\s+(\d+\.\d+\.\d+\.\d+)/) { $ipaddress = $1; } if (/^Default Gateway IP\s+:\s+(\d+\.\d+\.\d+\.\d+)/) { $ipgateway = $1; } if (/^Subnet Mask\s+:\s+(\d+\.\d+\.\d+\.\d+)/) { $ipmask = $1; } if (/^MAC Address\s+:\s+([0-9a-f]{2}(:[0-9a-f]{2}){5})/) { $macaddr = $1; } } $description = 'bmc'; my $binip = &ip_iptobin ($ipaddress, 4); my $binmask = &ip_iptobin ($ipmask, 4); my $binsubnet = $binip & $binmask; $ipsubnet = ip_bintoip($binsubnet, 4); $status = 1 if $ipaddress != '0.0.0.0'; $type = 'Ethernet'; $common->addNetwork({ DESCRIPTION => $description, IPADDRESS => $ipaddress, IPDHCP => "", IPGATEWAY => $ipgateway, IPMASK => $ipmask, IPSUBNET => $ipsubnet, MACADDR => $macaddr, STATUS => $status?"Up":"Down", TYPE => $type, }); } 1; UnixAgent-2.4.2/lib/Ocsinventory/Agent/Backend/OS/Generic/Lspci.pm000066400000000000000000000002761332737732100246000ustar00rootroot00000000000000package Ocsinventory::Agent::Backend::OS::Generic::Lspci; use strict; sub check { my $params = shift; my $common = $params->{common}; $common->can_run("lspci") } sub run {} 1; UnixAgent-2.4.2/lib/Ocsinventory/Agent/Backend/OS/Generic/Lspci/000077500000000000000000000000001332737732100242355ustar00rootroot00000000000000UnixAgent-2.4.2/lib/Ocsinventory/Agent/Backend/OS/Generic/Lspci/Controllers.pm000066400000000000000000000034271332737732100271070ustar00rootroot00000000000000package Ocsinventory::Agent::Backend::OS::Generic::Lspci::Controllers; use strict; sub check { my $params = shift; my $common = $params->{common}; $common->can_run("lspci") } sub run { my $params = shift; my $common = $params->{common}; my $driver; my $name; my $manufacturer; my $pciid; my $pcislot; my $type; my $lspci_version; my $command = "lspci -vvv"; #We get the current lspci version `lspci --version` =~ m/lspci\sversion\s(\d+.*)/ ; $lspci_version=$1; $lspci_version = $common->convertVersion($lspci_version,3); if ($lspci_version >= 224) { #More informations since version 2.2.4 $command = "lspci -vvv -nn"; } foreach(`$command`){ if (/^(\S+)\s+(\w+.*?):\s(.*)/) { $pcislot = $1; $name = $2; $manufacturer = $3; if ($manufacturer =~ s/ \((rev \S+)\)//) { $type = $1; } $manufacturer =~ s/\ *$//; # clean up the end of the string $manufacturer =~ s/\s+\(prog-if \d+ \[.*?\]\)$//; # clean up the end of the string if ($manufacturer =~ s/ \[([A-z\d]+:[A-z\d]+)\]$//) { $pciid = $1; } } if ($pcislot && /^\s+Kernel driver in use: (\w+)/) { $driver = $1; } if ($pcislot && /^$/) { $common->addController({ 'DRIVER' => $driver, 'NAME' => $name, 'MANUFACTURER' => $manufacturer, 'PCIID' => $pciid, 'PCISLOT' => $pcislot, 'TYPE' => $type, }); $driver = $name = $pciid = $pcislot = $manufacturer = $type = undef; } } } 1 UnixAgent-2.4.2/lib/Ocsinventory/Agent/Backend/OS/Generic/Lspci/Modems.pm000066400000000000000000000006701332737732100260220ustar00rootroot00000000000000package Ocsinventory::Agent::Backend::OS::Generic::Lspci::Modems; use strict; sub run { my $params = shift; my $common = $params->{common}; foreach(`lspci`){ if (/modem/i && /\d+\s(.+):\s*(.+)$/){ my $name = $1; my $description = $2; $common->addModems({ 'DESCRIPTION' => $description, 'NAME' => $name, }); } } } 1; UnixAgent-2.4.2/lib/Ocsinventory/Agent/Backend/OS/Generic/Lspci/Sounds.pm000066400000000000000000000006411332737732100260470ustar00rootroot00000000000000package Ocsinventory::Agent::Backend::OS::Generic::Lspci::Sounds; use strict; sub run { my $params = shift; my $common = $params->{common}; foreach(`lspci`){ if (/audio/i && /^\S+\s([^:]+):\s*(.+?)(?:\(([^()]+)\))?$/i){ $common->addSound({ 'DESCRIPTION' => $3, 'MANUFACTURER' => $2, 'NAME' => $1, }); } } } 1; UnixAgent-2.4.2/lib/Ocsinventory/Agent/Backend/OS/Generic/Lspci/Videos.pm000066400000000000000000000111061332737732100260230ustar00rootroot00000000000000package Ocsinventory::Agent::Backend::OS::Generic::Lspci::Videos; use strict; my $memory; my $resolution; my $chipset; my @resolution; my ($ret,$handle,$i,$count,$clock,$driver_version, $nvml_version, $memtotal, $serial, $bios_version, $uuid, $name); my $reso; #sub check { # return unless $common->can_run("xrandr"); # return 1; #} sub run { my $params = shift; my $common = $params->{common}; if ($common->can_run("xrandr")) { if ($common->can_run("nvidia-smi")) { if ($common->can_load("nvidia::ml qw(:all)")){ nvmlInit(); # Retrieve driver version ($ret, $driver_version) = nvmlSystemGetDriverVersion(); die nvmlErrorString($ret) unless $ret == $nividia::ml::bindings::NVML_SUCCESS; # Retrieve NVML version ($ret, $nvml_version) = nvmlSystemGetNVMLVersion(); die nvmlErrorString($ret) unless $ret == $nividia::ml::bindings::NVML_SUCCESS; # How many nvidia cards are present? ($ret, $count) = nvmlDeviceGetCount(); die nvmlErrorString($ret) unless $ret == $nividia::ml::bindings::NVML_SUCCESS; for ($i=0; $i<$count; $i++) { ($ret, $handle) = nvmlDeviceGetHandleByIndex($i); next if $ret != $nvidia::ml::bindings::NVML_SUCCESS; ($ret, $name) = nvmlDeviceGetName($handle); next if $ret != $nvidia::ml::bindings::NVML_SUCCESS; ($ret, $memtotal) = nvmlDeviceGetMemoryInfo($handle); next if $ret != $nvidia::ml::bindings::NVML_SUCCESS; $memtotal = ($memtotal->{"total"} / 1024 / 1024); ($ret, $serial) = nvmlDeviceGetSerial($handle); next if $ret != $nvidia::ml::bindings::NVML_SUCCESS; ($ret, $bios_version) = nvmlDeviceVBiosVersion($handle); next if $ret != $nvidia::ml::bindings::NVML_SUCCESS; ($ret, $uuid) = nvmlDeviceGetUUID($handle); next if $ret != $nvidia::ml::bindings::NVML_SUCCESS; } nvmlShutdown(); my @resol= `xrandr --verbose | grep *current`; foreach my $r (@resol){ if ($r =~ /((\d{3,4})x(\d{3,4}))/){ push(@resolution,$1); } } foreach my $res (@resolution){ $reso = $res; } $common->addVideo({ NAME => $name, MEMORY => $memtotal, DRVVERSION => $driver_version, NVMLVERSION => $nvml_version, SPEED => $clock, SERIAL => $serial, VBIOS => $bios_version, UUID => $uuid, RESOLUTION => $reso, }); } } else { foreach(`lspci`){ if(/graphics|vga|video/i && /^([0-9a-f][0-9a-f]:[0-9a-f][0-9a-f].[0-9a-f])\s([^:]+):\s*(.+?)(?:\(([^()]+)\))?$/i){ my $slot = $1; $chipset = $2; $name = $3; if (defined $slot) { my @detail = `lspci -v -s $slot`; $memory = 0; foreach my $m (@detail) { if ($m =~ /.*Memory.*\s+\(.*-bit,\sprefetchable\)\s\[size=(\d*)M\]/) { $memory += $1; } } # Don't record zero memory $memory = undef if $memory == 0; } my @resol= `xrandr --verbose | grep *current`; foreach my $r (@resol){ if ($r =~ /((\d{3,4})x(\d{3,4}))/){ $resolution = $1; } } $common->addVideo({ 'CHIPSET' => $chipset, 'NAME' => $name, 'MEMORY' => $memory, 'RESOLUTION' => $resolution, }); } } } } else { foreach(`lspci`){ if(/graphics|vga|video/i && /^\S+\s([^:]+):\s*(.+?)(?:\(([^()]+)\))?$/i){ $common->addVideo({ 'CHIPSET' => $1, 'NAME' => $2, }); } } } } 1; UnixAgent-2.4.2/lib/Ocsinventory/Agent/Backend/OS/Generic/Lsusb.pm000066400000000000000000000002761332737732100246160ustar00rootroot00000000000000package Ocsinventory::Agent::Backend::OS::Generic::Lsusb; use strict; sub check { my $params = shift; my $common = $params->{common}; $common->can_run("lsusb") } sub run {} 1; UnixAgent-2.4.2/lib/Ocsinventory/Agent/Backend/OS/Generic/Lsusb/000077500000000000000000000000001332737732100242535ustar00rootroot00000000000000UnixAgent-2.4.2/lib/Ocsinventory/Agent/Backend/OS/Generic/Lsusb/Usb.pm000066400000000000000000000032451332737732100253460ustar00rootroot00000000000000package Ocsinventory::Agent::Backend::OS::Generic::Lsusb::Usb; use strict; use Config; use Data::Dumper; my $vendor; my $product; my $interface; my $bus; my $device; my $serial; my $protocol; my $id; sub run { my $params = shift; my $common = $params->{common}; foreach (`lsusb`) { if (/^Bus\s+(\d+)\sDevice\s(\d*):\sID\s(\d+):(\d+)*/i) { next if (grep (/$4/,qw(0001 0002 0024))); $bus=$1; $device=$2; #if (defined $bus && defined $device) { my @detail = `lsusb -v -s $bus:$device 2>/dev/null`; foreach my $d (@detail) { if ($d =~ /^\s*iManufacturer\s*\d+\s*(.*)/i) { $vendor = $1; } elsif ($d =~ /^\s*iProduct\s*\d+\s*(.*)/i) { $product = $1; } elsif ($d =~ /^\s*iSerial\s*\d+\s(.*)/i) { $serial = $1; #} elsif ($d =~ /^\s*bInterfaceProtocol\s*\d\s(.*)/i) { } elsif ($d =~ /^\s*bInterfaceClass\s*\d+\s*(.*)/i) { #$protocol = $1 unless defined $protocol || $1 eq 'None'; $protocol = $1; #} elsif ($d =~ /^\s*iInterface\s*\d\s(\w+)\s(.*)/i){ } elsif ($d =~ /^\s*bInterfaceSubClass\s*\d+\s(.*)/i){ $interface = $1; } } # Add information to $current $common->addUsb({ DESCRIPTION => $product, INTERFACE => $interface, MANUFACTURER => $vendor, SERIAL => $serial, TYPE => $protocol, }); } } } 1; UnixAgent-2.4.2/lib/Ocsinventory/Agent/Backend/OS/Generic/Packaging.pm000066400000000000000000000004111332737732100254010ustar00rootroot00000000000000package Ocsinventory::Agent::Backend::OS::Generic::Packaging; use strict; sub check { my $params = shift; # Do not run an package inventory if there is the --nosoftware parameter return if ($params->{config}->{nosoftware}); 1; } sub run{} 1; UnixAgent-2.4.2/lib/Ocsinventory/Agent/Backend/OS/Generic/Packaging/000077500000000000000000000000001332737732100250475ustar00rootroot00000000000000UnixAgent-2.4.2/lib/Ocsinventory/Agent/Backend/OS/Generic/Packaging/BSDpkg.pm000066400000000000000000000020761332737732100265240ustar00rootroot00000000000000package Ocsinventory::Agent::Backend::OS::Generic::Packaging::BSDpkg; sub check { my $params = shift; my $common = $params->{common}; return if ( `uname -rs` =~ /SunOS 5.11/ ); $common->can_run("pkg") || $common->can_run("pkg_info") } sub run { my $params = shift; my $common = $params->{common}; if ($common->can_run("pkg")) { foreach(`pkg info`){ /^(\S+)-(\d+\S*)\s+(.*)/; my $name = $1; my $version = $2; my $comments = $3; $common->addSoftware({ 'COMMENTS' => $comments, 'NAME' => $name, 'VERSION' => $version }); } } elsif ($common->can_run("pkg_info")) { foreach(`pkg_info`){ /^(\S+)-(\d+\S*)\s+(.*)/; my $name = $1; my $version = $2; my $comments = $3; $common->addSoftware({ 'COMMENTS' => $comments, 'NAME' => $name, 'VERSION' => $version }); } } } 1; UnixAgent-2.4.2/lib/Ocsinventory/Agent/Backend/OS/Generic/Packaging/ByHand.pm000066400000000000000000000032111332737732100265470ustar00rootroot00000000000000package Ocsinventory::Agent::Backend::OS::Generic::Packaging::ByHand; #How does it work ? # #Create a directory called software in place where you have your #"modules.conf" file. #Put your scripts in this directory. #The scripts have to write on the STDIO with the following format : #publisher#software#version#comment # use strict; use warnings; sub check { return(1); 1; } sub run() { my $params = shift; my $common = $params->{common}; my $ligne; my $soft; my $comm; my $version; my $file; my $vendor; my $commentaire; my @dots; #if (!$file || !-d $file) { foreach (@{$common->{config}{etcdir}}) { $file = $_.'/softwares'; last if -d $file; } #} my $logger = $params->{logger}; if ( opendir(my $dh, $file) ){ @dots = readdir($dh); foreach (@dots) { if ( -f $file."/".$_ ){ $comm = $file."/".$_; $logger->debug("Running appli detection scripts from ".$comm); foreach (`$comm`){ $ligne = $_; chomp($ligne); ($vendor,$soft,$version,$commentaire) = split(/\#/,$ligne); $common->addSoftware ({ 'PUBLISHER' => $vendor, 'NAME' => $soft, 'VERSION' => $version, 'FILESIZE' => "", 'COMMENTS' => $commentaire, 'FROM' => 'ByHand' }); } } } closedir $dh; } 1; } 1; UnixAgent-2.4.2/lib/Ocsinventory/Agent/Backend/OS/Generic/Packaging/Deb.pm000066400000000000000000000032711332737732100261020ustar00rootroot00000000000000package Ocsinventory::Agent::Backend::OS::Generic::Packaging::Deb; use strict; use warnings; use File::Basename; use File::stat; sub check { my $params = shift; my $common = $params->{common}; $common->can_run("dpkg") } sub run { my $params = shift; my $common = $params->{common}; my $size; my $key; my $value; my %statinfo; # List of files from which installation date will be extracted my @listfile=glob('"/var/lib/dpkg/info/*.list"'); foreach my $file_list (@listfile){ my $stat=stat($file_list); my ($year,$month,$day,$hour,$min,$sec)=(localtime($stat->mtime))[5,4,3,2,1,0]; $value=sprintf "%02d/%02d%02d %02d:%02d:%02d",($year+1900),$month,$day,$hour,$min,$sec; $key=fileparse($file_list, ".list"); $key =~ s/(\s+):.+/$1/; $statinfo{$key}=$value; } # use dpkg-query --show --showformat='${Package}|||${Version}\n' foreach(`dpkg-query --show --showformat='\${Package}---\${Version}---\${Installed-Size}---\${Homepage}---\${Description}\n'`) { if (/^(\S+)---(\S+)---(\S*)---(\S*)---(.*)/) { if ($3) { $size=$3; } else { $size='Unknown size'; } $key=$1; if (exists $statinfo{$key}) { $common->addSoftware ({ 'NAME' => $1, 'VERSION' => $2, 'FILESIZE' => $size, 'PUBLISHER' => $4, 'COMMENTS' => $5, 'INSTALLDATE' => $statinfo{$key}, 'FROM' => 'deb' }); } } } } 1; UnixAgent-2.4.2/lib/Ocsinventory/Agent/Backend/OS/Generic/Packaging/Gentoo.pm000066400000000000000000000022171332737732100266420ustar00rootroot00000000000000package Ocsinventory::Agent::Backend::OS::Generic::Packaging::Gentoo; use strict; use warnings; sub check { my $params = shift; my $common = $params->{common}; $common->can_run("equery") } sub run { my $params = shift; my $common = $params->{common}; # TODO: This had been rewrite from the Linux agent _WITHOUT_ being checked! # New format for listing softwares with equery command (equery 0.3.0.5) # Older version don't run with these options my $equery_vers = `equery --version ` =~ /.*\((.*)\).*/; $equery_vers = $1; if ($equery_vers =~ /^0.3/) { foreach (`equery list --format='\$cp \$fullversion' '*'`){ if (/^(.*) (.*)/) { $common->addSoftware({ 'NAME' => $1, 'VERSION' => $2, }); } } } else { # Old version of Gentoo foreach (`equery list -i`){ if (/^([a-z]\w+-\w+\/\.*)-([0-9]+.*)/) { $common->addSoftware({ 'NAME' => $1, 'VERSION' => $2, }); } } } } 1; UnixAgent-2.4.2/lib/Ocsinventory/Agent/Backend/OS/Generic/Packaging/Pacman.pm000066400000000000000000000007521332737732100266100ustar00rootroot00000000000000package Ocsinventory::Agent::Backend::OS::Generic::Packaging::Pacman; sub check { my $params = shift; my $common = $params->{common}; $common->can_run("/usr/bin/pacman") } sub run { my $params = shift; my $common = $params->{common}; foreach(`/usr/bin/pacman -Q`){ /^(\S+)\s+(\S+)/; my $name = $1; my $version = $2; $common->addSoftware({ 'NAME' => $name, 'VERSION' => $version }); } } 1; UnixAgent-2.4.2/lib/Ocsinventory/Agent/Backend/OS/Generic/Packaging/RPM.pm000066400000000000000000000030231332737732100260410ustar00rootroot00000000000000package Ocsinventory::Agent::Backend::OS::Generic::Packaging::RPM; use strict; use warnings; sub check { my $params = shift; my $common = $params->{common}; return unless $common->can_run("rpm"); # Some time rpm is a wrapper or an alias for another `rpm --version 2>&1`; return if ($? >> 8)!=0; 1; } sub run { my $params = shift; my $common = $params->{common}; my $logger = $params->{logger}; my @date; my @list; my $buff; foreach (`rpm -qa --queryformat "%{NAME}.%{ARCH} %{VERSION}-%{RELEASE} --%{INSTALLTIME}-- --%{SIZE}-- --%{VENDOR}-- %{SUMMARY}\n--\n" 2>/dev/null`) { if (! /^--/) { chomp; $buff .= $_; } elsif ($buff =~ s/^(\S+)\s+(\S+)\s+--(.*)--\s+--(.*)--\s+--(.*)--\s+(.*)//) { my ($name,$version,$installdate,$filesize,$vendor,$comments) = ( $1,$2,$3,$4,$5,$6 ); @date = localtime($installdate); $installdate = sprintf( "%04d-%02d-%02d %02d:%02d:%02d", $date[5] + 1900, $date[4] + 1, $date[3], $date[2], $date[1], $date[0]); $common->addSoftware({ 'NAME' => $name, 'VERSION' => $version, 'INSTALLDATE' => $installdate, 'FILESIZE' => $filesize, 'COMMENTS' => $comments, 'PUBLISHER' => $vendor, 'FROM' => 'rpm' }); } else { $logger->debug("Should never go here!"); $buff = ''; } } } 1; UnixAgent-2.4.2/lib/Ocsinventory/Agent/Backend/OS/Generic/Printers/000077500000000000000000000000001332737732100247715ustar00rootroot00000000000000UnixAgent-2.4.2/lib/Ocsinventory/Agent/Backend/OS/Generic/Printers/Cups.pm000066400000000000000000000024041332737732100262410ustar00rootroot00000000000000package Ocsinventory::Agent::Backend::OS::Generic::Printers::Cups; use strict; sub check { my $params = shift; my $common = $params->{common}; # If we are on a MAC, Mac::SysProfile will do the job return if -r '/usr/sbin/system_profiler'; return unless $common->can_load("Net::CUPS") && $Net::CUPS::VERSION >= 0.60; return 1; } sub run { my $params = shift; my $common = $params->{common}; my $cups = Net::CUPS->new(); my @destinations = $cups->getDestinations(); my $printer; my $description; my $port; my $driver; foreach (@destinations) { $printer = $_->getName() unless $printer; $description = $_->getDescription() unless $description; $port = $_->getUri() unless $port; $driver = $_->getOptionValue("printer-make-and-model") unless $driver; # Just grab the default printer, if I use getDestinations, CUPS # returns all the printer of the local subnet (if it can) # TODO There is room for improvement here $common->addPrinter({ NAME => $printer, DESCRIPTION => $description, PORT => $port, DRIVER => $driver }); $printer = $description = $port = $driver = undef; } } 1; UnixAgent-2.4.2/lib/Ocsinventory/Agent/Backend/OS/Generic/Repository.pm000066400000000000000000000001331332737732100256750ustar00rootroot00000000000000package Ocsinventory::Agent::Backend::OS::Generic::Repository; use strict; sub run {} 1; UnixAgent-2.4.2/lib/Ocsinventory/Agent/Backend/OS/Generic/Repository/000077500000000000000000000000001332737732100253425ustar00rootroot00000000000000UnixAgent-2.4.2/lib/Ocsinventory/Agent/Backend/OS/Generic/Repository/BSD.pm000066400000000000000000000034771332737732100263230ustar00rootroot00000000000000package Ocsinventory::Agent::Backend::OS::Generic::Repository::BSD; use strict; use warnings; sub check { my $params = shift; my $common = $params->{common}; return unless $common->can_run("pkg"); } my $repo_name; my $repo_baseurl; my $repo_priority; my $repo_mirror_type; my $repo_signature_type; my $repo_fingerprints; my $repo_enable; sub run { my $params = shift; my $common = $params->{common}; if ($^O eq 'freebsd') { foreach my $line (`LANG=C pkg -vv 2>/dev/null`){ next if ($line =~ /^Repositories:/i); if ($line =~ /^\s+(.*):\s\{/i){ $repo_name = $1; } elsif ($line =~ /url\s+:\s\"(.*)\"/i) { $repo_baseurl = $1; } elsif ($line =~ /enabled\s+:\s(.*)\,/i){ $repo_enable = $1; } elsif ($line =~ /priority\s+:\s(.*)\,/i) { $repo_priority = $1; } elsif ($line =~ /Mirror_type\s+:\s\"(.*)\"\,/i){ $repo_mirror_type = $1; } elsif ($line =~ /signature_type\s+:\s\"(.*)\"\,/i){ $repo_signature_type = $1; } elsif ($line =~ /fingerprints\s+:\s\"(.*)\"/i){ $repo_fingerprints = $1; } if ($line =~ /^ \}$/) { $common->addRepo({ BASEURL => $repo_baseurl, NAME => $repo_name, ENABLED => $repo_enable, PRIORITY => $repo_priority, MIRROR => $repo_mirror_type, SIGNATURE => $repo_signature_type, FINGERPRINTS => $repo_fingerprints, }); $repo_name = $repo_baseurl = $repo_enable = $repo_priority = $repo_mirror_type = $repo_signature_type = $repo_fingerprints = undef; } } } } 1; UnixAgent-2.4.2/lib/Ocsinventory/Agent/Backend/OS/Generic/Repository/CentOS.pm000066400000000000000000000044601332737732100270370ustar00rootroot00000000000000package Ocsinventory::Agent::Backend::OS::Generic::Repository::CentOS; use strict; use warnings; sub check { my $params = shift; my $common = $params->{common}; return unless $common->can_run("yum"); } my $repo_name; my $repo_baseurl; my $repo_filename; my $repo_pkgs; my $repo_rev; my $repo_size; my $repo_tag; my $repo_updated; my $repo_mirrors; my $repo_expire; my $repo_exclude; my $repo_excluded; my $repo_metalink; sub run { my $params = shift; my $common = $params->{common}; my @repository=`LANG=C yum -v repolist 2>/dev/null`; push @repository, "\n"; for (my $i=0;$i<$#repository;$i++){ my $line=$repository[$i]; if ($line =~ /^$/ && $repo_name && $repo_filename) { $common->addRepo({ BASEURL => $repo_baseurl, EXCLUDE => $repo_exclude, EXCLUDED => $repo_excluded, EXPIRE => $repo_expire, FILENAME => $repo_filename, MIRRORS => $repo_mirrors, NAME => $repo_name, PKGS => $repo_pkgs, REVISION => $repo_rev, SIZE => $repo_size, TAG => $repo_tag, UPDATED => $repo_updated, }); $repo_name = $repo_baseurl = $repo_filename = $repo_pkgs = $repo_size = $repo_tag = $repo_updated = $repo_mirrors = $repo_expire = $repo_exclude = $repo_excluded = $repo_rev = $repo_metalink = undef; } $repo_name = $1 if ($line =~ /^Repo-name\s+:\s(.*)/i); $repo_baseurl = $1 if ($line =~ /^Repo-baseurl\s+:\s(.*)/i); $repo_mirrors = $1 if ($line =~ /^Repo-mirrors\s+:\s(.*)/i); $repo_filename = $1 if ($line =~ /^Repo-filename:\s(.*)/i); $repo_pkgs = $1 if ($line =~ /^Repo-pkgs\s+:\s(.*)/i); $repo_rev = $1 if ($line =~ /^Repo-revision:\s(.*)/i); $repo_size = $1 if ($line =~ /^Repo-size\s+:\s(.*)/i); $repo_tag = $1 if ($line =~ /^Repo-tags\s+:\s(.*)/i); $repo_updated = $1 if ($line =~ /^Repo-updated\s+:\s(.*)/i); $repo_exclude = $1 if ($line =~ /^Repo-exclude\s+:\s(.*)/i); $repo_excluded = $1 if ($line =~ /^Repo-excluded\s+:\s(.*)/i); $repo_expire = $1 if ($line =~ /^Repo-expire\s+:\s(.*)/i); $repo_metalink =$1 if ($line =~ /^Repo-metalink\s+:\s(.*)/i); } } 1; UnixAgent-2.4.2/lib/Ocsinventory/Agent/Backend/OS/Generic/Repository/Debian.pm000066400000000000000000000016131332737732100270630ustar00rootroot00000000000000package Ocsinventory::Agent::Backend::OS::Generic::Repository::Debian; use strict; use warnings; sub check{ my $params = shift; my $common = $params->{common}; return unless $common->can_run("apt-cache"); } sub run{ my $params = shift; my $common = $params->{common}; my ($repo_name, $repo_baseurl); my @repository=`apt-cache policy | grep -i http | awk {'print \$2 " " \$3'} | sort -u`; push @repository, "\n"; for (my $i=0;$i<$#repository;$i++){ my $line=$repository[$i]; $repo_name=$1 if ($line =~ /\/([^\/]*)\n$/); $repo_baseurl=$1 if ($line =~ /^(\S*)\h/); if ($line =~ /(^.*$)/ && $repo_name && $repo_baseurl){ $common->addRepo({ NAME => $repo_name, BASEURL => $repo_baseurl, }); $repo_name = $repo_baseurl = undef; } #$repo_name=$1 if ($line =~ /.*\s(\w-?\/\w)/); } } 1; UnixAgent-2.4.2/lib/Ocsinventory/Agent/Backend/OS/Generic/Repository/Rhel.pm000066400000000000000000000031671332737732100266010ustar00rootroot00000000000000package Ocsinventory::Agent::Backend::OS::Generic::Repository::Rhel; use strict; use warnings; sub check { my $params = shift; my $common = $params->{common}; return unless $common->can_run("dnf"); } my $repo_name; my $repo_baseurl; my $repo_filename; my $repo_pkgs; my $repo_rev; my $repo_size; my $repo_tag; my $repo_updated; sub run { my $params = shift; my $common = $params->{common}; my @repository=`LANG=C dnf -v repolist 2>/dev/null`; push @repository, "\n"; for (my $i=0;$i<$#repository;$i++){ my $line=$repository[$i]; if ($line =~ /^$/ && $repo_name && $repo_filename) { $common->addRepo({ BASEURL => $repo_baseurl, FILENAME => $repo_filename, NAME => $repo_name, PACKAGES => $repo_pkgs, REVISION => $repo_rev, SIZE => $repo_size, TAG => $repo_tag, UPDATED => $repo_updated, }); $repo_name = $repo_baseurl = $repo_filename = $repo_pkgs = $repo_rev = $repo_size = $repo_tag = $repo_updated = undef; } $repo_name=$1 if ($line =~ /^Repo-name\s+:\s(.*)/i); $repo_baseurl=$1 if ($line =~ /^Repo-baseurl\s+:\s(.*)/i); $repo_filename=$1 if ($line =~ /^Repo-filename:\s(.*)/i); $repo_pkgs=$1 if ($line =~ /^Repo-pkgs\s+:\s(.*)/i); $repo_rev=$1 if ($line =~ /^Repo-revision:\s(.*)/i); $repo_size=$1 if ($line =~ /^Repo-size\s+:\s(.*)/i); $repo_tag=$1 if ($line =~ /^Repo-tags\s+:\s(.*)/i); $repo_updated=$1 if ($line =~ /^Repo-updated\s+:\s(.*)/i); } } 1; UnixAgent-2.4.2/lib/Ocsinventory/Agent/Backend/OS/Generic/Screen.pm000066400000000000000000000143251332737732100247450ustar00rootroot00000000000000package Ocsinventory::Agent::Backend::OS::Generic::Screen; use strict; use utf8; use Parse::EDID; sub haveExternalUtils { my $common = shift; return $common->can_run("monitor-get-edid-using-vbe") || $common->can_run("monitor-get-edid") || $common->can_run("get-edid"); } sub check { my $params = shift; my $common = $params->{common}; return unless -d "/sys/devices" || haveExternalUtils($common); 1; } sub _getManufacturerFromCode { my $code = shift; my $h = { "ACR" => "Acer America Corp.", "ACT" => "Targa", "ADI" => "ADI Corporation http://www.adi.com.tw", "AOC" => "AOC International (USA) Ltd.", "API" => "Acer America Corp.", "APP" => "Apple Computer, Inc.", "ART" => "ArtMedia", "AST" => "AST Research", "AMW" => "AMW", "AUO" => "AU Optronics Corporation", "BMM" => "BMM", "BNQ" => "BenQ Corporation", "BOE" => "BOE Display Technology", "CPL" => "Compal Electronics, Inc. / ALFA", "CPQ" => "COMPAQ Computer Corp.", "CPT" => "Chunghwa Picture Tubes, Ltd.", "CTX" => "CTX - Chuntex Electronic Co.", "DEC" => "Digital Equipment Corporation", "DEL" => "Dell Computer Corp.", "DPC" => "Delta Electronics, Inc.", "DWE" => "Daewoo Telecom Ltd", "ECS" => "ELITEGROUP Computer Systems", "ENC" => "EIZO", "EIZ" => "EIZO", "EPI" => "Envision Peripherals, Inc.", "FCM" => "Funai Electric Company of Taiwan", "FUJ" => "Fujitsu", "FUS" => "Fujitsu Siemens", "GSM" => "LG Electronics Inc. (GoldStar Technology, Inc.)", "GWY" => "Gateway 2000", "HEI" => "Hyundai Electronics Industries Co., Ltd.", "HIQ" => "Hyundai ImageQuest", "HIT" => "Hitachi", "HSD" => "Hannspree Inc", "HSL" => "Hansol Electronics", "HTC" => "Hitachi Ltd. / Nissei Sangyo America Ltd.", "HWP" => "Hewlett Packard", "IBM" => "IBM PC Company", "ICL" => "Fujitsu ICL", "IFS" => "InFocus", "IQT" => "Hyundai", "IVM" => "Idek Iiyama North America, Inc.", "KFC" => "KFC Computek", "LEN" => "Lenovo", "LGD" => "LG Display", "LKM" => "ADLAS / AZALEA", "LNK" => "LINK Technologies, Inc.", "LPL" => "LG Philips", "LTN" => "Lite-On", "MAG" => "MAG InnoVision", "MAX" => "Maxdata Computer GmbH", "MEI" => "Panasonic Comm. & Systems Co.", "MEL" => "Mitsubishi Electronics", "MIR" => "Miro Computer Products AG", "MTC" => "MITAC", "MS_" => "Panasonic", "NAN" => "NANAO", "NEC" => "NEC Technologies, Inc.", "NVD" => "Fujitsu", "NOK" => "Nokia", "OQI" => "OPTIQUEST", "PBN" => "Packard Bell", "PCK" => "Daewoo", "PDC" => "Polaroid", "PGS" => "Princeton Graphic Systems", "PHL" => "Philips Consumer Electronics Co.", "PRT" => "Princeton", "PTS" => "ProView/EMC/PTS YakumoTFT17SL", "REL" => "Relisys", "SAM" => "Samsung", "SMI" => "Smile", "SMC" => "Samtron", "SNI" => "Siemens Nixdorf", "SNY" => "Sony Corporation", "SPT" => "Sceptre", "SRC" => "Shamrock Technology", "STN" => "Samtron", "STP" => "Sceptre", "TAT" => "Tatung Co. of America, Inc.", "TOS" => "Toshiba", "TRL" => "Royal Information Company", "TSB" => "Toshiba, Inc.", "UNM" => "Unisys Corporation", "VSC" => "ViewSonic Corporation", "WTC" => "Wen Technology", "ZCM" => "Zenith Data Systems", "___" => "Targa" }; return $h->{$code} if (exists ($h->{$code}) && $h->{$code}); return "Unknown manufacturer code ".$code; } sub getEdid { my $raw_edid; my $port = $_[0]; # Mandriva $raw_edid = `monitor-get-edid-using-vbe --port $port 2>/dev/null`; # Since monitor-edid 1.15, it's possible to retrieve EDID information # through DVI link but we need to use monitor-get-edid if (!$raw_edid) { $raw_edid = `monitor-get-edid --vbe-port $port 2>/dev/null`; } if (!$raw_edid) { foreach (1..5) { # Sometime get-edid return an empty string... $raw_edid = `get-edid 2>/dev/null`; last if (length($raw_edid) == 128 || length($raw_edid) == 256); } } return unless (length($raw_edid) == 128 || length($raw_edid) == 256); return $raw_edid; } sub run { my $params = shift; my $common = $params->{common}; my $logger = $params->{logger}; my $raw_perl = 1; my $verbose; my $MonitorsDB; my $base64; my $uuencode; my %found; my @edid_list; # first check sysfs if there are edid entries for my $file(split(/\0/,`find /sys/devices -wholename '*/card*/edid' -print0`)) { open(my $sys_edid_fd,'<',$file); my $raw_edid = do { local $/; <$sys_edid_fd> }; if (length($raw_edid) == 128 || length($raw_edid) == 256 ) { push @edid_list, $raw_edid; } } # if not fall back to the old method if (!@edid_list && haveExternalUtils($common)) { for my $port(0..20){ my $raw_edid = getEdid($port); if ($raw_edid){ if (length($raw_edid) == 128 || length($raw_edid) == 256) { push @edid_list, $raw_edid; } } } } for my $raw_edid(@edid_list) { my $edid = parse_edid($raw_edid); if (my $err = check_parsed_edid($edid)) { $logger->debug("check failed: bad edid: $err"); } my $caption = $edid->{monitor_name}; my $description = $edid->{week}."/".$edid->{year}; my $manufacturer = _getManufacturerFromCode($edid->{manufacturer_name}); my $serial = $edid->{serial_number}; if (!exists $found{$serial}) { $found{$serial} = 1; eval "use MIME::Base64;"; $base64 = encode_base64($raw_edid) if !$@; if ($common->can_run("uuencode")) { chomp($uuencode = `echo $raw_edid|uuencode -`); if (!$base64) { chomp($base64 = `echo $raw_edid|uuencode -m -`); } } $common->addMonitor ({ BASE64 => $base64, CAPTION => $caption, DESCRIPTION => $description, MANUFACTURER => $manufacturer, SERIAL => $serial, UUENCODE => $uuencode, }); } } } 1; UnixAgent-2.4.2/lib/Ocsinventory/Agent/Backend/OS/Generic/Users.pm000066400000000000000000000006651332737732100246310ustar00rootroot00000000000000package Ocsinventory::Agent::Backend::OS::Generic::Users; sub check { # Useless check for a posix system i guess my @who = `who 2>/dev/null`; return 1 if @who; return; } # Initialise the distro entry sub run { my $params = shift; my $common = $params->{common}; my %user; # Logged on users for (`who`){ my $user = $1 if /^(\S+)./; $common->addUser ({ LOGIN => $user }); } } 1; UnixAgent-2.4.2/lib/Ocsinventory/Agent/Backend/OS/HPUX.pm000066400000000000000000000011771332737732100227370ustar00rootroot00000000000000package Ocsinventory::Agent::Backend::OS::HPUX; use strict; use vars qw($runAfter); $runAfter = ["Ocsinventory::Agent::Backend::OS::Generic"]; sub check { $^O =~ /hpux/ } sub run { my $params = shift; my $common = $params->{common}; my $OSName; my $OSVersion; my $OSComment; #my $uname_path = &_get_path('uname'); # Operating systeminformations chomp($OSName = `uname -s`); chomp($OSVersion = `uname -r`); chomp($OSComment = `uname -l`); $common->setHardware({ OSNAME => $OSName, OSCOMMENTS => $OSComment, OSVERSION => $OSVersion, }); } 1; UnixAgent-2.4.2/lib/Ocsinventory/Agent/Backend/OS/HPUX/000077500000000000000000000000001332737732100223735ustar00rootroot00000000000000UnixAgent-2.4.2/lib/Ocsinventory/Agent/Backend/OS/HPUX/Bios.pm000066400000000000000000000024031332737732100236240ustar00rootroot00000000000000package Ocsinventory::Agent::Backend::OS::HPUX::Bios; use strict; ### # Version 1.1 # Correction of Bug n 522774 # # thanks to Marty Riedling for this correction # ### sub check { $^O =~ /hpux/ } sub run { my $params = shift; my $common = $params->{common}; my $BiosVersion; my $BiosDate; my $SystemModel; my $SystemSerial; $SystemModel=`model`; if ($common->can_run ("machinfo")) { foreach (`machinfo`) { if (/Firmware\s+revision\s?[:=]\s+(\S+)/) { $BiosVersion=$1; } if (/achine\s+serial\s+number\s?[:=]\s+(\S+)/) { $SystemSerial=$1; } } } else { for (`echo 'sc product cpu;il' | /usr/sbin/cstm | grep "PDC Firmware"`) { if (/Revision:\s+(\S+)/){ $BiosVersion="PDC $1"; } } for (`echo 'sc product system;il' | /usr/sbin/cstm | grep "System Serial Number"`) { if (/:\s+(\w+)/) { $SystemSerial=$1; } } } $common->setBios ({ BVERSION => $BiosVersion, BDATE => $BiosDate, BMANUFACTURER => "HP", SMANUFACTURER => "HP", SMODEL => $SystemModel, SSN => $SystemSerial, }); } 1; UnixAgent-2.4.2/lib/Ocsinventory/Agent/Backend/OS/HPUX/CPU.pm000066400000000000000000000060311332737732100233600ustar00rootroot00000000000000package Ocsinventory::Agent::Backend::OS::HPUX::CPU; ### # Version 1.1 # Correction of Bug n 522774 # # thanks to Marty Riedling for this correction # ### use strict; use LWP::UserAgent; sub check { $^O =~ /hpux/ } sub run { my $params = shift; my $common = $params->{common}; my $processort; my $processorn; my $processors=""; my $DeviceType; my $cpuInfo; my $serie; # Using old system HpUX without machinfo # the Hpux with machinfo will be done after my %cpuInfos = ( "D200"=>"7100LC 75", "D210"=>"7100LC 100", "D220"=>"7300LC 132", "D230"=>"7300LC 160", "D250"=>"7200 100", "D260"=>"7200 120", "D270"=>"8000 160", "D280"=>"8000 180", "D310"=>"7100LC 100", "D320"=>"7300LC 132", "D330"=>"7300LC 160", "D350"=>"7200 100", "D360"=>"7200 120", "D370"=>"8000 160", "D380"=>"8000 180", "D390"=>"8200 240", "K360"=>"8000 180", "K370"=>"8200 200", "K380"=>"8200 240", "K400"=>"7200 100", "K410"=>"7200 120", "K420"=>"7200 120", "K460"=>"8000 180", "K570"=>"8200 200", "K580"=>"8200 240", "L1000-36"=>"8500 360", "L1500-7x"=>"8700 750", "L3000-7x"=>"8700 750", "N4000-44"=>"8500 440", "ia64 hp server rx1620"=>"itanium 1600"); if ( $common->can_run ("machinfo") ) { foreach ( `machinfo`) { if ( /Number of CPUs\s+=\s+(\d+)/ ) { $processorn=$1; } if ( /Clock speed\s+=\s+(\d+)\s+MHz/ ) { $processors=$1; } # Added for HPUX 11.31 if ( /Intel\(R\) Itanium 2 9[01]00 series processor \((\d+\.\d+)/ ) { $processors=$1*1000; } if ( /(\d+)\s+logical processors/ ) { $processorn=$1; } # end HPUX 11.31 } } else { chomp($DeviceType =`model |cut -f 3- -d/`); my $cpuInfo = $cpuInfos{"$DeviceType"}; if ( "$cpuInfo" =~ /^(\S+)\s(\S+)/ ) { $processort=$1; $processors=$2; } else { for ( `echo 'sc product cpu;il' | /usr/sbin/cstm | grep "CPU Module"` ) { if ( /(\S+)\s+CPU\s+Module/ ) { $processort=$1; } }; for ( `echo 'itick_per_usec/D' | adb -k /stand/vmunix /dev/kmem` ) { if ( /tick_per_usec:\s+(\d+)/ ) { $processors=$1; } } }; # NBR CPU chomp($processorn=`ioscan -Fk -C processor | wc -l`); #print "HP $processort A $processorn A $processors "; } chomp($serie = `uname -m`); if ( $serie =~ /ia64/) { $processort="Itanium" } if ( $serie =~ /9000/) { $processort="PA$processort"; } $common->setHardware({ PROCESSORT => $processort, PROCESSORN => $processorn, PROCESSORS => $processors, }); } 1; UnixAgent-2.4.2/lib/Ocsinventory/Agent/Backend/OS/HPUX/Controller.pm000066400000000000000000000014461332737732100250610ustar00rootroot00000000000000package Ocsinventory::Agent::Backend::OS::HPUX::Controller; use strict; sub check { $^O =~ /hpux/ } sub run { my $params = shift; my $common = $params->{common}; my $name; my $interface; my $info; my $type; my @typeScaned=('ext_bus','fc','psi'); my $scaned; for (@typeScaned) { $scaned=$_; for ( `ioscan -kFC $scaned| cut -d ':' -f 9,11,17,18` ) { if ( /(\S+):(\S+):(\S+):(.+)/ ) { $name=$2; $interface=$3; $info=$4; $type=$1; $common->addController({ 'NAME' => $name, 'MANUFACTURER' => "$interface $info", 'TYPE' => $type, }); }; }; }; } 1; UnixAgent-2.4.2/lib/Ocsinventory/Agent/Backend/OS/HPUX/Domains.pm000066400000000000000000000013461332737732100243270ustar00rootroot00000000000000package Ocsinventory::Agent::Backend::OS::HPUX::Domains; use strict; sub check { my $params = shift; my $common = $params->{common}; $common->can_run ("domainname") } sub run { my $params = shift; my $common = $params->{common}; my $domain; chomp($domain = `domainname`); if (!$domain) { my %domain; if (open RESOLV, "/etc/resolv.conf") { while() { $domain{$2} = 1 if (/^(domain|search)\s+(.+)/); } close RESOLV; } $domain = join "/", keys %domain; } # If no domain name, we send "WORKGROUP" $domain = 'WORKGROUP' unless $domain; $common->setHardware({ WORKGROUP => $domain }); } 1; UnixAgent-2.4.2/lib/Ocsinventory/Agent/Backend/OS/HPUX/Drives.pm000066400000000000000000000026151332737732100241710ustar00rootroot00000000000000package Ocsinventory::Agent::Backend::OS::HPUX::Drives; sub check { $^O =~ /hpux/ } sub run { my $params = shift; my $common = $params->{common}; my $type; my $fs; my $lv; my $total; my $free; for ( `fstyp -l | grep -v nfs` ) { if ( /^\s*$/ ) { #Blank line next; } $type=$_; for ( `bdf -t $type `) { if ( /Filesystem/ ) { ; } ; if ( /^(\S+)\s(\d+)\s+(\d+)\s+(\d+)\s+(\d+%)\s+(\S+)/ ) { $lv=$1; $total=$2; $free=$3; $fs=$6; $common->addDrives({ FREE => $free, FILESYSTEM => $fs, TOTAL => $total, TYPE => $type, VOLUMN => $lv, }); }; if ( /^(\S+)\s/) { $lv=$1; }; if ( /(\d+)\s+(\d+)\s+(\d+)\s+(\d+%)\s+(\S+)/) { $total=$1; $free=$3; $fs=$5; # print "fs $fs lv $lv total $total free $free type $type\n"; $common->addDrives({ FREE => $free, FILESYSTEM => $fs, TOTAL => $total, TYPE => $type, VOLUMN => $lv, }); }; }; }; } 1; UnixAgent-2.4.2/lib/Ocsinventory/Agent/Backend/OS/HPUX/IPv4.pm000066400000000000000000000007441332737732100235200ustar00rootroot00000000000000package Ocsinventory::Agent::Backend::OS::HPUX::IPv4; sub check { `which ifconfig 2>&1`; ($? >> 8)?0:1 } # Initialise the distro entry sub run { my $params = shift; my $common = $params->{common}; my $ip; my $hostname; if ( `hostname` =~ /(\S+)/ ) { $hostname=$1; } for ( `grep $hostname /etc/hosts ` ) { if ( /(^\d+\.\d+\.\d+\.\d+)\s+/ ){ $ip=$1; $common->setHardware({IPADDR => $ip}); } } } 1; UnixAgent-2.4.2/lib/Ocsinventory/Agent/Backend/OS/HPUX/Mem.pm000066400000000000000000000010601332737732100234440ustar00rootroot00000000000000package Ocsinventory::Agent::Backend::OS::HPUX::Mem; use strict; sub check { $^O =~ /hpux/ } sub run { my $params = shift; my $common = $params->{common}; my $mem; my $swap; $mem = `grep Physical /var/adm/syslog/syslog.log|tr -s " "|cut -f 7 -d " "` ; if ( $mem eq "" ) { $mem = `grep Physical /var/adm/syslog/OLDsyslog.log|tr -s " "|cut -f 7 -d " "` ; }; $mem = int ($mem/1024); $swap = `swapinfo -mdfq`; $common->setHardware({ MEMORY => $mem, SWAP => $swap, }); } 1; UnixAgent-2.4.2/lib/Ocsinventory/Agent/Backend/OS/HPUX/Memory.pm000066400000000000000000000063521332737732100242070ustar00rootroot00000000000000package Ocsinventory::Agent::Backend::OS::HPUX::Memory; use strict; sub check { $^O =~ /hpux/ } sub run { my $params = shift; my $common = $params->{common}; my $capacity=0; my $caption; my $description; my $numslot; my $subnumslot; my $serialnumber; my $type; my @list_mem=`echo 'sc product mem;il'| /usr/sbin/cstm`; my $ok=0; if ( `uname -m` =~ /ia64/ ) { for ( `echo 'sc product IPF_MEMORY;il' | /usr/sbin/cstm` ) { if ( /\w+IMM\s+Location/ ) { ; } elsif ( /(\w+IMM)\s+(\w+)\s+(\S+)\s+(\w+IMM)\s+(\w+)\s+(\S+)/ ) { $common->addMemories({ CAPACITY => $3, CAPTION => $2 , NUMSLOTS => "1" , TYPE => $1, }); $common->addMemories({ CAPACITY => $6, CAPTION => $5 , NUMSLOTS => "1" , TYPE => $4, }); } } } else { for ( `echo 'sc product system;il' | /usr/sbin/cstm ` ) { if ( /FRU\sSource\s+=\s+\S+\s+\(memory/ ) { $ok=0; #print "FRU Source memory\n"; } if ( /Source\s+Detail\s+=\s4/ ) { $ok=1; #print "Source Detail IMM\n"; } if ( /Extender\s+Location\s+=\s+(\S+)/ ) { $subnumslot=$1; #print "Extended sub $subnumslot\n"; }; if ( /DIMMS\s+Rank\s+=\s+(\S+)/ ) { $numslot=sprintf("%02x",$1); #print "Num slot $numslot\n"; } if ( /FRU\s+Name\.*:\s+(\S+)/ ) { if ( /(\S+)_(\S+)/ ) { $type=$1; $capacity=$2; #print "Type $type capa $capacity\n"; } elsif ( /(\wIMM)(\S+)/ ) { $ok=1; $type=$1; $numslot=$2; #print "Type $type numslot $numslot\n"; } } if ( /Part\s+Number\.*:\s*(\S+)\s+/ ) { $description=$1; #print "ref $description\n"; }; if ( /Serial\s+Number\.*:\s*(\S+)\s+/ ) { $serialnumber=$1; if ( $ok eq 1 ) { if ( $capacity eq 0 ){ foreach ( @list_mem ){ if ( /\s+$numslot\s+(\d+)/ ){ $capacity=$1; #print "Capacity $capacity\n"; } } } $common->addMemories({ CAPACITY => $capacity, CAPTION => "Ext $subnumslot Slot $numslot" , DESCRIPTION => "Part Number $description", NUMSLOTS => "1" , SERIALNUMBER => $serialnumber, TYPE => $type, }); $ok=0; $capacity=0; }; #print "Serial $serialnumber\n\n"; }; }; } } 1; UnixAgent-2.4.2/lib/Ocsinventory/Agent/Backend/OS/HPUX/Networks.pm000066400000000000000000000051061332737732100245470ustar00rootroot00000000000000package Ocsinventory::Agent::Backend::OS::HPUX::Networks; sub check { my $params = shift; my $common = $params->{common}; $common->can_load("Net::IP qw(:PROC)"); } sub run { my $params = shift; my $common = $params->{common}; my $name; my $lanid; my $ipmask; my $ipgateway; my $status; my $macaddr; my $speed; my $type; my $ipsubnet; my $description; my $ipaddress; my $binip; my $binmask; my $binsubnet; for ( `lanscan -iap`) { # Reinit variable $name=""; $lanid=""; $ipmask=""; $ipgateway=""; $status=""; $macaddr=""; $speed=""; $type=""; $ipsubnet=""; $description=""; $ipaddress=""; if ( /^(\S+)\s(\S+)\s(\S+)\s+(\S+)/) { $name=$2; $macaddr=$1; $lanid=$4; #print "name $name macaddr $macaddr lanid $lanid\n"; for ( `lanadmin -g $lanid` ) { if (/Type.+=\s(.+)/) { $type = $1; }; if (/Description\s+=\s(.+)/) { $description = $1; }; if (/Speed.+=\s(\d+)/) { $speed = $1; unless ( $speed <= 1000000 ) { # in old version speed was given in Mbps # we want speed in Mbps $speed = $1/1000000; } }; if (/Operation Status.+=\s(.+)/) { $status = $1; }; }; # for lanadmin #print "name $name macaddr $macaddr lanid $lanid speed $speed status $status \n"; for ( `ifconfig $name 2> /dev/null` ) { if ( /inet\s(\S+)\snetmask\s(\S+)\s/ ) { $ipaddress=$1; $ipmask=$2; if ($ipmask =~ /(..)(..)(..)(..)/) { $ipmask=sprintf ("%i.%i.%i.%i",hex($1),hex($2),hex($3),hex($4)); } }; }; # For ifconfig $binip = ip_iptobin ($ipaddress ,4); $binmask = ip_iptobin ($ipmask ,4); $binsubnet = $binip & $binmask; $ipsubnet = ip_bintoip($binsubnet,4); $common->addNetworks({ DESCRIPTION => $description, IPADDRESS => $ipaddress, IPGATEWAY => $ipgateway, IPMASK => $ipmask, IPSUBNET => $ipsubnet, MACADDR => $macaddr, STATUS => $status, SPEED => $speed, TYPE => $type, }); }; # If }; # For lanscan } 1; UnixAgent-2.4.2/lib/Ocsinventory/Agent/Backend/OS/HPUX/README000066400000000000000000000030671332737732100232610ustar00rootroot00000000000000##################################################### # 17/12/2009 # Auteur: dwizz.donowin@yahoo.fr # # This code is open source and may be copied and modified as long as the source # code is always made freely available. # Please refer to the General Public Licence http://www.gnu.org/ or Licence.txt # ################################################################################ Version Francaise ----------------- (for english version see below) Ces fichiers sont generes pour etre utilisis avec l'agent Unix OCS-NG 1.02 Installation: Installer le client OCS-NG 1.02 avec ces prerequis extraire les fichiers dans le repertoire Ocsinventory/Agent/Backend/OS Ils seront automatiquement pris en compte par le client OCS Je n'ai pu tester ces fichiers que sur N4000 actuellement en version HP-UX 11.0 J'ai commence sur un rp3440 mais je n'ai pas encore toutes les informations car le format des certaines donnees change. N'hesitez pas a m'aider a le faire evoluer. English version --------------- This files are producted for using with the OCS-NG 1.02 Unix Agent Install: Install the OCS-NG 1.02 Agent with the prerequesit Extract the files in the Ocsinventory/Agent/Backend/OS It will be used automatically I have test the script on only n4000 system for th moment on HP-Ux 11.0 I try it on rp3440 but some informations are not in the same format If you wish to help me, you are welwome. the files are HPUX.pm HPUX sub directory Bios.pm CPU.pm Controller.pm Domains.pm Drives.pm IPv4.pm Mem.pm Memory.pm Networks.pm Slots.pm Software.pm Storages.pm UnixAgent-2.4.2/lib/Ocsinventory/Agent/Backend/OS/HPUX/Slots.pm000066400000000000000000000015251332737732100240400ustar00rootroot00000000000000package Ocsinventory::Agent::Backend::OS::HPUX::Slots; use strict; sub check { $^O =~ /hpux/ } sub run { my $params = shift; my $common = $params->{common}; my $name; my $interface; my $info; my $type; my @typeScaned=('ioa','ba'); my $scaned; for (@typeScaned ) { $scaned=$_; for ( `ioscan -kFC $scaned| cut -d ':' -f 9,11,17,18` ) { if ( /(\S+):(\S+):(\S+):(.+)/ ) { $name=$2; $interface=$3; $info=$4; $type=$1; $common->addSlots({ DESCRIPTION => "$name", DESIGNATION => "$interface $info", NAME => "$type", STATUS => "OK", }); }; }; }; } 1; UnixAgent-2.4.2/lib/Ocsinventory/Agent/Backend/OS/HPUX/Software.pm000066400000000000000000000014361332737732100245270ustar00rootroot00000000000000package Ocsinventory::Agent::Backend::OS::HPUX::Software; sub check { my $params = shift; # Do not run an package inventory if there is the --nosoftware parameter return if ($params->{params}->{nosoftware}); $^O =~ /hpux/ } sub run { my $params = shift; my $common = $params->{common}; my @softList; my $software; @softList = `swlist | grep -v '^ PH' | grep -v '^#' |tr -s "\t" " "|tr -s " "` ; foreach $software (@softList) { chomp( $software ); if ( $software =~ /^ (\S+)\s(\S+)\s(.+)/ ) { $common->addSoftwares({ 'NAME' => $1 , 'VERSION' => $2 , 'COMMENTS' => $3 , 'PUBLISHER' => "HP" , }); } } } 1; UnixAgent-2.4.2/lib/Ocsinventory/Agent/Backend/OS/HPUX/Storages.pm000066400000000000000000000054511332737732100245250ustar00rootroot00000000000000package Ocsinventory::Agent::Backend::OS::HPUX::Storages; sub check { $^O =~ /hpux/ } sub run { my $params = shift; my $common = $params->{common}; my @all_type = ("tape","disk") ; my $type; my $description; my $path; my $vendor; my $ref; my $size; my $devdsk; my $devrdsk; my $revlvl; my $alternate; for ( @all_type ) { $type = "$_"; for ( `ioscan -kFnC $type | cut -d ':' -f 1,11,18` ) { if ( /(\S+)\:(\S+)\:(\S+)\s+(\S+)/ ) { $description = $1; $path = $2; $vendor = $3; $ref = $4; }; $alternate = 0 ; if ( $type eq "disk" ) { if ( /\s+(\/dev\/dsk\/\S+)\s+(\/dev\/rdsk\/\S+)/ ) { #print "1 $1 2 $2 \n"; $devdsk=$1; $devrdsk=$2; # We look if we are on an alternate link for ( `pvdisplay $devdsk 2> /dev/null` ) { if ( /$devdsk\.+lternate/ ) { $alternate=1; }; }; # We are not on an alternate link if ( $alternate eq 0 ) { #$size = `diskinfo -b $devrdsk`; for ( `diskinfo -v $devrdsk`) { if ( /^\s+size:\s+(\S+)/ ) { $size=$1; $size = int ( $size/1024 ) if $size; }; if ( /^\s+rev level:\s+(\S+)/ ) { $revlvl=$1; }; }; #print "vendor $vendor ref $ref type $type description $description path $path size $size\n"; $common->addStorages({ MANUFACTURER => $vendor, MODEL => $ref, NAME => $devdsk, DESCRIPTION => $description, TYPE => $type, DISKSIZE => $size, FIRMWARE => $revlvl, }); }; }; } else { # We look for tapes if ( /^\s+(\/dev\/rmt\/\Sm)\s+/ ) { $devdsk=$1; $common->addStorages({ MANUFACTURER => $vendor, MODEL => $ref, NAME => $devdsk, DESCRIPTION => $description, TYPE => $type, DISKSIZE => '' }); }; }; }; }; } 1; UnixAgent-2.4.2/lib/Ocsinventory/Agent/Backend/OS/Linux.pm000066400000000000000000000015371332737732100232520ustar00rootroot00000000000000package Ocsinventory::Agent::Backend::OS::Linux; use strict; use vars qw($runAfter); $runAfter = ["Ocsinventory::Agent::Backend::OS::Generic"]; sub check { $^O =~ /^linux$/ } sub run { my $params = shift; my $common = $params->{common}; chomp (my $osversion = `uname -r`); my $lastloggeduser; my $datelastlog; my @query = $common->runcmd("last -R"); foreach ($query[0]) { if ( s/^(\S+)\s+\S+\s+(\S+\s+\S+\s+\S+\s+\S+)\s+.*// ) { $lastloggeduser = $1; $datelastlog = $2; } } # This will probably be overwritten by a Linux::Distro module. $common->setHardware({ OSNAME => "Linux", OSCOMMENTS => "Unknown Linux distribution", OSVERSION => $osversion, LASTLOGGEDUSER => $lastloggeduser, DATELASTLOGGEDUSER => $datelastlog }); } 1; UnixAgent-2.4.2/lib/Ocsinventory/Agent/Backend/OS/Linux/000077500000000000000000000000001332737732100227065ustar00rootroot00000000000000UnixAgent-2.4.2/lib/Ocsinventory/Agent/Backend/OS/Linux/Archs/000077500000000000000000000000001332737732100237465ustar00rootroot00000000000000UnixAgent-2.4.2/lib/Ocsinventory/Agent/Backend/OS/Linux/Archs/ARM.pm000066400000000000000000000002561332737732100247260ustar00rootroot00000000000000package Ocsinventory::Agent::Backend::OS::Linux::Archs::ARM; use strict; use Config; sub check { return 1 if $Config{'archname'} =~ /^arm/; 0; }; sub run{} 1; UnixAgent-2.4.2/lib/Ocsinventory/Agent/Backend/OS/Linux/Archs/ARM/000077500000000000000000000000001332737732100243655ustar00rootroot00000000000000UnixAgent-2.4.2/lib/Ocsinventory/Agent/Backend/OS/Linux/Archs/ARM/CPU.pm000066400000000000000000000013031332737732100253470ustar00rootroot00000000000000package Ocsinventory::Agent::Backend::OS::Linux::Archs::ARM::CPU; use strict; sub check { my $params = shift; my $common = $params->{common}; $common->can_read("/proc/cpuinfo") } sub run { my $params = shift; my $common = $params->{common}; my @cpu; my $current; open CPUINFO, ") { print; if (/^Processor\s+:\s*:/) { if ($current) { $common->addCPU($current); } $current = { CPUARCH => 'ARM', }; } $current->{TYPE} = $1 if /Processor\s+:\s+(\S.*)/; } # The last one $common->addCPU($current); } 1; UnixAgent-2.4.2/lib/Ocsinventory/Agent/Backend/OS/Linux/Archs/Alpha.pm000066400000000000000000000002621332737732100253310ustar00rootroot00000000000000package Ocsinventory::Agent::Backend::OS::Linux::Archs::Alpha; use strict; use Config; sub check { return 1 if $Config{'archname'} =~ /^alpha/; 0; }; sub run{} 1; UnixAgent-2.4.2/lib/Ocsinventory/Agent/Backend/OS/Linux/Archs/Alpha/000077500000000000000000000000001332737732100247735ustar00rootroot00000000000000UnixAgent-2.4.2/lib/Ocsinventory/Agent/Backend/OS/Linux/Archs/Alpha/CPU.pm000066400000000000000000000015641332737732100257660ustar00rootroot00000000000000package Ocsinventory::Agent::Backend::OS::Linux::Archs::Alpha::CPU; use strict; sub check { my $params = shift; my $common = $params->{common}; $common->can_read("/proc/cpuinfo") } sub run { my $params = shift; my $common = $params->{common}; my @cpu; my $current; open CPUINFO, ") { print; if (/^cpu\s*:/) { if ($current) { $common->addCPU($current); } $current = { CPUARCH => 'Alpha', }; } else { $current->{SERIAL} = $1 if /^cpu serial number\s+:\s+(\S.*)/; $current->{SPEED} = $1 if /cycle frequency \[Hz\]\s+:\s+(\d+)000000/; $current->{TYPE} = $1 if /platform string\s+:\s+(\S.*)/; } } # The last one $common->addCPU($current); } 1; UnixAgent-2.4.2/lib/Ocsinventory/Agent/Backend/OS/Linux/Archs/MIPS.pm000066400000000000000000000002601332737732100250520ustar00rootroot00000000000000package Ocsinventory::Agent::Backend::OS::Linux::Archs::MIPS; use strict; use Config; sub check { return 1 if $Config{'archname'} =~ /^mips/; 0; }; sub run{} 1; UnixAgent-2.4.2/lib/Ocsinventory/Agent/Backend/OS/Linux/Archs/MIPS/000077500000000000000000000000001332737732100245165ustar00rootroot00000000000000UnixAgent-2.4.2/lib/Ocsinventory/Agent/Backend/OS/Linux/Archs/MIPS/CPU.pm000066400000000000000000000013071332737732100255040ustar00rootroot00000000000000package Ocsinventory::Agent::Backend::OS::Linux::Archs::MIPS::CPU; use strict; sub check { my $params = shift; my $common = $params->{common}; $common->can_read("/proc/cpuinfo") } sub run { my $params = shift; my $common = $params->{common}; my @cpu; my $current; open CPUINFO, ") { print; if (/^system type\s+:\s*:/) { if ($current) { $common->addCPU($current); } $current = { CPUARCH => 'MIPS', }; } $current->{TYPE} = $1 if /cpu model\s+:\s+(\S.*)/; } # The last one $common->addCPU($current); } 1; UnixAgent-2.4.2/lib/Ocsinventory/Agent/Backend/OS/Linux/Archs/PowerPC.pm000066400000000000000000000002741332737732100256260ustar00rootroot00000000000000package Ocsinventory::Agent::Backend::OS::Linux::Archs::PowerPC; use strict; use Config; sub check { return 1 if $Config{'archname'} =~ /^(ppc|powerpc)/; 0; }; sub run{} 1; UnixAgent-2.4.2/lib/Ocsinventory/Agent/Backend/OS/Linux/Archs/PowerPC/000077500000000000000000000000001332737732100252655ustar00rootroot00000000000000UnixAgent-2.4.2/lib/Ocsinventory/Agent/Backend/OS/Linux/Archs/PowerPC/CPU.pm000066400000000000000000000024471332737732100262610ustar00rootroot00000000000000package Ocsinventory::Agent::Backend::OS::Linux::Archs::PowerPC::CPU; use strict; #processor : 0 #cpu : POWER4+ (gq) #clock : 1452.000000MHz #revision : 2.1 # #processor : 1 #cpu : POWER4+ (gq) #clock : 1452.000000MHz #revision : 2.1 # #timebase : 181495202 #machine : CHRP IBM,7029-6C3 # # sub check { my $params = shift; my $common = $params->{common}; $common->can_read ("/proc/cpuinfo") } sub run { my $params = shift; my $common = $params->{common}; my @cpus; my $current; my $isIBM; open CPUINFO, ") { $isIBM = 1 if /^machine\s*:.*IBM/; $current->{TYPE} = $1 if /cpu\s+:\s+(\S.*)/; $current->{SPEED} = $1 if /clock\s+:\s+(\S.*)/; $current->{SPEED} =~ s/\.[0-9]+MHz//; if (/^\s*$/) { if ($current->{TYPE}) { push @cpus, $current; } $current = {}; } } if (/^\s*$/) { if ($current->{TYPE}) { push @cpus, $current; } $current = {}; } foreach my $cpu (@cpus) { $cpu->{MANUFACTURER} = 'IBM' if $isIBM; $cpu->{CPUARCH} = 'PowerPC'; $common->addCPU($cpu); } } 1; UnixAgent-2.4.2/lib/Ocsinventory/Agent/Backend/OS/Linux/Archs/PowerPC/Various.pm000066400000000000000000000031741332737732100272600ustar00rootroot00000000000000package Ocsinventory::Agent::Backend::OS::Linux::Archs::PowerPC::Various; use strict; sub check { 1 }; sub run { my $params = shift; my $common = $params->{common}; ############ Motherboard my $SystemManufacturer; my $SystemModel; my $SystemSerial; my $BiosManufacturer; my $BiosVersion; my $BiosDate; if (open SERIAL,"; $SystemSerial =~ s/[^\,^\.^\w^\ ]//g; # I remove some unprintable char close SERIAL; } if (open MODEL,"; $SystemModel =~ s/[^\,^\.^\w^\ ]//g; close MODEL; } if (open COLOR,"; close COLOR; my ($color) = unpack "h7" , $tmp; $SystemModel = $SystemModel." color: $color" if $color; } if (open OPENBOOT,"; $BiosVersion =~ s/[^\,^\.^\w^\ ]//g; close OPENBOOT; } if (open COPYRIGHT,"; close COPYRIGHT; if ($tmp =~ /Apple/) { # What about the Apple clone? $BiosManufacturer = "Apple Computer, Inc."; $SystemManufacturer = "Apple Computer, Inc." } } $common->setBios ({ SMANUFACTURER => $SystemManufacturer, SMODEL => $SystemModel, SSN => $SystemSerial, BMANUFACTURER => $BiosManufacturer, BVERSION => $BiosVersion, BDATE => $BiosDate, }); } 1; UnixAgent-2.4.2/lib/Ocsinventory/Agent/Backend/OS/Linux/Archs/SPARC.pm000066400000000000000000000002621332737732100251540ustar00rootroot00000000000000package Ocsinventory::Agent::Backend::OS::Linux::Archs::SPARC; use strict; use Config; sub check { return 1 if $Config{'archname'} =~ /^sparc/; 0; }; sub run{} 1; UnixAgent-2.4.2/lib/Ocsinventory/Agent/Backend/OS/Linux/Archs/SPARC/000077500000000000000000000000001332737732100246165ustar00rootroot00000000000000UnixAgent-2.4.2/lib/Ocsinventory/Agent/Backend/OS/Linux/Archs/SPARC/CPU.pm000066400000000000000000000011211332737732100255760ustar00rootroot00000000000000package Ocsinventory::Agent::Backend::OS::Linux::Archs::SPARC::CPU; use strict; sub check { my $params = shift; my $common = $params->{common}; $common->can_read ("/proc/cpuinfo") } sub run { my $params = shift; my $common = $params->{common}; my @cpu; my $current = { CPUARCH => 'ARM' }; my $ncpus = 1; open CPUINFO, ") { $current->{TYPE} = $1 if /cpu\s+:\s+(\S.*)/; $ncpus = $1 if /ncpus probed\s+:\s+(\d+)/ } foreach (1..$ncpus) { $common->addCPU($current); } } 1 UnixAgent-2.4.2/lib/Ocsinventory/Agent/Backend/OS/Linux/Archs/i386.pm000066400000000000000000000002701332737732100247740ustar00rootroot00000000000000package Ocsinventory::Agent::Backend::OS::Linux::Archs::i386; use strict; use Config; sub check { return 1 if $Config{'archname'} =~ /^(i\d86|x86_64)/; 0; }; sub run{} 1; UnixAgent-2.4.2/lib/Ocsinventory/Agent/Backend/OS/Linux/Archs/i386/000077500000000000000000000000001332737732100244375ustar00rootroot00000000000000UnixAgent-2.4.2/lib/Ocsinventory/Agent/Backend/OS/Linux/Archs/i386/CPU.pm000066400000000000000000000115721332737732100254320ustar00rootroot00000000000000package Ocsinventory::Agent::Backend::OS::Linux::Archs::i386::CPU; use strict; use Config; sub check { my $params = shift; my $common = $params->{common}; $common->can_read("/proc/cpuinfo") } sub run { open(my $fh, '<:encoding(UTF-8)', "/proc/cpuinfo") or warn; my @cpuinfo = <$fh>; close($fh); my $params = shift; my $common = $params->{common}; my @dmidecode = `dmidecode -t processor`; my $fake_physid = 1; my $processors; my $processor; my $vendor_id; my $modelName; my $cacheSize; my $mhz; my $physical_id; my $siblings; my $core_id; my $cpuCores; my $arch; my $addressWidth; my $dataWidth; my $voltage; my $serial; my $maxMhz; my $socket; my $sockettype; my $status; $processor = $vendor_id = $modelName = $cacheSize = $mhz = $physical_id = $siblings = $core_id = $cpuCores = $arch = $dataWidth = $addressWidth = $voltage = $serial = $maxMhz = $socket = $status = $sockettype = ""; # get data from /proc/cpuinfo foreach my $line (@cpuinfo) { chomp $line; if ($line =~ /^\s*$/) { # empty line, dump what we know $physical_id = $fake_physid if ( $physical_id eq ""); $processors->{$physical_id}->{MANUFACTURER} = $vendor_id; $processors->{$physical_id}->{TYPE} = $modelName; $processors->{$physical_id}->{CURRENT_SPEED} = $mhz; $processors->{$physical_id}->{L2CACHESIZE} = $cacheSize; $processors->{$physical_id}->{CORES} = $cpuCores ? $cpuCores : 1; $processors->{$physical_id}->{LOGICAL_CPUS} = $siblings ? $siblings : $processors->{$physical_id}->{CORES}; $processors->{$physical_id}->{CPUARCH} = $arch; $processors->{$physical_id}->{DATA_WIDTH} = $dataWidth; $processors->{$physical_id}->{CURRENT_ADDRESS_WIDTH} = $addressWidth; $processor = $vendor_id = $modelName = $cacheSize = $mhz = $physical_id = $siblings = $core_id = $cpuCores = $arch = $dataWidth = $addressWidth = $voltage = $sockettype = ""; } $processor = $1 if($line =~ /processor\s*:\s*(\S.*)/i); $vendor_id = $2 if($line =~ /^vendor_id\s*:\s*(Authentic|Genuine|)(.+)/i); $vendor_id =~ s/(TMx86|TransmetaCPU)/Transmeta/; $vendor_id =~ s/CyrixInstead/Cyrix/; $vendor_id =~ s/CentaurHauls/VIA/; $modelName = $1 if($line =~ /model\sname\s*:\s*(\S.*)/i); if($line =~ /cpu\sMHz\s*:\s*(\S.*)/i) { $mhz = $1; $mhz = sprintf "%i", $mhz; } if($line =~ /cache\ssize\s*:\s*(\S.*)/i) { $cacheSize = $1; $cacheSize =~ s/\D+//; } $physical_id = $1 if($line =~ /physical\sid\s*:\s*(\S.*)/i); $siblings = $1 if($line =~ /siblings\s*:\s*(\S.*)/i); $core_id = $1 if($line =~ /core\sid\s*:\s*(\S.*)/i); $cpuCores = $1 if($line =~ /cpu\scores\s*:\s*(\S.*)/i); if($line =~ /address\ssizes\s*:\s*(\S.*)/i) { $addressWidth = $1; $addressWidth =~ /(\d+)\s+bits\s*physical,\s*(\d+)\s*bits\s*virtual/; $addressWidth = $2 ? $2 : ( $1 ? $1 : '' ); } if($line =~ /flags/) { if($line =~ /lm/) { $arch = "x86_64"; $dataWidth = 64; } else { $arch = "x86"; $dataWidth = 32; } } } $socket = -1; foreach my $line (@dmidecode) { chomp $line; $socket++ if($line =~ /^Handle/); # handle opens a new processor in dmidecode output next if $socket < 0; # if in preface still if($line =~ /^\s*$/ ) { # end of processor/socket found if ( $status ne "Unpopulated") { if ($socket >= 0) { $processors->{$socket}->{VOLTAGE} = $voltage; $processors->{$socket}->{SPEED} = $maxMhz; $processors->{$socket}->{SERIALNUMBER} = $serial; $processors->{$socket}->{SOCKET} = $sockettype; } # dmidecode tells about more CPUs than /proc/cpuinfo } $voltage = $maxMhz = $status = $serial = $sockettype = ""; } $voltage = $1 if ($line =~ /Voltage:\s*(\S.*)/i); $maxMhz = $1 if($line =~ /Current\sSpeed:\s*(\d+)/i); $status = $1 if($line =~ /Status:\s*(\S.*)/i); $serial = $1 if($line =~ /serial\sNumber:\s*(\S.*)/i); if($line =~ /Upgrade:\s*(\S.*)/i) { $sockettype = $1 unless ( $1 =~ /Unknown|Other/i ); } } foreach (keys %{$processors} ) { $common->addCPU($processors->{$_}); } } 1 UnixAgent-2.4.2/lib/Ocsinventory/Agent/Backend/OS/Linux/Archs/m68k.pm000066400000000000000000000002561332737732100250740ustar00rootroot00000000000000package Ocsinventory::Agent::Backend::OS::Linux::Archs::m68k; use strict; use Config; sub check { return 1 if $Config{'archname'} =~ /^m68k/; 0; }; sub run{} 1; UnixAgent-2.4.2/lib/Ocsinventory/Agent/Backend/OS/Linux/Archs/m68k/000077500000000000000000000000001332737732100245335ustar00rootroot00000000000000UnixAgent-2.4.2/lib/Ocsinventory/Agent/Backend/OS/Linux/Archs/m68k/CPU.pm000066400000000000000000000014121332737732100255160ustar00rootroot00000000000000package Ocsinventory::Agent::Backend::OS::Linux::Archs::m68k::CPU; use strict; sub check { my $params = shift; my $common = $params->{common}; $common->can_read("/proc/cpuinfo") } sub run { my $params = shift; my $common = $params->{common}; my @cpu; my $current; open CPUINFO, ") { print; if (/^CPU\s+:\s*:/) { if ($current) { $common->addCPU($current); } $current = { CPUARCH => 'm68k', }; } else { $current->{TYPE} = $1 if /CPU:\s+(\S.*)/; $current->{SPEED} = $1 if /Clocking:\s+:\s+(\S.*)/; } } # The last one $common->addCPU($current); } 1; UnixAgent-2.4.2/lib/Ocsinventory/Agent/Backend/OS/Linux/Archs/s390x.pm000066400000000000000000000002611332737732100251710ustar00rootroot00000000000000package Ocsinventory::Agent::Backend::OS::Linux::Archs::s390x; use strict; use Config; sub check { return 1 if $Config{'archname'} =~ /^s390/; 0; }; sub run{} 1; UnixAgent-2.4.2/lib/Ocsinventory/Agent/Backend/OS/Linux/Archs/s390x/000077500000000000000000000000001332737732100246345ustar00rootroot00000000000000UnixAgent-2.4.2/lib/Ocsinventory/Agent/Backend/OS/Linux/Archs/s390x/CPU.pm000066400000000000000000000014351332737732100256240ustar00rootroot00000000000000package Ocsinventory::Agent::Backend::OS::Linux::Archs::s390x::CPU; use strict; sub check { my $params = shift; my $common = $params->{common}; $common->can_read("/proc/cpuinfo") } sub run { my $params = shift; my $common = $params->{common}; my $current; my $cpucores; open CPUINFO, ") { print; if (/^vendor\s*:/) { if ($current) { $common->addCPU($current); } } elsif (/^processor [0-9]:\s+(\S.*)/) { $cpucores++; } $current->{MANUFACTURER} = $1 if /vendor_id\s*:\s+(\S.*)/; $current->{SPEED} = $1 if /bogomips per cpu:\s+(\S.*)/; } $current->{CORES} = $cpucores; $common->addCPU($current); } 1; UnixAgent-2.4.2/lib/Ocsinventory/Agent/Backend/OS/Linux/Distro/000077500000000000000000000000001332737732100241525ustar00rootroot00000000000000UnixAgent-2.4.2/lib/Ocsinventory/Agent/Backend/OS/Linux/Distro/LSB.pm000066400000000000000000000010571332737732100251330ustar00rootroot00000000000000package Ocsinventory::Agent::Backend::OS::Linux::Distro::LSB; sub check { my $params = shift; my $common = $params->{common}; $common->can_run("lsb_release") } sub run { my $params = shift; my $common = $params->{common}; my $release; chomp($release =`lsb_release -is`); my $OSversion; chomp($OSversion =`lsb_release -rs`); my $OSComment; chomp($OSComment =`uname -v`); $common->setHardware({ OSNAME => $release, OSVERSION => $OSversion, OSCOMMENTS => "$OSComment" }); } 1; UnixAgent-2.4.2/lib/Ocsinventory/Agent/Backend/OS/Linux/Distro/NonLSB.pm000066400000000000000000000002341332737732100256020ustar00rootroot00000000000000package Ocsinventory::Agent::Backend::OS::Linux::Distro::NonLSB; $runMeIfTheseChecksFailed = ["Ocsinventory::Agent::Backend::OS::Linux::Distro::LSB"]; 1; UnixAgent-2.4.2/lib/Ocsinventory/Agent/Backend/OS/Linux/Distro/NonLSB/000077500000000000000000000000001332737732100252455ustar00rootroot00000000000000UnixAgent-2.4.2/lib/Ocsinventory/Agent/Backend/OS/Linux/Distro/NonLSB/ArchLinux.pm000066400000000000000000000007651332737732100275100ustar00rootroot00000000000000package Ocsinventory::Agent::Backend::OS::Linux::Distro::NonLSB::ArchLinux; use strict; sub check {-f "/etc/arch-release"} ##### sub findRelease { my $v; open V, "); close V; return "ArchLinux $v"; } sub run { my $params = shift; my $common = $params->{common}; my $OSComment; chomp($OSComment =`uname -v`); $common->setHardware({ OSNAME => findRelease(), OSCOMMENTS => "$OSComment" }); } 1; UnixAgent-2.4.2/lib/Ocsinventory/Agent/Backend/OS/Linux/Distro/NonLSB/CentOS.pm000066400000000000000000000011021332737732100267300ustar00rootroot00000000000000package Ocsinventory::Agent::Backend::OS::Linux::Distro::NonLSB::CentOS; use strict; sub check { -f "/etc/centos-release" && !readlink ("/etc/centos-release") && !-f "/etc/vmware-release" } #### sub findRelease { my $v; open V, "); close V; $v; } sub run { my $params = shift; my $common = $params->{common}; my $OSComment; chomp($OSComment =`uname -v`); $common->setHardware({ OSNAME => findRelease(), OSCOMMENTS => "$OSComment" }); } 1; UnixAgent-2.4.2/lib/Ocsinventory/Agent/Backend/OS/Linux/Distro/NonLSB/Debian.pm000066400000000000000000000010411332737732100267610ustar00rootroot00000000000000package Ocsinventory::Agent::Backend::OS::Linux::Distro::NonLSB::Debian; use strict; sub check {-f "/etc/debian_version" && !-f "/etc/ubuntu_version"} ##### sub findRelease { my $v; open V, "); close V; return "Debian GNU/Linux $v"; } sub run { my $params = shift; my $common = $params->{common}; my $OSComment; chomp($OSComment =`uname -v`); $common->setHardware({ OSNAME => findRelease(), OSCOMMENTS => "$OSComment" }); } 1; UnixAgent-2.4.2/lib/Ocsinventory/Agent/Backend/OS/Linux/Distro/NonLSB/Fedora.pm000066400000000000000000000007521332737732100270070ustar00rootroot00000000000000package Ocsinventory::Agent::Backend::OS::Linux::Distro::NonLSB::Fedora; use strict; sub check {-f "/etc/fedora-release"} ##### sub findRelease { my $v; open V, "); close V; $v; } sub run { my $params = shift; my $common = $params->{common}; my $OSComment; chomp($OSComment =`uname -v`); $common->setHardware({ OSNAME => findRelease(), OSCOMMENTS => "$OSComment" }); } 1; UnixAgent-2.4.2/lib/Ocsinventory/Agent/Backend/OS/Linux/Distro/NonLSB/Gentoo.pm000066400000000000000000000010001332737732100270250ustar00rootroot00000000000000package Ocsinventory::Agent::Backend::OS::Linux::Distro::NonLSB::Gentoo; use strict; sub check {-f "/etc/gentoo-release"} ##### sub findRelease { my $v; open V, "); close V; return "Gentoo Linux $v"; } sub run { my $params = shift; my $common = $params->{common}; my $OSComment; chomp($OSComment =`uname -v`); $common->setHardware({ OSNAME => findRelease(), OSCOMMENTS => "$OSComment" }); } 1; UnixAgent-2.4.2/lib/Ocsinventory/Agent/Backend/OS/Linux/Distro/NonLSB/Knoppix.pm000066400000000000000000000010331332737732100272300ustar00rootroot00000000000000package Ocsinventory::Agent::Backend::OS::Linux::Distro::NonLSB::Knoppix; use strict; sub check {-f "/etc/knoppix_version"} ##### sub findRelease { my $v; open V, "); close V; print $v."\n"; return "Knoppix GNU/Linux $v"; } sub run { my $params = shift; my $common = $params->{common}; my $OSComment; chomp($OSComment =`uname -v`); $common->setHardware({ OSNAME => findRelease(), OSCOMMENTS => "$OSComment" }); } 1; UnixAgent-2.4.2/lib/Ocsinventory/Agent/Backend/OS/Linux/Distro/NonLSB/Mandrake.pm000066400000000000000000000010131332737732100273200ustar00rootroot00000000000000package Ocsinventory::Agent::Backend::OS::Linux::Distro::NonLSB::Mandrake; use strict; sub check {-f "/etc/mandrake-release" && !-f "/etc/mandriva-release"} ##### sub findRelease { my $v; open V, "); close V; $v; } sub run { my $params = shift; my $common = $params->{common}; my $OSComment; chomp($OSComment =`uname -v`); $common->setHardware({ OSNAME => findRelease(), OSCOMMENTS => "$OSComment" }); } 1; UnixAgent-2.4.2/lib/Ocsinventory/Agent/Backend/OS/Linux/Distro/NonLSB/Mandriva.pm000066400000000000000000000010431332737732100273420ustar00rootroot00000000000000package Ocsinventory::Agent::Backend::OS::Linux::Distro::NonLSB::Mandriva; use strict; sub check {-f "/etc/mandrake-release" && -f "/etc/mandriva-release"} ##### sub findRelease { my $v; open V, "); close V; return $v if $v; 0; } sub run { my $params = shift; my $common = $params->{common}; my $OSComment; chomp($OSComment =`uname -v`); $common->setHardware({ OSNAME => findRelease(), OSCOMMENTS => "$OSComment" }); } 1; UnixAgent-2.4.2/lib/Ocsinventory/Agent/Backend/OS/Linux/Distro/NonLSB/Oracle.pm000066400000000000000000000007731332737732100270170ustar00rootroot00000000000000package Ocsinventory::Agent::Backend::OS::Linux::Distro::NonLSB::oracle; use strict; sub check {-f "/etc/oracle-release"} ##### sub findRelease { my $v; open V, "); close V; return $v if $v; 0; } sub run { my $params = shift; my $common = $params->{common}; my $OSComment; chomp($OSComment =`uname -v`); $common->setHardware({ OSNAME => findRelease(), OSCOMMENTS => "$OSComment" }); } 1; UnixAgent-2.4.2/lib/Ocsinventory/Agent/Backend/OS/Linux/Distro/NonLSB/Redhat.pm000066400000000000000000000011041332737732100270060ustar00rootroot00000000000000package Ocsinventory::Agent::Backend::OS::Linux::Distro::NonLSB::Redhat; use strict; sub check { -f "/etc/redhat-release" && !readlink ("/etc/redhat-release") && !-f "/etc/vmware-release" } #### sub findRelease { my $v; open V, "); close V; $v; } sub run { my $params = shift; my $common = $params->{common}; my $OSComment; chomp($OSComment =`uname -v`); $common->setHardware({ OSNAME => findRelease(), OSCOMMENTS => "$OSComment" }); } 1; UnixAgent-2.4.2/lib/Ocsinventory/Agent/Backend/OS/Linux/Distro/NonLSB/Slackware.pm000066400000000000000000000011411332737732100275140ustar00rootroot00000000000000package Ocsinventory::Agent::Backend::OS::Linux::Distro::NonLSB::Slackware; use strict; sub check {-f "/etc/slackware-version"} ##### sub findRelease { my $v; open V, "); foreach (){ $v=$1 if (/Slackware ([\d.]+)/); close V; return $v; } } sub run { my $params = shift; my $common = $params->{common}; my $OSComment; chomp($OSComment =`uname -v`); $common->setHardware({ OSNAME => "Slackware", OSVERSION => findRelease(), OSCOMMENTS => "$OSComment" }); } 1; UnixAgent-2.4.2/lib/Ocsinventory/Agent/Backend/OS/Linux/Distro/NonLSB/SuSE.pm000066400000000000000000000010711332737732100264210ustar00rootroot00000000000000package Ocsinventory::Agent::Backend::OS::Linux::Distro::NonLSB::SuSE; use strict; sub check { my $params = shift; my $common = $params->{common}; $common->can_read ("/etc/SuSE-release") } ##### sub findRelease { my $v; open V, "); close V; $v; } sub run { my $params = shift; my $common = $params->{common}; my $OSComment; chomp($OSComment =`uname -v`); $common->setHardware({ OSNAME => findRelease(), OSCOMMENTS => "$OSComment" }); } 1; UnixAgent-2.4.2/lib/Ocsinventory/Agent/Backend/OS/Linux/Distro/NonLSB/Trustix.pm000066400000000000000000000007551332737732100272740ustar00rootroot00000000000000package Ocsinventory::Agent::Backend::OS::Linux::Distro::NonLSB::Trustix; use strict; sub check {-f "/etc/trustix-release"} ##### sub findRelease { my $v; open V, "); close V; $v; } sub run { my $params = shift; my $common = $params->{common}; my $OSComment; chomp($OSComment =`uname -v`); $common->setHardware({ OSNAME => findRelease(), OSCOMMENTS => "$OSComment" }); } 1; UnixAgent-2.4.2/lib/Ocsinventory/Agent/Backend/OS/Linux/Distro/NonLSB/Ubuntu.pm000066400000000000000000000011441332737732100270650ustar00rootroot00000000000000package Ocsinventory::Agent::Backend::OS::Linux::Distro::NonLSB::Ubuntu; use strict; use vars qw($runAfter); $runAfter = ["Ocsinventory::Agent::Backend::OS::Linux::Distro::NonLSB::Debian"]; sub check {-f "/etc/ubuntu_version"} ##### sub findRelease { my $v; open V, "); close V; return "Ubuntu $v"; } sub run { my $params = shift; my $common = $params->{common}; my $OSComment; chomp($OSComment =`uname -v`); $common->setHardware({ OSNAME => findRelease(), OSCOMMENTS => "$OSComment" }); } 1; UnixAgent-2.4.2/lib/Ocsinventory/Agent/Backend/OS/Linux/Distro/NonLSB/VmWare.pm000066400000000000000000000007521332737732100270100ustar00rootroot00000000000000package Ocsinventory::Agent::Backend::OS::Linux::Distro::NonLSB::VmWare; use strict; sub check { -f "/etc/vmware-release" } #### sub findRelease { my $v; open V, "); close V; $v; } sub run { my $params = shift; my $common = $params->{common}; my $OSComment; chomp($OSComment =`uname -v`); $common->setHardware({ OSNAME => findRelease(), OSCOMMENTS => "$OSComment" }); } 1; UnixAgent-2.4.2/lib/Ocsinventory/Agent/Backend/OS/Linux/Domains.pm000066400000000000000000000017771332737732100246520ustar00rootroot00000000000000package Ocsinventory::Agent::Backend::OS::Linux::Domains; use strict; sub check { my $params = shift; my $common = $params->{common}; return unless $common->can_run ("hostname"); my @domain = `hostname -d`; return 1 if @domain || $common->can_read ("/etc/resolv.conf"); 0; } sub run { my $params = shift; my $common = $params->{common}; my $domain; my %domain; my @dns_list; my $dns; chomp($domain = `hostname -d`); open RESOLV, "/etc/resolv.conf" or warn; while (){ if (/^nameserver\s+(\S+)/i) { push(@dns_list,$1); } elsif (!$domain) { $domain{$2} = 1 if (/^(domain|search)\s+(.+)/); } } close RESOLV; if (!$domain) { $domain = join "/", keys %domain; } $dns=join("/",@dns_list); # If no domain name, we send "WORKGROUP" $domain = 'WORKGROUP' unless $domain; $common->setHardware({ WORKGROUP => $domain, DNS => $dns }); } 1; UnixAgent-2.4.2/lib/Ocsinventory/Agent/Backend/OS/Linux/Drives.pm000066400000000000000000000116371332737732100245100ustar00rootroot00000000000000package Ocsinventory::Agent::Backend::OS::Linux::Drives; use strict; sub check { my $params = shift; my $common = $params->{common}; return unless $common->can_run ("df"); my $df = `df -TP`; return 1 if $df =~ /\w+/; 0 } sub run { my $params = shift; my $common = $params->{common}; my %months = ( Jan => 1, Fev => 2, Mar => 3, Apr => 4, May => 5, Jun => 6, Jul => 7, Aug => 8, Sep => 9, Oct => 10, Nov => 11, Dec => 12, ); my %listVolume = (); # Get complementary information in hash tab if ($common->can_run ("lshal")) { my %temp; my $in = 0; my $value; foreach my $line (`lshal`) { chomp $line; if ( $line =~ s{^udi = '/org/freedesktop/Hal/devices/volume.*}{}) { $in = 1; %temp = (); } elsif ($in == 1 and $line =~ s{^\s+(\S+) = (.*) \s*\((int|string|bool|string list|uint64)\)}{} ) { if ($3 ne 'int' and $3 ne 'uint64') { chomp($value = $2); if ($3 eq 'string') { chop($value); #$value =~ s/^'?(.*)'?$/$1/g; $value=substr($value,1,length($value)); $value=substr($value,0,length($value)-1); } $temp{$1} = $value; } else { $temp{$1} = (split(/\W/,$2))[0]; } } elsif ($in== 1 and $line eq '') { $in = 0 ; $listVolume{$temp{'block.device'}} = {%temp}; } } } foreach(`df -TP`) { # TODO retrieve error my $createdate; my $free; my $filesystem; my $label; my $total; my $type; my $volumn; my $serial; if (/^(\S+)\s+(\S+)\s+(\S+)\s+(?:\S+)\s+(\S+)\s+(?:\S+)\s+(\S+)\n/){ $free = sprintf("%i",($4/1024)); $filesystem = $2; $total = sprintf("%i",($3/1024)); $type = $5; $volumn = $1; # no virtual FS next if ($filesystem =~ /^(tmpfs|usbfs|proc|devpts|devshm|udev)$/); next if ($type =~ /^(tmpfs)$/); if ($filesystem =~ /^ext(2|3|4|4dev)/ && $common->can_run('dumpe2fs')) { foreach (`dumpe2fs -h $volumn 2> /dev/null`) { if (/Filesystem UUID:\s+(\S+)/) { $serial = $1; } elsif (/Filesystem created:\s+\w+ (\w+) (\d+) ([\d:]+) (\d{4})$/) { $createdate = $4.'/'.$months{$1}.'/'.$2.' '.$3; } elsif (/Filesystem volume name:\s*(\S.*)/) { $label = $1 unless $1 eq ''; } } } elsif ($filesystem =~ /^xfs$/ && $common->can_run('xfs_db')) { foreach (`xfs_db -r -c uuid $volumn`) { $serial = $1 if /^UUID =\s+(\S+)/; ; } foreach (`xfs_db -r -c label $volumn`) { $label = $1 if /^label =\s+"(\S+)"/; } } elsif ($filesystem =~ /^vfat$/ && $common->can_run('dosfslabel')) { chomp ($label = `dosfslabel $volumn`); } $label =~ s/\s+$//; $serial =~ s/\s+$//; # Check information and improve it if (keys %listVolume) { if ( defined $listVolume{$volumn} ) { if ($filesystem eq '') { $filesystem = $listVolume{$volumn}->{'volume.fstype'};} if ($label eq '') { $label = $listVolume{$volumn}->{'volume.label'};} if ($total eq '') { $total = int($listVolume{$volumn}->{'volume.size'}/(1024*1024) + 0.5);} if ($type eq '') { $type = $listVolume{$volumn}->{'storage.model'};} if ($serial eq '') { $serial = $listVolume{$volumn}->{'volume.uuid'};} delete ($listVolume{$volumn}); } } $common->addDrive({ CREATEDATE => $createdate, FREE => $free, FILESYSTEM => $filesystem, LABEL => $label, TOTAL => $total, TYPE => $type, VOLUMN => $volumn, SERIAL => $serial }); } } if ($common->can_run ("lshal")) { while (my ($k,$v) = each %listVolume ) { $common->addDrive({ FILESYSTEM => $v->{'volume.fstype'}, LABEL => $v->{'volume.label'}, TOTAL => int ($v->{'volume.size'}/(1024*1024) + 0.5), TYPE => $v->{'storage.model'}, VOLUMN => $k, SERIAL => $v->{'volume.uuid'} }); } } } 1; UnixAgent-2.4.2/lib/Ocsinventory/Agent/Backend/OS/Linux/Inputs.pm000066400000000000000000000026451332737732100245350ustar00rootroot00000000000000package Ocsinventory::Agent::Backend::OS::Linux::Inputs; use strict; use warnings; sub run { my $params = shift; my $common = $params->{common}; my $logger = $params->{logger}; my $in; my $vendor; my $phys; my $name; my $type; if (open INPUTS, ") { if (/^I: Bus=.*Vendor=(.*) Prod/){ $in=1; $vendor=$1; } elsif ($_ =~ /^$/) { $in=0; if ($phys && $phys =~ "input"){ $common->addInput({ DESCRIPTION=>$name, CAPTION=>$name, TYPE=>$type }); } } elsif ($in) { if (/^P: Phys=.*(button).*/i) { $phys="nodev"; } elsif (/^P: Phys=.*(input).*/i) { $phys="input"; } if (/^N: Name=\"(.*)\"/i){ $name=$1; } if (/^H: Handlers=(\w+)/i) { if ($1 =~ ".*kbd.*") { $type="Keyboard"; } elsif ($1 =~ ".*mouse.*") { $type="Pointing"; } else { $type=$1; } } } } close INPUTS; } } 1; UnixAgent-2.4.2/lib/Ocsinventory/Agent/Backend/OS/Linux/LVM.pm000066400000000000000000000042621332737732100237060ustar00rootroot00000000000000package Ocsinventory::Agent::Backend::OS::Linux::LVM; use strict; use vars qw($runAfter); $runAfter = ["Ocsinventory::Agent::Backend::OS::Linux::Drives"]; sub check { my $params = shift; my $common = $params->{common}; return unless $common->can_run ("pvs"); 1 } sub run { my $params = shift; my $common = $params->{common}; use constant MB => (1024*1024); if ($common->can_run('pvs')) { foreach (`pvs --noheading --nosuffix --units b -o +pv_uuid`) { chomp; $_ =~s/^\s+//; my @vs_elem=split('\s+'); my $status='VG: '.$vs_elem[1].', Fmt: '.$vs_elem[2].', Attr: '.$vs_elem[3]; $common->addDrive({ FREE => $vs_elem[5]/MB, FILESYSTEM => 'LVM PV', TOTAL => $vs_elem[4]/MB, TYPE => $vs_elem[0], VOLUMN => $status, SERIAL => $vs_elem[6] }); } } if ($common->can_run('vgs')) { foreach (`vgs --noheading --nosuffix --units b -o +vg_uuid,vg_extent_size`) { chomp; $_ =~s/^\s+//; my @vs_elem=split('\s+'); my $status = 'PV/LV: '.$vs_elem[1].'/'.$vs_elem[2] .', Attr: '.$vs_elem[4].', PE: '.($vs_elem[8]/MB).' MB'; $common->addDrive({ FREE => $vs_elem[6]/MB, FILESYSTEM => 'LVM VG', TOTAL => $vs_elem[5]/MB, TYPE => $vs_elem[0], VOLUMN => $status, SERIAL => $vs_elem[7] }); } } if ($common->can_run('lvs')) { foreach (`lvs -a --noheading --nosuffix --units b -o lv_name,vg_name,lv_attr,lv_size,lv_uuid,seg_count`) { chomp; $_ =~s/^\s+//; my @vs_elem=split('\s+'); my $status='Attr: '.$vs_elem[2].', Seg: '.$vs_elem[5]; $common->addDrive({ FREE => 0, FILESYSTEM => 'LVM LV', TOTAL => $vs_elem[3]/MB, TYPE => $vs_elem[1].'/'.$vs_elem[0], VOLUMN => $status, SERIAL => $vs_elem[4] }); } } } 1; UnixAgent-2.4.2/lib/Ocsinventory/Agent/Backend/OS/Linux/Mem.pm000066400000000000000000000012561332737732100237660ustar00rootroot00000000000000package Ocsinventory::Agent::Backend::OS::Linux::Mem; use strict; sub check { my $params = shift; my $common = $params->{common}; $common->can_read ("/proc/meminfo") } sub run { my $params = shift; my $common = $params->{common}; my $unit = 1024; my $PhysicalMemory; my $SwapFileSize; # Memory informations open MEMINFO, "/proc/meminfo"; while(){ $PhysicalMemory=$1 if /^memtotal\s*:\s*(\S+)/i; $SwapFileSize=$1 if /^swaptotal\s*:\s*(\S+)/i; } # TODO $common->setHardware({ MEMORY => sprintf("%i",$PhysicalMemory/$unit), SWAP => sprintf("%i", $SwapFileSize/$unit), }); } 1; UnixAgent-2.4.2/lib/Ocsinventory/Agent/Backend/OS/Linux/Network/000077500000000000000000000000001332737732100243375ustar00rootroot00000000000000UnixAgent-2.4.2/lib/Ocsinventory/Agent/Backend/OS/Linux/Network/IP.pm000066400000000000000000000020541332737732100252060ustar00rootroot00000000000000package Ocsinventory::Agent::Backend::OS::Linux::Network::IP; sub check { my $params = shift; my $common = $params->{common}; return unless $common->can_run ("ip") || $common->can_run("ifconfig"); 1; } # Initialise the distro entry sub run { my $params = shift; my $common = $params->{common}; my @ip; if ($common->can_run("ip")){ foreach (`ip a`){ if (/inet (\S+)\/\d{1,2}/){ ($1=~/127.+/)?next:push @ip,$1; } elsif (/inet6 (\S+)\d{2}/){ ($1=~/::1\/128/)?next:push @ip, $1; } } } elsif ($common->can_run("ifconfig")){ foreach (`ifconfig`){ #if(/^\s*inet\s*(\S+)\s*netmask/){ if (/^\s*inet add?r\s*:\s*(\S+)/ || /^\s*inet\s+(\S+)/){ ($1=~/127.+/)?next:push @ip, $1; } elsif (/^\s*inet6\s+(\S+)/){ ($1=~/::1/)?next:push @ip, $1; } } } my $ip=join "/", @ip; if (defined $ip) { $common->setHardware({IPADDR => $ip}); } } 1; UnixAgent-2.4.2/lib/Ocsinventory/Agent/Backend/OS/Linux/Network/Networks.pm000066400000000000000000000551301332737732100265150ustar00rootroot00000000000000package Ocsinventory::Agent::Backend::OS::Linux::Network::Networks; use strict; use warnings; use Data::Dumper; use File::stat; use Time::Local; sub check { my $params = shift; my $common = $params->{common}; if ($common->can_run("ip") && $common->can_load("Net::IP qw(:PROC)") || ($common->can_run("ifconfig") && $common->can_run("route")) && $common->can_load("Net::IP qw(:PROC)")){ return 1; } else { return 0; } } sub getLeaseFile { my $if = @_; my @directories = qw( /var/db /var/lib/dhclient /var/lib/dhcp3 /var/lib/dhcp /var/lib/NetworkManager ); my @patterns = ("*$if*.lease", "*.lease", "dhclient.leases.$if"); my @files; foreach my $directory (@directories) { next unless -d $directory; foreach my $pattern (@patterns) { push @files, grep { -s $_ } glob("$directory/$pattern"); } } return unless @files; @files = map {$_->[0]} sort {$a->[1]->ctime()<=>$b->[1]->ctime()} map {[$_,stat($_)]} @files; return $files[-1]; } sub _ipdhcp { my $if = shift; my $path; my $dhcp; my $ipdhcp; my $leasepath; if( $leasepath = getLeaseFile($if) ) { if (open DHCP, $leasepath) { my $lease; while(){ $lease = 1 if(/lease\s*{/i); $lease = 0 if(/^\s*}\s*$/); #Interface name if ($lease) { #inside a lease section if (/interface\s+"(.+?)"\s*/){ $dhcp = ($1 =~ /^$if$/); } #Server IP if (/option\s+dhcp-server-identifier\s+(\d{1,3}(?:\.\d{1,3}){3})\s*;/ and $dhcp){ $ipdhcp = $1; } } } close DHCP or warn; } else { warn "Can't open $leasepath\n"; } } return $ipdhcp; } # Initialise the distro entry sub run { my $params = shift; my $common = $params->{common}; my $logger = $params->{logger}; my $description; my $driver; my $ipaddress; my $ipgateway; my $ipmask; my $ipsubnet; my $ipaddress6; my $ipgateway6; my $ipmask6; my $ipsubnet6; my $macaddr; my $pcislot; my $status; my $type; my $virtualdev; my $settings; my $speed; my $current_speed; my $duplex; my $ssid; my $bssid; my $mode; my $version; my $bitrate; my $mtu; my @netsum; my $basedev; my $slave; my %gateway; if ($common->can_run("ip")){ my @netsum = `ip addr show`; push @netsum, "\n"; chomp @netsum; for (my $i=0;$i<=$#netsum;$i+=1) { my $line=$netsum[$i]; if ($line =~ /^(\d+(?) { $driver = $1 if /^DRIVER=(\S+)/; $pcislot = $1 if /^PCI_SLOT_NAME=(\S+)/; } close UEVENT; } # Retrieve speed from /sys/class/net/$description/speed $speed=getSpeed($description); # Retrieve duplex from /sys/class/net/$description/duplex $duplex=getDuplex($description); # Retrieve mtu from /sys/class/net/$description/mtu $mtu=getMTU($description); # Retrieve status from /sys/class/net/$description/status $status=getStatus($description); if (-d "/sys/class/net/$description/wireless"){ my @wifistatus = `iwconfig $description 2>/dev/null`; foreach my $line (@wifistatus){ $ssid = $1 if ($line =~ /ESSID:(\S+)/); $version = $1 if ($line =~ /IEEE (\S+)/); $mode = $1 if ($line =~ /Mode:(\S+)/); $bssid = $1 if ($line =~ /Access Point: (\S+)/); $bitrate = $1 if ($line =~ /Bit\sRate=\s*(\S+\sMb\/s)/i); } $type = "Wifi"; $status=1; } elsif (-f "/sys/class/net/$description/mode") { $type="infiniband"; } if (defined ($ipgateway)) { $common->setHardware({ DEFAULTGATEWAY => $ipgateway }); } elsif (defined ($ipgateway6)){ $common->setHardware({ DEFAULTGATEWAY => $ipgateway6 }); } # Virtual devices # Reliable way to get the info if (-d "/sys/devices/virtual/net/") { $virtualdev = (-d "/sys/devices/virtual/net/$description")?"1":"0"; } elsif ($common->can_run("brctl")) { # Let's guess my %bridge; foreach (`brctl show`) { next if /^bridge name/; $bridge{$1} = 1 if /^(\w+)\s/; } if ($pcislot) { $virtualdev = "1"; } elsif ($bridge{$description}) { $virtualdev = "0"; } $type = "bridge"; } # Check if this is dialup interface if ($description =~ m/^ppp$/) { $type="dialup"; $virtualdev=1; } # Check if this is an alias or tagged interface if ($description =~ m/^([\w\d]+)[:.]\d+$/) { $basedev=$1; $type="alias"; $virtualdev=1; } # Check if this is a bonding slave if (-d "/sys/class/net/$description/bonding"){ $slave=getslaves($description); $type="aggregate"; $virtualdev=1; } # Check if this is a vlan if (-f "/proc/net/vlan/$description"){ $type="vlan"; $virtualdev=1; } if ($description && $ipaddress) { if ($type eq "Wifi") { $common->addNetwork({ DESCRIPTION => $description, DRIVER => $driver, IPADDRESS => $ipaddress, IPDHCP => _ipdhcp($description), IPGATEWAY => $ipgateway, IPMASK => $ipmask, IPSUBNET => $ipsubnet, MACADDR => $macaddr, PCISLOT => $pcislot, STATUS => $status?"Up":"Down", TYPE => $type, SPEED => $bitrate, SSID => $ssid, BSSID => $bssid, IEEE => $version, MODE => $mode, }); } else { $common->addNetwork({ BASE => $basedev?$basedev : undef, DESCRIPTION => $description, DRIVER => $driver, IPADDRESS => $ipaddress, IPDHCP => _ipdhcp($description), IPGATEWAY => $ipgateway, IPMASK => $ipmask, IPSUBNET => $ipsubnet, MACADDR => $macaddr, PCISLOT => $pcislot, STATUS => $status?"Up":"Down", TYPE => $type, VIRTUALDEV => $virtualdev, DUPLEX => $duplex?"Full":"Half", SPEED => $speed, MTU => $mtu, SLAVE => $slave?$slave : undef, }); } } elsif ($description && $ipaddress6) { $common->addNetwork({ BASE => $basedev?$basedev : undef, DESCRIPTION => $description, DRIVER => $driver, IPADDRESS => $ipaddress6, IPDHCP => _ipdhcp($description), IPGATEWAY => $ipgateway6, IPMASK => $ipmask6, IPSUBNET => $ipsubnet6, MACADDR => $macaddr, PCISLOT => $pcislot, STATUS => $status?"Up":"Down", TYPE => $type, VIRTUALDEV => $virtualdev, DUPLEX => $duplex?"Full":"Half", SPEED => $speed, MTU => $mtu, SLAVE => $slave?$slave : undef, }); } else { $common->addNetwork({ DESCRIPTION => $description, DRIVER => $driver, MACADDR => $macaddr, PCISLOT => $pcislot, STATUS => $status?"Up":"Down", TYPE => $type, VIRTUALDEV => $virtualdev, DUPLEX => $duplex?"Full":"Half", SPEED => $speed, MTU => $mtu, }); } $description = $driver = $ipaddress = $ipgateway = $ipmask = $ipsubnet = $ipaddress6 = $ipgateway6 = $ipmask6 = $ipsubnet6 = $macaddr = $pcislot = $status = $type = $virtualdev = $speed = $duplex = $mtu = undef; } $description = $1 if ($line =~ /^\d+:\s+([^:@]+)/); # Interface name if ($description && $description eq "lo" ) { next; } # loopback interface is not inventoried if ($line =~ /inet ((?:\d{1,3}+\.){3}\d{1,3})\/(\d+)/i){ $ipaddress=$1; $ipmask=getIPNetmask($2); $ipsubnet=getSubnetAddressIPv4($ipaddress,$ipmask); $ipgateway=getIPRoute($ipaddress); } elsif ($line =~ /\s+link\/(\S+)/){ $type=$1; if ($type eq "ether"){ $type="ethernet"; } $macaddr=getMAC($description); } elsif ($line =~ /inet6 (\S+)\/(d{1,2})/i){ $ipaddress6=$1; $ipmask6=getIPNetmaskV6($2); $ipsubnet6=getSubnetAddressIPv6($ipaddress6,$ipmask6); $ipgateway6=getIPRoute($ipaddress6); } } } elsif ($common->can_run("ifconfig")){ foreach my $line (`ifconfig -a`) { if ($line =~ /^$/ && $description && $macaddr) { # end of interface section # I write the entry if (defined($ipgateway)){ $common->setHardware({ DEFAULTGATEWAY => $ipgateway }); } elsif (defined($ipgateway6)) { $common->setHardware({ DEFAULTGATEWAY => $ipgateway6 }); } if (-d "/sys/class/net/$description/wireless"){ my @wifistatus = `iwconfig $description`; foreach my $line (@wifistatus){ $ssid = $1 if ($line =~ /ESSID:(\S+)/); $version = $1 if ($line =~ /IEEE (\S+)/); $mode = $1 if ($line =~ /Mode:(\S+)/); $bssid = $1 if ($line =~ /Access Point: (\S+)/); $bitrate = $1 if ($line =~ /Bit\sRate=\s*(\S+\sMb\/s)/i); } $type = "Wifi"; } elsif (-f "/sys/class/net/$description/mode") { $type="infiniband"; } if (open UEVENT, ") { $driver = $1 if /^DRIVER=(\S+)/; $pcislot = $1 if /^PCI_SLOT_NAME=(\S+)/; } close UEVENT; } # Retrieve speed from /sys/class/net/$description/speed $speed=getSpeed($description); # Retrieve duplex from /sys/class/net/$description/duplex $duplex=getDuplex($description); # Virtual devices # Reliable way to get the info if (-d "/sys/devices/virtual/net/") { $virtualdev = (-d "/sys/devices/virtual/net/$description")?"1":"0"; } elsif ($common->can_run("brctl")) { # Let's guess my %bridge; foreach (`brctl show`) { next if /^bridge name/; $bridge{$1} = 1 if /^(\w+)\s/; } if ($pcislot) { $virtualdev = "1"; } elsif ($bridge{$description}) { $virtualdev = "0"; } $type = "bridge"; } # Check if this is dialup interface if ($description =~ m/^ppp$/) { $type="dialup"; $virtualdev=1; } # Check if this is an alias or tagged interface if ($description =~ m/^([\w\d]+)[:.]\d+$/) { $basedev=$1; $type="alias"; $virtualdev=1; } # Check if this is a bonding slave if (-d "/sys/class/net/$description/bonding"){ $slave=getslaves($description); $type="aggregate"; $virtualdev=1; } # Check if this is a vlan if (-f "/proc/net/vlan/$description"){ $type="vlan"; $virtualdev=1; } if ($description && $ipaddress) { if ($type eq "Wifi") { $common->addNetwork({ DESCRIPTION => $description, DRIVER => $driver, IPADDRESS => $ipaddress, IPDHCP => _ipdhcp($description), IPGATEWAY => $ipgateway, IPMASK => $ipmask, IPSUBNET => $ipsubnet, MACADDR => $macaddr, PCISLOT => $pcislot, STATUS => $status?"Up":"Down", TYPE => $type, SPEED => $bitrate, SSID => $ssid, BSSID => $bssid, IEEE => $version, MODE => $mode, }); } else { $common->addNetwork({ BASE => $basedev?$basedev : undef, DESCRIPTION => $description, DRIVER => $driver, IPADDRESS => $ipaddress, IPDHCP => _ipdhcp($description), IPGATEWAY => $ipgateway, IPMASK => $ipmask, IPSUBNET => $ipsubnet, MACADDR => $macaddr, PCISLOT => $pcislot, STATUS => $status?"Up":"Down", TYPE => $type, VIRTUALDEV => $virtualdev, DUPLEX => $duplex?"Full":"Half", SPEED => $speed, MTU => $mtu, SLAVE => $slave?$slave : undef, }); } } elsif ($description && $ipaddress6) { $common->addNetwork({ BASE => $basedev?$basedev : undef, DESCRIPTION => $description, DRIVER => $driver, IPADDRESS => $ipaddress6, IPDHCP => _ipdhcp($description), IPGATEWAY => $ipgateway6, IPMASK => $ipmask6, IPSUBNET => $ipsubnet6, MACADDR => $macaddr, PCISLOT => $pcislot, STATUS => $status?"Up":"Down", TYPE => $type, VIRTUALDEV => $virtualdev, DUPLEX => $duplex?"Full":"Half", SPEED => $speed, MTU => $mtu, SLAVE => $slave?$slave : undef, }); } } if ($line =~ /^$/) { # End of section $description = $driver = $ipaddress = $ipgateway = $ipmask = $ipsubnet = $macaddr = $pcislot = $status = $type = $virtualdev = $speed = $duplex = $mtu = undef; } else { # In a section if ($line =~ /^(\S+):/) { $description = $1; # Interface name if ($description && $description eq "lo" ) { next; } # loopback interface is not inventoried } if ($line =~ /inet add?r:(\S+)/i || $line =~ /^\s*inet\s+(\S+)/i || $line =~ /inet (\S+)\s+netmask/i){ $ipaddress=$1; $ipmask=getIPNetmask($ipaddress); $ipsubnet=getSubnetAddressIPv4($ipaddress,$ipmask); $ipgateway=getRouteIfconfig($ipaddress); } elsif ($line =~ /inet6 (\S+)\s+prefixlen\s+(\d{2})/i){ $ipaddress6=$1; $ipmask6=getIPNetmaskV6($ipaddress6); $ipsubnet6=getSubnetAddressIPv6($ipaddress6,$ipmask6); $ipgateway6=getRouteIfconfig($ipaddress6); } $macaddr = $1 if ($line =~ /hwadd?r\s+(\w{2}:\w{2}:\w{2}:\w{2}:\w{2}:\w{2})/i || $line =~ /ether\s+(\w{2}:\w{2}:\w{2}:\w{2}:\w{2}:\w{2})/i); $status = 1 if ($line =~ /^\s+UP\s/ || $line =~ /flags=.*[<,]UP[,>]/); $type = $1 if ($line =~ /link encap:(\S+)/i); $type = $2 if ($line =~ /^\s+(loop|ether).*\((\S+)\)/i); if ($type eq "ether" || $type eq "Ethernet") { $type="ethernet"; } # Retrieve mtu from /sys/class/net/$description/mtu $mtu=getMTU($description); } } } } sub getslaves{ my ($name)=@_; my @slaves= map{$_ =~/\/lowr_(\w+)$/} glob("/sys/class/net/$name/lower_*"); return join(",", @slaves); } sub getSpeed{ my ($prefix)=@_; my $speed; my $current_speed=0; return undef unless $prefix; if ( ! -z "/sys/class/net/$prefix/speed") { open SPEED, "){ $current_speed=$_; } close SPEED; chomp($current_speed); if ($current_speed eq "65535" || $current_speed eq ""){ $current_speed = "Unknown"; } if ($current_speed gt 100 ){ $speed = ($current_speed/1000)." Gbps"; } else { $speed = $current_speed." Mbps"; } } return $speed; } sub getDuplex{ my ($prefix)=@_; my $duplex; return undef unless $prefix; if (open DUPLEX, "){ $duplex=chomp($_); } close DUPLEX; } return $duplex; } sub getMTU { my ($prefix)=@_; my $mtu; return undef unless $prefix; if (open MTU, "){ chomp; $mtu=$_; } close MTU; } return $mtu; } sub getStatus { my ($prefix)=@_; my $status; return undef unless $prefix; if (open STATUS, "){ chomp; $status=$_; } close STATUS; } return $status; } sub getMAC { my ($prefix)=@_; my $mac; return undef unless $prefix; if (open MAC, "){ chomp; $mac=$_; } close MAC; } return $mac; } sub getSubnetAddressIPv4 { my ($address,$mask)=@_; return undef unless $address && $mask; my $binaddress=ip_iptobin($address, 4); my $binmask=ip_iptobin($mask, 4); my $binsubnet=$binaddress & $binmask; return ip_bintoip($binsubnet, 4); } sub getIPNetmask { my ($prefix) = @_; return undef unless $prefix; return ip_bintoip(ip_get_mask($prefix, 4), 4); } sub getSubnetAddressIPv6 { my ($address,$mask)=@_; return undef unless $address && $mask; my $binaddress = ip_iptobin($address, 6); my $binmask = ip_iptobin($mask, 6); my $binsubnet = $binaddress & $binmask; return ip_compress_address(ip_bintoip($binsubnet, 6),6); } sub getIPNetmaskV6 { my ($prefix) = @_; return undef unless $prefix; return ip_compress_address(ip_bintoip(ip_get_mask($prefix, 6), 6),6); } sub getIPRoute { my ($prefix) = @_; my $route; return undef unless $prefix; if (ip_is_ipv4($prefix)) { foreach my $line (`ip route`){ $route = $1 if $line =~ /^default via\s+(\S+)/; } } elsif (ip_is_ipv6($prefix)) { foreach my $line (`ip -6 route`){ next if $line =~ /^Unreachable/; $route = $1 if $line =~ /^(.*)\/.*/; } } return $route; } sub getRouteIfconfig { my ($prefix) = @_; my $route; return undef unless $prefix; if (ip_is_ipv4($prefix)) { foreach my $line (`route -n`){ next if $line =~ /^Default/; $route = $1 if $line =~ /^0.0.0.0\s+(\S+)/; } } elsif (ip_is_ipv6($prefix)) { foreach my $line (`route -6n`){ next if $line =~ /^2002/; $route = $1 if $line =~ /^(.*)\/.*/; } } return $route; } 1; UnixAgent-2.4.2/lib/Ocsinventory/Agent/Backend/OS/Linux/Sounds.pm000066400000000000000000000010101332737732100245070ustar00rootroot00000000000000package Ocsinventory::Agent::Backend::OS::Linux::Sounds; use strict; sub check { my $params = shift; my $common = $params->{common}; $common->can_run("lspci") } sub run { my $params = shift; my $common = $params->{common}; foreach(`lspci`){ if (/audio/i && /^\S+\s([^:]+):\s*(.+?)(?:\(([^()]+)\))?$/i){ $common->addSound({ 'DESCRIPTION' => $3, 'MANUFACTURER' => $2, 'NAME' => $1, }); } } } 1; UnixAgent-2.4.2/lib/Ocsinventory/Agent/Backend/OS/Linux/Storages.pm000066400000000000000000000532431332737732100250420ustar00rootroot00000000000000package Ocsinventory::Agent::Backend::OS::Linux::Storages; use strict; use XML::Simple; sub check { my $params = shift; my $common = $params->{common}; return unless ($common->can_run("lshw") || $common->can_run("lsscsi") || $common->can_run("lsblk") || $common->can_run("smartctl") || $common->can_run("multipath") || $common->can_run("udevinfo") || $common->can_run("udevadm") || $common->can_run("hdparm")); } ######## TODO # Do not remove, used by other modules sub getFromUdev { my @devs; foreach (glob ("/dev/.udev/db/*")) { my ($scsi_coid, $scsi_chid, $scsi_unid, $scsi_lun, $path, $device, $vendor, $model, $revision, $serial, $serial_short, $type, $bus, $capacity); if (/^(\/dev\/.udev\/db\/.*)([sh]d[a-z]+)$/) { $path = $1; $device = $2; open (PATH, $1 . $2); while () { if (/^S:.*-scsi-(\d+):(\d+):(\d+):(\d+)/) { $scsi_coid = $1; $scsi_chid = $2; $scsi_unid = $3; $scsi_lun = $4; } $vendor = $1 if /^E:ID_VENDOR=(.*)/; $model = $1 if /^E:ID_MODEL=(.*)/; $revision = $1 if /^E:ID_REVISION=(.*)/; $serial = $1 if /^E:ID_SERIAL=(.*)/; $serial_short = $1 if /^E:ID_SERIAL_SHORT=(.*)/; $type = $1 if /^E:ID_TYPE=(.*)/; $bus = $1 if /^E:ID_BUS=(.*)/; } $serial_short = $serial unless $serial_short =~ /\S/; $capacity = getCapacity($device); push (@devs, {NAME => $device, MANUFACTURER => $vendor, MODEL => $model, DESCRIPTION => $bus, TYPE => $type, DISKSIZE => $capacity, SERIALNUMBER => $serial_short, FIRMWARE => $revision, SCSI_COID => $scsi_coid, SCSI_CHID => $scsi_chid, SCSI_UNID => $scsi_unid, SCSI_LUN => $scsi_lun}); close (PATH); } } return @devs; } sub getFromSysProc { my($dev, $file) = @_; my $value; foreach ("/sys/block/$dev/device/$file", "/proc/ide/$dev/$file") { next unless open PATH, $_; chomp(my $value = ); $value =~ s/^(\w+)\W*/$1/; return $value; } } sub getCapacity { my ($dev) = @_; my $cap; chomp ($cap = `fdisk -s /dev/$dev 2>/dev/null`); #requires permissions on /dev/$dev $cap = int ($cap*1024) if $cap; return $cap; } sub getDescription { my ($name, $manufacturer, $description, $serialnumber) = @_; # detected as USB by udev # TODO maybe we should trust udev detection by default? return "USB" if (defined ($description) && $description =~ /usb/i); if ($name =~ /^s/) { # /dev/sd* are SCSI _OR_ SATA if ($manufacturer =~ /ATA/ || $serialnumber =~ /ATA/ || $description =~ /ATA/i) { return "SATA"; } else { return "SCSI"; } } else { return "IDE"; } } sub getManufacturer { my ($model) = @_; #if($model =~ /(maxtor|western|sony|compaq|hewlett packard|ibm|seagate|toshiba|fujitsu|lg|samsung|nec|transcend)/i) { # return ucfirst(lc($1)); if ($model =~ /^(IBM|LG|NEC$)/){ return $1; } elsif ($model =~ /(maxtor|western|sony|compaq|hewlett packard|ibm|seagate|toshiba|fujitsu|lg|samsung|nec$|transcend)/i) { $model = lc($1); $model = s/\b(\w)/\u$1/g; return $model; } elsif ($model =~ /^HP/) { return "Hewlett-Packard"; } elsif ($model =~ /^WD/) { return "Western Digital"; } elsif ($model =~ /^ST/) { return "Seagate"; } elsif ($model =~ /^(HD|IC|HU)/) { return "Hitachi"; } elsif ($model =~ /^NECVMWar/) { return "VMware"; } elsif ($model =~ /^VBOX/){ return "Virtual Box"; } else { return $model; } } sub getMultipathDisks { my @mpList = `multipath -l`; my @devs; my $volume; my $serial; my $dm; my $manufacturer; my $model; foreach my $line (@mpList) { if ($line =~ /^([\w\d]+)\s\((.*)\)\s(dm-\d+)\s(\w+)\s+,([\w\d\s]+)$/i) { $volume = $1; $serial = $2; $dm = $3; $manufacturer = $4; $model = $5; } if ($line =~ /size=(\d+)(\w+)\s/) { my $size = $1; my $unit = $2; # conversion to mebibyte my %conversion = ( "T" => 1000**4, "G" => 1000**3, "M" => 1000**2, "K" => 1000, ); if ($conversion{$unit}) { $size = $size / $conversion{$unit} * 2**20; } else { $size = $size." ".$unit; } push (@devs, {NAME=>$dm, DESCRIPTION=>$volume, TYPE=>"Multipath volume", MODEL=>$model, SERIALNUMBER=>$serial, MANUFACTURER=>$manufacturer}); } if ($line =~ /(sd[a-z]+)/i) { push (@devs, {NAME=>$1, DESCRIPTION=>"Child of $dm", TYPE=>"Multipath child"}); } } return @devs; } # some hdparm release generated kernel error if they are # run on CDROM device # http://forums.ocsinventory-ng.org/viewtopic.php?pid=20810 sub correctHdparmAvailable { my $hdparmVersion = `hdparm -V`; if ($hdparmVersion =~ /^hdparm v(\d+)\.(\d+)(\.|$)/) { return 1 if $1>9; return 1 if $1==9 && $2>=15; } return; } # get available md softraid devices sub getMdDevices { return unless ( open(my $fh, '<:encoding(UTF-8)', '/proc/mdstat') ); my @lines = <$fh>; close($fh); my $devName; my $raidLevel; my @devs; foreach (@lines) { chomp($_); if (/^(md\d*)\s*:\s*\w*\s*(raid\d)/) { $devName = $1; $raidLevel = $2; push (@devs, {NAME => $devName, MODEL => $raidLevel}); } } return @devs; } # get available block devices from /dev sub getFromDev { my @devs; my @disks; my $dir = "/dev"; opendir (my $dh, $dir) or die $!; @disks = grep{/^sd[a-z][a-z]?$|^vd[a-z][a-z]?$|^sr\d+$/} readdir($dh); foreach (@disks) { push (@devs, {NAME => $_}); } return @devs; } # get data from lshw sub getFromLshw { my @devs; my @inputlines = `lshw -class disk -xml -quiet`; return unless $inputlines[0] =~ /xml/i; my $foundcdroms = 0; my $input; foreach (@inputlines) { if ( /\/g) { # adding "" root element because $input =~ s/\?>/\?>\n/; # prior to version B.02.16, "lshw -class disk -xml" produces xml output $input .= "\n"; # without the "" root element, which does not parse correctly. } my $xml = new XML::Simple; my $data = $xml->XMLin($input); my $nodes = $data->{list}->{node}; foreach my $device (sort keys %$nodes) { my $description = ""; my $size = 0; my $sizeUnits = ""; my $name = "not set"; my $type = ""; my $vendor = ""; my $model = ""; my $serial = ""; my $revision = ""; if ($nodes->{$device}->{description}) { $description = $nodes->{$device}->{description}; } if ($nodes->{$device}->{size}) { my %units = ('bytes', 1, 'kilobytes', 10**3, 'megabytes', 10**6, 'gigabytes', 10**9, 'terabytes', 10**12); $sizeUnits = $nodes->{$device}->{size}->{units}; $size = $nodes->{$device}->{size}->{content}; $size = $size * $units{$sizeUnits}; $size = sprintf "%i", $size; } if ($nodes->{$device}->{logicalname}) { $name = $nodes->{$device}->{logicalname}; if (ref($name) eq 'ARRAY') { foreach (@{$name}) { if (!readlink $_) { $name = $_; last; } } } $name =~ s/\/dev\///; } if ($nodes->{$device}->{type}) { $type = $nodes->{$device}->{type}; } if ($nodes->{$device}->{vendor}) { $vendor = $nodes->{$device}->{vendor}; } if ($nodes->{$device}->{model}) { $model = $nodes->{$device}->{model}; } if ($nodes->{$device}->{serial}) { $serial = $nodes->{$device}->{serial}; } push (@devs, { NAME => $name, MANUFACTURER => getManufacturer($vendor), MODEL => $model, DESCRIPTION => $description, TYPE => $type, DISKSIZE => $size, SERIALNUMBER => $serial, FIRMWARE => $revision }); } return @devs; } # get data from lsscsi sub getFromLsscsi { my @devs; my ($id, $type, $vendor, $model, $rev, $device); foreach my $line (`lsscsi`) { ($id, $type, $vendor, $model, $rev, $device) = unpack ('a13a8a9a17a6a15', $line); $vendor =~ s/\s*$//; $type =~ s/\s*$//; $model =~ s/\s*$//; my @columns = split /\s+/, $line; my $deviceName = $columns[-1]; $deviceName =~ s/\/dev\///; #debug print Dumper {NAME => $deviceName, MANUFACTURER => $vendor, TYPE => $type, MODEL => $model}; if ($type =~ /cd\/dvd|disk/) { push (@devs, {NAME => $deviceName, MANUFACTURER => getManufacturer($vendor), TYPE => $type, MODEL => $model}); } } return @devs; } # get data from lsblk sub getFromLsblk { my @devs; foreach my $line (`lsblk -ldbn`) { my @columns = split /\s+/, $line; my $deviceName = $columns[0]; my $size = $columns[3]; my $type = $columns[5]; $size = "" if ($type =~ /rom/); push (@devs, {NAME => $deviceName, TYPE => $type, DISKSIZE => $size}); } return @devs; } # get data from smartctl sub getFromSmartctl { my ($params, $devices) = @_; my @devs; foreach my $device (keys %$devices) { my $vendor = ""; my $product = ""; my $revision = ""; my $size = ""; my $type = ""; my $serialnum = ""; my $description = ""; my $devName = $devices->{$device}->{NAME}; foreach my $line (`smartctl -i /dev/$devName`) { chomp($line); if ($line =~ m/Model Family:\s+(\S+.*)\s*$/i){ $vendor = $1; } elsif ($line =~ m/Vendor:\s+(\S+.*)\s*$/i) { $vendor = $1; } elsif ($line =~ m/Device Model:\s+(\S+.*)\s*$/i){ $product = $1; } elsif ($line =~ m/Product:\s+(\S+.*)\s*$/i) { $product = $1; } elsif ($line =~ m/Revision:\s+(\S+.*)\s*$/i) { $revision = $1; } elsif ($line =~ m/Firmware Version:\s+(\S+.*)\s*$/i) { $revision = $1; } elsif ($line =~ m/Serial Number:\s+(\S+.*)\s*$/i) { $serialnum = $1; } elsif ($line =~ m/User Capacity:\s+([\d\.,]+)\s+bytes/i) { $size = $1; $size =~ s/[\.,]//g; } elsif ($line =~ m/Device type:\s+(\S+.*)\s*$/i) { $type = $1; } elsif ($line =~ m/Model Family\s+(\S.*)\s*/i) { $description = $1; } } push (@devs, { NAME => $devName, MANUFACTURER => getManufacturer($vendor), MODEL => $product, FIRMWARE => $revision, TYPE => $type, DISKSIZE => $size, SERIALNUMBER => $serialnum, DESCRIPTION => $description }); } return @devs; } # get data from UDEV sub getFromuDev2 { my $params = shift; my $common = $params->{common}; my ($devices) = @_; my @input; my @devs; foreach my $device (keys %$devices) { my $type = ""; my $model = ""; my $vendor = ""; my $firmware = ""; my $serial = ""; my $serial_short = ""; my $serial_scsi = ""; my $serial_md = ""; my $devName = $devices->{$device}->{NAME}; if ($common->can_run("udevadm")) { @input = `udevadm info -q all -n /dev/$devName`; } else { @input = `udevinfo -q all -n /dev/$devName`; } foreach my $line (@input) { if ($line =~ m/ID_TYPE=(\S+.*)\s*$/){ $type = $1; } elsif ($line =~ m/ID_MODEL=(\S+.*)\s*$/) { $model = $1; $model =~ s/_/ /g; } elsif ($line =~ m/ID_VENDOR=(\S+.*)\s*$/) { $vendor = $1; } elsif ($line =~ m/ID_REVISION=(\S+.*)\s*$/) { $firmware = $1; } elsif ($line =~ m/ID_SERIAL_SHORT=(\S+.*)\s*$/) { $serial_short = $1; } elsif ($line =~ m/ID_SCSI_SERIAL=(\S+.*)\s*$/) { $serial_scsi = $1; } elsif ($line =~ m/ID_SERIAL=(\S+.*)\s*$/) { $serial = $1; } if ($line =~ m/MD_LEVEL=(\S+.*)\s*$/) { $model = $1; } elsif ($line =~ m/MD_METADATA=(\d\.?\d?)/) { $firmware = $1; $firmware = "MD METADATA ".$firmware; } elsif ($line =~ m/MD_UUID=(\S+.*)\s*$/) { $serial_md = $1; } } $serial = $serial_short unless $serial_short eq ""; # prefer serial_short over serial $serial = $serial_scsi unless $serial_scsi eq ""; $serial = $serial_md unless $serial_md eq ""; if ($devName =~ /md\d+/) { # if device is a multiple disk softraid $type = "MD"; $vendor = "Linux"; } push (@devs, { NAME => $devName, TYPE => $type, MODEL => $model, MANUFACTURER => getManufacturer($vendor), FIRMWARE => $firmware, SERIALNUMBER => $serial }); } return @devs; } sub run { my $params = shift; my $common = $params->{common}; my $logger = $params->{logger}; my $devices = {}; my ($serial,$cap,$unit,$model,$manufacturer,$type,$desc,$firmware,$name); my @partitions; # Get complementary information in hash tab if ($common->can_run ("lshal")) { my %temp; my $in = 0; my $value; foreach my $line (`lshal`) { chomp $line; if ($line =~ s{^udi = '/org/freedesktop/Hal/devices/storage.*}{}) { $in = 1; %temp = (); } elsif ($in == 1 and $line =~ s{^\s+(\S+) = (.*) \s*\((int|string|bool|string list|uint64)\)}{} ) { my $key = $1; my $value = $2; $value =~ s/^'(.*)'\s*$/$1/; # Drop the quote $value =~ s/\s+$//; # Drop the trailing white space if ($key eq 'storage.serial') { $temp{SERIALNUMBER} = $value; } elsif ($key eq 'storage.firmware_version') { $temp{FIRMWARE} = $value; } elsif ($key eq 'block.device') { $value =~ s/\/dev\/(\S+)/$1/; $temp{NAME} = $value; } elsif ($key eq 'info.vendor') { $temp{MANUFACTURER} = getManufacturer($value); } elsif ($key eq 'storage.model') { $temp{MODEL} = $value; } elsif ($key eq 'storage.drive_type') { $temp{TYPE} = $value; } elsif ($key eq 'storage.size') { $temp{DISKSIZE} = int($value/(1024*1024) + 0.5); } } elsif ($in== 1 and $line eq '' and $temp{NAME}) { $in = 0 ; $devices->{$temp{NAME}} = {%temp}; } } } foreach my $device (getMultipathDisks($params)) { my $name = $device->{NAME}; foreach my $f ("NAME", "MANUFACTURER", "MODEL", "SERIALNUMBER", "DESCRIPTION", "TYPE") { $devices->{$name}->{$f} = $device->{$f}; } } foreach my $device (getFromDev($params)) { my $name = $device->{NAME}; foreach my $f ("NAME") { if($devices->{$name}->{$f} eq "") { #debug print "getFromDev $name $f device->{\$f} $device->{$f}\n"; $devices->{$name}->{$f} = $device->{$f}; } } } foreach my $device (getMdDevices($params)) { my $name = $device->{NAME}; foreach my $f ("NAME", "MODEL") { if ($devices->{$name}->{$f} eq "") { $devices->{$name}->{$f} = $device->{$f}; } } } foreach my $device (getFromSmartctl($params,$devices)) { my $name = $device->{NAME}; foreach my $f ("NAME", "MANUFACTURER", "TYPE", "MODEL", "DISKSIZE", "FIRMWARE", "SERIALNUMBER", "DESCRIPTION") { if ($devices->{$name}->{$f} eq "") { #debug print "getFromSmartctl $name $f device->{\$f} $device->{$f}\n"; $devices->{$name}->{$f} = $device->{$f}; } } } foreach my $device (getFromuDev2($params,$devices)) { my $name = $device->{NAME}; foreach my $f ("NAME", "MANUFACTURER", "TYPE", "MODEL", "FIRMWARE", "SERIALNUMBER") { if ($devices->{$name}->{$f} eq "") { #debug print "getFromuDev2 $name $f device->{\$f} $device->{$f}\n"; $devices->{$name}->{$f} = $device->{$f}; } } } foreach my $device (getFromLshw($params)) { my $name = $device->{NAME}; foreach my $f ("NAME", "MANUFACTURER", "MODEL", "DESCRIPTION", "TYPE", "DISKSIZE", "SERIALNUMBER", "FIRMWARE") { if ($devices->{$name}->{$f} eq "") { #debug print "getFromLshw $name $f device->{\$f} $device->{$f}\n"; $devices->{$name}->{$f} = $device->{$f}; } } } foreach my $device (getFromLsblk($params)) { my $name = $device->{NAME}; foreach my $f ("NAME", "DISKSIZE", "TYPE") { if ($devices->{$name}->{$f} eq "") { #debug print "getFromLsblk $name $f device->{\$f} $device->{$f}\n"; $devices->{$name}->{$f} = $device->{$f}; } } } foreach my $device (getFromUdev($params)) { my $name = $device->{NAME}; foreach my $f ("NAME", "MANUFACTURER", "MODEL", "DESCRIPTION", "TYPE", "DISKSIZE", "SERIALNUMBER", "FIRMWARE", "SCSI_COID", "SCSI_CHID", "SCSI_UNID", "SCSI_LUN") { if ($devices->{$name}->{$f} eq "") { #debug print "getFromuDev $name $f device->{\$f} $device->{$f}\n"; $devices->{$name}->{$f} = $device->{$f}; } } } foreach my $device (getFromLsscsi($params)) { my $name = $device->{NAME}; foreach my $f ("NAME", "MANUFACTURER", "TYPE", "MODEL") { if ($devices->{$name}->{$f} eq "") { #debug print "getFromLsscsi $name $f device->{\$f} $device->{$f}\n"; $devices->{$name}->{$f} = $device->{$f}; } } } my $logical_drive = undef; if ($common->can_run ('arcconf') ) { my ($cur_cont,$info,$key,$dev,$controller); $controller = Ocsinventory::Agent::Backend::OS::Linux::Storages::Adaptec::parse_config(); foreach $cur_cont (keys %{$controller}){ #travers Controller $info = $controller->{$cur_cont}; foreach $key (keys %{$info}){ #travers Infos of Controller if ($key=~m/logical drive/) { $logical_drive= $info->{$key}; } } } } foreach my $device (sort (keys %$devices)) { if ($devices->{$device}->{TYPE} =~ /(CD)|(CD\/DVD)|(DVD)|(BD)/i) { $devices->{$device}->{DISKSIZE} = "0000"; } elsif ($devices->{$device}->{DISKSIZE}) { $devices->{$device}->{DISKSIZE} = $devices->{$device}->{DISKSIZE} * 10**-6; # we need MB for the view } if (!$devices->{$device}->{DESCRIPTION}) { $devices->{$device}->{DESCRIPTION} = getFromSysProc($device,"description"); } if (!$devices->{$device}->{MANUFACTURER} or $devices->{$device}->{MANUFACTURER} eq 'ATA'or $devices->{$device}->{MANUFACTURER} eq '') { $devices->{$device}->{MANUFACTURER} = getManufacturer($devices->{$device}->{MODEL}); } if (!$devices->{$device}->{DISKSIZE} && $devices->{$device}->{TYPE} =~ /disk/) { $devices->{$device}->{DISKSIZE} = getCapacity($devices->{$device}->{NAME})*10**-6; } #if ($devices->{$device}->{CAPACITY} =~ /^cdrom$/) { # $devices->{$device}->{CAPACITY} = getCapacity($devices->{$device}->{NAME})*10**-6; #} if ($devices->{$device}->{MANUFACTURER}=~m/Adaptec/) {#check if found devices are Logical Devices foreach my $devkey (keys %{$logical_drive}) { if($devices->{$device}->{MODEL} =~m/$logical_drive->{$devkey}->{'Logical device name'}/) { #Correct infos $devices->{$device}->{TYPE}="Logical Drive"; $devices->{$device}->{DISKSIZE} = $logical_drive->{$devkey}->{'Size'}; } } } $common->addStorages($devices->{$device}); } } 1; UnixAgent-2.4.2/lib/Ocsinventory/Agent/Backend/OS/Linux/Storages/000077500000000000000000000000001332737732100244755ustar00rootroot00000000000000UnixAgent-2.4.2/lib/Ocsinventory/Agent/Backend/OS/Linux/Storages/3ware.pm000066400000000000000000000144051332737732100260600ustar00rootroot00000000000000package Ocsinventory::Agent::Backend::OS::Linux::Storages::3ware; use Ocsinventory::Agent::Backend::OS::Linux::Storages; # Tested on 2.6.* kernels # # Cards tested : # # 8006-2LP # 9500S-4LP # 9550SXU-4LP # 9550SXU-8LP # 9650SE-2LP # 9650SE-4LPML # 9650SE-8LPML # # AMCC/3ware CLI (version 2.00.0X.XXX) use strict; sub check { my $params = shift; my $common = $params->{common}; my ($card, $res); # Do we have tw_cli ? if ($common->can_run("tw_cli")) { foreach (`tw_cli info`) { $card = $1 if /^(c\d+).*/; if ($card) { $res = `tw_cli info $card numdrives`; $card = undef; $res =~ s/^.*=\s(\d+)/$1/; # Do we have drives on the card ? ($res == 0)?return 0:return 1; } } } } sub run { my $params = shift; my $common = $params->{common}; my $logger = $params->{logger}; my ($tw_cli, $hd); my ($card, $card_model, $unit, $unit_id, $port, $serialnumber, $serial, $model, $capacity, $firmware, $description, $media, $device, $manufacturer, $sn); my @devices = Ocsinventory::Agent::Backend::OS::Linux::Storages::getFromUdev(); # First, getting the cards : c0, c1... etc. foreach (`tw_cli info`) { # Should output something like this : # # Ctl Model Ports Drives Units NotOpt RRate VRate BBU # ------------------------------------------------------------------------ # c0 9650SE-2LP 2 2 1 0 1 1 - if (/^(c\d)+\s+([\w|-]+)/) { $card = $1; $card_model = $2; $logger->debug("Card : $card - Model : $card_model"); } if ($card) { # Second, getting the units : u0, u1... etc. foreach (`tw_cli info $card`) { # Example output : # # Unit UnitType Status %RCmpl %V/I/M Stripe Size(GB) Cache AVrfy # ------------------------------------------------------------------------------ # u0 RAID-1 OK - - - 65.1826 ON OFF # # Port Status Unit Size Blocks Serial # --------------------------------------------------------------- # p0 OK u0 69.25 GB 145226112 WD-WMANS1648590 # p1 OK u0 69.25 GB 145226112 WD-WMANS1344790 if (/^(u)(\d+).*/) { $unit = $1 . $2; $unit_id = $2; } if ($unit) { # Try do get unit's serial in order to compare it to what was found in udev db. # Works only on newer cards. # Allow us to associate a node to a drive : sda -> WD-WMANS1648590 $sn = `tw_cli info $card $unit serial 2> /dev/null`; $sn =~ s/^.*serial number\s=\s(\w*)\s*/$1/; # Third, getting the ports : p0, p1... etc. foreach(`tw_cli info $card $unit`) { $port = $1 if /^.*(p\d+).*/; if ($port) { # Finally, getting drives' values. foreach (`tw_cli info $card $port model serial capacity firmware`) { # Example output : # # /c0/p0 Model = WDC WD740ADFD-00NLR4 # /c0/p0 Serial = WD-WMANS1648590 # /c0/p0 Capacity = 69.25 GB (145226112 Blocks) # /c0/p0 Firmware Version = 21.07QR4 $model = $1 if /^.*Model\s=\s(.*)/; $serialnumber = $1 if /^.*Serial\s=\s(.*)/; $capacity = 1024*$1 if /^.*Capacity\s=\s(\S+)\sGB.*/; $firmware = $1 if /^.*Firmware Version\s=\s(.*)/; } foreach $hd (@devices) { # How does this work with multiple older cards where serial for units is not implemented ? # Need to be tested on a system with multiple 3ware cards. if (($hd->{SERIALNUMBER} eq 'AMCC_' . $sn) or ($hd->{MODEL} eq 'Logical_Disk_' . $unit_id)) { $device = $hd->{NAME}; } } # Getting description from card model, very basic and unreliable # Assuming only IDE drives can be plugged in 5xxx/6xxx cards and # SATA drives only to 7xxx/8xxx/9xxxx cards $description = undef; foreach ($card_model) { $description = "IDE" if /^[5-6].*/; $description = "SATA" if /^[7-9].*/; } $media = 'disk'; $manufacturer = Ocsinventory::Agent::Backend::OS::Linux::Storages::getManufacturer($model); $port = undef; $logger->debug("3ware: $device, $manufacturer, $model, $description, $media, $capacity, $serialnumber, $firmware"); $common->addStorages({ NAME => $device, MANUFACTURER => $manufacturer, MODEL => $model, DESCRIPTION => $description, TYPE => $media, DISKSIZE => $capacity, SERIALNUMBER => $serialnumber, FIRMWARE => $firmware, }); } $port = undef; } $unit = undef; } } $card = undef; $card_model = undef; } } } 1; UnixAgent-2.4.2/lib/Ocsinventory/Agent/Backend/OS/Linux/Storages/Adaptec.pm000066400000000000000000000261101332737732100263740ustar00rootroot00000000000000package Ocsinventory::Agent::Backend::OS::Linux::Storages::Adaptec; use Ocsinventory::Agent::Backend::OS::Linux::Storages; #Function parse_config and parse_config_fh are taken from https://github.com/kumy/Parse-Arcconf # #LICENSE AND COPYRIGHT # #Copyright (C) 2012 Mathieu Alorent # #This program is free software; you can redistribute it and/or modify it #under the terms of either: the GNU General Public License as published #by the Free Software Foundation; or the Artistic License. # #See http://dev.perl.org/licenses/ for more information. # Tested on 2.6.* kernels # # Cards tested : # # Adaptec AAC-RAID use strict; my @devices = Ocsinventory::Agent::Backend::OS::Linux::Storages::getFromUdev(); sub check { my $params = shift; my $common = $params->{common}; #Do we have arcconf if ($common->can_run ('arcconf') ) { my $conf = `arcconf GETCONFIG 1`; if($conf =~ /Controllers found: (\d+)/) { if($1>0) { return 1; } } } #Do we have smartctl if ($common->can_run ('smartctl') ) { foreach my $hd (@devices) { $hd->{MANUFACTURER} eq 'Adaptec'?return 1:1; } } return 0; } sub run { my $params = shift; my $common = $params->{common}; my $logger = $params->{logger}; my ($name,$vendor,$model,$serialnumber,$firmware, $size, $description, $media, $manufacturer); my ($conf, $cur_cont,$info,$key, $dev, $devkey,$controller); #get infos from arcconf if possible if ($common->can_run ('arcconf') ) { $conf = `arcconf GETCONFIG 1`; if($conf =~ /Controllers found: (\d+)/) { if($1>0) { $controller = parse_config(); foreach $cur_cont (keys %{$controller}){ #travers Controller $info = $controller->{$cur_cont}; foreach $key (keys %{$info}){ #travers Infos of Controller #physical drives if ($key=~m/physical drive/) { $dev = $info->{$key}; foreach $devkey (keys %{$dev}) { #get infos $vendor = $dev->{$devkey}->{'Vendor'}; $model = $dev->{$devkey}->{'Model'}; $serialnumber = $dev->{$devkey}->{'Serial number'}; $firmware = $dev->{$devkey}->{'Firmware'}; $size = $dev->{$devkey}->{'Size'}; $description = $dev->{$devkey}->{'Transfer Speed'}; $media = $dev->{$devkey}->{'Device is'}; unless ( $media=~m/an Enclosure services device/) { #Dont need services device just drives if ( $media=~m/a Hard drive/ ){ $media = "HDD"; #try to determine if Drive is a Solid State Disk if (exists $dev->{$devkey}->{'SSD'}) { #SSD Info is explicit in config my $ssd = $dev->{$devkey}->{'SSD'}; if ($ssd=~m/Yes/) { $media = "SSD"; } } else { #No explicit info try to get it through model name if($model =~m/SSD|Solid State|WDS/) { $media = "SSD"; } } } $manufacturer = Ocsinventory::Agent::Backend::OS::Linux::Storages::getManufacturer($vendor); $logger->debug("Adaptec: $manufacturer $media $size, $manufacturer, $model, $description, $media, $size , $serialnumber, $firmware"); $common->addStorages({ NAME => "$manufacturer $media $size", MANUFACTURER => $manufacturer, MODEL => $model, DESCRIPTION => $description, TYPE => $media, DISKSIZE => $size, SERIALNUMBER => $serialnumber, FIRMWARE => $firmware, }); } } } } } } } } elsif (-r '/proc/scsi/scsi') { foreach my $hd (@devices) { open (PATH, '/proc/scsi/scsi'); # Example output: # # Attached devices: # Host: scsi0 Channel: 00 Id: 00 Lun: 00 # Vendor: Adaptec Model: raid10 Rev: V1.0 # Type: Direct-Access ANSI SCSI revision: 02 # Host: scsi0 Channel: 01 Id: 00 Lun: 00 # Vendor: HITACHI Model: HUS151436VL3800 Rev: S3C0 # Type: Direct-Access ANSI SCSI revision: 03 # Host: scsi0 Channel: 01 Id: 01 Lun: 00 # Vendor: HITACHI Model: HUS151436VL3800 Rev: S3C0 # Type: Direct-Access ANSI SCSI revision: 03 my ($host, $model, $firmware, $manufacturer, $size, $serialnumber); my $count = -1; while () { ($host, $count) = (1, $count+1) if /^Host:\sscsi$hd->{SCSI_COID}.*/; if ($host) { if ((/.*Model:\s(\S+).*Rev:\s(\S+).*/) and ($1 !~ 'raid.*')) { $model = $1; $firmware = $2; $manufacturer = Ocsinventory::Agent::Backend::OS::Linux::Storages::getManufacturer($model); foreach (`smartctl -i /dev/sg$count`) { $serialnumber = $1 if /^Serial Number:\s+(\S*).*/; } $logger->debug("Adaptec: $hd->{NAME}, $manufacturer, $model, SATA, disk, $hd->{DISKSIZE}, $serialnumber, $firmware"); $host = undef; $common->addStorages({ NAME => $hd->{NAME}, MANUFACTURER => $manufacturer, MODEL => $model, DESCRIPTION => 'SATA', TYPE => 'disk', DISKSIZE => $size, SERIALNUMBER => $serialnumber, FIRMWARE => $firmware, }); } } } close (PATH); } } } sub parse_config { my $arcconf = "arcconf"; my $argument = "GETCONFIG 1"; my $command = sprintf("%s %s|", $arcconf, $argument); my $fh; if(open $fh, $command) { my $c = parse_config_fh($fh); close $fh; return $c; } return undef; } sub parse_config_fh { my $fh = $_[0]; my $controller = {}; my $total_controller = 0; my $current_controller = 0; my $current_logical_drive = undef; my $current_physical_drive = undef; my $ctrl = undef; my $line = undef; LEVEL1: while($line = <$fh>) { chomp $line; next if($line =~ /^$/); next if($line =~ /^-+$/); if($line =~ /^Controllers found: (\d+)$/) { $total_controller = $1; } if($line =~ /^Controller information/) { $current_controller = $current_controller + 1; $current_logical_drive = undef; $current_physical_drive = undef; $controller->{$current_controller} = {}; $ctrl = $controller->{$current_controller}; while($line = <$fh>) { chomp $line; if ($line =~ /^\s+(.*\w)\s+:\s+(.*)$/) { $ctrl->{$1} = $2; } elsif ($line =~ /^\s+-+$/) { last; } } LEVEL2: while($line = <$fh>) { if ($line =~ /^\s+-+$/) { $line = <$fh>; chomp $line; } if($line =~ /^\s+(.*\w)\s*/) { my $cat = $1; $line = <$fh>; LEVEL3: while($line = <$fh>) { chomp $line; if ($line =~ /^\s+(.*\w)\s+:\s+(.*)$/) { $ctrl->{$cat}{$1} = $2; } elsif ($line =~ /^\s+-+$/) { last LEVEL3; } elsif ($line =~ /^$/) { last LEVEL2; } } } } } next if(!defined($current_controller)); if($line =~ /^Logical drive information/ or $line =~ /^Logical device information/) { LEVEL4: while($line = <$fh>) { chomp $line; if ($line =~ /^\S+.*\w\s+(\d+)$/) { $current_logical_drive = $1; } elsif ($line =~ /^\s+(\S.*\S+)\s+:\s+(.*)$/) { $ctrl->{'logical drive'}{$current_logical_drive}{$1} = $2; } elsif ($line =~ /^\s+-+$/) { my $cat = <$fh>; $cat =~ s/^\s+(\S.*\S+)\s+/$1/; chomp $cat; LEVEL5: while($line = <$fh>) { chomp $line; if ($line =~ /^\s+(\S.*\S+)\s+:\s+(.*)$/) { $ctrl->{'logical drive'}{$current_logical_drive}{$cat}{$1} = $2; } elsif ($line =~ /^\S+.*\w\s+(\d+)$/) { $current_logical_drive = $1; last LEVEL5; } elsif ($line =~ /^-+$/) { last LEVEL4; } elsif ($line =~ /^\s+-+$/) { next; } } } } } if($line =~ /^Physical Device information/) { LEVEL2: while($line = <$fh>) { if ($line =~ /^\s+-+$/) { $line = <$fh>; chomp $line; } if ($line =~ /^\s+Device\s+#(\d+)$/) { $current_physical_drive = $1; } elsif ($line =~ /^\s+Device is (.*\w)/) { $ctrl->{'physical drive'}{$current_physical_drive}{'Device is'} = $1; } elsif ($line =~ /^\s+(.*\w)\s+:\s+(.*)$/) { $ctrl->{'physical drive'}{$current_physical_drive}{$1} = $2; } elsif ($line =~ /^\s+-+$/) { last LEVEL3; } elsif ($line =~ /^$/) { last LEVEL2; } } } } return $controller; } 1; UnixAgent-2.4.2/lib/Ocsinventory/Agent/Backend/OS/Linux/Storages/FusionIO.pm000066400000000000000000000034051332737732100265300ustar00rootroot00000000000000package Ocsinventory::Agent::Backend::OS::Linux::Storages::FusionIO; use Ocsinventory::Agent::Backend::OS::Linux::Storages; use strict; sub trim { my $s = shift; $s =~ s/^\s+|\s+$//g; return $s }; sub check { my $params = shift; my $common = $params->{common}; my $ret; # Do we have fio-status? if ($common->can_run("fio-status")) { foreach (`fio-status 2> /dev/null`) { if (/^fct(\d*).*/) { $ret=1; last; } } } return $ret; } sub run { my $params = shift; my $common = $params->{common}; my $logger = $params->{logger}; my ($pd, $serialnumber, $model, $capacity, $firmware, $description, $media, $manufacturer); foreach (`fio-status 2> /dev/null`) { if (/^fct(\d*).*/) { my $slot = $1; my $cmd = "fio-status /dev/fct$slot --field"; $model = trim(`$cmd iom.board_name`); $description = trim(`$cmd adapter.product_name`); $media = trim('disk'); $capacity = trim(`$cmd iom.size_bytes`); $serialnumber = 'OEM:'.trim(`$cmd adapter.oem_serial_number`).' FIO:'.trim(`$cmd adapter.fio_serial_number`).' IOM:'.trim(`$cmd iom.serial_number`); $firmware = trim(`$cmd iom.fw_current_version`.' rev '.`$cmd iom.fw_current_revision`); $logger->debug("Fusion-io: N/A, $manufacturer, $model, $description, $media, $capacity, $serialnumber, $firmware"); $common->addStorages({ NAME => $model, MANUFACTURER => 'Fusion-io', MODEL => $model, DESCRIPTION => $description, TYPE => $media, DISKSIZE => $capacity, SERIALNUMBER => $serialnumber, FIRMWARE => $firmware }); } } } 1; UnixAgent-2.4.2/lib/Ocsinventory/Agent/Backend/OS/Linux/Storages/HP.pm000066400000000000000000000105311332737732100253420ustar00rootroot00000000000000package Ocsinventory::Agent::Backend::OS::Linux::Storages::HP; use Ocsinventory::Agent::Backend::OS::Linux::Storages; # Tested on 2.6.* kernels # # Cards tested : # # Smart Array E200 # # HP Array Configuration Utility CLI 7.85-18.0 use strict; sub check { my $params = shift; my $common = $params->{common}; my $ret; # Do we have ssacli ? if ($common->can_run("ssacli")) { foreach (`ssacli ctrl all show 2> /dev/null`) { if (/.*Slot\s(\d*).*/) { $ret = 1; last; } } } return $ret; } sub run { my $params = shift; my $common = $params->{common}; my $logger = $params->{logger}; my ($pd, $serialnumber, $model, $capacity, $firmware, $description, $media, $manufacturer); foreach (`ssacli ctrl all show 2> /dev/null`) { # Example output : # # Smart Array E200 in Slot 2 (sn: PA6C90K9SUH1ZA) if (/.*Slot\s(\d*).*/) { my $slot = $1; foreach (`ssacli ctrl slot=$slot pd all show 2> /dev/null`) { # Example output : # Smart Array E200 in Slot 2 # # array A # # physicaldrive 2I:1:1 (port 2I:box 1:bay 1, SATA, 74.3 GB, OK) # physicaldrive 2I:1:2 (port 2I:box 1:bay 2, SATA, 74.3 GB, OK) if (/.*physicaldrive\s(\S*)/) { my $pd = $1; foreach (`ssacli ctrl slot=$slot pd $pd show 2> /dev/null`) { # Example output : # # Smart Array E200 in Slot 2 # # array A # # physicaldrive 1:1 # Port: 2I # Box: 1 # Bay: 1 # Status: OK # Drive Type: Data Drive # Interface Type: SATA # Size: 74.3 GB # Firmware Revision: 21.07QR4 # Serial Number: WD-WMANS1732855 # Model: ATA WDC WD740ADFD-00 # SATA NCQ Capable: False # PHY Count: 1 $model = $1 if /.*Model:\s(.*)/; $description = $1 if /.*Interface Type:\s(.*)/; $media = $1 if /.*Drive Type:\s(.*)/; $capacity = $1 if /^\s*Size:\s(.*)/; $serialnumber = $1 if /.*Serial Number:\s(.*)/; $firmware = $1 if /.*Firmware Revision:\s(.*)/; } $serialnumber =~ s/^\s+//; $model =~ s/^ATA\s+//; # ex: ATA WDC WD740ADFD-00 $model =~ s/\s+/ /; $manufacturer = Ocsinventory::Agent::Backend::OS::Linux::Storages::getManufacturer($model); if ($media eq 'Data Drive') { $media = 'HDD'; if ($description =~m/SSD|Solid State/) { $media = 'SSD'; } elsif ($model =~m/SSD|Solid State|WDS/) { $media = 'SSD'; } } if ($capacity =~m/TB/) { $capacity *= 1000000; } elsif ($capacity =~m/GB/) { $capacity *= 1000; } else { $capacity *= 1; } $logger->debug("HP: N/A, $manufacturer, $model, $description, $media, $capacity, $serialnumber, $firmware"); $common->addStorages({ NAME => $model, MANUFACTURER => $manufacturer, MODEL => $model, DESCRIPTION => $description, TYPE => $media, DISKSIZE => $capacity, SERIALNUMBER => $serialnumber, FIRMWARE => $firmware }); } } } } } 1; UnixAgent-2.4.2/lib/Ocsinventory/Agent/Backend/OS/Linux/Storages/Lsilogic.pm000066400000000000000000000051351332737732100266040ustar00rootroot00000000000000package Ocsinventory::Agent::Backend::OS::Linux::Storages::Lsilogic; use Ocsinventory::Agent::Backend::OS::Linux::Storages; # Tested on 2.6.* kernels # # Cards tested : # # LSI Logic / Symbios Logic SAS1064E PCI-Express Fusion-MPT SAS # # mpt-status version : 1.2.0 use strict; sub check { my $params = shift; my $common = $params->{common}; my $device; # Do we have smartctl ? if ($common->can_run('smartctl')) { foreach my $node (glob("/dev/sd?")) { foreach (`smartctl -i $node`) { $device = $1 if /.*Device:\s(\w*).*/; } } ($device eq 'LSILOGIC')?return 1:return 0; } return 0; } sub run { my $params = shift; my $common = $params->{common}; my $logger = $params->{logger}; my $serialnumber; my @devices = Ocsinventory::Agent::Backend::OS::Linux::Storages::getFromUdev(); foreach my $hd (@devices) { foreach (`mpt-status -n -i $hd->{SCSI_UNID}`) { # Example output : # # ioc:0 vol_id:0 type:IM raidlevel:RAID-1 num_disks:2 size(GB):148 state: OPTIMAL flags: ENABLED # ioc:0 phys_id:1 scsi_id:2 vendor:ATA product_id:ST3160815AS revision:D size(GB):149 state: ONLINE flags: NONE sync_state: 100 ASC/ASCQ:0xff/0xff SMART ASC/ASCQ:0xff/0xff #ioc:0 phys_id:0 scsi_id:1 vendor:ATA product_id:ST3160815AS revision:D size(GB):149 state: ONLINE flags: NONE sync_state: 100 ASC/ASCQ:0xff/0xff SMART ASC/ASCQ:0xff/0xff #scsi_id:1 100% #scsi_id:0 100% if (/.*phys_id:(\d+).*product_id:\s*(\S*)\s+revision:(\S+).*size\(GB\):(\d+).*/) { $serialnumber = undef; foreach (`smartctl -i /dev/sg$1`) { $serialnumber = $1 if /^Serial Number:\s+(\S*)/; } my $model = $2; my $size = 1024*$4; # GB => MB my $firmware = $3; my $manufacturer = Ocsinventory::Agent::Backend::OS::Linux::Storages::getManufacturer($model); $logger->debug("Lsilogic: $hd->{NAME}, $manufacturer, $model, SATA, disk, $size, $serialnumber, $firmware"); $common->addStorages({ NAME => $hd->{NAME}, MANUFACTURER => $manufacturer, MODEL => $model, DESCRIPTION => 'SATA', TYPE => 'disk', DISKSIZE => $size, SERIALNUMBER => $serialnumber, FIRMWARE => $firmware, }); } } } } 1; UnixAgent-2.4.2/lib/Ocsinventory/Agent/Backend/OS/Linux/Storages/Megacli.pm000066400000000000000000000052101332737732100263720ustar00rootroot00000000000000package Ocsinventory::Agent::Backend::OS::Linux::Storages::Megacli; use Ocsinventory::Agent::Backend::OS::Linux::Storages; use strict; sub check { my $params = shift; my $common = $params->{common}; my $ret; my $cont; if ($common->can_run("megacli")) { foreach (`megacli -adpCount 2>/dev/null`) { if (/^Controller\sCount:\s(\d+)/) { $cont=$1; if (defined $cont && $cont == 1) { $ret=1; last; } } } } return $ret; } sub run { my $params = shift; my $common = $params->{common}; my $logger = $params->{logger}; my $adpc; my $model; my $description; my $capacity; my $firmware; my $serial; my $manufacturer; my $index; my @partitions; my @sl; # Retrieve the partition open PARTINFO, '){ if (/^\s*(\d*)\s*(\d*)\s*(\d*)\s*([sh]d[a-z]+)$/i){ push(@partitions,$4); } } # How adapters are present? foreach (`megacli -adpCount 2> /dev/null`){ $adpc=$1 if (/^Controller Count:\s(\d+)./i); } # How slot are used on the controller? for (my $count=0;$count<$adpc;$count++){ foreach (`megacli -ShowSummary -a$count`){ # Slot number : Connector : 0: Slot 1 if (/Connector\s*:\s*\d+(?:): Slot (\d+)/){ push (@sl, $1); } } # use smartctcl command to retrieve information foreach my $dev (@partitions){ foreach my $slo (@sl){ # smartctl -i -d megaraid,0 /dev/sda my $result=`smartctl -i -d megaraid,$slo /dev/$dev`; $model=$1 if ($result =~ /Model Family:\s*(.*)/); $description=$1 if ($result =~ /Device Model:\s*(.*)/); $manufacturer = Ocsinventory::Agent::Backend::OS::Linux::Storages::getManufacturer($description); $serial=$1 if ($result =~ /Serial Number:\s*(.*)/); $firmware=$1 if ($result =~ /Firmware Version:\s*(.*)/); $capacity=$1 if ($result =~ /User Capacity:\s*.*\[(.*)\]/); $common->addStorages({ NAME => $description, MANUFACTURER => $manufacturer, MODEL => $model, DESCRIPTION => $description, TYPE => "Disk", DISKSIZE => $capacity, SERIALNUMBER => $serial, FIRMWARE => $firmware }); } } } } 1; UnixAgent-2.4.2/lib/Ocsinventory/Agent/Backend/OS/Linux/Storages/ServeRaid.pm000066400000000000000000000073141332737732100267240ustar00rootroot00000000000000package Ocsinventory::Agent::Backend::OS::Linux::Storages::ServeRaid; use Ocsinventory::Agent::Backend::OS::Linux::Storages; # Tested on 2.6.* kernels # # Cards tested : # # IBM ServeRAID-6M # IBM ServeRAID-6i use strict; sub check { my $params = shift; my $common = $params->{common}; my $ret = 0; # Do we have ipssend installed ? if ($common->can_run("ipssend")) { foreach (`ipssend GETVERSION 2>/dev/null`) { if (/.*ServeRAID Controller Number\s(\d*).*/) { $ret = $1; last; } } } return $ret; } sub run { my $params = shift; my $common = $params->{common}; my $logger = $params->{logger}; my $slot; $logger->debug("ServeRaid: ipssend GETVERSION"); foreach (`ipssend GETVERSION 2>/dev/null`) { # Example Output : # Found 1 IBM ServeRAID controller(s). #---------------------------------------------------------------------- #ServeRAID Controller(s) Version Information #---------------------------------------------------------------------- # Controlling BIOS version : 7.00.14 # #ServeRAID Controller Number 1 # Controller type : ServeRAID-6M # Controller slot information : 2 # Actual BIOS version : 7.00.14 # Firmware version : 7.00.14 # Device driver version : 7.10.18 $slot = $1 if /.*ServeRAID Controller Number\s(\d*).*/; if (/.*Controller type.*:\s(.*)/) { my $name = $1; my ($serial, $capacity, $scsi, $channel, $state); $logger->debug("ServeRaid: ipssend GETCONFIG $slot PD"); foreach (`ipssend GETCONFIG $slot PD 2>/dev/null`) { # Example Output : # Channel #1: # Target on SCSI ID 0 # Device is a Hard disk # SCSI IDg: 0 # PFA (Yes/No) : No # Stateg : Online (ONL) # Size (in MB)/(in sectors): 34715/71096368 # Device ID : IBM-ESXSCBR036C3DFQDB2Q6CDKM # FRU part number : 32P0729 $channel = $1 if /.*Channel #(.*):/; $scsi = $1 if /.*SCSI ID.*:\s(.*)/; $state = $1 if /.*State.*\((.*)\)/; $capacity = $1 if /.*Size.*:\s(\d*)\/(\d*)/; $serial = $1 if /.*Device ID.*:\s(.*)/; if (/.*FRU part number.*:\s(.*)/) { my $model = $1; my $manufacturer = Ocsinventory::Agent::Backend::OS::Linux::Storages::getManufacturer($serial); ## my $fullname = "$name $slot/$channel/$scsi $state"; $logger->debug("ServeRaid: found $model, $manufacturer, $model, SCSI, disk, $capacity, $serial, "); $common->addStorages({ NAME => "$manufacturer $model", MANUFACTURER => $manufacturer, MODEL => $model, DESCRIPTION => "SCSI", TYPE => "disk", DISKSIZE => $capacity, SERIALNUMBER => $serial, FIRMWARE => "" }); # don't undef $channel, appear only once for several drive. $scsi = $state = $capacity = $serial = undef; } } } } } 1; UnixAgent-2.4.2/lib/Ocsinventory/Agent/Backend/OS/Linux/Sys.pm000066400000000000000000000005251332737732100240240ustar00rootroot00000000000000package Ocsinventory::Agent::Backend::OS::Linux::Sys; #$LunchAfter = "Ocsinventory::Agent::Backend::OS::Linux::VirtualFs::Sys"; sub check { my $params = shift; my $common = $params->{common}; return unless $common->can_run ("mount"); foreach (`mount`) { return 1 if (/type\ sysfs/); } 0; } sub run {} 1; UnixAgent-2.4.2/lib/Ocsinventory/Agent/Backend/OS/Linux/Uptime.pm000066400000000000000000000015041332737732100245070ustar00rootroot00000000000000package Ocsinventory::Agent::Backend::OS::Linux::Uptime; use strict; sub check { my $params = shift; my $common = $params->{common}; $common->can_read("/proc/uptime") } sub run { my $params = shift; my $common = $params->{common}; # Uptime open UPTIME, "/proc/uptime"; my $uptime = ; $uptime =~ s/^(.+)\s+.+/$1/; close UPTIME; # Uptime conversion my ($UYEAR, $UMONTH , $UDAY, $UHOUR, $UMIN, $USEC) = (gmtime ($uptime))[5,4,3,2,1,0]; # Write in ISO format $uptime=sprintf "%02d-%02d-%02d %02d:%02d:%02d", ($UYEAR-70), $UMONTH, ($UDAY-1), $UHOUR, $UMIN, $USEC; chomp(my $DeviceType =`uname -m`); # TODO$h->{'CONTENT'}{'HARDWARE'}{'DESCRIPTION'} = [ "$DeviceType/$uptime" ]; $common->setHardware({ DESCRIPTION => "$DeviceType/$uptime" }); } 1 UnixAgent-2.4.2/lib/Ocsinventory/Agent/Backend/OS/MacOS.pm000066400000000000000000000032761332737732100231170ustar00rootroot00000000000000package Ocsinventory::Agent::Backend::OS::MacOS; use strict; require Exporter; our @ISA = qw /Exporter/; our @EXPORT = qw /get_sysprofile_devices_names/; sub check { my $r; # we check far darwin because that's the _real_ underlying OS $r = 1 if (uc($^O) =~ /^DARWIN$/); return($r); } sub run { my $params = shift; my $common = $params->{common}; my $OSName; my $OSComment; my $OSVersion; my $uuid; # if we can load the system profiler, gather the information from that if ($common->can_load("Mac::SysProfile")){ my $profile = Mac::SysProfile->new(); my $data = $profile->gettype('SPSoftwareDataType'); return(undef) unless(ref($data) eq 'ARRAY'); my $h = $data->[0]; my $SystemVersion = $h->{'os_version'}; if ($SystemVersion =~ /^(.*?)\s+(\d+.*)/) { $OSName=$1; $OSVersion=$2; } else { # Default values $OSName="Mac OS X"; $OSVersion="Unknown"; } } else { # we can't load the system profiler, use the basic BSD stype information # Operating system informations chomp($OSName=`uname -s`); chomp($OSVersion=`uname -r`); } # add the uname -v as the comment, not really needed, but extra info never hurt chomp($OSComment=`uname -v`); # We get UUID if ($common->can_run("ioreg")) { my @ioreg = split ("=", `ioreg -rd1 -c IOPlatformExpertDevice | grep -E '(UUID)'`); chomp($uuid = $ioreg[1]); $uuid =~ s/\"|\s//g; } $common->setHardware({ OSNAME => $OSName, OSCOMMENTS => $OSComment, OSVERSION => $OSVersion, UUID => $uuid, }); } 1; UnixAgent-2.4.2/lib/Ocsinventory/Agent/Backend/OS/MacOS/000077500000000000000000000000001332737732100225515ustar00rootroot00000000000000UnixAgent-2.4.2/lib/Ocsinventory/Agent/Backend/OS/MacOS/Bios.pm000066400000000000000000000021721332737732100240050ustar00rootroot00000000000000package Ocsinventory::Agent::Backend::OS::MacOS::Bios; use strict; sub check { my $params = shift; my $common = $params->{common}; return $common->can_load("Mac::SysProfile") } sub run { my $params = shift; my $common = $params->{common}; # use Mac::SysProfile to get the respected datatype my $profile = Mac::SysProfile->new(); my $data = $profile->gettype('SPHardwareDataType'); # unless we get a real hash value, return with nothing return(undef) unless($data && ref($data) eq 'ARRAY'); my $h = $data->[0]; # set the bios informaiton from the apple system profiler $common->setBios({ SMANUFACTURER => 'Apple Inc', # duh SMODEL => $h->{'model_identifier'} || $h->{'machine_model'}, # SSN => $h->{'Serial Number'} # New method to get the SSN, because of MacOS 10.5.7 update # system_profiler gives 'Serial Number (system): XXXXX' where 10.5.6 # and lower give 'Serial Number: XXXXX' SSN => $h->{'serial_number'}, BVERSION => $h->{'boot_rom_version'}, }); } 1; UnixAgent-2.4.2/lib/Ocsinventory/Agent/Backend/OS/MacOS/CPU.pm000066400000000000000000000036651332737732100235500ustar00rootroot00000000000000package Ocsinventory::Agent::Backend::OS::MacOS::CPU; use strict; sub check { my $params = shift; my $common = $params->{common}; return(undef) unless -r '/usr/sbin/system_profiler'; return(undef) unless $common->can_load("Mac::SysProfile"); return 1; } sub run { my $params = shift; my $common = $params->{common}; my $processors; my $arch; my $datawidth; $processors->{1}->{MANUFACTURER} = `sysctl -n machdep.cpu.vendor`; $processors->{1}->{TYPE} = `sysctl -n machdep.cpu.brand_string`; $processors->{1}->{SPEED} = `sysctl -n hw.cpufrequency` / 1000 / 1000; $processors->{1}->{L2CACHESIZE} = `sysctl -n hw.l2cachesize` / 1024; $processors->{1}->{CORES} = `sysctl -n machdep.cpu.core_count`; $processors->{1}->{LOGICAL_CPUS} = `sysctl -n machdep.cpu.thread_count`; # 32 or 64 bits arch? my $sysctl_arch = `sysctl -n hw.cpu64bit_capable`; if ($sysctl_arch == 1){ $arch = "x86_64"; $datawidth = 64; } else { $arch = "x86"; $datawidth = 32; } $processors->{1}->{CPUARCH} = $arch; $processors->{1}->{DATA_WIDTH} = $datawidth; # copy cpu infos to other packages my $ncpu=`sysctl -n hw.packages`; foreach my $cpu (2..$ncpu) { $processors->{$cpu}->{MANUFACTURER} = $processors->{1}->{MANUFACTURER}; $processors->{$cpu}->{TYPE} = $processors->{1}->{TYPE}; $processors->{$cpu}->{SPEED} = $processors->{1}->{SPEED}; $processors->{$cpu}->{L2CACHESIZE} = $processors->{1}->{L2CACHESIZE}; $processors->{$cpu}->{CORES} = $processors->{1}->{CORES}; $processors->{$cpu}->{LOGICAL_CPUS} = $processors->{1}->{LOGICAL_CPUS}; $processors->{$cpu}->{CPUARCH} = $processors->{1}->{CPUARCH}; $processors->{$cpu}->{DATA_WIDTH} = $processors->{1}->{DATA_WIDTH}; } # Add new cpu infos to inventory foreach (keys %{$processors}){ $common->addCPU($processors->{$_}); } } 1; UnixAgent-2.4.2/lib/Ocsinventory/Agent/Backend/OS/MacOS/Camera.pm000066400000000000000000000011041332737732100242730ustar00rootroot00000000000000package Ocsinventory::Agent::Backend::OS::MacOS::Camera; use strict; sub check { return(undef) unless -r '/usr/sbin/system_profiler'; # check perms return 1; } sub run { my $params = shift; my $common = $params->{common}; # create profiler obj, bail if datatype fails my $data = $common->get_sysprofile_devices_names('SPCameraDataType'); return(undef) unless(ref($data) eq 'ARRAY'); # add sound cards foreach my $cam (@$data){ $common->addCamera({ 'MODEL' => $cam, 'UUID' => $cam, }); } } 1; UnixAgent-2.4.2/lib/Ocsinventory/Agent/Backend/OS/MacOS/Controllers.pm000066400000000000000000000045601332737732100254220ustar00rootroot00000000000000package Ocsinventory::Agent::Backend::OS::MacOS::Controllers; sub check { my $params = shift; my $common = $params->{common}; return(undef) unless -r '/usr/sbin/system_profiler'; # check perms return (undef) unless $common->can_load("Mac::SysProfile"); return 1; } sub run { my $params = shift; my $common = $params->{common}; my ($caption, $description, $name, $type); my $datatypes = { #usb => 'SPUSBDataType', TODO: fix problems with SPUSBDataType in Mac::Sysprofile firewire => 'SPFireWireDataType', thunderbolt => 'SPThunderboltDataType', ethernet => 'SPEthernetDataType', }; for my $datatype (keys %$datatypes) { # create the profile object and return undef unless we get something back my $pro = Mac::SysProfile->new(); my $data = $pro->gettype($datatypes->{$datatype}); return(undef) unless(ref($data) eq 'ARRAY'); foreach my $port (@$data) { if ($datatype =~ /usb/) { $name = $port->{'usb_bus_number'}; $type = 'USB Bus'; $description = $port->{'controller_location'} . ", PCI Device ID: " . $port->{'pci_device'}; } elsif ($datatype =~ /firewire/) { $name = 'FireWire'; $type = 'FireWire Bus'; $description = 'Max Speed: ' . $port->{'max_device_speed'}; } elsif ($datatype =~ /thunderbolt/) { $name = $port->{'device_name_key'}; next unless $name; $type = 'Thunderbolt'; $description = 'UID: ' . $port->{'switch_uid_key'}; } elsif ($datatype =~ /ethernet/) { $name = $port->{'_name'}; if ($name ne '') { $name = $port->{'spethernet_device-id'} if ($name eq 'ethernet'); $type = 'Ethernet Controller'; $description = 'BSD: ' . $port->{'spethernet_BSD_Name'}; } } $common->addController({ CAPTION => $caption, DESCRIPTION => $description, NAME => $name, TYPE => $type, }); $caption = $description = $name = $type = undef; } } } 1; UnixAgent-2.4.2/lib/Ocsinventory/Agent/Backend/OS/MacOS/Domains.pm000066400000000000000000000016531332737732100245060ustar00rootroot00000000000000package Ocsinventory::Agent::Backend::OS::MacOS::Domains; use strict; # straight up theft from the other modules... sub check { my $hostname; chomp ($hostname = `hostname`); my @domain = split (/\./, $hostname); shift (@domain); return 1 if @domain; -f "/etc/resolv.conf" } sub run { my $params = shift; my $common = $params->{common}; my $domain; my $hostname; chomp ($hostname = `hostname`); my @domain = split (/\./, $hostname); shift (@domain); $domain = join ('.',@domain); if (!$domain) { my %domain; open RESOLV, "/etc/resolv.conf" or warn; while(){ $domain{$2} = 1 if (/^(domain|search)\s+(.+)/); } close RESOLV; $domain = join "/", keys %domain; } # If no domain name, we send "WORKGROUP" $domain = 'WORKGROUP' unless $domain; $common->setHardware({ WORKGROUP => $domain }); } 1; UnixAgent-2.4.2/lib/Ocsinventory/Agent/Backend/OS/MacOS/Drives.pm000066400000000000000000000021151332737732100243420ustar00rootroot00000000000000package Ocsinventory::Agent::Backend::OS::MacOS::Drives; use strict; # yea BSD theft!!!! # would have used Mac::SysProfile, but the xml isn't quite fully supported # the drives come back in apple xml tree's, and the module can't handle it yet (soon as I find the time to fix the patch) sub check {1} sub run { my $params = shift; my $common = $params->{common}; my $free; my $filesystem; my $total; my $type; my $volumn; for my $t ("apfs", "ffs","ufs", "hfs") { # OpenBSD has no -m option so use -k to obtain results in kilobytes for(`df -P -k -t $t`){ # darwin needs the -t to be last if(/^(\S+)\s+(\S+)\s+(\S+)\s+(\S+)\s+(\S+)\s+(\S+)\n/){ $type = $1; $filesystem = $t; $total = sprintf("%i",$2/1024); $free = sprintf("%i",$4/1024); $volumn = $6; $common->addDrive({ FREE => $free, FILESYSTEM => $filesystem, TOTAL => $total, TYPE => $type, VOLUMN => $volumn }) } } } } 1; UnixAgent-2.4.2/lib/Ocsinventory/Agent/Backend/OS/MacOS/Hostname.pm000066400000000000000000000011031332737732100246600ustar00rootroot00000000000000package Ocsinventory::Agent::Backend::OS::MacOS::Hostname; sub check { my $params = shift; my $common = $params->{common}; return 1 if $common->can_load ("Mac::SysProfile"); 0; } # Initialise the distro entry sub run { my $params = shift; my $common = $params->{common}; my $hostname; my $profile = Mac::SysProfile->new(); my $data = $profile->gettype('SPSoftwareDataType'); return undef unless(ref($data) eq 'ARRAY'); my $h = $data->[0]; $hostname = $h->{'local_host_name'}; $common->setHardware ({NAME => $hostname}) if $hostname; } 1; UnixAgent-2.4.2/lib/Ocsinventory/Agent/Backend/OS/MacOS/IPv4.pm000066400000000000000000000011201332737732100236630ustar00rootroot00000000000000package Ocsinventory::Agent::Backend::OS::MacOS::IPv4; # straight up theft from the other modules sub check { my @ifconfig = `ifconfig -a 2>/dev/null`; return 1 if @ifconfig; return; } # Initialise the distro entry sub run { my $params = shift; my $common = $params->{common}; my @ip; # Looking for ip addresses with ifconfig, except loopback # *BSD need -a option foreach (`ifconfig -a`){ if(/^\s*inet\s+(\S+)/){ ($1=~/127.+/)?next:push @ip, $1 }; } my $ip=join "/", @ip; $common->setHardware({IPADDR => $ip}); } 1; UnixAgent-2.4.2/lib/Ocsinventory/Agent/Backend/OS/MacOS/Mem.pm000066400000000000000000000043071332737732100236310ustar00rootroot00000000000000package Ocsinventory::Agent::Backend::OS::MacOS::Mem; use strict; sub check { my $params = shift; my $common = $params->{common}; return(undef) unless -r '/usr/sbin/system_profiler'; # check perms return (undef) unless $common->can_load("Mac::SysProfile"); return 1; } sub run { my $params = shift; my $common = $params->{common}; my $PhysicalMemory; # create the profile object and return undef unless we get something back my $profile = Mac::SysProfile->new(); my $data = $profile->gettype('SPMemoryDataType'); return(undef) unless(ref($data) eq 'ARRAY'); # Workaround for MacOSX 10.5.7 #if ($h->{'Memory Slots'}) { # $h = $h->{'Memory Slots'}; #} foreach my $memory (@$data){ next unless $memory->{'_name'} =~ /^BANK|SODIMM|DIMM/; # tare out the slot number my $slot = $memory->{'_name'}; # memory in 10.5 if($slot =~ /^BANK (\d)\/DIMM\d/){ $slot = $1; } # 10.4 if($slot =~ /^SODIMM(\d)\/.*$/){ $slot = $1; } # 10.4 PPC if($slot =~ /^DIMM(\d)\/.*$/){ $slot = $1; } # 10.7 if ($slot =~ /^DIMM (\d)/) { $slot = $1; } my $size = $memory->{'dimm_size'}; my $desc = $memory->{'dimm_part_number'}; if ($desc !~ /empty/) { # dimm_part_number is an hex string, convert it to ascii $desc = pack "H*", $desc; $desc =~ s/\s+$//; } # if system_profiler lables the size in gigs, we need to trim it down to megs so it's displayed properly if($size =~ /GB$/){ $size =~ s/GB$//; $size *= 1024; } $common->addMemory({ 'CAPACITY' => $size, 'SPEED' => $memory->{'dimm_speed'}, 'TYPE' => $memory->{'dimm_type'}, 'SERIALNUMBER' => $memory->{'dimm_serial_number'}, 'DESCRIPTION' => $desc, 'NUMSLOTS' => $slot, 'CAPTION' => 'Status: '.$memory->{'dimm_status'}, }); } # Send total memory size to inventory object my $sysctl_memsize=`sysctl -n hw.memsize`; $common->setHardware({ MEMORY => $sysctl_memsize / 1024 / 1024, }); } 1; UnixAgent-2.4.2/lib/Ocsinventory/Agent/Backend/OS/MacOS/Networks.pm000066400000000000000000000076501332737732100247330ustar00rootroot00000000000000package Ocsinventory::Agent::Backend::OS::MacOS::Networks; # I think I hijacked most of this from the BSD/Linux modules use strict; sub check { my $params = shift; my $common = $params->{common}; $common->can_run("ifconfig") && $common->can_load("Net::IP qw(:PROC)") } sub _ipdhcp { my $if = shift; my $path; my $ipdhcp; my $leasepath; foreach ( # XXX BSD paths "/var/db/dhclient.leases.%s", "/var/db/dhclient.leases", # Linux path for some kFreeBSD based GNU system "/var/lib/dhcp3/dhclient.%s.leases", "/var/lib/dhcp3/dhclient.%s.leases", "/var/lib/dhcp/dhclient.leases") { $leasepath = sprintf($_,$if); last if (-e $leasepath); } return undef unless -e $leasepath; if (open DHCP, $leasepath) { my $lease; my $dhcp; my $expire; # find the last lease for the interface with its expire date while(){ $lease = 1 if(/lease\s*{/i); $lease = 0 if(/^\s*}\s*$/); if ($lease) { #inside a lease section if(/interface\s+"(.+?)"\s*/){ $dhcp = ($1 =~ /^$if$/); } #Server IP if(/option\s+dhcp-server-identifier\s+(\d{1,3}(?:\.\d{1,3}){3})\s*;/ and $dhcp){ $ipdhcp = $1; } if (/^\s*expire\s*\d\s*(\d*)\/(\d*)\/(\d*)\s*(\d*):(\d*):(\d*)/ and $dhcp) { $expire=sprintf "%04d%02d%02d%02d%02d%02d",$1,$2,$3,$4,$5,$6; } } } close DHCP or warn; chomp (my $currenttime = `date +"%Y%m%d%H%M%S"`); undef $ipdhcp unless $currenttime <= $expire; } else { warn "Can't open $leasepath\n"; } return $ipdhcp; } # Initialise the distro entry sub run { my $params = shift; my $common = $params->{common}; my $description; my $ipaddress; my $ipgateway; my $ipmask; my $ipsubnet; my $macaddr; my $status; my $type; # Looking for the gateway # 'route show' doesn't work on FreeBSD so we use netstat # XXX IPV4 only for(`netstat -nr -f inet`){ $ipgateway=$1 if /^default\s+(\S+)/i; } my @ifconfig = `ifconfig -a`; # -a option required on *BSD # first make the list available interfaces # too bad there's no -l option on OpenBSD my @list; foreach (@ifconfig){ # skip loopback, pseudo-devices and point-to-point interfaces #next if /^(lo|fwe|vmnet|sit|pflog|pfsync|enc|strip|plip|sl|ppp)\d+/; next unless(/^en([0-9])/); # darwin has a lot of interfaces, for this purpose we only want to deal with eth0 and eth1 if (/^(\S+):/) { push @list , $1; } # new interface name } # for each interface get it's parameters foreach $description (@list) { $ipaddress = $ipmask = $macaddr = $status = $type = undef; # search interface infos @ifconfig = `ifconfig $description`; foreach (@ifconfig){ $ipaddress = $1 if /inet (\S+)/i; $ipmask = $1 if /netmask\s+(\S+)/i; $macaddr = $2 if /(address:|ether|lladdr)\s+(\S+)/i; $status = 1 if /status:\s+active/i; $type = $1 if /media:\s+(\S+)/i; } my $binip = &ip_iptobin ($ipaddress ,4); # In BSD, netmask is given in hex form my $binmask = sprintf("%b", oct($ipmask)); my $binsubnet = $binip & $binmask; $ipsubnet = ip_bintoip($binsubnet,4); my $mask = ip_bintoip($binmask,4); $common->addNetwork({ DESCRIPTION => $description, IPADDRESS => ($status?$ipaddress:undef), IPDHCP => _ipdhcp($description), IPGATEWAY => ($status?$ipgateway:undef), IPMASK => ($status?$mask:undef), IPSUBNET => ($status?$ipsubnet:undef), MACADDR => $macaddr, STATUS => ($status?"Up":"Down"), TYPE => ($status?$type:undef) }); } } 1; UnixAgent-2.4.2/lib/Ocsinventory/Agent/Backend/OS/MacOS/Packages.pm000066400000000000000000000022571332737732100246330ustar00rootroot00000000000000package Ocsinventory::Agent::Backend::OS::MacOS::Packages; use strict; use warnings; sub check { my $params = shift; my $common = $params->{common}; return unless $common->can_load("Mac::SysProfile"); # Do not run an package inventory if there is the --nosoftware parameter return if ($params->{config}->{nosoftware}); 1; } sub run { my $params = shift; my $common = $params->{common}; my $profile = Mac::SysProfile->new(); my $data = $profile->gettype('SPApplicationsDataType'); # might need to check version of darwin return unless($data && ref($data) eq 'ARRAY'); # for each app, normalize the information, then add it to the inventory stack foreach my $app (@$data){ #my $a = $apps->{$app}; my $kind = $app->{'runtime_environment'} ? $app->{'runtime_environment'} : 'UNKNOWN'; my $comments = '['.$kind.']'; $common->addSoftware({ 'NAME' => $app->{'_name'}, 'VERSION' => $app->{'version'} || 'unknown', 'COMMENTS' => $comments, 'PUBLISHER' => $app->{'info'} || 'unknown', 'INSTALLDATE' => $app->{'lastModified'}, }); } } 1; UnixAgent-2.4.2/lib/Ocsinventory/Agent/Backend/OS/MacOS/Printers.pm000066400000000000000000000014311332737732100247140ustar00rootroot00000000000000package Ocsinventory::Agent::Backend::OS::MacOS::Printers; use strict; sub check { my $params = shift; my $common = $params->{common}; return(undef) unless -r '/usr/sbin/system_profiler'; return(undef) unless $common->can_load("Mac::SysProfile"); return 1; } sub run { my $params = shift; my $common = $params->{common}; my $profile = Mac::SysProfile->new(); my $data = $profile->gettype('SPPrintersDataType'); return(undef) unless(ref($data) eq 'ARRAY'); foreach my $printer (@$data){ next if($printer->{'_name'} =~ /^The\sprinters\slist\sis\sempty\.(.*)$/); $common->addPrinter({ NAME => $printer->{'_name'}, DRIVER => $printer->{'ppd'}, PORT => $printer->{'uri'}, }); } } 1; UnixAgent-2.4.2/lib/Ocsinventory/Agent/Backend/OS/MacOS/Slots.pm000066400000000000000000000020051332737732100242100ustar00rootroot00000000000000package Ocsinventory::Agent::Backend::OS::MacOS::Slots; sub check { my $params = shift; my $common = $params->{common}; return(undef) unless -r '/usr/sbin/system_profiler'; # check perms return (undef) unless $common->can_load("Mac::SysProfile"); return 1; } sub run { my $params = shift; my $common = $params->{common}; my ($name, $description, $status); # create the profile object and return undef unless we get something back my $pro = Mac::SysProfile->new(); my $data = $pro->gettype('SPPCIDataType'); return(undef) unless(ref($data) eq 'ARRAY'); foreach my $slot (@$data) { $name = $slot->{'_name'}; $description = $slot->{'sppci_link-width'}." ".$slot->{'sppci_bus'}." ".$slot->{'sppci_slot_name'}; $common->addSlot({ NAME => $name, DESCRIPTION => $description, }); $name = $description = $status = undef; } } 1; UnixAgent-2.4.2/lib/Ocsinventory/Agent/Backend/OS/MacOS/Sound.pm000066400000000000000000000011751332737732100242030ustar00rootroot00000000000000package Ocsinventory::Agent::Backend::OS::MacOS::Sound; use strict; sub check { return(undef) unless -r '/usr/sbin/system_profiler'; # check perms return 1; } sub run { my $params = shift; my $common = $params->{common}; # create profiler obj, bail if datatype fails my $data = $common->get_sysprofile_devices_names('SPAudioDataType'); return(undef) unless(ref($data) eq 'ARRAY'); # add sound cards foreach my $sound (@$data){ $common->addSound({ 'NAME' => $sound, 'MANUFACTURER' => $sound, 'DESCRIPTION' => $sound, }); } } 1; UnixAgent-2.4.2/lib/Ocsinventory/Agent/Backend/OS/MacOS/Storages.pm000066400000000000000000000055621332737732100247060ustar00rootroot00000000000000package Ocsinventory::Agent::Backend::OS::MacOS::Storages; use strict; sub check { my $params = shift; my $common = $params->{common}; return $common->can_load('Mac::SysProfile'); } sub getManufacturer { my $model = shift; if($model =~ /(maxtor|western|sony|compaq|hewlett packard|ibm|seagate|toshiba|fujitsu|lg|samsung|nec|transcend|matshita|pioneer|hitachi)/i) { return ucfirst(lc($1)); } elsif ($model =~ /^HP/) { return "Hewlett Packard"; } elsif ($model =~ /^WDC/) { return "Western Digital"; } elsif ($model =~ /^ST/) { return "Seagate"; } elsif ($model =~ /^HD/ or $model =~ /^IC/ or $model =~ /^HU/) { return "Hitachi"; } } sub run { my $params = shift; my $common = $params->{common}; my $logger = $params->{logger}; my $devices = {}; my $profile = Mac::SysProfile->new(); # Get SATA Drives my $sata = $profile->gettype('SPSerialATADataType'); if ( ref($sata) eq 'ARRAY') { foreach my $storage ( @$sata ) { next unless ( ref($storage) eq 'HASH' ); my $description; if ( $storage->{'_name'} =~ /DVD/i || $storage->{'_name'} =~ /CD/i ) { $description = 'CD-ROM Drive'; } else { $description = 'Disk drive'; } my $size = $storage->{'size'}; if ($size =~ /GB/) { $size =~ s/ GB//; $size *= 1024; } if ($size =~ /TB/) { $size =~ s/ TB//; $size *= 1048576; } my $manufacturer = getManufacturer($storage->{'_name'}); my $model = $storage->{'device_model'}; $model =~ s/\s*$manufacturer\s*//i; $devices->{$storage->{'_name'}} = { NAME => $storage->{'name'}, SERIALNUMBER => $storage->{'device_serial'}, DISKSIZE => $size, FIRMWARE => $storage->{'device_revision'}, MANUFACTURER => $manufacturer, DESCRIPTION => $description, MODEL => $model }; } } # Get PATA Drives my $pata = $profile->gettype('SPParallelATADataType'); if ( ref($sata) eq 'ARRAY') { foreach my $storage ( @$pata ) { next unless ( ref($storage) eq 'HASH' ); my $description; if ( $storage->{'_name'} =~ /DVD/i || $storage->{'_name'} =~ /CD/i ) { $description = 'CD-ROM Drive'; } else { $description = 'Disk drive'; } my $manufacturer = getManufacturer($storage->{'_name'}); my $model = $storage->{'device_model'}; my $size; $devices->{$storage->{'_name'}} = { NAME => $storage->{'_name'}, SERIAL => $storage->{'device_serial'}, DISKSIZE => $size, FIRMWARE => $storage->{'device_revision'}, MANUFACTURER => $manufacturer, DESCRIPTION => $description, MODEL => $model }; } } foreach my $device ( keys %$devices ) { $common->addStorages($devices->{$device}); } } 1; UnixAgent-2.4.2/lib/Ocsinventory/Agent/Backend/OS/MacOS/UUID.pm000066400000000000000000000010571332737732100236600ustar00rootroot00000000000000package Ocsinventory::Agent::Backend::OS::MacOS::UUID; use strict; use warnings; sub check { my $params = shift; my $common = $params->{common}; return(undef) unless -r '/usr/sbin/system_profiler'; return 1; } sub run { my $params = shift; my $common = $params->{common}; my @sphardware=`system_profiler SPHardwareDataType`; my $uuid; foreach my $line (@sphardware){ chomp $line; $uuid = $1 if ($line =~ /Hardware UUID:\s(.*)/i); } $common->setHardware({ UUID => $uuid, }); } 1; UnixAgent-2.4.2/lib/Ocsinventory/Agent/Backend/OS/MacOS/Uptime.pm000066400000000000000000000015501332737732100243530ustar00rootroot00000000000000package Ocsinventory::Agent::Backend::OS::MacOS::Uptime; use strict; sub check { my $boottime = `sysctl -n kern.boottime 2>/dev/null`; # straight from the BSD module ;-) return 1 if $boottime; return; } sub run { my $params = shift; my $common = $params->{common}; # stolen code from bsd. chomp (my $boottime = `sysctl -n kern.boottime`); $boottime = $1 if $boottime =~ /sec\s*=\s*(\d+)/; chomp (my $currenttime = `date +%s`); my $uptime = $currenttime - $boottime; # Uptime conversion my ($UYEAR, $UMONTH , $UDAY, $UHOUR, $UMIN, $USEC) = (gmtime ($uptime))[5,4,3,2,1,0]; # Write in ISO format $uptime=sprintf "%02d-%02d-%02d %02d:%02d:%02d", ($UYEAR-70), $UMONTH, ($UDAY-1), $UHOUR, $UMIN, $USEC; chomp(my $DeviceType =`uname -m`); $common->setHardware({ DESCRIPTION => "$DeviceType/$uptime" }); } 1; UnixAgent-2.4.2/lib/Ocsinventory/Agent/Backend/OS/MacOS/Video.pm000066400000000000000000000050151332737732100241560ustar00rootroot00000000000000package Ocsinventory::Agent::Backend::OS::MacOS::Video; use strict; use Parse::EDID qw(parse_edid); sub check { my $params = shift; my $common = $params->{common}; # make sure the user has access, cause that's the command that's gonna be run return(undef) unless -r '/usr/sbin/ioreg'; return(undef) unless -r '/usr/sbin/system_profiler'; return(undef) unless $common->can_load("Mac::SysProfile"); return 1; } sub run { my $params = shift; my $common = $params->{common}; # run the profiler to get our datatype my $profile = Mac::SysProfile->new(); my $data = $profile->gettype('SPDisplaysDataType'); # unless we get a valid return, bail out return(undef) unless(ref($data) eq 'ARRAY'); # we get video card because system_profiler XML output does not provide a human readable value my $video_names = $common->get_sysprofile_devices_names('SPDisplaysDataType'); return(undef) unless(ref($video_names) eq 'ARRAY'); my $count = 0; #Getting monitor serial number #TODO: get serial for multiples monitors my $ioreg_binary = `ioreg -lw0 | grep "EDID" | sed "/[^<]*{'monitor_name'}; my $ioreg_name = $ioreg->{'serial_number2'}; # add the video information foreach my $video (@$data){ my $memory; # macOS 10.13 doesn't have spdisplays_vram but has _spdisplays_vram if (exists($video->{'spdisplays_vram'})) { $memory = $video->{'spdisplays_vram'}; } elsif (exists($video->{'_spdisplays_vram'})) { $memory = $video->{'_spdisplays_vram'}; } $memory =~ s/ MB$//; $common->addVideo({ 'NAME' => $$video_names[$count], 'CHIPSET' => $video->{'sppci_model'}, 'MEMORY' => $memory, 'RESOLUTION' => $video->{'spdisplays_ndrvs'}[0]->{'spdisplays_resolution'}, }); foreach my $display (@{$video->{'spdisplays_ndrvs'}}){ my $serial; next unless(ref($display) eq 'HASH'); next if($display->{'_name'} eq 'spdisplays_display_connector'); $serial = $ioreg_serial if ($ioreg_name eq $display->{'_name'}); $common->addMonitor({ 'CAPTION' => $display->{'_name'}, 'SERIAL' => $serial, }) } $count++; } } 1; UnixAgent-2.4.2/lib/Ocsinventory/Agent/Backend/OS/Solaris.pm000066400000000000000000000021641332737732100235640ustar00rootroot00000000000000package Ocsinventory::Agent::Backend::OS::Solaris; use strict; use vars qw($runAfter); $runAfter = ["Ocsinventory::Agent::Backend::OS::Generic"]; sub check {$^O =~ /^solaris$/} sub run { my $params = shift; my $common = $params->{common}; my $OSName; my $OSComment; my $OSVersion; my $OSLevel; my $HWDescription; my ( $karch, $hostid, $proct, $platform); #Operating system informations chomp($OSName=`uname -s`); chomp($OSLevel=`uname -r`); chomp($OSComment=`uname -v`); open(FH, "< /etc/release") and do { chomp($OSVersion = readline (FH)); $OSVersion =~ s/^\s+//; close FH; }; chomp($OSVersion=`uname -v`) unless $OSVersion; chomp($OSVersion); $OSVersion=~s/^\s*//; $OSVersion=~s/\s*$//; # Hardware informations chomp($karch=`arch -k`); chomp($hostid=`hostid`); chomp($proct=`uname -p`); chomp($platform=`uname -i`); $HWDescription = "$platform($karch)/$proct HostID=$hostid"; $common->setHardware({ OSNAME => "$OSName $OSLevel", OSCOMMENTS => $OSComment, OSVERSION => $OSVersion, DESCRIPTION => $HWDescription }); } 1; UnixAgent-2.4.2/lib/Ocsinventory/Agent/Backend/OS/Solaris/000077500000000000000000000000001332737732100232235ustar00rootroot00000000000000UnixAgent-2.4.2/lib/Ocsinventory/Agent/Backend/OS/Solaris/Bios.pm000066400000000000000000000141351332737732100244610ustar00rootroot00000000000000package Ocsinventory::Agent::Backend::OS::Solaris::Bios; # SPARC # $ showrev #Hostname: 157501s021plc #Hostid: 83249bbf #Release: 5.10 #Kernel architecture: sun4u #Application architecture: sparc #Hardware provider: Sun_Microsystems #Domain: be.cnamts.fr #Kernel version: SunOS 5.10 Generic_118833-17 # # $ prtconf -pv (-b would be great...but doesn't work before S10) #System Configuration: Sun Microsystems sun4u #Memory size: 16384 Megabytes #System Peripherals (PROM Nodes): # #Node 0xf0819f00 # scsi-initiator-id: 00000007 # node#: 00000000 # #size-cells: 00000002 # stick-frequency: 00bebc20 # clock-frequency: 08f0d180 # idprom: 01840014.4f4162cb.45255cf4.4162cb16.55555555.55555555.55555555.55555555 # breakpoint-trap: 0000007f # device_type: 'gptwo' # banner-name: 'Sun Fire E6900' # compatible: 'SUNW,Serengeti' # newio-addr: 00000001 # name: 'SUNW,Sun-Fire' # X64 # $ showrev #Hostname: stlaurent #Hostid: 403100b #Release: 5.10 #Kernel architecture: i86pc #Application architecture: i386 #Hardware provider: #Domain: #Kernel version: SunOS 5.10 Generic_127112-07 # # $ smbios -t SMB_TYPE_SYSTEM #ID SIZE TYPE #1 76 SMB_TYPE_SYSTEM (system information) # # Manufacturer: Sun Microsystems, Inc. # Product: Sun Fire V40z # Version: 00 # Serial Number: R00T34E0009 # # UUID: be1630df-d130-41a4-be32-fd28bb4bd1ac # Wake-Up Event: 0x6 (power switch) # SKU Number: # Family: use strict; sub run { my $params = shift; my $common = $params->{common}; my $zone; my( $SystemSerial , $SystemModel, $SystemManufacturer, $ChassisType, $MotherBoardSerial, $MotherBoardModel, $MotherBoardManufacturer, $BiosManufacturer, $BiosVersion, $BiosDate, $aarch); if ( !$common->can_run("zonename") || `zonename` =~ /global/ ) { # Ether pre Sol10 or in Sol10/Sol11 global zone $zone = "global"; } else { $zone = ""; } if ($zone){ chomp($SystemModel = `uname -m`); chomp($aarch = `uname -p`); if( $aarch eq "i386" ){ # # For a Intel/AMD arch, we're using smbios # foreach(`/usr/sbin/smbios -t SMB_TYPE_SYSTEM`) { if(/^\s*Manufacturer:\s*(.+)$/){$SystemManufacturer = $1}; if(/^\s*Serial Number:\s*(.+)$/){$SystemSerial = $1;} if(/^\s*Product:\s*(.+)$/){$SystemModel = $1;} } foreach(`/usr/sbin/smbios -t SMB_TYPE_BIOS`) { if(/^\s*Vendor:\s*(.+)$/){$BiosManufacturer = $1}; if(/^\s*Version String:\s*(.+)$/){$BiosVersion = $1}; if(/^\s*Release Date:\s*(.+)$/){$BiosDate = $1}; } foreach(`/usr/sbin/smbios -t SMB_TYPE_BASEBOARD`) { if(/^\s*Product\s*(.+)$/){$MotherBoardModel = $1}; if(/^\s*Serial Number:\s*(.+)$/){$MotherBoardSerial = $1}; if(/^\s*Manufacturer:\s*(.+)$/){$MotherBoardManufacturer = $1}; } foreach(`/usr/sbin/smbios -t SMB_TYPE_CHASSIS`) { if(/^\s*Chassis Type:.*\((.+)\)$/) {$ChassisType = $1}; } } elsif( $aarch eq "sparc" ) { # # For a Sparc arch, we're using prtconf # my $name; my $OBPstring; my $found=0; if ( $common->can_run("virtinfo") && `virtinfo -t` =~ /.*LDoms guest.*/ ) { foreach(`virtinfo -a`) { if(/^Domain role:\s*(.+)$/) {$ChassisType = $1}; if(/^Chassis serial.:\s*(.+)$/) {$SystemSerial = $1}; } } foreach(`/usr/sbin/prtconf -pv`) { # prtconf is an awful thing to parse if(/^System Configuration:\s*(.+)\s+\S+$/) {$SystemManufacturer = $1; $BiosManufacturer = $1; } if(/^\s*banner-name:\s*'(.+)'$/){$SystemModel = $1;} unless ($name) { if(/^\s*name:\s*'(.+)'$/){$name = $1;} } unless ($OBPstring) { if(/^\s*version:\s*'(.+)'$/){ $OBPstring = $1; # looks like : "OBP 4.33.6.f 2014/07/10 10:24" # with further informations sometimes if( $OBPstring =~ m@OBP\s+(\S+)\s+(\d+)/(\d+)/(\d+)@ ){ $BiosVersion = "OBP $1"; $BiosDate = "$2/$3/$4"; } else { $BiosVersion = $OBPstring } } } } $SystemModel .= " ($name)" if( $name ); if ( $common->can_run("ipmitool") ) { foreach(`/usr/sbin/ipmitool fru print`) { if (/^\s*Chassis Type\s+:\s+(.+)/) { $ChassisType = $1; $found = 1; } elsif ( $found && /^\s*Product Serial\s+:\s+(.+)/) { $SystemSerial = $1; last; } } } if ( !$SystemSerial ) { # No serial found via ipmitool, so use sneep if( -x "/opt/SUNWsneep/bin/sneep" ) { chomp($SystemSerial = `/opt/SUNWsneep/bin/sneep`); }else { foreach(`/bin/find /opt -name sneep`) { chomp($SystemSerial = `$1`) if /^(\S+)/; } if (!$SystemSerial){ $SystemSerial = "Please install package SUNWsneep"; } } } } }else{ foreach(`showrev`){ if(/^Hardware provider:\s+(\S+)/){$SystemManufacturer = $1}; } $SystemModel = "Solaris Containers"; $SystemSerial = "Solaris Containers"; } # Writing data $common->setBios ({ BVERSION => $BiosVersion, BDATE => $BiosDate, BMANUFACTURER => $BiosManufacturer, SMANUFACTURER => $SystemManufacturer, SMODEL => $SystemModel, SSN => $SystemSerial, MMANUFACTURER => $MotherBoardManufacturer, MSN => $MotherBoardSerial, TYPE => $ChassisType, MMODEL => $MotherBoardModel }); } 1; UnixAgent-2.4.2/lib/Ocsinventory/Agent/Backend/OS/Solaris/CPU.pm000066400000000000000000000351611332737732100242160ustar00rootroot00000000000000package Ocsinventory::Agent::Backend::OS::Solaris::CPU; use strict; sub check { my $params = shift; my $common = $params->{common}; my $logger = $params->{logger}; if (!$common->can_run ("memconf")) { $logger->debug('memconf not found in $PATH'); return; } 1; } sub run { my $params = shift; my $common = $params->{common}; #modif 20100329 my @cpu; my $current; my $cpu_core; my $cpu_thread; my $cpu_slot; my $cpu_speed; my $cpu_type; my $model; my $zone; my $sun_class_cpu=0; my $cpusocket=1; my $cpu_arch; my $cpu_manufacturer; my $data_width; my %coretable = ( 'dual', 2, 'quad', 4, 'six', 6, 'eight', 8, 'ten', 10, 'twelve', 12 ); my $aarch; chomp($aarch = `uname -p`); chomp($cpu_arch = `uname -m`); chomp($data_width = `isainfo -b`); if ( !$common->can_run("zonename") || `zonename` =~ /global/ ) { # Either pre Sol10 or in Sol10/Sol11 global zone $zone = "global"; } else { # Sol10/Sol11 local zone $zone = ""; } if ($zone) { if ( $aarch =~ /sparc/ && $common->can_run("virtinfo") && `virtinfo -t` =~ /.*LDoms guest.*/ ) { $model = "Solaris Ldom"; } else { chomp($model = `uname -i`); } } else { $model = "Solaris Containers"; } #print "CPU Model: $model\n"; # we map (hopfully) our server model to a known class # # #sun_class_cpu sample out from memconf # 0 (default) generic detection with prsinfo # 1 Sun Microsystems, Inc. Sun Fire 880 (4 X UltraSPARC-III 750MHz) # 2 Sun Microsystems, Inc. Sun Fire V490 (2 X dual-thread UltraSPARC-IV 1350MHz) # 3 Sun Microsystems, Inc. Sun-Fire-T200 (Sun Fire T2000) (8-core quad-thread UltraSPARC-T1 1000MHz) # 4 Sun Microsystems, Inc. SPARC Enterprise T5220 (4-core 8-thread UltraSPARC-T2 1165MHz) # #if ($model eq "SUNW,Sun-Fire-280R") { $sun_class_cpu = 1; } #if ($model eq "SUNW,Sun-Fire-480R") { $sun_class_cpu = 1; } #if ($model eq "SUNW,Sun-Fire-V240") { $sun_class_cpu = 1; } #if ($model eq "SUNW,Sun-Fire-V245") { $sun_class_cpu = 1; } #if ($model eq "SUNW,Sun-Fire-V250") { $sun_class_cpu = 1; } #if ($model eq "SUNW,Sun-Fire-V440") { $sun_class_cpu = 1; } #if ($model eq "SUNW,Sun-Fire-V445") { $sun_class_cpu = 1; } #if ($model eq "SUNW,Sun-Fire-880") { $sun_class_cpu = 1; } #if ($model eq "SUNW,Sun-Fire-V490") { $sun_class_cpu = 2; } #if ($model eq "SUNW,Netra-T12") { $sun_class_cpu = 2; } #if ($model eq "SUNW,Sun-Fire-T200") { $sun_class_cpu = 3; } #if ($model eq "SUNW,SPARC-Enterprise-T1000") { $sun_class_cpu = 4; } #if ($model eq "SUNW,SPARC-Enterprise-T5220") { $sun_class_cpu = 4; } #if ($model eq "SUNW,SPARC-Enterprise-T5240") { $sun_class_cpu = 4; } #if ($model eq "SUNW,SPARC-Enterprise-T5120") { $sun_class_cpu = 4; } #if ($model eq "SUNW,SPARC-Enterprise") { $sun_class_cpu = 4; } if ($model =~ /SUNW,SPARC-Enterprise/) { $sun_class_cpu = 5; } # M5000 if ($model =~ /SUNW,SPARC-Enterprise-T\d/){ $sun_class_cpu = 4; } #T5220 - T5210 if ($model =~ /SUNW,Netra-T/){ $sun_class_cpu = 2; } if ($model =~ /SUNW,Sun-Fire-\d/){ $sun_class_cpu = 1; } if ($model =~ /SUNW,Sun-Fire-V/){ $sun_class_cpu = 2; } if ($model =~ /SUNW,Sun-Fire-T\d/) { $sun_class_cpu = 3; } if ($model =~ /Solaris Containers/){ $sun_class_cpu = 6; } if ($model =~ /SUNW,SPARCstation/) { $sun_class_cpu = 7; } if ($model =~ /SUNW,Sun-Blade-100/) { $sun_class_cpu = 7; } if ($model =~ /SUNW,Sun-Blade-1500/) { $sun_class_cpu = 7; } if ($model =~ /SUNW,Ultra/) { $sun_class_cpu = 7; } if ($model =~ /FJSV,GPUZC-M/) { $sun_class_cpu = 8; } # Recent and current hardware if ($model =~ /SUNW,T5/) { $sun_class_cpu = 20; } # T5240, T5440 if ($model =~ /i86pc/) { $sun_class_cpu = 21; } # Solaris Intel if ($model =~ /sun4v/) { $sun_class_cpu = 22; } # T3-x, T4-x, T5-x if ($model =~ /Solaris Ldom/){ $sun_class_cpu = 23; } if($sun_class_cpu == 0) { # if our maschine is not in one of the sun classes from upside, we use psrinfo # a generic methode foreach (`psrinfo -v`) { if (/^\s+The\s(\w+)\sprocessor\soperates\sat\s(\d+)\sMHz,/) { $cpu_type = $1; $cpu_speed = $2; $cpu_slot++; } } } if($sun_class_cpu == 1) { # Sun Microsystems, Inc. Sun Fire 880 (4 X UltraSPARC-III 750MHz) foreach (`memconf 2>&1`) { if(/^Sun Microsystems, Inc. Sun Fire\s+\S+\s+\((\d+)\s+X\s+(\S+)\s+(\d+)/) { $cpu_manufacturer = "Sun Microsystems, Inc."; $cpu_slot = $1; $cpu_type = $2; $cpu_speed = $3; $cpu_core=$1; $cpu_thread="0"; } elsif (/^Sun Microsystems, Inc. Sun Fire\s+\S+\s+\((\S+)\s+(\d+)/) { $cpu_manufacturer = "Sun Microsystems, Inc."; $cpu_slot="1"; $cpu_type=$1; $cpu_speed=$2; $cpu_core="1"; $cpu_thread="0"; } } } if($sun_class_cpu == 2) { #Sun Microsystems, Inc. Sun Fire V490 (2 X dual-thread UltraSPARC-IV 1350MHz) foreach (`memconf 2>&1`) { if(/^Sun Microsystems, Inc. Sun Fire\s+\S+\s+\((\d+)\s+X\s+(\S+)\s+(\S+)\s+(\d+)/) { $cpu_manufacturer = "Sun Microsystems, Inc."; $cpu_slot = $1; $cpu_type = $3 . " (" . $2 . ")"; $cpu_speed = $4; $cpu_core=$1; $cpu_thread=$2; } elsif (/^Sun Microsystems, Inc. Sun Fire\s+V\S+\s+\((\d+)\s+X\s+(\S+)\s+(\d+)(\S+)/) { $cpu_manufacturer = "Sun Microsystems, Inc."; $cpu_slot = $1; $cpu_type = $2 . " (" . $1 . ")"; $cpu_speed = $3; $cpu_core=$1; $cpu_thread=$2; } # Sun Microsystems, Inc. Sun Fire V240 (UltraSPARC-IIIi 1002MHz) elsif (/^Sun Microsystems, Inc. Sun Fire\s+\S+\s+\((\S+)\s+(\d+)/) { $cpu_manufacturer = "Sun Microsystems, Inc."; $cpu_slot="1"; $cpu_type=$1; $cpu_speed=$2; $cpu_core="1"; $cpu_thread="0"; } } } if($sun_class_cpu == 3) { foreach (`memconf 2>&1`) { #Sun Microsystems, Inc. Sun-Fire-T200 (Sun Fire T2000) (8-core quad-thread UltraSPARC-T1 1000MHz) #Sun Microsystems, Inc. Sun-Fire-T200 (Sun Fire T2000) (4-core quad-thread UltraSPARC-T1 1000MHz) if(/^Sun Microsystems, Inc.\s+\S+\s+\(\S+\s+\S+\s+\S+\)\s+\((\d+).*\s+(\S+)-\S+\s+(\S+)\s+(\d+)/) { # T2000 has only one CPU $cpu_manufacturer = "Sun Microsystems, Inc."; $cpu_slot = 1; $cpu_type = "$3 ($1-Core $2-Thread)"; $cpu_speed = $4; $cpu_core=$1; $cpu_thread = $coretable{lc($2)}; } } } if($sun_class_cpu == 4) { foreach (`memconf 2>&1`) { #Sun Microsystems, Inc. SPARC Enterprise T5120 (8-core 8-thread UltraSPARC-T2 1165MHz) #Sun Microsystems, Inc. SPARC Enterprise T5120 (4-core 8-thread UltraSPARC-T2 1165MHz) #Oracle Corporation SPARC Enterprise T5220 (8-Core 8-Thread UltraSPARC-T2 1415MHz) if(/^(.*)\s+SPARC.+\((\d+)*(\S+)\s+(\d+)*(\S+)\s+(\S+)\s+(\d+)MHz\)/) { $cpu_manufacturer = $1; $cpu_slot = 1; $cpu_type = "$6 ($2-Core $4-Thread)"; $cpu_speed = $7; $cpu_core=$2; $cpu_thread=$4; } } } if($sun_class_cpu == 5) { foreach (`memconf 2>&1`) { #Sun Microsystems, Inc. Sun SPARC Enterprise M5000 Server (6 X dual-core dual-thread SPARC64-VI 2150MHz) #Sun Microsystems, Inc. SPARC Enterprise M8000 Server (2 X Quad-Core Dual-Thread SPARC64-VII 2520MHz) #Fujitsu SPARC Enterprise M4000 Server (4 X dual-core dual-thread SPARC64-VI 2150MHz) if(/^Sun Microsystems, Inc\..+\((\d+)\s+X\s+(\S+)-\S+\s+(\S+)-\S+\s+(\S+)\s+(\d+)/) { $cpu_manufacturer = "Sun Microsystems, Inc."; $cpu_slot = $1; $cpu_type = "$4 ($2-Core $3-Thread)"; $cpu_speed = $5; $cpu_core = $coretable{lc($2)}; $cpu_thread = $coretable{lc($3)}; } #Fujitsu SPARC Enterprise M4000 Server (4 X dual-core dual-thread SPARC64-VI 2150MHz) if(/^Fujitsu SPARC Enterprise.*\((\d+)\s+X\s+(\S+)-\S+\s+(\S+)-\S+\s+(\S+)\s+(\d+)/) { $cpu_manufacturer = "Fujitsu"; $cpu_slot = $1; $cpu_type = "$4 ($2-Core $3-Thread)"; $cpu_speed = $5; $cpu_core = $coretable{lc($2)}; $cpu_thread = $coretable{lc($3)}; } } } if($sun_class_cpu == 6) { $cpu_manufacturer = "Solaris Container"; foreach (`prctl -n zone.cpu-shares $$`) { $cpu_type = $1 if /^zone.(\S+)$/; $cpu_type = $cpu_type." ".$1 if /^\s*privileged+\s*(\d+).*$/; $cpu_slot = 1 if /^\s*privileged+\s*(\d+).*$/; } } if($sun_class_cpu == 7) { foreach(`memconf 2>&1`) { #Sun Microsystems, Inc. Sun Blade 1500 (UltraSPARC-IIIi 1062MHz) #Sun Microsystems, Inc. Sun Blade 100 (UltraSPARC-IIe 502MHz) #Sun Microsystems, Inc. Sun Ultra 5/10 UPA/PCI (UltraSPARC-IIi 333MHz) #Sun Microsystems, Inc. Sun Ultra 1 SBus (UltraSPARC 143MHz) #Sun Microsystems, Inc. SPARCstation 20 (1 X 390Z50) (SuperSPARC 50MHz) #Sun Microsystems, Inc. SPARCstation 5 (TurboSPARC-II 170MHz) if (/^Sun Microsystems, Inc\..+\((\S+)\s+(\d+)MHz\)/) { $cpu_manufacturer = "Sun Microsystems, Inc."; $cpu_slot = 1; $cpu_type = $1; $cpu_speed = $2; $cpu_core = 1; $cpu_thread = 0; } } } if ($sun_class_cpu == 8) { foreach (`memconf 2>&1`){ #Fujitsu PRIMEPOWER450 4x SPARC64 V clone (4 X SPARC64-V 1978MHz) #Fujitsu PRIMEPOWER250 2x SPARC64 V clone (2 X SPARC64-V 1649MHz) if (/^FJSV,GPUZC-M.+\((\d+)\s+X\s+(\S+)\s+(\d+)MHz\)/) { $cpu_manufacturer = "Fujitsu"; $cpu_slot = $1; $cpu_type = $2; $cpu_speed = $3; $cpu_core = $1; $cpu_thread = "0"; } } } if ($sun_class_cpu == 20) { foreach (`memconf 2>&1`) { #Oracle Corporation T5240 (2 X 8-Core 8-Thread UltraSPARC-T2+ 1582MHz) #Oracle Corporation T5440 (4 X 8-Core 8-Thread UltraSPARC-T2+ 1596MHz) #Sun Microsystems, Inc. T5240 (2 X 8-Core 8-Thread UltraSPARC-T2+ 1582MHz) if(/^(.*)\s+T\d+\s+\((\d+)\s+X\s+(\d+)-\S+\s+(\d)+-\S+\s+(\S+)\s+(\d+)MHz\)/) { $cpu_manufacturer = $1; $cpu_slot = $2; $cpu_type = "$5 ($3-Core $4-Thread)"; $cpu_speed = $6; $cpu_core = $3; $cpu_thread = $4; } } } if ($sun_class_cpu == 21) { foreach (`memconf 2>&1`) { # Solaris on x86 #Oracle Corporation Sun Fire X4270 Server (2 X Quad-Core Hyper-Threaded Intel(R) Xeon(R) X5570 @ 2.93GHz) #HP ProLiant DL380 G5 (2 X Quad-Core Intel(R) Xeon(R) E5430 @ 2.66GHz) #HP ProLiant DL380 G7 (2 X Six-Core Hyper-Threaded Intel(R) Xeon(R) X5670 @ 2.93GHz) #HP ProLiant DL580 G7 (4 X Ten-Core Hyper-Threaded Intel(R) Xeon(R) E7- 4860 @ 2.27GHz) #HP ProLiant DL380p Gen8 (2 X Eight-Core Hyper-Threaded Intel(R) Xeon(R) E5-2660 0 @ 2.20GHz Proc 2) #HP ProLiant DL380 Gen9 (2 X Twelve-Core Hyper-Threaded Intel(R) Xeon(R) E5-2680 v3 @ 2.50GHz Proc 2 2497MHz) if(/^.*\((\d+) X (\S+)-Core Hyper-Threaded (\S+)(.*) @ (\S+)GHz.*\)/) { # Hyper-Threaded CPU $cpu_manufacturer = $3; $cpu_slot = $1; $cpu_type = $3 . $4; $cpu_speed = $5 * 1000; $cpu_core = $coretable{lc($2)}; $cpu_thread = "on"; } elsif(/^.*\((\d+) X (\S+)-Core (\S+)(.*) @ (\S+)GHz.*\)/) { # Non Hyper-Threaded CPU $cpu_manufacturer = $3; $cpu_slot = $1; $cpu_type = $3 . $4; $cpu_speed = $5 * 1000; $cpu_core = $coretable{lc($2)}; $cpu_thread = "off"; } elsif(/^.*\((\S+)-Core (\S+)(.*) @ (\S+)GHz.*\)/) { # single core CPU $cpu_manufacturer = $2; $cpu_slot = 1; $cpu_type = $2 . $3; $cpu_speed = $4 * 1000; $cpu_core = $coretable{lc($1)}; $cpu_thread = "off"; } } } if ($sun_class_cpu == 22) { foreach (`memconf 2>&1`) { #Oracle Corporation SPARC T3-1 (16-Core 8-Thread SPARC-T3 1649MHz) #Oracle Corporation SPARC T3-2 (2 X 16-Core 8-Thread SPARC-T3 1649MHz) #Oracle Corporation SPARC T4-1 (8-Core 8-Thread SPARC-T4 2848MHz) #Oracle Corporation SPARC T4-2 (2 X 8-Core 8-Thread SPARC-T4 2848MHz) #Oracle Corporation SPARC T4-4 (4 X 8-Core 8-Thread SPARC-T4 2998MHz) #Oracle Corporation SPARC T5-2 (16-Core 8-Thread SPARC-T5 3600MHz) #Oracle Corporation SPARC T5-4 (4 X 16-Core 8-Thread SPARC-T5 3600MHz) if(/^Oracle Corporation.+\((\d+)-Core (\d+)-Thread (\S+) (\d+)MHz\)/) { # Single CPU string $cpu_manufacturer = "Oracle Corporation"; $cpu_slot = 1; $cpu_type = "$3 ($1-Core $2-Thread)"; $cpu_speed = $4; $cpu_core = $1; $cpu_thread = $2; } elsif(/^Oracle Corporation.+\((\d+) X (\d+)-Core (\d+)-Thread (\S+) (\d+)MHz\)/) { # Multiple CPU string $cpu_manufacturer = "Oracle Corporation"; $cpu_slot = $1; $cpu_type = "$4 ($2-Core $3-Thread)"; $cpu_speed = $5; $cpu_core = $2; $cpu_thread = $3; } } } if($sun_class_cpu == 23) { # Solaris LDom support $cpu_slot=1; $cpu_core = 0; $cpu_thread = 0; $cpu_manufacturer = "Solaris LDom"; foreach (`psrinfo -pv`) { if (/^The physical processor has.* (\d+) virtual processors.*/) { $cpu_thread = $cpu_thread + $1; } elsif (/^\s+(\S+)\s+\(.*clock\s+(\d+)\sMHz\)/) { $cpu_type = $1; $cpu_speed = $2; } } } # for debug only #print "cpu_slot: " . $cpu_slot . "\n"; #print "cpu_type: " . $cpu_type . "\n"; #print "cpu_speed: " . $cpu_speed . "\n"; #print "cpu_core: " . $cpu_core . "\n"; #print "cpu_thread: " . $cpu_thread . "\n"; # Finally, add the found CPUs for $cpusocket ( 1 .. $cpu_slot ) { $current->{MANUFACTURER} = $cpu_manufacturer if $cpu_manufacturer; $current->{SPEED} = $cpu_speed if $cpu_speed; $current->{CURRENT_SPEED} = $cpu_speed if $cpu_speed; $current->{TYPE} = $cpu_type if $cpu_type; $current->{CORES} = $cpu_core if $cpu_core; $current->{CPUARCH} = $cpu_arch if $cpu_arch; if ( $cpu_core == 0 ) { $current->{LOGICAL_CPUS} = $cpu_thread if ( $cpu_thread ); } else { $current->{LOGICAL_CPUS} = $cpu_core * $cpu_thread if ( $cpu_core && $cpu_thread ); } $current->{DATA_WIDTH} = $data_width if $data_width; $common->addCPU($current); } # insert to values we have found # $common->setHardware({ # PROCESSORT => $cpu_type, # PROCESSORN => $cpu_slot, # PROCESSORS => $cpu_speed # }); } #run(); 1; UnixAgent-2.4.2/lib/Ocsinventory/Agent/Backend/OS/Solaris/Controllers.pm000066400000000000000000000015301332737732100260660ustar00rootroot00000000000000package Ocsinventory::Agent::Backend::OS::Solaris::Controllers; use strict; sub check { my $params = shift; my $common = $params->{common}; $common->can_run ("cfgadm") } sub run { my $params = shift; my $common = $params->{common}; my $name; my $type; my $description; foreach(`cfgadm -s cols=ap_id:type:info`){ $name = $type = $description = ""; next if (/^Ap_Id/); if (/^(\S+)\s+/){ $name = $1; } if(/^\S+\s+(\S+)/){ $type = $1; } #No manufacturer, but informations about controller if(/^\S+\s+\S+\s+(.*)/){ $description = $1; } $common->addController({ 'NAME' => $name, 'TYPE' => $type, 'DESCRIPTION' => $description, }); } } 1; UnixAgent-2.4.2/lib/Ocsinventory/Agent/Backend/OS/Solaris/Domains.pm000066400000000000000000000013451332737732100251560ustar00rootroot00000000000000package Ocsinventory::Agent::Backend::OS::Solaris::Domains; use strict; sub check { my $params = shift; my $common = $params->{common}; $common->can_run ("domainname") } sub run { my $params = shift; my $common = $params->{common}; my $domain; chomp($domain = `domainname`); if (!$domain) { my %domain; if (open RESOLV, "/etc/resolv.conf") { while() { $domain{$2} = 1 if (/^(domain|search)\s+(.+)/); } close RESOLV; } $domain = join "/", keys %domain; } # If no domain name, we send "WORKGROUP" $domain = 'WORKGROUP' unless $domain; $common->setHardware({ WORKGROUP => $domain }); } 1; UnixAgent-2.4.2/lib/Ocsinventory/Agent/Backend/OS/Solaris/Drives.pm000066400000000000000000000037021332737732100250170ustar00rootroot00000000000000package Ocsinventory::Agent::Backend::OS::Solaris::Drives; #Filesystem kbytes used avail capacity Mounted on #/dev/vx/dsk/bootdg/rootvol 16525754 5423501 10936996 34% / #/devices 0 0 0 0% /devices #ctfs 0 0 0 0% /system/contract #proc 0 0 0 0% /proc #mnttab 0 0 0 0% /etc/mnttab use strict; sub check { my $params = shift; my $common = $params->{common}; $common->can_run ("df") } sub run { my $params = shift; my $common = $params->{common}; my $free; my $filesystem; my $total; my $type; my $volumn; #Looking for mount points and disk space for (`df -k`){ if (/^Filesystem\s*/){next}; # on Solaris 10 and up, /devices is an extra mount which we like to exclude if (/^\/devices/){next}; # on Solaris 10 and up, /platform/.../libc_psr_hwcap1.so.1 is an extra mount which we like to exclude if (/^\/platform/){next}; # exclude cdrom mount point if (/^\/.*\/cdrom/){next}; if (/^swap.*/){next}; # exclude special entries such as ctfs, proc, mnttab, etc... if (/^.*\s+0\s+0\s+0.*/){next}; # skip nfs (dirty hack) if (/^\S+:\/.*/){next}; # everything else is a local filesystem if (/^(\S+)\s+(\S+)\s+(\S+)\s+(\S+)\s+(\S+)\s+(\S+)\n/){ $filesystem = $6; $total = sprintf("%i",($2/1024)); $free = sprintf("%i",($4/1024)); $volumn = $1; chomp($type = `mount -v | grep " $filesystem "`); $type =~ s/\S+\s+on\s+\S+\s+type\s+(\S+)\s+.*/$1/; $common->addDrive({ FREE => $free, FILESYSTEM => $filesystem, TOTAL => $total, TYPE => $type, VOLUMN => $volumn }); } } } 1; UnixAgent-2.4.2/lib/Ocsinventory/Agent/Backend/OS/Solaris/IPv4.pm000066400000000000000000000022011332737732100243360ustar00rootroot00000000000000package Ocsinventory::Agent::Backend::OS::Solaris::IPv4; sub check { my $params = shift; my $common = $params->{common}; $common->can_run ("ifconfig") } # Initialise the distro entry sub run { my $params = shift; my $common = $params->{common}; my %ip; my $ip; my $hostn; #Looking for ip addresses with ifconfig, except loopback # Solaris need -a option for (`ifconfig -a`){#ifconfig in the path #Solarisligne inet if (/^\s*inet\s+(\S+).*/){($1=~/127.+/)?next:($ip{$1}=1)}; } # Ok. Now, we have the list of IP addresses configured # We could have too many addresses to list them in HW # (details will be sent in Networks instead) # # How could we choose ? # # Let's try to resolve the name of our server # chomp( $hostn = `uname -n` ); if ($hostn) { my $aip; foreach (`ping -s $hostn 10 1`) { unless ( $ip ) { if( /^.*\((\d+\.\d+\.\d+\.\d+)\):.*/ ) { $aip = $1; $ip = $aip if( exists($ip{$aip}) ); } } } } $common->setHardware({IPADDR => $ip}); } 1; UnixAgent-2.4.2/lib/Ocsinventory/Agent/Backend/OS/Solaris/Mem.pm000066400000000000000000000013241332737732100242770ustar00rootroot00000000000000package Ocsinventory::Agent::Backend::OS::Solaris::Mem; use strict; sub check { my $params = shift; my $common = $params->{common}; $common->can_run ("swap") && $common->can_run ("prtconf") } sub run { my $params = shift; my $common = $params->{common}; #my $unit = 1024; my $PhysicalMemory; my $SwapFileSize; # Memory informations foreach(`prtconf`){ if(/^Memory\ssize:\s+(\S+)/){ #print "total memoire: $1"; $PhysicalMemory = $1}; } #Swap Informations foreach(`swap -l`){ if(/\s+(\S+)$/){$SwapFileSize = $1}; } $common->setHardware({ MEMORY => $PhysicalMemory, SWAP => $SwapFileSize }); } 1 UnixAgent-2.4.2/lib/Ocsinventory/Agent/Backend/OS/Solaris/Memory.pm000066400000000000000000000545031332737732100250400ustar00rootroot00000000000000package Ocsinventory::Agent::Backend::OS::Solaris::Memory; use strict; sub check { my $params = shift; my $common = $params->{common}; $common->can_run ("memconf") } sub run { my $model; my $params = shift; my $common = $params->{common}; my $logger = $params->{logger}; my $capacity; my $description; my $numslots; my $speed = undef; my $type = undef; my $banksize; my $module_count=0; my $empty_slots; my $flag=0; my $flag_mt=0; my $caption; my $sun_class=0; my $OSLevel; my $zone; my $aarch; # for debug only my $j=0; # first, we need determinate on which model of sun server we run, # because prtdiags output (and with that memconfs output) is differend # from server model to server model # we try to classified our box in one of the known classes chomp($OSLevel = `uname -r`); chomp($aarch = `uname -p`); if ( !$common->can_run("zonename") || `zonename` =~ /global/ ) { # Either pre Sol10 or in Sol10/Sol11 global zone $zone = "global"; }else{ # Sol10/Sol11 local zone $zone = ""; } #print "Nom :".$zone."*************************\n"; if ($zone) { if ( $aarch =~ /sparc/ && $common->can_run("virtinfo") && `virtinfo -t` =~ /.*LDoms guest.*/ ) { $model = "Solaris Ldom"; }else{ chomp($model = `uname -i`); } }else{ $model="Solaris Containers"; } #print "Memory Model: $model\n"; #$model=`uname -i`; # debug print model #print "Model: '$model'"; # cut the CR from string model #$model = substr($model, 0, length($model)-1); # we map (hopfully) our server model to a known class #if ($model eq "SUNW,Sun-Fire-280R") { $sun_class = 1; } #if ($model eq "SUNW,Sun-Fire-480R") { $sun_class = 1; } #if ($model eq "SUNW,Sun-Fire-V490") { $sun_class = 1; } #if ($model eq "SUNW,Sun-Fire-880") { $sun_class = 1; } #if ($model eq "SUNW,Sun-Fire-V240") { $sun_class = 2; } #if ($model eq "SUNW,Sun-Fire-V440") { $sun_class = 2; } #if ($model eq "SUNW,Sun-Fire-V250") { $sun_class = 2; } #if ($model eq "SUNW,Sun-Fire-T200") { $sun_class = 3; } #if ($model eq "SUNW,Sun-Fire-T1000") { $sun_class = 3; } #if ($model eq "SUNW,SPARC-Enterprise-T5220") { $sun_class = 4; } #if ($model eq "SUNW,SPARC-Enterprise") { $sun_class = 5; } # for M5000 && M4000 if ($model =~ /SUNW,SPARC-Enterprise/) { $sun_class = 5; } # for M5000 && M4000 if ($model =~ /SUNW,SPARC-Enterprise-T\d/){ $sun_class = 4; } if ($model =~ /SUNW,Netra-T/){ $sun_class = 2; } if ($model =~ /SUNW,Sun-Fire-\d/){ $sun_class = 1; } if ($model =~ /SUNW,Sun-Fire-V/){ $sun_class = 2; } if ($model =~ /SUNW,Sun-Fire-V490/) { $sun_class = 1; } if ($model =~ /SUNW,Sun-Fire-T\d/) { $sun_class = 3; } if ($model =~ /SUNW,SPARCstation/) { $sun_class = 3; } if ($model =~ /SUNW,Ultra-/) { $sun_class = 3; } if ($model =~ /SUNW,Sun-Blade-100/) { $sun_class = 8; } if ($model =~ /SUNW,Sun-Blade-1500/) { $sun_class = 8; } if ($model =~ /SUNW,T\d/) { $sun_class = 3; } if ($model =~ /Solaris Containers/){ $sun_class = 7; } if ($model =~ /Solaris Ldom/) { $sun_class = 7; } if ($model =~ /i86pc/) { $sun_class = 6; } if ($model =~ /sun4v/) { $sun_class = 3; } # debug print model #print "Sunclass: $sun_class\n"; # now we can look at memory information, depending from our class if($sun_class == 0) { $logger->debug("sorry, unknown model, could not detect memory configuration"); } if($sun_class == 1) { foreach(`memconf 2>&1`) { # debug #print "count: " .$j++ . " " . $flag_mt . " : " . "$_"; # if we find "empty groups:", we have reached the end and indicate that by setting flag = 0 if(/^empty \w+:\s(\S+)/) { $flag = 0; if($1 eq "None"){$empty_slots = 0;} } # grep the type of memory modules from heading if($flag_mt && /^\s*\S+\s+\S+\s+\S+\s+\S+\s+(\S+)/) {$flag_mt=0; $description = $1;} # only grap for information if flag = 1 if ($flag && /^\s*(\S+)\s+(\S+)/) { $caption = "Board " . $1 . " MemCtl " . $2; } if ($flag && /^\s*\S+\s+\S+\s+(\S+)/) { $numslots = $1; } if ($flag && /^\s*\S+\s+\S+\s+\S+\s+(\d+)/) { $banksize = $1; } if ($flag && /^\s*\S+\s+\S+\s+\S+\s+\S+\s+\S+\s+(\d+)/) { $capacity = $1; } if ($flag) { for (my $i = 1; $i <= ($banksize / $capacity); $i++) { #print "Caption: " . $caption . " Description: " . $description . " Bank Number: " . $numslots . " DIMM Capacity: " . $capacity . "MB\n"; $module_count++; $common->addMemory({ CAPACITY => $capacity, DESCRIPTION => $description, CAPTION => $caption, SPEED => $speed, TYPE => $type, NUMSLOTS => $numslots }) } } # this is the caption line if(/^\s+Logical Logical Logical/) { $flag_mt = 1; } # if we find "---", we set flag = 1, and in next line, we start to look for information if(/^-+/){ $flag = 1; } } #print "# of RAM Modules: " . $module_count . "\n"; #print "# of empty slots: " . $empty_slots . "\n"; } if($sun_class == 2) { foreach(`memconf 2>&1`) { # debug #print "line: " .$j++ . " " . $flag_mt . "/" . $flag ." : " . "$_"; # if we find "empty sockets:", we have reached the end and indicate that by resetting flag = 0 # emtpy sockets is follow by a list of emtpy slots, where we extract the slot names if(/^empty sockets:\s*(\S+)/) { $flag = 0; # cut of first 15 char containing the string empty sockets: substr ($_,0,15) = ""; $capacity = "empty"; $numslots = 0; foreach $caption (split) { if ($caption eq "None") { $empty_slots = 0; # no empty slots -> exit loop last; } # debug #print "Caption: " . $caption . " Description: " . $description . " Bank Number: " . $numslots . " DIMM Capacity: " . $capacity . "MB\n"; $empty_slots++; $common->addMemory({ CAPACITY => $capacity, DESCRIPTION => $description, CAPTION => $caption, SPEED => $speed, TYPE => $type, NUMSLOTS => $numslots }) } } if(/.*Memory Module Groups.*/) { $flag = 0; $flag_mt = 0; } # we only grap for information if flag = 1 if($flag && /^\s*\S+\s+\S+\s+(\S+)/){ $caption = $1; } if($flag && /^\s*(\S+)/){ $numslots = $1; } if($flag && /^\s*\S+\s+\S+\s+\S+\s+(\d+)/){ $capacity = $1; } if($flag) { # debug #print "Caption: " . $caption . " Description: " . $description . " Bank Number: " . $numslots . " DIMM Capacity: " . $capacity . "MB\n"; $module_count++; $common->addMemory({ CAPACITY => $capacity, DESCRIPTION => "DIMM", CAPTION => "Ram slot ".$numslots, SPEED => $speed, TYPE => $type, NUMSLOTS => $numslots }) } # this is the caption line if(/^ID ControllerID/) { $flag_mt = 1; $description = $1;} # if we find "---", we set flag = 1, and in next line, we start to look for information if($flag_mt && /^-+/){ $flag = 1;} } # debug: show number of modules found and number of empty slots } if($sun_class == 3) { # socket MB/MEM3/CMP3/BR1/CH1/D2 has a Micron Technology 36HTF51272F80EE1D4 4GB FB-DIMM foreach(`memconf 2>&1`) { # debug if(/^empty sockets:\s*(\S+)/) { # cut of first 15 char containing the string empty sockets: substr ($_,0,15) = ""; $description = ""; $type = ""; $capacity = "empty"; $numslots = 0; foreach $caption (split) { if ($caption eq "None") { $empty_slots = 0; # no empty slots -> exit loop last; } # debug #print "Caption: " . $caption . " Description: " . $description . " Bank Number: " . $numslots . " DIMM Capacity: " . $capacity . "MB\n"; $empty_slots++; $common->addMemory({ CAPACITY => $capacity, DESCRIPTION => $description, CAPTION => $caption, SPEED => $speed, TYPE => $type, NUMSLOTS => $numslots }) } } # socket MB/MEM3/CMP3/BR1/CH1/D2 has a Micron Technology 36HTF51272F80EE1D4 4GB FB-DIMM if(/^socket\s+(\S+) has a (.+) (\d+)GB (\S+)/) { $caption = $1; $description = $2; $type = $4; $numslots = 0; $capacity = $3 * 1024; # debug #print "Caption: " . $caption . " Description: " . $description . " Bank Number: " . $numslots . " DIMM Capacity: " . $capacity . "MB\n"; $module_count++; $common->addMemory({ CAPACITY => $capacity, DESCRIPTION => $description, CAPTION => $caption, SPEED => $speed, TYPE => $type, NUMSLOTS => $numslots }) } # socket P1C1/B31/C1/D0 (LUN 0 ID 124): Samsung 32768MB DDR4 SDRAM DIMM, M393A4K40BB1-CRC if(/^socket\s+(\S+) \(LUN \d+ ID \d+\): (.+) (\d+)MB (\S+) (\S+) DIMM, (\S+)/) { $caption = $1; $description = "$2 $6"; $type = "$4 $5"; $numslots = 0; $capacity = $3; $module_count++; $common->addMemory({ CAPACITY => $capacity, DESCRIPTION => $description, CAPTION => $caption, SPEED => $speed, TYPE => $type, NUMSLOTS => $numslots }) } } # debug: show number of modules found and number of empty slots #print "# of RAM Modules: " . $module_count . "\n"; #print "# of empty slots: " . $empty_slots . "\n"; } if($sun_class == 4) { foreach(`memconf 2>&1`) { # debug #print "line: " .$j++ . " " . $flag_mt . "/" . $flag ." : " . "$_"; # if we find "empty sockets:", we have reached the end and indicate that by resetting flag = 0 # emtpy sockets is follow by a list of emtpy slots, where we extract the slot names if(/^empty sockets:\s*(\S+)/) { $flag = 0; # cut of first 15 char containing the string empty sockets: substr ($_,0,15) = ""; $capacity = "empty"; $numslots = 0; foreach $caption (split) { if ($caption eq "None") { $empty_slots = 0; # no empty slots -> exit loop last; } # debug print "Caption: " . $caption . " Description: " . $description . " Bank Number: " . $numslots . " DIMM Capacity: " . $capacity . "MB\n"; $empty_slots++; $common->addMemory({ CAPACITY => $capacity, DESCRIPTION => $description, CAPTION => $caption, SPEED => $speed, TYPE => $type, NUMSLOTS => $numslots }) } } # we only grap for information if flag = 1 # socket MB/CMP0/BR0/CH0/D0 has a Samsung 501-7953-01 Rev 05 2GB FB-DIMM if(/^socket\s+(\S+) has a (.+)\s+(\S+)GB\s+(\S+)$/i) { $caption = $1; $description = $2; $type = $4; $numslots = 0; $capacity = $3 * 1024; # debug #print "Caption: " . $caption . " Description: " . $description . " Bank Number: " . $numslots . " DIMM Capacity: " . $capacity . "MB\n"; $module_count++; $common->addMemory({ CAPACITY => $capacity, DESCRIPTION => $description, CAPTION => $caption, SPEED => $speed, TYPE => $type, NUMSLOTS => $numslots }) } } # debug: show number of modules found and number of empty slots #print "# of RAM Modules: " . $module_count . "\n"; #print "# of empty slots: " . $empty_slots . "\n"; } if ($sun_class == 5 ) { foreach(`memconf 2>&1`) { # debug #print "line: " .$j++ . " " . $flag_mt . "/" . $flag ." : " . "$_"; # if we find "empty sockets:", we have reached the end and indicate that by resetting flag = 0 # emtpy sockets is follow by a list of emtpy slots, where we extract the slot names if(/^total memory.*(\S+)/) { $flag = 0;} #print "flag : $flag\n"; if($flag_mt && /^\s+\S+\s+\S+\s+\S+\s+(\S+)/) {$flag_mt=0; $type = $1;} #print "description : $description\n"; if ($flag && /^\s(\S+)\s+(\S+)/) { $numslots = "LSB " . $1 . " Group " . $2; } if ($flag && /^\s(\S+)\s+(\S+)/) { $caption = "LSB " . $1 . " Group " . $2; } if ($flag && /^\s+\S+\s+\S\s+\S+\s+\S+\s+(\d+)/) { $capacity = $1; } if ($flag && /^\s+\S+\s+\S\s+(\d+)/) { $banksize = $1; } #print "Num slot ". $numslots . " Bank Number: " . $numslots . " Bank size " . $banksize . " DIMM Capacity: " . $capacity . "MB\n"; if ($flag && $capacity > 1 ) { for (my $i = 1; $i <= ($banksize / $capacity); $i++) { #print "caption ". $caption . " Bank Number: " . $numslots . " Bank size " . $banksize . " DIMM Capacity: " . $capacity . "MB\n"; $common->addMemory({ CAPACITY => $capacity, DESCRIPTION => $description, CAPTION => $caption, SPEED => $speed, TYPE => $type, NUMSLOTS => $module_count }) } $module_count++; } #Caption Line if (/^Sun Microsystems/) { $flag_mt=1; $flag=1; } } } if($sun_class == 6) { #CPU1_D2 BANK2: 4096MB DDR3 DIMM, Samsung M393B5170EH1-CH9 (SUN FIRE X4270) #DIMM 1A: 4096MB Synchronous DDR2 FBDIMM (ProLiant DL380 G5) #Board 1, DIMM 1A: 8192MB Synchronous DDR3 (ProLiant DL580 G7) #PROC 1 DIMM 12: 16384MB Synchronous DDR3 DIMM, HP (ProLiant DL380p Gen8) #PROC 1 DIMM 12: 32768MB Synchronous DIMM, HP 752372-081 (ProLiant DL380 Gen9) #XMM1: 2048MB Synchronous DDR2 DIMM, Elpida EBE21UE8AEFA-8G-E (HP Desktop PC) #DIMM_1: 1024MB Synchronous DDR2 DIMM, Kingston KCM633-ELC (Dell Desktop PC) foreach(`memconf 2>&1`) { # debug #print "line: " .$j++ . " " . $flag_mt . "/" . $flag ." : " . "$_"; if(/^empty memory sockets:\s*(\S+)/) { # cut of first 22 char containing the string empty sockets: substr ($_,0,22) = ""; chomp(); $capacity = "0"; $numslots = 0; foreach $caption (split(/, /,$_)) { if ($caption eq "None") { $empty_slots = 0; # no empty slots -> exit loop last; } # debug #print "Caption: " . $caption . " Description: " . $description . " Bank Number: " . $numslots . " DIMM Capacity: " . $capacity . "MB\n"; $empty_slots++; if ($caption =~ /.* (\d+)$/) { $numslots = $1; } $common->addMemory({ CAPACITY => $capacity, DESCRIPTION => "empty", CAPTION => $caption, SPEED => 'n/a', TYPE => 'n/a', NUMSLOTS => $numslots }) } } # These are the non-emtpy sockets in various formats #DIMM 1A: 4096MB Synchronous DDR2 FBDIMM (ProLiant DL380 G5) #Board 1, DIMM 1A: 8192MB Synchronous DDR3 (ProLiant DL580 G7) #PROC 1 DIMM 12: 16384MB Synchronous DDR3 DIMM, HP (ProLiant DL380p Gen8) if(/^(.*DIMM) (\S+):\s+(\d+)MB\s(\S+ DDR\d+)\s*(\w*)?(,?.*)/) { $caption = "$1 $2"; $description = "$4 $5$6"; $numslots = $2; $capacity = $3; $type = $5; unless ($type) { $type = "DIMM" }; # Default if nothing else found # debug #print "Caption: " . $caption . " Description: " . $description . " Bank Number: " . $numslots . " DIMM Capacity: " . $capacity . "MB\n"; $module_count++; $common->addMemory({ CAPACITY => $capacity, DESCRIPTION => $description, CAPTION => $caption, SPEED => $speed, TYPE => $type, NUMSLOTS => $numslots }) } #CPU1_D2 BANK2: 4096MB DDR3 DIMM, Samsung M393B5170EH1-CH9 (SUN FIRE X4270) if(/^(.*BANK)(\S+):\s+(\d+)MB\s(\S*DDR\d+)\s*(\w+)?(,?.*)/) { $caption = "$1 $2"; $description = "$4 $5$6"; $numslots = $2; $capacity = $3; $type = $5; # debug #print "Caption: " . $caption . " Description: " . $description . " Bank Number: " . $numslots . " DIMM Capacity: " . $capacity . "MB\n"; $module_count++; $common->addMemory({ CAPACITY => $capacity, DESCRIPTION => $description, CAPTION => $caption, SPEED => $speed, TYPE => $type, NUMSLOTS => $numslots }) } #PROC 1 DIMM 12: 32768MB Synchronous DIMM, HP 752372-081 (ProLiant DL380 Gen9) if(/^(.*DIMM) (\S+):\s+(\d+)MB\s(\S+)\s+(DIMM\w*)(,?.*)/) { $caption = "$1 $2"; $description = "$4 $5$6"; $numslots = $2; $capacity = $3; $type = $5; # debug #print "Caption: " . $caption . " Description: " . $description . " Bank Number: " . $numslots . " DIMM Capacity: " . $capacity . "MB\n"; $module_count++; $common->addMemory({ CAPACITY => $capacity, DESCRIPTION => $description, CAPTION => $caption, SPEED => $speed, TYPE => $type, NUMSLOTS => $numslots }) } #XMM1: 2048MB Synchronous DDR2 DIMM, Elpida EBE21UE8AEFA-8G-E (HP Desktop PC) #DIMM_1: 1024MB Synchronous DDR2 DIMM, Kingston KCM633-ELC (Dell Desktop PC) if(/^(\S+):\s+(\d+)MB\s(.+)\s+(DIMM\w*)(,?.*)/) { $caption = "$1"; $description = "$3 $4$5"; $numslots = $1; $capacity = $2; $type = $4; # debug #print "Caption: " . $caption . " Description: " . $description . " Bank Number: " . $numslots . " DIMM Capacity: " . $capacity . "MB\n"; $module_count++; $common->addMemory({ CAPACITY => $capacity, DESCRIPTION => $description, CAPTION => $caption, SPEED => $speed, TYPE => $type, NUMSLOTS => $numslots }) } } # debug: show number of modules found and number of empty slots #print "# of RAM Modules: " . $module_count . "\n"; #print "# of empty slots: " . $empty_slots . "\n"; } if ($sun_class == 7) { foreach (`prctl -n project.max-shm-memory $$ 2>&1`) { $description = $1 if /^project.(\S+)$/; $capacity = $1 if /^\s*system+\s*(\d+).*$/; if(($description && $capacity)){ $capacity = $capacity * 1024; $numslots = 1 ; $description = "Memory Allocated"; $caption = "Memory Share"; #print $description."_".$capacity."***\n"; $common->addMemory({ CAPACITY => $capacity, DESCRIPTION => $description, CAPTION => $caption, SPEED => $speed, TYPE => $type, NUMSLOTS => $numslots }) } } } if($sun_class == 8) { # example output of a Sun Blade 100 Workstation #Sun Microsystems, Inc. Sun Blade 100 (UltraSPARC-IIe 502MHz) #Memory Segment Table: #----------------------------------------------------------------------- #Base Address Size Interleave Factor Contains #----------------------------------------------------------------------- #0x0 256MB 1 chassis/system-board/DIMM0 #empty sockets: DIMM1 DIMM2 DIMM3 #total memory = 256MB #Sun Microsystems, Inc. Sun Blade 100 (UltraSPARC-IIe 502MHz) #Memory Segment Table: #----------------------------------------------------------------------- #Base Address Size Interleave Factor Contains #----------------------------------------------------------------------- #0x0 256MB 1 Label DIMM0 #0x20000000 256MB 1 Label DIMM1 #empty sockets: DIMM2 DIMM3 #total memory = 512MB foreach(`memconf 2>&1`) { if (/^empty sockets:\s*(.+)/) { foreach $caption (split(/ /, $1)) { if ($caption eq "None") { $empty_slots = 0; last; } $empty_slots++; # print "empty slot\n"; $common->addMemory({ CAPACITY => "empty", DESCRIPTION => '', CAPTION => $caption, SPEED => '', TYPE => '', NUMSLOTS => $numslots }) } } if (/^0x(\d+)\s+(\d+)(\S)B\s+(\S+)\s+(.+)/) { $caption = "$5"; $description = ""; $numslots = 0; $capacity = $2 if ( $3 eq "M" ); $capacity = $2 * 1024 if ( $3 eq "G" ); $type = ""; # debug # print "Caption: " . $caption . " Description: " . $description . " Bank Number: " . $numslots . " DIMM Capacity: " . $capacity . "MB\n"; $module_count++; $common->addMemory({ CAPACITY => $capacity, DESCRIPTION => $description, CAPTION => $caption, SPEED => $speed, TYPE => $type, NUMSLOTS => $numslots }) } } } } #run(); 1; UnixAgent-2.4.2/lib/Ocsinventory/Agent/Backend/OS/Solaris/Networks.pm000066400000000000000000000113141332737732100253750ustar00rootroot00000000000000package Ocsinventory::Agent::Backend::OS::Solaris::Networks; #ce5: flags=1000843 mtu 1500 index 3 # inet 55.37.101.171 netmask fffffc00 broadcast 55.37.103.255 # ether 0:3:ba:24:9b:bf #aggr40001:2: flags=201000843 mtu 1500 index 3 # inet 55.37.101.172 netmask ffffff00 broadcast 223.0.146.255 use strict; sub check { my $params = shift; my $common = $params->{common}; $common->can_run("ifconfig") && $common->can_run("netstat") && $common->can_load ("Net::IP qw(:PROC)") } # Initialise the distro entry sub run { my $params = shift; my $common = $params->{common}; my $description; my $ipaddress; my $ipgateway; my $ipmask; my $ipsubnet; my $macaddr; my $status; my $type; my $zone; my @zoneadmcmd; my @zacsplitted; # get the first field of the first line of "zoneadm list -p" @zoneadmcmd = `zoneadm list -p`; @zacsplitted = split(/:/, $zoneadmcmd[0]); $zone = $zacsplitted[0]; foreach (`netstat -rn`){ $ipgateway=$1 if /^default\s+(\S+)/i; } #print "Nom :".$zone."*************************\n"; ### STEP 1: get aliases and zones' interfaces foreach (`ifconfig -a`){ # resets if new interface $ipaddress = $description = $macaddr = $status = $type = undef if /^(\S+):/; # interface name and other data $description = $1.":".$2 if /^(\S+):(\S+):/; $ipaddress = $1 if /inet\s+(\S+)/i; $ipmask = $1 if /\S*netmask\s+(\S+)/i; if (/ether\s+(\S+)/i) { # See # https://sourceforge.net/tracker/?func=detail&atid=487492&aid=1819948&group_id=58373 $macaddr = sprintf "%02x:%02x:%02x:%02x:%02x:%02x" , map hex, split /\:/, $1; } $status = 1 if /addNetwork({ DESCRIPTION => $description, IPADDRESS => $ipaddress, IPGATEWAY => $ipgateway, IPMASK => $ipmask, IPSUBNET => $ipsubnet, MACADDR => $macaddr, STATUS => $status?"Up":"Down", TYPE => $type, }); } } ### STEP 2: get physical interfaces when not a zone if (!$zone){ foreach (`ifconfig -a`){ # resets if new interface $ipaddress = $description = $macaddr = $status = $type = undef if /^(\S+):/; # interface name and other data $description = $1 if /^(\S+): /; $ipaddress = $1 if /inet\s+(\S+)/i; $ipmask = $1 if /\S*netmask\s+(\S+)/i; if (/ether\s+(\S+)/i) { # See # https://sourceforge.net/tracker/?func=detail&atid=487492&aid=1819948&group_id=58373 $macaddr = sprintf "%02x:%02x:%02x:%02x:%02x:%02x" , map hex, split /\:/, $1; } $status = 1 if /addNetwork({ DESCRIPTION => $description, IPADDRESS => $ipaddress, IPGATEWAY => $ipgateway, IPMASK => $ipmask, IPSUBNET => $ipsubnet, MACADDR => $macaddr, STATUS => $status?"Up":"Down", TYPE => $type, }); } } } } 1; UnixAgent-2.4.2/lib/Ocsinventory/Agent/Backend/OS/Solaris/Packages.pm000066400000000000000000000051201332737732100252750ustar00rootroot00000000000000package Ocsinventory::Agent::Backend::OS::Solaris::Packages; use strict; use warnings; sub check { my $params = shift; my $common = $params->{common}; # Do not run an package inventory if there is the --nosoftware parameter return if ($params->{config}->{nosoftware}); $common->can_run("pkginfo") || $common->can_run("pkg"); } sub run { my $params = shift; my $common = $params->{common}; my $chaine ; my @tab; my $name; my $version; my $comments; my $publisher; if ( `uname -r` =~ /5.11/ ) { # Solaris 11 foreach (`pkg info`) { if (/^\s*$/) { $common->addSoftware({ 'NAME' => $name, 'VERSION' => $version, 'COMMENTS' => $comments, 'PUBLISHER' => $publisher, }); $name = ''; $version = ''; $comments = ''; $publisher = ''; } elsif (/Name:\s+(.+)/) { $name = $1; } elsif (/Version:\s+(.+)/) { $version = $1; } elsif (/Publisher:\s+(.+)/) { $publisher = $1; } elsif (/Summary:\s+(.+)/) { $comments = $1; } } } else { # Solaris 10 and lower foreach (`pkginfo -l`) { if (/^\s*$/) { $common->addSoftware({ 'NAME' => $name, 'VERSION' => $version, 'COMMENTS' => $comments, 'PUBLISHER' => $publisher, }); $name = ''; $version = ''; $comments = ''; $publisher = ''; } elsif (/PKGINST:\s+(.+)/) { $name = $1; } elsif (/VERSION:\s+(.+)/) { $version = $1; } elsif (/VENDOR:\s+(.+)/) { $publisher = $1; } elsif (/DESC:\s+(.+)/) { $comments = $1; } } my $testrep; $testrep=0; #opendir(DIR,'/var/sis/') || exit ; opendir(DIR,'/var/sis/') || ($testrep=1) ; if ($testrep==0) { foreach (`ls /var/sis/*.SIS`) { $chaine= `cat $_` ; @tab = split(/;/, $chaine); if (/^\/var\/sis\/(\S+).SIS/){ $common->addSoftware({ 'VERSION' => $tab[2], 'NAME' => $tab[0]." ($1)", 'PUBLISHER' => $tab[1], 'COMMENTS' => $1, }); } } } closedir(DIR); } } 1; UnixAgent-2.4.2/lib/Ocsinventory/Agent/Backend/OS/Solaris/Ports.pm000066400000000000000000000026321332737732100246730ustar00rootroot00000000000000package Ocsinventory::Agent::Backend::OS::Solaris::Ports; use strict; sub run { my $params = shift; my $common = $params->{common}; my $zone; my $SystemModel; my $aarch; my $flag; my $caption; my $description; my $name; my $type; if ( !$common->can_run("zonename") || `zonename` =~ /global/ ) { # Ether pre Sol10 or in Sol10/Sol11 global zone $zone = "global"; } else { $zone = ""; } if ($zone) { chomp($SystemModel = `uname -m`); chomp($aarch = `uname -p`); if( $aarch eq "i386" ){ # # For a Intel/AMD arch, we're using smbios # foreach(`/usr/sbin/smbios -t SMB_TYPE_PORT`) { if(/\s+Internal Reference Designator:\s*(.+)/i ) { $flag = 1; $name = $1; } elsif ($flag && /^$/) { # end of section $flag = 0; $common->addPorts({ CAPTION => $caption, DESCRIPTION => $description, NAME => $name, TYPE => $type, }); $caption = $description = $name = $type = undef; } elsif ($flag) { $caption = $1 if /\s+External Connector Type:.*\((.+)\)/i; $description = $1 if /\s+External Reference Designator:\s*(.+)/i; $type = $1 if /\s+Port Type:.*\((.+)\)/i; } } } elsif( $aarch eq "sparc" ) { # # For a Sparc arch, we're done # } } } 1; UnixAgent-2.4.2/lib/Ocsinventory/Agent/Backend/OS/Solaris/Slots.pm000066400000000000000000000317021332737732100246700ustar00rootroot00000000000000package Ocsinventory::Agent::Backend::OS::Solaris::Slots; use strict; sub check { my $params = shift; my $common = $params->{common}; $common->can_run ("prtdiag") } sub run { my $params = shift; my $common = $params->{common}; my $description; my $designation; my $name; my $status; my @pci; my $flag; my $flag_pci; my $model; my $sun_class; chomp($model = `uname -i`); # debug print model #print "Model: '$model'"; $sun_class = 0; # we map (hopfully) our server model to a known class if ($model =~ /SUNW,SPARC-Enterprise/) { $sun_class = 1; } # M9000 if ($model =~ /SUNW,SPARC-Enterprise-T\d/) { $sun_class = 22; } # T5220 if ($model =~ /SUNW,Sun-Fire-\d/) { $sun_class = 3; } # 280R, 480R if ($model =~ /SUNW,Sun-Fire-V\d/) { $sun_class = 3; } # V490 if ($model =~ /SUNW,Sun-Fire-T\d/) { $sun_class = 4; } # T2000 if ($model =~ /SUNW,Sun-Blade-1500/) { $sun_class = 8; } # Blade 1500 workstation if ($model =~ /i86pc/) { $sun_class = 21; } # x86 hardware if ($model =~ /SUNW,T5/) { $sun_class = 22; } # T5240, T5440 if ($model =~ /sun4v/) { $sun_class = 22; } # T3-x, T4-x, T5-x #Debug #print "sun_class : $sun_class\n"; if ( $sun_class == 0 ) { # Default class, probably doesn't work foreach (`prtdiag `) { last if(/^\=+/ && $flag_pci); next if(/^\s+/ && $flag_pci); if($flag && $flag_pci && /^(\S+)\s+/) { $name = $1; } if($flag && $flag_pci && /(\S+)\s*$/) { $designation = $1; } if($flag && $flag_pci && /^\S+\s+\S+\s+\S+\s+\S+\s+\S+\s+\S+\s+\S+\s+\S+\s+\S+\s+(\S+)/) { $description = $1; } if($flag && $flag_pci && /^\S+\s+\S+\s+\S+\s+\S+\s+\S+\s+\S+\s+\S+\s+\S+\s+(\S+)/) { $status = $1; } if($flag && $flag_pci) { $common->addSlot({ DESCRIPTION => $description, DESIGNATION => $designation, NAME => $name, STATUS => $status, }); } if(/^=+\s+IO Cards/){$flag_pci = 1;} if($flag_pci && /^-+/){$flag = 1;} } } if ( $sun_class == 1 ) { # M9000 #========================= IO Devices ========================= # # IO Lane/Frq #LSB Type LPID RvID,DvID,VnID BDF State Act, Max Name Model #--- ----- ---- ------------------ --------- ----- ----------- ------------------------------ -------------------- # Logical Path # ------------ #00 PCIx 0 8, 125, 1033 2, 0, 0 okay 133, 133 pci-pciexclass,060400 N/A # /pci@0,600000/pci@0 # foreach (`prtdiag -v`) { last if(/^\=+/ && $flag_pci && $flag); if ($flag && $flag_pci && /^(\d+)\s+(\S+)\s+\S+\s+\S+\s+\S+\s+\S+\s+\S+\s+\S+\s+\S+\s+(\S+)\s+\S+\s+\S+\s+((\S+)-\S+)\s+(\S+).*/ ) { $designation = "LSB " . $1; $status = $3; $name = $4; $description = "[$2] $5"; $description .= " ($6)" unless ($6=~/N\/A/); $common->addSlot({ DESCRIPTION => $description, DESIGNATION => $designation, NAME => $name, STATUS => $status, }); } if(/^=+\S+\s+IO Devices/){$flag_pci = 1; } if($flag_pci && /^-+/){$flag = 1;} } } if ( $sun_class == 2 ) { # to be checked foreach (`prtdiag `) { if (/pci/) { @pci = split(/ +/); $name=$pci[4]." ".$pci[5]; $description=$pci[0]." (".$pci[1].")"; $designation=$pci[3]; $status=""; $common->addSlot({ DESCRIPTION => $description, DESIGNATION => $designation, NAME => $name, STATUS => $status, }); } } } if ( $sun_class == 3 ) { # SUNW,Sun-Fire-480R # ========================= IO Cards ========================= # # Bus Max # IO Port Bus Freq Bus Dev, # Type ID Side Slot MHz Freq Func State Name Model # ---- ---- ---- ---- ---- ---- ---- ----- -------------------------------- ---------------------- # PCI 8 B 3 33 33 3,0 ok SUNW,qlc-pci1077,2312.1077.101.2+ # PCI 8 B 3 33 33 3,1 ok SUNW,qlc-pci1077,2312.1077.101.2+ # PCI 8 B 5 33 33 5,0 ok pci-pci1011,25.4/pci108e,1000 PCI-BRIDGE # PCI 8 B 5 33 33 0,0 ok pci108e,1000-pci108e,1000.1 device on pci-bridge # PCI 8 B 5 33 33 0,1 ok SUNW,qfe-pci108e,1001 SUNW,pci-qfe/pci-bridg+ foreach (`prtdiag `) { last if(/^\=+/ && $flag_pci && $flag); # End of IO Devices, next section starts here if($flag && $flag_pci && /PCI/) { @pci = split(/ +/); $name=join(" ",@pci[9..$#pci]); $description="[".$pci[0]."] ".$pci[8]; $designation=$pci[0]."/".$pci[1]."/".$pci[2]."/".$pci[3]; $status=$pci[7]; $common->addSlot({ DESCRIPTION => $description, DESIGNATION => $designation, NAME => $name, STATUS => $status, }); } if(/^=+\S+\s+IO Cards/){ $flag_pci = 1; # Start of IO Devices section, still header to skip } if($flag_pci && /^-+/){ $flag = 1; # End of IO Devices header, real info starts here } } } if ( $sun_class == 21 ) { # x86 hardware $flag = 0; foreach (`/usr/sbin/smbios -t SMB_TYPE_SLOT`) { if ($flag && /^ID.*/) { # write current slot $common->addSlot({ DESCRIPTION => "$description ($status)", DESIGNATION => $designation, NAME => $name, STATUS => $status, }); $flag = 0; } elsif(/\s+Location Tag:\s+(.*)$/) { $description = $1; } elsif(/\s+Slot ID:\s+(.*)$/) { $designation= $1; } elsif(/\s+Type:\s+\S+\s+\((.*)\)$/) { $name= $1; } elsif(/\s+Usage:\s+\S+\s+\((.*)\).*$/) { $status = $1; } $flag = 1; } # Finally add the last card $common->addSlot({ DESCRIPTION => "$description ($status)", DESIGNATION => $designation, NAME => $name, STATUS => $status, }); } if ( $sun_class == 4 ) { # SUNW,Sun-Fire-T200 #========================= IO Configuration ========================= # # IO #Location Type Slot Path Name Model #----------- ----- ---- --------------------------------------------- ------------------------- --------- #IOBD/PCIE0 PCIE 0 /pci@780/pci@0/pci@8/network@0 network-pciex8086,105e SUNW,pcie+ foreach(`prtdiag `) { last if(/^\=+/ && $flag_pci && $flag); # End of IO Devices, next section starts here if($flag && $flag_pci && /PCI/) { @pci = split(/ +/); $name=$pci[5]; $description="[".$pci[1]."] ".$pci[4]; $designation=$pci[0]; $status=" "; if($flag && $flag_pci) { $common->addSlot({ DESCRIPTION => $description, DESIGNATION => $designation, NAME => $name, STATUS => $status, }); } } if(/^=+\S+\s+IO Configuration/){ $flag_pci = 1; # Start of IO Devices section, still header to skip } if($flag_pci && /^-+/){ $flag = 1; # End of IO Devices header, real info starts here } } } if ( $sun_class == 8 ) { # SUNW,Sun-Blade-1500 #================================= IO Devices ================================= #Bus Freq Slot + Name + #Type MHz Status Path Model #------ ---- ---------- ---------------------------- -------------------- #pci 33 MB isa/su (serial) # okay /pci@1e,600000/isa@7/serial@0,3f8 foreach (`prtdiag `) { last if(/^\=+/ && $flag_pci && $flag); # End of IO Devices, next section starts here # pci 33 MB isa/su(serial) SUNW,xxx if($flag && $flag_pci && /(\S+)\s+(\S+)\s+(\S+)\s+(\S+\s+\(\S+\))\s*(.*)/) { $name = $5; $designation = $3; $description = "[$1] $4"; $status = " "; $common->addSlot({ DESCRIPTION => $description, DESIGNATION => $designation, NAME => $name, STATUS => $status, }); } if(/^=+\S+\s+IO Devices/){ $flag_pci = 1; # Start of IO Devices section, still header to skip } if($flag_pci && /^-+/){ $flag = 1; # End of IO Devices header, real info starts here } } } if ( $sun_class == 22 ) { # SUNW,T5440 #======================================== IO Devices ======================================= #Slot + Bus Name + Model Max Speed Cur Speed #Status Type Path /Width /Width #------------------------------------------------------------------------------------------- #MB/HBA PCIE scsi-pciex1000,58 LSI,1068E -- -- # /pci@400/pci@0/pci@1/scsi@0 # SPARC T3-1 #================================= IO Devices ================================= #Slot + Bus Name + Model Speed #Status Type Path #------------------------------------------------------------------------------ #/SYS/MB/SASHBA0 PCIE scsi-pciex1000,72 LSI,2008 -- # /pci@400/pci@1/pci@0/pci@4/scsi@0 #/SYS/MB/RISER2/PCIE2PCIE network-pciex108e,abcd SUNW,pcie-qgc -- # /pci@400/pci@1/pci@0/pci@6/network@0 # SPARC T4-4 #======================================== IO Devices ======================================= #Slot + Bus Name + Model Max Speed Cur Speed #Status Type Path /Width /Width #------------------------------------------------------------------------------------------- #/SYS/MB/REM0/SASHBA0 PCIE LSI,sas-pciex1000,72 LSI,2008 -- -- # /pci@400/pci@1/pci@0/pci@0/LSI,sas@0 #/SYS/RIO/NET0 PCIE network-pciex8086,10c9 -- -- # /pci@400/pci@1/pci@0/pci@2/network@0 #/SYS/RIO/NET1 PCIE network-pciex8086,10c9 -- -- # /pci@400/pci@1/pci@0/pci@2/network@0,1 #/SYS/PCI-EM2 PCIE SUNW,qlc-pciex1077,2532 QEM3572 -- -- # /pci@400/pci@1/pci@0/pci@4/pci@0/pci@2/SUNW,qlc@0 # SPARC T5-4 #======================================== IO Devices ======================================= #Slot + Bus Name + Model Max Speed Cur Speed #Status Type Path /Width /Width #------------------------------------------------------------------------------------------- #/SYS/MB/USB_CTLR PCIE usb-pciexclass,0c0330 -- -- # /pci@300/pci@1/pci@0/pci@4/pci@0/pci@6/usb@0 #/SYS/RIO/XGBE0 PCIE network-pciex8086,1528 -- -- # /pci@300/pci@1/pci@0/pci@4/pci@0/pci@8/network@0 #/SYS/MB/SASHBA0 PCIE scsi-pciex1000,87 LSI,2308_2 -- -- # /pci@300/pci@1/pci@0/pci@4/pci@0/pci@c/scsi@0 foreach (`prtdiag `) { last if(/^\=+/ && $flag_pci && $flag); # End of IO Devices, next section starts here # Lazy match for $name due to differences in prtdiag output: # * the "Model" column does not always have a value # * 5-column output on Sol10, 6-column output on Sol11 if($flag && $flag_pci && /(\S+)\s+(\S+)\s+((\S+)-\S+)\s+(\S+)\s+.*/) { $designation = $1; $status = " "; $name = $3; $description = "[$2] $4"; $description .= " ($5)" unless ($5=~/.*GT\/?x\d+|--/); $common->addSlot({ DESCRIPTION => $description, DESIGNATION => $designation, NAME => $name, STATUS => $status, }); } if(/^=+\S+\s+IO Devices/){ $flag_pci = 1; # Start of IO Devices section, still header to skip } if($flag_pci && /^-+/){ $flag = 1; # End of IO Devices header, real info starts here } } } } 1; UnixAgent-2.4.2/lib/Ocsinventory/Agent/Backend/OS/Solaris/Storages.pm000066400000000000000000000057011332737732100253530ustar00rootroot00000000000000package Ocsinventory::Agent::Backend::OS::Solaris::Storages; use strict; #use warning; #sd0 Soft Errors: 0 Hard Errors: 0 Transport Errors: 0 #Vendor: HITACHI Product: DK32EJ72NSUN72G Revision: PQ08 Serial No: 43W14Z080040A34E #Size: 73.40GB <73400057856 bytes> #Media Error: 0 Device Not Ready: 0 No Device: 0 Recoverable: 0 #Illegal Request: 0 Predictive Failure Analysis: 0 # With -En : #c8t60060E80141A420000011A420000300Bd0 Soft Errors: 1 Hard Errors: 0 Transport Errors: 0 #Vendor: HITACHI Product: OPEN-V -SUN Revision: 5009 Serial No: #Size: 64.42GB <64424509440 bytes> #Media Error: 0 Device Not Ready: 0 No Device: 0 Recoverable: 0 #Illegal Request: 1 Predictive Failure Analysis: 0 sub check { my $params = shift; my $common = $params->{common}; $common->can_run ("iostat") } sub run { my $params = shift; my $common = $params->{common}; my $manufacturer; my $model; my $description; my $capacity; my $name; my $rev; my $sn; my $type; my $flag_first_line; my $rdisk_path; foreach(`iostat -En`){ #print; if ($flag_first_line){ ## To be removed when FIRMWARE will be supported if ($rev) { $description .= ' ' if $description; $description .= "FW:$rev"; } $rdisk_path=`ls -l /dev/rdsk/${name}s2`; if ( $rdisk_path =~ /.*->.*scsi_vhci.*/ ) { $type="MPxIO"; } elsif( $rdisk_path =~ /.*->.*fp@.*/ ) { $type="FC"; } elsif( $rdisk_path =~ /.*->.*scsi@.*/ ) { $type="SCSI"; } elsif( $rdisk_path =~ /.*->.*virtual-devices.*/ ) { $type="Virtual"; } $common->addStorages({ NAME => $name, MANUFACTURER => $manufacturer, MODEL => $model, DESCRIPTION => $description, TYPE => $type, FIRMWARE => $rev, SERIALNUMBER => $sn, DISKSIZE => $capacity }); $manufacturer=''; $model=''; $description=''; $name=''; $rev=''; $sn=''; $type=''; } $flag_first_line = 0; if (/^(\S+)\s+Soft/){ $name = $1; } if (/^.*Product:\s*(\S+)/){ $model = $1; } if (/^.*<(\S+)\s*bytes/){ $capacity = $1; $capacity = $capacity/(1024*1024); #print $capacity."\n"; } if (/^.*Serial No:\s*(\S+)/){ $sn = $1; ## To be removed when SERIALNUMBER will be supported $description = "S/N:$sn"; ## } if (/^.*Revision:\s*(\S+)/){ $rev = $1; } if (/^Vendor:\s*(\S+)/){ $manufacturer = $1; $flag_first_line = 1; } } } 1; UnixAgent-2.4.2/lib/Ocsinventory/Agent/Backend/OS/Solaris/Users.pm000066400000000000000000000007311332737732100246630ustar00rootroot00000000000000package Ocsinventory::Agent::Backend::OS::Solaris::Users; sub check { my $params = shift; my $common = $params->{common}; $common->can_run ("who") } # Initialise the distro entry sub run { my $params = shift; my $common = $params->{common}; my %user; # Logged on users for (`who`){ $user{$1} = 1 if /^(\S+)./; } my $UsersLoggedIn = join "/", keys %user; $common->setHardware ({ USERID => $UsersLoggedIn }); } 1; UnixAgent-2.4.2/lib/Ocsinventory/Agent/Backend/Virtualization/000077500000000000000000000000001332737732100243125ustar00rootroot00000000000000UnixAgent-2.4.2/lib/Ocsinventory/Agent/Backend/Virtualization/Docker.pm000066400000000000000000000025161332737732100260630ustar00rootroot00000000000000package Ocsinventory::Agent::Backend::Virtualization::Docker; use strict; sub check { return(undef) unless -r '/usr/bin/docker'; return 1; } my @image; sub run { my $params = shift; my $common = $params->{common}; foreach my $cont (`docker ps 2>/dev/null`) { next if ($cont =~ /^CONTAINER ID/); my $container_id=$1 if ($cont =~ /^(\w+)/i); push @image, $container_id; } foreach my $c (@image) { my $tab=`docker inspect $c`; my $memory=$1 if ($tab =~ /\s+"Memory":\s(\d+),/); my $name=$1 if ($tab =~ /\s+"Hostname":\s"(\w+)",/); my $status=$1 if ($tab =~ /\s+"Status":\s"(\w+)",/); my $vcpu=$1 if ($tab =~ /\s+"CpuShares":\s(\d+),/); my $vmid=$1 if ($tab =~ /\s+"Id":\s"(\w+)",/); my $ipaddr=$1 if ($tab =~ /\s+"IPAddress":\s"(.*)"/); my $macaddr=$1 if ($tab =~ /\s+"MacAddress":\s"(.*)"/); my $gateway=$1 if ($tab =~ /\s+"Gateway":\s"(.*)"/); $common->addVirtualMachine({ CPUSHARES => $vcpu, GATEWAY => $gateway, IPADDR => $ipaddr, MACADDR => $macaddr, MEMORY => $memory, NAME => $name, STATUS => $status, SUBSYSTEM => "Docker Container", VMID => $vmid, VTYPE => "Docker", }); } } 1; UnixAgent-2.4.2/lib/Ocsinventory/Agent/Backend/Virtualization/Jails.pm000066400000000000000000000027371332737732100257230ustar00rootroot00000000000000package Ocsinventory::Agent::Backend::Virtualization::Jails; use strict; sub check { return(undef) unless -r '/usr/sbin/jls'; return 1; } my @jail; sub run { my $params = shift; my $common = $params->{common}; foreach my $line (`jls -h 2>/dev/null | sed -e "1d"`) { push @jail, $line; } foreach my $j (@jail) { my @jparam=split('\s',$j); my $vmid=$jparam[6]; my $name=$jparam[7]; my $subsystem=$jparam[9]; my $status="running"; my @ip; my $ipv4=$jparam[39]; if ($ipv4 ne '-') { my @ipv4=split(",",$ipv4); foreach my $i (@ipv4) { push @ip, $i; } } my $ipv6=$jparam[41]; if ($ipv6 ne '-') { my @ipv6=split(",",$ipv6); foreach my $i (@ipv6) { push @ip, $i; } } my $ip=join "/", @ip; if (defined $ip) { $common->addVirtualMachine({ IPADDR => $ip, NAME => $name, STATUS => $status, SUBSYSTEM => "FreeBSD $subsystem", VMID => $vmid, VTYPE => "Jail", }); } else { $common->addVirtualMachine({ NAME => $name, STATUS => $status, SUBSYSTEM => "FreeBSD $subsystem", VMID => $vmid, VTYPE => "Jail", }); } } } 1;UnixAgent-2.4.2/lib/Ocsinventory/Agent/Backend/Virtualization/Libvirt.pm000066400000000000000000000025551332737732100262720ustar00rootroot00000000000000package Ocsinventory::Agent::Backend::Virtualization::Libvirt; use strict; use XML::Simple; sub check { my $params = shift; my $common = $params->{common}; $common->can_run('virsh') } sub run { my $params = shift; my $common = $params->{common}; foreach (`virsh list --all`) { if (/^\s*(\d+|\s+\-)\s+(\S+)\s+(\S.+)/){ my $memory; my $vcpu; my $name = $2; my $status = $3; $status =~ s/^shut off/off/; my $xml = `virsh dumpxml $name`; my $data = XMLin($xml); my $vcpu = $data->{vcpu}; my $uuid = $data->{uuid}; my $vmtype = $data->{type}; if ($data->{currentMemory}->{unit}) { $memory = $1 if $data->{currentMemory}->{content} =~ /(\d+)\d{3}$/; $vcpu = $data->{vcpu}->{content}; } else { $memory = $1 if $data->{currentMemory} =~ /(\d+)\d{3}$/; $vcpu = $data->{vcpu}; } my $machine = { MEMORY => $memory, NAME => $name, UUID => $uuid, STATUS => $status, SUBSYSTEM => "Libvirt", VMTYPE => $vmtype, VCPU => $vcpu, }; $common->addVirtualMachine($machine); } } } 1; UnixAgent-2.4.2/lib/Ocsinventory/Agent/Backend/Virtualization/Lxc.pm000066400000000000000000000047001332737732100253770ustar00rootroot00000000000000package Ocsinventory::Agent::Backend::Virtualization::Lxc; use strict; sub check { my $params = shift; my $common = $params->{common}; $common->can_run('lxc-ls') && $common->can_run('lxc-info') } my $memory; my $status; my $name; my $vmtype; my $vmid; my $vcpu=0; my $lstatus=""; my $cpu; my @lxc_vm; sub run { my $params = shift; my $common = $params->{common}; # Retrieve name and state of the vm foreach (`lxc-ls -1`) { my $vm = $1 if (/^(\S+)$/); #push (@lxc_vm, $vm); foreach (`lxc-info -n $vm`){ $name = $1 if (/^Name:\s*(\S+)$/); $vmid = $1 if (/^PID:\s*(\S+)$/); $lstatus = $1 if (/^State:\s*(\S+)$/); if ($lstatus eq "RUNNING") { $status = "Running"; $memory = $1 if (`lxc-cgroup -n $name memory.limit_in_bytes` =~ /(\S+)/); if (`lxc-cgroup -n $name cpuset.cpus` =~ /(\S+)/) { $cpu = $1; if ($cpu =~ /^(\d+)-(\d+)/){ my @tmp = ($1..$2); $vcpu += $#tmp + 1; } else { $vcpu += 1; } } } elsif ($lstatus eq "FROZEN") { $status = "Paused"; } elsif ($lstatus eq "STOPPED") { $status = "Off"; open LXC, ") { next if (/^#.*/); if (/^lxc.cgroup.memory.limit_in_bytes\s+=\s*(\S+)\s*$/){ $memory = $1; } if (/^lxc.cgroup.cpuset.cpus\s+=\s*(\S+)\s*$/){ foreach $cpu (split(/,/,$1)){ $cpu = $1; if ($cpu =~ /(\d+)-(\d+)/){ my @tmp = ($1..$2); $vcpu += $#tmp + 1; } else { $vcpu += 1; } } } } } } my $machine = { MEMORY => $memory, NAME => $name, STATUS => $status, SUBSYSTEM => "LXC Container", VCPU => $vcpu, VMID => $vmid, VMTYPE => "LXC", }; $common->addVirtualMachine($machine); } } 1; UnixAgent-2.4.2/lib/Ocsinventory/Agent/Backend/Virtualization/Parallels.pm000066400000000000000000000151271332737732100265750ustar00rootroot00000000000000package Ocsinventory::Agent::Backend::Virtualization::Parallels; use strict; use warnings; use XML::Simple; sub check { my $params = shift; my $common = $params->{common}; return $common->can_run('prlctl') } sub run { my $params = shift; my $common = $params->{common}; my $config = $params->{config}; my %status_list = ( 'running' => 'running', 'blocked' => 'blocked', 'paused' => 'paused', 'suspended' => 'suspended', 'crashed' => 'crashed', 'dying' => 'dying', ); my $xmlfile = undef; if (defined($config->{server}) && $config->{server}) { my $dir = $config->{server}; $dir =~ s/\//_/g; $config->{vardir} = $config->{basevardir}."/".$dir; } elsif (defined($config->{local}) && $config->{local}) { $config->{vardir} = $config->{basevardir}."/__LOCAL__"; } if (-d $config->{vardir}) { $xmlfile = $config->{vardir}."/uuid.xml"; } my ($uuid,$mem,$status,$name,$subsys)=undef; my $cpus = 1; my @users = (); # We don't want to scan user directories unless --scan-homedirs is used return unless $config->{scanhomedirs}; foreach my $lsuser ( glob("/Users/*") ) { $lsuser =~ s/.*\///; # Just keep the login next if $lsuser =~ /Shared/i; next if $lsuser =~ /^\./i; # Ignore hidden directory next if $lsuser =~ /\ /; # Ignore directory with space in the name next if $lsuser =~ /'/; # Ignore directory with space in the name push(@users,$lsuser); } foreach my $user (@users) { my @command = `su $user -c "prlctl list -a"`; shift (@command); foreach my $line ( @command ) { chomp $line; my @params = split(/ /, $line); $uuid = $params[0]; $status = $params[1]; # Avoid security risk. Should never appends next if $uuid =~ /(;\||&)/; foreach my $infos ( `sudo -u $user prlctl list -i $uuid`) { if ($infos =~ m/^\s\smemory\s(.*)Mb/) { $mem = $1; } elsif ($infos =~ m/^\s\scpu\s([0-9]{1,2})/) { $cpus= $1; } elsif ($infos =~ m/^Name:\s(.*)/) { $name = $1; } elsif ($infos =~ m/^OS:\s(.*)/) { $subsys = $1; } } $uuid =~ s/{// if ($uuid =~ m/{/); $uuid =~ s/}// if ($uuid =~ m/}/); my ($hwUUID,$currentUUID)=undef; # if vm is running, fetch the real uuid if ($status eq 'running') { my $command = "sudo -u $user prlctl exec $uuid /usr/sbin/ioreg -rd1 -c IOPlatformExpertDevice"; open(IOREG, "$command |") or die "Failed to run '$command': $!\n"; while() { if (/^[\s|]*"(\w+)"\s*=\s*(.*)$/) { next unless $1 eq "IOPlatformUUID"; $currentUUID = $2; $currentUUID =~ s/\"//g; } } } if (! -e $xmlfile) { my $uuid_xml = { 'PARALLELS' => { 'VIRTUALMACHINES' => { 'NAME' => [$name], 'PARALLELSUUID' => [$uuid], # Damned random uuid value 'GUESTUUID' => [$currentUUID], # The true and great uuid value }, }, }; my $xs = XML::Simple->new( ForceArray => 1, KeepRoot => 1, XMLDecl => ''); my $xml = $xs->XMLout($uuid_xml); open (MYFILE, "> $xmlfile"); print MYFILE "$xml"; # write xml output to the newly created file close (MYFILE); $hwUUID = $currentUUID; # fetch guest uuid value, even if it's empty (vm not currently running) } else { my $parallels = XML::Simple->new( ForceArray => 1, KeepRoot => 1, XMLDecl => '', ); my $vm = $parallels->XMLin($xmlfile); my $numberOfVMs = 0; my $boolean = 0; while (defined $vm->{PARALLELS}[0]{VIRTUALMACHINES}[$numberOfVMs]) { $numberOfVMs+=1; } for (my $counter=0; $counter<$numberOfVMs; $counter++) { if ( $vm->{PARALLELS}[0]{VIRTUALMACHINES}[$counter]{NAME}[0] eq $name ) { # if the vm with this name exists in the file, set its GUESTUUID value, if the currentUUID isn't empty if ( defined ($currentUUID)) { $vm->{PARALLELS}[0]{VIRTUALMACHINES}[$counter]{GUESTUUID}[0] = $currentUUID; } $vm->{PARALLELS}[0]{VIRTUALMACHINES}[$counter]{PARALLELSUUID}[0] = $uuid; # if vm re-registered, parallels uuid changes $boolean = 1; if ( defined ($vm->{PARALLELS}[0]{VIRTUALMACHINES}[$counter]{GUESTUUID}[0])) { $hwUUID = $vm->{PARALLELS}[0]{VIRTUALMACHINES}[$counter]{GUESTUUID}[0]; } } } unless ($boolean) { # if vm doesn't exist, push it to the file push @{$vm->{PARALLELS}[0]{VIRTUALMACHINES}}, { NAME => [$name], PARALLELSUUID => [$uuid], GUESTUUID => [$currentUUID], }; } open (MYFILE, "> $xmlfile"); print MYFILE $parallels->XMLout($vm); close (MYFILE); } $common->addVirtualMachine ({ NAME => $name, VCPU => $cpus, MEMORY => $mem, STATUS => $status, SUBSYSTEM => $subsys, VMTYPE => "Parallels", UUID => $hwUUID, }); } } } 1; UnixAgent-2.4.2/lib/Ocsinventory/Agent/Backend/Virtualization/Qemu.pm000066400000000000000000000036121332737732100255610ustar00rootroot00000000000000package Ocsinventory::Agent::Backend::Virtualization::Qemu; # With Qemu 0.10.X, some option will be added to get more and easly information (UUID, memory, ...) use strict; sub check { my $params = shift; my $common = $params->{common}; return ($common->can_run('qemu') || $common->can_run('kvm') || $common->can_run('qemu-kvm')) } sub run { my $params = shift; my $common = $params->{common}; foreach ( `ps -ef` ) { if (m/^\S+\s+(\d+).*((qemu|kvm|(qemu-kvm)).*\-([fh]d[a-d]|drive|cdrom).*)$/) { # match only if an qemu instance my $name = "N/A"; my $mem = 0; my $uuid; my $vmtype = $3; my $vcpu = 1; my $pid = $1; if (open F, "/proc/$pid/cmdline") { my @a=split "\000-", ; close F; foreach my $option ( @a ) { if ($option =~ m/^name\000(\S+)/) { $name = $1; } elsif ($option =~ m/^m\000(\S+)/) { $mem = $1; } elsif ($option =~ m/^uuid\000(\S+)/) { $uuid = $1; } elsif ($option =~ m/.*uuid=(\S+)/) { $uuid = $1; } elsif ($option =~ m/^smp\000(\d+)/) { $vcpu = $1; } } } if ($mem == 0 ) { # Default value $mem = 128; } $common->addVirtualMachine ({ NAME => $name, UUID => $uuid, VCPU => $vcpu, MEMORY => $mem, STATUS => "running", SUBSYSTEM => $vmtype, VMTYPE => $vmtype, }); } } } 1; UnixAgent-2.4.2/lib/Ocsinventory/Agent/Backend/Virtualization/SolarisLdoms.pm000066400000000000000000000026201332737732100272630ustar00rootroot00000000000000package Ocsinventory::Agent::Backend::Virtualization::SolarisLdoms; use strict; sub check { my $params = shift; my $common = $params->{common}; return unless $common->can_run('ldm'); } sub run { my @ldoms; my $ldom; my @ldomdetails; my $ldomdetail; my $ldomname; my $ldomstatus; my $ldommem; my $ldomncpu; my $ldomuuid; my $ldomsoftstate; my $params = shift; my $common = $params->{common}; my $logger = $params->{logger}; @ldoms = `/usr/sbin/ldm list-domain -p`; foreach $ldom (@ldoms) { if($ldom =~ /^DOMAIN\|name=(\S+)\|state=(\S+)\|flags=\S+\|cons=\S+\|ncpu=(\d+)\|mem=(\d+)\|.*/) { $ldomname=$1; $ldomstatus=$2; $ldomncpu=$3; $ldommem=$4/1024/1024; $ldomsoftstate=""; @ldomdetails = `/usr/sbin/ldm list-domain -o domain -p $ldomname`; foreach $ldomdetail (@ldomdetails) { if($ldomdetail =~ /^DOMAIN\|.*\|softstate=(.*)$/) { $ldomsoftstate=$1; } elsif($ldomdetail =~ /^UUID\|uuid=(.*)$/) { $ldomuuid=$1; } } my $machine = { MEMORY => $ldommem, NAME => $ldomname, UUID => $ldomuuid, STATUS => $ldomstatus, SUBSYSTEM => $ldomsoftstate, VMTYPE => "Solaris Ldom", VCPU => $ldomncpu, }; $common->addVirtualMachine($machine); } } } 1; UnixAgent-2.4.2/lib/Ocsinventory/Agent/Backend/Virtualization/SolarisZones.pm000066400000000000000000000044741332737732100273140ustar00rootroot00000000000000package Ocsinventory::Agent::Backend::Virtualization::SolarisZones; use strict; sub check { my $params = shift; my $common = $params->{common}; return unless $common->can_run('zoneadm'); return unless $common->can_run('zonecfg'); return unless check_solaris_valid_release(); } sub check_solaris_valid_release{ #check if Solaris 10 release is higher than 08/07 #no problem if Solaris 11 my $OSlevel; my @rlines; my $release_file; my $release; my $year; my $month; $OSlevel=`uname -r`; if ( $OSlevel =~ /5.10/ ) { $release_file = "/etc/release"; if (!open(SOLVERSION, $release_file)) { return; } @rlines = ; @rlines = grep(/Solaris/,@rlines); $release = @rlines[0]; $release =~ m/(\d)\/(\d+)/; $month = $1; $year = $2; $month =~ s/^0*//g; $year =~ s/^0*//g; if ($year <= 7 and $month < 8 ){ return 0; } } 1 } sub run { my @zones; my @lines; my $zone; my $zoneid; my $zonename; my $zonestatus; my $zonefile; my $pathroot; my $uuid; my $zonetype; my $memory; my $memcap; my $vcpu; my $params = shift; my $common = $params->{common}; my $logger = $params->{logger}; @zones = `/usr/sbin/zoneadm list -p`; @zones = grep (!/global/,@zones); foreach $zone (@zones) { ($zoneid,$zonename,$zonestatus,$pathroot,$uuid,$zonetype)=split(/:/,$zone); $memory=""; foreach (`/usr/sbin/zonecfg -z $zonename info capped-memory`) { if (/\s+physical:\s+(\S+)(\S)/) { # recalculate to GB $memory = $1 if ( $2 eq "G" ) ; $memory = $1 / 1024 if ( $2 eq "M" ) ; } } $vcpu=""; foreach (`/usr/sbin/zonecfg -z $zonename info dedicated-cpu`) { if (/\s+ncpus:\s+\S*(\d+)/) { $vcpu = $1; } } my $machine = { MEMORY => $memory, NAME => $zonename, UUID => $uuid, STATUS => $zonestatus, SUBSYSTEM => $zonetype, VMTYPE => "Solaris Zones", VMID => $zoneid, VCPU => $vcpu, }; $common->addVirtualMachine($machine); } } 1; UnixAgent-2.4.2/lib/Ocsinventory/Agent/Backend/Virtualization/VirtualBox.pm000066400000000000000000000155221332737732100267540ustar00rootroot00000000000000package Ocsinventory::Agent::Backend::Virtualization::VirtualBox; # This module detects only all VMs create by the user who launch this module (root VMs). use strict; use XML::Simple; use File::Glob ':glob'; sub check { my $params = shift; my $common = $params->{common}; return $common->can_run('VirtualBox') and $common->can_run('VBoxManage') } sub run { my $params = shift; my $common = $params->{common}; my $scanhomedirs = $params->{accountinfo}{config}{scanhomedirs}; my $cmd_list_vms = "VBoxManage -nologo list vms"; my ( $version ) = ( `VBoxManage --version` =~ m/^(\d\.\d).*$/ ) ; if ( $version > 2.1 ) { # detect VirtualBox version 2.2 or higher $cmd_list_vms = "VBoxManage -nologo list --long vms"; } my $in = 0; my $uuid; my $mem; my $status; my $name; foreach my $line (`$cmd_list_vms`){ # read only the information on the first paragraph of each vm chomp ($line); if ($in == 0 and $line =~ m/^Name:\s+(.*)$/) { # begin $name = $1; $in = 1; } elsif ($in == 1 ) { if ($line =~ m/^UUID:\s+(.*)/) { $uuid = $1; } elsif ($line =~ m/^Memory size:\s+(.*)/ ) { $mem = $1; } elsif ($line =~ m/^State:\s+(.*)\(.*/) { $status = ( $1 =~ m/off/ ? "off" : $1 ); } elsif ($line =~ m/^\s*$/) { # finish $in = 0 ; next if $uuid =~ /^N\\A$/ ; #If no UUID found, it is not a virtualmachine $common->addVirtualMachine ({ NAME => $name, VCPU => 1, UUID => $uuid, MEMORY => $mem, STATUS => $status, SUBSYSTEM => "Oracle xVM VirtualBox", VMTYPE => "VirtualBox", }); $name = $status = $mem = $uuid = 'N\A'; # useless but need it for security (new version, ...) } } } if ($in == 1) { # Anormal situation ! save the current vm information ... $common->addVirtualMachine ({ NAME => $name, VCPU => 1, UUID => $uuid, MEMORY => $mem, STATUS => $status, SUBSYSTEM => "Oracle xVM VirtualBox", VMTYPE => "VirtualBox", }); } # try to found another VMs, not exectute by root my @vmRunnings = (); my $index = 0 ; foreach my $line ( `ps -ef` ) { chomp($line); if ( $line !~ m/^root/) { if ($line =~ m/^.*VirtualBox (.*)$/) { my @process = split (/\s*\-\-/, $1); #separate options $name = $uuid = "N/A"; foreach my $option ( @process ) { #print $option."\n"; if ($option =~ m/^comment (.*)/) { $name = $1; } elsif ($option =~ m/^startvm (\S+)/) { $uuid = $1; } } if ($scanhomedirs == 1 ) { # If I will scan Home directories, $vmRunnings [$index] = $uuid; # save the no-root running machine $index += 1; } else { $common->addVirtualMachine ({ # add in inventory NAME => $name, VCPU => 1, UUID => $uuid, STATUS => "running", SUBSYSTEM => "Oracle xVM VirtualBox", VMTYPE => "VirtualBox", }); } } } } # If home directories scan is authorized if ($scanhomedirs == 1 ) { # Read every Machines Xml File of every user foreach my $xmlMachine (bsd_glob("/home/*/.VirtualBox/Machines/*/*.xml")) { chomp($xmlMachine); # Open config file ... my $configFile = new XML::Simple; my $data = $configFile->XMLin($xmlMachine); # ... and read it if ($data->{Machine}->{uuid}) { my $uuid = $data->{Machine}->{uuid}; $uuid =~ s/^{?(.{36})}?$/$1/; my $status = "off"; foreach my $vmRun (@vmRunnings) { if ($uuid eq $vmRun) { $status = "running"; } } $common->addVirtualMachine ({ NAME => $data->{Machine}->{name}, VCPU => $data->{Machine}->{Hardware}->{CPU}->{count}, UUID => $uuid, MEMORY => $data->{Machine}->{Hardware}->{Memory}->{RAMSize}, STATUS => $status, SUBSYSTEM => "Oracle xVM VirtualBox", VMTYPE => "VirtualBox", }); } } foreach my $xmlVirtualBox (bsd_glob("/home/*/.VirtualBox/VirtualBox.xml")) { chomp($xmlVirtualBox); # Open config file ... my $configFile = new XML::Simple; my $data = $configFile->XMLin($xmlVirtualBox); # ... and read it my $defaultMachineFolder = $data->{Global}->{SystemProperties}->{defaultMachineFolder}; if ( $defaultMachineFolder != 0 and $defaultMachineFolder != "Machines" and $defaultMachineFolder =~ /^\/home\/S+\/.VirtualBox\/Machines$/ ) { foreach my $xmlMachine (bsd_glob($defaultMachineFolder."/*/*.xml")) { my $configFile = new XML::Simple; my $data = $configFile->XMLin($xmlVirtualBox); if ( $data->{Machine} != 0 and $data->{Machine}->{uuid} != 0 ) { my $uuid = $data->{Machine}->{uuid}; $uuid =~ s/^{?(.{36})}?$/$1/; my $status = "off"; foreach my $vmRun (@vmRunnings) { if ($uuid eq $vmRun) { $status = "running"; } } $common->addVirtualMachine ({ NAME => $data->{Machine}->{name}, VCPU => $data->{Machine}->{Hardware}->{CPU}->{count}, UUID => $uuid, MEMORY => $data->{Machine}->{Hardware}->{Memory}->{RAMSize}, STATUS => $status, SUBSYSTEM => "Oracle xVM VirtualBox", VMTYPE => "VirtualBox", }); } } } } } } 1; UnixAgent-2.4.2/lib/Ocsinventory/Agent/Backend/Virtualization/VmWareDesktop.pm000066400000000000000000000026141332737732100274060ustar00rootroot00000000000000package Ocsinventory::Agent::Backend::Virtualization::VmWareDesktop; # # initial version: Walid Nouh # use strict; sub check { my $params = shift; my $common = $params->{common}; return $common->can_run('/Library/Application\ Support/VMware\ Fusion/vmrun') } sub run { my $params = shift; my $common = $params->{common}; my $logger = $params->{logger}; my $uuid; my $mem; my $status; my $name; my $i = 0; my $commande = "/Library/Application\\ Support/VMware\\ Fusion\/vmrun list"; foreach my $vmxpath ( `$commande` ) { next unless $i++ > 0; # Ignore the first line if (!open TMP, "<$vmxpath") { $logger->debug("Can't open $vmxpath\n"); next; } my @vminfos = ; close TMP; foreach my $line (@vminfos) { if ($line =~ m/^displayName =\s\"+(.*)\"/) { $name = $1; } elsif ($line =~ m/^memsize =\s\"+(.*)\"/) { $mem = $1; } elsif ($line =~ m/^uuid.bios =\s\"+(.*)\"/) { $uuid = $1; } } $common->addVirtualMachine ({ NAME => $name, VCPU => 1, UUID => $uuid, MEMORY => $mem, STATUS => "running", SUBSYSTEM => "VmWare Fusion", VMTYPE => "VmWare", }); } } 1; UnixAgent-2.4.2/lib/Ocsinventory/Agent/Backend/Virtualization/VmWareESX.pm000066400000000000000000000025761332737732100264430ustar00rootroot00000000000000package Ocsinventory::Agent::Backend::Virtualization::VmWareESX; use strict; sub check { my $params = shift; my $common = $params->{common}; $common->can_run('vmware-cmd') } sub run { my $params = shift; my $common = $params->{common}; foreach my $vmx (`vmware-cmd -l`) { chomp $vmx; next unless -f $vmx; my %machineInfo; open VMX, "<$vmx" or warn; foreach () { if (/^(\S+)\s*=\s*(\S+.*)/) { my $key = $1; my $value = $2; $value =~ s/(^"|"$)//g; $machineInfo{$key} = $value; } } close VMX; my $status = 'unknow'; if ( `vmware-cmd "$vmx" getstate` =~ /=\ (\w+)/ ) { # off $status = $1; } my $memory = $machineInfo{'memsize'}; my $name = $machineInfo{'displayName'}; my $uuid = $machineInfo{'uuid.bios'}; # correct uuid format $uuid =~ s/\s+//g;# delete space $uuid =~ s!^(........)(....)(....)-(....)(.+)$!\1-\2-\3-\4-\5!; # add dashs my $machine = { MEMORY => $memory, NAME => $name, UUID => $uuid, STATUS => $status, SUBSYSTEM => "VmWareESX", VMTYPE => "VmWare", }; $common->addVirtualMachine($machine); } } 1; UnixAgent-2.4.2/lib/Ocsinventory/Agent/Backend/Virtualization/VmWareWorkstation.pm000066400000000000000000000030751332737732100303230ustar00rootroot00000000000000package Ocsinventory::Agent::Backend::Virtualization::VmWareWorkstation; # # initial version: Walid Nouh # use strict; sub check { my $params = shift; my $common = $params->{common}; return $common->can_run('/bin/vmrun') } sub run { my $params = shift; my $common = $params->{common}; my $logger = $params->{logger}; my $cpu; my $cores; my $uuid; my $mem; my $status; my $name; my $i = 0; my $commande = "/bin/vmrun list"; foreach my $vmxpath ( `$commande` ) { next unless $i++ > 0; # Ignore the first line if (!open TMP, "<$vmxpath") { $logger->debug("Can't open $vmxpath\n"); next; } my @vminfos = ; close TMP; foreach my $line (@vminfos) { if ($line =~ m/^displayName =\s\"+(.*)\"/) { $name = $1; } elsif ($line =~ m/^numvcpus =\s\"+(.*)\"/){ $cpu = $1; } elsif ($line =~ m/^cpuid.coresPerSocket =\s\"+(.*)\" /){ $cores = $1; } elsif ($line =~ m/^memsize =\s\"+(.*)\"/) { $mem = $1; } elsif ($line =~ m/^uuid.bios =\s\"+(.*)\"/) { $uuid = $1; } } $common->addVirtualMachine ({ NAME => $name, VCPU => $cpu, CORES => $cores, UUID => $uuid, MEMORY => $mem, STATUS => "running", SUBSYSTEM => "VmWare Workstation", VMTYPE => "VmWare", }); } } 1; UnixAgent-2.4.2/lib/Ocsinventory/Agent/Backend/Virtualization/Vmsystem.pm000066400000000000000000000150771332737732100265110ustar00rootroot00000000000000package Ocsinventory::Agent::Backend::Virtualization::Vmsystem; # Initial Ocsinventory::Agent::Backend::Virtualization::Vmsystem version: Nicolas EISEN # # Code include from imvirt - I'm virtualized? # http://micky.ibh.net/~liske/imvirt.html # # Authors: # Thomas Liske # # Copyright Holder: # 2008 (C) IBH IT-Service GmbH [http://www.ibh.de/] # # License: # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this package; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # ## # # Outputs: # Xen # VirtualBox # Virtual Machine # VMware # QEMU # SolarisZone # # If no virtualization has been detected: # Physical # ## use strict; sub check { my $params = shift; my $common = $params->{common}; if ( $common->can_run("zoneadm")){ # Is a solaris zone system capable ? return 1; } if ( $common->can_run ("dmidecode") ) { # 2.6 and under haven't -t parameter my $dmidecode_ver = `dmidecode -V 2>/dev/null`; my @SplitVersion = split(/\./, $dmidecode_ver); if (@SplitVersion[0] > 2) { return 1; } elsif (@SplitVersion[0] == 2 && @SplitVersion[1] >= 7) { return 1; } } return 0; } sub run { my $params = shift; my $common = $params->{common}; my $dmidecode = '/usr/sbin/dmidecode'; my $cmd = '$dmidecode -t system'; my $dmesg = '/bin/dmesg | head -n 750'; my $status = "Physical"; my $found = 0; # Solaris zones my @solaris_zones; @solaris_zones = `/usr/sbin/zoneadm list`; @solaris_zones = grep (!/global/,@solaris_zones); if(@solaris_zones){ $status = "SolarisZone"; $found = 1; } if ( -d '/proc/xen' || check_file_content('/sys/devices/system/clocksource/clocksource0/available_clocksource','xen')) { $found = 1 ; if (check_file_content('/proc/xen/capabilities', 'control_d')) { # dom0 host } else { # domU PV host $status = "Xen"; # those information can't be extracted from dmidecode $common->setBios ({ SMANUFACTURER => 'Xen', SMODEL => 'PVM domU' }); } } # dmidecode needs root to work :( if ($found == 0 and -r '/dev/mem' && -x $dmidecode) { my $sysprod = `$dmidecode -s system-product-name`; if ($sysprod =~ /^VMware/) { $status = "VMware"; $found = 1; } elsif ($sysprod =~ /^Virtual Machine/) { $status = "Virtual Machine"; $found = 1; } elsif ($sysprod =~ /^Microsoft Corporation/) { $status = "Hyper-V"; $found=1; } else { my $biosvend = `$dmidecode -s bios-vendor`; if ($biosvend =~ /^QEMU/) { $status = "QEMU"; $found = 1; } elsif ($biosvend =~ /^Xen/) { # virtualized Xen $status = "Xen"; $found = 1; } } } # Parse loaded modules my %modmap = ( '^vmxnet\s' => 'VMware', '^xen_\w+front\s' => 'Xen', ); if ($found == 0 and open(HMODS, '/proc/modules')) { while() { foreach my $str (keys %modmap) { if (/$str/) { $status = "$modmap{$str}"; $found = 1; last; } } } close(HMODS); } # Let's parse some logs & /proc files for well known strings my %msgmap = ( 'VMware vmxnet virtual NIC driver' => 'VMware', 'Vendor: VMware\s+Model: Virtual disk' => 'VMware', 'Vendor: VMware,\s+Model: VMware Virtual ' => 'VMware', ': VMware Virtual IDE CDROM Drive' => 'VMware', ' QEMUAPIC ' => 'QEMU', 'QEMU Virtual CPU' => 'QEMU', ': QEMU HARDDISK,' => 'QEMU', ': QEMU CD-ROM,' => 'QEMU', ': Virtual HD,' => 'Virtual Machine', ': Virtual CD,' => 'Virtual Machine', ' VBOXBIOS ' => 'VirtualBox', ': VBOX HARDDISK,' => 'VirtualBox', ': VBOX CD-ROM,' => 'VirtualBox', 'Hypervisor signature: xen' => 'Xen', 'Xen virtual console successfully installed' => 'Xen', 'Xen reported:' => 'Xen', 'Xen: \d+ - \d+' => 'Xen', 'xen-vbd: registered block device' => 'Xen', 'ACPI: RSDP \(v\d+\s+Xen ' => 'Xen', 'ACPI: XSDT \(v\d+\s+Xen ' => 'Xen', 'ACPI: FADT \(v\d+\s+Xen ' => 'Xen', 'ACPI: MADT \(v\d+\s+Xen ' => 'Xen', 'ACPI: HPET \(v\d+\s+Xen ' => 'Xen', 'ACPI: SSDT \(v\d+\s+Xen ' => 'Xen', 'ACPI: DSDT \(v\d+\s+Xen ' => 'Xen', ); if ($found == 0 and open(HDMSG, '/var/log/dmesg')) { while() { foreach my $str (keys %msgmap) { if (/$str/) { $status = "$msgmap{$str}"; $found = 1; last; } } } close(HDMSG); } # Read kernel ringbuffer directly if ($found == 0 and open(HDMSG, '$dmesg |')) { while() { foreach my $str (keys %msgmap) { if (/$str/) { $status = "$msgmap{$str}"; $found = 1; last; } } } close(HDMSG); } if ($found == 0 and open(HSCSI, '/proc/scsi/scsi')) { while() { foreach my $str (keys %msgmap) { if (/$str/) { $status = "$msgmap{$str}"; $found = 1; last; } } } close(HSCSI); } $common->setHardware ({ VMSYSTEM => $status, }); } sub check_file_content { my ($file, $pattern) = @_; return 0 unless -r $file; my $found = 0; open (my $fh, '<', $file) or die "Can't open file $file: $!"; while (my $line = <$fh>) { if ($line =~ /$pattern/) { $found = 1; last; } } close ($fh); return $found; } 1; UnixAgent-2.4.2/lib/Ocsinventory/Agent/Backend/Virtualization/Xen.pm000066400000000000000000000002271332737732100254030ustar00rootroot00000000000000package Ocsinventory::Agent::Backend::Virtualization::Xen; $runMeIfTheseChecksFailed = ["Ocsinventory::Agent::Backend::Virtualization::Libvirt"]; 1; UnixAgent-2.4.2/lib/Ocsinventory/Agent/Backend/Virtualization/Xen/000077500000000000000000000000001332737732100250445ustar00rootroot00000000000000UnixAgent-2.4.2/lib/Ocsinventory/Agent/Backend/Virtualization/Xen/XL.pm000066400000000000000000000042331332737732100257270ustar00rootroot00000000000000package Ocsinventory::Agent::Backend::Virtualization::Xen::XL; use strict; sub check { my $params = shift; my $common = $params->{common}; my $can_run = $common->can_run('xl'); if ($can_run) { system('xl list'); my $exit_val = $? >> 8; return $exit_val eq 0; } return $can_run; } sub run { my $params = shift; my $common = $params->{common}; # output: xm list # # Name ID Mem(MiB) VCPUs State Time(s) # Domain-0 0 98 1 r----- 5068.6 # Fedora3 164 128 1 r----- 7.6 # Fedora4 165 128 1 ------ 0.6 # Mandrake2006 166 128 1 -b---- 3.6 # Mandrake10.2 167 128 1 ------ 2.5 # Suse9.2 168 100 1 ------ 1.8 # xl status my %status_list = ( 'r' => 'running', 'b' => 'blocked', 'p' => 'paused', 's' => 'shutdown', 'c' => 'crashed', 'd' => 'dying', ); my $vmtype = 'xen'; my $subsystem = 'xl'; my @xl_list = `xl list`; # remove first line shift @xl_list; foreach my $vm (@xl_list) { chomp $vm; my ($name, $vmid, $memory, $vcpu, $status, $time) = split(' ',$vm); $status =~ s/-//g; $status = ( $status ? $status_list{$status} : 'off'); my @vm_info = `xl list -l $name`; my $uuid; foreach my $value (@vm_info) { chomp $value; if ($value =~ /uuid/) { $value =~ s/"//g; $value =~ s/,//g; $value =~ s/\s+.*uuid:\s+(.*)/\1/; $uuid = $value; last; } } my $machine = { MEMORY => $memory, NAME => $name, UUID => $uuid, STATUS => $status, SUBSYSTEM => $subsystem, VMTYPE => $vmtype, VCPU => $vcpu, VMID => $vmid, }; $common->addVirtualMachine($machine); } } 1; UnixAgent-2.4.2/lib/Ocsinventory/Agent/Backend/Virtualization/Xen/XM.pm000066400000000000000000000041661332737732100257350ustar00rootroot00000000000000package Ocsinventory::Agent::Backend::Virtualization::Xen::XM; use strict; sub check { my $params = shift; my $common = $params->{common}; my $can_run = $common->can_run('xm'); if ($can_run) { system('xm list'); my $exit_val = $? >> 8; return $exit_val eq 0; } return $can_run; } sub run { my $params = shift; my $common = $params->{common}; # output: xm list # # Name ID Mem(MiB) VCPUs State Time(s) # Domain-0 0 98 1 r----- 5068.6 # Fedora3 164 128 1 r----- 7.6 # Fedora4 165 128 1 ------ 0.6 # Mandrake2006 166 128 1 -b---- 3.6 # Mandrake10.2 167 128 1 ------ 2.5 # Suse9.2 168 100 1 ------ 1.8 # xm status my %status_list = ( 'r' => 'running', 'b' => 'blocked', 'p' => 'paused', 's' => 'shutdown', 'c' => 'crashed', 'd' => 'dying', ); my $vmtype = 'xen'; my $subsystem = 'xm'; my @xm_list = `xm list`; # remove first line shift @xm_list; foreach my $vm (@xm_list) { chomp $vm; my ($name, $vmid, $memory, $vcpu, $status, $time) = split(' ',$vm); $status =~ s/-//g; $status = ( $status ? $status_list{$status} : 'off'); my @vm_info = `xm list -l $name`; my $uuid; foreach my $value (@vm_info) { chomp $value; if ($value =~ /uuid/) { $value =~ s/\(|\)//g; $value =~ s/\s+.*uuid\s+(.*)/\1/; $uuid = $value; last; } } my $machine = { MEMORY => $memory, NAME => $name, UUID => $uuid, STATUS => $status, SUBSYSTEM => $subsystem, VMTYPE => $vmtype, VCPU => $vcpu, VMID => $vmid, }; $common->addVirtualMachine($machine); } } 1; UnixAgent-2.4.2/lib/Ocsinventory/Agent/Backend/Virtualization/XenCitrixServer.pm000066400000000000000000000026671332737732100277670ustar00rootroot00000000000000package Ocsinventory::Agent::Backend::Virtualization::XenCitrixServer; use strict; use warnings; sub check { my $params = shift; my $common = $params->{common}; $common->can_run('xe') } sub run { my $params = shift; my $common = $params->{common}; my $hostname = `hostname`; my $residenton; foreach (`xe host-list params=uuid hostname=$hostname`) { $residenton = $1 if /:\s+(.+)/; } foreach (`xe vm-list params=uuid resident-on=$residenton`) { if (/:\s+(.+)/) { my $uuid = $1 if /:\s+(.+)/; my $fname = `xe vm-list params=name-label uuid=$uuid`; my $name = $1 if $fname =~ /:\s+(.+)/; my $fstatus = `xe vm-list params=power-state uuid=$uuid`; my $status = $1 if $fstatus =~ /:\s+(.+)/; my $fvcpu = `xe vm-list params=VCPUs-max uuid=$uuid`; my $vcpu = $1 if $fvcpu =~ /:\s+(.+)/; my $fmemory = `xe vm-list params=memory-actual uuid=$uuid`; my $tmemory = $1 if $fmemory =~ /:\s+(.+)/; my $memory = $1 if $tmemory =~ /(\d+)\d{6}$/; my $machine = { MEMORY => $memory, NAME => $name, UUID => $uuid, STATUS => $status, SUBSYSTEM => "xe", VMTYPE => "XEN", VCPU => $vcpu, }; $common->addVirtualMachine($machine); } } } 1; UnixAgent-2.4.2/lib/Ocsinventory/Agent/Common.pm000066400000000000000000000665661332737732100215500ustar00rootroot00000000000000############################################################################### ## OCSINVENTORY-NG ## Copyleft Guillaume PROTET 2010 ## Web : http://www.ocsinventory-ng.org ## ## This code is open source and may be copied and modified as long as the source ## code is always made freely available. ## Please refer to the General Public Licence http://www.gnu.org/ or Licence.txt ################################################################################ package Ocsinventory::Agent::Common; use strict; no strict 'refs'; use warnings; =head1 NAME Ocsinventory::Agent::Common - give common methods to other modules =over =item addController() Add a controller in the inventory. =item addUsb() Add external usb devices in the inventory. =item addInput() Add internal inputs as keyboard, mouse in the inventory. =item addModem() Add a modem in the inventory. =item addDrive() Add a partition in the inventory. =item addStorages() Add a storage system (hard drive, USB key, SAN volume, etc) in the inventory. =item addMemory() Add a memory module in the inventory. =item addPort() Add a port module in the inventory. =item addSlot() Add a slot in the inventory. =item addSoftware() Register a software in the inventory. =item addMonitor() Add a monitor (screen) in the inventory. =item addVideo() Add a video card in the inventory. =item addSound() Add a sound card in the inventory. =item addNetwork() Register a network in the inventory. =item addRepo() Register a repository in the inventory. =item setHardware() Save global information regarding the machine. The use of setHardware() to update USERID and PROCESSOR* information is deprecated, please, use addUser() and addCPU() instead. =item setBios() Set BIOS information. =item addCPU() Add a CPU in the inventory. =item addUser() Add an user in the list of logged user. =item addPrinter() Add a printer in the inventory. =item addVirtualMachine() Add a Virtual Machine in the inventory. =item addProcess() Record a running process in the inventory. =item addCamera() Add a camera device in the inventory. Only avalaible for MacOSX =item addIpDiscoverEntry() IpDiscover is used to identify network interface on the local network. This is done on the ARP level. This function adds a network interface in the inventory. =item setAccessLog() What is that for? :) =item flushXMLTags() Clear the content of $common->{xmltags} (to use after adding it in XML) =item addBatteries() Add a memory module in the inventory. =back =cut ################################################################################## # Ocsinventory::Agent::Common is use to give common methods to other modules # ################################################################################## sub new { my (undef, $params) = @_; my $self = {}; $self->{logger} = $params->{logger}; $self->{config} = $params->{config}; $self->{xmltags} = {}; bless $self; } sub addController { my ($self, $args) = @_; my $xmltags = $self->{xmltags}; my $content = {}; foreach my $key (qw/DESCRIPTION DRIVER NAME MANUFACTURER PCIID PCISLOT TYPE/) { if (exists $args->{$key}) { $content->{$key}[0] = $args->{$key} if $args->{$key}; } } push @{$xmltags->{CONTROLLERS}},$content; } sub addUsb { my ($self, $args) = @_; my $xmltags = $self->{xmltags}; my $content = {}; foreach my $key (qw/DESCRIPTION INTERFACE MANUFACTURER SERIAL TYPE/) { if (exists $args->{$key}) { $content->{$key}[0] = $args->{$key} if $args->{$key}; } } push @{$xmltags->{USBDEVICES}},$content; } sub addInput { my ($self, $args) = @_; my $xmltags = $self->{xmltags}; my $content = {}; foreach my $key (qw/DESCRIPTION INTERFACE MANUFACTURER SERIAL TYPE/) { if (exists $args->{$key}) { $content->{$key}[0] = $args->{$key} if $args->{$key}; } } push @{$xmltags->{INPUTS}},$content; } sub addModem { my ($self, $args) = @_; my $xmltags = $self->{xmltags}; my $content = {}; foreach my $key (qw/DESCRIPTION NAME/) { if (exists $args->{$key}) { $content->{$key}[0] = $args->{$key} if $args->{$key}; } } push @{$xmltags->{MODEMS}}, $content; } # For compatibility sub addModems { my $self = shift; my $logger = $self->{logger}; $logger->debug("please rename addModems to addModem()"); $self->addModem(@_); } sub addDrive { my ($self, $args) = @_; my $xmltags = $self->{xmltags}; my $content = {}; foreach my $key (qw/CREATEDATE FREE FILESYSTEM LABEL SERIAL TOTAL TYPE VOLUMN/) { if (exists $args->{$key}) { $content->{$key}[0] = $args->{$key} if $args->{$key}; } } push @{$xmltags->{DRIVES}}, $content; } # For compatibility sub addDrives { my $self = shift; my $logger = $self->{logger}; $logger->debug("please rename addDrives to addDrive()"); $self->addDrive(@_); } sub addStorages { my ($self, $args) = @_; my $xmltags = $self->{xmltags}; my $content = {}; foreach my $key (qw/DESCRIPTION DISKSIZE FIRMWARE MANUFACTURER MODEL NAME SERIALNUMBER SCSI_CHID SCSI_COID SCSI_LUN SCSI_UNID TYPE/) { if (exists $args->{$key}) { $content->{$key}[0] = $args->{$key} if $args->{$key}; } } push @{$xmltags->{STORAGES}}, $content; } # For compatibility sub addStorage { my $self = shift; my $logger = $self->{logger}; $logger->debug("please rename addStorages to addStorage()"); $self->addStorage(@_); } sub addMemory { my ($self, $args) = @_; my $xmltags = $self->{xmltags}; my $content = {}; foreach my $key (qw/CAPACITY CAPTION DESCRIPTION ERRORCORRECTIONTYPE MANUFACTURER NUMSLOTS SERIALNUMBER SPEED TYPE/) { if (exists $args->{$key}) { $content->{$key}[0] = $args->{$key} if $args->{$key}; } } push @{$xmltags->{MEMORIES}}, $content; } # For compatibility sub addMemories { my $self = shift; my $logger = $self->{logger}; $logger->debug("please rename addMemories to addMemory()"); $self->addMemory(@_); } sub addPorts{ my ($self, $args) = @_; my $xmltags = $self->{xmltags}; my $content = {}; foreach my $key (qw/CAPTION DESCRIPTION NAME TYPE/) { if (exists $args->{$key}) { $content->{$key}[0] = $args->{$key} if $args->{$key}; } } push @{$xmltags->{PORTS}}, $content; } # For compatibility sub addPort { my $self = shift; my $logger = $self->{logger}; $logger->debug("please rename addPorts to addPort()"); $self->addPort(@_); } sub addSlot { my ($self, $args) = @_; my $xmltags = $self->{xmltags}; my $content = {}; foreach my $key (qw/DESCRIPTION DESIGNATION NAME STATUS/) { if (exists $args->{$key}) { $content->{$key}[0] = $args->{$key} if $args->{$key}; } } push @{$xmltags->{SLOTS}}, $content; } # For compatibility sub addSlots { my $self = shift; my $logger = $self->{logger}; $logger->debug("please rename addSlots to addSlot()"); $self->addSlot(@_); } sub addSoftware { my ($self, $args) = @_; my $xmltags = $self->{xmltags}; my $content = {}; foreach my $key (qw/COMMENTS FILESIZE FOLDER FROM INSTALLDATE NAME PUBLISHER VERSION/) { if (exists $args->{$key}) { $content->{$key}[0] = $args->{$key} if $args->{$key}; } } push @{$xmltags->{SOFTWARES}}, $content; } # For compatibility sub addSoftwares { my $self = shift; my $logger = $self->{logger}; $logger->debug("please rename addSoftwares to addSoftware()"); $self->addSoftware(@_); } sub addMonitor { my ($self, $args) = @_; my $xmltags = $self->{xmltags}; my $content = {}; foreach my $key (qw/BASE64 CAPTION DESCRIPTION MANUFACTURER SERIAL UUENCODE/) { if (exists $args->{$key}) { $content->{$key}[0] = $args->{$key} if $args->{$key}; } } push @{$xmltags->{MONITORS}}, $content; } # For compatibility sub addMonitors { my $self = shift; my $logger = $self->{logger}; $logger->debug("please rename addMonitors to addMonitor()"); $self->addMonitor(@_); } sub addVideo { my ($self, $args) = @_; my $xmltags = $self->{xmltags}; my $content = {}; foreach my $key (qw/CHIPSET DRVVERSION MEMORY NAME PCISLOT PCIID RESOLUTION SPEED UUID VBIOS/) { if (exists $args->{$key}) { $content->{$key}[0] = $args->{$key} if $args->{$key}; } } push @{$xmltags->{VIDEOS}}, $content; } # For compatibility sub addVideos { my $self = shift; my $logger = $self->{logger}; $logger->debug("please rename addVideos to addVideo()"); $self->addVideo(@_); } sub addSound { my ($self, $args) = @_; my $xmltags = $self->{xmltags}; my $content = {}; foreach my $key (qw/DESCRIPTION MANUFACTURER NAME/) { if (exists $args->{$key}) { $content->{$key}[0] = $args->{$key} if $args->{$key}; } } push @{$xmltags->{SOUNDS}}, $content; } # For compatibility sub addSounds { my $self = shift; my $logger = $self->{logger}; $logger->debug("please rename addSounds to addSound()"); $self->addSound(@_); } sub addNetwork { my ($self, $args) = @_; my $xmltags = $self->{xmltags}; my $content = {}; foreach my $key (qw/BASE BSSID DESCRIPTION DRIVER DUPLEX IPADDRESS IPDHCP IPGATEWAY IPMASK IPSUBNET MACADDR MODE MTU PCISLOT SLAVE SPEED SSID STATUS TYPE VERSION VIRTUALDEV /) { if (exists $args->{$key}) { $content->{$key}[0] = $args->{$key} if $args->{$key}; } } push @{$xmltags->{NETWORKS}}, $content; } # For compatibility sub addNetworks { my $self = shift; my $logger = $self->{logger}; $logger->debug("please rename addNetworks to addNetwork()"); $self->addNetwork(@_); } sub addRepo { my ($self, $args) = @_; my $xmltags = $self->{xmltags}; my $content = {}; foreach my $key (qw/BASEURL ENABLED FINGERPRINTS FILENAME MIRROR NAME PACKAGES PRIORITY REVISION SIGNATURE SIZE TAG UPDATED/) { if (exists $args->{$key}) { $content->{$key}[0] = $args->{$key} if $args->{$key}; } } push @{$xmltags->{REPOSITORY}}, $content; } # For compatibility sub addRepos { my $self = shift; my $logger = $self->{logger}; $logger->debug("please rename addRepos to addRepo()"); $self->addRepo(@_); } sub setHardware { my ($self, $args, $nonDeprecated) = @_; my $xmltags = $self->{xmltags}; my $logger = $self->{logger}; foreach my $key (qw/USERID OSVERSION PROCESSORN OSCOMMENTS CHECKSUM PROCESSORT NAME PROCESSORS SWAP ETIME TYPE OSNAME IPADDR WORKGROUP DESCRIPTION MEMORY UUID DNS LASTLOGGEDUSER DATELASTLOGGEDUSER DEFAULTGATEWAY VMSYSTEM/) { if (exists $args->{$key}) { if ($key eq 'PROCESSORS' && !$nonDeprecated) { $logger->debug("PROCESSORN, PROCESSORS and PROCESSORT shouldn't be set directly anymore. Please use addCPU() method instead."); } if ($key eq 'USERID' && !$nonDeprecated) { $logger->debug("USERID shouldn't be set directly anymore. Please use addUser() method instead."); } $xmltags->{'HARDWARE'}{$key}[0] = $args->{$key}; } } } sub setBios { my ($self, $args) = @_; my $xmltags = $self->{xmltags}; foreach my $key (qw/SMODEL SMANUFACTURER SSN BDATE BVERSION BMANUFACTURER MMANUFACTURER MSN MMODEL ASSETTAG TYPE/) { if (exists $args->{$key}) { $xmltags->{'BIOS'}{$key}[0] = $args->{$key}; } } } sub addCPU { my ($self, $args) = @_; my $xmltags = $self->{xmltags}; my $content = {}; foreach my $key (qw/CORES CPUARCH CPUSTATUS CURRENT_SPEED DATA_WIDTH HPT L2CACHESIZE MANUFACTURER NBSOCKET SERIALNUMBER SOCKET SPEED TYPE VOLTAGE LOGICAL_CPUS/) { if (exists $args->{$key}) { $content->{$key}[0] = $args->{$key} if $args->{$key}; } } push @{$xmltags->{CPUS}}, $content; # For the compatibility with HARDWARE/PROCESSOR* my $processorn = int @{$xmltags->{CPUS}}; my $processors = $xmltags->{CPUS}[0]{SPEED}[0]; my $processort = $xmltags->{CPUS}[0]{TYPE}[0]; $self->setHardware ({ PROCESSORN => $processorn, PROCESSORS => $processors, PROCESSORT => $processort, }, 1); } sub addUser { my ($self, $args) = @_; my $xmltags = $self->{xmltags}; my $login = $args->{LOGIN}; return unless $login; # Is the login, already in the XML ? foreach my $user (@{$xmltags->{USERS}}) { return if $user->{LOGIN}[0] eq $login; } push @{$xmltags->{USERS}}, { LOGIN => [$login] }; my $userString = $xmltags->{HARDWARE}->{USERID}[0] || ""; $userString .= '/' if $userString; $userString .= $login; $self->setHardware ({ USERID => $userString, }, 1); } sub addPrinter { my ($self, $args) = @_; my $xmltags = $self->{xmltags}; my $content = {}; foreach my $key (qw/DESCRIPTION DRIVER NAME PORT/) { if (exists $args->{$key}) { $content->{$key}[0] = $args->{$key} if $args->{$key}; } } push @{$xmltags->{PRINTERS}}, $content; } # For compatibility sub addPrinters { my $self = shift; my $logger = $self->{logger}; $logger->debug("please rename addPrinters to addPrinter()"); $self->addPrinter(@_); } sub addBatteries { my ($self, $args) = @_; my $xmltags = $self->{xmltags}; my $content = {}; foreach my $key (qw/CHEMISTRY DESIGNCAPACITY DESIGNVOLTAGE LOCATION MANUFACTURER MANUFACTUREDATE MAXERROR NAME OEMSPECIFIC SBDSVERSION SERIALNUMBER /) { if (exists $args->{$key}) { $content->{$key}[0] = $args->{$key} if $args->{$key}; } } push @{$xmltags->{BATTERIES}}, $content; } sub addVirtualMachine { my ($self, $args) = @_; my $xmltags = $self->{xmltags}; my $content = {}; foreach my $key (qw/CORES IPADDR MEMORY NAME UUID STATUS SUBSYSTEM VMTYPE VCPU VMID/) { if (exists $args->{$key}) { $content->{$key}[0] = $args->{$key} if $args->{$key}; } } push @{$xmltags->{VIRTUALMACHINES}}, $content; } sub addProcess { my ($self, $args) = @_; my $xmltags = $self->{xmltags}; my $content = {}; foreach my $key (qw/COMMANDLINE CPUUSAGE PROCESSMEMORY PROCESSID STARTED TTY USERNAME VIRTUALMEMORY/) { if (exists $args->{$key}) { $content->{$key}[0] = $args->{$key} if $args->{$key}; } } push @{$xmltags->{RUNNING_PROCESSES}}, $content; } sub addCamera { my ($self, $args) = @_; my $xmltags = $self->{xmltags}; my $content = {}; foreach my $key (qw/MODEL UUID/){ if (exists $args->{$key}) { $content->{$key}[0] = $args->{$key} if $args->{$key}; } } push @{$xmltags->{RUNNING_PROCESSES}}, $content; } sub addIpDiscoverEntry { my ($self, $args) = @_; my $xmltags = $self->{xmltags}; my $ipaddress = $args->{IPADDRESS}; my $macaddr = $args->{MACADDR}; my $name = $args->{NAME}; if (!$xmltags->{IPDISCOVER}{H}) { $xmltags->{IPDISCOVER}{H} = []; } push @{$xmltags->{IPDISCOVER}{H}}, { # If I or M is undef, the server will ignore the host I => [$ipaddress?$ipaddress:""], M => [$macaddr?$macaddr:""], N => [$name?$name:"-"], # '-' is the default value returned by ipdiscover }; } sub setAccessLog { my ($self, $args) = @_; foreach my $key (qw/USERID LOGDATE/) { if (exists $args->{$key}) { $self->{xmlroot}{'CONTENT'}{'ACCESSLOG'}{$key}[0] = $args->{$key}; } } } sub flushXMLTags { my $self= shift; $self->{xmltags} = {}; } ### SNMP specifics subroutines #### sub getSnmpTable { my ($self,$snmp_table,$baseoid,$snmp_infos) = @_; # $snmp_infos is a hash passed for the SNMP information we want to get # It has to be created like this : # my $hash = { # INFORMATION => OID, #}; my $results={}; #The final hash which will contain one key per SNMP reference for my $oid ( keys %$snmp_table ) { if ( $oid =~ /$baseoid\.\d+\.\d+\.(\S+)/ ) { my $reference=$1; #Getting the last digits of the OID separated by a dot # Getting information if one the values from $snmp_infos hash is found for the current OID for my $value (keys %$snmp_infos) { if ($oid =~ /$snmp_infos->{$value}\.$reference/) { $results->{$reference}->{$value}= $snmp_table->{$oid} } } } } return $results; } sub setSnmpCommons { my ($self,$args) = @_; my $xmltags = $self->{xmltags}; foreach my $key (qw/IPADDR MACADDR SNMPDEVICEID NAME DESCRIPTION CONTACT LOCATION UPTIME DOMAIN TYPE / ) { if (exists $args->{$key}) { $xmltags->{COMMON}[0]{$key}[0] = $args->{$key}; } } } sub setSnmpPrinter { my ($self,$args) = @_; my $xmltags = $self->{xmltags}; foreach my $key (qw/NAME SERIALNUMBER COUNTER STATUS ERRORSTATE/ ) { if (exists $args->{$key}) { $xmltags->{PRINTERS}[0]{$key}[0] = $args->{$key}; } } } sub setSnmpSwitchInfos { my ($self,$args) = @_; my $xmltags = $self->{xmltags}; foreach my $key (qw/TYPE/) { if (exists $args->{$key}) { $xmltags->{SWITCHINFOS}[0]{$key}[0] = $args->{$key}; } } } sub setSnmpFirewalls { my ($self,$args) = @_; my $xmltags = $self->{xmltags}; foreach my $key (qw/SERIALNUMBER SYSTEM/) { if (exists $args->{$key}) { $xmltags->{FIREWALLS}[0]{$key}[0] = $args->{$key}; } } } sub setSnmpLoadBalancer { my ($self,$args) = @_; my $xmltags=$self->{xmltags}; foreach my $key (qw/SERIALNUMBER SYSTEM MANUFACTURER TYPE/ ) { if (exists $args->{$key}) { $xmltags->{LOADBALANCERS}[0]{$key}[0] = $args->{$key}; } } } sub setSnmpBlade { my ($self,$args) = @_; my $xmltags = $self->{xmltags}; foreach my $key (qw/SERIALNUMBER SYSTEM/) { if (exists $args->{$key}) { $xmltags->{BLADES}[0]{$key}[0] = $args->{$key}; } } } sub setSnmpComputer { my ($self,$args) = @_; my $xmltags = $self->{xmltags}; foreach my $key (qw/SYSTEM/) { if (exists $args->{$key}) { $xmltags->{COMPUTERS}[0]{$key}[0] = $args->{$key}; } } } sub addSnmpPrinterCartridge { my ($self,$args) = @_; my $xmltags = $self->{xmltags}; my $content = {}; foreach my $key (qw/DESCRIPTION TYPE LEVEL MAXCAPACITY COLOR/) { if (exists $args->{$key}) { $content->{$key}[0] = $args->{$key}; } } push @{$xmltags->{CARTRIDGES}},$content; } sub addSnmpPrinterTray { my ($self,$args) = @_; my $xmltags = $self->{xmltags}; my $content = {}; foreach my $key (qw/NAME DESCRIPTION LEVEL MAXCAPACITY/) { if (exists $args->{$key}) { $content->{$key}[0] = $args->{$key}; } } push @{$xmltags->{TRAYS}},$content; } sub addSnmpNetwork { my ($self,$args) = @_; my $xmltags = $self->{xmltags}; my $content = {}; foreach my $key (qw/DESCRIPTION MACADDR DEVICEMACADDR SLOT STATUS SPEED TYPE DEVICEADDRESS DEVICENAME DEVICEPORT DEVICETYPE TYPEMIB IPADDR IPMASK IPGATEWAY IPSUBNET IPDHCP DRIVER VIRTUALDEV/) { if (exists $args->{$key}) { $content->{$key}[0] = $args->{$key}; } } push @{$xmltags->{NETWORKS}},$content; } sub addSnmpCard { my ($self,$args) = @_; my $xmltags = $self->{xmltags}; my $content = {}; foreach my $key (qw/DESCRIPTION REFERENCE FIRMWARE SOFTWARE REVISION SERIALNUMBER MANUFACTURER TYPE/) { if (exists $args->{$key}) { $content->{$key}[0] = $args->{$key}; } } push @{$xmltags->{CARDS}},$content; } sub addSnmpFan { my ($self,$args) = @_; my $xmltags = $self->{xmltags}; my $content = {}; foreach my $key (qw/DESCRIPTION REFERENCE REVISION SERIALNUMBER MANUFACTURER TYPE/) { if (exists $args->{$key}) { $content->{$key}[0] = $args->{$key}; } } push @{$xmltags->{FANS}},$content; } sub addSnmpPowerSupply { my ($self,$args) = @_; my $xmltags = $self->{xmltags}; my $content = {}; foreach my $key (qw/MANUFACTURER REFERENCE TYPE SERIALNUMBER DESCRIPTION REVISION/ ) { if (exists $args->{$key}) { $content->{$key}[0]=$args->{$key}; } } push @{$xmltags->{POWERSUPPLIES}},$content; } sub addSnmpSwitch { my ($self,$args) = @_; my $xmltags = $self->{xmltags}; my $content = {}; foreach my $key (qw/MANUFACTURER REFERENCE TYPE SOFTVERSION FIRMVERSION SERIALNUMBER REVISION DESCRIPTION/) { if (exists $args->{$key}) { $content->{$key}[0]=$args->{$key}; } } push @{$xmltags->{SWITCHS}},$content; } sub addSnmpLocalPrinter { my ($self,$args) = @_; my $xmltags = $self->{xmltags}; my $content = {}; foreach my $key (qw/NAME/) { if (exists $args->{$key}) { $content->{$key}[0] = $args->{$key}; } } push @{$xmltags->{LOCALPRINTERS}},$content; } sub addSnmpInput { my ($self,$args) = @_; my $xmltags = $self->{xmltags}; my $content = {}; foreach my $key (qw/DESCRIPTION TYPE/) { if (exists $args->{$key}) { $content->{$key}[0] = $args->{$key}; } } push @{$xmltags->{INPUTS}},$content; } sub addSnmpCPU { my ($self,$args) = @_; my $xmltags = $self->{xmltags}; my $content = {}; foreach my $key (qw/MANUFACTURER TYPE SPEED/) { if (exists $args->{$key}) { $content->{$key}[0] = $args->{$key}; } } push @{$xmltags->{CPUS}},$content; } #Subroutine to add 0 in 'Sun like' MAC address if needed sub padSnmpMacAddress { my ($self,$mac) = @_; my @splitedAddr = split(':', $mac); for (@splitedAddr) { unless ($_ =~ /\w{2}/) { $_ = sprintf("%02s", $_); } } $mac=join (':', @splitedAddr); return $mac; } sub cleanXml { my ($self,$content) = @_; my $logger = $self->{logger}; my $clean_content; # To avoid strange breakage I remove the unprintable characters in the XML foreach (split "\n", $content) { if (! m/\A( [\x09\x0A\x0D\x20-\x7E] # ASCII | [\xC2-\xDF][\x80-\xBF] # non-overlong 2-byte | \xE0[\xA0-\xBF][\x80-\xBF] # excluding overlongs | [\xE1-\xEC\xEE\xEF][\x80-\xBF]{2} # straight 3-byte | \xED[\x80-\x9F][\x80-\xBF] # excluding surrogates | \xF0[\x90-\xBF][\x80-\xBF]{2} # planes 1-3 | [\xF1-\xF3][\x80-\xBF]{3} # planes 4-15 | \xF4[\x80-\x8F][\x80-\xBF]{2} # plane 16 )*\z/x) { s/[[:cntrl:]]//g; $self->{logger}->debug("non utf-8 '".$_."'"); } # Is that a good idea. Intent to drop some nasty char # s/[A-z0-9_\-<>\/:\.,#\ \?="'\(\)]//g; $clean_content .= $_."\n"; } return $clean_content; } #Subroutine to read XML structure (returned by XML::Simple::XMLin) and encode content in utf8. sub readXml { my ($self, $xml, $forcearray) = @_; my $logger = $self->{logger}; my $content = XML::Simple::XMLin($xml, ForceArray => [@{$forcearray}]); foreach my $key (keys %$content) { if (grep(/^$key$/, @{$forcearray})) { #Forced array in XML parsing $self->parseXmlArray($content->{$key},$forcearray); } else { #Not a forced array in XML parsing if (ref ($content->{$key}) =~ /^HASH$/ && !keys %{$content->{$key}}) { # If empty hash from XMLin() $content->{$key} = ''; } else { utf8::encode($content->{$key}) }; } } return $content; } #Subroutine to parse array in XML structure (returned by XML::Simple::XMLin) and encode it in utf8 sub parseXmlArray { my ($self,$array,$forcearray) = @_; foreach my $hash (@{$array}) { foreach my $key (keys %$hash) { if ( grep (/^$key$/,@$forcearray)) { #Forced array in XML parsing $self->parseXmlArray($hash->{$key},$forcearray); } else { #Not a forced array in XML parsing if (ref ($hash->{$key}) =~ /^HASH$/ && !keys %{$hash->{$key}}) { # If empty hash from XMLin() $hash->{$key} = ''; } else { utf8::encode($hash->{$key}) }; } } } } #Subroutine to convert versions to numbers (with icutting or right padding if needed) # We create it because Perl 5.8 does not include version comparison modules or functions sub convertVersion { my ($self,$version,$length) = @_; $version =~ s/\.//g; #We convert to number my $ver_length = length ($version); if ($ver_length > $length) { # We cut the number $version = substr $version, 0, $length; } elsif ($ver_length < $length) { #We add 0 to the right $version = substr($version . (0 x $length), 0, $length); } return $version; } #We create this subroutine because MacOSX system_profiler XML output does not give all ##the neeeded data (for videos and sounds for example) sub get_sysprofile_devices_names { my ($self,$type) = @_; return(undef) unless -r '/usr/sbin/system_profiler'; my $output=`system_profiler $type`; my $name; my $names=[]; # Code inspired from Mac::Sysprofile 0.03 from Daniel Muey for(split /\n/, $output) { next if m/^\s*$/ || m/^\w/; if(m/^\s{4}\w/) { $name = $_; $name =~ s/^\s+//; $name =~ s/:.*$//; push(@$names,$name); } } return $names; } ### Generic shared subroutines ##### sub can_run { my $self = shift; my $binary = shift; my $logger = $self->{logger}; my $calling_namespace = caller(0); chomp(my $binpath=`which $binary 2>/dev/null`); return unless -x $binpath; $self->{logger}->debug(" - $binary found"); 1; } sub can_load { my $self = shift; my $module = shift; my $logger = $self->{logger}; my $calling_namespace = caller(0); eval "package $calling_namespace; use $module;"; return if $@; $self->{logger}->debug(" - $module loaded"); 1; } sub can_read { my $self = shift; my $file = shift; my $logger = $self->{logger}; return unless -r $file; $self->{logger}->debug(" - $file can be read"); 1; } sub runcmd { my $self = shift; my $cmd = shift; my $logger = $self->{logger}; return unless $cmd; # $self->{logger}->debug(" - run $cmd"); return `$cmd`; } #### Old subroutines from the former Common.pm used by Download.pm ####### sub get_path{ my $self = shift; my $binary = shift; my $path; my @bin_directories = qw { /usr/local/sbin/ /sbin/ /usr/sbin/ /bin/ /usr/bin/ /usr/local/bin/ /etc/ocsinventory-client/}; print "\n=> retrieving $binary...\n" if $::debug; for (@bin_directories){ $path = $_.$binary,last if -x $_.$binary; } # For debbuging purposes if ($path){ print "=> $binary is at $path\n\n" if $::debug; } else { print "$binary not found (Maybe it is not installed ?) - Some functionnalities may lack !!\n\n"; } return $path; } sub already_in_array { my $self = shift; my $lookfor = shift; my @array = @_; foreach (@array){ if ($lookfor eq $_){ return 1 ; } } return 0; } 1; UnixAgent-2.4.2/lib/Ocsinventory/Agent/Config.pm000066400000000000000000000170511332737732100215060ustar00rootroot00000000000000package Ocsinventory::Agent::Config; use strict; use Getopt::Long; our $VERSION = '2.4.2'; my $basedir = ''; my $default = { 'daemon' => 0, 'debug' => 0, 'devlib' => 0, 'force' => 0, 'help' => 0, 'info' => 1, 'lazy' => 0, 'local' => '', # 'logger' => 'Syslog,File,Stderr', 'logger' => 'Stderr', 'logfacility' => 'LOG_USER', 'logfile' => '', 'password' => '', 'proxy' => '', 'realm' => '', 'remotedir' => '/ocsinventory', # deprecated, give a complete URL to # --server instead 'server' => 'http://ocsinventory-ng/ocsinventory', 'stdout' => 0, 'tag' => '', 'user' => '', 'version' => 0, 'wait' => '', # 'xml' => 0, 'nosoftware'=> 0, 'delaytime' => '3600', # max delay time (seconds) 'backendCollectTimeout' => '600', # timeOut of process : see Backend.pm 'scanhomedirs' => 0, 'ssl' => 1, 'ca' => '', # Other values that can't be changed with the # CLI parameters 'VERSION' => $VERSION, 'deviceid' => '', 'basevardir'=> $basedir.'/var/lib/ocsinventory-agent', 'logdir' => $basedir.'/var/log/ocsinventory-agent', # 'pidfile' => $basedir.'/var/run/ocsinventory-agent.pid', }; sub new { my (undef, $params) = @_; my $self = {}; bless $self; $self->{file} = $params->{file}; $self->{config} = $default; $self->loadFromCfgFile(); return $self; } sub loadFromCfgFile { my $self = shift; my $config; $self->{config}{etcdir} = []; push (@{$self->{config}{etcdir}}, '/etc/ocsinventory'); push (@{$self->{config}{etcdir}}, '/usr/local/etc/ocsinventory'); push (@{$self->{config}{etcdir}}, '/etc/ocsinventory-agent'); push (@{$self->{config}{etcdir}}, $ENV{HOME}.'/.ocsinventory'); # Should I? my $file; if (!$file || !-f $file) { foreach (@{$self->{config}{etcdir}}) { $file = $_.'/ocsinventory-agent.cfg'; last if -f $file; } return $config unless -f $file; } $self->{configfile} = $file; if (!open (CONFIG, "<".$file)) { print(STDERR "Config: Failed to open $file\n"); return $config; } foreach () { s/^#.+//; if (/(\w+)\s*=\s*(.+)/) { my $key = $1; my $val = $2; # Remove the quotes $val =~ s/\s+$//; $val =~ s/^'(.*)'$/$1/; $val =~ s/^"(.*)"$/$1/; $self->{config}{$key} = $val; } } close CONFIG; } sub loadUserParams { my $self = shift; my %options = ( "backend-collect-timeout=s" => \$self->{config}{backendCollectTimeout}, "basevardir=s" => \$self->{config}{basevardir}, "d|daemon" => \$self->{config}{daemon}, "debug" => \$self->{config}{debug}, "devlib" => \$self->{config}{devlib}, "f|force" => \$self->{config}{force}, "h|help" => \$self->{config}{help}, "i|info" => \$self->{config}{info}, "lazy" => \$self->{config}{lazy}, "l|local=s" => \$self->{config}{local}, "logfile=s" => \$self->{config}{logfile}, "nosoftware" => \$self->{config}{nosoftware}, "p|password=s" => \$self->{config}{password}, "P|proxy=s" => \$self->{config}{proxy}, "r|realm=s" => \$self->{config}{realm}, "R|remotedir=s" => \$self->{config}{remotedir}, "s|server=s" => \$self->{config}{server}, "stdout" => \$self->{config}{stdout}, "t|tag=s" => \$self->{config}{tag}, "u|user=s" => \$self->{config}{user}, "version" => \$self->{config}{version}, "w|wait=s" => \$self->{config}{wait}, # "x|xml" => \$self->{config}{xml}, "delaytime" => \$self->{config}{delaytime}, "scan-homedirs" => \$self->{config}{scanhomedirs}, "nolocal" => \$self->{config}{nolocal}, "ssl=s" => \$self->{config}{ssl}, "ca=s" => \$self->{config}{ca}, ); $self->help() if (!GetOptions(%options) || $self->{config}{help}); $self->version() if $self->{config}{version}; } sub help { my ($self, $error) = @_; if ($error) { chomp $error; print "ERROR: $error\n\n"; } if ($self->{configfile}) { print STDERR "Setting initialised with values retrieved from ". "the config found at ".$self->{configfile}."\n"; } print STDERR "\n"; print STDERR "Usage:\n"; print STDERR "\t--backend-collect-timeout set a max delay time of one action (search package id, ...) is set (".$self->{config}{backendCollectTimeout}.")\n"; print STDERR "\t--basevardir=/path indicate the directory where should the agent store its files (".$self->{config}{basevardir}.")\n"; print STDERR "\t-d --daemon detach the agent in background (".$self->{config}{daemon}.")\n"; print STDERR "\t --debug debug mode (".$self->{config}{debug}.")\n"; print STDERR "\t --devlib search for Backend mod in ./lib only (".$self->{config}{devlib}.")\n"; print STDERR "\t-f --force always send data to server (Don't ask before) (".$self->{config}{force}.")\n"; print STDERR "\t-i --info verbose mode (".$self->{config}{info}.")\n"; print STDERR "\t--lazy do not contact the server more than one time during the PROLOG_FREQ (".$self->{config}{lazy}.")\n"; print STDERR "\t-l --local=DIR do not contact server but write inventory in DIR directory in XML (".$self->{config}{local}.")\n"; print STDERR "\t --logfile=FILE log message in FILE (".$self->{config}{logfile}.")\n"; print STDERR "\t-p --password=PWD password for server auth\n"; print STDERR "\t-P --proxy=PROXY proxy address. e.g: http://user:pass\@proxy:port (".$self->{config}{proxy}.")\n"; print STDERR "\t-r --realm=REALM realm for server auth. e.g: 'Restricted Area' (".$self->{config}{realm}.")\n"; print STDERR "\t-s --server=uri server uri (".$self->{config}{server}.")\n"; print STDERR "\t --stdout do not write or post the inventory but print it on STDOUT\n"; print STDERR "\t-t --tag=TAG use TAG as tag (".$self->{config}{tag}."). Will be ignored by server if a value already exists.\n"; print STDERR "\t-u --user=USER user for server auth (".$self->{config}{user}.")\n"; print STDERR "\t --version print the version\n"; print STDERR "\t-w --wait=seconds wait a random period before contacting server like --daemon does (".$self->{config}{wait}.")\n"; # print STDERR "\t-x --xml write output in a xml file ($self->{config}{xml})\n"; print STDERR "\t--nosoftware do not return installed software list (".$self->{config}{nosoftware}.")\n"; print STDERR "\t--delaytime set a max delay time (in second) if no PROLOG_FREQ is set (".$self->{config}{delaytime}.")\n"; print STDERR "\t--scan-homedirs permit to scan home user directories (".$self->{config}{scanhomedirs}.")\n" ; print STDERR "\t--ssl=0|1 disable or enable SSL communications check\n" ; print STDERR "\t--ca=FILE path to CA certificate chain file in PEM format\n" ; print STDERR "\n"; print STDERR "Manpage:\n"; print STDERR "\tSee man ocsinventory-agent\n"; print STDERR "\n"; print STDERR "Ocsinventory-Agent is released under GNU GPL 2 license\n"; exit 1; } sub version { print "Ocsinventory unified agent for UNIX, Linux and MacOSX (".$VERSION.")\n"; exit 0; } 1; UnixAgent-2.4.2/lib/Ocsinventory/Agent/Hooks.pm000066400000000000000000000060251332737732100213630ustar00rootroot00000000000000package Ocsinventory::Agent::Hooks; # This package give possibility to use hooks in unified unix agent. use strict; use warnings; #use FindBin qw($Bin); sub new { my (undef, $context) = @_; my $self = {}; $self->{accountinfo} = $context->{accountinfo}; $self->{accountconfig} = $context->{accountconfig}; my $logger = $self->{logger}=$context->{logger}; $self->{config} = $context->{config}; $self->{dontuse} = 1; my $modulefile; foreach (@{$self->{config}->{etcdir}}) { $modulefile = $_.'/modules.conf'; if (-f $modulefile) { if (do $modulefile) { $logger->debug("Turns hooks on for $modulefile"); $self->{dontuse} = 0; last; } else { $logger->debug("Failed to load `$modulefile': $?"); } } } if ($self->{dontuse}) { $logger->debug("No modules will be used."); } else { my $ocsAgentServerUri; # to avoid a warning if $self->{config}->{server} is not defined if ($self->{config}->{server}) { $ocsAgentServerUri = "http://".$self->{config}->{server}.$self->{config}->{remotedir}; } if ($self->{config}->{debug}) { $::debug = 2; } } # Create objects for modules foreach my $package (searchModules(\%Ocsinventory::Agent::Modules::)){ my $module = new $package($context); my $name = $module->{structure}->{name}; # Store the reference in a key to access modules easily $self->{modules}->{$name}=$module; } bless $self; } # This function recursively searches for modules in a given namespace # Param: a hash reference to the namespace # Returns: an array with modules fully qualified names sub searchModules { my $symbols_href = shift; my @modules_list = (); my %symbols_h = %{$symbols_href}; my @symbols_a = sort(keys(%symbols_h)); foreach(@symbols_a){ if ($_ eq 'new'){ # Found a "new" method -> this is a usable module my $module_fqn = $symbols_h{$_}; # Keep the module fqn, without '*' at start $module_fqn =~ s/\*?(.+)::new$/$1/; push(@modules_list, $module_fqn); } elsif (substr($_, -2) eq '::') { # If we meet a package, continue walking push(@modules_list, searchModules($symbols_h{$_})); } } return @modules_list; } sub run { my ($self, $args, $moduleparam) = @_; return if $self->{dontuse}; my $name = $args->{name}; #type of hook asked my $logger = $self->{logger}; $logger->debug("Calling handlers : `$name'"); # Launching hook for modules if not 'undef' and if modules are not disabled by start_handler for (keys %{$self->{modules}}) { my $module = $self->{modules}->{$_}; unless ($module->{disabled}) { my $hook = $module->{structure}->{$name}; if ($hook) { $module->$hook($moduleparam); } } } } 1; UnixAgent-2.4.2/lib/Ocsinventory/Agent/Modules/000077500000000000000000000000001332737732100213475ustar00rootroot00000000000000UnixAgent-2.4.2/lib/Ocsinventory/Agent/Modules/Apache/000077500000000000000000000000001332737732100225305ustar00rootroot00000000000000UnixAgent-2.4.2/lib/Ocsinventory/Agent/Modules/Apache/Vhosts/000077500000000000000000000000001332737732100240165ustar00rootroot00000000000000UnixAgent-2.4.2/lib/Ocsinventory/Agent/Modules/Apache/Vhosts/Common.pm000066400000000000000000000246101332737732100256070ustar00rootroot00000000000000############################################################################### # Apache::Vhosts::Common - Common stuff for apache vhosts inventory # # Author: Linkbynet ############################################################################### package Ocsinventory::Agent::Modules::Apache::Vhosts::Common; =head1 NAME Apache::Vhosts::Common - Lib for common operations in vhosts inventory =head1 DESCRIPTION This package is meant to contain common functions used by OCS modules for Apache virtualhosts. For example, we could have two OCS modules: =over =item ApacheVhostsPackaged which would deal with packaged apache setups =item ApacheVhostsCompiled which would deal with compiled apache versions =back At different times, these modules still would need to do the same things, such as parsing apache configuration files, reading and extracting information from a vhost dump, reading a x509 certificate with openssl, ... To avoid code duplication, the specific modules can call the functions contained in this common package. =head2 Exports The module exports the following functions: =over =item C =item C =back =cut use Exporter; our @ISA = qw(Exporter); our @EXPORT = qw(&readVhostsDump &readVhostConfFile); use strict; use warnings; #### BEGIN: Define regexes # Useful lines in vhosts dump (NameVirtualHosts and IP vhosts only) my $dumpline_name_re = qr/^port ([0-9]+) namevhost (\S+) \((\S+):([0-9]+)\)/; my $dumpline_ip_re = qr/^([0-9.]+):([0-9]+)\s+(\S+) \((\S+):([0-9]+)\)/; # "subject=" line of openssl x509 command output (used to extract CN) my $subject_cn_re = qr/^subject=.*\/CN=([^\s\/]+).*$/; # Simplistic email address pattern my $damn_simple_email_re = qr/.+\@.+\..+/; #### END: Define regexes =head2 readVhostsDump() Return an array of hashes with the virtualhosts found thanks to Apache's vhosts dump (C command). =head3 Return type The function returns a reference to an array of hashes. =head3 Process The function's workflow is as follows: =over =item 1 Open C command output, with the current configuration file =item 2 Read dump line by line to match IP-based or name-based virtualhost information (both types of lines should be recognized): port 80 namevhost mynamevhost.fr (/etc/httpd/.../10-mynamevhost.conf:50) 10.0.0.1:80 myvhost myipvhost.fr (/etc/httpd/.../20-myipvhost.conf:1) =item 3 Create a hash with the virtualhost's data We put the following attributes in it: (string) computedname, (int) port, (string) srvname, (string) vhostfile, (string) vhostline, (string) docroot, (bool) ssl At this stage we do not know docroot or ssl, so they are "/nonexistent" and false (0), respectively. =item 4 Push the vhost hash to the array. =back =head3 Return example [ { 'computedname' => "[httpd] myvhost.fr:80", 'port' => 80, 'srvname' => 'myvhost.fr', 'vhostfile' => '/etc/httpd/conf.d/10-myvhost.conf', 'vhostline' => 1, 'docroot' => '/nonexistent', 'ssl' => 0 }, { 'computedname' => "[httpd] myvhost.fr:443", 'port' => 443, 'srvname' => 'myvhost.fr', 'vhostfile' => '/etc/httpd/conf.d/10-myvhost.conf', 'vhostline' => 20, 'docroot' => '/nonexistent', 'ssl' => 0 } ] =head3 Calling my $vhosts = readVhostsDump($httpd_bin, $httpd_conf_file, $logger); =over =item Parameter: $httpd_bin (string) Path to the httpd binary to execute (for example: C). Specific options (such as C<-D> parameters) may be added to the string. =item Parameter: $httpd_conf_file (string) Path to the main httpd configuration file (for example: C). =item Parameter: $logger (reference to OCS logger instance) To make use of OCS logging capabilities within the function. =back =cut sub readVhostsDump { my ($httpd_bin, $httpd_conf_file, $logger) = @_; my @vhosts = (); # 2>&1 because some very old Apache versions write the vhosts dump # on stderr! open(my $DUMPFILE, "$httpd_bin -S -f $httpd_conf_file 2>&1 |") or die("Cannot open \$(httpd -S -f $httpd_conf_file) $!"); while (<$DUMPFILE>) { chomp; s/^\s+//; # lstrip my ($ip, $port, $srvname, $vhostfile, $vhostline); if ($_ =~ $dumpline_name_re) { ($port, $srvname, $vhostfile, $vhostline) = ($1, $2, $3, $4); } elsif ($_ =~ $dumpline_ip_re) { ($ip, $port, $srvname, $vhostfile, $vhostline) = ($1, $2, $3, $4, $5); } if (defined($port)) { # sufficient test to know if line was found my %vhost = ( 'computedname' => "$srvname:$port", 'port' => int($port), 'srvname' => $srvname, 'vhostfile' => $vhostfile, 'vhostline' => int($vhostline), 'docroot' => '/nonexistent', 'ssl' => 0 ); push(@vhosts, \%vhost); } } close($DUMPFILE); return \@vhosts; } =head2 readVhostConfFile() Enhance a virtualhost's information with elements found when parsing the vhost's configuration file. =head3 Return type The function returns nothing. It only operates on the (referenced) vhost hash it got in parameter. =head3 Process The function must read the apache configuration file in which the vhost gets defined ( block). The path to the particular configuration file and the line number of the vhost declaration are known in the C and C attributes, thanks to the vhost dump. The function's process, for the given vhost, is as follows: =over =item 1 Open the configuration file at C =item 2 Read line by line, waiting to be at correct line number (C) to start searching for information. =item 3 Search for the following information in the and enhance the given vhost hash with: =over =item * docroot (string) the value of the C directive =item * ssl (bool) we turn it to true if we find a C directive =item * sslcertpath (string) value of the C directive, if such a directive is present =back =item 4 File reading stops when we find the C<< >> closing block (in case multiple vhosts are declared in the same configuration file). =back =head3 Calling foreach my $vhost (@$vhosts) # Generally { readVhostConfFile($vhost, $httpd_basedir); } =over =item Parameter: $vhost (reference to hash) The virtualhost hash to enhance. =item Parameter: $httpd_basedir (string) The path to base directory of httpd, in case we encounter a relative path in C and need to complete it. B: the given path is expected to end with a slash '/', for example: "/etc/httpd/" =back =cut sub readVhostConfFile { my ($vhost, $relpath_prefix) = @_; my $nr = 0; open(my $VHOST_FILE, '<', $vhost->{'vhostfile'}) or die ("Cannot open $vhost->{'vhostfile'}"); while (my $vline = <$VHOST_FILE>) { # Waiting the correct line to start reading next if ++$nr < $vhost->{'vhostline'}; $vline =~ s/^\s+//; # lstrip # Get various vhost properties # -- DocumentRoot if ($vline =~ m/^DocumentRoot ["']?([^\s'"]+)["']?/i) { $vhost->{'docroot'} = $1; } # -- SSLEngine (bool) elsif ($vline =~ m/^SSLEngine on/i) { $vhost->{'ssl'} = 1; } # -- SSLCertificateFile path elsif ($vline =~ m/^SSLCertificateFile ["']?([^\s'"]+)["']?/i) { $vhost->{'sslcertpath'} = $1; readVhostSSLCert($vhost, $relpath_prefix); } # Stop reading on block closing tag last if $vline =~ m@^@i; } close($VHOST_FILE); } ############################################################################### # readVhostSSLCert() - read a vhost's SSL certificate to get its details # # Invoking: # readVhostSSLCert($vhost, $relpath_prefix) # # Params: # - $vhost - a reference to the vhost hash # - $relpath_prefix - the prefix to use in case the SSLCertificateFile path # is a relative one, in order to make it an absolute path # # Returns: # nothing. # # We read the certificate with an "openssl x509" command. # We try to retrieve the following fields: # # - "subject" (specifically to get the CN) # - "notBefore" and "notAfter" dates # - "email" (we catch the first email returned) # # The certificate details found here are gently stuffed in # $vhost->{'sslcertdetails'}, as follows: # # { # # (in a vhost here) # # [...] # 'srvname' => 'myvhost.fr', # 'ssl' => 1, # 'sslcertpath' => 'conf/ssl/myvhost.fr.crt', # 'sslcertdetails' => { # 'cn' => 'myvhost.fr', # 'startdate' => '31/12/2012', # 'enddate' => '31/12/2042', # 'email' => 'certadmin-email@example.com' # } # } sub readVhostSSLCert { my ($vhost, $relpath_prefix) = @_; $vhost->{'sslcertdetails'} = (); my $sslcertpath = $vhost->{'sslcertpath'}; my $absolute = (substr($sslcertpath, 0, 1) eq '/'); if (!$absolute) { $sslcertpath = "${relpath_prefix}${sslcertpath}"; } open(my $OPENSSL_CMD, "openssl x509 -in \"$sslcertpath\" -noout -subject -dates -email |"); while (my $oline = <$OPENSSL_CMD>) { if ($oline =~ $subject_cn_re) { $vhost->{'sslcertdetails'}->{'cn'} = $1; } elsif ($oline =~ m/^notBefore=(.+)$/) { $vhost->{'sslcertdetails'}->{'startdate'} = formatDate($1); } elsif ($oline =~ m/^notAfter=(.+)$/) { $vhost->{'sslcertdetails'}->{'enddate'} = formatDate($1); } elsif ($oline =~ $damn_simple_email_re) { chomp $oline; $vhost->{'sslcertdetails'}->{'email'} = $oline; # stop processing from the first email address # (it should be the last line of the command output) last; } } close($OPENSSL_CMD); } ############################################################################### # formatDate() - reformat date, with help of system command date(1) # # Invoking: # formatDate($date) # # Params: # - $date - the date string to reformat, in a format parsable by date(1) # # Returns: # the ISO 8601 (%Y-%m-%d) formatted date (string) # sub formatDate { my ($date) = @_; my $formattedDate = `date --date="$date" --iso-8601`; chomp $formattedDate; return $formattedDate; } 1; UnixAgent-2.4.2/lib/Ocsinventory/Agent/Modules/Apache/VhostsEL.pm000066400000000000000000000125741332737732100246060ustar00rootroot00000000000000################################################################################ ## Author: Linkbynet ## ## This code is open source and may be copied and modified as long as the source ## code is always made freely available. ## Please refer to the General Public Licence http://www.gnu.org/ or Licence.txt ## ## ############################################################################# ## ## This module retrieves information about Apache virtualhosts. ## ## It handles setups where Apache was installed by package (Enterprise Linux ## distributionsi family: RHEL, CentOS, Fedora) with configuration in standard ## dir /etc/httpd. ## ## Information gets written to tags at XPaths: ## ## /REQUEST/CONTENT/APACHE_VHOST ## /REQUEST/CONTENT/APACHE_VHOST_CERTIFICATE ## ## Example: ## ## ## ## /var/www/example.com ## example.com:443 ## example.com ## 443 ## ## ## ## example.com ## 30/06/2023 ## 01/07/2013 ## example.com:443 ## certmaster@example.com ## ## ## ################################################################################ package Ocsinventory::Agent::Modules::Apache::VhostsEL; use strict; use warnings; use Ocsinventory::Agent::Modules::Apache::Vhosts::Common; sub new { my $name = "apachevhosts_el"; # Set the name of your module here my (undef,$context) = @_; my $self = {}; # Create a special logger for the module $self->{logger} = new Ocsinventory::Logger ({ config => $context->{config} }); $self->{logger}->{header} = "[$name]"; $self->{context} = $context; $self->{structure} = { name => $name, start_handler => $name."_start_handler", # or undef if don't use this hook prolog_writer => undef, # or undef if don't use this hook prolog_reader => undef, # or undef if don't use this hook inventory_handler => $name."_inventory_handler", # or undef if don't use this hook end_handler => undef # or undef if don't use this hook }; # Path to httpd bin $self->{modinfos}->{httpd_bin} = '/usr/sbin/httpd'; # Path to httpd dir in /etc # (basis for relative paths or SSLCertificateFile, for example) $self->{modinfos}->{httpd_basedir} = '/etc/httpd/'; # Path to httpd conf dir $self->{modinfos}->{httpd_confdir} = '/etc/httpd/conf'; # Path to httpd main conf file $self->{modinfos}->{httpd_conf_file} = '/etc/httpd/conf/httpd.conf'; bless $self; } ######### Hook methods ############ sub apachevhosts_el_start_handler { # Use this hook to test prerequisites needed by module and disble it if needed my $self = shift; my $logger = $self->{logger}; my $prerequisites = 1; # TESTS: # # 1 - Apache HTTPD server is installed the packet way (conf dir present) # 2 - We can execute the httpd binary # 3 - We can read the main conf file (httpd.conf or equivalent) if (! -d $self->{modinfos}->{httpd_confdir}) { # No apache found on this server (or not in the expected place) $logger->debug("- no $self->{modinfos}->{httpd_confdir} directory found"); $prerequisites = 0; } elsif (! -x $self->{modinfos}->{httpd_bin}) { $logger->debug("- no executable $self->{modinfos}->{httpd_bin} found"); $prerequisites = 0; } elsif (! -f $self->{modinfos}->{httpd_conf_file}) { $logger->debug("- did not find $self->{modinfos}->{httpd_conf_file} file"); $prerequisites = 0; } if ($prerequisites == 0) { $self->{disabled} = 1; # Use this to disable the module $logger->debug("Humm my prerequisites are not OK...disabling module :( :( "); } } sub apachevhosts_el_inventory_handler { # Use this hook to add or modify entries in the inventory XML my $self = shift; my $logger = $self->{logger}; my $common = $self->{context}->{common}; $logger->debug(__PACKAGE__); # Reading httpd -S output my $vhosts = readVhostsDump($self->{modinfos}->{httpd_bin}, $self->{modinfos}->{httpd_conf_file}, $logger); # Enhancing information by parsing each vhost's configuration foreach my $vhost (@$vhosts) { readVhostConfFile($vhost, $self->{modinfos}->{httpd_basedir}); } # Write OCS XML foreach my $vhost (@$vhosts) { push @{$common->{'xmltags'}->{'APACHE_VHOST'}}, { "NAME" => [$vhost->{'computedname'}], "URL" => [$vhost->{'srvname'}], "DIRECTORY" => [$vhost->{'docroot'}], "PORT_NUMBER" => [$vhost->{'port'}] }; if ($vhost->{'ssl'}) { push @{$common->{'xmltags'}->{'APACHE_VHOST_CERTIFICATE'}}, { "SITE" => [$vhost->{'computedname'}], "DOMAINNAME" => [$vhost->{'sslcertdetails'}->{'cn'}], "REGISTRATIONDATE" => [$vhost->{'sslcertdetails'}->{'startdate'}], "EXPIRATIONDATE" => [$vhost->{'sslcertdetails'}->{'enddate'}], "EMAIL" => [$vhost->{'sslcertdetails'}->{'email'}] }; } } } 1; UnixAgent-2.4.2/lib/Ocsinventory/Agent/Modules/Databases/000077500000000000000000000000001332737732100232365ustar00rootroot00000000000000UnixAgent-2.4.2/lib/Ocsinventory/Agent/Modules/Databases/Oracle.pm000066400000000000000000000065711332737732100250120ustar00rootroot00000000000000################################################################################ ## Author: Linkbynet ## ## This code is open source and may be copied and modified as long as the source ## code is always made freely available. ## Please refer to the General Public Licence http://www.gnu.org/ or Licence.txt ## ## ############################################################################# ## ## This module finds and retrieves information about Oracle instances. ## ## First elements are taken from the /etc/oratab file. For each instance listed ## in it, we get the precise version number (with tnsping utility) and bundle ## name by reading the file below: ## ## $ORACLE_HOME/inventory/Components21/oracle.server/*/context.xml ## ## Information gets written to tags at XPaths: ## ## /REQUEST/CONTENT/ORACLE_INSTANCE ## ## Example: ## ## ## ## 0 ## Standard ## EXDB01 ## 11.2.0.4.0 ## ## ## ################################################################################ package Ocsinventory::Agent::Modules::Databases::Oracle; use strict; use warnings; use Ocsinventory::Agent::Modules::Databases::Oracle::Instances; sub new { my $name = "oracleinstances"; # Set the name of your module here my (undef,$context) = @_; my $self = {}; # Create a special logger for the module $self->{logger} = new Ocsinventory::Logger ({ config => $context->{config} }); $self->{logger}->{header} = "[$name]"; $self->{context} = $context; $self->{structure} = { name => $name, start_handler => $name."_start_handler", # or undef if don't use this hook prolog_writer => undef, # or undef if don't use this hook prolog_reader => undef, # or undef if don't use this hook inventory_handler => $name."_inventory_handler", # or undef if don't use this hook end_handler => undef # or undef if don't use this hook }; bless $self; } ######### Hook methods ############ sub oracleinstances_start_handler { # Use this hook to test prerequisites needed by module and disble it if needed my $self = shift; my $logger = $self->{logger}; my $prerequisites = 1; if (!(-f '/etc/oratab' && -r '/etc/oratab')) { $logger->debug("- no readable /etc/oratab file"); $prerequisites = 0; } if ($prerequisites == 0) { $self->{disabled} = 1; # Use this to disable the module $logger->debug("Humm my prerequisites are not OK...disabling module :( :( "); } } sub oracleinstances_inventory_handler { # Use this hook to add or modify entries in the inventory XML my $self = shift; my $logger = $self->{logger}; my $common = $self->{context}->{common}; $logger->debug(__PACKAGE__); my $database = getInstances(); # Write to OCS XML foreach my $instance (keys(%$database)) { push @{$common->{xmltags}->{ORACLE_INSTANCE}}, { 'NAME' => [$instance], 'AUTOSTART' => [$database->{$instance}->{'AUTOSTART'}], 'VERSION' => [$database->{$instance}->{'VERSION'}], 'BUNDLE' => [$database->{$instance}->{'BUNDLE'}] }; } } 1; UnixAgent-2.4.2/lib/Ocsinventory/Agent/Modules/Databases/Oracle/000077500000000000000000000000001332737732100244435ustar00rootroot00000000000000UnixAgent-2.4.2/lib/Ocsinventory/Agent/Modules/Databases/Oracle/Instances.pm000066400000000000000000000135341332737732100267360ustar00rootroot00000000000000################################################################################ # Oracle::Instances - Common stuff to get Oracle instances and versions # # Author: Linkbynet ################################################################################ package Ocsinventory::Agent::Modules::Databases::Oracle::Instances; =head1 NAME Oracle::Instances - Lib for Oracle instances and versions retrieval =head1 DESCRIPTION This module provides a function to retrieve information about Oracle instances on the current server. To do so, the function reads the /etc/oratab file to find instances and then: =over =item 1 Checks the existence of the ORACLE_HOME directory. =item 2 Add (ORACLE_SID, ORACLE_HOME, AUTOSTART) to the databases hash. =item 3 Go and find server version and bundle for each ORACLE_HOME. This information is found by executing the C command and by reading the following XML file: $ORACLE_HOME/inventory/Components21/oracle.server/*/context.xml The following bundles are known: SE1 (Standard Edition One), SE (Standard Edition), EE (Enterprise Edition), XE (Express Edition). =item 4 Returns the database hash as follows: { 'SID' => { 'BUNDLE' => 'Standard', 'AUTOSTART' => 0, 'ORA_HOME' => '/home/oracle/oracle/product/11.2.0', 'VERSION' => '11.2.0.4.0' } }; =back Optionally, you can call C to return only the hash of versions and bundles, instead of the complete instances hash: { '/home/oracle/oracle/product/11.2.0' => { 'BUNDLE' => 'Standard', 'VERSION' => '11.2.0.4.0' } }; In that case, you just have to pass parameter 1 (integer one) when calling the function. =head2 Exports The module exports the C function. =cut use Exporter; our @ISA = qw(Exporter); our @EXPORT = qw(&getInstances); use strict; use warnings; ######### BEGIN: Constants ############ # Known Oracle editions. The two-letter codes are the ones which can be # encountered in the context.xml file. my %bundles = ( 'SE1' => 'Standard One', 'SE' => 'Standard', 'EE' => 'Enterprise', 'XE' => 'Express' ); ######### END: Constants ############ =head2 getInstances() =head3 Synopsis getInstances($version_only) where $versions_only is a integer (tested as a bool) my $database = getInstances() my $versions = getInstances(1) =head3 Return values The function returns a hash reference containing the instances or versions. =cut sub getInstances { my $versions_only = shift; my %database; my %versions; # First, read the /etc/oratab to find out Oracle instances # Here we already get the SID, path and autostart open(my $ORATAB, '<', '/etc/oratab') or die("Cannot open /etc/oratab $!"); while (my $oratab_line = <$ORATAB>) { chomp $oratab_line; next if $oratab_line =~ /^(#|$)/; # skip comments and empty lines my ($ora_sid, $ora_home, $dbstart_yn) = split(/:/, $oratab_line); # Keep existing instances only if (-d $ora_home) { $database{$ora_sid} = { 'ORA_HOME' => $ora_home, 'AUTOSTART' => $dbstart_yn eq 'Y' ? 1 : 0 }; } } close($ORATAB); # Retrieve version and bundle information in %versions # and put information in global %database hash too foreach my $ora_sid (keys(%database)) { my $ora_home = $database{$ora_sid}{'ORA_HOME'}; unless (exists($versions{$ora_home})) { $versions{$ora_home} = _getVersionAndBundle($ora_home); } my $version_bundle = $versions{$ora_home}; $database{$ora_sid}{'VERSION'} = $version_bundle->{'VERSION'}; $database{$ora_sid}{'BUNDLE'} = $version_bundle->{'BUNDLE'}; } # Return complete database hash or only version and bundle, according to # $versions_only argument if ($versions_only) { return \%versions; } else { return \%database; } } # _getVersionAndBundle($ora_home) # # Simple method building a hash with two keys 'VERSION' and 'BUNDLE' and their # values. # # Return: a hash reference sub _getVersionAndBundle { my $ora_home = shift; my %version_bundle = ( 'VERSION' => _getVersion($ora_home), 'BUNDLE' => _getBundle($ora_home) ); return \%version_bundle; } # _getVersion($ora_home) # # Find Oracle server version installed in ORACLE_HOME. # # We are using the tnsping command for that. # Return: the version string (for example "11.2.0.4.0" or "N/A" by default) sub _getVersion { my $ora_home = shift; my $version = 'N/A'; my $tnsping = "$ora_home/bin/tnsping"; if (-x $tnsping) { open(my $TNSPING_OUT, "$tnsping localhost |") or die("Cannot exec tnsping $!"); while (my $tp_line = <$TNSPING_OUT>) { if ($tp_line =~ m/^TNS Ping Utility for Linux: Version ([0-9.]+)/) { $version = $1; } } close($TNSPING_OUT); } return $version; } # _getBundle($ora_home) # # Find bundle version, reading a context.xml file down below ORACLE_HOME. # # Return: the full name of the install type (e.g. Standard or Enterprise) or, # by default, "N/A" sub _getBundle { my $ora_home = shift; my $bundle = 'N/A'; my $xml_re = qr/^\s*) { if ($xml_line =~ $xml_re) { $xml_line =~ $type_re; my $abbr = $1; $bundle = $bundles{$abbr} if exists($bundles{$abbr}); last; } } close($CONTEXT_XML); } return $bundle; } 1; UnixAgent-2.4.2/lib/Ocsinventory/Agent/Modules/Download.pm000066400000000000000000000756331332737732100234720ustar00rootroot00000000000000############################################################################### ## OCSINVENTORY-NG ## Copyleft Pascal DANEK 2005 ## Web : http://ocsinventory.sourceforge.net ## ## This code is open source and may be copied and modified as long as the source ## code is always made freely available. ## Please refer to the General Public Licence http://www.gnu.org/ or Licence.txt ################################################################################ # Function by hook: # -download_prolog_reader, download_message, download # -download_inventory_handler # -download_end_handler, begin, done, clean, finish, period, download, execute, # check_signature and build_package package Ocsinventory::Agent::Modules::Download; use strict; use Fcntl qw/:flock/; use XML::Simple; use LWP::UserAgent; use Compress::Zlib; use Digest::MD5; use File::Path; use Socket; # Can be missing. By default, we use MD5 # You have to install it if you want to use SHA1 digest eval{ require Digest::SHA1 }; #Global vars my $ua; my $download_config; my @prior_pkgs; sub new { my $name="download"; #Set the name of your module here my (undef,$context) = @_; my $self = {}; # Create a special logger for the module $self->{logger} = new Ocsinventory::Logger ({ config => $context->{config}, }); # We use the common object for the module $self->{common} = $context->{common}; $self->{context} = $context; $self->{logger}->{header}="[$name]"; $self->{structure} = { name => $name, start_handler => $name."_start_handler", prolog_writer => undef, prolog_reader => $name."_prolog_reader", inventory_handler => $name."_inventory_handler", end_handler => $name."_end_handler" }; $self->{settings} = { https_port => '443', # Time to wait between scheduler periods, scheduling cycles and fragments downloads frag_latency_default => 10, period_latency_default => 0, cycle_latency_default => 10, max_error_count => 30, # Number of loops for one period period_lenght_default => 10, }; $self->{messages} = { # Errors code_success => 'SUCCESS', success_already_setup => 'SUCCESS_ALREADY_SETUP', err_bad_id => 'ERR_BAD_ID', err_download_info => 'ERR_DOWNLOAD_INFO', err_bad_digest => 'ERR_BAD_DIGEST', err_download_pack => 'ERR_DOWNLOAD_PACK', err_build => 'ERR_BUILD', err_execute => 'ERR_EXECUTE', err_clean => 'ERR_CLEAN', err_timeout => 'ERR_TIMEOUT', }; # Special hash for packages $self->{packages}= {}; bless $self; } sub download_start_handler { my $self = shift; my $logger = $self->{logger}; my $common = $self->{context}->{common}; my $config = $self->{context}->{config}; $logger->debug("Calling download_start_handler"); # Disabling module if local mode if ($config->{stdout} || $config->{local}) { $self->{disabled} = 1; $logger->info("Agent is running in local mode...disabling module"); } # If we cannot load prerequisite, we disable the module if ($common->can_load('LWP')) { my $lwp_version = $LWP::VERSION; $lwp_version=$self->{common}->convertVersion($lwp_version,3); if ($lwp_version > 583) { #Newer LWP version unless ($common->can_load('LWP::Protocol::https')) { $self->{disabled} = 1; $logger->error("LWP::Protocol::https perl module is missing !!"); $logger->error("Humm my prerequisites are not OK...disabling module :( :("); } } else { unless ($common->can_load('Crypt::SSLeay')) { $self->{disabled} = 1; $logger->error("Crypt::SSLeay perl module is missing !!"); $logger->error("Humm my prerequisites are not OK...disabling module :( :("); } } } else { $self->{disabled} = 1; $logger->error("LWP perl module is missing !!"); $logger->error("Humm my prerequisites are not OK...disabling module :( :("); } } sub download_prolog_reader{ #Read prolog response my ($self,$prolog) = @_; my $context = $self->{context}; my $logger = $self->{logger}; my $config = $self->{context}->{config}; my $network = $self->{context}->{network}; my $common = $self->{common}; my $settings = $self->{settings}; my $messages = $self->{messages}; my $packages = $self->{packages}; $logger->debug("Calling download_prolog_reader"); $logger->debug($prolog); $prolog = XML::Simple::XMLin( $prolog, ForceArray => ['OPTION', 'PARAM']); my $option; # Create working directory my $opt_dir = $context->{installpath}.'/download'; mkdir($opt_dir) unless -d $opt_dir; # We create a file to tell to download process that we are running open SUSPEND, ">$opt_dir/suspend"; close(SUSPEND); # Create history file if needed unless(-e "$opt_dir/history"){ open HISTORY, ">$opt_dir/history" or die("Cannot create history file: $!"); close(HISTORY); } # Create lock file if needed unless(-e "$opt_dir/lock"){ open LOCK, ">$opt_dir/lock" or die("Cannot create lock file: $!"); close(LOCK); } # Retrieve our options for $option (@{$prolog->{OPTION}}){ if ($option->{NAME} =~/download/i){ for (@{ $option->{PARAM} } ) { # Type of param if ($_->{'TYPE'} eq 'CONF'){ # Writing configuration open CONFIG, ">$opt_dir/config" or die("Cannot open/create config file ($opt_dir/config)"); if (flock(CONFIG, LOCK_EX)){ $logger->debug("Writing config file."); print CONFIG XMLout($_, RootName => 'CONF'); close(CONFIG); $download_config = $_; } else { $logger->error("Cannot lock config file !!"); close(CONFIG); return 0; } # Apply config # ON ? if ($_->{'ON'} == '0'){ $logger->info("Download is off."); open LOCK, "$opt_dir/lock" or die("Cannot open lock file: $!"); if (flock(LOCK, LOCK_EX|LOCK_NB)){ close(LOCK); unlink("$opt_dir/suspend"); return 0; } else { $logger->debug("Try to kill current download process..."); my $pid = ; close(LOCK); $logger->debug("Sending USR1 to $pid..."); if (kill("USR1", $pid)){ $logger->debug("Success."); } else { $logger->debug("Failed."); } return 0; } } # Maybe a new package to download } elsif ($_->{'TYPE'} eq 'PACK'){ $packages->{$_->{'ID'}} = { 'PACK_LOC' => $_->{'PACK_LOC'}, 'INFO_LOC' => $_->{'INFO_LOC'}, #'ID' => $_->{'ID'}, 'CERT_PATH' => $_->{'CERT_PATH'}, 'CERT_FILE' => $_->{'CERT_FILE'}, 'FORCE' => $_->{'FORCE'} }; } } } } # We are now in download child # Connect to server if ($context->{network}) { $ua = $context->{network}->{ua}; } else { $logger->info("Cannot find network settings to make this module works properly...disabling module"); $self->{disabled} = 1; } # Check history file unless(open HISTORY, "$opt_dir/history") { flock(HISTORY, LOCK_EX); unlink("$opt_dir/suspend"); $logger->error("Cannot read history file: $!"); return 1; } chomp(my @done = ); close(HISTORY); # Package is maybe already handled for (keys %$packages){ my $dir = $opt_dir."/".$_; my $fileid = $_; my $infofile = 'info'; my $location = $packages->{$_}->{'INFO_LOC'}; unless ($packages->{$_}->{'FORCE'} == 1) { if($common->already_in_array($fileid, @done)){ $logger->info("Will not download $fileid. (already in history file)"); &download_message($fileid, $messages->{success_already_setup},$logger,$context); next; } } # Looking for packages status unless(-d $dir){ $logger->debug("Making working directory for $fileid."); mkdir($dir) or die("Cannot create $fileid directory: $!"); open FH, ">$dir/since" or die("Cannot create $fileid since file: $!");; print FH time(); close(FH); } # Retrieve and writing info file if needed unless(-f "$dir/$infofile"){ # Special value INSTALL_PATH $packages->{$_}->{CERT_PATH} =~ s/INSTALL_PATH/$context->{installpath}/; $packages->{$_}->{CERT_FILE} =~ s/INSTALL_PATH/$context->{installpath}/; # Getting info file if ($network->getFile("https","$location/$fileid","info","$dir/info")){ download_message($fileid, $self->{messages}->{err_download_info},$logger,$context); $logger->error("Error download info file !!! Wrong URL or SSL certificate ?"); next; } } } unless(unlink("$opt_dir/suspend")){ $logger->error("Cannot delete suspend file: $!"); return 1; } return 0; } sub ssl_verify_callback { my ($ok, $x509_store_ctx) = @_; return $ok; } sub download_inventory_handler{ # Adding the ocs package ids to softwares my ($self,$inventory) = @_; my $context = $self->{context}; my $logger = $self->{logger}; $logger->debug("Calling download_inventory_handler"); my @history; # Read download history file if ( open PACKAGES, "$context->{installpath}/download/history" ){ flock(PACKAGES, LOCK_SH); while(){ chomp( $_ ); push @history, { ID => $_ }; } } close(PACKAGES); # Add it to inventory (will be handled by Download.pm server module push @{ $inventory->{xmlroot}->{'CONTENT'}->{'DOWNLOAD'}->{'HISTORY'} },{ 'PACKAGE'=> \@history }; } sub download_end_handler{ # Get global structure my $self = shift; my $context = $self->{context}; my $logger = $self->{logger}; my $common = $self->{common}; my $settings = $self->{settings}; my $messages = $self->{messages}; my $packages = $self->{packages}; $logger->debug("Calling download_end_handler"); my $dir = $context->{installpath}."/download"; my $pidfile = $dir."/lock"; return 0 unless -d $dir; # We have jobs, we do it alone my $fork = fork(); if ($fork>0){ return 0; } elsif ($fork<0){ return 1; } else { $SIG{'USR1'} = sub { print "Exiting on signal...\n"; &finish($logger, $context); }; # Go into working directory chdir($dir) or die("Cannot chdir to working directory...Abort\n"); } # Maybe an other process is running exit(0) if begin($pidfile,$logger); # Retrieve the packages to download opendir DIR, $dir or die("Cannot read working directory: $!"); my $end; while(1){ # If agent is running, we wait if (-e "suspend") { $logger->debug('Found a suspend file... Will wait 10 seconds before retry'); sleep(10); next; } $end = 1; #TODO Uncomment this line #undef $packages; # Reading configuration open FH, "$dir/config" or die("Cannot read config file: $!"); if (flock(FH, LOCK_SH)){ $download_config = XMLin("$dir/config"); close(FH); # If Frag latency is null, download is off if ($download_config->{'ON'} eq '0'){ $logger->info("Option turned off. Exiting."); finish($logger, $context); } } else { $logger->error("Cannot read config file :-( . Exiting."); close(FH); finish($logger, $context); } # Retrieving packages to download and their priority while (my $entry = readdir(DIR)){ next if $entry !~ /^\d+$/; next unless(-d $entry); # Clean package if info file does not still exist unless(-e "$entry/info"){ $logger->debug("No info file found for $entry!!"); clean( $entry, $logger, $context, $messages, $packages ); next; } my $info = XML::Simple::XMLin( "$entry/info" ) or next; # Check that fileid == directory name if ($info->{'ID'} ne $entry){ $logger->debug("ID in info file does not correspond!!"); clean( $entry, $logger, $context, $messages, $packages ); download_message($entry, $messages->{err_bad_id},$logger,$context); next; } # Manage package timeout # Clean package if since timestamp is not present unless(-e "$entry/since"){ $logger->debug("No since file found!!"); clean($entry, $logger, $context,$messages,$packages ); next; } else { my $time = time(); if (open SINCE, "$entry/since"){ my $since = ; if ($since=~/\d+/){ if ((($time-$since)/86400) > $download_config->{TIMEOUT}){ $logger->error("Timeout Reached for $entry."); clean($entry, $logger, $context,$messages,$packages ); &download_message($entry, $messages->{err_timeout},$logger,$context); close(SINCE); next; } else { $logger->debug("Checking timeout for $entry... OK"); } } else { $logger->error("Since data for $entry is incorrect."); clean($entry, $logger, $context, $messages, $packages ); &download_message($entry, $messages->{err_timeout},$logger,$context); close(SINCE); next; } close(SINCE); } else { $logger->error("Cannot find since data for $entry."); clean($entry, $logger, $context, $messages, $packages ); &download_message($entry, $messages->{err_timeout},$logger,$context); next; } } # Building task file if needed unless( -f "$entry/task" and -f "$entry/task_done" ){ open FH, ">$entry/task" or die("Cannot create task file for $entry: $!"); my $i; my $frags = $info->{'FRAGS'}; # There are no frags if there is only a command if ($frags){ for ($i=1;$i<=$frags;$i++){ print FH "$entry-$i\n"; } }; close FH; # To be sure that task file is fully created open FLAG, ">$entry/task_done" or die ("Cannot create task flag file for $entry: $!"); close(FLAG); } # Store info XML descriptions in package attributes for (keys %$info){ $packages->{$entry}->{$_} = $info->{$_} } $end = 0; } # Rewind directory rewinddir(DIR); # Call packages scheduler if ($end){ last; } else { period($packages,$logger,$context,$self->{messages},$settings); } } $logger->info("No more package to download."); finish($logger, $context); } # Schedule the packages sub period{ my ($packages,$logger,$context,$messages,$settings) = @_ ; my $period_lenght_default = $settings->{period_lenght_default} ; my $frag_latency_default= $settings->{frag_latency_default} ; my $cycle_latency_default= $settings->{cycle_latency_default} ; my $period_latency_default= $settings->{period_latency_default} ; my $i; #Serching packages with the priority 0 for (keys %$packages) { if ($packages->{$_}->{'PRI'} eq "0") { push (@prior_pkgs,$_); } } $logger->debug("New period. Nb of cycles: ". (defined($download_config->{'PERIOD_LENGTH'})?$download_config->{'PERIOD_LENGTH'}:$period_lenght_default)); for ($i=1;$i<=( defined($download_config->{'PERIOD_LENGTH'})?$download_config->{'PERIOD_LENGTH'}:$period_lenght_default);$i++){ # Highest priority if (@prior_pkgs){ $logger->debug("Managing ".scalar(@prior_pkgs)." package(s) with absolute priority."); for (@prior_pkgs){ # If done file found, clean package if (-e "$_/done"){ $logger->debug("done file found!!"); done($_,$logger,$context,$messages,$settings,$packages); next; } download($_,$logger,$context,$messages,$settings,$packages); $logger->debug("Now pausing for a fragment latency => ".( defined($download_config->{'FRAG_LATENCY'})?$download_config->{'FRAG_LATENCY'}:$frag_latency_default) ." seconds"); sleep( defined($download_config->{'FRAG_LATENCY'})?$download_config->{'FRAG_LATENCY'}:$frag_latency_default ); } next; } # Normal priority for (keys %$packages){ # If done file found, clean package if(-e "$_/done"){ $logger->debug("done file found!!"); done($_,$logger,$context,$messages,$settings,$packages); next; } next if $i % $packages->{$_}->{'PRI'} != 0; download($_,$logger,$context,$messages,$settings,$packages); $logger->debug("Now pausing for a fragment latency => ". (defined( $download_config->{'FRAG_LATENCY'} )?$download_config->{'FRAG_LATENCY'}:$frag_latency_default) ." seconds"); sleep(defined($download_config->{'FRAG_LATENCY'})?$download_config->{'FRAG_LATENCY'}:$frag_latency_default); } $logger->debug("Now pausing for a cycle latency => ".( defined($download_config->{'CYCLE_LATENCY'})?$download_config->{'CYCLE_LATENCY'}:$cycle_latency_default) ." seconds"); sleep(defined($download_config->{'CYCLE_LATENCY'})?$download_config->{'CYCLE_LATENCY'}:$cycle_latency_default); } sleep($download_config->{'PERIOD_LATENCY'}?$download_config->{'PERIOD_LATENCY'}:$period_latency_default); } # Download a fragment of the specified package sub download { my ($id,$logger,$context,$messages,$settings,$packages) = @_; my $error; my $proto = $packages->{$id}->{'PROTO'}; my $location = $packages->{$id}->{'PACK_LOC'}; my $network = $context->{network}; # If we find a temp file, we know that the update of the task file has failed for any reason. So we retrieve it from this file if (-e "$id/task.temp") { unlink("$id/task.temp"); rename("$id/task.temp","$id/task") or return 1; } # Retrieve fragments already downloaded unless(open TASK, "$id/task"){ $logger->error("Cannot open $id/task."); return 1; } my @task = ; # Done if (!@task){ $logger->debug("Download of $id... Finished."); close(TASK); execute($id,$logger,$context,$messages,$settings,$packages); return 0; } my $fragment = shift(@task); $logger->debug("Downloading $fragment..."); # Using proxy if possible my $res = $network->getFile(lc($proto),"$location/$id",$fragment,"$id/$fragment"); # Checking if connected unless($res) { #Success $error = 0; # Updating task file rename(">$id/task", ">$id/task.temp"); open TASK, ">$id/task" or return 1; print TASK @task; close(TASK); unlink(">$id/task.temp"); } else { $error++; if ($error > $settings->{max_error_count}){ $logger->error("Error : Max errors count reached"); finish($logger,$context); } return 1; } return 0; } # Assemble and handle downloaded package sub execute{ my ($id,$logger,$context,$messages,$settings,$packages) = @_; my $common = $context->{common}; my $tmp = $id."/tmp"; my $exit_code; $logger->debug("Execute orders for package $id."); if (build_package($id,$logger,$context,$messages,$packages)){ clean($id,$logger, $context,$messages,$packages); return 1; } else { # First, we get in temp directory unless( chdir($tmp) ){ $logger->error("Cannot chdir to working directory: $!"); download_message($id, $messages->{err_execute}, $logger,$context); clean($id,$logger, $context,$messages,$packages); return 1; } # Executing preorders (notify user, auto launch, etc.... # $id->{NOTIFY_USER} # $id->{NOTIFY_TEXT} # $id->{NOTIFY_COUNTDOWN} # $id->{NOTIFY_CAN_ABORT} # TODO: notification to send through DBUS to the user eval{ # Execute instructions if ($packages->{$id}->{'ACT'} eq 'LAUNCH'){ my $exe_line = $packages->{$id}->{'NAME'}; $packages->{$id}->{'NAME'} =~ s/^([^ -]+).*/$1/; # Exec specified file (LAUNCH => NAME) if (-e $packages->{$id}->{'NAME'}){ $logger->debug("Launching $packages->{$id}->{'NAME'}..."); chmod(0755, $packages->{$id}->{'NAME'}) or die("Cannot chmod: $!"); $exit_code = system( "./".$exe_line ) >> 8; } else { die(); } } elsif ($packages->{$id}->{'ACT'} eq 'EXECUTE'){ # Exec specified command EXECUTE => COMMAND $logger->debug("Execute $packages->{$id}->{'COMMAND'}..."); system( $packages->{$id}->{'COMMAND'} ) and die(); } elsif ($packages->{$id}->{'ACT'} eq 'STORE'){ # Store files in specified path STORE => PATH $packages->{$id}->{'PATH'} =~ s/INSTALL_PATH/$context->{installpath}/; # Build it if needed my @dir = split('/', $packages->{$id}->{'PATH'}); my $dir; for (@dir){ $dir .= "$_/"; unless(-e $dir){ mkdir($dir); $logger->debug("Create $dir..."); } } $logger->debug("Storing package to $packages->{$id}->{'PATH'}..."); # Stefano Brandimarte => Stevenson! system($common->get_path('cp')." -pr * ".$packages->{$id}->{'PATH'}) and die(); } }; if ($@){ # Notify success to ocs server download_message($id, $messages->{err_execute},$logger,$context); chdir("../..") or die("Cannot go back to download directory: $!"); clean($id,$logger,$context,$messages,$packages); return 1; } else { chdir("../..") or die("Cannot go back to download directory: $!"); done($id,$logger,$context,$messages,$settings,$packages,(defined($exit_code)?$exit_code:'_NONE_')); return 0; } } } # Check package integrity sub build_package{ my ($id,$logger,$context,$messages,$packages) = @_; my $common = $context->{common}; my $count = $packages->{$id}->{'FRAGS'}; my $i; my $tmp = "./$id/tmp"; unless(-d $tmp){ mkdir("$tmp"); } # No job if no files return 0 unless $count; # Assemble package $logger->info("Building package for $id."); for ($i=1;$i<=$count;$i++){ if (-f "./$id/$id-$i"){ # We make a tmp working directory if ($i==1){ open PACKAGE, ">$tmp/build.tar.gz" or return 1; } # We write each fragment in the final package open FRAGMENT, "./$id/$id-$i" or return 1; my $row; while ($row = ){ print PACKAGE $row; } close(FRAGMENT); } else { return 1; } } close(PACKAGE); # if (check_signature($packages->{$id}->{'DIGEST'}, "$tmp/build.tar.gz", $packages->{$id}->{'DIGEST_ALGO'}, $packages->{$id}->{'DIGEST_ENCODE'},$logger)){ download_message($id, $messages->{err_bad_digest},$logger,$context); return 1; } if ( system( $common->get_path("tar")." -xvzf $tmp/build.tar.gz -C $tmp") ){ $logger->error("Cannot extract $id with tar, trying with unzip."); if ( system( $common->get_path("unzip")." $tmp/build.tar.gz -d $tmp") ){ $logger->error("Cannot extract $id with unzip."); download_message($id,$messages->{err_build},$logger,$context); return 1; } } $logger->debug("Building of $id... Success."); unlink("$tmp/build.tar.gz") or die ("Cannot remove build file: $!\n"); return 0; } sub check_signature{ my ($checksum, $file, $digest, $encode,$logger) = @_; $logger->info("Checking signature for $file."); my $base64; # Open file unless(open FILE, $file){ $logger->error("cannot open $file: $!"); return 1; } binmode(FILE); # Retrieving encoding form if ($encode =~ /base64/i){ $base64 = 1; $logger->debug('Digest format: Base 64'); } elsif ($encode =~ /hexa/i){ $logger->debug('Digest format: Hexadecimal'); } else { $logger->debug('Digest format: Not supported'); return 1; } eval{ # Check it if ($digest eq 'MD5'){ $logger->debug('Digest algo: MD5'); if ($base64){ die unless Digest::MD5->new->addfile(*FILE)->b64digest eq $checksum; } else { die unless Digest::MD5->new->addfile(*FILE)->hexdigest eq $checksum; } } elsif ($digest eq 'SHA1'){ $logger->debug('Digest algo: SHA1'); if ($base64){ die unless Digest::SHA1->new->addfile(*FILE)->b64digest eq $checksum; } else { die unless Digest::SHA1->new->addfile(*FILE)->hexdigest eq $checksum; } } else { $logger->debug('Digest algo unknown: '.$digest); die; } }; if ($@){ $logger->debug("Digest checking error !!"); close(FILE); return 1; } else { close(FILE); $logger->debug("Digest OK..."); return 0; } } # Launch a download error to ocs server sub download_message{ my ($id, $code,$logger,$context) = @_; $logger->debug("Sending message for $id, code=$code."); my $xml = { 'DEVICEID' => $context->{deviceid}, 'QUERY' => 'DOWNLOAD', 'ID' => $id, 'ERR' => $code }; # Generate xml $xml = XMLout($xml, RootName => 'REQUEST'); # Compress data $xml = Compress::Zlib::compress( $xml ); my $URI = $context->{servername}; # Send request my $request = HTTP::Request->new(POST => $URI); $request->header('Pragma' => 'no-cache', 'Content-type', 'application/x-compress'); $request->content($xml); my $res = $ua->request($request); # Checking result if ($res->is_success) { return 0; }else{ return 1; } } # At the beginning of end handler sub begin{ my ($pidfile,$logger) = @_; open LOCK_R, "$pidfile" or die("Cannot open pid file: $!"); if (flock(LOCK_R,LOCK_EX|LOCK_NB)){ open LOCK_W, ">$pidfile" or die("Cannot open pid file: $!"); select(LOCK_W) and $|=1; select(STDOUT) and $|=1; print LOCK_W $$; $logger->info("Beginning work. I am $$."); return 0; } else { close(LOCK_R); $logger->error("$pidfile locked. Cannot begin work... :-("); return 1; } } sub done{ my ($id,$logger,$context,$messages,$settings,$packages,$suffix) = @_; my $common = $context->{common}; my $frag_latency_default = $settings->{frag_latency_default}; $logger->debug("Package $id... Done. Sending message..."); # Trace installed package open DONE, ">$id/done"; close(DONE); # Read history file open HISTORY,"$context->{installpath}/download/history" or warn("Cannot open history file: $!"); chomp(my @historyIds = ); close(HISTORY); # Put it in history file open HISTORY,">>$context->{installpath}/download/history" or warn("Cannot open history file: $!"); flock(HISTORY, LOCK_EX); if ( $common->already_in_array($id, @historyIds) ){ $logger->debug("Warning: ID $id has been found in the history file (package was already deployed)"); } else { $logger->debug("Writing $id reference in history file"); print HISTORY $id,"\n"; } close(HISTORY); # Notify success to ocs server my $code; if ($suffix ne '_NONE_'){ $code = $messages->{code_success}."_$suffix"; } else { $code = $messages->{code_success}; } unless(download_message($id, $code,$logger,$context)){ clean($id,$logger,$context,$messages,$packages); } else { sleep( defined($download_config->{'FRAG_LATENCY'})?$download_config->{'FRAG_LATENCY'}:$frag_latency_default ); } return 0; } sub clean{ my ($id,$logger,$context,$messages,$packages) = @_; $logger->info("Cleaning $id package."); delete $packages->{$id}; #If the package is priority 0 if ((my $index) = grep { $prior_pkgs[$_] eq $id } 0..$#prior_pkgs){ delete $prior_pkgs[$index]; } unless(File::Path::rmtree($id, 0)){ $logger->error("Cannot clean $id!! Abort..."); download_message($id, $messages->{err_clean},$logger,$context); die(); } return 0; } # At the end sub finish{ my ($logger,$context) = @_; open LOCK, '>'.$context->{installpath}.'/download/lock'; $logger->debug("End of work...\n"); exit(0); } 1; UnixAgent-2.4.2/lib/Ocsinventory/Agent/Modules/Example.pm000066400000000000000000000052601332737732100233030ustar00rootroot00000000000000############################################################################### ## OCSINVENTORY-NG ## Copyleft Guillaume PROTET 2010 ## Web : http://www.ocsinventory-ng.org ## ## This code is open source and may be copied and modified as long as the source ## code is always made freely available. ## Please refer to the General Public Licence http://www.gnu.org/ or Licence.txt ################################################################################ package Ocsinventory::Agent::Modules::Example; sub new { my $name="example"; #Set the name of your module here my (undef,$context) = @_; my $self = {}; #Create a special logger for the module $self->{logger} = new Ocsinventory::Logger ({ config => $context->{config} }); $self->{logger}->{header}="[$name]"; $self->{context}=$context; $self->{structure}= { name => $name, start_handler => $name."_start_handler", #or undef if don't use this hook prolog_writer => $name."_prolog_writer", #or undef if don't use this hook prolog_reader => $name."_prolog_reader", #or undef if don't use this hook inventory_handler => $name."_inventory_handler", #or undef if don't use this hook end_handler => $name."_end_handler" #or undef if don't use this hook }; bless $self; } ######### Hook methods ############ sub example_start_handler { #Use this hook to test prerequisites needed by module and disble it if needed my $self = shift; my $logger = $self->{logger}; $logger->debug("Yeah you are in example_start_handler :)"); my $prerequisites = 1 ; if ( $prerequisites == 0 ) { $self->{disabled} = 1; #Use this to disable the module $logger->debug("Humm my prerequisites are not OK...disabling module :( :( "); } } sub example_prolog_writer { #Use this hook to add information the prolog XML my $self = shift; my $logger = $self->{logger}; $logger->debug("Yeah you are in example_prolog_writer :)"); } sub example_prolog_reader { #Use this hook to read the answer from OCS server my $self = shift; my $logger = $self->{logger}; $logger->debug("Yeah you are in example_prolog_reader :)"); } sub example_inventory_handler { #Use this hook to add or modify entries in the inventory XML my $self = shift; my $logger = $self->{logger}; $logger->debug("Yeah you are in example_inventory_handler :)"); } sub example_end_handler { #Use this hook to add treatments before the end of agent launch my $self = shift; my $logger = $self->{logger}; $logger->debug("Yeah you are in example_end_handler :)"); } 1; UnixAgent-2.4.2/lib/Ocsinventory/Agent/Modules/Snmp.pm000066400000000000000000001004351332737732100226250ustar00rootroot00000000000000############################################################################### ## OCSINVENTORY-NG ## Copyleft Guillaume PROTET 2010 ## Web : http://www.ocsinventory-ng.org ## ## This code is open source and may be copied and modified as long as the source ## code is always made freely available. ## Please refer to the General Public Licence http://www.gnu.org/ or Licence.txt ################################################################################ package Ocsinventory::Agent::Modules::Snmp; use strict; no strict 'refs'; use warnings; use XML::Simple; use Digest::MD5; # New lib for scanning sub new { my $name="snmp"; #Set the name of your module here my (undef,$context) = @_; my $self = {}; #Create a special logger for the module $self->{logger} = new Ocsinventory::Logger ({ config => $context->{config} }); $self->{logger}->{header}="[$name]"; $self->{common} = $context->{common}; $self->{context}=$context; $self->{structure}= { name => $name, start_handler => $name."_start_handler", prolog_writer => undef, prolog_reader => $name."_prolog_reader", inventory_handler => undef, end_handler => $name."_end_handler", }; $self->{number_scan}=0; $self->{snmp_oid_run}=$name."_oid_run"; $self->{snmp_oid_xml}=$name."_oid_xml"; $self->{func_oid}={}; $self->{snmp_dir}=[]; $self->{snmp_vardir} = ["$self->{context}->{installpath}/snmp/mibs/local/","$self->{context}->{installpath}/snmp/mibs/remote/"]; my $spec_dir_snmp="Ocsinventory/Agent/Modules/Snmp/"; $self->{spec_dir_snmp}=$spec_dir_snmp; $self->{spec_module_snmp}="Ocsinventory::Agent::Modules::Snmp::"; # We are going to search where is the directory Ocsinventory/Modules/snmp foreach my $dir ( @INC ) { my $res_dir=$dir."/".$spec_dir_snmp; if ( -d $res_dir ) { push(@{$self->{snmp_dir}},$res_dir); } } # We create a xml for the snmp inventory that we will be sent to server $self->{inventory}={}; bless $self; } sub snmp_start_handler { my $self = shift; my $logger = $self->{logger}; my $common = $self->{context}->{common}; my $config = $self->{context}->{config}; $logger->debug("Calling snmp_start_handler"); # Disabling module if local mode if ($config->{stdout} || $config->{local}) { $self->{disabled} = 1; $logger->info("Agent is running in local mode...disabling module"); } # If we cannot load prerequisite, we disable the module unless ($common->can_load('Net::SNMP')) { $self->{disabled} = 1; $logger->error("Net::SNMP perl module is missing !!"); $logger->error("Humm my prerequisites are not OK...disabling module :( :("); } } sub snmp_prolog_reader { my ($self, $prolog) = @_; my $logger = $self->{logger}; my $network = $self->{context}->{network}; my $snmp_vardir = $self->{snmp_vardir}; my $option; $logger->debug("Calling snmp_prolog_reader"); $prolog = XML::Simple::XMLin( $prolog, ForceArray => ['OPTION', 'PARAM']); for $option (@{$prolog->{OPTION}}){ if ( $option->{NAME} =~/snmp/i){ $self->{doscans} = 1 ; for ( @{ $option->{PARAM} } ) { if ($_->{'TYPE'} eq 'DEVICE'){ # Adding the IP in the devices array push @{$self->{netdevices}},{ IPADDR => $_->{IPADDR}, MACADDR => $_->{MACADDR}, }; } if ($_->{'TYPE'} eq 'COMMUNITY'){ # Adding the community in the communities array push @{$self->{communities}},{ VERSION=>$_->{VERSION}, NAME=>$_->{NAME}, USERNAME=>$_->{USERNAME}, AUTHPROTO=>$_->{AUTHPROTO}, AUTHPASSWD=>$_->{AUTHPASSWD}, PRIVPROTO=>$_->{PRIVPROTO}, PRIVPASSWD=>$_->{PRIVPASSWD} }; } if ($_->{'TYPE'} eq 'NETWORK'){ push @{$self->{nets_to_scan}},$_->{SUBNET}; } # Creating the directory for xml if they don't yet exist mkdir($self->{context}->{installpath}."/snmp") unless -d $self->{context}->{installpath}."/snmp"; mkdir($self->{context}->{installpath}."/snmp/mibs") unless -d $self->{context}->{installpath}."/snmp/mibs"; foreach my $dir ( @{$snmp_vardir}) { mkdir($dir) unless -d $dir; } } } } } sub snmp_end_handler { my $self = shift; my $logger = $self->{logger}; my $common = $self->{context}->{common}; my $network = $self->{context}->{network}; $logger->debug("Calling snmp_end_handler"); # If no order form server return unless $self->{doscans}; # Flushing xmltags if it has not been done $common->flushXMLTags(); # We get the config my $config = $self->{context}->{config}; my $communities=$self->{communities}; if ( ! defined ($communities ) ) { $logger->debug("We have no Community from server, we use default public community"); $communities=[{VERSION=>"2c",NAME=>"public"}]; } my ($name,$comm,$error,$system_oid); # sysName.0 my $snmp_sysname="1.3.6.1.2.1.1.5.0"; # sysDescr.0 my $snmp_sysdescr="1.3.6.1.2.1.1.1.0"; # sysLocation.0 my $snmp_syslocation="1.3.6.1.2.1.1.6.0"; # sysUpTime.0 my $snmp_sysuptime="1.3.6.1.2.1.1.3.0"; # sysObjectId.0 my $snmp_sysobjectid="1.3.6.1.2.1.1.2.0"; # syscontact.0 my $snmp_syscontact="1.3.6.1.2.1.1.4.0"; # ifPhysAddress.1 my $snmp_macaddr="1.3.6.1.2.1.2.2.1.6."; my $snmp_ifdescr="1.3.6.1.2.1.2.2.1.2."; my $snmp_iftype="1.3.6.1.2.1.2.2.1.3"; # Initalising the XML properties my $snmp_inventory = $self->{inventory}; $snmp_inventory->{xmlroot}->{QUERY} = ['SNMP']; $snmp_inventory->{xmlroot}->{DEVICEID} = [$self->{context}->{config}->{deviceid}]; # Scanning network $logger->debug("Snmp: Scanning network"); my $nets_to_scan=$self->{nets_to_scan}; foreach my $net_to_scan ( @$nets_to_scan ){ $self->snmp_ip_scan($net_to_scan); } $logger->debug("Snmp: Ending Scanning network"); # Begin scanning ip tables my $ip=$self->{netdevices}; foreach my $device ( @$ip ) { my $session=undef; my $full_oid=undef; my $devicedata = $common->{xmltags}; #To fill the xml informations for this device $logger->debug("Scanning $device->{IPADDR} device"); # Search for the good snmp community in the table community LIST_SNMP: foreach $comm ( @$communities ) { # Test if we use SNMP v3 if ( $comm->{VERSION} eq "3" ) { ($session, $error) = Net::SNMP->session( -retries => 2 , -timeout => 3, -version => 'snmpv'.$comm->{VERSION}, -hostname => $device->{IPADDR}, -translate => [-nosuchinstance => 0, -nosuchobject => 0], -username => $comm->{USERNAME}, -authpassword => $comm->{AUTHPASSWD}, -authprotocol => $comm->{AUTHPROTO}, -privpassword => $comm->{PRIVPASSWD}, -privprotocol => $comm->{PRIVPROTO}, ); # For a use in constructor module (Cisco) $self->{username}=$comm->{USERNAME}; $self->{authpassword}=$comm->{AUTHPASSWD}; $self->{authprotocol}=$comm->{AUTHPROTO}; $self->{privpassword}=$comm->{PRIVPASSWD}; $self->{privprotocol}= $comm->{PRIVPROTO}; } else { # We have an older version v2c ou v1 ($session, $error) = Net::SNMP->session( -retries => 1 , -timeout => 3, -version => 'snmpv'.$comm->{VERSION}, -hostname => $device->{IPADDR}, -community => $comm->{NAME}, -translate => [-nosuchinstance => 0, -nosuchobject => 0], ); }; unless (defined($session)) { $logger->error("Snmp ERROR: $error"); } else { $self->{snmp_session}=$session; # For a use in constructor module (Cisco) $self->{snmp_community}=$comm->{NAME}; $self->{snmp_version}=$comm->{VERSION}; $full_oid=$session->get_request( -varbindlist => [$snmp_sysobjectid] ); last LIST_SNMP if ( defined $full_oid); $session->close; $self->{snmp_session}=undef; } } if ( defined $full_oid ) { $full_oid=$full_oid->{$snmp_sysobjectid}; $session->max_msg_size(8192); # We have found the good Community, we can scan this equipment my ($constr_oid,$device_name,$description,$location,$contact,$uptime,$domain,$macaddr); # We indicate that we scan a new equipment $self->{number_scan}++; my $result; $result=$session->get_request( -varbindlist => [$snmp_sysname]); if ( defined ( $result->{$snmp_sysname} ) && length($result->{$snmp_sysname}) > 0 ) { $device_name=$result->{$snmp_sysname}; } else { $device_name="Not Defined"; } $result=$session->get_request(-varbindlist => [$snmp_sysobjectid]); $full_oid=$result->{$snmp_sysobjectid}; $result=$session->get_request(-varbindlist => [$snmp_sysdescr]); $description=$result->{$snmp_sysdescr}; $result=$session->get_request(-varbindlist => [$snmp_syslocation]); $location=$result->{$snmp_syslocation}; $result=$session->get_request(-varbindlist => [$snmp_sysuptime]); $uptime=$result->{$snmp_sysuptime}; $result=$session->get_request(-varbindlist => [$snmp_syscontact]); $contact=$result->{$snmp_syscontact}; #################### # finding MACADDRESS for checksum #################### my $index=$snmp_iftype; $result=$session->get_next_request(-varbindlist => [$index]); $macaddr=undef; my $ref_iftype=3; # We scan the kinod of connexion, if it is a ethernet, we can use this mac address # If we have a ref_iftype > 3 then we have no eth (type 6) while ( ! defined($macaddr) && defined( $result) && $ref_iftype == 3 ) { foreach $index ( keys %{$result} ) { if ( $index =~ /1\.3\.6\.1\.2\.1\.2\.2\.1\.(\S+)\.(\S+)/ ) { $ref_iftype=$1; my $ref_mac=$2; if ( $result->{$index} == 6 ) { my $res_mac=$session->get_request(-varbindlist => [$snmp_macaddr.$ref_mac]); if ( defined ($res_mac ) && defined ($res_mac->{$snmp_macaddr.$ref_mac}) && $res_mac->{$snmp_macaddr.$ref_mac} ne '' ) { $macaddr=" ".$res_mac->{$snmp_macaddr.$ref_mac}; } else { $result=$session->get_next_request(-varbindlist => [$index]); } } else { $result=$session->get_next_request(-varbindlist => [$index]); } } else { $result=undef; } } } if ( defined($macaddr) && $macaddr =~ /^ 0x(\w{2})(\w{2})(\w{2})(\w{2})(\w{2})(\w{2})$/ ) { $macaddr="$1:$2:$3:$4:$5:$6"; } elsif ( ! defined($macaddr) || $macaddr eq "endOfMibView" ) { if (defined ( $device->{MACADDR} ) ) { $macaddr = $device->{MACADDR}; } else { $macaddr=$device_name; # $macaddr=$device->{IPADDR}."_".$device_name; } } if ( defined ($macaddr) ) { if ( $full_oid =~ /1\.3\.6\.1\.4\.1\.(\d+)/ ) { $system_oid=$1; } # Create SnmpDeviceID my $md5 = Digest::MD5->new; $md5->add($macaddr, $system_oid); my $snmpdeviceid = $md5->hexdigest; # Adding standard informations $common->setSnmpCommons({ IPADDR => $device->{IPADDR}, MACADDR => $macaddr, SNMPDEVICEID => $snmpdeviceid, NAME => $device_name, DESCRIPTION => $description, CONTACT => $contact, LOCATION => $location, UPTIME => $uptime, WORKGROUP => $domain, }); # We run the special treatments for the OID vendor if ( $self->{snmp_oid_run}($self,$system_oid) == 1 ) { # We have no vendor oid for this equipment (run or xml) # we use default.pm $self->{snmp_oid_run}($self,"Default"); } # Add all the informations in the xml for this device push @{$snmp_inventory->{xmlroot}->{CONTENT}->{DEVICE}},$devicedata; } } else { $logger->debug("Failure in scanning Device $device->{IPADDR}: no snmp communication"); } # We have finished with this equipment if (defined $session) { $session->close; } $self->{snmp_session}=undef; # We clear the xml data for this device $common->flushXMLTags(); } $logger->info("No more SNMP device to scan"); # Formatting the XML and sendig it to the server my $content = XMLout( $snmp_inventory->{xmlroot}, RootName => 'REQUEST' , XMLDecl => '', SuppressEmpty => undef ); #Cleaning XML to delete unprintable characters my $clean_content = $common->cleanXml($content); $network->sendXML({message => $clean_content}); $logger->debug("End snmp_end_handler :)"); } ######################################################### # # # function for scanning range of ip and determining if # # there is an equipment for snmp scan # # Parameters: # # (self) # # net_to_scan indicate the subnet to scan # # # ######################################################### sub snmp_ip_scan { my ($self,$net_to_scan) = @_; my $logger=$self->{logger}; my $common=$self->{common}; if ($common->can_load('Net::Netmask') ) { my $block=Net::Netmask->new($net_to_scan); my $size=$block->size()-2; my $index=1; if ( $common->can_run('nmap') && $common->can_load('Nmap::Parser') ) { $logger->debug("Scannig $net_to_scan with nmap"); my $nmaparser = Nmap::Parser->new; $nmaparser->parsescan("nmap","-sP",$net_to_scan); for my $host ($nmaparser->all_hosts("up")) { my $res=$host->addr; $logger->debug("Found $res"); push( @{$self->{netdevices}},{ IPADDR=>$res }) unless $self->search_netdevice($res); } } elsif ($common->can_load('Net::Ping')) { $logger->debug("Scanning $net_to_scan with ping"); my $ping=Net::Ping->new("icmp",1); while ($index <= $size) { my $res=$block->nth($index); if ($ping->ping($res)) { $logger->debug("Found $res"); push( @{$self->{netdevices}},{ IPADDR=>$res }) unless $self->search_netdevice($res); } $index++; } $ping->close(); } else { $logger->debug("No scan possible"); } } else { $logger->debug("Net::Netmask not present: no scan possible"); } } ######################################################### # # # function for executing sub perl with the oid # # Parameters: # # (self) # # system oid for execute the .pm associated # # # ######################################################### sub snmp_oid_run { my ($self,$system_oid)=@_; my $logger=$self->{logger}; my $session=$self->{snmp_session}; my $spec_module_snmp=$self->{spec_module_snmp}; my $return_pm=0; unless ( defined ( $self->{func_oid}{$system_oid} )) { my $spec_dir_snmp=$self->{spec_dir_snmp}; # We init the default value $self->{func_oid}{$system_oid}={}; $self->{func_oid}{$system_oid}{active}=0; $self->{func_oid}{$system_oid}{oid_value}="1.3.6.1.2.1.1.2.0"; $self->{func_oid}{$system_oid}{oid_name}="Undefined"; # Can we find it in the snmp directory foreach my $dir ( @{$self->{snmp_dir}} ) { if ( -r $dir.$system_oid.".pm" ) { # We find the module my $module_found=$spec_module_snmp.$system_oid; eval "use $module_found"; if ($@) { $logger->debug ("Failed to load $module_found: $@"); } else { # We have execute it. We can get the function pointer on snmp_run my $package=$module_found."::"; $self->{func_oid}{$system_oid}{snmp_run}=$package->{'snmp_run'}; if ( defined ( $package->{'snmp_info'} ) ) { my $return_info=&{$package->{'snmp_info'}}; if ( defined $return_info->{oid_value} ) { $self->{func_oid}{$system_oid}{oid_value}=$return_info->{oid_value}; } if ( defined $return_info->{oid_name} ) { $self->{func_oid}{$system_oid}{oid_name}=$return_info->{oid_name}; } } $self->{func_oid}{$system_oid}{active}=1; $self->{func_oid}{$system_oid}{last_exec}=0; } } } } if ( $self->{func_oid}{$system_oid}{active} == 1 && $self->{func_oid}{$system_oid}{last_exec} < $self->{number_scan} ) { # we test that this function as never been executed for this equipment # We test first that this OID exist for this equipment my $oid_scan=$self->{func_oid}{$system_oid}{oid_value}; my $result=$session->get_request(-varbindlist => [ $oid_scan ] ); # We indicate that this equipment is the last scanned $self->{func_oid}{$system_oid}{last_exec}=$self->{number_scan}; if (defined ($result) && length ($result->{$oid_scan}) != 0 ){ # This OID exist, we can execute it $logger->debug("Launching $system_oid\n"); &{$self->{func_oid}{$system_oid}{snmp_run}}($session,$self); } else { $return_pm=1; } } my $return_xml=snmp_oid_xml($self,$system_oid); if ( $return_pm == 1 ) { return(1); } return($return_xml); } ######################################################### # # # function for executing sub xml with the oid # # Parameters: # # (self) # # system oid for execute the .xml associated # # # # $xml_oid->{system_oid} Ref the oid in the xml # # {active} 0 Ko 1 OK # # {xml_data} info get in xml file # # {last_exec} num for verify that # # this equipment is already scaned with this xml or no # ######################################################### sub snmp_oid_xml { my ($self,$system_oid)=@_; my $logger=$self->{logger}; my $spec_module_snmp=$self->{spec_module_snmp}; my $snmp_vardir = $self->{snmp_vardir}; if ( ! defined ( $self->{xml_oid}{$system_oid} )) { # We init the default value $self->{xml_oid}{$system_oid}={}; $self->{xml_oid}{$system_oid}{active}=0; # Can we find it in the snmp directory foreach my $dir ( @{$self->{snmp_vardir}} ) { # Can we find it in the snmp var directory if ( $self->{xml_oid}{$system_oid}{active} == 0 ) { if ( -r $dir.$system_oid.".xml" ) { # We find the xml # my $module_found=$spec_module_snmp.$system_oid; # eval "use $module_found"; if ( $self->{xml_oid}{$system_oid}{xml_data}=XML::Simple::XMLin($dir.$system_oid.".xml",ForceArray => 1 ) ) { # We have load the xml $logger->debug("Load module xml $system_oid"); $self->{xml_oid}{$system_oid}{active}=1; $self->{xml_oid}{$system_oid}{last_exec}=0; if ( defined( $self->{xml_oid}{$system_oid}{PARAMETERS}[0]{NAME}[0] ) ) { $self->{xml_oid}{$system_oid}{oid_name}=$self->{xml_oid}{$system_oid}{PARAMETERS}[0]{NAME}[0]; } } else { $logger->debug ("Failed to load xml $system_oid: $@"); $self->{xml_oid}{$system_oid}{active} = 0; } } } } } # now we have an information for the xml associated with this oid # It can be active or no if ( $self->{xml_oid}{$system_oid}{active} == 1 && $self->{xml_oid}{$system_oid}{last_exec} < $self->{number_scan} ) { $logger->debug ("Begin xml on $system_oid"); $self->{xml_oid}{$system_oid}{last_exec}=$self->{number_scan}; # We have done other scan so we can now execute own scan # We have actually only v1, we can have after other parallel version if ( xml_scan_v1($self,$system_oid,$self->{xml_oid}{$system_oid}{xml_data}) == 1 ) { $self->{xml_oid}{$system_oid}{active}=0; return 1; } return 0; } return 1; } ######################################################### # # # function for executing xml scan v1 # # Parameters: # # (self) # # system oid # # xml in input # # # ######################################################### sub xml_scan_v1 { my ($self,$system_oid,$xml)=@_; my $xmltags=$self->{context}->{common}->{xmltags}; my $logger=$self->{logger}; return 1 if ( xml_parameters_v1($self,$system_oid,$xml) == 1 ) ; if ( ! defined ($xmltags) ) { $xmltags={}; } $logger->debug("Begin scanning v1 on $system_oid"); my $filters=[]; if ( defined ($xml->{LOOPS}) ) { return 1 if ( xml_loops_v1($self,$xml->{LOOPS},$xmltags,$filters) == 1 ); } if ( defined ($xml->{DATA}) ) { return 1 if ( xml_data_v1($self,$xml->{DATA}[0],$xmltags,$filters,0) == 1 ); } return 0; } ######################################################### # # # function for parameters of xml v1 # # Parameters: # # (self) # # system oid # # xml in input # # # ######################################################### sub xml_parameters_v1 { my ($self,$system_oid,$xml)=@_; my $logger=$self->{logger}; $logger->debug("Validating xml parameters"); return 1 if ( ! defined($xml->{PARAMETERS}) ) ; return 0 if ( ! defined($xml->{PARAMETERS}[0]{EXECUTE}) ) ; # We first look if there is other scan to do $logger->debug("Begin looking other scan"); foreach my $type_exec ( "RUN","XML" ) { if ( defined( $xml->{PARAMETERS}[0]{EXECUTE}[0]{$type_exec}) ) { my $liste_exec=$xml->{PARAMETERS}[0]{EXECUTE}[0]{$type_exec}; my $lower_type_exec=lc($type_exec); foreach my $exec_perl ( @{$liste_exec} ) { my $a_exec="snmp_oid_".$lower_type_exec; $self->{$a_exec}($self,$exec_perl); } } } return 0; } ######################################################### # # # function for reading for a loops # # Parameters: # # (self) # # xml_loops (contain VALUE/INDEX/FILTER # # and a sub DATA # # result_table: pointer on where we # # put result information # # # # Return: 1 Pb # # 0 OK # ######################################################### sub xml_loops_v1 { my ($self,$xml_loops,$result_table,$filters)=@_; my $session=$self->{snmp_session}; my $logger=$self->{logger}; ALL_LOOPS: foreach my $uniq_loops ( @{$xml_loops} ) { if ( ! defined ($uniq_loops->{VALUE}) || ! defined($uniq_loops->{INDEX})|| ! defined($uniq_loops->{NAME_INDEX}) ) { $logger->debug("Error in xml File: VALUE, INDEX or NAME_INDEX not defined"); return 1 ; } # We now replace already existent filters my $data_value=$uniq_loops->{VALUE}[0]; my $index_value=$uniq_loops->{INDEX}[0]; foreach my $filter ( @{$filters} ) { $data_value=~s/$filter->{NAME}/$filter->{VALUE}/g; $index_value=~s/$filter->{NAME}/$filter->{VALUE}/g; } my $index_equipement=$session->get_entries(-columns => [ $data_value ] ); # If we have no data for this index it s not a problem in the xml next ALL_LOOPS if ( ! defined ( $index_equipement ) ) ; # We first verify if there is a filter on this value # in this case, we must filter the topic if this filter is not OK my $nbr_data=0; foreach my $uniq_index_equipement ( keys %{$index_equipement} ) { if ( defined ($uniq_loops->{FILTER}) && ! $index_equipement->{$uniq_index_equipement} =~ /$uniq_loops->{FILTER}[0]/ ) { delete $index_equipement->{$uniq_index_equipement}; # The Filter is OK, we can looks sub tables for this INDEX } elsif ( $uniq_index_equipement =~ /$index_value/ ) { # we use the index on the value for finding what are the INDEX values push(@{$filters},{VALUE=>$1,NAME=>$uniq_loops->{NAME_INDEX}[0]}); return 1 if ( xml_data_v1($self,$uniq_loops->{DATA}[0],$result_table,$filters,$nbr_data++) == 1); # After use this filter, we must take it out # so it can be used for other loops pop(@{$filters}); } } } return 0; } ######################################################### # # # function for reading for a table # # Parameters: # # (self) # # xml_line (containt SET/VALUE/FILTER # # or a sub DATA # # value_IDX for subtitution in the information # # result_table: pointer on the table where we # # put result information # # # # Return: 1 Pb # # 0 OK # ######################################################### sub xml_data_v1 { my ($self,$xml_table,$result_table,$filters,$pos_table)=@_; my $logger=$self->{logger}; foreach my $table ( keys %{$xml_table} ) { if ( $table eq "DATA" ) { foreach my $subtable ( @{$xml_table->{DATA}} ) { if ( !defined $result_table->{$subtable}[0] ) { $result_table->{$subtable}[0]={}; } return 1 if ( xml_data_v1($self,$xml_table->{$subtable},$filters,$result_table->[0]{$subtable}[0],0) == 1); } } elsif ( $table eq "LOOPS" ) { return 1 if ( xml_loops_v1($self,$xml_table->{LOOPS},$xml_table,$filters) == 1 ); } else { # we look for all lines in this table foreach my $line ( keys %{$xml_table->{$table}[0]} ) { if ( $line eq "LOOPS" ) { if ( ! defined ($result_table->{$table}[$pos_table]) ) { $result_table->{$table}[$pos_table]={}; } return 1 if ( xml_loops_v1($self,$xml_table->{$table}[0]{LOOPS},$result_table->{$table}[$pos_table],$filters) == 1 ); } else { my $result=xml_line_v1($self,$xml_table->{$table}[0]{$line}[0],$filters); if ( defined ($result) ) { $result_table->{$table}[$pos_table]{$line}[0]=$result; } } } } } return 0; } ######################################################### # # # function for reading for a uniq line in a table # # Parameters: # # (self) # # xml_line (containt SET/VALUE/FILTER # # value_IDX for subtitution in the information # # # # Return: undef if no line correct # # the string for this line in others cases # ######################################################### sub xml_line_v1 { my ($self,$xml_line,$filters)=@_; my $session=$self->{snmp_session}; return undef if ( ! defined ($xml_line) ) ; # We have a SET or a VALUE and an optional FILTER if ( defined ( $xml_line->{SET} ) ) { return($xml_line->{SET}[0]); } return undef if ( ! defined ( $xml_line->{VALUE} ) ) ; my $data_value=$xml_line->{VALUE}[0]; # If we have a loop, we must substitute the VLAUE foreach my $filter ( @{$filters} ) { $data_value=~s/$filter->{NAME}/$filter->{VALUE}/g; } # We look for information in the equipment with the snmp interogation my $info_equipment=$session->get_request(-varbindlist => [$data_value]); # We verify that information has been returned for this value return undef if ( ! defined ($info_equipment) ) ; $info_equipment=$info_equipment->{$data_value}; # Verify that we have data return undef if ( ! defined ($info_equipment) || $info_equipment eq "" ); # If there is a fliter, we verifiy that this line pass the filter return undef if ( defined ($xml_line->{FILTER}) && ! ($info_equipment =~ /$xml_line->{FILTER}[0]/ )) ; # Remplacement return $info_equipment if ( ! defined ($xml_line->{REPLACE}) ); foreach my $replace ( @{$xml_line->{REPLACE}} ) { return undef if ( ! defined( $replace->{STRING}) || ! defined ($replace->{BY}) ); $info_equipment=~s/$replace->{STRING}[0]/$replace->{BY}[0]/g; } return $info_equipment; } ######################################################### # # # function to search an IP address in netdevices array # # Parameters: # # (self) # # IP address to search # # # # Return: 1 if IP address was found # # nothing in other case # ######################################################### sub search_netdevice { my ($self,$ip)= @_ ; for (@{$self->{netdevices}}) { if ($ip =~ /^$_->{IPADDR}$/) { return 1; } } } 1; UnixAgent-2.4.2/lib/Ocsinventory/Agent/Modules/Snmp/000077500000000000000000000000001332737732100222645ustar00rootroot00000000000000UnixAgent-2.4.2/lib/Ocsinventory/Agent/Modules/Snmp/11.pm000066400000000000000000000007111332737732100230420ustar00rootroot00000000000000### # SNMP: OID:11 SYSTEM:HP ### package Ocsinventory::Agent::Modules::Snmp::11; use strict; no strict 'refs'; use warnings; sub snmp_run { my ($session,$snmp) = @_; my $common = $snmp->{common}; my $logger=$snmp->{logger}; my $list_mib=["If_Mib","Host_Resources_Mib", "Printer_Mib","Entity_Mib"]; $logger->debug("Running HP (11) MIB module"); foreach my $mib ( @{$list_mib} ) { $snmp->snmp_oid_run($mib); } } 1; UnixAgent-2.4.2/lib/Ocsinventory/Agent/Modules/Snmp/231.pm000066400000000000000000000006721332737732100231340ustar00rootroot00000000000000### # SNMP: OID:231 SYSTEM:Fujistu ### package Ocsinventory::Agent::Modules::Snmp::231; use strict; no strict 'refs'; use warnings; sub snmp_run { my ($session,$snmp) = @_; my $common = $snmp->{common}; my $logger=$snmp->{logger}; my $list_mib=["If_Mib","Host_Resources_Mib"]; $logger->debug("Running Fujitsu (231) MIB module"); foreach my $mib ( @{$list_mib} ) { $snmp->snmp_oid_run($mib); } } 1; UnixAgent-2.4.2/lib/Ocsinventory/Agent/Modules/Snmp/2620.pm000066400000000000000000000007421332737732100232160ustar00rootroot00000000000000### # SNMP: OID:2620 SYSTEM:Checkpoint ### package Ocsinventory::Agent::Modules::Snmp::2620; use strict; no strict 'refs'; use warnings; sub snmp_info { return ( { oid_value => "1.3.6.1.4.1.2620.1.1.1.0", oid_name => "Checkpoint Mib" } ); } sub snmp_run() { my ($session,$snmp) = @_; my $common = $snmp->{common}; my $logger=$snmp->{logger}; $logger->debug("Running Chekpoint (2620) MIB module"); $common->setSnmpCommons( {TYPE => "Firewall"} ); } 1; UnixAgent-2.4.2/lib/Ocsinventory/Agent/Modules/Snmp/311.pm000066400000000000000000000013421332737732100231260ustar00rootroot00000000000000### # SNMP: OID:311 SYSTEM:Microsoft ### package Ocsinventory::Agent::Modules::Snmp::311; use strict; no strict 'refs'; use warnings; sub snmp_info { return ( { oid_value => "1.3.6.1.4.1.77.1.2.1.0" , oid_name => "Microsoft" } ); } sub snmp_run { my ($session , $snmp )= @_; my $oid_run=$snmp->{snmp_oid_run}; my $common = $snmp->{common}; my $inventory = $snmp->{inventory}; my $logger=$snmp->{logger}; $common->setSnmpCommons( {TYPE => "Microsoft"} ); $common->setSnmpComputer({SYSTEM => 'Microsoft'}); my $list_mib=["If_Mib", "Host_Resources_Mib"]; $logger->debug("Running Microsoft (311) MIB module"); foreach my $mib ( @{$list_mib} ) { $snmp->snmp_oid_run($mib); } } 1; UnixAgent-2.4.2/lib/Ocsinventory/Agent/Modules/Snmp/3224.pm000066400000000000000000000011201332737732100232060ustar00rootroot00000000000000### # SNMP: OID:3224 SYSTEM:Juniper ### package Ocsinventory::Agent::Modules::Snmp::3224; use strict; no strict 'refs'; use warnings; sub snmp_info { return ( { oid_value => "1.3.6.1.4.1.3224.5.1.0", oid_name => "Juniper Mib" } ); } sub snmp_run() { my ($session,$snmp) = @_; my $common = $snmp->{common}; my $logger=$snmp->{logger}; $logger->debug("Running Juniper (3224) MIB module"); $common->setSnmpCommons( {TYPE => "Firewall"} ); my $list_mib=["If_Mib"]; foreach my $mib ( @{$list_mib} ) { $snmp->snmp_oid_run($mib); } } 1; UnixAgent-2.4.2/lib/Ocsinventory/Agent/Modules/Snmp/3375.pm000066400000000000000000000044151332737732100232270ustar00rootroot00000000000000### # SNMP: OID:3375 SYSTEM:F5 ### package Ocsinventory::Agent::Modules::Snmp::3375; use strict; no strict 'refs'; use warnings; sub snmp_info { return ( { oid_value => "1.3.6.1.4.1.3375.2.1.1.1.1.1.0", oid_name => "F5 Mib" } ); } sub snmp_run() { my ($session,$snmp) = @_; my $common = $snmp->{common}; my $logger=$snmp->{logger}; $logger->debug("Running F5 (3375) MIB module"); $common->setSnmpCommons( {TYPE => "Load Balanceur"} ); my $list_mib=["If_Mib"]; foreach my $mib ( @{$list_mib} ) { $snmp->snmp_oid_run($mib); } my $snmp_sysProductName="1.3.6.1.4.1.3375.2.1.4.1.0"; my $snmp_sysProductVersion="1.3.6.1.4.1.3375.2.1.4.2.0"; my $snmp_sysProductBuild="1.3.6.1.4.1.3375.2.1.4.3.0"; my $snmp_sysProductDate="1.3.6.1.4.1.3375.2.1.4.5.0"; my $snmp_sysGeneralHwNumber="1.3.6.1.4.1.3375.2.1.3.3.2.0"; my $snmp_sysGeneralChassisSerialNum="1.3.6.1.4.1.3375.2.1.3.3.3.0"; my $NAME=$session->get_request ( -varbindlist => [ $snmp_sysProductName ] ); if ( defined ( $NAME ) ) { $NAME=$NAME->{$snmp_sysProductName}; } my $VERSION=$session->get_request ( -varbindlist => [ $snmp_sysProductVersion] ); if ( defined ( $VERSION ) ) { $VERSION=$VERSION->{$snmp_sysProductVersion}; } my $COMMENT=$session->get_request ( -varbindlist => [ $snmp_sysProductBuild] ); if ( defined ( $COMMENT ) ) { $COMMENT=$COMMENT->{$snmp_sysProductBuild}; } my $DATE=$session->get_request ( -varbindlist => [ $snmp_sysProductDate ] ); if ( defined ( $DATE ) ) { $DATE=$DATE->{$snmp_sysProductDate}; } $common->addSoftware( { NAME => $NAME , VERSION => $VERSION , INSTALLDATE => $DATE , COMMENT => $COMMENT, }); my $TYPE=$session->get_request ( -varbindlist => [ $snmp_sysGeneralHwNumber ] ) ; if ( defined ( $TYPE ) ) { $TYPE=$TYPE->{$snmp_sysGeneralHwNumber}; } my $SERIALNUMBER=$session->get_request ( -varbindlist => [ $snmp_sysGeneralChassisSerialNum ] ) ; if ( defined ( $SERIALNUMBER ) ) { $SERIALNUMBER=$SERIALNUMBER->{$snmp_sysGeneralChassisSerialNum}; } $common->setSnmpLoadBalancer({ SERIALNUMBER => $SERIALNUMBER , TYPE => $TYPE , MANUFACTURER => "F5" , }); } 1; UnixAgent-2.4.2/lib/Ocsinventory/Agent/Modules/Snmp/42.pm000066400000000000000000000006441332737732100230530ustar00rootroot00000000000000### # SNMP: OID:42 SYSTEM:Sun ### package Ocsinventory::Agent::Modules::Snmp::42; use strict; no strict 'refs'; use warnings; sub snmp_run() { my ($session,$snmp) = @_; my $common = $snmp->{common}; my $logger=$snmp->{logger}; $logger->debug("Running Sun (42) MIB module"); $common->setSnmpCommons( {TYPE => "Sun"} ); $common->setSnmpComputer({SYSTEM => 'Sun'}); } 1; UnixAgent-2.4.2/lib/Ocsinventory/Agent/Modules/Snmp/641.pm000066400000000000000000000007111332737732100231330ustar00rootroot00000000000000### # SNMP: OID:641 SYSTEM:Lexmark ### package Ocsinventory::Agent::Modules::Snmp::641; use strict; no strict 'refs'; use warnings; sub snmp_run { my ($session,$snmp) = @_; my $common = $snmp->{common}; my $logger=$snmp->{logger}; my $list_mib=["If_Mib","Host_Resources_Mib", "Printer_Mib"]; $logger->debug("Running Lexmark (641) MIB module"); foreach my $mib ( @{$list_mib} ) { $snmp->snmp_oid_run($mib); } } 1; UnixAgent-2.4.2/lib/Ocsinventory/Agent/Modules/Snmp/7244.pm000066400000000000000000000007261332737732100232270ustar00rootroot00000000000000### # SNMP: OID:7244 SYSTEM:Fujitsu ### package Ocsinventory::Agent::Modules::Snmp::7244; use strict; no strict 'refs'; use warnings; sub snmp_info { return ( { oid_value => "1.3.6.1.4.1.7244.1.1.1.1.1.0", oid_name => "Fujitsu" } ); } sub snmp_run() { my ($session,$snmp) = @_; my $common = $snmp->{common}; my $logger=$snmp->{logger}; $logger->debug("Running Fujitsu (7244) MIB module"); $common->setSnmpCommons( {TYPE => "Blade"} ); } 1; UnixAgent-2.4.2/lib/Ocsinventory/Agent/Modules/Snmp/789.pm000066400000000000000000000056201332737732100231540ustar00rootroot00000000000000### # SNMP: OID:789 SYSTEM:NetApp ### package Ocsinventory::Agent::Modules::Snmp::789; use strict; no strict 'refs'; use warnings; sub snmp_run() { my ($session,$snmp) = @_; my $common = $snmp->{common}; my $logger=$snmp->{logger}; $logger->debug("Running NetApp (789) MIB module"); $common->setSnmpCommons( {TYPE => "Storage"} ); my $list_mib=["If_Mib"]; foreach my $mib ( @{$list_mib} ) { $snmp->snmp_oid_run($mib); } my $snmp_sysProductName="1.3.6.1.4.1.789.1.1.5.0"; my $snmp_sysProductVersion="1.3.6.1.4.1.789.1.1.2.0"; my $snmp_sysProductBuild="1.3.6.1.4.1.789.1.1.3.0"; my $snmp_volumetable="1.3.6.1.4.1.789.1.5.4.1.2"; my $snmp_storageSize="1.3.6.1.4.1.789.1.5.4.1.29."; my $snmp_storageUsed="1.3.6.1.4.1.789.1.5.4.1.30."; my $name=$session->get_request ( -varbindlist => [ $snmp_sysProductName ] ); if ( defined ( $name ) ) { $name=$name->{$snmp_sysProductName}; } my $version=$session->get_request ( -varbindlist => [ $snmp_sysProductVersion] ); if ( defined ( $version ) ) { $version=$version->{$snmp_sysProductVersion}; } my $comment=$session->get_request ( -varbindlist => [ $snmp_sysProductBuild] ); if ( defined ( $comment ) ) { $comment=$comment->{$snmp_sysProductBuild}; } $common->addSoftware( { NAME => $name , VERSION => $version , COMMENT => $comment, }); my $result; my $result_table; my $ref; # We look for volumes $result_table=$session->get_entries(-columns => [ $snmp_volumetable ]); foreach my $result ( keys %{$result_table} ) { if ( $result =~ /1\.3\.6\.1\.4\.1\.789\.1\.5\.4\.1\.2\.(\S+)/ ) { $ref=$1; # Definition Var for disks my $FREE=""; my $FILESYSTEM=""; my $TOTAL=""; $TOTAL=$session->get_request(-varbindlist => [ $snmp_storageSize.$ref ]); if ( defined ( $TOTAL ) ) { $TOTAL=$TOTAL->{$snmp_storageSize.$ref}; } #print $TOTAL, " "; $FREE=$session->get_request(-varbindlist => [ $snmp_storageUsed.$ref ]); if ( defined ( $FREE ) ) { $FREE=$TOTAL - $FREE->{$snmp_storageUsed.$ref}; } #print $FREE, " "; $FILESYSTEM=$session->get_request(-varbindlist => [ $snmp_volumetable."\.".$ref ]); #print $snmp_volumetable."\.".$ref, " "; if ( defined ( $FILESYSTEM) ) { $FILESYSTEM=$FILESYSTEM->{$snmp_volumetable."\.".$ref}; } #print $FILESYSTEM, "\n"; $common->addDrive( { FILESYSTEM => $FILESYSTEM , FREE => $FREE, TOTAL => $TOTAL, }), } # End index of the element } # End foreach storages } 1; UnixAgent-2.4.2/lib/Ocsinventory/Agent/Modules/Snmp/8072.pm000066400000000000000000000030061332737732100232210ustar00rootroot00000000000000### # SNMP: OID:8072 SYSTEM:Linux ### package Ocsinventory::Agent::Modules::Snmp::8072; use strict; no strict 'refs'; use warnings; sub snmp_run() { my ($session,$snmp) = @_; my $common = $snmp->{common}; my $logger=$snmp->{logger}; my $snmp_nom="1.3.6.1.2.1.1.5.0"; my $list_mib=["If_Mib", "Host_Resources_Mib"]; $logger->debug("Running Linux (8072) MIB module"); $common->setSnmpCommons( {TYPE => "Linux"} ); $common->setSnmpComputer({SYSTEM => 'Linux'}); foreach my $mib ( @{$list_mib} ) { $snmp->snmp_oid_run($mib); } my $snmp_oids="1.3.6.1.4.1.8072.1.2.1.1.4"; my $list_oid_done={8072 => 1}; my $result; my $results_oids=$session->get_next_request(-varbindlist => [$snmp_oids]) ; while ( defined ($results_oids ) ) { foreach $result ( keys %{$results_oids} ) { $snmp_oids=$result; if ( defined ( $results_oids->{$result} ) ) { if ( $results_oids->{$result} =~ /endOfMibView/ ) { $snmp_oids=undef; } elsif ( $result =~ /^1\.3\.6\.1\.4\.1\.8072\.1\.2\.1\.1\.4\S+\.1\.3\.6\.1\.4\.1\.(\d+)\./ ) { my $find_oid=$1; if ( ! defined $list_oid_done->{$find_oid} ) { $list_oid_done->{$find_oid}=1; $snmp->snmp_oid_run($find_oid); } } } } $results_oids=$session->get_next_request(-varbindlist => [$snmp_oids]) ; } } 1; UnixAgent-2.4.2/lib/Ocsinventory/Agent/Modules/Snmp/9.pm000066400000000000000000000317471332737732100230060ustar00rootroot00000000000000### # SNMP: OID: 9 SYSTEM: Cisco ### # Version 1.1 ### package Ocsinventory::Agent::Modules::Snmp::9; use strict; use warnings; use Data::Dumper; sub snmp_run { my ($session , $snmp )= @_; my $logger=$snmp->{logger}; my $common=$snmp->{common}; my $list_mib=["Entity_Mib"]; $logger->debug("Running Cisco (9) MIB module"); foreach my $mib ( @{$list_mib} ) { $snmp->snmp_oid_run($mib); } # OID my $snmp_osversion="1.3.6.1.4.1.9.2.1.73.0"; my $snmp_dot1dBasePortIfIndex="1.3.6.1.2.1.17.1.4.1.2."; my $snmp_ifdesc="1.3.6.1.2.1.2.2.1.2."; my $snmp_iftype="1.3.6.1.2.1.2.2.1.3"; my $snmp_ifspeed="1.3.6.1.2.1.2.2.1.5."; my $snmp_physAddr="1.3.6.1.2.1.2.2.1.6."; my $snmp_ifadminstatus="1.3.6.1.2.1.2.2.1.7."; # Specific Cisco my $snmp_description="1.3.6.1.4.1.9.2.2.1.1.28."; my $snmp_cisco_deviceAddress="1.3.6.1.4.1.9.9.23.1.2.1.1.4."; my $snmp_cisco_deviceId="1.3.6.1.4.1.9.9.23.1.2.1.1.6."; my $snmp_cisco_devicePort="1.3.6.1.4.1.9.9.23.1.2.1.1.7."; my $snmp_cisco_devicePlatform="1.3.6.1.4.1.9.9.23.1.2.1.1.8."; my $snmp_vtp_vlan_state="1.3.6.1.4.1.9.9.46.1.3.1.1.2"; my $snmp_dot1dTpFdbPort="1.3.6.1.2.1.17.4.3.1.2"; my $snmp_cisco_ImageTable="1.3.6.1.4.1.9.9.25.1.1.1.2.4"; my $snmp_cisco_ImageVersion="1.3.6.1.4.1.9.9.25.1.1.1.2.5"; my $snmp_cisco_cpmProcessName="1.3.6.1.4.1.9.9.109.1.2.1.1.2"; my $snmp_cisco_cpmProcessCPU="1.3.6.1.4.1.9.9.109.1.2.1.1.6."; my $oid; my $oid_complet; my $osversion; my $ref; my $serial; my $first_serial=undef; my $software; my $firmware; my $location; my $TotalEthernet=0; my $result_snmp; my $result_sub; my $index_mac={}; my $ref_mac={}; my $DESCRIPTION=undef; my $SPEED=undef; my $MACADDR=undef; my $DEVICEMACADDR=undef; my $SLOT=undef; my $STATUS=undef; my $TYPE=undef; my $DEVICENAME=undef; my $DEVICEADDRESS=undef; my $DEVICEPORT=undef; my $DEVICETYPE=undef; my $VLAN=undef; my $CPU=undef; $common->setSnmpCommons( {TYPE => "Network"} ); # Info interessante SNMPv2-SMI::enterprises.9.9.23.1.2.1.1.6.10140.1 # SNMPv2-SMI::enterprises.9.9.25.1.1.1.2.1 # version IOS $result_snmp=$session->get_request(-varbindlist => [$snmp_osversion]); if ( defined($result_snmp->{$snmp_osversion}) ) { $osversion=$result_snmp->{$snmp_osversion}; } # We are going to look for the vlan existing on this equipment $result_snmp=$session->get_entries(-columns => [$snmp_vtp_vlan_state]); foreach my $resultmac ( keys %{$result_snmp} ) { if ( $resultmac =~ /1\.3\.6\.1\.4\.1\.9\.9\.46\.1\.3\.1\.1\.2\.1\.(\S+)/ ) { my $ref_vlan=$1; my $sub_session; # Now we can scan this vlan for mac address # We must first open a new session with the index associated with the vlan if ( $session->version eq 3 ) { $sub_session= Net::SNMP->session( -retries => 1 , -timeout => 3, -version => $session->version, -hostname => $session->hostname, -community => $snmp->{snmp_community}."@".$ref_vlan, -translate => [-nosuchinstance => 0, -nosuchobject => 0], -username => $snmp->{USER}, -authpassword => $snmp->{AUTHPASSWD}, -authprotocol => $snmp->{AUTHPROTO}, -privpassword => $snmp->{PRIVPASSWD}, -privprotocol => $snmp->{PRIVPROTO}, ); } else { $sub_session= Net::SNMP->session( -retries => 1 , -timeout => 3, -version => $session->version, -hostname => $session->hostname, -community => $snmp->{snmp_community}."@".$ref_vlan, -translate => [-nosuchinstance => 0, -nosuchobject => 0], ); } if ( defined ( $sub_session ) ) { my $result_snmp_mac=$sub_session->get_entries(-columns => [$snmp_dot1dTpFdbPort ]); if ( defined ($result_snmp_mac ) ) { # We scan all lines for my $ligne_snmp_mac ( keys %{$result_snmp_mac} ) { # We first take in the OID the 6 last numbers indicate in decimal the mac address if ( $ligne_snmp_mac =~ /17\.4\.3\.1\.2\.(\S+)\.(\S+)\.(\S+)\.(\S+)\.(\S+)\.(\S+)$/ ) { my $distant_mac=sprintf("%.2x:%.2x:%.2x:%.2x:%.2x:%.2x",$1,$2,$3,$4,$5,$6); my $data_values={}; my $index_bridge=$result_snmp_mac->{$ligne_snmp_mac}; # We have no table for this reference if ( ! defined ( $index_mac->{$index_bridge}) ) { # init of the table $index_mac->{$index_bridge}=[]; # we take the value gived by the OID my $snmp_intero=$snmp_dot1dBasePortIfIndex.$index_bridge; # We take the index reference for the ifdesc # So when we scan this ifdesc, we can add the vlans and mac my $ref_snmp_line=$sub_session->get_request(-varbindlist => [ $snmp_intero ]); # We transmit the ointer value to the ref_mac so we can have a double access for the data # If we have no information: the mac is not associated with a port # It's the switch mac address if ( defined ( $ref_snmp_line->{$snmp_intero}) ) { $ref_mac->{$ref_snmp_line->{$snmp_intero}}=$index_mac->{$index_bridge}; } } $data_values->{MACADRESS}[0]=$distant_mac; $data_values->{VLANID}[0]=$ref_vlan; push(@{$index_mac->{$result_snmp_mac->{$ligne_snmp_mac}}},$data_values); } } } $sub_session->close; } } } # We look for interfaces $result_snmp=$session->get_entries(-columns => [$snmp_iftype]); foreach my $result ( keys %{$result_snmp} ) { # We work on real interface and no vlan if ( $result_snmp->{$result} == 6 ) { if ( $result =~ /1\.3\.6\.1\.2\.1\.2\.2\.1\.3\.(\S+)/ ) { $ref=$1; $TYPE="ethernetCsmacd"; $SLOT=$session->get_request(-varbindlist => [$snmp_ifdesc.$ref]); if ( defined( $SLOT->{$snmp_ifdesc.$ref} ) ) { $SLOT=$SLOT->{$snmp_ifdesc.$ref}; } $SPEED=$session->get_request(-varbindlist => [$snmp_ifspeed.$ref]); if ( defined( $SPEED->{$snmp_ifspeed.$ref}) ) { $SPEED=$SPEED->{$snmp_ifspeed.$ref}; if ( $SPEED / 1000000000000 >= 1 ) { $SPEED=$SPEED / 1000000000000; $SPEED=$SPEED." T"; } elsif ( $SPEED / 1000000000 >= 1 ) { $SPEED=$SPEED / 1000000000; $SPEED=$SPEED." G"; } elsif ( $SPEED / 1000000 >= 1 ) { $SPEED=$SPEED / 1000000; $SPEED=$SPEED." M"; } } $MACADDR=$session->get_request(-varbindlist => [$snmp_physAddr.$ref]); if ( defined( $MACADDR->{$snmp_physAddr.$ref}) ) { # For MACADDR, we need a translation beetween Hexa and string $MACADDR=$MACADDR->{$snmp_physAddr.$ref}; if ( length ($MACADDR) == 14 ) { $MACADDR=substr($MACADDR,2,2).":". substr($MACADDR,4,2).":". substr($MACADDR,6,2).":". substr($MACADDR,8,2).":". substr($MACADDR,10,2).":". substr($MACADDR,12,2); } else { $MACADDR=""; } } if ( defined $ref_mac->{$ref} ) { $VLAN=$ref_mac->{$ref}; } $STATUS=$session->get_request(-varbindlist => [ $snmp_ifadminstatus.$ref ]); if ( $STATUS->{$snmp_ifadminstatus.$ref} == 1 ) { $STATUS="Up"; } else { $STATUS="Down"; } $DESCRIPTION=$session->get_request(-varbindlist => [ $snmp_description.$ref ]); if ( defined( $DESCRIPTION ) ) { $DESCRIPTION=$DESCRIPTION->{$snmp_description.$ref}; } $DEVICEADDRESS=$session->get_entries( -columns => [ $snmp_cisco_deviceAddress.$ref ] ); if ( defined( $DEVICEADDRESS ) ) { my $DEVICEADDRESS_uniq; foreach my $key ( keys %{$DEVICEADDRESS} ) { $DEVICEADDRESS_uniq=$DEVICEADDRESS->{$key} ; if ( length ( $DEVICEADDRESS_uniq ) == 10 ) { $DEVICEADDRESS_uniq=hex(substr($DEVICEADDRESS_uniq,2,2)). ".".hex(substr($DEVICEADDRESS_uniq,4,2)). ".".hex(substr($DEVICEADDRESS_uniq,6,2)). ".".hex(substr($DEVICEADDRESS_uniq,8,2)); } else { $DEVICEADDRESS_uniq=undef; } } $DEVICEADDRESS=$DEVICEADDRESS_uniq; } $DEVICENAME=$session->get_entries( -columns => [ $snmp_cisco_deviceId.$ref ] ); if ( defined( $DEVICENAME ) ) { my $DEVICENAME_uniq; my $DEVICETYPE_uniq; my $DEVICEPORT_uniq; foreach my $key ( keys %{$DEVICENAME} ) { $DEVICENAME_uniq=$DEVICENAME->{$key}; } $DEVICENAME=$DEVICENAME_uniq; # If we have the device name, the cdp can be used for the other informations $DEVICETYPE=$session->get_entries( -columns => [ $snmp_cisco_devicePlatform.$ref ] ); if ( defined( $DEVICETYPE ) ) { foreach my $key ( keys %{$DEVICETYPE} ) { $DEVICETYPE_uniq=$DEVICETYPE->{$key}; } $DEVICETYPE=$DEVICETYPE_uniq; } $DEVICEPORT=$session->get_entries( -columns => [ $snmp_cisco_devicePort.$ref ] ); if ( defined( $DEVICEPORT ) ) { foreach my $key ( keys %{$DEVICEPORT} ) { $DEVICEPORT_uniq=$DEVICEPORT->{$key}; } $DEVICEPORT=$DEVICEPORT_uniq; } } } $common->addSnmpNetwork( { DESCRIPTION => $DESCRIPTION, SPEED => $SPEED, MACADDR => $MACADDR, SLOT => $SLOT, STATUS => $STATUS, TYPE => $TYPE, DEVICENAME => $DEVICENAME, DEVICEADDRESS => $DEVICEADDRESS, DEVICEPORT => $DEVICEPORT, DEVICETYPE => $DEVICETYPE, VLAN => $VLAN, }); $DESCRIPTION=undef; $MACADDR=undef; $SLOT=undef; $STATUS=undef; $TYPE=undef; $SPEED=undef; $MACADDR=undef; $DEVICEADDRESS=undef; $DEVICENAME=undef; $DEVICEPORT=undef; $DEVICETYPE=undef; $VLAN=undef; } } # We have finished for interfaces # We look for Softwares on the switch # We look for feature # All feature are separated by a pipe $result_snmp=$session->get_request ( -varbindlist => [ $snmp_cisco_ImageTable ]) ; if ( defined ( $result_snmp ) ) { $result_snmp=$result_snmp->{$snmp_cisco_ImageTable}; my @tab_feature=split(/\$/,$result_snmp); @tab_feature=split(/\|/,$tab_feature[1]); foreach $result_sub ( @tab_feature ) { $common->addSoftware( { NAME => $result_sub , COMMENTS => "Feature" } ); } } # We look for IOS version $result_snmp=$session->get_request ( -varbindlist => [ $snmp_cisco_ImageVersion ]) ; if ( defined ( $result_snmp ) ) { $result_snmp=$result_snmp->{$snmp_cisco_ImageVersion}; my @tab_feature=split(/\$/,$result_snmp); $common->addSoftware( { NAME => $tab_feature[1] , COMMENTS => "IOS" } ); } } 1; UnixAgent-2.4.2/lib/Ocsinventory/Agent/Modules/Snmp/Default.pm000066400000000000000000000007511332737732100242110ustar00rootroot00000000000000### # SNMP: Default ### package Ocsinventory::Agent::Modules::Snmp::Default; use strict; no strict 'refs'; use warnings; sub snmp_run { my ($session , $snmp )= @_; my $oid_run=$snmp->{snmp_oid_run}; my $inventory = $snmp->{inventory}; my $logger=$snmp->{logger}; my $list_mib=["If_Mib", "Host_Resources_Mib","Printer_Mib"]; $logger->debug("Running Default MIB module \n"); foreach my $mib ( @{$list_mib} ) { $snmp->snmp_oid_run($mib); } } 1; UnixAgent-2.4.2/lib/Ocsinventory/Agent/Modules/Snmp/Entity_Mib.pm000066400000000000000000000110761332737732100246720ustar00rootroot00000000000000### # SNMP: OID: 47 SYSTEM: Entity_Mib ### # Version 0.5 ### package Ocsinventory::Agent::Modules::Snmp::Entity_Mib; use strict; use warnings; sub snmp_run { my ($session , $snmp )= @_; my $logger=$snmp->{logger}; my $common=$snmp->{common}; $logger->debug("Running Entity MIB module"); # OID my $snmp_entPhysicalClass="1.3.6.1.2.1.47.1.1.1.1.5"; my $translation_entPhysicalClass={ #1 => "other", #2 => "unknown", 3 => "chassis", #4 => "backplane", #5 => "container", 6 => "powerSupply", 7 => "fan", #8 => "sensor", 9 => "module", #10 => "port", #11 => "stack", #12 => "cpu", }; my $result_snmp; my $result; my $nbr_switch=0; # We are looking for physical elements $result_snmp=$session->get_entries(-columns => [$snmp_entPhysicalClass]); foreach my $result ( keys %{$result_snmp} ) { if ( $result =~ /1\.3\.6\.1\.2\.1\.47\.1\.1\.1\.1\.5\.(\S+)/ ) { my $ref=$1; my $PhysicalClass=$result_snmp->{$snmp_entPhysicalClass.".".$ref}; my $info = {}; if ( $PhysicalClass =~ /^[3,6,7,9,11]$/ ) { info_element($info,$session,$ref,$logger); $info->{TYPE}=$translation_entPhysicalClass->{$PhysicalClass}; if ( $PhysicalClass == 3 ) { # We have a switch $nbr_switch++; $common->addSnmpSwitch( $info ); # Infos for a switch: DESCRIPTION, REFERENCE, REVISION, FIRMWARE, SERIALNUMBER, MANUFACTURER, TYPE } elsif ( $PhysicalClass == 6 ) { # Infos for an alimentation DESCRIPTION, REFERENCE, REVISION, SERIALNUMBER, MANUFACTURER, TYPE $common->addSnmpPowerSupply( $info ); } elsif ( $PhysicalClass == 7 ) { # Infos for a Fan: DESCRIPTION, REFERENCE, REVISION, SERIALNUMBER, MANUFACTURER, TYPE $common->addSnmpFan( $info ); } elsif ( $PhysicalClass == 9 && defined ($info->{SERIALNUMBER}) ) { if ( ! ($info->{DESCRIPTION} =~ /[CF]PU/ )) { # Infor for a card: DESCRIPTION, REFERENCE, REVISION, FIRMWARE, SOFTWARE, SERIALNUMBER, MANUFACTURER, TYPE $common->addSnmpCard( $info ); } } } } } # We have scaned all equipment, we know now if we have a switch or a stack of switch if ( $nbr_switch == 1 ) { $common->setSnmpSwitchInfos({TYPE=>"Switch"}); } elsif ( $nbr_switch > 1 ) { $common->setSnmpSwitchInfos({TYPE=>"Switchs Stack"}); } } sub info_element(){ my ($info ,$session, $ref, $logger)=@_; my $snmp_info="1.3.6.1.2.1.47.1.1.1.1.2."; my $snmp_ref="1.3.6.1.2.1.47.1.1.1.1.7."; my $snmp_hardware="1.3.6.1.2.1.47.1.1.1.1.8."; my $snmp_firmware="1.3.6.1.2.1.47.1.1.1.1.9."; my $snmp_software="1.3.6.1.2.1.47.1.1.1.1.10."; my $snmp_serial="1.3.6.1.2.1.47.1.1.1.1.11."; my $snmp_entPhysicalMfgName="1.3.6.1.2.1.47.1.1.1.1.12."; my $snmp_entPhysicalModelName="1.3.6.1.2.1.47.1.1.1.1.13."; my $result; # We have a good element $result=$session->get_request(-varbindlist => [$snmp_info.$ref]); if ( defined( $result) ) { $info->{DESCRIPTION} = $result->{$snmp_info.$ref}; } $result=$session->get_request(-varbindlist => [$snmp_ref.$ref]); if ( defined( $result ) ) { $info->{REFERENCE} = $result->{$snmp_ref.$ref}; } $result=$session->get_request(-varbindlist => [$snmp_hardware.$ref]); if ( defined( $result ) ) { $info->{REVISION} = $result->{$snmp_hardware.$ref}; } $result=$session->get_request(-varbindlist => [$snmp_serial.$ref]); if ( defined( $result ) ) { $info->{SERIALNUMBER} = $result->{$snmp_serial.$ref}; } $result=$session->get_request(-varbindlist => [$snmp_firmware.$ref]); if ( defined( $result) ) { $info->{FIRMWARE} = $result->{$snmp_firmware.$ref}; } $result=$session->get_request(-varbindlist => [$snmp_software.$ref]); if ( defined( $result ) ) { $info->{SOFTWARE} = $result->{$snmp_software.$ref}; } $result=$session->get_request(-varbindlist => [$snmp_entPhysicalMfgName.$ref]); if ( defined( $result ) ) { $info->{MANUFACTURER} = $result->{$snmp_entPhysicalMfgName.$ref}; } $result=$session->get_request(-varbindlist => [$snmp_entPhysicalModelName.$ref]); if ( defined( $result ) ) { $info->{TYPE} = $result->{$snmp_entPhysicalModelName.$ref}; } } 1; UnixAgent-2.4.2/lib/Ocsinventory/Agent/Modules/Snmp/Host_Resources_Mib.pm000066400000000000000000000232671332737732100263720ustar00rootroot00000000000000package Ocsinventory::Agent::Modules::Snmp::Host_Resources_Mib; use strict; use warnings; sub snmp_info { return ( { oid_value => "1.3.6.1.2.1.25.1.1.0", oid_name => "Host_Resources_Mib" } ); } sub snmp_run { my ($session , $snmp )= @_; my $logger=$snmp->{logger}; my $common=$snmp->{common}; $logger->debug("Running Host Resources MIB module"); # OID my $soft="1.3.6.1.2.1.25.6.3.1."; my $memory="1.3.6.1.2.1.25.2.2.0"; my $snmp_storageType="1.3.6.1.2.1.25.2.3.1.2"; my $snmp_storageDescr="1.3.6.1.2.1.25.2.3.1.3."; my $snmp_storageSize="1.3.6.1.2.1.25.2.3.1.5."; my $snmp_storageUsed="1.3.6.1.2.1.25.2.3.1.6."; my $snmp_storageAllocationUnits="1.3.6.1.2.1.25.2.3.1.4."; my $snmp_hrDeviceType="1.3.6.1.2.1.25.3.2.1.2"; my $snmp_cpu="1.3.6.1.2.1.25.3.2.1.3."; my $snmp_Printer="1.3.6.1.2.1.25.3.2.1.5."; my $snmp_Video="1.3.6.1.2.1.25.3.2.1.10."; my $snmp_Audio="1.3.6.1.2.1.25.3.2.1.11."; my $snmp_Keyboard="1.3.6.1.2.1.25.3.2.1.13."; my $snmp_Modem="1.3.6.1.2.1.25.3.2.1.14."; my $snmp_ParallelPort="1.3.6.1.2.1.25.3.2.1.15."; my $snmp_Pointing="1.3.6.1.2.1.25.3.2.1.16."; my $snmp_SerialPort="1.3.6.1.2.1.25.3.2.1.17."; my $DATE; my $result; my $result_table; my $ref; $result_table=$session->get_entries(-columns => [ $soft."2" ] ); foreach my $result ( keys %{$result_table} ) { if ( $result =~ /1\.3\.6\.1\.2\.1\.25\.6\.3\.1\.2\.(\S+)/ ) { $ref=$1; $DATE=$session->get_request ( -varbindlist => [ $soft."5.".$ref ]); if ( defined ( $DATE ) ) { $DATE=$DATE->{$soft."5.".$ref}; if ( defined ($DATE ) ) { if (length($DATE)>0) { $DATE=sprintf("%d/%d/%d",hex(substr($DATE,2,4)),hex(substr($DATE,6,2)),hex(substr($DATE,8,2))); } } } $common->addSoftware( { NAME=>$result_table->{ $result } , INSTALLDATE=>$DATE } ); } } # Memory $result=$session->get_request(-varbindlist => [ $memory ]); if ( defined ($result) ) { $common->addMemory( {CAPACITY => $result->{$memory} } ); } # We look for disk $result_table=$session->get_entries(-columns => [ $snmp_storageType ]); foreach my $result ( keys %{$result_table} ) { if ( $result =~ /1\.3\.6\.1\.2\.1\.25\.2\.3\.1\.2\.(\S+)/ ) { $ref=$1; # We look if the storage is a fixed disk if ( $result_table->{$result} =~ /2\.1\.4$/ ) { # Definition Var for disks my $FREE=""; my $FILESYSTEM=""; my $LABEL=""; my $SERIAL=""; my $TOTAL=""; my $TYPE="HardDisk"; my $VOLUMN=""; my $AllocUnits=$session->get_request(-varbindlist => [ $snmp_storageAllocationUnits.$ref ]); if ( defined ( $AllocUnits ) ) { $AllocUnits=$AllocUnits->{$snmp_storageAllocationUnits.$ref}; # Allocation Units are in Bytes, but we want KB if ( $AllocUnits ) { $AllocUnits/=1024; } } else { $AllocUnits=1; } $TOTAL=$session->get_request(-varbindlist => [ $snmp_storageSize.$ref ]); if ( defined ( $TOTAL ) ) { $TOTAL=$TOTAL->{$snmp_storageSize.$ref}; $TOTAL*=$AllocUnits; } else { $TOTAL=0; } $FREE=$session->get_request(-varbindlist => [ $snmp_storageUsed.$ref ]); if ( defined ( $FREE ) ) { $FREE=$TOTAL - $FREE->{$snmp_storageUsed.$ref}* $AllocUnits; } else { $FREE=0; } $FILESYSTEM=$session->get_request(-varbindlist => [ $snmp_storageDescr.$ref ]); if ( defined ( $FILESYSTEM) ) { $FILESYSTEM=$FILESYSTEM->{$snmp_storageDescr.$ref}; } if ( $FILESYSTEM =~ /(\S+)\s+Label:(\S+)\s+Serial Number\s+(\S+)/ ) { $VOLUMN=$1; $LABEL=$2; $SERIAL=$3; $FILESYSTEM=""; } elsif ( $FILESYSTEM =~ /(\S+)\s+Label:\s+Serial Number\s+(\S+)/ ) { $VOLUMN=$1; $SERIAL=$2; $FILESYSTEM=""; } $common->addDrive( { FILESYSTEM => $FILESYSTEM , VOLUMN => $VOLUMN, TYPE => $TYPE, LABEL => $LABEL, SERIAL => $SERIAL, FREE => $FREE, TOTAL => $TOTAL, }), } # End looking for fixed disk } # End index of the element } # End foreach storages $result_table=$session->get_entries(-columns => [ $snmp_hrDeviceType ]); foreach my $result ( keys %{$result_table} ) { if ( $result =~ /1\.3\.6\.1\.2\.1\.25\.3\.2\.1\.2\.(\S+)/ ) { $ref=$1; if ( $result_table->{$result} =~ /3\.1\.3$/ ) { # We have a CPU my $CPU=$session->get_request(-varbindlist => [ $snmp_cpu.$ref ] ); if ( defined ( $CPU ) ) { $CPU=$CPU->{$snmp_cpu.$ref}; my $TYPE=$CPU; my $MANUFACTURER=""; my $SPEED=""; if ( $CPU =~ /^Intel$/ ) { # We have a windows system and for all processor # it say Intel even if the proc is an AMD $MANUFACTURER="x86 Manufacturer"; $TYPE="x86"; } elsif ( $CPU =~ /[Ii]nte/ ) { $MANUFACTURER="Intel"; if ( $CPU =~ /\s+(\S+[GM][Hh][zZ])/ ) { $SPEED=$1; } } elsif ( $CPU =~ /AMD/ ) { $MANUFACTURER="AMD"; if ( $CPU =~ /\s+(\S+\+)/ ) { $SPEED=$1; } } $logger->debug("Speed $SPEED Manufacturer $MANUFACTURER Type $TYPE"); $common->addSnmpCPU( { SPEED => $SPEED, TYPE => $TYPE, MANUFACTURER => $MANUFACTURER, } ); } } } #end CPU elsif ( $result_table->{$result} =~ /3\.1\.5$/ ) { # We have a Printer my $NAME=$session->get_request(-varbindlist => [ $snmp_Printer.$ref ] ); if ( defined ($NAME) ) { $NAME=$NAME->{$snmp_Printer.$ref }; $common->addSnmpLocalPrinter( { NAME => $NAME } ); } } # End Printer elsif ( $result_table->{$result} =~ /3\.1\.13$/ ) { # We have a Keyboard my $DESCRIPTION=$session->get_request(-varbindlist => [ $snmp_Keyboard.$ref ] ); if ( defined ($DESCRIPTION) ) { $DESCRIPTION=$DESCRIPTION->{$snmp_Keyboard.$ref }; $common->addSnmpInput( { DESCRIPTION => $DESCRIPTION , TYPE => "Keyboard" } ); } } # End Keyboard elsif ( $result_table->{$result} =~ /3\.1\.16$/ ) { # We have a Pointing my $DESCRIPTION=$session->get_request(-varbindlist => [ $snmp_Pointing.$ref ] ); if ( defined ($DESCRIPTION) ) { $DESCRIPTION=$DESCRIPTION->{$snmp_Pointing.$ref }; $common->addSnmpInput( { DESCRIPTION => $DESCRIPTION , TYPE => "Mouse" } ); } } # End Pointing elsif ( $result_table->{$result} =~ /3\.1\.11$/ ) { # We have a Audio my $NAME=$session->get_request(-varbindlist => [ $snmp_Audio.$ref ] ); if ( defined ($NAME) ) { $NAME=$NAME->{$snmp_Audio.$ref }; $common->addSound( { NAME => $NAME } ); } } # End Audio elsif ( $result_table->{$result} =~ /3\.1\.10$/ ) { # We have a Video my $NAME=$session->get_request(-varbindlist => [ $snmp_Video.$ref ] ); if ( defined ($NAME) ) { $NAME=$NAME->{$snmp_Video.$ref }; $common->addVideo( { NAME => $NAME } ); } } # End Video elsif ( $result_table->{$result} =~ /3\.1\.14$/ ) { # We have a Modem my $NAME=$session->get_request(-varbindlist => [ $snmp_Modem.$ref ] ); if ( defined ($NAME) ) { $NAME=$NAME->{$snmp_Modem.$ref }; $common->addModem( { NAME => $NAME } ); } } # End Modem elsif ( $result_table->{$result} =~ /3\.1\.15$/ ) { # We have a ParallelPort my $NAME=$session->get_request(-varbindlist => [ $snmp_ParallelPort.$ref ] ); if ( defined ($NAME) ) { $NAME=$NAME->{$snmp_ParallelPort.$ref }; $common->addPorts( { NAME => $NAME , TYPE => "Parallel" } ); } } # End ParallelPort elsif ( $result_table->{$result} =~ /3\.1\.17$/ ) { # We have a SerialPort my $NAME=$session->get_request(-varbindlist => [ $snmp_SerialPort.$ref ] ); if ( defined ($NAME) ) { $NAME=$NAME->{$snmp_SerialPort.$ref }; $common->addPorts( { NAME => $NAME , TYPE => "Serial" } ); } } # End SerialPort } # End scan of hrDeviceType } 1; UnixAgent-2.4.2/lib/Ocsinventory/Agent/Modules/Snmp/If_Mib.pm000066400000000000000000000162031332737732100237510ustar00rootroot00000000000000### # SNMP: OID: 2 SYSTEM: If_Mib ### package Ocsinventory::Agent::Modules::Snmp::If_Mib; use strict; use warnings; use Data::Dumper; sub snmp_info { return ( { oid_value => "1.3.6.1.2.1.2.1.0", oid_name => "If_Mib" } ); } sub snmp_run { my ($session , $snmp )= @_; my $logger=$snmp->{logger}; my $common=$snmp->{common}; $logger->debug("Running If MIB module"); # OID a recuperer my $snmp_ifdescr="1.3.6.1.2.1.2.2.1.2."; my $snmp_iftype="1.3.6.1.2.1.2.2.1.3"; my $snmp_ifspeed="1.3.6.1.2.1.2.2.1.5."; my $snmp_physAddr="1.3.6.1.2.1.2.2.1.6."; my $snmp_ifadminstatus="1.3.6.1.2.1.2.2.1.7."; my $snmp_ipAdEntIfIndex="1.3.6.1.2.1.4.20.1.2"; my $snmp_ipAdEntNetMask="1.3.6.1.2.1.4.20.1.3."; my $snmp_ipRouteIfIndex="1.3.6.1.2.1.4.21.1.2."; my $snmp_ipRouteNextHop="1.3.6.1.2.1.4.21.1.7."; my $snmp_ipRouteType="1.3.6.1.2.1.4.21.1.8"; my $SPEED=undef; my $MACADDR=undef; my $SLOT=undef; my $STATUS=undef; my $TYPE=undef; my $IPADDR=undef; my $IPMASK=undef; my $IPGATEWAY=undef; my $IPSUBNET=undef; my $ref; my $result_snmp; my $address_index=undef; my $netmask_index=undef; my $network_index=undef; my $gateway_index=undef; # the informations on ip address and gateway are not indexed on the # interfaces so we must get it before and integrate the informations # after for each interface # We take all the snmp_ifadminstatus in a table if this information exist $result_snmp=$session->get_entries(-columns => [$snmp_ipAdEntIfIndex]); foreach my $result ( keys %{$result_snmp} ) { if ( $result =~ /1\.3\.6\.1\.2\.1\.4\.20\.1\.2\.(\S+)/ ) { my $address=$1; $address_index->{$result_snmp->{$result}}=$address; # We have the address so we can lokk for the netmask associated my $netmask=$session->get_request(-varbindlist => [$snmp_ipAdEntNetMask.$address]); if ( defined($netmask->{$snmp_ipAdEntNetMask.$address} ) ) { $netmask_index->{$result_snmp->{$result}}=$netmask->{$snmp_ipAdEntNetMask.$address}; } } } # now we can do the same thing for the gateway # It is an other index and only indirect information (routing) # are required actually $result_snmp=$session->get_entries(-columns => [$snmp_ipRouteType]); foreach my $result ( keys %{$result_snmp} ) { if ( $result =~ /1\.3\.6\.1\.2\.1\.4\.21\.1\.8\.(\S+)/ ) { if ( $result_snmp->{$result} == 4 ) { my $net_address=$1; # We get the index associating the interface with the gateway and subnet my $ind=$session->get_request(-varbindlist => [$snmp_ipRouteIfIndex.$net_address] ); $ind=$ind->{$snmp_ipRouteIfIndex.$net_address}; # We ave already the network so we can add the information with the index $network_index->{$ind}=$net_address; # We get the gateway my $gateway=$session->get_request(-varbindlist => [$snmp_ipRouteNextHop.$net_address] ); $gateway_index->{$ind}=$gateway->{$snmp_ipRouteNextHop.$net_address}; } } } # We look for interfaces $result_snmp=$session->get_entries(-columns => [$snmp_iftype]); foreach my $result ( keys %{$result_snmp} ) { # We work on real interface and no vlan $TYPE=$result_snmp->{$result}; if ( $TYPE == 6 || $TYPE == 94) { if ( $result =~ /1\.3\.6\.1\.2\.1\.2\.2\.1\.3\.(\S+)/ ) { $ref=$1; if ( $TYPE == 6 ) { $TYPE="ethernetCsmacd"; } elsif ( $TYPE == 94 ) { $TYPE="Adsl"; } my $intero=$snmp_ifdescr.$ref; #$SLOT=$session->get_request(-varbindlist => [$snmp_ifdescr.$ref]); $SLOT=$session->get_request(-varbindlist => [$intero]); $SLOT=" $SLOT->{$snmp_ifdescr.$ref}"; #print "Pour $intero Le slot $SLOT\n"; $SPEED=$session->get_request(-varbindlist => [$snmp_ifspeed.$ref]); if ( defined( $SPEED->{$snmp_ifspeed.$ref}) ) { $SPEED=$SPEED->{$snmp_ifspeed.$ref}; if ( $SPEED / 1000000000000 >= 1 ) { $SPEED=$SPEED / 1000000000000; $SPEED=$SPEED." T"; } elsif ( $SPEED / 1000000000 >= 1 ) { $SPEED=$SPEED / 1000000000; $SPEED=$SPEED." G"; } elsif ( $SPEED / 1000000 >= 1 ) { $SPEED=$SPEED / 1000000; $SPEED=$SPEED." M"; } } $MACADDR=$session->get_request(-varbindlist => [$snmp_physAddr.$ref]); if ( defined( $MACADDR->{$snmp_physAddr.$ref}) ) { # For MACADDR, we need a translation beetween Hexa and string $MACADDR=" ".$MACADDR->{$snmp_physAddr.$ref}; if ( $MACADDR =~ /^ 0x(\w{2})(\w{2})(\w{2})(\w{2})(\w{2})(\w{2})$/ ) { $MACADDR="$1:$2:$3:$4:$5:$6"; } $STATUS=$session->get_request(-varbindlist => [ $snmp_ifadminstatus.$ref ]); if ( $STATUS->{$snmp_ifadminstatus.$ref} == 1 ) { $STATUS="Up"; } else { $STATUS="Down"; } # If we have the address ip and netmask we can put it if ( defined ( $address_index ) ) { $IPADDR=$address_index->{$ref}; $IPMASK=$netmask_index->{$ref}; #if ( defined ($IPADDR ) ) { # my $local_info=$session->hostname(); # print "$IPADDR et $local_info"; # if ( $IPADDR eq $session->hostname() ) { # $common->setSnmpCommons({MACADDR => $MACADDR }); # } #} } if ( defined ( $network_index ) ) { $IPGATEWAY=$gateway_index->{$ref}; $IPSUBNET=$network_index->{$ref}; } $common->addSnmpNetwork( { TYPE => $TYPE, SLOT => $SLOT, SPEED => $SPEED, MACADDR => $MACADDR, STATUS => $STATUS, IPADDR => $IPADDR, IPMASK => $IPMASK, IPGATEWAY => $IPGATEWAY, IPSUBNET => $IPSUBNET, }); $MACADDR=undef; $SLOT=undef; $STATUS=undef; $SPEED=undef; $IPADDR=undef; $IPMASK=undef; $IPGATEWAY=undef; $IPSUBNET=undef; } } } } # End foreach result } 1; UnixAgent-2.4.2/lib/Ocsinventory/Agent/Modules/Snmp/Printer_Mib.pm000066400000000000000000000141201332737732100250320ustar00rootroot00000000000000### # SNMP: OID: 43 SYSTEM: Printer_Mib ### package Ocsinventory::Agent::Modules::Snmp::Printer_Mib; use strict; sub snmp_info { #TODO: find a common OID from Printer_Mib (compatible with most printers) instead of using hrPrinterStatus from Host_Ressources_Mib return ( { oid_value => "1.3.6.1.2.1.25.3.5.1.1.1", oid_name => "Printer_Mib" } ); } sub snmp_run { my ($session , $snmp )= @_; my $logger=$snmp->{logger}; my $common=$snmp->{common}; my ($result,$name,$serialnumber,$lifecount,$countunit,$printerstatus,$errorstate); $logger->debug("Running Printer MIB module"); $common->setSnmpCommons( {TYPE => "Printer"} ); # prtGeneralPrinterName my $snmp_name="1.3.6.1.2.1.43.5.1.1.16.1"; # prtInputSerialNumber my $snmp_serialnumber="1.3.6.1.2.1.43.5.1.1.17.1"; # prtMarkerLifeCount my $snmp_lifecount="1.3.6.1.2.1.43.10.2.1.4.1.1"; # prtMarkerCounterUnit my $snmp_countunit="1.3.6.1.2.1.43.10.2.1.3.1.1"; # prtInputTable my $snmp_inputable="1.3.6.1.2.1.43.8.2"; # prtMarkerSuppliesTable my $snmp_markersuppliestable="1.3.6.1.2.1.43.11.1"; # prtMarkerColorantValue my $snmp_colorantvalue="1.3.6.1.2.1.43.12.1.1.4"; # hrPrinterStatus my $snmp_printerstatus="1.3.6.1.2.1.25.3.5.1.1.1"; # PrinterDetectedErrorState my $snmp_errorstate="1.3.6.1.2.1.25.3.5.1.2.1"; #Trays informations we want to get my $trayinfos = { name => "1.3.6.1.2.1.43.8.2.1.13", #prtInputName description => "1.3.6.1.2.1.43.8.2.1.18", #prtInputDescription level => "1.3.6.1.2.1.43.8.2.1.10", #prtInputLevel maxcapacity => "1.3.6.1.2.1.43.8.2.1.9", #prtInputMaxCapacity }; # Cartridges informations we want to get my $cartridgeinfos = { description => "1.3.6.1.2.1.43.11.1.1.6", #prtMarkerSuppliesDescription type => "1.3.6.1.2.1.43.11.1.1.5", #prtMarkerSuppliesType level => "1.3.6.1.2.1.43.11.1.1.9", #prtMarkerSuppliesSupplyLevel maxcapacity => "1.3.6.1.2.1.43.11.1.1.8", #prtMarkerSuppliesMaxCapacity }; # Translation for the prtMarkerCounterUnit integer my $countunit_translation = { 3 => 'tenThousandthsOfInches', 4 => 'micrometers', 5 => 'characters', 6 => 'lines', 7 => 'impressions', 8 => 'sheets', 9 => 'dotRow', 11 => 'hours', 16 => 'feet', 17 => 'meters', }; # Translation for the prtMarkerSuppliesType integer my $suppliestype_translation = { 1 => 'other', 2 => 'unknown', 3 => 'toner', 4 => 'wasteToner', 5 => 'ink', 6 => 'inkCartridge', 7 => 'inkRibbon', 8 => 'wasteInk', 9 => 'opc', 10 => 'developer', 11 => 'fuserOil', 12 => 'solidWax', 13 => 'ribbonWax', 14 => 'wasteWax', }; my $printerstatus_translation = { 1 => 'other', 2 => 'unknown', 3 => 'idle', 4 => 'printing', 5 => 'warmup', }; my $errorstate_translation = { '0x00' => 'lowPaper', '0x01' => 'noPaper', '0x02' => 'lowToner', '0x03' => 'noToner', '0x04' => 'doorOpen', '0x05' => 'jammed', '0x06' => 'offline', '0x07' => 'serviceRequested', '0x08' => 'inputTrayMissing', '0x09' => 'outputTrayMissing', '0x10' => 'markerSupplyMissing', '0x11' => 'outputNearFull', '0x12' => 'outputFull', '0x13' => 'inputTrayEmpty', '0x14' => 'overduePreventMaint', }; ##### #Getting printer informations $result=$session->get_request( -varbindlist => [$snmp_name]); $name=$result->{$snmp_name}; $result=$session->get_request(-varbindlist => [$snmp_serialnumber]); $serialnumber=$result->{$snmp_serialnumber}; $result=$session->get_request(-varbindlist => [$snmp_lifecount]); $lifecount=$result->{$snmp_lifecount}; $result=$session->get_request(-varbindlist => [$snmp_countunit]); $countunit=$countunit_translation->{ $result->{$snmp_countunit} }; $result=$session->get_request(-varbindlist => [$snmp_printerstatus]); $printerstatus=$result->{$snmp_printerstatus}; $result=$session->get_request(-varbindlist => [$snmp_errorstate]); $errorstate=$result->{$snmp_errorstate}; # Adding informations to XML $common->setSnmpPrinter({ NAME => $name, SERIALNUMBER => $serialnumber, COUNTER => "$lifecount $countunit", STATUS => $printerstatus_translation->{$printerstatus}, ERRORSTATE => $errorstate_translation->{$errorstate}, }); # Getting trays informations using the table my $inputable=$session->get_table(-baseoid => $snmp_inputable) ; my $trays = $common->getSnmpTable($inputable,$snmp_inputable,$trayinfos); for my $tray ( keys %$trays ) { #Adding informations about trays in XML $common->addSnmpPrinterTray({ NAME => $trays->{$tray}->{name}, DESCRIPTION => $trays->{$tray}->{description}, LEVEL => $trays->{$tray}->{level}, MAXCAPACITY => $trays->{$tray}->{maxcapacity}, }); } # Getting cartridges informations using the table my $markersuppliestable=$session->get_table(-baseoid => $snmp_markersuppliestable) ; my $cartridges = $common->getSnmpTable($markersuppliestable,$snmp_markersuppliestable,$cartridgeinfos); for my $cartridge ( keys %$cartridges ) { # Getting colorant value $result = $session->get_request(-varbindlist => [$snmp_colorantvalue.$cartridge]); my $colorantvalue = $result->{$snmp_colorantvalue.$cartridge}; # Adding informations about cartridges in XML $common->addSnmpPrinterCartridge({ DESCRIPTION => $cartridges->{$cartridge}->{description}, TYPE => $suppliestype_translation->{ $cartridges->{$cartridge}->{type} }, LEVEL => $cartridges->{$cartridge}->{level}, MAXCAPACITY => $cartridges->{$cartridge}->{maxcapacity}, COLOR => $colorantvalue, }); } } 1; UnixAgent-2.4.2/lib/Ocsinventory/Agent/Network.pm000066400000000000000000000113331332737732100217270ustar00rootroot00000000000000package Ocsinventory::Agent::Network; # TODO: # - set the correct deviceID and olddeviceID use strict; use warnings; use IO::Socket::SSL qw(SSL_VERIFY_NONE); use LWP::UserAgent; use Socket; use Ocsinventory::Compress; sub new { my (undef, $params) = @_; my $self = {}; $self->{accountconfig} = $params->{accountconfig}; $self->{accountinfo} = $params->{accountinfo}; $self->{common} = $params->{common}; my $logger = $self->{logger} = $params->{logger}; $self->{config} = $params->{config}; my $uaserver; if ($self->{config}->{server} =~ /^http(|s):\/\//) { $self->{URI} = $self->{config}->{server}; $uaserver = $self->{config}->{server}; $uaserver =~ s/^http(|s):\/\///; $uaserver =~ s/\/.*//; if ($uaserver !~ /:\d+$/) { $uaserver .= ':443' if $self->{config}->{server} =~ /^https:/; $uaserver .= ':80' if $self->{config}->{server} =~ /^http:/; } } else { $self->{URI} = "http://".$self->{config}->{server}.$self->{config}->{remotedir}; $uaserver = $self->{config}->{server}; } $self->{compress} = new Ocsinventory::Compress ({logger => $logger}); # Connect to server $self->{ua} = LWP::UserAgent->new(keep_alive => 1); if ($self->{config}->{proxy}) { $self->{ua}->proxy(['http', 'https'], $self->{config}->{proxy}); } else { $self->{ua}->env_proxy; } my $version = 'OCS-NG_unified_unix_agent_v'; $version .= exists ($self->{config}->{VERSION})?$self->{config}->{VERSION}:''; $self->{ua}->agent($version); $self->{config}->{user}.",". $self->{config}->{password}.""; $self->{ua}->credentials( $uaserver, # server:port, port is needed $self->{config}->{realm}, $self->{config}->{user}, $self->{config}->{password} ); #Setting SSL configuration depending on LWP version $self->{ua}->_agent =~ /^libwww-perl\/(.*)$/; my $lwp_version= $1; $lwp_version=$self->{common}->convertVersion($lwp_version,3); if ($lwp_version > 583) { $self->{ua}->ssl_opts( verify_hostname => $self->{config}->{ssl}, SSL_ca_file => $self->{config}->{ca} ); if ($self->{config}->{ssl} == 0 ) { $self->{ua}->ssl_opts( SSL_verify_mode => SSL_VERIFY_NONE ); } } elsif ($self->{config}->{ssl} eq 1) { # SSL verification is disabled by default in LWP prior to version 6 # we activate it using Crypt::SSLeay environment variables $ENV{HTTPS_CA_FILE} = $self->{config}->{ca}; } bless $self; } sub sendXML { my ($self, $args) = @_; my $logger = $self->{logger}; my $compress = $self->{compress}; my $message = $args->{message}; my $common = $self->{common}; my $req = HTTP::Request->new(POST => $self->{URI}); $req->header('Pragma' => 'no-cache', 'Content-type', 'application/x-compress'); $logger->debug ("sending XML"); $logger->debug ("sending: ".$message); my $compressed = $compress->compress($message); if (!$compressed) { $logger->error ('failed to compress data'); return; } $req->content($compressed); my $res = $self->{ua}->request($req); # Checking if connected if (!$res->is_success) { $logger->error ('Cannot establish communication : '.$res->status_line); return; } return $res ; } sub getXMLResp { my ($self, $res, $msgtype) = @_; my $logger = $self->{logger}; my $compress = $self->{compress}; # If no answer from OCS server return unless $res; # Reading the XML response from OCS server my $content = $compress->uncompress($res->content); if (!$content) { $logger->error ("Deflating problem"); return; } my $tmp = "Ocsinventory::Agent::XML::Response::".$msgtype; eval "require $tmp"; if ($@) { $logger->error ("Can't load response module $tmp: $@"); } $tmp->import(); my $response = $tmp->new ({ accountconfig => $self->{accountconfig}, accountinfo => $self->{accountinfo}, content => $content, logger => $logger, config => $self->{config}, common => $self->{common}, }); return $response; } sub getFile { my ($self,$proto,$uri,$filetoget,$filepath) = @_; my $logger= $self->{logger}; chomp($proto,$uri,$filetoget,$filepath); my $url = "$proto://$uri/$filetoget"; my $response = $self->{ua}->mirror($url,$filepath); if ($response->is_success){ $logger->debug("Success downloading $filetoget file..."); } else { $logger->error("Failed downloading $filetoget: ".$response->status_line." !!!"); return 1; } } 1; UnixAgent-2.4.2/lib/Ocsinventory/Agent/XML/000077500000000000000000000000001332737732100203775ustar00rootroot00000000000000UnixAgent-2.4.2/lib/Ocsinventory/Agent/XML/Inventory.pm000066400000000000000000000205071332737732100227360ustar00rootroot00000000000000package Ocsinventory::Agent::XML::Inventory; # TODO: resort the functions use strict; use warnings; =head1 NAME Ocsinventory::Agent::XML::Inventory - the XML abstraction layer =head1 DESCRIPTION OCS Inventory uses XML for the data transmission. The module is the abstraction layer. It's mostly used in the backend module where it called $inventory in general. =cut use XML::Simple; use Digest::MD5 qw(md5_base64); use Config; use Ocsinventory::Agent::Backend; =over 4 =item new() The usual constructor. =cut sub new { my (undef, $params) = @_; my $self = {}; $self->{accountinfo} = $params->{context}->{accountinfo}; $self->{accountconfig} = $params->{context}->{accountconfig}; $self->{backend} = $params->{backend}; $self->{common} = $params->{context}->{common}; my $logger = $self->{logger} = $params->{context}->{logger}; $self->{config} = $params->{context}->{config}; if (!($self->{config}{deviceid})) { $logger->fault ('deviceid unititalised!'); } $self->{xmlroot}{QUERY} = ['INVENTORY']; $self->{xmlroot}{DEVICEID} = [$self->{config}->{deviceid}]; #$self->{xmlroot}{CONTENT}{HARDWARE} = { # TODO move that in a backend module # ARCHNAME => [$Config{archname}] #}; # Is the XML centent initialised? $self->{isInitialised} = undef; bless $self; } =item initialise() Runs the backend modules to initialise the data. =cut sub initialise { my ($self) = @_; return if $self->{isInitialised}; $self->{backend}->feedInventory ({inventory => $self}); $self->{isInitialised} = 1; } =item getContent() Return the inventory as a XML string. =cut sub getContent { my ($self, $args) = @_; my $logger = $self->{logger}; my $common = $self->{common}; if ($self->{isInitialised}) { $self->processChecksum(); # checks for MAC, NAME and SSN presence my $macaddr = $self->{xmlroot}->{CONTENT}->{NETWORKS}->[0]->{MACADDR}->[0]; my $ssn = $self->{xmlroot}->{CONTENT}->{BIOS}->{SSN}->[0]; my $name = $self->{xmlroot}->{CONTENT}->{HARDWARE}->{NAME}->[0]; my $missing; $missing .= "MAC-address " unless $macaddr; $missing .= "SSN " unless $ssn; $missing .= "HOSTNAME " unless $name; if ($missing) { $logger->debug('Missing value(s): '.$missing.'. I will send this inventory to the server BUT important value(s) to identify the computer are missing'); } $self->{accountinfo}->setAccountInfo($self); my $content = XMLout( $self->{xmlroot}, RootName => 'REQUEST', XMLDecl => '', SuppressEmpty => undef ); # Cleaning XML to delete unprintable characters my $clean_content=$common->cleanXml($content); # Cleaning xmltags content after adding it o inventory $common->flushXMLTags(); return $clean_content; } } =item printXML() Only for debugging purpose. Print the inventory on STDOUT. =cut sub printXML { my ($self, $args) = @_; if ($self->{isInitialised}) { print $self->getContent(); } } =item writeXML() Save the generated inventory as an XML file. The 'local' key of the config is used to know where the file as to be saved. =cut sub writeXML { my ($self, $args) = @_; my $logger = $self->{logger}; if ($self->{config}{local} =~ /^$/) { $logger->fault ('local path unititalised!'); } if ($self->{isInitialised}) { my $localfile = $self->{config}{local}."/".$self->{config}{deviceid}.'.ocs'; $localfile =~ s!(//){1,}!/!; # Convert perl data structure into xml strings if (open OUT, ">$localfile") { print OUT $self->getContent(); close OUT or warn; $logger->info("Inventory saved in $localfile"); } else { warn "Can't open `$localfile': $!" } } } =item processChecksum() Compute the field. This information is used by the server to know which parts of the XML have changed since the last inventory. The is done thank to the last_file file. It has MD5 prints of the previous inventory. =cut sub processChecksum { my $self = shift; my $logger = $self->{logger}; my $common = $self->{common}; # To apply to $checksum with an OR my %mask = ( 'HARDWARE' => 1, 'BIOS' => 2, 'MEMORIES' => 4, 'SLOTS' => 8, 'REGISTRY' => 16, 'CONTROLLERS' => 32, 'MONITORS' => 64, 'PORTS' => 128, 'STORAGES' => 256, 'DRIVES' => 512, 'INPUT' => 1024, 'MODEMS' => 2048, 'NETWORKS' => 4096, 'PRINTERS' => 8192, 'SOUNDS' => 16384, 'VIDEOS' => 32768, 'SOFTWARES' => 65536, 'VIRTUALMACHINES' => 131072, 'CPUS' => 262144, 'BATTERIES' => 1048576, ); if (!$self->{config}->{vardir}) { $logger->fault ("vardir uninitialised!"); } my $checksum = 0; if (!$self->{config}{local} && $self->{config}->{last_statefile}) { if (-f $self->{config}->{last_statefile}) { # TODO: avoid a violant death in case of problem with XML $self->{last_state_content} = XML::Simple::XMLin( $self->{config}->{last_statefile}, SuppressEmpty => undef, ForceArray => 1 ); } else { $logger->debug ('last_state file: `'. $self->{config}->{last_statefile}. "' doesn't exist (yet)."); } } foreach my $section (keys %mask) { # If the checksum has changed... my $hash = md5_base64(XML::Simple::XMLout($self->{xmlroot}{'CONTENT'}{$section})); if (!$self->{last_state_content}->{$section}[0] || $self->{last_state_content}->{$section}[0] ne $hash ) { $logger->debug ("Section $section has changed since last inventory"); # We make OR on $checksum with the mask of the current section $checksum |= $mask{$section}; # Finally I store the new value. $self->{last_state_content}->{$section}[0] = $hash; } } $common->setHardware({CHECKSUM => $checksum}); } =item saveLastState() At the end of the process IF the inventory was saved correctly, the last_state is saved. =cut sub saveLastState { my ($self, $args) = @_; my $logger = $self->{logger}; if (!defined($self->{last_state_content})) { $self->processChecksum(); } if (!defined ($self->{config}->{last_statefile})) { $logger->debug ("Can't save the last_state file. File path is not initialised."); return; } if (open LAST_STATE, ">".$self->{config}->{last_statefile}) { print LAST_STATE my $string = XML::Simple::XMLout( $self->{last_state_content}, RootName => 'LAST_STATE' );; close LAST_STATE or warn; } else { $logger->debug ("Cannot save the checksum values in ".$self->{config}->{last_statefile}.":$!"); } } =item addSection() A generic way to save a section in the inventory. Please avoid this solution. =cut sub addSection { my ($self, $args) = @_; my $logger = $self->{logger}; my $multi = $args->{multi}; my $tagname = $args->{tagname}; for ( keys %{$self->{xmlroot}{CONTENT}} ){ if ( $tagname eq $_ ){ $logger->debug("Tag name `$tagname` already exists - Don't add it"); return 0; } } if ($multi){ $self->{xmlroot}{CONTENT}{$tagname} = []; } else { $self->{xmlroot}{CONTENT}{$tagname} = {}; } return 1; } =item feedSection() Add information in inventory. =back =cut # Q: is that really useful()? Can't we merge with addSection()? sub feedSection{ my ($self, $args) = @_; my $tagname = $args->{tagname}; my $values = $args->{data}; my $logger = $self->{logger}; my $found=0; for ( keys %{$self->{xmlroot}{CONTENT}} ){ $found = 1 if $tagname eq $_; } if (!$found){ $logger->debug("Tag name `$tagname` doesn't exist - Cannot feed it"); return 0; } if ( $self->{xmlroot}{CONTENT}{$tagname} =~ /ARRAY/ ){ push @{$self->{xmlroot}{CONTENT}{$tagname}}, $args->{data}; } else { $self->{xmlroot}{CONTENT}{$tagname} = $values; } return 1; } 1; UnixAgent-2.4.2/lib/Ocsinventory/Agent/XML/Prolog.pm000066400000000000000000000014221332737732100221760ustar00rootroot00000000000000package Ocsinventory::Agent::XML::Prolog; use strict; use warnings; use XML::Simple; use Digest::MD5 qw(md5_base64); sub new { my (undef, $params) = @_; my $self = {}; $self->{config} = $params->{context}->{config}; $self->{logger} = $params->{context}->{logger}; die unless ($self->{config}->{deviceid}); #XXX $self->{xmlroot}{QUERY} = ['PROLOG']; $self->{xmlroot}{DEVICEID} = [$self->{config}->{deviceid}]; bless $self; } sub dump { my $self = shift; eval "use Data::Dumper;"; print Dumper($self->{xmlroot}); } sub getContent { my ($self, $args) = @_; my $content=XMLout( $self->{xmlroot}, RootName => 'REQUEST', XMLDecl => '', SuppressEmpty => undef ); return $content; } 1; UnixAgent-2.4.2/lib/Ocsinventory/Agent/XML/Response.pm000066400000000000000000000020651332737732100225360ustar00rootroot00000000000000package Ocsinventory::Agent::XML::Response; use strict; use warnings; use XML::Simple; use Data::Dumper; sub new { my (undef, $params) = @_; my $self = {}; $self->{accountconfig} = $params->{accountconfig}; $self->{accountinfo} = $params->{accountinfo}; $self->{content} = $params->{content}; $self->{config} = $params->{config}; $self->{common} = $params->{common}; my $logger = $self->{logger} = $params->{logger}; $self->{origmsg} = $params->{origmsg}; $logger->debug("=BEGIN=SERVER RET======"); $logger->debug(Dumper($self->{content})); $logger->debug("=END=SERVER RET======"); $self->{parsedcontent} = undef; bless $self; } sub getRawXML { my $self = shift; return $self->{content}; } sub getParsedContent { my ($self,$forcearray) = @_; if (!$self->{parsedcontent}) { $self->{parsedcontent} = $self->{common}->readXml($self->{content},$forcearray); } return $self->{parsedcontent}; } sub origMsgType { my ($self, $package) = @_; return ref($package); } 1; UnixAgent-2.4.2/lib/Ocsinventory/Agent/XML/Response/000077500000000000000000000000001332737732100221755ustar00rootroot00000000000000UnixAgent-2.4.2/lib/Ocsinventory/Agent/XML/Response/Inventory.pm000066400000000000000000000010721332737732100245300ustar00rootroot00000000000000package Ocsinventory::Agent::XML::Response::Inventory; use strict; use Ocsinventory::Agent::XML::Response; our @ISA = ('Ocsinventory::Agent::XML::Response'); sub new { my ($class, @params) = @_; my $this = $class->SUPER::new(@params); bless ($this, $class); my $parsedContent = $this->getParsedContent(['ACCOUNTINFO']); if ($parsedContent && exists ($parsedContent->{RESPONSE}) && $parsedContent->{RESPONSE} =~ /^ACCOUNT_UPDATE$/) { $this->{accountinfo}->writeAccountInfoFile($parsedContent->{ACCOUNTINFO}); } return $this; } 1; UnixAgent-2.4.2/lib/Ocsinventory/Agent/XML/Response/Prolog.pm000066400000000000000000000052761332737732100240070ustar00rootroot00000000000000package Ocsinventory::Agent::XML::Response::Prolog; use strict; use Ocsinventory::Agent::XML::Response; our @ISA = ('Ocsinventory::Agent::XML::Response'); sub new { my ($class, @params) = @_; my $this = $class->SUPER::new(@params); bless ($this, $class); $this->updatePrologFreq(); $this->saveNextTime(); return $this; } sub isInventoryAsked { my $self = shift; my $parsedContent = $self->getParsedContent(['OPTION','PARAM']); if ($parsedContent && exists ($parsedContent->{RESPONSE}) && $parsedContent->{RESPONSE} =~ /^SEND$/) { return 1; } 0 } sub getOptionsInfoByName { my ($self, $name) = @_; my $parsedContent = $self->getParsedContent(['OPTION','PARAM']); my $ret = []; return unless ($parsedContent && $parsedContent->{OPTION}); foreach (@{$parsedContent->{OPTION}}) { if ($_->{NAME} && $_->{NAME} =~ /^$name$/i) { $ret = $_->{PARAM} } } return $ret; } sub updatePrologFreq { my $self = shift; my $parsedContent = $self->getParsedContent(['OPTION','PARAM']); my $logger = $self->{logger}; if ($parsedContent && exists ($parsedContent->{PROLOG_FREQ})) { if( $parsedContent->{PROLOG_FREQ} ne $self->{accountconfig}->get("PROLOG_FREQ")){ $logger->info("PROLOG_FREQ has changed since last process(old=".$self->{accountconfig}->get("PROLOG_FREQ").",new=".$parsedContent->{PROLOG_FREQ}.")"); $self->{prologFreqChanged} = 1; $self->{accountconfig}->set("PROLOG_FREQ", $parsedContent->{PROLOG_FREQ}); } else{ $logger->debug("PROLOG_FREQ has not changed since last process"); } } } sub saveNextTime { my ($self, $args) = @_; my $logger = $self->{logger}; if (!$self->{config}->{next_timefile}) { $logger->debug("no next_timefile to save!"); return; } my $parsedContent = $self->getParsedContent(['OPTION','PARAM']); if (!open NEXT_TIME, ">".$self->{config}->{next_timefile}) { $logger->error ("Cannot create the next_timefile `".$self->{config}->{next_timefile}."': $!"); return; } close NEXT_TIME or warn; my $serverdelay = $self->{accountconfig}->get('PROLOG_FREQ'); my $time; if( $self->{prologFreqChanged} ){ $logger->debug("Compute next_time file with random value"); $time = time + int rand(($serverdelay?$serverdelay*3600:$self->{config}->{delaytime})); } else{ $time = time + ($serverdelay?$serverdelay*3600:$self->{config}->{delaytime}); } utime $time,$time,$self->{config}->{next_timefile}; if ($self->{config}->{cron}) { $logger->info ("Next inventory after ".localtime($time)); } } 1; UnixAgent-2.4.2/lib/Ocsinventory/Agent/XML/SimpleMessage.pm000066400000000000000000000017411332737732100234760ustar00rootroot00000000000000package Ocsinventory::Agent::XML::SimpleMessage; use strict; use warnings; use Data::Dumper; # XXX Debug use XML::Simple; use Digest::MD5 qw(md5_base64); use Ocsinventory::Agent::XML::Prolog; sub new { my (undef, $params) = @_; my $self = {}; $self->{config} = $params->{config}; $self->{accountinfo} = $params->{accountinfo}; die unless ($self->{config}->{deviceid}); #XXX $self->{xmlroot}{QUERY} = ['PROLOG']; $self->{xmlroot}{DEVICEID} = [$self->{config}->{deviceid}]; bless $self; } sub dump { my $self = shift; print Dumper($self->{xmlroot}); } sub set { my ($self, $args) = @_; foreach (keys %$args) { $self->{xmlroot}{$_} = [$args->{$_}]; } } sub getContent { my ($self, $args) = @_; $self->{accountinfo}->setAccountInfo($self); my $content=XMLout( $self->{xmlroot}, RootName => 'REQUEST', XMLDecl => '', SuppressEmpty => undef ); return $content; } 1; UnixAgent-2.4.2/lib/Ocsinventory/Compress.pm000066400000000000000000000054421332737732100210370ustar00rootroot00000000000000package Ocsinventory::Compress; use strict; use File::Temp qw/ tempdir tempfile /; sub new { my (undef, $params) = @_; my $self = {}; my $logger = $self->{logger} = $params->{logger}; eval{require Compress::Zlib;}; $self->{mode} = 'natif' unless $@; chomp(my $gzippath=`which gzip 2>/dev/null`); if ($self->{mode} eq 'natif') { $logger->debug ('Compress::Zlib is available.'); } elsif (-x $gzippath) { $logger->debug ( 'Compress::Zlib is not available! The data will be compressed with gzip instead but won\'t be accepted by server prior 1.02'); $self->{mode} = 'gzip'; $self->{tmpdir} = tempdir( CLEANUP => 1 ); mkdir $self->{tmpdir}; if ( ! -d $self->{tmpdir} ) { $logger->fault("Failed to create the temp dir `$self->{tmpdir}'"); } } else { $self->{mode} = 'deflated'; $logger->debug ('I need the Compress::Zlib library or the gzip'. ' command to compress the data - The data will be sent uncompressed but won\'t be accepted by server prior 1.02'); } bless $self; } sub compress { my ($self, $content) = @_; my $logger = $self->{logger}; # native mode (zlib) if ($self->{mode} eq 'natif') { return Compress::Zlib::compress($content); } elsif ($self->{mode} eq 'gzip'){ # gzip mode my ($fh, $filename) = tempfile( DIR => $self->{tmpdir} ); print $fh $content; close $fh; system ("gzip --best $filename > /dev/null"); # print "filename ".$filename."\n"; my $ret; open FILE, "<$filename.gz"; $ret .= $_ foreach (); close FILE; if ( ! unlink "$filename.gz" ) { $logger->debug("Failed to remove `$filename.gz'"); } return $ret; } elsif($self->{mode} eq 'deflated'){ # No compression available return $content; } } sub uncompress { my ($self,$data) = @_; my $logger = $self->{logger}; # Native mode if ($self->{mode} eq 'natif') { return Compress::Zlib::uncompress($data); } elsif($self->{mode} eq 'gzip'){ # Gzip mode my ($fh, $filename) = tempfile( DIR => $self->{tmpdir}, SUFFIX => '.gz' ); print $fh $data; close $fh; system ("gzip -d $filename"); my ($uncompressed_filename) = $filename =~ /(.*)\.gz$/; my $ret; open FILE, "<$uncompressed_filename"; $ret .= $_ foreach (); close FILE; if ( ! unlink "$uncompressed_filename" ) { $logger->debug("Failed to remove `$uncompressed_filename'"); } return $ret; } elsif($self->{mode} eq 'deflated'){ # No compression available return $data; } } 1; UnixAgent-2.4.2/lib/Ocsinventory/Logger.pm000066400000000000000000000044361332737732100204650ustar00rootroot00000000000000package Ocsinventory::Logger; # TODO use Log::Log4perl instead. use Carp; sub new { my (undef, $params) = @_; my $self = {}; bless $self; $self->{backend} = []; $self->{config} = $params->{config}; $self->{debug} = $self->{config}->{debug}?1:0; my @logger; if (exists ($self->{config}->{logger})) { @logger = split /,/, $self->{config}->{logger}; } else { # if no 'logger' parameter exist I use Stderr as default backend push @logger, 'Stderr'; } my @loadedMbackends; foreach (@logger) { my $backend = "Ocsinventory::LoggerBackend::".$_; eval ("require $backend"); # TODO deal with error if ($@) { print STDERR "Failed to load Logger backend: $backend ($@)\n"; next; } else { push @loadedMbackends, $_; } my $obj = new $backend ({ config => $self->{config}, }); push @{$self->{backend}}, $obj if $obj; } my $version = "Ocsinventory unified agent for UNIX, Linux and MacOSX "; $version .= exists ($self->{config}->{VERSION})?$self->{config}->{VERSION}:''; $self->debug($version."\n"); $self->debug("Log system initialised (@loadedMbackends)"); $self; } sub log { my ($self, $args) = @_; # levels: info, debug, warn, fault my $level = $args->{level}; my $message = $args->{message}; my $header = $self->{header}; return if ($level =~ /^debug$/ && !($self->{debug})); chomp($message); #Add a header to message if needed $message="$header $message" if $header; $level = 'info' unless $level; foreach (@{$self->{backend}}) { $_->addMsg ({ level => $level, message => $message }); } confess if $level =~ /^fault$/; # Die with a backtace } sub debug { my ($self, $msg) = @_; $self->log({ level => 'debug', message => $msg}); } sub info { my ($self, $msg) = @_; $self->log({ level => 'info', message => $msg}); } sub error { my ($self, $msg) = @_; $self->log({ level => 'error', message => $msg}); } sub fault { my ($self, $msg) = @_; $self->log({ level => 'fault', message => $msg}); } sub user { my ($self, $msg) = @_; $self->log({ level => 'user', message => $msg}); } 1; UnixAgent-2.4.2/lib/Ocsinventory/LoggerBackend/000077500000000000000000000000001332737732100213705ustar00rootroot00000000000000UnixAgent-2.4.2/lib/Ocsinventory/LoggerBackend/File.pm000066400000000000000000000011221332737732100226010ustar00rootroot00000000000000package Ocsinventory::LoggerBackend::File; use strict; sub new { my (undef, $params) = @_; my $self = {}; $self->{config} = $params->{config}; $self->{logfile} = $self->{config}->{logdir}."/".$self->{config}->{logfile}; bless $self; } sub addMsg { my ($self, $args) = @_; my $level = $args->{level}; my $message = $args->{message}; return if $message =~ /^$/; open FILE, ">>".$self->{config}->{logfile} or warn "Can't open ". "`".$self->{config}->{logfile}."'\n"; print FILE "[".localtime()."][$level] $message\n"; close FILE; } 1; UnixAgent-2.4.2/lib/Ocsinventory/LoggerBackend/Stderr.pm000066400000000000000000000011211332737732100231640ustar00rootroot00000000000000package Ocsinventory::LoggerBackend::Stderr; sub new { my (undef, $params) = @_; my $self = {}; $self->{config} = $params->{config}; bless $self; } sub addMsg { my ($self, $args) = @_; my $level = $args->{level}; my $message = $args->{message}; return if $message =~ /^$/; # if STDERR has been hijacked, I take its saved ref my $stderr; if (exists ($self->{config}->{savedstderr})) { $stderr = $self->{config}->{savedstderr}; } else { open ($stderr, ">&STDERR"); } print $stderr "[$level] $message\n"; } 1; UnixAgent-2.4.2/lib/Ocsinventory/LoggerBackend/Syslog.pm000066400000000000000000000010111332737732100231770ustar00rootroot00000000000000package Ocsinventory::LoggerBackend::Syslog; # Not tested yet! use Sys::Syslog qw( :DEFAULT setlogsock); sub new { my (undef, $params) = @_; my $self = {}; openlog("ocs-agent",'cons.pid', $params->{config}->{logfacility}); syslog('debug', 'syslog backend enabled'); bless $self; } sub addMsg { my (undef, $args) = @_; my $level = $args->{level}; my $message = $args->{message}; return if $message =~ /^$/; syslog('info', $message); } sub destroy { closelog(); } 1; UnixAgent-2.4.2/memconf000077500000000000000000014057011332737732100150130ustar00rootroot00000000000000#!/usr/bin/env perl # # !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! # MODIFY THE LOCATION TO THE FULL PATH TO PERL ABOVE IF NECESSARY # !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! # # @(#) memconf - Identify sizes of memory modules installed on a # @(#) Solaris, Linux, FreeBSD or HP-UX workstation or server. # @(#) Micron Technology, Inc. - Tom Schmidt 16-Nov-2017 V3.14 # # Maintained by Tom Schmidt (tschmidt@micron.com) # # Check http://sourceforge.net/projects/memconf/ or my website at # http://www.4schmidts.com/unix.html to get the latest version of memconf. # # If memconf does not recognize a system, then please run 'memconf -D' to # have it automatically E-mail me the information I need to enhanced to # recognize it. If the unrecognized system is a Sun clone, please also send # any hardware documentation on the memory layout that you may have. # # Usage: memconf [ -v | -D | -h ] [explorer_dir] # -v verbose mode # -D E-mail results to memconf maintainer # -h print help # explorer_dir Sun/Oracle Explorer output directory # # memconf reports the size of each SIMM/DIMM memory module installed in a # system. It also reports the system type and any empty memory sockets. # In verbose mode, it also reports the following information if available: # - banner name, model and CPU/system frequencies # - address range and bank numbers for each module # # memconf is free software; you can redistribute it and/or modify it under # the terms of the GNU General Public License as published by the Free # Software Foundation; either version 2 of the License, or (at your option) # any later version. # # Original version based on SunManagers SUMMARY by Howard Modell # (h.modell@ieee.org) on 29-Jan-1997. # # Tested to work on 32-bit and 64-bit kernels on: # - Solaris 10 6/06 or later on x86 with /usr/platform/i86pc/sbin/prtdiag # - Linux on SPARC with sparc-utils and /dev/openprom # - Linux on x86 and x86_64 with kernel-utils or pmtools for dmidecode # - FreeBSD on x86 and x86_64 with dmidecode # - Most HP-UX systems with SysMgmtPlus (cprop) or Support Tools Manager (cstm) # - Solaris (SunOS 4.X or 5.X) on the following SPARC systems # - sun4c Sun SS1, SS2, IPC, IPX, ELC with Open Boot PROM V2.X # - sun4m Sun 4/6x0, SS4, SS5, SS10, SS20, LX/ZX, Classic, Voyager, JavaEngine1 # - sun4d Sun SPARCserver-1000, 1000E, SPARCcenter-2000, 2000E # - sun4u Sun Ultra 1, 2, 5, 10, 30, 60, 450 # - sun4u Sun Ultra 80, Ultra Enterprise 420R, and Netra t1400/1405. # - sun4u Sun Ultra Enterprise 220R, 250, 450 # - sun4u Sun Ultra Enterprise 3000, 3500, 4000/5000, 4500/5500, 6000, 6500 # - sun4u1 Sun Ultra Enterprise 10000 # - sun4u Sun StorEdge N8400 and N8600 Filer # - sun4u Sun SPARCengine Ultra AX, AXi, AXmp, AXmp+, AXe # - sun4u Sun SPARCengine CP 1400, CP 1500, CP2140 # - sun4u Sun Netra t1 100/105, t1120/1125, ft1800, X1, T1 200, AX1105-500, 120 # - sun4u Sun Netra 20 (Netra T4) # - sun4u Sun Netra ct800 # - sun4u Sun Blade 100, 150, 1000, 1500, 2000, 2500 # - sun4u Sun Fire 280R # - sun4u Sun Fire 3800, 4800, 4810, 6800 # - sun4u Sun Fire V100, V120, V210, V240, V250, V440 # - sun4u Sun Netra 210, 240, 440 # - sun4u Sun Fire V125, V215, V245, V445 # - sun4u Sun Fire V480, V490, V880, V880z, V890 # - sun4u Sun Fire 12000, 15000, E20K, E25K # - sun4u Sun Fire V1280, Netra 1280 (Netra T12) # - sun4u Sun Fire E2900, E4900, E6900 # - sun4u Sun Fire B100s Blade Server # - sun4u Sun Ultra 25 Workstation # - sun4u Sun Ultra 45 Workstation # - sun4u Sun/Fujitsu Siemens SPARC Enterprise M3000, M4000, M5000, M8000, # and M9000 Server # - sun4v Sun Fire T2000, T1000, Netra T2000 # - sun4v Sun Blade T6300, T6320, T6340 # - sun4v Sun SPARC Enterprise T2000, T1000 Server # - sun4v Sun SPARC Enterprise T5120, T5140, T5220, T5240 Server, Netra T5220 # - sun4v Sun SPARC Enterprise T5440 Server, Netra T5440 # - sun4v Oracle SPARC T3-1, T3-1B, T3-2, T4-1, T4-2, T4-4, T5-2, T5-4, T7-4 # - sun4v Oracle SPARC S7-2, S7-2L # - sun4v Fujitsu SPARC M10-1, M10-4 # - sun4m Tatung COMPstation 5, 10, 20AL, 20S and 20SL clones # - sun4m transtec SPARCstation 20I clone # - sun4m Rave Axil-255 SPARCstation 5 clone # - sun4m Rave Axil-245, 311 and 320 clones (no verbose output) # - sun4u AXUS Ultra 250 # - sun4u Tatung COMPstation U2, U60 and U80D clones # - Force Computers SPARC clones (no verbose output) # - Tadpole SPARCbook 3 and RDI PowerLite-170 (no verbose output) # - Tadpole VoyagerIIi # - Tadpole (Cycle) 3200 CycleQUAD Ultra 2 upgrade motherboard # - Tadpole (Cycle) UP-520-IIi SPARCstation 5/20 upgrade motherboard # - Tadpole SPARCle # - Auspex 7000/650 (no verbose output) # - Fujitsu S-4/10H, S-4/20L and S-4/20H clones (no verbose output) # - Fujitsu GP7000, GP7000F # - Fujitsu Siemens PrimePower 200, 400, 600, 800, 1000, 2000 # - Fujitsu Siemens PrimePower 250, 450, 650, 850 # - Fujitsu Siemens PrimePower 900, 1500, 2500, HPC2500 # - Twinhead TWINstation 5G, 20G # - Detects VSIMMs for SX graphics on SS10SX/SS20 (1st VSIMM only) # - Detects Prestoserve NVSIMMs on SS10/SS20/SS1000/SC2000 # # Untested systems that should work: # - sun4c Sun SS1+ with Open Boot PROM V2.X # - sun4m Tatung COMPstation 20A clone # - sun4u Sun Netra ct400, ct410, ct810 # - sun4u Sun SPARCengine CP2040, CP2060, CP2080, CP2160 # - sun4v Sun Netra CP3260 # - sun4v Oracle SPARC T3-1BA, T3-4, T4-1B, T4-2B, T5-8, T5-1B, T7-1, T7-2 # - sun4v Oracle SPARC M5-32, M6-32, M7-8, M7-16 # - sun4v Oracle Netra SPARC T3 systems # - sun4v Fujitsu SPARC M10-4S # - May not work properly on Sun clones # # Won't work on: # - SPARC systems without /dev/openprom # - sun4c Sun SS1, SS1+, SLC, IPC with Open Boot PROM V1.X (no 'memory' lines # in devinfo/prtconf output) # - sun4 kernel architecture, and sun3 and older systems # - Perl 5.001 is known to have problems with hex number conversions # - Does not detect unused VSIMMs (another FB installed) or second VSIMM # # To Do list and Revision History can be found on the maintainers web site at # http://www.4schmidts.com/unix.html # Uncomment for debugging (perl 5 only) #use diagnostics; $^W=1; # Enables -w warning switch, put here for SunOS4 compatibility. $starttime=(times)[0]; $version="V3.14"; $version_date="16-Nov-2017"; $URL="http://sourceforge.net/projects/memconf/"; $newpath="/usr/sbin:/sbin:/bin:/usr/bin:/usr/ucb:/usr/local/bin:/var/local/bin"; $ENV{PATH}=(defined($ENV{PATH})) ? "$newpath:$ENV{PATH}" : $newpath; # Force C locale so that output is in English $ENV{LC_ALL}="C"; $_=$]; ($PERL_VERSION_MAJOR)=/(\d).*/; if ($PERL_VERSION_MAJOR < 5) { ($PERL_VERS)=/(\d\.\d)/; ($PERL_PATCH)=/(\d*)$/; $PERL_PATCH="0$PERL_PATCH" if ($PERL_PATCH < 10); $PERL_VERSION="$PERL_VERS$PERL_PATCH"; } else { ($PERL_VERSION)=/(\d\.\d{3}).*/; } $uname="/usr/bin/uname"; $uname="/bin/uname" if (-x '/bin/uname'); $running_on=""; if (-x $uname) { $os=&mychomp(`$uname`); $os="FreeBSD-based $os" if ($os ne "FreeBSD" && -f '/etc/freebsd-update.conf'); $running_on=$os; $hostname=&mychomp(`$uname -n`); if ($os eq "AIX") { $machine=&mychomp(`$uname -M`); # oslevel command can return stderr output, so use uname instead $osmajor=&mychomp(`$uname -v`); $osminor=&mychomp(`$uname -r`); $osrel="$osmajor.$osminor"; $kernver=""; $platform=&mychomp(`$uname -p`); } else { $machine=&mychomp(`$uname -m`); $osrel=&mychomp(`$uname -r`); $kernver=&mychomp(`$uname -v`); $platform=$machine; } } else { $hostname=""; $machine=""; $os="this unsupported"; $osrel=""; $kernver=""; } $osrelease=""; $prtdiag_cmd=""; $prtdiag_exec=""; $have_prtdiag_data=0; $prtdiag_checked=0; $prtdiag_memory=0; $prtfru_cmd=""; $have_prtfru_data=0; $have_prtfru_details=0; $missing_prtfru_details=" "; $prtpicl_cmd=""; $have_prtpicl_data=0; $psrinfo_cmd=""; $have_psrinfo_data=0; $use_psrinfo_data=1; $psrinfo_checked=0; $virtinfo_cmd=""; $have_virtinfo_data=0; $virtinfoLDOMcontrolfound=0; $cfgadm_cmd=""; $have_cfgadm_data=0; $ipmitool_cmd=""; $have_ipmitool_data=0; $ipmi_cpucnt=0; $ipmi_cputype=""; @ipmi_mem=(""); $ipmi_memory=0; $smbios_cmd=""; $have_smbios_data=0; @smbios_mem=(""); $smbios_memory=0; $kstat_cmd=""; $have_kstat_data=0; @kstat_brand=(); @kstat_MHz=(); $kstat_cpubanner=""; @kstat_core_id=(""); @kstat_core=(""); @kstat_ncore_per_chip=(""); @kstat_ncpu_per_chip=(""); $kstat_checked=0; $ldm_cmd=""; $have_ldm_data=0; $ldm_memory=0; $free_cmd=""; $free_checked=""; $have_free_data=0; $meminfo_cmd=""; $have_meminfo_data=0; $modprobe_eeprom_cmd=""; $decodedimms_cmd=""; $decodedimms_checked=""; $have_decodedimms_data=0; @reorder_decodedimms=(); $topology_cmd=""; @topology_header=(); @topology_data=(); $topology_mfg=""; $maxmembusspeed=""; $foundspeed=0; $mixedspeeds=0; $have_x86_devname=0; $manufacturer=""; $systemmanufacturer=""; $boardmanufacturer=""; $baseboard=""; $biosvendor=""; if (-d '/usr/platform') { $platform=&mychomp(`$uname -i`); if (-x "/usr/platform/$platform/sbin/prtdiag") { $prtdiag_cmd="/usr/platform/$platform/sbin/prtdiag"; } elsif (-x "/usr/platform/$machine/sbin/prtdiag") { $prtdiag_cmd="/usr/platform/$machine/sbin/prtdiag"; } elsif (-x '/usr/sbin/prtdiag') { $prtdiag_cmd="/usr/sbin/prtdiag"; } } elsif (-x '/usr/kvm/prtdiag') { $platform=$machine; $prtdiag_cmd='/usr/kvm/prtdiag'; } elsif (-x '/usr/sbin/prtdiag') { $platform=&mychomp(`$uname -i`); $prtdiag_cmd="/usr/sbin/prtdiag"; } if ($prtdiag_cmd) { if (-x $prtdiag_cmd) { $prtdiag_exec="$prtdiag_cmd"; } } $buffer=""; $filename=""; $installed_memory=0; $failed_memory=0; $spare_memory=0; $failing_memory=0; $memory_error_logged=0; $failed_fru=""; $ultra=0; $simmbanks=0; $bankcnt=0; $slot0=0; $smallestsimm=16777216; $largestsimm=0; $found8mb=0; $found16mb=0; $found32mb=0; $found10bit=0; $found11bit=0; $foundbank1or3=0; $sxmem=0; $nvmem=0; $nvmem1=0; $nvmem2=0; $memtype="SIMM"; $sockettype="socket"; $verbose=0; $debug=0; $recognized=1; $untested=1; $untested_type=""; $perlhexbug=0; $exitstatus=0; $meg=1048576; @socketstr=(""); @socketlabelstr=(""); @orderstr=(""); @groupstr=(""); @bankstr=(""); @banksstr=(""); $bankname="banks"; @bytestr=(""); @slotstr=(""); $simmrangex=0; $simmrange=1; $showrange=1; $start1x=""; $stop1x=""; @simmsizes=(0,16777216); @simmsizesfound=(); @memorylines=(""); $socket=""; $socketlabel=""; $order=""; $group=""; $slotnum=""; $bank=""; $dualbank=0; $byte=""; $gotmemory=""; $gotmodule=""; $gotmodulenames=""; $gotcpunames=""; $gotcpuboards=""; $slotname0=""; @boards_cpu=""; @boards_mem=""; $empty_banks=""; $banks_used=""; $nvsimm_banks=""; $boardslot_cpu=" "; $boardslot_cpus=" "; @boardslot_cpus=(); $boardslot_mem=" "; $boardslot_mems=" "; @boardslot_mems=(); $boardfound_cpu=0; $boardfound_mem=0; $prtdiag_has_mem=0; $prtdiag_banktable_has_dimms=0; $prtdiag_failed=0; $prtconf_warn=""; $flag_cpu=0; $flag_mem=0; $flag_rewrite_prtdiag_mem=0; $format_cpu=0; $format_mem=0; $foundname=0; $sockets_used=""; $sockets_empty=""; $sortslots=1; $devtype=""; $interleave=0; $stacked=0; $freq=0; $sysfreq=0; $cpufreq=0; $cputype=""; $cputype_prtconf=""; $cputype_psrinfo=""; $cpuinfo_cputype=""; @cpucnt=(); $cpucntfrom=""; $cpucntflag=0; $cpuinfo_cpucnt=0; $have_cpuinfo_data=0; $cpuinfo_coreidcnt=0; $cpuinfo_cpucores=0; @cpuinfo_physicalid=(); $cpuinfo_physicalidcnt=0; $cpuinfo_siblings=0; $cpuinfo_checked=0; $xm_info_cmd=""; $have_xm_info_data=0; $xen_ncpu=0; $xen_nr_nodes=0; $xen_sockets_per_node=0; $xen_cores_per_socket=0; $foundGenuineIntel=0; @diagcpucnt=(); $diagthreadcnt=0; $psrcpucnt=0; $foundpsrinfocpu=0; $ncpu=0; # remains 0 if using prtdiag output only $ndcpu=0; # prtdiag cpu count $npcpu=0; # physical cpu count $nvcpu=0; # virtual cpu count $necpu=0; # empty cpu socket count $threadcnt=0; $corecnt=1; $hyperthread=0; $hyperthreadcapable=0; $header_shown=0; $romver=""; $romvernum=""; $SUNWexplo=0; $banner=""; $bannermore=""; $cpubanner=""; $diagbanner=""; $model=""; $systemmodel=""; $boardmodel=""; $modelmore=""; $model_checked=0; $BSD=0; # Initially assume SunOS 5.X $config_cmd="/usr/sbin/prtconf -vp"; $config_command="prtconf"; $config_permission=0; $permission_error=""; $dmidecode_error=""; $freephys=0; $isX86=0; $HPUX=0; $devname=""; # Sun internal development code name $familypn=""; # Sun family part number (system code) $clone=0; $totmem=0; $latest_dmidecode_ver="2.12"; $minimum_dmidecode_ver="2.8"; $dmidecode_ver="0"; $dmidecodeURL="http://www.nongnu.org/dmidecode/"; $have_dmidecode=0; $cpuarr=-1; $memarr=-1; $release=""; $waitshown=0; $totalmemshown=0; $vmshown=0; $controlLDOMshown=0; $helpers_defined=0; $picl_foundmemory=0; @picl_mem_pn=(); @picl_mem_bank=(); @picl_mem_dimm=(); if (-x '/usr/bin/id') { $uid=&mychomp(`/usr/bin/id`); $uid=~s/uid=//; $uid=~s/\(.*//; } else { $uid=0; # assume super-user } $empty_memory_printed=0; @filelist=(); # # Parse options # foreach $name (@ARGV) { if ($name eq "-v") { # verbose mode $verbose=1; } elsif ($name eq "-d") { # more verbose debug mode $verbose=2; } elsif ($name eq "-debug") { # most verbose debug mode $debug=1; } elsif ($name eq "-debugtime") { # most verbose debug mode with timestamps $debug=2; } elsif ($name eq "-D") { # E-mail information of system to maintainer $verbose=3; open(MAILFILE, ">/tmp/memconf.output") || die "can't open /tmp/memconf.output: $!"; print MAILFILE "Output from 'memconf -d' on $hostname\n"; print MAILFILE "----------------------------------------------------\n"; close(MAILFILE); *STDERR = *STDOUT; # Redirect stderr to stdout open(STDOUT, "| tee -a /tmp/memconf.output") || die "can't open /tmp/memconf.output: $!"; print "Gathering memconf data to E-mail to maintainer. This may take a few minutes.\nPlease wait...\n"; } elsif (-f "$name/sysconfig/prtconf-vp.out") { # Sun/Oracle Explorer output $SUNWexplo=1; # Special case for regression testing Sun/Oracle Explorer data $os="SunOS"; open(FILE, "<$name/sysconfig/prtconf-vp.out"); @config=; close(FILE); if (-f "$name/sysconfig/prtdiag-v.out") { open(FILE, "<$name/sysconfig/prtdiag-v.out"); @prtdiag=; $have_prtdiag_data=1; $prtdiag_cmd="/usr/platform/$platform/sbin/prtdiag"; $prtdiag_exec="$prtdiag_cmd"; close(FILE); } if (-f "$name/fru/prtfru_-x.out") { open(FILE, "<$name/fru/prtfru_-x.out"); @prtfru=; $have_prtfru_data=1; $prtfru_cmd='/usr/sbin/prtfru'; close(FILE); } if (-f "$name/sysconfig/prtpicl-v.out") { open(FILE, "<$name/sysconfig/prtpicl-v.out"); @prtpicl=; $have_prtpicl_data=1; $prtpicl_cmd='/usr/sbin/prtpicl'; close(FILE); } if (-f "$name/sysconfig/psrinfo-v.out") { open(FILE, "<$name/sysconfig/psrinfo-v.out"); @psrinfo=; $have_psrinfo_data=1; $psrinfo_cmd='/usr/sbin/psrinfo'; close(FILE); } # Sun/Oracle Explorer does not include "psrinfo -p" or # "psrinfo -p -v" data yet. # Is virtinfo output available in Oracle Explorer? if (-f "$name/sysconfig/cfgadm-alv.out") { open(FILE, "<$name/sysconfig/cfgadm-alv.out"); @cfgadm=; $have_cfgadm_data=1; $cfgadm_cmd='/usr/sbin/cfgadm'; close(FILE); } if (-f "$name/sysconfig/uname-a.out") { open(FILE, "<$name/sysconfig/uname-a.out"); $uname=&mychomp(); close(FILE); @unamearr=split(/\s/, $uname); $hostname=$unamearr[1]; $machine=$unamearr[4]; $osrel=$unamearr[2]; $platform=$unamearr[6]; $prtdiag_cmd="/usr/platform/$platform/sbin/prtdiag"; $prtdiag_exec="$prtdiag_cmd"; } else { if ($config[0] =~ /System Configuration:/) { @machinearr=split(/\s+/, $config[0]); $machine=$machinearr[4]; } $osrel=""; $hostname=""; } if (-f "$name/sysconfig/prtconf-V.out") { open(FILE, "<$name/sysconfig/prtconf-V.out"); $romver=&mychomp(); close(FILE); } $filename="$name"; } elsif (-f $name) { # Regression test file with prtconf/dmidecode output open(FILE, "<$name"); @config=; close(FILE); # Regression test file may also have prtdiag, etc. @prtdiag=@config; @prtfru=@config; $have_prtfru_data=1; @prtpicl=@config; $have_prtpicl_data=1; @psrinfo=@config; $have_psrinfo_data=1; @virtinfo=@config; $have_virtinfo_data=1; @cfgadm=@config; $have_cfgadm_data=1; @ipmitool=@config; $have_ipmitool_data=1; @ldm=@config; $have_ldm_data=1; @cpuinfo=@config; $have_cpuinfo_data=1; @meminfo=@config; $have_meminfo_data=1; @free=@config; $have_free_data=1; @xm_info=@config; $have_xm_info_data=1; @decodedimms=@config; @smbios=@config; $have_smbios_data=1; @kstat=@config; $have_kstat_data=1; @machinfo=@config; $hostname=""; $osrel=""; # Check test file to determine OS and machine for ($val=0; $val <= $#config; $val++) { if ($config[$val]) { if ($config[$val] =~ /System Configuration:/) { @machinearr=split(/\s+/, $config[$val]); $machine=$machinearr[4]; $machine="" if (! defined($machine)); $platform=$machine; # Special case for regression testing SunOS prtconf files $os="SunOS"; last; } elsif ($config[$val] =~ / dmidecode |DMI .* present/) { $have_dmidecode=1; if ($config[$val] =~ / dmidecode /) { $dmidecode_ver=&mychomp($config[$val]); $dmidecode_ver=~s/.* dmidecode //; } $machine=""; $platform=""; # Special case for regression testing Linux dmidecode files $os="Linux"; last; } } } $filename="$name"; } else { &show_help; } } &pdebug("starting"); print "memconf: $version $version_date $URL\n" if (-t STDOUT || $verbose); &find_helpers; if (! $filename && -r '/proc/cpuinfo') { open(FILE, "/proc/cpuinfo"); @cpuinfo=; close(FILE); $have_cpuinfo_data=1; } if (! $filename && $xm_info_cmd) { @xm_info=&run("$xm_info_cmd"); $have_xm_info_data=1; } # Check cpuinfo now on unsupported machines (arm, mips, etc.) &check_cpuinfo if (! $filename && $machine !~ /.86|ia64|amd64|sparc/); &check_free; &check_dmidecode if ($have_dmidecode); if (! $filename) { if ($os eq "HP-UX") { &hpux_check; if (-x '/opt/propplus/bin/cprop') { &hpux_cprop; } elsif (-x '/usr/sbin/cstm') { &hpux_cstm; } else { &show_header; &show_supported; } } elsif ($os =~ /Linux|FreeBSD/) { &linux_distro if (! $release); if ($machine =~ /arm/i) { if (-f '/etc/Alt-F' && -f '/tmp/board') { # NAS model open(FILE, "); close(FILE); } elsif (-f '/etc/model') { # DLink NAS model open(FILE, "); close(FILE); } } # Use dmidecode for Linux x86, not for Linux SPARC &check_dmidecode if ($config_cmd =~ /dmidecode/ && -x "$config_cmd" && ($machine =~ /.86/ || ! -x '/usr/sbin/prtconf')); if ($machine =~ /.86/ || ! -e '/dev/openprom') { &show_header; &show_supported; } } elsif ($os ne "SunOS") { &show_header; &show_supported; } if (-f '/vmunix') { # SunOS 4.X (Solaris 1.X) $BSD=1; if (! -x '/usr/etc/devinfo') { print "ERROR: no 'devinfo' command. Aborting.\n"; &pdebug("exit 1"); exit 1; } $config_cmd="/usr/etc/devinfo -pv"; $config_command="devinfo"; } else { # Solaris 2.X or later $BSD=0; if (! -x '/usr/sbin/prtconf') { print "ERROR: no 'prtconf' command. Aborting.\n"; &pdebug("exit 1"); exit 1; } $config_cmd="/usr/sbin/prtconf -vp"; $config_command="prtconf"; } } else { # Special case for regression testing SunOS4 and SunOS5 files if ($filename =~ /\bdevinfo\./) { $os="SunOS"; $BSD=1; } elsif ($filename =~ /\bprtconf\./) { $os="SunOS"; $BSD=0; } # Special case for regression testing Linux files $os="Linux" if ($filename =~ /Linux/); # Special case for regression testing HP-UX files if ($filename =~ /\bcprop[\.+]/) { &hpux_check; &hpux_cprop; } elsif ($filename =~ /\b(cstm|machinfo)[\.+]/) { &hpux_check; &hpux_cstm; } } $kernbit=""; $hasprtconfV=0; $solaris=""; $solaris="1.0" if ($osrel eq "4.1.1"); $solaris="1.0.1" if ($osrel eq "4.1.2"); $solaris="1.1" if ($osrel =~ /4.1.3/); $solaris="1.1.1" if ($osrel eq "4.1.3_U1"); $solaris="1.1.2" if ($osrel eq "4.1.4"); if ($osrel =~ /^5./) { $osminor=$osrel; $osminor=~s/^5.//; if ($SUNWexplo) { if (-f "$filename/etc/release") { open(FILE, "<$filename/etc/release"); $release=; close(FILE); } } else { if (-f '/etc/release') { open(FILE, "; close(FILE); } } if ($release =~ "Solaris") { $release=~s/\s+//; $release=&mychomp($release); $solaris="$release"; } if ($release =~ "OmniOS") { $release=~s/\s+//; $release=&mychomp($release); $solaris="$release"; } if ($osminor =~ /^[7-9]$|^1[0-9]$/) { $hasprtconfV=1; $solaris=$osminor if (! $solaris); $kernbit=32; if ($SUNWexplo) { $cpuarch=""; if (-f "$filename/sysconfig/isainfo.out") { open(FILE, "<$filename/sysconfig/isainfo.out"); $cpuarch=; close(FILE); } elsif (-f "$filename/sysconfig/isainfo-kv.out") { open(FILE, "<$filename/sysconfig/isainfo-kv.out"); $cpuarch=; close(FILE); } $kernbit=64 if ($cpuarch =~ /sparcv9|ia64|amd64/); } elsif (-x '/bin/isainfo') { $kernbit=&mychomp(`/bin/isainfo -b`); } } elsif ($osminor =~ /^[4-6]$/) { $hasprtconfV=1; $solaris="2.$osminor" if (! $solaris); } else { $solaris="2.$osminor"; } # x86 Solaris 2.1 through 2.5.1 has different syntax than SPARC $config_cmd="/usr/sbin/prtconf -v" if ($machine eq "i86pc" && $osminor =~ /^[1-5]$/); # Solaris x86 returns booting system rather than PROM version $hasprtconfV=0 if ($machine eq "i86pc"); } if (! $filename) { @config=&run("$config_cmd"); if ($hasprtconfV) { # SPARC Solaris 2.4 or later $romver=&mychomp(`/usr/sbin/prtconf -V 2>&1`); if ($romver eq "Cannot open openprom device") { $prtconf_warn="ERROR: $romver"; $romver=""; } else { @romverarr=split(/\s/, $romver); $romvernum=$romverarr[1]; } } else { # SPARC Solaris 2.3 or older, or Solaris x86 # Try to use sysinfo if installed to determine the OBP version. # sysinfo is available from http://www.MagniComp.com/sysinfo/ close(STDERR) if ($verbose != 3); $romver=`sysinfo -show romver 2>/dev/null | tail -1`; open(STDERR) if ($verbose != 3); if ($romver) { $romver=&mychomp($romver); @romverarr=split(/\s/, $romver); $romver=$romverarr[$#romverarr]; } else { # Assume it is old $romver="2.X" if ($machine =~ /sun4/); } $romvernum=$romver; } } if ($filename && $have_prtpicl_data && ! $SUNWexplo) { foreach $line (@prtpicl) { $line=&dos2unix($line); $line=&mychomp($line); $line=~s/\s+$//; # Parse osrel and hostname from prtpicl data if ($line =~ /\s+:OS-Release\s/) { $osrel=$line; $osrel=~s/^.*:OS-Release\s+(.*)$/$1/; if ($osrel =~ /^5./) { $osminor=$osrel; $osminor=~s/^5.//; if ($osminor =~ /^[7-9]$|^1[0-9]$/) { $solaris=$osminor; # Solaris 10 SPARC and later is 64-bit $kernbit=64 if ($osminor =~ /^1[0-9]$/ && $machine =~ /sun4/); } else { # Solaris 2.6 and earlier is 32-bit $solaris="2.$osminor"; $kernbit=32; } if ($machine =~ /86/) { $solaris .= " X86" if ($solaris !~ / X86/); # Solaris 9 X86 and earlier is 32-bit $kernbit=32 if ($osminor =~ /^[7-9]$/); } elsif ($machine =~ /sun4/) { $solaris .= " SPARC" if ($solaris !~ / SPARC/); $kernbit=32 if ($machine =~ /sun4[cdm\b]/); } } } if ($line =~ /\s+:HostName\s/) { $hostname=$line; $hostname=~s/^.*:HostName\s+(.*)$/$1/; } } } sub please_wait { return if ($waitshown); $waitshown=1; print "Gathering data for memconf. This may take over a minute. Please wait...\n" if (-t STDOUT); } sub find_helpers { return if ($helpers_defined); $helpers_defined=1; if ($os eq "HP-UX") { $config_cmd="echo 'selclass qualifier cpu;info;wait;selclass qualifier memory;info;wait;infolog'|/usr/sbin/cstm"; } elsif ($os =~ /Linux|FreeBSD/) { if (defined($ENV{DMIDECODE}) && -x $ENV{DMIDECODE}) { # this may be a setuid-root version of dmidecode $config_cmd=$ENV{DMIDECODE}; } else { foreach $bin ('/usr/local/sbin','/usr/local/bin','/usr/sbin','/usr/bin','/bin') { if (-x "$bin/dmidecode") { $config_cmd="$bin/dmidecode"; last; } } } } elsif (-x '/usr/sbin/prtconf') { # Solaris 2.X or later $config_cmd="/usr/sbin/prtconf -vp"; $prtfru_cmd='/usr/sbin/prtfru' if (-x '/usr/sbin/prtfru'); $prtpicl_cmd='/usr/sbin/prtpicl' if (-x '/usr/sbin/prtpicl'); $psrinfo_cmd='/usr/sbin/psrinfo' if (-x '/usr/sbin/psrinfo'); $virtinfo_cmd='/usr/sbin/virtinfo' if (-x '/usr/sbin/virtinfo'); $cfgadm_cmd='/usr/sbin/cfgadm' if (-x '/usr/sbin/cfgadm'); $smbios_cmd='/usr/sbin/smbios' if (-x '/usr/sbin/smbios'); $kstat_cmd='/usr/bin/kstat -m cpu_info' if (-x '/usr/bin/kstat'); $ldm_cmd='/opt/SUNWldm/bin/ldm' if (-x '/opt/SUNWldm/bin/ldm'); } if ($os =~ /Linux|FreeBSD/) { $free_cmd='/usr/bin/free -m' if (-x '/usr/bin/free'); $meminfo_cmd='cat /proc/meminfo' if (-r '/proc/meminfo' || $running_on !~ /Linux|FreeBSD/); $topology_cmd='/usr/bin/topology --summary --nodes --cpus --io --routers' if (-x '/usr/bin/topology' || $running_on !~ /Linux|FreeBSD/); if (&is_xen_hv) { $xm_info_cmd='/usr/sbin/xm info'; $xm_info_cmd='/usr/bin/xm info' if (-x '/usr/bin/xm'); } if (-x '/usr/bin/decode-dimms.pl' || $running_on !~ /Linux|FreeBSD/) { $modprobe_eeprom_cmd='/sbin/modprobe eeprom'; $decodedimms_cmd='/usr/bin/decode-dimms.pl'; } } if ($os =~ /SunOS|Linux|FreeBSD/) { if (defined($ENV{IPMITOOL}) && -x $ENV{IPMITOOL}) { # this may be a setuid-root version of ipmitool $ipmitool_cmd=$ENV{IPMITOOL}; } else { foreach $bin ('/usr/sfw/bin','/usr/local/sbin','/usr/local/bin','/usr/sbin','/usr/bin','/bin') { if (-x "$bin/ipmitool") { $ipmitool_cmd="$bin/ipmitool"; last; } } } } } sub show_helpers { $s=shift; # Prefer prtconf for Linux SPARC if ($machine =~ /sun|sparc/i || $filename =~ /LinuxSPARC/) { print "$s/usr/sbin/prtconf -vp\n"; print "$s$config_cmd\n" if ($config_cmd =~ /dmidecode/ && -x "$config_cmd"); } else { print "$s$config_cmd\n" if ($config_cmd); } if ($os eq "SunOS") { print "$s$prtdiag_cmd -v\n" if ($prtdiag_exec); print "$s$prtfru_cmd -x\n" if ($prtfru_cmd); print "$s$prtpicl_cmd -v\n" if ($prtpicl_cmd); if ($psrinfo_cmd) { print "$s$psrinfo_cmd -v\n"; $tmp=&mychomp(`$psrinfo_cmd -p 2>/dev/null`); if ($tmp ne "") { print "$s$psrinfo_cmd -p\n"; print "$s$psrinfo_cmd -p -v\n"; } } print "$s$virtinfo_cmd -pa\n" if ($virtinfo_cmd); print "$s$cfgadm_cmd -al\n" if ($cfgadm_cmd); print "$s$smbios_cmd\n" if ($smbios_cmd); print "$s$kstat_cmd\n" if ($kstat_cmd); print "$s$ldm_cmd list-devices -a -p\n" if ($ldm_cmd); } if ($os =~ /Linux|FreeBSD/) { print "${s}cat /proc/cpuinfo\n" if (-r '/proc/cpuinfo' || $running_on !~ /Linux|FreeBSD/); print "${s}cat /proc/meminfo\n" if (-r '/proc/meminfo' || $running_on !~ /Linux|FreeBSD/); print "$s$free_cmd\n" if ($free_cmd); print "${s}/usr/bin/topology\n" if (-x '/usr/bin/topology' || $running_on !~ /Linux|FreeBSD/); print "$s$xm_info_cmd\n" if ($xm_info_cmd); print "${s}/usr/bin/xenstore-ls /local/domain/DOMID\n" if (-x '/usr/bin/xenstore-ls' || $running_on !~ /Linux|FreeBSD/); print "$s$modprobe_eeprom_cmd; $decodedimms_cmd\n" if ($decodedimms_cmd); } if ($os =~ /SunOS|Linux|FreeBSD/) { print "$s$ipmitool_cmd fru\n" if ($ipmitool_cmd && $running_on eq $os); } if ($os eq "HP-UX") { print "$s/usr/contrib/bin/machinfo\n" if (-x '/usr/contrib/bin/machinfo'); } } sub show_help { &find_helpers; if ($os =~ /Linux|FreeBSD/ && $config_cmd =~ /prtconf/) { if ($machine =~ /.86|ia64|amd64|sparc/) { $config_cmd="dmidecode"; } else { $config_cmd=""; } } print "Usage: memconf [ -v | -D | -h ] [explorer_dir]\n"; print " -v verbose mode\n"; print " -D E-mail results to memconf maintainer\n"; print " -h print help\n"; print " explorer_dir Sun/Oracle Explorer output directory\n"; print "\nThis is memconf, $version $version_date\n\nCheck my website "; print "at $URL to get the latest\nversion of memconf.\n\n"; &show_supported if ($os !~ /SunOS|HP-UX|Linux|FreeBSD/); print "Please send bug reports and enhancement requests along with "; print "the output of the\nfollowing commands to tschmidt\@micron.com "; print "as E-mail attachments so that memconf\nmay be enhanced. "; print "You can do this using the 'memconf -D' command if this system\n"; print "can E-mail to the Internet.\n"; &show_helpers(" "); &pdebug("exit"); exit; } sub check_hyperthread { &pdebug("in check_hyperthread: corecnt=$corecnt"); if ($cputype =~ /Intel.*\sXeon.*\s(E5540|E5620|L5520|X5560|X5570)\b/ && (($corecnt == 8 && ! &is_xen_hv) || &is_xen_hv)) { &pdebug("hyperthread=1: hack in cpubanner, cputype=$cputype") if (! $hyperthread); $hyperthread=1; $corecnt=4; $cputype=~s/Eight.Core //ig; $cputype=&multicore_cputype($cputype,$corecnt); } if ($cputype =~ /Intel.*\sXeon.*\s(L5640|X5670|X5675)\b/ && (($corecnt == 12 && ! &is_xen_hv) || &is_xen_hv)) { &pdebug("hyperthread=1: hack in cpubanner, cputype=$cputype") if (! $hyperthread); $hyperthread=1; $corecnt=6; $cputype=~s/Twelve.Core //ig; $cputype=&multicore_cputype($cputype,$corecnt); } } sub show_hyperthreadcapable { if ($hyperthreadcapable && ! $hyperthread) { print "NOTICE: CPU"; if ($npcpu > 1) { print "s are"; } else { print " is"; } print " capable of Hyper-Threading, but it is not enabled in the BIOS.\n"; } } sub cpubanner { # Hard-code some CPU models for hyper-threading on regression tests. # Hyper-Thread detection in Solaris x86 is done earlier by check_kstat # This hard-code method assumes Hyper-Threading is enabled if the # core count matches. This is not used when kstat data is available. if ($kstat_cpubanner && $modelmore !~ /MHz\)/) { &pdebug("in cpubanner, using kstat_cpubanner for cpubanner"); $cpubanner=$kstat_cpubanner; return; } &checkX86; if ($filename && $os eq "SunOS" && $isX86 && ! $hyperthread && ! $kstat_checked) { &check_hyperthread; } elsif ($filename && &is_xen_hv) { # Xen Hypervisor hides Hyper-Threading from /proc/cpuinfo, so # also hard-core some CPU models for it. &check_hyperthread; } &pdebug("in cpubanner, corecnt=$corecnt, npcpu=$npcpu, nvcpu=$nvcpu, cputype=$cputype"); if ($modelmore =~ /\(Solaris x86 machine\)/ && ! $cpubanner && $cputype ne "x86") { $modelmore=""; while (($cf,$cnt)=each(%cpucnt)) { $cf=~/^(.*) (\d+)$/; $cputype=$1; $cpufreq=$2; } &x86multicorecnt($cputype); $ncpu=$cpucnt{"$cputype $cpufreq"}; if ($cpucntflag == 0 && $npcpu == 0) { for $tmp (2,3,4,6,8,10,12,16) { $ncpu /= $tmp if ($corecnt == $tmp && $ncpu % $tmp == 0); } } $ncpu=$npcpu if ($npcpu); $cpubanner="$ncpu X " if ($ncpu > 1); $tmp=&multicore_cputype($cputype,$corecnt); $cpubanner .= "$tmp"; $cpubanner .= " x86" if ($cputype eq "AMD"); $cpubanner .= " ${cpufreq}MHz" if ($cpufreq && $cpufreq ne "0" && $cputype !~ /Hz$/); } } sub show_header { return if ($header_shown); &pdebug("cpucntfrom=$cpucntfrom"); &cpubanner; $header_shown=1; undef %saw; @saw{@simmsizesfound}=(); @simmsizesfound=sort numerically keys %saw; print "hostname: $hostname\n" if ($hostname); if ($filename) { print (($SUNWexplo) ? "Sun/Oracle Explorer directory" : "filename"); print ": $filename\n"; } if ($manufacturer) { $manufacturer="Sun Microsystems, Inc." if ($manufacturer =~ /Sun Microsystems/i); } if ($diagthreadcnt && $cpucntfrom eq "prtdiag") { # Replace @cpucnt with @diagcpucnt while (($cf,$tmp)=each(%cpucnt)) { delete $cpucnt{"$cf"}; $cpucnt{"$cf"}=$diagcpucnt{"$cf"}; } } if ($banner) { # See if banner includes CPU information if ($banner !~ /\(.*SPARC/ && $banner !~ /MHz/ && ! $kstat_cpubanner) { @cputypecnt=keys(%cpucnt); $x=0; while (($cf,$cnt)=each(%cpucnt)) { $x++; $cf=~/^(.*) (\d*)$/; $ctype=$1; $cfreq=$2; &multicore_cpu_cnt(""); $cpubanner .= "$cnt X " if ($cnt > 1); if ($ctype =~ /390Z5/) { $cpubanner .= "SuperSPARC"; $cpubanner .= "-II" if ($cfreq > 70); } elsif ($ctype =~ /MB86907/) { $cpubanner .= "TurboSPARC-II"; } elsif ($ctype =~ /MB86904|390S10/) { $cpubanner .= "microSPARC"; $cpubanner .= "-II" if ($cfreq > 70); } elsif ($ctype =~ /L2A0925/) { $cpubanner .= "microSPARC-IIep"; } elsif ($ctype =~ /,RT62[56]/) { $cpubanner .= "hyperSPARC"; } else { $cpubanner .= "$ctype"; } $cpubanner .= " ${cfreq}MHz" if ($cfreq && $cpubanner !~ /Hz$/); $cpubanner .= ", " if ($x < scalar(@cputypecnt)); } } elsif ($banner =~ /\(/ && $banner !~ /MHz/) { # CPU listed without speed while (($cf,$cnt)=each(%cpucnt)) { $cf=~/^(.*) (\d*)$/; $cfreq=$2; $banner=~s/\)/ ${cfreq}MHz\)/g if ($cfreq); } } } $modelmore="" if ($modelmore =~ /\(Solaris x86 machine\)/ && $model ne "i86pc" && $model ne "i86xpv" && $model ne "i86xen"); if ($verbose) { if ($banner) { print "banner: $banner"; print " $bannermore" if ($bannermore); print " ($cpubanner)" if ($cpubanner); print "\n"; } if ($manufacturer) { print "manufacturer: $manufacturer\n"; } if ($model) { print "model: $model"; print " $modelmore" if ($modelmore); print " $realmodel" if ($realmodel); print " ($cpubanner)" if ($cpubanner && ! $banner); print "\n"; } if ($baseboard) { print "base board: $baseboard\n"; } if (! $clone) { $tmp="Sun"; if ($manufacturer) { $tmp="Sun/Oracle" if ($manufacturer =~ /^Oracle\b/); } $tmp="Oracle" if ($platform =~ /^ORCL,/); print "$tmp development codename: $devname\n" if ($devname); print "$tmp Family Part Number: $familypn\n" if ($familypn); } if (! $filename || $SUNWexplo) { if ($solaris) { print "Solaris " if ($solaris !~ /(Solaris|OmniOS)/); print "$solaris"; if ($machine =~ /86/) { print " X86" if ($solaris !~ / X86/); } elsif ($machine =~ /sun4/) { print " SPARC" if ($solaris !~ / SPARC/); } print ", ${kernbit}-bit kernel, " if ($kernbit); } if ($os =~ /Linux|FreeBSD/ && $release) { if (-x '/bin/busybox') { @busybox=`/bin/busybox cat --help 2>&1`; $busyboxver=""; for (@busybox) { next if (! /^BusyBox/); $busyboxver=&mychomp($_); $busyboxver=~s/\).*$/\)/; } if ($busyboxver) { print "$busyboxver, "; } else { print "BusyBox, "; } } print "$release\n"; } else { print "$os"; print " $osrel" if ($osrel); print " ($osrelease)" if ($osrelease); print ", ${kernbit}-bit kernel" if ($kernbit && $HPUX); print "\n"; } } elsif ($HPUX) { print "$os"; print " $osrel" if ($osrel); print " ($osrelease)" if ($osrelease); print ", ${kernbit}-bit kernel" if ($kernbit); print "\n"; } elsif ($os =~ /Linux|FreeBSD/) { print "BusyBox " if ($filename =~ /BusyBox/); # for regression tests if ($release) { print "$release"; } elsif ($machine =~ /sun|sparc/i || $filename =~ /LinuxSPARC/) { print "Linux SPARC"; } elsif ($machine =~ /arm/i) { print "Linux ARM"; } elsif ($machine =~ /mips/i) { print "Linux MIPS"; } elsif ($have_dmidecode) { print "Linux x86"; } print ", ${kernbit}-bit kernel" if ($kernbit); print "\n"; } elsif ($BSD) { print "Solaris 1.X SPARC, 32-bit kernel, SunOS 4.X\n"; } elsif ($osrel && $solaris) { print "Oracle " if ($solaris !~ /Oracle/ && $platform =~ /^ORCL,/); print "Solaris " if ($solaris !~ /(Solaris|OmniOS)/); print "$solaris, "; print "${kernbit}-bit kernel, " if ($kernbit); print "SunOS $osrel\n"; } else { print "Solaris 2.X"; if ($machine =~ /86/) { print " X86"; } elsif ($machine =~ /sun4/) { print " SPARC"; } print ", SunOS 5.X\n"; } $ncpu=1 if ($ncpu == 0); # It has at least 1 CPU if ($kstat_cpubanner) { $tmp=$kstat_cpubanner; $tmp=~s/(\d) X /$1 /g; print "1 " if ($tmp eq $kstat_cpubanner); print "$tmp cpu"; print "s" if ($tmp ne $kstat_cpubanner); print (($sysfreq) ? ", " : "\n"); } elsif ($cpuarr == -1 && ! &is_xen_vm) { @cputypecnt=keys(%cpucnt); $x=0; $ctype=""; while (($cf,$cnt)=each(%cpucnt)) { if ($cpucntflag == 0 && $npcpu == 0 && $cpucntfrom ne "prtdiag") { for $tmp (2,3,4,6,8,10,12,16) { $cnt /= $tmp if ($corecnt == $tmp && $cnt % $tmp == 0); } $cpucntflag=1; } if ($npcpu) { $cnt=$npcpu; } else { $cnt=$ndcpu if ($ndcpu); $cnt=$ncpu if ($cpucntfrom =~ /cpuinfo/); } $x++; $cf=~/^(.*) (\d*)$/; $ctype=$1; $ctype=$cf if (! $ctype); $cfreq=$2; &checkX86; $ctype=&multicore_cputype($ctype,$corecnt) if ($isX86); &multicore_cpu_cnt(""); $ctype="" if ($ctype =~ /^\S*-Core $/); if ($ctype) { print "$cnt $ctype"; if ($cfreq) { print " ${cfreq}MHz" if ($cfreq && $ctype !~ /Hz$/); } print " cpu"; print "s" if ($cnt > 1); print ", " if ($x < scalar(@cputypecnt)); } } print (($sysfreq) ? ", " : "\n") if ($x && $ctype); } print "system freq: ${sysfreq}MHz\n" if ($sysfreq); } else { $modelbuf=""; if ($manufacturer) { $modelbuf .= "$manufacturer " if ($banner !~ /^$manufacturer/ && $model !~ /^$manufacturer/ && ($banner || $model)); } if ($banner && $bannermore) { $modelbuf .= "$banner $bannermore"; } elsif ($modelmore) { $modelbuf .= "$model $modelmore"; } elsif ($banner) { $modelbuf .= "$banner"; } elsif ($diagbanner) { $modelbuf .= "$diagbanner"; } elsif ($model) { $modelbuf .= "$model"; } if ($cpubanner) { if ($modelbuf) { $modelbuf .= " ($cpubanner)"; } else { $modelbuf = "$cpubanner"; } } $modelbuf .= " $realmodel" if ($realmodel); print "$modelbuf\n" if ($modelbuf); } # debug output if ($verbose > 1) { print "banner = $banner\n" if ($banner); print "diagbanner = $diagbanner\n" if ($diagbanner); print "cpubanner = $cpubanner\n" if ($cpubanner); print "bannermore = $bannermore\n" if ($bannermore); print "model = $model\n" if ($model); print "modelmore = $modelmore\n" if ($modelmore); print "machine = $machine\n" if ($machine); print "platform = $platform\n" if ($platform); print "ultra = $ultra\n" if ($ultra); if ($ultra eq "AXi") { print "found10bit = $found10bit\n"; print "found11bit = $found11bit\n"; } print "systemmanufacturer = $systemmanufacturer\n" if ($systemmanufacturer); print "systemmodel = $systemmodel\n" if ($systemmodel); print "boardmanufacturer = $boardmanufacturer\n" if ($boardmanufacturer); print "boardmodel = $boardmodel\n" if ($boardmodel); print "motherboard = $motherboard\n" if ($motherboard); print "romver = $romver\n" if ($romver); print "freephys = $freephys\n" if ($freephys); print "perl version: " . &mychomp($]) . "\n"; print "memory line: $gotmemory\n" if ($gotmemory); print "module info: $gotmodule\n" if ($gotmodule); print "dmidecode version: $dmidecode_ver\n" if ($dmidecode_ver); # Fujitsu GP7000F and PrimePower systems print "cpu name info: $gotcpunames\n" if ($gotcpunames); print "cpu board info: $gotcpuboards\n" if ($gotcpuboards); print "module name info: $gotmodulenames\n" if ($gotmodulenames); print "simmsizes = @simmsizes\n" if ($simmsizes[0]); print "simmsizesfound = @simmsizesfound\n" if ($simmsizesfound[0]); } if ($verbose && $boardfound_cpu) { if ($format_cpu == 1) { print "CPU Units: Frequency Cache-Size Version\n" if ($model =~ /-Enterprise/ || $ultra eq "e"); } else { print "CPU Units:\n"; } if ($model ne "SPARCserver-1000" && $model ne "SPARCcenter-2000") { print @boards_cpu; print "Memory Units:\n" if (! &is_virtualmachine); } } if ($interleave && ! &is_virtualmachine) { print "Memory Interleave Factor: $interleave"; print "-way" if ($interleave =~/^\d+$/); print "\n"; } print "Maximum Memory Bus Speed: $maxmembusspeed\n" if ($maxmembusspeed); } sub show_unrecognized { if ($perlhexbug) { print " This is most likely because Perl V$PERL_VERSION"; print " is buggy in hex number\n conversions. Please"; print " upgrade your perl release to Perl V5.002 or later\n"; print " for best results.\n"; } else { print " This is most likely because memconf $version"; print " does not completely\n recognize this $os"; print " $osrel" if ($osrel); print " $platform system.\n"; &show_request if ($untested == 0); } } sub show_untested { $osname="$os $osrel"; $osname="$os" if ($osrel eq ""); if ($untested_type eq "OS") { print "WARNING: This is an untested $osname operating"; } elsif ($untested_type eq "OBP") { print "ERROR: This is an untested $osname OBP $romvernum"; } elsif ($untested_type eq "CPU") { print "ERROR: This is an untested CPU type on this $osname"; } else { print "ERROR: This is an untested $osname"; } print " system by memconf $version\n"; print " Please let the author know how it works.\n"; $exitstatus=1; &show_request; } sub show_request { print " Check my website at $URL\n"; print " for a newer version of memconf that may recognize this system better.\n"; print " Please run 'memconf -D' to create a tar file of the output from the\n"; print " following commands to send to Tom Schmidt (tschmidt\@micron.com) so\n"; print " memconf $version may be enhanced to properly recognize this system:\n"; print " memconf -d\n"; &show_helpers(" "); if ($untested) { print " If this system is a Sun clone, please also send any hardware\n"; print " documentation on the memory layout that you may have.\n"; } } sub show_supported { &show_total_memory; print "ERROR: memconf $version is not supported on this $os"; print" $osrel $machine system.\n memconf is supported on:\n"; print " Solaris (SunOS 4.X or 5.X) on SPARC\n"; print " Solaris 10 6/06 or later on x86 with /usr/platform/i86pc/sbin/prtdiag\n"; print " Linux on SPARC with sparc-utils and /dev/openprom\n"; print " Linux on x86 and x86_64 with kernel-utils or pmtools for dmidecode\n"; print " FreeBSD on x86 and x86_64 with dmidecode\n"; print " Most HP-UX systems with SysMgmtPlus (cprop) or Support Tools Manager (cstm)\n"; if ($os =~ /Linux|FreeBSD/) { if ($machine =~ /.86|ia64|amd64|sparc/) { if ($config_cmd =~ /dmidecode/) { print "ERROR: dmidecode command was not found. Please install "; print "dmidecode from\n $dmidecodeURL "; print "to fix this issue.\n"; } print "NOTICE: This may be corrected by installing the "; print (($machine =~ /sparc/) ? "sparc-utils" : "kernel-utils or pmtools"); print "\n package if available for this $machine system.\n"; } else { $config_cmd=""; } } print " memconf may be able to process Sun/Oracle Explorer data on this machine.\n"; print " Check my website at $URL\n"; print " for a newer version of memconf that may recognize this system better.\n"; $exitstatus=1; &mailmaintainer if ($verbose == 3); &pdebug("exit $exitstatus"); exit $exitstatus; } sub show_memory { $mem=shift; print "${mem}MB"; if ($mem >= $meg) { print " (", $mem / $meg, "TB)"; } elsif ($mem >= 1024) { print " (", $mem / 1024, "GB)"; } print "\n"; } sub show_memory_label { $mem=shift; return if (! defined($mem)); return "$mem" if ($mem =~ /[MG]B/); return $mem / 1024 . "GB" if ($mem >= 1024); return "${mem}MB"; } sub show_errors { if ($failing_memory) { print "ERROR: Some of the installed memory has failed.\n"; print " You should consider replacing the failed memory.\n"; $exitstatus=1; } if ($unknown_JEDEC_ID) { print "ERROR: An unknown memory manufacturer was detected by memconf.\n"; &show_request; $exitstatus=1; } } sub check_model { &pdebug("in check_model, model=$model, platform=$platform, banner=$banner, diagbanner=$diagbanner"); $modelbanner=$banner; $modelbanner=$diagbanner if ($banner eq "" && $diagbanner ne ""); &find_helpers; # Workaround for broken "uname -i" on Oracle SPARC T3 systems $platform=$model if ($platform eq "sun4v"); if ($filename) { $platform=$model; $platform="SUNW,Ultra-5_10" if ($diagbanner =~ /Sun Ultra 5\/10/); $platform="SUNW,Sun-Fire" if ($diagbanner =~ /Sun Fire ([346]8[01]0|E[246]900)\b/); $platform="SUNW,Sun-Fire-15000" if ($diagbanner =~ /Sun Fire E2[05]K\b/); $platform=~s/-S$// if ($model =~ /Sun-Blade-[12]500-S\b/); if ($prtdiag_cmd =~ /platform/) { $prtdiag_cmd="/usr/platform/$platform/sbin/prtdiag"; $prtdiag_cmd="/usr/platform/sun4v/sbin/prtdiag" if ($platform =~ /ORCL,/); } } $model=~s/.*SUNW,//g; $model=~s/.*ORCL,//g; $model=~s/TWS,//g; $model=~s/CYCLE,//g; $model=~s/Tadpole_//g; $model=~s/ASPX,//g; $model=~s/PFU,//g; $model=~s/FJSV,//g; $model=~s/CompuAdd //g; $model=~s/RDI,//g; $model=~s/\s+$//; $ultra="ultra" if ($ultra eq 0 && ($model =~ /Ultra|Blade|Fire/ || ($machine eq "sun4v" && ! $filename))); if ($model =~ /Fire[- ](X|B[12]00x)/i) { # Sun Fire X??00 Servers, i86pc # Sun B100x or B200x Blade Servers, i86pc $ultra=""; $machine="x86" if ($machine ne "i86pc"); $untested=1; &x86_devname; } $ultra="sparc64" if ($model =~ /SPARC64/); $ultra="e" if ($model =~ /-Enterprise/ && $model !~ /SPARC-Enterprise/); $ultra=1 if ($model =~ /Ultra-1\b/); $ultra=2 if ($model =~ /Ultra-2\b/); $ultra=5 if ($model =~ /Ultra-5\b/); $ultra="5_10" if ($model =~ /Ultra-5_10\b/); $ultra=30 if ($model =~ /Ultra-30\b/); $ultra=60 if ($model =~ /Ultra-60\b/); $ultra=80 if ($model =~ /Ultra-80\b/); $ultra=250 if ($model =~ /Ultra-250\b/); $ultra=450 if ($model =~ /Ultra-4\b/); $ultra="Netra t1" if ($banner =~ /Netra t1\b/); if ($model =~ /Ultra-4FT\b/) { $ultra="Netra ft1800"; $bannermore="(Netra ft1800)"; $modelmore="(Netra ft1800)"; } $ultra="Sun Blade 1000" if ($model =~ /Ultra-100\b/); # prototype $ultra="Sun Blade 1000" if ($model =~ /Sun-Blade-1000\b/); $ultra="Sun Blade 2000" if ($model =~ /Sun-Blade-2000\b/); $ultra="Netra 20" if ($model =~ /Netra-20\b/); $ultra="Netra 20" if ($model =~ /Netra-T4\b/); # E2900/E4900 also use Netra-T12 $ultra="Netra T12" if ($model =~ /Netra-T12\b/ && $ultra !~ /Sun Fire/); $ultra="Sun Blade 100" if ($model =~ /Grover\b/); # prototype $ultra="Sun Blade 100" if ($model =~ /Sun-Blade-100\b/); $ultra="Sun Fire 280R" if ($model =~ /Enterprise-820R\b/); # prototype $ultra="Sun Fire 280R" if ($model =~ /Sun-Fire-280R\b/); $ultra="Sun Fire" if ($model =~ /Serengeti\b/); # prototype $ultra="Sun Fire" if ($model eq "Sun-Fire" || $model =~ /Sun-Fire-[346]8[01]0\b/); $ultra="Sun Fire V480" if ($model =~ /Sun-Fire-480R\b/); $ultra="Sun Fire V490" if ($model =~ /Sun-Fire-V490\b/); $ultra="Sun Fire V880" if ($model =~ /Sun-Fire-880\b/); $ultra="Sun Fire V890" if ($model =~ /Sun-Fire-V890\b/); # Sun Fire 12K, E25K, etc. systems identifies itself as Sun Fire 15K $ultra="Sun Fire 15K" if ($model =~ /Sun-Fire-15000\b/ && $ultra !~ /Sun Fire /); $ultra="Sun Fire 12K" if ($model =~ /Sun-Fire-12000\b/); $ultra="Serverblade1" if ($model =~ /Serverblade1\b/); # UltraSPARC-IIIi (Jalapeno) systems $ultra="Enchilada" if ($model =~ /Enchilada\b/); # prototype $ultra="Enchilada" if ($model =~ /Sun-Fire-V210\b/); $ultra="Enchilada" if ($model =~ /Netra-210\b/); $ultra="Enchilada" if ($model =~ /Sun-Fire-V240\b/); $ultra="Enchilada" if ($model =~ /Netra-240\b/); $ultra="Sun Fire V440" if ($model =~ /Sun-Fire-V440\b/); $ultra="Netra 440" if ($model =~ /Netra-440\b/); $ultra="Sun Fire V250" if ($model =~ /Sun-Fire-V250\b/); $ultra="Sun Blade 1500" if ($model =~ /Sun-Blade-1500\b/); $ultra="Sun Blade 2500" if ($model =~ /Sun-Blade-2500\b/); if ($model =~ /Sun-Blade-[12]500-S\b/) { $model=~s/-S$//; $modelmore="(Silver)" if ($banner !~ /\(Silver\)/); } $ultra="Sun Ultra 45 Workstation" if ($model =~ /Sun-Ultra-45-Workstation\b/ || $model eq "A70"); $ultra="Sun Ultra 25 Workstation" if ($model =~ /Sun-Ultra-25-Workstation\b/ || $model eq "Ultra-25"); $ultra="Sun Ultra 45 or Ultra 25 Workstation" if ($model =~ /Sun-Ultra-45-or-Ultra-25-Workstation\b/); $ultra="Sun Fire V125" if ($model =~ /Sun-Fire-V125\b/); $ultra="Seattle" if ($model =~ /Sun-Fire-V215\b/); $ultra="Seattle" if ($model =~ /Sun-Fire-V245\b/); $ultra="Boston" if ($model =~ /Sun-Fire-V445\b/); # UltraSPARC-IV (Jaguar) or UltraSPARC-IV+ (Panther) systems $ultra="Sun Fire E2900" if ($model =~ /Sun-Fire-E2900\b/); $ultra="Sun Fire E4900" if ($model =~ /Sun-Fire-E4900\b/); $ultra="Sun Fire E6900" if ($model =~ /Sun-Fire-E6900\b/); $ultra="Sun Fire E20K" if ($model =~ /Sun-Fire-(E|Enterprise-)20K\b/); $ultra="Sun Fire E25K" if ($model =~ /Sun-Fire-(E|Enterprise-)25K\b/); # SPARC64-VI or SPARC64-VII systems $ultra=$banner if ($banner =~ /SPARC Enterprise M[34589]000 Server/); # UltraSPARC-T1 (Niagara) systems if ($model =~ /Sun-Fire-T200\b/) { $ultra="T2000"; $modelmore="(Sun Fire T2000)"; } $ultra="T2000" if ($model =~ /Sun-Fire-T2000\b|SPARC-Enterprise-T2000\b|Netra-T2000\b/ || $modelbanner =~ /SPARC Enterprise T2000\b|Netra T2000\b/); $ultra="T1000" if ($model =~ /Sun-Fire-T1000\b|SPARC-Enterprise-T1000\b/ || $modelbanner =~ /SPARC Enterprise T1000/); $ultra="T6300" if ($model =~ /Sun-Blade-T6300\b/ || $modelbanner =~ /\bT6300\b/); # UltraSPARC-T2 (Niagara-II) systems $ultra="T5120" if ($model =~ /SPARC-Enterprise-T5120\b/ || $modelbanner =~ /\bT5120\b/); $ultra="T5220" if ($model =~ /(SPARC-Enterprise|Netra)-T5220\b/ || $modelbanner =~ /\bT5220\b/); $ultra="T6320" if ($model =~ /Sun-Blade-T6320\b/ || $modelbanner =~ /\bT6320\b/); $ultra="CP3260" if ($model =~ /Netra-CP3260\b/ || $modelbanner =~ /\bNetra CP3260\b/); # UltraSPARC-T2+ (Victoria Falls) systems $ultra="T5140" if ($model =~ /\bT5140\b/ || $modelbanner =~ /\bT5140\b/); $ultra="T5240" if ($model =~ /\bT5240\b|-USBRDT-5240\b/ || $modelbanner =~ /\bT5240\b/); $ultra="T5440" if ($model =~ /\bT5440\b|-USBRDT-5440\b/ || $modelbanner =~ /\bT5440\b/); $ultra="T6340" if ($model =~ /Sun-Blade-T6340\b/ || $modelbanner =~ /\bT6340\b/); # SPARC-T3 (Rainbow Falls) systems $ultra="T3-1" if ($model =~ /SPARC-T3-1\b/ || $modelbanner =~ /SPARC T3-1\b/); $ultra="T3-1B" if ($model =~ /SPARC-T3-1B\b/ || $modelbanner =~ /SPARC T3-1B\b/); $ultra="T3-1BA" if ($model =~ /SPARC-T3-1BA\b/ || $modelbanner =~ /SPARC T3-1BA\b/); $ultra="T3-2" if ($model =~ /SPARC-T3-2\b/ || $modelbanner =~ /SPARC T3-2\b/); $ultra="T3-4" if ($model =~ /SPARC-T3-4\b/ || $modelbanner =~ /SPARC T3-4\b/); # SPARC-T4 systems $ultra="T4-1" if ($model =~ /SPARC-T4-1\b/ || $modelbanner =~ /SPARC T4-1\b/); $ultra="T4-1B" if ($model =~ /SPARC-T4-1B\b/ || $modelbanner =~ /SPARC T4-1B\b/); $ultra="T4-2" if ($model =~ /SPARC-T4-2\b/ || $modelbanner =~ /SPARC T4-2\b/); $ultra="T4-2B" if ($model =~ /SPARC-T4-2B\b/ || $modelbanner =~ /SPARC T4-2B\b/); $ultra="T4-4" if ($model =~ /SPARC-T4-4\b/ || $modelbanner =~ /SPARC T4-4\b/); # SPARC-T5 systems $ultra="T5-2" if ($model =~ /SPARC-T5-2\b/ || $modelbanner =~ /SPARC T5-2\b/); $ultra="T5-4" if ($model =~ /SPARC-T5-4\b/ || $modelbanner =~ /SPARC T5-4\b/); $ultra="T5-8" if ($model =~ /SPARC-T5-8\b/ || $modelbanner =~ /SPARC T5-8\b/); $ultra="T5-1B" if ($model =~ /SPARC-T5-1B\b/ || $modelbanner =~ /SPARC T5-1B\b/); # SPARC M5 and M6 systems $ultra="M5-32" if ($model =~ /SPARC-M5-32\b/ || $modelbanner =~ /SPARC M5-32\b/); $ultra="M6-32" if ($model =~ /SPARC-M6-32\b/ || $modelbanner =~ /SPARC M6-32\b/); # Fujitsu SPARC M10 systems $ultra="M10-1" if ($model =~ /SPARC-M10-1\b/ || $modelbanner =~ /SPARC M10-1\b/); $ultra="M10-4" if ($model =~ /SPARC-M10-4\b/ || $modelbanner =~ /SPARC M10-4\b/); $ultra="M10-4S" if ($model =~ /SPARC-M10-4S\b/ || $modelbanner =~ /SPARC M10-4S\b/); # SPARC S7 and M7 systems $ultra="S7-2" if ($model =~ /SPARC-S7-2\b/ || $modelbanner =~ /SPARC S7-2\b/); $ultra="S7-2L" if ($model =~ /SPARC-S7-2L\b/ || $modelbanner =~ /SPARC S7-2L\b/); $ultra="T7-1" if ($model =~ /SPARC-T7-1\b/ || $modelbanner =~ /SPARC T7-1\b/); $ultra="T7-2" if ($model =~ /SPARC-T7-2\b/ || $modelbanner =~ /SPARC T7-2\b/); $ultra="T7-4" if ($model =~ /SPARC-T7-4\b/ || $modelbanner =~ /SPARC T7-4\b/); $ultra="M7-8" if ($model =~ /SPARC-M7-8\b/ || $modelbanner =~ /SPARC M7-8\b/); $ultra="M7-16" if ($model =~ /SPARC-M7-16\b/ || $modelbanner =~ /SPARC M7-16\b/); # Older SPARCstations $modelmore="SPARCstation SLC" if ($model eq "Sun 4/20"); $modelmore="SPARCstation ELC" if ($model eq "Sun 4/25"); $modelmore="SPARCstation IPC" if ($model eq "Sun 4/40"); $modelmore="SPARCstation IPX" if ($model eq "Sun 4/50"); $modelmore="SPARCstation 1" if ($model eq "Sun 4/60"); $modelmore="SPARCstation 1+" if ($model eq "Sun 4/65"); $modelmore="SPARCstation 2" if ($model eq "Sun 4/75"); $modelmore="(SPARCsystem 600)" if ($model =~ /Sun.4.600/ && $banner !~ /SPARCsystem/); $modelmore="Sun 4/30" if ($model =~ /SPARCstation-LX/); $modelmore="Sun 4/15" if ($model =~ /SPARCclassic/); $modelmore="Sun 4/10" if ($model =~ /SPARCclassic-X/); $modelmore="(SPARCstation 10SX)" if ($model =~ /Premier-24/); if ($model eq "S240") { $manufacturer="Sun Microsystems, Inc."; $modelmore="SPARCstation Voyager"; } # x86 &checkX86; if ($isX86) { $modelmore="(Solaris x86 machine)"; $cputype="x86"; $machine=$model; $ultra=0; $cpucntfrom="prtconf" if (! $cpucntfrom); return if ($model_checked); &check_prtdiag if ($use_psrinfo_data == 2); &check_psrinfo; &cpubanner; $cpucnt{"$cputype $cpufreq"}++; } # Clones if ($banner =~ /\bMP-250[(\b]/) { $ultra="axus250"; $bannermore="Ultra-250"; $modelmore="(Ultra-250)"; } $manufacturer="AXUS" if ($ultra =~ /axus/); $manufacturer="Force Computers" if ($model =~ /SPARC CP/); if ($model eq "S3GX") { $bannermore="(SPARCbook 3GX)"; $modelmore="(SPARCbook 3GX)"; } if ($model eq "S3XP") { $bannermore="(SPARCbook 3XP)"; $modelmore="(SPARCbook 3XP)"; } $manufacturer="Sun Microsystems, Inc." if ($banner !~ /Axil/ && ( $model =~ /^SPARCstation|^SPARCsystem|^SPARCclassic/ || $model =~ /^SPARCserver|^SPARCcenter|Enterprise|Premier 24/ || $model =~ /Netra|Sun.Fire|Sun.Blade|Serverblade1/)); # Oracle purchased Sun in 2010, so newer systems bear the Oracle name. $manufacturer="Oracle Corporation" if ($platform =~ /^ORCL,/ && $manufacturer eq "Sun Microsystems, Inc."); if ($model =~ /Auspex/) { $manufacturer="Auspex"; $model=~s/Auspex //g; $bannermore="Netserver"; $modelmore="Netserver"; } $manufacturer="Fujitsu" if ($banner =~ /Fujitsu/); $manufacturer="Fujitsu Siemens" if ($banner =~ /Fujitsu Siemens/); $manufacturer="Fujitsu Siemens Computers" if ($banner =~ /Fujitsu Siemens Computers/); if ($model =~ /S-4|^GPU[SZU]/ || $model eq "GP") { $manufacturer="Fujitsu" if ($manufacturer !~ /^Fujitsu/); $model=~s,_,/,g; $untested=1 if ($model =~ /^GPUSC-L/); $untested=1 if ($model =~ /^GPUU/); } if ($model =~ /PowerLite-/) { $bannermore=$model; $bannermore=~s/PowerLite-//g; } $model_checked=1; } sub check_banner { &pdebug("in check_banner, banner=$banner, ultra=$ultra"); $ultra="ultra" if ($ultra eq 0 && ($banner =~ /Ultra|Blade|Fire/)); $ultra="sparc64" if ($banner =~ /SPARC64/); $ultra=5 if ($banner =~ /Ultra 5\b/); $ultra="5_10" if ($banner =~ /Ultra 5\/10\b/); $ultra=10 if ($banner =~ /Ultra 10\b/); $ultra="220R" if ($banner =~ /Enterprise 220R\b/); $ultra=80 if ($banner =~ /Ultra 80\b/); # E410 is prototype name of E420R, but may still be in the # banner as "Sun Ultra 80/Enterprise 410 UPA/PCI" $ultra="420R" if ($banner =~ /Enterprise 410\b/); $ultra="420R" if ($banner =~ /Enterprise 420R\b/); $ultra="Netra t140x" if ($banner =~ /Netra t 1400\/1405\b/); $ultra="CP1400" if ($banner =~ /Ultra CP 1400\b/); $ultra="CP1500" if ($banner =~ /Ultra CP 1500\b/); $ultra="CP2000" if ($banner =~ /\bCP2000\b/); $ultra="CP2040" if ($banner =~ /\bCP2000 model 40\b/); $ultra="CP2060" if ($banner =~ /\bCP2000 model 60\b/); $ultra="CP2080" if ($banner =~ /\bCP2000 model 80\b/); $ultra="CP2140" if ($banner =~ /\bCP2000 model 140\b/); $ultra="CP2160" if ($banner =~ /\bCP2000 model 160\b/); $ultra="Sun Blade 1000" if ($banner =~ /Sun Excalibur\b/); # prototype $ultra="Sun Blade 2000" if ($banner =~ /Sun Blade 2000\b/); $ultra="Netra ct400" if ($banner =~ /Netra ct400\b/); $ultra="Netra ct410" if ($banner =~ /Netra ct410\b/); $ultra="Netra ct800" if ($banner =~ /Netra ct800\b/); $ultra="Netra ct810" if ($banner =~ /Netra ct810\b/); $ultra="Sun Blade 150" if ($banner =~ /Sun Blade 150\b/); # Sun Fire 12K, E25K, etc. systems identifies itself as Sun Fire 15K $ultra="Sun Fire 12K" if ($banner =~ /Sun Fire (12000|12K)\b/); if ($banner =~ /Ultra 4FT\b/) { $ultra="Netra ft1800"; $bannermore="(Netra ft1800)"; $modelmore="(Netra ft1800)"; } # UltraSPARC-IIIi (Jalapeno) systems $ultra="Sun Ultra 45 Workstation" if ($banner =~ /Sun Ultra 45 Workstation\b/); $ultra="Sun Ultra 25 Workstation" if ($banner =~ /Sun Ultra 25 Workstation\b/); # UltraSPARC-IV (Jaguar) or UltraSPARC-IV+ (Panther) systems $ultra="Sun Fire E2900" if ($banner =~ /Sun Fire E2900\b/); $ultra="Sun Fire E4900" if ($banner =~ /Sun Fire E4900\b/); $ultra="Sun Fire E6900" if ($banner =~ /Sun Fire E6900\b/); $ultra="Sun Fire E20K" if ($banner =~ /Sun Fire E20K\b/); $ultra="Sun Fire E25K" if ($banner =~ /Sun Fire E25K\b/); # SPARC64-VI or SPARC64-VII systems $ultra=$banner if ($banner =~ /SPARC Enterprise M[34589]000 Server/); # Clones if ($banner =~ /\bMP-250[(\b]/) { $ultra="axus250"; $bannermore="Ultra-250"; $modelmore="(Ultra-250)"; } $manufacturer="Sun Microsystems, Inc." if ($banner =~ /Sun |Netra /); $manufacturer="AXUS" if ($ultra =~ /\baxus\b/); $manufacturer="Rave" if ($banner =~ /Axil/); $manufacturer="Tadpole/Cycle" if ($banner =~ /Cycle|\bUP-20\b|\b520IIi\b/); $manufacturer="Tadpole" if ($banner =~ /Tadpole|\bRDI\b|\bVoyagerIIi\b|\bSPARCLE\b/); $manufacturer="Tatung" if ($banner =~ /COMPstation/); $manufacturer="Twinhead" if ($banner =~ /TWINstation/); $manufacturer="Fujitsu" if ($banner =~ /Fujitsu/); $manufacturer="Fujitsu Siemens" if ($banner =~ /Fujitsu Siemens/); $manufacturer="Fujitsu Siemens Computers" if ($banner =~ /Fujitsu Siemens Computers/); } sub check_for_prtdiag { return if (! $prtdiag_exec && ! $filename); return if ($have_prtdiag_data); &find_helpers; # Check for LDOMs if ($ldm_cmd && ! $have_ldm_data) { # Warn that ldm and prtdiag may take a while to run &please_wait; @ldm=&run("$ldm_cmd list-devices -a -p"); $have_ldm_data=1; foreach $line (@ldm) { $line=&dos2unix($line); $line=&mychomp($line); &check_LDOM; } } @prtdiag=&run("$prtdiag_exec") if (! $filename); $have_prtdiag_data=1; foreach $line (@prtdiag) { $line=&dos2unix($line); # Some Solaris prtdiag outputs have malformed header, so # handle them also. if ($line =~ /^System Configuration: +|.BIOS Configuration: |Sun Microsystems .*Fire *X|Sun Microsystems *X|Sun Microsystems .*Blade *X|Sun Microsystems .*Memory size: |^Oracle Corporation/i || ($line =~ /Sun Microsystems .*Ultra / && $machine eq "i86pc")) { $line=&mychomp($line); $tmp=$line; $line=~s/System Configuration: +//g; $line=~s/BIOS Configuration: .*//g; if ($line =~ /^Sun Microsystems/i) { $manufacturer="Sun Microsystems, Inc." if ($line !~ / i86pc$/); if ($tmp =~ /System Configuration: *W[12]00z/ && ! $model && $machine eq "i86pc") { $diagbanner=$line; $diagbanner=~s/^.* Inc\. *(.*)/$1/; } } elsif ($line =~ /^Oracle /i) { $manufacturer="Oracle Corporation" if ($line !~ / i86pc$/); } elsif ($line =~ /Inc\./i) { $manufacturer=$line; $manufacturer=~s/^(.* Inc\.).*/$1/i; if ($tmp !~ /BIOS Configuration: / && ! $model && $machine eq "i86pc") { $diagbanner=$line; $diagbanner=~s/^.* Inc\. *(.*)/$1/; } } elsif ($line =~ /Corporation/i) { $manufacturer=$line; $manufacturer=~s/^(.* Corporation).*/$1/i; if ($tmp !~ /BIOS Configuration: / && ! $model && $machine eq "i86pc") { $diagbanner=$line; $diagbanner=~s/^.* Corporation *(.*)/$1/; } } elsif ($line !~ /(To Be Filled|System Manufacturer)/i) { $manufacturer=$line; $manufacturer=~s/^(\w+)[ \/].*/$1/; } foreach $tmp ("Sun Microsystems, Inc.","Sun Microsystems","Oracle Corporation") { if ($line =~ /^$tmp +sun\w+ +/) { $diagbanner=$line; $diagbanner=~s/$tmp +sun\w+ +//g; $diagbanner=~s/Memory size: .*$//g; } elsif ($line =~ /^$tmp *Sun +/i) { $diagbanner=$line; $diagbanner=~s/$tmp *Sun/Sun/ig; $diagbanner=~s/Memory size: .*$//g; $diagbanner=~s/ BLADE / Blade /g; $diagbanner=~s/ FIRE / Fire /g; $diagbanner=~s/ SERVER\b/ Server /g; $diagbanner=~s/ MODULE*\b/ Module /g; $diagbanner=~s/ */ /g; } elsif ($line =~ /^$tmp.*Ultra/i) { $diagbanner=$line; $diagbanner=~s/$tmp.*Ultra/Ultra/ig; $diagbanner=~s/Memory size: .*$//g; } elsif ($line =~ /^$tmp *W[12]100z/i) { $diagbanner=$line; $diagbanner=~s/$tmp *//ig; } $diagbanner=~s/\s+$//; } } $prtdiag_failed=1 if ($line =~ /Prtdiag Failed/i); # prtdiag only works on the global zone, so find out # if we are in a Solaris zone. solaris8 brand container shows # kernel version of "Generic_Virtual" $prtdiag_failed=2 if ($line =~ /prtdiag can only be run in the global /i || $kernver eq "Generic_Virtual"); } if ($psrinfo_cmd && ! $have_psrinfo_data) { @psrinfo=&run("$psrinfo_cmd -v"); $tmp=&mychomp(`$psrinfo_cmd -p 2>/dev/null`); # physical CPUs if ($tmp) { push(@psrinfo, "#psrinfo -p\n$tmp\n"); $tmp=&mychomp(`$psrinfo_cmd -p -v 2>/dev/null`); push(@psrinfo, "#psrinfo -p -v\n$tmp\n"); } $have_psrinfo_data=1; } if ($ipmitool_cmd && ! $have_ipmitool_data) { @ipmitool=&run("$ipmitool_cmd fru"); $have_ipmitool_data=1; } if ($smbios_cmd && ! $have_smbios_data) { @smbios=&run("$smbios_cmd"); $have_smbios_data=1; } if ($kstat_cmd && ! $have_kstat_data) { @kstat=&run("$kstat_cmd"); $have_kstat_data=1; } if (! $filename && $verbose == 3) { # Only run the following commands if E-mailing maintainer since # this data is used by memconf only for some systems if ($prtpicl_cmd && ! $have_prtpicl_data) { @prtpicl=&run("$prtpicl_cmd -v"); $have_prtpicl_data=1; } if ($virtinfo_cmd && ! $have_virtinfo_data) { @virtinfo=&run("$virtinfo_cmd -pa"); $have_virtinfo_data=1; } if ($cfgadm_cmd && ! $have_cfgadm_data) { @cfgadm=&run("$cfgadm_cmd -al"); $have_cfgadm_data=1; } if ($ldm_cmd && ! $have_ldm_data) { @ldm=&run("$ldm_cmd list-devices -a -p"); $have_ldm_data=1; } } } sub add_to_sockets_used { $_=shift; # strip leading slash for matching $_=~s/^\///; if ($sockets_used !~ /$_/) { $sockets_used .= "," if ($sockets_used && /\s/); $sockets_used .= " $_"; # &pdebug("in add_to_sockets_used, added $_"); } } sub add_to_sockets_empty { $_=shift; $sockets_empty .= "," if ($sockets_empty && /\s/); $sockets_empty .= " $_"; } sub check_prtdiag { return if ($prtdiag_checked); &pdebug("in check_prtdiag"); $prtdiag_checked=1; return if (! $prtdiag_exec && ! $filename); &check_for_prtdiag; if ($diagbanner =~ /W1100z\b/i) { $model=$diagbanner if ($model eq "i86pc"); } $flag_cpu=0; $flag_mem=0; $build_socketstr=0; foreach $line (@prtdiag) { $line=&dos2unix($line); if ($line =~ /====|\/ \(picl,|= 2) { if ($linearr[2] =~ /\bU\d\d\d\d\b/) { # Sun Ultra-250 format $sockets_used .= " $linearr[2]"; } elsif ($linearr[2] =~ /\b\d\d\d\d\b/) { # Sun Ultra-4 format $sockets_used .= " U$linearr[2]"; } } if ($#linearr >= 3) { if ($linearr[3] ne "BankIDs" && $linearr[3] ne "GroupID" && $line !~ /^0x\d[\d ]+\d.+ +\d +-$/) { if ($linearr[1] =~ /\b\d+MB\b/) { # Sun Blade 100/1000 format $simmsize=$linearr[1]; $simmsize=~s/MB//g; push(@simmsizesfound, "$simmsize"); } elsif ($linearr[1] =~ /\b\d+GB\b/) { # Sun Blade 1000 format $simmsize=$linearr[1]; $simmsize=~s/GB//g; $simmsize *= 1024; push(@simmsizesfound, "$simmsize"); } } if ($model eq "Ultra-250" || $ultra eq 250 || $model eq "Ultra-4" || $ultra eq 450 || $model eq "Ultra-4FT" || $ultra eq "Netra ft1800") { if ($linearr[3] =~ /\b\d+\b/) { $simmsize=$linearr[3]; push(@simmsizesfound, "$simmsize"); } } } if ($#linearr >= 2) { if ($linearr[$#linearr] =~ /\bDIMM\d/ && $linearr[$#linearr - 1] =~ /\bCPU\d/) { $socket="$linearr[$#linearr - 1]_$linearr[$#linearr]"; &add_to_sockets_used("$socket") if ($linearr[1] ne "empty"); $build_socketstr=1 if ($#socketstr == 0); push(@socketstr, ("$socket")) if ($build_socketstr); } elsif ($linearr[$#linearr - 2] =~ /\bDIMM\d|_DIMM\d/ && $linearr[$#linearr - 1] =~ /\bBank\b/i) { # Ultra40 and JavaWorkstation $socket="$linearr[$#linearr - 2] $linearr[$#linearr - 1] $linearr[$#linearr]"; &add_to_sockets_used("$socket") if ($linearr[1] ne "empty"); $build_socketstr=1 if ($#socketstr == 0); push(@socketstr, ("$socket")) if ($build_socketstr); } elsif ($linearr[$#linearr] =~ /\b(DIMM\d|[UJ]\d\d\d\d[\b,])/ || ($linearr[$#linearr - 1] eq "Label" && $linearr[$#linearr] eq "-")) { $sockets_used .= " $linearr[$#linearr]"; # May be multiple sockets separated by "," $sockets_used=~s/,/ /g; } elsif ($linearr[2] =~ /MB\/P[01]\/B[01]\/D[01]|C[0-3]\/P[01]\/B[01]\/D[01]/) { $sockets_used .= " $linearr[2]"; # May be multiple sockets separated by "," $sockets_used=~s/,/ /g; } } if ($linearr[0] !~ /^0x/ && ($linearr[$#linearr] eq "-" || $linearr[$#linearr] =~ /^-,/)) { # unlabeled sockets $sockets_used .= " $linearr[$#linearr]"; # May be multiple sockets separated by "," $sockets_used=~s/,/ /g; } if ($linearr[$#linearr] =~ /\/J\d\d\d\d$/) { $linearr[$#linearr]=~s/.+\///g; $sockets_used .= " $linearr[$#linearr]"; } if ($ultra eq "Sun Fire 280R") { if ($line =~ / CA +0 +[0-3] .+4-way/) { $sockets_used="J0100 J0202 J0304 J0406 J0101 J0203 J0305 J0407"; } elsif ($line =~ / CA +0 +[02] /) { $sockets_used .= " J0100 J0202 J0304 J0406" if ($sockets_used !~ / J0100 /); } elsif ($line =~ / CA +[01] +[13] /) { $sockets_used .= " J0101 J0203 J0305 J0407" if ($sockets_used !~ / J0101 /); } } # Memory on Sun Fire systems if ($line =~ /^\/N\d\/SB\d\/P\d\/B\d\b/) { $boardslot_mem=substr($line,0,13); push(@boardslot_mems, "$boardslot_mem"); $boardslot_mems .= $boardslot_mem . " "; } elsif ($line =~ /^\/N\d\/SB\d\d\/P\d\/B\d\b/) { $boardslot_mem=substr($line,0,14); push(@boardslot_mems, "$boardslot_mem"); $boardslot_mems .= $boardslot_mem . " "; } elsif ($line =~ /^\/SB\d\d\/P\d\/B\d\b/) { $boardslot_mem=substr($line,0,11); push(@boardslot_mems, "$boardslot_mem"); $boardslot_mems .= $boardslot_mem . " "; } elsif ($line =~ /\bSB\d\/P\d\/B\d\/D\d\b,/) { $boardslot_mem=substr($line,24,51); push(@boardslot_mems, "$boardslot_mem"); $boardslot_mems .= $boardslot_mem . " "; } elsif ($line =~ /\bSB\d\/P\d\/B\d\/D\d\b/) { $boardslot_mem=substr($line,24,12); push(@boardslot_mems, "$boardslot_mem"); $boardslot_mems .= $boardslot_mem . " "; } if ($ultra =~ /Sun Fire/ && $#linearr >= 5) { if ($linearr[5] =~ /\d+MB/) { $simmsize=$linearr[5]; $simmsize=~s/MB//g; push(@simmsizesfound, "$simmsize"); } } if ($ultra =~ /Sun Fire V[48][89]0\b/) { # Fire V480, V490, V880, V890 $bankname="groups"; if ($banks_used ne "A0 A1 B0 B1") { $banks_used="A0 B0" if ($line =~ /^ ?[ABCD] .+ 4-way /); $banks_used="A0 A1 B0 B1" if ($line =~ /^ ?[ABCD] .+ 8-way /); } } if ($linearr[$#linearr] =~ /MB\/CMP0\/CH[0-3]\/R[01]\/D[01]/) { # UltraSPARC-T1 systems if ($#linearr >= 5) { if ($linearr[5] eq "MB") { $simmsize=$linearr[4]; $simmsize=~s/MB//g; $simmsize /= 2; push(@simmsizesfound, "$simmsize"); } elsif ($linearr[5] eq "GB") { $simmsize=$linearr[4]; $simmsize=~s/GB//g; $simmsize *= 512; push(@simmsizesfound, "$simmsize"); } if ($linearr[2] eq "MB") { $prtdiag_memory += $linearr[1]; } elsif ($linearr[2] eq "GB") { $prtdiag_memory += $linearr[1] * 1024; } $installed_memory=$prtdiag_memory if ($prtdiag_memory); } $sockets_used .= " $linearr[$#linearr]"; } if ($linearr[$#linearr] =~ /MB\/CMP[0-3]\/BR[0-3]\/CH[01]\/D[01]|MB\/CMP[0-3]\/MR[01]\/BR[01]\/CH[01]\/D[23]/) { # UltraSPARC-T2 systems: T5120, T5220, T6320 # UltraSPARC-T2+ systems: T5140, T5240, T5440 $sockets_used .= " $linearr[$#linearr]"; } if ($linearr[$#linearr] =~ /MB\/CPU[0-3]\/CMP[0-3]\/BR[01]\/CH[01]\/D[01]|MB\/MEM[0-3]\/CMP[0-3]\/BR[01]\/CH[01]\/D[01]/) { $sockets_used .= " $linearr[$#linearr]"; } if ($linearr[$#linearr] =~ /MB\/CMP[01]\/BOB[0-3]\/CH[01]\/D[01]/) { # SPARC T3-1, T3-1B, T4-1 or T4-1B $sockets_used .= " $linearr[$#linearr]"; } if ($linearr[$#linearr] =~ /MB\/CMP[01]\/MR[01]\/BOB[01]\/CH[01]\/D[01]/) { # SPARC T3-2, T4-2 $sockets_used .= " $linearr[$#linearr]"; } if ($linearr[$#linearr] =~ /PM[01]\/CMP[01]\/BOB[0-3]\/CH[01]\/D[01]/) { # SPARC T3-4, T4-4 $sockets_used .= " $linearr[$#linearr]"; } if ($linearr[$#linearr] =~ /SYS\/MB\/CM[01]\/CMP\/MR[0-3]\/BOB[01]\/CH[01]\/D[01]/) { # SPARC T5-2 $sockets_used .= " $linearr[$#linearr]"; } if ($linearr[$#linearr] =~ /SYS\/PM[0-3]\/CM[01]\/CMP\/BOB[0-7]\/CH[01]\/D[01]/) { # SPARC T5-4, T5-8 $sockets_used .= " $linearr[$#linearr]"; } if ($linearr[$#linearr] =~ /SYS\/MB\/CM0\/CMP\/BOB[0-7]\/CH[01]\/D[01]/) { # SPARC T5-1B $sockets_used .= " $linearr[$#linearr]"; } if ($linearr[$#linearr] =~ /SYS\/CMU\d+\/CMP\d+\/D\d+/) { # SPARC M5-32, M6-32 $sockets_used .= " $linearr[$#linearr]"; } if ($linearr[$#linearr] =~ /SYS\/MBU\/CMP0\/MEM[01][0-3][AB]/) { # Fujitsu SPARC M10-1 $sockets_used .= " $linearr[$#linearr]"; } if ($linearr[$#linearr] =~ /BB\d+\/CMU[LU]\/CMP[01]\/MEM[01][0-7][AB]/) { # Fujitsu SPARC M10-4, M10-4S (guess) $sockets_used .= " $linearr[$#linearr]"; } if ($linearr[$#linearr] =~ /SYS\/MB\/CMP\d+\/MCU\d+\/CH\d+\/D\d+/) { # SPARC S7-2, S7-2L $sockets_used .= " $linearr[$#linearr]"; } } if ($line =~ /CPU Units:/) { $flag_cpu=1; # Start of CPU section $flag_mem=0; # End of memory section $format_cpu=1; } if ($line =~ /==== (CPU|Processor Sockets |Virtual CPU)/) { $flag_cpu=1; # Start of CPU section $flag_mem=0; # End of memory section $format_cpu=2; } if ($line =~ /Memory Units:|==== Memory |==== Physical Memory |Used Memory:/) { $flag_cpu=0; # End of CPU section $flag_mem=1; # Start of memory section } if ($line =~ /CPU Units:/ && $line =~ /Memory Units:/) { $flag_cpu=1; # Start of CPU section $flag_mem=1; # Start of memory section } if ($flag_cpu && $line !~ /^\s*\n$/) { if ($model eq "Ultra-5_10" || $ultra eq "5_10" || $ultra eq 5 || $ultra eq 10) { $newline=$line; $newline=~s/^ //g if ($line !~ /Run Ecache CPU CPU/); push(@boards_cpu, "$newline"); } else { push(@boards_cpu, "$line"); } $boardfound_cpu=1; &checkX86; if ($flag_cpu == 2 && $isX86) { # Solaris x86 CPU type found in prtdiag $cputype2=&mychomp($line); # Remove multiple spaces before some Xeon models $cputype2=~s/\s\s+([ELWX][3-9])/ $1/; $cputype2=~s/\s\s+.*//; $cputype2=~s/(^.* Processor \d+) .*/$1/; $cputype2=&cleanup_cputype($cputype2); &x86multicorecnt($cputype2); # rewrite %cpucnt $cputype2 $cfreq=0; while (($cf,$cnt)=each(%cpucnt)) { $cf=~/^(.*) (\d+)$/; if (defined($2)) { $cfreq=$2; delete $cpucnt{"$1 $2"}; } else { delete $cpucnt{"$cf"}; } } $ndcpu++; if ($cpucntfrom ne "psrinfo") { $cpucntfrom="prtdiag"; $cpucntflag=1; $ncpu++ if ($filename); } $cputype=$cputype2 if ($cputype2); $cputype=$cputype_prtconf if (($cputype eq "AMD" || $cputype eq "Opteron") && $cputype_prtconf); $cputype=$cputype_psrinfo if ($cputype_psrinfo); $cpucnt{"$cputype $cfreq"}=$ncpu; } # CPUs on Sun Fire systems if ($line =~ /^\/N\d\/SB\d\/P\d\b/) { $boardslot_cpu=substr($line,0,10); push(@boardslot_cpus, "$boardslot_cpu"); $boardslot_cpus .= $boardslot_cpu . " "; } elsif ($line =~ /^\/N\d\/SB\d\d\/P\d\b/) { $boardslot_cpu=substr($line,0,11); push(@boardslot_cpus, "$boardslot_cpu"); $boardslot_cpus .= $boardslot_cpu . " "; } elsif ($line =~ /^\/SB\d\d\/P\d\b/) { $boardslot_cpu=substr($line,0,8); push(@boardslot_cpus, "$boardslot_cpu"); $boardslot_cpus .= $boardslot_cpu . " "; &prtdiag_threadcount(1); } elsif ($line =~ /^ SB\d\/P\d\b/) { $boardslot_cpu=substr($line,4,6); push(@boardslot_cpus, "$boardslot_cpu"); $boardslot_cpus .= $boardslot_cpu . " "; # prtdiag does not show cpuid or cputype } elsif ($line =~ / SB\d\/P\d$/) { $boardslot_cpu=substr($line,length($line)-7,6); push(@boardslot_cpus, "$boardslot_cpu"); $boardslot_cpus .= $boardslot_cpu . " "; &prtdiag_threadcount(0); } } if ($flag_cpu && $line =~ /------/) { # Next lines are the CPUs on each system board $flag_cpu=2; } if ($flag_mem && $line =~ /------/) { # Next lines are the memory on each system board $flag_mem=2; } if ($filename && $use_psrinfo_data) { # May have "psrinfo -v" output in regression test file if ($line =~ /.+ operates at \d+ MHz/) { $cpufreq=&mychomp($line); $cpufreq=~s/.+ operates at //; $cpufreq=~s/ MHz.+//; $cpucntfrom="psrinfo" if ($cpucntfrom ne "ldm"); $cpucntflag="0"; # reset flag $psrcpucnt++; # rewrite %cpucnt $cputype with frequency while (($cf,$cnt)=each(%cpucnt)) { $cf=~/^(.*) (\d+)$/; $tmp=$1; if (defined($tmp)) { delete $cpucnt{"$1 $2"} if ($2 == 0); } } if (defined($tmp)) { $cpucnt{"$tmp $cpufreq"}=$psrcpucnt; $ncpu=$psrcpucnt; } } # May have "psrinfo -p -v" output in regression test # file that has more detailed information about the # CPUs. Assumes all CPUs are same. $foundpsrinfocpu=1 if ($line =~ /.+ \d+ virtual processor/); if ($foundpsrinfocpu && (($line =~ /.+Hz$/ && $line !~ /Speed: / && $line !~ / PCI/) || $line =~ /\bAMD .* Processor /) && $line !~ / x86 /) { $cputype=&mychomp($line); $cputype=&cleanup_cputype($cputype); $cputype=~s/^Version:\s+//; $cputype=~s/^brand\s+//; $cputype=~s/^:brand-string\s+//; # rewrite %cpucnt $cputype with cputype while (($cf,$cnt)=each(%cpucnt)) { $cf=~/^(.*) (\d+)$/; $cpufreq=$2; delete $cpucnt{"$1 $2"}; } $cpucnt{"$cputype $cpufreq"}=$psrcpucnt; } } if ($filename && $filename !~ /Sun/ && $line =~ /^ *Manufacturer:/ && $manufacturer =~ /^Sun\b/ && $diagbanner !~ /^Sun\b|^Ultra/) { # Regression test file with smbios output $manufacturer=&mychomp($line); $manufacturer=~s/^.*Manufacturer: *//; $manufacturer=~s/\s*$//g; &pdebug("in check_prtdiag, smbios manufacturer=$manufacturer"); } } # Rewrite prtdiag output to include DIMM information on SB1X00, SB2X00, # Enchilada, Chalupa (Sun Fire V440), Netra T12, Seattle and Boston # systems @new_boards_mem=""; $grpcnt=0; $intcnt=0; if ($ultra =~ /Sun Blade [12][05]00\b/ || $ultra eq "Sun Fire 280R" || $ultra eq "Netra 20" || $ultra eq "Sun Fire V250" || $ultra eq "Netra T12") { foreach $line (@boards_mem) { $line=&mychomp($line); $newline=$line; if ($line eq "-----------------------------------------------------------" && ! $prtdiag_banktable_has_dimms) { $newline=$line . "------"; } elsif ($line eq "--------------------------------------------------") { $newline=$line . "-----------"; } elsif ($line =~ /ControllerID GroupID Size/ && ! $prtdiag_banktable_has_dimms) { $newline="ID ControllerID GroupID Size DIMMs Interleave Way"; } elsif ($line =~ /ControllerID GroupID Labels Status/) { $newline=$line . " DIMMs"; } elsif ($line =~ /ControllerID GroupID Labels/) { $newline=$line . " DIMMs"; } elsif ($line =~ /ControllerID GroupID Size Labels/) { $newline=$line . " DIMMs"; } elsif ($line =~ /^\d[\d ] \d[\d ] \d /) { &read_prtdiag_bank_table; } elsif ($line =~ /^0x\d[\d ]+\d.+ +\d +-$| GroupID \d[\d ]$/) { &read_prtdiag_memory_segment_table; } elsif ($line =~ /J0100,/) { $sz=$grpsize{0,0}; if (defined($sz)) { $sz=~s/ //g; $newline=$line . " 4x$sz"; } } elsif ($line =~ /J0101,/) { $sz=$grpsize{0,1}; if (defined($sz)) { $sz=~s/ //g; $newline=$line . " 4x$sz"; } } elsif ($line =~ /\/J0[1-4]0[0246]\b/) { $sz=$grpsize{0,0}; if (defined($sz)) { $sz=~s/ //g; $newline=$line . " $sz"; } } elsif ($line =~ /\/J0[1-4]0[1357]\b/) { $sz=$grpsize{0,1}; if (defined($sz)) { $sz=~s/ //g; $newline=$line . " $sz"; } } elsif ($line =~ /\bSB\d\/P\d\/B\d\/D\d,/) { $tmp=substr($line,0,2); $tmp=~s/ //g; $sz=$grpsize{$tmp,substr($line,15,1)}; $sz=$grpsize{0,substr($line,15,1)} if (! defined($sz)); if (defined($sz)) { $sz=~s/ //g; $newline=$line . " 4x$sz"; } } elsif ($line =~ /\bSB\d\/P\d\/B\d\/D\d\b/) { $tmp=substr($line,0,2); $tmp=~s/ //g; $sz=$grpsize{$tmp,substr($line,15,1)}; $sz=$grpsize{0,substr($line,15,1)} if (! defined($sz)); if (defined($sz)) { $sz=~s/ //g; $newline=$line . " $sz"; } } elsif ($line =~ / MB\/DIMM\d,/) { $sz=$grpsize{0,substr($line,15,1)}; $newline=$line . " 2x$sz" if (defined($sz)); } elsif ($line =~ /DIMM\d,DIMM\d/) { @linearr=split(' ', $line); if ($linearr[2] =~ /\d+[MG]B/) { $sz=$linearr[2]; if ($sz =~ /\dGB/) { $sz=~s/GB//g; $sz *= 512; } else { $sz=~s/MB//g; $sz /= 2; } $sz=&show_memory_label($sz); } $newline=$line . " 2x$sz" if (defined($sz)); if ($line =~ /DIMM[13],DIMM[24]/ && $ultra eq "Sun Blade 1500") { # prototype has sockets DIMM1-DIMM4 @socketstr=("DIMM1".."DIMM4"); } if ($line =~ /DIMM[1357],DIMM[2468]/ && $ultra eq "Sun Blade 2500") { # prototype has sockets DIMM1-DIMM8 if ($line =~ /DIMM[13],DIMM[24]/) { @socketstr=("DIMM1".."DIMM4"); } elsif ($line =~ /DIMM[57],DIMM[68]/) { push(@socketstr, "DIMM5".."DIMM8"); } } } push(@new_boards_mem, "$newline\n") if ($newline); } @boards_mem=@new_boards_mem; $memfrom="prtdiag"; } elsif ($ultra eq "Enchilada" || $ultra eq "Sun Fire V440" || $ultra eq "Netra 440" || $ultra =~ /Sun Ultra [24]5 .*Workstation/ || $ultra eq "Sun Fire V125" || $ultra eq "Seattle" || $ultra eq "Boston" || $banner =~ /Sun Fire E[24]900\b/ || $diagbanner =~ /Sun Fire E[24]900/) { foreach $line (@boards_mem) { $line=&mychomp($line); $newline=$line; if ($line eq "-----------------------------------------------------------" && ! $prtdiag_banktable_has_dimms) { $newline=$line . "------"; } elsif ($line eq "--------------------------------------------------") { $newline=$line . "-----------"; } elsif ($line =~ /ControllerID GroupID Size/ && ! $prtdiag_banktable_has_dimms) { $newline="ID ControllerID GroupID Size DIMMs Interleave Way"; } elsif ($line =~ /ControllerID GroupID Labels Status/) { $newline=$line . " DIMMs"; } elsif ($line =~ /ControllerID GroupID Labels/) { $newline=$line . " DIMMs"; } elsif ($line =~ /^\d[\d ] \d[\d ] \d /) { &read_prtdiag_bank_table; } elsif ($line =~ /^0x\d[\d ]+\d.+ +\d +-$| GroupID \d[\d ]$/) { &read_prtdiag_memory_segment_table; } elsif ($line =~ / MB\/P[01]\/B[01]\/D[01],|C[0-3]\/P[01]\/B[01]\/D[01],/) { $sz=$grpsize{substr($line,0,1),substr($line,15,1)}; $sz=$grpsize{0,substr($line,15,1)} if (! defined($sz)); if (defined($sz)) { $newline=$line . " 2x$sz"; } else { $newline=$line . " Failing"; $failing_memory=1; } } elsif ($line =~ / MB\/P[01]\/B[01]\/D[01]\b|C[0-3]\/P[01]\/B[01]\/D[01]\b/) { $sz=$grpsize{substr($line,0,1),substr($line,15,1)}; $sz=$grpsize{0,substr($line,15,1)} if (! defined($sz)); if (defined($sz)) { $sz=~s/ //g; $sz=&show_memory_label($sz); } $space=" "; $space="" if ($line =~ / okay/); if ($line =~ / failed/) { if (defined($sz)) { $failed_memory += $sz; } else { $failing_memory=1; } } if (defined($sz)) { # If interleave factor is 16, then print 4x$sz if (defined($grpinterleave{substr($line,28,1),0})) { if ($grpinterleave{substr($line,28,1),0} eq "0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15" && ! $prtdiag_banktable_has_dimms) { $newline=$line . "$space 4x$sz"; } else { $newline=$line . "$space $sz"; } } else { $newline=$line . "$space $sz"; } } } elsif ($line =~ / MB\/DIMM[0-7]\b/) { $sz=$grpsize{substr($line,0,1),substr($line,15,1)}; $sz=$grpsize{0,substr($line,15,1)} if (! defined($sz)); $newline=$line . " $sz" if (defined($sz)); } elsif ($line =~ /\bSB\d\/P\d\/B\d\/D\d,/) { $tmp=substr($line,0,2); $tmp=~s/ //g; $sz=$grpsize{$tmp,substr($line,15,1)}; $sz=$grpsize{0,substr($line,15,1)} if (! defined($sz)); if (defined($sz)) { $sz=~s/ //g; $newline=$line . " 4x$sz"; } } elsif ($line =~ /\bSB\d\/P\d\/B\d\/D\d\b/) { $tmp=substr($line,0,2); $tmp=~s/ //g; $sz=$grpsize{$tmp,substr($line,15,1)}; $sz=$grpsize{0,substr($line,15,1)} if (! defined($sz)); if (defined($sz)) { $sz=~s/ //g; $newline=$line . " $sz"; } } push(@new_boards_mem, "$newline\n") if ($newline); } @boards_mem=@new_boards_mem; $memfrom="prtdiag"; } # Rewrite prtdiag output to exclude redundant labels @new_boards_mem=""; $flag_group=0; foreach $line (@boards_mem) { $line=&mychomp($line); $newline=$line; $flag_group++ if ($line =~ /Memory Module Groups:/); if ($flag_group ge 2) { $newline="" if ($line =~ /Memory Module Groups:|--------------------------------------------------|ControllerID GroupID/); } push(@new_boards_mem, "$newline\n") if ($newline); } if ($machine eq "sun4v" && $cputype !~ /UltraSPARC-T1$/) { if ($prtpicl_cmd && ! $have_prtpicl_data) { # Warn that prtpicl may take a while to run &please_wait; @prtpicl=&run("$prtpicl_cmd -v"); $have_prtpicl_data=1; } &check_prtpicl if ($have_prtpicl_data); if ($picl_foundmemory) { @new_boards_mem=""; $memfrom="prtpicl"; $picl_bank_cnt=scalar(keys %picl_mem_bank); if (scalar(keys %picl_mem_dimm) == 1 || $picl_bank_cnt > 1) { while (($socket,$simmsize)=each(%picl_mem_bank)) { if (scalar(keys %picl_mem_pn) == $picl_bank_cnt * 2 || $interleave == 8) { # CH1 was not listed $simmsize /= 2; $picl_mem_dimm{"$socket"}=$simmsize; $socket=~s/CH0/CH1/g; $picl_mem_dimm{"$socket"}=$simmsize; &add_to_sockets_used($socket); } else { $picl_mem_dimm{"$socket"}=$simmsize; } } } while (($socket,$simmsize)=each(%picl_mem_dimm)) { $pn=$picl_mem_pn{"$socket"}; $sz=&show_memory_label($simmsize); $newline="socket $socket has a "; $newline .= $pn . " " if (defined($pn)); $newline .= $sz . " " if (defined($sz)); $newline .= "$memtype"; push(@new_boards_mem, "$newline\n"); push(@simmsizesfound, $simmsize) if (defined($sz)); } @new_boards_mem=sort alphanumerically @new_boards_mem; } elsif ($flag_rewrite_prtdiag_mem) { # Hack: Rewrite prtdiag output better than original if ($sockets_used =~ /MB\/CMP[0-3]\/BR[0-3]\/CH[01]\/D1/) { # All 16 DIMMs are installed @new_boards_mem=""; if ($sockets_used !~ /MB\/CMP[0-3]\/BR[0-3]\/CH1\/D[01]/) { foreach $line (@boards_mem) { $line=&mychomp($line); $newline=$line; if ($line =~ /MB\/CMP[0-3]\/BR[0-3]\/CH0\/D[01]/) { $line=~s/\s+$//; $tmp=$line; $tmp=~s/^.*(MB\/CMP.*)/$1/; $tmp=~s/CH0/CH1/g; $space=""; $space=" " if ($line =~ /^MB\/CMP/); $newline="$space$line,$tmp"; } push(@new_boards_mem, "$newline\n") if ($newline); } } $sockets_used=""; for ($cnt=0; $cnt <= $#socketstr; $cnt++) { $sockets_used .= " $socketstr[$cnt]"; } $simmsize=$installed_memory / 16; } else { # 8-DIMMs or 4-DIMMs are installed. # Hack: assume 4-DIMM configuration since # 8-DIMM has prtpicl output. @new_boards_mem=""; foreach $line (@boards_mem) { $line=&mychomp($line); $newline=$line; if ($line =~ /MB\/CMP[0-3]\/BR[0-3]\/CH0\/D[01]/) { $line=~s/\s+$//; $space=""; $space=" " if ($line =~ /^MB\/CMP/); $newline="$space$line"; } push(@new_boards_mem, "$newline\n") if ($newline); } $simmsize=$installed_memory / 4; } # Round up DIMM value $simmsize=&roundup_memory($simmsize); push(@simmsizesfound, $simmsize); } else { $tmp=0; foreach $socket (sort split(' ', $sockets_used)) { $tmp++; } if ($tmp) { # Round up DIMM value $simmsize=&roundup_memory($installed_memory / $tmp); push(@simmsizesfound, $simmsize); } } } @boards_mem=@new_boards_mem; # &pdebug("sockets_used=$sockets_used"); } sub prtdiag_threadcount { $arg=shift; # column with thread count $diagthreadcnt++; $tmp=$line; $tmp=~s/,\s+/,/; @linearr=split(' ', $tmp); $cputype=$linearr[4]; $cputype=~s/SUNW,U/U/; $cpufreq=$linearr[1+$arg]; if ($line =~ /\bUS-/) { $cputype=~s/US-/UltraSPARC-/; $cpufreq=$linearr[2]; } $cputype=~s/UltraSPARC-IV/Dual-Core UltraSPARC-IV/; $diagcpucnt{"$cputype $cpufreq"}++; if ($linearr[$arg] =~ /,/) { $tmp=$linearr[$arg]; @linearr=split(',', $tmp); $diagthreadcnt += $#linearr; } $cpucntfrom="prtdiag"; } sub check_prtpicl { &pdebug("in check_prtpicl"); $flag_mem_seg=0; $flag_mem_bank=0; $flag_mem_chan=0; $flag_mem_mod=0; $flag_physical_platform=0; $processorbrd=""; $cpumembrd=""; $mem_riser=""; $mem_cu=""; $picl_dimm_per_bank=0; $max_picl_dimm_per_bank=0; $has_picl_mem_mod=0; foreach $line (@prtpicl) { $line=&dos2unix($line); $line=&mychomp($line); $line=~s/\s+$//; if ($line =~ /^\s+:Label\s+PM[01]/) { # SPARC T3-4, T4-4 $processorbrd=$line; $processorbrd=~s/^.*:Label\s+(.*)$/$1/; } if ($line =~ /^\s+:Label\s+CM[0-3]/) { # SPARC T5-2, T5-4, T5-8, T5-1B $cpumembrd=$line; $cpumembrd=~s/^.*:Label\s+(.*)$/$1/; } if ($line =~ /^\s+:Label\s+(CPU[0-3]|MEM[0-3])/) { $cpumembrd=$line; $cpumembrd=~s/^.*:Label\s+(.*)$/$1\//; } if ($line =~ /^\s+:Label\s+CMP[0-3]/) { $cmp=$line; $cmp=~s/^.*:Label\s+(.*)$/$1/; } if ($line =~ /\s+:name\s+memory-module/) { $flag_mem_mod=0; # End of memory module section &add_to_sockets_used($mem_dimm); } if (($line =~ /^\s+\w.*/ && $line !~ /^\s+memory-/ && $has_picl_mem_mod) || ($line =~ /\s+:name\s/ && ! $has_picl_mem_mod)) { $flag_mem_seg=0; $max_picl_dimm_per_bank=$picl_dimm_per_bank if ($picl_dimm_per_bank); if ($flag_mem_mod && $mem_dimm !~ /\//) { if ($ultra eq "S7-2" || $ultra eq "S7-2L") { # SPARC S7-2, S7-2L (guess) $socket="/SYS/MB/$cpumembrd$cmp/$mem_cu/$mem_channel/$mem_dimm"; } elsif ($ultra =~ /T5-(2|1B)/) { # SPARC T5-2, T5-1B (guess) $socket="/SYS/MB/$cpumembrd/CMP/$mem_branch/$mem_channel/$mem_dimm"; } elsif ($ultra =~ /T5-(4|8)/) { # SPARC T5-4, T5-8 (guess) $socket="/SYS/$processorbrd/$cpumembrd/CMP/$mem_branch/$mem_channel/$mem_dimm"; } elsif ($processorbrd) { # SPARC T3-4, T4-4 $socket="/SYS/$processorbrd/$cpumembrd$cmp/$mem_branch/$mem_channel/$mem_dimm"; } else { $socket="MB/$cpumembrd$cmp/$mem_branch/$mem_channel/$mem_dimm"; } $flag_mem_mod=0; # End of memory module section &add_to_sockets_used($socket); if (defined($mem_model) && defined($mem_mfg)) { $picl_mem_pn{"$socket"}="$mem_mfg $mem_model"; } elsif (defined($mem_mfg)) { $picl_mem_pn{"$socket"}="$mem_mfg"; } if ($max_picl_dimm_per_bank) { $picl_mem_dimm{"$socket"}=$picl_bank_size / $max_picl_dimm_per_bank; push(@simmsizesfound, "$picl_mem_dimm{\"$socket\"}"); } elsif ($sockets_used =~ /\/CH1\//) { $picl_mem_dimm{"$socket"}+=$picl_bank_size / 2; } else { $picl_mem_dimm{"$socket"}+=$picl_bank_size; } } elsif ($flag_mem_bank) { $socket="$bank_nac" if ($bank_nac); $flag_mem_bank=0; # End of memory bank section $bank_nac=""; if ($socket) { &add_to_sockets_used($socket); $picl_mem_bank{"$socket"}=$picl_bank_size; } } } if ($line =~ /^\s+memory-segment\s/) { $flag_mem_seg=1; # Start of memory segment section } if ($flag_mem_seg) { if ($line =~ /^\s+:InterleaveFactor\s/) { $interleave=$line; $interleave=~s/^.*:InterleaveFactor\s+(.*)$/$1/; $interleave=hex($interleave) if ($interleave =~ /^0x\d/); } if ($line =~ /^\s+:Size\s/) { $segment_size=$line; $segment_size=~s/^.*:Size\s+(.*)$/$1/; if ($segment_size =~ /^0x\d/) { $segment_size=~s/^(.*)00000$/$1/; $segment_size=hex($segment_size); } else { $segment_size /= $meg; } } } if ($line =~ /^\s+memory-bank\s/) { $flag_mem_bank=1; # Start of memory bank section $picl_dimm_per_bank=0; } if ($flag_mem_bank) { if ($line =~ /^\s+:Label\s/) { $bank_label=$line; $bank_label=~s/^.*:Label\s+(.*)$/$1/; } if ($line =~ /^\s+:nac\s/) { $bank_nac=$line; $bank_nac=~s/^.*:nac\s+(.*)\s*$/$1/; } if ($line =~ /^\s+:Size\s/) { $picl_bank_size=$line; $picl_bank_size=~s/^.*:Size\s+(.*)$/$1/; if ($picl_bank_size =~ /^0x\d/) { $picl_bank_size=~s/^(.*)00000$/$1/; $picl_bank_size=hex($picl_bank_size); } else { $picl_bank_size=$segment_size / $meg; } } } if ($line =~ /^\s+memory-module\s/) { $flag_mem_mod=1; # Start of memory module section $has_picl_mem_mod=1; } if ($flag_mem_mod) { if ($line =~ /^\s+:nac\s/) { $mem_dimm=$line; $mem_dimm=~s/^.*:nac\s+(.*)\s*$/$1/; $picl_dimm_per_bank++; } } if ($line =~ /^\s+MR\d\s/) { $mem_riser=$line; $mem_riser=~s/^.*(MR\d).*/$1/; } if ($line =~ /^\s+MCU\d\s/) { $mem_cu=$line; $mem_cu=~s/^.*(MCU\d).*/$1/; } if ($line =~ /^\s+(BR|BOB)\d\s/) { $flag_mem_chan=0; $mem_branch=$line; $mem_branch=~s/^.*(BR\d).*/$1/; $mem_branch=~s/^.*(BOB\d).*/$1/; # SPARC T3-2, T4-2 $mem_branch=$mem_riser . "/" . $mem_branch if ($mem_riser); } if ($line =~ /^\s+CH\d\s/) { $flag_mem_chan=1; # Start of memory channel section $mem_channel=$line; $mem_channel=~s/^.*(CH\d).*/$1/; } if ($flag_mem_chan && $line =~ /^\s+D\d\s/) { $flag_mem_mod=1; # Start of memory module section $picl_foundmemory=1; $mem_dimm=$line; $mem_dimm=~s/^.*(D\d).*/$1/; } if ($flag_mem_mod) { if ($line =~ /\s+:ModelName\s/) { $mem_model=$line; $mem_model=~s/^.*:ModelName\s+(.*)$/$1/; } if ($line =~ /\s+:MfgName\s/) { $mem_mfg=$line; $mem_mfg=~s/^.*:MfgName\s+(.*)$/$1/; } } if ($line =~ /\s+:name\s+physical-platform/) { $flag_physical_platform=1; } elsif ($line =~ /\s+:name\s+SYS/) { $flag_physical_platform=0; } if ($flag_physical_platform) { if ($line =~ /\s+:MfgName\s/) { $manufacturer=$line; $manufacturer=~s/^.*:MfgName\s+(.*)$/$1/; } } } } sub check_prtfru { &pdebug("in check_prtfru"); if ($prtfru_cmd && ! $have_prtfru_data) { # Warn that prtfru may take a while to run &please_wait; @prtfru=&run("$prtfru_cmd -x"); $have_prtfru_data=1; } $flag_mem_mod=0; $cpu_mem_slot=""; $mem_slot=""; $mem_desc=""; $mem_mfg=""; $mem_mfg_loc=""; $mem_pn=""; $sun_pn=""; $fru_details=""; $fru_sb=""; $fru_cpu=""; $fru_bank=""; $fru_dimm=""; $prevline=""; foreach $line (@prtfru) { $line=&dos2unix($line); $line=&mychomp($line); $line=~s/\s+$//; if ($line =~ //) { $fru_sb=$prevline; $fru_sb=~s/^.*Label=(.*)\s*\".*/$1/; &pdebug("in check_prtfru, found fru_sb=$fru_sb"); } if ($line =~ //) { $flag_mem_mod=0; # End of memory module section if ($mem_slot) { if ($mem_desc) { $have_prtfru_details=1; $fru_details .= "$cpu_mem_slot " if ($cpu_mem_slot); $fru_details .= "$mem_slot: $mem_desc"; $fru_details .= ", Sun $sun_pn" if ($sun_pn); if ($mem_mfg && $mem_pn) { $fru_details .= ", $mem_mfg $mem_pn"; } else { $fru_details .= ", $mem_mfg" if ($mem_mfg); $fru_details .= ", $mem_pn" if ($mem_pn); } $fru_details .= "\n"; } else { $missing_prtfru_details .= "${cpu_mem_slot}_" if ($cpu_mem_slot); $missing_prtfru_details .= "$mem_slot "; } } $mem_slot=""; $mem_desc=""; $mem_mfg=""; $mem_mfg_loc=""; $mem_pn=""; $sun_pn=""; $fru_dimm=""; } if ($flag_mem_mod) { if ($line =~ /(DIMM_Capacity|Fru_Description) value=/) { $mem_desc=$line; $mem_desc=~s/^.*\"(.*)\s*\".*$/$1/; } if ($line =~ /(Fundamental_Memory_Type|DIMM_Config_Type) value=/) { $tmp=$line; $tmp=~s/^.*\"(.*)\s*\".*$/$1/; if ($mem_desc) { $mem_desc .= " $tmp"; } else { $mem_desc="$tmp"; } } if ($line =~ /Manufacture_Loc value=/ && ! $mem_mfg_loc) { $mem_mfg_loc=$line; if ($mem_mfg_loc =~ /\".*\"/) { $mem_mfg_loc=~s/^.*\"(.*)\s*\".*$/$1/; } else { $mem_mfg_loc=~s/^.*\"(.*)\s*$/$1/; } } if ($line =~ /Vendor_Name value=/ && ! $mem_mfg) { $mem_mfg=$line; if ($mem_mfg =~ /\".*\"/) { $mem_mfg=~s/^.*\"(.*)\s*\".*$/$1/; } else { $mem_mfg=~s/^.*\"(.*)\s*$/$1/; } $mem_mfg=&get_mfg($mem_mfg); # Fix some unrecognized manufacturers if ($mem_mfg =~ /(unrecognized value|UNKNOWN Invalid Value)/i) { if ($mem_mfg =~ /[0\b]4400\b/ || $mem_mfg_loc =~ /Boise.*Idaho/i) { $mem_mfg="Micron Technology"; } elsif ($mem_mfg =~ /[0\b]7800\b/ || $mem_mfg_loc =~ /Onyang.*Korea/i) { $mem_mfg="Samsung"; } elsif ($mem_mfg =~ /[0\b]0551\b/ || $mem_mfg_loc =~ /\bQMY\b/) { $mem_mfg="Qimonda"; } else { # unrecognized manufacturer $recognized=-3; $exitstatus=1; } } } if ($line =~ /Manufacturer_Part_No value=/ && ! $mem_pn) { $mem_pn=$line; $mem_pn=~s/^.*\"(.*)\s*\".*$/$1/; } if ($line =~ /Sun_Part_No value=/ && ! $sun_pn) { $sun_pn=$line; $sun_pn=~s/^.*\"(.*)\s*\".*$/$1/; $sun_pn=~s/^(\d\d\d)(\d\d\d\d)$/$1-$2/; } # This data is not always accurate, so ignore it # if ($line =~ /Fru_Type value=/ && ! $mem_desc) { # $mem_desc=$line; # $mem_desc=~s/^.*\"(.*)\s*\".*$/$1/; # } } $prevline=$line; } } sub multicore_cputype { $s=shift; $tmp=shift; return if (! defined($s) || ! defined($tmp)); $s="Hyper-Threaded $s" if ($hyperthread && $s !~ /Hyper.Thread/i); if ($tmp == 2) { $s="Dual-Core $s" if ($s !~ /(Dual|Two).Core/i); } elsif ($tmp == 3) { $s="Triple-Core $s" if ($s !~ /(Triple|Three).Core/i); } elsif ($tmp == 4) { $s="Quad-Core $s" if ($s !~ /(Quad|Four).Core/i); } elsif ($tmp == 6) { $s="Six-Core $s" if ($s !~ /(Hex|Six).Core/i); } elsif ($tmp == 8) { $s="Eight-Core $s" if ($s !~ /(Octal|Eight).Core/i); } elsif ($tmp == 10) { $s="Ten-Core $s" if ($s !~ /Ten.Core/i); } elsif ($tmp == 12) { $s="Twelve-Core $s" if ($s !~ /Twelve.Core/i); } elsif ($tmp > 1) { $s="${tmp}-Core $s" if ($s !~ /${tmp}.Core/i); } $s=~s/ Core/-Core/ if ($s =~ /(Dual|Two|Triple|Three|Quad|Four|Hex|Six|Octal|Eight|Ten|Twelve|[0-9]) Core/i); return($s); } sub cleanup_cputype { $_=shift; return "" if (! defined($_)); s/ CPU//; s/ [Pp]rocessor//; s/ +MHz/MHz/; s/ (\d[\d\.]*GHz) \d*MHz/ $1/; s/\s+/ /g; s/^\s+//; s/\s+$//; s/\(r\)/\(R\)/g; s/\(tm\)/\(TM\)/g; s/ Core/-Core/ if (/(Dual|Two|Triple|Three|Quad|Four|Hex|Six|Octal|Eight|Ten|Twelve|[0-9]) Core/i); return($_); } sub multicore_cpu_cnt { $arg=shift; &check_psrinfo; &pdebug("in multicore_cpu_cnt, cputype=$cputype, threadcnt=$threadcnt"); if ($cputype =~ /UltraSPARC-T1$/) { $cputype="UltraSPARC-T1"; # Count 4-Thread (4, 6, or 8 Core) Niagara CPUs as 1 CPU if ($npcpu && $ldm_cmd && ! $have_ldm_data) { $ncpu=$npcpu; } else { # Each CPU has 8 Cores max (32 threads) $ncpu=int(($threadcnt - 1) / 32) + 1; } if (defined($arg)) { $cnt=$ncpu; return; } if ($threadcnt) { $cputype=$threadcnt / 4 / $ncpu . "-Core Quad-Thread $cputype"; $cpucnt{"$cputype $cpufreq"}=$ncpu; } } elsif ($cputype =~ /UltraSPARC-T2\+/) { $cputype="UltraSPARC-T2+"; # Count 8-Thread (4, 6, or 8 Core) Victoria Falls CPUs as 1 CPU if ($npcpu && $ldm_cmd && ! $have_ldm_data) { $ncpu=$npcpu; } else { # Assume there are no single-cpu systems with the US-T2+ $ncpu=2; # Valid configurations: # T5140,T5240: 2 x 4-Core (64 threads), 2 x 6-Core # (96 threads), 2 x 8-Core (128 threads) # T5440: 4 x 4-Core (128 threads), 4 x 8-Core # (256 threads) # Netra-T5440: 2 x 8-Core (128 threads) if ($ultra eq "T5140" || $ultra eq "T5240") { $ncpu=2; } elsif ($ultra eq "T5440") { $ncpu=4; $ncpu=2 if ($model =~ /Netra-T5440/); } } if (defined($arg)) { $cnt=$ncpu; return; } if ($threadcnt) { $cputype=$threadcnt / 8 / $ncpu . "-Core 8-Thread $cputype"; $cpucnt{"$cputype $cpufreq"}=$ncpu; } } elsif ($cputype =~ /UltraSPARC-T2$/) { $cputype="UltraSPARC-T2"; # Count 8-Thread (4 or 8 Core) Niagara-II CPUs as 1 CPU if ($npcpu && $ldm_cmd && ! $have_ldm_data) { $ncpu=$npcpu; } else { # Each CPU has 8 Cores max (64 threads) $ncpu=int(($threadcnt - 1) / 64) + 1; } if (defined($arg)) { $cnt=$ncpu; return; } if ($threadcnt) { $cputype=$threadcnt / 8 / $ncpu . "-Core 8-Thread $cputype"; $cpucnt{"$cputype $cpufreq"}=$ncpu; } } elsif ($cputype =~ /SPARC-T3$/) { $cputype="SPARC-T3"; # Count 8-Thread (8 or 16 Core) Rainbow Falls CPUs as 1 CPU if ($npcpu && $ldm_cmd && ! $have_ldm_data) { $ncpu=$npcpu; } else { # Each CPU has 16 Cores max (128 threads) $ncpu=int(($threadcnt - 1) / 128) + 1; } if (defined($arg)) { $cnt=$ncpu; return; } if ($threadcnt) { $cputype=$threadcnt / 8 / $ncpu . "-Core 8-Thread $cputype"; $cpucnt{"$cputype $cpufreq"}=$ncpu; } } elsif ($cputype =~ /SPARC-T4$/) { $cputype="SPARC-T4"; # Count 8-Thread 8-Core SPARC-T4 CPUs as 1 CPU if ($npcpu && $ldm_cmd && ! $have_ldm_data) { $ncpu=$npcpu; } else { # Each CPU has 8 Cores max (64 threads) $ncpu=int(($threadcnt - 1) / 64) + 1; } if (defined($arg)) { $cnt=$ncpu; return; } if ($threadcnt) { $cputype=$threadcnt / 8 / $ncpu . "-Core 8-Thread $cputype"; $cpucnt{"$cputype $cpufreq"}=$ncpu; } } elsif ($cputype =~ /SPARC-T5$/) { $cputype="SPARC-T5"; # Count 8-Thread 16-Core SPARC-T5 CPUs as 1 CPU if ($npcpu && $ldm_cmd && ! $have_ldm_data) { $ncpu=$npcpu; } else { # Each CPU has 16 Cores max (128 threads) $ncpu=int(($threadcnt - 1) / 128) + 1; } if (defined($arg)) { $cnt=$ncpu; return; } if ($threadcnt) { $cputype=$threadcnt / 8 / $ncpu . "-Core 8-Thread $cputype"; $cpucnt{"$cputype $cpufreq"}=$ncpu; } } elsif ($cputype =~ /SPARC.M5$/) { $cputype="SPARC-M5"; # Count 8-Thread 6-Core SPARC-M5 CPUs as 1 CPU if ($npcpu && $ldm_cmd && ! $have_ldm_data) { $ncpu=$npcpu; } else { # Each CPU has 6 Cores max (48 threads) $ncpu=int(($threadcnt - 1) / 48) + 1; } if (defined($arg)) { $cnt=$ncpu; return; } if ($threadcnt) { $cputype=$threadcnt / 8 / $ncpu . "-Core 8-Thread $cputype"; $cpucnt{"$cputype $cpufreq"}=$ncpu; } } elsif ($cputype =~ /SPARC.M6$/) { $cputype="SPARC-M6"; # Count 8-Thread 12-Core SPARC-M6 CPUs as 1 CPU if ($npcpu && $ldm_cmd && ! $have_ldm_data) { $ncpu=$npcpu; } else { # Each CPU has 12 Cores max (96 threads) $ncpu=int(($threadcnt - 1) / 96) + 1; } if (defined($arg)) { $cnt=$ncpu; return; } if ($threadcnt) { $cputype=$threadcnt / 8 / $ncpu . "-Core 8-Thread $cputype"; $cpucnt{"$cputype $cpufreq"}=$ncpu; } } elsif ($cputype =~ /SPARC.S7$/) { $cputype="SPARC-S7"; # Count 8-Thread 8-Core SPARC-S7 CPUs as 1 CPU if ($npcpu && $ldm_cmd && ! $have_ldm_data) { $ncpu=$npcpu; } else { # Each CPU has 8 Cores max (64 threads) $ncpu=int(($threadcnt - 1) / 64) + 1; } if (defined($arg)) { $cnt=$ncpu; return; } if ($threadcnt) { $cputype=$threadcnt / 8 / $ncpu . "-Core 8-Thread $cputype"; $cpucnt{"$cputype $cpufreq"}=$ncpu; } } elsif ($cputype =~ /SPARC.M7$/) { $cputype="SPARC-M7"; # Count 8-Thread 32-Core SPARC-M7 CPUs as 1 CPU if ($npcpu && $ldm_cmd && ! $have_ldm_data) { $ncpu=$npcpu; } else { # Each CPU has 32 Cores max (256 threads) $ncpu=int(($threadcnt - 1) / 256) + 1; } if (defined($arg)) { $cnt=$ncpu; return; } if ($threadcnt) { $cputype=$threadcnt / 8 / $ncpu . "-Core 8-Thread $cputype"; $cpucnt{"$cputype $cpufreq"}=$ncpu; } } elsif ($cputype =~ /SPARC64-VI$/) { # Count Dual-Core Dual-Thread Olympus-C SPARC64-VI CPUs as 1 CPU $ncpu=$threadcnt / 4; $cputype="Dual-Core Dual-Thread SPARC64-VI"; if (defined($arg)) { $cnt=$ncpu; return; } $cpucnt{"$cputype $cpufreq"}=$ncpu; } elsif ($cputype =~ /SPARC64-VII\+\+$/) { # Count Quad-Core Dual-Thread Jupiter++ SPARC64-VII++ CPUs as 1 CPU $ncpu=$threadcnt / 8; $cputype="Quad-Core Dual-Thread SPARC64-VII++"; if (defined($arg)) { $cnt=$ncpu; return; } $cpucnt{"$cputype $cpufreq"}=$ncpu; } elsif ($cputype =~ /SPARC64-VII\+$/) { # Count Quad-Core Dual-Thread Jupiter+ SPARC64-VII+ CPUs as 1 CPU $ncpu=$threadcnt / 8; $cputype="Quad-Core Dual-Thread SPARC64-VII+"; if (defined($arg)) { $cnt=$ncpu; return; } $cpucnt{"$cputype $cpufreq"}=$ncpu; } elsif ($cputype =~ /SPARC64-VII$/) { # Count Quad-Core Dual-Thread Jupiter SPARC64-VII CPUs as 1 CPU $ncpu=$threadcnt / 8; $cputype="Quad-Core Dual-Thread SPARC64-VII"; if (defined($arg)) { $cnt=$ncpu; return; } $cpucnt{"$cputype $cpufreq"}=$ncpu; } elsif ($cputype =~ /SPARC64-VIII$/) { # Guess on the Venus SPARC64-VIII name ??? # Count 8-Core Dual-Thread Venus SPARC64-VIII CPUs as 1 CPU $ncpu=$threadcnt / 16; $cputype="8-Core Dual-Thread SPARC64-VIII"; if (defined($arg)) { $cnt=$ncpu; return; } $cpucnt{"$cputype $cpufreq"}=$ncpu; } elsif ($cputype =~ /SPARC64-X$/) { # Count 16-Core Dual-Thread SPARC64-X CPUs as 1 CPU $ncpu=$threadcnt / 32; $cputype="16-Core Dual-Thread SPARC64-X"; if (defined($arg)) { $cnt=$ncpu; return; } $cpucnt{"$cputype $cpufreq"}=$ncpu; } } sub x86multicorecnt { $_=shift; return if (! defined($_)); $corecnt=2 if (/\b(Dual|Two).Core/i); $corecnt=3 if (/\b(Triple|Three).Core/i); $corecnt=4 if (/\b(Quad|Four).Core/i); $corecnt=6 if (/\b(Hex|Six).Core/i); $corecnt=8 if (/\b(Octal|Eight).Core/i); $corecnt=10 if (/\bTen.Core/i); $corecnt=12 if (/\bTwelve.Core/i); } sub checkX86 { $isX86=1 if ($model eq "i86pc" || $machine eq "i86pc" || $model eq "i86xpv" || $machine eq "i86xpv" || $model eq "i86xen" || $machine eq "i86xen"); # Use CPU count from prtdiag (ndcpu) and thread count from psrinfo to # get core count per cpu for i86xpv/i86xen $use_psrinfo_data=2 if ($model eq "i86xpv" || $machine eq "i86xpv" || $model eq "i86xen" || $machine eq "i86xen"); } sub check_psrinfo { return if ($psrinfo_checked); &pdebug("in check_psrinfo, ndcpu=$ndcpu, npcpu=$npcpu, nvcpu=$nvcpu"); $psrinfo_checked=1; return if ($nvcpu || ! $use_psrinfo_data); if ($filename) { $npcpu=0; $j=0; $have_npcpu=0; foreach $line (@psrinfo) { $line=&dos2unix($line); # May have "psrinfo -p" output in regression test file # that has number of physical CPUs. if ($line =~ /^#.*psrinfo -p$/ && $psrinfo[$j + 1] =~ /^\d+$/) { $npcpu=&mychomp($psrinfo[$j + 1]); $have_npcpu=1; &pdebug("in check_psrinfo, found npcpu=$npcpu"); } # May have "psrinfo -p -v" output in regression test # file that has number of virtual CPUs. Assumes all # CPUs are same. if ($line =~ /^The .+ \d+ virtual processor/) { &check_psrinfo_pv; if ($use_psrinfo_data == 2 && $ndcpu > 1) { $corecnt /= $ndcpu; $npcpu=$ndcpu if (! $have_npcpu); } else { $npcpu++ if (! $have_npcpu); } $cpucntfrom="psrinfo" if ($cpucntfrom ne "ldm"); $cpucntflag="0"; # reset flag &pdebug("in check_psrinfo, found nvcpu=$nvcpu, corecnt=$corecnt, npcpu=$npcpu, hyperthread=$hyperthread"); } $j++; } } elsif ($psrinfo_cmd) { $ncpu=&mychomp(`$psrinfo_cmd | wc -l`); # physical & virtual CPUs $ncpu=~s/\s+//; $npcpu=&mychomp(`$psrinfo_cmd -p 2>/dev/null`); # physical CPUs if ($npcpu) { # Find number of virtual CPUs @tmp=`$psrinfo_cmd -p -v`; foreach $line (@tmp) { $line=&dos2unix($line); if ($line =~ /^The .+ \d+ virtual processor/) { &check_psrinfo_pv; if ($use_psrinfo_data == 2 && $ndcpu > 1) { $corecnt /= $ndcpu; $npcpu=$ndcpu; } } } if ($cputype eq "x86") { if ($tmp[2] =~ /.+Hz|\bAMD .* Processor /) { $cputype_psrinfo=&cleanup_cputype(&mychomp($tmp[2])); } } } else { $npcpu=$ncpu; $nvcpu=1; } @tmp=`$psrinfo_cmd -v`; if ($tmp[2] =~ /MHz/) { $cpufreq=&mychomp($tmp[2]); $cpufreq=~s/.+ operates at //; $cpufreq=~s/ MHz.+//; } $cpucntfrom="psrinfo" if ($cpucntfrom ne "ldm"); $have_psrinfo_data=1; } } sub check_psrinfo_pv { $nvcpu=&mychomp($line); $nvcpu=~s/.+ processor has //; $nvcpu=~s/ virtual processor.+//; if ($nvcpu =~ / cores and /) { $nvcpu=~s/cores and //; $corecnt=$nvcpu; $corecnt=~s/ \d+$//; $nvcpu=~s/^\d+ //; if ($nvcpu == 2 * $corecnt && $isX86) { $hyperthread=1; &pdebug("hyperthread=1: from psrinfo -p -v"); } } else { $corecnt=$nvcpu if ($nvcpu >= 2); $corecnt /= 2 if ($hyperthread); } } sub get_mfg { $_=shift; return "" if (! defined($_)); s/Manufacturer: *//ig; $has_JEDEC_ID=0; if (/JEDEC ID:/) { s/JEDEC ID://g; s/ //g; $has_JEDEC_ID=1; } s/^\s+//; s/\s+$//; s/^0x//; &pdebug("in get_mfg, JEDEC_ID=$_"); return "" if (/(^$|^\r$|^FFFFFFFFFFFF|^000000000000|^Undefined|Manufacturer\d)/i); s/^(00|80)// if (! /^007F/); # Based on JEDEC JEP106AT return "Micron Technology" if (/(^2C|Micron\b)/i); return "Micron CMS" if (/(^7F45|Micron CMS)/i); return "Crucial Technology" if (/(^1315$|^859B|^9B|^7F7F7F7F7F9B|Crucial\b)/i); # Inotera was a Joint Venture between Micron and Nanya # Micron fully acquired Inotera in 2016 return "Inotera Memories" if (/Inotera/i); # Micron acquired Elpida in August 2013 return "Elpida" if (/(^0500|^FE|^7F7FFE|^02FE|Elpida)/i); # Micron acquired Numonyx in February 2010 return "Numonyx (Intel)" if (/(^89|Intel)/i); return "Numonyx" if (/Numonyx/i); return "Fujitsu" if (/(^04|Fujitsu)/i); return "Hitachi" if (/(^07|Hitachi)/i); return "Inmos" if (/(^08|Inmos)/i); return "Intersil" if (/(^0B|Intersil)/i); return "Mostek" if (/(^0D|Mostek)/i); return "Freescale (Motorola)" if (/(^0E|Motorola)/i); return "Freescale" if (/Freescale/i); return "NEC" if (/^10/); return "Conexant (Rockwell)" if (/(^13|Rockwell)/i); return "Conexant" if (/Conexant/i); return "NXP (Philips Semi, Signetics)" if (/(^15|Philips Semi|Signetics)/i); return "Synertek" if (/(^16|Synertek)/i); return "Xicor" if (/(^19|Xicor)/i); return "Zilog" if (/(^1A|Zilog)/i); return "Mitsubishi" if (/(^1C|Mitsubishi)/i); return "ProMOS/Mosel Vitelic" if (/(^40|ProMOS|Mosel Vitelic)/i); return "Qimonda" if (/(^51|^8551|Qimonda)/i); return "Wintec Industries" if (/(^61|Wintec\b)/i); return "Goldenram" if (/(^6A|Goldenram)/i); return "Fairchild" if (/(^83|Fairchild)/i); return "GTE" if (/(^85|GTE)/i); return "DATARAM" if (/^91|^7F91/); return "Smart Modular" if (/^94|^0194|Smart Modular/i); return "Toshiba" if (/(^98|Toshiba)/i); return "Corsair" if (/(^9E|Corsair)/i); return "IBM" if (/^A4/i); return "Hynix Semiconductor (Hyundai Electronics)" if (/(^AD|Hyundai)/i); return "Hynix Semiconductor" if (/(HYN|Hynix)/i); return "Infineon (Siemens)" if (/(^C1|^7F7F7F7F7F51|Siemens)/i); return "Infineon" if (/Infineon/i); return "Samsung" if (/(^CE|Samsung)/i); return "Winbond Electronics" if (/(^DE|Winbond)/i); return "LG Semiconductor (Goldstar)" if (/(^E0|Goldstar)/i); return "LG Semiconductor" if (/LG Semi/i); return "Kingston" if (/(^7F98|^0198|Kingston)/i); return "SpecTek Incorporated" if (/(^7F7FB5|SpecTek)/i); return "Nanya Technology" if (/(^7F7F7F0B|^830B|Nanya)/i); return "Kingmax Semiconductor" if (/(^7F7F7F25|KINGMAX)/i); return "Ramaxel Technology" if (/(^7F7F7F7F43|Ramaxel)/i); return "A-DATA Technology" if (/(^7F7F7F7FCB|ADATA|A-DATA)/i); return "Team Group Inc." if (/^(7F7F7F7FEF|Team\b)/i); return "AMD" if (/^01/); return "AMI" if (/^02/); if ($has_JEDEC_ID || /^7F|^80|^FF/i) { $unknown_JEDEC_ID=1; &pdebug("in get_mfg, found unknown JEDEC ID $_"); } return &mychomp($_); } # See if CPUs and memory modules are listed in "ipmitool fru" output sub check_ipmitool { &pdebug("in check_ipmitool"); return if (! $ipmitool_cmd && ! $filename); $cputype2=""; $mem_mfg=""; $mem_model=""; $mem_pn=""; $flag_cpu=0; $flag_mem=0; $flag_mfg=0; $socket=""; foreach $line (@ipmitool) { $line=&dos2unix($line); $line=&mychomp($line); if ($line =~ /^ *$/) { # store cpu and memory modules in hash if ($flag_cpu) { if ($cputype2) { $cputype2=~s/DUAL.CORE/Dual-Core/; $cputype2=~s/TRIPLE.CORE/Triple-Core/; $cputype2=~s/QUAD.CORE/Quad-Core/; $cputype2=~s/SIX.CORE/Six-Core/; $cputype2=~s/EIGHT.CORE/Eight-Core/; $cputype2=~s/TEN.CORE/Ten-Core/; $cputype2=~s/TWELVE.CORE/Twelve-Core/; $cputype2=~s/ Core/-Core/; $cputype2=~s/OPTERON\(TM\) PROCESSOR/Opteron\(TM\)/; $ipmi_cputype="$cputype2"; $ipmi_cpucnt++; } } if ($flag_mem && $socket) { $ipmi_mem{"$socket"}=("$mem_mfg$mem_model$mem_pn") ? "$mem_mfg $mem_model$mem_pn" : ""; } $flag_cpu=0; # End of CPU section $flag_mem=0; # End of memory section $flag_mfg=0; # End of mfg section $cputype2=""; $mem_mfg=""; $mem_model=""; $mem_pn=""; } if ($line =~ / (cpu\d+\.vpd|p\d+\.fru )/) { $flag_cpu=1; # Start of CPU section $socket=$line; $socket=~s/^.*: +(.*\S)\.[vf][pr][du].*$/$1/; } if ($flag_cpu && $line =~ / Product Name /) { $cputype2=$line; $cputype2=~s/^.*: +(.*\S) *$/$1/; &x86multicorecnt($cputype2); } if ($line =~ / (cpu\d+\.mem\d+\.vpd|p\d+\.d\d+\.fru) /) { $flag_mem=1; # Start of memory module section $socket=$line; $socket=~s/^.*: +(.*\S)\.[vf][pr][du].*$/$1/; } elsif ($line =~ / P\d+C\d+\/B\d+\/C\d+\/D\d+ / && $ultra =~ /^T7-/) { # Need what M7-8 and M7-16 format looks like $flag_mem=1; # Start of memory module section $socket=$line; $socket=~s/^.*: +(.*\S)\s*.*$/$1/; } if ($flag_mem && $line =~ / Device not present /) { # Ignore missing Processor Modules $flag_mem=0 if ($ultra eq "T7-4" && $corecnt == 2 && $socket =~ /P1C\d+\/B\d+\/C\d+\/D\d+/); # Need what M7-8 and M7-16 format looks like } if ($flag_mem && $line =~ / Product Manufacturer /) { $mem_mfg=$line; $mem_mfg=~s/^.*: +(.*\S) *$/$1/; $mem_mfg=&get_mfg($mem_mfg); } if ($flag_mem && $line =~ / Product Name /) { $mem_model=$line; $mem_model=~s/^.*: +(.*\S) *$/$1/; $mem_model=~s/ ADDRESS\/COMMAND//; $mem_model=~s/PARITY/Parity/; } if ($flag_mem && $line =~ / Product Part Number /) { $mem_pn=$line; $mem_pn=~s/^.*: +(.*\S) *$/, $1/; $mem_pn=~s/^, .*,(.*\S)$/, $1/; } if ($line =~ /FRU Device Description *: *\/*SYS /) { $flag_mfg=1; # Start of mfg section } if ($flag_mfg && $line =~ / Product Manufacturer /) { $manufacturer="Sun Microsystems, Inc." if ($line =~ /Sun /i); $manufacturer="Oracle Corporation" if ($line =~ /Oracle/i); } } # Is ipmitool CPU count better? # &pdebug("ipmi_cpucnt=$ipmi_cpucnt"); if ($ncpu != $ipmi_cpucnt && $npcpu == 0 && $ipmi_cpucnt != 0) { $ncpu=$ipmi_cpucnt; $npcpu=$ipmi_cpucnt; $cpucntfrom="ipmitool"; $cpucnt{"$cputype $cpufreq"}=$ipmi_cpucnt; } # Did ipmitool find a better cputype? if (&lc($cputype) ne &lc($ipmi_cputype) && $ipmi_cputype) { # rewrite %cpucnt $cputype with cputype while (($cf,$cnt)=each(%cpucnt)) { $cf=~/^(.*) (\d+)$/; $cpufreq=$2; delete $cpucnt{"$1 $2"}; } $cpucnt{"$ipmi_cputype $cpufreq"}=$ipmi_cpucnt; } } # Check for logical domains sub check_for_LDOM { &pdebug("in check_for_LDOM"); $kernbit=64 if (! $kernbit && $machine eq "sun4v"); # Handle control LDOM on UltraSPARC-T1 and later systems if ($ldm_cmd && ! $have_ldm_data) { @ldm=&run("$ldm_cmd list-devices -a -p"); $have_ldm_data=1; } $ldmthreadcnt=0; if ($have_ldm_data) { foreach $line (@ldm) { $line=&dos2unix($line); $line=&mychomp($line); &check_LDOM; # Count virtual CPUs $ldmthreadcnt++ if ($line =~ /^\|pid=\d/); if ($line =~ /^\|pa=\d.*\|size=\d/) { # Add up total memory found in ldm output $sz=$line; $sz=~s/^.*size=(\d*).*/$1/; $ldm_memory += $sz; } } # Was ldm data found? $have_ldm_data=0 if (! $ldmthreadcnt && ! $ldm_memory); if ($ldmthreadcnt) { # VCPUs found in ldm output delete $cpucnt{"$cputype $cpufreq"}; &pdebug("ldm: ncpu=$ncpu, npcpu=$npcpu"); $cpucntfrom="ldm"; $threadcnt=$ldmthreadcnt; &multicore_cpu_cnt; } $installed_memory=$ldm_memory / $meg if ($ldm_memory); } # Handle guest domains on UltraSPARC-T1 and later systems if ($virtinfo_cmd && ! $have_virtinfo_data) { @virtinfo=&run("$virtinfo_cmd -pa"); $have_virtinfo_data=1; } if ($cfgadm_cmd && ! $have_cfgadm_data) { @cfgadm=&run("$cfgadm_cmd -al"); $have_cfgadm_data=1; } if ($have_virtinfo_data) { foreach $line (@virtinfo) { $line=&dos2unix($line); if ($line =~ /Domain role: LDoms guest|DOMAINROLE\|impl=LDoms\|control=false/i) { &found_guest_LDOM; &pdebug("exit 1"); exit 1; } $virtinfoLDOMcontrolfound=1 if ($line =~ /DOMAINROLE\|impl=LDoms\|control=true/i); } } if ($have_cfgadm_data) { foreach $line (@cfgadm) { $line=&dos2unix($line); if ($line =~ /Configuration administration not supported/ && $ldmthreadcnt == 0 && $virtinfoLDOMcontrolfound == 0) { # Hack: Assume cfgadm fails on guest domains. &found_guest_LDOM; &pdebug("exit 1"); exit 1; } } } } sub check_LDOM { if ($line =~ /Authorization failed|Connection refused/i) { if ($uid eq "0") { # No LDOMs configured $ldm_cmd=""; $have_ldm_data=0; } else { &found_guest_LDOM(""); print "ERROR: ldm: $line\n"; print " This user does not have permission to run '/opt/SUNWldm/bin/ldm'.\n"; print " Run memconf as a privileged user like root on the control LDOM.\n"; &pdebug("exit 1"); exit 1; } } } sub found_guest_LDOM { # Rewrite cputype and cpucnt hash since I don't # know how many cores the guest domain host has if ($cputype =~ /UltraSPARC-T1$/) { delete $cpucnt{"$cputype $cpufreq"}; $cputype="UltraSPARC-T1"; $cpucnt{"$cputype $cpufreq"}=1; } elsif ($cputype =~ /UltraSPARC-T2\+/) { delete $cpucnt{"$cputype $cpufreq"}; $cputype="UltraSPARC-T2+"; $cpucnt{"$cputype $cpufreq"}=1; } elsif ($cputype =~ /UltraSPARC-T2$/) { delete $cpucnt{"$cputype $cpufreq"}; $cputype="UltraSPARC-T2"; $cpucnt{"$cputype $cpufreq"}=1; } elsif ($cputype =~ /SPARC-T3$/) { delete $cpucnt{"$cputype $cpufreq"}; $cputype="SPARC-T3"; $cpucnt{"$cputype $cpufreq"}=1; } elsif ($cputype =~ /SPARC-T4$/) { delete $cpucnt{"$cputype $cpufreq"}; $cputype="SPARC-T4"; $cpucnt{"$cputype $cpufreq"}=1; } elsif ($cputype =~ /SPARC-T5$/) { delete $cpucnt{"$cputype $cpufreq"}; $cputype="SPARC-T5"; $cpucnt{"$cputype $cpufreq"}=1; } elsif ($cputype =~ /SPARC-M5$/) { delete $cpucnt{"$cputype $cpufreq"}; $cputype="SPARC-M5"; $cpucnt{"$cputype $cpufreq"}=1; } elsif ($cputype =~ /SPARC-M6$/) { delete $cpucnt{"$cputype $cpufreq"}; $cputype="SPARC-M6"; $cpucnt{"$cputype $cpufreq"}=1; } elsif ($cputype =~ /SPARC-S7$/) { delete $cpucnt{"$cputype $cpufreq"}; $cputype="SPARC-S7"; $cpucnt{"$cputype $cpufreq"}=1; } &show_header; $arg=shift; return if (defined($arg)); $domaincontrol=""; if ($have_virtinfo_data) { foreach $line (@virtinfo) { $line=&dos2unix($line); if ($line =~ /DOMAINCONTROL\|name=/i) { $domaincontrol=&mychomp($line); $domaincontrol=~s/^.*name=//; } } } print "ERROR: Guest Logical Domain (LDOM) detected.\n"; print " Run memconf on the control LDOM"; print " host \"$domaincontrol\"" if ($domaincontrol ne ""); print ".\n It cannot show system memory details on guest LDOMs.\n"; } sub found_nonglobal_zone { # non-global zone (container) print "WARNING: More details can be reported if memconf is run in the global zone"; if ($filename) { print ".\n"; } else { $globalzone=&mychomp(`/usr/sbin/arp -a | awk '/SP/ {print \$2}' | head -1`); print "\n on hostname '$globalzone'.\n"; } } sub check_smbios { &pdebug("in check_smbios"); $flag_smb_cpudevice=0; $flag_smb_memdevice=0; $cpu_membank=-1; $cpu_cnt=-1; $physmemarray=""; foreach $line (@smbios) { $line=&dos2unix($line); $line=&mychomp($line); next if ($line =~ /( *Unknown|: Other|: \.\.|: Not Specified)/i); if ($model eq "i86pc" || $model eq "i86xpv" || $model eq "i86xen") { if ($line =~ /^ *Manufacturer:/ && $line !~ /(To Be Filled|System Manufacturer)/i && $manufacturer eq "") { $manufacturer=$line; $manufacturer=~s/^ *Manufacturer: *//g; $manufacturer=~s/\s*$//g; &pdebug("in check_smbios, manufacturer=$manufacturer"); } if ($line =~ /^ *Product:/ && $line !~ /(To Be Filled|System .*Name|XXXX)/i) { $model=$line; $model=~s/^ *Product: *//g; $model=~s/\s*$//g; &pdebug("in check_smbios, model=$model"); &x86_devname; } } if ($line =~ /SMB_TYPE_PROCESSOR\b/) { $flag_smb_cpudevice=1; $cpu_cnt++; } if ($flag_smb_cpudevice && $line =~ /Location Tag:/) { $CPUSocketDesignation[$cpu_cnt]=$line; $CPUSocketDesignation[$cpu_cnt]=~s/^ *Location Tag: *//g; $flag_smb_cpudevice=0; } if ($line =~ /SMB_TYPE_MEMDEVICE\b/) { $mem_mfg=""; $socket=""; $pn=""; $simmsize=0; $memtype=""; $formfactor=""; $smb_mdf=""; $maxmembusspeed=""; $flag_smb_cpudevice=0; $flag_smb_memdevice=1; } if ($flag_smb_memdevice) { if ($line =~ /Manufacturer:/) { $mem_mfg=$line; $mem_mfg=~s/^ *Manufacturer: *//g; $mem_mfg=&get_mfg($mem_mfg); $mem_mfg=", $mem_mfg" if ($mem_mfg); } if ($line =~ /Location Tag:/) { # Ignore System ROM FLASH if ($line =~ /SYSTEM ROM/i) { $flag_smb_memdevice=0; } else { $socket=$line; $socket=~s/^ *Location Tag: *//g; $socket=~s/\s*$//g; } } if ($line =~ /Part Number:/) { $pn=$line; $pn=~s/^ *Part Number: *//g; $pn=~s/\s*$//g; $pn="" if ($pn =~ /^0xFF|PartNum/i); $pn=&hex2ascii($pn); if ($pn) { # Hack: Ballistic modules may have mfg Undefined $mem_mfg=", Crucial Technology" if (! $mem_mfg && $pn =~ /^BL/); if ($mem_mfg) { $pn=" $pn"; } else { $pn=", $pn"; } } } if ($line =~ /Physical Memory Array:/) { $tmp=&mychomp($line); $tmp=~s/^ *Physical Memory Array: *//g; $cpu_membank++ if ($physmemarray ne $tmp); $physmemarray=$tmp; } if ($line =~ /Size:/) { $simmsize=$line; $simmsize=~s/^ *Size: //g; $simmsize=~s/ bytes//g; $simmsize=0 if ($simmsize =~ /Not Populated/); $simmsize /= $meg; } if ($line =~ /Memory Type:/) { # Ignore FLASH (System ROM) if ($line =~ /FLASH/i) { $flag_smb_memdevice=0; } else { $memtype=$line; $memtype=~s/^ *Memory Type:.*\((.*)\).*/$1/g; $memtype .= " " if ($formfactor); $memtype="" if ($memtype =~ /Memory Type:|^other/); } } if ($line =~ /Form Factor:/) { $formfactor=$line; $formfactor=~s/^ *Form Factor:.*\((.*)\).*/$1/g; $formfactor="" if ($formfactor =~ /Form Factor:/); } $smb_mdf="Fast-Page " if ($line =~ /SMB_MDF_FASTPG/); $smb_mdf="Synchronous " if ($line =~ /SMB_MDF_SYNC/); $smb_mdf="EDO " if ($line =~ /SMB_MDF_EDO/); if ($line =~ /^ *Speed: *\d+ *MHz/) { $maxmembusspeed=$line; $maxmembusspeed=~s/^ *Speed: *(\d+) *MHz/${1}MHz/g; } if ($line =~ /Bank Locator:|^ *ID *SIZE *TYPE/ && $socket) { $bank_label=$line; $bank_label=~s/^ *(Bank Locator:|ID *SIZE *TYPE) *//g; $bank_label=~s/ *SLOT$//ig; $bank_label="BANK $bank_label" if ($bank_label =~ /^.$/); $bank_label="" if ($bank_label eq $socket || $bank_label eq "BANK"); if ($socket =~ /^CPU/ && $socket !~ /$bank_label/) { $socket .= "_$bank_label"; $bank_label=""; } $bank_label=" $bank_label" if ($bank_label); $flag_smb_memdevice=0; # Don't overwrite duplicate socket names if (! defined($smbios_mem{"$socket"})) { # Add CPU to X4170/X4270/X4275/X6270/X6275 if ($model =~ /Sun .*X(4[12]7[05]|627[05])\b/i && $socket !~ /CPU/) { $bank_label="" if ($bank_label =~ /\/P\d+$/); $cpu_number=$CPUSocketDesignation[$cpu_membank]; $cpu_number=~s/\s*//g; $socket="${cpu_number}_$socket"; } if ($model =~ /W1100z\b/i && $model !~ /2100z\b/i && $socket =~ /DIMM[5-8]/) { # DIMM5-DIMM8 don't exist on W1100z } else { $smbios_mem{"$socket$bank_label"}=($simmsize) ? "${simmsize}MB $smb_mdf$memtype$formfactor$mem_mfg$pn" : ""; $sockets_used=""; } } } } } $tmp=scalar(keys %smbios_mem); if (defined($tmp)) { if ($tmp) { &pdebug("Memory found with smbios"); &show_header; if (! &is_virtualmachine) { for (sort alphanumerically keys %smbios_mem) { if ($smbios_mem{$_}) { print "$_: $smbios_mem{$_}\n"; $simmsize=$smbios_mem{$_}; $simmsize=~s/^.*\b(\d+)M[Bb].*/$1/; $smbios_memory += $simmsize if ($simmsize); } else { &add_to_sockets_empty($_); } } } $totmem=$installed_memory; &print_empty_memory("memory sockets"); &finish; &pdebug("exit"); exit; } } } sub check_kstat { &pdebug("in check_kstat"); $instance=0; foreach $line (@kstat) { $line=&dos2unix($line); $_=&mychomp($line); # cpu thread instance number if (/\scpu_info\s+instance:\s+/) { ($instance)=(/.*\s(\d+)\s*$/); } if (/^\s*brand\s/) { ($val)=(/^\sbrand\s*(\S.*)\s*$/); push(@kstat_brand, "$val") if ($val); } if (/\sclock_MHz\s/) { ($val)=(/.*\s(\d+)\s*$/); push(@kstat_MHz, "$val") if ($val); } # count # of threads per unique core_id for each chip if (/\score_id\s/) { ($val)=(/.*\s(\d+)\s*$/); $kstat_core_id{$instance}=$val; $kstat_core{$val}++; } # number of cores per chip if (/\sncore_per_chip\s/) { ($val)=(/.*\s(\d+)\s*$/); $kstat_ncore_per_chip{$instance}=$val; } # max number of cpus (threads) per chip if (/\sncpu_per_chip\s/) { ($val)=(/.*\s(\d+)\s*$/); $kstat_ncpu_per_chip{$instance}=$val; } $foundGenuineIntel=1 if (/\svendor_id\s+GenuineIntel/); } if ($foundGenuineIntel && $instance) { # Assume all CPUs are same for ($val=0; $val <= $instance; $val++) { last if (! defined($kstat_core_id{$val}) || ! defined($kstat_ncore_per_chip{$val}) || ! defined($kstat_ncpu_per_chip{$val})); $kstat_checked=1; if ($kstat_ncpu_per_chip{$val} == 2 * $kstat_ncore_per_chip{$val}) { # CPU is hyper-thread capable, but it may not be # enabled in the BIOS &pdebug("in check_kstat, found CPU capable of Hyper-Threading") if (! $hyperthreadcapable); $hyperthreadcapable=1; if ($kstat_core{$kstat_core_id{$val}} == 2) { # Hyper-Thread is enabled in BIOS. # Only change corecnt if not already # done earlier in check_psrinfo_pv. $corecnt /= 2 if (! $hyperthread); $hyperthread=1; &pdebug("hyperthread=1: from kstat, cputype=$cputype"); last; } } } } elsif (@kstat_brand && @kstat_MHz) { @kstat_brandMHz=(); @kstat_brand_arr=(); @kstat_MHz_arr=(); $i=0; foreach $brand (@kstat_brand) { $kstat_brandMHz{$brand,$kstat_MHz[$i]}++; push(@kstat_brand_arr, "$brand") if (! grep($_ eq $brand, @kstat_brand_arr)); push(@kstat_MHz_arr, "$kstat_MHz[$i]") if (! grep($_ eq $kstat_MHz[$i], @kstat_MHz_arr)); $i++; } @kstat_cpubanners=(); # return unless have mix of CPUs or is VM return if ($#kstat_brand_arr == 0 && $#kstat_MHz_arr == 0 && ! &is_virtualmachine); foreach $brand (@kstat_brand_arr) { foreach $MHz (@kstat_MHz_arr) { if ($kstat_brandMHz{$brand,$MHz}) { $cputype=$brand; if ($isX86) { $cputype=&multicore_cputype($cputype,$corecnt); } else { &multicore_cpu_cnt; } $tmp=""; $cnt=$kstat_brandMHz{$brand,$MHz} / $corecnt; $cpucntfrom="kstat"; $tmp .= "$cnt X " if ($cnt > 1); push(@kstat_cpubanners, "$tmp$cputype ${MHz}MHz"); } } } $i=0; foreach (@kstat_cpubanners) { $kstat_cpubanner .= ", " if ($i); $kstat_cpubanner .= $_; $i++; } $kstat_cpubanner=&cleanup_cputype($kstat_cpubanner); &pdebug("in check_kstat, kstat_cpubanner=$kstat_cpubanner"); } } sub found_empty_bank { $empty_banks .= "," if ($empty_banks); $boardslot_mem=~s/[: ]//g; $empty_banks .= " Board $boardslot_mem @_"; } sub print_empty_memory { return if (&is_virtualmachine || $empty_memory_printed); $s=shift; print "empty $s: "; $sockets_empty=~s/^\s*//; $sockets_empty=~s/^,\s*//; print (($sockets_empty) ? "$sockets_empty\n" : "None\n"); $empty_memory_printed=1; } sub print_bios_error { return if (&is_virtualmachine); print " An upgraded BIOS from your manufacturer "; if (&check_dmidecode_ver != 0) { print "or a newer version of dmidecode\n from "; print "$dmidecodeURL "; } print "may fix this issue.\n This is a BIOS "; print "or dmidecode " if (&check_dmidecode_ver != 0); print "bug, not a bug in memconf"; print " or dmidecode" if (&check_dmidecode_ver == 0); print ".\n"; &check_dmidecode_ver(1); $recognized=0; $exitstatus=1; } sub found_nvsimm_bank { $nvsimm_banks .= ", Board $boardslot_mem @_"; } sub recommend_prtdiag_patch { # Sun BugID 4664349 print " This may be corrected by installing "; if ($osrel eq "5.9") { print "Sun patch 113221-03 or 118558-06 or later.\n"; } elsif ($osrel eq "5.8") { print "Sun patch 109873-26 or 111792-11 or later.\n"; } else { print "a Sun patch on this system.\n"; } } sub numerically { $a <=> $b; } sub alphanumerically { local($&, $`, $', $1, $2); # Sort numbers numerically return $a cmp $b if ($a !~ /\D/ && $b !~ /\D/); # Handle things like CH0/D0, p0.d0, DIMM1_A, Board 1,1A return $a cmp $b if ($a =~ /[\/\.,_]/ && $b =~ /[\/\.,_]/); # Handle things like DIMM 1A return $a cmp $b if ($a =~ /\d\D$/ && $b =~ /\d\D$/); # Handle things like DIMM 1 BANK A, ..., DIMM 12 BANK D if ($a =~ /(.*\D)(\d+)\D+$/) { ($a1, $a2) = ($1, $2); if ($b =~ /(.*\D)(\d+)\D+$/) { ($b1, $b2) = ($1, $2); return $a2 <=> $b2 if ($a1 eq $b1); } } # Handle things like DIMM1, ..., DIMM10 if ($a =~ /^(\D+)(\d+)\b/) { ($a1, $a2) = ($1, $2); if ($b =~ /^(\D+)(\d+)\b/) { ($b1, $b2) = ($1, $2); return $a2 <=> $b2 if ($a1 eq $b1); } } # Default is to sort alphabetically return $a cmp $b; } sub lc { $s=shift; return "" if (! defined($s)); $s=~tr/[A-Z]/[a-z]/; return $s; } sub dos2unix { # Convert "CR LF" or "CR" to "LF" $s=shift; $s=~s/\r\n/\n/g; $s=~s/\r/\n/g; return $s; } sub convert_freq { ($freqx)=@_; if ($isX86) { $freq=int(hex("0x$freqx") / 10000 + 0.5); } else { if ($freqx =~ /'/) { $freqpack=$freqx; $freqpack=~s/'//g; @frequnpack=unpack("C*",$freqpack); $freqx=""; foreach $field (@frequnpack) { $freqx.=sprintf("%02lx", $field); } if ($#frequnpack < 3) { $freqx.="00"; } } $freq=int(hex("0x$freqx") / 1000000 + 0.5); } return $freq; } sub mychomp { # Used instead of chop or chomp for compatibility with perl4 and perl5 ($a)=@_; return "" if (! defined($a)); $a=~s,$/$,,g; return $a; } sub hex2ascii { $_=shift; return $_ if (! /^0x/); s/0x(([0-9a-f][0-9a-f])+)/pack('H*', $1)/ie; s/[\x00|\s]+$//; # remove trailing nulls and spaces return $_; } sub pdebug { if ($debug == 1) { print "DEBUG: @_\n"; } elsif ($debug == 2) { printf "DEBUG time %.2f", ((times)[0] - $starttime); print ": @_\n"; } } sub run { &pdebug("Running @_"); `@_ 2>&1`; } sub read_prtdiag_bank_table { # prtdiag Bank Table $simmsize=substr($line,33,5); if ($simmsize =~ /\dGB/) { $simmsize=~s/GB//g; $simmsize *= 1024; } else { $simmsize=~s/MB//g; } if (! $prtdiag_banktable_has_dimms || $line =~ / 0$/) { # Interleave Way = 0 $simmsize /= 2; } if ($prtdiag_banktable_has_dimms && $line =~ / 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15/) { # Interleave Way = 16 $simmsize *= 4; $intcnt=1; push(@simmsizesfound, "$simmsize"); } elsif ($intcnt) { # Interleave Way = 16 $intcnt++; $simmsize *= 4; } $a=substr($line,9,2); $a=~s/ //g; $b=substr($line,23,1); $sz=&show_memory_label($simmsize); $grpsize{$a,$b}=$sz; $memlength=length($line); if ($memlength > 49) { $grpinterleave{$a,$b}=substr($line,49,40) if (substr($line,49,40)); } if ($intcnt == 0) { push(@simmsizesfound, "$simmsize"); $simmsize=&show_memory_label($simmsize) . " "; if (! $prtdiag_banktable_has_dimms) { $newline=substr($line,0,38) . " 2x" . substr($simmsize,0,5); $newline .= substr($line,42,20) if ($memlength > 38); } } $intcnt=1 if ($prtdiag_banktable_has_dimms && $line =~ / 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15/); $intcnt=0 if ($intcnt == 16); } sub read_prtdiag_memory_segment_table { # prtdiag Memory Segment Table $simmsize=($line =~ /\dGB/) ? substr($line,19,1) * 512 : substr($line,19,3) / 2; $grp=substr($line,-2,2); $grp=~s/ //g; if ($grp eq "-") { $grp=$grpcnt; $grpcnt++; } push(@simmsizesfound, "$simmsize"); $simmsize=&show_memory_label($simmsize); $grpsize{0,$grp}=$simmsize; } $motherboard=""; $realmodel=""; $manufacturer=""; $i=0; # May not have had permission to run prtconf, so see if prtdiag works &check_for_prtdiag; if ($diagbanner) { if (! $filename || $SUNWexplo) { $model=$platform; $model=~s/SUNW,//g; $model=~s/ORCL,//g; } else { $model=$diagbanner; $model=~s/ /-/g; # define $model for systems with $diagbanner != $model $model="Ultra-4" if ($diagbanner =~ /Sun.Enterprise.450\b/); $model="Sun-Blade-1000" if ($diagbanner =~ /Sun.Blade.1000\b/); $model="Sun-Fire-280R" if ($diagbanner =~ /Sun.Fire.280R\b/); $model="Netra t1" if ($diagbanner =~ /Netra.t1\b/); $model="Netra-T4" if ($diagbanner =~ /Netra.T4\b/); $model="Sun-Blade-100" if ($diagbanner =~ /Sun.Blade.1[05]0\b/); $model="Netra-T12" if ($diagbanner =~ /Sun.Fire.V1280\b/); $model="Serverblade1" if ($diagbanner =~ /Serverblade1\b/); $model="Ultra-Enterprise" if ($diagbanner =~ /Enterprise.(E?[3-6][05]00|10000)\b/); } # Check model and banner here in case we don't have prtconf data &check_model; &check_banner; } foreach $line (@config) { $line=&dos2unix($line); $line=&mychomp($line); $config_permission=1 if ($line =~ /Node /); if ($line =~ /Permission denied/i) { $permission_error="ERROR: $line" if (! $diagbanner || ! $prtdiag_has_mem); } if ($line =~ /(^\[Component\]:\s+Memory|cstm.*selclass qualifier )/) { # for HP-UX regression test file &hpux_check; &hpux_cprop if ($line =~ /^\[Component\]:\s+Memory/); &hpux_cstm; } if ($line =~ /banner-name:/ && ! $banner) { $banner=$line; $banner=~s/\s+banner-name:\s+//; $banner=~s/'//g; $banner=~s/SUNW,//g; $banner=~s/ORCL,//g; $banner=~s/TWS,//g; $banner=~s/CYCLE,//g; $banner=~s/\s+$//; &check_banner; } if ($line =~ /model:.*AXUS/) { # AXUS clones with their name on OBP $manufacturer="AXUS"; } if (($line =~ /SUNW,(Ultra-|SPARC|S240|JavaEngine1|Ultra.*[Ee]ngine)/ || $line =~ /SUNW,(Ultra.*Netra*|Premier-24|UltraAX-|Netra|Grover)/ || $line =~ /SUNW,(Enchilada|Serverblade1|Enterprise|A[0-9]|T[0-9])/ || $line =~ /ORCL,SPARC-|Sun.4|SUNW,Axil-|^i86pc|^i86xpv|^i86xen/ || $line =~ /model:\s+'(SPARC CPU|SPARC CPCI)-/ || $line =~ /\s+name:.*(SUNW,Sun-|'i86pc'|COMPstation|Tadpole)/ || $line =~ /\s+name:.*(Auspex|S-4|FJSV,GP|CompuAdd|RDI,)/) && $line !~ /\s+:Description\s+/ && $line !~ /\s+:*whoami:*\s+/ && $line !~ /\s+:*impl-arch-name:*\s+/ && $line !~ /Sun 4x Quad/i) { $model=$line; $model=~s/\s+name:\s+//; $model=~s/\s+model:\s+//; $model=~s/\s+:binding-name\s+//; $model=~s/\s+:PlatformName\s+//; $model=~s/'//g; $model=~s/\s+$//; &check_model; if ($line =~ /CompuAdd/) { $manufacturer="CompuAdd"; if ($model eq "SS-2") { $banner=$model if (! $banner); $bannermore="SPARCstation 2"; $modelmore="SPARCstation 2"; } } } $foundname=1 if ($line =~ /\s+name:\s+/); if ($line =~ /\s+model:\s+'.+,/ && ! $foundname) { # Ultra 5/10 motherboard is 375-xxxx part number # SS10/SS20 motherboard is Sxx,501-xxxx part number if ($line =~ /,(375|500|501)-/) { $motherboard=$line; $motherboard=~s/\s+model:\s+//; $motherboard=~s/'//g; } } if ($line =~ /\sname:\s+'memory'/) { $j=$i - 2; if ($config[$j] =~ /\sreg:\s/) { $gotmemory=&mychomp($config[$j]); } elsif ($config[$j - 1] =~ /\sreg:\s/) { $gotmemory=&mychomp($config[$j - 1]); } elsif ($config[$j + 1] =~ /\sreg:\s/) { $gotmemory=&mychomp($config[$j + 1]); } } if ($line =~ /\sdevice_type:\s+'memory-bank'/) { $j=$i - 3; if ($config[$j] =~ /\sreg:\s/ && $config[$j] !~ /.00000000$/) { $config[$j]=~s/\s+reg:\s+//; $gotmemory=($gotmemory) ? "$gotmemory.$config[$j]" : $config[$j]; $gotmemory=&mychomp($gotmemory); } } # The following is not used yet #if ($line =~ /\sdevice_type:\s+'memory-module'/) { # if ($config[$i - 2] =~ /\sreg:\s/) { # $config[$i - 3]=~s/\s+socket-name:\s+//; # if ($gotmodule) { # $gotmodule .= ".$config[$i - 3]"; # } else { # $gotmodule=$config[$i - 3]; # } # $gotmodule=&mychomp($gotmodule); # $config[$i - 2]=~s/\s+reg:\s+//; # @module=split(/\./, $config[$i - 2]); # $gotmodule .= ".$module[3]"; # $gotmodule=&mychomp($gotmodule); # $config[$i + 1]=~s/\s+name:\s+//; # $config[$i + 1] =~ y/[a-z]/[A-Z]/; # $gotmodule .= ".$config[$i + 1]"; # $gotmodule=&mychomp($gotmodule); # $gotmodule=~s/'//g; # } #} if ($line =~ /\ssimm-use:\s+/) { # DIMM usage on Fujitsu GP7000 $gotmodule=&mychomp($config[$i]); $gotmodule=~s/\s+simm-use:\s+//; $slotname0="SLOT0" if ($banner =~ /GP7000\b/); } if ($line =~ /\scomponent-name:\s+'.*CPU.*'/) { # CPUs on Fujitsu GP7000F and PrimePower systems $slotname=$line; $slotname=~s/\s+component-name:\s+//; $slotname=~s/'//g; $gotcpunames=($gotcpunames) ? "$gotcpunames $slotname" : $slotname; $boardname=$slotname; $boardname=~s/-.*//g; if ($boardname ne $slotname) { if ($gotcpuboards) { $gotcpuboards .= " $boardname" if ($gotcpuboards !~ /\b$boardname\b/); } else { $gotcpuboards=$boardname; } } } if ($line =~ /\sdevice_type:\s+'memory-module'/) { # DIMM usage on Fujitsu GP7000F and PrimePower systems $slotname=""; if ($config[$i - 3] =~ /\scomponent-name:\s/) { $slotname=$config[$i - 3]; } if ($config[$i - 4] =~ /\scomponent-name:\s/) { $slotname=$config[$i - 4]; } if ($slotname) { $slotname=~s/\s+component-name:\s+//; $slotname=~s/'//g; $slotname=&mychomp($slotname); $gotmodulenames=($gotmodulenames) ? "$gotmodulenames.$slotname" : $slotname; $slotname0=$slotname if (! $slotname0); $config[$i - 1]=~s/\s+reg:\s+//; @module=split(/\./, $config[$i - 1]); $gotmodulenames .= ".$module[1]"; $gotmodulenames=&mychomp($gotmodulenames); } } if ($line =~ /\sname:\s+'cgfourteen'/) { # Determine size of VSIMM # Currently assumes only one VSIMM is installed if ($config[$i - 2] =~ /\sreg:\s/) { $sx_line=&mychomp($config[$i - 2]); } elsif ($config[$i - 3] =~ /\sreg:\s/) { $sx_line=&mychomp($config[$i - 3]); } @sxline=split(/\./, $sx_line); $sxmem=hex("0x$sxline[5]") / $meg; } if ($line =~ /501-2197/) { # 1MB Prestoserve NVSIMMs (SS1000/SC2000) if ($config[$i + 1] =~ /\sreg:\s/) { $nv_line=&mychomp($config[$i + 1]); } elsif ($config[$i + 2] =~ /\sreg:\s/) { $nv_line=&mychomp($config[$i + 2]); } @nvline=split(/\./, $nv_line); $nvmem += hex("0x$nvline[2]") / $meg; } if ($line =~ /501-2001/) { # 2MB Prestoserve NVSIMMs (SS10/SS20) if ($config[$i + 1] =~ /\sreg:\s/) { $nv_line=&mychomp($config[$i + 1]); } elsif ($config[$i + 2] =~ /\sreg:\s/) { $nv_line=&mychomp($config[$i + 2]); } @nvline=split(/\./, $nv_line); $nvmem += hex("0x$nvline[2]") / $meg; $nvmem1=1 if ($nvline[1] eq "10000000"); $nvmem2=1 if ($nvline[1] eq "14000000" || $nvline[1] eq "1c000000"); } if ($line =~ /Memory size:\s/ && $installed_memory == 0) { $installed_memory=$line; $installed_memory=~s/^.*size: *(\d*[GM]*[Bb]*).*/$1/; if ($installed_memory =~ /GB/) { $installed_memory=~s/GB//g; $installed_memory *= 1024; } else { $installed_memory=~s/MB//ig; } # prtconf sometimes reports incorrect total memory # 32MB is minimum for sun4u machines if ($installed_memory < 32 && $machine eq "sun4u") { $prtconf_warn="Incorrect total installed memory (${installed_memory}MB) was reported by prtconf."; $installed_memory=0; } # Round up some odd-number total memory values $installed_memory++ if (sprintf("%3d", ($installed_memory + 1) / 2) * 2 != $installed_memory && $installed_memory >= 1023); $BSD=0; # prtconf and prtdiag only have this output $config_cmd="/usr/sbin/prtconf -vp" if ($config_cmd !~ /prtconf/); $config_command="prtconf"; } if ($sysfreq == 0 && $freq) { $sysfreq=$freq; $freq=0; } if ($devtype eq "cpu" || $line =~ /compatible: 'FJSV,SPARC64-/) { if ($cputype =~ /SPARC64-/) { $cpufreq=$freq if ($freq > $cpufreq); } else { $cpufreq=$freq; } $cpuline=$line; $j=$i - 3; while ($cpuline !~ /^$/ && $cpuline !~ /^\r$/) { if ($cpuline =~ /clock-frequency:/) { @freq_line=split(' ', $cpuline); $cpufreq=&convert_freq($freq_line[1]); $sysfreq=$freq if ($sysfreq == 0 && $freq); } elsif ($cpuline =~ /\s(name:|compatible:)\s/ && $cpuline !~ /Sun 4/ && $cpuline !~ /SPARCstation/ && $cpuline !~ /CompuAdd/ && $cpuline !~ /'cpu/ && $cpuline !~ /'core'/) { $cputype=&mychomp($cpuline); $cputype=~s/\s+name:\s+//; $cputype=~s/\s+compatible:\s+//; $cputype=~s/'//g; $cputype=~s/SUNW,//g; $cputype=~s/ORCL,//g; $cputype=~s/FJSV,//g; $cputype=~s/ .*//g; } elsif ($cpuline =~ /\sname:\s/ && ! $model) { $model=&mychomp($cpuline); $model=~s/\s+name:\s+//; $model=~s/'//g; $model=~s/SUNW,//g; $model=~s/ORCL,//g; $model=~s/FJSV,//g; } $j++; $cpuline=($config[$j]) ? $config[$j] : ""; } $freq=0; $cpufreq=$sysfreq if ($sysfreq >= $cpufreq); &pdebug("Checking cputype=$cputype, ncpu=$ncpu, threadcnt=$threadcnt"); if (! $cputype) { $cputype=$machine; $cputype="SPARC" if ($cputype =~ /^sun4/ || $model =~ /Sun 4\//); @bannerarr=split(/\s/, $banner); foreach $field (@bannerarr) { if ($field =~ /SPARC/ && $field !~ /SPARCstation/) { $cputype=$field; } elsif ($field =~ /390Z5/) { $field="TI,TMS$field" if ($field =~ /^390Z5/); $cputype=($cpufreq > 70) ? "SuperSPARC-II $field" : "SuperSPARC $field"; } elsif ($field =~ /RT62[56]/) { $cputype="hyperSPARC $field"; $machine="sun4m"; } } $cputype=~s/[()]//g; } elsif ($cputype =~ /MB86907/) { $cputype="TurboSPARC-II $cputype"; } elsif ($cputype =~ /MB86904|390S10/) { $cputype=($cpufreq > 70) ? "microSPARC-II $cputype" : "microSPARC $cputype"; } elsif ($cputype =~ /,RT62[56]/) { $cputype="hyperSPARC $cputype"; $machine="sun4m"; } elsif ($cputype =~ /UltraSPARC-IV/) { # Count Dual-Core US-IV & US-IV+ as 1 CPU $cputype="Dual-Core $cputype"; $machine="sun4u"; $threadcnt++; $threadcnt=0 if ($threadcnt == 2); # CPU count is better from prtdiag than psrinfo for # US-IV & US-IV+ Dual-Core processors. $use_psrinfo_data=0; } elsif ($cputype =~ /UltraSPARC-T1$/) { # Count 4-Thread (4, 6, or 8 Core) Niagara CPUs as 1 CPU $machine="sun4v"; $threadcnt++; # Number of cores & CPUs counted outside this loop below } elsif ($cputype =~ /UltraSPARC-T2\+/) { # Count 8-Thread (4, 6, or 8 Core) Victoria Falls CPUs as 1 CPU $machine="sun4v"; $threadcnt++; # Number of cores & CPUs counted outside this loop below } elsif ($cputype =~ /UltraSPARC-T2$/) { # Count 8-Thread (4 or 8 Core) Niagara-II CPUs as 1 CPU $machine="sun4v"; $threadcnt++; # Number of cores & CPUs counted outside this loop below } elsif ($cputype =~ /SPARC-T3$/) { # Count 8-Thread (8 or 16 Core) Rainbow Falls CPUs as 1 CPU $machine="sun4v"; $threadcnt++; # Number of cores & CPUs counted outside this loop below } elsif ($cputype =~ /SPARC-T4$/) { # Count 8-Thread 8-Core SPARC-T4 CPUs as 1 CPU $machine="sun4v"; $threadcnt++; # Number of cores & CPUs counted outside this loop below } elsif ($cputype =~ /SPARC-T5$/) { # Count 8-Thread 16-Core SPARC-T5 CPUs as 1 CPU $machine="sun4v"; $threadcnt++; # Number of cores & CPUs counted outside this loop below } elsif ($cputype =~ /SPARC64-VI$/ && $devtype eq "cpu") { # Count Dual-Core Dual-Thread as 1 CPU $machine="sun4u"; $threadcnt++; # Number of cores & CPUs counted outside this loop below } elsif ($cputype =~ /SPARC64-VII\+\+$/ && $devtype eq "cpu") { # Count Quad-Core Dual-Thread as 1 CPU $machine="sun4u"; $threadcnt++; # Number of cores & CPUs counted outside this loop below } elsif ($cputype =~ /SPARC64-VII\+$/ && $devtype eq "cpu") { # Count Quad-Core Dual-Thread as 1 CPU $machine="sun4u"; $threadcnt++; # Number of cores & CPUs counted outside this loop below } elsif ($cputype =~ /SPARC64-VII$/ && $devtype eq "cpu") { # Count Quad-Core Dual-Thread as 1 CPU $machine="sun4u"; $threadcnt++; # Number of cores & CPUs counted outside this loop below } elsif ($cputype eq "SPARC64-VIII" && $devtype eq "cpu") { # Guess on the Venus SPARC64-VIII name ??? # Count 8-Core Dual-Thread as 1 CPU $machine="sun4u"; $threadcnt++; # Number of cores & CPUs counted outside this loop below } elsif ($cputype =~ /SPARC64-X$/ && $devtype eq "cpu") { # Count 16-Core Dual-Thread as 1 CPU $machine="sun4v"; $threadcnt++; # Number of cores & CPUs counted outside this loop below } if ($threadcnt == 0 && $devtype eq "cpu") { $ncpu++; $cpucnt{"$cputype $cpufreq"}++; $cpucntfrom=$config_command; } $devtype=""; if (! $kernbit) { $kernbit=32 if ($machine =~ /sun4[cdm\b]/); $kernbit=64 if ($machine eq "sun4v" || $cputype =~ /UltraSPARC-III|UltraSPARC-IV|SPARC64/); } } if ($line =~ /device_type:/) { @dev_line=split(/\'/, $line); $devtype=$dev_line[1]; } if ($line =~ /clock-frequency:/) { @freq_line=split(' ', $line); $freq=&convert_freq($freq_line[1]); } if ($line =~ /\sversion:\s+'OBP/ && ! $romver) { $romver=$line; $romver=~s/\s+version:\s+//; $romver=~s/'//g; @romverarr=split(/\s/, $romver); $romvernum=$romverarr[1]; } if ($line =~ /compatible:\s+'sun4.'/ && ! $osrel) { @compatible_line=split(/\'/, $line); $machine=$compatible_line[1]; } if ($line =~ /value='.*AMD Opteron/ && $cputype eq "x86") { $cputype_prtconf=$line; $cputype_prtconf=~s/.*='//; $cputype_prtconf=~s/'//g; } $i++; } &multicore_cpu_cnt; &check_cpuinfo; &check_xm_info; if (! $osrel) { if ($BSD) { $osrel="4.X"; $config_cmd="/usr/etc/devinfo -pv"; $config_command="devinfo"; $cpucntfrom="devinfo"; # } elsif ($os =~ /Linux|FreeBSD/) { # $osrel="2.X"; # Could also be 3.X Linux kernel, so leave empty } else { $osrel="5.X"; $solaris="2.X"; if ($machine =~ /86/) { $solaris .= " X86"; } elsif ($machine =~ /sun4/) { $solaris .= " SPARC"; } $config_cmd="/usr/sbin/prtconf -vp"; $config_command="prtconf"; } } $memfrom=$config_command; #$sysfreq=$freq if ($sysfreq == 0 && $freq); #$cpufreq=$sysfreq if ($sysfreq > $cpufreq && $ncpu); @romverarr=split(/\./, $romvernum) if ($romver); $romvermajor=($romverarr[0]) ? $romverarr[0] : 2; $romverminor=($romverarr[1]) ? $romverarr[1] : 0; $romverminor=0 if (! $romverminor || $romverminor eq "X"); if ($banner =~ /^ \(/) { # banner-name does not include the eeprom banner name. This happens # sometimes when OBP 3.23 is installed on Ultra-60/E220R and # Ultra-80/E420R systems. $bannermore="Ultra 60 or Enterprise 220R" if ($model eq "Ultra-60"); $bannermore="Ultra 80, Enterprise 420R or Netra t 1400/1405" if ($model eq "Ultra-80"); } # # SPARCengine systems # $ultra="AX" if ($motherboard =~ /501-3043/); $ultra="AX-300" if ($motherboard =~ /501-5037/); $ultra="AXi" if ($motherboard =~ /501-4559/); $ultra="AXmp" if ($banner =~ /UltraAX-MP/ || $model =~ /UltraAX-MP/ || $motherboard =~ /501-(5296|5487|5670)/); $ultra="AXmp+" if ($banner =~ /UltraAX-MP\+/ || $model =~ /UltraAX-MP\+/ || $motherboard =~ /501-4324/); $ultra="AXe" if ($banner =~ /UltraAXe\b/ || $model =~ /UltraAX-e\b/ || $motherboard =~ /375-0088/); $ultra="AX-e2" if ($banner =~ /Netra AX1105-500\b/ || $model =~ /UltraAX-e2\b/ || $motherboard =~ /375-0128/); $ultra="Netra X1" if ($banner =~ /Netra X1\b/ || $motherboard =~ /375-3015/); $ultra="Netra T1 200" if ($banner =~ /Netra T1 200\b/ || $motherboard =~ /375-0132/); $ultra="Sun Fire V100" if ($banner =~ /Sun Fire V100\b/); # Sun Fire V120/Netra 120 can use motherboard 375-0132 like Netra T1 200 above $ultra="Sun Fire V120" if ($banner =~ /Sun Fire V120\b/); $ultra="Netra 120" if ($banner =~ /Netra 120\b/); if ($ultra =~ /AX/) { if ($banner !~ /SPARCengine.*Ultra/) { $tmp="(SPARCengine Ultra $ultra)"; $bannermore=($bannermore) ? "$tmp $bannermore" : $tmp; } } if ($model =~ /Ultra-5_10\b/) { if ($banner =~ /\bVoyagerIIi\b/) { # Tadpole Voyager IIi has 8 DIMM slots, but prtconf reports # it as an Ultra 5/10 $model="VoyagerIIi"; $ultra="VoyagerIIi"; } } $ultra="Sun Blade 150" if ($banner =~ /Sun Blade 150\b/ || $diagbanner =~ /Sun Blade 150\b/); $ultra="UP-20" if ($banner =~ /\bUP-20\b/); # untested ??? $ultra="UP-520IIi" if ($motherboard =~ /501-4559/ && $banner =~ /\b520IIi\b/); $need_obp2=0; if ($model eq "Sun 4/20" || $model eq "Sun 4/25" || $model eq "Sun 4/40" || $model eq "Sun 4/50" || $model eq "Sun 4/60" || $model eq "Sun 4/65" || $model eq "Sun 4/75" || $model eq "SS-2") { $machine="sun4c"; $need_obp2=1 if ($model eq "Sun 4/40" || $model eq "Sun 4/60" || $model eq "Sun 4/65"); } &check_prtdiag if ($isX86); if ($isX86) { # Round up Solaris x86 memory (may have 128MB or more reserved) $installed_memory=&roundup_memory($installed_memory); } if (! $gotmemory && $ultra eq 0 && $machine ne "sun4d" && $boardfound_mem eq 0) { &check_prtdiag; &show_header; if ($installed_memory) { print "total memory = "; &show_memory($installed_memory); } print "$permission_error\n" if ($permission_error); print "$prtconf_warn\n" if ($prtconf_warn); if ($prtdiag_failed == 2) { &found_nonglobal_zone; } else { print "ERROR: no 'memory' line in \"$config_cmd\" output.\n" if ($machine =~ /sun4/); if (! $config_permission && $machine =~ /sun4/ && ! $prtconf_warn) { print " This user "; print (($permission_error) ? "does" : "may"); print " not have permission to run $config_command.\n"; print " Try running memconf as a privileged user like root.\n" if ($uid ne "0"); } elsif ($need_obp2) { print " Upgrading from Open Boot PROM V1.X to V2.X will "; print "allow memconf to\n detect the memory installed.\n"; } elsif ($prtconf_warn =~ /openprom/) { print " Please correct the problem with the openprom device.\n" if ($machine =~ /sun4/); } else { print " This is an unsupported system by memconf.\n" if ($machine =~ /sun4/); } } &show_supported if ($machine !~ /sun4/ && $prtdiag_failed != 2); $exitstatus=1; &mailmaintainer if ($verbose == 3); &pdebug("exit $exitstatus"); exit $exitstatus; } $gotmemory=~s/\s+reg:\s+//; $gotmemory=~s/'//g; @slots=split(/\./, $gotmemory); $slot=1; if ($machine =~ /sun4|i86pc|i86xpv|i86xen/ && $manufacturer && $manufacturer !~ /^Sun\b|^Oracle\b/ && $ultra !~ /SPARC Enterprise M[34589]000 Server/ && ! &is_virtualmachine) { $bannermore=($bannermore) ? "$bannermore clone" : "clone" if ($manufacturer ne "Force Computers"); $modelmore=($modelmore) ? "$modelmore clone" : "clone" if (! $isX86); $clone=1; } # DIMMs are installed in pairs on Ultra 1, 5 and 10; quads on # Ultra 2, 60, 80, 220R, 420R, 450; 8's in Ultra Enterprise # # On 64-bit systems, prtconf format is AAAAAAAA.AAAAAAAA.SSSSSSSS.SSSSSSSS # and on 32-bit systems, prtconf format is AAAAAAAA.AAAAAAAA.SSSSSSSS # where A is for Address, S is for Size. # Minimum module size is 1MB (0x00100000), so strip off last 5 hex digits of LSB # and prepend last 5 digits of MSB, which allows recognizing up to 4500TB! # if ($ultra) { $val0=3; # simmsize is in 3rd and 4th fields $valaddr=2; # address is 2 fields before simmsize $valinc=4; # fields per simm $memtype="DIMM"; } else { $val0=2; # simmsize is in 3rd field $valaddr=1; # address is 1 field before simmsize $valinc=3; # fields per simm } # # Define memory layout for specific systems # if ($model eq "Sun 4/20") { # SLC accepts 4MB SIMMs on motherboard # 501-1676 (4MB 100ns), 501-1698 (4MB 80ns) # 33-bit 72-pin Fast Page Mode (36-bit work also) # Does not support Open Boot PROM V2.X, so devinfo/prtconf output will # not have memory lines. $devname="OffCampus"; $untested=1; $simmrangex="00000010"; $simmbanks=4; $simmsperbank=1; @simmsizes=(4); @socketstr=("U0502","U0501","U0602","U0601"); } if ($model eq "Sun 4/25") { # ELC accepts 4MB or 16MB SIMMs on motherboard # 501-1698 or 501-1812 (4MB 80ns), 501-1822 (16MB 80ns) # 33-bit 72-pin Fast Page Mode (36-bit work also) $devname="NodeWarrior"; $untested=0; $simmrangex="00000010"; $simmbanks=4; $simmsperbank=1; @simmsizes=(4,16); @socketstr=("U0407".."U0410"); @bankstr=("MEM1".."MEM4"); } if ($model eq "Sun 4/40") { # IPC accepts 1MB or 4MB SIMMs on motherboard # 501-1697 (1MB 80ns), 501-1625 (4MB 100ns), 501-1739 (4MB 80ns) # Does not show memory with Open Boot PROM V1.X, but does with OBP V2.X $devname="Phoenix"; $untested=0; $simmrangex="00000010"; $simmbanks=3; $simmsperbank=4; @simmsizes=(1,4); @socketstr=("U0588","U0587","U0586","U0585","U0584","U0591","U0590","U0589","U0678","U0676","U0683","U0677"); @bankstr=(0,0,0,0,1,1,1,1,2,2,2,2); @bytestr=(0..3,0..3,0..3); } if ($model eq "Sun 4/50") { # IPX accepts 4MB or 16MB SIMMs on motherboard # 501-1812 (4MB 80ns), 501-1915 or 501-1822 (16MB 80ns) # 33-bit 72-pin Fast Page Mode (36-bit work also) $devname="Hobbes"; $untested=0; $simmrangex="00000010"; $simmbanks=4; $simmsperbank=1; @simmsizes=(4,16); @socketstr=("U0310","U0309","U0308","U0307"); @bankstr=(0..3); } if ($model eq "Sun 4/60" || $model eq "Sun 4/65") { # SS1 and SS1+ accepts 1MB or 4MB SIMMs on motherboard # 501-1408 (1MB 100ns), 501-1697 (SS1+ only) (1MB 80ns), # 501-1625 (4MB 100ns), 501-1739 (4MB 80ns) # Does not show memory with Open Boot PROM V1.X, but does with OBP V2.X if ($model eq "Sun 4/60") { $devname="Campus"; $untested=0; } else { $devname="CampusB, Campus+"; $untested=1; } $simmrangex="00000010"; $simmbanks=4; $simmsperbank=4; @simmsizes=(1,4); @socketstr=("U0588","U0587","U0586","U0585","U0584","U0591","U0590","U0589","U0678","U0676","U0683","U0677","U0682","U0681","U0680","U0679"); @bankstr=(0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3); @bytestr=(0..3,0..3,0..3,0..3); } if ($model eq "Sun 4/75" || $model eq "SS-2") { # SS2 accepts 4MB SIMMs on motherboard and 32MB or 64MB SBus expansion # card (501-1823 Primary and 501-1824 Secondary) # 501-1739 (4MB 80ns) $devname="Calvin"; $untested=0; $simmrangex="00000010"; $simmbanks=4; $simmsperbank=4; @simmsizes=(4); @socketstr=("U0311","U0309","U0307","U0322","U0312","U0310","U0308","U0321","U0313","U0314","U0315","U0320","U0319","U0318","U0317","U0316"); @bankstr=(0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3); @bytestr=(0..3,0..3,0..3,0..3); } if ($model =~ /SPARCclassic|SPARCstation-LX/) { # Classic-X (4/10) accepts 1MB, 2MB, 4MB and 16MB SIMMs on motherboard # Classic (4/15) and LX (4/30) accepts 4MB and 16MB SIMMs on motherboard # Can accept 32MB SIMMs in bank 1, allowing 128MB total (2x32, 4x16) # Possibly accepts 8MB SIMMs in bank 1 # 501-2289 (1MB), 501-2433 (2MB) on Classic-X only # 501-1991 (4MB), 501-2059 (16MB) # 36-bit 72-pin 60ns Fast Page Mode $devname="Sunergy"; if ($model =~ /SPARCclassic-X/) { $untested=1; @simmsizes=(1,2,4,8,16,32); } else { $untested=0; @simmsizes=(4,8,16,32); } $simmrangex="00000020"; $simmbanks=3; $simmsperbank=2; @socketstr=("U0304","U0303","U0301","U0302","U0402","U0401"); @bankstr=(1,1,2,2,3,3); } if ($model eq "S240") { # Voyager has 16MB on motherboard, plus accepts one or two 16MB or 32MB # Memory cards (501-2327 32MB, 501-2366 16MB) # Motherboard, address 0x00000000-0x007fffff, 0x01000000-0x017fffff # Lower slot=Mem 1, address 0x02000000-0x07ffffff # Upper slot=Mem 2, address 0x0a000000-0x0fffffff $devname="Gypsy"; $untested=0; $memtype="memory card"; $sockettype="slot"; $simmrangex="00000020"; $simmbanks=8; # Count the skipped address range $simmsperbank=1; @simmsizes=(16,32); @socketstr=("motherboard","Mem 1","Mem 1","Mem 1","?","Mem 2","Mem 2","Mem 2"); @orderstr=("","lower slot","lower slot","lower slot","?","upper slot","upper slot","upper slot"); } if ($model eq "JavaEngine1") { # Accepts 8MB, 16MB and 32MB EDO DIMMs $devname="Bali"; $untested=0; $memtype="DIMM"; $simmrangex="00000020"; $simmbanks=2; $simmsperbank=1; @simmsizes=(8,16,32); @socketstr=("J0501","J0502"); @bankstr=(0,1); } if ($model eq "SPARCstation-4") { # Accepts 8MB and 32MB SIMMs on motherboard # 501-2470 (8MB), 501-2471 (32MB) # 168-pin 60ns Fast Page Mode $devname="Perigee"; $untested=0; $simmrangex="00000020"; $simmbanks=5; $simmsperbank=1; @simmsizes=(8,32); @socketstr=("J0301".."J0305"); @bankstr=(0..4); } if ($model eq "SPARCstation-5" || $model eq "micro COMPstation 5" || $model =~ /Axil-255/ || $banner =~ /TWINstation 5G\b/) { # Accepts 8MB and 32MB SIMMs on motherboard # 501-2470 (8MB), 501-2471 (32MB) # 168-pin 60ns Fast Page Mode $devname="Aurora" if ($model eq "SPARCstation-5"); $untested=0; $simmrangex="00000020"; $simmbanks=8; $simmsperbank=1; @simmsizes=(8,32); @socketstr=("J0300".."J0303","J0400".."J0403"); @bankstr=(0..7); if ($banner =~ /TWINstation 5G\b/) { $simmbanks=6; @socketstr=(0..5); } if ($model ne "SPARCstation-5") { $bannermore="SPARCstation 5 clone"; $modelmore="SPARCstation 5 clone"; } } if ($model =~ /SPARCstation-10/ || $model eq "Premier-24" || $motherboard eq "SUNW,S10,501-2365") { # Accepts 16MB and 64MB SIMMs on motherboard # 501-1785 or 501-2273 (16MB 80ns), 501-2479 (16MB 60ns), # 501-2622 (32MB 60ns), 501-1930 (64MB 80ns), 501-2480 (64MB 60ns) # 200-pin 60ns or 80ns Fast Page Mode ECC # 32MB SIMMs not supported according to Sun, but appears to work fine # depending on the OBP revision. OBP 2.12 and older detects the 32MB # SIMM as 16MB, OBP 2.19 and later properly detects the 32MB SIMM. $devname="Campus2" if ($model =~ /SPARCstation-10/); $devname="Campus2+" if ($model =~ /Premier-24/); $untested=0; $simmrangex="00000040"; $simmbanks=8; $simmsperbank=1; $romvernum="2.X" if (! $romvernum); $romverminor=0 if (! $romverminor || $romverminor eq "X"); @simmsizes=(($romvermajor eq 2) && ($romverminor >= 19)) ? (16,32,64) : (16,64); @socketstr=("J0201","J0203","J0302","J0304","J0202","J0301","J0303","J0305"); @orderstr=("1st","3rd","4th","2nd","8th","6th","5th","7th"); @bankstr=(0..7); } if ($model =~ /SPARCstation-20|COMPstation-20S/ || $banner =~ /TWINstation 20G\b/) { # Accepts 16MB, 32MB and 64MB SIMMs on motherboard # 501-2479 (16MB), 501-2622 (32MB), 501-2480 (64MB) # 200-pin 60ns Fast Page Mode ECC $devname="Kodiak" if ($model eq "SPARCstation-20"); $untested=0; $simmrangex="00000040"; $simmbanks=8; $simmsperbank=1; @simmsizes=(16,32,64); @socketstr=("J0201","J0303","J0202","J0301","J0305","J0203","J0302","J0304"); @orderstr=("1st","2nd","3rd","4th","5th","6th","7th","8th"); @bankstr=(0..7); if ($model !~ /SPARCstation-20/) { $bannermore="SPARCstation 20 clone"; $modelmore="SPARCstation 20 clone"; } if ($model eq "SPARCstation-20I") { $bannermore="(SPARCstation-20I) clone"; $modelmore="clone"; } if ($banner =~ /TWINstation 20G\b/) { # @socketstr=("J0201","J0303","J0202","J0301","J0305","J0203","J0302","J0304"); # @orderstr=("1st","6th","2nd","4th","8th","3rd","5th","7th"); @socketstr=(0..7); @orderstr=(""); } } if ($model eq "SPARCsystem-600" || $model =~ /Sun.4.600/) { # Accepts 4MB or 16MB SIMMs on motherboard # Accepts 1MB, 4MB or 16MB SIMMs on VME expansion cards # A memory bank is 16 SIMMs of the same size and speed # Minimum memory configuration is 16 SIMMs in Bank 0 on the motherboard # Motherboard Bank 1 must be populated before adding expansion cards # Up to two VME memory expansion cards can be added # Use 4MB SIMM 501-1739-01 or 501-2460-01 # Use 16MB SIMM 501-2060-01 $devname="Galaxy"; $untested=0; $simmrangex="00000100"; $simmbanks=2; # 2 banks on CPU board, 4 banks on each expansion cards $simmsperbank=16; @simmsizes=(4,16); # Sockets, banks and bytes on motherboard @socketstr=("U1107","U1307","U1105","U1305","U1103","U1303","U1101","U1301","U1207","U1407","U1205","U1405","U1203","U1403","U1201","U1401","U1108","U1308","U1106","U1306","U1104","U1304","U1102","U1302","U1208","U1408","U1206","U1406","U1204","U1404","U1202","U1402"); @bankstr=(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1); @banksstr=("Motherboard bank 0","Motherboard bank 1"); @bytestr=("0L0","0L1","1L0","1L1","2L0","2L1","3L0","3L1","4L0","4L1","5L0","5L1","6L0","6L1","7L0","7L1","0H0","0H1","1H0","1H1","2H0","2H1","3H0","3H1","4H0","4H1","5H0","5H1","6H0","6H1","7H0","7H1"); # Sockets, banks and bytes on VME expansion cards @socketstr_exp=("U1501","U1503","U1505","U1507","U1601","U1603","U1605","U1607","U1701","U1703","U1705","U1707","U1801","U1803","U1805","U1807","U1502","U1504","U1506","U1508","U1602","U1604","U1606","U1608","U1702","U1704","U1706","U1708","U1802","U1804","U1806","U1808","U1901","U1903","U1905","U1907","U2001","U2003","U2005","U2007","U2101","U2103","U2105","U2107","U2201","U2203","U2205","U2207","U1902","U1904","U1906","U1908","U2002","U2004","U2006","U2008","U2102","U2104","U2106","U2108","U2202","U2204","U2206","U2208"); @bankstr_exp=("B0","B0","B0","B0","B0","B0","B0","B0","B0","B0","B0","B0","B0","B0","B0","B0","B1","B1","B1","B1","B1","B1","B1","B1","B1","B1","B1","B1","B1","B1","B1","B1","B2","B2","B2","B2","B2","B2","B2","B2","B2","B2","B2","B2","B2","B2","B2","B2","B3","B3","B3","B3","B3","B3","B3","B3","B3","B3","B3","B3","B3","B3","B3","B3"); @bytestr_exp=("0L0","0L1","1L0","1L1","2L0","2L1","3L0","3L1","4L0","4L1","5L0","5L1","6L0","6L1","7L0","7L1","0H0","0H1","1H0","1H1","2H0","2H1","3H0","3H1","4H0","4H1","5H0","5H1","6H0","6H1","7H0","7H1","8L0","8L1","9L0","9L1","aL0","aL1","bL0","bL1","cL0","cL1","dL0","dL1","eL0","eL1","fL0","fL1","8H0","8H1","9H0","9H1","aH0","aH1","bH0","bH1","cH0","cH1","dH0","dH1","eH0","eH1","fH0","fH1"); } if ($model eq "Ultra-1" || $ultra eq 1) { # Accepts 16MB, 32MB, 64MB or 128MB DIMMs on motherboard # 501-2479 (16MB), 501-2622 (32MB), 501-2480 or 501-5691 (64MB), # 501-3136 (128MB) # 200-pin 60ns Fast Page Mode ECC $devname="Neutron (Ultra 1), Electron (Ultra 1E), Dublin (Ultra 150)"; $familypn="A11 (Ultra 1), A12 (Ultra 1E)"; $untested=0; $simmrangex="00000100"; $simmbanks=4; $simmsperbank=2; @simmsizes=(16,32,64,128); @socketstr=("U0701","U0601","U0702","U0602","U0703","U0603","U0704","U0604"); @bankstr=("0L","0H","1L","1H","2L","2H","3L","3H"); @bytestr=("00-15","16-31","00-15","16-31","00-15","16-31","00-15","16-31"); } if ($model eq "Ultra-2" || $ultra eq 2) { # Accepts 16MB, 32MB, 64MB or 128MB DIMMs on motherboard $devname="Pulsar"; $familypn="A14"; $untested=0; $simmrangex="00000200"; $simmbanks=4; $simmsperbank=4; @simmsizes=(16,32,64,128); @socketstr=("U0501","U0401","U0701","U0601","U0502","U0402","U0702","U0602","U0503","U0403","U0703","U0603","U0504","U0404","U0704","U0604"); @groupstr=(0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3); @bankstr=("0L","0H","1L","1H","0L","0H","1L","1H","0L","0H","1L","1H","0L","0H","1L","1H"); @bytestr=("00-15","16-31","32-47","48-63","00-15","16-31","32-47","48-63","00-15","16-31","32-47","48-63","00-15","16-31","32-47","48-63"); } if ($model eq "Ultra-30" || $ultra eq 30) { # Also Netra t 1100 # Accepts 16MB, 32MB, 64MB or 128MB DIMMs on motherboard # 501-2479 (16MB), 501-2622 (32MB), 501-2480 or 501-5691 (64MB), # 501-3136 (128MB) # 200-pin 60ns Fast Page Mode ECC # Two DIMMs form a pair, two pairs of DIMMs form a quad. # Minimum requirements is two DIMMs in any adjacent pair. # DIMMs can be installed in any order of pairs. # Interleaving requires a fully populated quad. # Each quad addresses 512MB of memory. $devname="Quark (Ultra-30), Lightweight (Netra t 1100)"; $familypn="A16 (Ultra-30), N01 (Netra t 1100)"; $untested=0; # simmrangex, simmbanks, and simmsperbank set later after determining # if interleaving banks using quads rather than pairs @simmsizes=(16,32,64,128); @socketstr=("U0701","U0801","U0901","U1001","U0702","U0802","U0902","U1002","U0703","U0803","U0903","U1003","U0704","U0804","U0904","U1004"); @bankstr=("Quad 0 Pair 0","Quad 0 Pair 0","Quad 0 Pair 1","Quad 0 Pair 1","Quad 1 Pair 0","Quad 1 Pair 0","Quad 1 Pair 1","Quad 1 Pair 1","Quad 2 Pair 0","Quad 2 Pair 0","Quad 2 Pair 1","Quad 2 Pair 1","Quad 3 Pair 0","Quad 3 Pair 0","Quad 3 Pair 1","Quad 3 Pair 1"); } if ($model eq "Ultra-5_10" || $ultra eq "5_10" || $ultra eq 5 || $ultra eq 10) { # Accepts 16MB, 32MB, 64MB, 128MB or 256MB DIMMs on motherboard # 16MB DIMM uses 10-bit column addressing and was not sold # 32, 64, 128 and 256MB DIMMs use 11-bit column addressing # Do not mix 16MB DIMMs with other sizes # 256MB DIMM not supported in Ultra 5 according to Sun documentation, # but they do work as long as you use low-profile DIMMs or take out the # floppy drive. # Memory speed is 60ns if 50ns and 60ns DIMMs are mixed # 2-way interleaving supported with four identical sized DIMMs # 50ns DIMMs supported on 375-0066 & 375-0079 motherboards # Bank 0 DIMM1/DIMM2 0x00000000-0x0fffffff, 0x20000000-0x2fffffff # Bank 1 DIMM3/DIMM4 0x10000000-0x1fffffff, 0x30000000-0x3fffffff $devname="Darwin/Otter (Ultra 5), Darwin/SeaLion (Ultra 10)"; $familypn="A21 (Ultra 5), A22 (Ultra 10)"; $untested=0; $simmrangex="00000100"; $simmbanks=2; $simmsperbank=2; @simmsizes=(16,32,64,128,256); @socketstr=("DIMM1".."DIMM4"); @bankstr=("0L","0H","1L","1H"); $sortslots=0; } if ($model eq "Ultra-60" || $ultra eq 60 || $ultra eq "220R") { # Also Netra t1120/1125 # Accepts 16MB, 32MB, 64MB or 128MB DIMMs on motherboard # 501-2479 (16MB), 501-2622 (32MB), 501-2480 or 501-5691 (64MB), # 501-3136 (128MB) # 200-pin 60ns Fast Page Mode ECC # U1001-U1004 bank 3 address 0xa0000000-0xbfffffff # U0901-U0904 bank 2 address 0x80000000-0x9fffffff # U0801-U0804 bank 1 address 0x20000000-0x3fffffff # U0701-U0704 bank 0 address 0x00000000-0x1fffffff if ($model eq "Ultra-60" || $ultra eq 60) { $devname="Deuterium (Ultra-60), Lightweight 2 (Netra t112x)"; $familypn="A23 (Ultra-60), N02/N04 (Netra t1120), N03 (Netra t1125)"; } if ($ultra eq "220R") { $devname="Razor"; $familypn="A34"; } $untested=0; $simmrangex="00000200"; $simmbanks=6; # Count the skipped address range $simmsperbank=4; @simmsizes=(16,32,64,128); @socketstr=("U0701".."U0704","U0801".."U0804","?","?","?","?","?","?","?","?","U0901".."U0904","U1001".."U1004"); @bankstr=(0,0,0,0,1,1,1,1,"?","?","?","?","?","?","?","?",2,2,2,2,3,3,3,3); } # # SPARCengine systems # if ($banner =~ /(Netra t1|Ultra CP 1500)\b/ || $ultra eq "Netra t1" || $model eq "Netra t1" || $ultra eq "CP1500" || $ultra eq "Netra ct400" || $ultra eq "Netra ct410" || $ultra eq "Netra ct800" || $ultra eq "Netra ct810") { # Netra t1 100/105, Netra ct400/410/800/810, SPARCengine CP1500 # Accepts 1 or 2 64MB, 128MB, 256MB or 512MB mezzanine memory cards # Netra ct400/800 use the Netra ct1600 DC chassis (N08) # Netra ct410/810 use the Netra ct1600 AC chassis (N09) # Also used in Sun Fire 12K & Sun Fire 15K # Install the highest capacity memory board first # The 370-4155 was sold for use in the Netra t1 100/105 # Up to four 370-4155 256MB memory boards can be installed # Only one 370-4155 can be mixed with any other memory boards # Cannot distinguish between 4 370-4155 256MB and 2 512MB memory boards # Maximum memory: 768MB for 270MHz/33MHz, 1GB for 360MHz/440MHz systems # # Top slot -> 64MB 64MB 128MB 128MB 256MB 256MB 512MB # Bottom slot SSF SS DSF SS SSF SS DSF SS DSF DS DSF SS DSF DS # | # v ------ ------ ------ ------ ------ ------ ------ # 64MB SSF SS Y N Y N N Y N # 64MB DSF SS Y Y Y Y Y Y Y # 128MB SSF SS Y N Y N N Y N # 128MB DSF SS Y Y Y Y Y Y Y # 256MB DSF SS Y Y Y Y Y Y Y # 512MB DSF DS Y/N * Y/N * Y/N * Y/N * Y/N * Y/N * Y/N * # # SSF=single-sided fab, DSF=double-sided fab # SS=stuffed on one side, DS=stuffed on both sides # * 512MB DSF DS board is supported on 360MHz and 440MHz systems, # 512MB DSF DS board is not supported on 270MHz and 333MHz systems # Lower board, address 0x00000000-0x0fffffff, 0x20000000-0x2fffffff # upper board, address 0x10000000-0x1fffffff, 0x30000000-0x3fffffff if ($banner =~ /Netra t1\b/ || $ultra eq "Netra t1" || $model eq "Netra t1") { $devname="Flyweight (Model 100), Flapjack (Model 105)"; $familypn="N07 (Model 100), N06 (Model 105)"; } $devname="Tonga" if ($ultra eq "Netra ct400"); $devname="Monte Carlo" if ($ultra eq "Netra ct800"); $familypn="N08" if ($ultra =~ /Netra ct[48]00/); if ($ultra =~ /Netra ct[48]10/) { $devname="Makaha"; $familypn="N09"; } $untested=0; $untested=1 if ($ultra eq "Netra ct400" || $ultra =~ /Netra ct[48]10/); $memtype="memory card"; $sockettype=""; $simmrangex="00000100"; $simmbanks=2; $simmsperbank=1; @simmsizes=(64,128,256,512); @socketstr=("base mezzanine board","additional mezzanine board"); @orderstr=("lower board","upper board"); $sortslots=0; } if ($banner =~ /Ultra CP 1400\b/ || $ultra eq "CP1400") { # Accepts 1 or 2 64MB, 128MB, 256MB or 512MB mezzanine memory cards # Has 64MB on-board memory on motherboard # Maximum memory: 832MB (64MB motherboard, 512MB bottom, 256MB top) # # Top slot -> 64MB 64MB 128MB 128MB 256MB 512MB # Bottom slot SSF SS DSF SS SSF SS DSF SS DSF SS DSF DS # | # v ------ ------ ------ ------ ------ ------ # 64MB SSF SS Y N Y N Y N # 64MB DSF SS Y Y Y Y Y N # 128MB SSF SS Y N Y N Y N # 128MB DSF SS Y Y Y Y Y N # 256MB DSF SS Y Y Y Y Y N # 512MB DSF DS Y Y Y Y Y N # # SSF=single-sided fab, DSF=double-sided fab # SS=stuffed on one side, DS=stuffed on both sides # 512MB DSF DS board is only supported in bottom slot # # Motherboard, address 0x00000000-0x03ffffff # Upper board, address 0x08000000-0xffffffff, 0x28000000-0x2fffffff # Lower board, address 0x10000000-0x17ffffff, 0x30000000-0x37ffffff $devname="Casanova"; $untested=0; $memtype="memory card"; $sockettype=""; $simmrangex="00000080"; $simmbanks=3; $simmsperbank=1; @simmsizes=(64,128,256,512); @socketstr=("motherboard","additional mezzanine board","base mezzanine board"); @orderstr=("","upper board","lower board"); $sortslots=0; } if ($ultra eq "AX" || $ultra eq "AX-300") { # SPARCengine Ultra AX and AX-300 # Accepts 8MB, 16MB, 32MB or 64MB DIMMs on motherboard # AX-300 also accepts 128MB DIMMs on motherboard $devname="Photon"; $untested=0; # unsure if socket order is correct $simmrangex="00000200"; $simmbanks=2; $simmsperbank=4; @simmsizes=(8,16,32,64,128); @socketstr=("U0301".."U0304","U0401".."U0404"); @bankstr=(0,0,0,0,1,1,1,1); } if ($ultra eq "AXi") { # SPARCengine Ultra AXi # Accepts 8MB, 16MB, 32MB, 64MB or 128MB single or dual bank 10-bit # column address type DIMMs on motherboard in all socket pairs # Accepts 8MB, 16MB, 32MB, 64MB, 128MB or 256MB dual bank 11-bit # column address type DIMMs on motherboard in Pairs 0 & 2 # (leave Pairs 1 & 3 empty) # DIMMs should be chosen as all 10-bit or all 11-bit column address type # Use 60ns DIMMs only #$devname="unknown"; $untested=0; $simmrangex="00000100"; $simmbanks=4; $simmsperbank=2; @simmsizes=(8,16,32,64,128,256); @socketstr=("U0404","U0403","U0304","U0303","U0402","U0401","U0302","U0301"); @bankstr=(0,0,2,2,1,1,3,3); $sortslots=0; } if ($ultra eq "AXmp" || $ultra eq "AXmp+") { # SPARCengine Ultra AXmp # Accepts 8MB, 16MB, 32MB, 64MB or 128MB DIMMs on motherboard # Accepts 256MB dual-bank DIMMs in bank 0 or 1 (not both) # Can't distinguish dual-bank DIMMs from two banks of single bank DIMMs # SPARCengine Ultra AXmp+ # Accepts 8MB, 16MB, 32MB, 64MB, 128MB or 256MB DIMMs on motherboard # Accepts dual-bank DIMMs in both bank 0 and 1 # Can't distinguish dual-bank DIMMs from two banks of single bank DIMMs $devname="Crichton"; $untested=0; $simmbanks=2; $simmsperbank=8; if ($ultra eq "AXmp+") { $simmrangex="00000400"; @simmsizes=(8,16,32,64,128,256); } else { $simmrangex="00000800"; @simmsizes=(8,16,32,64,128); } @socketstr=("U0701".."U0704","U0801".."U0804","U0901".."U0904","U1001".."U1004"); @bankstr=(0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1); $sortslots=0; } if ($ultra eq "AXe") { # SPARCengine Ultra AXe # Accepts 32MB, 64MB, 128MB or 256MB single or dual bank DIMMs # DIMMs should be chosen as all 10-bit or all 11-bit column address type $devname="Topdog"; $untested=0; $simmrangex="00000100"; $simmbanks=2; $simmsperbank=2; @simmsizes=(32,64,128,256); @socketstr=("DIMM3","DIMM4","DIMM1","DIMM2"); @bankstr=(0,0,1,1); # Assume stacked DIMMs like AXi since only 128MB DIMMs have been tested $sortslots=0; } if ($ultra eq "AX-e2") { # Netra AX1105-500 # Accepts up to 4 64MB, 128MB, 256MB or 512MB registered SDRAM PC133 # DIMMs; 128MB Minimum, 2GB Maximum # DIMM0 & DIMM1 form Bank 0, DIMM2 & DIMM3 form Bank 1 # DIMMs don't have to be installed as pairs $devname="Birdsnest Lite"; $untested=0; $simmrangex="00000200"; $simmbanks=4; $simmsperbank=1; @simmsizes=(64,128,256,512); @socketstr=("DIMM0".."DIMM3"); @bankstr=(0,0,1,1); } if ($ultra eq "Netra X1" || $ultra eq "Sun Fire V100") { # Netra X1, Sun Fire V100, UltraAX-i2 # Accepts up to 4 128MB or 256MB PC133 DIMMs for 1GB maximum # 500MHz model also accepts up to 4 512MB PC133 DIMMs for 2GB maximum # Have seen slower models also work with 512MB DIMMs for 2GB maximum # Sun Fire V100 is 500MHz only # The memory installation sequence is Slot 3, 2, 1, and 0. # Each DIMM slot addresses 512MB with 400MHz UltraSPARC IIe # Each DIMM slot addresses 1GB with >= 550MHz UltraSPARC IIe # Memory is SDRAM PC133 CL=3 ECC registered # When equal size DIMMs are installed, the lowest slot number is # mapped to the lowest address range. # When mixed size DIMMs are installed, the slot number with the largest # size DIMM is mapped to the lowest address range. $devname="Flapjack-lite" if ($ultra eq "Netra X1"); $devname="Flapjack-liteCD500" if ($ultra eq "Sun Fire V100"); $familypn="N19"; $untested=0; $simmrangex=($cpufreq > 520) ? "00000400" : "00000200"; $simmbanks=4; $simmsperbank=1; @simmsizes=(128,256,512); @socketstr=("DIMM0".."DIMM3"); } if ($ultra eq "Netra T1 200" || $ultra eq "Sun Fire V120" || $ultra eq "Netra 120") { # Netra T1 200, Sun Fire V120, Netra 120, UltraAX-i2 # Accepts up to 4 256MB, 512MB or 1GB PC133 DIMMs for 4GB maximum # Sun Fire V120 is 550MHz or 650MHz # Netra 120 is same platform as Sun Fire V120, but is 650MHz only # Memory is SDRAM PC133 CL=3 ECC registered # The minimum memory requirement is one DIMM in Slot 0 # The memory installation sequence is Slot 0, 1, 2, 3 # Each DIMM slot addresses 512MB of memory with 500MHz UltraSPARC IIe # Each DIMM slot addresses 1GB of memory with >= 550MHz UltraSPARC IIe # When equal size DIMMs are installed, the lowest slot number is # mapped to the lowest address range. # When mixed size DIMMs are installed, the slot number with the largest # size DIMM is mapped to the lowest address range. if ($ultra eq "Netra T1 200") { $devname="Flapjack2"; $familypn="N21"; } if ($ultra eq "Sun Fire V120" || $ultra eq "Netra 120") { $devname="Flapjack2+"; $familypn="N25"; } $untested=0; $simmrangex=($cpufreq > 520) ? "00000400" : "00000200"; $simmbanks=4; $simmsperbank=1; @simmsizes=(256,512,1024); @socketstr=("DIMM0".."DIMM3"); } if ($banner =~ /\bCP2000\b/ || $ultra =~ /^CP2[01]\d0$/) { # Netra CP2000/CP2100 Series CompactPCI Boards (UltraSPARC-IIe) # CP2040 (SUNW,UltraSPARC-IIe-NetraCT-40) supports 256MB, 512MB, and 1GB # CP2060 (SUNW,UltraSPARC-IIe-NetraCT-60) has non-expandable 512MB # CP2080 (SUNW,UltraSPARCengine_CP-80) supports 256MB, 512MB, and 1GB # CP2140 (SUNW,UltraSPARCengine_CP-40) supports 512MB, 1GB and 2GB # CP2160 (SUNW,UltraSPARCengine_CP-60) supports 1GB and 2GB # 256MB Single-Wide module 375-3024 # 512MB Single-Wide module 375-3025 # 1GB Double-Wide module 375-3026 # 1GB Single-Wide module 375-3125 # 2GB Double-Wide module 375-3114 # Max number of stacked memory boards is two # Install double wide memory first, then single wide memory $devname="Othello" if ($ultra eq "CP2040"); $devname="Sputnik Bluesky" if ($ultra eq "CP2060"); $devname="Sputnik Orion" if ($ultra eq "CP2080"); $devname="Othello+" if ($ultra eq "CP2140"); $devname="Sputnik+" if ($ultra eq "CP2160"); $untested=1; $untested=0 if ($ultra eq "CP2140"); if ($ultra eq "CP2060") { $memtype="embedded memory"; $sockettype=""; $simmrangex="00001000"; $simmbanks=1; $simmsperbank=1; @simmsizes=(512); } else { $memtype="memory card"; $sockettype=""; $simmrangex="00001000"; $simmbanks=2; $simmsperbank=1; if ($ultra eq "CP2140") { @simmsizes=(512,1024,2048); } elsif ($ultra eq "CP2160") { @simmsizes=(1024,2048); } else { @simmsizes=(256,512,1024); } @socketstr=("base mezzanine board","additional mezzanine board"); @orderstr=("lower board","upper board"); $sortslots=0; } } # # Clones: most do not have verbose output since I don't have any socket data # on them # if ($ultra eq "axus250" || $modelmore =~ /Ultra-250/) { # AXUS Microsystems, Inc. http://www.axus.com.tw # AXUS 250 clone # accepts up to 128MB DIMMs on motherboard $untested=0; $simmrangex="00000200"; $simmbanks=4; $simmsperbank=4; @simmsizes=(8,16,32,64,128); @socketstr=("U0501","U0601","U0701","U0801","U0502","U0602","U0702","U0802","U0503","U0603","U0703","U0803","U0504","U0604","U0704","U0804"); @bankstr=(0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3); } if ($model =~ /SPARC (CPU|CPCI)-/) { # Force Computers, http://www.forcecomputers.com # model format: "SPARC CPU-5V/64-110-X" for 64MB w/ 110MHz CPU $untested=1; $untested=0 if ($model =~ /SPARC CPU-/); if ($model =~ /\/${installed_memory}-/) { $totmem=$installed_memory; push(@simmsizesfound, "$totmem"); $buffer="motherboard contains ${totmem}MB on-board memory\n"; &finish; } } if ($model =~ /Axil/) { # RAVE Computer Association, http://rave.com $untested=1; $untested=0 if ($model =~ /Axil-(245|255|311|320)/); } if ($manufacturer =~ /Tadpole/) { # Tadpole RDI, http://www.tadpole.com $untested=1; $untested=0 if ($banner =~ /Tadpole S3|\bVoyagerIIi\b|\bCycleQUAD\b/); $untested=0 if ($model =~ /PowerLite-170/); if ($ultra eq "UP-20") { # Cycle UP-20 to upgrade SPARCstation 5/20 motherboards # Accepts 16MB, 32MB and 64MB SIMMs from SPARCstation 20 # Install SIMMs in pairs to form each bank $untested=1; $simmrangex="00000040"; $simmbanks=4; $simmsperbank=2; @simmsizes=(16,32,64); @bankstr=(0,0,1,1,2,2,3,3); } if ($ultra eq "UP-520IIi") { # Cycle UP-520-IIi to upgrade SPARCstation 5/20 motherboards # Accepts 8MB, 16MB, 32MB, 64MB, 128MB and 256MB DIMMs $untested=0; $simmrangex="00000200"; $simmbanks=4; $simmsperbank=2; @simmsizes=(8,16,32,64,128,256); @socketstr=("J301".."J304"); @bankstr=(0,0,1,1); } if ($banner =~ /\bSPARCLE\b/) { # UltraSPARC-IIe at 440MHz, 500MHz, or 650MHz # 256MB - 2GB ECC SDRAM, two slots, PC-133, 144-pin SO-DIMMs $untested=0; $simmbanks=2; $simmsperbank=1; @simmsizes=(128,256,512,1024); @socketstr=("DIMM0","DIMM1"); $memtype="SO-DIMM"; } } if ($manufacturer eq "Auspex") { # Auspex Netserver, http://www.auspex.com $memtype="Memory Module"; $untested=1; $untested=0 if ($model eq "SPARC Processor"); if ($osrel =~ /^5./) { $untested=1; # Untested with Solaris 2.X $untested_type="OS"; } } if ($manufacturer =~ /Fujitsu/) { # Hal Computer Systems, a Fujitsu Company, http://www.hal.com # Fujitsu Siemens, http://www.fujitsu-siemens.com $untested=1; $untested=0 if ($model =~ /S-4\/10H|S-4\/20[ABLH]/); if ($banner =~ /(GP7000|GP7000F)\b/) { $untested=0; if ($slotname0 =~ /SLOT[0-9]/) { # M200 # Up to 4GB of memory # System board has 16 DIMM slots, #00 - #15 # Banks - 0,0,1,1,2,2,2,2,3,3,3,3,4,4,4,4 # First Modules installed in Bank 0, slots 0-1 # Second Modules Installed in Bank 1, slots 2-3 # Modules in Bank 0 and 1 must be same size # Subsequent memory expansion installed in sets of four # modules in Bank 2 - 4 (Slots 4-7, 8-11, 12-15) @socketstr=("SLOT0".."SLOT9","SLOT10".."SLOT15"); } if ($slotname0 =~ /SLOT[AB][0-9]/) { # M400 and M600 # Up to 4GB of memory # System board has 32 DIMM slots, #00 - #15 Group A & B # Banks - 0,0,1,1,2,2,2,2,3,3,3,3,4,4,4,4 # First Modules installed in Bank 0 Group A, slots 0-1 # Second Modules installed in Bank 0 Group B, slots 0-1 # Modules in Group A and B must be same size # Next memory expansion installs in Bank 1 Group A & B, # slots 2-3 using modules of same size as Bank 0 # Subsequent memory expansion installed in sets of eight # modules in Bank 2 - 4 (Slots 4-7, 8-11, 12-15) in # both Group A and B @socketstr=("SLOTA0".."SLOTA9","SLOTA10".."SLOTA15","SLOTB0".."SLOTB9","SLOTB10".."SLOTB15"); } } if ($banner =~ /PRIMEPOWER *100N?\b/) { # PRIMEPOWER100N, 1U rack mount # Up to 2GB of memory # 4 memory module slots # 100MHz SDRAM ECC # Mount memory modules in order from memory module slot 0 $untested=1; } if ($banner =~ /PRIMEPOWER *[246]00\b/) { # Up to 8GB of memory # Each system board has 16 DIMM slots, #00 - #15 # Four banks of 4 (0-3,4-7,8-11,12-15) # PrimePower 200 and 400 use 1 system board # PrimePower 600 uses 2 system boards (00, 01) $untested=0; foreach $brd ("00","01") { if ($gotcpuboards =~ /\b$brd\b/) { if ($gotmodulenames =~ /${brd}-SLOT[0-9]/) { foreach $i (0..15) { push(@socketstr, ("${brd}-SLOT$i")); } } } } } if ($banner =~ /PRIMEPOWER *(800|1000|2000)\b/) { # 1-4 SPARC64 GP CPUs / system board # PrimePower 800 can have 4 system boards per system # PrimePower 1000 can have 8 system boards per system # PrimePower 2000 can have 32 system boards per system # Minimum Memory: 1GB / system board, 2GB / system # Maximum Memory: 8GB / system board, 32GB / system # 32 or 16 memory modules per system board, installed in quads $untested=0; @simmsizes=(128,256,512); foreach $brd ("00".."77") { if ($gotcpuboards =~ /\b$brd\b/) { if ($gotmodulenames =~ /${brd}-SLOT#[AB][0-9]/) { foreach $j ("A","B") { foreach $i ("00".."03","10".."13","20".."23","30".."33") { push(@socketstr, ("${brd}-SLOT#$j$i")); } } } } } } if ($banner =~ /PRIMEPOWER *250\b/) { # Pedestal, 2U or 4U rack mount # 1-2 SPARC64 V processors at 1.1GHz, 1.32GHz, 1.87GHz # 1GB-16GB DDR-SDRAM memory with ECC, 2-way, 8 DIMM slots $untested=0; @simmsizes=(256,512,1024,2048); foreach $i ("00".."07") { push(@socketstr, ("SLOT#$i")); } } if ($banner =~ /PRIMEPOWER *450\b/) { # Pedestal, 4U or 7U rack mount # 1-4 SPARC64 V processors at 1.1GHz, 1.32GHz, 1.87GHz # 1GB-32GB DDR-SDRAM memory with ECC, 4-way, 16 DIMM slots $untested=0; @simmsizes=(256,512,1024,2048); foreach $i ("00".."15") { push(@socketstr, ("SLOT#$i")); } } if ($banner =~ /PRIMEPOWER *[68]50\b/) { # PrimePower 650: 2-8 SPARC64 V processors at 1.1GHz or faster # 2GB-64GB memory, 8-way, 1 system board, 8U rack mount # PrimePower 850: 4-16 SPARC64 V processors at 1.1GHz or faster # 2GB-128GB memory, 16-way, 2 system boards, 16U rack mount # Uses DDR SDRAM ECC memory in 256MB, 512MB and 1GB sizes # Each system board has 32 memory module slots, laid out # with 4 DIMMs on 8 DIMM riser cards. $untested=0; @simmsizes=(256,512,1024,2048); foreach $brd ("C0S00","C0S01") { if ($gotcpuboards =~ /\b$brd\b/) { if ($gotmodulenames =~ /${brd}-SLOT#[A-D][0-9]/) { foreach $j ("A".."D") { foreach $i ("00".."07") { push(@socketstr, ("${brd}-SLOT#$j$i")); } } } } } } if ($banner =~ /PRIMEPOWER *(HPC2500|900|[12]500)\b/) { # SPARC64 V CPUs at 1.3GHz or 1.89GHz # PRIMEPOWER HPC2500 / 2500 # 2-8 CPUs / system board, 64-128 / system # Up to 16 8-way system boards / system # Up to 1024GB DDR-SDRAM memory with ECC, 128-way # Minimum Memory: 4GB / system board, 4GB / system # Maximum Memory: 64GB / system board, 1024GB / system # PRIMEPOWER 900 # 17U rack mount # 1-8 CPUs / system board, 1-16 / system # Up to 2 8-way system boards / system # Up to 128GB DDR-SDRAM memory with ECC, 8-way # Minimum Memory: 2GB / system board, 2GB / system # Maximum Memory: 64GB / system board, 128GB / system # PRIMEPOWER 1500 # 1-8 CPUs / system board, 1-32 / system # Up to 4 8-way system boards / system # Up to 256GB DDR-SDRAM memory with ECC, 8-way # Minimum Memory: 2GB / system board, 2GB / system # Maximum Memory: 64GB / system board, 256GB / system $untested=0; @simmsizes=(256,512,1024,2048); foreach $cab ("C0S","C1S") { foreach $brd ("00".."07") { if ($gotcpuboards =~ /\b$cab$brd\b/) { foreach $j ("A","B") { foreach $i ("00".."15") { push(@socketstr, ("$cab${brd}-SLOT#$j$i")); } } } } } } } if ($model =~ /COMPstation.10/) { # Tatung Science and Technology, http://www.tsti.com # Accepts 16MB and 64MB SIMMs on motherboard # Bank 0 must be filled first # Layout is like SPARCstation-10, but I don't know if it can accept # 32MB SIMMs or NVSIMMs $untested=0; $simmrangex="00000040"; $simmbanks=8; $simmsperbank=1; @simmsizes=(16,64); @socketstr=("J0201","J0203","J0302","J0304","J0202","J0301","J0303","J0305"); @bankstr=(0,2,4,6,1,3,5,7); } if ($model =~ /COMPstation-20A\b/) { # Tatung Science and Technology, http://www.tsti.com # Accepts 16MB, 32MB and 64MB SIMMs on motherboard $untested=1; $simmrangex="00000040"; $simmbanks=8; $simmsperbank=1; @simmsizes=(16,32,64); @socketstr=("J0201","J0304","J0203","J0302","J0303","J0301","J0305","J0202"); @orderstr=("1st","2nd","3rd","4th","5th","6th","7th","8th"); @bankstr=(1..8); } if ($model =~ /COMPstation-20AL/) { # Tatung Science and Technology, http://www.tsti.com # Accepts 16MB, 32MB and 64MB SIMMs on motherboard $untested=0; $simmrangex="00000040"; $simmbanks=8; $simmsperbank=1; @simmsizes=(16,32,64); @socketstr=("J0201","J0203","J0302","J0304","J0202","J0301","J0303","J0305"); @orderstr=("1st","2nd","3rd","4th","5th","6th","7th","8th"); @bankstr=(0..7); } if ($banner =~ /COMPstation_U(60|80D)_Series/) { # Tatung Science and Technology, http://www.tsti.com # Accepts 16MB, 32MB, 64MB, 128MB or 256MB DIMMs on motherboard # 4 banks with 4 DIMMs per bank $untested=0; if ($banner =~ /COMPstation_U60_Series/) { $simmrangex="00000200"; # use "00000400" with 256MB DIMMs $simmbanks=6; # Count the skipped address range } else { $simmrangex="00000400"; $simmbanks=4; } $simmsperbank=4; @simmsizes=(16,32,64,128,256); } if ($model =~ /\bVoyagerIIi\b/) { # Tadpole Voyager IIi has 8 DIMM slots, but otherwise appears # to look like an Ultra 5. It allows 256MB to 1GB of memory. $untested=0; $simmrangex="00000100"; $simmbanks=4; $simmsperbank=2; @simmsizes=(16,32,64,128); @socketstr=("DIMM1","DIMM2","DIMM5","DIMM6","DIMM3","DIMM4","DIMM7","DIMM8"); $sortslots=1; } # # systems below may have memory information available in prtdiag output # if ($model eq "SPARCserver-1000" || $model eq "SPARCcenter-2000") { $devname="Scorpion" if ($model eq "SPARCserver-1000"); $devname="Scorpion+" if ($banner =~ "1000E"); $devname="Dragon" if ($model eq "SPARCcenter-2000"); $devname="Dragon+" if ($banner =~ "2000E"); # Accepts 8MB and 32MB SIMMs on motherboard $untested=0; @simmsizes=(8,32); $prtdiag_has_mem=1; &check_prtdiag; if ($boardfound_mem) { $memfrom="prtdiag"; &pdebug("displaying memory from prtdiag"); foreach $line (@boards_mem) { if ($line =~ /Board/) { $boardslot_mem=substr($line,5,1); $simmsize=int substr($line,46,3) / 4; if ($simmsize == 0) { &found_empty_bank("Group 0"); } elsif ($simmsize == 1) { &found_nvsimm_bank("Group 0"); } else { push(@simmsizesfound, "$simmsize"); } $simmsize=int substr($line,54,3) / 4; if ($simmsize == 0) { &found_empty_bank("Group 1"); } elsif ($simmsize == 1) { &found_nvsimm_bank("Group 1"); } else { push(@simmsizesfound, "$simmsize"); } $simmsize=int substr($line,62,3) / 4; if ($simmsize == 0) { &found_empty_bank("Group 2"); } elsif ($simmsize == 1) { &found_nvsimm_bank("Group 2"); } else { push(@simmsizesfound, "$simmsize"); } $simmsize=int substr($line,70,3) / 4; if ($simmsize == 0) { &found_empty_bank("Group 3"); } elsif ($simmsize == 1) { &found_nvsimm_bank("Group 3"); } else { push(@simmsizesfound, "$simmsize"); } } } &show_header; print @boards_mem; print "Each memory unit group is comprised of 4 SIMMs\n"; $empty_banks=" None" if (! $empty_banks); print "empty memory groups:$empty_banks\n"; } else { &show_header; $recognized=0; } $totmem=$installed_memory; &finish; &pdebug("exit"); exit; } if ($model eq "Ultra-4" || $ultra eq 450 || $model eq "Ultra-4FT" || $ultra eq "Netra ft1800") { # Accepts 32MB, 64MB, 128MB or 256MB DIMMs on motherboard # 16MB DIMMs are not supported and may cause correctable ECC errors # 501-2622 (32MB), 501-2480 or 501-5691 (64MB), 501-3136 (128MB), # 501-4743 or 501-5896 (256MB) # 200-pin 60ns Fast Page Mode ECC # Netra ft1800 is based on Ultra 450 $devname="Tazmo (Tazmax/Tazmin)"; $familypn="A20, A25"; $familypn="N05" if ($model eq "Ultra-4FT" || $ultra eq "Netra ft1800"); $untested=0; $simmrangex="00000400"; $simmbanks=4; $simmsperbank=4; @simmsizes=(16,32,64,128,256); @socketstr=("U1901".."U1904","U1801".."U1804","U1701".."U1704","U1601".."U1604"); @groupstr=("A","A","A","A","B","B","B","B","C","C","C","C","D","D","D","D"); @bankstr=(2,2,2,2,3,3,3,3,0,0,0,0,1,1,1,1); } if ($model eq "Ultra-250" || $ultra eq 250) { # Accepts 16MB, 32MB, 64MB, or 128MB DIMMs on motherboard # 501-2479 (16MB), 501-2622 (32MB), 501-2480 or 501-5691 (64MB), # 501-3136 (128MB) # 200-pin 60ns Fast Page Mode ECC $devname="Javelin"; $familypn="A26"; $untested=0; $simmrangex="00000200"; $simmbanks=4; $simmsperbank=4; @simmsizes=(16,32,64,128); @socketstr=("U0701","U0801","U0901","U1001","U0702","U0802","U0902","U1002","U0703","U0803","U0903","U1003","U0704","U0804","U0904","U1004"); @bankstr=("A","A","A","A","B","B","B","B","C","C","C","C","D","D","D","D"); } if ($model eq "Ultra-80" || $ultra eq 80 || $ultra eq "420R" || $ultra eq "Netra t140x") { # Accepts 64MB or 256MB DIMMs # 501-5691 (64MB), 501-4743 501-5936 501-6005 501-6056 (256MB) # 200-pin 60ns 5V Fast Page Mode ECC, 576 bits data width # 64MB DIMMs same as in Ultra-60, 256MB DIMMs same as in Enterprise-450 # U0403,U0404,U1403,U1404 bank 3 address 0xc0000000-0xffffffff # U0303,U0304,U1303,U1304 bank 2 address 0x80000000-0xbfffffff # U0401,U0402,U1401,U1402 bank 1 address 0x40000000-0x7fffffff # U0301,U0302,U1301,U1302 bank 0 address 0x00000000-0x3fffffff # The minimum requirement is four DIMMs in any bank. The recommended # installation sequence is Bank 0,2,1,3. DIMMs are required on both the # Riser Board (U0[34]0?) and the System Board (U1[34]0?). Two-way and # four-way memory bank interleaving is supported. Memory is 2-way # interleaved when the same size DIMMs are installed in Banks 0 and 1. # Memory is 4-way interleaved when the same size DIMMs are installed in # Banks 0, 1, 2 and 3. # # prtconf does not reliably show the size of DIMMs in each slot when # 1GB of total memory is installed. It shows this: # reg: 00000000.00000000.00000000.40000000 # A system with 1GB is reported as having 4 256MB DIMMs, but may be # using 16 64MB DIMMs in a 4-way interleave. # This is an issue that Sun could fix in the OBP. # It is broken with OBP 3.33.0 2003/10/07 (patch 109082-06) and older. # prtfru (Solaris 8 and later) also does not work. # # Sun shipped U80 1GB configurations w/ 4x256MB DIMMs # Sun shipped U80 256MB configurations w/ 4x64MB DIMMs # Sun shipped E420R with 501-5936 256MB DIMMs # 64MB DIMM 501-2480 and 128MB DIMM 501-3136 are not supported. # 16MB and 32MB DIMMs are not sold for the Ultra 80. # $devname="Quasar (U80), Quahog (420R), Lightweight 3 (Netra t140x)"; $familypn="A27 (U80), A33 (420R), N14 (Netra t1405), N15 (Netra t1400)"; if ($ultra eq 80) { $devname="Quasar"; $familypn="A27"; } if ($ultra eq "420R") { $devname="Quahog"; $familypn="A33"; } if ($ultra eq "Netra t140x") { $devname="Lightweight 3"; $familypn="N14 (Netra t1405), N15 (Netra t1400)"; } $untested=0; $simmrangex="00000400"; $simmbanks=4; $simmsperbank=4; @simmsizes=(64,256); # Sun only supports 64MB and 256MB DIMMs @socketstr=("U0301","U0302","U1301","U1302","U0401","U0402","U1401","U1402","U0303","U0304","U1303","U1304","U0403","U0404","U1403","U1404"); @bankstr=(0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3); } if ($ultra eq "Sun Blade 1000" || $ultra eq "Sun Blade 2000" || $ultra eq "Sun Fire 280R" || $ultra eq "Netra 20") { # Accepts up to 8 128MB, 256MB, 512MB, 1GB or 2GB DIMMs installed in # groups of four DIMMs per bank on motherboard # Uses 232-pin 3.3V ECC 7ns SDRAM # J0407 Group 1 Bank 1/3 address 0x0fa000000 - 0x1f3ffffff # J0406 Group 0 Bank 0/2 address 0x000000000 - 0x0f9ffffff # J0305 Group 1 Bank 1/3 address 0x0fa000000 - 0x1f3ffffff # J0304 Group 0 Bank 0/2 address 0x000000000 - 0x0f9ffffff # J0203 Group 1 Bank 1/3 address 0x0fa000000 - 0x1f3ffffff # J0202 Group 0 Bank 0/2 address 0x000000000 - 0x0f9ffffff # J0101 Group 1 Bank 1/3 address 0x0fa000000 - 0x1f3ffffff # J0100 Group 0 Bank 0/2 address 0x000000000 - 0x0f9ffffff # The minimum memory requirement is four DIMMs in any Group # DIMMs can be installed in any group order # Each group addresses 4GB of memory # Memory slots (Jxxxx) map to same-numbered DIMMs (Uxxxx) # For maximum 4-way interleaving, install 8 DIMMs of identical sizes $devname="Excalibur (Sun Blade 1000), Littleneck (Sun Fire 280R), Lightweight 2+ (Netra 20/Netra T4), Sun Blade 2000 (Sun Blade 2000)"; $familypn="A28 (Sun Blade 1000), A35 (Sun Fire 280R), N28 (Netra 20/Netra T4), A29 (Sun Blade 2000)"; if ($ultra eq "Sun Blade 1000") { $devname="Excalibur (Sun Blade 1000), Sun Blade 2000 (Sun Blade 2000)"; $familypn="A28 (Sun Blade 1000), A29 (Sun Blade 2000)"; } if ($ultra eq "Sun Fire 280R") { $devname="Littleneck"; $familypn="A35"; } if ($ultra eq "Netra 20") { $devname="Lightweight 2+"; $familypn="N28"; } if ($ultra eq "Sun Blade 2000") { $devname="Sun Blade 2000"; $familypn="A29"; } $untested=0; # SB1000/2000 uses 501-4143, 501-5938, 501-6230 or 501-6560 motherboards # SB1000 can use 600, 750 and 900MHz UltraSPARC-III CPUs # SB1000 can use 900MHz and faster UltraSPARC-III+ Cu CPUs # SB2000 only shipped with 900MHz and faster UltraSPARC-III+ Cu CPUs # SB2000 can use any of the SB1000 motherboards if ($ultra eq "Sun Blade 1000") { $modelmore=$banner; $modelmore=~s/Sun-Blade-1000/or Sun-Blade-2000/g; $modelmore=~s/\s+$//; while (($cf,$cnt)=each(%cpucnt)) { $cf=~/^(.*) (\d*)$/; $cfreq=$2; $modelmore=~s/\)/ ${cfreq}MHz\)/g if ($cfreq); } } $prtdiag_has_mem=1; $simmrangex="00001000"; $simmbanks=2; $simmsperbank=4; @simmsizes=(128,256,512,1024,2048); @socketstr=("J0100","J0202","J0304","J0406","J0101","J0203","J0305","J0407"); @bankstr=(0,0,0,0,1,1,1,1); } if ($model eq "Sun-Blade-100" || $ultra eq "Sun Blade 100" || $ultra eq "Sun Blade 150") { # Accepts 128MB, 256MB or 512MB DIMMs on motherboard # Uses 168-pin 3.3V ECC PC133 CL=3 SDRAM # U5 DIMM3 address 0x60000000 - 0x7fffffff or 0xc0000000 - 0xffffffff # U4 DIMM2 address 0x40000000 - 0x5fffffff or 0x80000000 - 0xbfffffff # U3 DIMM1 address 0x20000000 - 0x3fffffff or 0x40000000 - 0x7fffffff # U2 DIMM0 address 0x00000000 - 0x1fffffff or 0x00000000 - 0x3fffffff # The minimum memory requirement is one DIMM in U2 # The memory installation sequence is U2, U3, U4, U5 # Each bank addresses 512MB of memory with 500MHz UltraSPARC # Each bank addresses 1GB of memory with >= 550MHz UltraSPARC if ($model eq "Sun-Blade-100" || $ultra eq "Sun Blade 100") { $devname="Grover"; $familypn="A36"; } if ($ultra eq "Sun Blade 150") { $devname="Grover+"; $familypn="A41"; } $untested=0; $prtdiag_has_mem=1; $simmrangex=($cpufreq > 520) ? "00000400" : "00000200"; $simmbanks=4; $simmsperbank=1; @simmsizes=(128,256,512); @socketstr=("DIMM0".."DIMM3"); @bankstr=(0..3); } if ($ultra eq "Sun Fire" || $ultra eq "Sun Fire 15K" || $ultra eq "Sun Fire 12K" || $ultra =~ /Sun Fire ([346]8[01]0|E[246]900|E2[05]K)\b/) { # Sun Fire 3800 system # 2-8 UltraSPARC-III processors # Up to 2 CPU/Memory boards # Sun Fire 4800, 4810 and 6800 system # 2-12 UltraSPARC-III processors # Up to 3 CPU/Memory boards # Sun Fire 6800 system # 2-24 UltraSPARC-III processors # Up to 6 CPU/Memory boards # Sun Fire 15K system # 16-106 UltraSPARC-III+, IV or IV+ processors # Up to 18 CPU/Memory boards # Sun Fire 12K system # up to 56 UltraSPARC-III+, IV or IV+ processors and 288GB memory # Sun Fire E2900 & E4900 system # 4, 8, or 12 UltraSPARC-IV or IV+ processors, up to 3 Uniboards # E4900 adds dynamic system domains when compared to E2900 # Sun Fire E6900 system # 4-24 UltraSPARC-IV or IV+ processors, up to 6 Uniboards # Sun Fire E20K system # 4-36 UltraSPARC-IV or IV+ processors, up to 9 Uniboards # Sun Fire E25K system # Up to 72 UltraSPARC-IV or IV+ processors, up to 18 Uniboards # Each CPU/Memory board holds up to 4 processors and up to 32GB memory # (32 DIMMs per board, 8 banks of 4 DIMMs) # Accepts 256MB, 512MB or 1GB DIMMs # 1GB DIMM not supported at 750MHz # 256MB DIMM only supported on US-III # 2GB DIMMs supported on 48x0/6800/E2900/E4900/E6900/E20K/E25K # System Board slots are labeled SB0 and higher # A populated DIMM bank requires an UltraSPARC CPU. # DIMMs are 232-pin 3.3V ECC 7ns SDRAM # prtdiag output shows the memory installed. # # CPU1 and CPU0 Memory CPU3 and CPU2 Memory # -------------------- -------------------- # Socket CPU Bank DIMM Socket CPU Bank DIMM # ------ --- ---- ---- ------ --- ---- ---- # J14600 P1 B0 D3 J16600 P3 B0 D3 # J14601 P1 B1 D3 J16601 P3 B1 D3 # J14500 P1 B0 D2 J16500 P3 B0 D2 # J14501 P1 B1 D2 J16501 P3 B1 D2 # J14400 P1 B0 D1 J16400 P3 B0 D1 # J14401 P1 B1 D1 J16401 P3 B1 D1 # J14300 P1 B0 D0 J16300 P3 B0 D0 # J14301 P1 B1 D0 J16301 P3 B1 D0 # J13600 P0 B0 D3 J15600 P2 B0 D3 # J13601 P0 B1 D3 J15601 P2 B1 D3 # J13500 P0 B0 D2 J15500 P2 B0 D2 # J13501 P0 B1 D2 J15501 P2 B1 D2 # J13400 P0 B0 D1 J15400 P2 B0 D1 # J13401 P0 B1 D1 J15401 P2 B1 D1 # J13300 P0 B0 D0 J15300 P2 B0 D0 # J13301 P0 B1 D0 J15301 P2 B1 D0 # $devname="Serengeti" if ($ultra eq "Sun Fire"); if ($banner =~ /Sun Fire 3800\b/ || $diagbanner =~ /Sun Fire 3800\b/) { $devname="Serengeti8, SF3800 or SP"; $familypn="F3800"; } if ($banner =~ /Sun Fire 4800\b/ || $diagbanner =~ /Sun Fire 4800\b/) { $devname="Serengeti12, SF4800 or MD"; $familypn="F4800"; } if ($banner =~ /Sun Fire 4810\b/ || $diagbanner =~ /Sun Fire 4810\b/) { $devname="Serengeti12i, SF4810 or ME"; $familypn="F4810"; } if ($banner =~ /Sun Fire 6800\b/ || $diagbanner =~ /Sun Fire 6800\b/) { $devname="Serengeti24, SF6800 or DC"; $familypn="F6800"; } if ($ultra eq "Sun Fire 15K") { $devname="Starcat, Serengeti72"; $familypn="F15K"; } $devname="Starkitty" if ($ultra eq "Sun Fire 12K"); if ($banner =~ /Sun Fire E2900\b/ || $diagbanner eq "Sun Fire E2900") { $devname="Amazon 2"; $familypn="E29"; } if ($banner =~ /Sun Fire E4900\b/ || $diagbanner eq "Sun Fire E4900") { $devname="Amazon 4"; $familypn="E49"; } $devname="Amazon 6" if ($banner =~ /Sun Fire E6900\b/ || $diagbanner eq "Sun Fire E6900"); $devname="Amazon 20" if ($banner =~ /Sun Fire E20K\b/ || $diagbanner eq "Sun Fire E20K"); $devname="Amazon 25" if ($banner =~ /Sun Fire E25K\b/ || $diagbanner eq "Sun Fire E25K"); $untested=0; $prtdiag_has_mem=1; @simmsizes=(256,512,1024); @simmsizes=(256,512,1024,2048) if ($ultra =~ /Sun Fire ([46]8[01]0|E[246]900|E2[05]K)\b/); } if ($ultra eq "Sun Fire V880") { # Accepts 128MB, 256MB, 512MB or 1GB DIMMs in groups of four per CPU # 128MB DIMMs only supported on 750MHz CPU/memory boards # 1GB DIMMs only supported on 900MHz or faster CPU/memory boards # 2-8 UltraSPARC-III processors, 750MHz or faster # Up to 64GB memory, 8GB max per CPU, 4 DIMMs per CPU, 2 CPUs per board # DIMMs must be added four-at-a-time within the same group of DIMM # slots; every fourth slot belongs to the same DIMM group. # Each CPU/Memory board must be populated with a minimum of eight DIMMs, # installed in groups A0 and B0. # For 1050MHz and higher system boards, each CPU/Memory board must be # populated with all sixteen DIMMs, installed in groups A0,A1,B0,B1. # Each group used must have four identical DIMMs installed (all four # DIMMs must be from the same manufacturing vendor and must have the # same capacity). # DIMMs are 232-pin 3.3V ECC 7ns SDRAM # Uses 128-bit-wide path to memory, 150MHz DIMMs, 2.4GB/sec # bandwidth to processor and an aggregate memory bw of 9.6GB/sec # prtdiag output shows the memory installed. # # CPU CPU/Memory Slot Associated DIMM Group # --- --------------- --------------------- # 0 Slot A A0,A1 # 2 Slot A B0,B1 # 1 Slot B A0,A1 # 3 Slot B B0,B1 # 4 Slot C A0,A1 # 6 Slot C B0,B1 # 5 Slot D A0,A1 # 7 Slot D B0,B1 # $devname="Daktari (V880), Nandi (V880z)"; $familypn="A30 (V880), A47 (V880z)"; $untested=0; @simmsizes=($cpufreq < 800) ? (128,256,512) : (256,512,1024,2048); @banksstr=("A0","A1","B0","B1"); $prtdiag_has_mem=1; } if ($ultra eq "Sun Fire V480") { # Accepts 256MB, 512MB or 1GB DIMMs in groups of four per CPU # 2 or 4 UltraSPARC-III processors, 900MHz or faster # Up to 32GB memory, 8GB max per CPU, 4 DIMMs per CPU, 2 CPUs per board # Smaller version of Sun Fire V880 above $devname="Cherrystone"; $familypn="A37"; $untested=0; @simmsizes=(256,512,1024,2048); @banksstr=("A0","A1","B0","B1"); $prtdiag_has_mem=1; } if ($ultra eq "Sun Fire V490" || $ultra eq "Sun Fire V890") { # Accepts 512MB or 1GB DIMMs in groups of four per CPU # 2 or 4 UltraSPARC-III, IV or IV+ processors, 1050MHz or faster # Up to 32GB memory, 8GB max per CPU, 4 DIMMs per CPU, 2 CPUs per board # Similar memory contraints as Sun Fire V880 above if ($ultra eq "Sun Fire V490") { $devname="Sebring"; $familypn="A52"; } if ($ultra eq "Sun Fire V890") { $devname="Silverstone"; $familypn="A53"; } $untested=0; @simmsizes=(512,1024,2048); @banksstr=("A0","A1","B0","B1"); $prtdiag_has_mem=1; } if ($ultra eq "Netra T12") { # Sun Fire V1280, Netra 1280 # Essentially the same as a Sun Fire 4810, but is marketed as a low cost # single domain system. # 2-12 UltraSPARC-IIIcu processors using up to 3 CPU/Memory boards # Each CPU/Memory board holds up to 4 processors and up to 32GB memory # (32 DIMMs per board, 8 banks of 4 DIMMs) # Accepts 256MB, 512MB, 1GB or 2GB DIMMs # System Board slots are labeled SB0 and higher # A populated DIMM bank requires an UltraSPARC III CPU. # DIMMs are 232-pin 3.3V ECC 7ns SDRAM # prtdiag output shows the memory installed. $devname="Lightweight 8"; $familypn="A40 (Sun Fire V1280), N40 (Netra 1280)"; $untested=0; $prtdiag_has_mem=1; @simmsizes=(256,512,1024,2048); } if ($ultra eq "Enchilada") { # Sun Fire V210, V240, Netra 210, 240 # 1-2 UltraSPARC-IIIi (Jalapeno) processors # UltraSPARC IIIi supports 128MB to 1GB single bank DIMMs. # UltraSPARC IIIi supports 256MB to 2GB dual bank DIMMs. # DDR-1 SDRAM PC2100 DIMMs, 8 DIMM slots, 4 DIMMs per processor, # 2 banks per processor, 2 DIMMs per bank # V210 accepts 1GB & 2GB DIMMs by installing Fan Upgrade Kit, X7418A # Mixing DIMM sizes and capacities is not supported. # prtdiag output can show the memory installed. $devname="Enchilada"; # Enxs if ($banner =~ /Sun Fire V210\b/ || $model =~ /Sun-Fire-V210/) { $devname="Enchilada 1U"; $familypn="N31"; } if ($model =~ /Netra-210\b/) { $devname="Salsa 19"; $familypn="N79"; } if ($banner =~ /Sun Fire V240\b/ || $model =~ /Sun-Fire-V240/) { $devname="Enchilada 2U"; $familypn="N32"; } if ($model =~ /Netra-240\b/) { $devname="Enchilada 19"; $familypn="N54"; } $untested=0 if ($banner =~ /Sun Fire (V210|240)\b/ || $model =~ /Sun-Fire-(V210|V240)/ || $model =~ /Netra-2[14]0\b/); $prtdiag_has_mem=1; $prtdiag_banktable_has_dimms=1; $simmrangex="00002000"; # Count the skipped address range for dual CPU $simmbanks=($ncpu > 1) ? 10 : 2; $simmsperbank=2; @simmsizes=(128,256,512,1024,2048); @socketstr=("MB/P0/B0/D0","MB/P0/B0/D1","MB/P0/B1/D0","MB/P0/B1/D1","?","?","?","?","?","?","?","?","?","?","?","?"); push(@socketstr, "MB/P1/B0/D0","MB/P1/B0/D1","MB/P1/B1/D0","MB/P1/B1/D1") if ($ncpu > 1); } if ($ultra eq "Sun Fire V440" || $ultra eq "Netra 440") { # 1-4 UltraSPARC-IIIi (Jalapeno) processors # UltraSPARC IIIi supports 128MB to 1GB single bank DIMMs. # UltraSPARC IIIi supports 256MB to 2GB dual bank DIMMs. # DDR-1 SDRAM PC2100 DIMMs, 16 DIMM slots, 4 DIMMs per processor, # 2 banks per processor, 2 DIMMs per bank # prtdiag output can show the memory installed. $devname="Chalupa"; $familypn="A42"; if ($ultra eq "Netra 440") { $devname="Chalupa 19"; $familypn="N42"; } $untested=0; $prtdiag_has_mem=1; $prtdiag_banktable_has_dimms=1; $simmrangex="00002000"; $simmbanks=26; # Count the skipped address range for each CPU $simmsperbank=2; @simmsizes=(128,256,512,1024,2048); # Each CPU card has 4 DIMM slots labeled J0601 (B0/D0), J0602 (B0/D1), # J0701 (B1/D0) and J0702 (B1/D1). @socketstr=("C0/P0/B0/D0","C0/P0/B0/D1","C0/P0/B1/D0","C0/P0/B1/D1","?","?","?","?","?","?","?","?","?","?","?","?"); push(@socketstr, "C1/P0/B0/D0","C1/P0/B0/D1","C1/P0/B1/D0","C1/P0/B1/D1","?","?","?","?","?","?","?","?","?","?","?","?") if ($ncpu > 1); push(@socketstr, "C2/P0/B0/D0","C2/P0/B0/D1","C2/P0/B1/D0","C2/P0/B1/D1","?","?","?","?","?","?","?","?","?","?","?","?") if ($ncpu > 2); push(@socketstr, "C3/P0/B0/D0","C3/P0/B0/D1","C3/P0/B1/D0","C3/P0/B1/D1") if ($ncpu > 3); } if ($ultra eq "Sun Blade 1500") { # 1 UltraSPARC-IIIi (Jalapeno) processor # UltraSPARC IIIi supports 128MB to 1GB single bank DIMMs. # UltraSPARC IIIi supports 256MB to 2GB dual bank DIMMs. # 184-pin DDR-1 SDRAM PC2100 DIMMs installed in pairs, 4 DIMM slots # prtdiag output can show the memory installed. $devname="Taco"; $devname .= "+" if ($modelmore =~ /\(Silver\)/ || $banner =~ /\(Silver\)/); $familypn="A43"; $untested=0; $prtdiag_has_mem=1; $prtdiag_banktable_has_dimms=1; $simmrangex="00002000"; $simmbanks=2; $simmsperbank=2; @simmsizes=(128,256,512,1024,2048); @socketstr=("DIMM0".."DIMM3"); # DIMM1-DIMM4 on prototype } if ($ultra eq "Sun Blade 2500" || $ultra eq "Sun Fire V250") { # 1-2 UltraSPARC-IIIi (Jalapeno) processors # UltraSPARC IIIi supports 128MB to 1GB single bank DIMMs. # UltraSPARC IIIi supports 256MB to 2GB dual bank DIMMs. # 184-pin DDR-1 SDRAM PC2100 DIMMs, 8 DIMM slots, 4 DIMMs per processor, # 2 banks per processor, 2 DIMMs per bank # prtdiag output can show the memory installed. if ($ultra eq "Sun Blade 2500") { $devname="Enchilada Workstation"; $devname .= " Silver" if ($modelmore =~ /\(Silver\)/ || $banner =~ /\(Silver\)/); $familypn="A39"; } if ($ultra eq "Sun Fire V250") { $devname="Enchilada 2P Tower"; $familypn="A50"; } $untested=0; $prtdiag_has_mem=1; $prtdiag_banktable_has_dimms=1; $simmrangex="00002000"; # Count the skipped address range for dual CPU $simmbanks=($ncpu > 1) ? 20 : 2; $simmsperbank=2; @simmsizes=(128,256,512,1024,2048); if ($ultra eq "Sun Blade 2500") { @socketstr=("DIMM0".."DIMM3"); push(@socketstr, "?", "?", "?", "?", "?", "?", "?", "?", "?", "?", "?", "?", "DIMM4".."DIMM7") if ($ncpu > 1); } else { @socketstr=("MB/DIMM0","MB/DIMM1","MB/DIMM2","MB/DIMM3"); push(@socketstr, "?", "?", "?", "?", "?", "?", "?", "?", "?", "?", "?", "?", "MB/DIMM4","MB/DIMM5","MB/DIMM6","MB/DIMM7") if ($ncpu > 1); } } if ($ultra eq "Sun Ultra 45 Workstation" || $ultra eq "Sun Ultra 45 or Ultra 25 Workstation") { # 1-2 UltraSPARC-IIIi (Jalapeno) 1.6GHz processors # 1GB to 16GB of DDR1 SDRAM 266 or 333MHz registered ECC memory using # matched pairs of 512MB, 1GB and 2GB DIMMs # maximum of 4 DIMMs (8GB) per CPU # CPU0 Bank0 DIMM1&DIMM3 blue sockets, Bank1 DIMM0&DIMM2 black sockets # CPU1 Bank0 DIMM4&DIMM6 blue sockets, Bank1 DIMM5&DIMM7 black sockets # prtdiag output can show the memory installed. $devname="Chicago"; # also "Netra Salsa-19" development name $familypn="A70"; $untested=0; $prtdiag_has_mem=1; $prtdiag_banktable_has_dimms=1; $simmrangex="00002000"; # Count the skipped address range for dual CPU $simmbanks=($ncpu > 1) ? 20 : 2; $simmsperbank=2; @simmsizes=(512,1024,2048); @socketstr=("MB/DIMM1","MB/DIMM3","MB/DIMM0","MB/DIMM2"); push(@socketstr, "?", "?", "?", "?", "?", "?", "?", "?", "?", "?", "?", "?", "MB/DIMM4","MB/DIMM6","MB/DIMM5","MB/DIMM7") if ($ncpu > 1); } if ($ultra eq "Sun Ultra 25 Workstation") { # 1 UltraSPARC-IIIi (Jalapeno) 1.34GHz processors # 1GB to 8GB of DDR1 SDRAM 266 or 333MHz registered ECC memory using # matched pairs of 512MB, 1GB and 2GB DIMMs # maximum of 4 DIMMs (8GB) # Bank0 DIMM1&DIMM3 blue sockets, Bank1 DIMM0&DIMM2 black sockets # prtdiag output can show the memory installed. $devname="Southside"; $familypn="A89"; $untested=0; $prtdiag_has_mem=1; $prtdiag_banktable_has_dimms=1; $simmrangex="00002000"; $simmbanks=2; $simmsperbank=2; @simmsizes=(512,1024,2048); @socketstr=("MB/DIMM1","MB/DIMM3","MB/DIMM0","MB/DIMM2"); } if ($ultra eq "Sun Fire V125") { # 1 UltraSPARC-IIIi (Jalapeno) processor # UltraSPARC IIIi supports 128MB to 1GB single bank DIMMs. # UltraSPARC IIIi supports 256MB to 2GB dual bank DIMMs. # DDR-1 SDRAM PC2100 DIMMs, 4 DIMM slots, 2 DIMMs per bank # Mixing DIMM sizes and capacities is not supported. # prtdiag output can show the memory installed. $devname="El Paso"; $familypn="125"; $untested=0; $prtdiag_has_mem=1; $prtdiag_banktable_has_dimms=1; $simmrangex="00002000"; $simmbanks=2; $simmsperbank=2; @simmsizes=(128,256,512,1024,2048); @socketstr=("MB/P0/B0/D0","MB/P0/B0/D1","MB/P0/B1/D0","MB/P0/B1/D1"); } if ($ultra eq "Seattle") { # Sun Fire V215, V245 # 1-2 UltraSPARC-IIIi (Jalapeno) processors # UltraSPARC IIIi supports 128MB to 1GB single bank DIMMs. # UltraSPARC IIIi supports 256MB to 2GB dual bank DIMMs. # DDR-1 SDRAM PC2100 DIMMs, 8 DIMM slots, 4 DIMMs per processor, # 2 banks per processor, 2 DIMMs per bank # Mixing DIMM sizes and capacities is not supported. # prtdiag output can show the memory installed. $devname="Seattle"; # Enxs if ($banner =~ /Sun Fire V215\b/ || $model =~ /Sun-Fire-V215/) { $devname="Seattle 1U"; $familypn="215"; } if ($banner =~ /Sun Fire V245\b/ || $model =~ /Sun-Fire-V245/) { $devname="Seattle 2U"; $familypn="245"; } $untested=0; $prtdiag_has_mem=1; $prtdiag_banktable_has_dimms=1; $simmrangex="00002000"; # Count the skipped address range for dual CPU $simmbanks=($ncpu > 1) ? 10 : 2; $simmsperbank=2; @simmsizes=(128,256,512,1024,2048); @socketstr=("MB/P0/B0/D0","MB/P0/B0/D1","MB/P0/B1/D0","MB/P0/B1/D1","?","?","?","?","?","?","?","?","?","?","?","?"); push(@socketstr, "MB/P1/B0/D0","MB/P1/B0/D1","MB/P1/B1/D0","MB/P1/B1/D1") if ($ncpu > 1); } if ($ultra eq "Boston") { # Sun Fire V445 # 2-4 UltraSPARC-IIIi (Jalapeno) processors # UltraSPARC IIIi supports 128MB to 1GB single bank DIMMs. # UltraSPARC IIIi supports 256MB to 2GB dual bank DIMMs. # DDR-1 SDRAM PC2100 DIMMs, 16 DIMM slots, 4 DIMMs per processor, # 2 banks per processor, 2 DIMMs per bank # prtdiag output can show the memory installed. $devname="Boston"; $familypn="445, A77"; $untested=0; $prtdiag_has_mem=1; $prtdiag_banktable_has_dimms=1; $simmrangex="00002000"; $simmbanks=26; # Count the skipped address range for each CPU $simmsperbank=2; @simmsizes=(128,256,512,1024,2048); # Each CPU card has 4 DIMM slots labeled J0601 (B0/D0), J0602 (B0/D1), # J0701 (B1/D0) and J0702 (B1/D1). @socketstr=("C0/P0/B0/D0","C0/P0/B0/D1","C0/P0/B1/D0","C0/P0/B1/D1","?","?","?","?","?","?","?","?","?","?","?","?"); push(@socketstr, "C1/P0/B0/D0","C1/P0/B0/D1","C1/P0/B1/D0","C1/P0/B1/D1","?","?","?","?","?","?","?","?","?","?","?","?") if ($ncpu > 1); push(@socketstr, "C2/P0/B0/D0","C2/P0/B0/D1","C2/P0/B1/D0","C2/P0/B1/D1","?","?","?","?","?","?","?","?","?","?","?","?") if ($ncpu > 2); push(@socketstr, "C3/P0/B0/D0","C3/P0/B0/D1","C3/P0/B1/D0","C3/P0/B1/D1") if ($ncpu > 3); } if ($ultra eq "Serverblade1") { # Sun Fire B100s Blade Server # 1 UltraSPARC-IIi 650MHz processors # Two PC-133 DIMM slots holding up to 2GB memory # Up to 16 Blade Servers in a single B1600 Intelligent Shelf # prtdiag output shows the memory installed. $bannermore="(Sun Fire B100s Blade Server)"; $modelmore=$bannermore; $devname="Stiletto"; $familypn="A44"; $untested=0; $prtdiag_has_mem=1; $simmrangex="00000400"; $simmbanks=2; $simmsperbank=1; @simmsizes=(256,512,1024); @socketstr=("Blade/DIMM0","Blade/DIMM1"); } if ($ultra eq "T2000") { # 1 UltraSPARC-T1 (Niagara) processor with "CoolThreads" multithreading # 8 Core 1.2GHz (9.6GHz clock speed rating) or 4, 6, or 8 Core 1.0GHz # or 8 Core 1.4GHz # Up to 64GB DDR2 memory in 16 slots w/ Chipkill and DRAM sparing, ECC # registered DIMMs. Supports 512MB, 1GB, 2GB and 4GB DIMMs. # Option X7800A - 1GB (2x512MB DDR2) 370-6207, 512MB DDR2 DIMM, 533MHz # Option X7801A - 2GB (2x1GB DDR2) 370-6208, 1GB DDR2 DIMM, 533MHz # Option X7802A - 4GB (2x2GB DDR2) 370-6209, 2GB DDR2 DIMM, 533MHz # DIMMs must be installed in sets of 8. Two basic memory configurations # are supported: 8-DIMM or 16-DIMM. All DIMMs must have identical # capacity. An 8 DIMM configuration fully populates Rank 0 (R0) slots. # Base configurations sold by Sun use all 16 DIMM slots (2 ranks) except # smallest memory configuration (4GB, 8 x 512MB in Rank 0). # The minimum T2000 memory requirement is 8 Rank 0 DIMMs. # 4 memory controllers embedded in UltraSPARC-T1 (CH0-CH3) # # T2000 Memory Map # +----------------------------------------+ # | J0901 Channel 0 Rank 1 DIMM 1 | DIMM 1 # Install 1st | J0701 Channel 0 Rank 0 DIMM 1 | DIMM 2 # | J0801 Channel 0 Rank 1 DIMM 0 | DIMM 3 # Install 1st | J0601 Channel 0 Rank 0 DIMM 0 | DIMM 4 # | J1401 Channel 1 Rank 1 DIMM 1 | DIMM 5 # Install 1st | J1201 Channel 1 Rank 0 DIMM 1 | DIMM 6 # | J1301 Channel 1 Rank 1 DIMM 0 | DIMM 7 # Install 1st | J1101 Channel 1 Rank 0 DIMM 0 | DIMM 8 # +----------------------------------------+ # +---------------+ # | UltraSPARC T1 | # +---------------+ # +----------------------------------------+ # Install 1st | J2101 Channel 3 Rank 0 DIMM 0 | DIMM 9 # | J2301 Channel 3 Rank 1 DIMM 0 | DIMM 10 # Install 1st | J2201 Channel 3 Rank 0 DIMM 1 | DIMM 11 # | J2401 Channel 3 Rank 1 DIMM 1 | DIMM 12 # Install 1st | J1601 Channel 2 Rank 0 DIMM 0 | DIMM 13 # | J1801 Channel 2 Rank 1 DIMM 0 | DIMM 14 # Install 1st | J1701 Channel 2 Rank 0 DIMM 1 | DIMM 15 # | J1901 Channel 2 Rank 1 DIMM 1 | DIMM 16 # +----------------------------------------+ $devname="Ontario"; $familypn="T20"; if ($model =~ /Netra-T2000\b/ || $banner =~ /Netra T2000\b/) { $devname="Pelton"; $familypn="N20"; } $familypn="T20, SEB" if ($model =~ /SPARC-Enterprise-T2000/ || $banner =~ /SPARC Enterprise T2000/); $untested=0; $simmrangex="00002000"; if (scalar(@slots) == 8) { # Two ranks reported $simmbanks=2; $simmsperbank=8; } else { # One rank reported, but default base configurations ship with # two ranks (16 DIMMs) $simmbanks=1; $simmsperbank=16; } @simmsizes=(512,1024,2048,4096); @socketstr=("MB/CMP0/CH0/R0/D0","MB/CMP0/CH0/R0/D1","MB/CMP0/CH1/R0/D0","MB/CMP0/CH1/R0/D1","MB/CMP0/CH2/R0/D0","MB/CMP0/CH2/R0/D1","MB/CMP0/CH3/R0/D0","MB/CMP0/CH3/R0/D1","MB/CMP0/CH0/R1/D0","MB/CMP0/CH0/R1/D1","MB/CMP0/CH1/R1/D0","MB/CMP0/CH1/R1/D1","MB/CMP0/CH2/R1/D0","MB/CMP0/CH2/R1/D1","MB/CMP0/CH3/R1/D0","MB/CMP0/CH3/R1/D1"); &check_for_LDOM; } if ($ultra eq "T1000") { # 1 UltraSPARC-T1 (Niagara) processor with "CoolThreads" multithreading # 6 or 8 Core 1.0GHz # Up to 32GB DDR2 memory in 8 slots w/ Chipkill and DRAM sparing, ECC # registered DIMMs. Supports 512MB, 1GB, 2GB and 4GB DIMMs. # Option X7800A - 1GB (2x512MB DDR2) 370-6207, 512MB DDR2 DIMM, 533MHz # Option X7801A - 2GB (2x1GB DDR2) 370-6208, 1GB DDR2 DIMM, 533MHz # Option X7802A - 4GB (2x2GB DDR2) 370-6209, 2GB DDR2 DIMM, 533MHz # DIMMs must be installed in sets of 4. # Base configurations sold by Sun use all 8 DIMM slots (2 ranks) except # smallest memory configuration (2GB, 4 x 512MB in Rank 0). # The minimum T1000 memory requirement is 4 Rank 0 DIMMs. # 4 memory controllers embedded in UltraSPARC-T1 (CH0-CH3) # # T1000 Memory Map # +----------------------------------------+ # | J1301 Channel 3 Rank 1 DIMM 1 | # Install 1st | J1101 Channel 3 Rank 0 DIMM 1 | # | J1201 Channel 3 Rank 1 DIMM 0 | # Install 1st | J1001 Channel 3 Rank 0 DIMM 0 | # +----------------------------------------+ # +---------------+ # | UltraSPARC T1 | # +---------------+ # +----------------------------------------+ # Install 1st | J0501 Channel 0 Rank 0 DIMM 0 | # | J0701 Channel 0 Rank 1 DIMM 0 | # Install 1st | J0601 Channel 0 Rank 0 DIMM 1 | # | J0801 Channel 0 Rank 1 DIMM 1 | # +----------------------------------------+ $devname="Erie"; $familypn="T10"; $familypn="T10, SEA" if ($model =~ /SPARC-Enterprise-T1000/ || $banner =~ /SPARC Enterprise T1000/); $untested=0; $simmrangex="00002000"; if (scalar(@slots) == 8) { # Two ranks reported $simmbanks=2; $simmsperbank=4; } else { $simmbanks=1; $simmsperbank=8; } @simmsizes=(512,1024,2048,4096); @socketstr=("MB/CMP0/CH0/R0/D0","MB/CMP0/CH0/R0/D1","MB/CMP0/CH3/R0/D0","MB/CMP0/CH3/R0/D1","MB/CMP0/CH0/R1/D0","MB/CMP0/CH0/R1/D1","MB/CMP0/CH3/R1/D0","MB/CMP0/CH3/R1/D1"); &check_for_LDOM; } if ($ultra eq "T6300") { # 1 UltraSPARC-T1 (Niagara) processor with "CoolThreads" multithreading # 6-Core 1.0GHz, 8-Core 1.0GHz, 1.2GHz or 1.4GHz # Up to 32GB ECC Registered DDR2 PC4200 # Supports 1GB, 2GB and 4GB DIMMs. # DIMMs must be installed in sets of 4. # Supported memory configurations: # 4 FB-DIMMs (Channel 0 and Channel 3) # 4 FB-DIMMs (Channel 1 and Channel 2) # 8 FB-DIMMs (Channel 0, 1, 2 and 3) (fully populated configuration) # Due to interleaving rules for the CPU, the system will operate at # the lowest capacity of all the DIMMs installed. Therefore, it is # ideal to install eight identical DIMMs (not four DIMMs of one # capacity and four DIMMs of another capacity). $devname="St. Paul"; $familypn="A94"; $untested=0; $memtype="FB-DIMM"; $simmrangex="00002000"; $showrange=0; $simmbanks=2; $simmsperbank=4; @simmsizes=(1024,2048,4096); @socketstr=("MB/CMP0/CH0/R0/D0","MB/CMP0/CH0/R0/D1","MB/CMP0/CH3/R0/D0","MB/CMP0/CH3/R0/D1","MB/CMP0/CH1/R0/D0","MB/CMP0/CH1/R0/D1","MB/CMP0/CH2/R0/D0","MB/CMP0/CH2/R0/D1"); @socketlabelstr=("J6301","J6401","J7201","J7301","J6601","J6701","J6901","J7001"); &check_for_LDOM; } if ($ultra eq "T5120" || $ultra eq "T5220" || $ultra eq "T6320") { # 1 UltraSPARC-T2 (Niagara-II) multicore processor with "CoolThreads" # multithreading, 1.2GHz 4 or 8-Core or 1.4GHz 8-Core # Up to 64GB Fully Buffered ECC-registered DDR2 @ 667MHz # Supports 1GB, 2GB, 4GB and 8GB DIMMs. # DIMMs must be installed in sets of 4. # All FB-DIMMs must be the same density (same type and Sun part number) # Supported memory configurations: # 4 FB-DIMMs (Group 1) MB/CMP0/BR[0-3]/CH0/D0 # 8 FB-DIMMs (Groups 1-2) MB/CMP0/BR[0-3]/CH[01]/D0 # 16 FB-DIMMs (Groups 1-3) MB/CMP0/BR[0-3]/CH[01]/D[01] # # FB-DIMM Configuration: # Install FB-DIMM # Branch Channel FRU Name FB-DIMM Order Pair # # 0 0 MB/CMP0/BR0/CH0/D0 J1001 1 A # MB/CMP0/BR0/CH0/D1 J1101 3 B # 1 MB/CMP0/BR0/CH1/D0 J1201 2 A # MB/CMP0/BR0/CH1/D1 J1301 3 B # 1 0 MB/CMP0/BR1/CH0/D0 J1401 1 C # MB/CMP0/BR1/CH0/D1 J1501 3 D # 1 MB/CMP0/BR1/CH1/D0 J1601 2 C # MB/CMP0/BR1/CH1/D1 J1701 3 D # 2 0 MB/CMP0/BR2/CH0/D0 J2001 1 E # MB/CMP0/BR2/CH0/D1 J2101 3 F # 1 MB/CMP0/BR2/CH1/D0 J2201 2 E # MB/CMP0/BR2/CH1/D1 J2301 3 F # 3 0 MB/CMP0/BR3/CH0/D0 J2401 1 G # MB/CMP0/BR3/CH0/D1 J2501 3 H # 1 MB/CMP0/BR3/CH1/D0 J2601 2 G # MB/CMP0/BR3/CH1/D1 J2701 3 H # # Note - FB-DIMM names in ILOM messages are displayed with the full FRU # name, such as /SYS/MB/CMP0/BR0/CH0/D0. $devname="Huron"; if ($ultra eq "T5120") { $devname="Huron 1U"; $familypn="SEC"; } if ($ultra eq "T5220") { $devname="Huron 2U"; $familypn="SED"; } if ($banner =~ /Netra T5220\b/) { $devname="Turgo"; $familypn="NT52"; } if ($ultra eq "T6320") { $devname="Glendale"; $familypn="A95"; } $untested=0; $memtype="FB-DIMM"; $simmrangex="00008000"; $showrange=0; $simmbanks=4; $simmsperbank=4; @simmsizes=(1024,2048,4096,8192); @socketstr=("MB/CMP0/BR0/CH0/D0","MB/CMP0/BR1/CH0/D0","MB/CMP0/BR2/CH0/D0","MB/CMP0/BR3/CH0/D0","MB/CMP0/BR0/CH1/D0","MB/CMP0/BR1/CH1/D0","MB/CMP0/BR2/CH1/D0","MB/CMP0/BR3/CH1/D0","MB/CMP0/BR0/CH0/D1","MB/CMP0/BR1/CH0/D1","MB/CMP0/BR2/CH0/D1","MB/CMP0/BR3/CH0/D1","MB/CMP0/BR0/CH1/D1","MB/CMP0/BR1/CH1/D1","MB/CMP0/BR2/CH1/D1","MB/CMP0/BR3/CH1/D1"); &check_for_LDOM; } if ($ultra eq "CP3260") { # 1 UltraSPARC-T2 (Niagara-II) multicore processor with "CoolThreads" # multithreading, 6 or 8 core with 8 threads per core # 8 FB-DIMM slots, 8GB or 16GB, using 1GB or 2GB DIMMs, 8 channels # Fully Buffered ECC-registered DDR2 @ 667MHz # All FB-DIMMs must be the same density (same type and Sun part number) # Supported memory configurations: # FB0B FB0A FB1B FB1A FB2A FB2B FB3A FB3B # DIMM Pair 0 DIMM Pair 1 DIMM Pair 2 DIMM Pair 3 $devname="Monza"; $untested=1; $memtype="FB-DIMM"; $simmrangex="00008000"; $showrange=0; $simmbanks=1; $simmsperbank=8; @simmsizes=(1024,2048); @socketstr=("FB0A","FB0B","FB1A","FB1B","FB2A","FB2B","FB3A","FB3B"); &check_for_LDOM; } if ($ultra eq "T5140" || $ultra eq "T5240" || $ultra eq "T6340") { # T5140 has 2 UltraSPARC-T2+ (Victoria Falls) multicore processors with # "CoolThreads" multithreading, 1.2GHz 4, 6, or 8-Core # T5240 has 2 UltraSPARC-T2+ (Victoria Falls) multicore processors with # "CoolThreads" multithreading, 1.2GHz 4, 6, or 8-Core or 1.4GHz 8-Core # T6340 has 2 UltraSPARC-T2+ (Victoria Falls) multicore processors with # "CoolThreads" multithreading, 1.4GHz 8-Core # 8GB to 64GB Fully Buffered ECC-registered DDR2 @ 667MHz # Supports 1GB, 2GB, 4GB and 8GB DIMMs. # T5240 also supports optional mezzanine memory board doubling memory # with an additional 16 FB-DIMM sockets # All FB-DIMMs must be the same density (same type and Sun part number) # # T5140,T5240 Supported memory configurations: # 8 FB-DIMMs (Group 1) MB/CMP[01]/BR[01]/CH[01]/D0 # 12 FB-DIMMs (Groups 1-2) MB/CMP[01]/BR[01]/CH[01]/D0,MB/CMP0/BR[01]/CH[01]/D1 # 16 FB-DIMMs (Groups 1-3) MB/CMP[01]/BR[01]/CH[01]/D[01] # T5240 with memory mezzanine assembly supports these additional # memory configurations once the motherboard is fully populated: # 24 FB-DIMMs (Groups 1-4) MB/CMP[01]/MR0/BR[01]/CH[01]/D[23] # 32 FB-DIMMs (Groups 1-5) MB/CMP[01]/MR[01]/BR[01]/CH[01]/D[23] # # FB-DIMM Configuration: # Install FB-DIMM # Branch Channel FRU Name FB-DIMM Order Pair # # CMP0,0 0 MB/CMP0/BR0/CH0/D0 J0500 1 A # MB/CMP0/BR0/CH0/D1 J0600 2 B # 1 MB/CMP0/BR0/CH1/D0 J0700 1 A # MB/CMP0/BR0/CH1/D1 J0800 2 B # CMP0,1 0 MB/CMP0/BR1/CH0/D0 J0900 1 C # MB/CMP0/BR1/CH0/D1 J1000 2 D # 1 MB/CMP0/BR1/CH1/D0 J1100 1 C # MB/CMP0/BR1/CH1/D1 J1200 2 D # CMP1,0 0 MB/CMP1/BR0/CH0/D0 J1800 1 E # MB/CMP1/BR0/CH0/D1 J1900 3 F # 1 MB/CMP1/BR0/CH1/D0 J2000 1 E # MB/CMP1/BR0/CH1/D1 J2100 3 F # CMP1,1 0 MB/CMP1/BR1/CH0/D0 J2200 1 G # MB/CMP1/BR1/CH0/D1 J2300 3 H # 1 MB/CMP1/BR1/CH1/D0 J2400 1 G # MB/CMP1/BR1/CH1/D1 J2500 3 H # CMP0,0 0 MB/CMP0/MR0/BR0/CH0/D2 J0201 4 # MB/CMP0/MR0/BR0/CH0/D3 J0301 4 # 1 MB/CMP0/MR0/BR0/CH1/D2 J0401 4 # MB/CMP0/MR0/BR0/CH1/D3 J0501 4 # CMP0,1 0 MB/CMP0/MR0/BR1/CH0/D2 J0601 4 # MB/CMP0/MR0/BR1/CH0/D3 J0701 4 # 1 MB/CMP0/MR0/BR1/CH1/D2 J0801 4 # MB/CMP0/MR0/BR1/CH1/D3 J0901 4 # CMP1,0 0 MB/CMP1/MR1/BR0/CH0/D2 J0201 5 # MB/CMP1/MR1/BR0/CH0/D3 J0301 5 # 1 MB/CMP1/MR1/BR0/CH1/D2 J0401 5 # MB/CMP1/MR1/BR0/CH1/D3 J0501 5 # CMP1,1 0 MB/CMP1/MR1/BR1/CH0/D2 J0601 5 # MB/CMP1/MR1/BR1/CH0/D3 J0701 5 # 1 MB/CMP1/MR1/BR1/CH1/D2 J0801 5 # MB/CMP1/MR1/BR1/CH1/D3 J0901 5 # # Note - FB-DIMM names in ILOM messages are displayed with the full FRU # name, such as /SYS/MB/CMP0/BR0/CH0/D0. $devname="Maramba"; if ($ultra eq "T5140") { $devname="Maramba 1U"; $familypn="SET"; } if ($ultra eq "T5240") { $devname="Maramba 2U"; $familypn="SEU"; } $untested=0; if ($model =~ /-USBRDT-5240/) { $devname="Thunder"; $untested=1; } if ($ultra eq "T6340") { $devname="Scottsdale"; $familypn="T6340"; } if ($model =~ /Netra.*T6340/) { $familypn="NT6340"; $untested=1; } $memtype="FB-DIMM"; $simmrangex="00008000"; $showrange=0; $simmbanks=4; $simmbanks=8 if ($ultra eq "T5240" || $ultra eq "T6340"); $simmsperbank=4; @simmsizes=(1024,2048,4096,8192); @socketstr=("MB/CMP0/BR0/CH0/D0","MB/CMP0/BR0/CH1/D0","MB/CMP0/BR1/CH0/D0","MB/CMP0/BR1/CH1/D0","MB/CMP1/BR0/CH0/D0","MB/CMP1/BR0/CH1/D0","MB/CMP1/BR1/CH0/D0","MB/CMP1/BR1/CH1/D0","MB/CMP0/BR0/CH0/D1","MB/CMP0/BR0/CH1/D1","MB/CMP0/BR1/CH0/D1","MB/CMP0/BR1/CH1/D1","MB/CMP1/BR0/CH0/D1","MB/CMP1/BR0/CH1/D1","MB/CMP1/BR1/CH0/D1","MB/CMP1/BR1/CH1/D1"); push(@socketstr, "MB/CMP0/MR0/BR0/CH0/D2","MB/CMP0/MR0/BR0/CH0/D3","MB/CMP0/MR0/BR0/CH1/D2","MB/CMP0/MR0/BR0/CH1/D3","MB/CMP0/MR0/BR1/CH0/D2","MB/CMP0/MR0/BR1/CH0/D3","MB/CMP0/MR0/BR1/CH1/D2","MB/CMP0/MR0/BR1/CH1/D3","MB/CMP1/MR1/BR0/CH0/D2","MB/CMP1/MR1/BR0/CH0/D3","MB/CMP1/MR1/BR0/CH1/D2","MB/CMP1/MR1/BR0/CH1/D3","MB/CMP1/MR1/BR1/CH0/D2","MB/CMP1/MR1/BR1/CH0/D3","MB/CMP1/MR1/BR1/CH1/D2","MB/CMP1/MR1/BR1/CH1/D3") if ($ultra eq "T5240"); push(@socketstr, "MB/CMP0/BR0/CH0/D2","MB/CMP0/BR0/CH0/D3","MB/CMP0/BR0/CH1/D2","MB/CMP0/BR0/CH1/D3","MB/CMP0/BR1/CH0/D2","MB/CMP0/BR1/CH0/D3","MB/CMP0/BR1/CH1/D2","MB/CMP0/BR1/CH1/D3","MB/CMP1/BR0/CH0/D2","MB/CMP1/BR0/CH0/D3","MB/CMP1/BR0/CH1/D2","MB/CMP1/BR0/CH1/D3","MB/CMP1/BR1/CH0/D2","MB/CMP1/BR1/CH0/D3","MB/CMP1/BR1/CH1/D2","MB/CMP1/BR1/CH1/D3") if ($ultra eq "T6340"); &check_for_LDOM; } if ($ultra eq "T5440") { # T5440 has 4 UltraSPARC-T2+ (Victoria Falls) multicore processors # Netra-T5440 has 2 UltraSPARC-T2+ (Victoria Falls) multicore processors # 16GB to 256GB Fully Buffered ECC-registered DDR2 @ 667MHz # Supports 2GB, 4GB and 8GB DIMMs. # All FB-DIMMs must be the same density (same type and Sun part number) # # Note - FB-DIMM names in ILOM messages are displayed with the full FRU # name, such as /SYS/MB/CMP0/BR0/CH0/D0. $devname="Batoka" if ($ultra eq "T5440"); $devname="Congo" if ($model =~ /Netra-T5440/); $devname="Lightning" if ($model =~ /-USBRDT-5440/); $untested=0; $untested=1 if ($model =~ /-USBRDT-5440/); $memtype="FB-DIMM"; $simmrangex="00004000"; $showrange=0; $simmbanks=4; $simmsperbank=4; @simmsizes=(2048,4096,8192); if ($model =~ /Netra-T5440/) { $familypn="NT544"; @socketstr=("MB/CMP0/BR0/CH0/D0","MB/CMP0/BR0/CH1/D0","MB/CMP0/BR1/CH0/D0","MB/CMP0/BR1/CH1/D0","MB/CMP1/BR0/CH0/D0","MB/CMP1/BR0/CH1/D0","MB/CMP1/BR1/CH0/D0","MB/CMP1/BR1/CH1/D0","MB/CMP0/BR0/CH0/D1","MB/CMP0/BR0/CH1/D1","MB/CMP0/BR1/CH0/D1","MB/CMP0/BR1/CH1/D1","MB/CMP1/BR0/CH0/D1","MB/CMP1/BR0/CH1/D1","MB/CMP1/BR1/CH0/D1","MB/CMP1/BR1/CH1/D1","MB/CMP0/MR0/BR0/CH0/D2","MB/CMP0/MR0/BR0/CH0/D3","MB/CMP0/MR0/BR0/CH1/D2","MB/CMP0/MR0/BR0/CH1/D3","MB/CMP0/MR0/BR1/CH0/D2","MB/CMP0/MR0/BR1/CH0/D3","MB/CMP0/MR0/BR1/CH1/D2","MB/CMP0/MR0/BR1/CH1/D3","MB/CMP1/MR1/BR0/CH0/D2","MB/CMP1/MR1/BR0/CH0/D3","MB/CMP1/MR1/BR0/CH1/D2","MB/CMP1/MR1/BR0/CH1/D3","MB/CMP1/MR1/BR1/CH0/D2","MB/CMP1/MR1/BR1/CH0/D3","MB/CMP1/MR1/BR1/CH1/D2","MB/CMP1/MR1/BR1/CH1/D3"); } else { $familypn="SEV"; @socketstr=("MB/CPU0/CMP0/BR0/CH0/D0","MB/CPU0/CMP0/BR0/CH1/D0","MB/CPU0/CMP0/BR1/CH0/D0","MB/CPU0/CMP0/BR1/CH1/D0","MB/MEM0/CMP0/BR0/CH0/D1","MB/MEM0/CMP0/BR0/CH1/D1","MB/MEM0/CMP0/BR1/CH0/D1","MB/MEM0/CMP0/BR1/CH1/D1","MB/CPU1/CMP1/BR0/CH0/D0","MB/CPU1/CMP1/BR0/CH1/D0","MB/CPU1/CMP1/BR1/CH0/D0","MB/CPU1/CMP1/BR1/CH1/D0","MB/MEM1/CMP1/BR0/CH0/D1","MB/MEM1/CMP1/BR0/CH1/D1","MB/MEM1/CMP1/BR1/CH0/D1","MB/MEM1/CMP1/BR1/CH1/D1","MB/CPU2/CMP2/BR0/CH0/D0","MB/CPU2/CMP2/BR0/CH1/D0","MB/CPU2/CMP2/BR1/CH0/D0","MB/CPU2/CMP2/BR1/CH1/D0","MB/MEM2/CMP2/BR0/CH0/D1","MB/MEM2/CMP2/BR0/CH1/D1","MB/MEM2/CMP2/BR1/CH0/D1","MB/MEM2/CMP2/BR1/CH1/D1","MB/CPU3/CMP3/BR0/CH0/D0","MB/CPU3/CMP3/BR0/CH1/D0","MB/CPU3/CMP3/BR1/CH0/D0","MB/CPU3/CMP3/BR1/CH1/D0","MB/MEM3/CMP3/BR0/CH0/D1","MB/MEM3/CMP3/BR0/CH1/D1","MB/MEM3/CMP3/BR1/CH0/D1","MB/MEM3/CMP3/BR1/CH1/D1"); } &check_for_LDOM; } if ($ultra eq "T3-1" || $ultra eq "T3-1B") { # SPARC T3-1 and T3-1B have 1 SPARC-T3 (Rainbow Falls) multicore # processor with 8-Threads, 16-Core, 1.65GHz # 16 DIMM slots for up to 128GB memory (16 x 8GB), 8GB min (4 x 2GB) # supports 2GB, 4GB & 8GB DDR3 DIMMs, dual-rank # DIMM slots are organized into four branches, with each branch # connected to a separate Buffer-on-Board (BOB) ASIC, designated BOB0 # through BOB3. Each BOB ASIC has two DDR3 channels, with each channel # supporting two DIMMs. # Populate the 4 blue slots first (CH1/D0), the 4 white slots second # (CH0/D0), and the 8 black slots third (D1). $memtype="DDR3 DIMM"; $simmrangex="00004000"; $showrange=0; $simmbanks=4; # Assume largest DIMMs installed for prtconf-only data $simmsperbank=&roundup_memory($installed_memory) / 8192; @simmsizes=(2048,4096,8192); $familypn="SE3" if ($ultra eq "T3-1"); $familypn="T31B" if ($ultra eq "T3-1B"); $familypn="NST3" if ($ultra eq "T3-1" && $banner =~ /Netra/i); $untested=0 if ($ultra eq "T3-1" || $ultra eq "T3-1B"); $untested=1 if ($banner =~ /Netra/i); @socketstr=("MB/CMP0/BOB0/CH1/D0","MB/CMP0/BOB1/CH1/D0","MB/CMP0/BOB2/CH1/D0","MB/CMP0/BOB3/CH1/D0","MB/CMP0/BOB0/CH0/D0","MB/CMP0/BOB1/CH0/D0","MB/CMP0/BOB2/CH0/D0","MB/CMP0/BOB3/CH0/D0","MB/CMP0/BOB0/CH1/D1","MB/CMP0/BOB1/CH1/D1","MB/CMP0/BOB2/CH1/D1","MB/CMP0/BOB3/CH1/D1","MB/CMP0/BOB0/CH0/D1","MB/CMP0/BOB1/CH0/D1","MB/CMP0/BOB2/CH0/D1","MB/CMP0/BOB3/CH0/D1"); &check_for_LDOM; } if ($ultra eq "T3-1BA") { # Netra SPARC T3-1BA has 1 SPARC-T3 (Rainbow Falls) multicore processor # with 8-Threads, 12-Core, 1.4GHz # 8 DIMM slots, 2GB or 4GB DDR3, all slots must be populated same # 16GB min (8 x 2GB), 32GB max (8 x 4GB) $memtype="DDR3 DIMM"; $simmrangex="00004000"; $showrange=0; $simmbanks=1; $simmsperbank=8; @simmsizes=(2048,4096); $untested=1; @socketstr=("DIMM0".."DIMM7"); # Guess &check_for_LDOM; } if ($ultra eq "T3-2") { # SPARC T3-2 has 2 SPARC-T3 (Rainbow Falls) multicore processors, each # with 8-Threads, 16-Core, 1.65GHz # 32 DIMM slots for up to 256GB memory (32 x 8GB), 64GB min (16 x 4GB) # supports 4GB & 8GB DDR3 DIMMs, dual-rank # A maximum of two memory risers (MR0 & MR1) supported per CPU, thus # allowing up to four memory risers total. # Each memory riser slot in the server chassis must be filled with # either a memory riser or filler panel, and each memory riser must be # filled with DIMMs and/or DIMM filler panels. # Each memory riser has 8 DIMM slots (D0-D3 for MB1, D4-D7 for MB0) # Install D0/D4 (blue), then D2/D6 (white), then D1/D5 (black), and # then D3/D7 (green). # Performance-oriented configurations should be configured with two # memory risers per CPU. In configurations that do not require two # memory risers per CPU, the following guidelines should be followed: # - Populate riser slot MR0 for each CPU, starting with the lowest # numbered CPU (P0). # - Populate riser slot MR1 for each CPU, starting with the lowest # numbered CPU (P0). $memtype="DDR3 DIMM"; $simmrangex="00004000"; $showrange=0; $simmbanks=4; # Assume largest DIMMs installed for prtconf-only data $simmsperbank=&roundup_memory($installed_memory) / 8192; @simmsizes=(4096,8192); $familypn="SE4"; $untested=0; $untested=1 if ($banner =~ /Netra/i); @socketstr=("MB/CMP0/MR0/BOB0/CH0/D0","MB/CMP0/MR0/BOB0/CH1/D0","MB/CMP0/MR0/BOB1/CH0/D0","MB/CMP0/MR0/BOB1/CH1/D0","MB/CMP1/MR0/BOB0/CH0/D0","MB/CMP1/MR0/BOB0/CH1/D0","MB/CMP1/MR0/BOB1/CH0/D0","MB/CMP1/MR0/BOB1/CH1/D0","MB/CMP0/MR1/BOB0/CH0/D0","MB/CMP0/MR1/BOB0/CH1/D0","MB/CMP0/MR1/BOB1/CH0/D0","MB/CMP0/MR1/BOB1/CH1/D0","MB/CMP1/MR1/BOB0/CH0/D0","MB/CMP1/MR1/BOB0/CH1/D0","MB/CMP1/MR1/BOB1/CH0/D0","MB/CMP1/MR1/BOB1/CH1/D0","MB/CMP0/MR0/BOB0/CH0/D1","MB/CMP0/MR0/BOB0/CH1/D1","MB/CMP0/MR0/BOB1/CH0/D1","MB/CMP0/MR0/BOB1/CH1/D1","MB/CMP1/MR0/BOB0/CH0/D1","MB/CMP1/MR0/BOB0/CH1/D1","MB/CMP1/MR0/BOB1/CH0/D1","MB/CMP1/MR0/BOB1/CH1/D1","MB/CMP0/MR1/BOB0/CH0/D1","MB/CMP0/MR1/BOB0/CH1/D1","MB/CMP0/MR1/BOB1/CH0/D1","MB/CMP0/MR1/BOB1/CH1/D1","MB/CMP1/MR1/BOB0/CH0/D1","MB/CMP1/MR1/BOB0/CH1/D1","MB/CMP1/MR1/BOB1/CH0/D1","MB/CMP1/MR1/BOB1/CH1/D1"); &check_for_LDOM; } if ($ultra eq "T3-4") { # SPARC T3-4 has 2 or 4 SPARC-T3 (Rainbow Falls) multicore processors, # each with 8-Threads, 16-Core, 1.65GHz # 64 DIMM slots for up to 512GB memory (64 x 8GB), 128GB min (32 x 4GB) # supports 4GB & 8GB DDR3 DIMMs, dual-rank $memtype="DDR3 DIMM"; $simmrangex="00004000"; $showrange=0; $simmbanks=4; # Assume largest DIMMs installed for prtconf-only data $simmsperbank=&roundup_memory($installed_memory) / 8192; @simmsizes=(4096,8192); $familypn="SE5"; $untested=1; $untested=1 if ($banner =~ /Netra/i); # Guess on socket name order ??? @socketstr=("PM0/CMP1/BOB0/CH0/D0","PM0/CMP1/BOB0/CH1/D0","PM0/CMP1/BOB1/CH0/D0","PM0/CMP1/BOB1/CH1/D0","PM0/CMP1/BOB2/CH0/D0","PM0/CMP1/BOB2/CH1/D0","PM0/CMP1/BOB3/CH0/D0","PM0/CMP1/BOB3/CH1/D0","PM0/CMP0/BOB0/CH0/D0","PM0/CMP0/BOB0/CH1/D0","PM0/CMP0/BOB1/CH0/D0","PM0/CMP0/BOB1/CH1/D0","PM0/CMP0/BOB2/CH0/D0","PM0/CMP0/BOB2/CH1/D0","PM0/CMP0/BOB3/CH0/D0","PM0/CMP0/BOB3/CH1/D0"); push(@socketstr, "PM0/CMP1/BOB0/CH0/D1","PM0/CMP1/BOB0/CH1/D1","PM0/CMP1/BOB1/CH0/D1","PM0/CMP1/BOB1/CH1/D1","PM0/CMP1/BOB2/CH0/D1","PM0/CMP1/BOB2/CH1/D1","PM0/CMP1/BOB3/CH0/D1","PM0/CMP1/BOB3/CH1/D1","PM0/CMP0/BOB0/CH0/D1","PM0/CMP0/BOB0/CH1/D1","PM0/CMP0/BOB1/CH0/D1","PM0/CMP0/BOB1/CH1/D1","PM0/CMP0/BOB2/CH0/D1","PM0/CMP0/BOB2/CH1/D1","PM0/CMP0/BOB3/CH0/D1","PM0/CMP0/BOB3/CH1/D1"); # Need to determine if PM1 is installed, its DIMMs are next push(@socketstr, "PM1/CMP1/BOB0/CH0/D0","PM1/CMP1/BOB0/CH1/D0","PM1/CMP1/BOB1/CH0/D0","PM1/CMP1/BOB1/CH1/D0","PM1/CMP1/BOB2/CH0/D0","PM1/CMP1/BOB2/CH1/D0","PM1/CMP1/BOB3/CH0/D0","PM1/CMP1/BOB3/CH1/D0","PM1/CMP0/BOB0/CH0/D0","PM1/CMP0/BOB0/CH1/D0","PM1/CMP0/BOB1/CH0/D0","PM1/CMP0/BOB1/CH1/D0","PM1/CMP0/BOB2/CH0/D0","PM1/CMP0/BOB2/CH1/D0","PM1/CMP0/BOB3/CH0/D0","PM1/CMP0/BOB3/CH1/D0"); push(@socketstr, "PM1/CMP1/BOB0/CH0/D1","PM1/CMP1/BOB0/CH1/D1","PM1/CMP1/BOB1/CH0/D1","PM1/CMP1/BOB1/CH1/D1","PM1/CMP1/BOB2/CH0/D1","PM1/CMP1/BOB2/CH1/D1","PM1/CMP1/BOB3/CH0/D1","PM1/CMP1/BOB3/CH1/D1","PM1/CMP0/BOB0/CH0/D1","PM1/CMP0/BOB0/CH1/D1","PM1/CMP0/BOB1/CH0/D1","PM1/CMP0/BOB1/CH1/D1","PM1/CMP0/BOB2/CH0/D1","PM1/CMP0/BOB2/CH1/D1","PM1/CMP0/BOB3/CH0/D1","PM1/CMP0/BOB3/CH1/D1"); &check_for_LDOM; } if ($ultra eq "T4-1" || $ultra eq "T4-1B") { # SPARC T4-1 and T4-1B have 1 SPARC-T4 multicore processor with # 8-Threads, 8-Core, 2.85GHz # 16 DIMM slots for up to 256GB memory (16 x 16GB), 16GB min (4 x 4GB) # supports 4GB, 8GB & 16GB DDR3 DIMMs # DIMM slots are organized into four branches, with each branch # connected to a separate Buffer-on-Board (BOB) ASIC, designated BOB0 # through BOB3. Each BOB ASIC has two DDR3 channels, with each channel # supporting two DIMMs. # Populate the 4 blue slots first (CH1/D0), the 4 white slots second # (CH0/D0), and the 8 black slots third (D1). $memtype="DDR3 DIMM"; $simmrangex="00008000"; # Guess $showrange=0; $simmbanks=4; # Assume largest DIMMs installed for prtconf-only data $simmsperbank=&roundup_memory($installed_memory) / 16384; @simmsizes=(4096,8192,16384); $familypn="T41B" if ($ultra eq "T4-1B"); $untested=0 if ($ultra eq "T4-1"); @socketstr=("MB/CMP0/BOB0/CH1/D0","MB/CMP0/BOB1/CH1/D0","MB/CMP0/BOB2/CH1/D0","MB/CMP0/BOB3/CH1/D0","MB/CMP0/BOB0/CH0/D0","MB/CMP0/BOB1/CH0/D0","MB/CMP0/BOB2/CH0/D0","MB/CMP0/BOB3/CH0/D0","MB/CMP0/BOB0/CH1/D1","MB/CMP0/BOB1/CH1/D1","MB/CMP0/BOB2/CH1/D1","MB/CMP0/BOB3/CH1/D1","MB/CMP0/BOB0/CH0/D1","MB/CMP0/BOB1/CH0/D1","MB/CMP0/BOB2/CH0/D1","MB/CMP0/BOB3/CH0/D1"); &check_for_LDOM; } if ($ultra eq "T4-2" || $ultra eq "T4-2B") { # SPARC T4-2 and T4-2B have 2 SPARC-T4 multicore processor with # 8-Threads, 8-Core, 2.85GHz # 32 DIMM slots for up to 512GB memory (32 x 16GB), 64GB min (16 x 4GB) # supports 4GB, 8GB & 16GB DDR3 DIMMs $memtype="DDR3 DIMM"; $simmrangex="00008000"; # Guess $showrange=0; $simmbanks=8; # Assume largest DIMMs installed for prtconf-only data $simmsperbank=&roundup_memory($installed_memory) / 16384; @simmsizes=(4096,8192,16384); $untested=0 if ($ultra eq "T4-2"); $untested=1 if ($banner =~ /Netra/i); @socketstr=("MB/CMP0/MR0/BOB0/CH0/D0","MB/CMP0/MR0/BOB0/CH1/D0","MB/CMP0/MR0/BOB1/CH0/D0","MB/CMP0/MR0/BOB1/CH1/D0","MB/CMP1/MR0/BOB0/CH0/D0","MB/CMP1/MR0/BOB0/CH1/D0","MB/CMP1/MR0/BOB1/CH0/D0","MB/CMP1/MR0/BOB1/CH1/D0","MB/CMP0/MR1/BOB0/CH0/D0","MB/CMP0/MR1/BOB0/CH1/D0","MB/CMP0/MR1/BOB1/CH0/D0","MB/CMP0/MR1/BOB1/CH1/D0","MB/CMP1/MR1/BOB0/CH0/D0","MB/CMP1/MR1/BOB0/CH1/D0","MB/CMP1/MR1/BOB1/CH0/D0","MB/CMP1/MR1/BOB1/CH1/D0","MB/CMP0/MR0/BOB0/CH0/D1","MB/CMP0/MR0/BOB0/CH1/D1","MB/CMP0/MR0/BOB1/CH0/D1","MB/CMP0/MR0/BOB1/CH1/D1","MB/CMP1/MR0/BOB0/CH0/D1","MB/CMP1/MR0/BOB0/CH1/D1","MB/CMP1/MR0/BOB1/CH0/D1","MB/CMP1/MR0/BOB1/CH1/D1","MB/CMP0/MR1/BOB0/CH0/D1","MB/CMP0/MR1/BOB0/CH1/D1","MB/CMP0/MR1/BOB1/CH0/D1","MB/CMP0/MR1/BOB1/CH1/D1","MB/CMP1/MR1/BOB0/CH0/D1","MB/CMP1/MR1/BOB0/CH1/D1","MB/CMP1/MR1/BOB1/CH0/D1","MB/CMP1/MR1/BOB1/CH1/D1"); &check_for_LDOM; } if ($ultra eq "T4-4") { # SPARC T4-4 has 4 SPARC-T4 multicore processor with # 8-Threads, 8-Core, 3.0GHz # 64 DIMM slots for up to 1TB memory (64 x 16GB), 64GB min (16 x 4GB) # supports 4GB, 8GB & 16GB DDR3 DIMMs $memtype="DDR3 DIMM"; $simmrangex="00008000"; # Guess $showrange=0; $simmbanks=16; # Assume largest DIMMs installed for prtconf-only data $simmsperbank=&roundup_memory($installed_memory) / 16384; @simmsizes=(4096,8192,16384); $untested=0; $untested=1 if ($banner =~ /Netra/i); @socketstr=("/SYS/PM0/CMP0/BOB0/CH0/D0","/SYS/PM0/CMP0/BOB0/CH1/D0","/SYS/PM0/CMP0/BOB1/CH0/D0","/SYS/PM0/CMP0/BOB1/CH1/D0","/SYS/PM0/CMP0/BOB2/CH0/D0","/SYS/PM0/CMP0/BOB2/CH1/D0","/SYS/PM0/CMP0/BOB3/CH0/D0","/SYS/PM0/CMP0/BOB3/CH1/D0","/SYS/PM0/CMP1/BOB0/CH0/D0","/SYS/PM0/CMP1/BOB0/CH1/D0","/SYS/PM0/CMP1/BOB1/CH0/D0","/SYS/PM0/CMP1/BOB1/CH1/D0","/SYS/PM0/CMP1/BOB2/CH0/D0","/SYS/PM0/CMP1/BOB2/CH1/D0","/SYS/PM0/CMP1/BOB3/CH0/D0","/SYS/PM0/CMP1/BOB3/CH1/D0","/SYS/PM1/CMP0/BOB0/CH0/D0","/SYS/PM1/CMP0/BOB0/CH1/D0","/SYS/PM1/CMP0/BOB1/CH0/D0","/SYS/PM1/CMP0/BOB1/CH1/D0","/SYS/PM1/CMP0/BOB2/CH0/D0","/SYS/PM1/CMP0/BOB2/CH1/D0","/SYS/PM1/CMP0/BOB3/CH0/D0","/SYS/PM1/CMP0/BOB3/CH1/D0","/SYS/PM1/CMP1/BOB0/CH0/D0","/SYS/PM1/CMP1/BOB0/CH1/D0","/SYS/PM1/CMP1/BOB1/CH0/D0","/SYS/PM1/CMP1/BOB1/CH1/D0","/SYS/PM1/CMP1/BOB2/CH0/D0","/SYS/PM1/CMP1/BOB2/CH1/D0","/SYS/PM1/CMP1/BOB3/CH0/D0","/SYS/PM1/CMP1/BOB3/CH1/D0"); &check_for_LDOM; } if ($ultra eq "T5-2") { # SPARC T5-2 has 2 SPARC-T5 multicore processor with # 8-Threads, 16-Core, 3.6GHz # 32 DIMM slots for up to 1TB memory (32 x 32GB), 256GB min (32 x 8GB) # supports 8GB, 16GB & 32GB DDR3 DIMMs # Each slot on a memory riser must be filled with a DIMM # All memory risers must contain the same type of DIMM $memtype="DDR3 DIMM"; $showrange=0; @simmsizes=(8192,16384,32768); $untested=0; # /SYS/MB/CM0/CMP/MR0/BOB0/CH0/D0 - /SYS/MB/CM1/CMP/MR3/BOB1/CH1/D0 for $s_cm (0,1) { for $s_mr (0..3) { for $s_bob (0,1) { for $s_ch (0,1) { push(@socketstr, "/SYS/MB/CM$s_cm/CMP/MR$s_mr/BOB$s_bob/CH$s_ch/D0"); } } } } &check_for_LDOM; } if ($ultra eq "T5-4") { # SPARC T5-4 has 4 SPARC-T5 multicore processor with # 8-Threads, 16-Core, 3.6GHz # 64 DIMM slots for 2TB memory (64 x 32GB) or 1TB min (64 x 16GB) # supports 16GB & 32GB DDR3 DIMMs # All DIMMs installed in the server must have identical capacities # All DIMMs installed in each processor module must be identical $memtype="DDR3 DIMM"; $showrange=0; @simmsizes=(16384,32768); $untested=0; # /SYS/PM0/CM0/CMP/BOB0/CH0/D0 - /SYS/PM1/CM1/CMP/BOB7/CH1/D0 for $s_pm (0,1) { for $s_cm (0,1) { for $s_bob (0..7) { for $s_ch (0,1) { push(@socketstr, "/SYS/PM$s_pm/CM$s_cm/CMP/BOB$s_bob/CH$s_ch/D0"); } } } } &check_for_LDOM; } if ($ultra eq "T5-8") { # SPARC T5-8 has 8 SPARC-T5 multicore processor with # 8-Threads, 16-Core, 3.6GHz # 128 DIMM slots for 4TB memory (128 x 32GB) or 2TB min (128 x 16GB) # supports 16GB & 32GB DDR3 DIMMs # All DIMMs installed in the server must have identical capacities # All DIMMs installed in each processor module must be identical $memtype="DDR3 DIMM"; $showrange=0; @simmsizes=(16384,32768); $untested=1; # /SYS/PM0/CM0/CMP/BOB0/CH0/D0 - /SYS/PM3/CM1/CMP/BOB7/CH1/D0 for $s_pm (0..3) { for $s_cm (0,1) { for $s_bob (0..7) { for $s_ch (0,1) { push(@socketstr, "/SYS/PM$s_pm/CM$s_cm/CMP/BOB$s_bob/CH$s_ch/D0"); } } } } &check_for_LDOM; } if ($ultra eq "T5-1B") { # SPARC T5-1B has 1 SPARC-T5 multicore processor with # 8-Threads, 16-Core, 3.6GHz # 16 DIMM slots for up to 512GB memory (16 x 32GB), 128GB min (16 x 8GB) # supports 8GB, 16GB & 32GB DDR3 DIMMs # Install quantities of 16 DIMMs # Ensure that all DIMMs are the same capacity and rank classification $memtype="DDR3 DIMM"; $showrange=0; @simmsizes=(8192,16384,32768); $untested=1; # /SYS/MB/CM0/CMP/BOB0/CH0/D0 - /SYS/MB/CM0/CMP/BOB7/CH1/D0 for $s_bob (0..7) { for $s_ch (0,1) { push(@socketstr, "/SYS/MB/CM0/CMP/BOB$s_bob/CH$s_ch/D0"); } } &check_for_LDOM; } if ($ultra eq "M5-32" || $ultra eq "M6-32") { # SPARC M5-32 has 8 to 32 SPARC M5 processor at 3.6GHz, each with: # 6 cores, 48 threads # 32 DIMM slots for up to 1TB memory (32 x 32GB) # supports 16GB & 32GB 1066MHz DDR3 DIMMs # SPARC M6-32 has 8 to 32 SPARC M5 processor at 3.6GHz, each with: # 12 cores, 96 threads # 32 DIMM slots for up to 1TB memory (32 x 32GB) # supports 16GB & 32GB 1066MHz DDR3 DIMMs # Each CMU (CPU Memory Unit) includes 2 CMPs and 64 DIMM slots # Each CMU can be Quarter, Half, or Fully-Populated # Quarter-Populated: CMP[01]/D0000-D1101 (16 DIMMs) # Half-Populated: CMP[01]/D0000-D1103 (32 DIMMs) # Fully-Populated: CMP[01]/D0000-D1113 (64 DIMMs) $memtype="DDR3 DIMM"; $showrange=0; @simmsizes=(16384,32768); $untested=1; # /SYS/CMU0/CMP0/D0000 - /SYS/CMU15/CMP1/D1113 $s_cmu=int(($npcpu/2)-1); for (0..$s_cmu) { for $s_cmp (0,1) { for $s_d1 (0,1) { for $s_d2 (0,1) { for $s_d3 (0,1) { for $s_d4 (0..3) { push(@socketstr, "/SYS/CMU$s_cmu/CMP$s_cmp/D$s_d1$s_d2$s_d3$s_d4"); } } } } } } &check_for_LDOM; } if ($ultra eq "M10-1") { # Fujitsu SPARC M10-1 has 1 SPARC64-X processor at 2.8GHz # 16 cores, 32 threads # 16 DIMM slots for up to 512GB memory (16 x 32GB), 128GB min (16 x 8GB) # supports 8GB, 16GB & 32GB R-DIMM or 64GB LR-DIMM # Mount memory in units of four or eight modules # Within a unit of four or eight modules, all the DIMMs must be of the # same capacity and rank # First mount memory group A, then mount memory group B $memtype="DIMM"; $showrange=0; @simmsizes=(8192,16384,32768,65536); $untested=0; # /SYS/MBU/CMP0/MEM[01][0-3][AB] for $s_memAB ("A","B") { for $s_cmp (0,1) { for $s_memN (0..3) { push(@socketstr, "/SYS/MBU/CMP0/MEM$s_cmp$s_memN$s_memAB"); } } } &check_for_LDOM; } if ($ultra eq "M10-4" || $ultra eq "M10-4S") { # Fujitsu SPARC M10-4 has up to 4 SPARC64-X processor at 2.8GHz # 16 cores, 32 threads each # 32 DIMM slots per memory unit for up to 2TB memory (32 x 64GB), 64GB min (8 x 8GB) # supports 8GB, 16GB & 32GB R-DIMM or 64GB LR-DIMM # Mount memory in units of eight modules # Within a unit of eight modules, all the DIMMs must be of the same # capacity and rank # First mount memory group A, then mount memory group B # M10-4S is a modular system that combines up to 16 M10-4 servers for # up to 64 processors and up to 32TB memory $memtype="DIMM"; $showrange=0; @simmsizes=(8192,16384,32768,65536); $untested=0; $untested=1 if ($ultra eq "M10-4S"); if ($npcpu > 4) { # M10-4S $ultra="M10-4S"; $untested=1; } # M10-4: /BB0/CMUL/CMP0/MEM0[0-7]A - /BB0/CMUU/CMP1/MEM1[0-7]B # M10-4S: /BB00/CMUL/CMP0/MEM0[0-7]A - /BB15/CMUU/CMP1/MEM1[0-7]B # Guess $bb=int(($npcpu/4)-1); # BB: Building Block for (0..$bb) { $bb="0$bb" if ($ultra eq "M10-4S" && $bb < 10); # Guess if (($npcpu/2) % 2) { push(@cmus, "/BB$bb/CMUL"); } else { push(@cmus, "/BB$bb/CMUU"); } for $s_cmu (@cmus) { for $s_cmp (0,1) { for $s_memAB ("A","B") { for $s_memN (0..7) { push(@socketstr, "$s_cmu/CMP$s_cmp/MEM$s_cmp$s_memN$s_memAB"); } } } } } &check_for_LDOM; } if ($ultra eq "S7-2" || $ultra eq "S7-2L") { # SPARC S7-2 has 1 or 2 SPARC S7 processors at 4.267GHz # SPARC S7-2L has 2 SPARC S7 processors at 4.267GHz # Each SPARC S7 processor supports: # 8 cores, 8 threads. # 16 DIMM slots for up to 1TB memory (16 x 64GB). # supports 16GB, 32GB & 64GB DDR4 DIMMs. # Do not mix DIMMs sizes. # Can be half populated (D0 white sockets), 4 DIMMs per CPU, or # fully populated (D0 white & D1 black sockets), 8 DIMMs per CPU. $memtype="DDR4 DIMM"; $showrange=0; @simmsizes=(16384,32768,65536); $untested=1; $untested=0 if ($ultra eq "S7-2"); $cmp_range=0; $cmp_range=1 if ($ncpu eq 2 || $corecnt eq 2); # /SYS/MB/CMP0/MCU0/CH0/D0 - /SYS/MB/CMP1/MCU1/CH1/D1 for $s_d (0,1) { for ($s_cmp=0; $s_cmp <= $cmp_range; $s_cmp++) { for $s_mcu (0,1) { for $s_ch (0,1) { push(@socketstr, "/SYS/MB/CMP$s_cmp/MCU$s_mcu/CH$s_ch/D$s_d"); } } } } &check_for_LDOM; } if ($ultra eq "T7-1") { # SPARC T7-1 has 1 SPARC M7 processors at 4.13GHz # SPARC M7 processor supports: # 32 cores, 8 threads # 16 DIMM slots for up to 1TB memory (16 x 64GB) # SPARC T7-1 supports: # 16GB, 32GB & 64GB DDR4 DIMMs # Left Memory Riser: /SYS/MB/CM/CMP/MR1/BOB[01]0/CH[01] # Left Motherboard: /SYS/MB/CM/CMP/BOB[13]1/CH[01] # Right Motherboard: /SYS/MB/CM/CMP/BOB[02]1/CH[01] # Right Memory Riser: /SYS/MB/CM/CMP/MR0/BOB[23]0/CH[01] # CH0 Black sockets, CH1 White sockets # In base configuration, all DIMM slots on motherboard must be # fully occupied (8 DIMMs). # In upgrade configuration (16 DIMMs), both memory risers are # added and must be fully occupied. $memtype="DDR4 DIMM"; $showrange=0; @simmsizes=(16384,32768,65536); $untested=1; for $s_bob (0..3) { # Motherboard for $s_ch (0,1) { push(@socketstr, "/SYS/MB/CM/CMP/BOB${s_bob}1/CH$s_ch"); } } for $s_bob (0,1) { # MR1 for $s_ch (0,1) { push(@socketstr, "/SYS/MB/CM/CMP/MR1/BOB${s_bob}0/CH$s_ch"); } } for $s_bob (2,3) { # MR0 for $s_ch (0,1) { push(@socketstr, "/SYS/MB/CM/CMP/MR0/BOB${s_bob}0/CH$s_ch"); } } &check_for_LDOM; } if ($ultra eq "T7-2") { # SPARC T7-2 has 2 SPARC M7 processors at 4.13GHz # SPARC M7 processor supports: # 32 cores, 8 threads # 16 DIMM slots for up to 1TB memory (16 x 64GB) # SPARC T7-2 supports: # 16GB, 32GB & 64GB DDR4 DIMMs # /SYS/MB/CM[01]/CMP/MR[0-3]/BOB[01]/CH[01]/DIMM # CH0 Black sockets, CH1 White sockets # All 8 memory risers must be installed in all configurations # Half-populated configurations populate CH0 Black sockets (16 DIMMs) # Full-populated configurations fill CH0 and CH1 sockets (32 DIMMs) $memtype="DDR4 DIMM"; $showrange=0; @simmsizes=(16384,32768,65536); $untested=1; for $s_ch (0,1) { for $s_cm (0,1) { for $s_mr (0..3) { for $s_bob (0,1) { push(@socketstr, "/SYS/MB/CM$s_cm/CMP/MR$s_mr/BOB$s_bob/CH$s_ch/DIMM"); } } } } &check_for_LDOM; } if ($ultra eq "T7-4") { # SPARC T7-4 has 2 or 4 SPARC M7 processors at 4.13GHz # SPARC M7 processor supports: # 32 cores, 8 threads # 16 DIMM slots for up to 1TB memory (16 x 64GB) # SPARC T7-4 supports: # 16GB, 32GB & 64GB DDR4 DIMMs # /SYS/PM[0-3]/CM[01]/CMP/BOB[0-3][01]/CH[01]/DIMM # CH0 Black sockets, CH1 White sockets # Half-populated configurations populate CH0 Black sockets (16 DIMMs) # Full-populated configurations fill CH0 and CH1 sockets (32 DIMMs) $memtype="DDR4 DIMM"; $showrange=0; @simmsizes=(16384,32768,65536); $untested=0; for $s_pm (0..$npcpu-1) { for $s_ch (0,1) { for $s_cm (0,1) { for $s_boba (0..3) { for $s_bobb (0,1) { push(@socketstr, "/SYS/PM$s_pm/CM$s_cm/CMP/BOB$s_boba$s_bobb/CH$s_ch/DIMM"); } } } } } &check_for_LDOM; } if ($ultra eq "M7-8" || $ultra eq "M7-16") { # SPARC M7-8 has 2 to 8 SPARC M7 processors at 4.13GHz # SPARC M7-16 has 4 to 16 SPARC M7 processors at 4.13GHz # Each SPARC M7 processor has 32 cores, 8 threads # SPARC M7-8 & M7-16 supports: # 16 DIMM slots for up to 512GB memory (16 x 32GB) # supports 16GB & 32GB DDR4 DIMMs # SPARC M7-8, has CMIOU_0 to CMIOU_7 # SPARC M7-16, has CMIOU_0 to CMIOU_15 # /SYS/CMIOU[0-15]/CM/CMP/BOB[0-3][01]/CH[01]/DIMM # CH0 Black sockets, CH1 White sockets # Half-populated configurations populate CH0 Black sockets (8 DIMMs) # Full-populated configurations fill CH0 and CH1 sockets (16 DIMMs) $memtype="DDR4 DIMM"; $showrange=0; @simmsizes=(16384,32768); $untested=1; for $s_cmiou (0..$npcpu-1) { for $s_ch (0,1) { for $s_boba (0..3) { for $s_bobb (0,1) { push(@socketstr, "/SYS/CM$s_cmiou/CM/CMP/BOB$s_boba$s_bobb/CH$s_ch/DIMM"); } } } } &check_for_LDOM; } if ($model eq "SPARC-Enterprise" || $ultra =~ /SPARC Enterprise M[34589]000 Server/) { # CPUs: Dual-Core Dual-Thread SPARC64-VI or # Quad-Core Dual-Thread SPARC64-VII, VII+, VII++ # M3000: 2RU rack, single SPARC64-VII 2.52GHz cpu # up to 32GB, uses DDR2-533 4GB or 8GB memory DIMMs # M4000: 6RU rack, up to 4 SPARC64-VI or SPARC64-VII cpus # Up to 2 CPU (CMU), 2 CPUs per board # Main memory Up to 128 GB per domain / system, up to 4 memory # boards w/ maximum 32GB per board using 8 DDR2 4GB memory DIMMs # M5000: 10RU rack, up to 8 SPARC64-VI or SPARC64-VII cpus # Up to 4 CPU (CMU), 2 CPUs per board # Main memory Up to 256 GB per domain / system, up to 8 memory # boards w/ maximum 32GB per board using 8 DDR2 4GB memory DIMMs # M8000: up to 16 SPARC64-VI or SPARC64-VII cpus # Up to 4 CPU memory boards (CMU), Up to 4 processors and up to # 128 GB memory per board based on 32 4GB DIMMs # Main memory Up to 512GB per domain / system # M9000: 32 or 64 SPARC64-VI or SPARC64-VII cpus # 32 CPU # Up to 8 CPU memory boards (CMU), Up to 4 processors and up to # 128 GB memory per board based on 32 4GB DIMMs # Main memory Up to 1TB per domain / system # 64 CPU # Up to 16 CPU memory boards (CMU), Up to 4 processors and up to # 128 GB memory per board based on 32 4GB DIMMs # Main memory Up to 2TB per domain / system $familypn="SEW" if ($ultra =~ /Sun SPARC Enterprise M3000 Server/); if ($ultra =~ /Sun SPARC Enterprise M4000 Server/) { $devname="OPL FF1"; $familypn="SEE"; } if ($ultra =~ /Sun SPARC Enterprise M5000 Server/) { $devname="OPL FF2"; $familypn="SEF"; } $familypn="SEG" if ($ultra =~ /Sun SPARC Enterprise M8000 Server/); $familypn="SEH/SEJ" if ($ultra =~ /Sun SPARC Enterprise M9000 Server/); $untested=1; $untested=0 if ($ultra =~ /SPARC Enterprise M[34589]000 Server/); $prtdiag_has_mem=1; @simmsizes=(1024,2048,4096); } if (($model =~ /-Enterprise/ || $ultra eq "e") && $model !~ /SPARC-Enterprise/) { # E3x00/E4x00/E5x00/E6x00 accepts 8MB, 32MB, 128MB or 256MB DIMMs on # motherboard, 2 banks of 8 DIMMs per board. # 256MB DIMMs (2GB kit X7026A) can be used with OBP 3.2.24 or later and # Solaris 2.5.1 11/97, Solaris 2.6 3/98 or later # 501-2652 (8MB), 501-2653 (32MB), 501-2654 (128MB), 501-5658 (256MB) # 168-pin 60ns 3.3V ECC # E10000 accepts 32MB or 128MB DIMMs on motherboard, # using 2 or 4 banks of 8 DIMMs per board. # 501-2653 (32MB), 501-2654 (128MB) # 168-pin 60ns 3.3V ECC $devname="Duraflame" if ($banner =~ /\bE?3[05]00\b/); $devname="Campfire Rack" if ($banner =~ /\bE?5[05]00\b/); $devname="Campfire" if ($banner =~ /\bE?4[05]00\b/); $devname="Sunfire" if ($banner =~ /\bE?6[05]00\b/); $devname .= "+" if ($banner =~ /\bE?[3-6]500\b/); $devname="Starfire" if ($model =~ /-10000\b/); $familypn="E3000, A17" if ($banner =~ /\bE?3000\b/); $familypn="E3500" if ($banner =~ /\bE?3500\b/); $familypn="E4000, A18" if ($banner =~ /\bE?4000\b/); $familypn="E4500" if ($banner =~ /\bE?4500\b/); $familypn="E5000" if ($banner =~ /\bE?5000\b/); $familypn="E5500" if ($banner =~ /\bE?5500\b/); $familypn="E6000" if ($banner =~ /\bE?6000\b/); $familypn="E6500" if ($banner =~ /\bE?6500\b/); $familypn="E10000" if ($model =~ /-10000\b/); $untested=1; if ($banner =~ /\bE?[3-6][05]00\b/ || $model =~ /-Enterprise-E?[3-6][05]00/ || $model eq "Ultra-Enterprise") { $untested=0; @simmsizes=(8,32,128,256); } if ($model =~ /-Enterprise-10000\b/) { $untested=0; @simmsizes=(32,128); } $prtdiag_has_mem=1; @prtdiag=&run("$prtdiag_exec") if (! $filename); $i=0; $flag_cpu=0; $flag_mem=0; foreach $line (@prtdiag) { $line=&dos2unix($line); if ($line =~ /Memory Units:/) { # Start of memory section, Solaris 2.5.1 format $flag_mem=1; $format_mem=1; $flag_cpu=0; # End of CPU section } if ($line =~ /====( | Physical )Memory /) { # Start of memory section, Solaris 2.6 and later format $flag_mem=1; $format_mem=2; $flag_cpu=0; # End of CPU section } if ($line =~ /Factor/) { # No interleave factor on E10000 $format_mem += 2 if ($format_mem == 1 || $format_mem == 2); } if ($line =~ /Failed Field Replaceable Unit/) { $tmp=$line; $tmp=~s/^\t/ /g; $failed_fru .= $tmp; } if ($line =~ /IO Cards/) { $flag_cpu=0; # End of CPU section $flag_mem=0; # End of memory section } if ($flag_cpu && $line !~ /^\s*\n$/) { push(@boards_cpu, "$line"); $boardfound_cpu=1; $boardslot_cpu=($line =~ /Board/) ? substr($line,6,2) : substr($line,0,2); $boardslot_cpu=~s/[: ]//g; if ($flag_cpu == 2 && $boardslot_cpus !~ /\s$boardslot_cpu\s/ && $boardslot_cpu) { push(@boardslot_cpus, "$boardslot_cpu"); $boardslot_cpus .= $boardslot_cpu . " "; } } if ($line =~ /CPU Units:/) { $flag_cpu=1; # Start of CPU section $flag_mem=0; # End of memory section $format_cpu=1; } if ($line =~ /====( | Virtual )CPUs ====/) { $flag_cpu=1; # Start of CPU section $flag_mem=0; # End of memory section $format_cpu=2; } if ($flag_mem == 2 && $line !~ /^\s*\n$/) { $memfrom="prtdiag"; $boardslot_mem=($line =~ /Board/) ? substr($line,5,2) : substr($line,0,2); $boardslot_mem=~s/[: ]//g; if ($boardslot_mems !~ /\s$boardslot_mem\s/) { push(@boardslot_mems, "$boardslot_mem"); $boardslot_mems .= $boardslot_mem . " "; } if ($format_mem == 1) { # Memory on each system board, E10000 $mem0=substr($line,12,4); $mem0=0 if ($mem0 !~ /\d+/); $dimm0=$mem0 / 8; if ($dimm0) { $dimms0=sprintf("8x%3d", $dimm0); push(@simmsizesfound, "$dimm0"); } else { $dimms0=" "; &found_empty_bank("Bank 0"); } $mem1=substr($line,20,4); $mem1=0 if ($mem1 !~ /\d+/); $dimm1=$mem1 / 8; if ($dimm1) { $dimms1=sprintf("8x%3d", $dimm1); push(@simmsizesfound, "$dimm1"); } else { $dimms1=" "; &found_empty_bank("Bank 1"); } $mem2=substr($line,28,4); $mem2=0 if ($mem2 !~ /\d+/); $dimm2=$mem2 / 8; if ($dimm2) { $dimms2=sprintf("8x%3d", $dimm2); push(@simmsizesfound, "$dimm2"); } else { $dimms2=" "; &found_empty_bank("Bank 2"); } $mem3=substr($line,36,4); $mem3=0 if ($mem3 !~ /\d+/); $dimm3=$mem3 / 8; if ($dimm3) { $dimms3=sprintf("8x%3d", $dimm3); push(@simmsizesfound, "$dimm3"); } else { $dimms3=" "; &found_empty_bank("Bank 3"); } $newline=substr($line,0,10); $newline .= " " . $mem0 . " " . $dimms0; $newline .= " " . $mem1 . " " . $dimms1; $newline .= " " . $mem2 . " " . $dimms2; $newline .= " " . $mem3 . " " . $dimms3; $newline .= "\n"; push(@boards_mem, "$newline"); $boardfound_mem=1; } if ($format_mem == 2) { # Memory on each system board, E10000 # untested ??? reporting of empty banks $untested=1; $bank_slot=substr($line,6,2); $mem=substr($line,12,4); $mem=0 if ($mem !~ /\d+/); $dimm=$mem / 8; if ($dimm) { $dimms=sprintf("8x3d", $dimm); push(@simmsizesfound, "$dimm"); $newline=substr($line,0,18) . $dimms; $newline .= substr($line,16,47); push(@boards_mem, "$newline"); $boardfound_mem=1; $failed_memory += $mem if ($newline =~ /\b\bFailed\b\b/); $spare_memory += $mem if ($newline =~ /\b\bSpare\b\b/); } else { $flag_mem=0; &found_empty_bank("Bank $bank_slot"); } if ($bank_slot == 0) { $next_boardslot_mem=substr($prtdiag[$i + 1],0,2); $next_boardslot_mem=~s/[: ]//g; &found_empty_bank("Bank 1") if ($next_boardslot_mem ne $boardslot_mem); } if ($bank_slot == 1) { $prev_boardslot_mem=substr($prtdiag[$i - 1],0,2); $prev_boardslot_mem=~s/[: ]//g; &found_empty_bank("Bank 0") if ($prev_boardslot_mem ne $boardslot_mem); } } if ($format_mem == 3) { # Memory on each system board, E[3456]x00 $mem0=substr($line,10,4); $mem0=0 if ($mem0 !~ /\d+/); $dimm0=$mem0 / 8; if ($dimm0) { $dimms0=sprintf("8x%3d", $dimm0); push(@simmsizesfound, "$dimm0"); } else { $dimms0=" "; &found_empty_bank("Bank 0"); } $memlength=length($line); $mem1=($memlength > 34) ? substr($line,34,4) : 0; $mem1=0 if ($mem1 !~ /\d+/); $dimm1=$mem1 / 8; if ($dimm1) { $dimms1=sprintf("8x%3d", $dimm1); push(@simmsizesfound, "$dimm1"); } else { $dimms1=" "; &found_empty_bank("Bank 1"); } $newline=substr($line,0,16) . $dimms0; $newline .= substr($line,16,24); if ($dimm1) { $newline .= $dimms1; $newline .= substr($line,39,16); } push(@boards_mem, "$newline"); $boardfound_mem=1; } if ($format_mem == 4) { # Memory on each system board, E[3456]x00 $bank_slot=substr($line,7,1); $mem=substr($line,12,4); $mem=0 if ($mem !~ /\d+/); $dimm=$mem / 8; if ($dimm) { $dimms=sprintf("8x%3d", $dimm); push(@simmsizesfound, "$dimm"); $newline=substr($line,0,18) . $dimms; $newline .= substr($line,16,47); push(@boards_mem, "$newline"); $boardfound_mem=1; $failed_memory += $mem if ($newline =~ /\b\bFailed\b\b/); $spare_memory += $mem if ($newline =~ /\b\bSpare\b\b/); } else { $flag_mem=0; &found_empty_bank("Bank $bank_slot"); } if ($bank_slot == 0) { $next_boardslot_mem=substr($prtdiag[$i + 1],0,2); $next_boardslot_mem=~s/[: ]//g; &found_empty_bank("Bank 1") if ($next_boardslot_mem ne $boardslot_mem); } if ($bank_slot == 1) { $prev_boardslot_mem=substr($prtdiag[$i - 1],0,2); $prev_boardslot_mem=~s/[: ]//g; &found_empty_bank("Bank 0") if ($prev_boardslot_mem ne $boardslot_mem); } } } if ($flag_cpu == 1 && $line =~ /-----/) { # Next lines are the CPUs on each system board $flag_cpu=2; } if ($flag_mem == 1 && $line =~ /-----/) { # Next lines are the memory on each system board $flag_mem=2; } $i++; } &show_header; if ($boardfound_mem) { if ($boardfound_cpu) { foreach $board (@boardslot_cpus) { if ($boardslot_mems !~ /\s$board\s/) { $boardslot_mem=$board; if ($format_mem <= 2) { # E10000 &found_empty_bank("Bank 0"); &found_empty_bank("Bank 1"); &found_empty_bank("Bank 2"); &found_empty_bank("Bank 3"); } else { # E3x00/E4x00/E5x00/E6x00 &found_empty_bank("Bank 0"); &found_empty_bank("Bank 1"); } } } } if ($format_mem == 1) { # E10000 running Solaris 2.5.1 print " Bank 0 Bank 1 Bank 2 Bank 3\n"; print " MB DIMMs MB DIMMs MB DIMMs MB DIMMs\n"; print " ---- ----- ---- ----- ---- ----- ---- -----\n"; print @boards_mem; } if ($format_mem == 2) { # E10000 running Solaris 2.6 or later print "Brd Bank MB DIMMs Status Condition Speed\n"; print "--- ----- ---- ----- ------- ---------- -----\n"; print @boards_mem; } if ($format_mem == 3) { # E3x00/E4x00/E5x00/E6x00 running Solaris 2.5.1 print " Bank 0 Bank 1\n"; print " J3100-J3800 Interleave J3101-J3801 Interleave\n"; print " MB DIMMs Factor With MB DIMMs Factor With\n"; print " ---- ----- ------ ---- ---- ----- ------ ----\n"; print @boards_mem; } if ($format_mem == 4) { # E3x00/E4x00/E5x00/E6x00 running Solaris 2.6 or later print " Intrlv. Intrlv.\n"; print "Brd Bank MB DIMMs Status Condition Speed Factor With\n"; print "--- ----- ---- ----- ------- ---------- ----- ------- -------\n"; print @boards_mem; print "Bank 0 uses sockets J3100-J3800, Bank 1 uses sockets J3101-J3801\n"; } $empty_banks=" None" if (! $empty_banks); print "empty memory banks:$empty_banks\n"; } $totmem=$installed_memory; &finish; &pdebug("exit"); exit; } # # Check to see if this system has memory defined in the prtdiag output # &check_prtdiag; $model=$diagbanner if ($diagbanner && $isX86); $untested=0 if ($boardfound_mem && $isX86 && ! $have_x86_devname); &x86_devname; # Don't use prtdiag data on this clone $boardfound_mem=0 if ($manufacturer eq "AXUS"); # # Check to see if this system has module information in prtconf output # (Seen on Fujitsu GP7000, GP7000F, PrimePower) # if ($gotmodule || $gotmodulenames) { @simmslots=($gotmodulenames) ? split(/\./, $gotmodulenames) : split(/\./, $gotmodule); $totmem=0; for ($val=0; $val < scalar(@simmslots); $val += 2) { $socket=($gotmodulenames) ? $simmslots[$val] : "SLOT" . $val / 2; $simmsz=$simmslots[$val + 1]; $simmsize=hex("0x$simmsz") / $meg; $perlhexbug=1 if ($simmsize <= 0 && $simmsz ne "00000000"); $totmem += $simmsize; if ($simmsize) { push(@simmsizesfound, "$simmsize"); if (! $boardfound_mem) { push(@memorylines, "$socket has a ${simmsize}MB"); if ($simmsize > 1023) { push(@memorylines, " ("); push(@memorylines, $simmsize/1024); push(@memorylines, "GB)"); } push(@memorylines, " $memtype\n"); } $sockets_used .= " $socket"; } } &show_header; &pdebug("displaying memory from $memfrom") if ($memfrom); print (($boardfound_mem) ? @boards_mem : @memorylines); $totmem=$installed_memory; &finish; &pdebug("exit"); exit; } # # Check to see if this system has module information in ipmitool output # if ($have_ipmitool_data) { &check_ipmitool; $tmp=scalar(keys %ipmi_mem); if (defined($tmp)) { if ($tmp) { &pdebug("Memory found with ipmitool"); &show_header; for (sort alphanumerically keys %ipmi_mem) { if ($ipmi_mem{$_}) { print "socket $_: $ipmi_mem{$_}\n"; $simmsize=$ipmi_mem{$_}; $simmsize=~s/^.*\b(\d+)M[Bb].*/$1/; $ipmi_memory += $simmsize if ($simmsize); } else { &add_to_sockets_empty($_); } } $totmem=$installed_memory; &print_empty_memory("memory sockets"); &finish; &pdebug("exit"); exit; } } } # # Check to see if this system has cpu information in kstat output to recognize # Hyper-Threaded Intel CPUs # &check_kstat if ($have_kstat_data); # # Check to see if this system has module information in smbios output # &check_smbios if ($have_smbios_data); # # Check to see if this system has module information in prtfru output # &check_prtfru; # # Display memory if found in prtdiag and/or prtfru output # if ($boardfound_mem) { &show_header; &pdebug("displaying memory from $memfrom") if ($memfrom); &pdebug("displaying memory from prtfru") if ($fru_details && $memfrom ne "prtfru"); # Rewrite prtdiag output to exclude DIMM5-DIMM8 on W1100z if ($model =~ /W1100z\b/i && $model !~ /2100z\b/i) { @new_boards_mem=""; foreach $line (@boards_mem) { push(@new_boards_mem, "$line") if ($line !~ /DIMM[5-8]/); } @boards_mem=@new_boards_mem; } print @boards_mem if (! &is_virtualmachine); if ($have_prtfru_details) { print "FRU Memory Data:\n-----------------------------------------------------------------------\n$fru_details"; if ($missing_prtfru_details ne " ") { print "NOTICE: Not all memory modules reported detailed FRU data\n"; } print "-----------------------------------------------------------------------\n"; } $totmem=$installed_memory; } # # Look for empty memory banks on Sun Fire 3800, 4800, 4810, 6800, 12K, 15K and # Netra T12 systems. Also Sun Fire E2900, E4900, E6900, E20K and E25K. # if ($ultra eq "Sun Fire" || $ultra eq "Sun Fire 15K" || $ultra eq "Sun Fire 12K" || $ultra eq "Netra T12" || $ultra =~ /Sun Fire ([346]8[01]0|E[246]900|E2[05]K)\b/) { foreach $cpu (@boardslot_cpus) { $empty_banks .= " $cpu/B0" if ($boardslot_mems !~ /$cpu\/B0/); $empty_banks .= " $cpu/B1" if ($boardslot_mems !~ /$cpu\/B1/); } $empty_banks=" None" if (! $empty_banks); if ($boardslot_mems eq " ") { $empty_banks=" Unknown"; $exitstatus=1; } print "empty memory banks:$empty_banks\n" if ($boardfound_mem); } if ($boardfound_mem) { &finish; &pdebug("exit"); exit; } # # OK, get ready to print out results # for ($val=$val0; $val < scalar(@slots); $val += $valinc) { $newaddrmsb=substr($slots[$val - $valaddr - 1],3,5); $newaddrlsb=substr($slots[$val - $valaddr],0,3); $newsizemsb=($valinc == 4) ? substr($slots[$val - 1],3,5) : ""; $newsizelsb=substr($slots[$val],0,3); # Round up for DIMM value seen on US-T1 and US-T2 Niagara systems # Two Ranks of DIMMs appear as one in prtconf if ($newsizelsb eq "ff8") { if ($newsizemsb eq "00000") { $newsizemsb="00001"; # 512MB if ($ultra eq "T2000") { # Hack: 1 rank of smallest DIMMs $simmbanks=2; $simmsperbank=8; } # Hack: Could be 1 Rank of 1GB on T1000 $recognized=-1 if ($ultra eq "T1000" && scalar(@slots) == 4); } elsif ($newsizemsb eq "00001") { $newsizemsb="00002"; # 1GB # Hack: Could be 1 Rank of 1GB on T2000 $recognized=-1 if ($ultra eq "T2000" && scalar(@slots) == 4); # Hack: Could be 1 Rank of 2GB on T1000 $recognized=-1 if ($ultra eq "T1000" && scalar(@slots) == 4); } elsif ($newsizemsb eq "00003") { $newsizemsb="00004"; # 2GB # Hack: Could be 1 Rank of 2GB on T2000 $recognized=-1 if ($ultra eq "T2000" && scalar(@slots) == 4); } elsif ($newsizemsb eq "00007") { $newsizemsb="00008"; # Fully stuffed 2 Ranks of 2GB } $newsizelsb="000"; $installed_memory += 8; } elsif ($newsizelsb eq "7f8" && $newsizemsb eq "00000") { if ($ultra eq "T1000") { # Hack: 1 rank of smallest DIMMs $newsizelsb="800"; # 512MB $simmbanks=2; $simmsperbank=4; } else { $newsizelsb="800"; # Hack: unsupported 256MB DIMM } $installed_memory += 8; } elsif ($newsizelsb eq "f80") { if ($newsizemsb eq "00001") { $newsizemsb="00002"; # 1GB } elsif ($newsizemsb eq "00003") { $newsizemsb="00004"; # 2GB } elsif ($newsizemsb eq "00007") { $newsizemsb="00008"; # 4GB } elsif ($newsizemsb eq "0000f") { $newsizemsb="00010"; # 8GB } $newsizelsb="000"; $installed_memory += 128; } if ($sortslots) { $mods{"$newaddrmsb$newaddrlsb"}="$newsizemsb$newsizelsb"; } else { push(@newslots, "$newaddrmsb$newaddrlsb"); push(@newslots, "$newsizemsb$newsizelsb"); } } if ($sortslots) { for (sort alphanumerically keys %mods) { push(@newslots, $_); push(@newslots, $mods{$_}); } } # For Ultra-30, determine if interleaving of banks using four DIMMs if ($model eq "Ultra-30" || $ultra eq 30) { $interleave=2; # pairs show up in odd numbered address ranges for ($val=0; $val < scalar(@newslots); $val += 2) { $interleave=1 if ($newslots[$val] =~ /00000[1357]00/); } if ($interleave eq 2) { $simmrangex="00000200"; $simmbanks=4; $simmsperbank=4; } else { $simmrangex="00000100"; $simmbanks=8; $simmsperbank=2; } } # Check if SPARCsystem-600 has VME memory expansion boards if ($model eq "SPARCsystem-600" || $model =~ /Sun.4.600/) { for ($val=0; $val < scalar(@newslots); $val += 2) { if ($newslots[$val] =~ /00000[4-9ab]00/) { @simmsizes=(1,4,16); push(@socketstr, @socketstr_exp); push(@bankstr, @bankstr_exp); push(@bytestr, @bytestr_exp); $exp=($newslots[$val] =~ /00000[4-7]00/) ? "Expansion board 0 bank" : "Expansion board 1 bank"; push(@banksstr, ("$exp B0","$exp B1", "$exp B2","$exp B3")); } } } # Hack: Rewrite interleaved memory line for Ultra-80 or Enterprise 420R if (($model eq "Ultra-80" || $ultra eq 80 || $ultra eq "420R" || $ultra eq "Netra t140x") && $newslots[0] eq "00000000") { if ($newslots[1] eq "00001000" && $installed_memory eq 4096) { # 4GB of memory (maximum) using 16x256MB in Banks 0-3 $newslots[1]="00000400"; $newslots[2]="00000400"; $newslots[3]="00000400"; $newslots[4]="00000800"; $newslots[5]="00000400"; $newslots[6]="00000c00"; $newslots[7]="00000400"; $interleave=4; } elsif ($newslots[1] eq "00000800" && $installed_memory eq 2048) { # 2GB of memory using 8x256MB in Banks 0,1 $newslots[1]="00000400"; $newslots[2]="00000400"; $newslots[3]="00000400"; $interleave=2; } elsif ($newslots[1] =~ /00000[97653]00/) { # Early OBP releases showed total memory as a single bank $recognized=-1; } elsif ($newslots[1] eq "00000400" && $installed_memory eq 1024) { # 1GB of memory can be 4x256MB in Bank 0 or 16x64MB in Banks 0-3 # so flag OBP bug $recognized=-1; } elsif ($newslots[1] eq "00000200" && $installed_memory eq 512) { # 512MB of memory using 8x64MB in Banks 0,1 $newslots[1]="00000100"; $newslots[2]="00000400"; $newslots[3]="00000100"; $interleave=2; } } # Hack: Fix address ranges for Tatung COMPstation U60 and U80D if ($banner =~ /COMPstation_U(60|80D)_Series/) { # Tatung Science and Technology, http://www.tsti.com for ($val=0; $val < scalar(@newslots); $val += 2) { $simmbanks=4 if ($newslots[$val] =~ /00000[46]00/); # Check for 256MB DIMMs or 256MB address range per bank if ($newslots[$val + 1] =~ /00000400/ || $newslots[$val] =~ /00000c00/) { $simmrangex="00000400"; $simmbanks=4; } } if ($simmbanks eq 6) { # Skipped address range similar to Sun Ultra 60 @socketstr=("J17","J32","J36","J40","J18","J33","J37","J41","?","?","?","?","?","?","?","?","J19","J34","J38","J42","J20","J35","J39","J43"); @slotstr=(1..8,"?","?","?","?","?","?","?","?",9..16); @bankstr=(0,0,0,0,1,1,1,1,"?","?","?","?","?","?","?","?",2,2,2,2,3,3,3,3); } else { @socketstr=("J17","J32","J36","J40","J18","J33","J37","J41","J19","J34","J38","J42","J20","J35","J39","J43"); @slotstr=(1..16); @bankstr=(0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3); } } # Hack: Try to rewrite memory line for Sun Blade 1000 & 2000 if prtdiag output # did not show the memory. This does not expect 2GB DIMMs to be used. if (($ultra eq "Sun Blade 1000" || $ultra eq "Sun Blade 2000" || $ultra eq "Sun Fire 280R") && ! $boardfound_mem) { # Assume 8GB is 8x1GB instead of 4x2GB if ($newslots[1] eq "00002000") { $newslots[1]="00001000"; $newslots[2]="00001000"; $newslots[3]="00001000"; $recognized=-2; } # Assume 6GB is 4x1GB + 4x512MB instead of 4x1.5GB if ($newslots[1] eq "00001800") { $newslots[1]="00001000"; $newslots[2]="00001000"; $newslots[3]="00000800"; $recognized=-1; } # Assume 5GB is 4x1GB + 4x256MB instead of 4x1280MB if ($newslots[1] eq "00001400") { $newslots[1]="00001000"; $newslots[2]="00001000"; $newslots[3]="00000400"; $recognized=-1; } # Assume 4.5GB is 4x1GB + 4x128MB instead of 4x1152MB if ($newslots[1] eq "00001200") { $newslots[1]="00001000"; $newslots[2]="00001000"; $newslots[3]="00000200"; $recognized=-1; } # Assume 3GB is 4x512MB + 4x256MB instead of 4x768MB if ($newslots[1] eq "00000c00") { $newslots[1]="00000800"; $newslots[2]="00001000"; $newslots[3]="00000400"; $recognized=-1; } # Assume 2.5GB is 4x512MB + 4x128MB instead of 4x640MB if ($newslots[1] eq "00000a00") { $newslots[1]="00000800"; $newslots[2]="00001000"; $newslots[3]="00000200"; $recognized=-1; } # Assume 1.5GB is 4x256MB + 4x128MB instead of 4x384MB if ($newslots[1] eq "00000600") { $newslots[1]="00000400"; $newslots[2]="00001000"; $newslots[3]="00000200"; $recognized=-1; } } # for prtconf output only, or fully stuffed LDOM servers if ($ultra eq "T5120" || $ultra eq "T5220" || $ultra eq "T6320" || $ultra eq "T5140") { # Hack: Rewrite fully stuffed memory line if ($installed_memory >= 130816) { $newslots[0]="00000000"; $newslots[1]="00008000"; $newslots[2]="00008000"; $newslots[3]="00008000"; $newslots[4]="00010000"; $newslots[5]="00008000"; $newslots[6]="00018000"; $newslots[7]="00008000"; } } if ($ultra eq "T5240" || $ultra eq "T6340") { # Hack: Rewrite fully stuffed memory line if ($installed_memory >= 261632) { $newslots[0]="00000000"; $newslots[1]="00008000"; $newslots[2]="00008000"; $newslots[3]="00008000"; $newslots[4]="00010000"; $newslots[5]="00008000"; $newslots[6]="00018000"; $newslots[7]="00008000"; $newslots[8]="00020000"; $newslots[9]="00008000"; $newslots[10]="00028000"; $newslots[11]="00008000"; $newslots[12]="00030000"; $newslots[13]="00008000"; $newslots[14]="00038000"; $newslots[15]="00008000"; } } # Check for dual bank DIMMs on Ultra AXmp+ if ($ultra eq "AXmp+") { if ($#newslots eq 1 && $newslots[0] eq "00000c00") { $simmsperbank=4; $dualbank=1; } if ($#newslots eq 3) { if ($newslots[2] =~ /00000[8c]00/) { $simmrangex="00000800"; $dualbank=1 if ($newslots[1] eq $newslots[3]); } } if ($#newslots ge 5) { $dualbank=1 if ($newslots[4] =~ /00000[8c]00/); } if ($dualbank eq 1) { @bankstr=("0,2","0,2","0,2","0,2","0,2","0,2","0,2","0,2","1,3","1,3","1,3","1,3","1,3","1,3","1,3","1,3"); # Rearrange slots if necessary if ($#newslots ge 5) { if ($newslots[4] eq "00000800") { $tmp=$newslots[2]; $newslots[2]=$newslots[4]; $newslots[4]=$tmp; $tmp=$newslots[3]; $newslots[3]=$newslots[5]; $newslots[5]=$tmp; } } } } $totmem=0; for ($val=0; $val < scalar(@newslots); $val += 2) { &pdebug("displaying memory from $memfrom") if ($memfrom); $simmaddr=$newslots[$val]; $simmsz=$newslots[$val + 1]; $simmsize=hex("0x$simmsz"); $simmsize=&roundup_memory($simmsize) if ($simmsize > 16384); $perlhexbug=1 if ($simmsize <= 0 && $simmsz ne "00000000"); $totmem += $simmsize; if (($model eq "Sun 4/75" || $model eq "SS-2") && ($simmbanks < $bankcnt + 2)) { # SS2 SBus memory card $buffer=($simmaddr eq "00000080") ? "${buffer}SBus primary" : "${buffer}SBus secondary"; $start1=hex("0x$simmaddr") * $meg; $perlhexbug=1 if ($start1 < 0); $simmrange=hex("0x$simmrangex") * $meg; $perlhexbug=1 if ($simmrange <= 0 && $simmrangex ne "00000000"); $start1x=sprintf("%08lx", $start1); $stop1x=sprintf("%08lx", $start1 + (2 * $simmrange) - 1); $totmem += $simmsize; $simmsize *= 2; $val += 2; $buffer .= " contains ${simmsize}MB"; $buffer .= " (address 0x${start1x}-0x$stop1x)" if ($verbose); $buffer .= "\n"; } elsif ($simmbanks) { $start1=hex("0x$simmaddr") * $meg; $perlhexbug=1 if ($start1 < 0); if ($simmrangex ne "0") { $simmrange=hex("0x$simmrangex") * $meg; $perlhexbug=1 if ($simmrange <= 0 && $simmrangex ne "00000000"); if ($simmrange < hex("0x00001000") * $meg) { $start1x=sprintf("%08lx", $start1); $stop1x=sprintf("%08lx", $start1 + ($simmsize * $meg) - 1); } else { # Systems with > 4GB of memory $start1x=$simmaddr . "00000"; $start1x=~s/^0000//; $stop1x=sprintf("%08lx", ($start1 / $meg) + $simmsize - 1) . "fffff"; $stop1x=~s/^0000//; } } $cnt=0; while ($cnt < $simmbanks * $simmsperbank) { if ($start1 >= $simmrange * $cnt && $start1 < $simmrange * ($cnt + 1)) { $bankcnt=$cnt; $cnt3=$bankcnt * $simmsperbank; if ($#socketstr) { $socket=$socketstr[$cnt3]; if ($#socketlabelstr) { $socketlabel=" ($socketlabelstr[$cnt3])" if (defined($socketlabelstr[$cnt3])); } if ($found10bit && $newslots[$val] !~ /00000[0-3]00/) { $socket=$socketstr[$cnt3 + 4]; if ($#socketlabelstr) { $socketlabel=" ($socketlabelstr[$cnt3 + 4])" if (defined($socketlabelstr[$cnt3 + 4])); } } } $order=$orderstr[$cnt3] if ($#orderstr); $group=$groupstr[$cnt3] if ($#groupstr); $slotnum=$slotstr[$cnt3] if ($#slotstr); if ($#bankstr) { $bank=$bankstr[$cnt3]; $bank=$bankstr[$cnt3 + 4] if ($found10bit && $newslots[$val] !~ /00000[0-3]00/); } $banks=$banksstr[$cnt3/$simmsperbank] if ($#banksstr); $byte=$bytestr[$cnt3] if ($#bytestr); } $cnt++; } # # Check for stacked DIMMs. A 128MB DIMM is sometimes seen as 2 # 64MB DIMMs with a hole in the address range. This may report # more slots than are really in a system. (i.e. a SS20 with # 8 32MB SIMMs reports 16 slots of 16MB each). # Special handling for $sortslots == 0 systems (Ultra 5/10, # Netra t1, Ultra CP 1400/1500, Ultra AXi/AXe/AXmp/AXmp+) # $stacked=0; if ($val < $#newslots - 2) { if ($sortslots == 0) { $start2=$start1 + ($simmrange * 2); $start2=$start1 + ($simmrange * 4) if ($banner =~ /Ultra CP 1400\b/ || $ultra eq "CP1400"); $start2x=sprintf("%08lx", $start2 / $meg); $stacked=2 if ($stacked == 0 && $newslots[$val + 2] eq $start2x && $newslots[$val + 3] eq $simmsz); if ($memtype eq "memory card") { # Some 256MB mezzanine boards are seen # as 4 64MB memory blocks with holes in # the address range. $start3=$start1 + ($simmsize * 2 * $meg) if ($simmsize eq 64); # Some 512MB mezzanine boards are seen # as 4 128MB memory blocks. $start3=$start1 + ($simmsize * $meg) if ($simmsize eq 128 && $banner !~ /Ultra CP 1400\b/ && $ultra ne "CP1400"); if ($banner =~ /\bCP2000\b/ || $ultra =~ /^CP2[01]\d0$/) { # 1GB mezzanine boards are seen # as 4 256MB memory blocks. $start3=$start1 + ($simmsize * $meg); $stacked=4; } $start3x=sprintf("%08lx", $start3 / $meg); if ($val < $#newslots - 6 && $stacked != 0) { $stacked=4 if ($newslots[$val + 4] eq $start3x && $newslots[$val + 5] eq $simmsz && $simmrange != $start3); } } if ($ultra eq "AXi") { # Check for 10-bit column address DIMMs if ($newslots[$val] =~ /00000[0-3]80/) { $found10bit=1; } elsif ($stacked == 0) { $found11bit=1; } if ($found10bit && $newslots[$val] !~ /00000[0-3]00/) { $socket=$socketstr[$cnt3 + 4]; if ($#socketlabelstr) { $socketlabel=" ($socketlabelstr[$cnt3 + 4])" if (defined($socketlabelstr[$cnt3 + 4])); } $bank=$bankstr[$cnt3 + 4]; } } } else { $start2=$start1 + ($simmrange / 2); $start2x=sprintf("%08lx", $start2 / $meg); $stacked=2 if ($newslots[$val + 2] eq $start2x && $newslots[$val + 3] eq $simmsz && ($simmsize ne 64)); } # # Check for 32MB SIMMs in bank 1 on Classic or LX. # They look like 16MB SIMMs at 0x0000000 and 0x06000000 # Also check for 8MB SIMMs in bank 1 on Classic or LX. # They look like 4MB SIMMs at 0x0000000 and 0x06000000 # if ($model =~ /SPARCclassic|SPARCstation-LX/) { if ($start1 == 0 && ($simmsize == 32 || $simmsize == 8)) { if ($newslots[$#newslots - 1] eq "00000060") { $totmem += $simmsize; $start2=hex("0x$newslots[$#newslots - 1]") * $meg; $start2x=sprintf("%08lx", $start2); $stop2x=sprintf("%08lx", $start2 + ($simmsize * $meg) - 1); $stop1x .= ", 0x${start2x}-0x$stop2x"; $simmsize *= 2; pop(@newslots); pop(@newslots); } } } if ($stacked == 2) { $totmem += $simmsize; $start2=hex("0x$newslots[$val + 2]") * $meg; if ($simmrange < hex("0x00001000") * $meg) { $start2x=sprintf("%08lx", $start2); $stop2x=sprintf("%08lx", $start2 + ($simmsize * $meg) - 1); } else { # Systems with > 4GB of memory $start2x=sprintf("%08lx", ($start2 / $meg)) . "00000"; $start2x=~s/^0000//; $stop2x=sprintf("%08lx", ($start2 / $meg) + $simmsize - 1) . "fffff"; $stop2x=~s/^0000//; } $stop1x .= ", 0x${start2x}-0x$stop2x"; $simmsize *= 2; $val += 2; } if ($stacked == 4) { $totmem += $simmsize * 3; $start2=hex("0x$newslots[$val + 2]") * $meg; $start2x=sprintf("%08lx", $start2); $stop2x=sprintf("%08lx", $start2 + ($simmsize * $meg) - 1); $stop1x .= ", 0x${start2x}-0x$stop2x"; $start3=hex("0x$newslots[$val + 4]") * $meg; $start3x=sprintf("%08lx", $start3); $stop3x=sprintf("%08lx", $start3 + ($simmsize * $meg) - 1); $stop1x .= ", 0x${start3x}-0x$stop3x"; $start4=hex("0x$newslots[$val + 6]") * $meg; $start4x=sprintf("%08lx", $start4); $stop4x=sprintf("%08lx", $start4 + ($simmsize * $meg) - 1); $stop1x .= ", 0x${start4x}-0x$stop4x"; $simmsize *= 4; $val += 6; } } # # Check for Voyager memory cards. A 32MB memory card is seen # as 4 8MB memory blocks with holes in the address range. # if ($model eq "S240" && $start1 && $simmsize == 16 && $val < $#newslots - 4) { $start=hex("0x$newslots[$val + 4]") - hex("0x$newslots[$val]"); $perlhexbug=1 if ($start < 0); $startx=sprintf("%08lx", $start); if ($newslots[$val + 1] eq "008" && $newslots[$val + 3] eq "008" && $startx eq "00000040") { $totmem += $simmsize; $startx=$newslots[$val + 2]; $start=hex("0x$startx") * $meg; $startx=sprintf("%08lx", $start); $perlhexbug=1 if ($start < 0); $stopx=sprintf("%08lx", $start + ($simmsize * $meg) - 1); $stop1x .= ", 0x${startx}-0x$stopx"; $startx=$newslots[$val + 4]; $start=hex("0x$startx") * $meg; $startx=sprintf("%08lx", $start); $perlhexbug=1 if ($start < 0); $stopx=sprintf("%08lx", $start + ($simmsize * $meg) - 1); $stop1x .= ", 0x${startx}-0x$stopx"; $simmsize *= 2; $val += 4; } } $slot0=$simmsize if ($start1 == 0); $simmsizeperbank=$simmsize / $simmsperbank; $smallestsimm=$simmsizeperbank if ($simmsize < $smallestsimm); $largestsimm=$simmsizeperbank if ($simmsize > $largestsimm); $found8mb=1 if ($simmsizeperbank == 8); $found16mb=1 if ($simmsizeperbank == 16); $found32mb=1 if ($simmsizeperbank == 32); push(@simmsizesfound, "$simmsizeperbank"); $cnt2=0; while ($cnt2 < $simmsperbank) { $socket='?' if (! defined($socket)); $bank='' if (! defined($bank)); $byte='' if (! defined($byte)); $socket='?' if ($socket eq ""); $recognized=0 if ($socket eq "?"); $sockets_used .= " $socket"; if ($socket eq "motherboard") { $buffer .= "$socket has "; $buffer .= $simmsize/$simmsperbank . "MB"; } else { if ($model eq "SPARCsystem-600" || $model =~ /Sun.4.600/) { $exp="Expansion board 0" if ($newslots[$val] =~ /00000[4-7]00/); $exp="Expansion board 1" if ($newslots[$val] =~ /00000[89ab]00/); if ($newslots[$val] =~ /00000[4-9ab]00/) { $buffer .= "$exp "; $banks="$exp bank $bank"; } $banks_used .= " $banks" if ($banks && $banks_used !~ /$banks/); } # prtconf-only data displayed here $buffer=($sockettype) ? "$buffer$sockettype $socket$socketlabel has a " : "$buffer$socket$socketlabel is a "; $buffer .= $simmsize/$simmsperbank . "MB"; $buffer .= " (" . $simmsize/$simmsperbank/1024 . "GB)" if ($simmsize/$simmsperbank > 1023); $buffer .= " $memtype"; push(@simmsizesfound, $simmsize/$simmsperbank); } if ($verbose) { $buf=""; if ($order) { $buf .= "$order"; $buf .= " $memtype" if ($memtype !~ /memory card/); } $slotnum="" if (! defined($slotnum)); $buf .= "slot $slotnum" if ($slotnum ne ""); $buf .= ", " if ($order || $slotnum ne ""); $buf .= "group $group, " if ($group ne ""); if ($bank ne "") { if ($bank =~ /Quad/) { $buf .= "$bank, "; } elsif ($dualbank eq 1) { $buf .= "banks $bank, "; } else { $buf .= "bank $bank, "; } $foundbank1or3=1 if ($bank eq 1 || $bank eq 3); } $buf .= "byte $byte, " if ($byte ne ""); $buf .= "address 0x${start1x}-0x$stop1x" if ($start1x && $showrange eq 1); $buffer .= " ($buf)" if ($buf); } $buffer .= "\n"; $cnt2++; $cnt3=($bankcnt * $simmsperbank) + $cnt2; if ($#socketstr) { $socket=$socketstr[$cnt3]; if ($#socketlabelstr) { $socketlabel=" ($socketlabelstr[$cnt3])" if (defined($socketlabelstr[$cnt3])); } if ($found10bit && $newslots[$val] !~ /00000[0-3]00/) { $socket=$socketstr[$cnt3 + 4]; if ($#socketlabelstr) { $socketlabel=" ($socketlabelstr[$cnt3 + 4])" if (defined($socketlabelstr[$cnt3 + 4])); } } # &pdebug("socketstr[$cnt3], bankcnt=$bankcnt, cnt2=$cnt2"); } $order=$orderstr[$cnt3] if ($#orderstr); $group=$groupstr[$cnt3] if ($#groupstr); $slotnum=$slotstr[$cnt3] if ($#slotstr); if ($#bankstr) { $bank=$bankstr[$cnt3]; $bank=$bankstr[$cnt3 + 4] if ($found10bit && $newslots[$val] !~ /00000[0-3]00/); } $banks=$banksstr[$cnt3/$simmsperbank] if ($#banksstr); $byte=$bytestr[$cnt3] if ($#bytestr); } } elsif ($ultra eq 1 || $ultra eq 5 || $ultra eq 10 || $ultra eq 30) { $buffer .= "bank $slot has a pair of " . $simmsize/2 . "MB DIMMs\n"; push(@simmsizesfound, $simmsize/2); } elsif ($ultra eq 2 || $ultra eq 250 || $ultra eq 450 || $ultra eq 80 || $ultra eq "420R" || $ultra eq "Netra t140x" || $ultra eq "Netra ft1800") { $buffer .= "group $slot has four " . $simmsize/4 . "MB DIMMs\n"; push(@simmsizesfound, $simmsize/4); } elsif ($ultra eq 60 || $ultra eq "220R") { $buffer .= "group $slot has four " . $simmsize/2 . "MB DIMMs\n"; push(@simmsizesfound, $simmsize/2); } elsif ($ultra eq "e") { $buffer .= "group $slot has eight " . $simmsize/8 . "MB DIMMs\n"; push(@simmsizesfound, $simmsize/8); } elsif ($socket eq "motherboard") { $buffer .= "$slot has ${simmsize}MB\n"; push(@simmsizesfound, $simmsize); } else { $buffer .= "slot $slot has a ${simmsize}MB"; $buffer .= " (" . $simmsize/1024 . "GB)" if ($simmsize > 1023); $buffer .= " $memtype\n"; push(@simmsizesfound, $simmsize); } $slot++; } # # Try to distinguish Ultra 5 from Ultra 10 # Cannot distinguish Ultra 5/333MHz from Ultra 10/333MHz (375-0066 motherboard) # Cannot distinguish Ultra 5/440MHz from Ultra 10/440MHz (375-0079 motherboard) # if ($model eq "Ultra-5_10" || $ultra eq "5_10" || $ultra eq 5 || $ultra eq 10) { if ($motherboard =~ /375-0009/) { $ultra=($sysfreq > 91) ? 10 : 5; $realmodel=($ultra eq 5) ? "(Ultra 5)" : "(Ultra 10)"; } # Determine if interleaving of banks using four identical sized DIMMs # Assume 1-way interleaving with mix of stacked and unstacked DIMMs $interleave=1; if ($#newslots == 3 && $stacked == 0) { $interleave=2 if ($newslots[1] eq $newslots[3]); } if ($#newslots == 7 && $stacked == 2) { $interleave=2 if ($newslots[1] eq $newslots[5]); } } &finish; &pdebug("exit"); exit; sub hpux_check { &pdebug("in hpux_check"); $HPUX=1; $model=$machine; if ($filename) { $model=""; $machine=""; $platform=""; $os="HP-UX"; } else { $osmajor=$osrel; $osmajor=~s/[^.]*.[0B]*//; $osmajor=~s/\..*//; &hpux_osrelease; $model=&mychomp(`/usr/bin/model`) if (-x '/usr/bin/model'); $cpuversion=""; if (-x '/usr/bin/getconf') { $kernbit=&mychomp(`/usr/bin/getconf KERNEL_BITS`); $cpuversion=&mychomp(`/usr/bin/getconf CPU_VERSION`); } $kernbit=32 if ($osmajor <= 10); if (-x '/usr/contrib/bin/machinfo') { @machinfo=&run("/usr/contrib/bin/machinfo"); &hpux_machinfo; } elsif (-x '/usr/sbin/ioscan') { $ncpu=&mychomp(`/usr/sbin/ioscan -kfnC processor | grep '^processor' | wc -l`); $cpucntfrom="ioscan"; } else { # Get CPU count from kernel if ($machine eq "ia64") { $ncpu=&hpux_kernelval("active_processor_count"); } else { $ncpu=&hpux_kernelval("processor_count"); } $cpucntfrom="kernel"; } $ncpu=1 if (! defined($ncpu)); # It has at least 1 CPU $cpubanner .= "$ncpu X " if ($ncpu > 1); if ($machine =~ /^9000\//) { $schedmodel=$model; $schedmodel=~s/^.*\/(.*$)/$1/; if (! $cputype && -r '/usr/sam/lib/mo/sched.models') { $cputype=&myawk('/usr/sam/lib/mo/sched.models',"^$schedmodel\\b",2); } if (! $cputype && -r '/opt/langtools/lib/sched.models') { $cputype=&myawk('/opt/langtools/lib/sched.models',"^$schedmodel\\b",2); } if (! $cputype && -r '/usr/lib/sched.models') { $cputype=&myawk('/usr/lib/sched.models',"^$schedmodel\\b",2); } if ($cputype) { $cpubanner .= "$cputype "; &pdebug(" cputype=$cputype"); } if ($cpuversion == 768) { $cpubanner .= "Itanium[TM] 1"; } elsif ($cpuversion == 524) { $cpubanner .= "Motorola MC68020"; } elsif ($cpuversion == 525) { $cpubanner .= "Motorola MC68030"; } elsif ($cpuversion == 526) { $cpubanner .= "Motorola MC68040"; } else { $cpubanner .= "PA-RISC"; if ($cpuversion == 532) { $cpubanner .= " 2.0"; } elsif ($cpuversion == 529) { $cpubanner .= " 1.2"; } elsif ($cpuversion == 528) { $cpubanner .= " 1.1"; } elsif ($cpuversion == 523) { $cpubanner .= " 1.0"; } elsif (&hpux_kernelval("cpu_arch_is_2_0")) { $cpubanner .= " 2.0"; } elsif (&hpux_kernelval("cpu_arch_is_1_1")) { $cpubanner .= " 1.1"; } elsif (&hpux_kernelval("cpu_arch_is_1_0")) { $cpubanner .= " 1.0"; } } } elsif ($cputype) { $cpubanner .= "$cputype"; } else { $cpubanner .= "$machine"; } if (! defined($cfreq)) { # Get CPU speed from kernel $cfreq=&hpux_kernelval("itick_per_usec"); if (! defined($cfreq)) { $cfreq=&hpux_kernelval("itick_per_tick"); $cfreq /= 10000 if (defined($cfreq)); } &pdebug(" cfreq=$cfreq found in kernel") if (defined($cfreq)); } $cpubanner .= ", ${cfreq}MHz" if (defined($cfreq)); } $model="HP $model" if ($model !~ /\bHP\b/i); $model=~s/ +$//; $is_hpvm=0; &hpux_machinfo if ($filename); } sub hpux_kernelval { return if (! -r '/dev/kmem'); $_=shift; $kernel="/hp_ux"; $kernel="/stand/vmunix" if (-f '/stand/vmunix'); $adb="/usr/bin/adb"; $adb .= " -o" if ($machine eq "ia64"); $kernelval=`echo "$_/D" | $adb $kernel /dev/kmem 2>/dev/null | tail -1`; @linearr=split(' ', $kernelval); return $linearr[1]; } sub hpux_machinfo { &pdebug("in hpux_machinfo"); $flag_cpu=0; $flag_platform=0; $flag_os=0; # parse machinfo output for CPU and other information foreach $line (@machinfo) { $line=&dos2unix($line); $line=&mychomp($line); if (! $line || $line =~ /^ +$/) { # End of sections $flag_cpu=0; $flag_platform=0; $flag_os=0; next; } if ($line =~ /^CPU info:/) { $flag_cpu=1; # Start of CPU section next; } if ($flag_cpu == 1) { # Parse CPU count, type and frequency for cpubanner if ($line =~ /^\s*\d*\s+.*[Pp]rocessor.* \(\d.*Hz,/) { $ncpu=$line; $ncpu=~s/^\s*(\d+)\s+.*/$1/; $ncpu=1 if ($ncpu eq $line); $cpucntfrom="machinfo 'CPU info'"; $cputype=$line; $cputype=~s/^\s*\d*\s+(.*)$/$1/; $cputype=~s/ processors.*$//; $cputype=~s/^(.*)\s+\(\d.*Hz.*/$1/; $cputype=~s/\s+/ /g; $cfreq=$line; $cfreq=~s/^.*[Pp]rocessor.* \((\d.* [GM]Hz),/$1/; if ($cfreq =~ /GHz/) { $cfreq=~s/ GHz.*$//; $cfreq *= 1000; } else { $cfreq=~s/ MHz.*$//; } &pdebug(" cputype=$cputype, cfreq=$cfreq"); next; } elsif ($line =~ /logical processors \(\d+ per socket/) { # Report multicore processors $tmp=$line; $tmp=~/(\d+) logical processors \((\d+) per socket/; $cputype=&multicore_cputype($cputype,$2) if (defined($2)); next; } elsif ($line =~ /Number of CPUs = /) { @linearr=split('=', $line); $ncpu=$linearr[1]; $ncpu=~s/^ *//; $cpucntfrom="machinfo 'Number of CPUs'"; next; } elsif ($line =~ /^\s*\d+ sockets\s*$/) { $tmp=$line; $tmp=~/(\d+) sockets/; $ncpu=$1; $cpucntfrom="machinfo 'sockets'"; next; } elsif ($line =~ /processor model: /) { @linearr=split(':', $line); $cputype=$linearr[1]; $cputype=~s/^ *\d+ +//; $cputype=~s/ processor$//; &pdebug(" cputype=$cputype"); next; } elsif ($line =~ /Clock speed = \d+ [GM]Hz/) { @linearr=split('=', $line); $cfreq=$linearr[1]; $cfreq=~s/^ *//; if ($cfreq =~ /GHz/) { $cfreq=~s/ GHz//; $cfreq *= 1000; } else { $cfreq=~s/ MHz//; } next; } elsif ($line =~ /LCPU attribute is /) { $hyperthreadcapable=1; if ($line =~ /enabled/i) { $hyperthread=1; $cputype=~s/ Intel/ Hyper-Threaded Intel/ if ($cputype !~ /Hyper.Thread/i); } next; } } if ($line =~ /^Memory:\s/) { $installed_memory=$line; $installed_memory=~s/^Memory:\s*(\d*\s*[GM]*[Bb]*).*/$1/; if ($installed_memory =~ /GB/) { $installed_memory=~s/\s*GB//g; $installed_memory *= 1024; } else { $installed_memory=~s/MB//ig; } $totmem=&roundup_memory($installed_memory); next; } if ($line =~ /^Platform info:/) { $flag_platform=1; # Start of Platform section next; } if ($flag_platform == 1 && $model eq "HP" && $line =~ /\bModel/i) { @linearr=split('[:=]', $line); $model=$linearr[1]; $model=~s/^ +//; $model=~s/"//g; $model=~s/ +$//; if ($model =~ /^ia64/) { $machine="ia64"; $platform="ia64"; $kernbit=64; } $model="HP $model" if ($model !~ /\bHP\b/i); next; } if ($line =~ /^OS info:/) { $flag_os=1; # Start of OS section next; } if ($flag_os == 1 && ! $osrel && $line =~ /\bRelease/i) { @linearr=split('[:=]', $line); $osrel=$linearr[1]; $osrel=~s/^ +//; $osrel=~s/^HP-UX //; &hpux_osrelease; next; } } $is_hpvm=1 if ($model =~ /Virtual Machine/); } sub hpux_osrelease { if ($osrel eq "B.11.11") { $osrelease="11i v1"; } elsif ($osrel eq "B.11.20") { $osrelease="11i v1.5"; } elsif ($osrel eq "B.11.22") { $osrelease="11i v1.6"; } elsif ($osrel eq "B.11.23") { $osrelease="11i v2"; } elsif ($osrel eq "B.11.31") { $osrelease="11i v3"; } } sub hpux_cprop { &pdebug("in hpux_cprop"); $config_cmd="/opt/propplus/bin/cprop -summary -c Memory"; $config_command="cprop"; # Use HP-UX SysMgmtPlus software to attempt to report memory if ($filename) { $cprop_out="<$filename"; } else { &show_header; $cprop_out="$config_cmd 2>&1 |"; } $cnt=0; open(FILE, $cprop_out); while() { next if (/^[\s\*\-]+$/); next if (/(| Unknown|: Other|: \.\.|: Not Specified|:\s*$)/i); ($permission_error)=(/(.*)/) if (/Permission denied|does not have privileges|is not authorized to run/i); if (/not supported on HPVM guest/i) { $is_hpvm=1; last; } $memarr++ if (/^\[Instance\]:\s+\d+/); if ($memarr >= 0) { ($Status[$memarr])=(/:\s+(.*)$/) if (/\[Status\]:\s+/); if (/\[Location\]:\s+/) { ($Location[$memarr])=(/Location\]:\s+(.*)$/); $Location[$memarr]=~s/^.*details\s+://; $Location[$memarr]=~s/\s+:\s+/:/g; $Location[$memarr]=~s/\.$//; } ($Size[$memarr])=(/:\s+(.*)$/) if (/\[Size\]:\s+/); ($ModType[$memarr])=(/:\s+(.*)$/) if (/\[Module Type\]:\s+/); ($MemType[$memarr])=(/:\s+(.*)$/) if (/\[Memory Type\]:\s+/); if (/\[Part Number\]:\s+/) { ($PN[$memarr])=(/:\s+(.*)$/); $PN[$memarr]=&hex2ascii($PN[$memarr]); } } } close(FILE); $installed_memory=0; for ($cnt=0; $cnt <= $memarr; $cnt++) { $buffer=""; if (defined($Size[$cnt])) { $buffer="$Location[$cnt]:" if (defined($Location[$cnt])); $buffer.=" $PN[$cnt]" if (defined($PN[$cnt])); $simmsize=$Size[$cnt]; if ($simmsize =~ /GB/) { $simmsize=~s/GB//g; $simmsize *= 1024; } else { $simmsize=~s/MB//ig; } $installed_memory += $simmsize; $buffer.=" $Size[$cnt]"; $buffer.=" $MemType[$cnt]" if (defined($MemType[$cnt])); $buffer.=" $ModType[$cnt]" if (defined($ModType[$cnt])); if (defined($Status[$cnt])) { if ($Status[$cnt] !~ /OK/i) { $buffer.=" - $Status[$cnt]"; $failing_memory=1; } } $buffer=~s/^\s+//; if ("$buffer" ne "") { push(@boards_mem, "$buffer\n"); $boardfound_mem=1; $memfrom="cprop"; } } elsif (defined($Location[$cnt])) { # Empty socket $sockets_empty .= ";" if ($sockets_empty); $sockets_empty .= " $Location[$cnt]"; } } $totmem=$installed_memory if (! $totmem); if ($installed_memory && $totmem && $installed_memory != $totmem) { print "ERROR: Total installed memory (${totmem}MB) does not "; print "match the total of the\n memory modules found "; print "(${installed_memory}MB).\n"; } &hpux_finish; } sub hpux_cstm { &pdebug("in hpux_cstm"); $config_cmd="echo 'selclass qualifier memory;info;wait;infolog'|/usr/sbin/cstm 2>&1"; if (! $filename && $verbose == 3) { # Include CPU information when E-mailing maintainer since this # data is used by memconf for regression testing. $config_cmd="echo 'selclass qualifier cpu;info;wait;selclass qualifier memory;info;wait;infolog'|/usr/sbin/cstm 2>&1"; } $config_command="cstm"; # Use HP-UX Support Tool Manager software to attempt to report memory if (! $filename) { &show_header; @config=&run("$config_cmd"); } $flag_memerr=0; foreach $line (@config) { $line=&dos2unix($line); next if ($line eq "\n" || $line =~ /^ +$/ || $line =~ /^ +=+$/); if ($line =~ /Internal Application error/i) { $cstm_error=$line; $cstm_error=~s/^ *//; next; } if ($line =~ /=\-\+\-=/) { $flag_mem=0; # End of section next; } if ($line =~ /\bPA [78]\d+.* CPU\b/) { $cputype=&mychomp($line); $cputype=~s/^.* (PA [78]\d+).*/$1/; $cputype=~s/ //g; &pdebug(" cputype=$cputype"); $ncpu++; } if ($line =~ /^'9000\// && $model eq "HP" && ! $machine) { @linearr=split(' ', $line); $machine=$linearr[0]; $machine=~s/\'//g; $platform=$machine; $model="HP $machine"; } if ($flag_mem == 1) { next if ($line =~ /Log creation time/); if ($line =~ /^-- Information Tool Log for /) { $flag_mem=0; # End of memory section next; } if ($line =~ /^Memory Error Log Summary/) { $flag_memerr=1; # Start of memory error log } if ($line =~ / errors logged | memory error log |Last error /) { $flag_memerr=0; # End of memory error log } if ($flag_memerr == 0 || $verbose) { push(@boards_mem, "$line"); } elsif ($verbose == 0 && $line =~ /^Memory Error Log Summary| errors logged | memory error log |Last error /) { # Only display the memory errors if verbose push(@boards_mem, "$line"); } $memory_error_logged=1 if ($line =~ / errors logged | Last error detected/); $boardfound_mem=1; $memfrom="cstm"; } if ($line =~ /^-- Information Tool Log for .*MEMORY / && $flag_mem == 0) { $flag_mem=1; # Start of memory section } } &hpux_finish; } sub hpux_finish { if ($machine =~ /^9000\/7/) { $modelmore="workstation"; } elsif ($machine =~ /^9000\/8/) { $modelmore="server"; } if ($filename) { if ($cputype) { $cpubanner="$ncpu X " if ($ncpu > 1); $cpubanner .= "$cputype"; } else { $cpubanner="$ncpu cpus" if ($ncpu > 1); } if (defined($cfreq)) { $cpubanner .= ", ${cfreq}MHz"; } &show_header; } if ($boardfound_mem) { &pdebug("displaying memory from $memfrom") if ($memfrom); print @boards_mem; &print_empty_memory("memory slots") if ($sockets_empty); &show_total_memory; } else { if ($filename) { &show_total_memory; } else { if (! $totmem) { # Get total memory from kernel if ($osmajor > 10) { $totmem=&hpux_kernelval("memory_installed_in_machine"); } else { $totmem=&hpux_kernelval("physmem"); } if (defined($totmem)) { $totmem /= 256; # Convert pages to MB } else { $totmem=0; } if (-r '/var/adm/syslog/syslog.log' && $totmem == 0) { open(FILE, "; close(FILE); @physical=grep(/Physical:/,@syslog); foreach $line (@physical) { @linearr=split(' ', $line); $totmem=$linearr[6] / 1024; last; } } } &show_total_memory; # Check if on a virtual machine (HPVM guest) if (-x '/opt/hpvm/bin/hpvminfo') { &pdebug("Checking hpvminfo"); $tmp=`/opt/hpvm/bin/hpvminfo 2>&1`; if ($tmp =~ /HPVM guest/i) { $is_hpvm=1; } elsif ($tmp =~ /Permission denied|does not have privileges|is not authorized to run/i) { print "ERROR: $tmp"; print " This user does not have permission to run '/opt/hpvm/bin/hpvminfo'.\n"; print " Run memconf as a privileged user like root on the HPVM host.\n"; } } } if ($is_hpvm) { print "NOTICE: Details shown are for the configuration of this HPVM guest, not the\n physical CPUs and memory of the HPVM host it is running on.\n"; } elsif ($config_command eq "cstm") { print "ERROR: /usr/sbin/cstm $cstm_error" if (defined($cstm_error)); print "ERROR: /usr/sbin/cstm did not report the memory installed in this HP-UX system.\n"; print " Cannot display detailed memory configuration. A newer version of\n"; print " Diagnostic and Support Tools for HP-UX may fix this issue. Aborting.\n"; } $exitstatus=1; } # # Post notice if X86 machine is Hyper-Thread capable, but not enabled # &show_hyperthreadcapable; if ($permission_error) { print "ERROR: $permission_error\n"; print " This user does not have permission to run $config_command.\n"; print " Try running memconf as a privileged user like root.\n" if ($uid ne "0"); $exitstatus=1; } # Flag untested CPU types (machine="" on regression test files) if (! $machine || $machine =~ /^9000\// || $machine eq "ia64") { # Tested HP-UX on PA-RISC and Itanium $untested=0; } else { $untested=1; $untested_type="CPU" if (! $untested_type); } &show_untested if ($untested); &show_errors; if ($memory_error_logged && $verbose == 0) { print "WARNING: Memory errors have been logged.\n"; print " Run 'memconf -v' to display the memory error log.\n"; } &mailmaintainer if ($verbose == 3); &pdebug("exit $exitstatus"); exit $exitstatus; } sub myawk { $awkfile=shift; $awksearch=shift; $awkfield=shift; open(FILE, "<$awkfile"); @tmp=; close(FILE); foreach $line (@tmp) { if ($line =~ /$awksearch/) { @linearr=split(' ', $line); return $linearr[$awkfield]; } } return ""; } sub x86_devname { return if ($have_x86_devname || $machine =~ /sun4|sparc/ || ! defined($model)); # x86 Sun development names and family part number $m=(defined($manufacturer)) ? "$manufacturer $model" : $model; $m=~s/-/ /g; &pdebug("in x86_devname, model=$m"); $untested=1 if ($m =~ /(Blade|Server) X\d/i); $untested=2 if ($m =~ /Sun |Netra /i); if ($m =~ /Sun .*W1100z.*2100z\b/i || $m =~ /Sun .*W[12]100z\b/i) { &cpubanner; # Check for Opteron 200 Series in case one CPU is disabled if ($cpubanner =~ /Opteron.* 2\d\d\b/i || $ncpu == 2) { # W2100z uses Opteron 200 Series 2-way processors. $devname="Metropolis 2P"; $familypn="A59"; $diagbanner="W2100z"; @socketstr=("DIMM2 Bank 0","DIMM1 Bank 0","DIMM4 Bank 1","DIMM3 Bank 1","DIMM6 Bank 2","DIMM5 Bank 2","DIMM8 Bank 3","DIMM7 Bank 3"); @reorder_decodedimms=(4,3,2,1,8,7,6,5); } elsif ($cpubanner) { # W1100z uses Opteron 100 Series 1-way processor. # W1100z is not upgradable to dual processors, so # don't show empty CPU2 or DIMM5-DIMM8 slots. $devname="Metropolis 1P"; $familypn="A58"; $diagbanner="W1100z"; @socketstr=("DIMM2 Bank 0","DIMM1 Bank 0","DIMM4 Bank 1","DIMM3 Bank 1"); @reorder_decodedimms=(4,3,2,1); } $model="Java Workstation $diagbanner"; $diagbanner=$model; $untested=0; } if ($m =~ /Sun .*V20z.*40z\b/i) { $devname="Stinger"; $familypn="A55 (V20z), A57 (V40z)"; } elsif ($m =~ /Sun .*V20z\b/i) { $devname="Stinger 2P"; $familypn="A55"; $untested=0; } elsif ($m =~ /Sun .*V40z\b/i) { $devname="Stinger 4P"; $familypn="A57"; $untested=0; } if ($m =~ /\bX2100 M2\b/i) { $devname="Leo"; $familypn="A84"; $untested=0; } elsif ($m =~ /Sun .*X2100\b/i) { $devname="Aquarius"; $familypn="A75"; $untested=0; } if ($m =~ /Sun .*X2200 (speedbump|M2\b.*Quad.*Core)/i) { # AMD Quad-Core Barcelona processor $devname="Taurus2"; $familypn="A85"; $untested=0; } elsif ($m =~ /Sun .*X2200 M2\b/i) { $devname="Taurus"; $familypn="A85"; $untested=0; } if ($m =~ /Sun .*X2250\b/i) { $devname="Venus"; $familypn="X2250"; $untested=0; } if ($m =~ /Sun .*X2270 M2\b/i) { # X2270 has 1 or 2 CPUs $familypn="X2270M2"; $untested=0 if ($os eq "SunOS"); } elsif ($m =~ /Sun .*X2270\b/i) { # X2270 has 1 or 2 Quad-Core hyper-threaded CPUs $familypn="X227"; $untested=0 if ($os eq "SunOS"); } if ($m =~ /Sun .*X4100 M2\b/i) { $devname="Galaxy 1F"; $familypn="A86"; $untested=0; } elsif ($m =~ /Sun .*X4100\b/i) { $devname="Galaxy 1U"; $familypn="A64"; $untested=0; } if ($m =~ /Sun .*X4100E\b/i) { $devname="Galaxy 1E"; # Cancelled $familypn="A72"; } if ($m =~ /Sun .*X4140\b/i) { $devname="Dorado 1U"; $familypn="B12"; $untested=0; } if ($m =~ /Sun .*X4150\b/i) { $devname="Doradi 1U"; $familypn="B13"; $untested=0; } if ($m =~ /Sun .*X4170\b/i) { # X4170 has 1 or 2 Quad-Core hyper-threaded CPUs $devname="Lynx 1U"; $familypn="X4170"; $untested=0; } if ($m =~ /Sun .*X4200 M2\b/i) { $devname="Galaxy 2F"; $familypn="A87"; $untested=0; } elsif ($m =~ /Sun .*X4200\b/i) { $devname="Galaxy 2U"; $familypn="A65"; $untested=0; } if ($m =~ /Netra .*X4200\b/i) { $devname="Draco"; $familypn="N87"; } if ($m =~ /Sun .*X4200E\b/i) { $devname="Galaxy 2E"; # Cancelled $familypn="A73"; } if ($m =~ /Sun .*X4240\b/i) { $devname="Dorado 2U"; $familypn="B14"; $untested=0; } if ($m =~ /Netra .*X4250\b/i) { $devname="Aries"; $familypn="NX425"; } if ($m =~ /Sun .*X4250\b/i) { $devname="Doradi 2U"; $familypn="X4250"; $untested=0 if ($os eq "SunOS"); } if ($m =~ /Sun .*X4270 M2\b/i) { # X4270 has 1 or 2 Quad-Core hyper-threaded CPUs $devname="Lynx 2U"; $familypn="X4270M2"; $untested=0; } elsif ($m =~ /Sun .*X4270\b/i) { $devname="Lynx 2U"; $familypn="X4270"; $untested=0; } if ($m =~ /Sun .*X4275\b/i) { # X4275 has 1 or 2 Quad-Core hyper-threaded CPUs $devname="Lynx 2U"; $familypn="X4275"; } if ($m =~ /Netra .*X4270\b/i) { $familypn="NX4270"; } if ($m =~ /Sun .*X4440\b/i) { $devname="Tucana"; $familypn="B16"; $untested=0 if ($os eq "SunOS"); } if ($m =~ /Sun .*X4450\b/i) { $devname="Tucani"; $familypn="B15"; $untested=0; } if ($m =~ /Netra .*X4450\b/i) { $devname="Argo"; } if ($m =~ /Sun .*X4470 M2\b/i) { # X4470 has 4 CPU sockets $familypn="X4470M2"; $untested=0 if ($os eq "SunOS"); } elsif ($m =~ /Sun .*X4470\b/i) { $familypn="X4470"; $untested=0 if ($os eq "SunOS"); } if ($m =~ /Sun .*X4500\b/i) { $devname="Thumper"; $familypn="A76"; $untested=0; } if ($m =~ /Sun .*X4540\b/i) { $devname="Thor"; $familypn="B24"; $untested=0 if ($os eq "SunOS"); } if ($m =~ /Sun .*X4600\b/i) { $devname="Galaxy 4U"; $familypn="A67"; # Same for X4600 M2 $devname="Galaxy 4F" if ($m =~ /Sun .*X4600 M2\b/); $untested=0; } if ($m =~ /Sun .*X4640\b/i) { # Replacement for Sun Fire X4600 M2 $familypn="X4640"; $untested=0 if ($os eq "SunOS"); } if ($m =~ /Sun .*X4800 M2\b/i) { # X4800 has 8 CPU sockets $familypn="X4800M2"; } elsif ($m =~ /Sun .*X4800\b/i) { # X4800 has 8 CPU sockets $familypn="X4800"; $untested=0 if ($os eq "SunOS"); } if ($m =~ /Sun .*X4950\b/i) { $devname="Streamstar StreamSwitch 2"; $familypn="A91"; } # The Sun Blade 8000 Modular System uses the Sun Blade # X8420/X8440/X8450 Server Modules if ($m =~ /Sun .*Blade 8000\b/i) { $devname="Andromeda 19"; $familypn="A81"; if ($m =~ /Sun .*Blade 8000 P\b/i) { $devname="Andromeda 14"; $familypn="A82"; } $untested=2; } if ($m =~ /Sun .*Fire V60x\b|Sun .*Fire\(tm\) V60\b/i) { $devname="Grizzly"; $familypn="A48"; } if ($m =~ /Sun .*Fire V65x\b|Sun .*Fire\(tm\) V65\b/i) { $devname="Grizzly 2U"; $familypn="A48"; $untested=0 if ($os eq "SunOS"); } if ($m =~ /Sun .*Ultra *20 M2\b/i) { $devname="Munich"; $familypn="A88"; $untested=2; $untested=0 if ($os eq "SunOS"); } elsif ($m =~ /Sun .*Ultra *20\b/i) { $devname="Marrakesh"; $familypn="A63"; $untested=2; $untested=0 if ($os eq "SunOS"); } if ($m =~ /Sun .*Ultra *24\b/i) { $devname="Ursa"; $familypn="B21"; $untested=0; } if ($m =~ /Sun .*Ultra *27\b/i) { $familypn="B27"; $untested=0; } if ($m =~ /Sun .*Ultra *40 M2\b/i) { $devname="Stuttgart"; $familypn="A83"; $untested=0; } elsif ($m =~ /Sun .*Ultra *40\b/i) { $devname="Sirius"; $familypn="A71"; $untested=0; } # The Sun Blade 6000 and 6048 Modular Systems use the Sun Blade # X6220, X6250 or T6300 Server Modules. if ($m =~ /Sun .*Blade 6000\b/i) { $devname="Constellation 10"; $familypn="A90"; $untested=2; } if ($m =~ /Sun .*Blade 6048\b/i) { $devname="Constellation 48"; $familypn="B22"; $untested=2; } if ($m =~ /Sun .*X6220\b/i) { $devname="Gemini"; $familypn="A92"; } if ($m =~ /Sun .*X6240\b/i) { $devname="Gemini+"; $familypn="X6240"; $untested=0 if ($os eq "SunOS"); } if ($m =~ /Sun .*X6250\b/i) { $devname="Wolf"; $familypn="A93"; $untested=0; } if ($m =~ /Sun .*X6270 M2\b/i) { # X6270 has 1 or 2 CPUs $familypn="X6270M2"; $untested=0; } elsif ($m =~ /Sun .*X6270\b/i) { # X6270 has 1 or 2 Quad-Core hyper-threaded CPUs $familypn="X6270"; $untested=0; } if ($m =~ /Sun .*X6275 M2\b/i) { # X6275 M2 has 2 Quad-Core or Six-Core hyper-threaded CPUs $familypn="X6275M2"; } elsif ($m =~ /Sun .*X6275\b/i) { # X6275 has 2 or 4 Quad-Core hyper-threaded CPUs $familypn="X6275"; } if ($m =~ /Sun .*X6420\b/i) { $devname="Pegasus"; } if ($m =~ /Sun .*X6440\b/i) { $devname="Pegasus+"; $familypn="X6440"; } if ($m =~ /Sun .*X6450\b/i) { $devname="Hercules2"; $familypn="X6450"; } if ($m =~ /Sun .*X8400\b/i) { $devname="Andromeda"; $familypn="X8400"; } if ($m =~ /Sun .*X8420\b/i) { $devname="Capella"; } if ($m =~ /Sun .*X8440\b/i) { $devname="Mira"; $familypn="A98"; } if ($m =~ /Sun .*X8450\b/i) { # Quad-Core CPU for Sun Blade 8000 chassis $devname="Scorpio"; $familypn="X8450"; } if ($m =~ /Sun .*X8600\b/i) { $devname="Antares"; } $untested=1 if ($m =~ /Netra Server X3.2\b/i); # X3-2 $untested=0 if ($m =~ /Sun Server X4.2\b/i && $os eq "SunOS"); # X4-2 $untested=0 if ($m =~ /Sun Server X4.2L\b/i && $os eq "SunOS"); # X4-2L $untested=1 if ($m =~ /Sun Server X4.4\b/i); # X4-4 $untested=1 if ($m =~ /Sun Server X4.8\b/i); # X4-8 $untested=1 if ($m =~ /Netra Blade X3.2B\b/i); # X3-2B $untested=1 if ($m =~ /Sun Blade X4.2B\b/i); # X4-2B $untested=0 if ($m =~ /Oracle Server X5.2\b/i && $os eq "SunOS"); # X5-2 $untested=0 if ($m =~ /Oracle Server X5.2L\b/i && $os eq "SunOS"); # X5-2L $untested=0 if ($m =~ /Oracle Server X6.2L\b/i && $os eq "SunOS"); # X6-2L $have_x86_devname=1 if ($devname); } sub releasefile { # Check file for release information $arg=shift; &pdebug("in releasefile, checking $arg"); open(FILE, $arg); while() { $tmp=&mychomp($_); next if ($tmp =~ /^[\s\*\-\_\\\/\|]*$/); # Ignore line if it starts with Escape sequence next if ($tmp =~ /^\e\[/); $tmp=~s/\s*\\[nr].*//; $tmp=~s/^Welcome to //; $tmp=~s/\s+-\s+.*//; &pdebug("in releasefile $arg, found $tmp"); return($tmp); } close(FILE); return(""); } sub linux_distro { $release=""; $osname="$os $osrel"; $osname="$os" if ($osrel eq ""); $kernbit=""; $kernbit="32-bit kernel" if ($machine =~ /i.86|sparc/); $kernbit="64-bit kernel" if ($machine =~ /x86_64|sparc64|ia64|amd64/); if (-f '/etc/freebsd-update.conf') { # FreeBSD @linearr=split(' ', $kernver); $release="$linearr[0] $linearr[1], $kernbit"; return; } $kernbit .= ", " if ($kernbit); foreach $relfile ('/etc/pclinuxos-release', '/etc/centos-release', '/etc/distro-release', '/etc/enterprise-release', '/etc/fedora-release', '/etc/frugalware-release', '/etc/kate-version', '/etc/myah-version', '/etc/pardus-release', '/etc/parsix-version', '/etc/sabayon-release', '/etc/vector-version', '/etc/whitebox-release', '/etc/yellowdog-release', '/etc/yoper-release', '/etc/UnitedLinux-release', '/etc/gentoo-release', '/etc/mandriva-release', '/etc/mandrakelinux-release','/etc/mandrake-release', '/etc/slackware-version','/etc/slackware-release', '/etc/redhat-release','/etc/redhat_version', '/etc/SuSE-release') { if (-f "$relfile") { $release=&releasefile($relfile); $release .= ", $kernbit$osname"; return; } } if (-d '/KNOPPIX') { if (-r '/cdrom/index.html') { open(FILE, ") { if (//) { $release=&mychomp($_); $release=~s/<TITLE>//; $release=~s/<\/TITLE.*//; } } close(FILE); } elsif (-r '/init') { open(FILE, "</init"); while(<FILE>) { if (/DISTRO=/) { $release=&mychomp($_); $release=~s/.*DISTRO="*(.*)$/$1/; $release=~s/"//g; } } close(FILE); } $release="Knoppix" if (! $release); $release .= ", $kernbit$osname"; $release .= ", " . &releasefile("/etc/issue") if (-f '/etc/issue'); return; } elsif (-f '/gos/gOS/gos.html') { $release="gOS, $kernbit$osname"; $release .= ", " . &releasefile("/etc/issue") if (-f '/etc/issue'); return; } elsif (-f '/etc/motd.static') { $release=&releasefile("/etc/motd.static"); $release .= ", $kernbit$osname"; if (-f '/etc/issue') { $tmp=&releasefile("/etc/issue"); if ($release =~ /Knoppix/i) { $release="Knoppix, $kernbit$osname, $tmp"; } else { $release .= ", $tmp"; } } return; } elsif (-d '/ffp/etc') { $release="fun_plug"; if (-f '/ffp/etc/ffp-version') { $tmp=&mychomp(`grep FFP_VERSION= /ffp/etc/ffp-version`); $tmp=~s/^.*=//; $release .= " $tmp" if ($tmp); } if (-f '/etc/Alt-F') { $tmp=&releasefile('/etc/Alt-F'); $release="Alt-F $tmp with $release"; } } elsif (-f '/etc/Alt-F') { $tmp=&releasefile('/etc/Alt-F'); $release="Alt-F $tmp"; } # Debian, Ubuntu, BusyBox, etc. foreach $relfile ('/etc/issue.net','/etc/issue','/etc/motd') { $release=&releasefile("$relfile") if (! $release && -f "$relfile"); } $release=(defined($release)) ? "$release, $kernbit$osname" : ""; $release=~s/^, //; } sub check_mixedspeeds { $_=shift; return if ($_ !~ /(\dMHz|\dns)/); s/^.* (\d*)MHz.*$/$1/; s/^(\d*)MHz.*$/$1/; s/^.* (\d*)ns.*$/$1/; s/^(\d*)ns.*$/$1/; return if (! $_); &pdebug("in check_mixedspeeds, value=$_"); # round some memory speeds $_=266 if ($_ >= 265 && $_ <= 285); # DDR-266 PC-2100 $_=667 if ($_ >= 665 && $_ <= 668); # DDR2-667 PC2-5300 $_=1066 if ($_ >= 1065 && $_ <= 1068); # DDR2-1066 PC2-8500, DDR3-1066 PC3-8500 $_=1866 if ($_ >= 1865 && $_ <= 1868); # DDR3-1866 PC3-14900 if ($foundspeed) { $mixedspeeds=1 if ($foundspeed ne $_); } else { $foundspeed=$_; } } sub roundup_memory { $newval=shift; # &pdebug("in roundup_memory $newval"); # Round up memory (may have 128MB or more reserved) # Works for up to 16777216GB (16TB) for ($val=16; $val <= 64; $val += 16) { $newval=$val if ($newval >= $val-8 && $newval < $val); } for ($val=64; $val <= 1024; $val += 32) { $newval=$val if ($newval >= $val-16 && $newval < $val); } for ($val=1024; $val <= 4096; $val += 512) { $newval=$val if ($newval >= $val-128 && $newval < $val); } for ($val=4096; $val <= 14336; $val += 1024) { $newval=$val if ($newval >= $val-512 && $newval < $val); } for ($val=14336; $val <= 32768; $val += 2048) { $newval=$val if ($newval >= $val-1024 && $newval < $val); } for ($val=32768; $val <= 262144; $val += 4096) { $newval=$val if ($newval >= $val-2048 && $newval < $val); } for ($val=262144; $val <= 1048576; $val += 8192) { $newval=$val if ($newval >= $val-4096 && $newval < $val); } for ($val=1048576; $val <= 4194304; $val += 16384) { $newval=$val if ($newval >= $val-8192 && $newval < $val); } for ($val=4194304; $val <= 16777216; $val += 32768) { $newval=$val if ($newval >= $val-16384 && $newval < $val); } for ($val=16777216; $val <= 67108864; $val += 65536) { $newval=$val if ($newval >= $val-32768 && $newval < $val); } for ($val=67108864; $val <= 268435456; $val += 131072) { $newval=$val if ($newval >= $val-65536 && $newval < $val); } return($newval); } sub check_dmidecode_ver { $tmp=shift; @dmidecode_verarr=split(/\./, $dmidecode_ver); if (defined($tmp)) { @latest_dmidecode_verarr=split(/\./, $latest_dmidecode_ver); if (($dmidecode_verarr[0] < $latest_dmidecode_verarr[0]) || ($dmidecode_verarr[0] == $latest_dmidecode_verarr[0] && $dmidecode_verarr[1] < $latest_dmidecode_verarr[1])) { print " Your dmidecode package is an old version"; print " ($dmidecode_ver)" if ($dmidecode_ver); print ", so consider upgrading\n"; print " to dmidecode-$latest_dmidecode_ver or later.\n"; } elsif ($dmidecode_ver) { print " Your dmidecode version is $dmidecode_ver.\n" if (defined($tmp)); } } @minimum_dmidecode_verarr=split(/\./, $minimum_dmidecode_ver); if (($dmidecode_verarr[0] < $minimum_dmidecode_verarr[0]) || ($dmidecode_verarr[0] == $minimum_dmidecode_verarr[0] && $dmidecode_verarr[1] < $minimum_dmidecode_verarr[1])) { return 1; } else { return 0; } } sub check_free { return if ($free_checked); &pdebug("in check_free"); $free_checked=1; if (! $filename && $free_cmd) { # Check memory detected by OS @free=&run("$free_cmd"); $have_free_data=1; } if (! $filename && $meminfo_cmd) { # Check memory detected by kernel @meminfo=&run("$meminfo_cmd"); $have_meminfo_data=1; } if ($have_meminfo_data) { foreach $line (@meminfo) { $line=&dos2unix($line); if ($line =~ /MemTotal:\s+\d+ kB/) { @linearr=split(' ', $line); $freephys=int($linearr[1] / 1024); $totmem=&roundup_memory($freephys) if ($totmem == 0); last; } } } if ($have_free_data && ! $freephys) { foreach $line (@free) { $line=&dos2unix($line); if ($line =~ /Mem:/) { @linearr=split(' ', $line); $freephys=$linearr[1]; $totmem=&roundup_memory($freephys) if ($totmem == 0); last; } } } } sub check_for_decodedimms { return if (&is_virtualmachine); # Need root permissions to load eeprom kernel module return if ($uid ne "0" && ! $filename); &pdebug("in check_for_decodedimms"); if (! $filename && $decodedimms_cmd) { $flag=1; # Some systems lockup when loading eeprom module, avoid them # Avoid running on systems with PIIX4 like Dell PowerEdge 2650 @tmp=&run("/sbin/modprobe i2c_dev"); @tmp=&run("/usr/sbin/i2cdetect -l | grep -w PIIX4"); $flag=0 if (@tmp); # See if eeprom module is already loaded in kernel @tmp=&run("/sbin/lsmod | grep -w eeprom"); $flag=2 if (@tmp); if ($flag) { # Check memory SPD data from EEPROM @tmp=&run("$modprobe_eeprom_cmd") if ($flag == 1); @decodedimms=&run("$decodedimms_cmd"); $have_decodedimms_data=1; } } } sub check_topology { # Stoutland Platform (SGI Blade Chassis) topology command return if (&is_virtualmachine); &pdebug("in check_topology"); if ($filename) { @topology=@config; } else { @topology=&run("$topology_cmd"); } $flag_mem=0; $partition_cnt=0; foreach (@topology) { $_=&dos2unix($_); $_=&mychomp($_); if (/^System type: /) { push(@topology_header, "$_\n"); $topology_mfg="SGI.COM" if (/ UV/); } if (/^Serial number: /) { push(@topology_header, "$_\n"); $topology_mfg="SGI.COM" if (/ UV/); } if (/^Partition number: /) { push(@topology_header, "$_\n"); $partition_cnt++; } push(@topology_header, "$_\n") if (/^\s*\d+ Blades$/); push(@topology_header, "$_\n") if (/^\s*\d+ CPUs$/); push(@topology_header, "$_\n") if (/^\s*\d+.* GB Memory Total/i); push(@topology_header, "$_\n") if (/^\s*\d+.* GB Max Memory.*/i); $flag_mem=1 if (/(Idx|Index)\s.*\sNASID\s+CPUS\s+Memory/); $flag_mem=0 if (/^\s*$/); push(@topology_data, "$_\n") if ($flag_mem); } } sub check_decodedimms { return if ($decodedimms_checked); return if (&is_virtualmachine); &pdebug("in check_decodedimms"); $decodedimms_checked=1; # TLS - uncomment to not use decode-dimms.pl data - 19-Apr-2012 # $have_decodedimms_data=0; # TLS - If decode-dimms.pl is not available, suggest that it can be installed # with lmsensors to get more detailed memory information. if ($have_decodedimms_data) { $flag_mem=0; $flag_unknown=0; $mem_mfg=""; $pn=""; $simmsize=0; $memtype=""; $dimmspeed=""; $cnt=0; foreach $line (@decodedimms) { $line=&dos2unix($line); $line=&mychomp($line); if ($line =~ /^Guessing DIMM is in/i) { $tmp=$line; $tmp=~s/^.*\s+(\d+)\s*$/$1/; $cnt=($tmp - 1) if ($tmp); $flag_mem=1; } $flag_mem=0 if ($line =~ /^(Decoding EEPROM|EEPROM Checksum of bytes.*Bad|Number of SDRAM DIMMs detected and decoded)/i); if ($flag_mem) { if ($line =~ /^Fundamental Memory type/i) { # Required data from SPD EEPROM $memtype=$line; $memtype=~s/^Fundamental Memory type\s+(.*\S)\s*$/ $1/; &pdebug("in check_decodedimms, cnt=$cnt, memtype=$memtype"); $flag_unknown=($memtype =~ /^ *Unknown/i) ? 1 : 0; if ($flag_unknown) { &pdebug("in check_decodedimms, cnt=$cnt, Unknown memtype detected - failing DIMM"); } } if ($line =~ /^Maximum module speed/i) { $dimmspeed=$line; $dimmspeed=~s/^Maximum module speed\s+\D+\s+(.*\S)\s*$/ $1/; &check_mixedspeeds($dimmspeed); &pdebug("in check_decodedimms, cnt=$cnt, dimmspeed=$dimmspeed"); } $simmsize=$sizearr[$cnt] if (defined($sizearr[$cnt]) && ! $simmsize); if ($line =~ /^Size\s+.*MB/i) { $simmsize=$line; $simmsize=~s/^Size\s+(\d+)\s*MB.*$/$1/; &pdebug("in check_decodedimms, cnt=$cnt, simmsize=$simmsize"); } if ($line =~ /^Manufacturer\s+/i) { $mem_mfg=$line; $mem_mfg=~s/^Manufacturer\s+(.*\S)\s*$/ $1/; $mem_mfg=&get_mfg($mem_mfg); $mem_mfg="" if ($mem_mfg =~ /^\s+(FFFFFFFFFFFF|000000000000|Undefined)/i); $mem_mfg=" $mem_mfg" if ($mem_mfg); &pdebug("in check_decodedimms, cnt=$cnt, mem_mfg=$mem_mfg"); } if ($line =~ /^Part Number\s+/i) { $pn=$line; $pn=~s/^Part Number\s+(.*\S)\s*$/ $1/; $pn="" if ($pn =~ /^\s+(FFFFFFFFFFFF|000000000000|Undefined)/i); &pdebug("in check_decodedimms, cnt=$cnt, pn=$pn"); } } elsif ($simmsize && $memtype) { if ($reorder_decodedimms[$cnt]) { $tmp=$reorder_decodedimms[$cnt]-1; &pdebug("in check_decodedimms, reorder cnt=$tmp"); } else { $tmp=$cnt; } if (defined($socketlabelarr[$tmp])) { $socket=$socketlabelarr[$tmp]; $offset=-1; $incr=0; foreach (@boards_mem) { if (/\b$socket\b/) { if ($MemPartNum[$incr-1]) { # make sure pn matches $offset=$incr if (" $MemPartNum[$incr-1]" eq "$pn"); } else { $offset=$incr; } } $incr++; } if ($offset >= 0) { ($old)=grep(/$socket/,@boards_mem); chop($old); if ($flag_unknown) { $tmp="$old - FAILING"; $failing_memory=1; } else { $tmp="$socket: ${simmsize}MB$dimmspeed$memtype"; $tmp .= ",$mem_mfg$pn" if ($mem_mfg || $pn); } @tmp=("$tmp\n"); # Replace socket data from dmidecode # with socket data from decode-dimms.pl &pdebug("in check_decodedimms, replace socket data '$old' with '$tmp'"); splice(@boards_mem, $offset, 1, @tmp); $memfrom="decode-dimms.pl" if ($memfrom !~ /decode-dimms.pl/); } } else { $memfrom="dmidecode and decode-dimms.pl"; } $mem_mfg=""; $pn=""; $simmsize=0; $memtype=""; $dimmspeed=""; $cnt++; } } } } sub check_dmidecode { &pdebug("in check_dmidecode"); $DMI6=0; $DMI6cnt=0; $DMI6totmem=0; $DMI17=0; $DMI17totmem=0; $DMI17end=0; $DMItype=0; $platform=""; $FoundEnd=0; $BrokenTable=""; $unknown_JEDEC_ID=0; $ECCDIMM=0; $config_command="dmidecode"; if ($filename) { $DmiFile="<$filename"; } else { $DmiFile="$config_cmd 2>&1 |"; &linux_distro if (! $release); if ($ipmitool_cmd && ! $have_ipmitool_data) { @ipmitool=&run("$ipmitool_cmd fru"); $have_ipmitool_data=1; } } $cpu_membank=-1; $physmemarray=""; $memfrom="dmidecode"; &check_for_decodedimms; &check_topology; open(FILE, $DmiFile); while(<FILE>) { next if (/(<OUT OF SPEC>| Unknown|: Other|: \.\.|: Not Specified|:\s*$)/i); # for regression tests $have_decodedimms_data=1 if (/^Guessing DIMM is in/i); ($dmidecode_ver)=(/.* dmidecode (.*)/i) if (/ dmidecode /i); ($permission_error)=(/(.*)/) if (/Permission denied/i); ($dmidecode_error)=(/# *(.*)/) if (/No SMBIOS nor DMI entry point found/i && ! &is_xen_vm); # Detect end of DMI type 17 blocks # &pdebug("In DMI type 17, $_") if ($DMItype == 17); if (/(^Handle|^\s*$)/i && $DMItype == 17 && $memarr >= 0 && ! $DMI17end) { $DMI17end=1; $DMItype=0; # Ignore Flash chips for DMI17totmem $Size17[$memarr]=0 if (! defined($Size17[$memarr])); $Type17[$memarr]="" if (! defined($Type17[$memarr])); &pdebug("End of DMI type 17 block, $Size17[$memarr] $Type17[$memarr] detected") if ($Type17[$memarr] =~ /Flash/i); if ($Size17[$memarr] !~ /Not Installed/i && $Size17[$memarr] !~ /No Module Installed/i && $Type17[$memarr] !~ /Flash/i) { &pdebug("End of DMI type 17 block, adding $Size17[$memarr] memory to total"); $simmsize=$Size17[$memarr]; if ($simmsize =~ / *GB.*/i) { $simmsize=~s/ *GB.*//ig; $simmsize *= 1024; } else { $simmsize=~s/ *MB.*//ig; } $DMI17totmem += $simmsize if ($simmsize); } } ($DMItype)=(/DMI type (\d+)/i) if (/\bDMI type /i); if (/Handle .* DMI type 16,/i) { ($tmp)=(/Handle (.*), DMI type 16,/i); $cpu_membank++ if ($physmemarray ne $tmp); $physmemarray=$tmp; } $DMI17end=0 if ($DMItype != 17); # Type Information # ---------------------------------------- # 0 BIOS # 1 System # 2 Base Board # 3 Chassis # 4 Processor # 5 Memory Controller # 6 Memory Module # 7 Cache # 8 Port Connector # 9 System Slots # 10 On Board Devices # 11 OEM Strings # 12 System Configuration Options # 13 BIOS Language # 14 Group Associations # 15 System Event Log # 16 Physical Memory Array # 17 Memory Device # 18 32-bit Memory Error # 19 Memory Array Mapped Address # 20 Memory Device Mapped Address # 21 Built-in Pointing Device # 22 Portable Battery # 23 System Reset # 24 Hardware Security # 25 System Power Controls # 26 Voltage Probe # 27 Cooling Device # 28 Temperature Probe # 29 Electrical Current Probe # 30 Out-of-band Remote Access # 31 Boot Integrity Services # 32 System Boot # 33 64-bit Memory Error # 34 Management Device # 35 Management Device Component # 36 Management Device Threshold Data # 37 Memory Channel # 38 IPMI Device # 39 Power Supply # 40 Additional Information # 41 Onboard Device # Additionally, type 126 is used for disabled entries and type # 127 is an end-of-table marker. Types 128 to 255 are for # OEM-specific data. # Keep walking the dmidecode output for more about the system # Check system information if ($DMItype == 0) { ($biosvendor)=(/: +(.*\S) *$/) if (/^\s*Vendor: /i); } if ($DMItype == 1) { ($systemmanufacturer)=(/: +(.*\S) *$/) if (/^\s*(Manufacturer|Vendor): /i); ($systemmodel)=(/: +(.*\S) *$/) if (/^\s*Product( Name|): /i); } if ($DMItype == 2) { ($boardmanufacturer)=(/: +(.*\S) *$/) if (/^\s*(Manufacturer|Vendor): /i); ($boardmodel)=(/: +(.*\S) *$/) if (/^\s*Product( Name|): /i); $boardmodel=~s/^$boardmanufacturer // if ($boardmanufacturer && $boardmodel); # use DMItype2 manufacturer if Oracle (for VirtualBox) ($systemmanufacturer)=(/: +(.*\S) *$/) if (/^\s*(Manufacturer|Vendor): *Oracle */i); } # Check CPU information if ($DMItype == 4) { if (/^\s*Processor( Information|)$/i) { $cpuarr++; $ncpu++; } if (/^\s*Socket Designation: /i) { ($CPUSocketDesignation[$cpuarr])=(/: +(.*\S) *$/); $CPUSocketDesignation[$cpuarr]="CPU $cpuarr" if ($CPUSocketDesignation[$cpuarr] eq "Microprocessor"); } ($CPUFamily[$cpuarr])=(/: +(.*\S) *$/) if (/^\s*(Processor |)Family: /i); if (/^\s*(Processor |)Manufacturer: /i) { ($CPUManufacturer[$cpuarr])=(/: +(.*\S) *$/); $CPUManufacturer[$cpuarr]=~s/GenuineIntel/Intel/; } ($CPUVersion[$cpuarr])=(/: +(.*\S) *$/) if (/^\s*(Processor |)Version: /i); ($ExtSpeed[$cpuarr])=(/: +(.*\S) *$/) if (/^\s*External Clock: /i); ($CPUSpeed[$cpuarr])=(/: +(.*\S) *$/) if (/^\s*Current Speed: /i); if (/^\s*Status: /i) { ($CPUStatus[$cpuarr])=(/: +(.*\S) *$/); if ($CPUStatus[$cpuarr] =~ /(Unpopulated|Disabled By BIOS)/i) { $ncpu--; $necpu++; $CPUVersion[$cpuarr]=""; } } } # Check memory controller information if ($DMItype == 5) { ($ECCBIOS)=(/: +(.*\S) *$/) if (/^\s*Error Detecting Method: /i && ! $ECCBIOS); ($interleave)=(/: +(.*\S) *$/) if (/^\s*Current Interleave: /i && $interleave eq "0"); ($MAXMEM)=(/: +(.*\S) *$/) if (/^\s*Maximum Total Memory Size: /i && ! $MAXMEM); } # Check each memory device if ($DMItype == 6) { $DMI6=1; $memarr++ if (/^\s*Memory (Module Information|Bank)$/i); ($Locator6[$memarr])=(/: +(.*\S) *$/) if (/^\s*Socket( Designation|): /i); ($Speed6[$memarr])=(/: +(.*\S) *$/) if (/^\s*Current Speed: /i); ($Type6[$memarr])=(/: +(.*\S) *$/) if (/^\s*Type: /i); if (/^\s*Installed Size: /i) { ($Size6[$memarr])=(/: +(.*\S) *$/); if ($Size6[$memarr] !~ /Not Installed/i && $Size6[$memarr] !~ /No Module Installed/i) { $simmsize=$Size6[$memarr]; $simmsize=~s/ *MB.*//ig; $DMI6totmem += $simmsize if ($simmsize); $SizeDetail[$memarr]=$Size6[$memarr]; $Size6[$memarr]=$simmsize . "MB"; $SizeDetail[$memarr]=~s/\d+ *MBy*t*e* *//i; } } ($BankConnections6[$memarr])=(/: +(.*\S) *$/) if (/^\s*Bank Connections: /i); $DMI6cnt=$memarr + 1; } # SMBIOS 2.1 added DMI Types 16 & 17, obsoleting Types 5 & 6 # Check physical memory array if ($DMItype == 16) { ($ECCBIOS)=(/: +(.*\S) *$/) if (/^\s*Error Correction Type: /i && ! $ECCBIOS); ($MAXMEM)=(/: +(.*\S) *$/) if (/^\s*Maximum Capacity: /i && ! $MAXMEM); ($NUMMOD)=(/: +(.*\S) *$/) if (/^\s*Number Of Devices: /i && ! $NUMMOD); } # Check each memory device if ($DMItype == 17) { if ($DMI6) { # Prefer DMI type 17 information over DMI type 6 $memarr=-1 if (! $DMI17); } $DMI17=1; $memarr++ if (/^\s*Memory Device$/i); ($FormFactor[$memarr])=(/: +(.*\S) *$/) if (/^\s*Form Factor: /i); ($TotalWidth[$memarr])=(/: +(\d*) */) if (/^\s*Total Width: /i); ($DataWidth[$memarr])=(/: +(\d*) */) if (/^\s*Data Width: /i); if (/^\s*Locator: /i) { ($Locator17[$memarr])=(/: +(.*\S) *$/); $Locator17[$memarr]=~s/ */ /g; # Add CPU to X4170/X4270/X4275/X6270/X6275 if ($systemmodel =~ /Sun .*X(4[12]7[05]|627[05])\b/i && $Locator17[$memarr] !~ /CPU/) { $cpu_number=$CPUSocketDesignation[$cpu_membank]; $cpu_number=~s/\s*//g; $Locator17[$memarr]="${cpu_number}_$Locator17[$memarr]"; } } ($BankLocator[$memarr])=(/: +(.*\S) *$/) if (/^\s*Bank Locator: /i); ($Type17[$memarr])=(/: +(.*\S) *$/) if (/^\s*Type: /i); ($TypeDetail[$memarr])=(/: +(.*\S) *$/) if (/^\s*Type Detail: /i); ($Size17[$memarr])=(/: +(.*\S) *$/) if (/^\s*Size: /i); ($Speed17[$memarr])=(/: +(.*\S) *$/) if (/^\s*Speed: /i); ($MemManufacturer[$memarr])=&get_mfg(/: +(.*\S) *$/) if (/^\s*Manufacturer: /i && $Size17[$memarr] =~ /( MB|GB)/); if (/^\s*Part Number: /i && ! /PartNum/i && ! /NOT AVAILABLE/i) { ($MemPartNum[$memarr])=(/: +(.*\S) *$/); $MemPartNum[$memarr]=&hex2ascii($MemPartNum[$memarr]); # Hack: Ballistic modules may have mfg Undefined $MemManufacturer[$memarr]="Crucial Technology" if (! $MemManufacturer[$memarr] && $MemPartNum[$memarr] =~ /^BL/); } } $BrokenTable=&mychomp($_) if (/DMI table is broken/i); $FoundEnd=1 if (/End.Of.Table/i); } close(FILE); # Determine best manufacturer and model to display (or both) from # DMI type 1 (System) or DMI type 2 (Base Board) $baseboard="$boardmanufacturer $boardmodel" if ("$boardmanufacturer$boardmodel" ne ""); $baseboard="" if ($boardmanufacturer eq $systemmanufacturer && ($boardmodel eq $systemmodel || $boardmodel eq "")); if ($systemmanufacturer) { $manufacturer=$systemmanufacturer; } else { $manufacturer=$boardmanufacturer; $baseboard=""; } if ($systemmodel) { $model=$systemmodel; } else { $model=$boardmodel; } if ($manufacturer =~ /To Be Filled|System Manufacturer/i) { $manufacturer=$boardmanufacturer; $baseboard=""; } if ($model =~ /To Be Filled|System .*Name|XXXX/i) { $model=$boardmodel; $baseboard=""; } $baseboard="" if (&is_virtualmachine); # Check kernel to see how many processors it sees (for multi-core and # hyper-threaded CPUs) &check_cpuinfo; # Check Xen hardware for processors it sees (for multi-core and # hyper-threaded CPUs) &check_xm_info; # Check topology for manufacturer $manufacturer=$topology_mfg if ($topology_mfg); # Check Xenstore for manufacturer and model if not known if (&is_xen_vm && ! -f $filename && -x '/usr/bin/xenstore-ls' && -x '/usr/bin/xenstore-read') { $domid=&mychomp(`/usr/bin/xenstore-read domid 2>/dev/null`); if ($domid) { @xenstore=`/usr/bin/xenstore-ls /local/domain/$domid 2>/dev/null`; foreach (@xenstore) { if ($manufacturer eq "" && /\bsystem-manufacturer = */) { ($manufacturer)=(/= *"(.*)"$/); } if ($model eq "" && /\bsystem-product-name = */) { ($model)=(/= *"(.*)"$/); } } } } # hash CPUs $range=$ncpu; # Only display allocated CPUs on Virtual Machines $range=$cpuinfo_cpucnt if ($cpuinfo_cpucnt && &is_virtualmachine); for ($val=0; $val < $range; $val++) { $cputype=""; $cpufreq=""; if ($CPUVersion[$val]) { if ($CPUVersion[$val] eq "AMD" && $cpuinfo_cputype && ! &is_virtualmachine) { $cputype .= "$CPUManufacturer[$val] " if ($CPUManufacturer[$val] && $cpuinfo_cputype !~ /$CPUManufacturer[$val]/i); &pdebug("Adding AMD \$cpuinfo_cputype=$cpuinfo_cputype to cputype"); $cputype .= "$cpuinfo_cputype "; } else { $cputype .= "$CPUManufacturer[$val] " if ($CPUManufacturer[$val] && $CPUVersion[$val] !~ /$CPUManufacturer[$val]/i); $CPUVersion[$val]=&cleanup_cputype($CPUVersion[$val]); &pdebug("Adding \$CPUVersion[$val]=$CPUVersion[$val] to cputype"); $cputype .= "$CPUVersion[$val] "; } } elsif ($cpuinfo_cputype && ! &is_virtualmachine) { if ($CPUManufacturer[$val]) { $cputype .= "$CPUManufacturer[$val] " if ($cpuinfo_cputype !~ /$CPUManufacturer[$val]/i); } &pdebug("Adding \$cpuinfo_cputype=$cpuinfo_cputype to cputype"); $cputype .= "$cpuinfo_cputype "; } else { $cputype .= "$CPUManufacturer[$val] " if ($CPUManufacturer[$val]); $cputype .= "$CPUFamily[$val] " if ($CPUFamily[$val]); } if (! $machine && $CPUFamily[$val]) { $machine="ia64" if ($CPUFamily[$val] eq "Itanium"); } $cputype=~s/^\s+//; $cputype=~s/\s+$//; $cputype=~s/ +/ /g; if ($ncpu < $cpuinfo_cpucnt && $cpuinfo_cpucnt && $foundGenuineIntel) { # Distinguish Multi-Core from hyper-threading if ($cpuinfo_cpucores && $cpuinfo_physicalidcnt && $cpuinfo_cpucnt) { if ($cpuinfo_cpucnt / ($cpuinfo_cpucores * $cpuinfo_physicalidcnt) == 2) { $hyperthread=1; $ncpu=$cpuinfo_physicalidcnt; $range=$ncpu; # Adjust the range of this "for" loop &pdebug("hyperthread=1: from cpuinfo physical id, ncpu=$ncpu, cpuinfo_cpucnt=$cpuinfo_cpucnt, cpuinfo_physicalidcnt=$cpuinfo_physicalidcnt, cpuinfo_cpucores=$cpuinfo_cpucores, cputype=$cputype"); } } elsif ($cpuinfo_cpucores && $cpuinfo_coreidcnt > 1) { if ($cpuinfo_coreidcnt != $ncpu * $cpuinfo_cpucores) { if ($cpuinfo_cpucnt == $cpuinfo_coreidcnt && $cpuinfo_cpucores == 1 && $cpuinfo_cpucnt / $ncpu > 2) { $cpuinfo_cpucores=$cpuinfo_cpucnt / $ncpu; } else { $hyperthread=1; &pdebug("hyperthread=1: from cpuinfo, cputype=$cputype"); } } elsif ($cpuinfo_siblings) { if ($cpuinfo_coreidcnt / ($ncpu * $cpuinfo_siblings) == 2) { $hyperthread=1; &pdebug("hyperthread=1: from cpuinfo siblings, ncpu=$ncpu, cpuinfo_cpucnt=$cpuinfo_cpucnt, cpuinfo_coreidcnt=$cpuinfo_coreidcnt, cpuinfo_siblings=$cpuinfo_siblings, cputype=$cputype"); } } } elsif ($cpuinfo_siblings && ! ($cpuinfo_cpucores == 0 && $cputype =~ /Pentium.* 4\b/)) { if ($cpuinfo_cpucores == 0 && $cpuinfo_cpucnt / $cpuinfo_siblings == 2) { $hyperthread=1; if ($cpuinfo_physicalidcnt) { $ncpu=$cpuinfo_physicalidcnt; $cpuinfo_cpucores=$cpuinfo_cpucnt / $cpuinfo_physicalidcnt / 2; $range=$ncpu; # Adjust the range of this "for" loop &pdebug("hyperthread=1: from cpuinfo physical id, ncpu=$ncpu, cpuinfo_cpucnt=$cpuinfo_cpucnt, cpuinfo_physicalidcnt=$cpuinfo_physicalidcnt, cpuinfo_siblings=$cpuinfo_siblings, cputype=$cputype"); } else { &pdebug("hyperthread=1: from cpuinfo siblings, ncpu=$ncpu, cpuinfo_cpucnt=$cpuinfo_cpucnt, cpuinfo_physicalidcnt=$cpuinfo_physicalidcnt, cpuinfo_siblings=$cpuinfo_siblings, cputype=$cputype"); } } } elsif ($cpuinfo_cpucores == 0 && $cputype =~ /Pentium.* 4\b/) { # Can't tell RHEL3 Hyper-Threaded Pentium 4 # from Dual-Core Pentium D $hyperthread=1; &pdebug("hyperthread=1: hack in cpuinfo, cputype=$cputype"); } if ($xen_cores_per_socket) { $cputype=&multicore_cputype($cputype,$xen_cores_per_socket); } elsif ($cpuinfo_cpucores) { $cputype=&multicore_cputype($cputype,$cpuinfo_cpucores); } elsif ($hyperthread && $cpuinfo_siblings) { $cputype=&multicore_cputype($cputype,$cpuinfo_physicalidcnt); } else { $cputype=&multicore_cputype($cputype,$cpuinfo_cpucnt / $ncpu); } } if ($CPUSpeed[$val]) { $cpufreq="$CPUSpeed[$val]"; $cpufreq=~s/ *MHz$//; $CPUSpeed[$val]=~s/ *MHz$/MHz/; } &x86multicorecnt($cputype); $cpucnt{"$cputype $cpufreq"}++ if (! $xen_ncpu || $val < $xen_ncpu); $cpucntfrom="dmidecode" if ($cpucntfrom !~ /cpuinfo/ && $cpucntfrom ne "xm_info"); $ExtSpeed[$val]=~s/ *MHz$/MHz/ if ($ExtSpeed[$val]); } @cputypecnt=keys(%cpucnt); $x=0; while (($cf,$cnt)=each(%cpucnt)) { $x++; $cf=~/^(.*) (\d*)$/; $ctype=$1; $cfreq=$2; if ($cpucntflag == 0 && $cpucntfrom !~ /cpuinfo/ && $cpucntfrom ne "xm_info") { for $tmp (2,3,4,6,8,10,12,16) { $cnt /= $tmp if ($corecnt == $tmp && $cnt % $tmp == 0); } $cpucntflag=1; } $ctype="" if ($ctype =~ /^\S*-Core $/); if ($ctype) { $ctype=&multicore_cputype($ctype,$corecnt) if (&is_xen_hv); $cpubanner .= "$cnt X " if ($cnt > 1); $cpubanner .= "$ctype"; $cpubanner .= " ${cfreq}MHz" if ($cfreq && $ctype !~ /Hz$/); $cpubanner .= ", " if ($x < scalar(@cputypecnt)); } } if (&is_virtualmachine && $cpubanner eq "") { $cpubanner .= "$cpuinfo_cpucnt X " if ($cpuinfo_cpucnt > 1); $_=$cpuinfo_cputype; ($vcpu_type)=(/^(\w*)/); ($vcpu_freq)=(/(\d[\d\.]*[GM]Hz)/); $cpubanner .= "$vcpu_type $vcpu_freq"; } $machine="x86" if (! $machine); &x86_devname; # # Print information # &show_header; if (@topology_data) { print @topology_header; print @topology_data; $untested=0 if ($partition_cnt == 1 && $topology_mfg); # SGI UV $totmem=$installed_memory; &finish; &pdebug("exit"); exit; } # CPU information if ($verbose) { print "WARNING: CPU Information Unknown\n" if ($cpuarr < 0 && $cpucntfrom !~ /cpuinfo/); $range=$cpuarr; $range=$cpuinfo_cpucnt - 1 if ($cpucntfrom =~ /cpuinfo/ && ! $permission_error && &is_virtualmachine); # Second CPU doesn't exist on W1100z $range=0 if ($model =~ /W1100z\b/i); # Third & fourth CPUs don't exist on Ultra 40 $range=1 if ($familypn eq "A71"); for ($cnt=0; $cnt <= $range; $cnt++) { # Only display allocated CPUs on Virtual Machines next if ($CPUStatus[$cnt] && &is_virtualmachine && $CPUStatus[$cnt] =~ /(Unpopulated|Disabled By BIOS)/i); if ($CPUSocketDesignation[$cnt]) { print "$CPUSocketDesignation[$cnt]: "; } else { print "v" if (&is_virtualmachine); print "CPU $cnt: "; } if ($cpucntfrom =~ /cpuinfo/ && &is_virtualmachine) { $_=$cpuinfo_cputype; ($vcpu_type)=(/^(\w*)/); ($vcpu_freq)=(/(\d[\d\.]*[GM]Hz)/); print "$vcpu_type $vcpu_freq cpu\n"; next; } if ($CPUStatus[$cnt]) { if ($CPUStatus[$cnt] =~ /(Unpopulated|Disabled By BIOS)/i) { print "$CPUStatus[$cnt]\n"; next; } } $ctype=""; if ($CPUVersion[$cnt]) { $ctype .= "$CPUManufacturer[$cnt] " if ($CPUManufacturer[$cnt] && $CPUVersion[$cnt] !~ /$CPUManufacturer[$cnt]/i); $ctype .= "$CPUVersion[$cnt] "; } else { $ctype .= "$CPUManufacturer[$cnt] " if ($CPUManufacturer[$cnt]); $ctype .= "$CPUFamily[$cnt] " if ($CPUFamily[$cnt]); } $ctype=~s/ +/ /g; print "$ctype"; if ($CPUSpeed[$cnt]) { print "$CPUSpeed[$cnt] " if ($ctype !~ /Hz $/); } print "cpu"; print ", system freq: $ExtSpeed[$cnt]" if ($ExtSpeed[$cnt]); print "\n"; } } if ($ncpu > 1 && $foundGenuineIntel && $cpucntfrom =~ /cpuinfo/ && ! $permission_error && ! &is_xen_vm) { print "WARNING: Cannot detect if Hyper-Threading is enabled, "; print "CPU count may be half of\n what is shown if "; print "Hyper-Threading is enabled.\n"; } # Memory information if ($permission_error) { print "ERROR: $permission_error\n"; print " This user does not have permission to run $config_command.\n"; print " Try running memconf as a privileged user like root.\n" if ($uid ne "0"); &pdebug("exit 1"); exit 1; } $max=0; if ($MAXMEM) { if ($MAXMEM =~ /\d+ MB/) { $max=$MAXMEM; $max=~s/ MB//g; } elsif ($MAXMEM =~ /\d+ GB/) { $max=$MAXMEM; $max=~s/ GB//g; $max *= 1024; } elsif ($MAXMEM =~ /\d+ TB/) { $max=$MAXMEM; $max=~s/ TB//g; $max *= $meg; } } $DMItypeshown=0; $memarr=3 if ($model =~ /W1100z\b/i); # DIMM5-DIMM8 don't exist on W1100z for ($cnt=0; $cnt <= $memarr; $cnt++) { $buf=""; # Prefer DMI type 17 information over DMI type 6 $DMI=17; $DMI=6 if ($DMI6 && ! $DMI17); # Prefer DMI type 6 information if DMI type 6 reports different # total memory than DMI type 17 (BIOS bug) $DMI=6 if ($DMI6 && $DMI17 && $DMI6totmem > $DMI17totmem && &roundup_memory($freephys) == $DMI6totmem && ! &is_virtualmachine); &pdebug("using DMI type $DMI data for memory: DMI6totmem=$DMI6totmem, DMI17totmem=$DMI17totmem") if (! $DMItypeshown); $DMItypeshown=1; if ($DMI == 6) { next if (! $Size6[$cnt]); if ($Type6[$cnt]) {next if ($Type6[$cnt] =~ /Flash/i);} if (defined($Locator6[$cnt]) && defined($BankLocator[$cnt])) { $BankLocator[$cnt]="" if ($Locator6[$cnt] eq $BankLocator[$cnt]); if ($Locator6[$cnt] =~ /:/ && $BankLocator[$cnt] =~ /:/) { $Loc1=$Locator6[$cnt]; $Loc1=~s/.*://; $Loc2=$BankLocator[$cnt]; $Loc2=~s/.*://; $Locator6[$cnt]=~s/:.*// if ($Loc1 eq $Loc2); } } if ($#socketstr && ! $have_decodedimms_data) { $socketlabelarr[$cnt]="$socketstr[$cnt]"; } else { $socketlabelarr[$cnt]=$Locator6[$cnt]; } if ($Size6[$cnt] =~ /Not Installed|No Module Installed|^0 *MB.*/i) { &add_to_sockets_empty($socketlabelarr[$cnt]); } else { $buf="$socketlabelarr[$cnt]"; $simmsize=$Size6[$cnt]; $simmsize=~s/ *MB.*//ig; $sizearr[$cnt]=$simmsize; $Size6[$cnt]=~s/MByte/ MB/ig; $Size6[$cnt]=~s/ +MB/MB/g; if (defined($BankConnections6[$cnt])) { if ($Locator6[$cnt] =~ /BANK *\d/i && $BankConnections6[$cnt] =~ / /) { $tmp=$simmsize / 2; $buf .= ": 2 X ${tmp}MB"; } else { $buf .= ": $Size6[$cnt]"; } } else { $buf .= ": $Size6[$cnt]"; } $buf .= " $SizeDetail[$cnt]" if ($SizeDetail[$cnt]); if ($Speed6[$cnt]) { $Speed6[$cnt]=~s/ +MHz/MHz/; $Speed6[$cnt]=~s/ +ns/ns/; $buf .= " $Speed6[$cnt]"; &check_mixedspeeds($Speed6[$cnt]); } elsif ($Speed17[$cnt]) { $Speed17[$cnt]=~s/ +MHz/MHz/; $Speed17[$cnt]=~s/ +ns/ns/; $buf .= " $Speed17[$cnt]"; &check_mixedspeeds($Speed17[$cnt]); } if ($TypeDetail[$cnt]) { $buf .= " $TypeDetail[$cnt]" if ($TypeDetail[$cnt] !~ /None/i); } if ($FormFactor[$cnt] && defined($Type17[$cnt])) { $buf .= " $Type17[$cnt]"; $buf .= " $FormFactor[$cnt]" if ($Type17[$cnt] !~ /$FormFactor[$cnt]/); } elsif ($Type6[$cnt]) { $buf .= " $Type6[$cnt]"; } if ($MemManufacturer[$cnt]) { $buf .= ", $MemManufacturer[$cnt]" if ($MemManufacturer[$cnt] !~ /None/i); if ($MemPartNum[$cnt]) { $buf .= " $MemPartNum[$cnt]" if ($MemPartNum[$cnt] !~ /None/i); } } elsif ($MemPartNum[$cnt]) { $buf .= ", $MemPartNum[$cnt]" if ($MemPartNum[$cnt] !~ /None/i); } } $totmem=$DMI6totmem; } else { next if (! $Size17[$cnt]); if ($Type17[$cnt]) {next if ($Type17[$cnt] =~ /Flash/i);} if (defined($Locator17[$cnt]) && defined($BankLocator[$cnt])) { $BankLocator[$cnt]="" if ($Locator17[$cnt] eq $BankLocator[$cnt]); if ($Locator17[$cnt] =~ /:/ && $BankLocator[$cnt] =~ /:/) { $Loc1=$Locator17[$cnt]; $Loc1=~s/.*://; $Loc2=$BankLocator[$cnt]; $Loc2=~s/.*://; $Locator17[$cnt]=~s/:.*// if ($Loc1 eq $Loc2); } } if ($BankLocator[$cnt]) { $bank_label="$BankLocator[$cnt]"; # Don't include bank label if memory label also # includes the CPU $bank_label="" if ($Locator17[$cnt] =~ /CPU/ && $BankLocator[$cnt] =~ /\/P\d+$/); } if ($#socketstr && ! $have_decodedimms_data) { $socketlabelarr[$cnt]="$socketstr[$cnt]"; } else { $socketlabelarr[$cnt]=$Locator17[$cnt]; $socketlabelarr[$cnt] .= " $bank_label" if ($bank_label); } if ($Size17[$cnt] =~ /Not Installed|No Module Installed|^0 *MB.*/i) { &add_to_sockets_empty($socketlabelarr[$cnt]); } else { $buf="$socketlabelarr[$cnt]"; $simmsize=$Size17[$cnt]; if ($simmsize =~ / *GB.*/i) { $simmsize=~s/ *GB.*//ig; $simmsize *= 1024; } else { $simmsize=~s/ *MB.*//ig; } $sizearr[$cnt]=$simmsize; $Size17[$cnt]=~s/MByte/ MB/ig; $Size17[$cnt]=~s/ +MB/MB/g; $buf .= ": $Size17[$cnt]"; $buf .= " $SizeDetail[$cnt]" if ($SizeDetail[$cnt]); if ($Speed17[$cnt]) { $Speed17[$cnt]=~s/ +MHz/MHz/; $Speed17[$cnt]=~s/ +ns/ns/; $buf .= " $Speed17[$cnt]"; &check_mixedspeeds($Speed17[$cnt]); } elsif ($Speed6[$cnt]) { $Speed6[$cnt]=~s/ +MHz/MHz/; $Speed6[$cnt]=~s/ +ns/ns/; $buf .= " $Speed6[$cnt]"; &check_mixedspeeds($Speed6[$cnt]); } if ($TypeDetail[$cnt]) { $buf .= " $TypeDetail[$cnt]" if ($TypeDetail[$cnt] !~ /None/i); } $buf .= " $Type17[$cnt]" if ($Type17[$cnt]); if ($FormFactor[$cnt]) { if ($Type17[$cnt]) { $buf .= " $FormFactor[$cnt]" if ($Type17[$cnt] !~ /$FormFactor[$cnt]/); } else { $buf .= " $FormFactor[$cnt]"; } } if ($TotalWidth[$cnt] && $DataWidth[$cnt]) { $ECCDIMM=1 if ($TotalWidth[$cnt] > $DataWidth[$cnt]); } if ($MemManufacturer[$cnt]) { $buf .= ", $MemManufacturer[$cnt]" if ($MemManufacturer[$cnt] !~ /None/i); if ($MemPartNum[$cnt]) { # Don't repeat MFG if it is in Partnumber $MemPartNum[$cnt]=~s/$MemManufacturer[$cnt] //; $buf .= " $MemPartNum[$cnt]" if ($MemPartNum[$cnt] !~ /None/i); } } elsif ($MemPartNum[$cnt]) { $buf .= ", $MemPartNum[$cnt]" if ($MemPartNum[$cnt] !~ /None/i); } } $totmem=$DMI17totmem; } push(@boards_mem, "$buf\n") if ($buf); } # Check memory SPD data from EEPROM if available, it can be more # accurate and detailed than the dmidecode data &check_decodedimms; &pdebug("displaying memory from $memfrom") if ($memfrom); if (! &is_virtualmachine) { # Only show ECC enabled in BIOS if ECC memory is installed if ($ECCBIOS) { $ECCBIOS="None" if (! $ECCDIMM); print "Memory Error Correction: $ECCBIOS\n"; } print "Maximum Memory: "; if (! $MAXMEM || $max < $totmem || $max == 0) { $MAXMEM="Unknown"; $MAXMEM .= " (DMI incorrectly reports ${max}MB)" if ($max < $totmem && $max); print "$MAXMEM\n"; } else { &show_memory($max); } print "Maximum Memory Bus Speed: $maxmembusspeed\n" if ($maxmembusspeed); print @boards_mem if (@boards_mem); } # # Print total memory # $sockettype="sockets"; $sockettype="banks" if ($sockets_empty =~ /BANK *\d/i && $sockets_empty !~ /DIMM/); if ($memarr < 0 || $totmem == 0) { if (&is_virtualmachine) { if ($totmem) { print "total memory = "; &show_memory($totmem); } else { $exitstatus=1; } &check_virtualmachine; } else { &print_empty_memory("memory $sockettype") if ($sockets_empty); print "ERROR: Memory Information Unknown\n"; if ((! $FoundEnd || $BrokenTable ne "") && $dmidecode_ver) { print "WARNING: dmidecode output is truncated\n" if (! $FoundEnd); if ($BrokenTable ne "") { print "ERROR: $BrokenTable\n"; print " Your BIOS may be corrupted or have an invalid checksum.\n"; } } &print_bios_error; $exitstatus=1; } } else { &print_empty_memory("memory $sockettype"); print "total memory = "; &show_memory($totmem); } if ($ECCBIOS) { if ($ECCBIOS eq "None" && $ECCDIMM) { print "WARNING: ECC memory detected, but ECC is not enabled in the BIOS.\n"; $exitstatus=1; } } print "WARNING: Mixed speeds of memory modules found.\n" if ($mixedspeeds); print "ERROR: $dmidecode_error\n" if ($dmidecode_error); if ($freephys > $totmem && $totmem && ! &is_virtualmachine) { print "ERROR: Total physical memory (${freephys}MB) is "; print "greater than the total memory found.\n The total "; print "physical memory reported by 'free -m' does not match "; print "the\n memory reported by 'dmidecode'.\n"; &print_bios_error; } # See if half of the memory is unused due to missing a second CPU if ($totmem && $totmem == &roundup_memory($freephys) * 2 && $ncpu == 1 && $necpu == 1) { print "WARNING: Half of the installed memory is not being "; print "used due to only having a\n single CPU "; print "installed in this dual-CPU capable system.\n"; } if ($os =~ /Linux|FreeBSD/ && &roundup_memory($freephys) < $totmem && $totmem > 4096) { $tmp=0; @tmp=(""); if (-r '/var/log/dmesg' && ! $filename) { open(FILE, "</var/log/dmesg"); @tmp=<FILE>; close(FILE); } elsif ($filename) { @tmp=@config; } foreach $line (@tmp) { if ($line =~ /Warning only \d.*B will be used/) { $line=~s/Warning o/WARNING: O/; print $line; $tmp=1; } if ($line =~ /Use a PAE enabled kernel/) { print "WARNING: " . $line; if (-r '/etc/grub.conf' && $osrel) { $tmp=`grep ${osrel}PAE /etc/grub.conf`; $tmp=($tmp) ? 2 : 1; } else { $tmp=1; } } } if ($tmp) { print "WARNING: Total memory available to the OS is "; print "less than the total memory found.\n"; $recognized=0; $exitstatus=1; } if ($tmp >=1 && $osrel) { $osrelk=$osrel; $osrelk=~s/smp//; $osrelk=~s/hugemem//; if ($tmp == 1) { if ($osrel =~ /smp$/) { if (`grep ${osrelk}hugemem /etc/grub.conf 2>/dev/null`) { print "WARNING: Boot the ${osrelk}hugemem kernel to use the full memory.\n"; } else { print "WARNING: Using a 'hugemem' kernel may fix this issue (supports up to 64GB).\n"; } } elsif ($osrel =~ /hugemem$/) { print "WARNING: An upgraded BIOS may fix this issue.\n"; print "WARNING: This is not a bug in memconf.\n"; } else { if ($totmem < 16384) { if (`grep ${osrelk}smp /etc/grub.conf 2>/dev/null`) { print "WARNING: Boot the ${osrelk}smp kernel to use the full memory.\n"; } elsif (`grep ${osrelk}hugemem /etc/grub.conf 2>/dev/null`) { print "WARNING: Boot the ${osrelk}hugemem kernel to use the full memory.\n"; } else { print "WARNING: Using an 'smp' or 'hugemem' kernel may fix this issue ('smp' supports\n"; print " up to 16GB, 'hugemem' supports up to 64GB).\n"; } } else { if (`grep ${osrelk}hugemem /etc/grub.conf 2>/dev/null`) { print "WARNING: Boot the ${osrelk}hugemem kernel to use the full memory.\n"; } else { print "WARNING: Using a 'hugemem' kernel may fix this issue (supports up to 64GB).\n"; } } } } if ($tmp == 2) { print "WARNING: Boot the ${osrelk}PAE kernel "; print "to use the full memory.\n"; } } elsif ($tmp == 1) { if ($totmem < 16384) { print "WARNING: Using an 'smp' or 'hugemem' kernel may fix this issue ('smp' supports\n"; print " up to 16GB, 'hugemem' supports up to 64GB).\n"; } else { print "WARNING: Using a 'hugemem' kernel may fix this issue (supports up to 64GB).\n"; } } } # Flag untested CPU types (machine="" or "x86" on regression test files) # Tested so far on x86, i86pc, x86_64, Itanium ia64, and amd64 if (! $machine || $machine eq "x86" || $machine =~ /i.86/ || $machine eq "x86_64" || $machine eq "ia64" || $machine eq "amd64") { $untested=0 if ($untested == 1); # Linux on SPARC with dmidecode # } elsif ($machine eq "sparc64" || $machine eq "sun4u") { # $untested=0 if ($untested == 1); } else { $untested=1; $untested_type="CPU" if (! $untested_type); } &check_virtualmachine; &show_untested if ($untested); &show_errors; &mailmaintainer if ($verbose == 3); &pdebug("exit $exitstatus"); exit $exitstatus; } sub show_total_memory { return if ($totalmemshown || ! $totmem); $totalmemshown=1; # # Print total memory # print "total memory = "; &show_memory($totmem); print "$permission_error\n" if ($permission_error && ! $HPUX); if ($prtconf_warn) { print "WARNING: $prtconf_warn\n"; print " This may be corrected by installing "; print "a Sun patch on this system.\n"; } } sub show_control_LDOM_message { return if ($controlLDOMshown); $controlLDOMshown=1; # # Post notice if on control LDOM # print "NOTICE: Control Logical Domain (LDOM) detected. "; $picl_bank_cnt=scalar(keys %picl_mem_bank); if ($picl_foundmemory || $picl_bank_cnt) { print "The cpus and memory modules\n"; print " reported are for the system, not necessarily the control LDOM.\n"; } else { print "The SUNWldm software package\n"; print " may need updated for prtpicl to be able to report the installed cpus and\n"; print " memory for the system.\n"; } } sub is_virtualmachine { if ($uid ne "0") { # In case non-root user is running memconf $tmp=($os =~ /Linux|FreeBSD/ && ! $filename) ? `lspci 2>/dev/null | egrep -i '(VMware|VirtualBox|VirtualPC)'` : ""; # Include special case for regression testing VM files if ((! $filename && $tmp =~ /VMware/i) || $filename =~ /VMware/i) { $manufacturer="VMware, Inc." if (! $manufacturer); $model="VMware Virtual Platform" if (! $model); return(1); } elsif ((! $filename && $tmp =~ /VirtualBox|VBox/i) || $filename =~ /VirtualBox/i) { $manufacturer="Oracle Corporation" if (! $manufacturer); $model="VirtualBox" if (! $model); return(1); } elsif ((! $filename && $tmp =~ /VirtualPC/i) || $filename =~ /VirtualPC/i) { $manufacturer="Microsoft Corporation" if (! $manufacturer); $model="Virtual Machine" if (! $model); return(1); } } return(1) if ($manufacturer =~ /VMware/ || $model =~ /VMware|Virtual Platform|Virtual Machine|VirtualBox|VBox/ || $diagbanner =~ /Virtual Machine/); return(1) if (&is_xen_vm); return(0); } sub is_xen_hv { return(1) if (-d '/proc/xen' && -f '/proc/xen/xsd_port'); # Linux Hypervisor # Special case for regression testing Xen files return(1) if ($filename =~ /Xen_dom0/i); } sub is_xen_vm { return(1) if (-d '/proc/xen' && ! -f '/proc/xen/xsd_port'); # Linux return(1) if ($model =~ /HVM domU/); # Linux return(1) if ($model eq "i86xpv" || $machine eq "i86xpv" || $model eq "i86xen" || $machine eq "i86xen"); # Solaris # Special case for regression testing Xen files return(1) if ($filename =~ /Xen_domU/i); } sub check_virtualmachine { return if ($vmshown); $vmshown=1; if (&is_virtualmachine) { if (&is_xen_vm) { $vmh="Xen dom0 hypervisor"; $vms="Xen server"; $vmg="Xen domU guest"; } else { $vmh="VM hypervisor"; $vms="VM server"; $vmg="Virtual Machine (VM)"; } print "NOTICE: Details shown may be for the configuration of this $vmg,\n not the physical CPUs and memory of the $vms it is running on.\n"; print "WARNING: More details can be reported if memconf is run on the $vmh.\n"; print " $vms CPU: $cpuinfo_cputype\n" if ($cpuinfo_cputype); } } sub check_xm_info { if ($have_xm_info_data) { &pdebug("in check_xm_info"); foreach $line (@xm_info) { $line=&dos2unix($line); $_=$line; ($xen_nr_nodes)=(/: (\d*) */) if (/^nr_nodes\s*: \d+/); ($xen_sockets_per_node)=(/: (\d*) */) if (/^sockets_per_node\s*: \d+/); ($xen_cores_per_socket)=(/: (\d*) */) if (/^cores_per_socket\s*: \d+/); $hyperthread=1 if (/^threads_per_core\s*: 2/); } $xen_ncpu=$xen_nr_nodes * $xen_sockets_per_node; &pdebug("xen_ncpu=$xen_ncpu, ncpu=$ncpu, xen_nr_nodes=$xen_nr_nodes, xen_sockets_per_node=$xen_sockets_per_node, xen_cores_per_socket=$xen_cores_per_socket, hyperthread=$hyperthread"); if ($xen_ncpu) { $cpucntfrom="xm_info"; $corecnt=$xen_cores_per_socket; $nvcpu=$xen_cores_per_socket; $nvcpu=$nvcpu * 2 if ($hyperthread); } } } sub check_cpuinfo { if ($have_cpuinfo_data) { return if ($cpuinfo_checked); &pdebug("in check_cpuinfo"); $cpuinfo_checked=1; foreach $line (@cpuinfo) { $line=&dos2unix($line); $_=$line; $cpuinfo_cpucnt++ if (/^processor\s*: \d+/); $cpuinfo_coreidcnt++ if (/^core id\s*: \d+/); if (/^physical id\s*: \d+/) { ($physicalid)=(/: (\d*) */); $cpuinfo_physicalid{$physicalid}++; } ($cpuinfo_cpucores)=(/: (\d*) */) if (/^cpu cores\s*: \d+/); ($cpuinfo_siblings)=(/: (\d*) */) if (/^siblings\s*: \d+/); # Only GenuineIntel x86 has hyper-threading capability $foundGenuineIntel=1 if (/^vendor_id\s*: GenuineIntel/); # Linux on x86 or ARM CPU model if (/^model name\s*: /) { ($cpuinfo_cputype)=(/: (.*)$/); $cpuinfo_cputype=&cleanup_cputype($cpuinfo_cputype); if (/.*(ARM|Feroceon|Marvell)/) { if ($filename) { # Special case for regression testing $machine="arm"; $platform=$machine; $os="Linux"; } $cpucnt{"$cpuinfo_cputype"}=$corecnt; } } # Linux on SPARC CPU model if (/^cpu\s+: \D/) { ($cpuinfo_cputype)=(/: (.*)$/); $cpuinfo_cputype=&cleanup_cputype($cpuinfo_cputype); $machine="sparc" if ($cpuinfo_cputype =~ /sparc/i); $os="Linux"; } # Linux on SPARC OBP version if (/^prom\s+: /) { ($romver)=(/: (.*)$/); @romverarr=split(/\s/, $romver); $romvernum=$romverarr[1]; } # Linux on SPARC CPU type ($machine)=(/: (.*)$/) if (/^type\s+: sun/); # Linux on SPARC if (/^ncpus active\s*: \d+/) { ($cpuinfo_cpucnt)=(/: (.*)$/); # Assume single core $cpuinfo_cpucores=1; } # Linux on SPARC CPU freq if (/^Cpu\dClkTck\s*: \d+/ && $cpufreq == 0) { ($freq)=(/: (.*)$/); $cpufreq=&convert_freq($freq); $cpuinfo_cputype.= " ${cpufreq}MHz" if ($cpuinfo_cputype !~ /MHz/ && $cpufreq); } # Linux on unsupported CPU models (arm, mips, etc.) if (($machine !~ /.86|ia64|amd64|sparc/ && ! $filename) || $filename) { if (/^Processor\s+: /) { ($cpuinfo_cputype)=(/: (.*)$/); if ($filename && /^Processor\s+: .*(ARM|Feroceon|Marvell)/) { # Special case for regression testing $machine="arm"; $platform=$machine; } $os="Linux"; $cpucnt{"$cpuinfo_cputype"}=$corecnt; } elsif (/^cpu model\s+: /) { ($cpuinfo_cputype)=(/: (.*)$/); if ($filename && /^cpu model\s+: .*MIPS/) { # Special case for regression testing $machine="mips"; $platform=$machine; } $os="Linux"; $cpucnt{"$cpuinfo_cputype"}=$corecnt; } } if ($filename) { ($hostname)=(/: (.*)$/) if (/^host\s*: / && $hostname eq ""); if (/^machine\s*: /) { ($machine)=(/: (.*)$/); if (! defined($kernbit)) { $kernbit=32 if ($machine =~ /i.86|sparc/); $kernbit=64 if ($machine =~ /x86_64|sparc64|ia64|amd64/); } } if (/^release\s*: / && $release eq "") { ($release)=(/: (.*)$/); $release="Linux $release"; } } } $cpuinfo_physicalidcnt=keys %cpuinfo_physicalid; $cpuinfo_physicalidcnt=0 if (! defined($cpuinfo_physicalidcnt)); if ($cpuinfo_cpucnt > $ncpu && (! $foundGenuineIntel || $foundGenuineIntel && ! $ncpu)) { # Prefer cpuinfo over dmidecode for CPU info $cpucntfrom=$config_command if (! $cpucntfrom); &pdebug("Preferring CPU count from cpuinfo ($cpuinfo_cpucnt) over $cpucntfrom ($ncpu)"); if ($ncpu) { $cpucntfrom="dmidecode and cpuinfo"; } else { $cpucntfrom="cpuinfo"; } if ($cpuinfo_cpucores) { $ncpu=$cpuinfo_cpucnt / $cpuinfo_cpucores; } else { $ncpu=$cpuinfo_cpucnt; } } &pdebug("cpuinfo_cputype=$cpuinfo_cputype, ncpu=$ncpu, cpuinfo_cpucnt=$cpuinfo_cpucnt, cpuinfo_coreidcnt=$cpuinfo_coreidcnt, cpuinfo_cpucores=$cpuinfo_cpucores, cpuinfo_physicalidcnt=$cpuinfo_physicalidcnt, cpuinfo_siblings=$cpuinfo_siblings, foundGenuineIntel=$foundGenuineIntel"); } } sub finish { &show_header; #print "newslots=@newslots\n" if ($#newslots && $verbose > 1); # Large memory system like SPARC T7-4 can mismatch memory in prtconf and ipmitool if ($isX86 || $ultra =~ /^T7-/) { # smbios and ipmitool memory data is more accurate than prtconf if ($smbios_memory && $smbios_memory > $installed_memory) { $installed_memory=$smbios_memory; $totmem=$installed_memory; } elsif ($ipmi_memory && $ipmi_memory > $installed_memory) { $installed_memory=$ipmi_memory; $totmem=$installed_memory; } } # Cannot accurately determine installed memory unless information is # is in prtpicl output, or if system is fully stuffed $picl_bank_cnt=scalar(keys %picl_mem_bank); if ($ldm_memory && ! ($picl_foundmemory || $picl_bank_cnt)) { $totmem=&roundup_memory($installed_memory); &show_total_memory; &show_control_LDOM_message; return; } print $buffer if ($buffer); # # Special memory options # if ($sxmem) { # Currently assumes only one VSIMM is installed. # Auxiliary Video Board 501-2020 (SS10SX) or 501-2488 (SS20) # required if two VSIMMs are installed. if ($model eq "SPARCstation-20" || $model eq "SuperCOMPstation-20S") { # SS20 1st VSIMM in J0304/J0407, 2nd in J0305/J0406 print "sockets J0304/J0407 have"; $sockets_used .= " J0304"; } elsif ($model =~ /COMPstation-20A\b/) { # 1st VSIMM in J0202, 2nd in J0301 print "socket J0202 has"; $sockets_used .= " J0202"; } else { # SS10SX 1st VSIMM in J0301/J1203, 2nd in J0202/J1201 print "sockets J0301/J1203 have"; $sockets_used .= " J0301"; } print " a ${sxmem}MB VSIMM installed for SX (CG14) graphics\n"; } if ($nvmem) { # NVSIMMs for Prestoserve if ($model eq "SPARCstation-20" || $model eq "SuperCOMPstation-20S") { # SS20 1st 2MB NVSIMM in J0305/J0406, 2nd in J0304/J0407 if ($nvmem1) { $sockets_used .= " J0305"; print "sockets J0305/J0406 have a 2MB NVSIMM"; print " installed for Prestoserve\n"; } if ($nvmem2) { $sockets_used .= " J0304"; print "sockets J0304/J0407 have a 2MB NVSIMM"; print " installed for Prestoserve\n"; } } elsif ($model =~ /COMPstation-20A\b/) { # 1st 2MB NVSIMM in J0301, 2nd in J0202 if ($nvmem1) { $sockets_used .= " J0301"; print "socket J0301 has a 2MB NVSIMM"; print " installed for Prestoserve\n"; } if ($nvmem2) { $sockets_used .= " J0202"; print "socket J0202 has a 2MB NVSIMM"; print " installed for Prestoserve\n"; } } elsif ($model =~ /SPARCstation-10/ || $model eq "Premier-24") { # SS10 1st 2MB NVSIMM in J0202/J1201, 2nd in J0301/J1203 if ($nvmem1) { $sockets_used .= " J0202"; print "sockets J0202/J1201 have a 2MB NVSIMM"; print " installed for Prestoserve\n"; } if ($nvmem2) { $sockets_used .= " J0301"; print "sockets J0301/J1203 have a 2MB NVSIMM"; print " installed for Prestoserve\n"; } } else { # SS1000 supports two banks of four 1MB NVSIMMs # SC2000 supports one bank of eight 1MB NVSIMMs print "Has ${nvmem}MB of NVSIMM installed for Prestoserve "; if ($model eq "SPARCserver-1000") { print "(1 bank of 4" if ($nvmem == 4); print "(2 banks of 4" if ($nvmem == 8); } else { print "(1 bank of 8"; } print " 1MB NVSIMMs$nvsimm_banks)\n"; } } # # Check for empty banks or sockets # if ($#banksstr) { foreach $banks (@banksstr) { if ($banks ne "?") { if ($banks_used !~ /\b$banks\b/ && $sockets_empty !~ /\b$banks\b/) { &add_to_sockets_empty($banks); } } } &print_empty_memory($bankname); } elsif ($#socketstr) { foreach $socket (@socketstr) { if ($socket ne "?") { # strip leading slash for matching $tmp=$socket; $tmp=~s/^\///; if ($sockets_used !~ /$tmp/ && $sockets_empty !~ /$tmp/) { &add_to_sockets_empty($socket); } } } if ($sockettype) { &print_empty_memory("${sockettype}s"); } else { &print_empty_memory("memory slots"); } } elsif ($verbose > 1 && $sockets_used) { print "memory sockets used: $sockets_used\n"; } # Look for duplicate sockets if ($sockets_used && $have_prtdiag_data) { $dup_sockets=""; if ($sockets_used =~ /;/) { $sep=';'; } elsif ($sockets_used =~ /,/) { $sep=','; } else { $sep=' '; } foreach $socket (sort split($sep, $sockets_used)) { next if ($socket eq "board" || $socket eq "mezzanine"); next if ($model eq "SPARCsystem-600" || $model =~ /Sun.4.600/); $pos=-1; $cnt=0; while (($pos=index(" $sockets_used ", " $socket ", $pos)) > -1) { $pos++; $cnt++; if ($cnt == 2 && $socket ne "-" && $socket ne "?") { # strip leading slash for matching $tmp=$socket; $tmp=~s/^\///; if ($dup_sockets !~ /$tmp/) { $dup_sockets .= " $socket"; print "ERROR: Duplicate socket $socket found\n"; $exitstatus=1; } } } } if ($dup_sockets) { print "WARNING: Memory was not properly reported by"; print " the 'prtdiag' command.\n"; &recommend_prtdiag_patch; } } # Look for unlabeled sockets if ($sockets_used =~ /\s-\s|^-\s|\s-$|^-$/) { print "WARNING: Unlabeled socket found"; print " in the 'prtdiag' command output" if ($have_prtdiag_data); print ".\n This may cause the reported empty sockets"; print " to be incorrect.\n"; &recommend_prtdiag_patch; } # Make sure Sun Fire V480/V490/V880/V890 is fully stuffed if >= 1050MHz if ($ultra =~ /Sun Fire V[48][89]0\b/) { print "ERROR: System should not have any empty banks since CPU is >= 1050MHz.\n" if ($cpufreq >= 1050 && $banks_used ne "A0 A1 B0 B1"); } if ($machine eq "sun4v") { # Round up Solaris memory (may have 128MB or more reserved) $installed_memory=&roundup_memory($installed_memory); $totmem=$installed_memory; } # # Print total memory # &show_total_memory; # # Post notice if on control LDOM # &show_control_LDOM_message if ($ldm_memory); # # Post notice if on a virtual machine # &check_virtualmachine; # # Post notice if X86 machine is Hyper-Thread capable, but not enabled # &show_hyperthreadcapable; # # Check for illegal memory stuffings # if ($model eq "Sun 4/50" || $model eq "Sun 4/25") { # IPX, ELC if ($slot0 != 16 && $largestsimm == 16 && $osrel =~ /4.1.1/) { print "ERROR: Install the highest capacity 16MB SIMM"; print " in socket $socketstr[0] under SunOS 4.1.1.\n"; $exitstatus=1; } } if ($model =~ /SPARCclassic|SPARCstation-LX/) { if ($found32mb) { # Reportedly can accept 32MB SIMMs in bank 1, allowing # 128MB total (2x32, 4x16) print "NOTICE: The 32MB SIMM is not supported in the"; print " $model according to\n Sun. However it does"; print " appear to work in bank 1 only, allowing a"; print " maximum of\n 128MB of total memory (2x32MB"; print " bank 1 + 4x16MB banks 2 & 3).\n"; } if ($found8mb) { # Possibly can accept 8MB SIMMs in bank 1 print "NOTICE: The 8MB SIMM is not supported in the"; print " $model according to\n Sun. However it does"; print " appear to work in bank 1 only.\n"; } } if ($model =~ /SPARCstation-10/ || $model eq "Premier-24") { if ($slot0 < $largestsimm && $BSD) { print "ERROR: Install the highest capacity SIMM in"; print " socket $socketstr[0] under Solaris 1.X.\n"; $exitstatus=1; } if (! $found32mb && $found16mb && ($romvermajor eq 2) && ($romverminor < 19)) { print "WARNING: The 32MB SIMM is not supported in the"; print " SS10 or SS10SX according to\n Sun. However"; print " it does work correctly depending on the Open"; print " Boot PROM\n version. This system is running"; print " OBP $romvernum, so 32MB SIMMs will only be\n"; print " recognized as 16MB SIMMs. You should"; print " upgrade to OBP 2.19 or later in order\n to"; print " be able to detect and utilize 32MB SIMMs.\n"; # OBP 2.14 and earlier see the 32MB SIMM as 16MB. # OBP 2.15 on a SS20 does see the 32MB SIMM as 32MB. # Have not tested 32MB SIMMs on SS10 with OBP 2.15-2.18 if ($romverminor > 14) { $untested=1; $untested_type="OBP"; } } if ($found32mb && ($romvermajor eq 2) && ($romverminor < 19)) { print "NOTICE: The 32MB SIMM is not supported in the"; print " SS10 or SS10SX according to\n Sun. However"; print " it does work correctly depending on the Open"; print " Boot PROM\n version. This system is running"; print " OBP $romvernum, and 32MB SIMMs were properly\n"; print " recognized.\n"; @simmsizes=(16,32,64); if ($romvernum ne "2.X") { $untested=1; $untested_type="OBP"; } } if (! $nvmem1 && $nvmem2) { print "ERROR: First NVSIMM should be installed in"; print " socket J0202, not socket J0301\n"; $exitstatus=1; } } if ($model eq "SPARCstation-20" || $model eq "SuperCOMPstation-20S") { if (! $nvmem1 && $nvmem2) { print "ERROR: First NVSIMM should be installed in"; print " socket J0305, not socket J0304\n"; $exitstatus=1; } } if ($model eq "SPARCstation-5") { if ($slot0 < $largestsimm && $BSD) { print "ERROR: Install the highest capacity SIMM in"; print " socket $socketstr[0] under Solaris 1.X.\n"; $exitstatus=1; } if ($osrel eq "4.1.3_U1" && $found32mb) { # Look to see if patch 101508-07 or later is installed # for 32MB SIMMs to work properly (bug 1176458) $what=&mychomp(`/usr/ucb/what /sys/sun4m/OBJ/module_vik.o`); if ($what !~ /module_vik.c 1.38 94\/08\/22 SMI/) { print "WARNING: Install SunOS 4.1.3_U1 patch"; print " 101508-07 or later in order for 32MB\n"; print " SIMMs to work reliably on the"; print " SPARCstation 5.\n"; } } } if ($model eq "Ultra-5_10" || $ultra eq "5_10" || $ultra eq 5 || $ultra eq 10) { if ($smallestsimm == 16 && $largestsimm > 16) { print "ERROR: 16MB DIMMs cannot be mixed with larger"; print " DIMMs on Ultra 5/10 systems.\n"; $exitstatus=1; } } if ($ultra eq 5) { if ($largestsimm == 256) { print "NOTICE: The 256MB DIMM is not supported in the"; print " Ultra 5 according to\n Sun. However it does"; print " work correctly as long as you use low-profile"; print "\n DIMMs or take out the floppy drive.\n"; } } if ($ultra eq "AXi") { # DIMMs should be chosen as all 10-bit or all 11-bit column # address type. If using 11-bit, then only use Bank 0 & 2. if ($found10bit && $found11bit) { print "ERROR: You should not mix 10-bit and 11-bit"; print " column address type DIMMs in the\n "; print "SPARCengine Ultra AXi.\n"; $exitstatus=1; } if ($found11bit) { if ($foundbank1or3) { print "ERROR"; $exitstatus=1; } else { print "WARNING"; } print ": Do not use Bank 1 (sockets U0402 & U0401) &"; print " Bank 3 (sockets U0302 &\n U0301) since"; print " 11-bit column address type DIMMs are"; print " installed. You should\n only use Bank 0"; print " (sockets U0404 & U0403) & Bank 2 (sockets"; print " U0304 & U0303).\n"; } } if ($model eq "Ultra-4" || $ultra eq 450 || $model eq "Ultra-4FT" || $ultra eq "Netra ft1800") { if ($found16mb) { print "WARNING: 16MB DIMMs are not supported and may"; print " cause correctable ECC errors.\n"; } } # # Check for unsupported memory sizes # foreach $i (@simmsizesfound) { $smallestsimm=$i if ($i < $smallestsimm); $largestsimm=$i if ($i > $largestsimm); $simmsizelegal=0; foreach $j (@simmsizes) { $simmsizelegal=1 if ($i == $j); } if (! $simmsizelegal && $simmsizes[0]) { print "ERROR: Unsupported ${i}MB $memtype found (supported "; if ($#simmsizes == 0) { print "size is @{simmsizes}MB)\n"; } else { print "MB sizes are: @simmsizes)\n"; } $exitstatus=1; } } if ($smallestsimm < $simmsizes[0]) { print "ERROR: Smaller than expected $memtype found "; print "(found ${smallestsimm}MB, smallest expected "; print "${simmsizes[0]}MB)\n"; $exitstatus=1; } if ($largestsimm > $simmsizes[$#simmsizes]) { print "ERROR: Larger than expected $memtype found "; print "(found ${largestsimm}MB, largest expected "; print "${simmsizes[$#simmsizes]}MB)\n"; $exitstatus=1; } # # Check for buggy perl version # if ($perlhexbug) { print "ERROR: This Perl V$PERL_VERSION is buggy in hex number"; print " conversions.\n"; $exitstatus=1; } if ($PERL_VERSION == 5.001) { print "WARNING: Perl V5.001 is known to be buggy in hex number"; print " conversions.\n"; } if ($PERL_VERSION < 5.002) { print "WARNING: Perl V5.002 or later is recommended for best"; print " results.\n"; print " You are running Perl V$PERL_VERSION\n"; } # # Check for bad eeprom banner-name. This happens sometimes when OBP 3.23 # or later is installed on Ultra-60/E220R and Ultra-80/E420R systems. # if ($banner =~ /^ \(/) { print "ERROR: banner-name not set in EEPROM (BugID 4257412)."; print " Cannot distinguish an\n "; print "Ultra 60 from an Enterprise 220R" if ($model eq "Ultra-60"); print "Ultra 80 from an Enterprise 420R or Netra t 1400/1405" if ($model eq "Ultra-80"); print "Sun Blade 1000/2000 from a Sun Fire 280R or Netra 20" if ($ultra eq "Sun Blade 1000" || $ultra eq "Sun Blade 2000" || $ultra eq "Sun Fire 280R" || $ultra eq "Netra 20"); print ".\n To correct this problem, please run one of "; print "the following commands as\n root depending on "; print "the system you have:\n"; if ($model eq "Ultra-60") { print " eeprom banner-name='Sun Ultra 60 UPA/PCI'\n"; print " eeprom banner-name='Sun Enterprise 220R'\n"; print "Note: Netra t1120/1125 systems may also use the 'Sun Ultra 60 UPA/PCI' banner\n"; } if ($model eq "Ultra-80") { print " eeprom banner-name='Sun Ultra 80 UPA/PCI'\n"; print " eeprom banner-name='Sun Enterprise 420R'\n"; print " eeprom banner-name='Netra t 1400/1405'\n"; print "Note: Netra t1400/1405 systems may also use the 'Sun Ultra 80 UPA/PCI' banner\n"; } if ($ultra eq "Sun Blade 1000" || $ultra eq "Sun Blade 2000" || $ultra eq "Sun Fire 280R" || $ultra eq "Netra 20") { print " eeprom banner-name='Sun-Blade-1000'\n"; print " eeprom banner-name='Sun Fire 280R'\n"; print " eeprom banner-name='Netra 20'\n"; print "Note: Netra 20 systems may also use the 'Sun-Blade-1000' banner\n"; } $exitstatus=1; } # # Check for possible memory detection errors by this program # if ($prtdiag_failed == 2) { &found_nonglobal_zone; $prtdiag_has_mem=0; } # prtdiag only available on SunOS $prtdiag_has_mem=0 if ($os ne "SunOS"); if (! $boardfound_mem && $prtdiag_has_mem) { print "WARNING: Memory should have been reported in the output from"; if ($prtdiag_cmd) { print "\n $prtdiag_cmd"; } else { if (-d '/usr/platform') { print " prtdiag,\n which was not found in /usr/platform/$machine/sbin"; } else { print " prtdiag."; } } print "\nERROR: prtdiag failed!" if ($prtdiag_failed); print "\n This system may be misconfigured, or may be"; print " missing software packages\n like SUNWpiclr,"; print " SUNWpiclu and SUNWpiclx, or may need the latest\n"; print " recommended Sun patches installed from"; print " http://sunsolve.sun.com/\n"; if ($ultra eq "Sun Fire V880") { print " This may be corrected by installing "; print "Sun patch 112186-19 or 119231-01 or later.\n"; } print " Check my website at $URL\n"; print " to get the latest version of memconf.\n"; $exitstatus=1; } if ($recognized == 0) { print "ERROR: Layout of memory ${sockettype}s not completely "; print "recognized on this system.\n"; $exitstatus=1; } if ($recognized < 0 && $os eq "SunOS") { if ($have_prtfru_details && $recognized == -3) { print "ERROR: Memory manufacturer not recognized.\n"; print " This is a bug in the Sun OBP or prtfru"; print " command, not a bug in memconf.\n"; } else { print "WARNING: Layout of memory ${sockettype}s not"; print " completely recognized on this system.\n"; } if ($model eq "Ultra-80" || $ultra eq 80 || $ultra eq "420R" || $ultra eq "Netra t140x") { if ($recognized == -1) { print " The memory configuration displayed is a guess which may be incorrect.\n"; if ($totmem eq 1024) { print " The 1GB of memory installed may be 4 256MB DIMMs populating bank 0,\n"; print " or 16 64MB DIMMs populating all 4 banks.\n"; } } print " This is a known bug due to Sun's 'prtconf', 'prtdiag' and 'prtfru'\n"; print " commands not providing enough detail for the memory layout of this\n"; print " SunOS $osrel $platform system to be accurately determined.\n"; print " This is a bug in Sun's OBP, not a bug in memconf. The latest OBP\n"; print " release (OBP 3.33.0 2003/10/07 from patch 109082-06) "; print (($totmem eq 1024) ? "still has this bug" : "should fix this"); print ".\n This system is using $romver\n"; $exitstatus=1; } if ($ultra eq "Sun Blade 1000" || $ultra eq "Sun Blade 2000" || $ultra eq "Sun Fire 280R" || $ultra eq "Netra 20") { # Do this if memory was not in the output of prtdiag if ($recognized == -2) { # Hack: If Sun Blade 1000 has 8GB of memory (maximum # allowed), then memory line was rewritten to show # memory stuffing. print " The memory configuration displayed should be"; print " correct though since this\n"; print " is a fully stuffed system.\n"; } else { print " The memory configuration displayed is a guess which may be incorrect.\n"; } } if ($ultra eq "T2000" || $ultra eq "T1000") { # Do this if memory was not in the output of prtdiag # Hack: If Sun Fire T2000 has 8GB or 16GB of memory or # if Sun Fire T1000 has 4GB or 8GB of memory, then it # may be 1 rank of DIMMs instead of default 2 ranks. print " The memory configuration displayed is a guess which may be incorrect.\n"; print " Base Sun configurations ship with two ranks of modules installed.\n"; print " This system may have one rank of " . $simmsizesfound[0]*2 . "MB DIMMs installed instead\n"; print " of two ranks of " . $simmsizesfound[0] . "MB DIMMs as shown.\n"; print " This is a known bug due to Sun's 'prtconf', 'prtdiag' and 'prtfru'\n"; print " commands not providing enough detail for the memory layout of this\n"; print " SunOS $osrel $platform system to be accurately determined.\n"; print " This is a Sun bug, not a bug in memconf.\n"; $exitstatus=1; } } if ($banner =~ /Netra t1\b/ || $ultra eq "Netra t1" || $model eq "Netra t1") { if ($totmem eq 1024) { print "WARNING: Cannot distinguish between four"; print " 370-4155 256MB mezzanine boards and\n"; print " two 512MB mezzanine boards.\n"; } if ($totmem eq 768) { print "WARNING: Cannot distinguish between three"; print " 370-4155 256MB mezzanine boards and\n"; print " one 512MB and one 256MB mezzanine boards.\n"; } } if ($installed_memory) { if ($installed_memory != $totmem) { print "ERROR: Total memory installed (${installed_memory}MB) "; print "does not match total memory found.\n"; $recognized=0; $exitstatus=1; } } if ($failed_memory) { print "ERROR: Failed memory (${failed_memory}MB) was detected.\n"; print " You should consider replacing the failed memory.\n"; $exitstatus=1; } if ($spare_memory) { print "NOTICE: Spare memory (${spare_memory}MB) was detected.\n"; print " You can configure the spare memory using the 'cfgadm' command.\n"; } &show_errors; if ($failed_fru) { print "ERROR: $failed_fru"; print " You should consider replacing the failed FRUs.\n"; $exitstatus=1; } &show_unrecognized if ($recognized == 0); if (! &is_virtualmachine) { if ($smbios_memory && &roundup_memory($smbios_memory) != $installed_memory) { print "ERROR: Memory found by smbios (${smbios_memory}MB) does not match memory found in $config_command (${installed_memory}MB).\n"; print " This may be corrected by installing a Sun BIOS patch on this system.\n"; $exitstatus=1; } if ($ipmi_memory && $ipmi_memory != $installed_memory) { print "ERROR: Memory found by ipmitool (${ipmi_memory}MB) does not match memory found in $config_command (${installed_memory}MB).\n"; print " This may be corrected by installing a Sun BIOS patch on this system.\n"; $exitstatus=1; } } # Tested on SunOS 4.X - 5.11 (Solaris 1.0 through Solaris 11) # Flag Future/Beta SunOS releases as untested if ($osrel =~ /^5.1[2-9]|^[6-9]/) { $untested=1; $untested_type="OS" if (! $untested_type); } # Flag untested CPU types: # US-IIIi+ (Serrano) if ($cputype =~ /UltraSPARC-IIIi\+/) { $untested=1; $untested_type="CPU" if (! $untested_type); } # SPARC-T4+, SPARC-T6 or newer if ($cputype =~ /SPARC-T([4-9]\+|[6-9])/) { $untested=1; $untested_type="CPU" if (! $untested_type); } # SPARC-M5, SPARC-M6 or other SPARC-M* if ($cputype =~ /SPARC.M\d\+/) { $untested=1; $untested_type="CPU" if (! $untested_type); } # SPARC-S* excluding SPARC-S7 if ($cputype =~ /SPARC.S\d\+/ && $cputype !~ /SPARC.S7\b/) { $untested=1; $untested_type="CPU" if (! $untested_type); } # SPARC64-VII++ or newer other than SPARC64-X if ($cputype =~ /SPARC64-(VII\+\+|VIII|IX|X)/ && $cputype !~ /SPARC64-X\b/) { $untested=1; $untested_type="CPU" if (! $untested_type); } # Dual-Core, Triple-Core, Quad-Core, Six-Core, Eight-Core, Ten-Core, # Twelve-Core, Fourteen-Core, Sixteen-Core, Eighteen-Core x86 CPUs # have been tested. Don't flag as untested CPU as of V3.14. # if ($isX86 && $corecnt !~ /^(1|2|3|4|6|8|10|12|14|16|18)$/) { # $untested=1; # $untested_type="CPU" if (! $untested_type); # } &show_untested if ($untested); &mailmaintainer if ($verbose == 3); &pdebug("exit $exitstatus"); exit $exitstatus; } sub createfile { $s=shift; push(@filelist, "$s"); open(OUTFILE, ">/tmp/$s") || die "can't open /tmp/$s: $!"; $tmp=0; foreach $line (@_) { print OUTFILE "$line"; print OUTFILE "\n" if ($line !~ /\n$/); $tmp++; } close(OUTFILE); print STDERR time . " created $tmp lines in $s\n" if ($debug); } sub b64encodefile { local($file)=@_; local($res)=""; local($chunk)=""; $base64_alphabet='ABCDEFGHIJKLMNOPQRSTUVWXYZ' . 'abcdefghijklmnopqrstuvwxyz' . '0123456789+/'; $uuencode_alphabet=q|`!"#$%&'()*+,-./0123456789:;<=>?| . '@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_'; # Build some strings for use in tr/// commands. # Some uuencodes use " " and some use "`", so we handle both. # We also need to protect backslashes and other special characters. $tr_uuencode=" " . $uuencode_alphabet; $tr_uuencode=~s/(\W)/\\$1/g; $tr_base64="A" . $base64_alphabet; $tr_base64=~s/(\W)/\\$1/g; $base64_pad='='; if (open(INFILE, "<$file")) { # break into chunks of 45 input chars, use perl's builtin # uuencoder to convert each chunk to uuencode format, # then kill the leading "M", translate to the base64 alphabet, # and finally append a newline. while (read(INFILE, $_, 45)) { if (length($_) == 45) { $chunk=substr(pack("u", $_), $[+1, 60); eval qq{ \$chunk =~ tr|$tr_uuencode|$tr_base64|; }; } else { # any leftover chars go onto a shorter line with # uuencode padding converted to base64 padding $chunk=substr(pack("u", $_), $[+1, int((length($_)+2)/3)*4 - (45-length($_))%3); eval qq{ \$chunk =~ tr|$tr_uuencode|$tr_base64|; }; $res .= $chunk . ($base64_pad x ((60 - length($chunk)) % 4)); } $res .= $chunk . "\n"; } close(INFILE); return($res); } else { return(""); } } sub mailmaintainer { # E-mail information of system to maintainer. Use system call to # sendmail instead of Mail::Send module so that this works for perl4 if (-x '/usr/sbin/sendmail') { $sendmail='/usr/sbin/sendmail'; } elsif (-x '/usr/lib/sendmail') { $sendmail='/usr/lib/sendmail'; } else { $sendmail=""; } if ($sendmail) { print "\nSending E-mail to memconf maintainer tschmidt\@micron.com"; print " with output of:\n memconf -d (seen above)\n"; &show_helpers(" "); print "\nIf this system cannot send E-mail to the internet, then please E-mail the\n"; print "following file to tschmidt\@micron.com as an attachment from a system that can:\n"; } else { print "\nPlease E-mail the following file as an attachment to tschmidt\@micron.com\n"; } # Rewrite fully-qualified hostnames so that attachment filename has # only one extension. $newhostname=$hostname; $newhostname=~s/\./_/g; $outfile="memconf_$newhostname"; print (" /tmp/${outfile}.tar\n"); if ($filename) { $mail_subj=($SUNWexplo) ? "Sun/Oracle Explorer directory $filename" : "filename $filename"; } else { $mail_subj="$hostname"; } $mail_subject="memconf output from $mail_subj"; close(STDOUT); rename("/tmp/memconf.output","/tmp/${outfile}.txt"); push(@filelist, "${outfile}.txt"); if ($config_cmd) { @config=&run("$config_cmd") if (! $config[0]); &createfile("${outfile}_${config_command}.txt",@config); } if ($os eq "SunOS") { &createfile("${outfile}_prtdiag.txt",@prtdiag) if ($prtdiag_exec); &createfile("${outfile}_prtfru.txt",@prtfru) if ($prtfru_cmd); &createfile("${outfile}_prtpicl.txt",@prtpicl) if ($prtpicl_cmd); &createfile("${outfile}_psrinfo.txt",@psrinfo) if ($psrinfo_cmd); &createfile("${outfile}_virtinfo.txt",@virtinfo) if ($virtinfo_cmd); &createfile("${outfile}_cfgadm.txt",@cfgadm) if ($cfgadm_cmd); &createfile("${outfile}_smbios.txt",@smbios) if ($smbios_cmd); &createfile("${outfile}_kstat.txt",@kstat) if ($kstat_cmd); &createfile("${outfile}_ldm.txt",@ldm) if ($ldm_cmd); } &createfile("${outfile}_cpuinfo.txt",@cpuinfo) if (-r '/proc/cpuinfo'); &createfile("${outfile}_meminfo.txt",@meminfo) if (-r '/proc/meminfo'); &createfile("${outfile}_free.txt",@free) if ($free_cmd); &createfile("${outfile}_xm_info.txt",@xm_info) if ($xm_info_cmd); if (-x '/usr/bin/xenstore-ls') { $domid=&mychomp(`/usr/bin/xenstore-read domid 2>/dev/null`); if ($domid) { @xenstore=`/usr/bin/xenstore-ls /local/domain/$domid 2>/dev/null`; &createfile("${outfile}_xenstore-ls.txt",@xenstore); } } &createfile("${outfile}_decodedimms.txt",@decodedimms) if ($decodedimms_cmd); &createfile("${outfile}_ipmitool.txt",@ipmitool) if ($ipmitool_cmd); if ($os eq "HP-UX") { &createfile("${outfile}_machinfo.txt",@machinfo) if (-x '/usr/contrib/bin/machinfo'); } `cd /tmp; tar cf /tmp/${outfile}.tar @filelist 2>/dev/null`; if ($sendmail) { # Make MIME attachment using sendmail open(MAIL, "|$sendmail -t"); print MAIL "To: tschmidt\@micron.com\n"; print MAIL "Subject: $mail_subject\n"; print MAIL "MIME-Version: 1.0\n"; print MAIL "Content-Type: multipart/mixed; boundary=\"memconf_UNIQUE_LINE\"\n"; print MAIL "\n"; print MAIL "This is a multi-part message in MIME format.\n"; print MAIL "--memconf_UNIQUE_LINE\n"; print MAIL "Content-Type: text/plain; charset=\"ISO-8859-1\"; format=flowed\n"; print MAIL "\n"; print MAIL "Attached is output and regression test files from memconf $version $version_date from $mail_subj\n\n"; open(FILE, "/tmp/${outfile}.txt"); @tmp=<FILE>; close(FILE); print MAIL @tmp; print MAIL "\n--memconf_UNIQUE_LINE\n"; print MAIL "Content-Type: application/octet-stream; name=\"${outfile}.tar\"\n"; print MAIL "Content-Transfer-Encoding: base64\n"; print MAIL "Content-Disposition: attachment; filename=\"${outfile}.tar\"\n"; print MAIL "\n"; print MAIL &b64encodefile("/tmp/${outfile}.tar"); print MAIL "--memconf_UNIQUE_LINE--\n"; close(MAIL); } foreach $tmp (@filelist) { unlink "/tmp/$tmp"; } } ���������������������������������������������������������������UnixAgent-2.4.2/ocsinventory-agent������������������������������������������������������������������0000775�0000000�0000000�00000022162�13327377321�0017220�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!/usr/bin/perl eval 'exec /usr/bin/perl -S $0 ${1+"$@"}' if 0; # not running under some shell #Copyright (C) 2006-2016 OCS Inventory Developers # #This program is free software; you can redistribute it and/or #modify it under the terms of the GNU General Public License #as published by the Free Software Foundation; either version 2 #of the License, or (at your option) any later version. # #This program is distributed in the hope that it will be useful, #but WITHOUT ANY WARRANTY; without even the implied warranty of #MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #GNU General Public License for more details. # #You should have received a copy of the GNU General Public License #along with this program; if not, write to the Free Software #Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, #USA. # use strict; use warnings; my $devlib; foreach (@ARGV) { if (/^--devlib$/) { print "[info] --devlib are found, Developer mode enabled\n"; eval "use lib 'lib';"; } } eval "use Ocsinventory::Agent;"; if ($@) { print "Failed to load Ocsinventory::Agent, $@\n"; print "you can run the agent directly for its source directory "; print "with --devlib\n"; exit 1; } eval "Ocsinventory::Agent::run();"; print $@; __END__ =head1 NAME ocsinventory-agent - Unified client for OCS-Inventory =head1 SYNOPSIS B<ocsinventory-agent> S<[ B<-fhilpruw> ]> S<[ I<--server server> | I<--local /tmp> ]>... =head1 EXAMPLES % ocsinventory-agent --server localhost # send an inventory to the OCS server % ocsinventory-agent --server http://localhost/ocsinventory2 # send an inventory over http to a server with a non standard # virtual directory % ocsinventory-agent --server https://localhost/ocsinventory # send an inventory over https to the OCS server % ocsinventory-agent --local /tmp # write an inventory in the /tmp directory % ocsinventory-agent --server localhost --user=toto --password=pw --realm="Restricted Area" # send a report to a server protected by a basic authentication % ocsinventory-agent --lazy # send an inventory only if the a random delay between 0 and PROLOG_FREQ had been run over. % ocsinventory-agent --delaytime 60 -d # If NO PROLOG_FREQ has been preset, pick a time between execution and --delaytime for the agent to contact the server [default is 3600 seconds] =head1 DESCRIPTION F<ocsinventory-agent> creates inventory and send or write them. This agent is the successor of the former linux_agent which was released with OCS 1.01 and prior. It also replaces the Solaris/AIX/BSD unofficial agents. The detailed list of supported Operating System is available in the Wiki. =over 4 =item F<GNU/Linux> =item F<Solaris> =item F<FreeBSD> =item F<NetBSD> =item F<OpenBSD> =item F<AIX> =item F<MacOSX> =item F<GNU/kFreeBSD> =back =head1 OPTIONS Most of the options are available in a I<short> form and a I<long> form. For example, the two lines below are all equivalent: % ocsinventory-agent -s localhost % ocsinventory-agent --server localhost =over 4 =item B<--backend-collect-timeout=SECONDS_BEFORE_KILL> Time before OCS kills modules processing which don't end before the timeout. =item B<--basevardir>=I<DIR> Indicate the place where the agent should store its files. =item B<-d>, B<--daemon> Launch ocsinventory-agent in background. Proc::Daemon is needed. =item B<--debug> Turn the debug mode on. =item B<--devlib> This option is designed for backend module developer. With it enabled, ocsinventry-agent won't try to load the Backend module installed on the system. Instead it will scan the ./lib directory. =item B<--delaytime=SECONDS_TO_WAIT> This option defaults to waiting a random() time between 0 and 3600 before initially contacting the server assuming NO PROLOG_FREQ has been set. Once PROLOG_FREQ has been set, it uses that number at the top end of it's random setting. Useful for pre-setting a deployed agent's initial start time (so you don't jam the server all at once, but don't have to wait an hour to make sure the deployment worked). =item B<-f>, B<--force> The agent will first contact the server during the PROLOG period. If the server doesn't know the machine or has outdated information, it will ask for an inventory. With this option, the agent doesn't run the PROLOG with the server first but directly sends an inventory. =item B<-i>, B<--info> Turn the verbose mode on. The flag is ignored if B<--debug> is enable. =item B<--lazy> Do not contact the server more than one time during the PROLOG_FREQ and do an exit if there is nothing to do. Useful if you want to start the agent script regulary from the crontab but don't want to overload the server. =item B<-l>, B<--local>=I<DIR> Write an inventory in the I<DIR> directory. A new file will be created if needed. =item B<--logfile>=I<FILE> Log message in I<FILE> and turn off STDERR =item B<-p>, B<--password>=I<PASSWORD> Use I<PASSWORD> for an HTTP identification with the server. =item B<-P>, B<--proxy>=I<PROXY> Use I<PROXY> to specify a proxy HTTP server. By default, the agent uses HTTP_PROXY environment variable. =item B<-r>, B<--realm>=I<REALM> Use I<REALM> for an HTTP identification with the server. For example, the value can be 'Restricted Area'. You can find it in the login popup of your Internet browser. =item B<-s>, B<--server>=I<URI> The uri of the server. If I<URI> doesn't start with http:// or https://, the assume the parameter is a hostname and rewrite it like that: % http://servername/ocsinventory If you want to use https or another virtual directory you need to enter the full path. B<--server> is ignored if B<--local> is in use. =item B<--stdout> Print the inventory on stdout. % ocsinventory-agent --stdout > /tmp/report.xml # prepare an inventory and write it in the /tmp/report.xml file. # A file will be created. =item B<--scan-homedirs> Authorized OCS to scan home directories to increase the Virtual Machine inventory. WARNING: beware with user privacy by using this option because it may encounter private data scans (even if it's not designed for !). =item B<--ssl>=I<0|1> Check SSL communications using a certificate. Set to 0 if you want to disable certificate check or 1 to enable (needs CA certificate path in this case) . Default is set to 1. =item B<--ca>=I<FILE> Path to CA certificate chain file in PEM format, for server SSL certificate validation. Set to <your server configuration directory>/cacert.pem by default. =item B<--tag>=I<TAG> Mark the machine with the I<TAG> tag. Once the initial inventory is accepted by the server this value is ignored and you've to change the information directly on the server. The server do so in order to centralize the administration of the machine. =item B<-u> I<USER>, B<--user>=I<USER> Use I<USER> for the server authentication. =item B<--version>=I<USER> Print the version and exit. =item B<-w> I<DURATION>, B<--wait>=I<DURATION> Wait before initializing the connexion with the server. If I<DURATION> equal I<server> the agent will use the PROLOG_FREQ of the server to determine the duration of this periode. Exactly like it would had done if it was in --daemon mode. Else if duration is a numerical value, it will be used directly. % ocsinventory-agent --wait 5 --server localhost =item B<--nosoftware> Do not inventory the software installed on the machine. B<--nosoft> also works but is deperecated. =item B<--nolocal> Deactivate local mode even if it is set in config file or command line =back =head1 CONFIG FILE The agent try to initialize the settings from the B<ocsinventory-agent.cfg> config file. It looks for the file in these directories: =over =item /etc/ocsinventory =item /usr/local/etc/ocsinventory =item /etc/ocsinventory-agent =back =head1 AUTHORS The maintainer is Guillaume PROTET <guillaume.protet@mortheres.info> Please read the AUTHORS, Changes and THANKS files to see who is behind OCS Inventory Agent. =head1 SEE ALSO =over 4 =item OCS-Inventory website, http://www.ocsinventory-ng.org/ =item LaunchPad project page, http://launchpad.net/ocsinventory-unix-agent =item forum, http://forums.ocsinventory-ng.org/ =item and wiki http://wiki.ocsinventory-ng.org/ =back =head1 BUGS Please, use the forum as much as possible. You can open your own bug tickets. Patches are welcome. You can also use LaunchPad bugtracker or push your Bazaar branch on LaunchPad and do a merge request. =head1 COPYRIGHT Copyright (C) 2006-2016 OCS Inventory contributors This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA =cut ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������UnixAgent-2.4.2/postinst.pl�������������������������������������������������������������������������0000775�0000000�0000000�00000044123�13327377321�0015660�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!/usr/bin/perl -w use strict; use lib 'lib'; use Cwd; use Ocsinventory::Agent::Config; my $old_unix_agent_dir = "/etc/ocsinventory-client"; my $config; my @cacert; my $binpath; my $randomtime; my $crontab; my $cron_line; my $option; my $nowizard; my $configdir; my $remove_old_unix; my $old_unix_config; my $nossl; my $download; my $snmp; my $now; for $option (@ARGV){ if ($option=~/--nowizard$/){ $nowizard = 1; } elsif($option=~/--server=(\S*)$/){ $config->{server} = $1; } elsif($option=~/--basevardir=(\S*)$/){ $config->{basevardir} = $1; } elsif($option=~/--configdir=(\S*)$/){ $configdir = $1; } elsif($option=~/--user=(\S*)$/){ $config->{user} = $1; } elsif($option=~/--password=(\S*)$/){ $config->{password} = $1; } elsif($option=~/--realm=(\S*)$/){ $config->{realm} = $1; } elsif($option=~/--tag=(\S*)$/){ $config->{tag} = $1; } elsif($option=~/--crontab$/){ $crontab = 1; } elsif($option=~/--get-old-unix-agent-config$/){ $old_unix_config = 1; } elsif($option=~/--remove-old-unix-agent$/){ $remove_old_unix = 1; } elsif($option=~/--debug$/){ $config->{debug} = 1; } elsif($option=~/--logfile=(\S*)$/){ $config->{logfile} = $1; } elsif($option=~/--nossl$/){ $nossl = 1; } elsif($option=~/--ca=(\S*)$/){ $config->{ca} = $1; } elsif($option=~/--download$/){ $download = 1; } elsif($option=~/--snmp$/){ $snmp = 1; } elsif($option=~/--now$/){ $now = 1; } elsif($option=~/--help/ || $option=~/-h/) { print STDERR <<EOF; Usage : \t--nowizard launch this script without interaction \t--server=url set OCS Inventory NG server address (e.g: http://ocsinventory-ng/ocsinventory) \t--basevardir=path set OCS Inventory NG Unix Unified agent variables directory (e.g: /var/lib/ocsinventory-agent) \t--configdir=path set OCS Inventory NG Unix Unified configuration directory (e.g: /etc/ocsinventory-agent) \t--user=username set username for OCS Inventory server Apache authentication (if needed) \t--password=password set password for OCS Inventory NG server Apache authentication (if needed) \t--realm=realm set realm name for OCS Inventory NG server Apache authentication (if needed) \t--crontab set a crontab while installing OCS Inventory NG Unix Unified agent \t--get-old-unix-agent-config retrieve old OCS Inventory NG Unix agent configuration (if needed) \t--remove-old-unix-agent remove old OCS Inventory NG Unix agent from system (if needed) \t--debug activate debug mode configuration option while installing OCS Inventory NG Unix Unified agent \t--logfile=path set OCS Inventory NG Unix Unified agent log file path (if needed) \t--nossl disable SSL CA verification configuration option while installing OCS Inventory NG Unix Unified agent (not recommended) \t--ca=path set OCS Inventory NG Unix Unified agent CA certificate chain file path \t--download activate package deployment feature while installing OCS Inventory NG Unix Unified agent \t--snmp activate SNMP scans feature while installing OCS Inventory NG Unix Unified agent \t--now launch OCS Inventory NG Unix Unified agent after installation \t-h --help display this help EOF exit 0; } } loadModules (qw/XML::Simple ExtUtils::MakeMaker/); ############ Setting default values ############ my @default_configdirs = ("/etc/ocsinventory", "/usr/local/etc/ocsinventory", "/etc/ocsinventory-agent"); unless ($config->{basevardir}) { if ($^O =~ /solaris/) { $config->{basevardir} = '/var/opt/ocsinventory-agent'; } elsif ($^O =~ /bsd/) { $config->{basevardir} = '/var/db/ocsinventory-agent'; } else { $config->{basevardir} = '/var/lib/ocsinventory-agent' } } ############ Asking for questions ############## unless ($nowizard) { if (!ask_yn("Do you want to configure the agent", 'y')) { exit 0; } unless ($configdir) { $configdir = getConfigDir (@default_configdirs); #If not found unless (-d $configdir) { $configdir = askConfigDir (@default_configdirs); unless (-d $configdir) { unless (ask_yn ("Do you want to create the directory ".$configdir."?", 'y')) { die("Please create ".$configdir." directory first.\n"); } } } } #Old unix agent if (ask_yn("Should the old unix_agent settings be imported ?", 'y')) { $old_unix_config=1; } #Getting agent configuration if exists if (-f $configdir."/ocsinventory-agent.cfg") { open (CONFIG, "<".$configdir."/ocsinventory-agent.cfg") or die "Can't open ".$configdir."/ocsinventory-agent.cfg: ".$!; foreach (<CONFIG>) { s/#.+//; if (/(\w+)\s*=\s*(.+)/) { my $key = $1; my $val = $2; # Remove the quotes $val =~ s/\s+$//; $val =~ s/^'(.*)'$/$1/; $val =~ s/^"(.*)"$/$1/; $config->{$key} = $val unless $config->{$key}; } } close CONFIG; } #Getting server name print "[info] The config file will be written in $configdir/ocsinventory-agent.cfg,\n"; $config->{server} = promptUser('What is the address of your ocs server',$config->{server}); #$config->{server} = promptUser('What is the address of your ocs server', exists ($config->{server})?$config->{server}:'ocsinventory-ng'); #Getting credentials if needed if (ask_yn ("Do you need credential for the server? (You probably don't)", 'n')) { $config->{user} = promptUser("user", $config->{user}); $config->{password} = promptUser("password"); print "[info] The realm can be found in the login popup of your Internet browser.\n[info] In general, it's something like 'Restricted Area'.\n"; $config->{realm} = promptUser("realm"); } #Getting tag unless ($config->{tag}){ if (ask_yn('Do you want to apply an administrative tag on this machine', 'y')) { $config->{tag} = promptUser("tag", $config->{tag}); } } #Getting crontab if ($^O =~ /solaris/ || $^O =~ /bsd/) { if (ask_yn("Do yo want to install the cron task in current user crontab ?", 'y')) { $crontab = 1; } } elsif (-d "/etc/cron.d") { if (ask_yn("Do yo want to install the cron task in /etc/cron.d", 'y')) { $crontab = 1; } } #Getting basevardir $config->{basevardir} = promptUser('Where do you want the agent to store its files? (You probably don\'t need to change it)', $config->{basevardir}, '^\/\w+', 'The location must begin with /'); unless (-d $config->{basevardir}) { unless (ask_yn ("Do you want to create the ".$config->{basevardir}." directory?\n", 'y')) { die("Please create the ".$config->{basevardir}." directory manually and relaunch postinst.pl script\n"); } } #Remove old unix agent ? $remove_old_unix = ask_yn ("Should I remove the old unix_agent", 'n') unless $remove_old_unix; #Enable debug option ? $config->{debug} = ask_yn("Do you want to activate debug configuration option ?", 'y') unless $config->{debug}; #Enable log file ? unless ($config->{logfile}) { if (ask_yn("Do you want to use OCS Inventory NG UNix Unified agent log file ?", 'y')){ $config->{logfile} = promptUser('Specify log file path you want to use', $config->{logfile}, '^\/\w+', 'The location must begin with /'); } } #Disable SSL option ? unless ($nossl) { $nossl = ask_yn("Do you want disable SSL CA verification configuration option (not recommended) ?", 'n'); } #Set CA certificate path ? unless ($config->{ca}) { if (ask_yn("Do you want to set CA certificate chain file path ?", 'y')){ $config->{ca} = promptUser('Specify CA certificate chain file path', $config->{ca}, '^\/\w+', 'The location must begin with /'); } } #Enable download feature ? $download = ask_yn("Do you want to use OCS-Inventory software deployment feature?", 'y') unless $download; #Enable SNMP feature ? $snmp = ask_yn("Do you want to use OCS-Inventory SNMP scans feature?", 'y') unless $snmp; #Run agent after configuration ? $now = ask_yn("Do you want to send an inventory of this machine?", 'y') unless $now; } ################ Here we go... ############## #Old unix agent if (-f $old_unix_agent_dir.'/ocsinv.conf' && $old_unix_config) { print STDERR "Getting old OCS Inventory NG Unix agent configuration...\n"; my $ocsinv = XMLin($old_unix_agent_dir.'/ocsinv.conf'); $config->{server} = mkFullServerUrl($ocsinv->{'OCSFSERVER'}); if (-f $old_unix_agent_dir.'/cacert.pem') { open CACERT, $old_unix_agent_dir.'/cacert.pem' or die "Can't import the CA certificate: ".$!; @cacert = <CACERT>; close CACERT; } my $admcontent = ''; if (-f "$old_unix_agent_dir/ocsinv.adm") { if (!open(ADM, "<:encoding(iso-8859-1)", "$old_unix_agent_dir/ocsinv.adm")) { warn "Can't open $old_unix_agent_dir/ocsinv.adm"; } else { $admcontent .= $_ foreach (<ADM>); close ADM; my $admdata = XMLin($admcontent) or die; if (ref ($admdata->{ACCOUNTINFO}) eq 'ARRAY') { foreach (@{$admdata->{ACCOUNTINFO}}) { $config->{tag} = $_->{KEYVALUE} if $_->{KEYNAME} =~ /^TAG$/; } } elsif ( exists($admdata->{ACCOUNTINFO}->{KEYNAME}) && exists($admdata->{ACCOUNTINFO}->{KEYVALUE}) && $admdata->{ACCOUNTINFO}->{KEYNAME} eq 'TAG' ){ print $admdata->{ACCOUNTINFO}->{KEYVALUE}."\n"; $config->{tag} = $admdata->{ACCOUNTINFO}->{KEYVALUE}; } } } } #Setting server uri print STDERR "Setting OCS Inventory NG server address...\n"; $config->{server}="ocsinventory-ng" unless $config->{server}; $config->{server} = mkFullServerUrl($config->{server}); if (!$config->{server}) { print "Server is empty. Leaving...\n"; exit 1; } my $uri; if ($config->{server} =~ /^http(|s):\/\//) { $uri = $config->{server}; } else { # just the hostname $uri = "http://".$config->{server}."/ocsinventory" } #Is OCS agent well installed ? print STDERR "Looking for OCS Invetory NG Unix Unified agent installation...\n"; chomp($binpath = `which ocsinventory-agent 2>/dev/null`); if (! -x $binpath) { # Packaged version with perl and agent ? $binpath = $^X; $binpath =~ s/perl/ocsinventory-agent/; } if (! -x $binpath) { print "sorry, can't find ocsinventory-agent in \$PATH\n"; exit 1; } else { print "ocsinventory agent presents: $binpath\n"; } #Setting crontab $randomtime = int(rand(60)).' '.int(rand(24)); $cron_line = $randomtime." * * * root $binpath --lazy > /dev/null 2>&1\n"; if ($crontab) { print STDERR "Setting crontab...\n"; if ($^O =~ /solaris/ || $^O =~ /bsd/) { my $cron = `crontab -l`; # Let's suppress Unix cron/anacron user column $cron_line =~ s/ root / /; $cron .= $cron_line; open CRONP, "| crontab" || die "Can't run crontab: $!"; print CRONP $crontab; close(CRONP); } elsif (-d "/etc/cron.d") { open DEST, '>/etc/cron.d/ocsinventory-agent' or die $!; # Save the root PATH print DEST "PATH=".$ENV{PATH}."\n"; print DEST $randomtime." * * * root $binpath --lazy > /dev/null 2>&1\n"; close DEST; } } #Creating basevardir if (!-d $config->{basevardir}) { print STDERR "Creating $config->{basevardir} directory...\n"; mkdir $config->{basevardir} or die $!; } #Disabling SSL verification if asked $config->{ssl} = 0 if $nossl; #Creating configuration directory $configdir = "/etc/ocsinventory-agent" unless $configdir; #If not set in command line if (grep (/$configdir/,@default_configdirs)) { $configdir = '/etc/ocsinventory-agent' unless $configdir; print STDERR "Creating $configdir directory...\n"; unless (-d $configdir) { unless (mkdir $configdir) { die("Failed to create ".$configdir.". Are you root?\n"); } } print STDERR "Writing OCS Inventory NG Unix Unified agent configuration\n"; open CONFIG, ">$configdir/ocsinventory-agent.cfg" or die "Can't write the config file in $configdir: ".$!; print CONFIG $_."=".$config->{$_}."\n" foreach (keys %$config); close CONFIG; chmod 0600, "$configdir/ocsinventory-agent.cfg"; } else { die("Wrong configuration directory...please choose a directory supported by OCS Inventory NG agent !!!\n"); } #Removing old unix agent if needed if ($remove_old_unix) { print STDERR "Removing old OCS Inventory Unix agent...\n"; foreach (qw# /etc/ocsinventory-client /etc/logrotate.d/ocsinventory-client /usr/sbin/ocsinventory-client.pl /etc/cron.d/ocsinventory-client /bin/ocsinv #) { print $_."\n"; next; rmdir if -d; unlink if -f || -l; } print "done\n" } # Creating vardirectory for this server my $dir = $config->{server}; $dir =~ s/\//_/g; my $vardir = $config->{basevardir}."/".$dir; print STDERR "Creating $vardir directory...\n"; recMkdir($vardir) or die "Can't create $vardir!"; if (@cacert) { # we need to migrate the certificate print STDERR "Copying cacert.pem in $vardir...\n"; open CACERT, ">".$vardir."/cacert.pem" or die "Can't open ".$vardir.'/cacert.pem: '.$!; print CACERT foreach (@cacert); close CACERT; print "Certificate copied in ".$vardir."/cacert.pem\n"; } #We copy custom XML for SNMP MIBs from sources my $workdir = getcwd(); my $source_snmpdir = "$workdir/snmp"; my $snmpdir = "$vardir/snmp"; if ( -d $source_snmpdir && -d $vardir) { unless (-d $snmpdir) { print STDERR "Creating $snmpdir directory...\n"; recMkdir($snmpdir) or die "Can't create $snmpdir!"; } print STDERR "Copying SNMP MIBs XML files...\n"; system("cp -r $source_snmpdir/* $snmpdir"); } print STDERR "Activating modules if needed...\n"; open MODULE, ">$configdir/modules.conf" or die "Can't write modules.conf in $configdir: ".$!; print MODULE "# this list of module will be load by the at run time\n"; print MODULE "# to check its syntax do:\n"; print MODULE "# #perl modules.conf\n"; print MODULE "# You must have NO error. Else the content will be ignored\n"; print MODULE "# This mechanism goal is to launch agent extension modules\n"; print MODULE "\n"; print MODULE ($download?'':'#'); print MODULE "use Ocsinventory::Agent::Modules::Download;\n"; print MODULE ($snmp?'':'#'); print MODULE "use Ocsinventory::Agent::Modules::Snmp;\n"; print MODULE "\n"; print MODULE "# DO NOT REMOVE THE 1;\n"; print MODULE "1;\n"; close MODULE; #Prevent security risks by removing existing snmp_com.txt file which is no longer used my $snmp_com_file = "$snmpdir/snmp_com.txt"; if ( -f $snmp_com_file ) { print STDERR "$snmp_com_file seems to exists...removing it to prevent security risks !\n"; unlink $snmp_com_file; } # Launch agent if asked if ($now) { print STDERR "Launching OCS Inventory NG Unix Unified agent...\n"; system("$binpath --force"); if (($? >> 8)==0) { print " -> Success!\n"; } else { print " -> Failed!\n"; print "You may want to launch the agent with the --verbose or --debug flag.\n"; } } #End print "New settings written! Thank you for using OCS Inventory\n"; ######## Subroutines ################ sub loadModules { my @modules = @_; foreach (@modules) { eval "use $_;"; if ($@) { print STDERR "Failed to load $_. Please install it and restart the postinst.pl script ( ./postinst.pl ).\n"; exit 1; } } } sub ask_yn { my $promptUser = shift; my $default = shift; die unless $default =~ /^(y|n)$/; my $cpt = 5; while (1) { my $line = prompt("$promptUser\nPlease enter 'y' or 'n'?>", $default); return 1 if $line =~ /^y$/; return if $line =~ /^n$/; if ($cpt-- < 0) { print STDERR "to much user input, exit...\n"; exit(0); } } } sub promptUser { my ($promptUser, $default, $regex, $notice) = @_; my $string = $promptUser; $string .= "?>"; my $line; my $cpt = 5; while (1) { $line = prompt($string, $default); if ($regex && $line !~ /$regex/) { print STDERR $notice."\n"; } else { last; } if ($cpt-- < 0) { print STDERR "to much user input, exit...\n"; exit(0); } } return $line; } sub getConfigDir { my @choices = @_; foreach (@choices) { my $t = $_.'/ocsinventory-agent.cfg'; if (-f $t) { print "Config file found are $t! Reusing it.\n"; return $_; } } } sub askConfigDir { my @choices = @_; print STDERR "Where do you want to write the configuration file?\n"; foreach (0..$#choices) { print STDERR " ".$_." -> ".$choices[$_]."\n"; } my $input = -1; my $configdir; while (1) { $input = prompt("?>"); if ($input =~ /^\d+$/ && $input >= 0 && $input <= $#choices) { last; } else { print STDERR "Value must be between 0 and ".$#choices."\n"; } } return $choices[$input]; } sub recMkdir { my $dir = shift; my @t = split /\//, $dir; shift @t; return unless @t; my $t; foreach (@t) { $t .= '/'.$_; if ((!-d $t) && (!mkdir $t)) { return; } } 1; } sub mkFullServerUrl { my $server = shift; my $ret = 'http://' unless $server =~ /^http(s|):\/\//; $ret .= $server; if ($server !~ /http(|s):\/\/\S+\/\S+/) { $ret .= '/ocsinventory'; } return $ret; } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������UnixAgent-2.4.2/resources/��������������������������������������������������������������������������0000775�0000000�0000000�00000000000�13327377321�0015443�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������UnixAgent-2.4.2/resources/cpuinfo/������������������������������������������������������������������0000775�0000000�0000000�00000000000�13327377321�0017106�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������UnixAgent-2.4.2/resources/cpuinfo/cpuinfo-vmware-esx������������������������������������������������0000664�0000000�0000000�00000000000�13327377321�0022556�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������UnixAgent-2.4.2/resources/cpuinfo/linux-686-1�������������������������������������������������������0000664�0000000�0000000�00000001134�13327377321�0020646�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������processor : 0 vendor_id : GenuineIntel cpu family : 6 model : 13 model name : Intel(R) Pentium(R) M processor 1.73GHz stepping : 8 cpu MHz : 1729.038 cache size : 2048 KB fdiv_bug : no hlt_bug : no f00f_bug : no coma_bug : no fpu : yes fpu_exception : yes cpuid level : 2 wp : yes flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat clflush dts acpi mmx fxsr sse sse2 ss tm pbe nx bts est tm2 bogomips : 3462.27 clflush size : 64 power management: ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������UnixAgent-2.4.2/resources/cpuinfo/linux-alpha-1�����������������������������������������������������0000664�0000000�0000000�00000001550�13327377321�0021412�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������cpu : Alpha cpu model : EV68CB cpu variation : 7 cpu revision : 0 cpu serial number : JA30502089 system type : Titan system variation : Privateer system revision : 0 system serial number : AY31001636 cycle frequency [Hz] : 1250000000 timer frequency [Hz] : 1024.00 page size [bytes] : 8192 phys. address bits : 44 max. addr. space # : 255 BogoMIPS : 2484.04 kernel unaligned acc : 0 (pc=0,va=0) user unaligned acc : 0 (pc=0,va=0) platform string : AlphaServer ES45 Model 3B cpus detected : 3 cpus active : 3 cpu active mask : 0000000000000007 L1 Icache : 64K, 2-way, 64b line L1 Dcache : 64K, 2-way, 64b line L2 cache : n/a L3 cache : n/a ��������������������������������������������������������������������������������������������������������������������������������������������������������UnixAgent-2.4.2/resources/cpuinfo/linux-armel-1�����������������������������������������������������0000664�0000000�0000000�00000001130�13327377321�0021417�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������Processor : XScale-80219 rev 0 (v5l) BogoMIPS : 593.10 Features : swp half fastmult edsp CPU implementer : 0x69 CPU architecture: 5TE CPU variant : 0x0 CPU part : 0x2e3 CPU revision : 0 Cache type : undefined 5 Cache clean : undefined 5 Cache lockdown : undefined 5 Cache format : Harvard I size : 32768 I assoc : 32 I line length : 32 I sets : 32 D size : 32768 D assoc : 32 D line length : 32 D sets : 32 Hardware : Thecus N2100 Revision : 0000 Serial : 0000000000000000 ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������UnixAgent-2.4.2/resources/cpuinfo/linux-ia64-1������������������������������������������������������0000664�0000000�0000000�00000001033�13327377321�0021064�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������processor : 0 vendor : GenuineIntel arch : IA-64 family : Itanium 2 model : 2 revision : 1 archrev : 0 features : branchlong cpu number : 0 cpu regs : 4 cpu MHz : 1600.000009 itc MHz : 1600.009464 BogoMIPS : 2392.06 siblings : 1 processor : 1 vendor : GenuineIntel arch : IA-64 family : Itanium 2 model : 2 revision : 1 archrev : 0 features : branchlong cpu number : 0 cpu regs : 4 cpu MHz : 1600.000009 itc MHz : 1600.009464 BogoMIPS : 2392.06 siblings : 1 �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������UnixAgent-2.4.2/resources/cpuinfo/linux-mips-1������������������������������������������������������0000664�0000000�0000000�00000000644�13327377321�0021300�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������system type : SGI Indigo2 processor : 0 cpu model : R4400SC V5.0 FPU V0.0 BogoMIPS : 74.75 wait instruction : no microsecond timers : yes tlb_entries : 48 extra interrupt vector : no hardware watchpoint : yes ASEs implemented : shadow register sets : 1 VCED exceptions : 640580539 VCEI exceptions : 9972559 ��������������������������������������������������������������������������������������������UnixAgent-2.4.2/resources/cpuinfo/linux-ppc-1�������������������������������������������������������0000664�0000000�0000000�00000000406�13327377321�0021106�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������processor : 0 cpu : 604r clock : ??? revision : 49.2 (pvr 0009 3102) bogomips : 299.00 machine : PReP Utah (Powerstack II Pro4000) l2 cache : 512KiB, parity disabled SRAM:synchronous, pipelined, no parity ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������UnixAgent-2.4.2/resources/cpuinfo/linux-ppc-2�������������������������������������������������������0000664�0000000�0000000�00000000427�13327377321�0021112�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������processor : 0 cpu : POWER4+ (gq) clock : 1452.000000MHz revision : 2.1 processor : 1 cpu : POWER4+ (gq) clock : 1452.000000MHz revision : 2.1 timebase : 181495202 machine : CHRP IBM,7029-6C3 �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������UnixAgent-2.4.2/resources/cpuinfo/linux-sparc-1�����������������������������������������������������0000664�0000000�0000000�00000000615�13327377321�0021436�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������cpu : TI UltraSparc IIIi (Jalapeno) fpu : UltraSparc IIIi integrated FPU prom : OBP 4.13.2 2004/03/29 10:11 type : sun4u ncpus probed : 2 ncpus active : 2 D$ parity tl1 : 0 I$ parity tl1 : 0 Cpu0ClkTck : 000000003bb94e80 Cpu1ClkTck : 000000003bb94e80 MMU Type : Cheetah+ State: CPU0: online CPU1: online �������������������������������������������������������������������������������������������������������������������UnixAgent-2.4.2/resources/dmidecode-freebsd-6.2�����������������������������������������������������0000664�0000000�0000000�00000014471�13327377321�0021225�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������# dmidecode 2.8 SMBIOS 2.3 present. 25 structures occupying 643 bytes. Table at 0x000F0800. Handle 0x0000, DMI type 1, 25 bytes System Information Manufacturer: Product Name: Version: Serial Number: UUID: Not Present Wake-up Type: Power Switch Handle 0x0001, DMI type 2, 8 bytes Base Board Information Manufacturer: Product Name: CN700-8237R Version: Serial Number: Handle 0x0002, DMI type 3, 17 bytes Chassis Information Manufacturer: Type: Desktop Lock: Not Present Version: Serial Number: Asset Tag: Boot-up State: Unknown Power Supply State: Unknown Thermal State: Unknown Security Status: Unknown OEM Information: 0x00000000 Handle 0x0003, DMI type 4, 35 bytes Processor Information Socket Designation: NanoBGA2 Type: Central Processor Family: Other Manufacturer: VIA ID: A9 06 00 00 FF BB C9 A7 Version: VIA C7 Voltage: 1.1 V External Clock: 100 MHz Max Speed: 2000 MHz Current Speed: 2000 MHz Status: Populated, Enabled Upgrade: None L1 Cache Handle: 0x0006 L2 Cache Handle: 0x0007 L3 Cache Handle: Not Provided Serial Number: Asset Tag: Part Number: Handle 0x0004, DMI type 5, 18 bytes Memory Controller Information Error Detecting Method: None Error Correcting Capabilities: None Supported Interleave: Eight-way Interleave Current Interleave: Four-way Interleave Maximum Memory Module Size: 1024 MB Maximum Total Memory Size: 1024 MB Supported Speeds: 70 ns 60 ns Supported Memory Types: DIMM SDRAM Memory Module Voltage: 2.9 V Associated Memory Slots: 1 0x0005 Enabled Error Correcting Capabilities: None Handle 0x0005, DMI type 6, 12 bytes Memory Module Information Socket Designation: A0 Bank Connections: 0 Current Speed: 37 ns Type: Other Installed Size: 512 MB (Single-bank Connection) Enabled Size: 512 MB (Single-bank Connection) Error Status: OK Handle 0x0006, DMI type 7, 19 bytes Cache Information Socket Designation: Internal Cache Configuration: Enabled, Not Socketed, Level 1 Operational Mode: Write Back Location: Internal Installed Size: 32 KB Maximum Size: 32 KB Supported SRAM Types: Synchronous Installed SRAM Type: Synchronous Speed: Unknown Error Correction Type: Unknown System Type: Unknown Associativity: 4-way Set-associative Handle 0x0007, DMI type 7, 19 bytes Cache Information Socket Designation: Internal Cache Configuration: Enabled, Not Socketed, Level 2 Operational Mode: Write Back Location: External Installed Size: 0 KB Maximum Size: 0 KB Supported SRAM Types: Synchronous Installed SRAM Type: Synchronous Speed: Unknown Error Correction Type: Unknown System Type: Unknown Associativity: Unknown Handle 0x0008, DMI type 8, 9 bytes Port Connector Information Internal Reference Designator: PRIMARY IDE Internal Connector Type: On Board IDE External Reference Designator: Not Specified External Connector Type: None Port Type: Other Handle 0x0009, DMI type 8, 9 bytes Port Connector Information Internal Reference Designator: SECONDARY IDE Internal Connector Type: On Board IDE External Reference Designator: Not Specified External Connector Type: None Port Type: Other Handle 0x000A, DMI type 8, 9 bytes Port Connector Information Internal Reference Designator: FDD Internal Connector Type: On Board Floppy External Reference Designator: Not Specified External Connector Type: None Port Type: 8251 FIFO Compatible Handle 0x000B, DMI type 8, 9 bytes Port Connector Information Internal Reference Designator: COM1 Internal Connector Type: 9 Pin Dual Inline (pin 10 cut) External Reference Designator: External Connector Type: DB-9 male Port Type: Serial Port 16450 Compatible Handle 0x000C, DMI type 8, 9 bytes Port Connector Information Internal Reference Designator: COM2 Internal Connector Type: 9 Pin Dual Inline (pin 10 cut) External Reference Designator: External Connector Type: DB-9 male Port Type: Serial Port 16450 Compatible Handle 0x000D, DMI type 8, 9 bytes Port Connector Information Internal Reference Designator: LPT1 Internal Connector Type: DB-25 female External Reference Designator: External Connector Type: DB-25 female Port Type: Parallel Port ECP/EPP Handle 0x000E, DMI type 8, 9 bytes Port Connector Information Internal Reference Designator: Keyboard Internal Connector Type: PS/2 External Reference Designator: External Connector Type: PS/2 Port Type: Keyboard Port Handle 0x000F, DMI type 8, 9 bytes Port Connector Information Internal Reference Designator: PS/2 Mouse Internal Connector Type: PS/2 External Reference Designator: External Connector Type: PS/2 Port Type: Mouse Port Handle 0x0010, DMI type 8, 9 bytes Port Connector Information Internal Reference Designator: Not Specified Internal Connector Type: None External Reference Designator: USB0 External Connector Type: Other Port Type: USB Handle 0x0011, DMI type 9, 13 bytes System Slot Information Designation: PCI0 Type: 32-bit PCI Current Usage: Available Length: Long ID: 1 Characteristics: 5.0 V is provided PME signal is supported Handle 0x0012, DMI type 13, 22 bytes BIOS Language Information Installable Languages: 3 n|US|iso8859-1 r|CA|iso8859-1 a|JP|unicode Currently Installed Language: n|US|iso8859-1 Handle 0x0013, DMI type 16, 15 bytes Physical Memory Array Location: System Board Or Motherboard Use: System Memory Error Correction Type: None Maximum Capacity: 512 MB Error Information Handle: Not Provided Number Of Devices: 1 Handle 0x0014, DMI type 17, 27 bytes Memory Device Array Handle: 0x0013 Error Information Handle: Not Provided Total Width: Unknown Data Width: Unknown Size: 512 MB Form Factor: DIMM Set: None Locator: A0 Bank Locator: Bank0/1 Type: Unknown Type Detail: None Speed: Unknown Manufacturer: None Serial Number: None Asset Tag: None Part Number: None Handle 0x0015, DMI type 19, 15 bytes Memory Array Mapped Address Starting Address: 0x00000000000 Ending Address: 0x0001FFFFFFF Range Size: 512 MB Physical Array Handle: 0x0013 Partition Width: 0 Handle 0x0016, DMI type 20, 19 bytes Memory Device Mapped Address Starting Address: 0x00000000000 Ending Address: 0x0001FFFFFFF Range Size: 512 MB Physical Device Handle: 0x0014 Memory Array Mapped Address Handle: 0x0015 Partition Row Position: 1 Handle 0x0017, DMI type 32, 11 bytes System Boot Information Status: No errors detected Handle 0x0018, DMI type 127, 4 bytes End Of Table �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������UnixAgent-2.4.2/resources/dmidecode-linux-2.6�������������������������������������������������������0000664�0000000�0000000�00000032757�13327377321�0020761�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������# dmidecode 2.8 SMBIOS 2.3 present. 60 structures occupying 2446 bytes. Table at 0x000F7860. Handle 0xDA00, DMI type 218, 125 bytes OEM-specific Type Header and Data: DA 7D 00 DA B2 00 0D 5F 0F 37 40 7D 00 00 00 00 00 7E 00 02 00 00 00 40 00 04 00 01 00 41 00 04 00 00 00 90 00 05 00 00 00 91 00 05 00 01 00 92 00 05 00 02 00 45 01 45 01 01 00 44 01 44 01 00 00 00 80 00 80 01 00 00 A0 00 A0 01 00 05 80 05 80 01 00 76 01 76 01 01 00 75 01 75 01 01 00 01 F0 01 F0 00 00 02 F0 02 F0 00 00 03 F0 03 F0 00 00 04 F0 04 F0 00 00 FF FF 00 00 00 00 Handle 0x0000, DMI type 0, 20 bytes BIOS Information Vendor: Dell Inc. Version: A06 Release Date: 10/02/2005 Address: 0xF0000 Runtime Size: 64 kB ROM Size: 576 kB Characteristics: ISA is supported PCI is supported PC Card (PCMCIA) is supported PNP is supported BIOS is upgradeable BIOS shadowing is allowed Boot from CD is supported Selectable boot is supported 3.5"/720 KB floppy services are supported (int 13h) Print screen service is supported (int 5h) 8042 keyboard services are supported (int 9h) Serial services are supported (int 14h) Printer services are supported (int 17h) CGA/mono video services are supported (int 10h) ACPI is supported USB legacy is supported AGP is supported Smart battery is supported BIOS boot specification is supported Function key-initiated network boot is supported Handle 0x0100, DMI type 1, 25 bytes System Information Manufacturer: Dell Inc. Product Name: Latitude D610 Version: Not Specified Serial Number: D8XD62J UUID: 44454C4C-3800-1058-8044-C4C04F36324A Wake-up Type: Power Switch Handle 0x0200, DMI type 2, 9 bytes Base Board Information Manufacturer: Dell Inc. Product Name: 0XD762 Version: Serial Number: .D8XD62J.CN4864363E7491. Handle 0x0300, DMI type 3, 13 bytes Chassis Information Manufacturer: Dell Inc. Type: Portable Lock: Not Present Version: Not Specified Serial Number: D8XD62J Asset Tag: Not Specified Boot-up State: Safe Power Supply State: Safe Thermal State: Safe Security Status: None Handle 0x0301, DMI type 126, 13 bytes Inactive Handle 0x0400, DMI type 4, 32 bytes Processor Information Socket Designation: Microprocessor Type: Central Processor Family: Pentium M Manufacturer: Intel ID: D8 06 00 00 FF FB E9 AF Signature: Type 0, Family 6, Model 13, Stepping 8 Flags: FPU (Floating-point unit on-chip) VME (Virtual mode extension) DE (Debugging extension) PSE (Page size extension) TSC (Time stamp counter) MSR (Model specific registers) PAE (Physical address extension) MCE (Machine check exception) CX8 (CMPXCHG8 instruction supported) APIC (On-chip APIC hardware supported) SEP (Fast system call) MTRR (Memory type range registers) PGE (Page global enable) MCA (Machine check architecture) CMOV (Conditional move instruction supported) PAT (Page attribute table) CLFSH (CLFLUSH instruction supported) DS (Debug store) ACPI (ACPI supported) MMX (MMX technology supported) FXSR (Fast floating-point save and restore) SSE (Streaming SIMD extensions) SSE2 (Streaming SIMD extensions 2) SS (Self-snoop) TM (Thermal monitor supported) PBE (Pending break enabled) Version: Not Specified Voltage: 3.3 V External Clock: 133 MHz Max Speed: 1800 MHz Current Speed: 1733 MHz Status: Populated, Enabled Upgrade: None L1 Cache Handle: 0x0700 L2 Cache Handle: 0x0701 L3 Cache Handle: Not Provided Handle 0x0700, DMI type 7, 19 bytes Cache Information Socket Designation: Not Specified Configuration: Enabled, Not Socketed, Level 1 Operational Mode: Write Back Location: Internal Installed Size: 8 KB Maximum Size: 8 KB Supported SRAM Types: Unknown Installed SRAM Type: Unknown Speed: Unknown Error Correction Type: None System Type: Data Associativity: 4-way Set-associative Handle 0x0701, DMI type 7, 19 bytes Cache Information Socket Designation: Not Specified Configuration: Enabled, Not Socketed, Level 2 Operational Mode: Varies With Memory Address Location: Internal Installed Size: 2048 KB Maximum Size: 2048 KB Supported SRAM Types: Pipeline Burst Installed SRAM Type: Pipeline Burst Speed: 15 ns Error Correction Type: None System Type: Unified Associativity: Other Handle 0x0800, DMI type 8, 9 bytes Port Connector Information Internal Reference Designator: PARALLEL Internal Connector Type: None External Reference Designator: Not Specified External Connector Type: DB-25 female Port Type: Parallel Port PS/2 Handle 0x0801, DMI type 8, 9 bytes Port Connector Information Internal Reference Designator: SERIAL1 Internal Connector Type: None External Reference Designator: Not Specified External Connector Type: DB-9 male Port Type: Serial Port 16550A Compatible Handle 0x0803, DMI type 126, 9 bytes Inactive Handle 0x0804, DMI type 8, 9 bytes Port Connector Information Internal Reference Designator: USB Internal Connector Type: None External Reference Designator: Not Specified External Connector Type: Access Bus (USB) Port Type: USB Handle 0x0805, DMI type 126, 9 bytes Inactive Handle 0x0806, DMI type 8, 9 bytes Port Connector Information Internal Reference Designator: MONITOR Internal Connector Type: None External Reference Designator: Not Specified External Connector Type: DB-15 female Port Type: Video Port Handle 0x0808, DMI type 126, 9 bytes Inactive Handle 0x0809, DMI type 8, 9 bytes Port Connector Information Internal Reference Designator: IrDA Internal Connector Type: None External Reference Designator: Not Specified External Connector Type: Infrared Port Type: Other Handle 0x080A, DMI type 126, 9 bytes Inactive Handle 0x080C, DMI type 8, 9 bytes Port Connector Information Internal Reference Designator: Modem Internal Connector Type: None External Reference Designator: Not Specified External Connector Type: RJ-11 Port Type: Modem Port Handle 0x080D, DMI type 8, 9 bytes Port Connector Information Internal Reference Designator: Ethernet Internal Connector Type: None External Reference Designator: Not Specified External Connector Type: RJ-45 Port Type: Network Port Handle 0x0900, DMI type 9, 13 bytes System Slot Information Designation: PCMCIA 0 Type: 32-bit PC Card (PCMCIA) Current Usage: Available Length: Other ID: Adapter 0, Socket 0 Characteristics: 5.0 V is provided 3.3 V is provided PC Card-16 is supported Cardbus is supported Zoom Video is supported Modem ring resume is supported Handle 0x0902, DMI type 126, 13 bytes Inactive Handle 0x0904, DMI type 9, 13 bytes System Slot Information Designation: MiniPCI Type: 32-bit Other Current Usage: Available Length: Other Characteristics: 5.0 V is provided 3.3 V is provided PME signal is supported Handle 0x0A00, DMI type 10, 6 bytes On Board Device Information Type: Video Status: Enabled Description: Intel 915GM Graphics Handle 0x0A01, DMI type 10, 6 bytes On Board Device Information Type: Sound Status: Enabled Description: Sigmatel 9751 Handle 0x0B00, DMI type 11, 5 bytes OEM Strings String 1: Dell System String 2: 5[0003] String 3: 13[PP11L] Handle 0x0D00, DMI type 13, 22 bytes BIOS Language Information Installable Languages: 1 en|US|iso8859-1 Currently Installed Language: en|US|iso8859-1 Handle 0x1000, DMI type 16, 15 bytes Physical Memory Array Location: System Board Or Motherboard Use: System Memory Error Correction Type: None Maximum Capacity: 4 GB Error Information Handle: Not Provided Number Of Devices: 2 Handle 0x1100, DMI type 17, 27 bytes Memory Device Array Handle: 0x1000 Error Information Handle: Not Provided Total Width: 64 bits Data Width: 64 bits Size: 1024 MB Form Factor: DIMM Set: None Locator: DIMM_A Bank Locator: Not Specified Type: DDR Type Detail: Synchronous Speed: 533 MHz (1.9 ns) Manufacturer: C100000000000000 Serial Number: 02132010 Asset Tag: Not Specified Part Number: Not Specified Handle 0x1101, DMI type 17, 27 bytes Memory Device Array Handle: 0x1000 Error Information Handle: Not Provided Total Width: 64 bits Data Width: 64 bits Size: 1024 MB Form Factor: DIMM Set: None Locator: DIMM_B Bank Locator: Not Specified Type: DDR Type Detail: Synchronous Speed: 533 MHz (1.9 ns) Manufacturer: C100000000000000 Serial Number: 02132216 Asset Tag: Not Specified Part Number: Not Specified Handle 0x1300, DMI type 19, 15 bytes Memory Array Mapped Address Starting Address: 0x00000000000 Ending Address: 0x0000009FFFF Range Size: 640 kB Physical Array Handle: 0x1000 Partition Width: 0 Handle 0x1301, DMI type 19, 15 bytes Memory Array Mapped Address Starting Address: 0x00000100000 Ending Address: 0x0007FFFFFFF Range Size: 2047 MB Physical Array Handle: 0x1000 Partition Width: 0 Handle 0x1400, DMI type 20, 19 bytes Memory Device Mapped Address Starting Address: 0x00000000000 Ending Address: 0x0000009FFFF Range Size: 640 kB Physical Device Handle: 0x1100 Memory Array Mapped Address Handle: 0x1300 Partition Row Position: 1 Handle 0x1401, DMI type 20, 19 bytes Memory Device Mapped Address Starting Address: 0x00000100000 Ending Address: 0x0003FFFFFFF Range Size: 1023 MB Physical Device Handle: 0x1100 Memory Array Mapped Address Handle: 0x1301 Partition Row Position: 1 Handle 0x1402, DMI type 20, 19 bytes Memory Device Mapped Address Starting Address: 0x00040000000 Ending Address: 0x0007FFFFFFF Range Size: 1 GB Physical Device Handle: 0x1101 Memory Array Mapped Address Handle: 0x1301 Partition Row Position: 1 Handle 0x1500, DMI type 21, 7 bytes Built-in Pointing Device Type: Touch Pad Interface: Bus Mouse Buttons: 2 Handle 0x1600, DMI type 22, 26 bytes Portable Battery Location: Sys. Battery Bay Manufacturer: Samsung SDI Name: DELL C129563 Design Capacity: 48000 mWh Design Voltage: 11100 mV SBDS Version: 1.0 Maximum Error: 3% SBDS Serial Number: 7734 SBDS Manufacture Date: 2006-03-11 SBDS Chemistry: LION OEM-specific Information: 0x00000001 Handle 0x1601, DMI type 126, 26 bytes Inactive Handle 0x1602, DMI type 126, 26 bytes Inactive Handle 0x1B00, DMI type 27, 12 bytes Cooling Device Type: Fan Status: OK OEM-specific Information: 0x0000DD00 Handle 0x1C00, DMI type 28, 20 bytes Temperature Probe Description: CPU Internal Temperature Location: Processor Status: OK Maximum Value: 127.0 deg C Minimum Value 0.0 deg C Resolution: 1.000 deg C Tolerance: 0.5 deg C Accuracy: Unknown OEM-specific Information: 0x0000DC00 Handle 0x2000, DMI type 32, 11 bytes System Boot Information Status: No errors detected Handle 0xB000, DMI type 176, 5 bytes OEM-specific Type Header and Data: B0 05 00 B0 00 Handle 0xB100, DMI type 177, 12 bytes OEM-specific Type Header and Data: B1 0C 00 B1 01 00 00 00 00 00 00 00 Handle 0xD000, DMI type 208, 10 bytes OEM-specific Type Header and Data: D0 0A 00 D0 01 04 FE 00 82 01 Handle 0xD100, DMI type 209, 12 bytes OEM-specific Type Header and Data: D1 0C 00 D1 00 00 00 03 04 07 80 05 Handle 0xD200, DMI type 210, 12 bytes OEM-specific Type Header and Data: D2 0C 00 D2 F8 03 04 03 06 80 04 05 Handle 0xD300, DMI type 211, 13 bytes OEM-specific Type Header and Data: D3 0D 00 D3 01 04 02 01 00 00 00 00 02 Strings: Back of System Handle 0xD800, DMI type 216, 9 bytes OEM-specific Type Header and Data: D8 09 00 D8 01 03 01 F0 03 Strings: Intel Corp. 1219 Handle 0xD900, DMI type 217, 8 bytes OEM-specific Type Header and Data: D9 08 00 D9 01 02 01 03 Strings: US-101 Proprietary Handle 0xDB00, DMI type 219, 9 bytes OEM-specific Type Header and Data: DB 09 00 DB 03 01 02 03 FF Strings: System Device Bay Floppy, Battery, CD-ROM, CD-RW, DVD, DVD+RW, DVD+/-RW, Hard Disk CDRW+DVD Handle 0xDB80, DMI type 126, 9 bytes Inactive Handle 0xDB81, DMI type 126, 9 bytes Inactive Handle 0x8100, DMI type 129, 8 bytes OEM-specific Type Header and Data: 81 08 00 81 01 01 02 01 Strings: Intel_ASF Dell_ASF_001 Handle 0xDC00, DMI type 220, 22 bytes OEM-specific Type Header and Data: DC 16 00 DC 01 F0 00 00 02 F0 00 00 00 00 03 F0 04 F0 00 00 00 00 Handle 0xDD00, DMI type 221, 19 bytes OEM-specific Type Header and Data: DD 13 00 DD 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 Handle 0xD400, DMI type 212, 237 bytes OEM-specific Type Header and Data: D4 ED 00 D4 70 00 71 00 00 10 2D 2E 5C 00 78 BF 40 5D 00 78 BF 00 65 00 21 F7 00 66 00 21 F7 08 5E 00 23 FE 01 5F 00 23 FE 00 F1 00 21 FC 00 F2 00 21 FC 01 F3 00 21 FC 02 0F 00 26 F8 00 11 00 26 F8 01 05 00 26 F8 02 12 00 26 F8 03 06 00 26 F8 04 31 00 26 8F 00 32 00 26 8F 10 33 00 26 8F 20 34 00 26 8F 30 35 00 26 8F 40 07 00 25 F8 00 0B 00 25 F8 01 0C 00 25 F8 02 0D 00 25 F8 03 28 00 23 F3 00 29 00 23 F3 04 2A 00 23 F3 08 2B 00 58 00 00 2C 00 59 00 00 E7 00 1D F3 04 E6 00 1D F3 00 0E 01 23 FD 02 0F 01 23 FD 00 9B 00 23 EF 10 9C 00 23 EF 00 87 00 11 FD 02 88 00 11 FD 00 E8 00 23 DF 20 E9 00 23 DF 00 51 01 22 F7 00 50 01 22 F7 08 12 01 34 FB 04 13 01 34 FB 00 08 00 1D DF 00 03 00 1D DF 00 FF FF 00 00 00 Handle 0xD401, DMI type 212, 127 bytes OEM-specific Type Header and Data: D4 7F 01 D4 70 00 71 00 03 40 49 4A 42 00 48 7F 80 43 00 48 7F 00 55 00 47 BF 00 6D 00 47 BF 40 0C 01 46 FB 04 0D 01 46 FB 00 14 01 46 E7 00 15 01 46 E7 08 16 01 46 E7 10 0A 01 48 EF 10 0B 01 48 EF 00 2D 00 48 DF 20 2E 00 48 DF 00 11 01 48 BF 00 10 01 48 BF 40 F0 00 46 DF 20 ED 00 46 DF 00 41 01 46 FE 01 40 01 46 FE 00 EA 00 67 F3 00 EB 00 67 F3 04 EC 00 67 F3 08 FF FF 00 00 00 Handle 0xDE00, DMI type 222, 13 bytes OEM-specific Type Header and Data: DE 0D 00 DE 01 02 FF FF 00 00 00 00 00 Handle 0x7F00, DMI type 127, 4 bytes End Of Table �����������������UnixAgent-2.4.2/resources/dmidecode-openbsd-3.7�����������������������������������������������������0000664�0000000�0000000�00000040102�13327377321�0021235�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������# dmidecode 2.6 Legacy DMI 2.0 present. 41 structures occupying 1014 bytes. Table at 0x000F0800. Handle 0x0000 DMI type 0, 18 bytes. BIOS Information Vendor: Award Software International, Inc. Version: 4.51 PG Release Date: 02/11/99 Address: 0xE0000 Runtime Size: 128 kB ROM Size: 256 kB Characteristics: ISA is supported PCI is supported PNP is supported APM is supported BIOS is upgradeable BIOS shadowing is allowed ESCD support is available Boot from CD is supported Selectable boot is supported BIOS ROM is socketed EDD is supported 5.25"/360 KB floppy services are supported (int 13h) 5.25"/1.2 MB floppy services are supported (int 13h) 3.5"/720 KB floppy services are supported (int 13h) 3.5"/2.88 MB floppy services are supported (int 13h) Print screen service is supported (int 5h) 8042 keyboard services are supported (int 9h) Serial services are supported (int 14h) Printer services are supported (int 17h) CGA/mono video services are supported (int 10h) Handle 0x0001 DMI type 1, 8 bytes. System Information Manufacturer: VIA Technologies, Inc. Product Name: VT82C691 Version: Serial Number: Handle 0x0002 DMI type 2, 8 bytes. Base Board Information Manufacturer: Tekram Technology Co., Ltd. Product Name: P6PROA5 Version: Rev. 1.0 Serial Number: Handle 0x0003 DMI type 3, 9 bytes. Chassis Information Manufacturer: Type: Unknown Lock: Not Present Version: Serial Number: Asset Tag: Handle 0x0004 DMI type 4, 26 bytes. Processor Information Socket Designation: SLOT 1 Type: Central Processor Family: Pentium II Manufacturer: Intel ID: 52 06 00 00 FF F9 83 01 Signature: Type 0, Family 6, Model 5, Stepping 2 Flags: FPU (Floating-point unit on-chip) VME (Virtual mode extension) DE (Debugging extension) PSE (Page size extension) TSC (Time stamp counter) MSR (Model specific registers) PAE (Physical address extension) MCE (Machine check exception) CX8 (CMPXCHG8 instruction supported) SEP (Fast system call) MTRR (Memory type range registers) PGE (Page global enable) MCA (Machine check architecture) CMOV (Conditional move instruction supported) PAT (Page attribute table) PSE-36 (36-bit page size extension) MMX (MMX technology supported) FXSR (Fast floating-point save and restore) Version: Pentium II Voltage: 3.3 V External Clock: 100 MHz Max Speed: 500 MHz Current Speed: 400 MHz Status: Populated, Enabled Upgrade: Slot 1 Handle 0x0005 DMI type 5, 31 bytes. Memory Controller Information Error Detecting Method: 64-bit ECC Error Correcting Capabilities: Single-bit Error Correcting Supported Interleave: Four-way Interleave Current Interleave: One-way Interleave Maximum Memory Module Size: 256 MB Maximum Total Memory Size: 2048 MB Supported Speeds: 70 ns 60 ns Supported Memory Types: Other Unknown Standard FPM EDO Parity ECC SIMM DIMM SDRAM Memory Module Voltage: 5.0 V 3.3 V Associated Memory Slots: 8 0x0006 0x0007 0x0008 0x0009 0x000A 0x000B 0x000C 0x000D Handle 0x0007 DMI type 6, 12 bytes. Memory Module Information Socket Designation: BANK_1 Bank Connections: 2 Current Speed: 70 ns Type: Unknown Installed Size: Not Installed Enabled Size: Not Installed Error Status: OK Handle 0x0008 DMI type 6, 12 bytes. Memory Module Information Socket Designation: BANK_2 Bank Connections: 3 Current Speed: 70 ns Type: DIMM SDRAM Installed Size: 64 MB (Single-bank Connection) Enabled Size: 64 MB (Single-bank Connection) Error Status: OK Handle 0x0009 DMI type 6, 12 bytes. Memory Module Information Socket Designation: BANK_3 Bank Connections: 4 Current Speed: 70 ns Type: Unknown Installed Size: Not Installed Enabled Size: Not Installed Error Status: OK Handle 0x000A DMI type 6, 12 bytes. Memory Module Information Socket Designation: BANK_4 Bank Connections: 5 Current Speed: 70 ns Type: DIMM SDRAM Installed Size: 64 MB (Single-bank Connection) Enabled Size: 64 MB (Single-bank Connection) Error Status: OK Handle 0x000B DMI type 6, 12 bytes. Memory Module Information Socket Designation: BANK_5 Bank Connections: 6 Current Speed: 70 ns Type: DIMM SDRAM Installed Size: 64 MB (Single-bank Connection) Enabled Size: 64 MB (Single-bank Connection) Error Status: OK Handle 0x000C DMI type 6, 12 bytes. Memory Module Information Socket Designation: BANK_6 Bank Connections: 7 Current Speed: 70 ns Type: Unknown Installed Size: Not Installed Enabled Size: Not Installed Error Status: OK Handle 0x000D DMI type 6, 12 bytes. Memory Module Information Socket Designation: BANK_7 Bank Connections: 8 Current Speed: 70 ns Type: Unknown Installed Size: Not Installed Enabled Size: Not Installed Error Status: OK Handle 0x000E DMI type 7, 15 bytes. Cache Information Socket Designation: Internal Cache Configuration: Enabled, Not Socketed, Level 1 Operational Mode: Write Back Location: Internal Installed Size: 32 KB Maximum Size: 32 KB Supported SRAM Types: Synchronous Installed SRAM Type: Synchronous Handle 0x000F DMI type 7, 15 bytes. Cache Information Socket Designation: External Cache Configuration: Enabled, Not Socketed, Level 2 Operational Mode: Write Back Location: External Installed Size: 512 KB Maximum Size: 2048 KB Supported SRAM Types: Synchronous Installed SRAM Type: Synchronous Handle 0x0010 DMI type 8, 9 bytes. Port Connector Information Internal Reference Designator: PRIMARY IDE Internal Connector Type: On Board IDE External Reference Designator: External Connector Type: None Port Type: Other Handle 0x0011 DMI type 8, 9 bytes. Port Connector Information Internal Reference Designator: SECONDARY IDE Internal Connector Type: On Board IDE External Reference Designator: External Connector Type: None Port Type: Other Handle 0x0012 DMI type 8, 9 bytes. Port Connector Information Internal Reference Designator: FLOPPY Internal Connector Type: On Board Floppy External Reference Designator: External Connector Type: None Port Type: Other Handle 0x0013 DMI type 8, 9 bytes. Port Connector Information Internal Reference Designator: COM1 Internal Connector Type: 9 Pin Dual Inline (pin 10 cut) External Reference Designator: External Connector Type: DB-9 male Port Type: Serial Port 16550 Compatible Handle 0x0014 DMI type 8, 9 bytes. Port Connector Information Internal Reference Designator: COM2 Internal Connector Type: 9 Pin Dual Inline (pin 10 cut) External Reference Designator: External Connector Type: DB-9 male Port Type: Serial Port 16550 Compatible Handle 0x0015 DMI type 8, 9 bytes. Port Connector Information Internal Reference Designator: LPT1 Internal Connector Type: DB-25 female External Reference Designator: External Connector Type: DB-25 female Port Type: Parallel Port ECP/EPP Handle 0x0016 DMI type 8, 9 bytes. Port Connector Information Internal Reference Designator: Keyboard Internal Connector Type: Other External Reference Designator: External Connector Type: PS/2 Port Type: Keyboard Port Handle 0x0017 DMI type 8, 9 bytes. Port Connector Information Internal Reference Designator: PS/2 Mouse Internal Connector Type: Other External Reference Designator: External Connector Type: PS/2 Port Type: Mouse Port Handle 0x0018 DMI type 8, 9 bytes. Port Connector Information Internal Reference Designator: IR_CON Internal Connector Type: Other External Reference Designator: External Connector Type: Infrared Port Type: Other Handle 0x0019 DMI type 8, 9 bytes. Port Connector Information Internal Reference Designator: IR_CON2 Internal Connector Type: Other External Reference Designator: External Connector Type: Infrared Port Type: Other Handle 0x001A DMI type 9, 12 bytes. System Slot Information Designation: AGP Type: 32-bit PCI Current Usage: In Use Length: Long ID: 32 Characteristics: 5.0 V is provided Handle 0x001B DMI type 9, 12 bytes. System Slot Information Designation: PCI1 Type: 32-bit PCI Current Usage: Available Length: Long ID: 12 Characteristics: 5.0 V is provided Handle 0x001C DMI type 9, 12 bytes. System Slot Information Designation: PCI2 Type: 32-bit PCI Current Usage: Available Length: Long ID: 11 Characteristics: 5.0 V is provided Handle 0x001D DMI type 9, 12 bytes. System Slot Information Designation: PCI3 Type: 32-bit PCI Current Usage: In Use Length: Long ID: 10 Characteristics: 5.0 V is provided Handle 0x001E DMI type 9, 12 bytes. System Slot Information Designation: PCI4 Type: 32-bit PCI Current Usage: Available Length: Long ID: 9 Characteristics: 5.0 V is provided Handle 0x001F DMI type 9, 12 bytes. System Slot Information Designation: PCI5 Type: 32-bit PCI Current Usage: Available Length: Long ID: 8 Characteristics: 5.0 V is provided Handle 0x0020 DMI type 9, 12 bytes. System Slot Information Designation: ISA Type: 16-bit ISA Current Usage: Unknown Length: Long Characteristics: 5.0 V is provided Handle 0x0021 DMI type 9, 12 bytes. System Slot Information Designation: ISA Type: 16-bit ISA Current Usage: Unknown Length: Long Characteristics: 5.0 V is provided Handle 0x0022 DMI type 9, 12 bytes. System Slot Information Designation: PCIx Type: 32-bit PCI Current Usage: Unknown Length: Long ID: 0 Characteristics: 5.0 V is provided Handle 0x0023 DMI type 9, 12 bytes. System Slot Information Designation: PCIx Type: 32-bit PCI Current Usage: Unknown Length: Long ID: 0 Characteristics: 5.0 V is provided Handle 0x0024 DMI type 9, 12 bytes. System Slot Information Designation: PCIx Type: 32-bit PCI Current Usage: Unknown Length: Long ID: 0 Characteristics: 5.0 V is provided Handle 0x0025 DMI type 9, 12 bytes. System Slot Information Designation: PCIx Type: 32-bit PCI Current Usage: Unknown Length: Long ID: 0 Characteristics: 5.0 V is provided Handle 0x0026 DMI type 9, 12 bytes. System Slot Information Designation: PCIx Type: 32-bit PCI Current Usage: Unknown Length: Long ID: 0 Characteristics: 5.0 V is provided Handle 0x0027 DMI type 8, 9 bytes. Port Connector Information Internal Reference Designator: USB Internal Connector Type: Other External Reference Designator: External Connector Type: Other Port Type: USB Handle 0x0028 DMI type 13, 22 bytes. BIOS Language Information Installable Languages: 3 en|US|iso8859-1 fr|CA|iso8859-1 ja|JP|unicode Currently Installed Language: en|US|iso8859-1 Wrong DMI structures count: 41 announced, only 40 decoded. ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������UnixAgent-2.4.2/resources/dmidecode-openbsd-3.8�����������������������������������������������������0000664�0000000�0000000�00000067563�13327377321�0021262�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������ dmidecode 2.6 SMBIOS 2.3 present. 82 structures occupying 3043 bytes. Table at 0x000FA4C0. Handle 0xDA00 DMI type 218, 11 bytes. OEM-specific Type Header and Data: DA 0B 00 DA B2 00 17 00 0E 20 00 Handle 0x0000 DMI type 0, 20 bytes. BIOS Information Vendor: Dell Computer Corporation Version: A05 Release Date: 09/21/2005 Address: 0xF0000 Runtime Size: 64 kB ROM Size: 1024 kB Characteristics: ISA is supported PCI is supported PNP is supported BIOS is upgradeable BIOS shadowing is allowed ESCD support is available Boot from CD is supported Selectable boot is supported EDD is supported Japanese floppy for Toshiba 1.2 MB is supported (int 13h) 5.25"/360 KB floppy services are supported (int 13h) 5.25"/1.2 MB floppy services are supported (int 13h) 3.5"/720 KB floppy services are supported (int 13h) Print screen service is supported (int 5h) 8042 keyboard services are supported (int 9h) Serial services are supported (int 14h) Printer services are supported (int 17h) CGA/mono video services are supported (int 10h) ACPI is supported USB legacy is supported LS-120 boot is supported BIOS boot specification is supported Function key-initiated network boot is supported Handle 0x0100 DMI type 1, 25 bytes. System Information Manufacturer: Dell Computer Corporation Product Name: PowerEdge 1800 Version: Not Specified Serial Number: 2K1012J UUID: 44454C4C-4B00-1031-8030-B2C04F31324A Wake-up Type: Power Switch Handle 0x0200 DMI type 2, 9 bytes. Base Board Information Manufacturer: Dell Computer Corporation Product Name: 0P8611 Version: A04 Serial Number: ..CN717035A80217. Handle 0x0300 DMI type 3, 17 bytes. Chassis Information Manufacturer: Dell Computer Corporation Type: Main Server Chassis Lock: Present Version: Not Specified Serial Number: 2K1012J Asset Tag: Not Specified Boot-up State: Safe Power Supply State: Safe Thermal State: Safe Security Status: Unknown OEM Information: 0x00000000 Handle 0x0400 DMI type 4, 35 bytes. Processor Information Socket Designation: PROC_1 Type: Central Processor Family: Xeon Manufacturer: Intel ID: 43 0F 00 00 FF FB EB BF Signature: Type 0, Family 15, Model 4, Stepping 3 Flags: FPU (Floating-point unit on-chip) VME (Virtual mode extension) DE (Debugging extension) PSE (Page size extension) TSC (Time stamp counter) MSR (Model specific registers) PAE (Physical address extension) MCE (Machine check exception) CX8 (CMPXCHG8 instruction supported) APIC (On-chip APIC hardware supported) SEP (Fast system call) MTRR (Memory type range registers) PGE (Page global enable) MCA (Machine check architecture) CMOV (Conditional move instruction supported) PAT (Page attribute table) PSE-36 (36-bit page size extension) CLFSH (CLFLUSH instruction supported) DS (Debug store) ACPI (ACPI supported) MMX (MMX technology supported) FXSR (Fast floating-point save and restore) SSE (Streaming SIMD extensions) SSE2 (Streaming SIMD extensions 2) SS (Self-snoop) HTT (Hyper-threading technology) TM (Thermal monitor supported) PBE (Pending break enabled) Version: Not Specified Voltage: 1.4 V External Clock: 800 MHz Max Speed: 3600 MHz Current Speed: 3000 MHz Status: Populated, Enabled Upgrade: ZIF Socket L1 Cache Handle: 0x0700 L2 Cache Handle: 0x0701 L3 Cache Handle: 0x0702 Serial Number: Not Specified Asset Tag: Not Specified Part Number: Not Specified Handle 0x0401 DMI type 4, 35 bytes. Processor Information Socket Designation: PROC_2 Type: Central Processor Family: Xeon Manufacturer: Intel ID: 00 00 00 00 00 00 00 00 Signature: Type 0, Family 0, Model 0, Stepping 0 Flags: None Version: Not Specified Voltage: 1.4 V External Clock: Unknown Max Speed: 3600 MHz Current Speed: Unknown Status: Unpopulated Upgrade: ZIF Socket L1 Cache Handle: 0x0703 L2 Cache Handle: 0x0704 L3 Cache Handle: 0x0705 Serial Number: Not Specified Asset Tag: Not Specified Part Number: Not Specified Handle 0x0700 DMI type 7, 19 bytes. Cache Information Socket Designation: Not Specified Configuration: Enabled, Not Socketed, Level 1 Operational Mode: Write Through Location: Internal Installed Size: 16 KB Maximum Size: 16 KB Supported SRAM Types: Unknown Installed SRAM Type: Unknown Speed: Unknown Error Correction Type: Parity System Type: Data Associativity: 8-way Set-associative Handle 0x0701 DMI type 7, 19 bytes. Cache Information Socket Designation: Not Specified Configuration: Enabled, Not Socketed, Level 2 Operational Mode: Write Back Location: Internal Installed Size: 2048 KB Maximum Size: 2048 KB Supported SRAM Types: Unknown Installed SRAM Type: Unknown Speed: Unknown Error Correction Type: Single-bit ECC System Type: Unified Associativity: 8-way Set-associative Handle 0x0702 DMI type 7, 19 bytes. Cache Information Socket Designation: Not Specified Configuration: Enabled, Not Socketed, Level 3 Operational Mode: Write Back Location: Internal Installed Size: 0 KB Maximum Size: 0 KB Supported SRAM Types: Unknown Installed SRAM Type: Unknown Speed: Unknown Error Correction Type: Single-bit ECC System Type: Unified Associativity: 2-way Set-associative Handle 0x0703 DMI type 7, 19 bytes. Cache Information Socket Designation: Not Specified Configuration: Enabled, Not Socketed, Level 1 Operational Mode: Write Through Location: Internal Installed Size: 0 KB Maximum Size: 16 KB Supported SRAM Types: Unknown Installed SRAM Type: Unknown Speed: Unknown Error Correction Type: Parity System Type: Data Associativity: 8-way Set-associative Handle 0x0704 DMI type 7, 19 bytes. Cache Information Socket Designation: Not Specified Configuration: Enabled, Not Socketed, Level 2 Operational Mode: Write Back Location: Internal Installed Size: 0 KB Maximum Size: 2048 KB Supported SRAM Types: Unknown Installed SRAM Type: Unknown Speed: Unknown Error Correction Type: Single-bit ECC System Type: Unified Associativity: 8-way Set-associative Handle 0x0705 DMI type 7, 19 bytes. Cache Information Socket Designation: Not Specified Configuration: Enabled, Not Socketed, Level 3 Operational Mode: Write Back Location: Internal Installed Size: 0 KB Maximum Size: 0 KB Supported SRAM Types: Unknown Installed SRAM Type: Unknown Speed: Unknown Error Correction Type: Single-bit ECC System Type: Unified Associativity: 2-way Set-associative Handle 0x0800 DMI type 8, 9 bytes. Port Connector Information Internal Reference Designator: SCSI Internal Connector Type: 68 Pin Dual Inline External Reference Designator: Not Specified External Connector Type: None Port Type: SCSI Wide Handle 0x0801 DMI type 8, 9 bytes. Port Connector Information Internal Reference Designator: Not Specified Internal Connector Type: None External Reference Designator: Not Specified External Connector Type: DB-15 female Port Type: Video Port Handle 0x0802 DMI type 8, 9 bytes. Port Connector Information Internal Reference Designator: Not Specified Internal Connector Type: None External Reference Designator: Not Specified External Connector Type: Access Bus (USB) Port Type: USB Handle 0x0803 DMI type 8, 9 bytes. Port Connector Information Internal Reference Designator: Not Specified Internal Connector Type: None External Reference Designator: Not Specified External Connector Type: Access Bus (USB) Port Type: USB Handle 0x0804 DMI type 8, 9 bytes. Port Connector Information Internal Reference Designator: Not Specified Internal Connector Type: None External Reference Designator: Not Specified External Connector Type: Access Bus (USB) Port Type: USB Handle 0x0805 DMI type 8, 9 bytes. Port Connector Information Internal Reference Designator: Not Specified Internal Connector Type: None External Reference Designator: Not Specified External Connector Type: Access Bus (USB) Port Type: USB Handle 0x0806 DMI type 8, 9 bytes. Port Connector Information Internal Reference Designator: Not Specified Internal Connector Type: None External Reference Designator: Not Specified External Connector Type: DB-25 female Port Type: Parallel Port PS/2 Handle 0x0807 DMI type 8, 9 bytes. Port Connector Information Internal Reference Designator: Not Specified Internal Connector Type: None External Reference Designator: Not Specified External Connector Type: RJ-45 Port Type: Network Port Handle 0x0808 DMI type 8, 9 bytes. Port Connector Information Internal Reference Designator: Not Specified Internal Connector Type: None External Reference Designator: Not Specified External Connector Type: DB-9 male Port Type: Serial Port 16550A Compatible Handle 0x0809 DMI type 8, 9 bytes. Port Connector Information Internal Reference Designator: Not Specified Internal Connector Type: None External Reference Designator: Not Specified External Connector Type: PS/2 Port Type: Keyboard Port Handle 0x080A DMI type 8, 9 bytes. Port Connector Information Internal Reference Designator: Not Specified Internal Connector Type: None External Reference Designator: Not Specified External Connector Type: PS/2 Port Type: Mouse Port Handle 0x0900 DMI type 9, 13 bytes. System Slot Information Designation: SLOT1 Type: 64-bit PCI Current Usage: Available Length: Long ID: 1 Characteristics: 3.3 V is provided PME signal is supported Handle 0x0901 DMI type 9, 13 bytes. System Slot Information Designation: SLOT2 Type: <OUT OF SPEC><OUT OF SPEC> Current Usage: Available Length: Long Characteristics: 3.3 V is provided PME signal is supported Handle 0x0902 DMI type 9, 13 bytes. System Slot Information Designation: SLOT3 Type: <OUT OF SPEC><OUT OF SPEC> Current Usage: Available Length: Long Characteristics: 3.3 V is provided PME signal is supported Handle 0x0903 DMI type 9, 13 bytes. System Slot Information Designation: SLOT4 Type: 32-bit PCI Current Usage: Available Length: Long ID: 4 Characteristics: 5.0 V is provided PME signal is supported Handle 0x0904 DMI type 9, 13 bytes. System Slot Information Designation: SLOT5 Type: 64-bit PCI-X Current Usage: In Use Length: Long ID: 5 Characteristics: 3.3 V is provided PME signal is supported Handle 0x0905 DMI type 9, 13 bytes. System Slot Information Designation: SLOT6 Type: 64-bit PCI-X Current Usage: Available Length: Long ID: 6 Characteristics: 3.3 V is provided PME signal is supported Handle 0x0A00 DMI type 10, 10 bytes. On Board Device 1 Information Type: SCSI Controller Status: Enabled Description: LSI Logic 53C1020 Ultra 320 SCSI On Board Device 2 Information Type: Video Status: Enabled Description: ATI RADEON 7000 PCI Video On Board Device 3 Information Type: Ethernet Status: Enabled Description: Intel 82541GI Gigabit Ethernet Handle 0x0B00 DMI type 11, 5 bytes. OEM Strings String 1: Dell System String 2: 5[0000] Handle 0x7E00 DMI type 126, 144 bytes. Inactive Handle 0x0C00 DMI type 12, 5 bytes. System Configuration Options Option 1: NVRAM_CLR: Clear user settable NVRAM areas and set defaults Option 2: PASSWD: Close to enable password Handle 0x0D00 DMI type 13, 22 bytes. BIOS Language Information Installable Languages: 1 en|US|iso8859-1 Currently Installed Language: en|US|iso8859-1 Handle 0x1000 DMI type 16, 15 bytes. Physical Memory Array Location: System Board Or Motherboard Use: System Memory Error Correction Type: Multi-bit ECC Maximum Capacity: 12 GB Error Information Handle: Not Provided Number Of Devices: 6 Handle 0x1100 DMI type 17, 27 bytes. Memory Device Array Handle: 0x1000 Error Information Handle: Not Provided Total Width: 72 bits Data Width: 64 bits Size: 512 MB Form Factor: DIMM Set: 1 Locator: DIMM1_A Bank Locator: Not Specified Type: <OUT OF SPEC> Type Detail: Synchronous Speed: 400 MHz (2.5 ns) Manufacturer: CE00000000000000 Serial Number: 50075483 Asset Tag: 010552 Part Number: M3 93T6450FZ0-CCC Handle 0x1101 DMI type 17, 27 bytes. Memory Device Array Handle: 0x1000 Error Information Handle: Not Provided Total Width: 72 bits Data Width: 64 bits Size: 512 MB Form Factor: DIMM Set: 1 Locator: DIMM1_B Bank Locator: Not Specified Type: <OUT OF SPEC> Type Detail: Synchronous Speed: 400 MHz (2.5 ns) Manufacturer: CE00000000000000 Serial Number: 500355A1 Asset Tag: 010552 Part Number: M3 93T6450FZ0-CCC Handle 0x1102 DMI type 17, 27 bytes. Memory Device Array Handle: 0x1000 Error Information Handle: Not Provided Total Width: 72 bits Data Width: 64 bits Size: No Module Installed Form Factor: DIMM Set: 2 Locator: DIMM2_A Bank Locator: Not Specified Type: <OUT OF SPEC> Type Detail: Synchronous Speed: 400 MHz (2.5 ns) Manufacturer: Serial Number: Asset Tag: Part Number: Handle 0x1103 DMI type 17, 27 bytes. Memory Device Array Handle: 0x1000 Error Information Handle: Not Provided Total Width: 72 bits Data Width: 64 bits Size: No Module Installed Form Factor: DIMM Set: 2 Locator: DIMM2_B Bank Locator: Not Specified Type: <OUT OF SPEC> Type Detail: Synchronous Speed: 400 MHz (2.5 ns) Manufacturer: Serial Number: Asset Tag: Part Number: Handle 0x1104 DMI type 17, 27 bytes. Memory Device Array Handle: 0x1000 Error Information Handle: Not Provided Total Width: 72 bits Data Width: 64 bits Size: No Module Installed Form Factor: DIMM Set: 3 Locator: DIMM3_A Bank Locator: Not Specified Type: <OUT OF SPEC> Type Detail: Synchronous Speed: 400 MHz (2.5 ns) Manufacturer: Serial Number: Asset Tag: Part Number: Handle 0x1105 DMI type 17, 27 bytes. Memory Device Array Handle: 0x1000 Error Information Handle: Not Provided Total Width: 72 bits Data Width: 64 bits Size: No Module Installed Form Factor: DIMM Set: 3 Locator: DIMM3_B Bank Locator: Not Specified Type: <OUT OF SPEC> Type Detail: Synchronous Speed: 400 MHz (2.5 ns) Manufacturer: Serial Number: Asset Tag: Part Number: Handle 0x1300 DMI type 19, 15 bytes. Memory Array Mapped Address Starting Address: 0x00000000000 Ending Address: 0x0003FFFFFFF Range Size: 1 GB Physical Array Handle: 0x1000 Partition Width: 0 Handle 0x1301 DMI type 126, 15 bytes. Inactive Handle 0x1400 DMI type 20, 19 bytes. Memory Device Mapped Address Starting Address: 0x00000000000 Ending Address: 0x0003FFFFFFF Range Size: 1 GB Physical Device Handle: 0x1100 Memory Array Mapped Address Handle: 0x1300 Partition Row Position: 1 Handle 0x1401 DMI type 20, 19 bytes. Memory Device Mapped Address Starting Address: 0x00000000000 Ending Address: 0x0003FFFFFFF Range Size: 1 GB Physical Device Handle: 0x1101 Memory Array Mapped Address Handle: 0x1300 Partition Row Position: 2 Handle 0x1402 DMI type 126, 19 bytes. Inactive Handle 0x1403 DMI type 126, 19 bytes. Inactive Handle 0x1404 DMI type 126, 19 bytes. Inactive Handle 0x1405 DMI type 126, 19 bytes. Inactive Handle 0x1406 DMI type 126, 19 bytes. Inactive Handle 0x1407 DMI type 126, 19 bytes. Inactive Handle 0x1408 DMI type 126, 19 bytes. Inactive Handle 0x1409 DMI type 126, 19 bytes. Inactive Handle 0x140A DMI type 126, 19 bytes. Inactive Handle 0x140B DMI type 126, 19 bytes. Inactive Handle 0x140C DMI type 126, 19 bytes. Inactive Handle 0x140D DMI type 126, 19 bytes. Inactive Handle 0x1420 DMI type 126, 19 bytes. Inactive Handle 0x1421 DMI type 126, 19 bytes. Inactive Handle 0x1424 DMI type 126, 19 bytes. Inactive Handle 0x1425 DMI type 126, 19 bytes. Inactive Handle 0x1428 DMI type 126, 19 bytes. Inactive Handle 0x1429 DMI type 126, 19 bytes. Inactive Handle 0x1430 DMI type 126, 19 bytes. Inactive Handle 0x1431 DMI type 126, 19 bytes. Inactive Handle 0x1434 DMI type 126, 19 bytes. Inactive Handle 0x1435 DMI type 126, 19 bytes. Inactive Handle 0x1438 DMI type 126, 19 bytes. Inactive Handle 0x1439 DMI type 126, 19 bytes. Inactive Handle 0x2000 DMI type 32, 11 bytes. System Boot Information Status: No errors detected Handle 0x2600 DMI type 38, 18 bytes. IPMI Device Information Interface Type: KCS (Keyboard Control Style) Specification Version: 1.5 I2C Slave Address: 0x10 NV Storage Device: Not Present Base Address: 0x0000000000000CA8 (I/O) Register Spacing: 32-bit Boundaries Handle 0xD000 DMI type 208, 10 bytes. OEM-specific Type Header and Data: D0 0A 00 D0 01 05 FE 00 83 01 Handle 0xD100 DMI type 209, 12 bytes. OEM-specific Type Header and Data: D1 0C 00 D1 78 03 07 03 04 0F 80 05 Handle 0xD200 DMI type 210, 12 bytes. OEM-specific Type Header and Data: D2 0C 00 D2 F8 03 04 03 06 80 04 05 Handle 0xD400 DMI type 212, 167 bytes. OEM-specific Type Header and Data: D4 A7 00 D4 70 00 71 00 00 10 2D 2E 03 00 11 7F 80 04 00 11 7F 00 07 00 25 9F 00 08 00 25 9F 20 09 00 25 9F 40 0A 00 25 9F 60 0B 00 25 7F 00 0C 00 25 7F 80 0F 00 25 F8 00 11 00 25 F8 01 12 00 25 F8 02 2E 40 25 F8 03 2F 40 25 F8 04 00 00 25 F8 05 42 00 11 FE 01 43 00 11 FE 00 44 00 11 9F 20 45 00 11 9F 00 31 40 11 FB 00 32 40 11 FB 04 9D 00 11 FD 02 9E 00 11 FD 00 9F 00 26 FE 01 A0 00 26 FE 00 51 00 26 3F 00 52 00 26 3F 40 53 00 26 3F 80 54 00 26 3F C0 28 40 26 DF 20 29 40 26 DF 00 FF FF 00 00 00 Handle 0xD401 DMI type 212, 202 bytes. OEM-specific Type Header and Data: D4 CA 01 D4 70 00 71 00 03 40 59 6D 6B 00 78 7F 80 6C 00 78 7F 00 58 00 78 FA 05 59 00 78 FA 00 5C 00 78 BF 40 5D 00 78 BF 00 04 80 78 FD 02 01 A0 78 FD 00 08 40 51 FE 01 09 40 51 FE 00 0A 40 51 FD 02 0B 40 51 FD 00 19 00 55 E7 00 1A 00 55 E7 08 1B 00 55 E7 10 FF 00 55 9F 40 FE 00 55 9F 20 FD 00 55 9F 00 1E 00 55 FD 00 50 00 55 FD 02 8A 00 55 FE 01 8B 00 55 FE 00 BF 00 53 FE 00 C0 00 53 FE 01 33 40 53 E7 00 34 40 53 E7 08 35 40 53 E7 10 36 40 53 E7 18 1A 40 53 FD 02 1B 40 53 FD 00 1C 40 53 FB 04 1D 40 53 FB 00 6E 00 58 FC 01 2D 00 58 FC 02 2E 00 58 FC 00 22 40 58 EF 10 23 40 58 EF 00 FF FF 00 00 00 Handle 0xD402 DMI type 212, 47 bytes. OEM-specific Type Header and Data: D4 2F 02 D4 70 00 71 00 03 40 59 6D D8 00 55 7F 80 D9 00 55 7F 00 00 C0 5C 00 0A 03 C0 67 00 05 83 00 76 00 00 84 00 77 00 00 FF FF 00 00 00 Handle 0xD403 DMI type 212, 177 bytes. OEM-specific Type Header and Data: D4 B1 03 D4 72 00 73 00 00 40 5D 5E 28 01 4A FC 00 29 01 4A FC 01 2A 01 4A FC 02 02 40 4A F7 00 01 40 4A F7 08 D1 00 7E FE 00 D2 00 7E FE 01 2A 40 7E FB 00 2B 40 7E FB 04 D3 00 00 00 02 D4 00 06 00 02 00 90 2C 00 00 01 90 2D 00 00 17 01 4B FE 00 18 01 4B FE 01 19 01 4B FD 00 1A 01 4B FD 02 35 01 4C FC 00 37 01 4C FC 01 39 01 4C FC 02 3B 01 4C F3 04 3D 01 4C F3 08 DE 00 76 FE 01 26 40 42 FE 01 27 40 42 FE 00 37 40 42 FB 00 38 40 42 FB 04 00 00 47 FE 01 00 00 47 FE 00 A1 00 48 FC 02 A3 00 48 FC 01 A2 00 48 FC 00 FF FF 00 00 00 Handle 0xD800 DMI type 216, 9 bytes. OEM-specific Type Header and Data: D8 09 00 D8 01 02 01 00 00 Strings: ATI RADEON 7000 V6.11 Handle 0xDE00 DMI type 222, 15 bytes. OEM-specific Type Header and Data: DE 0F 00 DE 01 04 FF FF 00 00 00 00 00 00 00 Handle 0x7F00 DMI type 127, 4 bytes. End Of Table ���������������������������������������������������������������������������������������������������������������������������������������������UnixAgent-2.4.2/resources/dmidecode.rhel.2.1��������������������������������������������������������0000664�0000000�0000000�00000013425�13327377321�0020540�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������PNP BIOS present. PNP BIOS present. SYSID present. SMBIOS 2.3 present. DMI 2.3 present. 40 structures occupying 1146 bytes. DMI table at 0x000FAC20. Handle 0x0000 DMI type 0, 20 bytes. BIOS Information Block Vendor: IBM Version: -[JPE130AUS-1.30]- Release: 12/11/2002 BIOS base: 0xF0000 ROM size: 448K Capabilities: Flags: 0x000000007FFBDE90 Handle 0x0100 DMI type 1, 25 bytes. System Information Block Vendor: IBM Product: -[84803AX]- Version: IBM CORPORATION Serial Number: KBKGW40 Handle 0x0200 DMI type 2, 8 bytes. Board Information Block Vendor: IBM Product: -[M51G]- Version: -1 Serial Number: NA60B7Y0S3Q Handle 0x0300 DMI type 3, 17 bytes. Chassis Information Block Vendor: IBM Chassis Type: Mini Tower Lock present Version: N/A Serial Number: N/A Asset Tag: N/A Handle 0x0400 DMI type 4, 32 bytes. Processor Socket Designation: CPU1 Processor Type: Central Processor Processor Family: Processor Manufacturer: Intel Processor Version: Pentium 4 Handle 0x0500 DMI type 5, 20 bytes. Memory Controller Handle 0x0600 DMI type 6, 12 bytes. Memory Bank Socket: DIMM1 Banks: 0 Type: ECC DIMM SDRAM Installed Size: 256Mbyte Enabled Size: 256Mbyte Handle 0x0601 DMI type 6, 12 bytes. Memory Bank Socket: DIMM2 Type: UNKNOWN Installed Size: Not Installed Enabled Size: Not Installed Handle 0x0700 DMI type 7, 19 bytes. Cache Socket: CPU1 L1 socketed Internal Cache: write-back L1 Cache Size: 32K L1 Cache Maximum: 20K L1 Cache Type: Unknown Handle 0x0701 DMI type 7, 19 bytes. Cache Socket: CPU1 L2 socketed Internal Cache: write-back L2 Cache Size: 512K L2 Cache Maximum: 512K L2 Cache Type: Pipeline burst Handle 0x0800 DMI type 8, 9 bytes. Port Connector Internal Designator: Internal Connector Type: None External Designator: SERIAL1 External Connector Type: DB-9 pin male Port Type: Serial Port 16650A Compatible Handle 0x0801 DMI type 8, 9 bytes. Port Connector Internal Designator: Internal Connector Type: None External Designator: SERIAL2 External Connector Type: DB-9 pin male Port Type: Serial Port 16650A Compatible Handle 0x0802 DMI type 8, 9 bytes. Port Connector Internal Designator: Internal Connector Type: None External Designator: PRINTER External Connector Type: DB-25 pin female Port Type: Parallel Port ECP/EPP Handle 0x0803 DMI type 8, 9 bytes. Port Connector Internal Designator: Internal Connector Type: None External Designator: KEYBOARD External Connector Type: PS/2 Port Type: Keyboard Port Handle 0x0804 DMI type 8, 9 bytes. Port Connector Internal Designator: Internal Connector Type: None External Designator: MOUSE External Connector Type: PS/2 Port Type: Mouse Port Handle 0x0805 DMI type 8, 9 bytes. Port Connector Internal Designator: Internal Connector Type: None External Designator: USB1 External Connector Type: Access Bus (USB) Port Type: USB Handle 0x0806 DMI type 8, 9 bytes. Port Connector Internal Designator: Internal Connector Type: None External Designator: USB2 External Connector Type: Access Bus (USB) Port Type: USB Handle 0x0807 DMI type 8, 9 bytes. Port Connector Internal Designator: IDE1 Internal Connector Type: On Board IDE External Designator: External Connector Type: None Port Type: Other Handle 0x0808 DMI type 8, 9 bytes. Port Connector Internal Designator: IDE2 Internal Connector Type: On Board IDE External Designator: External Connector Type: None Port Type: Other Handle 0x0809 DMI type 8, 9 bytes. Port Connector Internal Designator: FDD Internal Connector Type: On Board Floppy External Designator: External Connector Type: None Port Type: Other Handle 0x080A DMI type 8, 9 bytes. Port Connector Internal Designator: SCSI1 Internal Connector Type: SSA SCSI External Designator: External Connector Type: None Port Type: SCSI II Handle 0x0900 DMI type 9, 12 bytes. Card Slot Slot: AGP Type: Slot Features: 5v Handle 0x0901 DMI type 9, 12 bytes. Card Slot Slot: PCI1 Type: 32bit PCI Status: Available. Slot Features: 5v Handle 0x0902 DMI type 9, 13 bytes. Card Slot Slot: PCI2 Type: 32bit PCI Status: In use. Slot Features: 5v Handle 0x0903 DMI type 9, 13 bytes. Card Slot Slot: PCI3 Type: 32bit PCI Status: Available. Slot Features: 5v Handle 0x0904 DMI type 9, 13 bytes. Card Slot Slot: PCI4 Type: 32bit PCI Status: Available. Slot Features: 5v Handle 0x0905 DMI type 9, 13 bytes. Card Slot Slot: PCI5 Type: 32bit PCI Status: Available. Slot Features: 5v Handle 0x0A00 DMI type 10, 14 bytes. On Board Devices Information Description: ATI RAGE XL : Enabled Type: Description: Adaptec 7892 SCSI : Enabled Type: Description: Broadcom 5702 : Enabled Type: Description: AC 97 : Enabled Type: Description: IBM Automatic Server Restart - Machine Type 8480 : Enabled Type: Handle 0x0D00 DMI type 13, 22 bytes. BIOS Language Information Handle 0x0F00 DMI type 15, 39 bytes. Event Log Log Area: 511 bytes. Log Header At: 0. Log Data At: 16. Log Type: 3. Log Valid: Yes. Handle 0x1000 DMI type 16, 15 bytes. Physical Memory Array Handle 0x1100 DMI type 17, 23 bytes. Memory Device Handle 0x1101 DMI type 17, 23 bytes. Memory Device Handle 0x1300 DMI type 19, 15 bytes. Memory Array Mapped Address Handle 0x1400 DMI type 20, 19 bytes. Memory Device Mapped Address Handle 0x1401 DMI type 20, 19 bytes. Memory Device Mapped Address Handle 0x2000 DMI type 32, 12 bytes. System Boot Information Handle 0x2200 DMI type 34, 11 bytes. 01 06 5a 00 00 00 05 ..Z.... Handle 0x8900 DMI type 137, 10 bytes. 01 02 03 04 05 06 ...... Handle 0x7F00 DMI type 127, 4 bytes. End-of-Table �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������UnixAgent-2.4.2/resources/dmidecode.rhel.3.4��������������������������������������������������������0000664�0000000�0000000�00000030001�13327377321�0020531�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������# dmidecode 2.2 SMBIOS 2.33 present. 59 structures occupying 2374 bytes. Table at 0x7FF77000. Handle 0x0000 DMI type 0, 20 bytes. BIOS Information Vendor: IBM Version: IBM BIOS Version 1.57-[PME157AUS-1.57]- Release Date: 08/25/2005 Address: 0xE03F0 Runtime Size: 130064 bytes ROM Size: 1024 kB Characteristics: PCI is supported PNP is supported BIOS is upgradeable BIOS shadowing is allowed ESCD support is available Boot from CD is supported Selectable boot is supported BIOS ROM is socketed Print screen service is supported (int 5h) Serial services are supported (int 14h) ACPI is supported USB legacy is supported BIOS boot specification is supported Handle 0x0001 DMI type 1, 25 bytes. System Information Manufacturer: IBM Product Name: IBM eServer x226-[8488PCR]- Version: Not Applicable Serial Number: KDXPC16 UUID: A8346631-8E88-3AE3-898C-F3AC9F61C316 Wake-up Type: Power Switch Handle 0x0002 DMI type 2, 8 bytes. Base Board Information Manufacturer: IBM Product Name: MSI-9151 Boards Version: Not Applicable Serial Number: #A123456789 Handle 0x0003 DMI type 3, 17 bytes. Chassis Information Manufacturer: IBM Type: Tower Lock: Not Present Version: N/A Serial Number: N/A Asset Tag: 12345678901234567890123456789012 Boot-up State: Safe Power Supply State: Safe Thermal State: Safe Security Status: None OEM Information: 0x00001234 Handle 0x0004 DMI type 4, 35 bytes. Processor Information Socket Designation: CPU#1 Type: Central Processor Family: Xeon MP Manufacturer: Intel Corporation ID: 41 0F 00 00 FF FB EB BF Signature: Type 0, Family F, Model 4, Stepping 1 Flags: FPU (Floating-point unit on-chip) VME (Virtual mode extension) DE (Debugging extension) PSE (Page size extension) TSC (Time stamp counter) MSR (Model specific registers) PAE (Physical address extension) MCE (Machine check exception) CX8 (CMPXCHG8 instruction supported) APIC (On-chip APIC hardware supported) SEP (Fast system call) MTRR (Memory type range registers) PGE (Page global enable) MCA (Machine check architecture) CMOV (Conditional move instruction supported) PAT (Page attribute table) PSE-36 (36-bit page size extension) CLFSH (CLFLUSH instruction supported) DS (Debug store) ACPI (ACPI supported) MMX (MMX technology supported) FXSR (Fast floating-point save and restore) SSE (Streaming SIMD extensions) SSE2 (Streaming SIMD extensions 2) SS (Self-snoop) HTT (Hyper-threading technology) TM (Thermal monitor supported) SBF (Signal break on FERR) Version: Intel(R) Xeon(TM) CPU 2.80GHz Voltage: 1.3 V External Clock: 200 MHz Max Speed: 3600 MHz Current Speed: 2800 MHz Status: Populated, Enabled Upgrade: ZIF Socket L1 Cache Handle: 0x0006 L2 Cache Handle: 0x0007 L3 Cache Handle: Not Provided Serial Number: Asset Tag: Part Number: Handle 0x0005 DMI type 4, 35 bytes. Processor Information Socket Designation: CPU#2 Type: Central Processor Family: Xeon MP Manufacturer: Intel Corporation ID: 41 0F 00 00 FF FB EB BF Signature: Type 0, Family F, Model 4, Stepping 1 Flags: FPU (Floating-point unit on-chip) VME (Virtual mode extension) DE (Debugging extension) PSE (Page size extension) TSC (Time stamp counter) MSR (Model specific registers) PAE (Physical address extension) MCE (Machine check exception) CX8 (CMPXCHG8 instruction supported) APIC (On-chip APIC hardware supported) SEP (Fast system call) MTRR (Memory type range registers) PGE (Page global enable) MCA (Machine check architecture) CMOV (Conditional move instruction supported) PAT (Page attribute table) PSE-36 (36-bit page size extension) CLFSH (CLFLUSH instruction supported) DS (Debug store) ACPI (ACPI supported) MMX (MMX technology supported) FXSR (Fast floating-point save and restore) SSE (Streaming SIMD extensions) SSE2 (Streaming SIMD extensions 2) SS (Self-snoop) HTT (Hyper-threading technology) TM (Thermal monitor supported) SBF (Signal break on FERR) Version: Intel(R) Xeon(TM) CPU 2.80GHz Voltage: 1.3 V External Clock: 200 MHz Max Speed: 3600 MHz Current Speed: 2800 MHz Status: Populated, Enabled Upgrade: ZIF Socket L1 Cache Handle: 0x0009 L2 Cache Handle: 0x000A L3 Cache Handle: Not Provided Serial Number: Asset Tag: Part Number: Handle 0x0006 DMI type 7, 19 bytes. Cache Information Socket Designation: L1 Cache for CPU#1 Configuration: Enabled, Not Socketed, Level 1 Operational Mode: Write Back Location: Internal Installed Size: 16 KB Maximum Size: 16 KB Supported SRAM Types: Burst Pipeline Burst Installed SRAM Type: Burst Pipeline Burst Speed: Unknown Error Correction Type: Single-bit ECC System Type: Data Associativity: 4-way Set-associative Handle 0x0007 DMI type 7, 19 bytes. Cache Information Socket Designation: L2 Cache for CPU#1 Configuration: Enabled, Not Socketed, Level 2 Operational Mode: Write Back Location: Internal Installed Size: 1024 KB Maximum Size: 2048 KB Supported SRAM Types: Burst Pipeline Burst Installed SRAM Type: Burst Speed: Unknown Error Correction Type: Single-bit ECC System Type: Unified Associativity: 4-way Set-associative Handle 0x0008 DMI type 126, 19 bytes. Inactive Handle 0x0009 DMI type 7, 19 bytes. Cache Information Socket Designation: L1 Cache for CPU#2 Configuration: Enabled, Not Socketed, Level 1 Operational Mode: Write Back Location: Internal Installed Size: 16 KB Maximum Size: 16 KB Supported SRAM Types: Burst Pipeline Burst Installed SRAM Type: Burst Pipeline Burst Speed: Unknown Error Correction Type: Single-bit ECC System Type: Data Associativity: 4-way Set-associative Handle 0x000A DMI type 7, 19 bytes. Cache Information Socket Designation: L2 Cache for CPU#2 Configuration: Enabled, Not Socketed, Level 2 Operational Mode: Write Back Location: Internal Installed Size: 1024 KB Maximum Size: 2048 KB Supported SRAM Types: Burst Pipeline Burst Installed SRAM Type: Burst Speed: Unknown Error Correction Type: Single-bit ECC System Type: Unified Associativity: 4-way Set-associative Handle 0x000B DMI type 126, 19 bytes. Inactive Handle 0x000C DMI type 8, 9 bytes. Port Connector Information Internal Reference Designator: J2A1 Internal Connector Type: 9 Pin Dual Inline (pin 10 cut) External Reference Designator: COM 1 External Connector Type: DB-9 male Port Type: Serial Port 16550A Compatible Handle 0x000D DMI type 8, 9 bytes. Port Connector Information Internal Reference Designator: J2A2 Internal Connector Type: 9 Pin Dual Inline (pin 10 cut) External Reference Designator: COM 2 External Connector Type: DB-9 male Port Type: Serial Port 16550A Compatible Handle 0x000E DMI type 8, 9 bytes. Port Connector Information Internal Reference Designator: J3A1 Internal Connector Type: 25 Pin Dual Inline (pin 26 cut) External Reference Designator: Parallel External Connector Type: DB-25 female Port Type: Parallel Port ECP/EPP Handle 0x000F DMI type 8, 9 bytes. Port Connector Information Internal Reference Designator: J1A1 Internal Connector Type: None External Reference Designator: Keyboard External Connector Type: Circular DIN-8 male Port Type: Keyboard Port Handle 0x0010 DMI type 8, 9 bytes. Port Connector Information Internal Reference Designator: J1A1 Internal Connector Type: None External Reference Designator: PS/2 Mouse External Connector Type: Circular DIN-8 male Port Type: Keyboard Port Handle 0x0011 DMI type 9, 13 bytes. System Slot Information Designation: PCIE Slot #1 Type: PCI Current Usage: Available Length: Other ID: 1 Characteristics: PME signal is supported Handle 0x0012 DMI type 9, 13 bytes. System Slot Information Designation: PCI/33 Slot #2 Type: 32-bit PCI Current Usage: Available Length: Short ID: 2 Characteristics: 5.0 V is provided 3.3 V is provided PME signal is supported Handle 0x0013 DMI type 9, 13 bytes. System Slot Information Designation: PCI/33 Slot #3 Type: 32-bit PCI Current Usage: Available Length: Short ID: 3 Characteristics: 5.0 V is provided 3.3 V is provided PME signal is supported Handle 0x0014 DMI type 9, 13 bytes. System Slot Information Designation: PCIX 133 Slot #4 Type: 64-bit PCI-X Current Usage: Available Length: Long ID: 4 Characteristics: 3.3 V is provided PME signal is supported Handle 0x0015 DMI type 9, 13 bytes. System Slot Information Designation: PCIX100(ZCR) Slot #5 Type: 64-bit PCI-X Current Usage: Available Length: Long ID: 5 Characteristics: 3.3 V is provided PME signal is supported Handle 0x0016 DMI type 9, 13 bytes. System Slot Information Designation: PCIX100 Slot #6 Type: 64-bit PCI-X Current Usage: Available Length: Long ID: 6 Characteristics: 3.3 V is provided PME signal is supported Handle 0x0017 DMI type 10, 6 bytes. On Board Device Information Type: Other Status: Enabled Description: IBM Automatic Server Restart - Machine Type 8648 Handle 0x0018 DMI type 10, 6 bytes. On Board Device Information Type: Video Status: Enabled Description: ATI Rage 7000 Handle 0x0019 DMI type 10, 6 bytes. On Board Device Information Type: SCSI Controller Status: Enabled Description: Adaptec AIC 7902 Handle 0x001A DMI type 10, 6 bytes. On Board Device Information Type: Ethernet Status: Enabled Description: BoardCom BCM5721 Handle 0x001D DMI type 11, 5 bytes. OEM Strings String 1: IBM Remote Supervisor Adapter -[GRET15AUS]- Handle 0x001E DMI type 12, 5 bytes. System Configuration Options Option 1: JCMOS1: 1-2 Keep CMOS Data(Default), 2-3 Clear CMOS Data (make sure the AC power cord(s) is(are) removed from the system) Handle 0x001F DMI type 12, 5 bytes. System Configuration Options Option 1: JCON1: 1-2 Normal(Default), 2-3 Configuration, No Jumper - BIOS Crisis Recovery Handle 0x0020 DMI type 13, 22 bytes. BIOS Language Information Installable Languages: 1 en|US|iso8859-1 Currently Installed Language: en|US|iso8859-1 Handle 0x0021 DMI type 15, 29 bytes. System Event Log Area Length: 320 bytes Header Start Offset: 0x0000 Header Length: 16 bytes Data Start Offset: 0x0010 Access Method: General-pupose non-volatile data functions Access Address: 0x0000 Status: Valid, Not Full Change Token: 0x00000013 Header Format: Type 1 Supported Log Type Descriptors: 3 Descriptor 1: POST error Data Format 1: POST results bitmap Descriptor 2: Single-bit ECC memory error Data Format 2: Multiple-event Descriptor 3: Multi-bit ECC memory error Data Format 3: Multiple-event Handle 0x0022 DMI type 16, 15 bytes. Physical Memory Array Location: System Board Or Motherboard Use: System Memory Error Correction Type: Single-bit ECC Maximum Capacity: 16 GB Error Information Handle: No Error Number Of Devices: 6 Handle 0x0023 DMI type 17, 27 bytes. Memory Device Array Handle: 0x0022 Error Information Handle: No Error Total Width: 72 bits Data Width: 64 bits Size: 512 MB Form Factor: DIMM Set: 1 Locator: DIMM 1 Bank Locator: BANK 1 Type: DDR Type Detail: Synchronous Speed: 400 MHz (2.5 ns) Manufacturer: Serial Number: 460360BB Asset Tag: 3342 Part Number: M3 93T6553BZ3-CCC Handle 0x0024 DMI type 17, 27 bytes. Memory Device Array Handle: 0x0022 Error Information Handle: No Error Total Width: 72 bits Data Width: 64 bits Size: 512 MB Form Factor: DIMM Set: 1 Locator: DIMM 2 Bank Locator: BANK 1 Type: DDR Type Detail: Synchronous Speed: 400 MHz (2.5 ns) Manufacturer: Serial Number: 460360E8 Asset Tag: 3342 Part Number: M3 93T6553BZ3-CCC Handle 0x0025 DMI type 17, 27 bytes. Memory Device Array Handle: 0x0022 Error Information Handle: No Error Total Width: 72 bits Data Width: 64 bits Size: 512 MB Form Factor: DIMM Set: 2 Locator: DIMM 3 Bank Locator: BANK 2 Type: DDR Type Detail: Synchronous Speed: 400 MHz (2.5 ns) Manufacturer: �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������UnixAgent-2.4.2/resources/dmidecode.rhel.4.3��������������������������������������������������������0000664�0000000�0000000�00000044015�13327377321�0020543�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������# dmidecode 2.2 SMBIOS 2.2 present. 57 structures occupying 1719 bytes. Table at 0x000F0000. Handle 0x0000 DMI type 0, 19 bytes. BIOS Information Vendor: IBM Version: -[OQE115A]- Release Date: 03/14/2006 Address: 0xE0000 Runtime Size: 128 kB ROM Size: 1024 kB Characteristics: PCI is supported PNP is supported APM is supported BIOS is upgradeable BIOS shadowing is allowed Boot from CD is supported Selectable boot is supported BIOS ROM is socketed EDD is supported 5.25"/360 KB floppy services are supported (int 13h) 5.25"/1.2 MB floppy services are supported (int 13h) 3.5"/720 KB floppy services are supported (int 13h) 3.5"/2.88 MB floppy services are supported (int 13h) Print screen service is supported (int 5h) 8042 keyboard services are supported (int 9h) Serial services are supported (int 14h) Printer services are supported (int 17h) CGA/mono video services are supported (int 10h) ACPI is supported USB legacy is supported AGP is supported LS-120 boot is supported ATAPI Zip drive boot is supported Handle 0x0001 DMI type 1, 25 bytes. System Information Manufacturer: IBM Product Name: -[86494jg]- Version: 2.0 Serial Number: KDMAH1Y UUID: 0339D4C3-44C0-9D11-A20E-85CDC42DE79C Wake-up Type: Other Handle 0x0002 DMI type 2, 8 bytes. Base Board Information Manufacturer: IBM Product Name: MS-9121 Version: 2.0 Serial Number: 48Z1LX Handle 0x0003 DMI type 3, 13 bytes. Chassis Information Manufacturer: IBM Type: Tower Lock: Present Version: Serial Number: Asset Tag: Boot-up State: Unknown Power Supply State: Unknown Thermal State: Unknown Security Status: Unknown Handle 0x0004 DMI type 4, 32 bytes. Processor Information Socket Designation: CPU1 Type: Central Processor Family: Xeon Manufacturer: Intel ID: 29 0F 00 00 FF FB EB BF Signature: Type 0, Family F, Model 2, Stepping 9 Flags: FPU (Floating-point unit on-chip) VME (Virtual mode extension) DE (Debugging extension) PSE (Page size extension) TSC (Time stamp counter) MSR (Model specific registers) PAE (Physical address extension) MCE (Machine check exception) CX8 (CMPXCHG8 instruction supported) APIC (On-chip APIC hardware supported) SEP (Fast system call) MTRR (Memory type range registers) PGE (Page global enable) MCA (Machine check architecture) CMOV (Conditional move instruction supported) PAT (Page attribute table) PSE-36 (36-bit page size extension) CLFSH (CLFLUSH instruction supported) DS (Debug store) ACPI (ACPI supported) MMX (MMX technology supported) FXSR (Fast floating-point save and restore) SSE (Streaming SIMD extensions) SSE2 (Streaming SIMD extensions 2) SS (Self-snoop) HTT (Hyper-threading technology) TM (Thermal monitor supported) SBF (Signal break on FERR) Version: Intel Xeon(tm) Voltage: 1.4 V External Clock: 133 MHz Max Speed: 3200 MHz Current Speed: 2666 MHz Status: Populated, Enabled Upgrade: ZIF Socket L1 Cache Handle: 0x000B L2 Cache Handle: 0x000D L3 Cache Handle: 0x000F Handle 0x0005 DMI type 4, 32 bytes. Processor Information Socket Designation: CPU2 Type: Central Processor Family: Xeon Manufacturer: Intel ID: 29 0F 00 00 FF FB EB BF Signature: Type 0, Family F, Model 2, Stepping 9 Flags: FPU (Floating-point unit on-chip) VME (Virtual mode extension) DE (Debugging extension) PSE (Page size extension) TSC (Time stamp counter) MSR (Model specific registers) PAE (Physical address extension) MCE (Machine check exception) CX8 (CMPXCHG8 instruction supported) APIC (On-chip APIC hardware supported) SEP (Fast system call) MTRR (Memory type range registers) PGE (Page global enable) MCA (Machine check architecture) CMOV (Conditional move instruction supported) PAT (Page attribute table) PSE-36 (36-bit page size extension) CLFSH (CLFLUSH instruction supported) DS (Debug store) ACPI (ACPI supported) MMX (MMX technology supported) FXSR (Fast floating-point save and restore) SSE (Streaming SIMD extensions) SSE2 (Streaming SIMD extensions 2) SS (Self-snoop) HTT (Hyper-threading technology) TM (Thermal monitor supported) SBF (Signal break on FERR) Version: Intel Xeon(tm) Voltage: 1.4 V External Clock: 133 MHz Max Speed: 3200 MHz Current Speed: 2666 MHz Status: Populated, Enabled Upgrade: ZIF Socket L1 Cache Handle: 0x000C L2 Cache Handle: 0x000E L3 Cache Handle: 0x0010 Handle 0x0006 DMI type 5, 24 bytes. Memory Controller Information Error Detecting Method: 8-bit Parity Error Correcting Capabilities: Single-bit Error Correcting Double-bit Error Correcting Error Scrubbing Supported Interleave: One-way Interleave Current Interleave: One-way Interleave Maximum Memory Module Size: 2048 MB Maximum Total Memory Size: 8192 MB Supported Speeds: Other Supported Memory Types: Other ECC DIMM Memory Module Voltage: 3.3 V Associated Memory Slots: 4 0x0007 0x0008 0x0009 0x000A Enabled Error Correcting Capabilities: Single-bit Error Correcting Double-bit Error Correcting Error Scrubbing Handle 0x0007 DMI type 6, 12 bytes. Memory Module Information Socket Designation: DIMM1 Bank Connections: 0 Current Speed: Unknown Type: Other DIMM Installed Size: 512 MB (Single-bank Connection) Enabled Size: 512 MB (Single-bank Connection) Error Status: OK Handle 0x0008 DMI type 6, 12 bytes. Memory Module Information Socket Designation: DIMM2 Bank Connections: 2 Current Speed: Unknown Type: Other DIMM Installed Size: 512 MB (Single-bank Connection) Enabled Size: 512 MB (Single-bank Connection) Error Status: OK Handle 0x0009 DMI type 6, 12 bytes. Memory Module Information Socket Designation: DIMM3 Bank Connections: 4 Current Speed: Unknown Type: Other DIMM Installed Size: 512 MB (Single-bank Connection) Enabled Size: 512 MB (Single-bank Connection) Error Status: OK Handle 0x000A DMI type 6, 12 bytes. Memory Module Information Socket Designation: DIMM4 Bank Connections: 6 Current Speed: Unknown Type: Other DIMM Installed Size: 512 MB (Single-bank Connection) Enabled Size: 512 MB (Single-bank Connection) Error Status: OK Handle 0x000B DMI type 7, 19 bytes. Cache Information Socket Designation: Level 1 Cache Configuration: Enabled, Not Socketed, Level 1 Operational Mode: Write Back Location: Internal Installed Size: 20 KB Maximum Size: 20 KB Supported SRAM Types: Synchronous Installed SRAM Type: Synchronous Speed: Unknown Error Correction Type: Unknown System Type: Unknown Associativity: Unknown Handle 0x000C DMI type 7, 19 bytes. Cache Information Socket Designation: Level 1 Cache Configuration: Enabled, Not Socketed, Level 1 Operational Mode: Write Back Location: Internal Installed Size: 20 KB Maximum Size: 20 KB Supported SRAM Types: Synchronous Installed SRAM Type: Synchronous Speed: Unknown Error Correction Type: Unknown System Type: Unknown Associativity: Unknown Handle 0x000D DMI type 7, 19 bytes. Cache Information Socket Designation: Level 2 Cache Configuration: Enabled, Not Socketed, Level 2 Operational Mode: Write Back Location: Internal Installed Size: 512 KB Maximum Size: 512 KB Supported SRAM Types: Synchronous Installed SRAM Type: Synchronous Speed: Unknown Error Correction Type: Unknown System Type: Unknown Associativity: Unknown Handle 0x000E DMI type 7, 19 bytes. Cache Information Socket Designation: Level 2 Cache Configuration: Enabled, Not Socketed, Level 2 Operational Mode: Write Back Location: Internal Installed Size: 512 KB Maximum Size: 512 KB Supported SRAM Types: Synchronous Installed SRAM Type: Synchronous Speed: Unknown Error Correction Type: Unknown System Type: Unknown Associativity: Unknown Handle 0x000F DMI type 7, 19 bytes. Cache Information Socket Designation: Tertiary (Level 3) Cache Configuration: Disabled, Not Socketed, Level 3 Operational Mode: Write Back Location: Internal Installed Size: 0 KB Maximum Size: 0 KB Supported SRAM Types: Synchronous Installed SRAM Type: Synchronous Speed: Unknown Error Correction Type: Unknown System Type: Unknown Associativity: Unknown Handle 0x0010 DMI type 7, 19 bytes. Cache Information Socket Designation: Tertiary (Level 3) Cache Configuration: Disabled, Not Socketed, Level 3 Operational Mode: Write Back Location: Internal Installed Size: 0 KB Maximum Size: 0 KB Supported SRAM Types: Synchronous Installed SRAM Type: Synchronous Speed: Unknown Error Correction Type: Unknown System Type: Unknown Associativity: Unknown Handle 0x0011 DMI type 8, 9 bytes. Port Connector Information Internal Reference Designator: IDE1 Internal Connector Type: On Board IDE External Reference Designator: Not Specified External Connector Type: None Port Type: Other Handle 0x0012 DMI type 8, 9 bytes. Port Connector Information Internal Reference Designator: IDE2 Internal Connector Type: On Board IDE External Reference Designator: Not Specified External Connector Type: None Port Type: Other Handle 0x0013 DMI type 8, 9 bytes. Port Connector Information Internal Reference Designator: FDD Internal Connector Type: On Board Floppy External Reference Designator: Not Specified External Connector Type: None Port Type: 8251 FIFO Compatible Handle 0x0014 DMI type 8, 9 bytes. Port Connector Information Internal Reference Designator: COM1 Internal Connector Type: 9 Pin Dual Inline (pin 10 cut) External Reference Designator: External Connector Type: DB-9 male Port Type: Serial Port 16450 Compatible Handle 0x0015 DMI type 8, 9 bytes. Port Connector Information Internal Reference Designator: COM2 Internal Connector Type: 9 Pin Dual Inline (pin 10 cut) External Reference Designator: External Connector Type: DB-9 male Port Type: Serial Port 16450 Compatible Handle 0x0016 DMI type 8, 9 bytes. Port Connector Information Internal Reference Designator: LPT1 Internal Connector Type: DB-25 female External Reference Designator: External Connector Type: DB-25 female Port Type: Parallel Port ECP/EPP Handle 0x0017 DMI type 8, 9 bytes. Port Connector Information Internal Reference Designator: Keyboard Internal Connector Type: PS/2 External Reference Designator: External Connector Type: PS/2 Port Type: Keyboard Port Handle 0x0018 DMI type 8, 9 bytes. Port Connector Information Internal Reference Designator: PS/2 Mouse Internal Connector Type: PS/2 External Reference Designator: External Connector Type: PS/2 Port Type: Mouse Port Handle 0x0019 DMI type 8, 9 bytes. Port Connector Information Internal Reference Designator: Not Specified Internal Connector Type: None External Reference Designator: JUSB1 External Connector Type: Other Port Type: USB Handle 0x001A DMI type 8, 9 bytes. Port Connector Information Internal Reference Designator: Not Specified Internal Connector Type: None External Reference Designator: JUSB2 External Connector Type: Other Port Type: USB Handle 0x001B DMI type 8, 9 bytes. Port Connector Information Internal Reference Designator: Not Specified Internal Connector Type: None External Reference Designator: AUD1 External Connector Type: None Port Type: Audio Port Handle 0x001C DMI type 8, 9 bytes. Port Connector Information Internal Reference Designator: Not Specified Internal Connector Type: None External Reference Designator: JLAN1 External Connector Type: RJ-45 Port Type: Network Port Handle 0x001D DMI type 8, 9 bytes. Port Connector Information Internal Reference Designator: Not Specified Internal Connector Type: None External Reference Designator: SCSI1 External Connector Type: None Port Type: SCSI Wide Handle 0x001E DMI type 8, 9 bytes. Port Connector Information Internal Reference Designator: Not Specified Internal Connector Type: None External Reference Designator: SCSI2 External Connector Type: None Port Type: SCSI Wide Handle 0x001F DMI type 9, 13 bytes. System Slot Information Designation: PCI1 Type: 32-bit PCI Current Usage: Available Length: Other ID: 1 Characteristics: 3.3 V is provided PME signal is supported Handle 0x0020 DMI type 9, 13 bytes. System Slot Information Designation: PCI6 Type: 32-bit PCI Current Usage: In Use Length: Other ID: 2 Characteristics: 3.3 V is provided PME signal is supported Handle 0x0021 DMI type 10, 14 bytes. On Board Device Information Type: Other Status: Enabled Description: IBM Automatic Server Restart - Machine Type 8480 On Board Device Information Type: SCSI Controller Status: Enabled Description: LSI Logic 1030 Ultra320 SCSI Adapter - SCSI1 On Board Device Information Type: SCSI Controller Status: Enabled Description: LSI Logic 1030 Ultra320 SCSI Adapter - SCSI2 On Board Device Information Type: Ethernet Status: Enabled Description: Broadcom BCM5703 NetXtreme Gigabit Ethernet - JLAN1 On Board Device Information Type: Sound Status: Enabled Description: SoundMax Integrated Digital Audio - AUD1 Handle 0x0022 DMI type 9, 13 bytes. System Slot Information Designation: AGP Type: 32-bit AGP Current Usage: Available Length: Long ID: 8 Characteristics: 5.0 V is provided Handle 0x0023 DMI type 9, 13 bytes. System Slot Information Designation: PCI2 Type: 64-bit PCI-X Current Usage: Available Length: Long ID: 2 Characteristics: 3.3 V is provided PME signal is supported Handle 0x0024 DMI type 9, 13 bytes. System Slot Information Designation: PCI3 Type: 64-bit PCI-X Current Usage: Available Length: Long ID: 3 Characteristics: 3.3 V is provided PME signal is supported Handle 0x0025 DMI type 9, 13 bytes. System Slot Information Designation: PCI4 Type: 64-bit PCI-X Current Usage: In Use Length: Long ID: 1 Characteristics: 3.3 V is provided PME signal is supported Handle 0x0026 DMI type 9, 13 bytes. System Slot Information Designation: PCI5 Type: 64-bit PCI-X Current Usage: Available Length: Long ID: 2 Characteristics: 3.3 V is provided PME signal is supported Handle 0x0027 DMI type 13, 22 bytes. BIOS Language Information Installable Languages: 3 n|US|iso8859-1 n|US|iso8859-1 r|CA|iso8859-1 Currently Installed Language: n|US|iso8859-1 Handle 0x0028 DMI type 16, 15 bytes. Physical Memory Array Location: System Board Or Motherboard Use: System Memory Error Correction Type: Multi-bit ECC Maximum Capacity: 8 GB Error Information Handle: No Error Number Of Devices: 4 Handle 0x0029 DMI type 17, 21 bytes. Memory Device Array Handle: 0x0028 Error Information Handle: 0x002D Total Width: 257 bits Data Width: 256 bits Size: 512 MB Form Factor: DIMM Set: 1 Locator: DIMM1 Bank Locator: Bank0 Type: DDR Type Detail: None Handle 0x002A DMI type 17, 21 bytes. Memory Device Array Handle: 0x0028 Error Information Handle: 0x002E Total Width: 257 bits Data Width: 256 bits Size: 512 MB Form Factor: DIMM Set: 1 Locator: DIMM2 Bank Locator: Bank1 Type: DDR Type Detail: None Handle 0x002B DMI type 17, 21 bytes. Memory Device Array Handle: 0x0028 Error Information Handle: 0x002F Total Width: 257 bits Data Width: 256 bits Size: 512 MB Form Factor: DIMM Set: 2 Locator: DIMM3 Bank Locator: Bank2 Type: DDR Type Detail: None Handle 0x002C DMI type 17, 21 bytes. Memory Device Array Handle: 0x0028 Error Information Handle: 0x0030 Total Width: 257 bits Data Width: 256 bits Size: 512 MB Form Factor: DIMM Set: 2 Locator: DIMM4 Bank Locator: Bank3 Type: DDR Type Detail: None Handle 0x002D DMI type 18, 23 bytes. 32-bit Memory Error Information Type: Other Granularity: Other Operation: Other Vendor Syndrome: Unknown Memory Array Address: Unknown Device Address: Unknown Resolution: Unknown Handle 0x002E DMI type 18, 23 bytes. 32-bit Memory Error Information Type: Other Granularity: Other Operation: Other Vendor Syndrome: Unknown Memory Array Address: Unknown Device Address: Unknown Resolution: Unknown Handle 0x002F DMI type 18, 23 bytes. 32-bit Memory Error Information Type: Other Granularity: Other Operation: Other Vendor Syndrome: Unknown Memory Array Address: Unknown Device Address: Unknown Resolution: Unknown Handle 0x0030 DMI type 18, 23 bytes. 32-bit Memory Error Information Type: Other Granularity: Other Operation: Other Vendor Syndrome: Unknown Memory Array Address: Unknown Device Address: Unknown Resolution: Unknown Handle 0x0031 DMI type 19, 15 bytes. Memory Array Mapped Address Starting Address: 0x00000000000 Ending Address: 0x0007FFFFFFF Range Size: 2 GB Physical Array Handle: 0x0028 Partition Width: 0 Handle 0x0032 DMI type 20, 19 bytes. Memory Device Mapped Address Starting Address: 0x00000000000 Ending Address: 0x0001FFFFFFF Range Size: 512 MB Physical Device Handle: 0x0029 Memory Array Mapped Address Handle: 0x0031 Partition Row Position: 1 Handle 0x0033 DMI type 20, 19 bytes. Memory Device Mapped Address Starting Address: 0x00020000000 Ending Address: 0x0003FFFFFFF Range Size: 512 MB Physical Device Handle: 0x002A Memory Array Mapped Address Handle: 0x0031 Partition Row Position: 1 Handle 0x0034 DMI type 20, 19 bytes. Memory Device Mapped Address Starting Address: 0x00040000000 Ending Address: 0x0005FFFFFFF Range Size: 512 MB Physical Device Handle: 0x002B Memory Array Mapped Address Handle: 0x0031 Partition Row Position: 1 Handle 0x0035 DMI type 20, 19 bytes. Memory Device Mapped Address Starting Address: 0x00060000000 Ending Address: 0x0007FFFFFFF Range Size: 512 MB Physical Device Handle: 0x002C Memory Array Mapped Address Handle: 0x0031 Partition Row Position: 1 Handle 0x0036 DMI type 32, 11 bytes. System Boot Information Status: No errors detected Handle 0x0037 DMI type 129, 8 bytes. OEM-specific Type Header And Data: 81 08 37 00 01 01 02 01 Strings: Alert Standard Format IBM 0053 Handle 0x0038 DMI type 127, 4 bytes. End Of Table �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������UnixAgent-2.4.2/resources/dmidecode.rhel.4.6��������������������������������������������������������0000664�0000000�0000000�00000045616�13327377321�0020556�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������# dmidecode 2.2 SMBIOS 2.4 present. 74 structures occupying 2059 bytes. Table at 0x000EE000. Handle 0x0000 DMI type 0, 24 bytes. BIOS Information Vendor: HP Version: D21 Release Date: 01/24/2008 Address: 0xF0000 Runtime Size: 64 kB ROM Size: 4096 kB Characteristics: PCI is supported PNP is supported BIOS is upgradeable BIOS shadowing is allowed ESCD support is available Boot from CD is supported Selectable boot is supported EDD is supported 5.25"/360 KB floppy services are supported (int 13h) 5.25"/1.2 MB floppy services are supported (int 13h) 3.5"/720 KB floppy services are supported (int 13h) Print screen service is supported (int 5h) 8042 keyboard services are supported (int 9h) Serial services are supported (int 14h) Printer services are supported (int 17h) CGA/mono video services are supported (int 10h) ACPI is supported USB legacy is supported BIOS boot specification is supported Function key-initiated network boot is supported Handle 0x0100 DMI type 1, 27 bytes. System Information Manufacturer: HP Product Name: ProLiant ML350 G5 Version: Not Specified Serial Number: GB8814HE7S UUID: 34313236-3435-4742-3838-313448453753 Wake-up Type: Power Switch Handle 0x0300 DMI type 3, 17 bytes. Chassis Information Manufacturer: HP Type: Tower Lock: Not Present Version: Not Specified Serial Number: GB8814HE7S Asset Tag: Boot-up State: Unknown Power Supply State: Unknown Thermal State: Unknown Security Status: Unknown OEM Information: 0x00000000 Handle 0x0400 DMI type 4, 40 bytes. Processor Information Socket Designation: Proc 1 Type: Central Processor Family: Xeon Manufacturer: Intel ID: 76 06 01 00 FF FB EB BF Signature: Type 0, Family 6, Model 17, Stepping 6 Flags: FPU (Floating-point unit on-chip) VME (Virtual mode extension) DE (Debugging extension) PSE (Page size extension) TSC (Time stamp counter) MSR (Model specific registers) PAE (Physical address extension) MCE (Machine check exception) CX8 (CMPXCHG8 instruction supported) APIC (On-chip APIC hardware supported) SEP (Fast system call) MTRR (Memory type range registers) PGE (Page global enable) MCA (Machine check architecture) CMOV (Conditional move instruction supported) PAT (Page attribute table) PSE-36 (36-bit page size extension) CLFSH (CLFLUSH instruction supported) DS (Debug store) ACPI (ACPI supported) MMX (MMX technology supported) FXSR (Fast floating-point save and restore) SSE (Streaming SIMD extensions) SSE2 (Streaming SIMD extensions 2) SS (Self-snoop) HTT (Hyper-threading technology) TM (Thermal monitor supported) SBF (Signal break on FERR) Version: Not Specified Voltage: 1.4 V External Clock: 1333 MHz Max Speed: 4800 MHz Current Speed: 2333 MHz Status: Populated, Enabled Upgrade: ZIF Socket L1 Cache Handle: 0x0710 L2 Cache Handle: 0x0720 L3 Cache Handle: 0x0730 Serial Number: Not Specified Asset Tag: Not Specified Part Number: Not Specified Handle 0x0406 DMI type 4, 40 bytes. Processor Information Socket Designation: Proc 2 Type: Central Processor Family: Xeon Manufacturer: Intel ID: 00 00 00 00 00 00 00 00 Signature: Type 0, Family 0, Model 0, Stepping 0 Flags: None Version: Not Specified Voltage: 1.4 V External Clock: 200 MHz Max Speed: 4800 MHz Current Speed: Unknown Status: Unpopulated Upgrade: ZIF Socket L1 Cache Handle: 0x0716 L2 Cache Handle: 0x0726 L3 Cache Handle: 0x0736 Serial Number: Not Specified Asset Tag: Not Specified Part Number: Not Specified Handle 0x0710 DMI type 7, 19 bytes. Cache Information Socket Designation: Processor 1 Internal L1 Cache Configuration: Enabled, Not Socketed, Level 1 Operational Mode: Write Back Location: Internal Installed Size: 128 KB Maximum Size: 128 KB Supported SRAM Types: Burst Installed SRAM Type: Burst Speed: Unknown Error Correction Type: Single-bit ECC System Type: Data Associativity: 8-way Set-associative Handle 0x0716 DMI type 7, 19 bytes. Cache Information Socket Designation: Processor 2 Internal L1 Cache Configuration: Disabled, Not Socketed, Level 1 Operational Mode: Unknown Location: Internal Installed Size: 0 KB Maximum Size: 128 KB Supported SRAM Types: Burst Installed SRAM Type: Burst Speed: Unknown Error Correction Type: Single-bit ECC System Type: Data Associativity: 8-way Set-associative Handle 0x0720 DMI type 7, 19 bytes. Cache Information Socket Designation: Processor 1 Internal L2 Cache Configuration: Enabled, Not Socketed, Level 2 Operational Mode: Write Back Location: Internal Installed Size: 12288 KB Maximum Size: 16384 KB Supported SRAM Types: Burst Installed SRAM Type: Burst Speed: Unknown Error Correction Type: Single-bit ECC System Type: Unknown Associativity: 8-way Set-associative Handle 0x0726 DMI type 7, 19 bytes. Cache Information Socket Designation: Processor 2 Internal L2 Cache Configuration: Disabled, Not Socketed, Level 2 Operational Mode: Unknown Location: Internal Installed Size: 0 KB Maximum Size: 16384 KB Supported SRAM Types: Burst Installed SRAM Type: Burst Speed: Unknown Error Correction Type: Single-bit ECC System Type: Unknown Associativity: 8-way Set-associative Handle 0x0730 DMI type 7, 19 bytes. Cache Information Socket Designation: Processor 1 Internal L3 Cache Configuration: Disabled, Not Socketed, Level 3 Operational Mode: Unknown Location: Internal Installed Size: 0 KB Maximum Size: 8192 KB Supported SRAM Types: Burst Installed SRAM Type: Burst Speed: Unknown Error Correction Type: Single-bit ECC System Type: Unknown Associativity: Other Handle 0x0736 DMI type 7, 19 bytes. Cache Information Socket Designation: Processor 2 Internal L3 Cache Configuration: Disabled, Not Socketed, Level 3 Operational Mode: Unknown Location: Internal Installed Size: 0 KB Maximum Size: 8192 KB Supported SRAM Types: Burst Installed SRAM Type: Burst Speed: Unknown Error Correction Type: Single-bit ECC System Type: Unknown Associativity: Other Handle 0x0801 DMI type 8, 9 bytes. Port Connector Information Internal Reference Designator: J16 Internal Connector Type: Access Bus (USB) External Reference Designator: USB Port 1 External Connector Type: Access Bus (USB) Port Type: USB Handle 0x0802 DMI type 8, 9 bytes. Port Connector Information Internal Reference Designator: J19 Internal Connector Type: Access Bus (USB) External Reference Designator: USB Port 2 External Connector Type: Access Bus (USB) Port Type: USB Handle 0x0803 DMI type 8, 9 bytes. Port Connector Information Internal Reference Designator: J69 Internal Connector Type: Access Bus (USB) External Reference Designator: USB Port 3 External Connector Type: Access Bus (USB) Port Type: USB Handle 0x0804 DMI type 8, 9 bytes. Port Connector Information Internal Reference Designator: J69 Internal Connector Type: Access Bus (USB) External Reference Designator: USB Port 4 External Connector Type: Access Bus (USB) Port Type: USB Handle 0x0805 DMI type 8, 9 bytes. Port Connector Information Internal Reference Designator: J02 Internal Connector Type: Access Bus (USB) External Reference Designator: USB Port 5 External Connector Type: Access Bus (USB) Port Type: USB Handle 0x0806 DMI type 8, 9 bytes. Port Connector Information Internal Reference Designator: J03 Internal Connector Type: Access Bus (USB) External Reference Designator: USB Port 6 External Connector Type: Access Bus (USB) Port Type: USB Handle 0x0901 DMI type 9, 13 bytes. System Slot Information Designation: PCI Slot 1 Type: 64-bit PCI-X Current Usage: Available Length: Long ID: 1 Characteristics: 3.3 V is provided PME signal is supported Handle 0x0902 DMI type 9, 13 bytes. System Slot Information Designation: PCI Slot 2 Type: 64-bit PCI-X Current Usage: Available Length: Long ID: 2 Characteristics: 3.3 V is provided PME signal is supported Handle 0x0903 DMI type 9, 13 bytes. System Slot Information Designation: PCI Slot 3 Type: 64-bit PCI-X Current Usage: Available Length: Long ID: 3 Characteristics: 3.3 V is provided PME signal is supported Handle 0x0904 DMI type 9, 13 bytes. System Slot Information Designation: PCI-E Slot 4 Type: <OUT OF SPEC><OUT OF SPEC> Current Usage: Available Length: Long Characteristics: 3.3 V is provided PME signal is supported Handle 0x0905 DMI type 9, 13 bytes. System Slot Information Designation: PCI-E Slot 5 Type: <OUT OF SPEC><OUT OF SPEC> Current Usage: Available Length: Long Characteristics: 3.3 V is provided PME signal is supported Handle 0x0906 DMI type 9, 13 bytes. System Slot Information Designation: PCI-E Slot 6 Type: <OUT OF SPEC><OUT OF SPEC> Current Usage: Available Length: Long Characteristics: 3.3 V is provided PME signal is supported Handle 0x0B00 DMI type 11, 5 bytes. OEM Strings String 1: Product ID: 412645-B21 Handle 0x1000 DMI type 16, 15 bytes. Physical Memory Array Location: System Board Or Motherboard Use: System Memory Error Correction Type: Single-bit ECC Maximum Capacity: 32 GB Error Information Handle: Not Provided Number Of Devices: 8 Handle 0x1100 DMI type 17, 23 bytes. Memory Device Array Handle: 0x1000 Error Information Handle: Not Provided Total Width: 72 bits Data Width: 64 bits Size: 512 MB Form Factor: <OUT OF SPEC> Set: 1 Locator: DIMM 1A Bank Locator: Not Specified Type: <OUT OF SPEC> Type Detail: Synchronous Speed: 667 MHz (1.5 ns) Handle 0x1101 DMI type 17, 23 bytes. Memory Device Array Handle: 0x1000 Error Information Handle: Not Provided Total Width: 72 bits Data Width: 64 bits Size: 1024 MB Form Factor: <OUT OF SPEC> Set: 2 Locator: DIMM 2B Bank Locator: Not Specified Type: <OUT OF SPEC> Type Detail: Synchronous Speed: 667 MHz (1.5 ns) Handle 0x1102 DMI type 17, 23 bytes. Memory Device Array Handle: 0x1000 Error Information Handle: Not Provided Total Width: 72 bits Data Width: 64 bits Size: 1024 MB Form Factor: <OUT OF SPEC> Set: 3 Locator: DIMM 3C Bank Locator: Not Specified Type: <OUT OF SPEC> Type Detail: Synchronous Speed: 667 MHz (1.5 ns) Handle 0x1103 DMI type 17, 23 bytes. Memory Device Array Handle: 0x1000 Error Information Handle: Not Provided Total Width: 72 bits Data Width: 64 bits Size: No Module Installed Form Factor: <OUT OF SPEC> Set: 4 Locator: DIMM 4D Bank Locator: Not Specified Type: <OUT OF SPEC> Type Detail: Synchronous Speed: Unknown Handle 0x1104 DMI type 17, 23 bytes. Memory Device Array Handle: 0x1000 Error Information Handle: Not Provided Total Width: 72 bits Data Width: 64 bits Size: 512 MB Form Factor: <OUT OF SPEC> Set: 1 Locator: DIMM 5A Bank Locator: Not Specified Type: <OUT OF SPEC> Type Detail: Synchronous Speed: 667 MHz (1.5 ns) Handle 0x1105 DMI type 17, 23 bytes. Memory Device Array Handle: 0x1000 Error Information Handle: Not Provided Total Width: 72 bits Data Width: 64 bits Size: 1024 MB Form Factor: <OUT OF SPEC> Set: 2 Locator: DIMM 6B Bank Locator: Not Specified Type: <OUT OF SPEC> Type Detail: Synchronous Speed: 667 MHz (1.5 ns) Handle 0x1106 DMI type 17, 23 bytes. Memory Device Array Handle: 0x1000 Error Information Handle: Not Provided Total Width: 72 bits Data Width: 64 bits Size: 1024 MB Form Factor: <OUT OF SPEC> Set: 3 Locator: DIMM 7C Bank Locator: Not Specified Type: <OUT OF SPEC> Type Detail: Synchronous Speed: 667 MHz (1.5 ns) Handle 0x1107 DMI type 17, 23 bytes. Memory Device Array Handle: 0x1000 Error Information Handle: Not Provided Total Width: 72 bits Data Width: 64 bits Size: No Module Installed Form Factor: <OUT OF SPEC> Set: 4 Locator: DIMM 8D Bank Locator: Not Specified Type: <OUT OF SPEC> Type Detail: Synchronous Speed: Unknown Handle 0x1300 DMI type 19, 15 bytes. Memory Array Mapped Address Starting Address: 0x00000000000 Ending Address: 0x0015FFFFFFF Range Size: 5632 MB Physical Array Handle: 0x1000 Partition Width: 0 Handle 0x1400 DMI type 20, 19 bytes. Memory Device Mapped Address Starting Address: 0x00000000000 Ending Address: 0x0015FFFFFFF Range Size: 5632 MB Physical Device Handle: 0x1100 Memory Array Mapped Address Handle: 0x1300 Partition Row Position: 1 Interleave Position: 1 Interleaved Data Depth: Unknown Handle 0x1401 DMI type 20, 19 bytes. Memory Device Mapped Address Starting Address: 0x00000000000 Ending Address: 0x0015FFFFFFF Range Size: 5632 MB Physical Device Handle: 0x1101 Memory Array Mapped Address Handle: 0x1300 Partition Row Position: 1 Interleave Position: 1 Interleaved Data Depth: Unknown Handle 0x1402 DMI type 20, 19 bytes. Memory Device Mapped Address Starting Address: 0x00000000000 Ending Address: 0x0015FFFFFFF Range Size: 5632 MB Physical Device Handle: 0x1102 Memory Array Mapped Address Handle: 0x1300 Partition Row Position: 1 Interleave Position: 1 Interleaved Data Depth: Unknown Handle 0x1403 DMI type 20, 19 bytes. Memory Device Mapped Address Starting Address: 0x00000000000 Ending Address: 0x000000003FF Range Size: 1 kB Physical Device Handle: 0x1103 Memory Array Mapped Address Handle: 0x1300 Partition Row Position: 1 Interleave Position: 1 Interleaved Data Depth: Unknown Handle 0x1404 DMI type 20, 19 bytes. Memory Device Mapped Address Starting Address: 0x00000000000 Ending Address: 0x0015FFFFFFF Range Size: 5632 MB Physical Device Handle: 0x1104 Memory Array Mapped Address Handle: 0x1300 Partition Row Position: 1 Interleave Position: 2 Interleaved Data Depth: Unknown Handle 0x1405 DMI type 20, 19 bytes. Memory Device Mapped Address Starting Address: 0x00000000000 Ending Address: 0x0015FFFFFFF Range Size: 5632 MB Physical Device Handle: 0x1105 Memory Array Mapped Address Handle: 0x1300 Partition Row Position: 1 Interleave Position: 2 Interleaved Data Depth: Unknown Handle 0x1406 DMI type 20, 19 bytes. Memory Device Mapped Address Starting Address: 0x00000000000 Ending Address: 0x0015FFFFFFF Range Size: 5632 MB Physical Device Handle: 0x1106 Memory Array Mapped Address Handle: 0x1300 Partition Row Position: 1 Interleave Position: 2 Interleaved Data Depth: Unknown Handle 0x1407 DMI type 20, 19 bytes. Memory Device Mapped Address Starting Address: 0x00000000000 Ending Address: 0x000000003FF Range Size: 1 kB Physical Device Handle: 0x1107 Memory Array Mapped Address Handle: 0x1300 Partition Row Position: 1 Interleave Position: 2 Interleaved Data Depth: Unknown Handle 0x2000 DMI type 32, 11 bytes. System Boot Information Status: No errors detected Handle 0x2600 DMI type 38, 18 bytes. IPMI Device Information Interface Type: KCS (Keyboard Control Style) Specification Version: 2.0 I2C Slave Address: 0x10 NV Storage Device: Not Present Base Address: 0x0000000000000CA2 (I/O) Register Spacing: Successive Byte Boundaries Handle 0xC100 DMI type 193, 7 bytes. OEM-specific Type Header And Data: C1 07 00 C1 01 01 02 Strings: 11/13/2007 11/13/2007 Handle 0xC200 DMI type 194, 5 bytes. OEM-specific Type Header And Data: C2 05 00 C2 01 Handle 0xC300 DMI type 195, 5 bytes. OEM-specific Type Header And Data: C3 05 00 C3 01 Strings: $0E110764 Handle 0xC400 DMI type 196, 5 bytes. OEM-specific Type Header And Data: C4 05 00 C4 00 Handle 0xC500 DMI type 197, 10 bytes. OEM-specific Type Header And Data: C5 0A 00 C5 00 04 00 01 FF 01 Handle 0xDF00 DMI type 223, 7 bytes. OEM-specific Type Header And Data: DF 07 00 DF 66 46 70 Handle 0xC506 DMI type 197, 10 bytes. OEM-specific Type Header And Data: C5 0A 06 C5 06 04 00 00 FF 02 Handle 0xD300 DMI type 211, 7 bytes. OEM-specific Type Header And Data: D3 07 00 D3 00 04 4E Handle 0xD306 DMI type 211, 7 bytes. OEM-specific Type Header And Data: D3 07 06 D3 06 04 00 Handle 0xC600 DMI type 198, 11 bytes. OEM-specific Type Header And Data: C6 0B 00 C6 17 00 00 01 3C 00 01 Handle 0xC700 DMI type 199, 112 bytes. OEM-specific Type Header And Data: C7 70 00 C7 0B 06 00 00 08 20 19 01 76 06 01 00 0B 06 00 00 08 20 19 01 76 06 01 00 04 04 00 00 07 20 08 06 74 06 01 00 04 04 00 00 07 20 08 06 74 06 01 00 B4 00 00 00 07 20 14 03 FB 06 00 00 B4 00 00 00 07 20 14 03 FB 06 00 00 67 00 00 00 07 20 26 03 F7 06 00 00 C9 00 00 00 07 20 26 03 F6 06 00 00 02 00 00 00 05 20 15 12 64 0F 00 00 Handle 0xCD00 DMI type 205, 22 bytes. OEM-specific Type Header And Data: CD 16 00 CD 01 01 46 41 54 78 00 00 E0 FF 00 00 00 00 00 00 0D 00 Handle 0xCA00 DMI type 202, 8 bytes. OEM-specific Type Header And Data: CA 08 00 CA 00 11 FF 01 Handle 0xCA01 DMI type 202, 8 bytes. OEM-specific Type Header And Data: CA 08 01 CA 01 11 FF 02 Handle 0xCA02 DMI type 202, 8 bytes. OEM-specific Type Header And Data: CA 08 02 CA 02 11 FF 03 Handle 0xCA03 DMI type 202, 8 bytes. OEM-specific Type Header And Data: CA 08 03 CA 03 11 FF 04 Handle 0xCA04 DMI type 202, 8 bytes. OEM-specific Type Header And Data: CA 08 04 CA 04 11 FF 05 Handle 0xCA05 DMI type 202, 8 bytes. OEM-specific Type Header And Data: CA 08 05 CA 05 11 FF 06 Handle 0xCA06 DMI type 202, 8 bytes. OEM-specific Type Header And Data: CA 08 06 CA 06 11 FF 07 Handle 0xCA07 DMI type 202, 8 bytes. OEM-specific Type Header And Data: CA 08 07 CA 07 11 FF 08 Handle 0xD100 DMI type 209, 12 bytes. OEM-specific Type Header And Data: D1 0C 00 D1 00 03 00 1F 29 62 C4 A4 Handle 0xD400 DMI type 212, 24 bytes. OEM-specific Type Header And Data: D4 18 00 D4 24 43 52 55 00 F8 F6 FF 00 00 00 00 00 40 00 00 00 00 00 00 Handle 0xD500 DMI type 213, 28 bytes. OEM-specific Type Header And Data: D5 1C 00 D5 00 00 36 00 00 00 BF 1F 00 00 46 00 00 00 00 00 00 00 00 00 00 00 00 00 Handle 0xD600 DMI type 214, 44 bytes. OEM-specific Type Header And Data: D6 2C 00 D6 31 31 00 02 0E 20 00 00 13 20 00 00 00 60 00 00 00 20 00 00 02 20 00 00 04 20 00 00 06 20 00 00 0C 20 00 00 08 20 00 00 Handle 0xD700 DMI type 215, 6 bytes. OEM-specific Type Header And Data: D7 06 00 D7 00 05 Handle 0xDB00 DMI type 219, 8 bytes. OEM-specific Type Header And Data: DB 08 00 DB FF 00 00 00 Handle 0xDC00 DMI type 218, 45 bytes. OEM-specific Type Header And Data: DA 2D 00 DC 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 Handle 0xDC01 DMI type 220, 45 bytes. OEM-specific Type Header And Data: DC 2D 01 DC 08 00 00 C5 00 FF 01 00 C5 01 FF 02 00 C5 02 FF 03 00 C5 03 FF 04 06 C5 02 FF 05 06 C5 03 FF 06 06 C5 00 FF 07 06 C5 01 FF Handle 0xDD00 DMI type 221, 12 bytes. OEM-specific Type Header And Data: DD 0C 00 DD 00 03 00 1F 29 62 C4 A5 Handle 0x7F00 DMI type 127, 4 bytes. End Of Table ������������������������������������������������������������������������������������������������������������������UnixAgent-2.4.2/resources/ipdiscover/���������������������������������������������������������������0000775�0000000�0000000�00000000000�13327377321�0017612�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������UnixAgent-2.4.2/resources/ipdiscover/ipdiscover.c���������������������������������������������������0000664�0000000�0000000�00000015474�13327377321�0022140�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* ############################################################################### ##OCSInventory Version NG Beta ##Copyleft Pascal DANEK 2006 ##Web : http://ocsinventory.sourceforge.net ## ##This code is open source and may be copied and modified as long as the source ##code is always made freely available. ##Please refer to the General Public Licence http://www.gnu.org/ or Licence.txt ################################################################################ */ #include "ipdiscover.h" /* We get IP address, netmask, index number and mac address of the adapter */ void get_iface_infos( packet *ppacket, int *index, char *iface, struct sockaddr_in *ipaddr, struct sockaddr_in *netmask){ int tmpsock; struct ifreq ifr; if( ( tmpsock = socket( AF_INET, SOCK_STREAM, 0 ) ) < 0 ){ perror("Socket creation problem"); exit(1); } /* Initialize */ memset( &ifr, 0x0, sizeof(struct ifreq)); /* We put into the ifreq struct the name of adapter */ strncpy(ifr.ifr_name, iface, IF_NAMESIZE-1); /* IP */ if(ioctl(tmpsock, SIOCGIFADDR, &ifr)< 0){ close(tmpsock); perror("Cannot get the ip address"); exit(1); } memcpy( &ipaddr->sin_addr, &( (struct sockaddr_in *) &ifr.ifr_addr )->sin_addr, 4 ); memcpy( ppacket->arphdr.ar_sip, &( (struct sockaddr_in *) &ifr.ifr_addr )->sin_addr, 4 ); /*******************/ /* SNM */ if(ioctl(tmpsock, SIOCGIFNETMASK, &ifr)< 0){ close(tmpsock); perror("Cannot get the net submask"); exit(1); } memcpy(&netmask->sin_addr, &((struct sockaddr_in *) &ifr.ifr_netmask)->sin_addr, 4); /*******************/ /* MAC */ if(ioctl(tmpsock, SIOCGIFHWADDR, &ifr)< 0){ close(tmpsock); perror("Cannot get the mac address"); exit(1); } memcpy( ppacket->ethhdr.h_source, (unsigned char *)&ifr.ifr_hwaddr.sa_data, ETH_ALEN ); memcpy( ppacket->arphdr.ar_sha, (unsigned char *)&ifr.ifr_hwaddr.sa_data, ETH_ALEN ); /*******************/ /* INDEX */ if(ioctl(tmpsock, SIOCGIFINDEX, &ifr)< 0){ close(tmpsock); perror("Cannot get the interface index"); exit(1); } *index = ifr.ifr_ifindex; /*******************/ close(tmpsock); } void data_init( struct sockaddr_in *ipaddr, struct sockaddr_in *netmask, packet **ppacket, struct sockaddr_ll *sll, int index ){ memset(ipaddr, 0x00, sizeof(struct sockaddr_in)); memset(netmask, 0x00, sizeof(struct sockaddr_in)); /* Arp structure */ *ppacket = malloc( sizeof( packet ) ); /* Tie to adapter */ sll->sll_family = AF_PACKET; sll->sll_protocol = htons(ETH_P_ARP); /* Building the packet */ memset( (*ppacket)->ethhdr.h_dest, 0xFF, 6 ); (*ppacket)->ethhdr.h_proto = htons(0x806); /* arp header */ (*ppacket)->arphdr.arp_hrdad = htons(ARPHRD_ETHER); (*ppacket)->arphdr.arp_prot = htons(ETH_P_IP); (*ppacket)->arphdr.arp_halen = ETH_ALEN; (*ppacket)->arphdr.arp_prlen = 4; (*ppacket)->arphdr.arp_opcode = htons(ARPOP_REQUEST); memset( (*ppacket)->arphdr.ar_tha, 0x0,ETH_ALEN ); } void print_xml(struct in_addr *ipsrc, packet *ppacket_r, struct hostent* name){ printf("<H><I>%s</I><M>%02x:%02x:%02x:%02x:%02x:%02x</M><N>%s</N></H>\n",inet_ntoa(*ipsrc), *ppacket_r->arphdr.ar_sha,ppacket_r->arphdr.ar_sha[1],ppacket_r->arphdr.ar_sha[2], ppacket_r->arphdr.ar_sha[3],ppacket_r->arphdr.ar_sha[4],ppacket_r->arphdr.ar_sha[5], name?name->h_name:"-"); } void create_socket(int *sd, struct sockaddr_ll *sll, int index){ /* Socket creation */ *sd = socket( PF_PACKET, SOCK_RAW, htons( ETH_P_ARP ) ); /* Put the iface index in sockaddr_ll structure to bind */ sll->sll_ifindex = index; if( *sd < 0 ){ perror("Socket creation problem"); exit(1); } if( fcntl( *sd, F_SETFL, O_NONBLOCK ) == -1 ){ perror("Cannot set socket mode to O_NONBLOCK"); exit(1); } /* Bind */ if( bind( *sd, (struct sockaddr*)sll, sizeof(*sll) ) == -1 ){ perror("Bind error"); exit(1); } } void validate_iface( struct sockaddr_in *ipaddr, struct sockaddr_in *netmask, packet *ppacket ){ char error_str[100]; if( ntohl(netmask->sin_addr.s_addr) < 0xFFFF0000){ snprintf(error_str, 100, "Invalid netmask -> too large (%s). Stop\n", inet_ntoa(netmask->sin_addr)); perror( error_str ); exit(1); } } void scan_init( unsigned long *unet, unsigned long *uhost, struct sockaddr_in *ipaddr, struct sockaddr_in *netmask, struct in_addr *ipsrc, packet **ppacket_r ){ /* Netid */ *unet = ntohl(ipaddr->sin_addr.s_addr) & ntohl(netmask->sin_addr.s_addr); /* Supposed number of hosts */ *uhost = ~( ntohl(netmask->sin_addr.s_addr) ); memset(ipsrc, 0, sizeof(struct in_addr)); *ppacket_r = malloc( sizeof( packet ) ); } int main(int argc, char ** argv){ /* Declarations */ /* full packet (tx and rx) */ packet *ppacket, *ppacket_r; /* Socket descriptor, nic index */ int sd = 0; int flag = 0; int index = 0; /* ip data */ unsigned long unet,uhost,ipdst,tip; /* The name of the interface is given in parameter to the binary */ char * iface; /* detected device's FQDN */ struct hostent* name; /* ip level sockaddr */ struct sockaddr_in ipaddr, netmask; /* Lowlevel sockaddr */ struct sockaddr_ll sll = {0x0}; /* source ip to put in packet */ struct in_addr ipsrc; int request_latency = REQUEST_LATENCY_DEFAULT; int p=0; /* Take at least one argument */ if(argc<2){ printf("IPDISCOVER binary ver. %d \nUsage : ipdiscover [iface name] [latency in ms]\n", VERSION); exit(0); }else{ iface = argv[1]; if( argc==3 ) request_latency = atoi( argv[2] ); } /* Initialize data */ data_init( &ipaddr, &netmask, &ppacket, &sll, index ); /* Reading nic parameters */ get_iface_infos( ppacket, &index, iface, &ipaddr, &netmask ); /* Check iface settings */ validate_iface( &ipaddr, &netmask, ppacket ); /* Creating socket */ create_socket( &sd, &sll, index ); /* Initialize packet target ip, potential hosts number... */ scan_init( &unet, &uhost, &ipaddr, &netmask, &ipsrc, &ppacket_r ); /* We are looking for all the possible connected host */ for(ipdst=1;ipdst<uhost;ipdst++){ tip = htonl(ipdst+unet); memcpy( ppacket->arphdr.ar_tip, &tip, 4 ); /* Sending the packet */ if( write( sd, ppacket, sizeof(packet) ) < 0 ){ perror("Transmission error"); exit(1); } flag = 0; usleep( request_latency * 1000 ); while( flag>=0 ){ memset( ppacket_r, 0, sizeof( packet ) ); flag = read( sd, ppacket_r, sizeof( packet ) ); if( flag>0 ) memcpy(&ipsrc, ppacket_r->arphdr.ar_sip, sizeof(struct in_addr)); if(ntohs(ppacket_r->arphdr.arp_opcode) == 2){ char * c; if(p==0) printf("<IPDISCOVER>\n"); p++; name = gethostbyaddr(&ipsrc, sizeof(struct in_addr), AF_INET); if(name){ while((c=strchr(name->h_name,'<')) || (c=strchr(name->h_name,'>'))){ strncpy(c,"x",sizeof(c)); } } usleep( NAME_RES_LATENCY ); print_xml( &ipsrc, ppacket_r, name ); } } } if(p) printf("</IPDISCOVER>\n"); /* That's all */ exit(0); } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������UnixAgent-2.4.2/resources/ipdiscover/ipdiscover.h���������������������������������������������������0000664�0000000�0000000�00000003000�13327377321�0022123�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* ############################################################################### ##OCSInventory Version NG Beta ##Copyleft Pascal DANEK 2006 ##Web : http://ocsinventory.sourceforge.net ## ##This code is open source and may be copied and modified as long as the source ##code is always made freely available. ##Please refer to the General Public Licence http://www.gnu.org/ or Licence.txt ################################################################################ */ #include <sys/socket.h> #include <linux/if_ether.h> #include <stdio.h> #include <string.h> #include <stdlib.h> #include <netinet/in.h> #include <arpa/inet.h> #include <unistd.h> #include <linux/if_packet.h> #include <ctype.h> #include <sys/types.h> #include <sys/socket.h> #include <linux/sockios.h> #include <sys/ioctl.h> #include <net/if.h> #include <fcntl.h> #include <time.h> #include <netdb.h> #ifndef ARPHRD_ETHER #define ARPHRD_ETHER 1 #endif #ifndef ARPOP_REQUEST #define ARPOP_REQUEST 1 #endif #ifndef ARPOP_REPLY #define ARPOP_REPLY 2 #endif #define VERSION 5 #define NAME_RES_LATENCY 1000000 #define REQUEST_LATENCY_DEFAULT 100 /* ms */ /* Trame ARP */ struct arphdr{ unsigned short arp_hrdad; unsigned short arp_prot; unsigned char arp_halen; unsigned char arp_prlen; unsigned short arp_opcode; unsigned char ar_sha[ETH_ALEN]; unsigned char ar_sip[4]; unsigned char ar_tha[ETH_ALEN]; unsigned char ar_tip[4]; }; /* Ethernet header*/ struct Packet{ struct ethhdr ethhdr; struct arphdr arphdr; }; typedef struct Packet packet; UnixAgent-2.4.2/snmp/�������������������������������������������������������������������������������0000775�0000000�0000000�00000000000�13327377321�0014406�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������UnixAgent-2.4.2/snmp/mibs/��������������������������������������������������������������������������0000775�0000000�0000000�00000000000�13327377321�0015340�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������UnixAgent-2.4.2/snmp/mibs/local/��������������������������������������������������������������������0000775�0000000�0000000�00000000000�13327377321�0016432�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������UnixAgent-2.4.2/snmp/mibs/local/1588.xml������������������������������������������������������������0000664�0000000�0000000�00000007707�13327377321�0017574�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������<T_1588> <PARAMETERS> <PARSER>1</PARSER> <VERSION>1</VERSION> <NAME>Brocade</NAME> <EXECUTE> <RUN>Host_Resources_Mib</RUN> <RUN>If_Mib</RUN> <RUN>Entity_Mib</RUN> </EXECUTE> </PARAMETERS> <DATA> <COMMON> <TYPE> <SET>San</SET> </TYPE> </COMMON> <SWITCH_SAN> <SERIALNUMBER> <VALUE>1.3.6.1.4.1.1588.2.1.1.1.1.10.0</VALUE> </SERIALNUMBER> <MANUFACTURER> <SET>Brocade</SET> </MANUFACTURER> <SOFTVERSION> <VALUE>1.3.6.1.4.1.1588.2.1.1.1.1.6.0</VALUE> </SOFTVERSION> <DOMAIN_ID> <VALUE>1.3.6.1.4.1.1588.2.1.1.1.2.1.0</VALUE> </DOMAIN_ID> <PRINCIPAL_ID> <VALUE>1.3.6.1.4.1.1588.2.1.1.1.2.2.0</VALUE> </PRINCIPAL_ID> </SWITCH_SAN> </DATA> <LOOPS> <VALUE>1.3.6.1.4.1.1588.2.1.1.1.6.2.1.1</VALUE> <INDEX>1.3.6.1.4.1.1588.2.1.1.1.6.2.1.1.(\S+)</INDEX> <NAME_INDEX>IDX</NAME_INDEX> <DATA> <NETWORKS> <SLOT> <VALUE>1.3.6.1.4.1.1588.2.1.1.1.6.2.1.37.IDX</VALUE> </SLOT> <PHYSICAL> <VALUE>1.3.6.1.4.1.1588.2.1.1.1.6.2.1.3.IDX</VALUE> <REPLACE> <STRING>1</STRING> <BY>No Card</BY> </REPLACE> <REPLACE> <STRING>2</STRING> <BY>No Gbic</BY> </REPLACE> <REPLACE> <STRING>3</STRING> <BY>Laser Fault</BY> </REPLACE> <REPLACE> <STRING>4</STRING> <BY>No Light</BY> </REPLACE> <REPLACE> <STRING>5</STRING> <BY>No Sync</BY> </REPLACE> <REPLACE> <STRING>6</STRING> <BY>In Sync</BY> </REPLACE> <REPLACE> <STRING>7</STRING> <BY>Port Fault</BY> </REPLACE> <REPLACE> <STRING>8</STRING> <BY>Diagnostics Fault</BY> </REPLACE> <REPLACE> <STRING>9</STRING> <BY>Lock Reference Signal</BY> </REPLACE> </PHYSICAL> <OP_STATUS> <VALUE>1.3.6.1.4.1.1588.2.1.1.1.6.2.1.4.IDX</VALUE> <REPLACE> <STRING>0</STRING> <BY>Unknown</BY> </REPLACE> <REPLACE> <STRING>1</STRING> <BY>Online</BY> </REPLACE> <REPLACE> <STRING>2</STRING> <BY>Offline</BY> </REPLACE> <REPLACE> <STRING>3</STRING> <BY>testing</BY> </REPLACE> <REPLACE> <STRING>4</STRING> <BY>Faulty</BY> </REPLACE> </OP_STATUS> <STATUS> <VALUE>1.3.6.1.4.1.1588.2.1.1.1.6.2.1.5.IDX</VALUE> <REPLACE> <STRING>1</STRING> <BY>Online</BY> </REPLACE> <REPLACE> <STRING>2</STRING> <BY>Offline</BY> </REPLACE> <REPLACE> <STRING>3</STRING> <BY>Testing</BY> </REPLACE> <REPLACE> <STRING>4</STRING> <BY>Faulty</BY> </REPLACE> </STATUS> <TYPE> <VALUE>1.3.6.1.4.1.1588.2.1.1.1.6.2.1.7.IDX</VALUE> <REPLACE> <STRING>1</STRING> <BY>unknown</BY> </REPLACE> <REPLACE> <STRING>2</STRING> <BY>long wave laser (lw)</BY> </REPLACE> <REPLACE> <STRING>3</STRING> <BY>short wave laser (sw)</BY> </REPLACE> <REPLACE> <STRING>4</STRING> <BY>long wave LED (ld)</BY> </REPLACE> <REPLACE> <STRING>5</STRING> <BY>copper (CU)</BY> </REPLACE> </TYPE> <SPEED> <VALUE>1.3.6.1.4.1.1588.2.1.1.1.6.2.1.35.IDX</VALUE> <REPLACE> <STRING>1</STRING> <BY>1 GB</BY> </REPLACE> <REPLACE> <STRING>2</STRING> <BY>2 GB</BY> </REPLACE> <REPLACE> <STRING>3</STRING> <BY>auto</BY> </REPLACE> <REPLACE> <STRING>4</STRING> <BY>4 GB</BY> </REPLACE> <REPLACE> <STRING>5</STRING> <BY>8 GB</BY> </REPLACE> <REPLACE> <STRING>6</STRING> <BY>10 GB</BY> </REPLACE> </SPEED> <MACADDR> <VALUE>1.3.6.1.4.1.1588.2.1.1.1.6.2.1.34.IDX</VALUE> </MACADDR> </NETWORKS> </DATA> </LOOPS> </T_1588> ���������������������������������������������������������UnixAgent-2.4.2/snmp/mibs/local/18552.xml�����������������������������������������������������������0000664�0000000�0000000�00000000273�13327377321�0017642�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������<T_18552> <PARAMETERS> <PARSER>1</PARSER> <VERSION>1</VERSION> <NAME>xxx</NAME> <EXECUTE> <RUN>8072</RUN> </EXECUTE> </PARAMETERS> </T_18552> �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������UnixAgent-2.4.2/snmp/mibs/local/24681.xml�����������������������������������������������������������0000664�0000000�0000000�00000002137�13327377321�0017643�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������<T_24681> <PARAMETERS> <PARSER>1</PARSER> <VERSION>1</VERSION> <NAME>Nas</NAME> </PARAMETERS> <DATA> <COMMON> <TYPE> <SET>San</SET> </TYPE> <UPTIME> <VALUE>1.3.6.1.4.1.24681.1.4</VALUE> </UPTIME> </COMMON> <MEMORIES> <CAPACITY> <VALUE>1.3.6.1.4.1.24681.1.2</VALUE> </CAPACITY> </MEMORIES> </DATA> <LOOPS> <VALUE>1.3.6.1.4.1.24681.1.9.1.2</VALUE> <INDEX>1.3.6.1.4.1.24681.1.9.1.(\S+)</INDEX> <NAME_INDEX>IDX</NAME_INDEX> <DATA> <NETWORKS> <DESCRIPTION> <VALUE>1.3.6.1.4.1.24681.1.9.1.2.IDX</VALUE> </DESCRIPTION> </NETWORKS> </DATA> </LOOPS> <LOOPS> <VALUE>1.3.6.1.4.1.24681.1.11.1.2</VALUE> <INDEX>1.3.6.1.4.1.24681.1.11.1.(\S+)</INDEX> <NAME_INDEX>IDX</NAME_INDEX> <DATA> <TYPE> <VALUE>1.3.6.1.4.1.24681.1.11.5.IDX</VALUE> </TYPE> <TOTAL> <VALUE>1.3.6.1.4.1.24681.1.11.6.IDX</VALUE> </TOTAL> <LABEL> <VALUE>1.3.6.1.4.1.24681.1.11.2.IDX</VALUE> </LABEL> </DATA> </LOOPS> </T_24681> ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������UnixAgent-2.4.2/snmp/mibs/local/6876.xml������������������������������������������������������������0000664�0000000�0000000�00000006042�13327377321�0017570�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������<T_6876> <PARAMETERS> <PARSER>1</PARSER> <VERSION>1</VERSION> <NAME>Vmware</NAME> <EXECUTE> <RUN>Host_Resources_Mib</RUN> <RUN>If_Mib</RUN> </EXECUTE> </PARAMETERS> <DATA> <COMMON> <DESCRIPTION> <VALUE>1.3.6.1.4.1.6876.1.1.0</VALUE> </DESCRIPTION> <TYPE> <SET>Virtual Server</SET> </TYPE> </COMMON> <VIRTUAL> <TYPE> <VALUE>1.3.6.1.4.1.6876.1.1.0</VALUE> </TYPE> <MANUFACTURER> <SET>VmWare</SET> </MANUFACTURER> <SOFTVERSION> <VALUE>1.3.6.1.4.1.6876.1.2.0</VALUE> </SOFTVERSION> <REVISION> <VALUE>1.3.6.1.4.1.6876.1.4.0</VALUE> </REVISION> </VIRTUAL> </DATA> <LOOPS> <VALUE>1.3.6.1.4.1.6876.2.1.1.2</VALUE> <INDEX>1.3.6.1.4.1.6876.2.1.1.2.(\S+)</INDEX> <NAME_INDEX>VM</NAME_INDEX> <DATA> <VIRTUALMACHINES> <NAME> <VALUE>1.3.6.1.4.1.6876.2.1.1.2.VM</VALUE> </NAME> <CONFIG_FILE> <VALUE>1.3.6.1.4.1.6876.2.1.1.3.VM</VALUE> </CONFIG_FILE> <OS> <VALUE>1.3.6.1.4.1.6876.2.1.1.4.VM</VALUE> </OS> <MEMORY> <VALUE>1.3.6.1.4.1.6876.2.1.1.5.VM</VALUE> </MEMORY> <POWER> <VALUE>1.3.6.1.4.1.6876.2.1.1.6.VM</VALUE> </POWER> <CPU> <VALUE>1.3.6.1.4.1.6876.2.1.1.9.VM</VALUE> </CPU> <UUID> <VALUE>1.3.6.1.4.1.6876.2.1.1.10.VM</VALUE> </UUID> <LOOPS> <VALUE>1.3.6.1.4.1.6876.2.3.1.3.VM</VALUE> <INDEX>1.3.6.1.4.1.6876.2.3.1.3.VM.(\S+)</INDEX> <NAME_INDEX>DISK</NAME_INDEX> <DATA> <DISKS> <NAME> <VALUE>1.3.6.1.4.1.6876.2.3.1.3.VM.DISK</VALUE> </NAME> </DISKS> </DATA> </LOOPS> <LOOPS> <VALUE>1.3.6.1.4.1.6876.2.4.1.3.VM</VALUE> <INDEX>1.3.6.1.4.1.6876.2.4.1.3.VM.(\S+)</INDEX> <NAME_INDEX>NET</NAME_INDEX> <DATA> <NETWORKS> <DRIVER> <VALUE>1.3.6.1.4.1.6876.2.4.1.3.VM.NET</VALUE> </DRIVER> <DESCRIPTION> <VALUE>1.3.6.1.4.1.6876.2.4.1.4.VM.NET</VALUE> </DESCRIPTION> <MACADDR> <VALUE>1.3.6.1.4.1.6876.2.4.1.7.VM.NET</VALUE> </MACADDR> <STATUS> <VALUE>1.3.6.1.4.1.6876.2.4.1.6.VM.NET</VALUE> <REPLACE> <STRING>true</STRING> <BY>Up</BY> </REPLACE> <REPLACE> <STRING>false</STRING> <BY>Down</BY> </REPLACE> </STATUS> </NETWORKS> </DATA> </LOOPS> </VIRTUALMACHINES> </DATA> </LOOPS> </T_6876> ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������UnixAgent-2.4.2/snmp/mibs/local/7244.xml������������������������������������������������������������0000664�0000000�0000000�00000031042�13327377321�0017554�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������<T_7244> <PARAMETERS> <PARSER>1</PARSER> <VERSION>1</VERSION> <NAME>Blade</NAME> </PARAMETERS> <LOOPS> <VALUE>1.3.6.1.4.1.7244.1.1.1.3.2.4.1.1</VALUE> <INDEX>1.3.6.1.4.1.7244.1.1.1.3.2.4.1.1.(\S+)</INDEX> <NAME_INDEX>POWER</NAME_INDEX> <DATA> <POWERSUPPLIES> <STATUS> <VALUE>1.3.6.1.4.1.7244.1.1.1.3.2.4.1.2.POWER</VALUE> <REPLACE> <STRING>1</STRING> <BY>Unknown</BY> </REPLACE> <REPLACE> <STRING>2</STRING> <BY>Ok</BY> </REPLACE> <REPLACE> <STRING>3</STRING> <BY>Not present</BY> </REPLACE> <REPLACE> <STRING>4</STRING> <BY>Error</BY> </REPLACE> <REPLACE> <STRING>5</STRING> <BY>Critical</BY> </REPLACE> <REPLACE> <STRING>6</STRING> <BY>Off</BY> </REPLACE> <REPLACE> <STRING>7</STRING> <BY>dummy</BY> </REPLACE> </STATUS> <MANUFACTURER> <VALUE>1.3.6.1.4.1.7244.1.1.1.3.2.4.1.3.POWER</VALUE> </MANUFACTURER> <REFERENCE> <VALUE>1.3.6.1.4.1.7244.1.1.1.3.2.4.1.4.POWER</VALUE> </REFERENCE> <TYPE> <VALUE>1.3.6.1.4.1.7244.1.1.1.3.2.5.1.5.POWER</VALUE> </TYPE> <REVISION> <VALUE>1.3.6.1.4.1.7244.1.1.1.3.2.4.1.6.POWER</VALUE> </REVISION> <SERIALNUMBER> <VALUE>1.3.6.1.4.1.7244.1.1.1.3.2.4.1.7.POWER</VALUE> </SERIALNUMBER> </POWERSUPPLIES> </DATA> </LOOPS> <LOOPS> <VALUE>1.3.6.1.4.1.7244.1.1.1.4.1.1.1.1</VALUE> <INDEX>1.3.6.1.4.1.7244.1.1.1.4.1.1.1.1.(\S+)</INDEX> <NAME_INDEX>LAME</NAME_INDEX> <DATA> <DEVICE> <POWER> <VALUE>1.3.6.1.4.1.7244.1.1.1.4.1.1.1.5.LAME</VALUE> <REPLACE> <STRING>1</STRING> <BY>Unknown</BY> </REPLACE> <REPLACE> <STRING>2</STRING> <BY>On</BY> </REPLACE> <REPLACE> <STRING>3</STRING> <BY>Off</BY> </REPLACE> <REPLACE> <STRING>4</STRING> <BY>Power-cycle</BY> </REPLACE> <REPLACE> <STRING>5</STRING> <BY>Reset</BY> </REPLACE> <REPLACE> <STRING>6</STRING> <BY>Nmi</BY> </REPLACE> <REPLACE> <STRING>7</STRING> <BY>Force Off</BY> </REPLACE> </POWER> <DATA> <POSITION> <VALUE>1.3.6.1.4.1.7244.1.1.1.4.1.1.1.1.LAME</VALUE> </POSITION> <STATUS> <VALUE>1.3.6.1.4.1.7244.1.1.1.4.2.1.1.2.LAME</VALUE> <REPLACE> <STRING>1</STRING> <BY>Unknown</BY> </REPLACE> <REPLACE> <STRING>2</STRING> <BY>Ok</BY> </REPLACE> <REPLACE> <STRING>3</STRING> <BY>Not Present</BY> </REPLACE> <REPLACE> <STRING>4</STRING> <BY>Error</BY> </REPLACE> <REPLACE> <STRING>5</STRING> <BY>Critical</BY> </REPLACE> <REPLACE> <STRING>6</STRING> <BY>Standby</BY> </REPLACE> </STATUS> </DATA> <MANUFACTURER> <VALUE>1.3.6.1.4.1.7244.1.1.1.4.2.1.1.3.LAME</VALUE> <REPLACE> <STRING>FSC</STRING> <BY>Fujitsu Siemens Computers</BY> </REPLACE> </MANUFACTURER> <SERIAL> <VALUE>1.3.6.1.4.1.7244.1.1.1.4.2.1.1.5.LAME</VALUE> </SERIAL> <PRODUCT> <VALUE>1.3.6.1.4.1.7244.1.1.1.4.2.1.1.6.LAME</VALUE> </PRODUCT> <HARDWARE> <VALUE>1.3.6.1.4.1.7244.1.1.1.4.2.1.1.8.LAME</VALUE> </HARDWARE> <FIRMWARE> <VALUE>1.3.6.1.4.1.7244.1.1.1.4.2.1.1.9.LAME</VALUE> </FIRMWARE> <BIOS> <VALUE>1.3.6.1.4.1.7244.1.1.1.4.2.1.1.10.LAME</VALUE> </BIOS> <BIOS> <VALUE>1.3.6.1.4.1.7244.1.1.1.4.2.1.1.10.LAME</VALUE> </BIOS> <SOCKET> <VALUE>1.3.6.1.4.1.7244.1.1.1.4.2.1.1.11.LAME</VALUE> </SOCKET> <MEMORY_SLOT> <VALUE>1.3.6.1.4.1.7244.1.1.1.4.2.1.1.12.LAME</VALUE> </MEMORY_SLOT> <TYPE> <VALUE>1.3.6.1.4.1.7244.1.1.1.4.2.1.1.22.LAME</VALUE> </TYPE> <LOOPS> <VALUE>1.3.6.1.4.1.7244.1.1.1.4.3.1.1.1.LAME</VALUE> <INDEX>1.3.6.1.4.1.7244.1.1.1.4.3.1.1.1.LAME.(\S+)</INDEX> <NAME_INDEX>CPU</NAME_INDEX> <DATA> <CPUS> <TYPE> <VALUE>1.3.6.1.4.1.7244.1.1.1.4.3.1.1.3.LAME.CPU</VALUE> <REPLACE> <STRING>12</STRING> <BY>Xeon</BY> </REPLACE> <REPLACE> <STRING>11</STRING> <BY>Pentium M</BY> </REPLACE> <REPLACE> <STRING>10</STRING> <BY>Pentium IV</BY> </REPLACE> <REPLACE> <STRING>9</STRING> <BY>M Un</BY> </REPLACE> <REPLACE> <STRING>8</STRING> <BY>Pentium III</BY> </REPLACE> <REPLACE> <STRING>7</STRING> <BY>Pentium II Xeon</BY> </REPLACE> <REPLACE> <STRING>6</STRING> <BY>Celeron</BY> </REPLACE> <REPLACE> <STRING>5</STRING> <BY>Pentium MMX</BY> </REPLACE> <REPLACE> <STRING>4</STRING> <BY>Pentium II</BY> </REPLACE> <REPLACE> <STRING>3</STRING> <BY>Pentium Pro</BY> </REPLACE> <REPLACE> <STRING>2</STRING> <BY>Pentium</BY> </REPLACE> <REPLACE> <STRING>1</STRING> <BY>Unknown</BY> </REPLACE> </TYPE> <SPEED> <VALUE>1.3.6.1.4.1.7244.1.1.1.4.3.1.1.4.LAME.CPU</VALUE> </SPEED> <STATUS> <VALUE>1.3.6.1.4.1.7244.1.1.1.4.3.1.1.6.LAME.CPU</VALUE> <REPLACE> <STRING>1</STRING> <BY>Unknown</BY> </REPLACE> <REPLACE> <STRING>2</STRING> <BY>OK</BY> </REPLACE> <REPLACE> <STRING>3</STRING> <BY>Not Present</BY> </REPLACE> <REPLACE> <STRING>4</STRING> <BY>Error</BY> </REPLACE> <REPLACE> <STRING>5</STRING> <BY>Critical</BY> </REPLACE> <REPLACE> <STRING>6</STRING> <BY>Missing termination</BY> </REPLACE> <REPLACE> <STRING>7</STRING> <BY>Disabled</BY> </REPLACE> </STATUS> <MANUFACTURER> <VALUE>1.3.6.1.4.1.7244.1.1.1.4.3.1.1.9.LAME.CPU</VALUE> </MANUFACTURER> </CPUS> </DATA> </LOOPS> <MEMORY> <VALUE>1.3.6.1.4.1.7244.1.1.1.4.4.1.1.2.LAME</VALUE> </MEMORY> <LOOPS> <VALUE>1.3.6.1.4.1.7244.1.1.1.4.4.2.1.1.LAME</VALUE> <INDEX>1.3.6.1.4.1.7244.1.1.1.4.4.2.1.1.LAME.(\S+)</INDEX> <NAME_INDEX>SLOT</NAME_INDEX> <DATA> <MEMORIES> <NUMSLOTS> <VALUE>1.3.6.1.4.1.7244.1.1.1.4.4.2.1.2.LAME.SLOT</VALUE> </NUMSLOTS> <STATUS> <VALUE>1.3.6.1.4.1.7244.1.1.1.4.4.2.1.3.LAME.SLOT</VALUE> <REPLACE> <STRING>1</STRING> <BY>Unknown</BY> </REPLACE> <REPLACE> <STRING>2</STRING> <BY>Disable</BY> </REPLACE> <REPLACE> <STRING>3</STRING> <BY>Ok</BY> </REPLACE> <REPLACE> <STRING>4</STRING> <BY>Not Present</BY> </REPLACE> <REPLACE> <STRING>5</STRING> <BY>Critical</BY> </REPLACE> <REPLACE> <STRING>6</STRING> <BY>Prefailure Warning</BY> </REPLACE> </STATUS> <CAPACITY>3 <VALUE>1.3.6.1.4.1.7244.1.1.1.4.4.2.1.4.LAME.SLOT</VALUE> </CAPACITY> <DESCRIPTION> <VALUE>1.3.6.1.4.1.7244.1.1.1.4.4.2.1.6.LAME.SLOT</VALUE> </DESCRIPTION> <SPEED> <VALUE>1.3.6.1.4.1.7244.1.1.1.4.4.2.1.7.LAME.SLOT</VALUE> </SPEED> </MEMORIES> </DATA> </LOOPS> </DEVICE> </DATA> </LOOPS> <LOOPS> <VALUE>1.3.6.1.4.1.7244.1.1.1.3.3.1.1.2</VALUE> <INDEX>1.3.6.1.4.1.7244.1.1.1.3.3.1.1.2.(\S+)</INDEX> <NAME_INDEX>FAN</NAME_INDEX> <DATA> <FANS> <STATUS> <VALUE>1.3.6.1.4.1.7244.1.1.1.3.3.1.1.2.FAN</VALUE> <REPLACE> <STRING>1</STRING> <BY>Unknown</BY> </REPLACE> <REPLACE> <STRING>2</STRING> <BY>Disable</BY> </REPLACE> <REPLACE> <STRING>3</STRING> <BY>Ok</BY> </REPLACE> <REPLACE> <STRING>4</STRING> <BY>Fail</BY> </REPLACE> <REPLACE> <STRING>5</STRING> <BY>Prefailure predicted</BY> </REPLACE> <REPLACE> <STRING>6</STRING> <BY>Redundant fan failed</BY> </REPLACE> <REPLACE> <STRING>7</STRING> <BY>Not manageable</BY> </REPLACE> <REPLACE> <STRING>8</STRING> <BY>Not present</BY> </REPLACE> <REPLACE> <STRING>9</STRING> <BY>Not available</BY> </REPLACE> </STATUS> <DESCRIPTION> <VALUE>1.3.6.1.4.1.7244.1.1.1.3.3.1.1.3.FAN</VALUE> </DESCRIPTION> </FANS> </DATA> </LOOPS> <LOOPS> <VALUE>1.3.6.1.4.1.7244.1.1.1.2.1.1.3</VALUE> <INDEX>1.3.6.1.4.1.7244.1.1.1.2.1.1.3.(\S+)</INDEX> <NAME_INDEX>BLADE</NAME_INDEX> <DATA> <BLADE> <STATUS> <VALUE>1.3.6.1.4.1.7244.1.1.1.2.1.1.2.BLADE</VALUE> <REPLACE> <STRING>1</STRING> <BY>Unknown</BY> </REPLACE> <REPLACE> <STRING>2</STRING> <BY>Ok</BY> </REPLACE> <REPLACE> <STRING>3</STRING> <BY>Not present</BY> </REPLACE> <REPLACE> <STRING>4</STRING> <BY>Error</BY> </REPLACE> <REPLACE> <STRING>5</STRING> <BY>Critical</BY> </REPLACE> <REPLACE> <STRING>6</STRING> <BY>Standby</BY> </REPLACE> </STATUS> <MANUFACTURER> <VALUE>1.3.6.1.4.1.7244.1.1.1.2.1.1.3.BLADE</VALUE> <REPLACE> <STRING>FSC</STRING> <BY>Fujitsu Siemens Computers</BY> </REPLACE> </MANUFACTURER> <SERIALNUMBER> <VALUE>1.3.6.1.4.1.7244.1.1.1.2.1.1.5.BLADE</VALUE> </SERIALNUMBER> <TYPE> <VALUE>1.3.6.1.4.1.7244.1.1.1.2.1.1.6.BLADE</VALUE> </TYPE> <SERIALNUMBER> <VALUE>1.3.6.1.4.1.7244.1.1.1.2.1.1.7.BLADE</VALUE> </SERIALNUMBER> <FIRMVERSION> <VALUE>1.3.6.1.4.1.7244.1.1.1.2.1.1.8.BLADE</VALUE> </FIRMVERSION> <SOFTVERSION> <VALUE>1.3.6.1.4.1.7244.1.1.1.2.1.1.9.BLADE</VALUE> </SOFTVERSION> </BLADE> </DATA> </LOOPS> </T_7244> ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������UnixAgent-2.4.2/tools/������������������������������������������������������������������������������0000775�0000000�0000000�00000000000�13327377321�0014571�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������UnixAgent-2.4.2/tools/build-perl-tree.sh������������������������������������������������������������0000775�0000000�0000000�00000004635�13327377321�0020134�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!/bin/sh # A script to prepare a installation of Perl + OCSInventory-agent for # Unix/Linux # This in order to be able to provide an installation for system without # Perl > 5.6 set -e MAKE="make" TMP="/home2/goneri/tmp" PREFIX="$TMP/build/opt/ocsinventory-agent" ETCDIR="$PREFIX/etc" BASEDIR="$PREFIX/var/ocsinventory-agent" LOGDIR="$PREFIX/log/ocsinventory-agent" PIDFILE="$PREFIX/var/run" PERLVERSION="5.10.0" if [ ! -d $TMP ]; then echo "tmp $TMP dir is missing" fi cd $TMP if [ ! -f perl-$PERLVERSION.tar.gz ]; then wget -O perl-$PERLVERSION.tar.gz.part http://cpan.perl.org/src/perl-$PERLVERSION.tar.gz mv perl-$PERLVERSION.tar.gz.part perl-$PERLVERSION.tar.gz fi gunzip < perl-$PERLVERSION.tar.gz | tar xvf - cd perl-$PERLVERSION # AIX #./Configure -Dusenm -des -Dinstallprefix=$PREFIX -Dsiteprefix=$PREFIX -Dprefix=$PREFIX #./Configure -Dcc="gcc" -des -Dinstallprefix=$PREFIX -Dsiteprefix=$PREFIX -Dprefix=$PREFIX ./Configure -des -Dinstallprefix=$PREFIX -Dsiteprefix=$PREFIX -Dprefix=$PREFIX $MAKE $MAKE install PATH=$PREFIX/bin:$PATH export PATH cpanp 's conf prereqs 1; i XML::SAX' cpanp 's conf prereqs 1; i XML::Simple' cpanp 's conf prereqs 1; i LWP' cpanp 's conf prereqs 1; i Proc::Daemon' cpanp 's conf prereqs 1; i HTML::Parser' # For what? # Report error about IPv6 on Solaris 10 cpanp 's conf prereqs 1; i --force Net::IP' cpanp 's conf prereqs 1; i --force PAR::Packer' cpanp 's conf prereqs 1; i --force Net::SSLeay' exit; if [ ! openssl-0.9.8j.tar.gz ]; then wget -O openssl-0.9.8j.tar.gz.part http://www.openssl.org/source/openssl-0.9.8j.tar.gz mv openssl-0.9.8j.tar.gz.part openssl-0.9.8j.tar.gz fi gunzip < openssl-0.9.8j.tar.gz | tar xvf - cd openssl-0.9.8j ./config --prefix=/home2/goneri/tmp/openssl make make install ln -s apps bin #for i in `ls ../tarballs/*.gz`; do # gunzip < $i | tar xvf - #done #cd ../expat-2.0.0/ #./configure --prefix=$PREFIX #$MAKE #cd ../Ocsinventory-Agent-0.0.2/ #$PERL Makefile.PL PREFIX=$PREFIX #$MAKE PREFIX=$PREFIX #$MAKE install PREFIX=$PREFIX #:$PATH#perl -i -pe "s!/etc/ocsinventory-agent!$ETCDIR!" $PREFIX/bin/ocsinventory-agent #perl -i -pe "s!/var/lib/ocsinventory-agent!$BASEDIR!" $PREFIX/bin/ocsinventory-agent #perl -i -pe "s!/var/log/ocsinventory-agent!$LOGDIR!" $PREFIX/bin/ocsinventory-agent #perl -i -pe "s!/var/run/ocsinventory-agent.pid!$PIDFILE!" $PREFIX/bin/ocsinventory-agent #mkdir -p $ETCDIR #mkdir -p $BASEDIR #mkdir -p $LOGDIR #mkdir -p $PIDFILE ���������������������������������������������������������������������������������������������������UnixAgent-2.4.2/tools/macosx/�����������������������������������������������������������������������0000775�0000000�0000000�00000000000�13327377321�0016063�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������UnixAgent-2.4.2/tools/macosx/README�����������������������������������������������������������������0000664�0000000�0000000�00000004320�13327377321�0016742�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������DESCRIPTION OS X [darwin] Readme This README will help you roll your own native OSX, OCSNG.app client for enterprise deployment. PREREQUISITES - XCode 6.4 - Darwin Perl dependencies [A tarball with all the PerlDep's you'll need for this to run in darwin-land, see create....cpan.pl script] - OCSNG.pmproj [Apple PackageMaker binrary settings file] - Iceberg [http://s.sudre.free.fr/Software/Iceberg.html] BUILDING/INSTALLING - Run the tools/macosx/scripts/create-darwin-perl-lib_fromCPAN.pl script which will create the ~/darwin-perl-lib directory. This directory will stash a built version of all the perl libraries needed to run this client (ie: no running CPAN on the hosts you're deploying this on) - READ THE SCRIPT BEFORE RUNNING, some CPAN configurations are needed prior to running - You'll need CPAN, Perl (the development libraries for perl), so Xcode Tools (just about a full install). - Open the tools/macosx/ocsng_app-xcode/OCSNG.xcodeproj project using Xcode 6.4 and build it (Choose menu "Product\Archive") - Export the created archive to folder tools/macosx/installer_gui/iceberg/ - OPen tools/macosx/installer_gui/iceberg/iceberg_project.packproj file using Iceberg and build it to create the final graphic installer COPYRIGHT See AUTHORS file. Ocsinventory-Agent is released under GNU GPL 2 licence. Portions of the Xcode project may fall under other, open licences (individual files will elaborate). Some of the Xcode project files are not core pieces of OCSNG and are to be treated as a supplement tool for building the agent for OSX deployment. NOTES - macosx tools was created by claimid.com/wesyoung and modified by OCS NG team for the 2.0 version. - Once installed, the agent should contact the server and upload an initial inventory, then go back to sleep. - OCS MacOSX agent is launched using LaunchD but you can click on /Applications/OCSNG.app to launch OCS agent manually. - You can take a look to OCS MacOSX logs in /var/logs/ocsng.log file (by default) - To uninstall the .app, use the uninstaller.sh script in /Application/OCSNG/Contents/Resources directory. This will kill the service, remove all the files (no restart required). - This package works on MacOSX 10.9+ on i386, ppc and x86_64 architectures. ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������UnixAgent-2.4.2/tools/macosx/installer_gui/���������������������������������������������������������0000775�0000000�0000000�00000000000�13327377321�0020724�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������UnixAgent-2.4.2/tools/macosx/installer_gui/iceberg/�������������������������������������������������0000775�0000000�0000000�00000000000�13327377321�0022324�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������UnixAgent-2.4.2/tools/macosx/installer_gui/iceberg/iceberg_project.packproj�������������������������0000664�0000000�0000000�00000035421�13327377321�0027212�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict> <key>Hierarchy</key> <dict> <key>Attributes</key> <dict> <key>Documents</key> <dict> <key>Background Image</key> <dict> <key>IFPkgFlagBackgroundAlignment</key> <integer>0</integer> <key>IFPkgFlagBackgroundScaling</key> <integer>2</integer> <key>Mode</key> <integer>1</integer> <key>Path</key> <string>logos/OCS_logo.jpg</string> <key>Path Type</key> <integer>2</integer> </dict> <key>License</key> <dict> <key>English</key> <dict> <key>Keywords</key> <dict/> <key>Mode</key> <integer>1</integer> <key>Path</key> <string>license/gpl-2.0.txt</string> <key>Path Type</key> <integer>2</integer> <key>Template</key> <string>APSL License</string> </dict> <key>French</key> <dict> <key>Keywords</key> <dict/> <key>Mode</key> <integer>1</integer> <key>Path</key> <string>license/gpl-2.0.txt</string> <key>Path Type</key> <integer>2</integer> <key>Template</key> <string>CeCILL 2 License</string> </dict> <key>International</key> <dict> <key>Mode</key> <integer>1</integer> <key>Path</key> <string>license/gpl-2.0.txt</string> <key>Path Type</key> <integer>2</integer> </dict> </dict> <key>ReadMe</key> <dict> <key>International</key> <dict> <key>Mode</key> <integer>0</integer> <key>Path</key> <string></string> <key>Path Type</key> <integer>1</integer> </dict> </dict> <key>Welcome</key> <dict> <key>International</key> <dict> <key>Mode</key> <integer>0</integer> <key>Path</key> <string></string> <key>Path Type</key> <integer>1</integer> </dict> </dict> </dict> <key>Files</key> <dict> <key>Compress</key> <true/> <key>Hierarchy</key> <dict> <key>Children</key> <array> <dict> <key>Children</key> <array> <dict> <key>Children</key> <array/> <key>GID</key> <integer>80</integer> <key>Path</key> <string>OCSNG.app</string> <key>Path Type</key> <integer>2</integer> <key>Privileges</key> <integer>493</integer> <key>Type</key> <integer>3</integer> <key>UID</key> <integer>0</integer> </dict> <dict> <key>Children</key> <array/> <key>GID</key> <integer>80</integer> <key>Path</key> <string>Utilities</string> <key>Path Type</key> <integer>1</integer> <key>Privileges</key> <integer>509</integer> <key>Type</key> <integer>1</integer> <key>UID</key> <integer>0</integer> </dict> </array> <key>GID</key> <integer>80</integer> <key>Path</key> <string>Applications</string> <key>Path Type</key> <integer>1</integer> <key>Privileges</key> <integer>509</integer> <key>Type</key> <integer>1</integer> <key>UID</key> <integer>0</integer> </dict> <dict> <key>Children</key> <array> <dict> <key>Children</key> <array/> <key>GID</key> <integer>80</integer> <key>Path</key> <string>Application Support</string> <key>Path Type</key> <integer>1</integer> <key>Privileges</key> <integer>509</integer> <key>Type</key> <integer>1</integer> <key>UID</key> <integer>0</integer> </dict> <dict> <key>Children</key> <array/> <key>GID</key> <integer>80</integer> <key>Path</key> <string>Documentation</string> <key>Path Type</key> <integer>1</integer> <key>Privileges</key> <integer>509</integer> <key>Type</key> <integer>1</integer> <key>UID</key> <integer>0</integer> </dict> <dict> <key>Children</key> <array/> <key>GID</key> <integer>80</integer> <key>Path</key> <string>Filesystems</string> <key>Path Type</key> <integer>1</integer> <key>Privileges</key> <integer>509</integer> <key>Type</key> <integer>1</integer> <key>UID</key> <integer>0</integer> </dict> <dict> <key>Children</key> <array/> <key>GID</key> <integer>80</integer> <key>Path</key> <string>Frameworks</string> <key>Path Type</key> <integer>1</integer> <key>Privileges</key> <integer>509</integer> <key>Type</key> <integer>1</integer> <key>UID</key> <integer>0</integer> </dict> <dict> <key>Children</key> <array/> <key>GID</key> <integer>80</integer> <key>Path</key> <string>Internet Plug-Ins</string> <key>Path Type</key> <integer>1</integer> <key>Privileges</key> <integer>509</integer> <key>Type</key> <integer>1</integer> <key>UID</key> <integer>0</integer> </dict> <dict> <key>Children</key> <array/> <key>GID</key> <integer>80</integer> <key>Path</key> <string>PreferencePanes</string> <key>Path Type</key> <integer>1</integer> <key>Privileges</key> <integer>509</integer> <key>Type</key> <integer>1</integer> <key>UID</key> <integer>0</integer> </dict> <dict> <key>Children</key> <array/> <key>GID</key> <integer>80</integer> <key>Path</key> <string>Preferences</string> <key>Path Type</key> <integer>1</integer> <key>Privileges</key> <integer>509</integer> <key>Type</key> <integer>1</integer> <key>UID</key> <integer>0</integer> </dict> <dict> <key>Children</key> <array/> <key>GID</key> <integer>80</integer> <key>Path</key> <string>Printers</string> <key>Path Type</key> <integer>1</integer> <key>Privileges</key> <integer>509</integer> <key>Type</key> <integer>1</integer> <key>UID</key> <integer>0</integer> </dict> <dict> <key>Children</key> <array/> <key>GID</key> <integer>80</integer> <key>Path</key> <string>QuickTime</string> <key>Path Type</key> <integer>1</integer> <key>Privileges</key> <integer>509</integer> <key>Type</key> <integer>1</integer> <key>UID</key> <integer>0</integer> </dict> <dict> <key>Children</key> <array/> <key>GID</key> <integer>80</integer> <key>Path</key> <string>Scripts</string> <key>Path Type</key> <integer>1</integer> <key>Privileges</key> <integer>509</integer> <key>Type</key> <integer>1</integer> <key>UID</key> <integer>0</integer> </dict> </array> <key>GID</key> <integer>80</integer> <key>Path</key> <string>Library</string> <key>Path Type</key> <integer>1</integer> <key>Privileges</key> <integer>1021</integer> <key>Type</key> <integer>1</integer> <key>UID</key> <integer>0</integer> </dict> <dict> <key>Children</key> <array> <dict> <key>Children</key> <array> <dict> <key>Children</key> <array/> <key>GID</key> <integer>0</integer> <key>Path</key> <string>Extensions</string> <key>Path Type</key> <integer>1</integer> <key>Privileges</key> <integer>493</integer> <key>Type</key> <integer>1</integer> <key>UID</key> <integer>0</integer> </dict> </array> <key>GID</key> <integer>0</integer> <key>Path</key> <string>Library</string> <key>Path Type</key> <integer>1</integer> <key>Privileges</key> <integer>493</integer> <key>Type</key> <integer>1</integer> <key>UID</key> <integer>0</integer> </dict> </array> <key>GID</key> <integer>0</integer> <key>Path</key> <string>System</string> <key>Path Type</key> <integer>1</integer> <key>Privileges</key> <integer>493</integer> <key>Type</key> <integer>1</integer> <key>UID</key> <integer>0</integer> </dict> </array> <key>GID</key> <integer>80</integer> <key>Path</key> <string>/</string> <key>Path Type</key> <integer>1</integer> <key>Privileges</key> <integer>1021</integer> <key>Type</key> <integer>1</integer> <key>UID</key> <integer>0</integer> </dict> <key>IFPkgFlagDefaultLocation</key> <string>/Applications</string> <key>Imported Package</key> <false/> <key>Package Path</key> <string></string> <key>Split Forks</key> <true/> </dict> <key>Plugins</key> <dict> <key>PluginsList</key> <array> <dict> <key>Path</key> <string>Introduction</string> <key>Type</key> <integer>0</integer> </dict> <dict> <key>Path</key> <string>ReadMe</string> <key>Type</key> <integer>0</integer> </dict> <dict> <key>Path</key> <string>License</string> <key>Type</key> <integer>0</integer> </dict> <dict> <key>Path</key> <string>plugins/ocs_agent_config.bundle</string> <key>Path Type</key> <integer>2</integer> <key>Status</key> <true/> <key>Type</key> <integer>1</integer> </dict> <dict> <key>Path</key> <string>plugins/ocs_agent_daemon_options.bundle</string> <key>Path Type</key> <integer>2</integer> <key>Status</key> <true/> <key>Type</key> <integer>1</integer> </dict> <dict> <key>Path</key> <string>Target</string> <key>Type</key> <integer>0</integer> </dict> <dict> <key>Path</key> <string>PackageSelection</string> <key>Type</key> <integer>0</integer> </dict> <dict> <key>Path</key> <string>Install</string> <key>Type</key> <integer>0</integer> </dict> <dict> <key>Path</key> <string>FinishUp</string> <key>Type</key> <integer>0</integer> </dict> </array> </dict> <key>Scripts</key> <dict> <key>Additional Resources</key> <dict> <key>International</key> <array/> </dict> <key>Installation Scripts</key> <dict> <key>IFInstallationScriptsPostflight</key> <dict> <key>Path</key> <string></string> <key>Status</key> <false/> </dict> <key>IFInstallationScriptsPostinstall</key> <dict> <key>Path</key> <string>scripts/postinstall</string> <key>Path Type</key> <integer>2</integer> <key>Status</key> <true/> </dict> <key>IFInstallationScriptsPostupgrade</key> <dict> <key>Path</key> <string>scripts/postinstall</string> <key>Path Type</key> <integer>2</integer> <key>Status</key> <true/> </dict> <key>IFInstallationScriptsPreflight</key> <dict> <key>Path</key> <string></string> <key>Status</key> <false/> </dict> <key>IFInstallationScriptsPreinstall</key> <dict> <key>Path</key> <string></string> <key>Status</key> <false/> </dict> <key>IFInstallationScriptsPreupgrade</key> <dict> <key>Path</key> <string></string> <key>Status</key> <false/> </dict> </dict> <key>Requirements</key> <array/> </dict> <key>Settings</key> <dict> <key>Description</key> <dict> <key>International</key> <dict> <key>IFPkgDescriptionDeleteWarning</key> <string></string> <key>IFPkgDescriptionDescription</key> <string></string> <key>IFPkgDescriptionTitle</key> <string>Ocsinventory Agent MacOSX</string> <key>IFPkgDescriptionVersion</key> <string>2.3</string> </dict> </dict> <key>Display Information</key> <dict> <key>CFBundleGetInfoString</key> <string>Ocsinventory Agent MacOSX</string> <key>CFBundleIconFile</key> <string></string> <key>CFBundleIconFile Path Type</key> <integer>1</integer> <key>CFBundleIdentifier</key> <string>org.ocsinventory-ng.agent.macosx</string> <key>CFBundleName</key> <string>Ocsinventory Agent MacOSX</string> <key>CFBundleShortVersionString</key> <string>2.3</string> </dict> <key>Options</key> <dict> <key>IFPkgFlagAllowBackRev</key> <false/> <key>IFPkgFlagAuthorizationAction</key> <integer>1</integer> <key>IFPkgFlagFollowLinks</key> <false/> <key>IFPkgFlagIsRequired</key> <false/> <key>IFPkgFlagOverwritePermissions</key> <false/> <key>IFPkgFlagRelocatable</key> <false/> <key>IFPkgFlagRestartAction</key> <integer>0</integer> <key>IFPkgFlagRootVolumeOnly</key> <false/> <key>IFPkgFlagUpdateInstalledLanguages</key> <false/> </dict> <key>Version</key> <dict> <key>IFMajorVersion</key> <integer>2</integer> <key>IFMinorVersion</key> <integer>0</integer> </dict> </dict> </dict> <key>IFPkgFlagPackageSelection</key> <integer>0</integer> <key>Name</key> <string>Ocsinventory_Agent_MacOSX</string> <key>Status</key> <integer>1</integer> <key>Type</key> <integer>1</integer> </dict> <key>Name</key> <string>Project</string> <key>Settings</key> <dict> <key>10.1 Compatibility</key> <true/> <key>Build Path</key> <string>build</string> <key>Build Path Type</key> <integer>2</integer> <key>Comment</key> <string></string> <key>Remove .DS_Store</key> <true/> <key>Remove .pbdevelopment</key> <true/> <key>Remove CVS</key> <true/> </dict> </dict> </plist> �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������UnixAgent-2.4.2/tools/macosx/installer_gui/iceberg/license/�����������������������������������������0000775�0000000�0000000�00000000000�13327377321�0023746�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������UnixAgent-2.4.2/tools/macosx/installer_gui/iceberg/license/gpl-2.0.txt������������������������������0000664�0000000�0000000�00000043254�13327377321�0025576�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������ GNU GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Lesser General Public License instead.) You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. The precise terms and conditions for copying, distribution and modification follow. GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you". Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does. 1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License. c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program. In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following: a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.) The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. 4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it. 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation. 10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. <one line to give the program's name and a brief idea of what it does.> Copyright (C) <year> <name of author> This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Also add information on how to contact you by electronic and paper mail. If the program is interactive, make it output a short notice like this when it starts in an interactive mode: Gnomovision version 69, Copyright (C) year name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (which makes passes at compilers) written by James Hacker. <signature of Ty Coon>, 1 April 1989 Ty Coon, President of Vice This General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Lesser General Public License instead of this License. ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������UnixAgent-2.4.2/tools/macosx/installer_gui/iceberg/logos/�������������������������������������������0000775�0000000�0000000�00000000000�13327377321�0023447�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������UnixAgent-2.4.2/tools/macosx/installer_gui/iceberg/logos/OCS_logo.jpg�������������������������������0000775�0000000�0000000�00000024567�13327377321�0025636�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������PNG  ��� IHDR��,���r���F��� pHYs��.#��.#x?v�� OiCCPPhotoshop ICC profile��xڝSgTS=BKKoR RB&*! J!QEEȠQ, !{kּ> H3Q5 B.@ $p�d!s#�~<<+"�x �M0B\t8K�@zB�@F&S��`cb�P-�`'�{�[!� eD�h;�VE�X0�fK9�-�0IWfH�� � �0Q)�{�`##x��FW<+*��x<$9E[-qWW.(I+6aa@.y24��x6_-"bbϫp@��t~,/;m%h^ uf@�Wp~<<EJB[aW}g_Wl~<$2]GLϒ bG "IbX*QqD2"B)%d,>5�j>{-]cK'Xt��o(hw?G%�fIq��^D$.Tʳ?��D*A, `6B$BB dr`)B(Ͱ*`/@4Qhp.U=pa( Aa!ڈbX#!H$ ɈQ"K5H1RT UH=r9\F;�2G1Q= C7F dt1r=6Ыhڏ>C03l0.B8, c˱" VcϱwE 6wB aAHXLXNH $4 7 Q'"K&b21XH,#/{C7$C2'ITFnR#,4H#dk9, +ȅ3![ b@qS(RjJ4e2AURݨT5ZBRQ4u9̓IKhhitݕNWGw Ljg(gwLӋT071oUX**| J&*/Tު UUT^S}FU3S ԖUPSSg;goT?~YYLOCQ_ cx,!k u5&|v*=9C3J3WRf?qtN (~))4L1e\kXHQG6EYAJ'\'GgSSݧ M=:.kDwn^Loy}/TmG X $ <5qo</QC]@Caaᄑ<FFi\$mmƣ&&!&KMMRM);L;L֙͢5=12כ߷`ZxZ,eIZYnZ9YXUZ]F%ֻNNgðɶۮm}agbgŮ}}= Z~sr:V:ޚΜ?}/gX3)iSGggs󈋉K.>.ȽJtq]zۯ6iܟ4)Y3sCQ? 0k߬~OCOg#/c/Wװwa>>r><72Y_7ȷOo_C#dz�%gA[z|!?:eAAA!h쐭!ΑiP~aa~ 'W?pX15wCsDDDޛg1O9-J5*>.j<74?.fYXXIlK9.*6nl {/]py.,:@LN8A*%w% yg"/6шC\*NH*Mz쑼5y$3,幄'L Lݛ:v m2=:1qB!Mggfvˬen/kY- BTZ(*geWf͉9+̳ې7ᒶKW-X潬j9<qy +V<*mOW~&zMk^ʂk U }]OX/Yߵa>(xoʿܔĹdff-[n ڴ VE/(ۻC<e;?TTTT6ݵan{4[>ɾUUMfeI?m]Nmq#׹=TR+Gw- 6 U#pDy  :v{vg/jBFS[b[O>zG4<YyJTiӓgό}~.`ۢ{cjotE;;\tWW:_mt<Oǻ\kz{f7y՞9=ݽzo~r'˻w'O_@AC݇?[jwGCˆ 8>99?rCd&ˮ/~јѡ򗓿m|x31^VwwO| (hSЧc3-��� cHRM��z%��������u0��`��:��o_F��IDATxyTŹ ; EEAE\@ D 5^1.֘nqԸt4brMr5+jsܐ#ffT6MOm癇sN꭯"444ra&PR�?X,D:顠D5 Q;,MXGVOO'0= ԄduX;b`J,i9:xagaih6Yu>ji�pn |VkX_h3P&, Ӯ|Z{`p&, X]ŏ5aihk8MX!Zq1XFA\h;hkhhhDэ!V԰}6h҄kۭ> ŰG|cM9oz!+-FnW1=ag~w=,@SIL~TJO KȳwMTV6^*$eYJJln<D_2+(1։ >iw _2T6a1@|5ax x2|^a@v@?LORV%1W,s8ZF]u y�456tL M+fS&+~ \t,-:P&?tu |#Dl-)Z"m Cq {٪yLz<^&qA5X ,C3PQd)R۸GUc#}a45RjYt<Wmtx&s"y/Π:oh;yo76d' IV:[Vc4�_w4�ZkY|;dq<EOT#W)|$'`/5D IJ)ǕU`&G!ÇfJ~5vdcqMZ=/jPu#OaI8H%<!m ~LD|>V</"U+Ytk9`p\udiXAaha*pJZmL$OtUYt<v70b(F]xh\_)DN7YuJvtߝI)tՅu VA蝴ͼu|9 ?sdjXQ₰?(/t`-&5YK0Sگ;Ԙ \ aŠO C�\k)2-E8/\{ oOc]cƮv|+g~Y=OR 2`KN˞pl AV<U GDTj[|'rR.E:0KŪ,~. 5yN:h ~{ ~*%kŶ#jS{#!Iea@$&og"OueC#!Lx} 8<f"_GϘDREͥv/\ҙ-&d*Vo< #⸼8)_  6"ǁY,'3YIy}LRv=B6`RU83pC>dq1 85|[~\WѹWgj|w"B"GV eq>oF T #*7Hp}q:+`i`6R&X6MYS.',ӣM#33&RoCN\{f䴃i+UXȒ5-=pб{=gs (Ih+%-HpkIWpDs~ gjyTN2 wHΙ)r]Kag]-5zXfj<9zWKظd]>OmU- <3&iقJ7ݗgLWGXWʉڵu' CͶ]w xlK&,l6ӴC}9v:1_<"j^3:ZƘ+ǥu=MXق2t0H]vcNc|= >y⃜| sE~J=ɉ&,l}uW1u]zwa[xs:F`'y{F~%cSNjd  >Cn4F[3@$ئ=ġu>LzT ld3_z/fCڷ7t.)ࣩAFn  nC� ozP -~k>+B(\Uv޸U*q(-#oS˒PSǏOc]CJՄM<a#^. D߶+W/}@:vأ3.<8]6;{ 9Y{lUi`k&AĚ, C'"z&TE[NuA(\ʎ)ݶYz%lX~6kds[X W;C7duECm[>zWZ6@TkmozMX& SC,G L=Ԅ9I;Gm&,<ղ*�+O! o^FFhDBG1p~뚰4򛴶�U* Gߺ&,&@$x?˨J:g7yUC-xLJs{�T)Y MXHb9au`)`xm/_ɩ:tDo 54'֕@PzW9")=]fХOWv;RPkX,~y_3?eGP_SzKEeU[B <Ѳ{W^ҜӰ6VyFLňVu&VBG-O5!?pGH~{y Qϒa:k}/21"5{V]u-ZφEk.( VJThSuN2Pp pG8 NgW( 68Շ߱J>DiDUyOUhO.VI&+JڹyT**lJg4pB5q>[ﶰ?ԡ@dՁV s٣M#^Lf cv70/(n!_|'?T m CP6(4< F#c(�y, C�v>~gw`,p)%ACKX~߁y&n ?2&"<,BxeYt?M;I^x&WDWx9 ƛ8KpC埆* duz8w9}Hp0Gd<@$�MGC[WL-.q٬UNA$!NI@$8yؤEa",tܘ@$FlBvcZ|{`="Uw{�* ?BI5nvE@ +a%p.5bH |>Β.b`616c_~8- V'1E86q!2pu Di3.  fpL ܐzTj3Y-äBZP'VZ=) x82 m\ Lt{ |8XNd-pĵ&)�J"@ Xqϰ?Γ?T1ah 5;V#+j@Y ;8(pRmF8d x6 J;2Lhgh9>:\)~(*D!)$;H9GroV"%128Qz?T\ DIy&Ṳe�444$vGp`1@ #U;zqeºB cu4§iG:kZTpBZTxb5R Ԣ*H ;4rQh@3*# T WkT5aia]j Qp"hױ?ӢjЄS(Oȿ0-؍ *]vIhi"zG3,]s"`ؕ Ǯ5:v&sg'e;IlױWets;R$nnզ4JhH"ôFțo]+_~$Ru &`0 \v"͏eflIױ_j>b.Oʖ| (FW(HQ"ױ7zLlXPg]0:#Nls~9Gc]Ƕcdq!"TS|�< <:h~ERUcWxI%'vA $BD28ױ$٦؏G䔏CѦv&= Qױ7+ٚ*h~$K[{aZMql Y]fؽ^$vC u]i �~K*�8u-11mMczTN0ZP ӺXP$e8u\s�O`("%:tF Ώ$!^Eo=9 $Yz4SĻGr/]~H&DYXt0c񮂴ul 2=4cQŠ\@$=γuGL8'lXd{ {*P=?0/ `2aZYo7oH-1 S dԚu| 4� Ӛ!yY!'ôF>B!`tv))\K j�D DA "!cXn]i ۢ Od`vCV\yPQ]juׁ%$Ѥ-6e$W]=U;-E}JJ6%;k" _R1�lK'F&%bVkQ�.~KY8BQ<㕉HSW(;LC3$Yôv~aMg 5uծcfF׷ű/Á :) \{kt +&^^DO?twT�KvOO*ٍ  Z+Vp` YBijXIIQ1Z*Ṃqg<4MLRjŅRe,rxǮ5Lk*`yLv#MP{}땳*C74V%z)�0:l%{IX*#:Gi h:ױϔ/*;ô'˚V 7uiIÌtp<hn�xE iuȤJ5q +|+iŊ<E5ݮTFT l?w5a~IExa|?8QOv= ckc@1-Vx?iCwBq`+k/ 4il3EZVT %Jױ+L2P3VVU;5 Β$u7iTQa_ɞ]aygg(1h۝aZwK":ޣc+ݚ}]жœiôT3~"Y*acVH%9]n2L,VmcBF9MqqNɢOTTDױQfu*YOr]]:!Yv54O\+ج940݈�ӿvU8ifTДMh~<sױWUEryUNv)o&2" C~B*>SY?%hLq;m(ln)u-i=NbTv\Ǯ"؞QR*YUMô-Nki2e> )s݊`(.3NW߼Ѯ7ORD]IU^dT'[G͛/ JFzugJde[~ L?Qf42JXm: G^Db)lHgi4V1}* mV(5fƜb~x4/ʚ2LXy M3LkߨBu{{vd5UdFu$zҩo%K5 oq~w�T BF?k|[}J7wG8f6U w-Ym[oMS ōcYL8/Te[u&J׉jESƄ?^6 Ӛ:ca= C/ad'|co'z4=0;=TTߺBkl[c3K TJufôf) 9b=,j )"666x0n$*;;]Fo2%Tdzq!Qf�(frG�+0i-2L,lt]nSbxô40z\/"`Uv(>\npv꧊c/o[ݵg<j+ F.maGrQ=JN&�KU>0w ӚcWҶߧyN: 0نiوL*Aϧ0i5u܋Z&Յױo'eV11oiKVʑcG Ӻ=Nc4PED'}ôV"/}+ `Xv?pN RE/=h5?U:{2{BptV#ˆvH:6<.R%\<M)WcRg4uiTN֣xaZceM.:RNiob*tf6*( 6Gc:Y>Kps-aWP LK[6dfz=Rnȃ]yo7+dױZΖpJ<ݨ@%1""&\Xa�W#36;",xŞA9ҫΩ|o fJHo<<}.TױF/Hf`=K0[!hy=W f@d^x90I:`GID \=3g#ܒ D?Tu!ADMh1pI xaZGU'ZV95k/DxIDxr.F'yدf`<ep%ô*~Y[!DhT!,`i@T\2\:xd<?{;Fxm碯 N|<|-"\cKb&T5½[r zôΒihW-.3Aa<GNDfUD%-a̞M|o{:=$[? FkI;tô.@8p3Ig| [=0" D#)$*r2blU㮞4iiY:t?̐}h߈Fh#)W4:W Ro%5DXLm[8"pvݔCaJ�烁+wKylЄM%tH[rLb-v]Mu&ևO@=ula_L/-EMXߧg1imhא)6 icVخ8[&, ijď܁sצۨ!�ЍU����IENDB`�����������������������������������������������������������������������������������������������������������������������������������������UnixAgent-2.4.2/tools/macosx/installer_gui/iceberg/scripts/�����������������������������������������0000775�0000000�0000000�00000000000�13327377321�0024013�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������UnixAgent-2.4.2/tools/macosx/installer_gui/iceberg/scripts/postinstall������������������������������0000775�0000000�0000000�00000002610�13327377321�0026314�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!/bin/bash #Setting temp directory if [ $3 ] #If run from NetInstall then TMP_DIR=$3/tmp/ocs_installer else TMP_DIR=/tmp/ocs_installer fi INSTALL_PATH="/Applications/OCSNG.app" #We set rights to install directory chown -R root:wheel $INSTALL_PATH chmod -R 755 $INSTALL_PATH #We set rights to ocscontact binary chown root:wheel $INSTALL_PATH/Contents/Resources/ocscontact chmod 700 $INSTALL_PATH/Contents/Resources/ocscontact #We set rights to uninstall script in install path chmod 700 $INSTALL_PATH/Contents/Resources/uninstaller.sh #We set etc configuration path ETCPATH="/etc/ocsinventory-agent" mkdir $ETCPATH/ cp $TMP_DIR/ocsinventory-agent.cfg $ETCPATH/ cp $TMP_DIR/modules.conf $ETCPATH/ #We set var directory VARPATH="/var/lib/ocsinventory-agent" mkdir -p $VARPATH chown -R root:wheel $VARPATH if [ -e $TMP_DIR/serverdir ] && [ -e $TMP_DIR/cacert.pem ]; then SERVERDIR=`cat $TMP_DIR/serverdir` mkdir $SERVERDIR cp $TMP_DIR/cacert.pem $SERVERDIR/ fi #We set LaunchDaemons plist files LAUNCHDPATH="/Library/LaunchDaemons/" cp $TMP_DIR/org.ocsng.agent.plist $LAUNCHDPATH chown root:wheel $LAUNCHDPATH/org.ocsng.agent.plist chmod 644 $LAUNCHDPATH/org.ocsng.agent.plist if [ -f $TMP_DIR/now ]; then echo 'Loading Service' launchctl load $LAUNCHDPATH/org.ocsng.agent.plist echo 'Starting Service' launchctl start org.ocsng.agent fi #We remove temporary directory rm -Rf $TMP_DIR exit 0 ������������������������������������������������������������������������������������������������������������������������UnixAgent-2.4.2/tools/macosx/installer_gui/ocs_agent_config/����������������������������������������0000775�0000000�0000000�00000000000�13327377321�0024213�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������UnixAgent-2.4.2/tools/macosx/installer_gui/ocs_agent_config/English.lproj/��������������������������0000775�0000000�0000000�00000000000�13327377321�0026731�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������UnixAgent-2.4.2/tools/macosx/installer_gui/ocs_agent_config/English.lproj/InfoPlist.strings���������0000664�0000000�0000000�00000001502�13327377321�0032251�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/�/� �/�/� �O�C�S�I�N�V�E�N�T�O�R�Y�-�N�G� �/�/� �/�/� �C�o�p�y�l�e�f�t� �G�u�i�l�l�a�u�m�e� �P�R�O�T�E�T� �&� �G�i�l�l�e�s� �D�U�B�O�I�S� �2�0�1�7� �/�/� � �/�/� �/�/� �T�h�i�s� �c�o�d�e� �i�s� �o�p�e�n� �s�o�u�r�c�e� �a�n�d� �m�a�y� �b�e� �c�o�p�i�e�d� �a�n�d� �m�o�d�i�f�i�e�d� �a�s� �l�o�n�g� �a�s� �t�h�e� �s�o�u�r�c�e� �/�/� �c�o�d�e� �i�s� �a�l�w�a�y�s� �m�a�d�e� �f�r�e�e�l�y� �a�v�a�i�l�a�b�l�e�.� �/�/� �P�l�e�a�s�e� �r�e�f�e�r� �t�o� �t�h�e� �G�e�n�e�r�a�l� �P�u�b�l�i�c� �L�i�c�e�n�c�e� �h�t�t�p�:�/�/�w�w�w�.�g�n�u�.�o�r�g�/� �/�/� �/�/� � �/�/�L�o�c�a�l�i�z�e�d� �v�e�r�s�i�o�n�s� �o�f� �I�n�f�o�.�p�l�i�s�t� �k�e�y�s� �N�S�H�u�m�a�n�R�e�a�d�a�b�l�e�C�o�p�y�r�i�g�h�t� �=� �"�O�C�S� �I�n�v�e�n�t�o�r�y� �N�G� �T�e�a�m�,� �2�0�1�7�"�;� �I�n�s�t�a�l�l�e�r�S�e�c�t�i�o�n�T�i�t�l�e� �=� �"�C�o�n�f�i�g�u�r�a�t�i�o�n�"�;� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������UnixAgent-2.4.2/tools/macosx/installer_gui/ocs_agent_config/English.lproj/Localizable.strings�������0000664�0000000�0000000�00000005050�13327377321�0032565�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/�/� �/�/� �O�C�S�I�N�V�E�N�T�O�R�Y�-�N�G� �/�/� �/�/� �C�o�p�y�l�e�f�t� �G�u�i�l�l�a�u�m�e� �P�R�O�T�E�T� �2�0�1�1� �/�/� � �/�/� �/�/� �T�h�i�s� �c�o�d�e� �i�s� �o�p�e�n� �s�o�u�r�c�e� �a�n�d� �m�a�y� �b�e� �c�o�p�i�e�d� �a�n�d� �m�o�d�i�f�i�e�d� �a�s� �l�o�n�g� �a�s� �t�h�e� �s�o�u�r�c�e� �/�/� �c�o�d�e� �i�s� �a�l�w�a�y�s� �m�a�d�e� �f�r�e�e�l�y� �a�v�a�i�l�a�b�l�e�.� �/�/� �P�l�e�a�s�e� �r�e�f�e�r� �t�o� �t�h�e� �G�e�n�e�r�a�l� �P�u�b�l�i�c� �L�i�c�e�n�c�e� �h�t�t�p�:�/�/�w�w�w�.�g�n�u�.�o�r�g�/� �/�/� �/�/� � �/�/� �L�o�c�a�l�i�z�e�d� �v�e�r�s�i�o�n�s� �o�f� �I�n�f�o�.�p�l�i�s�t� �k�e�y�s� �P�a�n�e�T�i�t�l�e� �=� �"�O�C�S� �A�g�e�n�t� �c�o�n�f�i�g�u�r�a�t�i�o�n�"�;� � �/�/�Y�e�s� �b�u�t�t�o�n� �"�Y�e�s�"� �=� �"�Y�e�s�"�;� � �/�/�N�o� �b�u�t�t�o�n� �"�N�o�"� �=� �"�N�o�"�;� � �/�/�W�a�r�n�i�n�g� �a�b�o�u�t� �a�l�r�e�a�d�y� �e�x�i�s�t�i�n�g� �c�o�f�i�g�u�r�a�t�i�o�n� �f�i�l�e� �"�A�l�r�e�a�d�y�_�c�o�n�f�_�w�a�r�n�"� �=� �"�O�C�S� �a�g�e�n�t� �c�o�n�f�i�g�u�r�a�t�i�o�n� �f�i�l�e� �s�e�e�m�s� �t�o� �a�l�r�e�a�d�y� �e�x�i�s�t�s�.� �D�o� �y�o�u� �w�a�n�t� �t�o� �l�a�u�n�c�h� �O�C�S� �I�n�v�e�n�t�o�r�y� �N�G� �a�g�e�n�t� �c�o�n�f�i�g�u�r�a�t�i�o�n�?�"�;� � �/�/�W�a�r�n�i�n�g� �a�b�o�u�t� �a�l�r�e�a�d�y� �e�x�i�s�t�i�n�g� �c�o�f�i�g�u�r�a�t�i�o�n� �f�i�l�e� �c�o�m�m�e�n�t� �"�A�l�r�e�a�d�y�_�c�o�n�f�_�w�a�r�n�_�c�o�m�m�e�n�t�"� �=� �"�T�h�e� �p�r�e�v�i�o�u�s� �/�e�t�c�/�o�c�s�i�n�v�e�n�t�o�r�y�-�a�g�e�n�t�/�o�c�s�i�n�v�e�n�t�o�r�y�-�a�g�e�n�t�.�c�f�g� �f�i�l�e� �w�i�l�l� �b�e� �e�r�a�s�e�d�"�;� � �/�/�W�a�r�n�i�n�g� �a�b�o�u�t� �m�i�s�s�i�n�g� �c�e�r�t�i�f�i�c�a�t�e� �f�i�l�e� �"�M�i�s�s�i�n�g�_�c�e�r�t�_�w�a�r�n�"� �=� �"�Y�o�u� �h�a�v�e� �e�n�a�b�l�e�d� �D�o�w�n�l�o�a�d� �f�e�a�t�u�r�e� �a�n�d� �S�S�L� �c�e�r�t�i�c�a�t�e� �c�h�e�c�k� �b�u�t� �y�o�u� �d�o�n�'�t� �s�p�e�c�i�f�y� �a� �c�e�r�t�i�f�i�c�a�t�e� �f�i�l�e�"�;� � �/�/�W�a�r�n�i�n�g� �a�b�o�u�t� �m�i�s�s�i�n�g� �c�e�r�t�i�f�i�c�a�t�e� �f�i�l�e� �c�o�m�m�e�n�t� �"�M�i�s�s�i�n�g�_�c�e�r�t�_�w�a�r�n�_�c�o�m�m�e�n�t�"� �=� �"�I�f� �y�o�u� �d�o�n�'�t� �s�p�e�c�i�f�i�y� �a� �c�e�r�t�i�f�i�c�a�t�e� �f�i�l�e�,� �D�o�w�n�l�o�a�d� �f�e�a�t�u�r�e� �w�o�n�'�t� �w�o�r�k�"�;� � �/�/�W�a�r�n�i�n�g� �a�b�o�u�t� �i�n�v�a�l�i�d� �s�e�r�v�e�r� �a�d�d�r�e�s�s� �"�I�n�v�a�l�i�d�_�s�r�v�_�a�d�d�r�"� �=� �"�I�n�v�a�l�i�d� �O�C�S� �s�e�r�v�e�r� �a�d�d�r�e�s�s�"�;� � �/�/�W�a�r�n�i�n�g� �a�b�o�u�t� �i�n�v�a�l�i�d� �s�e�r�v�e�r� �a�d�d�r�e�s�s� �c�o�m�m�e�n�t� �"�I�n�v�a�l�i�d�_�s�r�v�_�a�d�d�r�_�c�o�m�m�e�n�t�"� �=� �"�P�l�e�a�s�e� �c�h�e�c�k� �a�n�d� �r�e�-�e�n�t�e�r� �y�o�u�r� �O�C�S� �s�e�r�v�e�r� �a�d�d�r�e�s�s�"�;�����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������UnixAgent-2.4.2/tools/macosx/installer_gui/ocs_agent_config/English.lproj/ocs_agent_config.nib/�����0000775�0000000�0000000�00000000000�13327377321�0032767�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������designable.nib��������������������������������������������������������������������������������������0000664�0000000�0000000�00000032670�13327377321�0035507�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�UnixAgent-2.4.2/tools/macosx/installer_gui/ocs_agent_config/English.lproj/ocs_agent_config.nib�������������������������������������������������������������������������<?xml version="1.0" encoding="UTF-8"?> <document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="13196" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none"> <dependencies> <deployment version="1060" identifier="macosx"/> <plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="13196"/> <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/> </dependencies> <objects> <customObject id="-2" userLabel="File's Owner" customClass="InstallerSection"> <connections> <outlet property="firstPane" destination="5" id="6"/> </connections> </customObject> <customObject id="-1" userLabel="First Responder" customClass="FirstResponder"/> <customObject id="-3" userLabel="Application"/> <customObject id="5" userLabel="ocs_agent_configPane" customClass="ocs_agent_configPane"> <connections> <outlet property="cacertfile" destination="56" id="71"/> <outlet property="contentView" destination="8" id="9"/> <outlet property="debugmode" destination="64" id="65"/> <outlet property="download" destination="94" id="99"/> <outlet property="lazymode" destination="100" id="102"/> <outlet property="logfile" destination="29" id="72"/> <outlet property="protocolist" destination="33" id="77"/> <outlet property="server" destination="10" id="73"/> <outlet property="ssl" destination="103" id="105"/> <outlet property="tag" destination="14" id="70"/> </connections> </customObject> <customView id="8" userLabel="View"> <rect key="frame" x="0.0" y="0.0" width="450" height="360"/> <autoresizingMask key="autoresizingMask"/> <subviews> <textField verticalHuggingPriority="750" id="79"> <rect key="frame" x="42" y="333" width="343" height="17"/> <autoresizingMask key="autoresizingMask"/> <textFieldCell key="cell" sendsActionOnEndEditing="YES" title="Set your OCS Inventory Agent MacOSX configuration" id="93"> <font key="font" metaFont="system"/> <color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/> <color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/> </textFieldCell> </textField> <button imageHugsTitle="YES" id="64"> <rect key="frame" x="263" y="195" width="103" height="18"/> <autoresizingMask key="autoresizingMask"/> <buttonCell key="cell" type="check" title="Debug Mode" bezelStyle="regularSquare" imagePosition="leading" alignment="left" inset="2" id="92"> <behavior key="behavior" changeContents="YES" doesNotDimImage="YES" lightByContents="YES"/> <font key="font" metaFont="system"/> </buttonCell> </button> <textField verticalHuggingPriority="750" misplaced="YES" id="63"> <rect key="frame" x="17" y="34" width="407" height="34"/> <autoresizingMask key="autoresizingMask"/> <textFieldCell key="cell" sendsActionOnEndEditing="YES" title="Certificate File (needed by 'Download feature') :" id="91"> <font key="font" metaFont="system"/> <color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/> <color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/> </textFieldCell> </textField> <textField verticalHuggingPriority="750" misplaced="YES" id="56"> <rect key="frame" x="20" y="21" width="269" height="22"/> <autoresizingMask key="autoresizingMask"/> <textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" selectable="YES" sendsActionOnEndEditing="YES" state="on" borderStyle="bezel" drawsBackground="YES" id="89"> <font key="font" metaFont="system"/> <color key="textColor" name="textColor" catalog="System" colorSpace="catalog"/> <color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/> </textFieldCell> </textField> <button verticalHuggingPriority="750" misplaced="YES" imageHugsTitle="YES" id="59"> <rect key="frame" x="291" y="13" width="97" height="32"/> <autoresizingMask key="autoresizingMask"/> <buttonCell key="cell" type="push" title="Browse" bezelStyle="rounded" alignment="center" borderStyle="border" inset="2" id="90"> <behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/> <font key="font" metaFont="system"/> </buttonCell> <connections> <action selector="chooseCacertFile:" target="5" id="66"/> </connections> </button> <popUpButton verticalHuggingPriority="750" imageHugsTitle="YES" id="33"> <rect key="frame" x="17" y="252" width="98" height="26"/> <autoresizingMask key="autoresizingMask"/> <popUpButtonCell key="cell" type="push" bezelStyle="rounded" alignment="left" lineBreakMode="truncatingTail" state="on" borderStyle="borderAndBezel" inset="2" arrowPosition="arrowAtCenter" preferredEdge="maxY" selectedItem="36" id="88"> <behavior key="behavior" lightByBackground="YES" lightByGray="YES"/> <font key="font" metaFont="system"/> <menu key="menu" title="OtherViews" id="34"> <items> <menuItem state="on" id="36"/> <menuItem title="Item2" id="37"/> <menuItem title="Item3" id="35"/> </items> </menu> </popUpButtonCell> <connections> <action selector="chooseProtocol:" target="5" id="76"/> </connections> </popUpButton> <textField verticalHuggingPriority="750" id="30"> <rect key="frame" x="17" y="219" width="114" height="17"/> <autoresizingMask key="autoresizingMask"/> <textFieldCell key="cell" sendsActionOnEndEditing="YES" title="Log File path :" id="87"> <font key="font" metaFont="system"/> <color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/> <color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/> </textFieldCell> </textField> <textField verticalHuggingPriority="750" id="29"> <rect key="frame" x="20" y="189" width="185" height="22"/> <autoresizingMask key="autoresizingMask"/> <textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" selectable="YES" editable="YES" sendsActionOnEndEditing="YES" state="on" borderStyle="bezel" drawsBackground="YES" id="86"> <font key="font" metaFont="system"/> <color key="textColor" name="textColor" catalog="System" colorSpace="catalog"/> <color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/> </textFieldCell> </textField> <textField verticalHuggingPriority="750" id="15"> <rect key="frame" x="17" y="150" width="167" height="17"/> <autoresizingMask key="autoresizingMask"/> <textFieldCell key="cell" sendsActionOnEndEditing="YES" title="TAG value (optional):" id="84"> <font key="font" metaFont="system"/> <color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/> <color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/> </textFieldCell> </textField> <textField verticalHuggingPriority="750" id="14"> <rect key="frame" x="19" y="120" width="146" height="22"/> <autoresizingMask key="autoresizingMask"/> <textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" selectable="YES" editable="YES" sendsActionOnEndEditing="YES" state="on" borderStyle="bezel" drawsBackground="YES" id="83"> <font key="font" metaFont="system"/> <color key="textColor" name="textColor" catalog="System" colorSpace="catalog"/> <color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/> </textFieldCell> </textField> <textField verticalHuggingPriority="750" id="13"> <rect key="frame" x="132" y="286" width="178" height="17"/> <autoresizingMask key="autoresizingMask"/> <textFieldCell key="cell" sendsActionOnEndEditing="YES" title="OCS server URL :" id="82"> <font key="font" metaFont="system"/> <color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/> <color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/> </textFieldCell> </textField> <textField verticalHuggingPriority="750" id="10"> <rect key="frame" x="117" y="256" width="146" height="22"/> <autoresizingMask key="autoresizingMask"/> <textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" selectable="YES" editable="YES" sendsActionOnEndEditing="YES" state="on" borderStyle="bezel" drawsBackground="YES" id="81"> <font key="font" metaFont="system"/> <color key="textColor" name="textColor" catalog="System" colorSpace="catalog"/> <color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/> </textFieldCell> </textField> <button imageHugsTitle="YES" id="94"> <rect key="frame" x="263" y="167" width="201" height="26"/> <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/> <buttonCell key="cell" type="check" title="Download feature" bezelStyle="regularSquare" imagePosition="leading" alignment="left" inset="2" id="95"> <behavior key="behavior" changeContents="YES" doesNotDimImage="YES" lightByContents="YES"/> <font key="font" metaFont="system"/> </buttonCell> </button> <button imageHugsTitle="YES" id="100"> <rect key="frame" x="263" y="147" width="89" height="18"/> <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/> <buttonCell key="cell" type="check" title="Lazy Mode" bezelStyle="regularSquare" imagePosition="leading" alignment="left" inset="2" id="101"> <behavior key="behavior" changeContents="YES" doesNotDimImage="YES" lightByContents="YES"/> <font key="font" metaFont="system"/> </buttonCell> </button> <button imageHugsTitle="YES" id="103"> <rect key="frame" x="263" y="122" width="166" height="18"/> <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/> <buttonCell key="cell" type="check" title="SSL check" bezelStyle="regularSquare" imagePosition="leading" alignment="left" inset="2" id="104"> <behavior key="behavior" changeContents="YES" doesNotDimImage="YES" lightByContents="YES"/> <font key="font" metaFont="system"/> </buttonCell> </button> <textField verticalHuggingPriority="750" misplaced="YES" id="28"> <rect key="frame" x="271" y="259" width="95" height="17"/> <autoresizingMask key="autoresizingMask"/> <textFieldCell key="cell" sendsActionOnEndEditing="YES" id="85"> <font key="font" metaFont="system"/> <string key="title">/ocsinventory </string> <color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/> <color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/> </textFieldCell> </textField> </subviews> </customView> </objects> </document> ������������������������������������������������������������������������keyedobjects.nib������������������������������������������������������������������������������������0000664�0000000�0000000�00000033366�13327377321�0036070�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�UnixAgent-2.4.2/tools/macosx/installer_gui/ocs_agent_config/English.lproj/ocs_agent_config.nib�������������������������������������������������������������������������bplist00������X$versionX$objectsY$archiverT$top�����#�$�*�.�2�B�J�M�N�O�S�X�l�u�v������������������������   3489<=@CLMUV_`hirs|� !$()*-.4=>GHLOSVabcmnwxE}�j��U$null� � � � � �����������������VNSRoot]NSConnections\NSOidsValues_NSObjectsValues]NSObjectsKeys_NSAccessibilityOidsValues_NSVisibleWindows_NSAccessibilityOidsKeys_NSAccessibilityConnectorsV$classZNSOidsKeys׀׀ր؀� ��!�"[NSClassName_InstallerSection�%�&�'�(Z$classnameX$classes^NSCustomObject�'�)XNSObject�+��,�-ZNS.objects�%�&�/�0\NSMutableSet�/�1�)UNSSet�+��3�A�4�5�6�7�8�9�:�;�<�=�>�?�@ %l�C�D�E���G�H�IXNSSource]NSDestinationWNSLabel � ��K�" _ocs_agent_configPaneYfirstPane�%�&�P�Q_NSNibOutletConnector�P�R�)^NSNibConnector�C�D�E��G�U�V�I $ �Y�Z�[��\�]�^�_�`�a�b�c�d�e�f�f�h�i�j�kVNSCellWNSFrame_NSAllowsLogicalLayoutDirection_NSNextResponder[NSSuperviewXNSvFlags]NSNibTouchBar_%NSTextFieldAlignmentRectInsetsVersionYNSEnabled#�� �� �m�\�^�_�n�o�p�q�i�h�i�tZNSSubviews[NSFrameSize&��_{{20, 21}, {269, 22}}�w�x��y�z�{�|�}�~��U���k����[NSCellFlags]NSControlViewYNSSupport_NSDrawsBackground_NSBackgroundColorZNSContents[NSTextColor\NSCellFlags2p�A" @�P��������VNSSizeXNSfFlagsVNSName#@*������_.AppleSystemUIFont�%�&��VNSFont��)����������[NSColorName\NSColorSpace]NSCatalogNameWNSColorVSystem_textBackgroundColor����������WNSWhite\NSComponents_NSCustomColorSpaceB1�C1 1��������TNSIDUNSICCWNSModel �����WNS.dataOh��happl���mntrGRAYXYZ ����.�acspAPPL����none�����������������������-appl�����������������������������������������������desc������ydscm��<��cprt�� $���#wtpt�� H���kTRC�� \�� desc�������Generic Gray Gamma 2.2 Profile����������������������������������������������������������������������������������mluc���������� skSK���.��daDK���8��caES���8��viVN���@��"ptBR���J��bukUA���,��frFU���>��huHU���4��zhTW�����JnbNO���:��hcsCZ���(��heIL���$��itIT���N��roRO���*��<deDE���N��fkoKR���"��svSE���8��zhCN�����jaJP���&��elGR���*��ptPO���R��DnlNL���@��esES���L��thTH���2��"trTR���$��TfiFI���F��xhrHR���>��plPL���J��ruRU���:��FenUS���<��arEG���,���Va�e�o�b�e�c�n�� �s�i�v�� �g�a�m�a� �2�,�2�G�e�n�e�r�i�s�k� �g�r�� �2�,�2� �g�a�m�m�a�p�r�o�f�i�l�G�a�m�m�a� �d�e� �g�r�i�s�o�s� �g�e�n��r�i�c�a� �2�.�2�C�u� �h��n�h� �M��u� �x��m� �C�h�u�n�g� �G�a�m�m�a� �2�.�2�P�e�r�f�i�l� �G�e�n��r�i�c�o� �d�a� �G�a�m�a� �d�e� �C�i�n�z�a�s� �2�,�2030;L=0� �G�r�a�y�-30<0� �2�.�2�P�r�o�f�i�l� �g��n��r�i�q�u�e� �g�r�i�s� �g�a�m�m�a� �2�,�2��l�t�a�l��n�o�s� �s�z��r�k�e� �g�a�m�m�a� �2�.�2u(ppQI^� �2�.�2� r_icϏ�G�e�n�e�r�i�s�k� �g�r�� �g�a�m�m�a� �2�,�2�-�p�r�o�f�i�l�O�b�e�c�n�� a�e�d�� �g�a�m�a� �2�.�2� � � �2�.�2�P�r�o�f�i�l�o� �g�r�i�g�i�o� �g�e�n�e�r�i�c�o� �d�e�l�l�a� �g�a�m�m�a� �2�,�2�G�a�m�a� �g�r�i� �g�e�n�e�r�i�c� �2�,�2�A�l�l�g�e�m�e�i�n�e�s� �G�r�a�u�s�t�u�f�e�n�-�P�r�o�f�i�l� �G�a�m�m�a� �2�,�2|� ֌� � �2�.�2� \ |fnpp^|ep� �2�.�2� cϏeNN�,000000� �2�.�2� 000000� � � �2�.�2�P�e�r�f�i�l� �g�e�n��r�i�c�o� �d�e� �c�i�n�z�e�n�t�o�s� �d�a� �G�a�m�m�a� �2�,�2�A�l�g�e�m�e�e�n� �g�r�i�j�s� �g�a�m�m�a� �2�,�2�-�p�r�o�f�i�e�l�P�e�r�f�i�l� �g�e�n��r�i�c�o� �d�e� �g�a�m�m�a� �d�e� �g�r�i�s�e�s� �2�,�2#1*5A!!2@#"L1H'D� �2�.�2�G�e�n�e�l� �G�r�i� �G�a�m�a� �2�,�2�Y�l�e�i�n�e�n� �h�a�r�m�a�a�n� �g�a�m�m�a� �2�,�2� �-�p�r�o�f�i�i�l�i�G�e�n�e�r�i �k�i� �G�r�a�y� �G�a�m�m�a� �2�.�2� �p�r�o�f�i�l�U�n�i�w�e�r�s�a�l�n�y� �p�r�o�f�i�l� �s�z�a�r�o[�c�i� �g�a�m�m�a� �2�,�21I0O� A5@0O� 30<<0� �2�,�2�-?@>D8;L�G�e�n�e�r�i�c� �G�r�a�y� �G�a�m�m�a� �2�.�2� �P�r�o�f�i�l�e:'E'� �2�.�2� DHF� 1E'/J� 9'Etext����Copyright Apple Inc., 2012��XYZ ������Q����curv����������� �����#�(�-�2�7�;�@�E�J�O�T�Y�^�c�h�m�r�w�|������������������������� %+28>ELRY`gnu| &/8AKT]gqz� !-8COZfr~ -;HUcq~ +:IXgw'7HYj{+=Oat 2FZn  % : O d y  ' = T j " 9 Q i  * C \ u & @ Z t .Id %A^z &Ca~1Om&Ed#Cc'Ij4Vx&IlAe@e Ek*Qw;c*R{Gp@j>i  A l !!H!u!!!"'"U"""# #8#f###$$M$|$$% %8%h%%%&'&W&&&''I'z''( (?(q(())8)k))**5*h**++6+i++,,9,n,,- -A-v--..L.../$/Z///050l0011J1112*2c223 3F3334+4e4455M555676r667$7`7788P8899B999:6:t::;-;k;;<'<e<<="=a==> >`>>?!?a??@#@d@@A)AjAAB0BrBBC:C}CDDGDDEEUEEF"FgFFG5G{GHHKHHIIcIIJ7J}JK KSKKL*LrLMMJMMN%NnNO�OIOOP'PqPQQPQQR1R|RSS_SSTBTTU(UuUVV\VVWDWWX/X}XYYiYZZVZZ[E[[\5\\]']x]^^l^__a_``W``aOaabIbbcCccd@dde=eef=ffg=ggh?hhiCiijHjjkOkklWlmm`mnnknooxop+ppq:qqrKrss]sttptu(uuv>vvwVwxxnxy*yyzFz{{c{|!||}A}~~b~#G k͂0WGrׇ;iΉ3dʋ0cʍ1fΏ6n֑?zM _ɖ4 uL$h՛BdҞ@iءG&vVǥ8nRĩ7u\ЭD-�u`ֲK³8%yhYѹJº;.! zpg_XQKFAǿ=ȼ:ɹ8ʷ6˶5̵5͵6ζ7ϸ9к<Ѿ?DINU\dlvۀ܊ݖޢ)߯6DScs 2F[p(@Xr4Pm8Ww)Km�%�&��]NSMutableData���)VNSData�%�&��\NSColorSpace��)\NSColorSpace�%�&��WNSColor��)����������ŀ !YtextColor����������B0�C0 1�%�&��_NSTextFieldCell����)\NSActionCellVNSCell�%�&��[NSTextField�����)YNSControlVNSView[NSResponderZcacertfile�C�D�E��G�f��I  �+���A�������������U���'0:>BEILPSWpuy}l�Y�Z�[��\�]�^�_�`�a���d�e�f�f�h�i�j�k)(#� _{{271, 259}, {95, 17}}�w�x��y�{�}�|�~���������'"+.*@��^/ocsinventory ��������,-\controlColor�����  ���L0.602715373�N0.6666666667 1���������ŀ/!_controlTextColor�Y�Z�[��\�]�^�_�a�d�f�f�i�k219 � _{{263, 122}, {166, 18}}!�w"#$�~%�x�|��y&'(�)�+�,�./�12_NSPeriodicInterval]NSButtonFlags_NSAlternateContents_NSKeyEquivalent_NSAlternateImage_NSPeriodicDelay^NSButtonFlags2KH8Q 74038YSSL check5�67[NSImageName56XNSSwitch�%�&:;_NSButtonImageSource:�)P�%�&>?\NSButtonCell>���)�%�&ABXNSButtonA����)�Y�Z�[��\�]�^�_�aDE�d�f�f�i�k<;9� _{{263, 147}, {89, 18}}!�w"#$�~%�x�|��y&'(�)�+�,�R/�1274:=8YLazy Mode�Y�Z�[��\�]�^�_�aWX�d�f�f�i�k@?9� _{{263, 167}, {201, 26}}!�w"#$�~%�x�|��y&'(�)�+�,�e/�1274>A8_Download feature�Y�Z�[��\�]�^�_�`�ajk�d�e�f�f�h�i�j�kDC#� _{{117, 256}, {146, 22}}�w�x��y�z�{�|�}�~t����k����p�AB" �Y�Z�[��\�]�^�_�`�a}~�d�e�f�f�h�i�j�kGF#� _{{132, 286}, {178, 17}}�w�x��y�{�}�|�~������E"+.H_OCS server URL :�Y�Z�[��\�]�^�_�`�a�d�e�f�f�h�i�j�kKJ#� _{{19, 120}, {146, 22}}�w�x��y�z�{�|�}�~t����k����I" �Y�Z�[��\�]�^�_�`�a�d�e�f�f�h�i�j�kNM#� _{{17, 150}, {167, 17}}�w�x��y�{�}�|�~������L"+.O_TAG value (optional):�Y�Z�[��\�]�^�_�`�a�d�e�f�f�h�i�j�kRQ#� _{{20, 189}, {185, 22}}�w�x��y�z�{�|�}�~t����k����P" �Y�Z�[��\�]�^�_�`�a�d�e�f�f�h�i�j�kUT#� _{{17, 219}, {114, 17}}�w�x��y�{�}�|�~������S"+.V_Log File path :�Y�Z�[��\�]�^�_�a�d�f�f�h�i�kYXo� _{{17, 252}, {98, 26}}!�w#"$%�x�~�y&�'(��+��k1�k�k_NSPreferredEdgeZNSMenuItem_NSMenuItemRespectAlignmentVNSMenu_NSUsesItemFromMenu]NSAltersState_NSArrowPosition@�@\@ 7[W� ]Z n���������������    ��]NSMnemonicLoc_NSKeyEquivModMaskXNSActionYNSOnImageZNSKeyEquivXNSTargetWNSTitleWNSState\NSMixedImage]���d^eYb�[NSMenuItemsfgm�[NSClassName^NSResourceName_a`WNSImage_NSMenuCheckmark�%�&"#_NSCustomResource"�)�'_ac_NSMenuMixedState__popUpItemAction:�%�&+,ZNSMenuItem+�)ZOtherViews�+�/�A12\hjl�   �: ]e^YidbUItem2�   �D ]e^YkdbUItem3�%�&IJ^NSMutableArrayIK�)WNSArray�%�&MNVNSMenuM�)�%�&PQ_NSPopUpButtonCellPR>���)^NSMenuItemCell�%�&TU]NSPopUpButtonTA����)�Y�Z�[W��\�]�^�_�aXY�d[�f�f�h�i�k_NSHuggingPrioritysqr9� _{{291, 13}, {97, 32}}Z{250, 750}!�w"#$�~%�x�|��y&'(�d�+g�j/�1@ 7���[pt8VBrowse�Y�Z�[��\�]�^�_�`�aop�d�e�f�f�h�i�j�kwv#� _{{17, 34}, {407, 34}}�w�x��y�{�}�|�~������~u"+.x_1Certificate File (needed by 'Download feature') :�Y�Z�[��\�]�^�_�a�d�f�f�h�i�k{z9� _{{263, 195}, {103, 18}}!�w"#$�~%�x�|��y&'(�)�+�,�/�1274y|8ZDebug Mode�Y�Z�[��\�]�^�_�`�a�d�e�f�f�h�i�j�k~#� _{{42, 333}, {343, 17}}�w�x��y�{�}�|�~������}"+._2Set your OCS Inventory Agent MacOSX configurationZ{450, 360}VNSView�%�&\NSCustomView���)[contentView�C�D�E��G��I y Ydebugmode�C�D�E��G��I > Xdownload�C�D�E��G��I : Xlazymode�C�D�E��G��I P Wlogfile�C�D�E��G��I W [protocolist�C�D�E��G��I B Vserver�C�D�E��G��I 0 Sssl�C�D�E��G��I I Stag�C�D�E���G߀W _chooseProtocol:�%�&_NSNibControlConnector�)^NSNibConnector�C�D�E���G߀p _chooseCacertFile:�+�'�G�f���o�U�b�X�12�����}�j�W�D���񀛀 }y{uwpsWY]\hjSUPRLNIKEGBD>@:<02')� ��"]NSApplication�%�&KK�)�+�'����f��f��f��f�U�f��f��f��f��f��f��f��f��f��f��f��f�߀}yupWY]]]SPLIEB>:0'�+�F5��G�f���o�U�b�X�12�����}�j�W�D����4�5�6�7�8�9�:�;�<�=�>�?�@ }y{uwpsWY]\hjSUPRLNIKEGBD>@:<02') %�+�~5€ÀĀŀƀǀȀɀʀˀ̀̀΀πЀрҀӀԀՀ      !"#$%&'()*+,-./012345�+��Al�+��%�&^NSIBObjectData�)_NSKeyedArchiver_IB.systemFontUpdateVersion]IB.objectdata���"�+�5�:�?'.<I[i  "+6?NS\epqs|  2<E\cr AKMOPRTVY[]^{'2>KTVXZ[]_afgx 4IQ^svz|~)+4BIPYfkx "-7>JUfhjlnw -2468:<>CRgikmo|   1f{  "+4JOPYfox %JLNOQSUWXr>GIKMNPRT}          5 Z \ ^ ` a c e g !%!'!)!*!,!.!0!2!3!L!q!s!u!w!x!z!|!~!!!!!!!!!!!!!!!!!" "2"4"6"7"9";"="?"@"X""""""# ##&#(#*#/#1#3#5#8#9#;#=#>#?#A#C#E#V#Y#[#]#n#p#r#t#########$$ $$$$$$$$$!$.$:$<$>$@$M$Y$h$j$l$n$v$$$$$$$$$$$$$%%%%%%%%H%J%L%N%P%R%T%V%X%^%%%%%%%%%%%%%%%%%%%&&&&)&6&_&s&u&w&x&z&|&~&&&&&&&&&&&&&&&&''')'+','.'0'2'4'5'M'n'p'r't'v'x'z'''''''''''(0(2(4(6(8(:(<(>(I(r(t(v(w(y({(}((((((((((()) ))#),)8)I)K)M)O)Q)[)l)n)p)r)t)})))))))))))))))))))))))*******"*3*5*7*9*;*?*P*R*T*V*X*j*s**********+(+*+,+.+0+2+4+6+8+:+<+>+@+B+D+F+H+J+L+N+P+R+T+V+X+Z+\+^+`+b+d+f+h+j+l+n+p+r+t+v+x++++++++++,,,,, , , ,,,,,,,,,,!,#,%,',),+,-,/,1,3,5,7,9,;,=,?,A,C,E,G,I,K,T,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,----- - - ----------!-#-%-'-)-+---6-----------------------------------------------..... . . ..........!.#.%.'.).+.-./.1.3.5.7.9.;.=.?.A.C.E.G.I.K.M.O.Q.S.U.W.Y.[.]._.a.c.e.g.i.k.m.o.q.z.{.}..........��������������������������.��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������UnixAgent-2.4.2/tools/macosx/installer_gui/ocs_agent_config/French.lproj/���������������������������0000775�0000000�0000000�00000000000�13327377321�0026545�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������UnixAgent-2.4.2/tools/macosx/installer_gui/ocs_agent_config/French.lproj/InfoPlist.strings����������0000664�0000000�0000000�00000001444�13327377321�0032072�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/�/� �/�/� �O�C�S�I�N�V�E�N�T�O�R�Y�-�N�G� �/�/� �/�/� �C�o�p�y�l�e�f�t� �G�u�i�l�l�a�u�m�e� �P�R�O�T�E�T� �2�0�1�1� �/�/� � �/�/� �/�/� �T�h�i�s� �c�o�d�e� �i�s� �o�p�e�n� �s�o�u�r�c�e� �a�n�d� �m�a�y� �b�e� �c�o�p�i�e�d� �a�n�d� �m�o�d�i�f�i�e�d� �a�s� �l�o�n�g� �a�s� �t�h�e� �s�o�u�r�c�e� �/�/� �c�o�d�e� �i�s� �a�l�w�a�y�s� �m�a�d�e� �f�r�e�e�l�y� �a�v�a�i�l�a�b�l�e�.� �/�/� �P�l�e�a�s�e� �r�e�f�e�r� �t�o� �t�h�e� �G�e�n�e�r�a�l� �P�u�b�l�i�c� �L�i�c�e�n�c�e� �h�t�t�p�:�/�/�w�w�w�.�g�n�u�.�o�r�g�/� �/�/� �/�/� � � �/�/�L�o�c�a�l�i�z�e�d� �v�e�r�s�i�o�n�s� �o�f� �I�n�f�o�.�p�l�i�s�t� �k�e�y�s� �N�S�H�u�m�a�n�R�e�a�d�a�b�l�e�C�o�p�y�r�i�g�h�t� �=� �"�O�C�S� �I�n�v�e�n�t�o�r�y� �N�G� �T�e�a�m�,� �2�0�1�1�"�;� �I�n�s�t�a�l�l�e�r�S�e�c�t�i�o�n�T�i�t�l�e� �=� �"�C�o�n�f�i�g�u�r�a�t�i�o�n�"�;� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������UnixAgent-2.4.2/tools/macosx/installer_gui/ocs_agent_config/French.lproj/Localizable.strings��������0000664�0000000�0000000�00000005364�13327377321�0032411�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/�/� �/�/� �O�C�S�I�N�V�E�N�T�O�R�Y�-�N�G� �/�/� �/�/� �C�o�p�y�l�e�f�t� �G�u�i�l�l�a�u�m�e� �P�R�O�T�E�T� �2�0�1�1� �/�/� � �/�/� �/�/� �T�h�i�s� �c�o�d�e� �i�s� �o�p�e�n� �s�o�u�r�c�e� �a�n�d� �m�a�y� �b�e� �c�o�p�i�e�d� �a�n�d� �m�o�d�i�f�i�e�d� �a�s� �l�o�n�g� �a�s� �t�h�e� �s�o�u�r�c�e� �/�/� �c�o�d�e� �i�s� �a�l�w�a�y�s� �m�a�d�e� �f�r�e�e�l�y� �a�v�a�i�l�a�b�l�e�.� �/�/� �P�l�e�a�s�e� �r�e�f�e�r� �t�o� �t�h�e� �G�e�n�e�r�a�l� �P�u�b�l�i�c� �L�i�c�e�n�c�e� �h�t�t�p�:�/�/�w�w�w�.�g�n�u�.�o�r�g�/� �/�/� �/�/� � �/�/� �L�o�c�a�l�i�z�e�d� �v�e�r�s�i�o�n�s� �o�f� �I�n�f�o�.�p�l�i�s�t� �k�e�y�s� �P�a�n�e�T�i�t�l�e� �=� �"�C�o�n�f�i�g�u�r�a�t�i�o�n� �d�e� �l�'�a�g�e�n�t� �O�C�S�"�;� � �/�/�Y�e�s� �b�u�t�t�o�n� �"�Y�e�s�"� �=� �"�O�u�i�"�;� � �/�/�N�o� �b�u�t�t�o�n� �"�N�o�"� �=� �"�N�o�n�"�;� � �/�/�W�a�r�n�i�n�g� �a�b�o�u�t� �a�l�r�e�a�d�y� �e�x�i�s�t�i�n�g� �c�o�f�i�g�u�r�a�t�i�o�n� �f�i�l�e� �"�A�l�r�e�a�d�y�_�c�o�n�f�_�w�a�r�n�"� �=� �"�L�e� �f�i�c�h�i�e�r� �d�e� �c�o�n�f�i�g�u�r�a�t�i�o�n� �d�e� �l�'�a�g�e�n�t� �O�C�S� �s�e�m�b�l�e� �d��j�� �e�x�i�s�t�e�r�.� �V�o�u�l�e�z�-�v�o�u�s� �p�r�o�c��d�e�r� �� �l�a� �c�o�n�f�i�g�u�r�a�t�i�o�n� �d�e� �l�'�a�g�e�n�t� �O�C�S� �I�n�v�e�n�t�o�r�y� �N�G� �?�"�;� � �/�/�W�a�r�n�i�n�g� �a�b�o�u�t� �a�l�r�e�a�d�y� �e�x�i�s�t�i�n�g� �c�o�f�i�g�u�r�a�t�i�o�n� �f�i�l�e� �c�o�m�m�e�n�t� �"�A�l�r�e�a�d�y�_�c�o�n�f�_�w�a�r�n�_�c�o�m�m�e�n�t�"� �=� �"�L�e� �f�i�c�h�i�e�r� �/�e�t�c�/�o�c�s�i�n�v�e�n�t�o�r�y�-�a�g�e�n�t�/�o�c�s�i�n�v�e�n�t�o�r�y�-�a�g�e�n�t�.�c�f�g� �s�e�r�a� ��c�r�a�s��"�;� � �/�/�W�a�r�n�i�n�g� �a�b�o�u�t� �m�i�s�s�i�n�g� �c�e�r�t�i�f�i�c�a�t�e� �f�i�l�e� �"�M�i�s�s�i�n�g�_�c�e�r�t�_�w�a�r�n�"� �=� �"�V�o�u�s� �a�v�e�z� �a�c�t�i�v�� �l�a� �f�o�n�c�t�i�o�n�n�a�l�i�t�� �d�e� �t��l��-�d��p�l�o�i�e�m�e�n�t� �e�t� �l�a� �v��r�i�f�i�c�a�t�i�o�n� �d�u� �c�e�r�t�i�f�i�c�a�t� �S�S�L� �m�a�i�s� �v�o�u�s� �n�'�a�v�e�z� �p�a�s� �s�p��c�i�f�i�� �d�e� �f�i�c�h�i�e�r� �c�e�r�t�i�f�i�c�a�t�"�;� � �/�/�W�a�r�n�i�n�g� �a�b�o�u�t� �m�i�s�s�i�n�g� �c�e�r�t�i�f�i�c�a�t�e� �f�i�l�e� �c�o�m�m�e�n�t� �"�M�i�s�s�i�n�g�_�c�e�r�t�_�w�a�r�n�_�c�o�m�m�e�n�t�"� �=� �"�S�i� �v�o�u�s� �n�e� �s�p��c�i�f�i�e�z� �p�a�s� �d�e� �f�i�c�h�i�e�r� �c�e�r�t�i�f�i�c�a�t�,� �l�a� �f�o�n�c�t�i�o�n�n�a�l�i�t�� �d�e� �t��l��-�d��p�l�o�i�m�e�n�t� �n�e� �f�o�n�c�t�i�o�n�n�e�r�a� �p�a�s�"�;� � �/�/�W�a�r�n�i�n�g� �a�b�o�u�t� �i�n�v�a�l�i�d� �s�e�r�v�e�r� �a�d�d�r�e�s�s� �"�I�n�v�a�l�i�d�_�s�r�v�_�a�d�d�r�"� �=� �"�A�d�r�e�s�s�e� �d�u� �s�e�r�v�e�r� �O�C�S� �i�n�v�a�l�i�d�e�"�;� � �/�/�W�a�r�n�i�n�g� �a�b�o�u�t� �i�n�v�a�l�i�d� �s�e�r�v�e�r� �a�d�d�r�e�s�s� �c�o�m�m�e�n�t� �"�I�n�v�a�l�i�d�_�s�r�v�_�a�d�d�r�_�c�o�m�m�e�n�t�"� �=� �"�V�e�u�i�l�l�e�z� �s�a�i�s�i�r� �d�e� �n�o�u�v�e�a�u� �l�'�a�d�r�e�s�s�e� �d�u� �s�e�r�v�e�u�r� �O�C�S�"�;�����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������UnixAgent-2.4.2/tools/macosx/installer_gui/ocs_agent_config/French.lproj/ocs_agent_config.nib/������0000775�0000000�0000000�00000000000�13327377321�0032603�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������designable.nib��������������������������������������������������������������������������������������0000664�0000000�0000000�00000032766�13327377321�0035331�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�UnixAgent-2.4.2/tools/macosx/installer_gui/ocs_agent_config/French.lproj/ocs_agent_config.nib��������������������������������������������������������������������������<?xml version="1.0" encoding="UTF-8"?> <document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="13196" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none"> <dependencies> <deployment version="1060" identifier="macosx"/> <plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="13196"/> <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/> </dependencies> <objects> <customObject id="-2" userLabel="File's Owner" customClass="InstallerSection"> <connections> <outlet property="firstPane" destination="5" id="6"/> </connections> </customObject> <customObject id="-1" userLabel="First Responder" customClass="FirstResponder"/> <customObject id="-3" userLabel="Application"/> <customObject id="5" userLabel="ocs_agent_configPane" customClass="ocs_agent_configPane"> <connections> <outlet property="cacertfile" destination="56" id="71"/> <outlet property="contentView" destination="8" id="9"/> <outlet property="debugmode" destination="64" id="65"/> <outlet property="download" destination="94" id="99"/> <outlet property="lazymode" destination="100" id="104"/> <outlet property="logfile" destination="29" id="72"/> <outlet property="protocolist" destination="33" id="77"/> <outlet property="server" destination="10" id="73"/> <outlet property="ssl" destination="105" id="107"/> <outlet property="tag" destination="14" id="70"/> </connections> </customObject> <customView id="8" userLabel="View"> <rect key="frame" x="0.0" y="0.0" width="450" height="360"/> <autoresizingMask key="autoresizingMask"/> <subviews> <textField verticalHuggingPriority="750" id="79"> <rect key="frame" x="17" y="316" width="429" height="34"/> <autoresizingMask key="autoresizingMask"/> <textFieldCell key="cell" sendsActionOnEndEditing="YES" title="Paramétrez la configuration de votre Agent OCS Inventory MacOSX" id="93"> <font key="font" metaFont="system"/> <color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/> <color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/> </textFieldCell> </textField> <button imageHugsTitle="YES" id="64"> <rect key="frame" x="263" y="195" width="103" height="18"/> <autoresizingMask key="autoresizingMask"/> <buttonCell key="cell" type="check" title="Mode Debug" bezelStyle="regularSquare" imagePosition="leading" alignment="left" inset="2" id="92"> <behavior key="behavior" changeContents="YES" doesNotDimImage="YES" lightByContents="YES"/> <font key="font" metaFont="system"/> </buttonCell> </button> <textField verticalHuggingPriority="750" misplaced="YES" id="63"> <rect key="frame" x="18" y="49" width="407" height="23"/> <autoresizingMask key="autoresizingMask"/> <textFieldCell key="cell" sendsActionOnEndEditing="YES" title="Fichier certificat (nécessaire pour le télé-déploiement) :" id="91"> <font key="font" metaFont="system"/> <color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/> <color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/> </textFieldCell> </textField> <textField verticalHuggingPriority="750" misplaced="YES" id="56"> <rect key="frame" x="20" y="20" width="269" height="22"/> <autoresizingMask key="autoresizingMask"/> <textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" selectable="YES" sendsActionOnEndEditing="YES" state="on" borderStyle="bezel" drawsBackground="YES" id="89"> <font key="font" metaFont="system"/> <color key="textColor" name="textColor" catalog="System" colorSpace="catalog"/> <color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/> </textFieldCell> </textField> <button verticalHuggingPriority="750" misplaced="YES" imageHugsTitle="YES" id="59"> <rect key="frame" x="301" y="13" width="97" height="32"/> <autoresizingMask key="autoresizingMask"/> <buttonCell key="cell" type="push" title="Parcourir" bezelStyle="rounded" alignment="center" borderStyle="border" inset="2" id="90"> <behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/> <font key="font" metaFont="system"/> </buttonCell> <connections> <action selector="chooseCacertFile:" target="5" id="66"/> </connections> </button> <popUpButton verticalHuggingPriority="750" imageHugsTitle="YES" id="33"> <rect key="frame" x="17" y="252" width="98" height="26"/> <autoresizingMask key="autoresizingMask"/> <popUpButtonCell key="cell" type="push" bezelStyle="rounded" alignment="left" lineBreakMode="truncatingTail" state="on" borderStyle="borderAndBezel" inset="2" arrowPosition="arrowAtCenter" preferredEdge="maxY" selectedItem="36" id="88"> <behavior key="behavior" lightByBackground="YES" lightByGray="YES"/> <font key="font" metaFont="system"/> <menu key="menu" title="OtherViews" id="34"> <items> <menuItem state="on" id="36"/> <menuItem title="Item2" id="37"/> <menuItem title="Item3" id="35"/> </items> </menu> </popUpButtonCell> <connections> <action selector="chooseProtocol:" target="5" id="76"/> </connections> </popUpButton> <textField verticalHuggingPriority="750" id="30"> <rect key="frame" x="17" y="202" width="191" height="34"/> <autoresizingMask key="autoresizingMask"/> <textFieldCell key="cell" sendsActionOnEndEditing="YES" title="Chemin du fichier de logs :" id="87"> <font key="font" metaFont="system"/> <color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/> <color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/> </textFieldCell> </textField> <textField verticalHuggingPriority="750" id="29"> <rect key="frame" x="20" y="189" width="185" height="22"/> <autoresizingMask key="autoresizingMask"/> <textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" selectable="YES" editable="YES" sendsActionOnEndEditing="YES" state="on" borderStyle="bezel" drawsBackground="YES" id="86"> <font key="font" metaFont="system"/> <color key="textColor" name="textColor" catalog="System" colorSpace="catalog"/> <color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/> </textFieldCell> </textField> <textField verticalHuggingPriority="750" id="15"> <rect key="frame" x="17" y="133" width="191" height="34"/> <autoresizingMask key="autoresizingMask"/> <textFieldCell key="cell" sendsActionOnEndEditing="YES" title="Valeur du TAG (optionnel):" id="84"> <font key="font" metaFont="system"/> <color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/> <color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/> </textFieldCell> </textField> <textField verticalHuggingPriority="750" id="14"> <rect key="frame" x="19" y="120" width="146" height="22"/> <autoresizingMask key="autoresizingMask"/> <textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" selectable="YES" editable="YES" sendsActionOnEndEditing="YES" state="on" borderStyle="bezel" drawsBackground="YES" id="83"> <font key="font" metaFont="system"/> <color key="textColor" name="textColor" catalog="System" colorSpace="catalog"/> <color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/> </textFieldCell> </textField> <textField verticalHuggingPriority="750" id="13"> <rect key="frame" x="120" y="286" width="178" height="17"/> <autoresizingMask key="autoresizingMask"/> <textFieldCell key="cell" sendsActionOnEndEditing="YES" title="URL du serveur OCS:" id="82"> <font key="font" metaFont="system"/> <color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/> <color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/> </textFieldCell> </textField> <textField verticalHuggingPriority="750" id="10"> <rect key="frame" x="117" y="256" width="146" height="22"/> <autoresizingMask key="autoresizingMask"/> <textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" selectable="YES" editable="YES" sendsActionOnEndEditing="YES" state="on" borderStyle="bezel" drawsBackground="YES" id="81"> <font key="font" metaFont="system"/> <color key="textColor" name="textColor" catalog="System" colorSpace="catalog"/> <color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/> </textFieldCell> </textField> <button imageHugsTitle="YES" id="94"> <rect key="frame" x="263" y="163" width="146" height="30"/> <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/> <buttonCell key="cell" type="check" title="Télé-déploiement" bezelStyle="regularSquare" imagePosition="leading" alignment="left" inset="2" id="95"> <behavior key="behavior" changeContents="YES" doesNotDimImage="YES" lightByContents="YES"/> <font key="font" metaFont="system"/> </buttonCell> </button> <button imageHugsTitle="YES" id="100"> <rect key="frame" x="263" y="143" width="103" height="18"/> <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/> <buttonCell key="cell" type="check" title="Mode Lazy" bezelStyle="regularSquare" imagePosition="leading" alignment="left" inset="2" id="101"> <behavior key="behavior" changeContents="YES" doesNotDimImage="YES" lightByContents="YES"/> <font key="font" metaFont="system"/> </buttonCell> </button> <button imageHugsTitle="YES" id="105"> <rect key="frame" x="263" y="118" width="173" height="18"/> <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/> <buttonCell key="cell" type="check" title="Vérification SSL" bezelStyle="regularSquare" imagePosition="leading" alignment="left" inset="2" id="106"> <behavior key="behavior" changeContents="YES" doesNotDimImage="YES" lightByContents="YES"/> <font key="font" metaFont="system"/> </buttonCell> </button> <textField verticalHuggingPriority="750" misplaced="YES" id="28"> <rect key="frame" x="271" y="258" width="95" height="17"/> <autoresizingMask key="autoresizingMask"/> <textFieldCell key="cell" sendsActionOnEndEditing="YES" id="85"> <font key="font" metaFont="system"/> <string key="title">/ocsinventory </string> <color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/> <color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/> </textFieldCell> </textField> </subviews> </customView> </objects> </document> ����������keyedobjects.nib������������������������������������������������������������������������������������0000664�0000000�0000000�00000033706�13327377321�0035702�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�UnixAgent-2.4.2/tools/macosx/installer_gui/ocs_agent_config/French.lproj/ocs_agent_config.nib��������������������������������������������������������������������������bplist00������X$versionX$objectsY$archiverT$top�����#�$�*�.�2�B�J�M�N�O�S�X�l�u�v������������������������   3489<=@CLMUV_`hirs|� !$()*-.4=>GHLOSVabcmnwxE}�j��U$null� � � � � �����������������VNSRoot]NSConnections\NSOidsValues_NSObjectsValues]NSObjectsKeys_NSAccessibilityOidsValues_NSVisibleWindows_NSAccessibilityOidsKeys_NSAccessibilityConnectorsV$classZNSOidsKeys׀׀ր؀� ��!�"[NSClassName_InstallerSection�%�&�'�(Z$classnameX$classes^NSCustomObject�'�)XNSObject�+��,�-ZNS.objects�%�&�/�0\NSMutableSet�/�1�)UNSSet�+��3�A�4�5�6�7�8�9�:�;�<�=�>�?�@ %l�C�D�E���G�H�IXNSSource]NSDestinationWNSLabel � ��K�" _ocs_agent_configPaneYfirstPane�%�&�P�Q_NSNibOutletConnector�P�R�)^NSNibConnector�C�D�E��G�U�V�I $ �Y�Z�[��\�]�^�_�`�a�b�c�d�e�f�f�h�i�j�kVNSCellWNSFrame_NSAllowsLogicalLayoutDirection_NSNextResponder[NSSuperviewXNSvFlags]NSNibTouchBar_%NSTextFieldAlignmentRectInsetsVersionYNSEnabled#�� �� �m�\�^�_�n�o�p�q�i�h�i�tZNSSubviews[NSFrameSize&��_{{20, 20}, {269, 22}}�w�x��y�z�{�|�}�~��U���k����[NSCellFlags]NSControlViewYNSSupport_NSDrawsBackground_NSBackgroundColorZNSContents[NSTextColor\NSCellFlags2p�A" @�P��������VNSSizeXNSfFlagsVNSName#@*������_.AppleSystemUIFont�%�&��VNSFont��)����������[NSColorName\NSColorSpace]NSCatalogNameWNSColorVSystem_textBackgroundColor����������WNSWhite\NSComponents_NSCustomColorSpaceB1�C1 1��������TNSIDUNSICCWNSModel �����WNS.dataOh��happl���mntrGRAYXYZ ����.�acspAPPL����none�����������������������-appl�����������������������������������������������desc������ydscm��<��cprt�� $���#wtpt�� H���kTRC�� \�� desc�������Generic Gray Gamma 2.2 Profile����������������������������������������������������������������������������������mluc���������� skSK���.��daDK���8��caES���8��viVN���@��"ptBR���J��bukUA���,��frFU���>��huHU���4��zhTW�����JnbNO���:��hcsCZ���(��heIL���$��itIT���N��roRO���*��<deDE���N��fkoKR���"��svSE���8��zhCN�����jaJP���&��elGR���*��ptPO���R��DnlNL���@��esES���L��thTH���2��"trTR���$��TfiFI���F��xhrHR���>��plPL���J��ruRU���:��FenUS���<��arEG���,���Va�e�o�b�e�c�n�� �s�i�v�� �g�a�m�a� �2�,�2�G�e�n�e�r�i�s�k� �g�r�� �2�,�2� �g�a�m�m�a�p�r�o�f�i�l�G�a�m�m�a� �d�e� �g�r�i�s�o�s� �g�e�n��r�i�c�a� �2�.�2�C�u� �h��n�h� �M��u� �x��m� �C�h�u�n�g� �G�a�m�m�a� �2�.�2�P�e�r�f�i�l� �G�e�n��r�i�c�o� �d�a� �G�a�m�a� �d�e� �C�i�n�z�a�s� �2�,�2030;L=0� �G�r�a�y�-30<0� �2�.�2�P�r�o�f�i�l� �g��n��r�i�q�u�e� �g�r�i�s� �g�a�m�m�a� �2�,�2��l�t�a�l��n�o�s� �s�z��r�k�e� �g�a�m�m�a� �2�.�2u(ppQI^� �2�.�2� r_icϏ�G�e�n�e�r�i�s�k� �g�r�� �g�a�m�m�a� �2�,�2�-�p�r�o�f�i�l�O�b�e�c�n�� a�e�d�� �g�a�m�a� �2�.�2� � � �2�.�2�P�r�o�f�i�l�o� �g�r�i�g�i�o� �g�e�n�e�r�i�c�o� �d�e�l�l�a� �g�a�m�m�a� �2�,�2�G�a�m�a� �g�r�i� �g�e�n�e�r�i�c� �2�,�2�A�l�l�g�e�m�e�i�n�e�s� �G�r�a�u�s�t�u�f�e�n�-�P�r�o�f�i�l� �G�a�m�m�a� �2�,�2|� ֌� � �2�.�2� \ |fnpp^|ep� �2�.�2� cϏeNN�,000000� �2�.�2� 000000� � � �2�.�2�P�e�r�f�i�l� �g�e�n��r�i�c�o� �d�e� �c�i�n�z�e�n�t�o�s� �d�a� �G�a�m�m�a� �2�,�2�A�l�g�e�m�e�e�n� �g�r�i�j�s� �g�a�m�m�a� �2�,�2�-�p�r�o�f�i�e�l�P�e�r�f�i�l� �g�e�n��r�i�c�o� �d�e� �g�a�m�m�a� �d�e� �g�r�i�s�e�s� �2�,�2#1*5A!!2@#"L1H'D� �2�.�2�G�e�n�e�l� �G�r�i� �G�a�m�a� �2�,�2�Y�l�e�i�n�e�n� �h�a�r�m�a�a�n� �g�a�m�m�a� �2�,�2� �-�p�r�o�f�i�i�l�i�G�e�n�e�r�i �k�i� �G�r�a�y� �G�a�m�m�a� �2�.�2� �p�r�o�f�i�l�U�n�i�w�e�r�s�a�l�n�y� �p�r�o�f�i�l� �s�z�a�r�o[�c�i� �g�a�m�m�a� �2�,�21I0O� A5@0O� 30<<0� �2�,�2�-?@>D8;L�G�e�n�e�r�i�c� �G�r�a�y� �G�a�m�m�a� �2�.�2� �P�r�o�f�i�l�e:'E'� �2�.�2� DHF� 1E'/J� 9'Etext����Copyright Apple Inc., 2012��XYZ ������Q����curv����������� �����#�(�-�2�7�;�@�E�J�O�T�Y�^�c�h�m�r�w�|������������������������� %+28>ELRY`gnu| &/8AKT]gqz� !-8COZfr~ -;HUcq~ +:IXgw'7HYj{+=Oat 2FZn  % : O d y  ' = T j " 9 Q i  * C \ u & @ Z t .Id %A^z &Ca~1Om&Ed#Cc'Ij4Vx&IlAe@e Ek*Qw;c*R{Gp@j>i  A l !!H!u!!!"'"U"""# #8#f###$$M$|$$% %8%h%%%&'&W&&&''I'z''( (?(q(())8)k))**5*h**++6+i++,,9,n,,- -A-v--..L.../$/Z///050l0011J1112*2c223 3F3334+4e4455M555676r667$7`7788P8899B999:6:t::;-;k;;<'<e<<="=a==> >`>>?!?a??@#@d@@A)AjAAB0BrBBC:C}CDDGDDEEUEEF"FgFFG5G{GHHKHHIIcIIJ7J}JK KSKKL*LrLMMJMMN%NnNO�OIOOP'PqPQQPQQR1R|RSS_SSTBTTU(UuUVV\VVWDWWX/X}XYYiYZZVZZ[E[[\5\\]']x]^^l^__a_``W``aOaabIbbcCccd@dde=eef=ffg=ggh?hhiCiijHjjkOkklWlmm`mnnknooxop+ppq:qqrKrss]sttptu(uuv>vvwVwxxnxy*yyzFz{{c{|!||}A}~~b~#G k͂0WGrׇ;iΉ3dʋ0cʍ1fΏ6n֑?zM _ɖ4 uL$h՛BdҞ@iءG&vVǥ8nRĩ7u\ЭD-�u`ֲK³8%yhYѹJº;.! zpg_XQKFAǿ=ȼ:ɹ8ʷ6˶5̵5͵6ζ7ϸ9к<Ѿ?DINU\dlvۀ܊ݖޢ)߯6DScs 2F[p(@Xr4Pm8Ww)Km�%�&��]NSMutableData���)VNSData�%�&��\NSColorSpace��)\NSColorSpace�%�&��WNSColor��)����������ŀ !YtextColor����������B0�C0 1�%�&��_NSTextFieldCell����)\NSActionCellVNSCell�%�&��[NSTextField�����)YNSControlVNSView[NSResponderZcacertfile�C�D�E��G�f��I  �+���A�������������U���'0:>BEILPSWpuy}l�Y�Z�[��\�]�^�_�`�a���d�e�f�f�h�i�j�k)(#� _{{271, 258}, {95, 17}}�w�x��y�{�}�|�~���������'"+.*@��^/ocsinventory ��������,-\controlColor�����  ���L0.602715373�N0.6666666667 1���������ŀ/!_controlTextColor�Y�Z�[��\�]�^�_�a�d�f�f�i�k219 � _{{263, 118}, {173, 18}}!�w"#$�~%�x�|��y&'(�)�+�,�./�12_NSPeriodicInterval]NSButtonFlags_NSAlternateContents_NSKeyEquivalent_NSAlternateImage_NSPeriodicDelay^NSButtonFlags2KH8Q 74038o�V��r�i�f�i�c�a�t�i�o�n� �S�S�L5�67[NSImageName56XNSSwitch�%�&:;_NSButtonImageSource:�)P�%�&>?\NSButtonCell>���)�%�&ABXNSButtonA����)�Y�Z�[��\�]�^�_�aDE�d�f�f�i�k<;9� _{{263, 143}, {103, 18}}!�w"#$�~%�x�|��y&'(�)�+�,�R/�1274:=8YMode Lazy�Y�Z�[��\�]�^�_�aWX�d�f�f�i�k@?9� _{{263, 163}, {146, 30}}!�w"#$�~%�x�|��y&'(�)�+�,�e/�1274>A8o�T��l��-�d��p�l�o�i�e�m�e�n�t�Y�Z�[��\�]�^�_�`�ajk�d�e�f�f�h�i�j�kDC#� _{{117, 256}, {146, 22}}�w�x��y�z�{�|�}�~t����k����p�AB" �Y�Z�[��\�]�^�_�`�a}~�d�e�f�f�h�i�j�kGF#� _{{120, 286}, {178, 17}}�w�x��y�{�}�|�~������E"+.H_URL du serveur OCS:�Y�Z�[��\�]�^�_�`�a�d�e�f�f�h�i�j�kKJ#� _{{19, 120}, {146, 22}}�w�x��y�z�{�|�}�~t����k����I" �Y�Z�[��\�]�^�_�`�a�d�e�f�f�h�i�j�kNM#� _{{17, 133}, {191, 34}}�w�x��y�{�}�|�~������L"+.O_Valeur du TAG (optionnel):�Y�Z�[��\�]�^�_�`�a�d�e�f�f�h�i�j�kRQ#� _{{20, 189}, {185, 22}}�w�x��y�z�{�|�}�~t����k����P" �Y�Z�[��\�]�^�_�`�a�d�e�f�f�h�i�j�kUT#� _{{17, 202}, {191, 34}}�w�x��y�{�}�|�~������S"+.V_Chemin du fichier de logs :�Y�Z�[��\�]�^�_�a�d�f�f�h�i�kYXo� _{{17, 252}, {98, 26}}!�w#"$%�x�~�y&�'(��+��k1�k�k_NSPreferredEdgeZNSMenuItem_NSMenuItemRespectAlignmentVNSMenu_NSUsesItemFromMenu]NSAltersState_NSArrowPosition@�@\@ 7[W� ]Z n���������������    ��]NSMnemonicLoc_NSKeyEquivModMaskXNSActionYNSOnImageZNSKeyEquivXNSTargetWNSTitleWNSState\NSMixedImage]���d^eYb�[NSMenuItemsfgm�[NSClassName^NSResourceName_a`WNSImage_NSMenuCheckmark�%�&"#_NSCustomResource"�)�'_ac_NSMenuMixedState__popUpItemAction:�%�&+,ZNSMenuItem+�)ZOtherViews�+�/�A12\hjl�   �: ]e^YidbUItem2�   �D ]e^YkdbUItem3�%�&IJ^NSMutableArrayIK�)WNSArray�%�&MNVNSMenuM�)�%�&PQ_NSPopUpButtonCellPR>���)^NSMenuItemCell�%�&TU]NSPopUpButtonTA����)�Y�Z�[W��\�]�^�_�aXY�d[�f�f�h�i�k_NSHuggingPrioritysqr9� _{{301, 13}, {97, 32}}Z{250, 750}!�w"#$�~%�x�|��y&'(�d�+g�j/�1@ 7���[pt8YParcourir�Y�Z�[��\�]�^�_�`�aop�d�e�f�f�h�i�j�kwv#� _{{18, 49}, {407, 23}}�w�x��y�{�}�|�~������~u"+.xo:�F�i�c�h�i�e�r� �c�e�r�t�i�f�i�c�a�t� �(�n��c�e�s�s�a�i�r�e� �p�o�u�r� �l�e� �t��l��-�d��p�l�o�i�e�m�e�n�t�)� �:�Y�Z�[��\�]�^�_�a�d�f�f�h�i�k{z9� _{{263, 195}, {103, 18}}!�w"#$�~%�x�|��y&'(�)�+�,�/�1274y|8ZMode Debug�Y�Z�[��\�]�^�_�`�a�d�e�f�f�h�i�j�k~#� _{{17, 316}, {429, 34}}�w�x��y�{�}�|�~������}"+.o?�P�a�r�a�m��t�r�e�z� �l�a� �c�o�n�f�i�g�u�r�a�t�i�o�n� �d�e� �v�o�t�r�e� �A�g�e�n�t� �O�C�S� �I�n�v�e�n�t�o�r�y� �M�a�c�O�S�XZ{450, 360}VNSView�%�&\NSCustomView���)[contentView�C�D�E��G��I y Ydebugmode�C�D�E��G��I > Xdownload�C�D�E��G��I : Xlazymode�C�D�E��G��I P Wlogfile�C�D�E��G��I W [protocolist�C�D�E��G��I B Vserver�C�D�E��G��I 0 Sssl�C�D�E��G��I I Stag�C�D�E���G߀W _chooseProtocol:�%�&_NSNibControlConnector�)^NSNibConnector�C�D�E���G߀p _chooseCacertFile:�+�'�G�f���o�U�b�X�12�����}�j�W�D���񀛀 }y{uwpsWY]\hjSUPRLNIKEGBD>@:<02')� ��"]NSApplication�%�&KK�)�+�'����f��f��f��f�U�f��f��f��f��f��f��f��f��f��f��f��f�߀}yupWY]]]SPLIEB>:0'�+�F5��G�f���o�U�b�X�12�����}�j�W�D����4�5�6�7�8�9�:�;�<�=�>�?�@ }y{uwpsWY]\hjSUPRLNIKEGBD>@:<02') %�+�~5€ÀĀŀƀǀȀɀʀˀ̀̀΀πЀрҀӀԀՀ      !"#$%&'()*+,-./012345�+��Al�+��%�&^NSIBObjectData�)_NSKeyedArchiver_IB.systemFontUpdateVersion]IB.objectdata���"�+�5�:�?'.<I[i  "+6?NS\epqs|  2<E\cr AKMOPRTVY[]^{'2>KTVXZ[]_afgx 4IQ^svz|~)+4BIPYfkx "-7>JUfhjlnw -2468:<>CRgikmo|   1f{"+79;DMchir')+-/135?dfhikmoqr "$&()Chqsuwxz|~  ; = ? @ B D F H I b !!! ! ! !!!.!W!Y![!\!^!`!b!d!e!~!!!!!!!!!!!!!!!!!"�"!"#"%"'")"+"-"K"p"r"t"u"w"y"{"}"~"""###&#;#I#[#d#f#h#m#o#q#s#v#w#y#{#|#}#############$$ $$$($0$8$E$J$L$Q$S$U$W$Y$[$]$_$l$x$z$|$~$$$$$$$$$$$$$$$% %!%*%5%:%E%N%U%W%Y%[%]%%%%%%%%%%%%%%%%%%%%%%%&& &&& &4&A&P&Y&g&t&&&&&&&&&&&&&''"'$'&'+'-'/'1'3'5'?'h'j'l'm'o'q's'u'v''''''''(2(W(Y([(\(^(`(b(d(e(((((((((((((((()))))>)@)B)D)F)H)J))))))******!*+*<*>*@*B*D*M*^*`*b*d*f*o************************++++ + ++ +"+$+&+(+:+C+[+b+q+++++++++++,�,,,,, , ,,,,,,,,,, ,",$,&,(,*,,,.,0,2,4,6,8,:,<,>,@,B,D,F,H,Q,S,U,c,l,q,z,,,,,,,,,,,,,,,,,,,,,,,,,,,----- - - --------$-------------------------------------------------------..s.u.w.y.{.}.................................................................///// / / //////////!/#/%/'/)/+/-///1/3/5/7/9/;/=/?/A/J/K/M/V/W/Y/b/q/v////��������������������������/����������������������������������������������������������UnixAgent-2.4.2/tools/macosx/installer_gui/ocs_agent_config/Info.plist������������������������������0000664�0000000�0000000�00000001724�13327377321�0026167�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict> <key>CFBundleDevelopmentRegion</key> <string>English</string> <key>CFBundleExecutable</key> <string>${EXECUTABLE_NAME}</string> <key>CFBundleIconFile</key> <string></string> <key>CFBundleIdentifier</key> <string>$(PRODUCT_BUNDLE_IDENTIFIER)</string> <key>CFBundleInfoDictionaryVersion</key> <string>6.0</string> <key>CFBundleName</key> <string>Configuration</string> <key>CFBundlePackageType</key> <string>BNDL</string> <key>CFBundleShortVersionString</key> <string>1.0.01</string> <key>CFBundleSignature</key> <string>????</string> <key>CFBundleVersion</key> <string>2.3</string> <key>InstallerSectionTitle</key> <string>Configuration</string> <key>NSMainNibFile</key> <string>ocs_agent_config</string> <key>NSPrincipalClass</key> <string>InstallerSection</string> </dict> </plist> ��������������������������������������������UnixAgent-2.4.2/tools/macosx/installer_gui/ocs_agent_config/InstallerSections.plist�����������������0000664�0000000�0000000�00000000702�13327377321�0030734�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict> <key>SectionOrder</key> <array> <string>Introduction</string> <string>ReadMe</string> <string>License</string> <string>Configuration</string> <string>Target</string> <string>PackageSelection</string> <string>Install</string> </array> </dict> </plist> ��������������������������������������������������������������UnixAgent-2.4.2/tools/macosx/installer_gui/ocs_agent_config/ocs_agent_config.xcodeproj/�������������0000775�0000000�0000000�00000000000�13327377321�0031476�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������UnixAgent-2.4.2/tools/macosx/installer_gui/ocs_agent_config/ocs_agent_config.xcodeproj/ocs.mode1v3��0000664�0000000�0000000�00000116671�13327377321�0033476�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict> <key>ActivePerspectiveName</key> <string>Project</string> <key>AllowedModules</key> <array> <dict> <key>BundleLoadPath</key> <string></string> <key>MaxInstances</key> <string>n</string> <key>Module</key> <string>PBXSmartGroupTreeModule</string> <key>Name</key> <string>Groups and Files Outline View</string> </dict> <dict> <key>BundleLoadPath</key> <string></string> <key>MaxInstances</key> <string>n</string> <key>Module</key> <string>PBXNavigatorGroup</string> <key>Name</key> <string>Editor</string> </dict> <dict> <key>BundleLoadPath</key> <string></string> <key>MaxInstances</key> <string>n</string> <key>Module</key> <string>XCTaskListModule</string> <key>Name</key> <string>Task List</string> </dict> <dict> <key>BundleLoadPath</key> <string></string> <key>MaxInstances</key> <string>n</string> <key>Module</key> <string>XCDetailModule</string> <key>Name</key> <string>File and Smart Group Detail Viewer</string> </dict> <dict> <key>BundleLoadPath</key> <string></string> <key>MaxInstances</key> <string>1</string> <key>Module</key> <string>PBXBuildResultsModule</string> <key>Name</key> <string>Detailed Build Results Viewer</string> </dict> <dict> <key>BundleLoadPath</key> <string></string> <key>MaxInstances</key> <string>1</string> <key>Module</key> <string>PBXProjectFindModule</string> <key>Name</key> <string>Project Batch Find Tool</string> </dict> <dict> <key>BundleLoadPath</key> <string></string> <key>MaxInstances</key> <string>n</string> <key>Module</key> <string>XCProjectFormatConflictsModule</string> <key>Name</key> <string>Project Format Conflicts List</string> </dict> <dict> <key>BundleLoadPath</key> <string></string> <key>MaxInstances</key> <string>n</string> <key>Module</key> <string>PBXBookmarksModule</string> <key>Name</key> <string>Bookmarks Tool</string> </dict> <dict> <key>BundleLoadPath</key> <string></string> <key>MaxInstances</key> <string>n</string> <key>Module</key> <string>PBXClassBrowserModule</string> <key>Name</key> <string>Class Browser</string> </dict> <dict> <key>BundleLoadPath</key> <string></string> <key>MaxInstances</key> <string>n</string> <key>Module</key> <string>PBXCVSModule</string> <key>Name</key> <string>Source Code Control Tool</string> </dict> <dict> <key>BundleLoadPath</key> <string></string> <key>MaxInstances</key> <string>n</string> <key>Module</key> <string>PBXDebugBreakpointsModule</string> <key>Name</key> <string>Debug Breakpoints Tool</string> </dict> <dict> <key>BundleLoadPath</key> <string></string> <key>MaxInstances</key> <string>n</string> <key>Module</key> <string>XCDockableInspector</string> <key>Name</key> <string>Inspector</string> </dict> <dict> <key>BundleLoadPath</key> <string></string> <key>MaxInstances</key> <string>n</string> <key>Module</key> <string>PBXOpenQuicklyModule</string> <key>Name</key> <string>Open Quickly Tool</string> </dict> <dict> <key>BundleLoadPath</key> <string></string> <key>MaxInstances</key> <string>1</string> <key>Module</key> <string>PBXDebugSessionModule</string> <key>Name</key> <string>Debugger</string> </dict> <dict> <key>BundleLoadPath</key> <string></string> <key>MaxInstances</key> <string>1</string> <key>Module</key> <string>PBXDebugCLIModule</string> <key>Name</key> <string>Debug Console</string> </dict> <dict> <key>BundleLoadPath</key> <string></string> <key>MaxInstances</key> <string>n</string> <key>Module</key> <string>XCSnapshotModule</string> <key>Name</key> <string>Snapshots Tool</string> </dict> </array> <key>Description</key> <string>DefaultDescriptionKey</string> <key>DockingSystemVisible</key> <false/> <key>Extension</key> <string>mode1v3</string> <key>FavBarConfig</key> <dict> <key>PBXProjectModuleGUID</key> <string>0606C13B14DC842A008033F9</string> <key>XCBarModuleItemNames</key> <dict/> <key>XCBarModuleItems</key> <array/> </dict> <key>FirstTimeWindowDisplayed</key> <false/> <key>Identifier</key> <string>com.apple.perspectives.project.mode1v3</string> <key>MajorVersion</key> <integer>33</integer> <key>MinorVersion</key> <integer>0</integer> <key>Name</key> <string>Default</string> <key>Notifications</key> <array/> <key>OpenEditors</key> <array/> <key>PerspectiveWidths</key> <array> <integer>-1</integer> <integer>-1</integer> </array> <key>Perspectives</key> <array> <dict> <key>ChosenToolbarItems</key> <array> <string>active-combo-popup</string> <string>action</string> <string>NSToolbarFlexibleSpaceItem</string> <string>clean</string> <string>buildOrClean</string> <string>build-and-go</string> <string>go</string> <string>servicesModuledebug</string> <string>servicesModulebuild</string> <string>debugger-enable-breakpoints</string> <string>com.apple.ide.PBXToolbarStopButton</string> <string>get-info</string> <string>NSToolbarFlexibleSpaceItem</string> <string>com.apple.pbx.toolbar.searchfield</string> </array> <key>ControllerClassBaseName</key> <string></string> <key>IconName</key> <string>WindowOfProjectWithEditor</string> <key>Identifier</key> <string>perspective.project</string> <key>IsVertical</key> <false/> <key>Layout</key> <array> <dict> <key>BecomeActive</key> <true/> <key>ContentConfiguration</key> <dict> <key>PBXBottomSmartGroupGIDs</key> <array> <string>1C37FBAC04509CD000000102</string> <string>1C37FAAC04509CD000000102</string> <string>1C37FABC05509CD000000102</string> <string>1C37FABC05539CD112110102</string> <string>E2644B35053B69B200211256</string> <string>1C37FABC04509CD000100104</string> <string>1CC0EA4004350EF90044410B</string> <string>1CC0EA4004350EF90041110B</string> </array> <key>PBXProjectModuleGUID</key> <string>1CE0B1FE06471DED0097A5F4</string> <key>PBXProjectModuleLabel</key> <string>Files</string> <key>PBXProjectStructureProvided</key> <string>yes</string> <key>PBXSmartGroupTreeModuleColumnData</key> <dict> <key>PBXSmartGroupTreeModuleColumnWidthsKey</key> <array> <real>275</real> </array> <key>PBXSmartGroupTreeModuleColumnsKey_v4</key> <array> <string>MainColumn</string> </array> </dict> <key>PBXSmartGroupTreeModuleOutlineStateKey_v7</key> <dict> <key>PBXSmartGroupTreeModuleOutlineStateExpansionKey</key> <array> <string>089C166AFE841209C02AAC07</string> <string>08FB77AFFE84173DC02AAC07</string> <string>32C88E010371C26100C91783</string> <string>089C167CFE841241C02AAC07</string> <string>B47CF353067B4E030066DBF6</string> <string>089C167DFE841241C02AAC07</string> <string>B40F802706739F480053A16B</string> <string>19C28FB8FE9D52D311CA2CBB</string> <string>0638EF1412E6DA96006FF673</string> <string>1C37FBAC04509CD000000102</string> <string>1C37FAAC04509CD000000102</string> <string>1CC0EA4004350EF90044410B</string> <string>1CC0EA4004350EF90041110B</string> <string>B40F802706739F480053A16B</string> </array> <key>PBXSmartGroupTreeModuleOutlineStateSelectionKey</key> <array> <array> <integer>23</integer> <integer>22</integer> </array> </array> <key>PBXSmartGroupTreeModuleOutlineStateVisibleRectKey</key> <string>{{0, 0}, {275, 695}}</string> </dict> <key>PBXTopSmartGroupGIDs</key> <array/> <key>XCIncludePerspectivesSwitch</key> <true/> <key>XCSharingToken</key> <string>com.apple.Xcode.GFSharingToken</string> </dict> <key>GeometryConfiguration</key> <dict> <key>Frame</key> <string>{{0, 0}, {292, 713}}</string> <key>GroupTreeTableConfiguration</key> <array> <string>MainColumn</string> <real>275</real> </array> <key>RubberWindowFrame</key> <string>0 145 1440 733 0 0 1440 878 </string> </dict> <key>Module</key> <string>PBXSmartGroupTreeModule</string> <key>Proportion</key> <string>292pt</string> </dict> <dict> <key>Dock</key> <array> <dict> <key>ContentConfiguration</key> <dict> <key>PBXProjectModuleGUID</key> <string>1CE0B20306471E060097A5F4</string> <key>PBXProjectModuleLabel</key> <string>InfoPlist.strings</string> <key>PBXSplitModuleInNavigatorKey</key> <dict> <key>Split0</key> <dict> <key>PBXProjectModuleGUID</key> <string>1CE0B20406471E060097A5F4</string> <key>PBXProjectModuleLabel</key> <string>InfoPlist.strings</string> <key>_historyCapacity</key> <integer>0</integer> <key>bookmark</key> <string>06D66236151BD16E009F482C</string> <key>history</key> <array> <string>069E8F421402FC9D00897797</string> <string>069E8FAF1402FF0400897797</string> <string>06EBE12C14D9F59800B916EB</string> <string>0673FEEB14DB417F008A3FF8</string> <string>0632F4CF14DB4C470064D8E2</string> <string>0606C15E14DCA3BF008033F9</string> <string>0606C16914DCA4D3008033F9</string> <string>0606C1A814DCA789008033F9</string> <string>0606C1A914DCA789008033F9</string> </array> </dict> <key>SplitCount</key> <string>1</string> </dict> <key>StatusBarVisibility</key> <false/> </dict> <key>GeometryConfiguration</key> <dict> <key>Frame</key> <string>{{0, 0}, {1143, 313}}</string> <key>RubberWindowFrame</key> <string>0 145 1440 733 0 0 1440 878 </string> </dict> <key>Module</key> <string>PBXNavigatorGroup</string> <key>Proportion</key> <string>313pt</string> </dict> <dict> <key>ContentConfiguration</key> <dict> <key>PBXProjectModuleGUID</key> <string>1CE0B20506471E060097A5F4</string> <key>PBXProjectModuleLabel</key> <string>Detail</string> </dict> <key>GeometryConfiguration</key> <dict> <key>Frame</key> <string>{{0, 318}, {1143, 395}}</string> <key>RubberWindowFrame</key> <string>0 145 1440 733 0 0 1440 878 </string> </dict> <key>Module</key> <string>XCDetailModule</string> <key>Proportion</key> <string>395pt</string> </dict> </array> <key>Proportion</key> <string>1143pt</string> </dict> </array> <key>Name</key> <string>Project</string> <key>ServiceClasses</key> <array> <string>XCModuleDock</string> <string>PBXSmartGroupTreeModule</string> <string>XCModuleDock</string> <string>PBXNavigatorGroup</string> <string>XCDetailModule</string> </array> <key>TableOfContents</key> <array> <string>06D66237151BD16E009F482C</string> <string>1CE0B1FE06471DED0097A5F4</string> <string>06D66238151BD16E009F482C</string> <string>1CE0B20306471E060097A5F4</string> <string>1CE0B20506471E060097A5F4</string> </array> <key>ToolbarConfigUserDefaultsMinorVersion</key> <string>2</string> <key>ToolbarConfiguration</key> <string>xcode.toolbar.config.defaultV3</string> </dict> <dict> <key>ControllerClassBaseName</key> <string></string> <key>IconName</key> <string>WindowOfProject</string> <key>Identifier</key> <string>perspective.morph</string> <key>IsVertical</key> <false/> <key>Layout</key> <array> <dict> <key>BecomeActive</key> <integer>1</integer> <key>ContentConfiguration</key> <dict> <key>PBXBottomSmartGroupGIDs</key> <array> <string>1C37FBAC04509CD000000102</string> <string>1C37FAAC04509CD000000102</string> <string>1C08E77C0454961000C914BD</string> <string>1C37FABC05509CD000000102</string> <string>1C37FABC05539CD112110102</string> <string>E2644B35053B69B200211256</string> <string>1C37FABC04509CD000100104</string> <string>1CC0EA4004350EF90044410B</string> <string>1CC0EA4004350EF90041110B</string> </array> <key>PBXProjectModuleGUID</key> <string>11E0B1FE06471DED0097A5F4</string> <key>PBXProjectModuleLabel</key> <string>Files</string> <key>PBXProjectStructureProvided</key> <string>yes</string> <key>PBXSmartGroupTreeModuleColumnData</key> <dict> <key>PBXSmartGroupTreeModuleColumnWidthsKey</key> <array> <real>186</real> </array> <key>PBXSmartGroupTreeModuleColumnsKey_v4</key> <array> <string>MainColumn</string> </array> </dict> <key>PBXSmartGroupTreeModuleOutlineStateKey_v7</key> <dict> <key>PBXSmartGroupTreeModuleOutlineStateExpansionKey</key> <array> <string>29B97314FDCFA39411CA2CEA</string> <string>1C37FABC05509CD000000102</string> </array> <key>PBXSmartGroupTreeModuleOutlineStateSelectionKey</key> <array> <array> <integer>0</integer> </array> </array> <key>PBXSmartGroupTreeModuleOutlineStateVisibleRectKey</key> <string>{{0, 0}, {186, 337}}</string> </dict> <key>PBXTopSmartGroupGIDs</key> <array/> <key>XCIncludePerspectivesSwitch</key> <integer>1</integer> <key>XCSharingToken</key> <string>com.apple.Xcode.GFSharingToken</string> </dict> <key>GeometryConfiguration</key> <dict> <key>Frame</key> <string>{{0, 0}, {203, 355}}</string> <key>GroupTreeTableConfiguration</key> <array> <string>MainColumn</string> <real>186</real> </array> <key>RubberWindowFrame</key> <string>373 269 690 397 0 0 1440 878 </string> </dict> <key>Module</key> <string>PBXSmartGroupTreeModule</string> <key>Proportion</key> <string>100%</string> </dict> </array> <key>Name</key> <string>Morph</string> <key>PreferredWidth</key> <integer>300</integer> <key>ServiceClasses</key> <array> <string>XCModuleDock</string> <string>PBXSmartGroupTreeModule</string> </array> <key>TableOfContents</key> <array> <string>11E0B1FE06471DED0097A5F4</string> </array> <key>ToolbarConfiguration</key> <string>xcode.toolbar.config.default.shortV3</string> </dict> </array> <key>PerspectivesBarVisible</key> <false/> <key>ShelfIsVisible</key> <false/> <key>StatusbarIsVisible</key> <false/> <key>TimeStamp</key> <real>0.0</real> <key>ToolbarConfigUserDefaultsMinorVersion</key> <string>2</string> <key>ToolbarDisplayMode</key> <integer>1</integer> <key>ToolbarIsVisible</key> <true/> <key>ToolbarSizeMode</key> <integer>1</integer> <key>Type</key> <string>Perspectives</string> <key>UpdateMessage</key> <string>The Default Workspace in this version of Xcode now includes support to hide and show the detail view (what has been referred to as the "Metro-Morph" feature). You must discard your current Default Workspace settings and update to the latest Default Workspace in order to gain this feature. Do you wish to update to the latest Workspace defaults for project '%@'?</string> <key>WindowJustification</key> <integer>5</integer> <key>WindowOrderList</key> <array> <string>060D9AEF13D8CE5900152410</string> <string>/Users/ocs/work/ocs/dev/beta5/temp/tools/macosx/installer_gui/ocs_agent_config/ocs_agent_config.xcodeproj</string> </array> <key>WindowString</key> <string>0 145 1440 733 0 0 1440 878 </string> <key>WindowToolsV3</key> <array> <dict> <key>FirstTimeWindowDisplayed</key> <false/> <key>Identifier</key> <string>windowTool.build</string> <key>IsVertical</key> <true/> <key>Layout</key> <array> <dict> <key>Dock</key> <array> <dict> <key>ContentConfiguration</key> <dict> <key>PBXProjectModuleGUID</key> <string>1CD0528F0623707200166675</string> <key>PBXProjectModuleLabel</key> <string></string> <key>StatusBarVisibility</key> <true/> </dict> <key>GeometryConfiguration</key> <dict> <key>Frame</key> <string>{{0, 0}, {719, 280}}</string> <key>RubberWindowFrame</key> <string>660 210 719 562 0 0 1440 878 </string> </dict> <key>Module</key> <string>PBXNavigatorGroup</string> <key>Proportion</key> <string>280pt</string> </dict> <dict> <key>ContentConfiguration</key> <dict> <key>PBXProjectModuleGUID</key> <string>XCMainBuildResultsModuleGUID</string> <key>PBXProjectModuleLabel</key> <string>Build Results</string> <key>XCBuildResultsTrigger_Collapse</key> <integer>1021</integer> <key>XCBuildResultsTrigger_Open</key> <integer>1011</integer> </dict> <key>GeometryConfiguration</key> <dict> <key>Frame</key> <string>{{0, 285}, {719, 236}}</string> <key>RubberWindowFrame</key> <string>660 210 719 562 0 0 1440 878 </string> </dict> <key>Module</key> <string>PBXBuildResultsModule</string> <key>Proportion</key> <string>236pt</string> </dict> </array> <key>Proportion</key> <string>521pt</string> </dict> </array> <key>Name</key> <string>Build Results</string> <key>ServiceClasses</key> <array> <string>PBXBuildResultsModule</string> </array> <key>StatusbarIsVisible</key> <true/> <key>TableOfContents</key> <array> <string>060D9AEF13D8CE5900152410</string> <string>06D66239151BD16E009F482C</string> <string>1CD0528F0623707200166675</string> <string>XCMainBuildResultsModuleGUID</string> </array> <key>ToolbarConfiguration</key> <string>xcode.toolbar.config.buildV3</string> <key>WindowContentMinSize</key> <string>486 300</string> <key>WindowString</key> <string>660 210 719 562 0 0 1440 878 </string> <key>WindowToolGUID</key> <string>060D9AEF13D8CE5900152410</string> <key>WindowToolIsVisible</key> <false/> </dict> <dict> <key>FirstTimeWindowDisplayed</key> <false/> <key>Identifier</key> <string>windowTool.debugger</string> <key>Layout</key> <array> <dict> <key>Dock</key> <array> <dict> <key>ContentConfiguration</key> <dict> <key>Debugger</key> <dict> <key>HorizontalSplitView</key> <dict> <key>_collapsingFrameDimension</key> <real>0.0</real> <key>_indexOfCollapsedView</key> <integer>0</integer> <key>_percentageOfCollapsedView</key> <real>0.0</real> <key>isCollapsed</key> <string>yes</string> <key>sizes</key> <array> <string>{{0, 0}, {317, 164}}</string> <string>{{317, 0}, {377, 164}}</string> </array> </dict> <key>VerticalSplitView</key> <dict> <key>_collapsingFrameDimension</key> <real>0.0</real> <key>_indexOfCollapsedView</key> <integer>0</integer> <key>_percentageOfCollapsedView</key> <real>0.0</real> <key>isCollapsed</key> <string>yes</string> <key>sizes</key> <array> <string>{{0, 0}, {694, 164}}</string> <string>{{0, 164}, {694, 216}}</string> </array> </dict> </dict> <key>LauncherConfigVersion</key> <string>8</string> <key>PBXProjectModuleGUID</key> <string>1C162984064C10D400B95A72</string> <key>PBXProjectModuleLabel</key> <string>Debug - GLUTExamples (Underwater)</string> </dict> <key>GeometryConfiguration</key> <dict> <key>DebugConsoleDrawerSize</key> <string>{100, 120}</string> <key>DebugConsoleVisible</key> <string>None</string> <key>DebugConsoleWindowFrame</key> <string>{{200, 200}, {500, 300}}</string> <key>DebugSTDIOWindowFrame</key> <string>{{200, 200}, {500, 300}}</string> <key>Frame</key> <string>{{0, 0}, {694, 380}}</string> <key>RubberWindowFrame</key> <string>321 238 694 422 0 0 1440 878 </string> </dict> <key>Module</key> <string>PBXDebugSessionModule</string> <key>Proportion</key> <string>100%</string> </dict> </array> <key>Proportion</key> <string>100%</string> </dict> </array> <key>Name</key> <string>Debugger</string> <key>ServiceClasses</key> <array> <string>PBXDebugSessionModule</string> </array> <key>StatusbarIsVisible</key> <true/> <key>TableOfContents</key> <array> <string>1CD10A99069EF8BA00B06720</string> <string>1C0AD2AB069F1E9B00FABCE6</string> <string>1C162984064C10D400B95A72</string> <string>1C0AD2AC069F1E9B00FABCE6</string> </array> <key>ToolbarConfiguration</key> <string>xcode.toolbar.config.debugV3</string> <key>WindowString</key> <string>321 238 694 422 0 0 1440 878 </string> <key>WindowToolGUID</key> <string>1CD10A99069EF8BA00B06720</string> <key>WindowToolIsVisible</key> <false/> </dict> <dict> <key>FirstTimeWindowDisplayed</key> <false/> <key>Identifier</key> <string>windowTool.find</string> <key>Layout</key> <array> <dict> <key>Dock</key> <array> <dict> <key>Dock</key> <array> <dict> <key>ContentConfiguration</key> <dict> <key>PBXProjectModuleGUID</key> <string>1CDD528C0622207200134675</string> <key>PBXProjectModuleLabel</key> <string><No Editor></string> <key>PBXSplitModuleInNavigatorKey</key> <dict> <key>Split0</key> <dict> <key>PBXProjectModuleGUID</key> <string>1CD0528D0623707200166675</string> </dict> <key>SplitCount</key> <string>1</string> </dict> <key>StatusBarVisibility</key> <integer>1</integer> </dict> <key>GeometryConfiguration</key> <dict> <key>Frame</key> <string>{{0, 0}, {781, 167}}</string> <key>RubberWindowFrame</key> <string>62 385 781 470 0 0 1440 878 </string> </dict> <key>Module</key> <string>PBXNavigatorGroup</string> <key>Proportion</key> <string>781pt</string> </dict> </array> <key>Proportion</key> <string>50%</string> </dict> <dict> <key>BecomeActive</key> <integer>1</integer> <key>ContentConfiguration</key> <dict> <key>PBXProjectModuleGUID</key> <string>1CD0528E0623707200166675</string> <key>PBXProjectModuleLabel</key> <string>Project Find</string> </dict> <key>GeometryConfiguration</key> <dict> <key>Frame</key> <string>{{8, 0}, {773, 254}}</string> <key>RubberWindowFrame</key> <string>62 385 781 470 0 0 1440 878 </string> </dict> <key>Module</key> <string>PBXProjectFindModule</string> <key>Proportion</key> <string>50%</string> </dict> </array> <key>Proportion</key> <string>428pt</string> </dict> </array> <key>Name</key> <string>Project Find</string> <key>ServiceClasses</key> <array> <string>PBXProjectFindModule</string> </array> <key>StatusbarIsVisible</key> <true/> <key>TableOfContents</key> <array> <string>1C530D57069F1CE1000CFCEE</string> <string>1C530D58069F1CE1000CFCEE</string> <string>1C530D59069F1CE1000CFCEE</string> <string>1CDD528C0622207200134675</string> <string>1C530D5A069F1CE1000CFCEE</string> <string>1CE0B1FE06471DED0097A5F4</string> <string>1CD0528E0623707200166675</string> </array> <key>WindowString</key> <string>62 385 781 470 0 0 1440 878 </string> <key>WindowToolGUID</key> <string>1C530D57069F1CE1000CFCEE</string> <key>WindowToolIsVisible</key> <false/> </dict> <dict> <key>FirstTimeWindowDisplayed</key> <false/> <key>Identifier</key> <string>MENUSEPARATOR</string> </dict> <dict> <key>FirstTimeWindowDisplayed</key> <false/> <key>Identifier</key> <string>windowTool.debuggerConsole</string> <key>Layout</key> <array> <dict> <key>Dock</key> <array> <dict> <key>BecomeActive</key> <integer>1</integer> <key>ContentConfiguration</key> <dict> <key>PBXProjectModuleGUID</key> <string>1C78EAAC065D492600B07095</string> <key>PBXProjectModuleLabel</key> <string>Debugger Console</string> </dict> <key>GeometryConfiguration</key> <dict> <key>Frame</key> <string>{{0, 0}, {440, 358}}</string> <key>RubberWindowFrame</key> <string>650 41 440 400 0 0 1280 1002 </string> </dict> <key>Module</key> <string>PBXDebugCLIModule</string> <key>Proportion</key> <string>358pt</string> </dict> </array> <key>Proportion</key> <string>358pt</string> </dict> </array> <key>Name</key> <string>Debugger Console</string> <key>ServiceClasses</key> <array> <string>PBXDebugCLIModule</string> </array> <key>StatusbarIsVisible</key> <true/> <key>TableOfContents</key> <array> <string>1C78EAAD065D492600B07095</string> <string>1C78EAAE065D492600B07095</string> <string>1C78EAAC065D492600B07095</string> </array> <key>ToolbarConfiguration</key> <string>xcode.toolbar.config.consoleV3</string> <key>WindowString</key> <string>650 41 440 400 0 0 1280 1002 </string> <key>WindowToolGUID</key> <string>1C78EAAD065D492600B07095</string> <key>WindowToolIsVisible</key> <false/> </dict> <dict> <key>Identifier</key> <string>windowTool.snapshots</string> <key>Layout</key> <array> <dict> <key>Dock</key> <array> <dict> <key>Module</key> <string>XCSnapshotModule</string> <key>Proportion</key> <string>100%</string> </dict> </array> <key>Proportion</key> <string>100%</string> </dict> </array> <key>Name</key> <string>Snapshots</string> <key>ServiceClasses</key> <array> <string>XCSnapshotModule</string> </array> <key>StatusbarIsVisible</key> <string>Yes</string> <key>ToolbarConfiguration</key> <string>xcode.toolbar.config.snapshots</string> <key>WindowString</key> <string>315 824 300 550 0 0 1440 878 </string> <key>WindowToolIsVisible</key> <string>Yes</string> </dict> <dict> <key>FirstTimeWindowDisplayed</key> <false/> <key>Identifier</key> <string>windowTool.scm</string> <key>Layout</key> <array> <dict> <key>Dock</key> <array> <dict> <key>ContentConfiguration</key> <dict> <key>PBXProjectModuleGUID</key> <string>1C78EAB2065D492600B07095</string> <key>PBXProjectModuleLabel</key> <string><No Editor></string> <key>PBXSplitModuleInNavigatorKey</key> <dict> <key>Split0</key> <dict> <key>PBXProjectModuleGUID</key> <string>1C78EAB3065D492600B07095</string> </dict> <key>SplitCount</key> <string>1</string> </dict> <key>StatusBarVisibility</key> <integer>1</integer> </dict> <key>GeometryConfiguration</key> <dict> <key>Frame</key> <string>{{0, 0}, {452, 0}}</string> <key>RubberWindowFrame</key> <string>743 379 452 308 0 0 1280 1002 </string> </dict> <key>Module</key> <string>PBXNavigatorGroup</string> <key>Proportion</key> <string>0pt</string> </dict> <dict> <key>BecomeActive</key> <integer>1</integer> <key>ContentConfiguration</key> <dict> <key>PBXProjectModuleGUID</key> <string>1CD052920623707200166675</string> <key>PBXProjectModuleLabel</key> <string>SCM</string> </dict> <key>GeometryConfiguration</key> <dict> <key>ConsoleFrame</key> <string>{{0, 259}, {452, 0}}</string> <key>Frame</key> <string>{{0, 7}, {452, 259}}</string> <key>RubberWindowFrame</key> <string>743 379 452 308 0 0 1280 1002 </string> <key>TableConfiguration</key> <array> <string>Status</string> <real>30</real> <string>FileName</string> <real>199</real> <string>Path</string> <real>197.09500122070312</real> </array> <key>TableFrame</key> <string>{{0, 0}, {452, 250}}</string> </dict> <key>Module</key> <string>PBXCVSModule</string> <key>Proportion</key> <string>262pt</string> </dict> </array> <key>Proportion</key> <string>266pt</string> </dict> </array> <key>Name</key> <string>SCM</string> <key>ServiceClasses</key> <array> <string>PBXCVSModule</string> </array> <key>StatusbarIsVisible</key> <true/> <key>TableOfContents</key> <array> <string>1C78EAB4065D492600B07095</string> <string>1C78EAB5065D492600B07095</string> <string>1C78EAB2065D492600B07095</string> <string>1CD052920623707200166675</string> </array> <key>ToolbarConfiguration</key> <string>xcode.toolbar.config.scm</string> <key>WindowString</key> <string>743 379 452 308 0 0 1280 1002 </string> </dict> <dict> <key>FirstTimeWindowDisplayed</key> <false/> <key>Identifier</key> <string>windowTool.breakpoints</string> <key>IsVertical</key> <false/> <key>Layout</key> <array> <dict> <key>Dock</key> <array> <dict> <key>BecomeActive</key> <integer>1</integer> <key>ContentConfiguration</key> <dict> <key>PBXBottomSmartGroupGIDs</key> <array> <string>1C77FABC04509CD000000102</string> </array> <key>PBXProjectModuleGUID</key> <string>1CE0B1FE06471DED0097A5F4</string> <key>PBXProjectModuleLabel</key> <string>Files</string> <key>PBXProjectStructureProvided</key> <string>no</string> <key>PBXSmartGroupTreeModuleColumnData</key> <dict> <key>PBXSmartGroupTreeModuleColumnWidthsKey</key> <array> <real>168</real> </array> <key>PBXSmartGroupTreeModuleColumnsKey_v4</key> <array> <string>MainColumn</string> </array> </dict> <key>PBXSmartGroupTreeModuleOutlineStateKey_v7</key> <dict> <key>PBXSmartGroupTreeModuleOutlineStateExpansionKey</key> <array> <string>1C77FABC04509CD000000102</string> </array> <key>PBXSmartGroupTreeModuleOutlineStateSelectionKey</key> <array> <array> <integer>0</integer> </array> </array> <key>PBXSmartGroupTreeModuleOutlineStateVisibleRectKey</key> <string>{{0, 0}, {168, 350}}</string> </dict> <key>PBXTopSmartGroupGIDs</key> <array/> <key>XCIncludePerspectivesSwitch</key> <integer>0</integer> </dict> <key>GeometryConfiguration</key> <dict> <key>Frame</key> <string>{{0, 0}, {185, 368}}</string> <key>GroupTreeTableConfiguration</key> <array> <string>MainColumn</string> <real>168</real> </array> <key>RubberWindowFrame</key> <string>315 424 744 409 0 0 1440 878 </string> </dict> <key>Module</key> <string>PBXSmartGroupTreeModule</string> <key>Proportion</key> <string>185pt</string> </dict> <dict> <key>ContentConfiguration</key> <dict> <key>PBXProjectModuleGUID</key> <string>1CA1AED706398EBD00589147</string> <key>PBXProjectModuleLabel</key> <string>Detail</string> </dict> <key>GeometryConfiguration</key> <dict> <key>Frame</key> <string>{{190, 0}, {554, 368}}</string> <key>RubberWindowFrame</key> <string>315 424 744 409 0 0 1440 878 </string> </dict> <key>Module</key> <string>XCDetailModule</string> <key>Proportion</key> <string>554pt</string> </dict> </array> <key>Proportion</key> <string>368pt</string> </dict> </array> <key>MajorVersion</key> <integer>3</integer> <key>MinorVersion</key> <integer>0</integer> <key>Name</key> <string>Breakpoints</string> <key>ServiceClasses</key> <array> <string>PBXSmartGroupTreeModule</string> <string>XCDetailModule</string> </array> <key>StatusbarIsVisible</key> <true/> <key>TableOfContents</key> <array> <string>1CDDB66807F98D9800BB5817</string> <string>1CDDB66907F98D9800BB5817</string> <string>1CE0B1FE06471DED0097A5F4</string> <string>1CA1AED706398EBD00589147</string> </array> <key>ToolbarConfiguration</key> <string>xcode.toolbar.config.breakpointsV3</string> <key>WindowString</key> <string>315 424 744 409 0 0 1440 878 </string> <key>WindowToolGUID</key> <string>1CDDB66807F98D9800BB5817</string> <key>WindowToolIsVisible</key> <true/> </dict> <dict> <key>FirstTimeWindowDisplayed</key> <false/> <key>Identifier</key> <string>windowTool.debugAnimator</string> <key>Layout</key> <array> <dict> <key>Dock</key> <array> <dict> <key>Module</key> <string>PBXNavigatorGroup</string> <key>Proportion</key> <string>100%</string> </dict> </array> <key>Proportion</key> <string>100%</string> </dict> </array> <key>Name</key> <string>Debug Visualizer</string> <key>ServiceClasses</key> <array> <string>PBXNavigatorGroup</string> </array> <key>StatusbarIsVisible</key> <true/> <key>ToolbarConfiguration</key> <string>xcode.toolbar.config.debugAnimatorV3</string> <key>WindowString</key> <string>100 100 700 500 0 0 1280 1002 </string> </dict> <dict> <key>FirstTimeWindowDisplayed</key> <false/> <key>Identifier</key> <string>windowTool.bookmarks</string> <key>Layout</key> <array> <dict> <key>Dock</key> <array> <dict> <key>Module</key> <string>PBXBookmarksModule</string> <key>Proportion</key> <string>100%</string> </dict> </array> <key>Proportion</key> <string>100%</string> </dict> </array> <key>Name</key> <string>Bookmarks</string> <key>ServiceClasses</key> <array> <string>PBXBookmarksModule</string> </array> <key>StatusbarIsVisible</key> <false/> <key>WindowString</key> <string>538 42 401 187 0 0 1280 1002 </string> </dict> <dict> <key>Identifier</key> <string>windowTool.projectFormatConflicts</string> <key>Layout</key> <array> <dict> <key>Dock</key> <array> <dict> <key>Module</key> <string>XCProjectFormatConflictsModule</string> <key>Proportion</key> <string>100%</string> </dict> </array> <key>Proportion</key> <string>100%</string> </dict> </array> <key>Name</key> <string>Project Format Conflicts</string> <key>ServiceClasses</key> <array> <string>XCProjectFormatConflictsModule</string> </array> <key>StatusbarIsVisible</key> <false/> <key>WindowContentMinSize</key> <string>450 300</string> <key>WindowString</key> <string>50 850 472 307 0 0 1440 877</string> </dict> <dict> <key>FirstTimeWindowDisplayed</key> <false/> <key>Identifier</key> <string>windowTool.classBrowser</string> <key>Layout</key> <array> <dict> <key>Dock</key> <array> <dict> <key>BecomeActive</key> <integer>1</integer> <key>ContentConfiguration</key> <dict> <key>OptionsSetName</key> <string>Hierarchy, all classes</string> <key>PBXProjectModuleGUID</key> <string>1CA6456E063B45B4001379D8</string> <key>PBXProjectModuleLabel</key> <string>Class Browser - NSObject</string> </dict> <key>GeometryConfiguration</key> <dict> <key>ClassesFrame</key> <string>{{0, 0}, {374, 96}}</string> <key>ClassesTreeTableConfiguration</key> <array> <string>PBXClassNameColumnIdentifier</string> <real>208</real> <string>PBXClassBookColumnIdentifier</string> <real>22</real> </array> <key>Frame</key> <string>{{0, 0}, {630, 331}}</string> <key>MembersFrame</key> <string>{{0, 105}, {374, 395}}</string> <key>MembersTreeTableConfiguration</key> <array> <string>PBXMemberTypeIconColumnIdentifier</string> <real>22</real> <string>PBXMemberNameColumnIdentifier</string> <real>216</real> <string>PBXMemberTypeColumnIdentifier</string> <real>97</real> <string>PBXMemberBookColumnIdentifier</string> <real>22</real> </array> <key>PBXModuleWindowStatusBarHidden2</key> <integer>1</integer> <key>RubberWindowFrame</key> <string>385 179 630 352 0 0 1440 878 </string> </dict> <key>Module</key> <string>PBXClassBrowserModule</string> <key>Proportion</key> <string>332pt</string> </dict> </array> <key>Proportion</key> <string>332pt</string> </dict> </array> <key>Name</key> <string>Class Browser</string> <key>ServiceClasses</key> <array> <string>PBXClassBrowserModule</string> </array> <key>StatusbarIsVisible</key> <false/> <key>TableOfContents</key> <array> <string>1C0AD2AF069F1E9B00FABCE6</string> <string>1C0AD2B0069F1E9B00FABCE6</string> <string>1CA6456E063B45B4001379D8</string> </array> <key>ToolbarConfiguration</key> <string>xcode.toolbar.config.classbrowser</string> <key>WindowString</key> <string>385 179 630 352 0 0 1440 878 </string> <key>WindowToolGUID</key> <string>1C0AD2AF069F1E9B00FABCE6</string> <key>WindowToolIsVisible</key> <false/> </dict> <dict> <key>Identifier</key> <string>windowTool.refactoring</string> <key>IncludeInToolsMenu</key> <false/> <key>Layout</key> <array> <dict> <key>Dock</key> <array> <dict> <key>BecomeActive</key> <true/> <key>GeometryConfiguration</key> <dict> <key>Frame</key> <string>{0, 0}, {500, 335}</string> <key>RubberWindowFrame</key> <string>{0, 0}, {500, 335}</string> </dict> <key>Module</key> <string>XCRefactoringModule</string> <key>Proportion</key> <string>100%</string> </dict> </array> <key>Proportion</key> <string>100%</string> </dict> </array> <key>Name</key> <string>Refactoring</string> <key>ServiceClasses</key> <array> <string>XCRefactoringModule</string> </array> <key>WindowString</key> <string>200 200 500 356 0 0 1920 1200 </string> </dict> </array> </dict> </plist> �����������������������������������������������������������������������UnixAgent-2.4.2/tools/macosx/installer_gui/ocs_agent_config/ocs_agent_config.xcodeproj/ocs.pbxuser��0000664�0000000�0000000�00000025763�13327377321�0033711�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// !$*UTF8*$! { 0606C15E14DCA3BF008033F9 /* PBXTextBookmark */ = { isa = PBXTextBookmark; fRef = 0632F49314DB45F00064D8E2 /* French */; name = "Localizable.strings: 6"; rLen = 2; rLoc = 63; rType = 0; vrLen = 488; vrLoc = 0; }; 0606C16914DCA4D3008033F9 /* PBXTextBookmark */ = { isa = PBXTextBookmark; fRef = B47CF354067B4E030066DBF6 /* English */; name = "Localizable.strings: 13"; rLen = 0; rLoc = 261; rType = 0; vrLen = 920; vrLoc = 355; }; 0606C1A814DCA789008033F9 /* PBXTextBookmark */ = { isa = PBXTextBookmark; fRef = B44C200906739AE500D31AA1 /* ocs_agent_configPane.m */; name = "ocs_agent_configPane.m: 223"; rLen = 0; rLoc = 7876; rType = 0; vrLen = 1073; vrLoc = 7130; }; 0606C1A914DCA789008033F9 /* PBXTextBookmark */ = { isa = PBXTextBookmark; fRef = 0649FBA414D9F110001EC640 /* French */; name = "InfoPlist.strings: 16"; rLen = 0; rLoc = 398; rType = 0; vrLen = 401; vrLoc = 0; }; 0632F49314DB45F00064D8E2 /* French */ = { uiCtxt = { sepNavIntBoundsRect = "{{0, 0}, {1118, 578}}"; sepNavSelRange = "{531, 0}"; sepNavVisRange = "{0, 1364}"; sepNavWindowFrame = "{{15, 167}, {948, 706}}"; }; }; 0632F4CF14DB4C470064D8E2 /* PBXTextBookmark */ = { isa = PBXTextBookmark; fRef = 0649FBA014D9F0FD001EC640 /* English */; name = "InfoPlist.strings: 1"; rLen = 0; rLoc = 262; rType = 0; vrLen = 145; vrLoc = 0; }; 0649FBA014D9F0FD001EC640 /* English */ = { uiCtxt = { sepNavIntBoundsRect = "{{0, 0}, {935, 628}}"; sepNavSelRange = "{261, 0}"; sepNavVisRange = "{0, 401}"; sepNavWindowFrame = "{{316, 76}, {994, 756}}"; }; }; 0649FBA414D9F110001EC640 /* French */ = { uiCtxt = { sepNavIntBoundsRect = "{{0, 0}, {1082, 281}}"; sepNavSelRange = "{398, 0}"; sepNavVisRange = "{0, 401}"; sepNavWindowFrame = "{{84, 104}, {948, 706}}"; }; }; 0649FBA514D9F123001EC640 /* French */ = { uiCtxt = { sepNavIntBoundsRect = "{{0, 0}, {1082, 280}}"; sepNavSelRange = "{137, 0}"; sepNavVisRange = "{0, 137}"; sepNavWindowFrame = "{{84, 104}, {948, 706}}"; }; }; 0673FEEB14DB417F008A3FF8 /* PBXTextBookmark */ = { isa = PBXTextBookmark; fRef = B44C200806739AE500D31AA1 /* ocs_agent_configPane.h */; name = "ocs_agent_configPane.h: 20"; rLen = 0; rLoc = 507; rType = 0; vrLen = 658; vrLoc = 66; }; 06992DAA12ED12D000448686 /* ocs_agent_configPane.m:134 */ = { isa = PBXFileBreakpoint; actions = ( ); breakpointStyle = 0; continueAfterActions = 0; countType = 0; delayBeforeContinue = 0; fileReference = B44C200906739AE500D31AA1 /* ocs_agent_configPane.m */; functionName = "-getConfig:"; hitCount = 0; ignoreCount = 0; lineNumber = 134; location = ocs_agent_config; modificationTime = 332886961.303945; originalNumberOfMultipleMatches = 1; state = 0; }; 069E8F421402FC9D00897797 /* PBXTextBookmark */ = { isa = PBXTextBookmark; fRef = 32DBCF630370AF2F00C91783 /* ocs_agent_config_Prefix.pch */; name = "ocs_agent_config_Prefix.pch: 1"; rLen = 0; rLoc = 0; rType = 0; vrLen = 162; vrLoc = 0; }; 069E8F941402FEAC00897797 /* objc.h */ = { isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = objc.h; path = /Developer/SDKs/MacOSX10.4u.sdk/usr/include/objc/objc.h; sourceTree = "<absolute>"; }; 069E8FAF1402FF0400897797 /* PBXTextBookmark */ = { isa = PBXTextBookmark; fRef = 069E8F941402FEAC00897797 /* objc.h */; name = "objc.h: 34"; rLen = 0; rLoc = 1173; rType = 0; vrLen = 461; vrLoc = 834; }; 06CD1B9212DD81CD0064FB6B /* Source Control */ = { isa = PBXSourceControlManager; fallbackIsa = XCSourceControlManager; isSCMEnabled = 0; scmConfiguration = { repositoryNamesForRoots = { "" = ""; }; }; scmType = ""; }; 06CD1B9312DD81CD0064FB6B /* Code sense */ = { isa = PBXCodeSenseManager; indexTemplatePath = ""; }; 06D66236151BD16E009F482C /* PBXTextBookmark */ = { isa = PBXTextBookmark; fRef = 0649FBA414D9F110001EC640 /* French */; name = "InfoPlist.strings: 16"; rLen = 0; rLoc = 398; rType = 0; vrLen = 401; vrLoc = 0; }; 06EBE12C14D9F59800B916EB /* PlistBookmark */ = { isa = PlistBookmark; fRef = 8D5B49B7048680CD000E48DA /* Info.plist */; fallbackIsa = PBXBookmark; isK = 0; kPath = ( ); name = /Users/ocs/work/ocs/dev/beta5/ocs_agent_config/Info.plist; rLen = 0; rLoc = 9223372036854775808; }; 089C1669FE841209C02AAC07 /* Project object */ = { activeBuildConfigurationName = Release; activeTarget = 8D5B49AC048680CD000E48DA /* OCS Agent configuration */; addToTargets = ( 8D5B49AC048680CD000E48DA /* OCS Agent configuration */, ); breakpoints = ( 06992DAA12ED12D000448686 /* ocs_agent_configPane.m:134 */, ); codeSenseManager = 06CD1B9312DD81CD0064FB6B /* Code sense */; perUserDictionary = { PBXConfiguration.PBXFileTableDataSource3.PBXBookmarksDataSource = { PBXFileTableDataSourceColumnSortingDirectionKey = "-1"; PBXFileTableDataSourceColumnSortingKey = PBXBookmarksDataSource_NameID; PBXFileTableDataSourceColumnWidthsKey = ( 200, 200, 713.58349609375, ); PBXFileTableDataSourceColumnsKey = ( PBXBookmarksDataSource_LocationID, PBXBookmarksDataSource_NameID, PBXBookmarksDataSource_CommentsID, ); }; PBXConfiguration.PBXFileTableDataSource3.PBXErrorsWarningsDataSource = { PBXFileTableDataSourceColumnSortingDirectionKey = "-1"; PBXFileTableDataSourceColumnSortingKey = PBXErrorsWarningsDataSource_LocationID; PBXFileTableDataSourceColumnWidthsKey = ( 20, 300, 45.2085, ); PBXFileTableDataSourceColumnsKey = ( PBXErrorsWarningsDataSource_TypeID, PBXErrorsWarningsDataSource_MessageID, PBXErrorsWarningsDataSource_LocationID, ); }; PBXConfiguration.PBXFileTableDataSource3.PBXExecutablesDataSource = { PBXFileTableDataSourceColumnSortingDirectionKey = "-1"; PBXFileTableDataSourceColumnSortingKey = PBXExecutablesDataSource_NameID; PBXFileTableDataSourceColumnWidthsKey = ( 22, 300, 792, ); PBXFileTableDataSourceColumnsKey = ( PBXExecutablesDataSource_ActiveFlagID, PBXExecutablesDataSource_NameID, PBXExecutablesDataSource_CommentsID, ); }; PBXConfiguration.PBXFileTableDataSource3.PBXFileTableDataSource = { PBXFileTableDataSourceColumnSortingDirectionKey = "-1"; PBXFileTableDataSourceColumnSortingKey = PBXFileDataSource_Filename_ColumnID; PBXFileTableDataSourceColumnWidthsKey = ( 20, 904, 20, 48, 43, 43, 20, ); PBXFileTableDataSourceColumnsKey = ( PBXFileDataSource_FiletypeID, PBXFileDataSource_Filename_ColumnID, PBXFileDataSource_Built_ColumnID, PBXFileDataSource_ObjectSize_ColumnID, PBXFileDataSource_Errors_ColumnID, PBXFileDataSource_Warnings_ColumnID, PBXFileDataSource_Target_ColumnID, ); }; PBXConfiguration.PBXFileTableDataSource3.PBXFindDataSource = { PBXFileTableDataSourceColumnSortingDirectionKey = "-1"; PBXFileTableDataSourceColumnSortingKey = PBXFindDataSource_LocationID; PBXFileTableDataSourceColumnWidthsKey = ( 200, 918, ); PBXFileTableDataSourceColumnsKey = ( PBXFindDataSource_MessageID, PBXFindDataSource_LocationID, ); }; PBXConfiguration.PBXTargetDataSource.PBXTargetDataSource = { PBXFileTableDataSourceColumnSortingDirectionKey = "-1"; PBXFileTableDataSourceColumnSortingKey = PBXFileDataSource_Filename_ColumnID; PBXFileTableDataSourceColumnWidthsKey = ( 20, 864, 60, 20, 48, 43, 43, ); PBXFileTableDataSourceColumnsKey = ( PBXFileDataSource_FiletypeID, PBXFileDataSource_Filename_ColumnID, PBXTargetDataSource_PrimaryAttribute, PBXFileDataSource_Built_ColumnID, PBXFileDataSource_ObjectSize_ColumnID, PBXFileDataSource_Errors_ColumnID, PBXFileDataSource_Warnings_ColumnID, ); }; PBXPerProjectTemplateStateSaveDate = 354144537; PBXWorkspaceStateSaveDate = 354144537; }; perUserProjectItems = { 0606C15E14DCA3BF008033F9 /* PBXTextBookmark */ = 0606C15E14DCA3BF008033F9 /* PBXTextBookmark */; 0606C16914DCA4D3008033F9 /* PBXTextBookmark */ = 0606C16914DCA4D3008033F9 /* PBXTextBookmark */; 0606C1A814DCA789008033F9 /* PBXTextBookmark */ = 0606C1A814DCA789008033F9 /* PBXTextBookmark */; 0606C1A914DCA789008033F9 /* PBXTextBookmark */ = 0606C1A914DCA789008033F9 /* PBXTextBookmark */; 0632F4CF14DB4C470064D8E2 /* PBXTextBookmark */ = 0632F4CF14DB4C470064D8E2 /* PBXTextBookmark */; 0673FEEB14DB417F008A3FF8 /* PBXTextBookmark */ = 0673FEEB14DB417F008A3FF8 /* PBXTextBookmark */; 069E8F421402FC9D00897797 /* PBXTextBookmark */ = 069E8F421402FC9D00897797 /* PBXTextBookmark */; 069E8FAF1402FF0400897797 /* PBXTextBookmark */ = 069E8FAF1402FF0400897797 /* PBXTextBookmark */; 06D66236151BD16E009F482C /* PBXTextBookmark */ = 06D66236151BD16E009F482C /* PBXTextBookmark */; 06EBE12C14D9F59800B916EB /* PlistBookmark */ = 06EBE12C14D9F59800B916EB /* PlistBookmark */; }; sourceControlManager = 06CD1B9212DD81CD0064FB6B /* Source Control */; userBuildSettings = { }; }; 089C167EFE841241C02AAC07 /* English */ = { uiCtxt = { sepNavIntBoundsRect = "{{0, 0}, {1082, 280}}"; sepNavSelRange = "{0, 0}"; sepNavVisRange = "{0, 144}"; sepNavVisRect = "{{0, 0}, {955, 627}}"; sepNavWindowFrame = "{{193, -2}, {994, 756}}"; }; }; 32DBCF630370AF2F00C91783 /* ocs_agent_config_Prefix.pch */ = { uiCtxt = { sepNavIntBoundsRect = "{{0, 0}, {1082, 280}}"; sepNavSelRange = "{0, 0}"; sepNavVisRange = "{0, 162}"; sepNavVisRect = "{{0, 0}, {955, 627}}"; sepNavWindowFrame = "{{13, 117}, {994, 756}}"; }; }; 8D5B49AC048680CD000E48DA /* OCS Agent configuration */ = { activeExec = 0; }; 8D5B49B7048680CD000E48DA /* Info.plist */ = { uiCtxt = { sepNavIntBoundsRect = "{{0, 0}, {955, 627}}"; sepNavSelRange = "{498, 0}"; sepNavVisRect = "{{0, 0}, {955, 627}}"; sepNavWindowFrame = "{{446, 90}, {994, 756}}"; }; }; B44C200806739AE500D31AA1 /* ocs_agent_configPane.h */ = { uiCtxt = { sepNavIntBoundsRect = "{{0, 0}, {1082, 481}}"; sepNavSelRange = "{507, 0}"; sepNavVisRange = "{66, 658}"; sepNavVisRect = "{{0, 0}, {711, 429}}"; sepNavWindowFrame = "{{459, 200}, {750, 558}}"; }; }; B44C200906739AE500D31AA1 /* ocs_agent_configPane.m */ = { uiCtxt = { sepNavIntBoundsRect = "{{0, 0}, {1454, 3185}}"; sepNavSelRange = "{7876, 0}"; sepNavVisRange = "{7130, 1073}"; sepNavVisRect = "{{0, 806}, {910, 675}}"; sepNavWindowFrame = "{{125, 90}, {1188, 788}}"; }; }; B47CF354067B4E030066DBF6 /* English */ = { uiCtxt = { sepNavIntBoundsRect = "{{0, 0}, {1082, 494}}"; sepNavSelRange = "{261, 0}"; sepNavVisRange = "{355, 920}"; sepNavVisRect = "{{0, 0}, {955, 627}}"; sepNavWindowFrame = "{{446, 90}, {994, 756}}"; }; }; B4A6B2A60673D523003CD9B2 /* InstallerSections.plist */ = { uiCtxt = { sepNavIntBoundsRect = "{{0, 0}, {955, 627}}"; sepNavSelRange = "{309, 0}"; sepNavVisRect = "{{0, 0}, {955, 627}}"; sepNavWindowFrame = "{{61, 75}, {994, 756}}"; }; }; } �������������project.pbxproj�������������������������������������������������������������������������������������0000664�0000000�0000000�00000034227�13327377321�0034503�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�UnixAgent-2.4.2/tools/macosx/installer_gui/ocs_agent_config/ocs_agent_config.xcodeproj���������������������������������������������������������������������������������// !$*UTF8*$! { archiveVersion = 1; classes = { }; objectVersion = 44; objects = { /* Begin PBXBuildFile section */ 0649FBA314D9F106001EC640 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 0649FBA214D9F106001EC640 /* InfoPlist.strings */; }; 8D5B49B0048680CD000E48DA /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 089C167DFE841241C02AAC07 /* InfoPlist.strings */; }; 8D5B49B4048680CD000E48DA /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1058C7ADFEA557BF11CA2CBB /* Cocoa.framework */; }; B40F7FFC06739E1B0053A16B /* InstallerPlugins.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = B40F7FFB06739E1B0053A16B /* InstallerPlugins.framework */; }; B40F802906739F480053A16B /* ocs_agent_config.nib in Resources */ = {isa = PBXBuildFile; fileRef = B40F802706739F480053A16B /* ocs_agent_config.nib */; }; B44C200B06739AE500D31AA1 /* ocs_agent_configPane.m in Sources */ = {isa = PBXBuildFile; fileRef = B44C200906739AE500D31AA1 /* ocs_agent_configPane.m */; }; B47CF355067B4E030066DBF6 /* Localizable.strings in Resources */ = {isa = PBXBuildFile; fileRef = B47CF353067B4E030066DBF6 /* Localizable.strings */; }; /* End PBXBuildFile section */ /* Begin PBXFileReference section */ 0632F49314DB45F00064D8E2 /* French */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = French; path = French.lproj/Localizable.strings; sourceTree = "<group>"; }; 0638EF1412E6DA96006FF673 /* ocs_agent_config.bundle */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = ocs_agent_config.bundle; sourceTree = BUILT_PRODUCTS_DIR; }; 0649FB6414D9E877001EC640 /* French */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = French; path = French.lproj/ocs_agent_config.nib; sourceTree = "<group>"; }; 0649FBA014D9F0FD001EC640 /* English */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.strings; name = English; path = English.lproj/InfoPlist.strings; sourceTree = "<group>"; }; 0649FBA414D9F110001EC640 /* French */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = French; path = French.lproj/InfoPlist.strings; sourceTree = "<group>"; }; 0649FBA514D9F123001EC640 /* French */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = French; path = French.lproj/InfoPlist.strings; sourceTree = "<group>"; }; 089C1672FE841209C02AAC07 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = /System/Library/Frameworks/Foundation.framework; sourceTree = "<absolute>"; }; 089C167EFE841241C02AAC07 /* English */ = {isa = PBXFileReference; fileEncoding = 10; lastKnownFileType = text.plist.strings; name = English; path = English.lproj/InfoPlist.strings; sourceTree = "<group>"; }; 089C167FFE841241C02AAC07 /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = /System/Library/Frameworks/AppKit.framework; sourceTree = "<absolute>"; }; 1058C7ADFEA557BF11CA2CBB /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = /System/Library/Frameworks/Cocoa.framework; sourceTree = "<absolute>"; }; 32DBCF630370AF2F00C91783 /* ocs_agent_config_Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ocs_agent_config_Prefix.pch; sourceTree = "<group>"; }; 8D5B49B7048680CD000E48DA /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; }; B40F7FFB06739E1B0053A16B /* InstallerPlugins.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = InstallerPlugins.framework; path = /System/Library/Frameworks/InstallerPlugins.framework; sourceTree = "<absolute>"; }; B40F802806739F480053A16B /* English */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = English; path = English.lproj/ocs_agent_config.nib; sourceTree = "<group>"; }; B44C200806739AE500D31AA1 /* ocs_agent_configPane.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ocs_agent_configPane.h; sourceTree = "<group>"; }; B44C200906739AE500D31AA1 /* ocs_agent_configPane.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ocs_agent_configPane.m; sourceTree = "<group>"; }; B47CF354067B4E030066DBF6 /* English */ = {isa = PBXFileReference; fileEncoding = 10; lastKnownFileType = text.plist.strings; name = English; path = English.lproj/Localizable.strings; sourceTree = "<group>"; }; B4A6B2A60673D523003CD9B2 /* InstallerSections.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = InstallerSections.plist; sourceTree = "<group>"; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ 8D5B49B3048680CD000E48DA /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( 8D5B49B4048680CD000E48DA /* Cocoa.framework in Frameworks */, B40F7FFC06739E1B0053A16B /* InstallerPlugins.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ 089C166AFE841209C02AAC07 /* InstallerPlugin */ = { isa = PBXGroup; children = ( 08FB77AFFE84173DC02AAC07 /* Classes */, 32C88E010371C26100C91783 /* Other Sources */, 089C167CFE841241C02AAC07 /* Resources */, 089C1671FE841209C02AAC07 /* Frameworks and Libraries */, 19C28FB8FE9D52D311CA2CBB /* Products */, ); name = InstallerPlugin; sourceTree = "<group>"; }; 089C1671FE841209C02AAC07 /* Frameworks and Libraries */ = { isa = PBXGroup; children = ( 1058C7ACFEA557BF11CA2CBB /* Linked Frameworks */, 1058C7AEFEA557BF11CA2CBB /* Other Frameworks */, ); name = "Frameworks and Libraries"; sourceTree = "<group>"; }; 089C167CFE841241C02AAC07 /* Resources */ = { isa = PBXGroup; children = ( B47CF353067B4E030066DBF6 /* Localizable.strings */, B4A6B2A60673D523003CD9B2 /* InstallerSections.plist */, 8D5B49B7048680CD000E48DA /* Info.plist */, 089C167DFE841241C02AAC07 /* InfoPlist.strings */, B40F802706739F480053A16B /* ocs_agent_config.nib */, 0649FBA214D9F106001EC640 /* InfoPlist.strings */, ); name = Resources; sourceTree = "<group>"; }; 08FB77AFFE84173DC02AAC07 /* Classes */ = { isa = PBXGroup; children = ( B44C200906739AE500D31AA1 /* ocs_agent_configPane.m */, B44C200806739AE500D31AA1 /* ocs_agent_configPane.h */, ); name = Classes; sourceTree = "<group>"; }; 1058C7ACFEA557BF11CA2CBB /* Linked Frameworks */ = { isa = PBXGroup; children = ( 1058C7ADFEA557BF11CA2CBB /* Cocoa.framework */, B40F7FFB06739E1B0053A16B /* InstallerPlugins.framework */, ); name = "Linked Frameworks"; sourceTree = "<group>"; }; 1058C7AEFEA557BF11CA2CBB /* Other Frameworks */ = { isa = PBXGroup; children = ( 089C1672FE841209C02AAC07 /* Foundation.framework */, 089C167FFE841241C02AAC07 /* AppKit.framework */, ); name = "Other Frameworks"; sourceTree = "<group>"; }; 19C28FB8FE9D52D311CA2CBB /* Products */ = { isa = PBXGroup; children = ( 0638EF1412E6DA96006FF673 /* ocs_agent_config.bundle */, ); name = Products; sourceTree = "<group>"; }; 32C88E010371C26100C91783 /* Other Sources */ = { isa = PBXGroup; children = ( 32DBCF630370AF2F00C91783 /* ocs_agent_config_Prefix.pch */, ); name = "Other Sources"; sourceTree = "<group>"; }; /* End PBXGroup section */ /* Begin PBXNativeTarget section */ 8D5B49AC048680CD000E48DA /* OCS Agent configuration */ = { isa = PBXNativeTarget; buildConfigurationList = B44174E608BA33C40065BEDE /* Build configuration list for PBXNativeTarget "OCS Agent configuration" */; buildPhases = ( 8D5B49AF048680CD000E48DA /* Resources */, 8D5B49B1048680CD000E48DA /* Sources */, 8D5B49B3048680CD000E48DA /* Frameworks */, ); buildRules = ( ); dependencies = ( ); name = "OCS Agent configuration"; productInstallPath = "$(HOME)/Library/Bundles"; productName = InstallerPlugin; productReference = 0638EF1412E6DA96006FF673 /* ocs_agent_config.bundle */; productType = "com.apple.product-type.bundle"; }; /* End PBXNativeTarget section */ /* Begin PBXProject section */ 089C1669FE841209C02AAC07 /* Project object */ = { isa = PBXProject; attributes = { LastUpgradeCheck = 0900; }; buildConfigurationList = B44174EA08BA33C40065BEDE /* Build configuration list for PBXProject "ocs_agent_config" */; compatibilityVersion = "Xcode 2.4"; developmentRegion = English; hasScannedForEncodings = 1; knownRegions = ( English, Japanese, French, German, ); mainGroup = 089C166AFE841209C02AAC07 /* InstallerPlugin */; projectDirPath = ""; projectRoot = ""; targets = ( 8D5B49AC048680CD000E48DA /* OCS Agent configuration */, ); }; /* End PBXProject section */ /* Begin PBXResourcesBuildPhase section */ 8D5B49AF048680CD000E48DA /* Resources */ = { isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( 8D5B49B0048680CD000E48DA /* InfoPlist.strings in Resources */, B40F802906739F480053A16B /* ocs_agent_config.nib in Resources */, B47CF355067B4E030066DBF6 /* Localizable.strings in Resources */, 0649FBA314D9F106001EC640 /* InfoPlist.strings in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXResourcesBuildPhase section */ /* Begin PBXSourcesBuildPhase section */ 8D5B49B1048680CD000E48DA /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( B44C200B06739AE500D31AA1 /* ocs_agent_configPane.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXSourcesBuildPhase section */ /* Begin PBXVariantGroup section */ 0649FBA214D9F106001EC640 /* InfoPlist.strings */ = { isa = PBXVariantGroup; children = ( 0649FBA014D9F0FD001EC640 /* English */, 0649FBA414D9F110001EC640 /* French */, ); name = InfoPlist.strings; sourceTree = "<group>"; }; 089C167DFE841241C02AAC07 /* InfoPlist.strings */ = { isa = PBXVariantGroup; children = ( 089C167EFE841241C02AAC07 /* English */, 0649FBA514D9F123001EC640 /* French */, ); name = InfoPlist.strings; sourceTree = "<group>"; }; B40F802706739F480053A16B /* ocs_agent_config.nib */ = { isa = PBXVariantGroup; children = ( B40F802806739F480053A16B /* English */, 0649FB6414D9E877001EC640 /* French */, ); name = ocs_agent_config.nib; sourceTree = "<group>"; }; B47CF353067B4E030066DBF6 /* Localizable.strings */ = { isa = PBXVariantGroup; children = ( B47CF354067B4E030066DBF6 /* English */, 0632F49314DB45F00064D8E2 /* French */, ); name = Localizable.strings; sourceTree = "<group>"; }; /* End PBXVariantGroup section */ /* Begin XCBuildConfiguration section */ B44174E708BA33C40065BEDE /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { COPY_PHASE_STRIP = NO; GCC_DYNAMIC_NO_PIC = NO; GCC_ENABLE_FIX_AND_CONTINUE = YES; GCC_MODEL_TUNING = G5; GCC_OPTIMIZATION_LEVEL = 0; GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = ocs_agent_config_Prefix.pch; GCC_VERSION = com.apple.compilers.llvm.clang.1_0; INFOPLIST_FILE = Info.plist; INSTALL_PATH = "$(HOME)/Library/Bundles"; PRODUCT_BUNDLE_IDENTIFIER = "org.ocsinventory-ng.${PRODUCT_NAME:identifier}"; PRODUCT_NAME = ocs_agent_config; SDKROOT = "$(DEVELOPER_SDK_DIR)/MacOSX10.11.sdk"; WRAPPER_EXTENSION = bundle; ZERO_LINK = YES; }; name = Debug; }; B44174E808BA33C40065BEDE /* Release */ = { isa = XCBuildConfiguration; buildSettings = { GCC_GENERATE_DEBUGGING_SYMBOLS = NO; GCC_MODEL_TUNING = G5; GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = ocs_agent_config_Prefix.pch; GCC_VERSION = com.apple.compilers.llvm.clang.1_0; INFOPLIST_FILE = Info.plist; INSTALL_PATH = "$(HOME)/Library/Bundles"; PRODUCT_BUNDLE_IDENTIFIER = "org.ocsinventory-ng.${PRODUCT_NAME:identifier}"; PRODUCT_NAME = ocs_agent_config; SDKROOT = "$(DEVELOPER_SDK_DIR)/MacOSX10.11.sdk"; WRAPPER_EXTENSION = bundle; }; name = Release; }; B44174EB08BA33C40065BEDE /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; ENABLE_TESTABILITY = YES; GCC_VERSION = 4.0; GCC_WARN_ABOUT_RETURN_TYPE = YES; GCC_WARN_UNUSED_VARIABLE = YES; MACOSX_DEPLOYMENT_TARGET = 10.11; ONLY_ACTIVE_ARCH = YES; PREBINDING = NO; SDKROOT = "$(DEVELOPER_SDK_DIR)/MacOSX10.11.sdk"; STRINGS_FILE_OUTPUT_ENCODING = "UTF-8"; VALID_ARCHS = "i386 x86_64"; }; name = Debug; }; B44174EC08BA33C40065BEDE /* Release */ = { isa = XCBuildConfiguration; buildSettings = { CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; GCC_VERSION = 4.0; GCC_WARN_ABOUT_RETURN_TYPE = YES; GCC_WARN_UNUSED_VARIABLE = YES; MACOSX_DEPLOYMENT_TARGET = 10.11; "MACOSX_DEPLOYMENT_TARGET[arch=x86_64]" = 10.11; PREBINDING = NO; SDKROOT = "$(DEVELOPER_SDK_DIR)/MacOSX10.11.sdk"; STRINGS_FILE_OUTPUT_ENCODING = "UTF-8"; VALID_ARCHS = "i386 x86_64"; }; name = Release; }; /* End XCBuildConfiguration section */ /* Begin XCConfigurationList section */ B44174E608BA33C40065BEDE /* Build configuration list for PBXNativeTarget "OCS Agent configuration" */ = { isa = XCConfigurationList; buildConfigurations = ( B44174E708BA33C40065BEDE /* Debug */, B44174E808BA33C40065BEDE /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; B44174EA08BA33C40065BEDE /* Build configuration list for PBXProject "ocs_agent_config" */ = { isa = XCConfigurationList; buildConfigurations = ( B44174EB08BA33C40065BEDE /* Debug */, B44174EC08BA33C40065BEDE /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; /* End XCConfigurationList section */ }; rootObject = 089C1669FE841209C02AAC07 /* Project object */; } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������UnixAgent-2.4.2/tools/macosx/installer_gui/ocs_agent_config/ocs_agent_configPane.h������������������0000664�0000000�0000000�00000001657�13327377321�0030470�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// // OCSINVENTORY-NG // // Copyleft Guillaume PROTET 2011 // // // This code is open source and may be copied and modified as long as the source // code is always made freely available. // Please refer to the General Public Licence http://www.gnu.org/ // // #import <Cocoa/Cocoa.h> #import <InstallerPlugins/InstallerPlugins.h> @interface ocs_agent_configPane : InstallerPane { IBOutlet NSTextField *server; IBOutlet NSTextField *tag; IBOutlet NSTextField *logfile; IBOutlet NSTextField *cacertfile; IBOutlet NSButton *debugmode; IBOutlet NSButton *lazymode; IBOutlet NSButton *download; IBOutlet NSButton *ssl; IBOutlet NSPopUpButton *protocolist; NSFileManager *filemgr; NSString *tmpCfgFilePath; NSString *tmpModulesFilePath; NSString *tmpServerdirFilePath; NSString *tmpCacertFilePath; } - (IBAction) getConfig:(id)sender ; - (IBAction) chooseCacertFile:(id)sender; - (IBAction) chooseProtocol:(id)sender; @end ���������������������������������������������������������������������������������UnixAgent-2.4.2/tools/macosx/installer_gui/ocs_agent_config/ocs_agent_configPane.m������������������0000664�0000000�0000000�00000022107�13327377321�0030466�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// // OCSINVENTORY-NG // // Copyleft Guillaume PROTET 2011 // // // This code is open source and may be copied and modified as long as the source // code is always made freely available. // Please refer to the General Public Licence http://www.gnu.org/ // // #import "ocs_agent_configPane.h" @implementation ocs_agent_configPane - (NSString *)title { return [[NSBundle bundleForClass:[self class]] localizedStringForKey:@"PaneTitle" value:nil table:nil]; } - (NSArray *) protocols { return [NSArray arrayWithObjects:@"http", @"https", nil]; } - (void)didEnterPane:(InstallerSectionDirection)dir { NSAlert *cfgFileExistsWrn; NSString *tmpPath = @"/tmp/ocs_installer"; filemgr = [ NSFileManager defaultManager]; tmpCfgFilePath = @"/tmp/ocs_installer/ocsinventory-agent.cfg"; tmpModulesFilePath = @"/tmp/ocs_installer/modules.conf"; tmpServerdirFilePath = @"/tmp/ocs_installer/serverdir"; tmpCacertFilePath = @"/tmp/ocs_installer/cacert.pem"; //Checking if temp directory exists if ([filemgr fileExistsAtPath:tmpPath]) { [filemgr removeItemAtPath:tmpCfgFilePath error:nil]; [filemgr removeItemAtPath:tmpModulesFilePath error:nil]; [filemgr removeItemAtPath:tmpServerdirFilePath error:nil]; [filemgr removeItemAtPath:tmpCacertFilePath error:nil]; } else { [filemgr createDirectoryAtPath:tmpPath withIntermediateDirectories:true attributes:nil error:nil]; } if ([filemgr fileExistsAtPath:@"/etc/ocsinventory-agent/ocsinventory-agent.cfg"]) { //We display a warning dialog cfgFileExistsWrn = [[NSAlert alloc] init]; [cfgFileExistsWrn setMessageText:NSLocalizedStringFromTableInBundle(@"Already_conf_warn",nil,[NSBundle bundleForClass:[self class]], @"Warning about already existing cofiguration file")]; [cfgFileExistsWrn setInformativeText:NSLocalizedStringFromTableInBundle(@"Already_conf_warn_comment",nil,[NSBundle bundleForClass:[self class]], @"Warning about already existing cofiguration file comment")]; [cfgFileExistsWrn addButtonWithTitle:NSLocalizedStringFromTableInBundle(@"Yes",nil,[NSBundle bundleForClass:[self class]], @"Yes button")]; [cfgFileExistsWrn addButtonWithTitle:NSLocalizedStringFromTableInBundle(@"No",nil,[NSBundle bundleForClass:[self class]], @"No button")]; [cfgFileExistsWrn setAlertStyle:NSInformationalAlertStyle]; if ([cfgFileExistsWrn runModal] != NSAlertFirstButtonReturn) { // No button was clicked, we don't display config pane [self gotoNextPane]; } [cfgFileExistsWrn release]; } // fill defaults values [server setStringValue:@"ocsinventory-ng"]; [logfile setStringValue:@"/var/log/ocsng.log"]; [debugmode setState:1]; [lazymode setState:0]; [download setState:1]; [ssl setState:1]; //Defaults for protocol droping list [protocolist removeAllItems]; [protocolist addItemWithTitle: @"http://"]; [protocolist addItemWithTitle: @"https://"]; [protocolist selectItemWithTitle: @"http://"]; } - (IBAction) chooseCacertFile:(id)sender { NSOpenPanel *panel = [NSOpenPanel openPanel]; NSArray* fileTypes = [[NSArray alloc] initWithObjects:@"pem",@"PEM",@"crt",@"CRT",nil]; //Configuration for the browse panel [panel setCanChooseDirectories:NO]; [panel setCanChooseFiles:YES]; [panel setAllowsMultipleSelection:NO]; [panel setAllowedFileTypes:fileTypes]; // Get panel return value NSInteger clicked = [panel runModal]; // If OK clicked only if (clicked == NSFileHandlingPanelOKButton) { for (NSURL *url in [panel URLs]) { // do something with the url here. NSString *path = url.path; [cacertfile setStringValue:path]; } } } - (IBAction) chooseProtocol:(id)sender { NSString *protocol = [protocolist titleOfSelectedItem]; //We show the selected protocol [protocolist setTitle:protocol]; } - (IBAction) getConfig:(id)sender { BOOL srvAddrChk; // enable the Continue button only if server address filled srvAddrChk = ([[server stringValue] length] > 0); [self setNextEnabled:srvAddrChk]; } - (BOOL)shouldExitPane:(InstallerSectionDirection)Direction { NSMutableString *ocsAgentCfgContent; NSMutableString *modulesCfgContent; NSString *serverDir; NSMutableString *protocolName; NSAlert *srvConfigWrn; NSAlert *caCertWrn; NSString *protocol = [protocolist titleOfSelectedItem]; // check the direction of movement if (Direction == InstallerDirectionForward) { if ( [[server stringValue] length] > 0) { ocsAgentCfgContent = [@"server=" mutableCopy]; //Adding server value to the mutable string [ocsAgentCfgContent appendString:protocol]; [ocsAgentCfgContent appendString:[server objectValue]]; [ocsAgentCfgContent appendString:@"/ocsinventory"]; [ocsAgentCfgContent appendString:@"\n"]; //if tag filled if ( [[tag stringValue] length] > 0) { [ocsAgentCfgContent appendString:@"tag="]; [ocsAgentCfgContent appendString:[tag objectValue]]; [ocsAgentCfgContent appendString:@"\n"]; } //if logfile filled if ( [[logfile stringValue] length] > 0) { [ocsAgentCfgContent appendString:@"logfile="]; [ocsAgentCfgContent appendString:[logfile objectValue]]; [ocsAgentCfgContent appendString:@"\n"]; } //if debugmode checked if ([debugmode state] == 1) { [ocsAgentCfgContent appendString:@"debug=1\n"]; } else { [ocsAgentCfgContent appendString:@"debug=0\n"]; } //if lazymode checked if ([lazymode state] == 1) { [ocsAgentCfgContent appendString:@"lazy=1\n"]; } else { [ocsAgentCfgContent appendString:@"lazy=0\n"]; } //if ssl checked if ([ssl state] == 1) { [ocsAgentCfgContent appendString:@"ssl=1\n"]; } else { [ocsAgentCfgContent appendString:@"ssl=0\n"]; } //Writing to ocsinventory agent configuration file [ocsAgentCfgContent writeToFile:tmpCfgFilePath atomically: YES encoding:NSUTF8StringEncoding error:NULL]; modulesCfgContent = [@"# this list of module will be load by the at run time\n" @"# to check its syntax do:\n" @"# #perl modules.conf\n" @"# You must have NO error. Else the content will be ignored\n" @"# This mechanism goal it to keep compatibility with 'plugin'\n" @"# created for the previous linux_agent.\n" @"# The new unified_agent have its own extension system that allow\n" @"# user to add new information easily.\n" @"\n" @"#use Ocsinventory::Agent::Modules::Example;\n" mutableCopy]; //if download checked if ( [download state] == 1) { [modulesCfgContent appendString:@"use Ocsinventory::Agent::Modules::Download;\n" @"\n" @"# DO NOT REMOVE THE 1;\n" @"1;" ]; } else { [modulesCfgContent appendString:@"#use Ocsinventory::Agent::Modules::Download;\n" @"\n" @"# DO NOT REMOVE THE 1;\n" @"1;" ]; } //Writing to modules configuration file [modulesCfgContent writeToFile:tmpModulesFilePath atomically: YES encoding:NSUTF8StringEncoding error:NULL]; //We have to copy cacert.pem if is asked by user if ( [[cacertfile stringValue] length] > 0) { protocolName = [protocol mutableCopy]; [protocolName replaceOccurrencesOfString:@"/" withString:@"" options:NSCaseInsensitiveSearch range:NSMakeRange(0, [protocolName length])]; serverDir = [NSString stringWithFormat:@"/var/lib/ocsinventory-agent/%@__%@_ocsinventory", protocolName, [server objectValue]]; [serverDir writeToFile:tmpServerdirFilePath atomically: YES encoding:NSUTF8StringEncoding error:NULL]; [filemgr copyItemAtPath:[cacertfile objectValue] toPath:tmpCacertFilePath error:nil]; } if ( [download state] == 1 && [ssl state] == 1 && [[cacertfile stringValue] length] == 0 ) { //We display a warning dialog caCertWrn = [[NSAlert alloc] init]; [caCertWrn addButtonWithTitle:@"OK"]; [caCertWrn setMessageText:NSLocalizedStringFromTableInBundle(@"Missing_cert_warn",nil,[NSBundle bundleForClass:[self class]], @"Warning about missing certificate file")]; [caCertWrn setInformativeText:NSLocalizedStringFromTableInBundle(@"Missing_cert_warn_comment",nil,[NSBundle bundleForClass:[self class]], @"Warning about missing certificate file comment")]; [caCertWrn setAlertStyle:NSInformationalAlertStyle]; [caCertWrn runModal]; // display the warning dialog [caCertWrn release]; // dispose the warning dialog } } else { //We display a warning dialog srvConfigWrn = [[NSAlert alloc] init]; [srvConfigWrn addButtonWithTitle:@"OK"]; [srvConfigWrn setMessageText:NSLocalizedStringFromTableInBundle(@"Invalid_srv_addr",nil,[NSBundle bundleForClass:[self class]], @"Warning about invalid server address")]; [srvConfigWrn setInformativeText:NSLocalizedStringFromTableInBundle(@"Invalid_srv_addr_comment",nil,[NSBundle bundleForClass:[self class]], @"Warning about invalid server address comment")]; [srvConfigWrn setAlertStyle:NSInformationalAlertStyle]; [srvConfigWrn runModal]; [srvConfigWrn release]; [self gotoPreviousPane]; } } return (YES); } @end ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������UnixAgent-2.4.2/tools/macosx/installer_gui/ocs_agent_config/ocs_agent_config_Prefix.pch�������������0000664�0000000�0000000�00000000242�13327377321�0031511�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// // Prefix header for all source files of the 'InstallerPlugin' target in the 'InstallerPlugin' project. // #ifdef __OBJC__ #import <Cocoa/Cocoa.h> #endif ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������UnixAgent-2.4.2/tools/macosx/installer_gui/ocs_agent_config/version.plist���������������������������0000664�0000000�0000000�00000000632�13327377321�0026756�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict> <key>BuildVersion</key> <string>2</string> <key>CFBundleVersion</key> <string>1.0</string> <key>ProjectName</key> <string>DevToolsWizardTemplates</string> <key>SourceVersion</key> <string>3670000</string> </dict> </plist> ������������������������������������������������������������������������������������������������������UnixAgent-2.4.2/tools/macosx/installer_gui/ocs_agent_daemon_options/��������������������������������0000775�0000000�0000000�00000000000�13327377321�0025764�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������UnixAgent-2.4.2/tools/macosx/installer_gui/ocs_agent_daemon_options/English.lproj/������������������0000775�0000000�0000000�00000000000�13327377321�0030502�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������UnixAgent-2.4.2/tools/macosx/installer_gui/ocs_agent_daemon_options/English.lproj/InfoPlist.strings�0000664�0000000�0000000�00000001452�13327377321�0034026�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/�/� �/�/� �O�C�S�I�N�V�E�N�T�O�R�Y�-�N�G� �/�/� �/�/� �C�o�p�y�l�e�f�t� �G�u�i�l�l�a�u�m�e� �P�R�O�T�E�T� �2�0�1�1� �/�/� � �/�/� �/�/� �T�h�i�s� �c�o�d�e� �i�s� �o�p�e�n� �s�o�u�r�c�e� �a�n�d� �m�a�y� �b�e� �c�o�p�i�e�d� �a�n�d� �m�o�d�i�f�i�e�d� �a�s� �l�o�n�g� �a�s� �t�h�e� �s�o�u�r�c�e� �/�/� �c�o�d�e� �i�s� �a�l�w�a�y�s� �m�a�d�e� �f�r�e�e�l�y� �a�v�a�i�l�a�b�l�e�.� �/�/� �P�l�e�a�s�e� �r�e�f�e�r� �t�o� �t�h�e� �G�e�n�e�r�a�l� �P�u�b�l�i�c� �L�i�c�e�n�c�e� �h�t�t�p�:�/�/�w�w�w�.�g�n�u�.�o�r�g�/� �/�/� �/�/� � �/�/� �L�o�c�a�l�i�z�e�d� �v�e�r�s�i�o�n�s� �o�f� �I�n�f�o�.�p�l�i�s�t� �k�e�y�s� �N�S�H�u�m�a�n�R�e�a�d�a�b�l�e�C�o�p�y�r�i�g�h�t� �=� �"�C�o�p�y�l�e�f�t� �G�u�i�l�l�a�u�m�e� �P�R�O�T�E�T� �2�0�1�1�"�;� �I�n�s�t�a�l�l�e�r�S�e�c�t�i�o�n�T�i�t�l�e� �=� �"�D�a�e�m�o�n� �o�p�t�i�o�n�s�"�;�����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������Localizable.strings���������������������������������������������������������������������������������0000664�0000000�0000000�00000001760�13327377321�0034263�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�UnixAgent-2.4.2/tools/macosx/installer_gui/ocs_agent_daemon_options/English.lproj��������������������������������������������������������������������������������������/�/� �/�/� �O�C�S�I�N�V�E�N�T�O�R�Y�-�N�G� �/�/� �/�/� �C�o�p�y�l�e�f�t� �G�u�i�l�l�a�u�m�e� �P�R�O�T�E�T� �2�0�1�1� �/�/� � �/�/� �/�/� �T�h�i�s� �c�o�d�e� �i�s� �o�p�e�n� �s�o�u�r�c�e� �a�n�d� �m�a�y� �b�e� �c�o�p�i�e�d� �a�n�d� �m�o�d�i�f�i�e�d� �a�s� �l�o�n�g� �a�s� �t�h�e� �s�o�u�r�c�e� �/�/� �c�o�d�e� �i�s� �a�l�w�a�y�s� �m�a�d�e� �f�r�e�e�l�y� �a�v�a�i�l�a�b�l�e�.� �/�/� �P�l�e�a�s�e� �r�e�f�e�r� �t�o� �t�h�e� �G�e�n�e�r�a�l� �P�u�b�l�i�c� �L�i�c�e�n�c�e� �h�t�t�p�:�/�/�w�w�w�.�g�n�u�.�o�r�g�/� �/�/� �/�/� � �/�/� �L�o�c�a�l�i�z�e�d� �v�e�r�s�i�o�n�s� �o�f� �I�n�f�o�.�p�l�i�s�t� �k�e�y�s� �"�P�a�n�e�T�i�t�l�e�"� �=� �"�O�C�S� �a�g�e�n�t� �d�a�e�m�o�n� �o�p�t�i�o�n�s�"�;� � �/�/�P�e�r�i�d�o�c�i�t�y� �w�a�r�n� �"�P�e�r�i�o�d�i�c�i�t�y�_�w�a�r�n�"�=�"�I�n�v�a�l�i�d� �p�e�r�i�o�d�i�c�i�t�y� �v�a�l�u�e�"�;� � �/�/�P�e�r�i�o�d�i�c�i�t�y� �w�a�r�n� �c�o�m�m�e�n�t� �"�P�e�r�i�o�d�i�c�i�t�y�_�w�a�r�n�_�c�o�m�m�e�n�t�"�=�"�P�l�e�a�s�e� �e�n�t�e�r� �a� �v�a�l�i�d� �n�u�m�b�e�r� �v�a�l�u�e�"�;� �����������������ocs_agent_daemon_options.xib������������������������������������������������������������������������0000664�0000000�0000000�00000126524�13327377321�0036201�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�UnixAgent-2.4.2/tools/macosx/installer_gui/ocs_agent_daemon_options/English.lproj��������������������������������������������������������������������������������������<?xml version="1.0" encoding="UTF-8"?> <archive type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="7.10"> <data> <int key="IBDocument.SystemTarget">0</int> <string key="IBDocument.SystemVersion">10K540</string> <string key="IBDocument.InterfaceBuilderVersion">851</string> <string key="IBDocument.AppKitVersion">1038.36</string> <string key="IBDocument.HIToolboxVersion">461.00</string> <object class="NSMutableDictionary" key="IBDocument.PluginVersions"> <string key="NS.key.0">com.apple.InterfaceBuilder.CocoaPlugin</string> <string key="NS.object.0">851</string> </object> <object class="NSMutableArray" key="IBDocument.EditedObjectIDs"> <bool key="EncodedWithXMLCoder">YES</bool> <integer value="8"/> </object> <object class="NSArray" key="IBDocument.PluginDependencies"> <bool key="EncodedWithXMLCoder">YES</bool> <string>com.apple.InterfaceBuilder.CocoaPlugin</string> </object> <object class="NSMutableDictionary" key="IBDocument.Metadata"> <string key="NS.key.0">PluginDependencyRecalculationVersion</string> <integer value="1" key="NS.object.0"/> </object> <object class="NSMutableArray" key="IBDocument.RootObjects" id="995885815"> <bool key="EncodedWithXMLCoder">YES</bool> <object class="NSCustomObject" id="533019728"> <string key="NSClassName">InstallerSection</string> </object> <object class="NSCustomObject" id="304932500"> <string key="NSClassName">FirstResponder</string> </object> <object class="NSCustomObject" id="521373648"> <string key="NSClassName">ocs_agent_daemon_optionsPane</string> </object> <object class="NSCustomView" id="878039515"> <reference key="NSNextResponder"/> <int key="NSvFlags">256</int> <object class="NSMutableArray" key="NSSubviews"> <bool key="EncodedWithXMLCoder">YES</bool> <object class="NSTextField" id="566571413"> <reference key="NSNextResponder" ref="878039515"/> <int key="NSvFlags">268</int> <string key="NSFrame">{{286, 221}, {49, 17}}</string> <reference key="NSSuperview" ref="878039515"/> <bool key="NSEnabled">YES</bool> <object class="NSTextFieldCell" key="NSCell" id="436802917"> <int key="NSCellFlags">68288064</int> <int key="NSCellFlags2">272630784</int> <string key="NSContents">hour(s)</string> <object class="NSFont" key="NSSupport" id="531741455"> <string key="NSName">LucidaGrande</string> <double key="NSSize">13</double> <int key="NSfFlags">1044</int> </object> <reference key="NSControlView" ref="566571413"/> <object class="NSColor" key="NSBackgroundColor" id="719882935"> <int key="NSColorSpace">6</int> <string key="NSCatalogName">System</string> <string key="NSColorName">controlColor</string> <object class="NSColor" key="NSColor"> <int key="NSColorSpace">3</int> <bytes key="NSWhite">MC42NjY2NjY2NjY3AA</bytes> </object> </object> <object class="NSColor" key="NSTextColor" id="748922370"> <int key="NSColorSpace">6</int> <string key="NSCatalogName">System</string> <string key="NSColorName">controlTextColor</string> <object class="NSColor" key="NSColor" id="476741409"> <int key="NSColorSpace">3</int> <bytes key="NSWhite">MAA</bytes> </object> </object> </object> </object> <object class="NSTextField" id="136445426"> <reference key="NSNextResponder" ref="878039515"/> <int key="NSvFlags">268</int> <string key="NSFrame">{{61, 221}, {157, 17}}</string> <reference key="NSSuperview" ref="878039515"/> <bool key="NSEnabled">YES</bool> <object class="NSTextFieldCell" key="NSCell" id="249338464"> <int key="NSCellFlags">68288064</int> <int key="NSCellFlags2">272630784</int> <string key="NSContents">Launch OCS agent every</string> <reference key="NSSupport" ref="531741455"/> <reference key="NSControlView" ref="136445426"/> <reference key="NSBackgroundColor" ref="719882935"/> <reference key="NSTextColor" ref="748922370"/> </object> </object> <object class="NSTextField" id="789897599"> <reference key="NSNextResponder" ref="878039515"/> <int key="NSvFlags">268</int> <string key="NSFrame">{{228, 218}, {53, 22}}</string> <reference key="NSSuperview" ref="878039515"/> <bool key="NSEnabled">YES</bool> <object class="NSTextFieldCell" key="NSCell" id="710676000"> <int key="NSCellFlags">-1804468671</int> <int key="NSCellFlags2">71304192</int> <string key="NSContents"/> <reference key="NSSupport" ref="531741455"/> <reference key="NSControlView" ref="789897599"/> <bool key="NSDrawsBackground">YES</bool> <object class="NSColor" key="NSBackgroundColor"> <int key="NSColorSpace">6</int> <string key="NSCatalogName">System</string> <string key="NSColorName">textBackgroundColor</string> <object class="NSColor" key="NSColor"> <int key="NSColorSpace">3</int> <bytes key="NSWhite">MQA</bytes> </object> </object> <object class="NSColor" key="NSTextColor"> <int key="NSColorSpace">6</int> <string key="NSCatalogName">System</string> <string key="NSColorName">textColor</string> <reference key="NSColor" ref="476741409"/> </object> </object> </object> <object class="NSButton" id="735987645"> <reference key="NSNextResponder" ref="878039515"/> <int key="NSvFlags">268</int> <string key="NSFrame">{{62, 166}, {267, 18}}</string> <reference key="NSSuperview" ref="878039515"/> <bool key="NSEnabled">YES</bool> <object class="NSButtonCell" key="NSCell" id="420447138"> <int key="NSCellFlags">-2080244224</int> <int key="NSCellFlags2">0</int> <string key="NSContents">Launch OCS agent at daemon start</string> <reference key="NSSupport" ref="531741455"/> <reference key="NSControlView" ref="735987645"/> <int key="NSButtonFlags">1211912703</int> <int key="NSButtonFlags2">2</int> <object class="NSCustomResource" key="NSNormalImage" id="665758281"> <string key="NSClassName">NSImage</string> <string key="NSResourceName">NSSwitch</string> </object> <object class="NSButtonImageSource" key="NSAlternateImage" id="534174978"> <string key="NSImageName">NSSwitch</string> </object> <string key="NSAlternateContents"/> <string key="NSKeyEquivalent"/> <int key="NSPeriodicDelay">200</int> <int key="NSPeriodicInterval">25</int> </object> </object> <object class="NSButton" id="59704994"> <reference key="NSNextResponder" ref="878039515"/> <int key="NSvFlags">268</int> <string key="NSFrame">{{62, 131}, {213, 18}}</string> <reference key="NSSuperview" ref="878039515"/> <bool key="NSEnabled">YES</bool> <object class="NSButtonCell" key="NSCell" id="945206299"> <int key="NSCellFlags">-2080244224</int> <int key="NSCellFlags2">0</int> <string key="NSContents">Launch daemon after install</string> <reference key="NSSupport" ref="531741455"/> <reference key="NSControlView" ref="59704994"/> <int key="NSButtonFlags">1211912703</int> <int key="NSButtonFlags2">2</int> <reference key="NSNormalImage" ref="665758281"/> <reference key="NSAlternateImage" ref="534174978"/> <string key="NSAlternateContents"/> <string key="NSKeyEquivalent"/> <int key="NSPeriodicDelay">200</int> <int key="NSPeriodicInterval">25</int> </object> </object> </object> <string key="NSFrameSize">{418, 330}</string> <reference key="NSSuperview"/> <object class="NSMutableString" key="NSClassName"> <characters key="NS.bytes">NSView</characters> </object> <string key="NSExtension">NSResponder</string> </object> <object class="NSCustomObject" id="330240596"> <string key="NSClassName">NSApplication</string> </object> </object> <object class="IBObjectContainer" key="IBDocument.Objects"> <object class="NSMutableArray" key="connectionRecords"> <bool key="EncodedWithXMLCoder">YES</bool> <object class="IBConnectionRecord"> <object class="IBOutletConnection" key="connection"> <string key="label">firstPane</string> <reference key="source" ref="533019728"/> <reference key="destination" ref="521373648"/> </object> <int key="connectionID">6</int> </object> <object class="IBConnectionRecord"> <object class="IBOutletConnection" key="connection"> <string key="label">parentSection</string> <reference key="source" ref="521373648"/> <reference key="destination" ref="533019728"/> </object> <int key="connectionID">7</int> </object> <object class="IBConnectionRecord"> <object class="IBOutletConnection" key="connection"> <string key="label">contentView</string> <reference key="source" ref="521373648"/> <reference key="destination" ref="878039515"/> </object> <int key="connectionID">9</int> </object> <object class="IBConnectionRecord"> <object class="IBOutletConnection" key="connection"> <string key="label">startup</string> <reference key="source" ref="521373648"/> <reference key="destination" ref="735987645"/> </object> <int key="connectionID">21</int> </object> <object class="IBConnectionRecord"> <object class="IBOutletConnection" key="connection"> <string key="label">now</string> <reference key="source" ref="521373648"/> <reference key="destination" ref="59704994"/> </object> <int key="connectionID">22</int> </object> <object class="IBConnectionRecord"> <object class="IBOutletConnection" key="connection"> <string key="label">periodicity</string> <reference key="source" ref="521373648"/> <reference key="destination" ref="789897599"/> </object> <int key="connectionID">23</int> </object> </object> <object class="IBMutableOrderedSet" key="objectRecords"> <object class="NSArray" key="orderedObjects"> <bool key="EncodedWithXMLCoder">YES</bool> <object class="IBObjectRecord"> <int key="objectID">0</int> <object class="NSArray" key="object" id="0"> <bool key="EncodedWithXMLCoder">YES</bool> </object> <reference key="children" ref="995885815"/> <nil key="parent"/> </object> <object class="IBObjectRecord"> <int key="objectID">-2</int> <reference key="object" ref="533019728"/> <reference key="parent" ref="0"/> <string key="objectName">File's Owner</string> </object> <object class="IBObjectRecord"> <int key="objectID">-1</int> <reference key="object" ref="304932500"/> <reference key="parent" ref="0"/> <string key="objectName">First Responder</string> </object> <object class="IBObjectRecord"> <int key="objectID">5</int> <reference key="object" ref="521373648"/> <reference key="parent" ref="0"/> <string key="objectName">ocs_agent_daemon_optionsPane</string> </object> <object class="IBObjectRecord"> <int key="objectID">8</int> <reference key="object" ref="878039515"/> <object class="NSMutableArray" key="children"> <bool key="EncodedWithXMLCoder">YES</bool> <reference ref="789897599"/> <reference ref="136445426"/> <reference ref="566571413"/> <reference ref="59704994"/> <reference ref="735987645"/> </object> <reference key="parent" ref="0"/> <string key="objectName">View</string> </object> <object class="IBObjectRecord"> <int key="objectID">-3</int> <reference key="object" ref="330240596"/> <reference key="parent" ref="0"/> <string key="objectName">Application</string> </object> <object class="IBObjectRecord"> <int key="objectID">11</int> <reference key="object" ref="59704994"/> <object class="NSMutableArray" key="children"> <bool key="EncodedWithXMLCoder">YES</bool> <reference ref="945206299"/> </object> <reference key="parent" ref="878039515"/> </object> <object class="IBObjectRecord"> <int key="objectID">12</int> <reference key="object" ref="945206299"/> <reference key="parent" ref="59704994"/> </object> <object class="IBObjectRecord"> <int key="objectID">13</int> <reference key="object" ref="735987645"/> <object class="NSMutableArray" key="children"> <bool key="EncodedWithXMLCoder">YES</bool> <reference ref="420447138"/> </object> <reference key="parent" ref="878039515"/> </object> <object class="IBObjectRecord"> <int key="objectID">14</int> <reference key="object" ref="420447138"/> <reference key="parent" ref="735987645"/> </object> <object class="IBObjectRecord"> <int key="objectID">15</int> <reference key="object" ref="789897599"/> <object class="NSMutableArray" key="children"> <bool key="EncodedWithXMLCoder">YES</bool> <reference ref="710676000"/> </object> <reference key="parent" ref="878039515"/> </object> <object class="IBObjectRecord"> <int key="objectID">16</int> <reference key="object" ref="710676000"/> <reference key="parent" ref="789897599"/> </object> <object class="IBObjectRecord"> <int key="objectID">17</int> <reference key="object" ref="136445426"/> <object class="NSMutableArray" key="children"> <bool key="EncodedWithXMLCoder">YES</bool> <reference ref="249338464"/> </object> <reference key="parent" ref="878039515"/> </object> <object class="IBObjectRecord"> <int key="objectID">18</int> <reference key="object" ref="249338464"/> <reference key="parent" ref="136445426"/> </object> <object class="IBObjectRecord"> <int key="objectID">19</int> <reference key="object" ref="566571413"/> <object class="NSMutableArray" key="children"> <bool key="EncodedWithXMLCoder">YES</bool> <reference ref="436802917"/> </object> <reference key="parent" ref="878039515"/> </object> <object class="IBObjectRecord"> <int key="objectID">20</int> <reference key="object" ref="436802917"/> <reference key="parent" ref="566571413"/> </object> </object> </object> <object class="NSMutableDictionary" key="flattenedProperties"> <bool key="EncodedWithXMLCoder">YES</bool> <object class="NSArray" key="dict.sortedKeys"> <bool key="EncodedWithXMLCoder">YES</bool> <string>-3.IBPluginDependency</string> <string>11.IBPluginDependency</string> <string>11.IBViewBoundsToFrameTransform</string> <string>12.IBPluginDependency</string> <string>13.IBPluginDependency</string> <string>13.IBViewBoundsToFrameTransform</string> <string>14.IBPluginDependency</string> <string>15.IBPluginDependency</string> <string>15.IBViewBoundsToFrameTransform</string> <string>16.IBPluginDependency</string> <string>17.IBPluginDependency</string> <string>17.IBViewBoundsToFrameTransform</string> <string>18.IBPluginDependency</string> <string>19.IBPluginDependency</string> <string>19.IBViewBoundsToFrameTransform</string> <string>20.IBPluginDependency</string> <string>5.ImportedFromIB2</string> <string>8.IBEditorWindowLastContentRect</string> <string>8.IBPluginDependency</string> <string>8.ImportedFromIB2</string> <string>8.editorWindowContentRectSynchronizationRect</string> </object> <object class="NSMutableArray" key="dict.values"> <bool key="EncodedWithXMLCoder">YES</bool> <string>com.apple.InterfaceBuilder.CocoaPlugin</string> <string>com.apple.InterfaceBuilder.CocoaPlugin</string> <object class="NSAffineTransform"> <bytes key="NSTransformStruct">P4AAAL+AAABCeAAAwwcAAA</bytes> </object> <string>com.apple.InterfaceBuilder.CocoaPlugin</string> <string>com.apple.InterfaceBuilder.CocoaPlugin</string> <object class="NSAffineTransform"> <bytes key="NSTransformStruct">P4AAAL+AAABCeAAAwyoAAA</bytes> </object> <string>com.apple.InterfaceBuilder.CocoaPlugin</string> <string>com.apple.InterfaceBuilder.CocoaPlugin</string> <object class="NSAffineTransform"> <bytes key="NSTransformStruct">P4AAAL+AAABDXAAAw24AAA</bytes> </object> <string>com.apple.InterfaceBuilder.CocoaPlugin</string> <string>com.apple.InterfaceBuilder.CocoaPlugin</string> <object class="NSAffineTransform"> <bytes key="NSTransformStruct">P4AAAL+AAABCVAAAw2wAAA</bytes> </object> <string>com.apple.InterfaceBuilder.CocoaPlugin</string> <string>com.apple.InterfaceBuilder.CocoaPlugin</string> <object class="NSAffineTransform"> <bytes key="NSTransformStruct">P4AAAL+AAABDiwAAw2wAAA</bytes> </object> <string>com.apple.InterfaceBuilder.CocoaPlugin</string> <integer value="1"/> <string>{{393, 478}, {418, 330}}</string> <string>com.apple.InterfaceBuilder.CocoaPlugin</string> <integer value="1"/> <string>{{467, 510}, {418, 330}}</string> </object> </object> <object class="NSMutableDictionary" key="unlocalizedProperties"> <bool key="EncodedWithXMLCoder">YES</bool> <reference key="dict.sortedKeys" ref="0"/> <object class="NSMutableArray" key="dict.values"> <bool key="EncodedWithXMLCoder">YES</bool> </object> </object> <nil key="activeLocalization"/> <object class="NSMutableDictionary" key="localizations"> <bool key="EncodedWithXMLCoder">YES</bool> <reference key="dict.sortedKeys" ref="0"/> <object class="NSMutableArray" key="dict.values"> <bool key="EncodedWithXMLCoder">YES</bool> </object> </object> <nil key="sourceID"/> <int key="maxID">25</int> </object> <object class="IBClassDescriber" key="IBDocument.Classes"> <object class="NSMutableArray" key="referencedPartialClassDescriptions"> <bool key="EncodedWithXMLCoder">YES</bool> <object class="IBPartialClassDescription"> <string key="className">ocs_agent_daemon_optionsPane</string> <string key="superclassName">InstallerPane</string> <object class="NSMutableDictionary" key="outlets"> <bool key="EncodedWithXMLCoder">YES</bool> <object class="NSArray" key="dict.sortedKeys"> <bool key="EncodedWithXMLCoder">YES</bool> <string>now</string> <string>periodicity</string> <string>startup</string> </object> <object class="NSMutableArray" key="dict.values"> <bool key="EncodedWithXMLCoder">YES</bool> <string>NSButton</string> <string>NSTextField</string> <string>NSButton</string> </object> </object> <object class="NSMutableDictionary" key="toOneOutletInfosByName"> <bool key="EncodedWithXMLCoder">YES</bool> <object class="NSArray" key="dict.sortedKeys"> <bool key="EncodedWithXMLCoder">YES</bool> <string>now</string> <string>periodicity</string> <string>startup</string> </object> <object class="NSMutableArray" key="dict.values"> <bool key="EncodedWithXMLCoder">YES</bool> <object class="IBToOneOutletInfo"> <string key="name">now</string> <string key="candidateClassName">NSButton</string> </object> <object class="IBToOneOutletInfo"> <string key="name">periodicity</string> <string key="candidateClassName">NSTextField</string> </object> <object class="IBToOneOutletInfo"> <string key="name">startup</string> <string key="candidateClassName">NSButton</string> </object> </object> </object> <object class="IBClassDescriptionSource" key="sourceIdentifier"> <string key="majorKey">IBProjectSource</string> <string key="minorKey">ocs_agent_daemon_optionsPane.h</string> </object> </object> </object> <object class="NSMutableArray" key="referencedPartialClassDescriptionsV3.2+"> <bool key="EncodedWithXMLCoder">YES</bool> <object class="IBPartialClassDescription"> <string key="className">InstallerPane</string> <string key="superclassName">NSObject</string> <object class="NSMutableDictionary" key="outlets"> <bool key="EncodedWithXMLCoder">YES</bool> <object class="NSArray" key="dict.sortedKeys"> <bool key="EncodedWithXMLCoder">YES</bool> <string>contentView</string> <string>firstKeyView</string> <string>initialKeyView</string> <string>lastKeyView</string> <string>nextPane</string> <string>parentSection</string> </object> <object class="NSMutableArray" key="dict.values"> <bool key="EncodedWithXMLCoder">YES</bool> <string>NSView</string> <string>NSView</string> <string>NSView</string> <string>NSView</string> <string>InstallerPane</string> <string>id</string> </object> </object> <object class="NSMutableDictionary" key="toOneOutletInfosByName"> <bool key="EncodedWithXMLCoder">YES</bool> <object class="NSArray" key="dict.sortedKeys"> <bool key="EncodedWithXMLCoder">YES</bool> <string>contentView</string> <string>firstKeyView</string> <string>initialKeyView</string> <string>lastKeyView</string> <string>nextPane</string> <string>parentSection</string> </object> <object class="NSMutableArray" key="dict.values"> <bool key="EncodedWithXMLCoder">YES</bool> <object class="IBToOneOutletInfo"> <string key="name">contentView</string> <string key="candidateClassName">NSView</string> </object> <object class="IBToOneOutletInfo"> <string key="name">firstKeyView</string> <string key="candidateClassName">NSView</string> </object> <object class="IBToOneOutletInfo"> <string key="name">initialKeyView</string> <string key="candidateClassName">NSView</string> </object> <object class="IBToOneOutletInfo"> <string key="name">lastKeyView</string> <string key="candidateClassName">NSView</string> </object> <object class="IBToOneOutletInfo"> <string key="name">nextPane</string> <string key="candidateClassName">InstallerPane</string> </object> <object class="IBToOneOutletInfo"> <string key="name">parentSection</string> <string key="candidateClassName">id</string> </object> </object> </object> <object class="IBClassDescriptionSource" key="sourceIdentifier"> <string key="majorKey">IBFrameworkSource</string> <string key="minorKey">InstallerPlugins.framework/Headers/InstallerPane.h</string> </object> </object> <object class="IBPartialClassDescription"> <string key="className">InstallerSection</string> <string key="superclassName">NSObject</string> <object class="NSMutableDictionary" key="outlets"> <string key="NS.key.0">firstPane</string> <string key="NS.object.0">InstallerPane</string> </object> <object class="NSMutableDictionary" key="toOneOutletInfosByName"> <string key="NS.key.0">firstPane</string> <object class="IBToOneOutletInfo" key="NS.object.0"> <string key="name">firstPane</string> <string key="candidateClassName">InstallerPane</string> </object> </object> <object class="IBClassDescriptionSource" key="sourceIdentifier"> <string key="majorKey">IBFrameworkSource</string> <string key="minorKey">InstallerPlugins.framework/Headers/InstallerSection.h</string> </object> </object> <object class="IBPartialClassDescription"> <string key="className">NSActionCell</string> <string key="superclassName">NSCell</string> <object class="IBClassDescriptionSource" key="sourceIdentifier"> <string key="majorKey">IBFrameworkSource</string> <string key="minorKey">AppKit.framework/Headers/NSActionCell.h</string> </object> </object> <object class="IBPartialClassDescription"> <string key="className">NSApplication</string> <string key="superclassName">NSResponder</string> <object class="IBClassDescriptionSource" key="sourceIdentifier" id="516944043"> <string key="majorKey">IBFrameworkSource</string> <string key="minorKey">AppKit.framework/Headers/NSApplication.h</string> </object> </object> <object class="IBPartialClassDescription"> <string key="className">NSApplication</string> <object class="IBClassDescriptionSource" key="sourceIdentifier" id="782011093"> <string key="majorKey">IBFrameworkSource</string> <string key="minorKey">AppKit.framework/Headers/NSApplicationScripting.h</string> </object> </object> <object class="IBPartialClassDescription"> <string key="className">NSApplication</string> <object class="IBClassDescriptionSource" key="sourceIdentifier" id="516991054"> <string key="majorKey">IBFrameworkSource</string> <string key="minorKey">AppKit.framework/Headers/NSColorPanel.h</string> </object> </object> <object class="IBPartialClassDescription"> <string key="className">NSApplication</string> <object class="IBClassDescriptionSource" key="sourceIdentifier"> <string key="majorKey">IBFrameworkSource</string> <string key="minorKey">AppKit.framework/Headers/NSHelpManager.h</string> </object> </object> <object class="IBPartialClassDescription"> <string key="className">NSApplication</string> <object class="IBClassDescriptionSource" key="sourceIdentifier"> <string key="majorKey">IBFrameworkSource</string> <string key="minorKey">AppKit.framework/Headers/NSPageLayout.h</string> </object> </object> <object class="IBPartialClassDescription"> <string key="className">NSApplication</string> <object class="IBClassDescriptionSource" key="sourceIdentifier"> <string key="majorKey">IBFrameworkSource</string> <string key="minorKey">AppKit.framework/Headers/NSUserInterfaceItemSearching.h</string> </object> </object> <object class="IBPartialClassDescription"> <string key="className">NSButton</string> <string key="superclassName">NSControl</string> <object class="IBClassDescriptionSource" key="sourceIdentifier"> <string key="majorKey">IBFrameworkSource</string> <string key="minorKey">AppKit.framework/Headers/NSButton.h</string> </object> </object> <object class="IBPartialClassDescription"> <string key="className">NSButtonCell</string> <string key="superclassName">NSActionCell</string> <object class="IBClassDescriptionSource" key="sourceIdentifier"> <string key="majorKey">IBFrameworkSource</string> <string key="minorKey">AppKit.framework/Headers/NSButtonCell.h</string> </object> </object> <object class="IBPartialClassDescription"> <string key="className">NSCell</string> <string key="superclassName">NSObject</string> <object class="IBClassDescriptionSource" key="sourceIdentifier"> <string key="majorKey">IBFrameworkSource</string> <string key="minorKey">AppKit.framework/Headers/NSCell.h</string> </object> </object> <object class="IBPartialClassDescription"> <string key="className">NSControl</string> <string key="superclassName">NSView</string> <object class="IBClassDescriptionSource" key="sourceIdentifier" id="1058793971"> <string key="majorKey">IBFrameworkSource</string> <string key="minorKey">AppKit.framework/Headers/NSControl.h</string> </object> </object> <object class="IBPartialClassDescription"> <string key="className">NSFormatter</string> <string key="superclassName">NSObject</string> <object class="IBClassDescriptionSource" key="sourceIdentifier"> <string key="majorKey">IBFrameworkSource</string> <string key="minorKey">Foundation.framework/Headers/NSFormatter.h</string> </object> </object> <object class="IBPartialClassDescription"> <string key="className">NSMenu</string> <string key="superclassName">NSObject</string> <object class="IBClassDescriptionSource" key="sourceIdentifier" id="237335938"> <string key="majorKey">IBFrameworkSource</string> <string key="minorKey">AppKit.framework/Headers/NSMenu.h</string> </object> </object> <object class="IBPartialClassDescription"> <string key="className">NSObject</string> <object class="IBClassDescriptionSource" key="sourceIdentifier"> <string key="majorKey">IBFrameworkSource</string> <string key="minorKey">AppKit.framework/Headers/NSAccessibility.h</string> </object> </object> <object class="IBPartialClassDescription"> <string key="className">NSObject</string> <reference key="sourceIdentifier" ref="516944043"/> </object> <object class="IBPartialClassDescription"> <string key="className">NSObject</string> <reference key="sourceIdentifier" ref="782011093"/> </object> <object class="IBPartialClassDescription"> <string key="className">NSObject</string> <reference key="sourceIdentifier" ref="516991054"/> </object> <object class="IBPartialClassDescription"> <string key="className">NSObject</string> <reference key="sourceIdentifier" ref="1058793971"/> </object> <object class="IBPartialClassDescription"> <string key="className">NSObject</string> <object class="IBClassDescriptionSource" key="sourceIdentifier"> <string key="majorKey">IBFrameworkSource</string> <string key="minorKey">AppKit.framework/Headers/NSDictionaryController.h</string> </object> </object> <object class="IBPartialClassDescription"> <string key="className">NSObject</string> <object class="IBClassDescriptionSource" key="sourceIdentifier"> <string key="majorKey">IBFrameworkSource</string> <string key="minorKey">AppKit.framework/Headers/NSDragging.h</string> </object> </object> <object class="IBPartialClassDescription"> <string key="className">NSObject</string> <object class="IBClassDescriptionSource" key="sourceIdentifier"> <string key="majorKey">IBFrameworkSource</string> <string key="minorKey">AppKit.framework/Headers/NSFontManager.h</string> </object> </object> <object class="IBPartialClassDescription"> <string key="className">NSObject</string> <object class="IBClassDescriptionSource" key="sourceIdentifier"> <string key="majorKey">IBFrameworkSource</string> <string key="minorKey">AppKit.framework/Headers/NSFontPanel.h</string> </object> </object> <object class="IBPartialClassDescription"> <string key="className">NSObject</string> <object class="IBClassDescriptionSource" key="sourceIdentifier"> <string key="majorKey">IBFrameworkSource</string> <string key="minorKey">AppKit.framework/Headers/NSKeyValueBinding.h</string> </object> </object> <object class="IBPartialClassDescription"> <string key="className">NSObject</string> <reference key="sourceIdentifier" ref="237335938"/> </object> <object class="IBPartialClassDescription"> <string key="className">NSObject</string> <object class="IBClassDescriptionSource" key="sourceIdentifier"> <string key="majorKey">IBFrameworkSource</string> <string key="minorKey">AppKit.framework/Headers/NSNibLoading.h</string> </object> </object> <object class="IBPartialClassDescription"> <string key="className">NSObject</string> <object class="IBClassDescriptionSource" key="sourceIdentifier"> <string key="majorKey">IBFrameworkSource</string> <string key="minorKey">AppKit.framework/Headers/NSOutlineView.h</string> </object> </object> <object class="IBPartialClassDescription"> <string key="className">NSObject</string> <object class="IBClassDescriptionSource" key="sourceIdentifier"> <string key="majorKey">IBFrameworkSource</string> <string key="minorKey">AppKit.framework/Headers/NSPasteboard.h</string> </object> </object> <object class="IBPartialClassDescription"> <string key="className">NSObject</string> <object class="IBClassDescriptionSource" key="sourceIdentifier"> <string key="majorKey">IBFrameworkSource</string> <string key="minorKey">AppKit.framework/Headers/NSSavePanel.h</string> </object> </object> <object class="IBPartialClassDescription"> <string key="className">NSObject</string> <object class="IBClassDescriptionSource" key="sourceIdentifier"> <string key="majorKey">IBFrameworkSource</string> <string key="minorKey">AppKit.framework/Headers/NSTableView.h</string> </object> </object> <object class="IBPartialClassDescription"> <string key="className">NSObject</string> <object class="IBClassDescriptionSource" key="sourceIdentifier"> <string key="majorKey">IBFrameworkSource</string> <string key="minorKey">AppKit.framework/Headers/NSToolbarItem.h</string> </object> </object> <object class="IBPartialClassDescription"> <string key="className">NSObject</string> <object class="IBClassDescriptionSource" key="sourceIdentifier" id="196130618"> <string key="majorKey">IBFrameworkSource</string> <string key="minorKey">AppKit.framework/Headers/NSView.h</string> </object> </object> <object class="IBPartialClassDescription"> <string key="className">NSObject</string> <object class="IBClassDescriptionSource" key="sourceIdentifier"> <string key="majorKey">IBFrameworkSource</string> <string key="minorKey">Foundation.framework/Headers/NSArchiver.h</string> </object> </object> <object class="IBPartialClassDescription"> <string key="className">NSObject</string> <object class="IBClassDescriptionSource" key="sourceIdentifier"> <string key="majorKey">IBFrameworkSource</string> <string key="minorKey">Foundation.framework/Headers/NSClassDescription.h</string> </object> </object> <object class="IBPartialClassDescription"> <string key="className">NSObject</string> <object class="IBClassDescriptionSource" key="sourceIdentifier"> <string key="majorKey">IBFrameworkSource</string> <string key="minorKey">Foundation.framework/Headers/NSError.h</string> </object> </object> <object class="IBPartialClassDescription"> <string key="className">NSObject</string> <object class="IBClassDescriptionSource" key="sourceIdentifier"> <string key="majorKey">IBFrameworkSource</string> <string key="minorKey">Foundation.framework/Headers/NSFileManager.h</string> </object> </object> <object class="IBPartialClassDescription"> <string key="className">NSObject</string> <object class="IBClassDescriptionSource" key="sourceIdentifier"> <string key="majorKey">IBFrameworkSource</string> <string key="minorKey">Foundation.framework/Headers/NSKeyValueCoding.h</string> </object> </object> <object class="IBPartialClassDescription"> <string key="className">NSObject</string> <object class="IBClassDescriptionSource" key="sourceIdentifier"> <string key="majorKey">IBFrameworkSource</string> <string key="minorKey">Foundation.framework/Headers/NSKeyValueObserving.h</string> </object> </object> <object class="IBPartialClassDescription"> <string key="className">NSObject</string> <object class="IBClassDescriptionSource" key="sourceIdentifier"> <string key="majorKey">IBFrameworkSource</string> <string key="minorKey">Foundation.framework/Headers/NSKeyedArchiver.h</string> </object> </object> <object class="IBPartialClassDescription"> <string key="className">NSObject</string> <object class="IBClassDescriptionSource" key="sourceIdentifier"> <string key="majorKey">IBFrameworkSource</string> <string key="minorKey">Foundation.framework/Headers/NSObject.h</string> </object> </object> <object class="IBPartialClassDescription"> <string key="className">NSObject</string> <object class="IBClassDescriptionSource" key="sourceIdentifier"> <string key="majorKey">IBFrameworkSource</string> <string key="minorKey">Foundation.framework/Headers/NSObjectScripting.h</string> </object> </object> <object class="IBPartialClassDescription"> <string key="className">NSObject</string> <object class="IBClassDescriptionSource" key="sourceIdentifier"> <string key="majorKey">IBFrameworkSource</string> <string key="minorKey">Foundation.framework/Headers/NSPortCoder.h</string> </object> </object> <object class="IBPartialClassDescription"> <string key="className">NSObject</string> <object class="IBClassDescriptionSource" key="sourceIdentifier"> <string key="majorKey">IBFrameworkSource</string> <string key="minorKey">Foundation.framework/Headers/NSRunLoop.h</string> </object> </object> <object class="IBPartialClassDescription"> <string key="className">NSObject</string> <object class="IBClassDescriptionSource" key="sourceIdentifier"> <string key="majorKey">IBFrameworkSource</string> <string key="minorKey">Foundation.framework/Headers/NSScriptClassDescription.h</string> </object> </object> <object class="IBPartialClassDescription"> <string key="className">NSObject</string> <object class="IBClassDescriptionSource" key="sourceIdentifier"> <string key="majorKey">IBFrameworkSource</string> <string key="minorKey">Foundation.framework/Headers/NSScriptKeyValueCoding.h</string> </object> </object> <object class="IBPartialClassDescription"> <string key="className">NSObject</string> <object class="IBClassDescriptionSource" key="sourceIdentifier"> <string key="majorKey">IBFrameworkSource</string> <string key="minorKey">Foundation.framework/Headers/NSScriptObjectSpecifiers.h</string> </object> </object> <object class="IBPartialClassDescription"> <string key="className">NSObject</string> <object class="IBClassDescriptionSource" key="sourceIdentifier"> <string key="majorKey">IBFrameworkSource</string> <string key="minorKey">Foundation.framework/Headers/NSScriptWhoseTests.h</string> </object> </object> <object class="IBPartialClassDescription"> <string key="className">NSObject</string> <object class="IBClassDescriptionSource" key="sourceIdentifier"> <string key="majorKey">IBFrameworkSource</string> <string key="minorKey">Foundation.framework/Headers/NSThread.h</string> </object> </object> <object class="IBPartialClassDescription"> <string key="className">NSObject</string> <object class="IBClassDescriptionSource" key="sourceIdentifier"> <string key="majorKey">IBFrameworkSource</string> <string key="minorKey">Foundation.framework/Headers/NSURL.h</string> </object> </object> <object class="IBPartialClassDescription"> <string key="className">NSObject</string> <object class="IBClassDescriptionSource" key="sourceIdentifier"> <string key="majorKey">IBFrameworkSource</string> <string key="minorKey">Foundation.framework/Headers/NSURLConnection.h</string> </object> </object> <object class="IBPartialClassDescription"> <string key="className">NSObject</string> <object class="IBClassDescriptionSource" key="sourceIdentifier"> <string key="majorKey">IBFrameworkSource</string> <string key="minorKey">Foundation.framework/Headers/NSURLDownload.h</string> </object> </object> <object class="IBPartialClassDescription"> <string key="className">NSResponder</string> <object class="IBClassDescriptionSource" key="sourceIdentifier"> <string key="majorKey">IBFrameworkSource</string> <string key="minorKey">AppKit.framework/Headers/NSInterfaceStyle.h</string> </object> </object> <object class="IBPartialClassDescription"> <string key="className">NSResponder</string> <string key="superclassName">NSObject</string> <object class="IBClassDescriptionSource" key="sourceIdentifier"> <string key="majorKey">IBFrameworkSource</string> <string key="minorKey">AppKit.framework/Headers/NSResponder.h</string> </object> </object> <object class="IBPartialClassDescription"> <string key="className">NSTextField</string> <string key="superclassName">NSControl</string> <object class="IBClassDescriptionSource" key="sourceIdentifier"> <string key="majorKey">IBFrameworkSource</string> <string key="minorKey">AppKit.framework/Headers/NSTextField.h</string> </object> </object> <object class="IBPartialClassDescription"> <string key="className">NSTextFieldCell</string> <string key="superclassName">NSActionCell</string> <object class="IBClassDescriptionSource" key="sourceIdentifier"> <string key="majorKey">IBFrameworkSource</string> <string key="minorKey">AppKit.framework/Headers/NSTextFieldCell.h</string> </object> </object> <object class="IBPartialClassDescription"> <string key="className">NSView</string> <object class="IBClassDescriptionSource" key="sourceIdentifier"> <string key="majorKey">IBFrameworkSource</string> <string key="minorKey">AppKit.framework/Headers/NSClipView.h</string> </object> </object> <object class="IBPartialClassDescription"> <string key="className">NSView</string> <object class="IBClassDescriptionSource" key="sourceIdentifier"> <string key="majorKey">IBFrameworkSource</string> <string key="minorKey">AppKit.framework/Headers/NSMenuItem.h</string> </object> </object> <object class="IBPartialClassDescription"> <string key="className">NSView</string> <object class="IBClassDescriptionSource" key="sourceIdentifier"> <string key="majorKey">IBFrameworkSource</string> <string key="minorKey">AppKit.framework/Headers/NSRulerView.h</string> </object> </object> <object class="IBPartialClassDescription"> <string key="className">NSView</string> <string key="superclassName">NSResponder</string> <reference key="sourceIdentifier" ref="196130618"/> </object> </object> </object> <int key="IBDocument.localizationMode">0</int> <string key="IBDocument.TargetRuntimeIdentifier">IBCocoaFramework</string> <object class="NSMutableDictionary" key="IBDocument.PluginDeclaredDependencies"> <string key="NS.key.0">com.apple.InterfaceBuilder.CocoaPlugin.macosx</string> <integer value="0" key="NS.object.0"/> </object> <object class="NSMutableDictionary" key="IBDocument.PluginDeclaredDependencyDefaults"> <string key="NS.key.0">com.apple.InterfaceBuilder.CocoaPlugin.macosx</string> <integer value="1060" key="NS.object.0"/> </object> <object class="NSMutableDictionary" key="IBDocument.PluginDeclaredDevelopmentDependencies"> <string key="NS.key.0">com.apple.InterfaceBuilder.CocoaPlugin.InterfaceBuilder3</string> <integer value="3000" key="NS.object.0"/> </object> <bool key="IBDocument.PluginDeclaredDependenciesTrackSystemTargetVersion">YES</bool> <string key="IBDocument.LastKnownRelativeProjectPath">../ocs_agent_daemon_options.xcodeproj</string> <int key="IBDocument.defaultPropertyAccessControl">3</int> <object class="NSMutableDictionary" key="IBDocument.LastKnownImageSizes"> <string key="NS.key.0">NSSwitch</string> <string key="NS.object.0">{15, 15}</string> </object> </data> </archive> ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������UnixAgent-2.4.2/tools/macosx/installer_gui/ocs_agent_daemon_options/French.lproj/�������������������0000775�0000000�0000000�00000000000�13327377321�0030316�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������UnixAgent-2.4.2/tools/macosx/installer_gui/ocs_agent_daemon_options/French.lproj/InfoPlist.strings��0000664�0000000�0000000�00000001452�13327377321�0033642�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/�/� �/�/� �O�C�S�I�N�V�E�N�T�O�R�Y�-�N�G� �/�/� �/�/� �C�o�p�y�l�e�f�t� �G�u�i�l�l�a�u�m�e� �P�R�O�T�E�T� �2�0�1�1� �/�/� � �/�/� �/�/� �T�h�i�s� �c�o�d�e� �i�s� �o�p�e�n� �s�o�u�r�c�e� �a�n�d� �m�a�y� �b�e� �c�o�p�i�e�d� �a�n�d� �m�o�d�i�f�i�e�d� �a�s� �l�o�n�g� �a�s� �t�h�e� �s�o�u�r�c�e� �/�/� �c�o�d�e� �i�s� �a�l�w�a�y�s� �m�a�d�e� �f�r�e�e�l�y� �a�v�a�i�l�a�b�l�e�.� �/�/� �P�l�e�a�s�e� �r�e�f�e�r� �t�o� �t�h�e� �G�e�n�e�r�a�l� �P�u�b�l�i�c� �L�i�c�e�n�c�e� �h�t�t�p�:�/�/�w�w�w�.�g�n�u�.�o�r�g�/� �/�/� �/�/� � �/�/� �L�o�c�a�l�i�z�e�d� �v�e�r�s�i�o�n�s� �o�f� �I�n�f�o�.�p�l�i�s�t� �k�e�y�s� �N�S�H�u�m�a�n�R�e�a�d�a�b�l�e�C�o�p�y�r�i�g�h�t� �=� �"�O�C�S� �I�n�v�e�n�t�o�r�y� �N�G� �T�e�a�m�,� �2�0�1�7�"�;� �I�n�s�t�a�l�l�e�r�S�e�c�t�i�o�n�T�i�t�l�e� �=� �"�O�p�t�i�o�n�s� �d�u� �d��m�o�n�"�;� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������UnixAgent-2.4.2/tools/macosx/installer_gui/ocs_agent_daemon_options/French.lproj/Localizable.strings0000664�0000000�0000000�00000002026�13327377321�0034152�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/�/� �/�/� �O�C�S�I�N�V�E�N�T�O�R�Y�-�N�G� �/�/� �/�/� �C�o�p�y�l�e�f�t� �G�u�i�l�l�a�u�m�e� �P�R�O�T�E�T� �2�0�1�1� �/�/� � �/�/� �/�/� �T�h�i�s� �c�o�d�e� �i�s� �o�p�e�n� �s�o�u�r�c�e� �a�n�d� �m�a�y� �b�e� �c�o�p�i�e�d� �a�n�d� �m�o�d�i�f�i�e�d� �a�s� �l�o�n�g� �a�s� �t�h�e� �s�o�u�r�c�e� �/�/� �c�o�d�e� �i�s� �a�l�w�a�y�s� �m�a�d�e� �f�r�e�e�l�y� �a�v�a�i�l�a�b�l�e�.� �/�/� �P�l�e�a�s�e� �r�e�f�e�r� �t�o� �t�h�e� �G�e�n�e�r�a�l� �P�u�b�l�i�c� �L�i�c�e�n�c�e� �h�t�t�p�:�/�/�w�w�w�.�g�n�u�.�o�r�g�/� �/�/� �/�/� � �/�/� �L�o�c�a�l�i�z�e�d� �v�e�r�s�i�o�n�s� �o�f� �I�n�f�o�.�p�l�i�s�t� �k�e�y�s� �"�P�a�n�e�T�i�t�l�e�"� �=� �"�O�p�t�i�o�n�s� �d�u� �d��m�o�n� �d�e� �l�'�a�g�e�n�t� �O�C�S�"�;� � �/�/�P�e�r�i�d�o�c�i�t�y� �w�a�r�n� �"�P�e�r�i�o�d�i�c�i�t�y�_�w�a�r�n�"� �=� �"�V�a�l�e�u�r� �d�e� �l�a� �p��r�o�d�i�c�i�t�� �i�n�v�a�l�i�d�e�"�;� � �/�/�P�e�r�i�o�d�i�c�i�t�y� �w�a�r�n� �c�o�m�m�e�n�t� �"�P�e�r�i�o�d�i�c�i�t�y�_�w�a�r�n�_�c�o�m�m�e�n�t�"� �=� �"�V�e�u�i�l�l�e�z� �r�e�n�t�r�e�r� �u�n� �n�o�m�b�r�e� �v�a�l�i�d�e�"�;� � �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ocs_agent_daemon_options.xib������������������������������������������������������������������������0000664�0000000�0000000�00000126561�13327377321�0036016�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�UnixAgent-2.4.2/tools/macosx/installer_gui/ocs_agent_daemon_options/French.lproj���������������������������������������������������������������������������������������<?xml version="1.0" encoding="UTF-8"?> <archive type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="7.10"> <data> <int key="IBDocument.SystemTarget">0</int> <string key="IBDocument.SystemVersion">10K549</string> <string key="IBDocument.InterfaceBuilderVersion">851</string> <string key="IBDocument.AppKitVersion">1038.36</string> <string key="IBDocument.HIToolboxVersion">461.00</string> <object class="NSMutableDictionary" key="IBDocument.PluginVersions"> <string key="NS.key.0">com.apple.InterfaceBuilder.CocoaPlugin</string> <string key="NS.object.0">851</string> </object> <object class="NSMutableArray" key="IBDocument.EditedObjectIDs"> <bool key="EncodedWithXMLCoder">YES</bool> <integer value="8"/> </object> <object class="NSArray" key="IBDocument.PluginDependencies"> <bool key="EncodedWithXMLCoder">YES</bool> <string>com.apple.InterfaceBuilder.CocoaPlugin</string> </object> <object class="NSMutableDictionary" key="IBDocument.Metadata"> <string key="NS.key.0">PluginDependencyRecalculationVersion</string> <integer value="1" key="NS.object.0"/> </object> <object class="NSMutableArray" key="IBDocument.RootObjects" id="995885815"> <bool key="EncodedWithXMLCoder">YES</bool> <object class="NSCustomObject" id="533019728"> <string key="NSClassName">InstallerSection</string> </object> <object class="NSCustomObject" id="304932500"> <string key="NSClassName">FirstResponder</string> </object> <object class="NSCustomObject" id="521373648"> <string key="NSClassName">ocs_agent_daemon_optionsPane</string> </object> <object class="NSCustomView" id="878039515"> <reference key="NSNextResponder"/> <int key="NSvFlags">256</int> <object class="NSMutableArray" key="NSSubviews"> <bool key="EncodedWithXMLCoder">YES</bool> <object class="NSTextField" id="566571413"> <reference key="NSNextResponder" ref="878039515"/> <int key="NSvFlags">268</int> <string key="NSFrame">{{286, 221}, {56, 17}}</string> <reference key="NSSuperview" ref="878039515"/> <bool key="NSEnabled">YES</bool> <object class="NSTextFieldCell" key="NSCell" id="436802917"> <int key="NSCellFlags">68288064</int> <int key="NSCellFlags2">272630784</int> <string key="NSContents">heure(s)</string> <object class="NSFont" key="NSSupport" id="531741455"> <string key="NSName">LucidaGrande</string> <double key="NSSize">13</double> <int key="NSfFlags">1044</int> </object> <reference key="NSControlView" ref="566571413"/> <object class="NSColor" key="NSBackgroundColor" id="719882935"> <int key="NSColorSpace">6</int> <string key="NSCatalogName">System</string> <string key="NSColorName">controlColor</string> <object class="NSColor" key="NSColor"> <int key="NSColorSpace">3</int> <bytes key="NSWhite">MC42NjY2NjY2NjY3AA</bytes> </object> </object> <object class="NSColor" key="NSTextColor" id="748922370"> <int key="NSColorSpace">6</int> <string key="NSCatalogName">System</string> <string key="NSColorName">controlTextColor</string> <object class="NSColor" key="NSColor" id="476741409"> <int key="NSColorSpace">3</int> <bytes key="NSWhite">MAA</bytes> </object> </object> </object> </object> <object class="NSTextField" id="136445426"> <reference key="NSNextResponder" ref="878039515"/> <int key="NSvFlags">268</int> <string key="NSFrame">{{35, 220}, {188, 17}}</string> <reference key="NSSuperview" ref="878039515"/> <bool key="NSEnabled">YES</bool> <object class="NSTextFieldCell" key="NSCell" id="249338464"> <int key="NSCellFlags">68288064</int> <int key="NSCellFlags2">272630784</int> <string key="NSContents">Lancer l'agent OCS toutes les</string> <reference key="NSSupport" ref="531741455"/> <reference key="NSControlView" ref="136445426"/> <reference key="NSBackgroundColor" ref="719882935"/> <reference key="NSTextColor" ref="748922370"/> </object> </object> <object class="NSTextField" id="789897599"> <reference key="NSNextResponder" ref="878039515"/> <int key="NSvFlags">268</int> <string key="NSFrame">{{228, 218}, {53, 22}}</string> <reference key="NSSuperview" ref="878039515"/> <bool key="NSEnabled">YES</bool> <object class="NSTextFieldCell" key="NSCell" id="710676000"> <int key="NSCellFlags">-1804468671</int> <int key="NSCellFlags2">71304192</int> <string key="NSContents"/> <reference key="NSSupport" ref="531741455"/> <reference key="NSControlView" ref="789897599"/> <bool key="NSDrawsBackground">YES</bool> <object class="NSColor" key="NSBackgroundColor"> <int key="NSColorSpace">6</int> <string key="NSCatalogName">System</string> <string key="NSColorName">textBackgroundColor</string> <object class="NSColor" key="NSColor"> <int key="NSColorSpace">3</int> <bytes key="NSWhite">MQA</bytes> </object> </object> <object class="NSColor" key="NSTextColor"> <int key="NSColorSpace">6</int> <string key="NSCatalogName">System</string> <string key="NSColorName">textColor</string> <reference key="NSColor" ref="476741409"/> </object> </object> </object> <object class="NSButton" id="735987645"> <reference key="NSNextResponder" ref="878039515"/> <int key="NSvFlags">268</int> <string key="NSFrame">{{62, 166}, {300, 18}}</string> <reference key="NSSuperview" ref="878039515"/> <bool key="NSEnabled">YES</bool> <object class="NSButtonCell" key="NSCell" id="420447138"> <int key="NSCellFlags">-2080244224</int> <int key="NSCellFlags2">0</int> <string key="NSContents">Lancer l'agent OCS au démarrage du démon</string> <reference key="NSSupport" ref="531741455"/> <reference key="NSControlView" ref="735987645"/> <int key="NSButtonFlags">1211912703</int> <int key="NSButtonFlags2">2</int> <object class="NSCustomResource" key="NSNormalImage" id="665758281"> <string key="NSClassName">NSImage</string> <string key="NSResourceName">NSSwitch</string> </object> <object class="NSButtonImageSource" key="NSAlternateImage" id="534174978"> <string key="NSImageName">NSSwitch</string> </object> <string key="NSAlternateContents"/> <string key="NSKeyEquivalent"/> <int key="NSPeriodicDelay">200</int> <int key="NSPeriodicInterval">25</int> </object> </object> <object class="NSButton" id="59704994"> <reference key="NSNextResponder" ref="878039515"/> <int key="NSvFlags">268</int> <string key="NSFrame">{{62, 131}, {246, 18}}</string> <reference key="NSSuperview" ref="878039515"/> <bool key="NSEnabled">YES</bool> <object class="NSButtonCell" key="NSCell" id="945206299"> <int key="NSCellFlags">-2080244224</int> <int key="NSCellFlags2">0</int> <string key="NSContents">Lancer le démon après l'installation</string> <reference key="NSSupport" ref="531741455"/> <reference key="NSControlView" ref="59704994"/> <int key="NSButtonFlags">1211912703</int> <int key="NSButtonFlags2">2</int> <reference key="NSNormalImage" ref="665758281"/> <reference key="NSAlternateImage" ref="534174978"/> <string key="NSAlternateContents"/> <string key="NSKeyEquivalent"/> <int key="NSPeriodicDelay">200</int> <int key="NSPeriodicInterval">25</int> </object> </object> </object> <string key="NSFrameSize">{418, 330}</string> <reference key="NSSuperview"/> <object class="NSMutableString" key="NSClassName"> <characters key="NS.bytes">NSView</characters> </object> <string key="NSExtension">NSResponder</string> </object> <object class="NSCustomObject" id="330240596"> <string key="NSClassName">NSApplication</string> </object> </object> <object class="IBObjectContainer" key="IBDocument.Objects"> <object class="NSMutableArray" key="connectionRecords"> <bool key="EncodedWithXMLCoder">YES</bool> <object class="IBConnectionRecord"> <object class="IBOutletConnection" key="connection"> <string key="label">firstPane</string> <reference key="source" ref="533019728"/> <reference key="destination" ref="521373648"/> </object> <int key="connectionID">6</int> </object> <object class="IBConnectionRecord"> <object class="IBOutletConnection" key="connection"> <string key="label">parentSection</string> <reference key="source" ref="521373648"/> <reference key="destination" ref="533019728"/> </object> <int key="connectionID">7</int> </object> <object class="IBConnectionRecord"> <object class="IBOutletConnection" key="connection"> <string key="label">contentView</string> <reference key="source" ref="521373648"/> <reference key="destination" ref="878039515"/> </object> <int key="connectionID">9</int> </object> <object class="IBConnectionRecord"> <object class="IBOutletConnection" key="connection"> <string key="label">startup</string> <reference key="source" ref="521373648"/> <reference key="destination" ref="735987645"/> </object> <int key="connectionID">21</int> </object> <object class="IBConnectionRecord"> <object class="IBOutletConnection" key="connection"> <string key="label">now</string> <reference key="source" ref="521373648"/> <reference key="destination" ref="59704994"/> </object> <int key="connectionID">22</int> </object> <object class="IBConnectionRecord"> <object class="IBOutletConnection" key="connection"> <string key="label">periodicity</string> <reference key="source" ref="521373648"/> <reference key="destination" ref="789897599"/> </object> <int key="connectionID">23</int> </object> </object> <object class="IBMutableOrderedSet" key="objectRecords"> <object class="NSArray" key="orderedObjects"> <bool key="EncodedWithXMLCoder">YES</bool> <object class="IBObjectRecord"> <int key="objectID">0</int> <object class="NSArray" key="object" id="0"> <bool key="EncodedWithXMLCoder">YES</bool> </object> <reference key="children" ref="995885815"/> <nil key="parent"/> </object> <object class="IBObjectRecord"> <int key="objectID">-2</int> <reference key="object" ref="533019728"/> <reference key="parent" ref="0"/> <string key="objectName">File's Owner</string> </object> <object class="IBObjectRecord"> <int key="objectID">-1</int> <reference key="object" ref="304932500"/> <reference key="parent" ref="0"/> <string key="objectName">First Responder</string> </object> <object class="IBObjectRecord"> <int key="objectID">5</int> <reference key="object" ref="521373648"/> <reference key="parent" ref="0"/> <string key="objectName">ocs_agent_daemon_optionsPane</string> </object> <object class="IBObjectRecord"> <int key="objectID">8</int> <reference key="object" ref="878039515"/> <object class="NSMutableArray" key="children"> <bool key="EncodedWithXMLCoder">YES</bool> <reference ref="789897599"/> <reference ref="566571413"/> <reference ref="59704994"/> <reference ref="735987645"/> <reference ref="136445426"/> </object> <reference key="parent" ref="0"/> <string key="objectName">View</string> </object> <object class="IBObjectRecord"> <int key="objectID">-3</int> <reference key="object" ref="330240596"/> <reference key="parent" ref="0"/> <string key="objectName">Application</string> </object> <object class="IBObjectRecord"> <int key="objectID">11</int> <reference key="object" ref="59704994"/> <object class="NSMutableArray" key="children"> <bool key="EncodedWithXMLCoder">YES</bool> <reference ref="945206299"/> </object> <reference key="parent" ref="878039515"/> </object> <object class="IBObjectRecord"> <int key="objectID">12</int> <reference key="object" ref="945206299"/> <reference key="parent" ref="59704994"/> </object> <object class="IBObjectRecord"> <int key="objectID">13</int> <reference key="object" ref="735987645"/> <object class="NSMutableArray" key="children"> <bool key="EncodedWithXMLCoder">YES</bool> <reference ref="420447138"/> </object> <reference key="parent" ref="878039515"/> </object> <object class="IBObjectRecord"> <int key="objectID">14</int> <reference key="object" ref="420447138"/> <reference key="parent" ref="735987645"/> </object> <object class="IBObjectRecord"> <int key="objectID">15</int> <reference key="object" ref="789897599"/> <object class="NSMutableArray" key="children"> <bool key="EncodedWithXMLCoder">YES</bool> <reference ref="710676000"/> </object> <reference key="parent" ref="878039515"/> </object> <object class="IBObjectRecord"> <int key="objectID">16</int> <reference key="object" ref="710676000"/> <reference key="parent" ref="789897599"/> </object> <object class="IBObjectRecord"> <int key="objectID">17</int> <reference key="object" ref="136445426"/> <object class="NSMutableArray" key="children"> <bool key="EncodedWithXMLCoder">YES</bool> <reference ref="249338464"/> </object> <reference key="parent" ref="878039515"/> </object> <object class="IBObjectRecord"> <int key="objectID">18</int> <reference key="object" ref="249338464"/> <reference key="parent" ref="136445426"/> </object> <object class="IBObjectRecord"> <int key="objectID">19</int> <reference key="object" ref="566571413"/> <object class="NSMutableArray" key="children"> <bool key="EncodedWithXMLCoder">YES</bool> <reference ref="436802917"/> </object> <reference key="parent" ref="878039515"/> </object> <object class="IBObjectRecord"> <int key="objectID">20</int> <reference key="object" ref="436802917"/> <reference key="parent" ref="566571413"/> </object> </object> </object> <object class="NSMutableDictionary" key="flattenedProperties"> <bool key="EncodedWithXMLCoder">YES</bool> <object class="NSArray" key="dict.sortedKeys"> <bool key="EncodedWithXMLCoder">YES</bool> <string>-3.IBPluginDependency</string> <string>11.IBPluginDependency</string> <string>11.IBViewBoundsToFrameTransform</string> <string>12.IBPluginDependency</string> <string>13.IBPluginDependency</string> <string>13.IBViewBoundsToFrameTransform</string> <string>14.IBPluginDependency</string> <string>15.IBPluginDependency</string> <string>15.IBViewBoundsToFrameTransform</string> <string>16.IBPluginDependency</string> <string>17.IBPluginDependency</string> <string>17.IBViewBoundsToFrameTransform</string> <string>18.IBPluginDependency</string> <string>19.IBPluginDependency</string> <string>19.IBViewBoundsToFrameTransform</string> <string>20.IBPluginDependency</string> <string>5.ImportedFromIB2</string> <string>8.IBEditorWindowLastContentRect</string> <string>8.IBPluginDependency</string> <string>8.ImportedFromIB2</string> <string>8.editorWindowContentRectSynchronizationRect</string> </object> <object class="NSMutableArray" key="dict.values"> <bool key="EncodedWithXMLCoder">YES</bool> <string>com.apple.InterfaceBuilder.CocoaPlugin</string> <string>com.apple.InterfaceBuilder.CocoaPlugin</string> <object class="NSAffineTransform"> <bytes key="NSTransformStruct">P4AAAL+AAABCeAAAwwcAAA</bytes> </object> <string>com.apple.InterfaceBuilder.CocoaPlugin</string> <string>com.apple.InterfaceBuilder.CocoaPlugin</string> <object class="NSAffineTransform"> <bytes key="NSTransformStruct">P4AAAL+AAABCeAAAwyoAAA</bytes> </object> <string>com.apple.InterfaceBuilder.CocoaPlugin</string> <string>com.apple.InterfaceBuilder.CocoaPlugin</string> <object class="NSAffineTransform"> <bytes key="NSTransformStruct">P4AAAL+AAABDXAAAw24AAA</bytes> </object> <string>com.apple.InterfaceBuilder.CocoaPlugin</string> <string>com.apple.InterfaceBuilder.CocoaPlugin</string> <object class="NSAffineTransform"> <bytes key="NSTransformStruct">P4AAAL+AAABCdAAAw2wAAA</bytes> </object> <string>com.apple.InterfaceBuilder.CocoaPlugin</string> <string>com.apple.InterfaceBuilder.CocoaPlugin</string> <object class="NSAffineTransform"> <bytes key="NSTransformStruct">P4AAAL+AAABDiwAAw2wAAA</bytes> </object> <string>com.apple.InterfaceBuilder.CocoaPlugin</string> <integer value="1"/> <string>{{393, 478}, {418, 330}}</string> <string>com.apple.InterfaceBuilder.CocoaPlugin</string> <integer value="1"/> <string>{{467, 510}, {418, 330}}</string> </object> </object> <object class="NSMutableDictionary" key="unlocalizedProperties"> <bool key="EncodedWithXMLCoder">YES</bool> <reference key="dict.sortedKeys" ref="0"/> <object class="NSMutableArray" key="dict.values"> <bool key="EncodedWithXMLCoder">YES</bool> </object> </object> <nil key="activeLocalization"/> <object class="NSMutableDictionary" key="localizations"> <bool key="EncodedWithXMLCoder">YES</bool> <reference key="dict.sortedKeys" ref="0"/> <object class="NSMutableArray" key="dict.values"> <bool key="EncodedWithXMLCoder">YES</bool> </object> </object> <nil key="sourceID"/> <int key="maxID">25</int> </object> <object class="IBClassDescriber" key="IBDocument.Classes"> <object class="NSMutableArray" key="referencedPartialClassDescriptions"> <bool key="EncodedWithXMLCoder">YES</bool> <object class="IBPartialClassDescription"> <string key="className">ocs_agent_daemon_optionsPane</string> <string key="superclassName">InstallerPane</string> <object class="NSMutableDictionary" key="outlets"> <bool key="EncodedWithXMLCoder">YES</bool> <object class="NSArray" key="dict.sortedKeys"> <bool key="EncodedWithXMLCoder">YES</bool> <string>now</string> <string>periodicity</string> <string>startup</string> </object> <object class="NSMutableArray" key="dict.values"> <bool key="EncodedWithXMLCoder">YES</bool> <string>NSButton</string> <string>NSTextField</string> <string>NSButton</string> </object> </object> <object class="NSMutableDictionary" key="toOneOutletInfosByName"> <bool key="EncodedWithXMLCoder">YES</bool> <object class="NSArray" key="dict.sortedKeys"> <bool key="EncodedWithXMLCoder">YES</bool> <string>now</string> <string>periodicity</string> <string>startup</string> </object> <object class="NSMutableArray" key="dict.values"> <bool key="EncodedWithXMLCoder">YES</bool> <object class="IBToOneOutletInfo"> <string key="name">now</string> <string key="candidateClassName">NSButton</string> </object> <object class="IBToOneOutletInfo"> <string key="name">periodicity</string> <string key="candidateClassName">NSTextField</string> </object> <object class="IBToOneOutletInfo"> <string key="name">startup</string> <string key="candidateClassName">NSButton</string> </object> </object> </object> <object class="IBClassDescriptionSource" key="sourceIdentifier"> <string key="majorKey">IBProjectSource</string> <string key="minorKey">ocs_agent_daemon_optionsPane.h</string> </object> </object> </object> <object class="NSMutableArray" key="referencedPartialClassDescriptionsV3.2+"> <bool key="EncodedWithXMLCoder">YES</bool> <object class="IBPartialClassDescription"> <string key="className">InstallerPane</string> <string key="superclassName">NSObject</string> <object class="NSMutableDictionary" key="outlets"> <bool key="EncodedWithXMLCoder">YES</bool> <object class="NSArray" key="dict.sortedKeys"> <bool key="EncodedWithXMLCoder">YES</bool> <string>contentView</string> <string>firstKeyView</string> <string>initialKeyView</string> <string>lastKeyView</string> <string>nextPane</string> <string>parentSection</string> </object> <object class="NSMutableArray" key="dict.values"> <bool key="EncodedWithXMLCoder">YES</bool> <string>NSView</string> <string>NSView</string> <string>NSView</string> <string>NSView</string> <string>InstallerPane</string> <string>id</string> </object> </object> <object class="NSMutableDictionary" key="toOneOutletInfosByName"> <bool key="EncodedWithXMLCoder">YES</bool> <object class="NSArray" key="dict.sortedKeys"> <bool key="EncodedWithXMLCoder">YES</bool> <string>contentView</string> <string>firstKeyView</string> <string>initialKeyView</string> <string>lastKeyView</string> <string>nextPane</string> <string>parentSection</string> </object> <object class="NSMutableArray" key="dict.values"> <bool key="EncodedWithXMLCoder">YES</bool> <object class="IBToOneOutletInfo"> <string key="name">contentView</string> <string key="candidateClassName">NSView</string> </object> <object class="IBToOneOutletInfo"> <string key="name">firstKeyView</string> <string key="candidateClassName">NSView</string> </object> <object class="IBToOneOutletInfo"> <string key="name">initialKeyView</string> <string key="candidateClassName">NSView</string> </object> <object class="IBToOneOutletInfo"> <string key="name">lastKeyView</string> <string key="candidateClassName">NSView</string> </object> <object class="IBToOneOutletInfo"> <string key="name">nextPane</string> <string key="candidateClassName">InstallerPane</string> </object> <object class="IBToOneOutletInfo"> <string key="name">parentSection</string> <string key="candidateClassName">id</string> </object> </object> </object> <object class="IBClassDescriptionSource" key="sourceIdentifier"> <string key="majorKey">IBFrameworkSource</string> <string key="minorKey">InstallerPlugins.framework/Headers/InstallerPane.h</string> </object> </object> <object class="IBPartialClassDescription"> <string key="className">InstallerSection</string> <string key="superclassName">NSObject</string> <object class="NSMutableDictionary" key="outlets"> <string key="NS.key.0">firstPane</string> <string key="NS.object.0">InstallerPane</string> </object> <object class="NSMutableDictionary" key="toOneOutletInfosByName"> <string key="NS.key.0">firstPane</string> <object class="IBToOneOutletInfo" key="NS.object.0"> <string key="name">firstPane</string> <string key="candidateClassName">InstallerPane</string> </object> </object> <object class="IBClassDescriptionSource" key="sourceIdentifier"> <string key="majorKey">IBFrameworkSource</string> <string key="minorKey">InstallerPlugins.framework/Headers/InstallerSection.h</string> </object> </object> <object class="IBPartialClassDescription"> <string key="className">NSActionCell</string> <string key="superclassName">NSCell</string> <object class="IBClassDescriptionSource" key="sourceIdentifier"> <string key="majorKey">IBFrameworkSource</string> <string key="minorKey">AppKit.framework/Headers/NSActionCell.h</string> </object> </object> <object class="IBPartialClassDescription"> <string key="className">NSApplication</string> <string key="superclassName">NSResponder</string> <object class="IBClassDescriptionSource" key="sourceIdentifier" id="516944043"> <string key="majorKey">IBFrameworkSource</string> <string key="minorKey">AppKit.framework/Headers/NSApplication.h</string> </object> </object> <object class="IBPartialClassDescription"> <string key="className">NSApplication</string> <object class="IBClassDescriptionSource" key="sourceIdentifier" id="782011093"> <string key="majorKey">IBFrameworkSource</string> <string key="minorKey">AppKit.framework/Headers/NSApplicationScripting.h</string> </object> </object> <object class="IBPartialClassDescription"> <string key="className">NSApplication</string> <object class="IBClassDescriptionSource" key="sourceIdentifier" id="516991054"> <string key="majorKey">IBFrameworkSource</string> <string key="minorKey">AppKit.framework/Headers/NSColorPanel.h</string> </object> </object> <object class="IBPartialClassDescription"> <string key="className">NSApplication</string> <object class="IBClassDescriptionSource" key="sourceIdentifier"> <string key="majorKey">IBFrameworkSource</string> <string key="minorKey">AppKit.framework/Headers/NSHelpManager.h</string> </object> </object> <object class="IBPartialClassDescription"> <string key="className">NSApplication</string> <object class="IBClassDescriptionSource" key="sourceIdentifier"> <string key="majorKey">IBFrameworkSource</string> <string key="minorKey">AppKit.framework/Headers/NSPageLayout.h</string> </object> </object> <object class="IBPartialClassDescription"> <string key="className">NSApplication</string> <object class="IBClassDescriptionSource" key="sourceIdentifier"> <string key="majorKey">IBFrameworkSource</string> <string key="minorKey">AppKit.framework/Headers/NSUserInterfaceItemSearching.h</string> </object> </object> <object class="IBPartialClassDescription"> <string key="className">NSButton</string> <string key="superclassName">NSControl</string> <object class="IBClassDescriptionSource" key="sourceIdentifier"> <string key="majorKey">IBFrameworkSource</string> <string key="minorKey">AppKit.framework/Headers/NSButton.h</string> </object> </object> <object class="IBPartialClassDescription"> <string key="className">NSButtonCell</string> <string key="superclassName">NSActionCell</string> <object class="IBClassDescriptionSource" key="sourceIdentifier"> <string key="majorKey">IBFrameworkSource</string> <string key="minorKey">AppKit.framework/Headers/NSButtonCell.h</string> </object> </object> <object class="IBPartialClassDescription"> <string key="className">NSCell</string> <string key="superclassName">NSObject</string> <object class="IBClassDescriptionSource" key="sourceIdentifier"> <string key="majorKey">IBFrameworkSource</string> <string key="minorKey">AppKit.framework/Headers/NSCell.h</string> </object> </object> <object class="IBPartialClassDescription"> <string key="className">NSControl</string> <string key="superclassName">NSView</string> <object class="IBClassDescriptionSource" key="sourceIdentifier" id="1058793971"> <string key="majorKey">IBFrameworkSource</string> <string key="minorKey">AppKit.framework/Headers/NSControl.h</string> </object> </object> <object class="IBPartialClassDescription"> <string key="className">NSFormatter</string> <string key="superclassName">NSObject</string> <object class="IBClassDescriptionSource" key="sourceIdentifier"> <string key="majorKey">IBFrameworkSource</string> <string key="minorKey">Foundation.framework/Headers/NSFormatter.h</string> </object> </object> <object class="IBPartialClassDescription"> <string key="className">NSMenu</string> <string key="superclassName">NSObject</string> <object class="IBClassDescriptionSource" key="sourceIdentifier" id="237335938"> <string key="majorKey">IBFrameworkSource</string> <string key="minorKey">AppKit.framework/Headers/NSMenu.h</string> </object> </object> <object class="IBPartialClassDescription"> <string key="className">NSObject</string> <object class="IBClassDescriptionSource" key="sourceIdentifier"> <string key="majorKey">IBFrameworkSource</string> <string key="minorKey">AppKit.framework/Headers/NSAccessibility.h</string> </object> </object> <object class="IBPartialClassDescription"> <string key="className">NSObject</string> <reference key="sourceIdentifier" ref="516944043"/> </object> <object class="IBPartialClassDescription"> <string key="className">NSObject</string> <reference key="sourceIdentifier" ref="782011093"/> </object> <object class="IBPartialClassDescription"> <string key="className">NSObject</string> <reference key="sourceIdentifier" ref="516991054"/> </object> <object class="IBPartialClassDescription"> <string key="className">NSObject</string> <reference key="sourceIdentifier" ref="1058793971"/> </object> <object class="IBPartialClassDescription"> <string key="className">NSObject</string> <object class="IBClassDescriptionSource" key="sourceIdentifier"> <string key="majorKey">IBFrameworkSource</string> <string key="minorKey">AppKit.framework/Headers/NSDictionaryController.h</string> </object> </object> <object class="IBPartialClassDescription"> <string key="className">NSObject</string> <object class="IBClassDescriptionSource" key="sourceIdentifier"> <string key="majorKey">IBFrameworkSource</string> <string key="minorKey">AppKit.framework/Headers/NSDragging.h</string> </object> </object> <object class="IBPartialClassDescription"> <string key="className">NSObject</string> <object class="IBClassDescriptionSource" key="sourceIdentifier"> <string key="majorKey">IBFrameworkSource</string> <string key="minorKey">AppKit.framework/Headers/NSFontManager.h</string> </object> </object> <object class="IBPartialClassDescription"> <string key="className">NSObject</string> <object class="IBClassDescriptionSource" key="sourceIdentifier"> <string key="majorKey">IBFrameworkSource</string> <string key="minorKey">AppKit.framework/Headers/NSFontPanel.h</string> </object> </object> <object class="IBPartialClassDescription"> <string key="className">NSObject</string> <object class="IBClassDescriptionSource" key="sourceIdentifier"> <string key="majorKey">IBFrameworkSource</string> <string key="minorKey">AppKit.framework/Headers/NSKeyValueBinding.h</string> </object> </object> <object class="IBPartialClassDescription"> <string key="className">NSObject</string> <reference key="sourceIdentifier" ref="237335938"/> </object> <object class="IBPartialClassDescription"> <string key="className">NSObject</string> <object class="IBClassDescriptionSource" key="sourceIdentifier"> <string key="majorKey">IBFrameworkSource</string> <string key="minorKey">AppKit.framework/Headers/NSNibLoading.h</string> </object> </object> <object class="IBPartialClassDescription"> <string key="className">NSObject</string> <object class="IBClassDescriptionSource" key="sourceIdentifier"> <string key="majorKey">IBFrameworkSource</string> <string key="minorKey">AppKit.framework/Headers/NSOutlineView.h</string> </object> </object> <object class="IBPartialClassDescription"> <string key="className">NSObject</string> <object class="IBClassDescriptionSource" key="sourceIdentifier"> <string key="majorKey">IBFrameworkSource</string> <string key="minorKey">AppKit.framework/Headers/NSPasteboard.h</string> </object> </object> <object class="IBPartialClassDescription"> <string key="className">NSObject</string> <object class="IBClassDescriptionSource" key="sourceIdentifier"> <string key="majorKey">IBFrameworkSource</string> <string key="minorKey">AppKit.framework/Headers/NSSavePanel.h</string> </object> </object> <object class="IBPartialClassDescription"> <string key="className">NSObject</string> <object class="IBClassDescriptionSource" key="sourceIdentifier"> <string key="majorKey">IBFrameworkSource</string> <string key="minorKey">AppKit.framework/Headers/NSTableView.h</string> </object> </object> <object class="IBPartialClassDescription"> <string key="className">NSObject</string> <object class="IBClassDescriptionSource" key="sourceIdentifier"> <string key="majorKey">IBFrameworkSource</string> <string key="minorKey">AppKit.framework/Headers/NSToolbarItem.h</string> </object> </object> <object class="IBPartialClassDescription"> <string key="className">NSObject</string> <object class="IBClassDescriptionSource" key="sourceIdentifier" id="196130618"> <string key="majorKey">IBFrameworkSource</string> <string key="minorKey">AppKit.framework/Headers/NSView.h</string> </object> </object> <object class="IBPartialClassDescription"> <string key="className">NSObject</string> <object class="IBClassDescriptionSource" key="sourceIdentifier"> <string key="majorKey">IBFrameworkSource</string> <string key="minorKey">Foundation.framework/Headers/NSArchiver.h</string> </object> </object> <object class="IBPartialClassDescription"> <string key="className">NSObject</string> <object class="IBClassDescriptionSource" key="sourceIdentifier"> <string key="majorKey">IBFrameworkSource</string> <string key="minorKey">Foundation.framework/Headers/NSClassDescription.h</string> </object> </object> <object class="IBPartialClassDescription"> <string key="className">NSObject</string> <object class="IBClassDescriptionSource" key="sourceIdentifier"> <string key="majorKey">IBFrameworkSource</string> <string key="minorKey">Foundation.framework/Headers/NSError.h</string> </object> </object> <object class="IBPartialClassDescription"> <string key="className">NSObject</string> <object class="IBClassDescriptionSource" key="sourceIdentifier"> <string key="majorKey">IBFrameworkSource</string> <string key="minorKey">Foundation.framework/Headers/NSFileManager.h</string> </object> </object> <object class="IBPartialClassDescription"> <string key="className">NSObject</string> <object class="IBClassDescriptionSource" key="sourceIdentifier"> <string key="majorKey">IBFrameworkSource</string> <string key="minorKey">Foundation.framework/Headers/NSKeyValueCoding.h</string> </object> </object> <object class="IBPartialClassDescription"> <string key="className">NSObject</string> <object class="IBClassDescriptionSource" key="sourceIdentifier"> <string key="majorKey">IBFrameworkSource</string> <string key="minorKey">Foundation.framework/Headers/NSKeyValueObserving.h</string> </object> </object> <object class="IBPartialClassDescription"> <string key="className">NSObject</string> <object class="IBClassDescriptionSource" key="sourceIdentifier"> <string key="majorKey">IBFrameworkSource</string> <string key="minorKey">Foundation.framework/Headers/NSKeyedArchiver.h</string> </object> </object> <object class="IBPartialClassDescription"> <string key="className">NSObject</string> <object class="IBClassDescriptionSource" key="sourceIdentifier"> <string key="majorKey">IBFrameworkSource</string> <string key="minorKey">Foundation.framework/Headers/NSObject.h</string> </object> </object> <object class="IBPartialClassDescription"> <string key="className">NSObject</string> <object class="IBClassDescriptionSource" key="sourceIdentifier"> <string key="majorKey">IBFrameworkSource</string> <string key="minorKey">Foundation.framework/Headers/NSObjectScripting.h</string> </object> </object> <object class="IBPartialClassDescription"> <string key="className">NSObject</string> <object class="IBClassDescriptionSource" key="sourceIdentifier"> <string key="majorKey">IBFrameworkSource</string> <string key="minorKey">Foundation.framework/Headers/NSPortCoder.h</string> </object> </object> <object class="IBPartialClassDescription"> <string key="className">NSObject</string> <object class="IBClassDescriptionSource" key="sourceIdentifier"> <string key="majorKey">IBFrameworkSource</string> <string key="minorKey">Foundation.framework/Headers/NSRunLoop.h</string> </object> </object> <object class="IBPartialClassDescription"> <string key="className">NSObject</string> <object class="IBClassDescriptionSource" key="sourceIdentifier"> <string key="majorKey">IBFrameworkSource</string> <string key="minorKey">Foundation.framework/Headers/NSScriptClassDescription.h</string> </object> </object> <object class="IBPartialClassDescription"> <string key="className">NSObject</string> <object class="IBClassDescriptionSource" key="sourceIdentifier"> <string key="majorKey">IBFrameworkSource</string> <string key="minorKey">Foundation.framework/Headers/NSScriptKeyValueCoding.h</string> </object> </object> <object class="IBPartialClassDescription"> <string key="className">NSObject</string> <object class="IBClassDescriptionSource" key="sourceIdentifier"> <string key="majorKey">IBFrameworkSource</string> <string key="minorKey">Foundation.framework/Headers/NSScriptObjectSpecifiers.h</string> </object> </object> <object class="IBPartialClassDescription"> <string key="className">NSObject</string> <object class="IBClassDescriptionSource" key="sourceIdentifier"> <string key="majorKey">IBFrameworkSource</string> <string key="minorKey">Foundation.framework/Headers/NSScriptWhoseTests.h</string> </object> </object> <object class="IBPartialClassDescription"> <string key="className">NSObject</string> <object class="IBClassDescriptionSource" key="sourceIdentifier"> <string key="majorKey">IBFrameworkSource</string> <string key="minorKey">Foundation.framework/Headers/NSThread.h</string> </object> </object> <object class="IBPartialClassDescription"> <string key="className">NSObject</string> <object class="IBClassDescriptionSource" key="sourceIdentifier"> <string key="majorKey">IBFrameworkSource</string> <string key="minorKey">Foundation.framework/Headers/NSURL.h</string> </object> </object> <object class="IBPartialClassDescription"> <string key="className">NSObject</string> <object class="IBClassDescriptionSource" key="sourceIdentifier"> <string key="majorKey">IBFrameworkSource</string> <string key="minorKey">Foundation.framework/Headers/NSURLConnection.h</string> </object> </object> <object class="IBPartialClassDescription"> <string key="className">NSObject</string> <object class="IBClassDescriptionSource" key="sourceIdentifier"> <string key="majorKey">IBFrameworkSource</string> <string key="minorKey">Foundation.framework/Headers/NSURLDownload.h</string> </object> </object> <object class="IBPartialClassDescription"> <string key="className">NSResponder</string> <object class="IBClassDescriptionSource" key="sourceIdentifier"> <string key="majorKey">IBFrameworkSource</string> <string key="minorKey">AppKit.framework/Headers/NSInterfaceStyle.h</string> </object> </object> <object class="IBPartialClassDescription"> <string key="className">NSResponder</string> <string key="superclassName">NSObject</string> <object class="IBClassDescriptionSource" key="sourceIdentifier"> <string key="majorKey">IBFrameworkSource</string> <string key="minorKey">AppKit.framework/Headers/NSResponder.h</string> </object> </object> <object class="IBPartialClassDescription"> <string key="className">NSTextField</string> <string key="superclassName">NSControl</string> <object class="IBClassDescriptionSource" key="sourceIdentifier"> <string key="majorKey">IBFrameworkSource</string> <string key="minorKey">AppKit.framework/Headers/NSTextField.h</string> </object> </object> <object class="IBPartialClassDescription"> <string key="className">NSTextFieldCell</string> <string key="superclassName">NSActionCell</string> <object class="IBClassDescriptionSource" key="sourceIdentifier"> <string key="majorKey">IBFrameworkSource</string> <string key="minorKey">AppKit.framework/Headers/NSTextFieldCell.h</string> </object> </object> <object class="IBPartialClassDescription"> <string key="className">NSView</string> <object class="IBClassDescriptionSource" key="sourceIdentifier"> <string key="majorKey">IBFrameworkSource</string> <string key="minorKey">AppKit.framework/Headers/NSClipView.h</string> </object> </object> <object class="IBPartialClassDescription"> <string key="className">NSView</string> <object class="IBClassDescriptionSource" key="sourceIdentifier"> <string key="majorKey">IBFrameworkSource</string> <string key="minorKey">AppKit.framework/Headers/NSMenuItem.h</string> </object> </object> <object class="IBPartialClassDescription"> <string key="className">NSView</string> <object class="IBClassDescriptionSource" key="sourceIdentifier"> <string key="majorKey">IBFrameworkSource</string> <string key="minorKey">AppKit.framework/Headers/NSRulerView.h</string> </object> </object> <object class="IBPartialClassDescription"> <string key="className">NSView</string> <string key="superclassName">NSResponder</string> <reference key="sourceIdentifier" ref="196130618"/> </object> </object> </object> <int key="IBDocument.localizationMode">0</int> <string key="IBDocument.TargetRuntimeIdentifier">IBCocoaFramework</string> <object class="NSMutableDictionary" key="IBDocument.PluginDeclaredDependencies"> <string key="NS.key.0">com.apple.InterfaceBuilder.CocoaPlugin.macosx</string> <integer value="0" key="NS.object.0"/> </object> <object class="NSMutableDictionary" key="IBDocument.PluginDeclaredDependencyDefaults"> <string key="NS.key.0">com.apple.InterfaceBuilder.CocoaPlugin.macosx</string> <integer value="1040" key="NS.object.0"/> </object> <object class="NSMutableDictionary" key="IBDocument.PluginDeclaredDevelopmentDependencies"> <string key="NS.key.0">com.apple.InterfaceBuilder.CocoaPlugin.InterfaceBuilder3</string> <integer value="3000" key="NS.object.0"/> </object> <bool key="IBDocument.PluginDeclaredDependenciesTrackSystemTargetVersion">YES</bool> <string key="IBDocument.LastKnownRelativeProjectPath">../ocs_agent_daemon_options.xcodeproj</string> <int key="IBDocument.defaultPropertyAccessControl">3</int> <object class="NSMutableDictionary" key="IBDocument.LastKnownImageSizes"> <string key="NS.key.0">NSSwitch</string> <string key="NS.object.0">{15, 15}</string> </object> </data> </archive> �����������������������������������������������������������������������������������������������������������������������������������������������UnixAgent-2.4.2/tools/macosx/installer_gui/ocs_agent_daemon_options/Info.plist����������������������0000664�0000000�0000000�00000001733�13327377321�0027740�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict> <key>CFBundleDevelopmentRegion</key> <string>English</string> <key>CFBundleExecutable</key> <string>${EXECUTABLE_NAME}</string> <key>CFBundleIconFile</key> <string></string> <key>CFBundleIdentifier</key> <string>$(PRODUCT_BUNDLE_IDENTIFIER)</string> <key>CFBundleInfoDictionaryVersion</key> <string>6.0</string> <key>CFBundleName</key> <string>Daemon options</string> <key>CFBundlePackageType</key> <string>BNDL</string> <key>CFBundleShortVersionString</key> <string>4.0</string> <key>CFBundleSignature</key> <string>????</string> <key>CFBundleVersion</key> <string>2.3</string> <key>InstallerSectionTitle</key> <string>Daemon options</string> <key>NSMainNibFile</key> <string>ocs_agent_daemon_options</string> <key>NSPrincipalClass</key> <string>InstallerSection</string> </dict> </plist> �������������������������������������UnixAgent-2.4.2/tools/macosx/installer_gui/ocs_agent_daemon_options/InstallerSections.plist���������0000664�0000000�0000000�00000000724�13327377321�0032511�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict> <key>SectionOrder</key> <array> <string>Introduction</string> <string>ReadMe</string> <string>License</string> <string>ocs_agent_launch_options.bundle</string> <string>Target</string> <string>PackageSelection</string> <string>Install</string> </array> </dict> </plist> ��������������������������������������������ocs_agent_daemon_options.xcodeproj/�����������������������������������������������������������������0000775�0000000�0000000�00000000000�13327377321�0034741�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�UnixAgent-2.4.2/tools/macosx/installer_gui/ocs_agent_daemon_options����������������������������������������������������������������������������������������������������ocs.mode1v3�����������������������������������������������������������������������������������������0000664�0000000�0000000�00000117232�13327377321�0036733�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�UnixAgent-2.4.2/tools/macosx/installer_gui/ocs_agent_daemon_options/ocs_agent_daemon_options.xcodeproj�����������������������������������������������������������������<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict> <key>ActivePerspectiveName</key> <string>Project</string> <key>AllowedModules</key> <array> <dict> <key>BundleLoadPath</key> <string></string> <key>MaxInstances</key> <string>n</string> <key>Module</key> <string>PBXSmartGroupTreeModule</string> <key>Name</key> <string>Groups and Files Outline View</string> </dict> <dict> <key>BundleLoadPath</key> <string></string> <key>MaxInstances</key> <string>n</string> <key>Module</key> <string>PBXNavigatorGroup</string> <key>Name</key> <string>Editor</string> </dict> <dict> <key>BundleLoadPath</key> <string></string> <key>MaxInstances</key> <string>n</string> <key>Module</key> <string>XCTaskListModule</string> <key>Name</key> <string>Task List</string> </dict> <dict> <key>BundleLoadPath</key> <string></string> <key>MaxInstances</key> <string>n</string> <key>Module</key> <string>XCDetailModule</string> <key>Name</key> <string>File and Smart Group Detail Viewer</string> </dict> <dict> <key>BundleLoadPath</key> <string></string> <key>MaxInstances</key> <string>1</string> <key>Module</key> <string>PBXBuildResultsModule</string> <key>Name</key> <string>Detailed Build Results Viewer</string> </dict> <dict> <key>BundleLoadPath</key> <string></string> <key>MaxInstances</key> <string>1</string> <key>Module</key> <string>PBXProjectFindModule</string> <key>Name</key> <string>Project Batch Find Tool</string> </dict> <dict> <key>BundleLoadPath</key> <string></string> <key>MaxInstances</key> <string>n</string> <key>Module</key> <string>XCProjectFormatConflictsModule</string> <key>Name</key> <string>Project Format Conflicts List</string> </dict> <dict> <key>BundleLoadPath</key> <string></string> <key>MaxInstances</key> <string>n</string> <key>Module</key> <string>PBXBookmarksModule</string> <key>Name</key> <string>Bookmarks Tool</string> </dict> <dict> <key>BundleLoadPath</key> <string></string> <key>MaxInstances</key> <string>n</string> <key>Module</key> <string>PBXClassBrowserModule</string> <key>Name</key> <string>Class Browser</string> </dict> <dict> <key>BundleLoadPath</key> <string></string> <key>MaxInstances</key> <string>n</string> <key>Module</key> <string>PBXCVSModule</string> <key>Name</key> <string>Source Code Control Tool</string> </dict> <dict> <key>BundleLoadPath</key> <string></string> <key>MaxInstances</key> <string>n</string> <key>Module</key> <string>PBXDebugBreakpointsModule</string> <key>Name</key> <string>Debug Breakpoints Tool</string> </dict> <dict> <key>BundleLoadPath</key> <string></string> <key>MaxInstances</key> <string>n</string> <key>Module</key> <string>XCDockableInspector</string> <key>Name</key> <string>Inspector</string> </dict> <dict> <key>BundleLoadPath</key> <string></string> <key>MaxInstances</key> <string>n</string> <key>Module</key> <string>PBXOpenQuicklyModule</string> <key>Name</key> <string>Open Quickly Tool</string> </dict> <dict> <key>BundleLoadPath</key> <string></string> <key>MaxInstances</key> <string>1</string> <key>Module</key> <string>PBXDebugSessionModule</string> <key>Name</key> <string>Debugger</string> </dict> <dict> <key>BundleLoadPath</key> <string></string> <key>MaxInstances</key> <string>1</string> <key>Module</key> <string>PBXDebugCLIModule</string> <key>Name</key> <string>Debug Console</string> </dict> <dict> <key>BundleLoadPath</key> <string></string> <key>MaxInstances</key> <string>n</string> <key>Module</key> <string>XCSnapshotModule</string> <key>Name</key> <string>Snapshots Tool</string> </dict> </array> <key>BundlePath</key> <string>/Developer/Library/PrivateFrameworks/DevToolsInterface.framework/Resources</string> <key>Description</key> <string>DefaultDescriptionKey</string> <key>DockingSystemVisible</key> <false/> <key>Extension</key> <string>mode1v3</string> <key>FavBarConfig</key> <dict> <key>PBXProjectModuleGUID</key> <string>06E8159E13EB2FA3008B68AB</string> <key>XCBarModuleItemNames</key> <dict/> <key>XCBarModuleItems</key> <array/> </dict> <key>FirstTimeWindowDisplayed</key> <false/> <key>Identifier</key> <string>com.apple.perspectives.project.mode1v3</string> <key>MajorVersion</key> <integer>33</integer> <key>MinorVersion</key> <integer>0</integer> <key>Name</key> <string>Default</string> <key>Notifications</key> <array/> <key>OpenEditors</key> <array/> <key>PerspectiveWidths</key> <array> <integer>-1</integer> <integer>-1</integer> </array> <key>Perspectives</key> <array> <dict> <key>ChosenToolbarItems</key> <array> <string>active-combo-popup</string> <string>action</string> <string>NSToolbarFlexibleSpaceItem</string> <string>clean</string> <string>buildOrClean</string> <string>build-and-go</string> <string>go</string> <string>servicesModuledebug</string> <string>servicesModulebuild</string> <string>debugger-enable-breakpoints</string> <string>com.apple.ide.PBXToolbarStopButton</string> <string>get-info</string> <string>NSToolbarFlexibleSpaceItem</string> <string>com.apple.pbx.toolbar.searchfield</string> </array> <key>ControllerClassBaseName</key> <string></string> <key>IconName</key> <string>WindowOfProjectWithEditor</string> <key>Identifier</key> <string>perspective.project</string> <key>IsVertical</key> <false/> <key>Layout</key> <array> <dict> <key>BecomeActive</key> <true/> <key>ContentConfiguration</key> <dict> <key>PBXBottomSmartGroupGIDs</key> <array> <string>1C37FBAC04509CD000000102</string> <string>1C37FAAC04509CD000000102</string> <string>1C37FABC05509CD000000102</string> <string>1C37FABC05539CD112110102</string> <string>E2644B35053B69B200211256</string> <string>1C37FABC04509CD000100104</string> <string>1CC0EA4004350EF90044410B</string> <string>1CC0EA4004350EF90041110B</string> </array> <key>PBXProjectModuleGUID</key> <string>1CE0B1FE06471DED0097A5F4</string> <key>PBXProjectModuleLabel</key> <string>Files</string> <key>PBXProjectStructureProvided</key> <string>yes</string> <key>PBXSmartGroupTreeModuleColumnData</key> <dict> <key>PBXSmartGroupTreeModuleColumnWidthsKey</key> <array> <real>405</real> </array> <key>PBXSmartGroupTreeModuleColumnsKey_v4</key> <array> <string>MainColumn</string> </array> </dict> <key>PBXSmartGroupTreeModuleOutlineStateKey_v7</key> <dict> <key>PBXSmartGroupTreeModuleOutlineStateExpansionKey</key> <array> <string>089C166AFE841209C02AAC07</string> <string>08FB77AFFE84173DC02AAC07</string> <string>089C167CFE841241C02AAC07</string> <string>EE3F05FA0DD294BA00EA504A</string> <string>B47CF353067B4E030066DBF6</string> <string>089C167DFE841241C02AAC07</string> <string>089C1671FE841209C02AAC07</string> <string>1058C7AEFEA557BF11CA2CBB</string> <string>1C37FBAC04509CD000000102</string> <string>1C37FABC05509CD000000102</string> </array> <key>PBXSmartGroupTreeModuleOutlineStateSelectionKey</key> <array> <array> <integer>10</integer> <integer>9</integer> <integer>5</integer> <integer>0</integer> </array> </array> <key>PBXSmartGroupTreeModuleOutlineStateVisibleRectKey</key> <string>{{0, 0}, {405, 674}}</string> </dict> <key>PBXTopSmartGroupGIDs</key> <array/> <key>XCIncludePerspectivesSwitch</key> <true/> <key>XCSharingToken</key> <string>com.apple.Xcode.GFSharingToken</string> </dict> <key>GeometryConfiguration</key> <dict> <key>Frame</key> <string>{{0, 0}, {422, 692}}</string> <key>GroupTreeTableConfiguration</key> <array> <string>MainColumn</string> <real>405</real> </array> <key>RubberWindowFrame</key> <string>0 145 1440 733 0 0 1440 878 </string> </dict> <key>Module</key> <string>PBXSmartGroupTreeModule</string> <key>Proportion</key> <string>422pt</string> </dict> <dict> <key>Dock</key> <array> <dict> <key>ContentConfiguration</key> <dict> <key>PBXProjectModuleGUID</key> <string>1CE0B20306471E060097A5F4</string> <key>PBXProjectModuleLabel</key> <string>Localizable.strings</string> <key>PBXSplitModuleInNavigatorKey</key> <dict> <key>Split0</key> <dict> <key>PBXProjectModuleGUID</key> <string>1CE0B20406471E060097A5F4</string> <key>PBXProjectModuleLabel</key> <string>Localizable.strings</string> <key>_historyCapacity</key> <integer>0</integer> <key>bookmark</key> <string>06128B6F151BD54D004BCDF5</string> <key>history</key> <array> <string>0688BCF513EF4B1500094AA2</string> <string>0688BD3513EF4F7D00094AA2</string> <string>0688BD4A13EF51B800094AA2</string> <string>069E8EFD1402FAF700897797</string> <string>069E8F681402FDF600897797</string> <string>06EBE14414D9F99D00B916EB</string> <string>0673FF0E14DB457D008A3FF8</string> <string>0632F51E14DB4EF10064D8E2</string> <string>0632F5CA14DB51740064D8E2</string> <string>0680346414DCAAC500E14075</string> <string>06128B6E151BD54D004BCDF5</string> <string>0632F51F14DB4EF10064D8E2</string> </array> </dict> <key>SplitCount</key> <string>1</string> </dict> <key>StatusBarVisibility</key> <true/> </dict> <key>GeometryConfiguration</key> <dict> <key>Frame</key> <string>{{0, 0}, {1013, 199}}</string> <key>RubberWindowFrame</key> <string>0 145 1440 733 0 0 1440 878 </string> </dict> <key>Module</key> <string>PBXNavigatorGroup</string> <key>Proportion</key> <string>199pt</string> </dict> <dict> <key>ContentConfiguration</key> <dict> <key>PBXProjectModuleGUID</key> <string>1CE0B20506471E060097A5F4</string> <key>PBXProjectModuleLabel</key> <string>Detail</string> </dict> <key>GeometryConfiguration</key> <dict> <key>Frame</key> <string>{{0, 204}, {1013, 488}}</string> <key>RubberWindowFrame</key> <string>0 145 1440 733 0 0 1440 878 </string> </dict> <key>Module</key> <string>XCDetailModule</string> <key>Proportion</key> <string>488pt</string> </dict> </array> <key>Proportion</key> <string>1013pt</string> </dict> </array> <key>Name</key> <string>Project</string> <key>ServiceClasses</key> <array> <string>XCModuleDock</string> <string>PBXSmartGroupTreeModule</string> <string>XCModuleDock</string> <string>PBXNavigatorGroup</string> <string>XCDetailModule</string> </array> <key>TableOfContents</key> <array> <string>06128B70151BD54D004BCDF5</string> <string>1CE0B1FE06471DED0097A5F4</string> <string>06128B71151BD54D004BCDF5</string> <string>1CE0B20306471E060097A5F4</string> <string>1CE0B20506471E060097A5F4</string> </array> <key>ToolbarConfigUserDefaultsMinorVersion</key> <string>2</string> <key>ToolbarConfiguration</key> <string>xcode.toolbar.config.defaultV3</string> </dict> <dict> <key>ControllerClassBaseName</key> <string></string> <key>IconName</key> <string>WindowOfProject</string> <key>Identifier</key> <string>perspective.morph</string> <key>IsVertical</key> <integer>0</integer> <key>Layout</key> <array> <dict> <key>BecomeActive</key> <integer>1</integer> <key>ContentConfiguration</key> <dict> <key>PBXBottomSmartGroupGIDs</key> <array> <string>1C37FBAC04509CD000000102</string> <string>1C37FAAC04509CD000000102</string> <string>1C08E77C0454961000C914BD</string> <string>1C37FABC05509CD000000102</string> <string>1C37FABC05539CD112110102</string> <string>E2644B35053B69B200211256</string> <string>1C37FABC04509CD000100104</string> <string>1CC0EA4004350EF90044410B</string> <string>1CC0EA4004350EF90041110B</string> </array> <key>PBXProjectModuleGUID</key> <string>11E0B1FE06471DED0097A5F4</string> <key>PBXProjectModuleLabel</key> <string>Files</string> <key>PBXProjectStructureProvided</key> <string>yes</string> <key>PBXSmartGroupTreeModuleColumnData</key> <dict> <key>PBXSmartGroupTreeModuleColumnWidthsKey</key> <array> <real>186</real> </array> <key>PBXSmartGroupTreeModuleColumnsKey_v4</key> <array> <string>MainColumn</string> </array> </dict> <key>PBXSmartGroupTreeModuleOutlineStateKey_v7</key> <dict> <key>PBXSmartGroupTreeModuleOutlineStateExpansionKey</key> <array> <string>29B97314FDCFA39411CA2CEA</string> <string>1C37FABC05509CD000000102</string> </array> <key>PBXSmartGroupTreeModuleOutlineStateSelectionKey</key> <array> <array> <integer>0</integer> </array> </array> <key>PBXSmartGroupTreeModuleOutlineStateVisibleRectKey</key> <string>{{0, 0}, {186, 337}}</string> </dict> <key>PBXTopSmartGroupGIDs</key> <array/> <key>XCIncludePerspectivesSwitch</key> <integer>1</integer> <key>XCSharingToken</key> <string>com.apple.Xcode.GFSharingToken</string> </dict> <key>GeometryConfiguration</key> <dict> <key>Frame</key> <string>{{0, 0}, {203, 355}}</string> <key>GroupTreeTableConfiguration</key> <array> <string>MainColumn</string> <real>186</real> </array> <key>RubberWindowFrame</key> <string>373 269 690 397 0 0 1440 878 </string> </dict> <key>Module</key> <string>PBXSmartGroupTreeModule</string> <key>Proportion</key> <string>100%</string> </dict> </array> <key>Name</key> <string>Morph</string> <key>PreferredWidth</key> <integer>300</integer> <key>ServiceClasses</key> <array> <string>XCModuleDock</string> <string>PBXSmartGroupTreeModule</string> </array> <key>TableOfContents</key> <array> <string>11E0B1FE06471DED0097A5F4</string> </array> <key>ToolbarConfiguration</key> <string>xcode.toolbar.config.default.shortV3</string> </dict> </array> <key>PerspectivesBarVisible</key> <false/> <key>ShelfIsVisible</key> <false/> <key>SourceDescription</key> <string>file at '/Developer/Library/PrivateFrameworks/DevToolsInterface.framework/Resources/XCPerspectivesSpecificationMode1.xcperspec'</string> <key>StatusbarIsVisible</key> <true/> <key>TimeStamp</key> <real>0.0</real> <key>ToolbarConfigUserDefaultsMinorVersion</key> <string>2</string> <key>ToolbarDisplayMode</key> <integer>1</integer> <key>ToolbarIsVisible</key> <true/> <key>ToolbarSizeMode</key> <integer>1</integer> <key>Type</key> <string>Perspectives</string> <key>UpdateMessage</key> <string>The Default Workspace in this version of Xcode now includes support to hide and show the detail view (what has been referred to as the "Metro-Morph" feature). You must discard your current Default Workspace settings and update to the latest Default Workspace in order to gain this feature. Do you wish to update to the latest Workspace defaults for project '%@'?</string> <key>WindowJustification</key> <integer>5</integer> <key>WindowOrderList</key> <array> <string>06128B73151BD54D004BCDF5</string> <string>06128B74151BD54D004BCDF5</string> <string>06128B75151BD54D004BCDF5</string> <string>06E815A213EB2FA3008B68AB</string> <string>/Users/ocs/work/ocs/dev/beta5/temp/tools/macosx/installer_gui/ocs_agent_daemon_options/ocs_agent_daemon_options.xcodeproj</string> </array> <key>WindowString</key> <string>0 145 1440 733 0 0 1440 878 </string> <key>WindowToolsV3</key> <array> <dict> <key>FirstTimeWindowDisplayed</key> <false/> <key>Identifier</key> <string>windowTool.build</string> <key>IsVertical</key> <true/> <key>Layout</key> <array> <dict> <key>Dock</key> <array> <dict> <key>ContentConfiguration</key> <dict> <key>PBXProjectModuleGUID</key> <string>1CD0528F0623707200166675</string> <key>PBXProjectModuleLabel</key> <string></string> <key>StatusBarVisibility</key> <true/> </dict> <key>GeometryConfiguration</key> <dict> <key>Frame</key> <string>{{0, 0}, {500, 218}}</string> <key>RubberWindowFrame</key> <string>347 297 500 500 0 0 1440 878 </string> </dict> <key>Module</key> <string>PBXNavigatorGroup</string> <key>Proportion</key> <string>218pt</string> </dict> <dict> <key>ContentConfiguration</key> <dict> <key>PBXProjectModuleGUID</key> <string>XCMainBuildResultsModuleGUID</string> <key>PBXProjectModuleLabel</key> <string>Build Results</string> <key>XCBuildResultsTrigger_Collapse</key> <integer>1021</integer> <key>XCBuildResultsTrigger_Open</key> <integer>1011</integer> </dict> <key>GeometryConfiguration</key> <dict> <key>Frame</key> <string>{{0, 223}, {500, 236}}</string> <key>RubberWindowFrame</key> <string>347 297 500 500 0 0 1440 878 </string> </dict> <key>Module</key> <string>PBXBuildResultsModule</string> <key>Proportion</key> <string>236pt</string> </dict> </array> <key>Proportion</key> <string>459pt</string> </dict> </array> <key>Name</key> <string>Build Results</string> <key>ServiceClasses</key> <array> <string>PBXBuildResultsModule</string> </array> <key>StatusbarIsVisible</key> <true/> <key>TableOfContents</key> <array> <string>06E815A213EB2FA3008B68AB</string> <string>06128B72151BD54D004BCDF5</string> <string>1CD0528F0623707200166675</string> <string>XCMainBuildResultsModuleGUID</string> </array> <key>ToolbarConfiguration</key> <string>xcode.toolbar.config.buildV3</string> <key>WindowContentMinSize</key> <string>486 300</string> <key>WindowString</key> <string>347 297 500 500 0 0 1440 878 </string> <key>WindowToolGUID</key> <string>06E815A213EB2FA3008B68AB</string> <key>WindowToolIsVisible</key> <false/> </dict> <dict> <key>Identifier</key> <string>windowTool.debugger</string> <key>Layout</key> <array> <dict> <key>Dock</key> <array> <dict> <key>ContentConfiguration</key> <dict> <key>Debugger</key> <dict> <key>HorizontalSplitView</key> <dict> <key>_collapsingFrameDimension</key> <real>0.0</real> <key>_indexOfCollapsedView</key> <integer>0</integer> <key>_percentageOfCollapsedView</key> <real>0.0</real> <key>isCollapsed</key> <string>yes</string> <key>sizes</key> <array> <string>{{0, 0}, {317, 164}}</string> <string>{{317, 0}, {377, 164}}</string> </array> </dict> <key>VerticalSplitView</key> <dict> <key>_collapsingFrameDimension</key> <real>0.0</real> <key>_indexOfCollapsedView</key> <integer>0</integer> <key>_percentageOfCollapsedView</key> <real>0.0</real> <key>isCollapsed</key> <string>yes</string> <key>sizes</key> <array> <string>{{0, 0}, {694, 164}}</string> <string>{{0, 164}, {694, 216}}</string> </array> </dict> </dict> <key>LauncherConfigVersion</key> <string>8</string> <key>PBXProjectModuleGUID</key> <string>1C162984064C10D400B95A72</string> <key>PBXProjectModuleLabel</key> <string>Debug - GLUTExamples (Underwater)</string> </dict> <key>GeometryConfiguration</key> <dict> <key>DebugConsoleDrawerSize</key> <string>{100, 120}</string> <key>DebugConsoleVisible</key> <string>None</string> <key>DebugConsoleWindowFrame</key> <string>{{200, 200}, {500, 300}}</string> <key>DebugSTDIOWindowFrame</key> <string>{{200, 200}, {500, 300}}</string> <key>Frame</key> <string>{{0, 0}, {694, 380}}</string> <key>RubberWindowFrame</key> <string>321 238 694 422 0 0 1440 878 </string> </dict> <key>Module</key> <string>PBXDebugSessionModule</string> <key>Proportion</key> <string>100%</string> </dict> </array> <key>Proportion</key> <string>100%</string> </dict> </array> <key>Name</key> <string>Debugger</string> <key>ServiceClasses</key> <array> <string>PBXDebugSessionModule</string> </array> <key>StatusbarIsVisible</key> <integer>1</integer> <key>TableOfContents</key> <array> <string>1CD10A99069EF8BA00B06720</string> <string>1C0AD2AB069F1E9B00FABCE6</string> <string>1C162984064C10D400B95A72</string> <string>1C0AD2AC069F1E9B00FABCE6</string> </array> <key>ToolbarConfiguration</key> <string>xcode.toolbar.config.debugV3</string> <key>WindowString</key> <string>321 238 694 422 0 0 1440 878 </string> <key>WindowToolGUID</key> <string>1CD10A99069EF8BA00B06720</string> <key>WindowToolIsVisible</key> <integer>0</integer> </dict> <dict> <key>Identifier</key> <string>windowTool.find</string> <key>Layout</key> <array> <dict> <key>Dock</key> <array> <dict> <key>Dock</key> <array> <dict> <key>ContentConfiguration</key> <dict> <key>PBXProjectModuleGUID</key> <string>1CDD528C0622207200134675</string> <key>PBXProjectModuleLabel</key> <string><No Editor></string> <key>PBXSplitModuleInNavigatorKey</key> <dict> <key>Split0</key> <dict> <key>PBXProjectModuleGUID</key> <string>1CD0528D0623707200166675</string> </dict> <key>SplitCount</key> <string>1</string> </dict> <key>StatusBarVisibility</key> <integer>1</integer> </dict> <key>GeometryConfiguration</key> <dict> <key>Frame</key> <string>{{0, 0}, {781, 167}}</string> <key>RubberWindowFrame</key> <string>62 385 781 470 0 0 1440 878 </string> </dict> <key>Module</key> <string>PBXNavigatorGroup</string> <key>Proportion</key> <string>781pt</string> </dict> </array> <key>Proportion</key> <string>50%</string> </dict> <dict> <key>BecomeActive</key> <integer>1</integer> <key>ContentConfiguration</key> <dict> <key>PBXProjectModuleGUID</key> <string>1CD0528E0623707200166675</string> <key>PBXProjectModuleLabel</key> <string>Project Find</string> </dict> <key>GeometryConfiguration</key> <dict> <key>Frame</key> <string>{{8, 0}, {773, 254}}</string> <key>RubberWindowFrame</key> <string>62 385 781 470 0 0 1440 878 </string> </dict> <key>Module</key> <string>PBXProjectFindModule</string> <key>Proportion</key> <string>50%</string> </dict> </array> <key>Proportion</key> <string>428pt</string> </dict> </array> <key>Name</key> <string>Project Find</string> <key>ServiceClasses</key> <array> <string>PBXProjectFindModule</string> </array> <key>StatusbarIsVisible</key> <integer>1</integer> <key>TableOfContents</key> <array> <string>1C530D57069F1CE1000CFCEE</string> <string>1C530D58069F1CE1000CFCEE</string> <string>1C530D59069F1CE1000CFCEE</string> <string>1CDD528C0622207200134675</string> <string>1C530D5A069F1CE1000CFCEE</string> <string>1CE0B1FE06471DED0097A5F4</string> <string>1CD0528E0623707200166675</string> </array> <key>WindowString</key> <string>62 385 781 470 0 0 1440 878 </string> <key>WindowToolGUID</key> <string>1C530D57069F1CE1000CFCEE</string> <key>WindowToolIsVisible</key> <integer>0</integer> </dict> <dict> <key>Identifier</key> <string>MENUSEPARATOR</string> </dict> <dict> <key>Identifier</key> <string>windowTool.debuggerConsole</string> <key>Layout</key> <array> <dict> <key>Dock</key> <array> <dict> <key>BecomeActive</key> <integer>1</integer> <key>ContentConfiguration</key> <dict> <key>PBXProjectModuleGUID</key> <string>1C78EAAC065D492600B07095</string> <key>PBXProjectModuleLabel</key> <string>Debugger Console</string> </dict> <key>GeometryConfiguration</key> <dict> <key>Frame</key> <string>{{0, 0}, {650, 250}}</string> <key>RubberWindowFrame</key> <string>516 632 650 250 0 0 1680 1027 </string> </dict> <key>Module</key> <string>PBXDebugCLIModule</string> <key>Proportion</key> <string>209pt</string> </dict> </array> <key>Proportion</key> <string>209pt</string> </dict> </array> <key>Name</key> <string>Debugger Console</string> <key>ServiceClasses</key> <array> <string>PBXDebugCLIModule</string> </array> <key>StatusbarIsVisible</key> <integer>1</integer> <key>TableOfContents</key> <array> <string>1C78EAAD065D492600B07095</string> <string>1C78EAAE065D492600B07095</string> <string>1C78EAAC065D492600B07095</string> </array> <key>ToolbarConfiguration</key> <string>xcode.toolbar.config.consoleV3</string> <key>WindowString</key> <string>650 41 650 250 0 0 1280 1002 </string> <key>WindowToolGUID</key> <string>1C78EAAD065D492600B07095</string> <key>WindowToolIsVisible</key> <integer>0</integer> </dict> <dict> <key>Identifier</key> <string>windowTool.snapshots</string> <key>Layout</key> <array> <dict> <key>Dock</key> <array> <dict> <key>Module</key> <string>XCSnapshotModule</string> <key>Proportion</key> <string>100%</string> </dict> </array> <key>Proportion</key> <string>100%</string> </dict> </array> <key>Name</key> <string>Snapshots</string> <key>ServiceClasses</key> <array> <string>XCSnapshotModule</string> </array> <key>StatusbarIsVisible</key> <string>Yes</string> <key>ToolbarConfiguration</key> <string>xcode.toolbar.config.snapshots</string> <key>WindowString</key> <string>315 824 300 550 0 0 1440 878 </string> <key>WindowToolIsVisible</key> <string>Yes</string> </dict> <dict> <key>Identifier</key> <string>windowTool.scm</string> <key>Layout</key> <array> <dict> <key>Dock</key> <array> <dict> <key>ContentConfiguration</key> <dict> <key>PBXProjectModuleGUID</key> <string>1C78EAB2065D492600B07095</string> <key>PBXProjectModuleLabel</key> <string><No Editor></string> <key>PBXSplitModuleInNavigatorKey</key> <dict> <key>Split0</key> <dict> <key>PBXProjectModuleGUID</key> <string>1C78EAB3065D492600B07095</string> </dict> <key>SplitCount</key> <string>1</string> </dict> <key>StatusBarVisibility</key> <integer>1</integer> </dict> <key>GeometryConfiguration</key> <dict> <key>Frame</key> <string>{{0, 0}, {452, 0}}</string> <key>RubberWindowFrame</key> <string>743 379 452 308 0 0 1280 1002 </string> </dict> <key>Module</key> <string>PBXNavigatorGroup</string> <key>Proportion</key> <string>0pt</string> </dict> <dict> <key>BecomeActive</key> <integer>1</integer> <key>ContentConfiguration</key> <dict> <key>PBXProjectModuleGUID</key> <string>1CD052920623707200166675</string> <key>PBXProjectModuleLabel</key> <string>SCM</string> </dict> <key>GeometryConfiguration</key> <dict> <key>ConsoleFrame</key> <string>{{0, 259}, {452, 0}}</string> <key>Frame</key> <string>{{0, 7}, {452, 259}}</string> <key>RubberWindowFrame</key> <string>743 379 452 308 0 0 1280 1002 </string> <key>TableConfiguration</key> <array> <string>Status</string> <real>30</real> <string>FileName</string> <real>199</real> <string>Path</string> <real>197.0950012207031</real> </array> <key>TableFrame</key> <string>{{0, 0}, {452, 250}}</string> </dict> <key>Module</key> <string>PBXCVSModule</string> <key>Proportion</key> <string>262pt</string> </dict> </array> <key>Proportion</key> <string>266pt</string> </dict> </array> <key>Name</key> <string>SCM</string> <key>ServiceClasses</key> <array> <string>PBXCVSModule</string> </array> <key>StatusbarIsVisible</key> <integer>1</integer> <key>TableOfContents</key> <array> <string>1C78EAB4065D492600B07095</string> <string>1C78EAB5065D492600B07095</string> <string>1C78EAB2065D492600B07095</string> <string>1CD052920623707200166675</string> </array> <key>ToolbarConfiguration</key> <string>xcode.toolbar.config.scm</string> <key>WindowString</key> <string>743 379 452 308 0 0 1280 1002 </string> </dict> <dict> <key>Identifier</key> <string>windowTool.breakpoints</string> <key>IsVertical</key> <integer>0</integer> <key>Layout</key> <array> <dict> <key>Dock</key> <array> <dict> <key>BecomeActive</key> <integer>1</integer> <key>ContentConfiguration</key> <dict> <key>PBXBottomSmartGroupGIDs</key> <array> <string>1C77FABC04509CD000000102</string> </array> <key>PBXProjectModuleGUID</key> <string>1CE0B1FE06471DED0097A5F4</string> <key>PBXProjectModuleLabel</key> <string>Files</string> <key>PBXProjectStructureProvided</key> <string>no</string> <key>PBXSmartGroupTreeModuleColumnData</key> <dict> <key>PBXSmartGroupTreeModuleColumnWidthsKey</key> <array> <real>168</real> </array> <key>PBXSmartGroupTreeModuleColumnsKey_v4</key> <array> <string>MainColumn</string> </array> </dict> <key>PBXSmartGroupTreeModuleOutlineStateKey_v7</key> <dict> <key>PBXSmartGroupTreeModuleOutlineStateExpansionKey</key> <array> <string>1C77FABC04509CD000000102</string> </array> <key>PBXSmartGroupTreeModuleOutlineStateSelectionKey</key> <array> <array> <integer>0</integer> </array> </array> <key>PBXSmartGroupTreeModuleOutlineStateVisibleRectKey</key> <string>{{0, 0}, {168, 350}}</string> </dict> <key>PBXTopSmartGroupGIDs</key> <array/> <key>XCIncludePerspectivesSwitch</key> <integer>0</integer> </dict> <key>GeometryConfiguration</key> <dict> <key>Frame</key> <string>{{0, 0}, {185, 368}}</string> <key>GroupTreeTableConfiguration</key> <array> <string>MainColumn</string> <real>168</real> </array> <key>RubberWindowFrame</key> <string>315 424 744 409 0 0 1440 878 </string> </dict> <key>Module</key> <string>PBXSmartGroupTreeModule</string> <key>Proportion</key> <string>185pt</string> </dict> <dict> <key>ContentConfiguration</key> <dict> <key>PBXProjectModuleGUID</key> <string>1CA1AED706398EBD00589147</string> <key>PBXProjectModuleLabel</key> <string>Detail</string> </dict> <key>GeometryConfiguration</key> <dict> <key>Frame</key> <string>{{190, 0}, {554, 368}}</string> <key>RubberWindowFrame</key> <string>315 424 744 409 0 0 1440 878 </string> </dict> <key>Module</key> <string>XCDetailModule</string> <key>Proportion</key> <string>554pt</string> </dict> </array> <key>Proportion</key> <string>368pt</string> </dict> </array> <key>MajorVersion</key> <integer>3</integer> <key>MinorVersion</key> <integer>0</integer> <key>Name</key> <string>Breakpoints</string> <key>ServiceClasses</key> <array> <string>PBXSmartGroupTreeModule</string> <string>XCDetailModule</string> </array> <key>StatusbarIsVisible</key> <integer>1</integer> <key>TableOfContents</key> <array> <string>1CDDB66807F98D9800BB5817</string> <string>1CDDB66907F98D9800BB5817</string> <string>1CE0B1FE06471DED0097A5F4</string> <string>1CA1AED706398EBD00589147</string> </array> <key>ToolbarConfiguration</key> <string>xcode.toolbar.config.breakpointsV3</string> <key>WindowString</key> <string>315 424 744 409 0 0 1440 878 </string> <key>WindowToolGUID</key> <string>1CDDB66807F98D9800BB5817</string> <key>WindowToolIsVisible</key> <integer>1</integer> </dict> <dict> <key>Identifier</key> <string>windowTool.debugAnimator</string> <key>Layout</key> <array> <dict> <key>Dock</key> <array> <dict> <key>Module</key> <string>PBXNavigatorGroup</string> <key>Proportion</key> <string>100%</string> </dict> </array> <key>Proportion</key> <string>100%</string> </dict> </array> <key>Name</key> <string>Debug Visualizer</string> <key>ServiceClasses</key> <array> <string>PBXNavigatorGroup</string> </array> <key>StatusbarIsVisible</key> <integer>1</integer> <key>ToolbarConfiguration</key> <string>xcode.toolbar.config.debugAnimatorV3</string> <key>WindowString</key> <string>100 100 700 500 0 0 1280 1002 </string> </dict> <dict> <key>Identifier</key> <string>windowTool.bookmarks</string> <key>Layout</key> <array> <dict> <key>Dock</key> <array> <dict> <key>Module</key> <string>PBXBookmarksModule</string> <key>Proportion</key> <string>100%</string> </dict> </array> <key>Proportion</key> <string>100%</string> </dict> </array> <key>Name</key> <string>Bookmarks</string> <key>ServiceClasses</key> <array> <string>PBXBookmarksModule</string> </array> <key>StatusbarIsVisible</key> <integer>0</integer> <key>WindowString</key> <string>538 42 401 187 0 0 1280 1002 </string> </dict> <dict> <key>Identifier</key> <string>windowTool.projectFormatConflicts</string> <key>Layout</key> <array> <dict> <key>Dock</key> <array> <dict> <key>Module</key> <string>XCProjectFormatConflictsModule</string> <key>Proportion</key> <string>100%</string> </dict> </array> <key>Proportion</key> <string>100%</string> </dict> </array> <key>Name</key> <string>Project Format Conflicts</string> <key>ServiceClasses</key> <array> <string>XCProjectFormatConflictsModule</string> </array> <key>StatusbarIsVisible</key> <integer>0</integer> <key>WindowContentMinSize</key> <string>450 300</string> <key>WindowString</key> <string>50 850 472 307 0 0 1440 877</string> </dict> <dict> <key>Identifier</key> <string>windowTool.classBrowser</string> <key>Layout</key> <array> <dict> <key>Dock</key> <array> <dict> <key>BecomeActive</key> <integer>1</integer> <key>ContentConfiguration</key> <dict> <key>OptionsSetName</key> <string>Hierarchy, all classes</string> <key>PBXProjectModuleGUID</key> <string>1CA6456E063B45B4001379D8</string> <key>PBXProjectModuleLabel</key> <string>Class Browser - NSObject</string> </dict> <key>GeometryConfiguration</key> <dict> <key>ClassesFrame</key> <string>{{0, 0}, {374, 96}}</string> <key>ClassesTreeTableConfiguration</key> <array> <string>PBXClassNameColumnIdentifier</string> <real>208</real> <string>PBXClassBookColumnIdentifier</string> <real>22</real> </array> <key>Frame</key> <string>{{0, 0}, {630, 331}}</string> <key>MembersFrame</key> <string>{{0, 105}, {374, 395}}</string> <key>MembersTreeTableConfiguration</key> <array> <string>PBXMemberTypeIconColumnIdentifier</string> <real>22</real> <string>PBXMemberNameColumnIdentifier</string> <real>216</real> <string>PBXMemberTypeColumnIdentifier</string> <real>97</real> <string>PBXMemberBookColumnIdentifier</string> <real>22</real> </array> <key>PBXModuleWindowStatusBarHidden2</key> <integer>1</integer> <key>RubberWindowFrame</key> <string>385 179 630 352 0 0 1440 878 </string> </dict> <key>Module</key> <string>PBXClassBrowserModule</string> <key>Proportion</key> <string>332pt</string> </dict> </array> <key>Proportion</key> <string>332pt</string> </dict> </array> <key>Name</key> <string>Class Browser</string> <key>ServiceClasses</key> <array> <string>PBXClassBrowserModule</string> </array> <key>StatusbarIsVisible</key> <integer>0</integer> <key>TableOfContents</key> <array> <string>1C0AD2AF069F1E9B00FABCE6</string> <string>1C0AD2B0069F1E9B00FABCE6</string> <string>1CA6456E063B45B4001379D8</string> </array> <key>ToolbarConfiguration</key> <string>xcode.toolbar.config.classbrowser</string> <key>WindowString</key> <string>385 179 630 352 0 0 1440 878 </string> <key>WindowToolGUID</key> <string>1C0AD2AF069F1E9B00FABCE6</string> <key>WindowToolIsVisible</key> <integer>0</integer> </dict> <dict> <key>Identifier</key> <string>windowTool.refactoring</string> <key>IncludeInToolsMenu</key> <integer>0</integer> <key>Layout</key> <array> <dict> <key>Dock</key> <array> <dict> <key>BecomeActive</key> <integer>1</integer> <key>GeometryConfiguration</key> <dict> <key>Frame</key> <string>{0, 0}, {500, 335}</string> <key>RubberWindowFrame</key> <string>{0, 0}, {500, 335}</string> </dict> <key>Module</key> <string>XCRefactoringModule</string> <key>Proportion</key> <string>100%</string> </dict> </array> <key>Proportion</key> <string>100%</string> </dict> </array> <key>Name</key> <string>Refactoring</string> <key>ServiceClasses</key> <array> <string>XCRefactoringModule</string> </array> <key>WindowString</key> <string>200 200 500 356 0 0 1920 1200 </string> </dict> </array> </dict> </plist> ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ocs.pbxuser�����������������������������������������������������������������������������������������0000664�0000000�0000000�00000024632�13327377321�0037146�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�UnixAgent-2.4.2/tools/macosx/installer_gui/ocs_agent_daemon_options/ocs_agent_daemon_options.xcodeproj�����������������������������������������������������������������// !$*UTF8*$! { 06128B6E151BD54D004BCDF5 /* PBXTextBookmark */ = { isa = PBXTextBookmark; fRef = 069BF79014D9FEF900CDCB91 /* French */; name = "Localizable.strings: 14"; rLen = 0; rLoc = 350; rType = 0; vrLen = 345; vrLoc = 25; }; 06128B6F151BD54D004BCDF5 /* PBXTextBookmark */ = { isa = PBXTextBookmark; fRef = B47CF354067B4E030066DBF6 /* English */; name = "Localizable.strings: 20"; rLen = 24; rLoc = 440; rType = 0; vrLen = 356; vrLoc = 147; }; 0632F51E14DB4EF10064D8E2 /* PBXTextBookmark */ = { isa = PBXTextBookmark; fRef = 089C167EFE841241C02AAC07 /* English */; name = "InfoPlist.strings: 15"; rLen = 0; rLoc = 404; rType = 0; vrLen = 438; vrLoc = 0; }; 0632F51F14DB4EF10064D8E2 /* PBXTextBookmark */ = { isa = PBXTextBookmark; fRef = B47CF354067B4E030066DBF6 /* English */; name = "Localizable.strings: 20"; rLen = 24; rLoc = 440; rType = 0; vrLen = 503; vrLoc = 0; }; 0632F5CA14DB51740064D8E2 /* PBXTextBookmark */ = { isa = PBXTextBookmark; fRef = 0632F5CB14DB51740064D8E2 /* NSBundle.h */; name = "NSBundle.h: 1"; rLen = 0; rLoc = 0; rType = 0; vrLen = 581; vrLoc = 0; }; 0632F5CB14DB51740064D8E2 /* NSBundle.h */ = { isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = NSBundle.h; path = /System/Library/Frameworks/Foundation.framework/Headers/NSBundle.h; sourceTree = "<absolute>"; }; 0673FF0E14DB457D008A3FF8 /* PBXTextBookmark */ = { isa = PBXTextBookmark; fRef = 06EBE15314D9F9C600B916EB /* French */; name = "InfoPlist.strings: 1"; rLen = 0; rLoc = 261; rType = 0; vrLen = 150; vrLoc = 0; }; 0680346414DCAAC500E14075 /* PBXTextBookmark */ = { isa = PBXTextBookmark; fRef = B44C200906739AE500D31AA1 /* ocs_agent_daemon_optionsPane.m */; name = "ocs_agent_daemon_optionsPane.m: 38"; rLen = 0; rLoc = 950; rType = 0; vrLen = 576; vrLoc = 1119; }; 0688BCF513EF4B1500094AA2 /* PBXTextBookmark */ = { isa = PBXTextBookmark; fRef = EE3F05FB0DD294BA00EA504A /* English */; name = "ocs_agent_daemon_options.xib: 8"; rLen = 0; rLoc = 353; rType = 0; vrLen = 1598; vrLoc = 0; }; 0688BD3513EF4F7D00094AA2 /* PBXTextBookmark */ = { isa = PBXTextBookmark; fRef = B44C200806739AE500D31AA1 /* ocs_agent_daemon_optionsPane.h */; name = "ocs_agent_daemon_optionsPane.h: 21"; rLen = 0; rLoc = 482; rType = 0; vrLen = 576; vrLoc = 0; }; 0688BD4A13EF51B800094AA2 /* PlistBookmark */ = { isa = PlistBookmark; fRef = B4A6B2A60673D523003CD9B2 /* InstallerSections.plist */; fallbackIsa = PBXBookmark; isK = 0; kPath = ( ); name = /Users/ocs/work/ocs/dev/ocs_agent_daemon_options/InstallerSections.plist; rLen = 0; rLoc = 9223372036854775808; }; 069BF79014D9FEF900CDCB91 /* French */ = { uiCtxt = { sepNavIntBoundsRect = "{{0, 0}, {952, 286}}"; sepNavSelRange = "{350, 0}"; sepNavVisRange = "{25, 345}"; sepNavWindowFrame = "{{275, 90}, {948, 706}}"; }; }; 069E8EFD1402FAF700897797 /* PlistBookmark */ = { isa = PlistBookmark; fRef = 8D5B49B7048680CD000E48DA /* Info.plist */; fallbackIsa = PBXBookmark; isK = 0; kPath = ( ); name = /Users/ocs/work/ocs/dev/debug_tiger/installer_gui/ocs_agent_daemon_options/Info.plist; rLen = 0; rLoc = 9223372036854775808; }; 069E8F001402FAF700897797 /* objc.h */ = { isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = objc.h; path = /Developer/SDKs/MacOSX10.4u.sdk/usr/include/objc/objc.h; sourceTree = "<absolute>"; }; 069E8F681402FDF600897797 /* PBXTextBookmark */ = { isa = PBXTextBookmark; fRef = 069E8F001402FAF700897797 /* objc.h */; name = "objc.h: 34"; rLen = 0; rLoc = 1173; rType = 0; vrLen = 721; vrLoc = 834; }; 06E815A413EB2FA3008B68AB /* Source Control */ = { isa = PBXSourceControlManager; fallbackIsa = XCSourceControlManager; isSCMEnabled = 0; scmConfiguration = { repositoryNamesForRoots = { "" = ""; }; }; }; 06E815A513EB2FA3008B68AB /* Code sense */ = { isa = PBXCodeSenseManager; indexTemplatePath = ""; }; 06EBE14414D9F99D00B916EB /* PBXTextBookmark */ = { isa = PBXTextBookmark; fRef = 32DBCF630370AF2F00C91783 /* ocs_agent_daemon_options_Prefix.pch */; name = "ocs_agent_daemon_options_Prefix.pch: 1"; rLen = 0; rLoc = 0; rType = 0; vrLen = 162; vrLoc = 0; }; 06EBE15314D9F9C600B916EB /* French */ = { uiCtxt = { sepNavIntBoundsRect = "{{0, 0}, {889, 578}}"; sepNavSelRange = "{259, 0}"; sepNavVisRange = "{0, 406}"; sepNavWindowFrame = "{{460, 171}, {948, 706}}"; }; }; 06EBE18014D9FBC200B916EB /* French */ = { uiCtxt = { sepNavIntBoundsRect = "{{0, 0}, {952, 13117}}"; sepNavSelRange = "{44397, 0}"; sepNavVisRange = "{0, 1244}"; sepNavWindowFrame = "{{38, 146}, {948, 706}}"; }; }; 089C1669FE841209C02AAC07 /* Project object */ = { activeArchitecturePreference = i386; activeBuildConfigurationName = Release; activeTarget = 8D5B49AC048680CD000E48DA /* ocs_agent_daemon_options */; codeSenseManager = 06E815A513EB2FA3008B68AB /* Code sense */; perUserDictionary = { PBXConfiguration.PBXFileTableDataSource3.PBXBookmarksDataSource = { PBXFileTableDataSourceColumnSortingDirectionKey = "-1"; PBXFileTableDataSourceColumnSortingKey = PBXBookmarksDataSource_NameID; PBXFileTableDataSourceColumnWidthsKey = ( 200, 200, 583.58349609375, ); PBXFileTableDataSourceColumnsKey = ( PBXBookmarksDataSource_LocationID, PBXBookmarksDataSource_NameID, PBXBookmarksDataSource_CommentsID, ); }; PBXConfiguration.PBXFileTableDataSource3.PBXExecutablesDataSource = { PBXFileTableDataSourceColumnSortingDirectionKey = "-1"; PBXFileTableDataSourceColumnSortingKey = PBXExecutablesDataSource_NameID; PBXFileTableDataSourceColumnWidthsKey = ( 22, 300, 662, ); PBXFileTableDataSourceColumnsKey = ( PBXExecutablesDataSource_ActiveFlagID, PBXExecutablesDataSource_NameID, PBXExecutablesDataSource_CommentsID, ); }; PBXConfiguration.PBXFileTableDataSource3.PBXFileTableDataSource = { PBXFileTableDataSourceColumnSortingDirectionKey = "-1"; PBXFileTableDataSourceColumnSortingKey = PBXFileDataSource_Filename_ColumnID; PBXFileTableDataSourceColumnWidthsKey = ( 20, 774, 20, 48, 43, 43, 20, ); PBXFileTableDataSourceColumnsKey = ( PBXFileDataSource_FiletypeID, PBXFileDataSource_Filename_ColumnID, PBXFileDataSource_Built_ColumnID, PBXFileDataSource_ObjectSize_ColumnID, PBXFileDataSource_Errors_ColumnID, PBXFileDataSource_Warnings_ColumnID, PBXFileDataSource_Target_ColumnID, ); }; PBXConfiguration.PBXTargetDataSource.PBXTargetDataSource = { PBXFileTableDataSourceColumnSortingDirectionKey = "-1"; PBXFileTableDataSourceColumnSortingKey = PBXFileDataSource_Filename_ColumnID; PBXFileTableDataSourceColumnWidthsKey = ( 20, 734, 60, 20, 48, 43, 43, ); PBXFileTableDataSourceColumnsKey = ( PBXFileDataSource_FiletypeID, PBXFileDataSource_Filename_ColumnID, PBXTargetDataSource_PrimaryAttribute, PBXFileDataSource_Built_ColumnID, PBXFileDataSource_ObjectSize_ColumnID, PBXFileDataSource_Errors_ColumnID, PBXFileDataSource_Warnings_ColumnID, ); }; PBXPerProjectTemplateStateSaveDate = 354145594; PBXWorkspaceStateSaveDate = 354145594; }; perUserProjectItems = { 06128B6E151BD54D004BCDF5 /* PBXTextBookmark */ = 06128B6E151BD54D004BCDF5 /* PBXTextBookmark */; 06128B6F151BD54D004BCDF5 /* PBXTextBookmark */ = 06128B6F151BD54D004BCDF5 /* PBXTextBookmark */; 0632F51E14DB4EF10064D8E2 /* PBXTextBookmark */ = 0632F51E14DB4EF10064D8E2 /* PBXTextBookmark */; 0632F51F14DB4EF10064D8E2 /* PBXTextBookmark */ = 0632F51F14DB4EF10064D8E2 /* PBXTextBookmark */; 0632F5CA14DB51740064D8E2 /* PBXTextBookmark */ = 0632F5CA14DB51740064D8E2 /* PBXTextBookmark */; 0673FF0E14DB457D008A3FF8 /* PBXTextBookmark */ = 0673FF0E14DB457D008A3FF8 /* PBXTextBookmark */; 0680346414DCAAC500E14075 /* PBXTextBookmark */ = 0680346414DCAAC500E14075 /* PBXTextBookmark */; 0688BCF513EF4B1500094AA2 /* PBXTextBookmark */ = 0688BCF513EF4B1500094AA2 /* PBXTextBookmark */; 0688BD3513EF4F7D00094AA2 /* PBXTextBookmark */ = 0688BD3513EF4F7D00094AA2 /* PBXTextBookmark */; 0688BD4A13EF51B800094AA2 /* PlistBookmark */ = 0688BD4A13EF51B800094AA2 /* PlistBookmark */; 069E8EFD1402FAF700897797 /* PlistBookmark */ = 069E8EFD1402FAF700897797 /* PlistBookmark */; 069E8F681402FDF600897797 /* PBXTextBookmark */ = 069E8F681402FDF600897797 /* PBXTextBookmark */; 06EBE14414D9F99D00B916EB /* PBXTextBookmark */ = 06EBE14414D9F99D00B916EB /* PBXTextBookmark */; }; sourceControlManager = 06E815A413EB2FA3008B68AB /* Source Control */; userBuildSettings = { }; }; 089C167EFE841241C02AAC07 /* English */ = { uiCtxt = { sepNavIntBoundsRect = "{{0, 0}, {889, 578}}"; sepNavSelRange = "{259, 0}"; sepNavVisRange = "{0, 404}"; sepNavWindowFrame = "{{84, 104}, {948, 706}}"; }; }; 32DBCF630370AF2F00C91783 /* ocs_agent_daemon_options_Prefix.pch */ = { uiCtxt = { sepNavIntBoundsRect = "{{0, 0}, {952, 344}}"; sepNavSelRange = "{0, 0}"; sepNavVisRange = "{0, 162}"; }; }; 8D5B49AC048680CD000E48DA /* ocs_agent_daemon_options */ = { activeExec = 0; }; 8D5B49B7048680CD000E48DA /* Info.plist */ = { uiCtxt = { sepNavWindowFrame = "{{61, 125}, {948, 706}}"; }; }; B44C200806739AE500D31AA1 /* ocs_agent_daemon_optionsPane.h */ = { uiCtxt = { sepNavIntBoundsRect = "{{0, 0}, {889, 578}}"; sepNavSelRange = "{482, 0}"; sepNavVisRange = "{0, 576}"; sepNavWindowFrame = "{{124, 161}, {948, 706}}"; }; }; B44C200906739AE500D31AA1 /* ocs_agent_daemon_optionsPane.m */ = { uiCtxt = { sepNavIntBoundsRect = "{{0, 0}, {915, 1859}}"; sepNavSelRange = "{950, 0}"; sepNavVisRange = "{0, 1100}"; sepNavWindowFrame = "{{90, 163}, {948, 706}}"; }; }; B47CF354067B4E030066DBF6 /* English */ = { uiCtxt = { sepNavIntBoundsRect = "{{0, 0}, {952, 273}}"; sepNavSelRange = "{440, 24}"; sepNavVisRange = "{147, 356}"; sepNavWindowFrame = "{{492, 172}, {948, 706}}"; }; }; B4A6B2A60673D523003CD9B2 /* InstallerSections.plist */ = { uiCtxt = { sepNavWindowFrame = "{{15, 167}, {948, 706}}"; }; }; EE3F05FB0DD294BA00EA504A /* English */ = { uiCtxt = { sepNavIntBoundsRect = "{{0, 0}, {889, 13104}}"; sepNavSelRange = "{353, 0}"; sepNavVisRange = "{1363, 2034}"; sepNavWindowFrame = "{{15, 167}, {948, 706}}"; }; }; } ������������������������������������������������������������������������������������������������������project.pbxproj�������������������������������������������������������������������������������������0000664�0000000�0000000�00000033271�13327377321�0040023�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�UnixAgent-2.4.2/tools/macosx/installer_gui/ocs_agent_daemon_options/ocs_agent_daemon_options.xcodeproj�����������������������������������������������������������������// !$*UTF8*$! { archiveVersion = 1; classes = { }; objectVersion = 45; objects = { /* Begin PBXBuildFile section */ 8D5B49B0048680CD000E48DA /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 089C167DFE841241C02AAC07 /* InfoPlist.strings */; }; 8D5B49B4048680CD000E48DA /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1058C7ADFEA557BF11CA2CBB /* Cocoa.framework */; }; B40F7FFC06739E1B0053A16B /* InstallerPlugins.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = B40F7FFB06739E1B0053A16B /* InstallerPlugins.framework */; }; B44C200B06739AE500D31AA1 /* ocs_agent_daemon_optionsPane.m in Sources */ = {isa = PBXBuildFile; fileRef = B44C200906739AE500D31AA1 /* ocs_agent_daemon_optionsPane.m */; }; B47CF355067B4E030066DBF6 /* Localizable.strings in Resources */ = {isa = PBXBuildFile; fileRef = B47CF353067B4E030066DBF6 /* Localizable.strings */; }; EE3F05FC0DD294BA00EA504A /* ocs_agent_daemon_options.xib in Resources */ = {isa = PBXBuildFile; fileRef = EE3F05FA0DD294BA00EA504A /* ocs_agent_daemon_options.xib */; }; /* End PBXBuildFile section */ /* Begin PBXFileReference section */ 069BF79014D9FEF900CDCB91 /* French */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = French; path = French.lproj/Localizable.strings; sourceTree = "<group>"; }; 06EBE15314D9F9C600B916EB /* French */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = French; path = French.lproj/InfoPlist.strings; sourceTree = "<group>"; }; 06EBE18014D9FBC200B916EB /* French */ = {isa = PBXFileReference; explicitFileType = file.xib; name = French; path = French.lproj/ocs_agent_daemon_options.xib; sourceTree = "<group>"; }; 089C1672FE841209C02AAC07 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = /System/Library/Frameworks/Foundation.framework; sourceTree = "<absolute>"; }; 089C167EFE841241C02AAC07 /* English */ = {isa = PBXFileReference; fileEncoding = 10; lastKnownFileType = text.plist.strings; name = English; path = English.lproj/InfoPlist.strings; sourceTree = "<group>"; }; 089C167FFE841241C02AAC07 /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = /System/Library/Frameworks/AppKit.framework; sourceTree = "<absolute>"; }; 1058C7ADFEA557BF11CA2CBB /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = /System/Library/Frameworks/Cocoa.framework; sourceTree = "<absolute>"; }; 32DBCF630370AF2F00C91783 /* ocs_agent_daemon_options_Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ocs_agent_daemon_options_Prefix.pch; sourceTree = "<group>"; }; 8D5B49B6048680CD000E48DA /* ocs_agent_daemon_options.bundle */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = ocs_agent_daemon_options.bundle; sourceTree = BUILT_PRODUCTS_DIR; }; 8D5B49B7048680CD000E48DA /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; }; B40F7FFB06739E1B0053A16B /* InstallerPlugins.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = InstallerPlugins.framework; path = /System/Library/Frameworks/InstallerPlugins.framework; sourceTree = "<absolute>"; }; B44C200806739AE500D31AA1 /* ocs_agent_daemon_optionsPane.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ocs_agent_daemon_optionsPane.h; sourceTree = "<group>"; }; B44C200906739AE500D31AA1 /* ocs_agent_daemon_optionsPane.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ocs_agent_daemon_optionsPane.m; sourceTree = "<group>"; }; B47CF354067B4E030066DBF6 /* English */ = {isa = PBXFileReference; fileEncoding = 10; lastKnownFileType = text.plist.strings; name = English; path = English.lproj/Localizable.strings; sourceTree = "<group>"; }; B4A6B2A60673D523003CD9B2 /* InstallerSections.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = InstallerSections.plist; sourceTree = "<group>"; }; EE3F05FB0DD294BA00EA504A /* English */ = {isa = PBXFileReference; explicitFileType = file.xib; name = English; path = English.lproj/ocs_agent_daemon_options.xib; sourceTree = "<group>"; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ 8D5B49B3048680CD000E48DA /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( 8D5B49B4048680CD000E48DA /* Cocoa.framework in Frameworks */, B40F7FFC06739E1B0053A16B /* InstallerPlugins.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ 089C166AFE841209C02AAC07 /* InstallerPlugin */ = { isa = PBXGroup; children = ( 08FB77AFFE84173DC02AAC07 /* Classes */, 32C88E010371C26100C91783 /* Other Sources */, 089C167CFE841241C02AAC07 /* Resources */, 089C1671FE841209C02AAC07 /* Frameworks and Libraries */, 19C28FB8FE9D52D311CA2CBB /* Products */, ); name = InstallerPlugin; sourceTree = "<group>"; }; 089C1671FE841209C02AAC07 /* Frameworks and Libraries */ = { isa = PBXGroup; children = ( 1058C7ACFEA557BF11CA2CBB /* Linked Frameworks */, 1058C7AEFEA557BF11CA2CBB /* Other Frameworks */, ); name = "Frameworks and Libraries"; sourceTree = "<group>"; }; 089C167CFE841241C02AAC07 /* Resources */ = { isa = PBXGroup; children = ( EE3F05FA0DD294BA00EA504A /* ocs_agent_daemon_options.xib */, B47CF353067B4E030066DBF6 /* Localizable.strings */, B4A6B2A60673D523003CD9B2 /* InstallerSections.plist */, 8D5B49B7048680CD000E48DA /* Info.plist */, 089C167DFE841241C02AAC07 /* InfoPlist.strings */, ); name = Resources; sourceTree = "<group>"; }; 08FB77AFFE84173DC02AAC07 /* Classes */ = { isa = PBXGroup; children = ( B44C200906739AE500D31AA1 /* ocs_agent_daemon_optionsPane.m */, B44C200806739AE500D31AA1 /* ocs_agent_daemon_optionsPane.h */, ); name = Classes; sourceTree = "<group>"; }; 1058C7ACFEA557BF11CA2CBB /* Linked Frameworks */ = { isa = PBXGroup; children = ( 1058C7ADFEA557BF11CA2CBB /* Cocoa.framework */, B40F7FFB06739E1B0053A16B /* InstallerPlugins.framework */, ); name = "Linked Frameworks"; sourceTree = "<group>"; }; 1058C7AEFEA557BF11CA2CBB /* Other Frameworks */ = { isa = PBXGroup; children = ( 089C1672FE841209C02AAC07 /* Foundation.framework */, 089C167FFE841241C02AAC07 /* AppKit.framework */, ); name = "Other Frameworks"; sourceTree = "<group>"; }; 19C28FB8FE9D52D311CA2CBB /* Products */ = { isa = PBXGroup; children = ( 8D5B49B6048680CD000E48DA /* ocs_agent_daemon_options.bundle */, ); name = Products; sourceTree = "<group>"; }; 32C88E010371C26100C91783 /* Other Sources */ = { isa = PBXGroup; children = ( 32DBCF630370AF2F00C91783 /* ocs_agent_daemon_options_Prefix.pch */, ); name = "Other Sources"; sourceTree = "<group>"; }; /* End PBXGroup section */ /* Begin PBXNativeTarget section */ 8D5B49AC048680CD000E48DA /* ocs_agent_daemon_options */ = { isa = PBXNativeTarget; buildConfigurationList = B44174E608BA33C40065BEDE /* Build configuration list for PBXNativeTarget "ocs_agent_daemon_options" */; buildPhases = ( 8D5B49AF048680CD000E48DA /* Resources */, 8D5B49B1048680CD000E48DA /* Sources */, 8D5B49B3048680CD000E48DA /* Frameworks */, ); buildRules = ( ); dependencies = ( ); name = ocs_agent_daemon_options; productInstallPath = "$(HOME)/Library/Bundles"; productName = InstallerPlugin; productReference = 8D5B49B6048680CD000E48DA /* ocs_agent_daemon_options.bundle */; productType = "com.apple.product-type.bundle"; }; /* End PBXNativeTarget section */ /* Begin PBXProject section */ 089C1669FE841209C02AAC07 /* Project object */ = { isa = PBXProject; attributes = { LastUpgradeCheck = 0900; }; buildConfigurationList = B44174EA08BA33C40065BEDE /* Build configuration list for PBXProject "ocs_agent_daemon_options" */; compatibilityVersion = "Xcode 3.1"; developmentRegion = English; hasScannedForEncodings = 1; knownRegions = ( English, Japanese, French, German, ); mainGroup = 089C166AFE841209C02AAC07 /* InstallerPlugin */; projectDirPath = ""; projectRoot = ""; targets = ( 8D5B49AC048680CD000E48DA /* ocs_agent_daemon_options */, ); }; /* End PBXProject section */ /* Begin PBXResourcesBuildPhase section */ 8D5B49AF048680CD000E48DA /* Resources */ = { isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( 8D5B49B0048680CD000E48DA /* InfoPlist.strings in Resources */, B47CF355067B4E030066DBF6 /* Localizable.strings in Resources */, EE3F05FC0DD294BA00EA504A /* ocs_agent_daemon_options.xib in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXResourcesBuildPhase section */ /* Begin PBXSourcesBuildPhase section */ 8D5B49B1048680CD000E48DA /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( B44C200B06739AE500D31AA1 /* ocs_agent_daemon_optionsPane.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXSourcesBuildPhase section */ /* Begin PBXVariantGroup section */ 089C167DFE841241C02AAC07 /* InfoPlist.strings */ = { isa = PBXVariantGroup; children = ( 089C167EFE841241C02AAC07 /* English */, 06EBE15314D9F9C600B916EB /* French */, ); name = InfoPlist.strings; sourceTree = "<group>"; }; B47CF353067B4E030066DBF6 /* Localizable.strings */ = { isa = PBXVariantGroup; children = ( B47CF354067B4E030066DBF6 /* English */, 069BF79014D9FEF900CDCB91 /* French */, ); name = Localizable.strings; sourceTree = "<group>"; }; EE3F05FA0DD294BA00EA504A /* ocs_agent_daemon_options.xib */ = { isa = PBXVariantGroup; children = ( EE3F05FB0DD294BA00EA504A /* English */, 06EBE18014D9FBC200B916EB /* French */, ); name = ocs_agent_daemon_options.xib; sourceTree = "<group>"; }; /* End PBXVariantGroup section */ /* Begin XCBuildConfiguration section */ B44174E708BA33C40065BEDE /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { COPY_PHASE_STRIP = NO; GCC_DYNAMIC_NO_PIC = NO; GCC_ENABLE_FIX_AND_CONTINUE = YES; GCC_MODEL_TUNING = G5; GCC_OPTIMIZATION_LEVEL = 0; GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = ocs_agent_daemon_options_Prefix.pch; GCC_VERSION = com.apple.compilers.llvm.clang.1_0; INFOPLIST_FILE = Info.plist; INSTALL_PATH = "$(HOME)/Library/Bundles"; MACOSX_DEPLOYMENT_TARGET = 10.11; ONLY_ACTIVE_ARCH = NO; PRODUCT_BUNDLE_IDENTIFIER = "org.ocsinventory-ng.${PRODUCT_NAME:identifier}"; PRODUCT_NAME = ocs_agent_daemon_options; SDKROOT = "$(DEVELOPER_SDK_DIR)/MacOSX10.11.sdk"; STRINGS_FILE_OUTPUT_ENCODING = "UTF-8"; WRAPPER_EXTENSION = bundle; ZERO_LINK = YES; }; name = Debug; }; B44174E808BA33C40065BEDE /* Release */ = { isa = XCBuildConfiguration; buildSettings = { DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; GCC_MODEL_TUNING = G5; GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = ocs_agent_daemon_options_Prefix.pch; GCC_VERSION = com.apple.compilers.llvm.clang.1_0; INFOPLIST_FILE = Info.plist; INSTALL_PATH = "$(HOME)/Library/Bundles"; MACOSX_DEPLOYMENT_TARGET = 10.11; PRODUCT_BUNDLE_IDENTIFIER = "org.ocsinventory-ng.${PRODUCT_NAME:identifier}"; PRODUCT_NAME = ocs_agent_daemon_options; SDKROOT = "$(DEVELOPER_SDK_DIR)/MacOSX10.11.sdk"; STRINGS_FILE_OUTPUT_ENCODING = "UTF-8"; WRAPPER_EXTENSION = bundle; }; name = Release; }; B44174EB08BA33C40065BEDE /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; ENABLE_TESTABILITY = YES; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_VERSION = ""; GCC_WARN_ABOUT_RETURN_TYPE = YES; GCC_WARN_UNUSED_VARIABLE = YES; MACOSX_DEPLOYMENT_TARGET = 10.11; ONLY_ACTIVE_ARCH = YES; PREBINDING = NO; SDKROOT = "$(DEVELOPER_SDK_DIR)/MacOSX10.11.sdk"; STRINGS_FILE_OUTPUT_ENCODING = "UTF-8"; }; name = Debug; }; B44174EC08BA33C40065BEDE /* Release */ = { isa = XCBuildConfiguration; buildSettings = { CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_VERSION = ""; GCC_WARN_ABOUT_RETURN_TYPE = YES; GCC_WARN_UNUSED_VARIABLE = YES; MACOSX_DEPLOYMENT_TARGET = 10.11; "MACOSX_DEPLOYMENT_TARGET[arch=x86_64]" = 10.11; PREBINDING = NO; SDKROOT = "$(DEVELOPER_SDK_DIR)/MacOSX10.11.sdk"; STRINGS_FILE_OUTPUT_ENCODING = "UTF-8"; }; name = Release; }; /* End XCBuildConfiguration section */ /* Begin XCConfigurationList section */ B44174E608BA33C40065BEDE /* Build configuration list for PBXNativeTarget "ocs_agent_daemon_options" */ = { isa = XCConfigurationList; buildConfigurations = ( B44174E708BA33C40065BEDE /* Debug */, B44174E808BA33C40065BEDE /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; B44174EA08BA33C40065BEDE /* Build configuration list for PBXProject "ocs_agent_daemon_options" */ = { isa = XCConfigurationList; buildConfigurations = ( B44174EB08BA33C40065BEDE /* Debug */, B44174EC08BA33C40065BEDE /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; /* End XCConfigurationList section */ }; rootObject = 089C1669FE841209C02AAC07 /* Project object */; } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������UnixAgent-2.4.2/tools/macosx/installer_gui/ocs_agent_daemon_options/ocs_agent_daemon_optionsPane.h��0000664�0000000�0000000�00000001100�13327377321�0033771�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// // OCSINVENTORY-NG // // Copyleft Guillaume PROTET 2011 // // // This code is open source and may be copied and modified as long as the source // code is always made freely available. // Please refer to the General Public Licence http://www.gnu.org/ // // #import <Cocoa/Cocoa.h> #import <InstallerPlugins/InstallerPlugins.h> @interface ocs_agent_daemon_optionsPane : InstallerPane { IBOutlet NSTextField *periodicity; IBOutlet NSButton *now; IBOutlet NSButton *startup; NSFileManager *filemgr; NSString *tmpLaunchdFilePath; NSString *tmpNowFilePath; } @end ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������UnixAgent-2.4.2/tools/macosx/installer_gui/ocs_agent_daemon_options/ocs_agent_daemon_optionsPane.m��0000664�0000000�0000000�00000007337�13327377321�0034020�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// // OCSINVENTORY-NG // // Copyleft Guillaume PROTET 2011 // // // This code is open source and may be copied and modified as long as the source // code is always made freely available. // Please refer to the General Public Licence http://www.gnu.org/ // // #import "ocs_agent_daemon_optionsPane.h" @implementation ocs_agent_daemon_optionsPane - (NSString *)title { return [[NSBundle bundleForClass:[self class]] localizedStringForKey:@"PaneTitle" value:nil table:nil]; } - (void)didEnterPane:(InstallerSectionDirection)dir { NSString *tmpPath = @"/tmp/ocs_installer"; filemgr = [ NSFileManager defaultManager]; tmpLaunchdFilePath =@"/tmp/ocs_installer/org.ocsng.agent.plist"; tmpNowFilePath = @"/tmp/ocs_installer/now"; //Checking if temp directory exists if ([filemgr fileExistsAtPath:tmpPath]) { [filemgr removeItemAtPath:tmpLaunchdFilePath error:nil]; [filemgr removeItemAtPath:tmpNowFilePath error:nil]; } else { [filemgr createDirectoryAtPath:tmpPath withIntermediateDirectories:true attributes:nil error:nil]; } // fill defaults values [periodicity setStringValue:@"5"]; [startup setState:1]; [now setState:0]; } - (BOOL)shouldExitPane:(InstallerSectionDirection)Direction { NSMutableString *launchdCfgFile; NSAlert *periodicityValueWrn; //Creating org.ocsng.agent.plist file for launchd //TODO: use XML parser instead of writing the XML as a simple text file ? launchdCfgFile = [@"<?xml version='1.0' encoding='UTF-8'?>\n" @"<!DOCTYPE plist PUBLIC '-//Apple//DTD PLIST 1.0//EN' 'http://www.apple.com/DTDs/PropertyList-1.0.dtd'>\n" @"<plist version='1.0'>\n" @"<dict>\n" @"\t<key>Label</key>\n" @"\t<string>org.ocsng.agent</string>\n" @"\t<key>ProgramArguments</key>\n" @"\t\t<array>\n" @"\t\t\t<string>/Applications/OCSNG.app/Contents/MacOS/OCSNG</string>\n" @"\t\t</array>\n" mutableCopy]; if ([startup state] == 1) { [launchdCfgFile appendString:@"\t<key>RunAtLoad</key>\n" @"\t<true/>\n" ]; } if ( [[periodicity stringValue] length] > 0) { //We convert string to numeric value and check if it is integer NSNumberFormatter *formatter = [[NSNumberFormatter alloc] init]; NSNumber *convert = [formatter numberFromString:[periodicity stringValue]]; [formatter release]; if (convert) { int hours = [convert intValue]; int seconds = hours * 3600; [launchdCfgFile appendString:@"\t<key>StartInterval</key>\n" @"\t<integer>" ]; [launchdCfgFile appendString:[NSString stringWithFormat:@"%d", seconds]]; [launchdCfgFile appendString:@"</integer>\n"]; } else { //We display a warn message and we go back to pane periodicityValueWrn = [[NSAlert alloc] init]; [periodicityValueWrn addButtonWithTitle:NSLocalizedString(@"OK", @"OK")]; [periodicityValueWrn setMessageText:NSLocalizedStringFromTableInBundle(@"Periodicity_warn",nil,[NSBundle bundleForClass:[self class]], @"Peridocity warn")]; [periodicityValueWrn setInformativeText:NSLocalizedStringFromTableInBundle(@"Periodicity_warn_comment",nil,[NSBundle bundleForClass:[self class]], @"Periodicity warn comment")]; [periodicityValueWrn setAlertStyle:NSInformationalAlertStyle]; [periodicityValueWrn runModal]; [periodicityValueWrn release]; [self gotoPreviousPane]; } } [launchdCfgFile appendString:@"</dict>\n" @"</plist>" ]; //Writing org.ocsng.agent.plist file [launchdCfgFile writeToFile:tmpLaunchdFilePath atomically: YES encoding:NSUTF8StringEncoding error:NULL]; //Check if we launch agent after install if ([now state] == 1) { [filemgr createFileAtPath:tmpNowFilePath contents:nil attributes:nil]; } return (YES); } @end �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ocs_agent_daemon_options_Prefix.pch�����������������������������������������������������������������0000664�0000000�0000000�00000000242�13327377321�0034754�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�UnixAgent-2.4.2/tools/macosx/installer_gui/ocs_agent_daemon_options����������������������������������������������������������������������������������������������������// // Prefix header for all source files of the 'InstallerPlugin' target in the 'InstallerPlugin' project. // #ifdef __OBJC__ #import <Cocoa/Cocoa.h> #endif ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������UnixAgent-2.4.2/tools/macosx/ocsng_app-xcode/�������������������������������������������������������0000775�0000000�0000000�00000000000�13327377321�0021134�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������UnixAgent-2.4.2/tools/macosx/ocsng_app-xcode/English.lproj/�����������������������������������������0000775�0000000�0000000�00000000000�13327377321�0023652�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������UnixAgent-2.4.2/tools/macosx/ocsng_app-xcode/English.lproj/InfoPlist.strings������������������������0000664�0000000�0000000�00000000372�13327377321�0027176�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/�*� �L�o�c�a�l�i�z�e�d� �v�e�r�s�i�o�n�s� �o�f� �I�n�f�o�.�p�l�i�s�t� �k�e�y�s� �*�/� � �N�S�H�u�m�a�n�R�e�a�d�a�b�l�e�C�o�p�y�r�i�g�h�t� �=� �"�C�o�p�y�l�e�f�t� �B�a�r�e�l�y�3�a�m�.�c�o�m� �-� �c�l�a�i�m�i�d�/�s�a�x�j�a�z�m�a�n�9�,� �2�0�0�8�"�;�����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������UnixAgent-2.4.2/tools/macosx/ocsng_app-xcode/English.lproj/Localizable.strings����������������������0000664�0000000�0000000�00000001062�13327377321�0027505�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// // OCSINVENTORY-NG // Copyleft Guillaume PROTET 2011 // Web : http://www.ocsinventory-ng.org // // This code is open source and may be copied and modified as long as the source // code is always made freely available. // Please refer to the General Public Licence http://www.gnu.org/ or Licence.txt // // //Yes button "Yes" = "Yes"; //No button "No" = "No"; //First Window question "Ask_agent_run" = "Do you want to launch OCS Inventory NG agent ?"; //First window comment "Ask_agent_run_comment" = "This will take contact with OCS Inventory NG server";������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������UnixAgent-2.4.2/tools/macosx/ocsng_app-xcode/French.lproj/������������������������������������������0000775�0000000�0000000�00000000000�13327377321�0023466�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������UnixAgent-2.4.2/tools/macosx/ocsng_app-xcode/French.lproj/Localizable.strings�����������������������0000664�0000000�0000000�00000001064�13327377321�0027323�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// // OCSINVENTORY-NG // Copyleft Guillaume PROTET 2011 // Web : http://www.ocsinventory-ng.org // // This code is open source and may be copied and modified as long as the source // code is always made freely available. // Please refer to the General Public Licence http://www.gnu.org/ or Licence.txt // // //Yes button "Yes" = "Oui"; //No button "No" = "Non"; //First Window question "Ask_agent_run" = "Voulez-vous lancer l'agent OCS Inventory NG ?"; //First window comment "Ask_agent_run_comment" = "Ceci prendra contact avec le serveur OCS Inventory NG";����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������UnixAgent-2.4.2/tools/macosx/ocsng_app-xcode/GetPID.c�����������������������������������������������0000775�0000000�0000000�00000051277�13327377321�0022373�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* File: GetPID.c Description: This file provides a simple API to do process PID lookup based on process name. Author: Chad Jones Copyright: © Copyright 2003 Apple Computer, Inc. All rights reserved. Disclaimer: IMPORTANT: This Apple software is supplied to you by Apple Computer, Inc. ("Apple") in consideration of your agreement to the following terms, and your use, installation, modification or redistribution of this Apple software constitutes acceptance of these terms. If you do not agree with these terms, please do not use, install, modify or redistribute this Apple software. In consideration of your agreement to abide by the following terms, and subject to these terms, Apple grants you a personal, non-exclusive license, under Apple’s copyrights in this original Apple software (the "Apple Software"), to use, reproduce, modify and redistribute the Apple Software, with or without modifications, in source and/or binary forms; provided that if you redistribute the Apple Software in its entirety and without modifications, you must retain this notice and the following text and disclaimers in all such redistributions of the Apple Software. Neither the name, trademarks, service marks or logos of Apple Computer, Inc. may be used to endorse or promote products derived from the Apple Software without specific prior written permission from Apple. Except as expressly stated in this notice, no other rights or licenses, express or implied, are granted by Apple herein, including but not limited to any patent rights that may be infringed by your derivative works or by other works in which the Apple Software may be incorporated. The Apple Software is provided by Apple on an "AS IS" basis. APPLE MAKES NO WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION THE IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, REGARDING THE APPLE SOFTWARE OR ITS USE AND OPERATION ALONE OR IN COMBINATION WITH YOUR PRODUCTS. IN NO EVENT SHALL APPLE BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) ARISING IN ANY WAY OUT OF THE USE, REPRODUCTION, MODIFICATION AND/OR DISTRIBUTION OF THE APPLE SOFTWARE, HOWEVER CAUSED AND WHETHER UNDER THEORY OF CONTRACT, TORT (INCLUDING NEGLIGENCE), STRICT LIABILITY OR OTHERWISE, EVEN IF APPLE HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. Change History (most recent first): */ #include "GetPID.h" #include <errno.h> #include <string.h> #include <sys/sysctl.h> /***************************************************** * GetAllPIDsForProcessName ***************************************************** * Purpose: This functions purpose is to lookup a BSD * process PID given the BSD process name. This function may * potentially return multiple PIDs for a given BSD process name * since several processes can have the same BSD process name. * * Parameters: * ProcessName A constant C-string. On calling * GetAllPIDsForProcessName this variable holds the BSD process name * used to do the process lookup. Note that the process name you need * to pass is the name of the BSD executable process. If trying * to find the PID of an regular OSX application you will need to pass the * name of the actual BSD executable inside an application bundle (rather * than the bundle name itself). In any case as a user you can find the * BSD process name of any process (including OSX applications) by * typing the command "ps -axcocommand,pid" in terminal. * * ArrayOfReturnedPIDs A pointer to a pre-allocated array of pid_t. * On calling GetAllPIDsForProcessName this variable must be a pointer to a * pre-allocated array of pid_t whos length (in number of pid_t entries) is defined * in ArrayOfPIDsLength. On successful return from GetAllPIDsForProcessName * this array will hold the PIDs of all processes which have a matching process * name to that specified in the ProcessName input variable. The number of actual * PIDs entered in the array starting at index zero will be the value returned * in NumberOfMatchesFound. On failed return if the error is a buffer overflow * error then the buffer will be filled to the max with PIDs which matched. * Otherwise on failed return the state of the array will be undefined. Note * the returned PID array is not sorted and is listed in order of process encountered. * * NumberOfPossiblePIDsInArray A unsigned integer. On calling * GetAllPIDsForProcessName this variable will hold the number of * pre-allocated PID entries which are in the ArrayOfReturnedPIDs for this functions * use. Note this value must have a value greater than zero. * * NumberOfMatchesFound An unsigned integer. On calling GetAllPIDsForProcessName * this variable will point to a pre-allocated unsigned integer. On return from * GetAllPIDsForProcessName this variable will contain the number of PIDs contained in the * ArrayOfReturnedPIDs. On failed return the value of the variable will be undefined. * * SysctlError A pointer to a pre-allocated integer. On failed return, this * variable represents the error returned from the sysctl command. On function * success this variable will have a value specified by the sysctl based on the * error that occurred. On success the variable will have the value zero. * Note this variable can also be NULL in which case the variable is ignored. * * *Function Result* A integer return value. * See result codes listed below. * Result Codes: * 0 Success. A set of process PIDs were found and are located in * ArrayOfReturnedPIDs array. * -1 Could not find a process with a matching process name * (i.e. process not found). * -2 Invalid arguments passed. * -3 Unable to get the size of sysctl buffer required * (consult SysctlError return value for more information) * -4 Unable to allocate memory to store BSD process information * (consult SysctlError return value for more information) * -5 The array passed to hold the returned PIDs is not large enough * to hold all PIDs of process with matching names. * *****************************************************/ int GetAllPIDsForProcessName(const char* ProcessName, pid_t ArrayOfReturnedPIDs[], const unsigned int NumberOfPossiblePIDsInArray, unsigned int* NumberOfMatchesFound, int* SysctlError) { // --- Defining local variables for this function and initializing all to zero --- // int mib[6] = {0,0,0,0,0,0}; //used for sysctl call. int SuccessfullyGotProcessInformation; size_t sizeOfBufferRequired = 0; //set to zero to start with. int error = 0; long NumberOfRunningProcesses = 0; unsigned int Counter = 0; struct kinfo_proc* BSDProcessInformationStructure = NULL; pid_t CurrentExaminedProcessPID = 0; char* CurrentExaminedProcessName = NULL; // --- Checking input arguments for validity --- // if (ProcessName == NULL) //need valid process name { return(kInvalidArgumentsError); } if (ArrayOfReturnedPIDs == NULL) //need an actual array { return(kInvalidArgumentsError); } if (NumberOfPossiblePIDsInArray <= 0) { //length of the array must be larger than zero. return(kInvalidArgumentsError); } if (NumberOfMatchesFound == NULL) //need an integer for return. { return(kInvalidArgumentsError); } //--- Setting return values to known values --- // //initalizing PID array so all values are zero memset(ArrayOfReturnedPIDs, 0, NumberOfPossiblePIDsInArray * sizeof(pid_t)); *NumberOfMatchesFound = 0; //no matches found yet if (SysctlError != NULL) //only set sysctlError if it is present { *SysctlError = 0; } //--- Getting list of process information for all processes --- // /* Setting up the mib (Management Information Base) which is an array of integers where each * integer specifies how the data will be gathered. Here we are setting the MIB * block to lookup the information on all the BSD processes on the system. Also note that * every regular application has a recognized BSD process accociated with it. We pass * CTL_KERN, KERN_PROC, KERN_PROC_ALL to sysctl as the MIB to get back a BSD structure with * all BSD process information for all processes in it (including BSD process names) */ mib[0] = CTL_KERN; mib[1] = KERN_PROC; mib[2] = KERN_PROC_ALL; /* Here we have a loop set up where we keep calling sysctl until we finally get an unrecoverable error * (and we return) or we finally get a successful result. Note with how dynamic the process list can * be you can expect to have a failure here and there since the process list can change between * getting the size of buffer required and the actually filling that buffer. */ SuccessfullyGotProcessInformation = FALSE; while (SuccessfullyGotProcessInformation == FALSE) { /* Now that we have the MIB for looking up process information we will pass it to sysctl to get the * information we want on BSD processes. However, before we do this we must know the size of the buffer to * allocate to accomidate the return value. We can get the size of the data to allocate also using the * sysctl command. In this case we call sysctl with the proper arguments but specify no return buffer * specified (null buffer). This is a special case which causes sysctl to return the size of buffer required. * * First Argument: The MIB which is really just an array of integers. Each integer is a constant * representing what information to gather from the system. Check out the man page to know what * constants sysctl will work with. Here of course we pass our MIB block which was passed to us. * Second Argument: The number of constants in the MIB (array of integers). In this case there are three. * Third Argument: The output buffer where the return value from sysctl will be stored. In this case * we don't want anything return yet since we don't yet know the size of buffer needed. Thus we will * pass null for the buffer to begin with. * Forth Argument: The size of the output buffer required. Since the buffer itself is null we can just * get the buffer size needed back from this call. * Fifth Argument: The new value we want the system data to have. Here we don't want to set any system * information we only want to gather it. Thus, we pass null as the buffer so sysctl knows that * we have no desire to set the value. * Sixth Argument: The length of the buffer containing new information (argument five). In this case * argument five was null since we didn't want to set the system value. Thus, the size of the buffer * is zero or NULL. * Return Value: a return value indicating success or failure. Actually, sysctl will either return * zero on no error and -1 on error. The errno UNIX variable will be set on error. */ error = sysctl(mib, 3, NULL, &sizeOfBufferRequired, NULL, 0); /* If an error occurred then return the accociated error. The error itself actually is stored in the UNIX * errno variable. We can access the errno value using the errno global variable. We will return the * errno value as the sysctlError return value from this function. */ if (error != 0) { if (SysctlError != NULL) { *SysctlError = errno; //we only set this variable if the pre-allocated variable is given } return(kErrorGettingSizeOfBufferRequired); } /* Now we successful obtained the size of the buffer required for the sysctl call. This is stored in the * SizeOfBufferRequired variable. We will malloc a buffer of that size to hold the sysctl result. */ BSDProcessInformationStructure = (struct kinfo_proc*) malloc(sizeOfBufferRequired); if (BSDProcessInformationStructure == NULL) { if (SysctlError != NULL) { *SysctlError = ENOMEM; //we only set this variable if the pre-allocated variable is given } return(kUnableToAllocateMemoryForBuffer); //unrecoverable error (no memory available) so give up } /* Now we have the buffer of the correct size to hold the result we can now call sysctl * and get the process information. * * First Argument: The MIB for gathering information on running BSD processes. The MIB is really * just an array of integers. Each integer is a constant representing what information to * gather from the system. Check out the man page to know what constants sysctl will work with. * Second Argument: The number of constants in the MIB (array of integers). In this case there are three. * Third Argument: The output buffer where the return value from sysctl will be stored. This is the buffer * which we allocated specifically for this purpose. * Forth Argument: The size of the output buffer (argument three). In this case its the size of the * buffer we already allocated. * Fifth Argument: The buffer containing the value to set the system value to. In this case we don't * want to set any system information we only want to gather it. Thus, we pass null as the buffer * so sysctl knows that we have no desire to set the value. * Sixth Argument: The length of the buffer containing new information (argument five). In this case * argument five was null since we didn't want to set the system value. Thus, the size of the buffer * is zero or NULL. * Return Value: a return value indicating success or failure. Actually, sysctl will either return * zero on no error and -1 on error. The errno UNIX variable will be set on error. */ error = sysctl(mib, 3, BSDProcessInformationStructure, &sizeOfBufferRequired, NULL, 0); //Here we successfully got the process information. Thus set the variable to end this sysctl calling loop if (error == 0) { SuccessfullyGotProcessInformation = TRUE; } else { /* failed getting process information we will try again next time around the loop. Note this is caused * by the fact the process list changed between getting the size of the buffer and actually filling * the buffer (something which will happen from time to time since the process list is dynamic). * Anyways, the attempted sysctl call failed. We will now begin again by freeing up the allocated * buffer and starting again at the beginning of the loop. */ free(BSDProcessInformationStructure); } }//end while loop // --- Going through process list looking for processes with matching names --- // /* Now that we have the BSD structure describing the running processes we will parse it for the desired * process name. First we will the number of running processes. We can determine * the number of processes running because there is a kinfo_proc structure for each process. */ NumberOfRunningProcesses = sizeOfBufferRequired / sizeof(struct kinfo_proc); /* Now we will go through each process description checking to see if the process name matches that * passed to us. The BSDProcessInformationStructure has an array of kinfo_procs. Each kinfo_proc has * an extern_proc accociated with it in the kp_proc attribute. Each extern_proc (kp_proc) has the process name * of the process accociated with it in the p_comm attribute and the PID of that process in the p_pid attibute. * We test the process name by compairing the process name passed to us with the value in the p_comm value. * Note we limit the compairison to MAXCOMLEN which is the maximum length of a BSD process name which is used * by the system. */ for (Counter = 0 ; Counter < NumberOfRunningProcesses ; Counter++) { //Getting PID of process we are examining CurrentExaminedProcessPID = BSDProcessInformationStructure[Counter].kp_proc.p_pid; //Getting name of process we are examining CurrentExaminedProcessName = BSDProcessInformationStructure[Counter].kp_proc.p_comm; if ((CurrentExaminedProcessPID > 0) //Valid PID && ((strncmp(CurrentExaminedProcessName, ProcessName, MAXCOMLEN) == 0))) //name matches { // --- Got a match add it to the array if possible --- // if ((*NumberOfMatchesFound + 1) > NumberOfPossiblePIDsInArray) { //if we overran the array buffer passed we release the allocated buffer give an error. free(BSDProcessInformationStructure); return(kPIDBufferOverrunError); } //adding the value to the array. ArrayOfReturnedPIDs[*NumberOfMatchesFound] = CurrentExaminedProcessPID; //incrementing our number of matches found. *NumberOfMatchesFound = *NumberOfMatchesFound + 1; } }//end looking through process list free(BSDProcessInformationStructure); //done with allocated buffer so release. if (*NumberOfMatchesFound == 0) { //didn't find any matches return error. return(kCouldNotFindRequestedProcess); } else { //found matches return success. return(kSuccess); } } /***************************************************** * GetPIDForProcessName ***************************************************** * Purpose: A convience call for GetAllPIDsForProcessName(). * This function looks up a process PID given a BSD process * name. * * Parameters: * ProcessName A constant C-string. On calling * GetPIDForProcessName this variable holds the BSD process name * used to do the process lookup. Note that the process name you need * to pass is the name of the BSD executable process. If trying * to find the PID of an regular OSX application you will need to pass the * name of the actual BSD executable inside an application bundle (rather * than the bundle name itself). In any case as a user you can find the * BSD process name of any process (including OSX applications) by * typing the command "ps -axcocommand,pid" in terminal. * * *Function Result* A integer return value. * See result codes listed below. * Result Codes: * >0 Success. The value returned is the PID of the * matching process. * -1 Error getting PID for requested process. This error can * be caused by several things. One is if no such process exists. * Another is if more than one process has the given name. The * thing to do here is to call GetAllPIDsForProcessName() * for complete error code or to get PIDs if there are multiple * processes with that name. *****************************************************/ int GetPIDForProcessName(const char* ProcessName) { pid_t PIDArray[1] = {0}; int Error = 0; unsigned int NumberOfMatches = 0; /* Here we are calling the function GetAllPIDsForProcessName which wil give us the PIDs * of the process name we pass. Of course here we are hoping for a single PID return. * First Argument: The BSD process name of the process we want to lookup. In this case the * the process name passed to us. * Second Argument: A preallocated array of pid_t. This is where the PIDs of matching processes * will be placed on return. We pass the array we just allocated which is length one. * Third Argument: The number of pid_t entries located in the array of pid_t (argument 2). In this * case our array has one pid_t entry so pass one. * Forth Argument: On return this will hold the number of PIDs placed into the * pid_t array (array passed in argument 2). * Fifth Argument: Passing NULL to ignore this argument. * Return Value: An error indicating success (zero result) or failure (non-zero). * */ Error = GetAllPIDsForProcessName(ProcessName, PIDArray, 1, &NumberOfMatches, NULL); if ((Error == 0) && (NumberOfMatches == 1))//success! { return((int) PIDArray[0]); //return the one PID we found. } else { return(-1); } } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������UnixAgent-2.4.2/tools/macosx/ocsng_app-xcode/GetPID.h�����������������������������������������������0000775�0000000�0000000�00000020714�13327377321�0022370�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* File: GetPID.h Description: This file defines a simple API to do process PID lookup based on process name. Author: Chad Jones Copyright: Copyright 2003 Apple Computer, Inc. All rights reserved. Disclaimer: IMPORTANT: This Apple software is supplied to you by Apple Computer, Inc. ("Apple") in consideration of your agreement to the following terms, and your use, installation, modification or redistribution of this Apple software constitutes acceptance of these terms. If you do not agree with these terms, please do not use, install, modify or redistribute this Apple software. In consideration of your agreement to abide by the following terms, and subject to these terms, Apple grants you a personal, non-exclusive license, under Apples copyrights in this original Apple software (the "Apple Software"), to use, reproduce, modify and redistribute the Apple Software, with or without modifications, in source and/or binary forms; provided that if you redistribute the Apple Software in its entirety and without modifications, you must retain this notice and the following text and disclaimers in all such redistributions of the Apple Software. Neither the name, trademarks, service marks or logos of Apple Computer, Inc. may be used to endorse or promote products derived from the Apple Software without specific prior written permission from Apple. Except as expressly stated in this notice, no other rights or licenses, express or implied, are granted by Apple herein, including but not limited to any patent rights that may be infringed by your derivative works or by other works in which the Apple Software may be incorporated. The Apple Software is provided by Apple on an "AS IS" basis. APPLE MAKES NO WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION THE IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, REGARDING THE APPLE SOFTWARE OR ITS USE AND OPERATION ALONE OR IN COMBINATION WITH YOUR PRODUCTS. IN NO EVENT SHALL APPLE BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) ARISING IN ANY WAY OUT OF THE USE, REPRODUCTION, MODIFICATION AND/OR DISTRIBUTION OF THE APPLE SOFTWARE, HOWEVER CAUSED AND WHETHER UNDER THEORY OF CONTRACT, TORT (INCLUDING NEGLIGENCE), STRICT LIABILITY OR OTHERWISE, EVEN IF APPLE HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. Change History (most recent first): */ #if !defined(__DTSSampleCode_GetPID__) #define __DTSSampleCode_GetPID__ 1 #include <stdlib.h> #include <stdio.h> #if defined(__cplusplus) extern "C" { #endif // --- Defining constants for use with sample code --- // enum {kSuccess = 0, kCouldNotFindRequestedProcess = -1, kInvalidArgumentsError = -2, kErrorGettingSizeOfBufferRequired = -3, kUnableToAllocateMemoryForBuffer = -4, kPIDBufferOverrunError = -5}; /***************************************************** * GetAllPIDsForProcessName ***************************************************** * Purpose: This functions purpose is to lookup a BSD * process PID given the BSD process name. This function may * potentially return multiple PIDs for a given BSD process name * since several processes can have the same BSD process name. * * Parameters: * ProcessName A constant C-string. On calling * GetAllPIDsForProcessName this variable holds the BSD process name * used to do the process lookup. Note that the process name you need * to pass is the name of the BSD executable process. If trying * to find the PID of an regular OSX application you will need to pass the * name of the actual BSD executable inside an application bundle (rather * than the bundle name itself). In any case as a user you can find the * BSD process name of any process (including OSX applications) by * typing the command "ps -axcocommand,pid" in terminal. * * ArrayOfReturnedPIDs A pointer to a pre-allocated array of pid_t. * On calling GetAllPIDsForProcessName this variable must be a pointer to a * pre-allocated array of pid_t whos length (in number of pid_t entries) is defined * in ArrayOfPIDsLength. On successful return from GetAllPIDsForProcessName * this array will hold the PIDs of all processes which have a matching process * name to that specified in the ProcessName input variable. The number of actual * PIDs entered in the array starting at index zero will be the value returned * in NumberOfMatchesFound. On failed return if the error is a buffer overflow * error then the buffer will be filled to the max with PIDs which matched. * Otherwise on failed return the state of the array will be undefined. * * NumberOfPossiblePIDsInArray A unsigned integer. On calling * GetAllPIDsForProcessName this variable will hold the number of * pre-allocated PID entries which are in the ArrayOfReturnedPIDs for this functions * use. Note this value must have a value greater than zero. * * NumberOfMatchesFound An unsigned integer. On calling GetAllPIDsForProcessName * this variable will point to a pre-allocated unsigned integer. On return from * GetAllPIDsForProcessName this variable will contain the number of PIDs contained in the * ArrayOfReturnedPIDs. On failed return the value of the variable will be undefined. * * SysctlError A pointer to a pre-allocated integer. On failed return, this * variable represents the error returned from the sysctl command. On function * success this variable will have a value specified by the sysctl based on the * error that occurred. On success the variable will have the value zero. * Note this variable can also be NULL in which case the variable is ignored. * * *Function Result* A integer return value. * See result codes listed below. * Result Codes: * 0 Success. A set of process PIDs were found and are located in * ArrayOfReturnedPIDs array. * -1 Could not find a process with a matching process name * (i.e. process not found). * -2 Invalid arguments passed. * -3 Unable to get the size of sysctl buffer required * (consult SysctlError return value for more information) * -4 Unable to allocate memory to store BSD process information * (consult SysctlError return value for more information) * -5 The array passed to hold the returned PIDs is not large enough * to hold all PIDs of process with matching names. * *****************************************************/ int GetAllPIDsForProcessName(const char* ProcessName, pid_t ArrayOfReturnedPIDs[], const unsigned int NumberOfPossiblePIDsInArray, unsigned int* NumberOfMatchesFound, int* SysctlError); //Can be NULL /***************************************************** * GetPIDForProcessName ***************************************************** * Purpose: A convience call for GetAllPIDsForProcessName(). * This function looks up a process PID given a BSD process * name. * * Parameters: * ProcessName A constant C-string. On calling * GetPIDForProcessName this variable holds the BSD process name * used to do the process lookup. Note that the process name you need * to pass is the name of the BSD executable process. If trying * to find the PID of an regular OSX application you will need to pass the * name of the actual BSD executable inside an application bundle (rather * than the bundle name itself). In any case as a user you can find the * BSD process name of any process (including OSX applications) by * typing the command "ps -axcocommand,pid" in terminal. * * *Function Result* A integer return value. * See result codes listed below. * Result Codes: * >=0 Success. The value returned is the PID of the * requested process. * -1 Error getting PID for requested process. This error can * be caused by several things. One is if no such process exists. * Another is if more than one process has the given name. The * Answer is to call GetAllPIDsForProcessName() * for complete error code or to get PIDs if there are multiple * processes with that name. *****************************************************/ int GetPIDForProcessName(const char* ProcessName); #if defined(__cplusplus) } #endif #endif����������������������������������������������������UnixAgent-2.4.2/tools/macosx/ocsng_app-xcode/Info.plist���������������������������������������������0000664�0000000�0000000�00000001402�13327377321�0023101�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict> <key>CFBundleDevelopmentRegion</key> <string>English</string> <key>CFBundleExecutable</key> <string>${EXECUTABLE_NAME}</string> <key>CFBundleIconFile</key> <string>ocs_logo</string> <key>CFBundleIdentifier</key> <string>$(PRODUCT_BUNDLE_IDENTIFIER)</string> <key>CFBundleInfoDictionaryVersion</key> <string>6.0</string> <key>CFBundleName</key> <string>${PRODUCT_NAME}</string> <key>CFBundlePackageType</key> <string>APPL</string> <key>CFBundleSignature</key> <string>OCNG</string> <key>CFBundleVersion</key> <string>2.4.0</string> <key>LSUIElement</key> <true/> </dict> </plist> ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������UnixAgent-2.4.2/tools/macosx/ocsng_app-xcode/OCSNG.xcodeproj/���������������������������������������0000775�0000000�0000000�00000000000�13327377321�0024001�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������UnixAgent-2.4.2/tools/macosx/ocsng_app-xcode/OCSNG.xcodeproj/ocs.mode1������������������������������0000664�0000000�0000000�00000117162�13327377321�0025524�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict> <key>ActivePerspectiveName</key> <string>Project</string> <key>AllowedModules</key> <array> <dict> <key>BundleLoadPath</key> <string></string> <key>MaxInstances</key> <string>n</string> <key>Module</key> <string>PBXSmartGroupTreeModule</string> <key>Name</key> <string>Groups and Files Outline View</string> </dict> <dict> <key>BundleLoadPath</key> <string></string> <key>MaxInstances</key> <string>n</string> <key>Module</key> <string>PBXNavigatorGroup</string> <key>Name</key> <string>Editor</string> </dict> <dict> <key>BundleLoadPath</key> <string></string> <key>MaxInstances</key> <string>n</string> <key>Module</key> <string>XCTaskListModule</string> <key>Name</key> <string>Task List</string> </dict> <dict> <key>BundleLoadPath</key> <string></string> <key>MaxInstances</key> <string>n</string> <key>Module</key> <string>XCDetailModule</string> <key>Name</key> <string>File and Smart Group Detail Viewer</string> </dict> <dict> <key>BundleLoadPath</key> <string></string> <key>MaxInstances</key> <string>1</string> <key>Module</key> <string>PBXBuildResultsModule</string> <key>Name</key> <string>Detailed Build Results Viewer</string> </dict> <dict> <key>BundleLoadPath</key> <string></string> <key>MaxInstances</key> <string>1</string> <key>Module</key> <string>PBXProjectFindModule</string> <key>Name</key> <string>Project Batch Find Tool</string> </dict> <dict> <key>BundleLoadPath</key> <string></string> <key>MaxInstances</key> <string>n</string> <key>Module</key> <string>PBXRunSessionModule</string> <key>Name</key> <string>Run Log</string> </dict> <dict> <key>BundleLoadPath</key> <string></string> <key>MaxInstances</key> <string>n</string> <key>Module</key> <string>PBXBookmarksModule</string> <key>Name</key> <string>Bookmarks Tool</string> </dict> <dict> <key>BundleLoadPath</key> <string></string> <key>MaxInstances</key> <string>n</string> <key>Module</key> <string>PBXClassBrowserModule</string> <key>Name</key> <string>Class Browser</string> </dict> <dict> <key>BundleLoadPath</key> <string></string> <key>MaxInstances</key> <string>n</string> <key>Module</key> <string>PBXCVSModule</string> <key>Name</key> <string>Source Code Control Tool</string> </dict> <dict> <key>BundleLoadPath</key> <string></string> <key>MaxInstances</key> <string>n</string> <key>Module</key> <string>PBXDebugBreakpointsModule</string> <key>Name</key> <string>Debug Breakpoints Tool</string> </dict> <dict> <key>BundleLoadPath</key> <string></string> <key>MaxInstances</key> <string>n</string> <key>Module</key> <string>XCDockableInspector</string> <key>Name</key> <string>Inspector</string> </dict> <dict> <key>BundleLoadPath</key> <string></string> <key>MaxInstances</key> <string>n</string> <key>Module</key> <string>PBXOpenQuicklyModule</string> <key>Name</key> <string>Open Quickly Tool</string> </dict> <dict> <key>BundleLoadPath</key> <string></string> <key>MaxInstances</key> <string>1</string> <key>Module</key> <string>PBXDebugSessionModule</string> <key>Name</key> <string>Debugger</string> </dict> <dict> <key>BundleLoadPath</key> <string></string> <key>MaxInstances</key> <string>1</string> <key>Module</key> <string>PBXDebugCLIModule</string> <key>Name</key> <string>Debug Console</string> </dict> </array> <key>Description</key> <string>DefaultDescriptionKey</string> <key>DockingSystemVisible</key> <false/> <key>Extension</key> <string>mode1</string> <key>FavBarConfig</key> <dict> <key>PBXProjectModuleGUID</key> <string>061EA96D130275AC009A0BD6</string> <key>XCBarModuleItemNames</key> <dict/> <key>XCBarModuleItems</key> <array/> </dict> <key>FirstTimeWindowDisplayed</key> <false/> <key>Identifier</key> <string>com.apple.perspectives.project.mode1</string> <key>MajorVersion</key> <integer>31</integer> <key>MinorVersion</key> <integer>1</integer> <key>Name</key> <string>Default</string> <key>Notifications</key> <array/> <key>OpenEditors</key> <array> <dict> <key>Content</key> <dict> <key>PBXProjectModuleGUID</key> <string>06C5590613CC1F6A00405FC9</string> <key>PBXProjectModuleLabel</key> <string>main.m</string> <key>PBXSplitModuleInNavigatorKey</key> <dict> <key>Split0</key> <dict> <key>PBXProjectModuleGUID</key> <string>06C5590713CC1F6A00405FC9</string> <key>PBXProjectModuleLabel</key> <string>main.m</string> <key>_historyCapacity</key> <integer>0</integer> <key>bookmark</key> <string>06C5593E13CC2EFB00405FC9</string> <key>history</key> <array> <string>06C5591D13CC27B200405FC9</string> </array> </dict> <key>SplitCount</key> <string>1</string> </dict> <key>StatusBarVisibility</key> <true/> </dict> <key>Geometry</key> <dict> <key>Frame</key> <string>{{0, 20}, {948, 609}}</string> <key>PBXModuleWindowStatusBarHidden2</key> <false/> <key>RubberWindowFrame</key> <string>390 203 948 650 0 0 1440 878 </string> </dict> </dict> </array> <key>PerspectiveWidths</key> <array> <integer>-1</integer> <integer>-1</integer> </array> <key>Perspectives</key> <array> <dict> <key>ChosenToolbarItems</key> <array> <string>active-target-popup</string> <string>active-buildstyle-popup</string> <string>action</string> <string>NSToolbarFlexibleSpaceItem</string> <string>buildOrClean</string> <string>build-and-runOrDebug</string> <string>com.apple.ide.PBXToolbarStopButton</string> <string>get-info</string> <string>toggle-editor</string> <string>NSToolbarFlexibleSpaceItem</string> <string>com.apple.pbx.toolbar.searchfield</string> </array> <key>ControllerClassBaseName</key> <string></string> <key>IconName</key> <string>WindowOfProjectWithEditor</string> <key>Identifier</key> <string>perspective.project</string> <key>IsVertical</key> <false/> <key>Layout</key> <array> <dict> <key>BecomeActive</key> <true/> <key>ContentConfiguration</key> <dict> <key>PBXBottomSmartGroupGIDs</key> <array> <string>1C37FBAC04509CD000000102</string> <string>1C37FAAC04509CD000000102</string> <string>1C08E77C0454961000C914BD</string> <string>1C37FABC05509CD000000102</string> <string>1C37FABC05539CD112110102</string> <string>E2644B35053B69B200211256</string> <string>1C37FABC04509CD000100104</string> <string>1CC0EA4004350EF90044410B</string> <string>1CC0EA4004350EF90041110B</string> </array> <key>PBXProjectModuleGUID</key> <string>1CE0B1FE06471DED0097A5F4</string> <key>PBXProjectModuleLabel</key> <string>Files</string> <key>PBXProjectStructureProvided</key> <string>yes</string> <key>PBXSmartGroupTreeModuleColumnData</key> <dict> <key>PBXSmartGroupTreeModuleColumnWidthsKey</key> <array> <real>186</real> </array> <key>PBXSmartGroupTreeModuleColumnsKey_v4</key> <array> <string>MainColumn</string> </array> </dict> <key>PBXSmartGroupTreeModuleOutlineStateKey_v7</key> <dict> <key>PBXSmartGroupTreeModuleOutlineStateExpansionKey</key> <array> <string>29B97314FDCFA39411CA2CEA</string> <string>080E96DDFE201D6D7F000001</string> <string>29B97315FDCFA39411CA2CEA</string> <string>29B97317FDCFA39411CA2CEA</string> <string>29B97323FDCFA39411CA2CEA</string> <string>1058C7A0FEA54F0111CA2CBB</string> <string>1058C7A2FEA54F0111CA2CBB</string> <string>1C37FBAC04509CD000000102</string> <string>06C5593713CC2B2600405FC9</string> <string>06C5593813CC2B2600405FC9</string> <string>1C37FABC05509CD000000102</string> </array> <key>PBXSmartGroupTreeModuleOutlineStateSelectionKey</key> <array> <array> <integer>5</integer> <integer>3</integer> <integer>0</integer> </array> </array> <key>PBXSmartGroupTreeModuleOutlineStateVisibleRectKey</key> <string>{{0, 0}, {186, 690}}</string> </dict> <key>PBXTopSmartGroupGIDs</key> <array/> <key>XCIncludePerspectivesSwitch</key> <true/> <key>XCSharingToken</key> <string>com.apple.Xcode.GFSharingToken</string> </dict> <key>GeometryConfiguration</key> <dict> <key>Frame</key> <string>{{0, 0}, {203, 708}}</string> <key>GroupTreeTableConfiguration</key> <array> <string>MainColumn</string> <real>186</real> </array> <key>RubberWindowFrame</key> <string>10 115 1440 749 0 0 1440 878 </string> </dict> <key>Module</key> <string>PBXSmartGroupTreeModule</string> <key>Proportion</key> <string>203pt</string> </dict> <dict> <key>Dock</key> <array> <dict> <key>ContentConfiguration</key> <dict> <key>PBXProjectModuleGUID</key> <string>1CE0B20306471E060097A5F4</string> <key>PBXProjectModuleLabel</key> <string>MyNewFile14.java</string> <key>PBXSplitModuleInNavigatorKey</key> <dict> <key>Split0</key> <dict> <key>PBXProjectModuleGUID</key> <string>1CE0B20406471E060097A5F4</string> <key>PBXProjectModuleLabel</key> <string>MyNewFile14.java</string> </dict> <key>SplitCount</key> <string>1</string> </dict> <key>StatusBarVisibility</key> <true/> </dict> <key>GeometryConfiguration</key> <dict> <key>Frame</key> <string>{{0, 0}, {1232, 0}}</string> <key>RubberWindowFrame</key> <string>10 115 1440 749 0 0 1440 878 </string> </dict> <key>Module</key> <string>PBXNavigatorGroup</string> <key>Proportion</key> <string>0pt</string> </dict> <dict> <key>ContentConfiguration</key> <dict> <key>PBXProjectModuleGUID</key> <string>1CE0B20506471E060097A5F4</string> <key>PBXProjectModuleLabel</key> <string>Detail</string> </dict> <key>GeometryConfiguration</key> <dict> <key>Frame</key> <string>{{0, 5}, {1232, 703}}</string> <key>RubberWindowFrame</key> <string>10 115 1440 749 0 0 1440 878 </string> </dict> <key>Module</key> <string>XCDetailModule</string> <key>Proportion</key> <string>703pt</string> </dict> </array> <key>Proportion</key> <string>1232pt</string> </dict> </array> <key>Name</key> <string>Project</string> <key>ServiceClasses</key> <array> <string>XCModuleDock</string> <string>PBXSmartGroupTreeModule</string> <string>XCModuleDock</string> <string>PBXNavigatorGroup</string> <string>XCDetailModule</string> </array> <key>TableOfContents</key> <array> <string>06C5590413CC1F6A00405FC9</string> <string>1CE0B1FE06471DED0097A5F4</string> <string>06C5590513CC1F6A00405FC9</string> <string>1CE0B20306471E060097A5F4</string> <string>1CE0B20506471E060097A5F4</string> </array> <key>ToolbarConfiguration</key> <string>xcode.toolbar.config.default</string> </dict> <dict> <key>ControllerClassBaseName</key> <string></string> <key>IconName</key> <string>WindowOfProject</string> <key>Identifier</key> <string>perspective.morph</string> <key>IsVertical</key> <integer>0</integer> <key>Layout</key> <array> <dict> <key>BecomeActive</key> <integer>1</integer> <key>ContentConfiguration</key> <dict> <key>PBXBottomSmartGroupGIDs</key> <array> <string>1C37FBAC04509CD000000102</string> <string>1C37FAAC04509CD000000102</string> <string>1C08E77C0454961000C914BD</string> <string>1C37FABC05509CD000000102</string> <string>1C37FABC05539CD112110102</string> <string>E2644B35053B69B200211256</string> <string>1C37FABC04509CD000100104</string> <string>1CC0EA4004350EF90044410B</string> <string>1CC0EA4004350EF90041110B</string> </array> <key>PBXProjectModuleGUID</key> <string>11E0B1FE06471DED0097A5F4</string> <key>PBXProjectModuleLabel</key> <string>Files</string> <key>PBXProjectStructureProvided</key> <string>yes</string> <key>PBXSmartGroupTreeModuleColumnData</key> <dict> <key>PBXSmartGroupTreeModuleColumnWidthsKey</key> <array> <real>186</real> </array> <key>PBXSmartGroupTreeModuleColumnsKey_v4</key> <array> <string>MainColumn</string> </array> </dict> <key>PBXSmartGroupTreeModuleOutlineStateKey_v7</key> <dict> <key>PBXSmartGroupTreeModuleOutlineStateExpansionKey</key> <array> <string>29B97314FDCFA39411CA2CEA</string> <string>1C37FABC05509CD000000102</string> </array> <key>PBXSmartGroupTreeModuleOutlineStateSelectionKey</key> <array> <array> <integer>0</integer> </array> </array> <key>PBXSmartGroupTreeModuleOutlineStateVisibleRectKey</key> <string>{{0, 0}, {186, 337}}</string> </dict> <key>PBXTopSmartGroupGIDs</key> <array/> <key>XCIncludePerspectivesSwitch</key> <integer>1</integer> <key>XCSharingToken</key> <string>com.apple.Xcode.GFSharingToken</string> </dict> <key>GeometryConfiguration</key> <dict> <key>Frame</key> <string>{{0, 0}, {203, 355}}</string> <key>GroupTreeTableConfiguration</key> <array> <string>MainColumn</string> <real>186</real> </array> <key>RubberWindowFrame</key> <string>373 269 690 397 0 0 1440 878 </string> </dict> <key>Module</key> <string>PBXSmartGroupTreeModule</string> <key>Proportion</key> <string>100%</string> </dict> </array> <key>Name</key> <string>Morph</string> <key>PreferredWidth</key> <integer>300</integer> <key>ServiceClasses</key> <array> <string>XCModuleDock</string> <string>PBXSmartGroupTreeModule</string> </array> <key>TableOfContents</key> <array> <string>11E0B1FE06471DED0097A5F4</string> </array> <key>ToolbarConfiguration</key> <string>xcode.toolbar.config.default.short</string> </dict> </array> <key>PerspectivesBarVisible</key> <false/> <key>ShelfIsVisible</key> <false/> <key>SourceDescription</key> <string>file at '/Developer/Library/PrivateFrameworks/DevToolsInterface.framework/Versions/A/Resources/XCPerspectivesSpecificationMode1.xcperspec'</string> <key>StatusbarIsVisible</key> <true/> <key>TimeStamp</key> <real>0.0</real> <key>ToolbarDisplayMode</key> <integer>1</integer> <key>ToolbarIsVisible</key> <true/> <key>ToolbarSizeMode</key> <integer>1</integer> <key>Type</key> <string>Perspectives</string> <key>UpdateMessage</key> <string>The Default Workspace in this version of Xcode now includes support to hide and show the detail view (what has been referred to as the "Metro-Morph" feature). You must discard your current Default Workspace settings and update to the latest Default Workspace in order to gain this feature. Do you wish to update to the latest Workspace defaults for project '%@'?</string> <key>WindowJustification</key> <integer>5</integer> <key>WindowOrderList</key> <array> <string>06E04A76134C3537009FD4CA</string> <string>06C5590613CC1F6A00405FC9</string> <string>1C0AD2B3069F1EA900FABCE6</string> <string>/Users/ocs/work/ocs/dev/ocsng_app-xcode/OCSNG.xcodeproj</string> </array> <key>WindowString</key> <string>10 115 1440 749 0 0 1440 878 </string> <key>WindowTools</key> <array> <dict> <key>FirstTimeWindowDisplayed</key> <false/> <key>Identifier</key> <string>windowTool.build</string> <key>IsVertical</key> <true/> <key>Layout</key> <array> <dict> <key>Dock</key> <array> <dict> <key>ContentConfiguration</key> <dict> <key>PBXProjectModuleGUID</key> <string>1CD0528F0623707200166675</string> <key>PBXProjectModuleLabel</key> <string>main.m</string> <key>StatusBarVisibility</key> <true/> </dict> <key>GeometryConfiguration</key> <dict> <key>Frame</key> <string>{{0, 0}, {1440, 466}}</string> <key>RubberWindowFrame</key> <string>185 -243 1440 748 0 0 1440 878 </string> </dict> <key>Module</key> <string>PBXNavigatorGroup</string> <key>Proportion</key> <string>466pt</string> </dict> <dict> <key>BecomeActive</key> <true/> <key>ContentConfiguration</key> <dict> <key>PBXProjectModuleGUID</key> <string>XCMainBuildResultsModuleGUID</string> <key>PBXProjectModuleLabel</key> <string>Build</string> <key>XCBuildResultsTrigger_Collapse</key> <integer>1021</integer> <key>XCBuildResultsTrigger_Open</key> <integer>1011</integer> </dict> <key>GeometryConfiguration</key> <dict> <key>Frame</key> <string>{{0, 471}, {1440, 236}}</string> <key>RubberWindowFrame</key> <string>185 -243 1440 748 0 0 1440 878 </string> </dict> <key>Module</key> <string>PBXBuildResultsModule</string> <key>Proportion</key> <string>236pt</string> </dict> </array> <key>Proportion</key> <string>707pt</string> </dict> </array> <key>Name</key> <string>Build Results</string> <key>ServiceClasses</key> <array> <string>PBXBuildResultsModule</string> </array> <key>StatusbarIsVisible</key> <true/> <key>TableOfContents</key> <array> <string>06E04A76134C3537009FD4CA</string> <string>06C558F513CC1D1900405FC9</string> <string>1CD0528F0623707200166675</string> <string>XCMainBuildResultsModuleGUID</string> </array> <key>ToolbarConfiguration</key> <string>xcode.toolbar.config.build</string> <key>WindowString</key> <string>185 -243 1440 748 0 0 1440 878 </string> <key>WindowToolGUID</key> <string>06E04A76134C3537009FD4CA</string> <key>WindowToolIsVisible</key> <true/> </dict> <dict> <key>FirstTimeWindowDisplayed</key> <false/> <key>Identifier</key> <string>windowTool.debugger</string> <key>IsVertical</key> <true/> <key>Layout</key> <array> <dict> <key>Dock</key> <array> <dict> <key>ContentConfiguration</key> <dict> <key>Debugger</key> <dict> <key>HorizontalSplitView</key> <dict> <key>_collapsingFrameDimension</key> <real>0.0</real> <key>_indexOfCollapsedView</key> <integer>0</integer> <key>_percentageOfCollapsedView</key> <real>0.0</real> <key>isCollapsed</key> <string>yes</string> <key>sizes</key> <array> <string>{{0, 0}, {313, 196}}</string> <string>{{313, 0}, {381, 196}}</string> </array> </dict> <key>VerticalSplitView</key> <dict> <key>_collapsingFrameDimension</key> <real>0.0</real> <key>_indexOfCollapsedView</key> <integer>0</integer> <key>_percentageOfCollapsedView</key> <real>0.0</real> <key>isCollapsed</key> <string>yes</string> <key>sizes</key> <array> <string>{{0, 0}, {694, 196}}</string> <string>{{0, 196}, {694, 185}}</string> </array> </dict> </dict> <key>LauncherConfigVersion</key> <string>8</string> <key>PBXProjectModuleGUID</key> <string>1C162984064C10D400B95A72</string> <key>PBXProjectModuleLabel</key> <string>Debug - GLUTExamples (Underwater)</string> </dict> <key>GeometryConfiguration</key> <dict> <key>DebugConsoleDrawerSize</key> <string>{100, 120}</string> <key>DebugConsoleVisible</key> <string>None</string> <key>DebugConsoleWindowFrame</key> <string>{{200, 200}, {500, 300}}</string> <key>DebugSTDIOWindowFrame</key> <string>{{200, 200}, {500, 300}}</string> <key>Frame</key> <string>{{0, 0}, {694, 381}}</string> <key>RubberWindowFrame</key> <string>496 358 694 422 0 0 1440 878 </string> </dict> <key>Module</key> <string>PBXDebugSessionModule</string> <key>Proportion</key> <string>381pt</string> </dict> </array> <key>Proportion</key> <string>381pt</string> </dict> </array> <key>Name</key> <string>Debugger</string> <key>ServiceClasses</key> <array> <string>PBXDebugSessionModule</string> </array> <key>StatusbarIsVisible</key> <true/> <key>TableOfContents</key> <array> <string>1CD10A99069EF8BA00B06720</string> <string>06BF31CC13CAD57A006FA767</string> <string>1C162984064C10D400B95A72</string> <string>06BF31CD13CAD57A006FA767</string> <string>06BF31CE13CAD57A006FA767</string> <string>06BF31CF13CAD57A006FA767</string> <string>06BF31D013CAD57A006FA767</string> <string>06BF31D113CAD57A006FA767</string> <string>06BF31D213CAD57A006FA767</string> </array> <key>ToolbarConfiguration</key> <string>xcode.toolbar.config.debug</string> <key>WindowString</key> <string>496 358 694 422 0 0 1440 878 </string> <key>WindowToolGUID</key> <string>1CD10A99069EF8BA00B06720</string> <key>WindowToolIsVisible</key> <false/> </dict> <dict> <key>Identifier</key> <string>windowTool.find</string> <key>Layout</key> <array> <dict> <key>Dock</key> <array> <dict> <key>Dock</key> <array> <dict> <key>ContentConfiguration</key> <dict> <key>PBXProjectModuleGUID</key> <string>1CDD528C0622207200134675</string> <key>PBXProjectModuleLabel</key> <string><No Editor></string> <key>PBXSplitModuleInNavigatorKey</key> <dict> <key>Split0</key> <dict> <key>PBXProjectModuleGUID</key> <string>1CD0528D0623707200166675</string> </dict> <key>SplitCount</key> <string>1</string> </dict> <key>StatusBarVisibility</key> <integer>1</integer> </dict> <key>GeometryConfiguration</key> <dict> <key>Frame</key> <string>{{0, 0}, {781, 167}}</string> <key>RubberWindowFrame</key> <string>62 385 781 470 0 0 1440 878 </string> </dict> <key>Module</key> <string>PBXNavigatorGroup</string> <key>Proportion</key> <string>781pt</string> </dict> </array> <key>Proportion</key> <string>50%</string> </dict> <dict> <key>BecomeActive</key> <integer>1</integer> <key>ContentConfiguration</key> <dict> <key>PBXProjectModuleGUID</key> <string>1CD0528E0623707200166675</string> <key>PBXProjectModuleLabel</key> <string>Project Find</string> </dict> <key>GeometryConfiguration</key> <dict> <key>Frame</key> <string>{{8, 0}, {773, 254}}</string> <key>RubberWindowFrame</key> <string>62 385 781 470 0 0 1440 878 </string> </dict> <key>Module</key> <string>PBXProjectFindModule</string> <key>Proportion</key> <string>50%</string> </dict> </array> <key>Proportion</key> <string>428pt</string> </dict> </array> <key>Name</key> <string>Project Find</string> <key>ServiceClasses</key> <array> <string>PBXProjectFindModule</string> </array> <key>StatusbarIsVisible</key> <integer>1</integer> <key>TableOfContents</key> <array> <string>1C530D57069F1CE1000CFCEE</string> <string>1C530D58069F1CE1000CFCEE</string> <string>1C530D59069F1CE1000CFCEE</string> <string>1CDD528C0622207200134675</string> <string>1C530D5A069F1CE1000CFCEE</string> <string>1CE0B1FE06471DED0097A5F4</string> <string>1CD0528E0623707200166675</string> </array> <key>WindowString</key> <string>62 385 781 470 0 0 1440 878 </string> <key>WindowToolGUID</key> <string>1C530D57069F1CE1000CFCEE</string> <key>WindowToolIsVisible</key> <integer>0</integer> </dict> <dict> <key>Identifier</key> <string>MENUSEPARATOR</string> </dict> <dict> <key>FirstTimeWindowDisplayed</key> <false/> <key>Identifier</key> <string>windowTool.debuggerConsole</string> <key>IsVertical</key> <true/> <key>Layout</key> <array> <dict> <key>Dock</key> <array> <dict> <key>ContentConfiguration</key> <dict> <key>PBXProjectModuleGUID</key> <string>1C78EAAC065D492600B07095</string> <key>PBXProjectModuleLabel</key> <string>Debugger Console</string> </dict> <key>GeometryConfiguration</key> <dict> <key>Frame</key> <string>{{0, 0}, {440, 358}}</string> <key>RubberWindowFrame</key> <string>73 409 440 400 0 0 1440 878 </string> </dict> <key>Module</key> <string>PBXDebugCLIModule</string> <key>Proportion</key> <string>358pt</string> </dict> </array> <key>Proportion</key> <string>359pt</string> </dict> </array> <key>Name</key> <string>Debugger Console</string> <key>ServiceClasses</key> <array> <string>PBXDebugCLIModule</string> </array> <key>StatusbarIsVisible</key> <true/> <key>TableOfContents</key> <array> <string>06C399E61394981F0047198A</string> <string>06BF31D313CAD57A006FA767</string> <string>1C78EAAC065D492600B07095</string> </array> <key>WindowString</key> <string>73 409 440 400 0 0 1440 878 </string> <key>WindowToolGUID</key> <string>06C399E61394981F0047198A</string> <key>WindowToolIsVisible</key> <false/> </dict> <dict> <key>FirstTimeWindowDisplayed</key> <false/> <key>Identifier</key> <string>windowTool.run</string> <key>IsVertical</key> <true/> <key>Layout</key> <array> <dict> <key>Dock</key> <array> <dict> <key>ContentConfiguration</key> <dict> <key>LauncherConfigVersion</key> <string>3</string> <key>PBXProjectModuleGUID</key> <string>1CD0528B0623707200166675</string> <key>PBXProjectModuleLabel</key> <string>Run</string> <key>Runner</key> <dict> <key>HorizontalSplitView</key> <dict> <key>_collapsingFrameDimension</key> <real>0.0</real> <key>_indexOfCollapsedView</key> <integer>0</integer> <key>_percentageOfCollapsedView</key> <real>0.0</real> <key>isCollapsed</key> <string>yes</string> <key>sizes</key> <array> <string>{{0, 0}, {493, 167}}</string> <string>{{0, 176}, {493, 267}}</string> </array> </dict> <key>VerticalSplitView</key> <dict> <key>_collapsingFrameDimension</key> <real>0.0</real> <key>_indexOfCollapsedView</key> <integer>0</integer> <key>_percentageOfCollapsedView</key> <real>0.0</real> <key>isCollapsed</key> <string>yes</string> <key>sizes</key> <array> <string>{{0, 0}, {405, 443}}</string> <string>{{414, 0}, {514, 443}}</string> </array> </dict> </dict> </dict> <key>GeometryConfiguration</key> <dict> <key>Frame</key> <string>{{0, 0}, {459, 159}}</string> <key>RubberWindowFrame</key> <string>31 655 459 200 0 0 1440 878 </string> </dict> <key>Module</key> <string>PBXRunSessionModule</string> <key>Proportion</key> <string>159pt</string> </dict> </array> <key>Proportion</key> <string>159pt</string> </dict> </array> <key>Name</key> <string>Run Log</string> <key>ServiceClasses</key> <array> <string>PBXRunSessionModule</string> </array> <key>StatusbarIsVisible</key> <true/> <key>TableOfContents</key> <array> <string>1C0AD2B3069F1EA900FABCE6</string> <string>06C558F613CC1D1900405FC9</string> <string>1CD0528B0623707200166675</string> <string>06C558F713CC1D1900405FC9</string> </array> <key>ToolbarConfiguration</key> <string>xcode.toolbar.config.run</string> <key>WindowString</key> <string>31 655 459 200 0 0 1440 878 </string> <key>WindowToolGUID</key> <string>1C0AD2B3069F1EA900FABCE6</string> <key>WindowToolIsVisible</key> <true/> </dict> <dict> <key>Identifier</key> <string>windowTool.scm</string> <key>Layout</key> <array> <dict> <key>Dock</key> <array> <dict> <key>ContentConfiguration</key> <dict> <key>PBXProjectModuleGUID</key> <string>1C78EAB2065D492600B07095</string> <key>PBXProjectModuleLabel</key> <string><No Editor></string> <key>PBXSplitModuleInNavigatorKey</key> <dict> <key>Split0</key> <dict> <key>PBXProjectModuleGUID</key> <string>1C78EAB3065D492600B07095</string> </dict> <key>SplitCount</key> <string>1</string> </dict> <key>StatusBarVisibility</key> <integer>1</integer> </dict> <key>GeometryConfiguration</key> <dict> <key>Frame</key> <string>{{0, 0}, {452, 0}}</string> <key>RubberWindowFrame</key> <string>743 379 452 308 0 0 1280 1002 </string> </dict> <key>Module</key> <string>PBXNavigatorGroup</string> <key>Proportion</key> <string>0pt</string> </dict> <dict> <key>BecomeActive</key> <integer>1</integer> <key>ContentConfiguration</key> <dict> <key>PBXProjectModuleGUID</key> <string>1CD052920623707200166675</string> <key>PBXProjectModuleLabel</key> <string>SCM</string> </dict> <key>GeometryConfiguration</key> <dict> <key>ConsoleFrame</key> <string>{{0, 259}, {452, 0}}</string> <key>Frame</key> <string>{{0, 7}, {452, 259}}</string> <key>RubberWindowFrame</key> <string>743 379 452 308 0 0 1280 1002 </string> <key>TableConfiguration</key> <array> <string>Status</string> <real>30</real> <string>FileName</string> <real>199</real> <string>Path</string> <real>197.09500122070312</real> </array> <key>TableFrame</key> <string>{{0, 0}, {452, 250}}</string> </dict> <key>Module</key> <string>PBXCVSModule</string> <key>Proportion</key> <string>262pt</string> </dict> </array> <key>Proportion</key> <string>266pt</string> </dict> </array> <key>Name</key> <string>SCM</string> <key>ServiceClasses</key> <array> <string>PBXCVSModule</string> </array> <key>StatusbarIsVisible</key> <integer>1</integer> <key>TableOfContents</key> <array> <string>1C78EAB4065D492600B07095</string> <string>1C78EAB5065D492600B07095</string> <string>1C78EAB2065D492600B07095</string> <string>1CD052920623707200166675</string> </array> <key>ToolbarConfiguration</key> <string>xcode.toolbar.config.scm</string> <key>WindowString</key> <string>743 379 452 308 0 0 1280 1002 </string> </dict> <dict> <key>Identifier</key> <string>windowTool.breakpoints</string> <key>IsVertical</key> <integer>0</integer> <key>Layout</key> <array> <dict> <key>Dock</key> <array> <dict> <key>BecomeActive</key> <integer>1</integer> <key>ContentConfiguration</key> <dict> <key>PBXBottomSmartGroupGIDs</key> <array> <string>1C77FABC04509CD000000102</string> </array> <key>PBXProjectModuleGUID</key> <string>1CE0B1FE06471DED0097A5F4</string> <key>PBXProjectModuleLabel</key> <string>Files</string> <key>PBXProjectStructureProvided</key> <string>no</string> <key>PBXSmartGroupTreeModuleColumnData</key> <dict> <key>PBXSmartGroupTreeModuleColumnWidthsKey</key> <array> <real>168</real> </array> <key>PBXSmartGroupTreeModuleColumnsKey_v4</key> <array> <string>MainColumn</string> </array> </dict> <key>PBXSmartGroupTreeModuleOutlineStateKey_v7</key> <dict> <key>PBXSmartGroupTreeModuleOutlineStateExpansionKey</key> <array> <string>1C77FABC04509CD000000102</string> </array> <key>PBXSmartGroupTreeModuleOutlineStateSelectionKey</key> <array> <array> <integer>0</integer> </array> </array> <key>PBXSmartGroupTreeModuleOutlineStateVisibleRectKey</key> <string>{{0, 0}, {168, 350}}</string> </dict> <key>PBXTopSmartGroupGIDs</key> <array/> <key>XCIncludePerspectivesSwitch</key> <integer>0</integer> </dict> <key>GeometryConfiguration</key> <dict> <key>Frame</key> <string>{{0, 0}, {185, 368}}</string> <key>GroupTreeTableConfiguration</key> <array> <string>MainColumn</string> <real>168</real> </array> <key>RubberWindowFrame</key> <string>315 424 744 409 0 0 1440 878 </string> </dict> <key>Module</key> <string>PBXSmartGroupTreeModule</string> <key>Proportion</key> <string>185pt</string> </dict> <dict> <key>ContentConfiguration</key> <dict> <key>PBXProjectModuleGUID</key> <string>1CA1AED706398EBD00589147</string> <key>PBXProjectModuleLabel</key> <string>Detail</string> </dict> <key>GeometryConfiguration</key> <dict> <key>Frame</key> <string>{{190, 0}, {554, 368}}</string> <key>RubberWindowFrame</key> <string>315 424 744 409 0 0 1440 878 </string> </dict> <key>Module</key> <string>XCDetailModule</string> <key>Proportion</key> <string>554pt</string> </dict> </array> <key>Proportion</key> <string>368pt</string> </dict> </array> <key>MajorVersion</key> <integer>2</integer> <key>MinorVersion</key> <integer>0</integer> <key>Name</key> <string>Breakpoints</string> <key>ServiceClasses</key> <array> <string>PBXSmartGroupTreeModule</string> <string>XCDetailModule</string> </array> <key>StatusbarIsVisible</key> <integer>1</integer> <key>TableOfContents</key> <array> <string>1CDDB66807F98D9800BB5817</string> <string>1CDDB66907F98D9800BB5817</string> <string>1CE0B1FE06471DED0097A5F4</string> <string>1CA1AED706398EBD00589147</string> </array> <key>ToolbarConfiguration</key> <string>xcode.toolbar.config.breakpoints</string> <key>WindowString</key> <string>315 424 744 409 0 0 1440 878 </string> <key>WindowToolGUID</key> <string>1CDDB66807F98D9800BB5817</string> <key>WindowToolIsVisible</key> <integer>1</integer> </dict> <dict> <key>Identifier</key> <string>windowTool.debugAnimator</string> <key>Layout</key> <array> <dict> <key>Dock</key> <array> <dict> <key>Module</key> <string>PBXNavigatorGroup</string> <key>Proportion</key> <string>100%</string> </dict> </array> <key>Proportion</key> <string>100%</string> </dict> </array> <key>Name</key> <string>Debug Visualizer</string> <key>ServiceClasses</key> <array> <string>PBXNavigatorGroup</string> </array> <key>StatusbarIsVisible</key> <integer>1</integer> <key>ToolbarConfiguration</key> <string>xcode.toolbar.config.debugAnimator</string> <key>WindowString</key> <string>100 100 700 500 0 0 1280 1002 </string> </dict> <dict> <key>Identifier</key> <string>windowTool.bookmarks</string> <key>Layout</key> <array> <dict> <key>Dock</key> <array> <dict> <key>Module</key> <string>PBXBookmarksModule</string> <key>Proportion</key> <string>100%</string> </dict> </array> <key>Proportion</key> <string>100%</string> </dict> </array> <key>Name</key> <string>Bookmarks</string> <key>ServiceClasses</key> <array> <string>PBXBookmarksModule</string> </array> <key>StatusbarIsVisible</key> <integer>0</integer> <key>WindowString</key> <string>538 42 401 187 0 0 1280 1002 </string> </dict> <dict> <key>FirstTimeWindowDisplayed</key> <false/> <key>Identifier</key> <string>windowTool.classBrowser</string> <key>IsVertical</key> <true/> <key>Layout</key> <array> <dict> <key>Dock</key> <array> <dict> <key>BecomeActive</key> <true/> <key>ContentConfiguration</key> <dict> <key>OptionsSetName</key> <string>Hierarchy, all classes</string> <key>PBXProjectModuleGUID</key> <string>1CA6456E063B45B4001379D8</string> <key>PBXProjectModuleLabel</key> <string>Class Browser - NSObject</string> </dict> <key>GeometryConfiguration</key> <dict> <key>ClassesFrame</key> <string>{{0, 0}, {378, 96}}</string> <key>ClassesTreeTableConfiguration</key> <array> <string>PBXClassNameColumnIdentifier</string> <real>208</real> <string>PBXClassBookColumnIdentifier</string> <real>22</real> </array> <key>Frame</key> <string>{{0, 0}, {630, 332}}</string> <key>MembersFrame</key> <string>{{0, 101}, {378, 231}}</string> <key>MembersTreeTableConfiguration</key> <array> <string>PBXMemberTypeIconColumnIdentifier</string> <real>22</real> <string>PBXMemberNameColumnIdentifier</string> <real>216</real> <string>PBXMemberTypeColumnIdentifier</string> <real>101</real> <string>PBXMemberBookColumnIdentifier</string> <real>22</real> </array> <key>RubberWindowFrame</key> <string>397 461 630 352 0 0 1440 878 </string> </dict> <key>Module</key> <string>PBXClassBrowserModule</string> <key>Proportion</key> <string>332pt</string> </dict> </array> <key>Proportion</key> <string>332pt</string> </dict> </array> <key>Name</key> <string>Class Browser</string> <key>ServiceClasses</key> <array> <string>PBXClassBrowserModule</string> </array> <key>StatusbarIsVisible</key> <false/> <key>TableOfContents</key> <array> <string>1C0AD2AF069F1E9B00FABCE6</string> <string>069BBEBB134C395300F43B40</string> <string>1CA6456E063B45B4001379D8</string> </array> <key>ToolbarConfiguration</key> <string>xcode.toolbar.config.classbrowser</string> <key>WindowString</key> <string>397 461 630 352 0 0 1440 878 </string> <key>WindowToolGUID</key> <string>1C0AD2AF069F1E9B00FABCE6</string> <key>WindowToolIsVisible</key> <false/> </dict> </array> </dict> </plist> ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������UnixAgent-2.4.2/tools/macosx/ocsng_app-xcode/OCSNG.xcodeproj/ocs.mode1v3����������������������������0000664�0000000�0000000�00000121734�13327377321�0025775�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict> <key>ActivePerspectiveName</key> <string>Project</string> <key>AllowedModules</key> <array> <dict> <key>BundleLoadPath</key> <string></string> <key>MaxInstances</key> <string>n</string> <key>Module</key> <string>PBXSmartGroupTreeModule</string> <key>Name</key> <string>Groups and Files Outline View</string> </dict> <dict> <key>BundleLoadPath</key> <string></string> <key>MaxInstances</key> <string>n</string> <key>Module</key> <string>PBXNavigatorGroup</string> <key>Name</key> <string>Editor</string> </dict> <dict> <key>BundleLoadPath</key> <string></string> <key>MaxInstances</key> <string>n</string> <key>Module</key> <string>XCTaskListModule</string> <key>Name</key> <string>Task List</string> </dict> <dict> <key>BundleLoadPath</key> <string></string> <key>MaxInstances</key> <string>n</string> <key>Module</key> <string>XCDetailModule</string> <key>Name</key> <string>File and Smart Group Detail Viewer</string> </dict> <dict> <key>BundleLoadPath</key> <string></string> <key>MaxInstances</key> <string>1</string> <key>Module</key> <string>PBXBuildResultsModule</string> <key>Name</key> <string>Detailed Build Results Viewer</string> </dict> <dict> <key>BundleLoadPath</key> <string></string> <key>MaxInstances</key> <string>1</string> <key>Module</key> <string>PBXProjectFindModule</string> <key>Name</key> <string>Project Batch Find Tool</string> </dict> <dict> <key>BundleLoadPath</key> <string></string> <key>MaxInstances</key> <string>n</string> <key>Module</key> <string>XCProjectFormatConflictsModule</string> <key>Name</key> <string>Project Format Conflicts List</string> </dict> <dict> <key>BundleLoadPath</key> <string></string> <key>MaxInstances</key> <string>n</string> <key>Module</key> <string>PBXBookmarksModule</string> <key>Name</key> <string>Bookmarks Tool</string> </dict> <dict> <key>BundleLoadPath</key> <string></string> <key>MaxInstances</key> <string>n</string> <key>Module</key> <string>PBXClassBrowserModule</string> <key>Name</key> <string>Class Browser</string> </dict> <dict> <key>BundleLoadPath</key> <string></string> <key>MaxInstances</key> <string>n</string> <key>Module</key> <string>PBXCVSModule</string> <key>Name</key> <string>Source Code Control Tool</string> </dict> <dict> <key>BundleLoadPath</key> <string></string> <key>MaxInstances</key> <string>n</string> <key>Module</key> <string>PBXDebugBreakpointsModule</string> <key>Name</key> <string>Debug Breakpoints Tool</string> </dict> <dict> <key>BundleLoadPath</key> <string></string> <key>MaxInstances</key> <string>n</string> <key>Module</key> <string>XCDockableInspector</string> <key>Name</key> <string>Inspector</string> </dict> <dict> <key>BundleLoadPath</key> <string></string> <key>MaxInstances</key> <string>n</string> <key>Module</key> <string>PBXOpenQuicklyModule</string> <key>Name</key> <string>Open Quickly Tool</string> </dict> <dict> <key>BundleLoadPath</key> <string></string> <key>MaxInstances</key> <string>1</string> <key>Module</key> <string>PBXDebugSessionModule</string> <key>Name</key> <string>Debugger</string> </dict> <dict> <key>BundleLoadPath</key> <string></string> <key>MaxInstances</key> <string>1</string> <key>Module</key> <string>PBXDebugCLIModule</string> <key>Name</key> <string>Debug Console</string> </dict> <dict> <key>BundleLoadPath</key> <string></string> <key>MaxInstances</key> <string>n</string> <key>Module</key> <string>XCSnapshotModule</string> <key>Name</key> <string>Snapshots Tool</string> </dict> </array> <key>Description</key> <string>DefaultDescriptionKey</string> <key>DockingSystemVisible</key> <false/> <key>Extension</key> <string>mode1v3</string> <key>FavBarConfig</key> <dict> <key>PBXProjectModuleGUID</key> <string>06B19D9613CF924200E550A5</string> <key>XCBarModuleItemNames</key> <dict/> <key>XCBarModuleItems</key> <array/> </dict> <key>FirstTimeWindowDisplayed</key> <false/> <key>Identifier</key> <string>com.apple.perspectives.project.mode1v3</string> <key>MajorVersion</key> <integer>33</integer> <key>MinorVersion</key> <integer>0</integer> <key>Name</key> <string>Default</string> <key>Notifications</key> <array/> <key>OpenEditors</key> <array> <dict> <key>Content</key> <dict> <key>PBXProjectModuleGUID</key> <string>06128B5D151BD3BF004BCDF5</string> <key>PBXProjectModuleLabel</key> <string>ocscontact.m</string> <key>PBXSplitModuleInNavigatorKey</key> <dict> <key>Split0</key> <dict> <key>PBXProjectModuleGUID</key> <string>06128B5E151BD3BF004BCDF5</string> <key>PBXProjectModuleLabel</key> <string>ocscontact.m</string> <key>_historyCapacity</key> <integer>0</integer> <key>bookmark</key> <string>06128B5F151BD3BF004BCDF5</string> <key>history</key> <array> <string>06128B57151BD393004BCDF5</string> </array> </dict> <key>SplitCount</key> <string>1</string> </dict> <key>StatusBarVisibility</key> <true/> </dict> <key>Geometry</key> <dict> <key>Frame</key> <string>{{0, 20}, {949, 691}}</string> <key>PBXModuleWindowStatusBarHidden2</key> <false/> <key>RubberWindowFrame</key> <string>202 146 949 732 0 0 1440 878 </string> </dict> </dict> </array> <key>PerspectiveWidths</key> <array> <integer>-1</integer> <integer>-1</integer> </array> <key>Perspectives</key> <array> <dict> <key>ChosenToolbarItems</key> <array> <string>active-combo-popup</string> <string>action</string> <string>NSToolbarFlexibleSpaceItem</string> <string>clean</string> <string>buildOrClean</string> <string>build-and-go</string> <string>go</string> <string>servicesModuledebug</string> <string>servicesModulebuild</string> <string>debugger-enable-breakpoints</string> <string>com.apple.ide.PBXToolbarStopButton</string> <string>get-info</string> <string>NSToolbarFlexibleSpaceItem</string> <string>com.apple.pbx.toolbar.searchfield</string> </array> <key>ControllerClassBaseName</key> <string></string> <key>IconName</key> <string>WindowOfProjectWithEditor</string> <key>Identifier</key> <string>perspective.project</string> <key>IsVertical</key> <false/> <key>Layout</key> <array> <dict> <key>BecomeActive</key> <true/> <key>ContentConfiguration</key> <dict> <key>PBXBottomSmartGroupGIDs</key> <array> <string>1C37FBAC04509CD000000102</string> <string>1C37FAAC04509CD000000102</string> <string>1C37FABC05509CD000000102</string> <string>1C37FABC05539CD112110102</string> <string>E2644B35053B69B200211256</string> <string>1C37FABC04509CD000100104</string> <string>1CC0EA4004350EF90044410B</string> <string>1CC0EA4004350EF90041110B</string> </array> <key>PBXProjectModuleGUID</key> <string>1CE0B1FE06471DED0097A5F4</string> <key>PBXProjectModuleLabel</key> <string>Files</string> <key>PBXProjectStructureProvided</key> <string>yes</string> <key>PBXSmartGroupTreeModuleColumnData</key> <dict> <key>PBXSmartGroupTreeModuleColumnWidthsKey</key> <array> <real>254</real> </array> <key>PBXSmartGroupTreeModuleColumnsKey_v4</key> <array> <string>MainColumn</string> </array> </dict> <key>PBXSmartGroupTreeModuleOutlineStateKey_v7</key> <dict> <key>PBXSmartGroupTreeModuleOutlineStateExpansionKey</key> <array> <string>29B97314FDCFA39411CA2CEA</string> <string>080E96DDFE201D6D7F000001</string> <string>29B97315FDCFA39411CA2CEA</string> <string>29B97317FDCFA39411CA2CEA</string> <string>0649FB3314D9E198001EC640</string> <string>29B97323FDCFA39411CA2CEA</string> <string>1058C7A0FEA54F0111CA2CBB</string> <string>1058C7A2FEA54F0111CA2CBB</string> <string>19C28FACFE9D520D11CA2CBB</string> <string>1C37FBAC04509CD000000102</string> </array> <key>PBXSmartGroupTreeModuleOutlineStateSelectionKey</key> <array> <array> <integer>4</integer> <integer>3</integer> <integer>0</integer> </array> </array> <key>PBXSmartGroupTreeModuleOutlineStateVisibleRectKey</key> <string>{{0, 0}, {254, 674}}</string> </dict> <key>PBXTopSmartGroupGIDs</key> <array/> <key>XCIncludePerspectivesSwitch</key> <true/> <key>XCSharingToken</key> <string>com.apple.Xcode.GFSharingToken</string> </dict> <key>GeometryConfiguration</key> <dict> <key>Frame</key> <string>{{0, 0}, {271, 692}}</string> <key>GroupTreeTableConfiguration</key> <array> <string>MainColumn</string> <real>254</real> </array> <key>RubberWindowFrame</key> <string>0 145 1440 733 0 0 1440 878 </string> </dict> <key>Module</key> <string>PBXSmartGroupTreeModule</string> <key>Proportion</key> <string>271pt</string> </dict> <dict> <key>Dock</key> <array> <dict> <key>ContentConfiguration</key> <dict> <key>PBXProjectModuleGUID</key> <string>1CE0B20306471E060097A5F4</string> <key>PBXProjectModuleLabel</key> <string>ocscontact.m</string> <key>PBXSplitModuleInNavigatorKey</key> <dict> <key>Split0</key> <dict> <key>PBXProjectModuleGUID</key> <string>1CE0B20406471E060097A5F4</string> <key>PBXProjectModuleLabel</key> <string>ocscontact.m</string> <key>_historyCapacity</key> <integer>0</integer> <key>bookmark</key> <string>06128B5A151BD3BF004BCDF5</string> <key>history</key> <array> <string>068D515613DC84ED00211FF5</string> <string>068D515813DC84ED00211FF5</string> <string>06D79C9013DC8D3500E6B017</string> <string>06F13D9C13DC92FC00509DAF</string> <string>06709F4613E09D94005F44AE</string> <string>0649FB4714D9E57D001EC640</string> <string>068005F2151BCF55006F95F1</string> <string>068005F3151BCF55006F95F1</string> <string>068005F4151BCF55006F95F1</string> <string>068005F5151BCF55006F95F1</string> <string>06128B59151BD3BF004BCDF5</string> </array> </dict> <key>SplitCount</key> <string>1</string> </dict> <key>StatusBarVisibility</key> <true/> </dict> <key>GeometryConfiguration</key> <dict> <key>Frame</key> <string>{{0, 0}, {1164, 92}}</string> <key>RubberWindowFrame</key> <string>0 145 1440 733 0 0 1440 878 </string> </dict> <key>Module</key> <string>PBXNavigatorGroup</string> <key>Proportion</key> <string>92pt</string> </dict> <dict> <key>ContentConfiguration</key> <dict> <key>PBXProjectModuleGUID</key> <string>1CE0B20506471E060097A5F4</string> <key>PBXProjectModuleLabel</key> <string>Detail</string> </dict> <key>GeometryConfiguration</key> <dict> <key>Frame</key> <string>{{0, 97}, {1164, 595}}</string> <key>RubberWindowFrame</key> <string>0 145 1440 733 0 0 1440 878 </string> </dict> <key>Module</key> <string>XCDetailModule</string> <key>Proportion</key> <string>595pt</string> </dict> </array> <key>Proportion</key> <string>1164pt</string> </dict> </array> <key>Name</key> <string>Project</string> <key>ServiceClasses</key> <array> <string>XCModuleDock</string> <string>PBXSmartGroupTreeModule</string> <string>XCModuleDock</string> <string>PBXNavigatorGroup</string> <string>XCDetailModule</string> </array> <key>TableOfContents</key> <array> <string>06128B5B151BD3BF004BCDF5</string> <string>1CE0B1FE06471DED0097A5F4</string> <string>06128B5C151BD3BF004BCDF5</string> <string>1CE0B20306471E060097A5F4</string> <string>1CE0B20506471E060097A5F4</string> </array> <key>ToolbarConfigUserDefaultsMinorVersion</key> <string>2</string> <key>ToolbarConfiguration</key> <string>xcode.toolbar.config.defaultV3</string> </dict> <dict> <key>ControllerClassBaseName</key> <string></string> <key>IconName</key> <string>WindowOfProject</string> <key>Identifier</key> <string>perspective.morph</string> <key>IsVertical</key> <false/> <key>Layout</key> <array> <dict> <key>BecomeActive</key> <integer>1</integer> <key>ContentConfiguration</key> <dict> <key>PBXBottomSmartGroupGIDs</key> <array> <string>1C37FBAC04509CD000000102</string> <string>1C37FAAC04509CD000000102</string> <string>1C08E77C0454961000C914BD</string> <string>1C37FABC05509CD000000102</string> <string>1C37FABC05539CD112110102</string> <string>E2644B35053B69B200211256</string> <string>1C37FABC04509CD000100104</string> <string>1CC0EA4004350EF90044410B</string> <string>1CC0EA4004350EF90041110B</string> </array> <key>PBXProjectModuleGUID</key> <string>11E0B1FE06471DED0097A5F4</string> <key>PBXProjectModuleLabel</key> <string>Files</string> <key>PBXProjectStructureProvided</key> <string>yes</string> <key>PBXSmartGroupTreeModuleColumnData</key> <dict> <key>PBXSmartGroupTreeModuleColumnWidthsKey</key> <array> <real>186</real> </array> <key>PBXSmartGroupTreeModuleColumnsKey_v4</key> <array> <string>MainColumn</string> </array> </dict> <key>PBXSmartGroupTreeModuleOutlineStateKey_v7</key> <dict> <key>PBXSmartGroupTreeModuleOutlineStateExpansionKey</key> <array> <string>29B97314FDCFA39411CA2CEA</string> <string>1C37FABC05509CD000000102</string> </array> <key>PBXSmartGroupTreeModuleOutlineStateSelectionKey</key> <array> <array> <integer>0</integer> </array> </array> <key>PBXSmartGroupTreeModuleOutlineStateVisibleRectKey</key> <string>{{0, 0}, {186, 337}}</string> </dict> <key>PBXTopSmartGroupGIDs</key> <array/> <key>XCIncludePerspectivesSwitch</key> <integer>1</integer> <key>XCSharingToken</key> <string>com.apple.Xcode.GFSharingToken</string> </dict> <key>GeometryConfiguration</key> <dict> <key>Frame</key> <string>{{0, 0}, {203, 355}}</string> <key>GroupTreeTableConfiguration</key> <array> <string>MainColumn</string> <real>186</real> </array> <key>RubberWindowFrame</key> <string>373 269 690 397 0 0 1440 878 </string> </dict> <key>Module</key> <string>PBXSmartGroupTreeModule</string> <key>Proportion</key> <string>100%</string> </dict> </array> <key>Name</key> <string>Morph</string> <key>PreferredWidth</key> <integer>300</integer> <key>ServiceClasses</key> <array> <string>XCModuleDock</string> <string>PBXSmartGroupTreeModule</string> </array> <key>TableOfContents</key> <array> <string>11E0B1FE06471DED0097A5F4</string> </array> <key>ToolbarConfiguration</key> <string>xcode.toolbar.config.default.shortV3</string> </dict> </array> <key>PerspectivesBarVisible</key> <false/> <key>ShelfIsVisible</key> <false/> <key>StatusbarIsVisible</key> <true/> <key>TimeStamp</key> <real>0.0</real> <key>ToolbarConfigUserDefaultsMinorVersion</key> <string>2</string> <key>ToolbarDisplayMode</key> <integer>1</integer> <key>ToolbarIsVisible</key> <true/> <key>ToolbarSizeMode</key> <integer>1</integer> <key>Type</key> <string>Perspectives</string> <key>UpdateMessage</key> <string>The Default Workspace in this version of Xcode now includes support to hide and show the detail view (what has been referred to as the "Metro-Morph" feature). You must discard your current Default Workspace settings and update to the latest Default Workspace in order to gain this feature. Do you wish to update to the latest Workspace defaults for project '%@'?</string> <key>WindowJustification</key> <integer>5</integer> <key>WindowOrderList</key> <array> <string>06B19D9713CF924200E550A5</string> <string>06128B5D151BD3BF004BCDF5</string> <string>/Users/ocs/work/ocs/dev/beta5/temp/tools/macosx/ocsng_app-xcode/OCSNG.xcodeproj</string> </array> <key>WindowString</key> <string>0 145 1440 733 0 0 1440 878 </string> <key>WindowToolsV3</key> <array> <dict> <key>FirstTimeWindowDisplayed</key> <false/> <key>Identifier</key> <string>windowTool.build</string> <key>IsVertical</key> <true/> <key>Layout</key> <array> <dict> <key>Dock</key> <array> <dict> <key>ContentConfiguration</key> <dict> <key>PBXProjectModuleGUID</key> <string>1CD0528F0623707200166675</string> <key>PBXProjectModuleLabel</key> <string></string> <key>StatusBarVisibility</key> <true/> </dict> <key>GeometryConfiguration</key> <dict> <key>Frame</key> <string>{{0, 0}, {1440, 455}}</string> <key>RubberWindowFrame</key> <string>0 146 1440 732 0 0 1440 878 </string> </dict> <key>Module</key> <string>PBXNavigatorGroup</string> <key>Proportion</key> <string>455pt</string> </dict> <dict> <key>ContentConfiguration</key> <dict> <key>PBXProjectModuleGUID</key> <string>XCMainBuildResultsModuleGUID</string> <key>PBXProjectModuleLabel</key> <string>Build Results</string> <key>XCBuildResultsTrigger_Collapse</key> <integer>1021</integer> <key>XCBuildResultsTrigger_Open</key> <integer>1011</integer> </dict> <key>GeometryConfiguration</key> <dict> <key>Frame</key> <string>{{0, 460}, {1440, 231}}</string> <key>RubberWindowFrame</key> <string>0 146 1440 732 0 0 1440 878 </string> </dict> <key>Module</key> <string>PBXBuildResultsModule</string> <key>Proportion</key> <string>231pt</string> </dict> </array> <key>Proportion</key> <string>691pt</string> </dict> </array> <key>Name</key> <string>Build Results</string> <key>ServiceClasses</key> <array> <string>PBXBuildResultsModule</string> </array> <key>StatusbarIsVisible</key> <true/> <key>TableOfContents</key> <array> <string>06B19D9713CF924200E550A5</string> <string>06128B60151BD3BF004BCDF5</string> <string>1CD0528F0623707200166675</string> <string>XCMainBuildResultsModuleGUID</string> </array> <key>ToolbarConfiguration</key> <string>xcode.toolbar.config.buildV3</string> <key>WindowContentMinSize</key> <string>486 300</string> <key>WindowString</key> <string>0 146 1440 732 0 0 1440 878 </string> <key>WindowToolGUID</key> <string>06B19D9713CF924200E550A5</string> <key>WindowToolIsVisible</key> <false/> </dict> <dict> <key>FirstTimeWindowDisplayed</key> <false/> <key>Identifier</key> <string>windowTool.debugger</string> <key>IsVertical</key> <true/> <key>Layout</key> <array> <dict> <key>Dock</key> <array> <dict> <key>ContentConfiguration</key> <dict> <key>Debugger</key> <dict> <key>HorizontalSplitView</key> <dict> <key>_collapsingFrameDimension</key> <real>0.0</real> <key>_indexOfCollapsedView</key> <integer>0</integer> <key>_percentageOfCollapsedView</key> <real>0.0</real> <key>isCollapsed</key> <string>yes</string> <key>sizes</key> <array> <string>{{0, 0}, {314, 203}}</string> <string>{{314, 0}, {380, 203}}</string> </array> </dict> <key>VerticalSplitView</key> <dict> <key>_collapsingFrameDimension</key> <real>0.0</real> <key>_indexOfCollapsedView</key> <integer>0</integer> <key>_percentageOfCollapsedView</key> <real>0.0</real> <key>isCollapsed</key> <string>yes</string> <key>sizes</key> <array> <string>{{0, 0}, {694, 203}}</string> <string>{{0, 203}, {694, 178}}</string> </array> </dict> </dict> <key>LauncherConfigVersion</key> <string>8</string> <key>PBXProjectModuleGUID</key> <string>1C162984064C10D400B95A72</string> <key>PBXProjectModuleLabel</key> <string>Debug - GLUTExamples (Underwater)</string> </dict> <key>GeometryConfiguration</key> <dict> <key>DebugConsoleVisible</key> <string>None</string> <key>DebugConsoleWindowFrame</key> <string>{{200, 200}, {500, 300}}</string> <key>DebugSTDIOWindowFrame</key> <string>{{200, 200}, {500, 300}}</string> <key>Frame</key> <string>{{0, 0}, {694, 381}}</string> <key>PBXDebugSessionStackFrameViewKey</key> <dict> <key>DebugVariablesTableConfiguration</key> <array> <string>Name</string> <real>120</real> <string>Value</string> <real>85</real> <string>Summary</string> <real>150</real> </array> <key>Frame</key> <string>{{314, 0}, {380, 203}}</string> <key>RubberWindowFrame</key> <string>496 358 694 422 0 0 1440 878 </string> </dict> <key>RubberWindowFrame</key> <string>496 358 694 422 0 0 1440 878 </string> </dict> <key>Module</key> <string>PBXDebugSessionModule</string> <key>Proportion</key> <string>381pt</string> </dict> </array> <key>Proportion</key> <string>381pt</string> </dict> </array> <key>Name</key> <string>Debugger</string> <key>ServiceClasses</key> <array> <string>PBXDebugSessionModule</string> </array> <key>StatusbarIsVisible</key> <true/> <key>TableOfContents</key> <array> <string>1CD10A99069EF8BA00B06720</string> <string>0606C1C714DCA7BA008033F9</string> <string>1C162984064C10D400B95A72</string> <string>0606C1C814DCA7BA008033F9</string> <string>0606C1C914DCA7BA008033F9</string> <string>0606C1CA14DCA7BA008033F9</string> <string>0606C1CB14DCA7BA008033F9</string> <string>0606C1CC14DCA7BA008033F9</string> </array> <key>ToolbarConfiguration</key> <string>xcode.toolbar.config.debugV3</string> <key>WindowString</key> <string>496 358 694 422 0 0 1440 878 </string> <key>WindowToolGUID</key> <string>1CD10A99069EF8BA00B06720</string> <key>WindowToolIsVisible</key> <false/> </dict> <dict> <key>FirstTimeWindowDisplayed</key> <false/> <key>Identifier</key> <string>windowTool.find</string> <key>Layout</key> <array> <dict> <key>Dock</key> <array> <dict> <key>Dock</key> <array> <dict> <key>ContentConfiguration</key> <dict> <key>PBXProjectModuleGUID</key> <string>1CDD528C0622207200134675</string> <key>PBXProjectModuleLabel</key> <string><No Editor></string> <key>PBXSplitModuleInNavigatorKey</key> <dict> <key>Split0</key> <dict> <key>PBXProjectModuleGUID</key> <string>1CD0528D0623707200166675</string> </dict> <key>SplitCount</key> <string>1</string> </dict> <key>StatusBarVisibility</key> <integer>1</integer> </dict> <key>GeometryConfiguration</key> <dict> <key>Frame</key> <string>{{0, 0}, {781, 167}}</string> <key>RubberWindowFrame</key> <string>62 385 781 470 0 0 1440 878 </string> </dict> <key>Module</key> <string>PBXNavigatorGroup</string> <key>Proportion</key> <string>781pt</string> </dict> </array> <key>Proportion</key> <string>50%</string> </dict> <dict> <key>BecomeActive</key> <integer>1</integer> <key>ContentConfiguration</key> <dict> <key>PBXProjectModuleGUID</key> <string>1CD0528E0623707200166675</string> <key>PBXProjectModuleLabel</key> <string>Project Find</string> </dict> <key>GeometryConfiguration</key> <dict> <key>Frame</key> <string>{{8, 0}, {773, 254}}</string> <key>RubberWindowFrame</key> <string>62 385 781 470 0 0 1440 878 </string> </dict> <key>Module</key> <string>PBXProjectFindModule</string> <key>Proportion</key> <string>50%</string> </dict> </array> <key>Proportion</key> <string>428pt</string> </dict> </array> <key>Name</key> <string>Project Find</string> <key>ServiceClasses</key> <array> <string>PBXProjectFindModule</string> </array> <key>StatusbarIsVisible</key> <true/> <key>TableOfContents</key> <array> <string>1C530D57069F1CE1000CFCEE</string> <string>1C530D58069F1CE1000CFCEE</string> <string>1C530D59069F1CE1000CFCEE</string> <string>1CDD528C0622207200134675</string> <string>1C530D5A069F1CE1000CFCEE</string> <string>1CE0B1FE06471DED0097A5F4</string> <string>1CD0528E0623707200166675</string> </array> <key>WindowString</key> <string>62 385 781 470 0 0 1440 878 </string> <key>WindowToolGUID</key> <string>1C530D57069F1CE1000CFCEE</string> <key>WindowToolIsVisible</key> <false/> </dict> <dict> <key>FirstTimeWindowDisplayed</key> <false/> <key>Identifier</key> <string>MENUSEPARATOR</string> </dict> <dict> <key>FirstTimeWindowDisplayed</key> <false/> <key>Identifier</key> <string>windowTool.debuggerConsole</string> <key>IsVertical</key> <true/> <key>Layout</key> <array> <dict> <key>Dock</key> <array> <dict> <key>ContentConfiguration</key> <dict> <key>PBXProjectModuleGUID</key> <string>1C78EAAC065D492600B07095</string> <key>PBXProjectModuleLabel</key> <string>Debugger Console</string> </dict> <key>GeometryConfiguration</key> <dict> <key>Frame</key> <string>{{0, 0}, {440, 359}}</string> <key>RubberWindowFrame</key> <string>10 478 440 400 0 0 1440 878 </string> </dict> <key>Module</key> <string>PBXDebugCLIModule</string> <key>Proportion</key> <string>359pt</string> </dict> </array> <key>Proportion</key> <string>359pt</string> </dict> </array> <key>Name</key> <string>Debugger Console</string> <key>ServiceClasses</key> <array> <string>PBXDebugCLIModule</string> </array> <key>StatusbarIsVisible</key> <true/> <key>TableOfContents</key> <array> <string>1C78EAAD065D492600B07095</string> <string>0649FB5514D9E57D001EC640</string> <string>1C78EAAC065D492600B07095</string> </array> <key>ToolbarConfiguration</key> <string>xcode.toolbar.config.consoleV3</string> <key>WindowString</key> <string>10 478 440 400 0 0 1440 878 </string> <key>WindowToolGUID</key> <string>1C78EAAD065D492600B07095</string> <key>WindowToolIsVisible</key> <false/> </dict> <dict> <key>Identifier</key> <string>windowTool.snapshots</string> <key>Layout</key> <array> <dict> <key>Dock</key> <array> <dict> <key>Module</key> <string>XCSnapshotModule</string> <key>Proportion</key> <string>100%</string> </dict> </array> <key>Proportion</key> <string>100%</string> </dict> </array> <key>Name</key> <string>Snapshots</string> <key>ServiceClasses</key> <array> <string>XCSnapshotModule</string> </array> <key>StatusbarIsVisible</key> <string>Yes</string> <key>ToolbarConfiguration</key> <string>xcode.toolbar.config.snapshots</string> <key>WindowString</key> <string>315 824 300 550 0 0 1440 878 </string> <key>WindowToolIsVisible</key> <string>Yes</string> </dict> <dict> <key>FirstTimeWindowDisplayed</key> <false/> <key>Identifier</key> <string>windowTool.scm</string> <key>Layout</key> <array> <dict> <key>Dock</key> <array> <dict> <key>ContentConfiguration</key> <dict> <key>PBXProjectModuleGUID</key> <string>1C78EAB2065D492600B07095</string> <key>PBXProjectModuleLabel</key> <string><No Editor></string> <key>PBXSplitModuleInNavigatorKey</key> <dict> <key>Split0</key> <dict> <key>PBXProjectModuleGUID</key> <string>1C78EAB3065D492600B07095</string> </dict> <key>SplitCount</key> <string>1</string> </dict> <key>StatusBarVisibility</key> <integer>1</integer> </dict> <key>GeometryConfiguration</key> <dict> <key>Frame</key> <string>{{0, 0}, {452, 0}}</string> <key>RubberWindowFrame</key> <string>743 379 452 308 0 0 1280 1002 </string> </dict> <key>Module</key> <string>PBXNavigatorGroup</string> <key>Proportion</key> <string>0pt</string> </dict> <dict> <key>BecomeActive</key> <integer>1</integer> <key>ContentConfiguration</key> <dict> <key>PBXProjectModuleGUID</key> <string>1CD052920623707200166675</string> <key>PBXProjectModuleLabel</key> <string>SCM</string> </dict> <key>GeometryConfiguration</key> <dict> <key>ConsoleFrame</key> <string>{{0, 259}, {452, 0}}</string> <key>Frame</key> <string>{{0, 7}, {452, 259}}</string> <key>RubberWindowFrame</key> <string>743 379 452 308 0 0 1280 1002 </string> <key>TableConfiguration</key> <array> <string>Status</string> <real>30</real> <string>FileName</string> <real>199</real> <string>Path</string> <real>197.09500122070312</real> </array> <key>TableFrame</key> <string>{{0, 0}, {452, 250}}</string> </dict> <key>Module</key> <string>PBXCVSModule</string> <key>Proportion</key> <string>262pt</string> </dict> </array> <key>Proportion</key> <string>266pt</string> </dict> </array> <key>Name</key> <string>SCM</string> <key>ServiceClasses</key> <array> <string>PBXCVSModule</string> </array> <key>StatusbarIsVisible</key> <true/> <key>TableOfContents</key> <array> <string>1C78EAB4065D492600B07095</string> <string>1C78EAB5065D492600B07095</string> <string>1C78EAB2065D492600B07095</string> <string>1CD052920623707200166675</string> </array> <key>ToolbarConfiguration</key> <string>xcode.toolbar.config.scm</string> <key>WindowString</key> <string>743 379 452 308 0 0 1280 1002 </string> </dict> <dict> <key>FirstTimeWindowDisplayed</key> <false/> <key>Identifier</key> <string>windowTool.breakpoints</string> <key>IsVertical</key> <false/> <key>Layout</key> <array> <dict> <key>Dock</key> <array> <dict> <key>BecomeActive</key> <integer>1</integer> <key>ContentConfiguration</key> <dict> <key>PBXBottomSmartGroupGIDs</key> <array> <string>1C77FABC04509CD000000102</string> </array> <key>PBXProjectModuleGUID</key> <string>1CE0B1FE06471DED0097A5F4</string> <key>PBXProjectModuleLabel</key> <string>Files</string> <key>PBXProjectStructureProvided</key> <string>no</string> <key>PBXSmartGroupTreeModuleColumnData</key> <dict> <key>PBXSmartGroupTreeModuleColumnWidthsKey</key> <array> <real>168</real> </array> <key>PBXSmartGroupTreeModuleColumnsKey_v4</key> <array> <string>MainColumn</string> </array> </dict> <key>PBXSmartGroupTreeModuleOutlineStateKey_v7</key> <dict> <key>PBXSmartGroupTreeModuleOutlineStateExpansionKey</key> <array> <string>1C77FABC04509CD000000102</string> </array> <key>PBXSmartGroupTreeModuleOutlineStateSelectionKey</key> <array> <array> <integer>0</integer> </array> </array> <key>PBXSmartGroupTreeModuleOutlineStateVisibleRectKey</key> <string>{{0, 0}, {168, 350}}</string> </dict> <key>PBXTopSmartGroupGIDs</key> <array/> <key>XCIncludePerspectivesSwitch</key> <integer>0</integer> </dict> <key>GeometryConfiguration</key> <dict> <key>Frame</key> <string>{{0, 0}, {185, 368}}</string> <key>GroupTreeTableConfiguration</key> <array> <string>MainColumn</string> <real>168</real> </array> <key>RubberWindowFrame</key> <string>315 424 744 409 0 0 1440 878 </string> </dict> <key>Module</key> <string>PBXSmartGroupTreeModule</string> <key>Proportion</key> <string>185pt</string> </dict> <dict> <key>ContentConfiguration</key> <dict> <key>PBXProjectModuleGUID</key> <string>1CA1AED706398EBD00589147</string> <key>PBXProjectModuleLabel</key> <string>Detail</string> </dict> <key>GeometryConfiguration</key> <dict> <key>Frame</key> <string>{{190, 0}, {554, 368}}</string> <key>RubberWindowFrame</key> <string>315 424 744 409 0 0 1440 878 </string> </dict> <key>Module</key> <string>XCDetailModule</string> <key>Proportion</key> <string>554pt</string> </dict> </array> <key>Proportion</key> <string>368pt</string> </dict> </array> <key>MajorVersion</key> <integer>3</integer> <key>MinorVersion</key> <integer>0</integer> <key>Name</key> <string>Breakpoints</string> <key>ServiceClasses</key> <array> <string>PBXSmartGroupTreeModule</string> <string>XCDetailModule</string> </array> <key>StatusbarIsVisible</key> <true/> <key>TableOfContents</key> <array> <string>1CDDB66807F98D9800BB5817</string> <string>1CDDB66907F98D9800BB5817</string> <string>1CE0B1FE06471DED0097A5F4</string> <string>1CA1AED706398EBD00589147</string> </array> <key>ToolbarConfiguration</key> <string>xcode.toolbar.config.breakpointsV3</string> <key>WindowString</key> <string>315 424 744 409 0 0 1440 878 </string> <key>WindowToolGUID</key> <string>1CDDB66807F98D9800BB5817</string> <key>WindowToolIsVisible</key> <true/> </dict> <dict> <key>FirstTimeWindowDisplayed</key> <false/> <key>Identifier</key> <string>windowTool.debugAnimator</string> <key>Layout</key> <array> <dict> <key>Dock</key> <array> <dict> <key>Module</key> <string>PBXNavigatorGroup</string> <key>Proportion</key> <string>100%</string> </dict> </array> <key>Proportion</key> <string>100%</string> </dict> </array> <key>Name</key> <string>Debug Visualizer</string> <key>ServiceClasses</key> <array> <string>PBXNavigatorGroup</string> </array> <key>StatusbarIsVisible</key> <true/> <key>ToolbarConfiguration</key> <string>xcode.toolbar.config.debugAnimatorV3</string> <key>WindowString</key> <string>100 100 700 500 0 0 1280 1002 </string> </dict> <dict> <key>FirstTimeWindowDisplayed</key> <false/> <key>Identifier</key> <string>windowTool.bookmarks</string> <key>Layout</key> <array> <dict> <key>Dock</key> <array> <dict> <key>Module</key> <string>PBXBookmarksModule</string> <key>Proportion</key> <string>100%</string> </dict> </array> <key>Proportion</key> <string>100%</string> </dict> </array> <key>Name</key> <string>Bookmarks</string> <key>ServiceClasses</key> <array> <string>PBXBookmarksModule</string> </array> <key>StatusbarIsVisible</key> <false/> <key>WindowString</key> <string>538 42 401 187 0 0 1280 1002 </string> </dict> <dict> <key>Identifier</key> <string>windowTool.projectFormatConflicts</string> <key>Layout</key> <array> <dict> <key>Dock</key> <array> <dict> <key>Module</key> <string>XCProjectFormatConflictsModule</string> <key>Proportion</key> <string>100%</string> </dict> </array> <key>Proportion</key> <string>100%</string> </dict> </array> <key>Name</key> <string>Project Format Conflicts</string> <key>ServiceClasses</key> <array> <string>XCProjectFormatConflictsModule</string> </array> <key>StatusbarIsVisible</key> <false/> <key>WindowContentMinSize</key> <string>450 300</string> <key>WindowString</key> <string>50 850 472 307 0 0 1440 877</string> </dict> <dict> <key>FirstTimeWindowDisplayed</key> <false/> <key>Identifier</key> <string>windowTool.classBrowser</string> <key>Layout</key> <array> <dict> <key>Dock</key> <array> <dict> <key>BecomeActive</key> <true/> <key>ContentConfiguration</key> <dict> <key>OptionsSetName</key> <string>Hierarchy, all classes</string> <key>PBXProjectModuleGUID</key> <string>1CA6456E063B45B4001379D8</string> <key>PBXProjectModuleLabel</key> <string>Class Browser - NSObject</string> </dict> <key>GeometryConfiguration</key> <dict> <key>ClassesFrame</key> <string>{{0, 0}, {378, 96}}</string> <key>ClassesTreeTableConfiguration</key> <array> <string>PBXClassNameColumnIdentifier</string> <real>208</real> <string>PBXClassBookColumnIdentifier</string> <real>22</real> </array> <key>Frame</key> <string>{{0, 0}, {630, 332}}</string> <key>MembersFrame</key> <string>{{0, 101}, {378, 231}}</string> <key>MembersTreeTableConfiguration</key> <array> <string>PBXMemberTypeIconColumnIdentifier</string> <real>22</real> <string>PBXMemberNameColumnIdentifier</string> <real>216</real> <string>PBXMemberTypeColumnIdentifier</string> <real>101</real> <string>PBXMemberBookColumnIdentifier</string> <real>22</real> </array> <key>RubberWindowFrame</key> <string>397 461 630 352 0 0 1440 878 </string> </dict> <key>Module</key> <string>PBXClassBrowserModule</string> <key>Proportion</key> <string>332pt</string> </dict> </array> <key>Proportion</key> <string>332pt</string> </dict> </array> <key>Name</key> <string>Class Browser</string> <key>ServiceClasses</key> <array> <string>PBXClassBrowserModule</string> </array> <key>StatusbarIsVisible</key> <false/> <key>TableOfContents</key> <array> <string>1C0AD2AF069F1E9B00FABCE6</string> <string>1C0AD2B0069F1E9B00FABCE6</string> <string>1CA6456E063B45B4001379D8</string> </array> <key>ToolbarConfiguration</key> <string>xcode.toolbar.config.classbrowser</string> <key>WindowString</key> <string>397 461 630 352 0 0 1440 878 </string> <key>WindowToolGUID</key> <string>1C0AD2AF069F1E9B00FABCE6</string> <key>WindowToolIsVisible</key> <false/> </dict> <dict> <key>Identifier</key> <string>windowTool.refactoring</string> <key>IncludeInToolsMenu</key> <false/> <key>Layout</key> <array> <dict> <key>Dock</key> <array> <dict> <key>BecomeActive</key> <true/> <key>GeometryConfiguration</key> <dict> <key>Frame</key> <string>{0, 0}, {500, 335}</string> <key>RubberWindowFrame</key> <string>{0, 0}, {500, 335}</string> </dict> <key>Module</key> <string>XCRefactoringModule</string> <key>Proportion</key> <string>100%</string> </dict> </array> <key>Proportion</key> <string>100%</string> </dict> </array> <key>Name</key> <string>Refactoring</string> <key>ServiceClasses</key> <array> <string>XCRefactoringModule</string> </array> <key>WindowString</key> <string>200 200 500 356 0 0 1920 1200 </string> </dict> </array> </dict> </plist> ������������������������������������UnixAgent-2.4.2/tools/macosx/ocsng_app-xcode/OCSNG.xcodeproj/ocs.pbxuser����������������������������0000664�0000000�0000000�00000030134�13327377321�0026200�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// !$*UTF8*$! { 06128B57151BD393004BCDF5 /* PBXBookmark */ = { isa = PBXBookmark; fRef = 06D657B3134FDBFF00981FE3 /* ocscontact.m */; }; 06128B59151BD3BF004BCDF5 /* PBXTextBookmark */ = { isa = PBXTextBookmark; fRef = 06D657B3134FDBFF00981FE3 /* ocscontact.m */; name = "ocscontact.m: 6"; rLen = 0; rLoc = 99; rType = 0; vrLen = 178; vrLoc = 4; }; 06128B5A151BD3BF004BCDF5 /* PBXTextBookmark */ = { isa = PBXTextBookmark; fRef = 06D657B3134FDBFF00981FE3 /* ocscontact.m */; name = "ocscontact.m: 5"; rLen = 0; rLoc = 99; rType = 0; vrLen = 199; vrLoc = 23; }; 06128B5F151BD3BF004BCDF5 /* PBXTextBookmark */ = { isa = PBXTextBookmark; fRef = 06D657B3134FDBFF00981FE3 /* ocscontact.m */; name = "ocscontact.m: 1"; rLen = 308; rLoc = 0; rType = 0; vrLen = 1036; vrLoc = 0; }; 061EA95B130259AB009A0BD6 /* OCSNG */ = { isa = PBXExecutable; activeArgIndices = ( ); argumentStrings = ( ); autoAttachOnCrash = 1; breakpointsEnabled = 0; configStateDict = { }; customDataFormattersEnabled = 1; dataTipCustomDataFormattersEnabled = 1; dataTipShowTypeColumn = 1; dataTipSortType = 0; debuggerPlugin = GDBDebugging; disassemblyDisplayState = 0; dylibVariantSuffix = ""; enableDebugStr = 1; environmentEntries = ( ); executableSystemSymbolLevel = 0; executableUserSymbolLevel = 0; libgmallocEnabled = 0; name = OCSNG; savedGlobals = { }; showTypeColumn = 0; sourceDirectories = ( ); }; 061EA963130259CA009A0BD6 /* Source Control */ = { isa = PBXSourceControlManager; fallbackIsa = XCSourceControlManager; isSCMEnabled = 0; scmConfiguration = { repositoryNamesForRoots = { "" = ""; }; }; scmType = ""; }; 061EA964130259CA009A0BD6 /* Code sense */ = { isa = PBXCodeSenseManager; indexTemplatePath = ""; }; 0649FB3114D9E191001EC640 /* English */ = { uiCtxt = { sepNavIntBoundsRect = "{{0, 0}, {889, 578}}"; sepNavSelRange = "{56, 0}"; sepNavVisRange = "{0, 562}"; sepNavWindowFrame = "{{15, 167}, {948, 706}}"; }; }; 0649FB3514D9E1AA001EC640 /* French */ = { uiCtxt = { sepNavIntBoundsRect = "{{0, 0}, {1103, 299}}"; sepNavSelRange = "{308, 0}"; sepNavVisRange = "{97, 213}"; sepNavWindowFrame = "{{40, 146}, {948, 706}}"; }; }; 0649FB4714D9E57D001EC640 /* PBXTextBookmark */ = { isa = PBXTextBookmark; fRef = 089C165DFE840E0CC02AAC07 /* English */; name = "InfoPlist.strings: 1"; rLen = 0; rLoc = 0; rType = 0; vrLen = 0; vrLoc = 0; }; 06709F4613E09D94005F44AE /* PBXTextBookmark */ = { isa = PBXTextBookmark; fRef = 06D657B2134FDBFF00981FE3 /* ocscontact.h */; name = "ocscontact.h: 3"; rLen = 0; rLoc = 6; rType = 0; vrLen = 198; vrLoc = 0; }; 068005F2151BCF55006F95F1 /* PBXTextBookmark */ = { isa = PBXTextBookmark; fRef = 29B97316FDCFA39411CA2CEA /* main.m */; name = "main.m: 43"; rLen = 0; rLoc = 1437; rType = 0; vrLen = 232; vrLoc = 1767; }; 068005F3151BCF55006F95F1 /* PBXTextBookmark */ = { isa = PBXTextBookmark; fRef = 0649FB3114D9E191001EC640 /* English */; name = "Localizable.strings: 10"; rLen = 0; rLoc = 308; rType = 0; vrLen = 210; vrLoc = 100; }; 068005F4151BCF55006F95F1 /* PlistBookmark */ = { isa = PlistBookmark; fRef = 8D1107310486CEB800E47090 /* Info.plist */; fallbackIsa = PBXBookmark; isK = 0; kPath = ( ); name = "/Users/ocs/work/ocs/dev/beta5/temp/tools/macosx/ocsng_app-xcode/Info.plist"; rLen = 0; rLoc = 9223372036854775808; }; 068005F5151BCF55006F95F1 /* PBXTextBookmark */ = { isa = PBXTextBookmark; fRef = 0649FB3514D9E1AA001EC640 /* French */; name = "Localizable.strings: 10"; rLen = 0; rLoc = 308; rType = 0; vrLen = 213; vrLoc = 97; }; 068D515613DC84ED00211FF5 /* PBXTextBookmark */ = { isa = PBXTextBookmark; fRef = 069BD7C713D8D205002A70BE /* AvailabilityMacros.h */; name = "AvailabilityMacros.h: 108"; rLen = 0; rLoc = 5131; rType = 0; vrLen = 450; vrLoc = 4962; }; 068D515813DC84ED00211FF5 /* PBXTextBookmark */ = { isa = PBXTextBookmark; fRef = 32CA4F630368D1EE00C91783 /* OCSNG_Prefix.pch */; name = "OCSNG_Prefix.pch: 1"; rLen = 0; rLoc = 0; rType = 0; vrLen = 106; vrLoc = 0; }; 069BD7C713D8D205002A70BE /* AvailabilityMacros.h */ = { isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = AvailabilityMacros.h; path = /Developer/SDKs/MacOSX10.6.sdk/usr/include/AvailabilityMacros.h; sourceTree = "<absolute>"; }; 06D65785134FD5B800981FE3 /* ocscontact-Info.plist */ = { uiCtxt = { sepNavWindowFrame = "{{15, 167}, {948, 706}}"; }; }; 06D657A6134FD97A00981FE3 /* ocscontact */ = { activeExec = 0; executables = ( 06D657A8134FD97A00981FE3 /* ocscontact */, ); }; 06D657A8134FD97A00981FE3 /* ocscontact */ = { isa = PBXExecutable; activeArgIndices = ( ); argumentStrings = ( ); autoAttachOnCrash = 1; breakpointsEnabled = 0; configStateDict = { }; customDataFormattersEnabled = 1; dataTipCustomDataFormattersEnabled = 1; dataTipShowTypeColumn = 1; dataTipSortType = 0; debuggerPlugin = GDBDebugging; disassemblyDisplayState = 0; dylibVariantSuffix = ""; enableDebugStr = 1; environmentEntries = ( ); executableSystemSymbolLevel = 0; executableUserSymbolLevel = 0; libgmallocEnabled = 0; name = ocscontact; savedGlobals = { }; showTypeColumn = 0; sourceDirectories = ( ); }; 06D657B2134FDBFF00981FE3 /* ocscontact.h */ = { uiCtxt = { sepNavIntBoundsRect = "{{0, 0}, {890, 662}}"; sepNavSelRange = "{308, 0}"; sepNavVisRange = "{0, 380}"; sepNavVisRect = "{{0, 0}, {910, 675}}"; sepNavWindowFrame = "{{15, 88}, {949, 790}}"; }; }; 06D657B3134FDBFF00981FE3 /* ocscontact.m */ = { uiCtxt = { sepNavIntBoundsRect = "{{0, 0}, {1103, 533}}"; sepNavSelRange = "{99, 0}"; sepNavVisRange = "{23, 199}"; sepNavVisRect = "{{0, 0}, {910, 675}}"; sepNavWindowFrame = "{{202, 90}, {949, 788}}"; }; }; 06D79C9013DC8D3500E6B017 /* PBXTextBookmark */ = { isa = PBXTextBookmark; fRef = 06D79C9113DC8D3500E6B017 /* NSAlert.h */; name = "NSAlert.h: 1"; rLen = 0; rLoc = 0; rType = 0; vrLen = 0; vrLoc = 0; }; 06D79C9113DC8D3500E6B017 /* NSAlert.h */ = { isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = NSAlert.h; path = /System/Library/Frameworks/AppKit.framework/Headers/NSAlert.h; sourceTree = "<absolute>"; }; 06F13D9C13DC92FC00509DAF /* PBXTextBookmark */ = { isa = PBXTextBookmark; fRef = EE2C4E5A0DF1CA5800171780 /* GetPID.h */; name = "GetPID.h: 1"; rLen = 0; rLoc = 0; rType = 0; vrLen = 461; vrLoc = 0; }; 089C165DFE840E0CC02AAC07 /* English */ = { uiCtxt = { sepNavIntBoundsRect = "{{0, 0}, {1171, 39}}"; sepNavSelRange = "{0, 0}"; sepNavVisRange = "{0, 0}"; sepNavVisRect = "{{0, 0}, {910, 675}}"; sepNavWindowFrame = "{{15, 90}, {949, 788}}"; }; }; 29B97313FDCFA39411CA2CEA /* Project object */ = { activeArchitecturePreference = i386; activeBuildConfigurationName = Release; activeExecutable = 061EA95B130259AB009A0BD6 /* OCSNG */; activeTarget = 8D1107260486CEB800E47090 /* OCSNG */; addToTargets = ( 8D1107260486CEB800E47090 /* OCSNG */, ); codeSenseManager = 061EA964130259CA009A0BD6 /* Code sense */; executables = ( 061EA95B130259AB009A0BD6 /* OCSNG */, 06D657A8134FD97A00981FE3 /* ocscontact */, ); perUserDictionary = { PBXConfiguration.PBXFileTableDataSource3.PBXBookmarksDataSource = { PBXFileTableDataSourceColumnSortingDirectionKey = "-1"; PBXFileTableDataSourceColumnSortingKey = PBXBookmarksDataSource_NameID; PBXFileTableDataSourceColumnWidthsKey = ( 200, 200, 802.58349609375, ); PBXFileTableDataSourceColumnsKey = ( PBXBookmarksDataSource_LocationID, PBXBookmarksDataSource_NameID, PBXBookmarksDataSource_CommentsID, ); }; PBXConfiguration.PBXFileTableDataSource3.PBXFileTableDataSource = { PBXFileTableDataSourceColumnSortingDirectionKey = "-1"; PBXFileTableDataSourceColumnSortingKey = PBXFileDataSource_Filename_ColumnID; PBXFileTableDataSourceColumnWidthsKey = ( 20, 925, 20, 48, 43, 43, 20, ); PBXFileTableDataSourceColumnsKey = ( PBXFileDataSource_FiletypeID, PBXFileDataSource_Filename_ColumnID, PBXFileDataSource_Built_ColumnID, PBXFileDataSource_ObjectSize_ColumnID, PBXFileDataSource_Errors_ColumnID, PBXFileDataSource_Warnings_ColumnID, PBXFileDataSource_Target_ColumnID, ); }; PBXConfiguration.PBXTargetDataSource.PBXTargetDataSource = { PBXFileTableDataSourceColumnSortingDirectionKey = "-1"; PBXFileTableDataSourceColumnSortingKey = PBXFileDataSource_Filename_ColumnID; PBXFileTableDataSourceColumnWidthsKey = ( 20, 885, 60, 20, 48, 43, 43, ); PBXFileTableDataSourceColumnsKey = ( PBXFileDataSource_FiletypeID, PBXFileDataSource_Filename_ColumnID, PBXTargetDataSource_PrimaryAttribute, PBXFileDataSource_Built_ColumnID, PBXFileDataSource_ObjectSize_ColumnID, PBXFileDataSource_Errors_ColumnID, PBXFileDataSource_Warnings_ColumnID, ); }; PBXPerProjectTemplateStateSaveDate = 354145162; PBXWorkspaceStateSaveDate = 354145162; }; perUserProjectItems = { 06128B57151BD393004BCDF5 /* PBXBookmark */ = 06128B57151BD393004BCDF5 /* PBXBookmark */; 06128B59151BD3BF004BCDF5 /* PBXTextBookmark */ = 06128B59151BD3BF004BCDF5 /* PBXTextBookmark */; 06128B5A151BD3BF004BCDF5 /* PBXTextBookmark */ = 06128B5A151BD3BF004BCDF5 /* PBXTextBookmark */; 06128B5F151BD3BF004BCDF5 /* PBXTextBookmark */ = 06128B5F151BD3BF004BCDF5 /* PBXTextBookmark */; 0649FB4714D9E57D001EC640 /* PBXTextBookmark */ = 0649FB4714D9E57D001EC640 /* PBXTextBookmark */; 06709F4613E09D94005F44AE /* PBXTextBookmark */ = 06709F4613E09D94005F44AE /* PBXTextBookmark */; 068005F2151BCF55006F95F1 /* PBXTextBookmark */ = 068005F2151BCF55006F95F1 /* PBXTextBookmark */; 068005F3151BCF55006F95F1 /* PBXTextBookmark */ = 068005F3151BCF55006F95F1 /* PBXTextBookmark */; 068005F4151BCF55006F95F1 /* PlistBookmark */ = 068005F4151BCF55006F95F1 /* PlistBookmark */; 068005F5151BCF55006F95F1 /* PBXTextBookmark */ = 068005F5151BCF55006F95F1 /* PBXTextBookmark */; 068D515613DC84ED00211FF5 /* PBXTextBookmark */ = 068D515613DC84ED00211FF5 /* PBXTextBookmark */; 068D515813DC84ED00211FF5 /* PBXTextBookmark */ = 068D515813DC84ED00211FF5 /* PBXTextBookmark */; 06D79C9013DC8D3500E6B017 /* PBXTextBookmark */ = 06D79C9013DC8D3500E6B017 /* PBXTextBookmark */; 06F13D9C13DC92FC00509DAF /* PBXTextBookmark */ = 06F13D9C13DC92FC00509DAF /* PBXTextBookmark */; }; sourceControlManager = 061EA963130259CA009A0BD6 /* Source Control */; userBuildSettings = { OBJROOT = "/Users/ocs/work/ocs/dev/ocsng_app-xcode/build"; SYMROOT = "/Users/ocs/work/ocs/dev/ocsng_app-xcode/build"; }; }; 29B97316FDCFA39411CA2CEA /* main.m */ = { uiCtxt = { sepNavIntBoundsRect = "{{0, 0}, {1103, 1677}}"; sepNavSelRange = "{1437, 0}"; sepNavVisRange = "{1767, 232}"; sepNavVisRect = "{{0, 1107}, {909, 577}}"; sepNavWindowFrame = "{{227, 127}, {948, 706}}"; }; }; 32CA4F630368D1EE00C91783 /* OCSNG_Prefix.pch */ = { uiCtxt = { sepNavIntBoundsRect = "{{0, 0}, {1171, 104}}"; sepNavSelRange = "{0, 0}"; sepNavVisRange = "{0, 106}"; sepNavVisRect = "{{0, 0}, {910, 577}}"; sepNavWindowFrame = "{{61, 125}, {949, 706}}"; }; }; 8D1107260486CEB800E47090 /* OCSNG */ = { activeExec = 0; executables = ( 061EA95B130259AB009A0BD6 /* OCSNG */, ); }; 8D1107310486CEB800E47090 /* Info.plist */ = { uiCtxt = { sepNavIntBoundsRect = "{{0, 0}, {910, 675}}"; sepNavSelRange = "{358, 0}"; sepNavVisRect = "{{0, 0}, {910, 675}}"; sepNavWindowFrame = "{{243, 90}, {949, 788}}"; }; }; EE2C4E590DF1CA5800171780 /* GetPID.c */ = { uiCtxt = { sepNavIntBoundsRect = "{{0, 0}, {1171, 5174}}"; sepNavSelRange = "{0, 0}"; sepNavVisRange = "{870, 577}"; }; }; EE2C4E5A0DF1CA5800171780 /* GetPID.h */ = { uiCtxt = { sepNavIntBoundsRect = "{{0, 0}, {890, 2132}}"; sepNavSelRange = "{0, 0}"; sepNavVisRange = "{0, 2676}"; sepNavVisRect = "{{0, 0}, {910, 577}}"; sepNavWindowFrame = "{{38, 146}, {949, 706}}"; }; }; } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������UnixAgent-2.4.2/tools/macosx/ocsng_app-xcode/OCSNG.xcodeproj/project.pbxproj������������������������0000664�0000000�0000000�00000050642�13327377321�0027064�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// !$*UTF8*$! { archiveVersion = 1; classes = { }; objectVersion = 44; objects = { /* Begin PBXBuildFile section */ 0625C76F13CAC89000D6EB7C /* ocs_logo.icns in Resources */ = {isa = PBXBuildFile; fileRef = 0625C76E13CAC89000D6EB7C /* ocs_logo.icns */; }; 0649FB3414D9E198001EC640 /* Localizable.strings in Resources */ = {isa = PBXBuildFile; fileRef = 0649FB3314D9E198001EC640 /* Localizable.strings */; }; 06C39B371394ADB20047198A /* CoreData.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 06C39B361394ADB20047198A /* CoreData.framework */; }; 06C39B381394ADB20047198A /* CoreData.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 06C39B361394ADB20047198A /* CoreData.framework */; }; 06C39B3A1394ADDF0047198A /* AppKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 06C39B391394ADDF0047198A /* AppKit.framework */; }; 06C39B3B1394ADDF0047198A /* AppKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 06C39B391394ADDF0047198A /* AppKit.framework */; }; 06C39BCE1394B5600047198A /* Security.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 06C39BCD1394B5600047198A /* Security.framework */; }; 06C39BCF1394B5600047198A /* Security.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 06C39BCD1394B5600047198A /* Security.framework */; }; 06D657B4134FDBFF00981FE3 /* ocscontact.m in Sources */ = {isa = PBXBuildFile; fileRef = 06D657B3134FDBFF00981FE3 /* ocscontact.m */; }; 0B6A94131F83D4E600D02E57 /* THANKS in Resources */ = {isa = PBXBuildFile; fileRef = 0B6A940E1F83D4E500D02E57 /* THANKS */; }; 0B6A94141F83D4E600D02E57 /* LICENSE in Resources */ = {isa = PBXBuildFile; fileRef = 0B6A940F1F83D4E600D02E57 /* LICENSE */; }; 0B6A94151F83D4E600D02E57 /* Changes in Resources */ = {isa = PBXBuildFile; fileRef = 0B6A94101F83D4E600D02E57 /* Changes */; }; 0B6A94161F83D4E600D02E57 /* ocsinventory-agent in Resources */ = {isa = PBXBuildFile; fileRef = 0B6A94111F83D4E600D02E57 /* ocsinventory-agent */; }; 0B6A94171F83D4E600D02E57 /* AUTHORS in Resources */ = {isa = PBXBuildFile; fileRef = 0B6A94121F83D4E600D02E57 /* AUTHORS */; }; 0B6A943E1F83DB3F00D02E57 /* uninstaller.sh in Resources */ = {isa = PBXBuildFile; fileRef = 0B6A943D1F83DB3F00D02E57 /* uninstaller.sh */; }; 8D11072B0486CEB800E47090 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 089C165CFE840E0CC02AAC07 /* InfoPlist.strings */; }; 8D11072D0486CEB800E47090 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 29B97316FDCFA39411CA2CEA /* main.m */; settings = {ATTRIBUTES = (); }; }; 8D11072F0486CEB800E47090 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */; }; EE2C4E5B0DF1CA5800171780 /* GetPID.c in Sources */ = {isa = PBXBuildFile; fileRef = EE2C4E590DF1CA5800171780 /* GetPID.c */; }; /* End PBXBuildFile section */ /* Begin PBXFileReference section */ 0625C76E13CAC89000D6EB7C /* ocs_logo.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; name = ocs_logo.icns; path = icons/ocs_logo.icns; sourceTree = "<group>"; }; 0649FB3114D9E191001EC640 /* English */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.strings; name = English; path = English.lproj/Localizable.strings; sourceTree = "<group>"; }; 0649FB3514D9E1AA001EC640 /* French */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = French; path = French.lproj/Localizable.strings; sourceTree = "<group>"; }; 06C39B361394ADB20047198A /* CoreData.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreData.framework; path = /System/Library/Frameworks/CoreData.framework; sourceTree = "<absolute>"; }; 06C39B391394ADDF0047198A /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = /System/Library/Frameworks/AppKit.framework; sourceTree = "<absolute>"; }; 06C39BCD1394B5600047198A /* Security.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Security.framework; path = /System/Library/Frameworks/Security.framework; sourceTree = "<absolute>"; }; 06D65785134FD5B800981FE3 /* ocscontact-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "ocscontact-Info.plist"; sourceTree = "<group>"; }; 06D657A7134FD97A00981FE3 /* ocscontact */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = ocscontact; sourceTree = BUILT_PRODUCTS_DIR; }; 06D657B2134FDBFF00981FE3 /* ocscontact.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ocscontact.h; sourceTree = "<group>"; }; 06D657B3134FDBFF00981FE3 /* ocscontact.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ocscontact.m; sourceTree = "<group>"; }; 089C165DFE840E0CC02AAC07 /* English */ = {isa = PBXFileReference; fileEncoding = 10; lastKnownFileType = text.plist.strings; name = English; path = English.lproj/InfoPlist.strings; sourceTree = "<group>"; }; 0B6A940E1F83D4E500D02E57 /* THANKS */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = THANKS; path = ../../../THANKS; sourceTree = "<group>"; }; 0B6A940F1F83D4E600D02E57 /* LICENSE */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = LICENSE; path = ../../../LICENSE; sourceTree = "<group>"; }; 0B6A94101F83D4E600D02E57 /* Changes */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = Changes; path = ../../../Changes; sourceTree = "<group>"; }; 0B6A94111F83D4E600D02E57 /* ocsinventory-agent */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.perl; name = "ocsinventory-agent"; path = "../../../ocsinventory-agent"; sourceTree = "<group>"; }; 0B6A94121F83D4E600D02E57 /* AUTHORS */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = AUTHORS; path = ../../../AUTHORS; sourceTree = "<group>"; }; 0B6A943D1F83DB3F00D02E57 /* uninstaller.sh */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; name = uninstaller.sh; path = ../scripts/uninstaller.sh; sourceTree = "<group>"; }; 1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = /System/Library/Frameworks/Cocoa.framework; sourceTree = "<absolute>"; }; 29B97316FDCFA39411CA2CEA /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; }; 29B97325FDCFA39411CA2CEA /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = /System/Library/Frameworks/Foundation.framework; sourceTree = "<absolute>"; }; 32CA4F630368D1EE00C91783 /* OCSNG_Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OCSNG_Prefix.pch; sourceTree = "<group>"; }; 8D1107310486CEB800E47090 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; }; 8D1107320486CEB800E47090 /* OCSNG.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = OCSNG.app; sourceTree = BUILT_PRODUCTS_DIR; }; EE2C4E590DF1CA5800171780 /* GetPID.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = GetPID.c; sourceTree = "<group>"; }; EE2C4E5A0DF1CA5800171780 /* GetPID.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GetPID.h; sourceTree = "<group>"; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ 06D657A5134FD97A00981FE3 /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( 06C39B371394ADB20047198A /* CoreData.framework in Frameworks */, 06C39B3A1394ADDF0047198A /* AppKit.framework in Frameworks */, 06C39BCE1394B5600047198A /* Security.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; 8D11072E0486CEB800E47090 /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( 8D11072F0486CEB800E47090 /* Cocoa.framework in Frameworks */, 06C39B381394ADB20047198A /* CoreData.framework in Frameworks */, 06C39B3B1394ADDF0047198A /* AppKit.framework in Frameworks */, 06C39BCF1394B5600047198A /* Security.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ 080E96DDFE201D6D7F000001 /* Classes */ = { isa = PBXGroup; children = ( 29B97316FDCFA39411CA2CEA /* main.m */, ); name = Classes; sourceTree = "<group>"; }; 1058C7A0FEA54F0111CA2CBB /* Linked Frameworks */ = { isa = PBXGroup; children = ( 1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */, ); name = "Linked Frameworks"; sourceTree = "<group>"; }; 1058C7A2FEA54F0111CA2CBB /* Other Frameworks */ = { isa = PBXGroup; children = ( 06C39BCD1394B5600047198A /* Security.framework */, 06C39B391394ADDF0047198A /* AppKit.framework */, 06C39B361394ADB20047198A /* CoreData.framework */, 29B97325FDCFA39411CA2CEA /* Foundation.framework */, ); name = "Other Frameworks"; sourceTree = "<group>"; }; 19C28FACFE9D520D11CA2CBB /* Products */ = { isa = PBXGroup; children = ( 8D1107320486CEB800E47090 /* OCSNG.app */, 06D657A7134FD97A00981FE3 /* ocscontact */, ); name = Products; sourceTree = "<group>"; }; 29B97314FDCFA39411CA2CEA /* OCSNG */ = { isa = PBXGroup; children = ( 080E96DDFE201D6D7F000001 /* Classes */, 29B97315FDCFA39411CA2CEA /* Other Sources */, 29B97317FDCFA39411CA2CEA /* Resources */, 29B97323FDCFA39411CA2CEA /* Frameworks */, 19C28FACFE9D520D11CA2CBB /* Products */, 06D65785134FD5B800981FE3 /* ocscontact-Info.plist */, ); name = OCSNG; sourceTree = "<group>"; }; 29B97315FDCFA39411CA2CEA /* Other Sources */ = { isa = PBXGroup; children = ( 06D657B2134FDBFF00981FE3 /* ocscontact.h */, 06D657B3134FDBFF00981FE3 /* ocscontact.m */, EE2C4E590DF1CA5800171780 /* GetPID.c */, EE2C4E5A0DF1CA5800171780 /* GetPID.h */, 32CA4F630368D1EE00C91783 /* OCSNG_Prefix.pch */, ); name = "Other Sources"; sourceTree = "<group>"; }; 29B97317FDCFA39411CA2CEA /* Resources */ = { isa = PBXGroup; children = ( 0B6A943D1F83DB3F00D02E57 /* uninstaller.sh */, 0B6A94121F83D4E600D02E57 /* AUTHORS */, 0B6A94101F83D4E600D02E57 /* Changes */, 0B6A940F1F83D4E600D02E57 /* LICENSE */, 0B6A94111F83D4E600D02E57 /* ocsinventory-agent */, 0B6A940E1F83D4E500D02E57 /* THANKS */, 0625C76E13CAC89000D6EB7C /* ocs_logo.icns */, 8D1107310486CEB800E47090 /* Info.plist */, 089C165CFE840E0CC02AAC07 /* InfoPlist.strings */, 0649FB3314D9E198001EC640 /* Localizable.strings */, ); name = Resources; sourceTree = "<group>"; }; 29B97323FDCFA39411CA2CEA /* Frameworks */ = { isa = PBXGroup; children = ( 1058C7A0FEA54F0111CA2CBB /* Linked Frameworks */, 1058C7A2FEA54F0111CA2CBB /* Other Frameworks */, ); name = Frameworks; sourceTree = "<group>"; }; /* End PBXGroup section */ /* Begin PBXNativeTarget section */ 06D657A6134FD97A00981FE3 /* ocscontact */ = { isa = PBXNativeTarget; buildConfigurationList = 06D657A9134FD99800981FE3 /* Build configuration list for PBXNativeTarget "ocscontact" */; buildPhases = ( 06D657A4134FD97A00981FE3 /* Sources */, 06D657A5134FD97A00981FE3 /* Frameworks */, ); buildRules = ( ); dependencies = ( ); name = ocscontact; productName = ocscontact; productReference = 06D657A7134FD97A00981FE3 /* ocscontact */; productType = "com.apple.product-type.tool"; }; 8D1107260486CEB800E47090 /* OCSNG */ = { isa = PBXNativeTarget; buildConfigurationList = C01FCF4A08A954540054247B /* Build configuration list for PBXNativeTarget "OCSNG" */; buildPhases = ( 8D1107290486CEB800E47090 /* Resources */, 8D11072C0486CEB800E47090 /* Sources */, 8D11072E0486CEB800E47090 /* Frameworks */, ); buildRules = ( ); dependencies = ( ); name = OCSNG; productInstallPath = "$(HOME)/Applications"; productName = OCSNG; productReference = 8D1107320486CEB800E47090 /* OCSNG.app */; productType = "com.apple.product-type.application"; }; /* End PBXNativeTarget section */ /* Begin PBXProject section */ 29B97313FDCFA39411CA2CEA /* Project object */ = { isa = PBXProject; attributes = { LastUpgradeCheck = 0900; }; buildConfigurationList = C01FCF4E08A954540054247B /* Build configuration list for PBXProject "OCSNG" */; compatibilityVersion = "Xcode 3.0"; developmentRegion = English; hasScannedForEncodings = 1; knownRegions = ( English, Japanese, French, German, ); mainGroup = 29B97314FDCFA39411CA2CEA /* OCSNG */; projectDirPath = ""; projectRoot = ""; targets = ( 8D1107260486CEB800E47090 /* OCSNG */, 06D657A6134FD97A00981FE3 /* ocscontact */, ); }; /* End PBXProject section */ /* Begin PBXResourcesBuildPhase section */ 8D1107290486CEB800E47090 /* Resources */ = { isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( 0B6A94151F83D4E600D02E57 /* Changes in Resources */, 8D11072B0486CEB800E47090 /* InfoPlist.strings in Resources */, 0625C76F13CAC89000D6EB7C /* ocs_logo.icns in Resources */, 0B6A94161F83D4E600D02E57 /* ocsinventory-agent in Resources */, 0649FB3414D9E198001EC640 /* Localizable.strings in Resources */, 0B6A94171F83D4E600D02E57 /* AUTHORS in Resources */, 0B6A943E1F83DB3F00D02E57 /* uninstaller.sh in Resources */, 0B6A94131F83D4E600D02E57 /* THANKS in Resources */, 0B6A94141F83D4E600D02E57 /* LICENSE in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXResourcesBuildPhase section */ /* Begin PBXSourcesBuildPhase section */ 06D657A4134FD97A00981FE3 /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( 06D657B4134FDBFF00981FE3 /* ocscontact.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; 8D11072C0486CEB800E47090 /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( 8D11072D0486CEB800E47090 /* main.m in Sources */, EE2C4E5B0DF1CA5800171780 /* GetPID.c in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXSourcesBuildPhase section */ /* Begin PBXVariantGroup section */ 0649FB3314D9E198001EC640 /* Localizable.strings */ = { isa = PBXVariantGroup; children = ( 0649FB3114D9E191001EC640 /* English */, 0649FB3514D9E1AA001EC640 /* French */, ); name = Localizable.strings; sourceTree = "<group>"; }; 089C165CFE840E0CC02AAC07 /* InfoPlist.strings */ = { isa = PBXVariantGroup; children = ( 089C165DFE840E0CC02AAC07 /* English */, ); name = InfoPlist.strings; sourceTree = "<group>"; }; /* End PBXVariantGroup section */ /* Begin XCBuildConfiguration section */ 06D657AA134FD99800981FE3 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { COPY_PHASE_STRIP = NO; GCC_DYNAMIC_NO_PIC = NO; GCC_ENABLE_FIX_AND_CONTINUE = YES; GCC_GENERATE_DEBUGGING_SYMBOLS = YES; GCC_MODEL_TUNING = G5; GCC_OPTIMIZATION_LEVEL = 0; GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = "$(SYSTEM_LIBRARY_DIR)/Frameworks/AppKit.framework/Headers/AppKit.h"; GCC_VERSION = com.apple.compilers.llvm.clang.1_0; INSTALL_PATH = "$(HOME)/bin"; OBJROOT = build; OTHER_LDFLAGS = ( "-framework", Foundation, "-framework", AppKit, ); PREBINDING = NO; PRODUCT_NAME = ocscontact; SYMROOT = build; ZERO_LINK = NO; }; name = Debug; }; 06D657AB134FD99800981FE3 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { COPY_PHASE_STRIP = YES; GCC_ENABLE_FIX_AND_CONTINUE = NO; GCC_GENERATE_DEBUGGING_SYMBOLS = NO; GCC_MODEL_TUNING = G5; GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = "$(SYSTEM_LIBRARY_DIR)/Frameworks/AppKit.framework/Headers/AppKit.h"; GCC_VERSION = com.apple.compilers.llvm.clang.1_0; INSTALL_PATH = /Applications; OBJROOT = build; OTHER_LDFLAGS = ( "-framework", Foundation, "-framework", AppKit, ); PREBINDING = NO; PRODUCT_NAME = ocscontact; SDKROOT = "$(DEVELOPER_SDK_DIR)/MacOSX10.11.sdk"; SKIP_INSTALL = YES; SYMROOT = build; ZERO_LINK = NO; }; name = Release; }; C01FCF4B08A954540054247B /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { ADDITIONAL_SDKS = ""; COPY_PHASE_STRIP = NO; GCC_DYNAMIC_NO_PIC = NO; GCC_ENABLE_FIX_AND_CONTINUE = YES; GCC_MODEL_TUNING = G5; GCC_OPTIMIZATION_LEVEL = 0; GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = OCSNG_Prefix.pch; GCC_VERSION = com.apple.compilers.llvm.clang.1_0; INFOPLIST_FILE = Info.plist; INSTALL_PATH = "$(HOME)/Applications"; OBJROOT = build; PRODUCT_BUNDLE_IDENTIFIER = org.ocsng.agent; PRODUCT_NAME = OCSNG; SDKROOT = "$(DEVELOPER_SDK_DIR)/MacOSX10.11.sdk"; SYMROOT = build; VALID_ARCHS = "x86_64 i386"; WRAPPER_EXTENSION = app; ZERO_LINK = ""; }; name = Debug; }; C01FCF4C08A954540054247B /* Release */ = { isa = XCBuildConfiguration; buildSettings = { DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; GCC_MODEL_TUNING = G5; GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = OCSNG_Prefix.pch; GCC_VERSION = com.apple.compilers.llvm.clang.1_0; INFOPLIST_FILE = Info.plist; OBJROOT = build; PRODUCT_BUNDLE_IDENTIFIER = org.ocsng.agent; PRODUCT_NAME = OCSNG; SDKROOT = "$(DEVELOPER_SDK_DIR)/MacOSX10.11.sdk"; SYMROOT = build; VALID_ARCHS = "x86_64 i386"; WRAPPER_EXTENSION = app; ZERO_LINK = ""; }; name = Release; }; C01FCF4F08A954540054247B /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; ENABLE_TESTABILITY = YES; GCC_VERSION = ""; GCC_WARN_ABOUT_RETURN_TYPE = YES; GCC_WARN_UNUSED_VARIABLE = YES; INSTALL_GROUP = $USER; INSTALL_MODE_FLAG = "a-rwx,u+rwx,g+rwx"; INSTALL_OWNER = $GROUP; MACOSX_DEPLOYMENT_TARGET = 10.11; ONLY_ACTIVE_ARCH = YES; PREBINDING = NO; SDKROOT = "$(DEVELOPER_SDK_DIR)/MacOSX10.11.sdk"; VALID_ARCHS = "i386 x86_64"; }; name = Debug; }; C01FCF5008A954540054247B /* Release */ = { isa = XCBuildConfiguration; buildSettings = { CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; DEPLOYMENT_LOCATION = YES; DSTROOT = "/tmp/$(PROJECT_NAME).dst"; FRAMEWORK_SEARCH_PATHS = ""; GCC_GENERATE_DEBUGGING_SYMBOLS = YES; GCC_VERSION = ""; GCC_WARN_ABOUT_RETURN_TYPE = YES; GCC_WARN_UNUSED_VARIABLE = YES; HEADER_SEARCH_PATHS = ""; INSTALL_GROUP = _ocsng; INSTALL_MODE_FLAG = "a-w,ug+rx,o-rwx"; INSTALL_OWNER = _ocsng; INSTALL_PATH = /Applications; LD_MAP_FILE_PATH = "$(TARGET_TEMP_DIR)/$(PRODUCT_NAME)-LinkMap-$(CURRENT_VARIANT)-$(CURRENT_ARCH).txt"; MACOSX_DEPLOYMENT_TARGET = 10.11; "MACOSX_DEPLOYMENT_TARGET[arch=x86_64]" = 10.11; PREBINDING = NO; SDKROOT = "$(DEVELOPER_SDK_DIR)/MacOSX10.11.sdk"; }; name = Release; }; /* End XCBuildConfiguration section */ /* Begin XCConfigurationList section */ 06D657A9134FD99800981FE3 /* Build configuration list for PBXNativeTarget "ocscontact" */ = { isa = XCConfigurationList; buildConfigurations = ( 06D657AA134FD99800981FE3 /* Debug */, 06D657AB134FD99800981FE3 /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; C01FCF4A08A954540054247B /* Build configuration list for PBXNativeTarget "OCSNG" */ = { isa = XCConfigurationList; buildConfigurations = ( C01FCF4B08A954540054247B /* Debug */, C01FCF4C08A954540054247B /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; C01FCF4E08A954540054247B /* Build configuration list for PBXProject "OCSNG" */ = { isa = XCConfigurationList; buildConfigurations = ( C01FCF4F08A954540054247B /* Debug */, C01FCF5008A954540054247B /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; /* End XCConfigurationList section */ }; rootObject = 29B97313FDCFA39411CA2CEA /* Project object */; } ����������������������������������������������������������������������������������������������UnixAgent-2.4.2/tools/macosx/ocsng_app-xcode/OCSNG_Prefix.pch���������������������������������������0000664�0000000�0000000�00000000215�13327377321�0024014�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// // Prefix header for all source files of the 'OCSNG' target in the 'OCSNG' project // #ifdef __OBJC__ #import <Cocoa/Cocoa.h> #endif �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������UnixAgent-2.4.2/tools/macosx/ocsng_app-xcode/icons/�������������������������������������������������0000775�0000000�0000000�00000000000�13327377321�0022247�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������UnixAgent-2.4.2/tools/macosx/ocsng_app-xcode/icons/ocs_logo.icns������������������������������������0000664�0000000�0000000�00000024626�13327377321�0024743�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������icns��)TOC ���ic08��)~ic08��)~PNG  ��� IHDR���������\rf���sRGB���)0IDATx} x]ywfYeyWٲ-K^11IhI6 ihJBP~~p44 PU˛,aٖe--־/wkdՕts}ys37yϜov0~6O#d,Q&O,] ¿baG5|TQGǶ?}l �I||C@$ `aL 69pC90! x^#�QDtFQ o7"2|D $�Ln<?ßd[WE%@` ̠}Dd^!%vl2mDnFRnj> 1,d>0$ 0Ev@m?\[.Jq�䥹e`΂[[, w?yK%3�$ �܌�A !NjyF kJ&�KYX,\ \BK=3y60-])6rIl@]Gy&0W)�~ٿ$ �gLn*O�xpE!xg^!|뿓gՓcR0GfyY2j<�C@T`L .;Lw'dPFY j$p&jo ~WE9 ]nkg.�p1Ocϻڀ%F^'vB?mx»��>Ed>>d60arJ�<x;��FA@^ӟ`"�_|w1Qy �(=$ ʤ|a W�$ �̆ SV�<g�Ff c<Q%.,{\vC>0vv;CW\]w{2�0bk;y;�LnBR �"`TG26KL+< �L@�\C�\ o&^o&Ch �F# 3q;t]~2G_@�XY5cX*X 4'˹9~�F>@�X it�g/L}G@ZxHh4ku8Z" @z  `u"ld�_[ _K�% :�XKH d �#gxw,~B �FbT ̑�@)n#Q J�Xh��kf(=�0 �,]{K *H@�vژwC@ ȶ�h#�c�??!�F[@�c�O O�V 0@ �mA�0�zmc�??!�F[@�c�O O�Ƕ? ?~!Mq)vAŤPph ٩J7k&jn^?AX?D3WϢ7gQ$ ֚WC<C] ľ,�&3ѲWRZ~:NҀ�G?/`ע9�ߜJm Q Zm-E&F:-:Ck^G3QUQ;OOt{̸qRDN/֋}hĄRS[JƉn?VߓO3G(@�3�c[.rn' }N. (+NW3J+N dL ;MO䄕3)WTiTvz[z( $bgPuuGü@g?YBC}Czb d�Laz,umd=@Gx~[Ikz*YAk_OIg�/,y1 Y�` GQ-lL|{/qEhw󣳯. Kf-kÜ�oԡ -;'V ݵ2O ScFg_]t Vܾ2?|0 �&qpLt3%,LP`w!}ZYFD_k^jl;/iB8ax@�FRM4kE\1?H'Ur \n'@,ݻSep�?㤳QOWSz^rjB]V*|r_h'##$g"nlėu`bOzU|W~)\?DO/??:ꖭT~ܥWFBaqQ<Z9 �wxÞ.@ngKjs"UDG jF|m ELEP\ n7}ܲ޺]V_XGG^(W8߰J_,b�{ Ș@hxmM ϸq.ܱƩIzjjߩ/@*@¢DxGn `{ʦtu$ntJ9@:UEܒ/U?Ee zIH uuz Tˬw-�\x P?M[k[Q}S^*_/~]A۠Jh a;"QG�yTCp:y+281;H?96d&/hr3O;qnlJR޹ ).)x@׀pnOflWlU.%edsxw-�;8\KdZ=~_WXF;>4ȓ݆ |I}k`m+h*C2 �GM/qLT_wt;K)F/JVSL>P|/Pש3$.nQTY~G3D7:s Ϫ"d!3!M,�L/ri eŽ';;NBٹS"n~�)4w[rd~maMjLԒRD|F[6cֻyA�\]8\|[6-"q}t"͉K7aTnW@tr4/tn3|()@�>[{-wbPz, p^*@Y?A<R\f="a< �oSGGPgs2THCnt5TwB3yc-�|׻ �`ub.o>L_42ki:$AGU)eUʰ@T=�:i] J3v.K *ESuiWQ�2xko;?iN^IELVI'^:BPIC8M%[NU0Z;@�^ h]GaaJ_~t=l%SK4s;(*CyK2읎Z@�^:2=?|͊T^*Q@M^U R鳅TwVIhѧҢ[AQK]0a0͚,zPsaq|z~:R¾ .iPı xhdzep}�܇;Ind:H}q5s,+z@T#8<VJa݄�M@M`D=sR~#/ݩi[wb 4W91xk y8ͧu/{rة'xe[UʬڕYHt({�AG<a �7k ъ/6Qؾk;t;ؽ&*q:kSHБFT5XlܓN{I{N.V;s*4aБGB~]�~$c qTU_TG_&Vud}xY4H@_ǻ)a}�܁%+`;.6r(k־}PtDڕ4jHl)iDA�)9x$Wtem;T=_ :»!΂H֦CjV#NoV#4JTji/ՂvNNtD#CV+�L? !TRJM]TmqZN7:JX:Y^o E`"z1fP>~ J_>r7;Tr=PsJqYW(o!SS 7"S9x{iUgB6i,R뽫E>@ǰ@a5~b<VҼtd$|HCp1DI60etR= #p%0L!o*uν;gMw@pD #"fk)cBM98jwE1Wn}xAUo H9IeF�Ww7W?Me~:jh#Ro[d7fݿmwLбvVr~KTw=4d.=͘6R]4'ƌM �gxeeJ~s}dK38qE*^(ɪCtD|U(Y}JeBb^flNZ*AGd??_6Qh\g1A�L1Q.W6iż;7|?#/l%!8 4gֆT-}Rs-t}}KUD߶N_-5 н(0vzJ ǫ:7S!ks5~z ct :[zITlɤ_ZCt-@d3hC)<>\Tu)ˣW_! Cy]:<$їBZ]�`9;mLQQ>q[UA7VHA`'a/Kj:AK]%I^P~ :ߋZzzE}[Bp"-l#W1{Ђwl=?OGyŹP1ޗn*qOëצ/Zx-D~M�߿1UOLJw렒gЕ3NDrБ{8H>-H,UwqϦLw8%;W=S: :RAGBch=/-KOFZ AyEx /-UOҠPdWNpБgAGD|1#~G�'O/0Ԫifܳ} 39ݚ^TVEϒ[(2M͜wMj"�a~KQT|02M/4#E!U)nnpU+6?m*^tJ:@MԳet][ �& !  *gAG*f7 AG'_gwQ6JD�vֵ  y9 ݀4/(? v؅~T=$GHE@"0UuF2,OKo#dFggg7Q$CO!Ud}x0 dwh-)ӼSĻFVN%Hmewl?OCJ`c?ض R73%aˎ @@=Yc߼ET\5{?v5.5Ul 2>8ײXۂYϛ@%LVv8(Ape):mV%8LM閄R +ɣ|ug?q:Z%;M=gRNB\3KYƬ',C�bb8*_?J*Q;k۩]uEQvDJ +>C 9fK.ܮZi�z0<qv[{nW CHmK9C[%�8xǢO.! dſN#+H@@K؂^eLz sB1&jwZ+((T Ǹc.vA Q=@=t/^1($$0Ha zELgj+?$<*]>DE) YA"o<C|X~LH`V,ʽ=Qǎ.0-M5_s|6+`0nԯNRtDyך(CK ִq☒�YO|9wPO[(tdL{2:lA@[¿^2 Z|wh�OyJ;H LqW:AGd Y/^FN>t|&eliC/QcIG`],:'C11:�~d>*޹9xǞ(t6@_K/>AG?TdQ0mmEЯ)iOQx,wL AGJOdk@ $9?qrk2dž({HTqd xtR� Dω;e<}lEtKU% @LC}G= ] IӈurЖ~rT e9F&FѬj+@z27r Ƒ^ܔ56eg'k?Wk;Zf>ևvqⒺ)Ry=63bt_|(jyt_P)/ SP5Ӝp^>s\BVqscއ%\Yj57'ER-)C)<֜굲exTpܟ@"�NlILZLKfRg4@))\I5'OZjT{r5ڧ+/щWh `=ydV_W6~a?^\ͳBvau--tWnr#�AWk[žf$Z)bZ2'&+?jx SPwPzn/h@ 68qbelA>[(8K ⵐTEui sh߯]~#,D_<@Uo}uz6'Kdյ{)<9#hցA>L2͏MIR(vNZ|[6ԗ"{ny P=j6ᶮT=;@,SN8Fp,cjv9EYYՔ(QdঅTk*&䥟]A (Tl[A;[uva\poOE(Gv6)e\:[SФ)4Q z-`ϼC/ )= A��k:Ew4Ǥz2(WR$6X5eܐIb[/ut'RF<�PCVA)kVUMu/2If`D{Й rrTH^E�Uyb�Y/XaqLfګw;b[Ux<ֻ}Ca=IHr?=XWbf(7 #y ռ+lf?#EOy"gEmPs\M΃�<ZfSF j)(R Q(M^jGZUԦ!]T8E�F�`E뀀S@�NI `m@�_8E�F�`E뀀S@�NI `m@�_8E�ϝ?$ k@�> +|�|�SՈd_   �J1�_   �J1�_   �J1�_   �J1�_   �J1�_   �J1�_   �J1�_   �<S݅<pGnF�f@]]_WnQ[`�Gս$!Q "8.0^x t_{δ+@�+Pd[tfmdy u%2c(f ]I{G2=�=yEE3c($*DW6o=L#�<ƺ5V7SGCa5D3 2ܔE6 `!@�>>W[ 2h\S@XZ(8\QB;52�;8R*ԩ{.w}r mx| 'E1l&?g8>̍9S-{ 7l,&XctԶQoߣϯ֝">fLw|A׵� )qYe~x>%,L 7[jZwj? q Li� =/" {{3e"=c/RwV@�>>:b1EH͈UJ#Khڡ,dCCtǩa X0@m'ib1kǩrc6A�˴kzNUO[{1U ?Lvj`jy* x|x-HP{D�T Oҕ&!T[N̅p2]CsnGgS *RwK75U\?Kh@v. �p]qȞ#tL�3(nI͘Gn<2I,ڨejlΆq�o4{6^f@a!�!.$s!�0Wib݄fP74(P X{m."�p(VD�`^E�\ ŀ�XW& " �B1 `E@�VU �EP X{m."�p(VD�`^E8(`miF�lf6 @�٨CJj`jB@O/-Wï�6:' G3�̨dYW �8hm_:6 ɤ�lTΑg o;~6G^g� G+~� xP'�Es�G&>�,Ѻu:|+"`JW;6�vP>�ѭJ� konUδn';vF#@:qSne#[%O]C�|R,~̋@@ 5ߌm50rE; @|~ հRk!$@@wn]< �L�^Ժ0R9(A< `*ciw$%/Ua A{Xo]KI�| |vh!p&vVFI�#zmAg(0DGAT)C<a2^ � d}N+_vJ�Rj[}-6~ʌ|\cyB y&Pw1N@# `~ƒ<c%~`idzKx<F]&�m=U>f� � .ǩU\&�ȴB0paD@|IfUM�\I+cM`<p|j*4H%2`!Yl P۩Uʓ_3mcyiKlFb Nv�8;1u)iԼ3{G,[ɺ]|H�E_i]w<f~6&cJr/$ �G@x\ML6pD 3;YmvJɑ�*bgW?ֹn'�G32G"0H@`BxݾymeiMx1<F�zFvngfO mB(O �;}cc}88f"7q+s#d $  ?ǯyп΃[x�F7 '9[y#yEkdeɓY9;�z5�F@}:9|,#L>R YK!"#3!bG U|e<|ݹc����IENDB`����������������������������������������������������������������������������������������������������������UnixAgent-2.4.2/tools/macosx/ocsng_app-xcode/main.m�������������������������������������������������0000664�0000000�0000000�00000007712�13327377321�0022245�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// // OCSINVENTORY-NG // // Copyleft Wes Young (claimid.com/saxjazman9 - Barely3am.com) 2008 // // // This code is open source and may be copied and modified as long as the source // code is always made freely available. // Please refer to the General Public Licence http://www.gnu.org/ // // #import <Cocoa/Cocoa.h> #include <Security/Authorization.h> #include <Security/AuthorizationTags.h> int main(int argc, char *argv[]) { NSAutoreleasePool *autoreleasepool = [[NSAutoreleasePool alloc] init]; [NSApplication sharedApplication]; int launchOcsAgent = 1; //Getting current user NSString *user = NSUserName() ; if (![user isEqualToString:@"root"]) { //If not launched by Launchd //show icon on Dock if (![[NSUserDefaults standardUserDefaults] boolForKey:@"hideDockIcon"]) { ProcessSerialNumber psn = { 0, kCurrentProcess }; TransformProcessType(&psn, kProcessTransformToForegroundApplication); } NSAlert *askOcsAgentLaunch = [[NSAlert alloc] init]; [askOcsAgentLaunch setMessageText:NSLocalizedString(@"Ask_agent_run", @"First Window question")]; [askOcsAgentLaunch setInformativeText:NSLocalizedString(@"Ask_agent_run_comment", @"First window comment")]; [askOcsAgentLaunch addButtonWithTitle:NSLocalizedString(@"Yes", @"Yes Button")]; [askOcsAgentLaunch addButtonWithTitle:NSLocalizedString(@"No", @"No Button")]; [askOcsAgentLaunch setAlertStyle:NSInformationalAlertStyle]; //Our application become the topmost window [NSApp activateIgnoringOtherApps:YES]; if ([askOcsAgentLaunch runModal] != NSAlertFirstButtonReturn) { // Button 'No' was clicked, we don't launch OCS agent launchOcsAgent = 0; } [askOcsAgentLaunch release]; } if (launchOcsAgent == 1 ) { // Too be on the safe side, I chose the array length to be 10. const int kPIDArrayLength = 10; pid_t myArray[kPIDArrayLength]; unsigned int numberMatches; // simple way of geting our PID, see if we're already running.... int error = GetAllPIDsForProcessName("OCSNG",myArray,kPIDArrayLength,&numberMatches,NULL); if (error == 0) { // Success if (numberMatches > 1) { // There's already a copy of this app running return -1; } } //We launch contact to server using Authorization Services (with asking password) OSStatus myStatus; AuthorizationFlags myFlags = kAuthorizationFlagDefaults; AuthorizationRef myAuthorizationRef; myStatus = AuthorizationCreate(NULL, kAuthorizationEmptyEnvironment,myFlags, &myAuthorizationRef); if (myStatus != errAuthorizationSuccess) return myStatus; do { { AuthorizationItem myItems = {kAuthorizationRightExecute, 0, NULL, 0}; AuthorizationRights myRights = {1, &myItems}; myFlags = kAuthorizationFlagDefaults | kAuthorizationFlagInteractionAllowed | kAuthorizationFlagPreAuthorize | kAuthorizationFlagExtendRights; myStatus = AuthorizationCopyRights (myAuthorizationRef,&myRights, NULL, myFlags, NULL ); } if (myStatus != errAuthorizationSuccess) break; { //We use an helper tool instead of running OCS agent directly NSString *ocscontactPath = [[NSBundle mainBundle] pathForResource:@"ocscontact"ofType:nil]; char *myArguments[] = { "", NULL }; FILE *myCommunicationsPipe = NULL; char myReadBuffer[128]; myFlags = kAuthorizationFlagDefaults; myStatus = AuthorizationExecuteWithPrivileges (myAuthorizationRef, [ocscontactPath UTF8String], kAuthorizationFlagDefaults, myArguments, &myCommunicationsPipe); if (myStatus == errAuthorizationSuccess) for(;;) { int bytesRead = read (fileno (myCommunicationsPipe),myReadBuffer, sizeof (myReadBuffer)); if (bytesRead < 1) break; write (fileno (stdout), myReadBuffer, bytesRead); } } } while (0); AuthorizationFree (myAuthorizationRef, kAuthorizationFlagDefaults); return myStatus; } [autoreleasepool release]; return NSApplicationMain(argc, (const char **) argv); } ������������������������������������������������������UnixAgent-2.4.2/tools/macosx/ocsng_app-xcode/ocscontact-Info.plist����������������������������������0000664�0000000�0000000�00000001340�13327377321�0025240�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict> <key>CFBundleDevelopmentRegion</key> <string>English</string> <key>CFBundleExecutable</key> <string>${EXECUTABLE_NAME}</string> <key>CFBundleIdentifier</key> <string>org.ocsinventory-ng.ocscontact</string> <key>CFBundleInfoDictionaryVersion</key> <string>6.0</string> <key>CFBundlePackageType</key> <string>APPL</string> <key>CFBundleSignature</key> <string>????</string> <key>CFBundleVersion</key> <string>2.3</string> <key>NSMainNibFile</key> <string>MainMenu</string> <key>NSPrincipalClass</key> <string>NSApplication</string> </dict> </plist> ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������UnixAgent-2.4.2/tools/macosx/ocsng_app-xcode/ocscontact.h�������������������������������������������0000664�0000000�0000000�00000000574�13327377321�0023453�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// // OCSINVENTORY-NG // Copyleft Guillaume PROTET 2011 // Web : http://www.ocsinventory-ng.org // // This code is open source and may be copied and modified as long as the source // code is always made freely available. // Please refer to the General Public Licence http://www.gnu.org/ or Licence.txt // // #import <Cocoa/Cocoa.h> @interface ocscontact : NSObject { } @end ������������������������������������������������������������������������������������������������������������������������������������UnixAgent-2.4.2/tools/macosx/ocsng_app-xcode/ocscontact.m�������������������������������������������0000664�0000000�0000000�00000002013�13327377321�0023446�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// // OCSINVENTORY-NG // Copyleft Guillaume PROTET 2011 // Web : http://www.ocsinventory-ng.org // // This code is open source and may be copied and modified as long as the source // code is always made freely available. // Please refer to the General Public Licence http://www.gnu.org/ or Licence.txt // // //ocscontact is the helper tool to run OCS agent using Authorization Services. //ocscontact executable MUST be owned by root and have 700 permissions #import "ocscontact.h" @implementation ocscontact int main( int argc, char *argv[], char *envp[]) { NSAutoreleasePool *autoreleasepool = [[NSAutoreleasePool alloc] init]; NSLog(@"Running ocscontact"); setuid(0); //To be able to run OCS agent as root NSTask *Task = [[NSTask alloc] init]; //We get the path of ocsinventory-agent executable NSString *ocsinventoryAgentPath = [[NSBundle mainBundle] pathForResource:@"ocsinventory-agent"ofType:nil]; [Task setLaunchPath:ocsinventoryAgentPath]; [Task launch]; [autoreleasepool release]; return 0; } @end ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������UnixAgent-2.4.2/tools/macosx/patches/���������������������������������������������������������������0000775�0000000�0000000�00000000000�13327377321�0017512�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������UnixAgent-2.4.2/tools/macosx/patches/lib-ocsinventory-agent-backend-darwn.patch���������������������0000664�0000000�0000000�00000001147�13327377321�0027636�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������--- a/lib/Ocsinventory/Agent/Backend.pm +++ b/lib/Ocsinventory/Agent/Backend.pm @@ -85,8 +87,11 @@ sub initModList { } if ($config->{devlib}) { - # devlib enable, I only search for backend module in ./lib - push (@dirToScan, './lib'); + eval "use Cwd qw(abs_path);"; + eval "use File::Basename;"; + my $path = dirname( abs_path($0) ); + $logger->debug("devlib mode: Only looking in $path for backend modules."); + push (@dirToScan, $path . "/lib"); } else { # my ($inst) = ExtUtils::Installed->new(); # eval {@installed_files = �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������UnixAgent-2.4.2/tools/macosx/patches/ocsinventory-agent-darwin.patch��������������������������������0000664�0000000�0000000�00000000634�13327377321�0025656�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������--- ../unified_unix_agent/ocsinventory-agent 2011-05-08 19:23:10.000000000 +0200 +++ ocsinventory-agent 2011-07-29 00:15:15.000000000 +0200 @@ -18,6 +18,18 @@ #USA. # +BEGIN { + use File::Basename; + use Cwd qw(abs_path); + + my $scriptname = basename(__FILE__); + my $path = abs_path($0); + $path =~ s/$scriptname//g; + + unshift(@INC,$path."/lib/"); +} + + use strict; use warnings; ����������������������������������������������������������������������������������������������������UnixAgent-2.4.2/tools/macosx/scripts/���������������������������������������������������������������0000775�0000000�0000000�00000000000�13327377321�0017552�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������UnixAgent-2.4.2/tools/macosx/scripts/create-darwin-perl-lib_fromCPAN.pl�����������������������������0000664�0000000�0000000�00000013357�13327377321�0026036�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!/usr/bin/perl -w # # COPYRIGHT: # # This software is Copyright (c) 2008 claimid.com/saxjazman9 # # (Except where explicitly superseded by other copyright notices) # # Special thanks to Jesse over a best practical for the framework # from which this script is has been created # # LICENSE: # # This work is made available to you under the terms of Version 2 of # the GNU General Public License. A copy of that license should have # been provided with this software, but in any event can be snarfed # from www.gnu.org. # # This work is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA # 02110-1301 or visit their web page on the internet at # http://www.gnu.org/licenses/old-licenses/gpl-2.0.html. # # # This is just a basic script that checks to make sure that all # the modules needed by OCS MacOSX agent before you can compile it. # # You have to install LWP in your system to use this script # # WARNING: Before executing this script please modify your ~/.cpan/CPAN/MyConfig.pm file as follows: # $> perl -MCPAN -e shell # cpan> o conf makepl_arg 'LIB=~/darwin-perl-lib PREFIX=--perl-only' # cpan> o conf commit # cpan> quit # # This will set the CPAN shell up to install the modules in this script to ~/darwin-perl-lib # it will also cause the man pages and other misc perl stuff to not be installed... we only need the modules anyway # # After this script is done, you will take the ~/darwin-perl-lib and move it to the source code directory for # compiling your application # # Once the script has completed and you are confident you have everything, you can reverse the changes to your # MyConfig.pm by: # # # $> perl -MCPAN -e shell # cpan> o conf makepl_arg '' # cpan> o conf commit # cpan> quit # # # THIS IS A BETA SCRIPT! USE AT YOUR OWN RISK # use strict; use warnings; use Getopt::Long; use CPAN; use LWP::Simple qw/getstore/; my $libwww_tarball = "G/GA/GAAS/libwww-perl-6.05.tar.gz"; my $xmlentities_tarball = "S/SI/SIXTEASE/XML-Entities-1.0002.tar.gz"; my %args; my %deps; GetOptions( \%args, 'install', ); unless (keys %args) { help(); exit(0); } # Set up defaults my %default = ( 'CORE' => 1, ); $args{$_} = $default{$_} foreach grep !exists $args{$_}, keys %default; # # Place any core modules (+ versions) that are required in the form: MOD::MOD 0.01 # $deps{'CORE'} = [ text_to_hash( << ".") ]; $libwww_tarball XML::SAX XML::Parser XML::Simple URI XML::NamespaceSupport File::Listing Net::IP Compress::Zlib Compress::Raw::Zlib IO::Zlib Mac::SysProfile Mac::PropertyList Parse::EDID . # push all the dep's into a @missing array my @missing; my @deps = @{ $deps{'CORE'} }; while (@deps) { my $module = shift @deps; my $version = shift @deps; push @missing, $module, $version; } # assuming we've passed the --install, proceed with the compiling and install to our if ( $args{'install'} ) { while( @missing ) { resolve_dep(shift @missing, shift @missing); } #We install XML::Etities manually because of writing rights in /usr/local/bin directory &install_tarball("http://search.cpan.org/CPAN/authors/id",$xmlentities_tarball,"XML-Entities"); } # convert the dep text list to a hash sub text_to_hash { my %hash; for my $line ( split /\n/, $_[0] ) { my($key, $value) = $line =~ /(\S+)\s*(\S*)/; $value ||= ''; $hash{$key} = $value; } return %hash; } # pull in our local .cpan/CPAN/MyConfig.pm file # use the cpan shell to force install the module to our local dir # force install is used because although we may have the package already up-to-date on our system, # we want a clean fresh copy installed to our darwin-perl-lib dir. sub resolve_dep { my $module = shift; my $version = shift; local @INC = @INC; my $user = `whoami`; chomp $user; unshift @INC, "/Users/$user/Library/Application Support/.cpan"; if ( $ENV{'HOME'} ) { unshift @INC, "$ENV{'HOME'}/.cpan"; } #unshift @INC, "/Users/$user/~darwin-perl-lib"; print "\nInstall module $module\n"; my $cfg = (eval { require CPAN::MyConfig }); unless($cfg){ die('CPAN Not configured properly'); } CPAN::Shell->force('install',$module); } # the help.... sub help { print <<'.'; By default, testdeps determine whether you have installed all the perl modules OCSNG.app needs to run. --install Install missing modules . } sub install_tarball { my $cpan_url = shift; my $tarball_url = shift; my $directory = shift; my $mod_dir; my $tarball = $tarball_url; $tarball =~ s/(.*)\/(.*)\/(.*)\///; if ($directory) { $mod_dir = $directory; } else { $mod_dir = $tarball ; $mod_dir =~ s/\.tar\.gz//; } print "Getting $cpan_url/$tarball_url file\n"; my $resp = getstore("$cpan_url/$tarball_url", $tarball); die "Couldn't get $cpan_url/$tarball_url -> HTTP response: $resp." unless $resp == 200; print "Extracting $tarball file\n"; open(EXCLUDE,">exclude_hiddens"); print EXCLUDE ".*"; close EXCLUDE; system("tar -xvzf $tarball -X exclude_hiddens"); #We exclude hiddens files from extract (mainly for older Mac::Sysprofile package) unlink "exclude_hiddens"; print "Installing $mod_dir module\n"; chdir($mod_dir); system("env ARCHFLAGS='-arch i386 -arch ppc -arch x86_64' perl Makefile.PL LIB='~/darwin-perl-lib' PREFIX='--perl-only'"); #Multi architectures support system("make && make install"); chdir('..'); system("rm -Rf $mod_dir"); } 1; ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������UnixAgent-2.4.2/tools/macosx/scripts/extract_version.pl���������������������������������������������0000664�0000000�0000000�00000000223�13327377321�0023323�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!/bin/perl -w my $FILE="./ocsinventory-agent"; open(F,$FILE); while(<F>){ next unless $_ =~ /^our \$VERSION = '(.*)';$/; print $1; } close(F); �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������UnixAgent-2.4.2/tools/macosx/scripts/macosx-perl-lib-dep-snapshot.tar.gz����������������������������0000664�0000000�0000000�00013774000�13327377321�0026316�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������darwin-perl-lib/������������������������������������������������������������������������������������000755 �000765 �000024 �00000000000 13167165535 015767� 5����������������������������������������������������������������������������������������������������ustar�00ocsinventory��������������������staff���������������������������000000 �000000 ������������������������������������������������������������������������������������������������������������������������������������������������������������������������darwin-perl-lib/._.DS_Store�������������������������������������������������������������������������000644 �000765 �000024 �00000000170 13167165535 017665� 0����������������������������������������������������������������������������������������������������ustar�00ocsinventory��������������������staff���������������������������000000 �000000 ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������Mac OS X ���� ���2���F������x���� @������������������������ATTR�������x���x����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������darwin-perl-lib/.DS_Store���������������������������������������������������������������������������000644 �000765 �000024 �00000020004 13167165535 017446� 0����������������������������������������������������������������������������������������������������ustar�00ocsinventory��������������������staff���������������������������000000 �000000 ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������Bud1����������� �����������������������������������������������������������l�eIlocblob����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������� ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ ������@��������������������������������������� ������@����������������������������������������� ������@����������������������������������������� ������@����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������B�u�n�d�l�eIlocblob������;���(������C�o�m�p�r�e�s�sIlocblob���������(������C�o�m�p�r�e�s�sbwspblob���bplist00  ]ShowStatusBar[ShowPathbar[ShowToolbar[ShowTabView_ContainerShowSidebar\WindowBounds[ShowSidebar  _{{118, 248}, {770, 673}} %1=I`myz{|}~��������������������������������C�o�m�p�r�e�s�sptbLustr����U�s�e�r�s�/�o�c�s�i�n�v�e�n�t�o�r�y�/�o�c�s�-�l�i�b�/����C�o�m�p�r�e�s�sptbNustr����C�o�m�p�r�e�s�s����C�o�m�p�r�e�s�svSrnlong�������d�a�r�w�i�n�-�t�h�r�e�a�d�-�m�u�l�t�i�-�2�l�e�v�e�lIlocblob��������(������d�a�r�w�i�n�-�t�h�r�e�a�d�-�m�u�l�t�i�-�2�l�e�v�e�lbwspblob���bplist00  ]ShowStatusBar[ShowPathbar[ShowToolbar[ShowTabView_ContainerShowSidebar\WindowBounds[ShowSidebar  _{{118, 248}, {770, 673}} %1=I`myz{|}~��������������������������������d�a�r�w�i�n�-�t�h�r�e�a�d�-�m�u�l�t�i�-�2�l�e�v�e�lvSrnlong�������F�i�l�eIlocblob��������(������H�T�T�PIlocblob��������(������I�OIlocblob������;���������I�OptbLustr����U�s�e�r�s�/�o�c�s�i�n�v�e�n�t�o�r�y�/�o�c�s�-�l�i�b�/����I�OptbNustr����I�O����L�W�PIlocblob���������������L�W�Pbwspblob���bplist00  ]ShowStatusBar[ShowPathbar[ShowToolbar[ShowTabView_ContainerShowSidebar\WindowBounds[ShowSidebar  _{{118, 248}, {770, 673}} %1=I`myz{|}~��������������������������������L�W�PvSrnlong�������L�W�P�.�p�mIlocblob������������� �l�w�p�c�o�o�k�.�p�o�dIlocblob������������� �l�w�p�t�u�t�.�p�o�dIlocblob��������������M�a�cIlocblob������;��������M�o�z�i�l�l�aIlocblob��������������N�e�tIlocblob�������������U�R�IIlocblob�������������U�R�I�.�p�mIlocblob�������������X�M�LIlocblob������;��x���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������� ���E�� �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������DSDB����������������������������� ���`������������������������������������������� ������@����������������������������������������� ������@����������������������������������������� ������@�������tainerShowSidebar\WindowBounds[ShowSidebar  _{{118, 248}, {770, 673}} %1=I`myz{|}~��������������������������������L�W�PvSrnlong�������L�W�P�.�p�mIlocblob������������� �l�w�p�c�o�o�k�.�p�o�dIlocblob������������� �l�w�p�t�u�t�.�p�o�dIlocblob��������������M�a�cIlocblob������;��������M�o�z�i�l�l�aIlocblob��������������N�e�tIlocblob�������������U�R�IIlocblob�������������U�R�I�.�p�mIlocblob�������������X�M�LIlocblob������;��x�����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������darwin-perl-lib/Bundle/�����������������������������������������������������������������������������000755 �000765 �000024 �00000000000 11705106466 017172� 5����������������������������������������������������������������������������������������������������ustar�00ocsinventory��������������������staff���������������������������000000 �000000 ������������������������������������������������������������������������������������������������������������������������������������������������������������������������darwin-perl-lib/Compress/���������������������������������������������������������������������������000755 �000765 �000024 �00000000000 13167163506 017556� 5����������������������������������������������������������������������������������������������������ustar�00ocsinventory��������������������staff���������������������������000000 �000000 ������������������������������������������������������������������������������������������������������������������������������������������������������������������������darwin-perl-lib/darwin-thread-multi-2level/���������������������������������������������������������000755 �000765 �000024 �00000000000 13167163507 023034� 5����������������������������������������������������������������������������������������������������ustar�00ocsinventory��������������������staff���������������������������000000 �000000 ������������������������������������������������������������������������������������������������������������������������������������������������������������������������darwin-perl-lib/File/�������������������������������������������������������������������������������000755 �000765 �000024 �00000000000 13167163507 016643� 5����������������������������������������������������������������������������������������������������ustar�00ocsinventory��������������������staff���������������������������000000 �000000 ������������������������������������������������������������������������������������������������������������������������������������������������������������������������darwin-perl-lib/HTTP/�������������������������������������������������������������������������������000755 �000765 �000024 �00000000000 13167165437 016547� 5����������������������������������������������������������������������������������������������������ustar�00ocsinventory��������������������staff���������������������������000000 �000000 ������������������������������������������������������������������������������������������������������������������������������������������������������������������������darwin-perl-lib/IO/���������������������������������������������������������������������������������000755 �000765 �000024 �00000000000 13167163507 016273� 5����������������������������������������������������������������������������������������������������ustar�00ocsinventory��������������������staff���������������������������000000 �000000 ������������������������������������������������������������������������������������������������������������������������������������������������������������������������darwin-perl-lib/LWP/��������������������������������������������������������������������������������000755 �000765 �000024 �00000000000 13167163507 016426� 5����������������������������������������������������������������������������������������������������ustar�00ocsinventory��������������������staff���������������������������000000 �000000 ������������������������������������������������������������������������������������������������������������������������������������������������������������������������darwin-perl-lib/LWP.pm������������������������������������������������������������������������������000444 �000765 �000024 �00000052254 13167163507 016772� 0����������������������������������������������������������������������������������������������������ustar�00ocsinventory��������������������staff���������������������������000000 �000000 ������������������������������������������������������������������������������������������������������������������������������������������������������������������������package LWP; our $VERSION = '6.27'; require LWP::UserAgent; # this should load everything you need sub Version { $VERSION; } 1; __END__ =pod =encoding utf-8 =head1 NAME LWP - The World-Wide Web library for Perl =head1 SYNOPSIS use LWP; print "This is libwww-perl-$LWP::VERSION\n"; =head1 DESCRIPTION The libwww-perl collection is a set of Perl modules which provides a simple and consistent application programming interface (API) to the World-Wide Web. The main focus of the library is to provide classes and functions that allow you to write WWW clients. The library also contain modules that are of more general use and even classes that help you implement simple HTTP servers. Most modules in this library provide an object oriented API. The user agent, requests sent and responses received from the WWW server are all represented by objects. This makes a simple and powerful interface to these services. The interface is easy to extend and customize for your own needs. The main features of the library are: =over 3 =item * Contains various reusable components (modules) that can be used separately or together. =item * Provides an object oriented model of HTTP-style communication. Within this framework we currently support access to C<http>, C<https>, C<gopher>, C<ftp>, C<news>, C<file>, and C<mailto> resources. =item * Provides a full object oriented interface or a very simple procedural interface. =item * Supports the basic and digest authorization schemes. =item * Supports transparent redirect handling. =item * Supports access through proxy servers. =item * Provides parser for F<robots.txt> files and a framework for constructing robots. =item * Supports parsing of HTML forms. =item * Implements HTTP content negotiation algorithm that can be used both in protocol modules and in server scripts (like CGI scripts). =item * Supports HTTP cookies. =item * Some simple command line clients, for instance C<lwp-request> and C<lwp-download>. =back =head1 HTTP STYLE COMMUNICATION The libwww-perl library is based on HTTP style communication. This section tries to describe what that means. Let us start with this quote from the HTTP specification document <URL:http://www.w3.org/Protocols/>: =over 3 =item * The HTTP protocol is based on a request/response paradigm. A client establishes a connection with a server and sends a request to the server in the form of a request method, URI, and protocol version, followed by a MIME-like message containing request modifiers, client information, and possible body content. The server responds with a status line, including the message's protocol version and a success or error code, followed by a MIME-like message containing server information, entity meta-information, and possible body content. =back What this means to libwww-perl is that communication always take place through these steps: First a I<request> object is created and configured. This object is then passed to a server and we get a I<response> object in return that we can examine. A request is always independent of any previous requests, i.e. the service is stateless. The same simple model is used for any kind of service we want to access. For example, if we want to fetch a document from a remote file server, then we send it a request that contains a name for that document and the response will contain the document itself. If we access a search engine, then the content of the request will contain the query parameters and the response will contain the query result. If we want to send a mail message to somebody then we send a request object which contains our message to the mail server and the response object will contain an acknowledgment that tells us that the message has been accepted and will be forwarded to the recipient(s). It is as simple as that! =head2 The Request Object The libwww-perl request object has the class name L<HTTP::Request>. The fact that the class name uses C<HTTP::> as a prefix only implies that we use the HTTP model of communication. It does not limit the kind of services we can try to pass this I<request> to. For instance, we will send L<HTTP::Request>s both to ftp and gopher servers, as well as to the local file system. The main attributes of the request objects are: =over 3 =item * B<method> is a short string that tells what kind of request this is. The most common methods are B<GET>, B<PUT>, B<POST> and B<HEAD>. =item * B<uri> is a string denoting the protocol, server and the name of the "document" we want to access. The B<uri> might also encode various other parameters. =item * B<headers> contains additional information about the request and can also used to describe the content. The headers are a set of keyword/value pairs. =item * B<content> is an arbitrary amount of data. =back =head2 The Response Object The libwww-perl response object has the class name L<HTTP::Response>. The main attributes of objects of this class are: =over 3 =item * B<code> is a numerical value that indicates the overall outcome of the request. =item * B<message> is a short, human readable string that corresponds to the I<code>. =item * B<headers> contains additional information about the response and describe the content. =item * B<content> is an arbitrary amount of data. =back Since we don't want to handle all possible I<code> values directly in our programs, a libwww-perl response object has methods that can be used to query what kind of response this is. The most commonly used response classification methods are: =over 3 =item is_success() The request was successfully received, understood or accepted. =item is_error() The request failed. The server or the resource might not be available, access to the resource might be denied or other things might have failed for some reason. =back =head2 The User Agent Let us assume that we have created a I<request> object. What do we actually do with it in order to receive a I<response>? The answer is that you pass it to a I<user agent> object and this object takes care of all the things that need to be done (like low-level communication and error handling) and returns a I<response> object. The user agent represents your application on the network and provides you with an interface that can accept I<requests> and return I<responses>. The user agent is an interface layer between your application code and the network. Through this interface you are able to access the various servers on the network. The class name for the user agent is L<LWP::UserAgent>. Every libwww-perl application that wants to communicate should create at least one object of this class. The main method provided by this object is request(). This method takes an L<HTTP::Request> object as argument and (eventually) returns a L<HTTP::Response> object. The user agent has many other attributes that let you configure how it will interact with the network and with your application. =over 3 =item * B<timeout> specifies how much time we give remote servers to respond before the library disconnects and creates an internal I<timeout> response. =item * B<agent> specifies the name that your application uses when it presents itself on the network. =item * B<from> can be set to the e-mail address of the person responsible for running the application. If this is set, then the address will be sent to the servers with every request. =item * B<parse_head> specifies whether we should initialize response headers from the E<lt>head> section of HTML documents. =item * B<proxy> and B<no_proxy> specify if and when to go through a proxy server. <URL:http://www.w3.org/History/1994/WWW/Proxies/> =item * B<credentials> provides a way to set up user names and passwords needed to access certain services. =back Many applications want even more control over how they interact with the network and they get this by sub-classing L<LWP::UserAgent>. The library includes a sub-class, L<LWP::RobotUA>, for robot applications. =head2 An Example This example shows how the user agent, a request and a response are represented in actual perl code: # Create a user agent object use LWP::UserAgent; my $ua = LWP::UserAgent->new; $ua->agent("MyApp/0.1 "); # Create a request my $req = HTTP::Request->new(POST => 'http://search.cpan.org/search'); $req->content_type('application/x-www-form-urlencoded'); $req->content('query=libwww-perl&mode=dist'); # Pass request to the user agent and get a response back my $res = $ua->request($req); # Check the outcome of the response if ($res->is_success) { print $res->content; } else { print $res->status_line, "\n"; } The $ua is created once when the application starts up. New request objects should normally created for each request sent. =head1 NETWORK SUPPORT This section discusses the various protocol schemes and the HTTP style methods that headers may be used for each. For all requests, a "User-Agent" header is added and initialized from the $ua->agent attribute before the request is handed to the network layer. In the same way, a "From" header is initialized from the $ua->from attribute. For all responses, the library adds a header called "Client-Date". This header holds the time when the response was received by your application. The format and semantics of the header are the same as the server created "Date" header. You may also encounter other "Client-XXX" headers. They are all generated by the library internally and are not received from the servers. =head2 HTTP Requests HTTP requests are just handed off to an HTTP server and it decides what happens. Few servers implement methods beside the usual "GET", "HEAD", "POST" and "PUT", but CGI-scripts may implement any method they like. If the server is not available then the library will generate an internal error response. The library automatically adds a "Host" and a "Content-Length" header to the HTTP request before it is sent over the network. For a GET request you might want to add a "If-Modified-Since" or "If-None-Match" header to make the request conditional. For a POST request you should add the "Content-Type" header. When you try to emulate HTML E<lt>FORM> handling you should usually let the value of the "Content-Type" header be "application/x-www-form-urlencoded". See L<lwpcook> for examples of this. The libwww-perl HTTP implementation currently support the HTTP/1.1 and HTTP/1.0 protocol. The library allows you to access proxy server through HTTP. This means that you can set up the library to forward all types of request through the HTTP protocol module. See L<LWP::UserAgent> for documentation of this. =head2 HTTPS Requests HTTPS requests are HTTP requests over an encrypted network connection using the SSL protocol developed by Netscape. Everything about HTTP requests above also apply to HTTPS requests. In addition the library will add the headers "Client-SSL-Cipher", "Client-SSL-Cert-Subject" and "Client-SSL-Cert-Issuer" to the response. These headers denote the encryption method used and the name of the server owner. The request can contain the header "If-SSL-Cert-Subject" in order to make the request conditional on the content of the server certificate. If the certificate subject does not match, no request is sent to the server and an internally generated error response is returned. The value of the "If-SSL-Cert-Subject" header is interpreted as a Perl regular expression. =head2 FTP Requests The library currently supports GET, HEAD and PUT requests. GET retrieves a file or a directory listing from an FTP server. PUT stores a file on a ftp server. You can specify a ftp account for servers that want this in addition to user name and password. This is specified by including an "Account" header in the request. User name/password can be specified using basic authorization or be encoded in the URL. Failed logins return an UNAUTHORIZED response with "WWW-Authenticate: Basic" and can be treated like basic authorization for HTTP. The library supports ftp ASCII transfer mode by specifying the "type=a" parameter in the URL. It also supports transfer of ranges for FTP transfers using the "Range" header. Directory listings are by default returned unprocessed (as returned from the ftp server) with the content media type reported to be "text/ftp-dir-listing". The L<File::Listing> module provides methods for parsing of these directory listing. The ftp module is also able to convert directory listings to HTML and this can be requested via the standard HTTP content negotiation mechanisms (add an "Accept: text/html" header in the request if you want this). For normal file retrievals, the "Content-Type" is guessed based on the file name suffix. See L<LWP::MediaTypes>. The "If-Modified-Since" request header works for servers that implement the C<MDTM> command. It will probably not work for directory listings though. Example: $req = HTTP::Request->new(GET => 'ftp://me:passwd@ftp.some.where.com/'); $req->header(Accept => "text/html, */*;q=0.1"); =head2 News Requests Access to the USENET News system is implemented through the NNTP protocol. The name of the news server is obtained from the NNTP_SERVER environment variable and defaults to "news". It is not possible to specify the hostname of the NNTP server in news: URLs. The library supports GET and HEAD to retrieve news articles through the NNTP protocol. You can also post articles to newsgroups by using (surprise!) the POST method. GET on newsgroups is not implemented yet. Examples: $req = HTTP::Request->new(GET => 'news:abc1234@a.sn.no'); $req = HTTP::Request->new(POST => 'news:comp.lang.perl.test'); $req->header(Subject => 'This is a test', From => 'me@some.where.org'); $req->content(<<EOT); This is the content of the message that we are sending to the world. EOT =head2 Gopher Request The library supports the GET and HEAD methods for gopher requests. All request header values are ignored. HEAD cheats and returns a response without even talking to server. Gopher menus are always converted to HTML. The response "Content-Type" is generated from the document type encoded (as the first letter) in the request URL path itself. Example: $req = HTTP::Request->new(GET => 'gopher://gopher.sn.no/'); =head2 File Request The library supports GET and HEAD methods for file requests. The "If-Modified-Since" header is supported. All other headers are ignored. The I<host> component of the file URL must be empty or set to "localhost". Any other I<host> value will be treated as an error. Directories are always converted to an HTML document. For normal files, the "Content-Type" and "Content-Encoding" in the response are guessed based on the file suffix. Example: $req = HTTP::Request->new(GET => 'file:/etc/passwd'); =head2 Mailto Request You can send (aka "POST") mail messages using the library. All headers specified for the request are passed on to the mail system. The "To" header is initialized from the mail address in the URL. Example: $req = HTTP::Request->new(POST => 'mailto:libwww@perl.org'); $req->header(Subject => "subscribe"); $req->content("Please subscribe me to the libwww-perl mailing list!\n"); =head2 CPAN Requests URLs with scheme C<cpan:> are redirected to a suitable CPAN mirror. If you have your own local mirror of CPAN you might tell LWP to use it for C<cpan:> URLs by an assignment like this: $LWP::Protocol::cpan::CPAN = "file:/local/CPAN/"; Suitable CPAN mirrors are also picked up from the configuration for the CPAN.pm, so if you have used that module a suitable mirror should be picked automatically. If neither of these apply, then a redirect to the generic CPAN http location is issued. Example request to download the newest perl: $req = HTTP::Request->new(GET => "cpan:src/latest.tar.gz"); =head1 OVERVIEW OF CLASSES AND PACKAGES This table should give you a quick overview of the classes provided by the library. Indentation shows class inheritance. LWP::MemberMixin -- Access to member variables of Perl5 classes LWP::UserAgent -- WWW user agent class LWP::RobotUA -- When developing a robot applications LWP::Protocol -- Interface to various protocol schemes LWP::Protocol::http -- http:// access LWP::Protocol::file -- file:// access LWP::Protocol::ftp -- ftp:// access ... LWP::Authen::Basic -- Handle 401 and 407 responses LWP::Authen::Digest HTTP::Headers -- MIME/RFC822 style header (used by HTTP::Message) HTTP::Message -- HTTP style message HTTP::Request -- HTTP request HTTP::Response -- HTTP response HTTP::Daemon -- A HTTP server class WWW::RobotRules -- Parse robots.txt files WWW::RobotRules::AnyDBM_File -- Persistent RobotRules Net::HTTP -- Low level HTTP client The following modules provide various functions and definitions. LWP -- This file. Library version number and documentation. LWP::MediaTypes -- MIME types configuration (text/html etc.) LWP::Simple -- Simplified procedural interface for common functions HTTP::Status -- HTTP status code (200 OK etc) HTTP::Date -- Date parsing module for HTTP date formats HTTP::Negotiate -- HTTP content negotiation calculation File::Listing -- Parse directory listings HTML::Form -- Processing for <form>s in HTML documents =head1 MORE DOCUMENTATION All modules contain detailed information on the interfaces they provide. The L<lwpcook> manpage is the libwww-perl cookbook that contain examples of typical usage of the library. You might want to take a look at how the scripts L<lwp-request>, L<lwp-download>, L<lwp-dump> and L<lwp-mirror> are implemented. =head1 ENVIRONMENT The following environment variables are used by LWP: =over =item HOME The L<LWP::MediaTypes> functions will look for the F<.media.types> and F<.mime.types> files relative to you home directory. =item http_proxy =item ftp_proxy =item xxx_proxy =item no_proxy These environment variables can be set to enable communication through a proxy server. See the description of the C<env_proxy> method in L<LWP::UserAgent>. =item PERL_LWP_ENV_PROXY If set to a TRUE value, then the L<LWP::UserAgent> will by default call C<env_proxy> during initialization. This makes LWP honor the proxy variables described above. =item PERL_LWP_SSL_VERIFY_HOSTNAME The default C<verify_hostname> setting for L<LWP::UserAgent>. If not set the default will be 1. Set it as 0 to disable hostname verification (the default prior to libwww-perl 5.840. =item PERL_LWP_SSL_CA_FILE =item PERL_LWP_SSL_CA_PATH The file and/or directory where the trusted Certificate Authority certificates is located. See L<LWP::UserAgent> for details. =item PERL_HTTP_URI_CLASS Used to decide what URI objects to instantiate. The default is L<URI>. You might want to set it to L<URI::URL> for compatibility with old times. =back =head1 AUTHORS LWP was made possible by contributions from Adam Newby, Albert Dvornik, Alexandre Duret-Lutz, Andreas Gustafsson, Andreas König, Andrew Pimlott, Andy Lester, Ben Coleman, Benjamin Low, Ben Low, Ben Tilly, Blair Zajac, Bob Dalgleish, BooK, Brad Hughes, Brian J. Murrell, Brian McCauley, Charles C. Fu, Charles Lane, Chris Nandor, Christian Gilmore, Chris W. Unger, Craig Macdonald, Dale Couch, Dan Kubb, Dave Dunkin, Dave W. Smith, David Coppit, David Dick, David D. Kilzer, Doug MacEachern, Edward Avis, erik, Gary Shea, Gisle Aas, Graham Barr, Gurusamy Sarathy, Hans de Graaff, Harald Joerg, Harry Bochner, Hugo, Ilya Zakharevich, INOUE Yoshinari, Ivan Panchenko, Jack Shirazi, James Tillman, Jan Dubois, Jared Rhine, Jim Stern, Joao Lopes, John Klar, Johnny Lee, Josh Kronengold, Josh Rai, Joshua Chamas, Joshua Hoblitt, Kartik Subbarao, Keiichiro Nagano, Ken Williams, KONISHI Katsuhiro, Lee T Lindley, Liam Quinn, Marc Hedlund, Marc Langheinrich, Mark D. Anderson, Marko Asplund, Mark Stosberg, Markus B Krüger, Markus Laker, Martijn Koster, Martin Thurn, Matthew Eldridge, Matthew.van.Eerde, Matt Sergeant, Michael A. Chase, Michael Quaranta, Michael Thompson, Mike Schilli, Moshe Kaminsky, Nathan Torkington, Nicolai Langfeldt, Norton Allen, Olly Betts, Paul J. Schinder, peterm, Philip Guenther, Daniel Buenzli, Pon Hwa Lin, Radoslaw Zielinski, Radu Greab, Randal L. Schwartz, Richard Chen, Robin Barker, Roy Fielding, Sander van Zoest, Sean M. Burke, shildreth, Slaven Rezic, Steve A Fink, Steve Hay, Steven Butler, Steve_Kilbane, Takanori Ugai, Thomas Lotterer, Tim Bunce, Tom Hughes, Tony Finch, Ville Skyttä, Ward Vandewege, William York, Yale Huang, and Yitzchak Scott-Thoennes. LWP owes a lot in motivation, design, and code, to the libwww-perl library for Perl4 by Roy Fielding, which included work from Alberto Accomazzi, James Casey, Brooks Cutter, Martijn Koster, Oscar Nierstrasz, Mel Melchner, Gertjan van Oosten, Jared Rhine, Jack Shirazi, Gene Spafford, Marc VanHeyningen, Steven E. Brenner, Marion Hakanson, Waldemar Kebsch, Tony Sanders, and Larry Wall; see the libwww-perl-0.40 library for details. =head1 COPYRIGHT Copyright 1995-2009, Gisle Aas Copyright 1995, Martijn Koster This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. =head1 AVAILABILITY The latest version of this library is likely to be available from CPAN as well as: http://github.com/libwww-perl/libwww-perl The best place to discuss this code is on the <libwww@perl.org> mailing list. =cut ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������darwin-perl-lib/lwpcook.pod�������������������������������������������������������������������������000444 �000765 �000024 �00000022061 13167163507 020145� 0����������������������������������������������������������������������������������������������������ustar�00ocsinventory��������������������staff���������������������������000000 �000000 ������������������������������������������������������������������������������������������������������������������������������������������������������������������������=head1 NAME lwpcook - The libwww-perl cookbook =head1 DESCRIPTION This document contain some examples that show typical usage of the libwww-perl library. You should consult the documentation for the individual modules for more detail. All examples should be runnable programs. You can, in most cases, test the code sections by piping the program text directly to perl. =head1 GET It is very easy to use this library to just fetch documents from the net. The LWP::Simple module provides the get() function that return the document specified by its URL argument: use LWP::Simple; $doc = get 'http://search.cpan.org/dist/libwww-perl/'; or, as a perl one-liner using the getprint() function: perl -MLWP::Simple -e 'getprint "http://search.cpan.org/dist/libwww-perl/"' or, how about fetching the latest perl by running this command: perl -MLWP::Simple -e ' getstore "ftp://ftp.sunet.se/pub/lang/perl/CPAN/src/latest.tar.gz", "perl.tar.gz"' You will probably first want to find a CPAN site closer to you by running something like the following command: perl -MLWP::Simple -e 'getprint "http://www.cpan.org/SITES.html"' Enough of this simple stuff! The LWP object oriented interface gives you more control over the request sent to the server. Using this interface you have full control over headers sent and how you want to handle the response returned. use LWP::UserAgent; $ua = LWP::UserAgent->new; $ua->agent("$0/0.1 " . $ua->agent); # $ua->agent("Mozilla/8.0") # pretend we are very capable browser $req = HTTP::Request->new( GET => 'http://search.cpan.org/dist/libwww-perl/'); $req->header('Accept' => 'text/html'); # send request $res = $ua->request($req); # check the outcome if ($res->is_success) { print $res->decoded_content; } else { print "Error: " . $res->status_line . "\n"; } The lwp-request program (alias GET) that is distributed with the library can also be used to fetch documents from WWW servers. =head1 HEAD If you just want to check if a document is present (i.e. the URL is valid) try to run code that looks like this: use LWP::Simple; if (head($url)) { # ok document exists } The head() function really returns a list of meta-information about the document. The first three values of the list returned are the document type, the size of the document, and the age of the document. More control over the request or access to all header values returned require that you use the object oriented interface described for GET above. Just s/GET/HEAD/g. =head1 POST There is no simple procedural interface for posting data to a WWW server. You must use the object oriented interface for this. The most common POST operation is to access a WWW form application: use LWP::UserAgent; $ua = LWP::UserAgent->new; my $req = HTTP::Request->new( POST => 'http://rt.cpan.org/Public/Dist/Display.html'); $req->content_type('application/x-www-form-urlencoded'); $req->content('Status=Active&Name=libwww-perl'); my $res = $ua->request($req); print $res->as_string; Lazy people use the HTTP::Request::Common module to set up a suitable POST request message (it handles all the escaping issues) and has a suitable default for the content_type: use HTTP::Request::Common qw(POST); use LWP::UserAgent; $ua = LWP::UserAgent->new; my $req = POST 'http://rt.cpan.org/Public/Dist/Display.html', [ Status => 'Active', Name => 'libwww-perl' ]; print $ua->request($req)->as_string; The lwp-request program (alias POST) that is distributed with the library can also be used for posting data. =head1 PROXIES Some sites use proxies to go through fire wall machines, or just as cache in order to improve performance. Proxies can also be used for accessing resources through protocols not supported directly (or supported badly :-) by the libwww-perl library. You should initialize your proxy setting before you start sending requests: use LWP::UserAgent; $ua = LWP::UserAgent->new; $ua->env_proxy; # initialize from environment variables # or $ua->proxy(ftp => 'http://proxy.myorg.com'); $ua->proxy(wais => 'http://proxy.myorg.com'); $ua->no_proxy(qw(no se fi)); my $req = HTTP::Request->new(GET => 'wais://xxx.com/'); print $ua->request($req)->as_string; The LWP::Simple interface will call env_proxy() for you automatically. Applications that use the $ua->env_proxy() method will normally not use the $ua->proxy() and $ua->no_proxy() methods. Some proxies also require that you send it a username/password in order to let requests through. You should be able to add the required header, with something like this: use LWP::UserAgent; $ua = LWP::UserAgent->new; $ua->proxy(['http', 'ftp'] => 'http://username:password@proxy.myorg.com'); $req = HTTP::Request->new('GET',"http://www.perl.com"); $res = $ua->request($req); print $res->decoded_content if $res->is_success; Replace C<proxy.myorg.com>, C<username> and C<password> with something suitable for your site. =head1 ACCESS TO PROTECTED DOCUMENTS Documents protected by basic authorization can easily be accessed like this: use LWP::UserAgent; $ua = LWP::UserAgent->new; $req = HTTP::Request->new(GET => 'http://www.linpro.no/secret/'); $req->authorization_basic('aas', 'mypassword'); print $ua->request($req)->as_string; The other alternative is to provide a subclass of I<LWP::UserAgent> that overrides the get_basic_credentials() method. Study the I<lwp-request> program for an example of this. =head1 COOKIES Some sites like to play games with cookies. By default LWP ignores cookies provided by the servers it visits. LWP will collect cookies and respond to cookie requests if you set up a cookie jar. use LWP::UserAgent; use HTTP::Cookies; $ua = LWP::UserAgent->new; $ua->cookie_jar(HTTP::Cookies->new(file => "lwpcookies.txt", autosave => 1)); # and then send requests just as you used to do $res = $ua->request(HTTP::Request->new(GET => "http://no.yahoo.com/")); print $res->status_line, "\n"; As you visit sites that send you cookies to keep, then the file F<lwpcookies.txt"> will grow. =head1 HTTPS URLs with https scheme are accessed in exactly the same way as with http scheme, provided that an SSL interface module for LWP has been properly installed (see the F<README.SSL> file found in the libwww-perl distribution for more details). If no SSL interface is installed for LWP to use, then you will get "501 Protocol scheme 'https' is not supported" errors when accessing such URLs. Here's an example of fetching and printing a WWW page using SSL: use LWP::UserAgent; my $ua = LWP::UserAgent->new; my $req = HTTP::Request->new(GET => 'https://www.helsinki.fi/'); my $res = $ua->request($req); if ($res->is_success) { print $res->as_string; } else { print "Failed: ", $res->status_line, "\n"; } =head1 MIRRORING If you want to mirror documents from a WWW server, then try to run code similar to this at regular intervals: use LWP::Simple; %mirrors = ( 'http://www.sn.no/' => 'sn.html', 'http://www.perl.com/' => 'perl.html', 'http://search.cpan.org/distlibwww-perl/' => 'lwp.html', 'gopher://gopher.sn.no/' => 'gopher.html', ); while (($url, $localfile) = each(%mirrors)) { mirror($url, $localfile); } Or, as a perl one-liner: perl -MLWP::Simple -e 'mirror("http://www.perl.com/", "perl.html")'; The document will not be transferred unless it has been updated. =head1 LARGE DOCUMENTS If the document you want to fetch is too large to be kept in memory, then you have two alternatives. You can instruct the library to write the document content to a file (second $ua->request() argument is a file name): use LWP::UserAgent; $ua = LWP::UserAgent->new; my $req = HTTP::Request->new(GET => 'http://www.cpan.org/authors/Gisle_Aas/libwww-perl-6.02.tar.gz'); $res = $ua->request($req, "libwww-perl.tar.gz"); if ($res->is_success) { print "ok\n"; } else { print $res->status_line, "\n"; } Or you can process the document as it arrives (second $ua->request() argument is a code reference): use LWP::UserAgent; $ua = LWP::UserAgent->new; $URL = 'ftp://ftp.unit.no/pub/rfc/rfc-index.txt'; my $expected_length; my $bytes_received = 0; my $res = $ua->request(HTTP::Request->new(GET => $URL), sub { my($chunk, $res) = @_; $bytes_received += length($chunk); unless (defined $expected_length) { $expected_length = $res->content_length || 0; } if ($expected_length) { printf STDERR "%d%% - ", 100 * $bytes_received / $expected_length; } print STDERR "$bytes_received bytes received\n"; # XXX Should really do something with the chunk itself # print $chunk; }); print $res->status_line, "\n"; =head1 COPYRIGHT Copyright 1996-2001, Gisle Aas This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������darwin-perl-lib/lwptut.pod��������������������������������������������������������������������������000444 �000765 �000024 �00000061614 13167163507 020035� 0����������������������������������������������������������������������������������������������������ustar�00ocsinventory��������������������staff���������������������������000000 �000000 ������������������������������������������������������������������������������������������������������������������������������������������������������������������������=head1 NAME lwptut -- An LWP Tutorial =head1 DESCRIPTION LWP (short for "Library for WWW in Perl") is a very popular group of Perl modules for accessing data on the Web. Like most Perl module-distributions, each of LWP's component modules comes with documentation that is a complete reference to its interface. However, there are so many modules in LWP that it's hard to know where to start looking for information on how to do even the simplest most common things. Really introducing you to using LWP would require a whole book -- a book that just happens to exist, called I<Perl & LWP>. But this article should give you a taste of how you can go about some common tasks with LWP. =head2 Getting documents with LWP::Simple If you just want to get what's at a particular URL, the simplest way to do it is LWP::Simple's functions. In a Perl program, you can call its C<get($url)> function. It will try getting that URL's content. If it works, then it'll return the content; but if there's some error, it'll return undef. my $url = 'http://www.npr.org/programs/fa/?todayDate=current'; # Just an example: the URL for the most recent /Fresh Air/ show use LWP::Simple; my $content = get $url; die "Couldn't get $url" unless defined $content; # Then go do things with $content, like this: if($content =~ m/jazz/i) { print "They're talking about jazz today on Fresh Air!\n"; } else { print "Fresh Air is apparently jazzless today.\n"; } The handiest variant on C<get> is C<getprint>, which is useful in Perl one-liners. If it can get the page whose URL you provide, it sends it to STDOUT; otherwise it complains to STDERR. % perl -MLWP::Simple -e "getprint 'http://www.cpan.org/RECENT'" That is the URL of a plain text file that lists new files in CPAN in the past two weeks. You can easily make it part of a tidy little shell command, like this one that mails you the list of new C<Acme::> modules: % perl -MLWP::Simple -e "getprint 'http://www.cpan.org/RECENT'" \ | grep "/by-module/Acme" | mail -s "New Acme modules! Joy!" $USER There are other useful functions in LWP::Simple, including one function for running a HEAD request on a URL (useful for checking links, or getting the last-revised time of a URL), and two functions for saving/mirroring a URL to a local file. See L<the LWP::Simple documentation|LWP::Simple> for the full details, or chapter 2 of I<Perl & LWP> for more examples. =for comment ########################################################################## =head2 The Basics of the LWP Class Model LWP::Simple's functions are handy for simple cases, but its functions don't support cookies or authorization, don't support setting header lines in the HTTP request, generally don't support reading header lines in the HTTP response (notably the full HTTP error message, in case of an error). To get at all those features, you'll have to use the full LWP class model. While LWP consists of dozens of classes, the main two that you have to understand are L<LWP::UserAgent> and L<HTTP::Response>. LWP::UserAgent is a class for "virtual browsers" which you use for performing requests, and L<HTTP::Response> is a class for the responses (or error messages) that you get back from those requests. The basic idiom is C<< $response = $browser->get($url) >>, or more fully illustrated: # Early in your program: use LWP 5.64; # Loads all important LWP classes, and makes # sure your version is reasonably recent. my $browser = LWP::UserAgent->new; ... # Then later, whenever you need to make a get request: my $url = 'http://www.npr.org/programs/fa/?todayDate=current'; my $response = $browser->get( $url ); die "Can't get $url -- ", $response->status_line unless $response->is_success; die "Hey, I was expecting HTML, not ", $response->content_type unless $response->content_type eq 'text/html'; # or whatever content-type you're equipped to deal with # Otherwise, process the content somehow: if($response->decoded_content =~ m/jazz/i) { print "They're talking about jazz today on Fresh Air!\n"; } else { print "Fresh Air is apparently jazzless today.\n"; } There are two objects involved: C<$browser>, which holds an object of class LWP::UserAgent, and then the C<$response> object, which is of class HTTP::Response. You really need only one browser object per program; but every time you make a request, you get back a new HTTP::Response object, which will have some interesting attributes: =over =item * A status code indicating success or failure (which you can test with C<< $response->is_success >>). =item * An HTTP status line that is hopefully informative if there's failure (which you can see with C<< $response->status_line >>, returning something like "404 Not Found"). =item * A MIME content-type like "text/html", "image/gif", "application/xml", etc., which you can see with C<< $response->content_type >> =item * The actual content of the response, in C<< $response->decoded_content >>. If the response is HTML, that's where the HTML source will be; if it's a GIF, then C<< $response->decoded_content >> will be the binary GIF data. =item * And dozens of other convenient and more specific methods that are documented in the docs for L<HTTP::Response>, and its superclasses L<HTTP::Message> and L<HTTP::Headers>. =back =for comment ########################################################################## =head2 Adding Other HTTP Request Headers The most commonly used syntax for requests is C<< $response = $browser->get($url) >>, but in truth, you can add extra HTTP header lines to the request by adding a list of key-value pairs after the URL, like so: $response = $browser->get( $url, $key1, $value1, $key2, $value2, ... ); For example, here's how to send some more Netscape-like headers, in case you're dealing with a site that would otherwise reject your request: my @ns_headers = ( 'User-Agent' => 'Mozilla/4.76 [en] (Win98; U)', 'Accept' => 'image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, image/png, */*', 'Accept-Charset' => 'iso-8859-1,*,utf-8', 'Accept-Language' => 'en-US', ); ... $response = $browser->get($url, @ns_headers); If you weren't reusing that array, you could just go ahead and do this: $response = $browser->get($url, 'User-Agent' => 'Mozilla/4.76 [en] (Win98; U)', 'Accept' => 'image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, image/png, */*', 'Accept-Charset' => 'iso-8859-1,*,utf-8', 'Accept-Language' => 'en-US', ); If you were only ever changing the 'User-Agent' line, you could just change the C<$browser> object's default line from "libwww-perl/5.65" (or the like) to whatever you like, using the LWP::UserAgent C<agent> method: $browser->agent('Mozilla/4.76 [en] (Win98; U)'); =for comment ########################################################################## =head2 Enabling Cookies A default LWP::UserAgent object acts like a browser with its cookies support turned off. There are various ways of turning it on, by setting its C<cookie_jar> attribute. A "cookie jar" is an object representing a little database of all the HTTP cookies that a browser can know about. It can correspond to a file on disk (the way Netscape uses its F<cookies.txt> file), or it can be just an in-memory object that starts out empty, and whose collection of cookies will disappear once the program is finished running. To give a browser an in-memory empty cookie jar, you set its C<cookie_jar> attribute like so: $browser->cookie_jar({}); To give it a copy that will be read from a file on disk, and will be saved to it when the program is finished running, set the C<cookie_jar> attribute like this: use HTTP::Cookies; $browser->cookie_jar( HTTP::Cookies->new( 'file' => '/some/where/cookies.lwp', # where to read/write cookies 'autosave' => 1, # save it to disk when done )); That file will be an LWP-specific format. If you want to be access the cookies in your Netscape cookies file, you can use the HTTP::Cookies::Netscape class: use HTTP::Cookies; # yes, loads HTTP::Cookies::Netscape too $browser->cookie_jar( HTTP::Cookies::Netscape->new( 'file' => 'c:/Program Files/Netscape/Users/DIR-NAME-HERE/cookies.txt', # where to read cookies )); You could add an C<< 'autosave' => 1 >> line as further above, but at time of writing, it's uncertain whether Netscape might discard some of the cookies you could be writing back to disk. =for comment ########################################################################## =head2 Posting Form Data Many HTML forms send data to their server using an HTTP POST request, which you can send with this syntax: $response = $browser->post( $url, [ formkey1 => value1, formkey2 => value2, ... ], ); Or if you need to send HTTP headers: $response = $browser->post( $url, [ formkey1 => value1, formkey2 => value2, ... ], headerkey1 => value1, headerkey2 => value2, ); For example, the following program makes a search request to AltaVista (by sending some form data via an HTTP POST request), and extracts from the HTML the report of the number of matches: use strict; use warnings; use LWP 5.64; my $browser = LWP::UserAgent->new; my $word = 'tarragon'; my $url = 'http://search.yahoo.com/yhs/search'; my $response = $browser->post( $url, [ 'q' => $word, # the Altavista query string 'fr' => 'altavista', 'pg' => 'q', 'avkw' => 'tgz', 'kl' => 'XX', ] ); die "$url error: ", $response->status_line unless $response->is_success; die "Weird content type at $url -- ", $response->content_type unless $response->content_is_html; if( $response->decoded_content =~ m{([0-9,]+)(?:<.*?>)? results for} ) { # The substring will be like "996,000</strong> results for" print "$word: $1\n"; } else { print "Couldn't find the match-string in the response\n"; } =for comment ########################################################################## =head2 Sending GET Form Data Some HTML forms convey their form data not by sending the data in an HTTP POST request, but by making a normal GET request with the data stuck on the end of the URL. For example, if you went to C<www.imdb.com> and ran a search on "Blade Runner", the URL you'd see in your browser window would be: http://www.imdb.com/find?s=all&q=Blade+Runner To run the same search with LWP, you'd use this idiom, which involves the URI class: use URI; my $url = URI->new( 'http://www.imdb.com/find' ); # makes an object representing the URL $url->query_form( # And here the form data pairs: 'q' => 'Blade Runner', 's' => 'all', ); my $response = $browser->get($url); See chapter 5 of I<Perl & LWP> for a longer discussion of HTML forms and of form data, and chapters 6 through 9 for a longer discussion of extracting data from HTML. =head2 Absolutizing URLs The URI class that we just mentioned above provides all sorts of methods for accessing and modifying parts of URLs (such as asking sort of URL it is with C<< $url->scheme >>, and asking what host it refers to with C<< $url->host >>, and so on, as described in L<the docs for the URI class|URI>. However, the methods of most immediate interest are the C<query_form> method seen above, and now the C<new_abs> method for taking a probably-relative URL string (like "../foo.html") and getting back an absolute URL (like "http://www.perl.com/stuff/foo.html"), as shown here: use URI; $abs = URI->new_abs($maybe_relative, $base); For example, consider this program that matches URLs in the HTML list of new modules in CPAN: use strict; use warnings; use LWP; my $browser = LWP::UserAgent->new; my $url = 'http://www.cpan.org/RECENT.html'; my $response = $browser->get($url); die "Can't get $url -- ", $response->status_line unless $response->is_success; my $html = $response->decoded_content; while( $html =~ m/<A HREF=\"(.*?)\"/g ) { print "$1\n"; } When run, it emits output that starts out something like this: MIRRORING.FROM RECENT RECENT.html authors/00whois.html authors/01mailrc.txt.gz authors/id/A/AA/AASSAD/CHECKSUMS ... However, if you actually want to have those be absolute URLs, you can use the URI module's C<new_abs> method, by changing the C<while> loop to this: while( $html =~ m/<A HREF=\"(.*?)\"/g ) { print URI->new_abs( $1, $response->base ) ,"\n"; } (The C<< $response->base >> method from L<HTTP::Message|HTTP::Message> is for returning what URL should be used for resolving relative URLs -- it's usually just the same as the URL that you requested.) That program then emits nicely absolute URLs: http://www.cpan.org/MIRRORING.FROM http://www.cpan.org/RECENT http://www.cpan.org/RECENT.html http://www.cpan.org/authors/00whois.html http://www.cpan.org/authors/01mailrc.txt.gz http://www.cpan.org/authors/id/A/AA/AASSAD/CHECKSUMS ... See chapter 4 of I<Perl & LWP> for a longer discussion of URI objects. Of course, using a regexp to match hrefs is a bit simplistic, and for more robust programs, you'll probably want to use an HTML-parsing module like L<HTML::LinkExtor> or L<HTML::TokeParser> or even maybe L<HTML::TreeBuilder>. =for comment ########################################################################## =head2 Other Browser Attributes LWP::UserAgent objects have many attributes for controlling how they work. Here are a few notable ones: =over =item * C<< $browser->timeout(15); >> This sets this browser object to give up on requests that don't answer within 15 seconds. =item * C<< $browser->protocols_allowed( [ 'http', 'gopher'] ); >> This sets this browser object to not speak any protocols other than HTTP and gopher. If it tries accessing any other kind of URL (like an "ftp:" or "mailto:" or "news:" URL), then it won't actually try connecting, but instead will immediately return an error code 500, with a message like "Access to 'ftp' URIs has been disabled". =item * C<< use LWP::ConnCache; $browser->conn_cache(LWP::ConnCache->new()); >> This tells the browser object to try using the HTTP/1.1 "Keep-Alive" feature, which speeds up requests by reusing the same socket connection for multiple requests to the same server. =item * C<< $browser->agent( 'SomeName/1.23 (more info here maybe)' ) >> This changes how the browser object will identify itself in the default "User-Agent" line is its HTTP requests. By default, it'll send "libwww-perl/I<versionnumber>", like "libwww-perl/5.65". You can change that to something more descriptive like this: $browser->agent( 'SomeName/3.14 (contact@robotplexus.int)' ); Or if need be, you can go in disguise, like this: $browser->agent( 'Mozilla/4.0 (compatible; MSIE 5.12; Mac_PowerPC)' ); =item * C<< push @{ $ua->requests_redirectable }, 'POST'; >> This tells this browser to obey redirection responses to POST requests (like most modern interactive browsers), even though the HTTP RFC says that should not normally be done. =back For more options and information, see L<the full documentation for LWP::UserAgent|LWP::UserAgent>. =for comment ########################################################################## =head2 Writing Polite Robots If you want to make sure that your LWP-based program respects F<robots.txt> files and doesn't make too many requests too fast, you can use the LWP::RobotUA class instead of the LWP::UserAgent class. LWP::RobotUA class is just like LWP::UserAgent, and you can use it like so: use LWP::RobotUA; my $browser = LWP::RobotUA->new('YourSuperBot/1.34', 'you@yoursite.com'); # Your bot's name and your email address my $response = $browser->get($url); But HTTP::RobotUA adds these features: =over =item * If the F<robots.txt> on C<$url>'s server forbids you from accessing C<$url>, then the C<$browser> object (assuming it's of class LWP::RobotUA) won't actually request it, but instead will give you back (in C<$response>) a 403 error with a message "Forbidden by robots.txt". That is, if you have this line: die "$url -- ", $response->status_line, "\nAborted" unless $response->is_success; then the program would die with an error message like this: http://whatever.site.int/pith/x.html -- 403 Forbidden by robots.txt Aborted at whateverprogram.pl line 1234 =item * If this C<$browser> object sees that the last time it talked to C<$url>'s server was too recently, then it will pause (via C<sleep>) to avoid making too many requests too often. How long it will pause for, is by default one minute -- but you can control it with the C<< $browser->delay( I<minutes> ) >> attribute. For example, this code: $browser->delay( 7/60 ); ...means that this browser will pause when it needs to avoid talking to any given server more than once every 7 seconds. =back For more options and information, see L<the full documentation for LWP::RobotUA|LWP::RobotUA>. =for comment ########################################################################## =head2 Using Proxies In some cases, you will want to (or will have to) use proxies for accessing certain sites and/or using certain protocols. This is most commonly the case when your LWP program is running (or could be running) on a machine that is behind a firewall. To make a browser object use proxies that are defined in the usual environment variables (C<HTTP_PROXY>, etc.), just call the C<env_proxy> on a user-agent object before you go making any requests on it. Specifically: use LWP::UserAgent; my $browser = LWP::UserAgent->new; # And before you go making any requests: $browser->env_proxy; For more information on proxy parameters, see L<the LWP::UserAgent documentation|LWP::UserAgent>, specifically the C<proxy>, C<env_proxy>, and C<no_proxy> methods. =for comment ########################################################################## =head2 HTTP Authentication Many web sites restrict access to documents by using "HTTP Authentication". This isn't just any form of "enter your password" restriction, but is a specific mechanism where the HTTP server sends the browser an HTTP code that says "That document is part of a protected 'realm', and you can access it only if you re-request it and add some special authorization headers to your request". For example, the Unicode.org admins stop email-harvesting bots from harvesting the contents of their mailing list archives, by protecting them with HTTP Authentication, and then publicly stating the username and password (at C<http://www.unicode.org/mail-arch/>) -- namely username "unicode-ml" and password "unicode". For example, consider this URL, which is part of the protected area of the web site: http://www.unicode.org/mail-arch/unicode-ml/y2002-m08/0067.html If you access that with a browser, you'll get a prompt like "Enter username and password for 'Unicode-MailList-Archives' at server 'www.unicode.org'". In LWP, if you just request that URL, like this: use LWP; my $browser = LWP::UserAgent->new; my $url = 'http://www.unicode.org/mail-arch/unicode-ml/y2002-m08/0067.html'; my $response = $browser->get($url); die "Error: ", $response->header('WWW-Authenticate') || 'Error accessing', # ('WWW-Authenticate' is the realm-name) "\n ", $response->status_line, "\n at $url\n Aborting" unless $response->is_success; Then you'll get this error: Error: Basic realm="Unicode-MailList-Archives" 401 Authorization Required at http://www.unicode.org/mail-arch/unicode-ml/y2002-m08/0067.html Aborting at auth1.pl line 9. [or wherever] ...because the C<$browser> doesn't know any the username and password for that realm ("Unicode-MailList-Archives") at that host ("www.unicode.org"). The simplest way to let the browser know about this is to use the C<credentials> method to let it know about a username and password that it can try using for that realm at that host. The syntax is: $browser->credentials( 'servername:portnumber', 'realm-name', 'username' => 'password' ); In most cases, the port number is 80, the default TCP/IP port for HTTP; and you usually call the C<credentials> method before you make any requests. For example: $browser->credentials( 'reports.mybazouki.com:80', 'web_server_usage_reports', 'plinky' => 'banjo123' ); So if we add the following to the program above, right after the C<< $browser = LWP::UserAgent->new; >> line... $browser->credentials( # add this to our $browser 's "key ring" 'www.unicode.org:80', 'Unicode-MailList-Archives', 'unicode-ml' => 'unicode' ); ...then when we run it, the request succeeds, instead of causing the C<die> to be called. =for comment ########################################################################## =head2 Accessing HTTPS URLs When you access an HTTPS URL, it'll work for you just like an HTTP URL would -- if your LWP installation has HTTPS support (via an appropriate Secure Sockets Layer library). For example: use LWP; my $url = 'https://www.paypal.com/'; # Yes, HTTPS! my $browser = LWP::UserAgent->new; my $response = $browser->get($url); die "Error at $url\n ", $response->status_line, "\n Aborting" unless $response->is_success; print "Whee, it worked! I got that ", $response->content_type, " document!\n"; If your LWP installation doesn't have HTTPS support set up, then the response will be unsuccessful, and you'll get this error message: Error at https://www.paypal.com/ 501 Protocol scheme 'https' is not supported Aborting at paypal.pl line 7. [or whatever program and line] If your LWP installation I<does> have HTTPS support installed, then the response should be successful, and you should be able to consult C<$response> just like with any normal HTTP response. For information about installing HTTPS support for your LWP installation, see the helpful F<README.SSL> file that comes in the libwww-perl distribution. =for comment ########################################################################## =head2 Getting Large Documents When you're requesting a large (or at least potentially large) document, a problem with the normal way of using the request methods (like C<< $response = $browser->get($url) >>) is that the response object in memory will have to hold the whole document -- I<in memory>. If the response is a thirty megabyte file, this is likely to be quite an imposition on this process's memory usage. A notable alternative is to have LWP save the content to a file on disk, instead of saving it up in memory. This is the syntax to use: $response = $ua->get($url, ':content_file' => $filespec, ); For example, $response = $ua->get('http://search.cpan.org/', ':content_file' => '/tmp/sco.html' ); When you use this C<:content_file> option, the C<$response> will have all the normal header lines, but C<< $response->content >> will be empty. Note that this ":content_file" option isn't supported under older versions of LWP, so you should consider adding C<use LWP 5.66;> to check the LWP version, if you think your program might run on systems with older versions. If you need to be compatible with older LWP versions, then use this syntax, which does the same thing: use HTTP::Request::Common; $response = $ua->request( GET($url), $filespec ); =for comment ########################################################################## =head1 SEE ALSO Remember, this article is just the most rudimentary introduction to LWP -- to learn more about LWP and LWP-related tasks, you really must read from the following: =over =item * L<LWP::Simple> -- simple functions for getting/heading/mirroring URLs =item * L<LWP> -- overview of the libwww-perl modules =item * L<LWP::UserAgent> -- the class for objects that represent "virtual browsers" =item * L<HTTP::Response> -- the class for objects that represent the response to a LWP response, as in C<< $response = $browser->get(...) >> =item * L<HTTP::Message> and L<HTTP::Headers> -- classes that provide more methods to HTTP::Response. =item * L<URI> -- class for objects that represent absolute or relative URLs =item * L<URI::Escape> -- functions for URL-escaping and URL-unescaping strings (like turning "this & that" to and from "this%20%26%20that"). =item * L<HTML::Entities> -- functions for HTML-escaping and HTML-unescaping strings (like turning "C. & E. BrontE<euml>" to and from "C. & E. Brontë") =item * L<HTML::TokeParser> and L<HTML::TreeBuilder> -- classes for parsing HTML =item * L<HTML::LinkExtor> -- class for finding links in HTML documents =item * The book I<Perl & LWP> by Sean M. Burke. O'Reilly & Associates, 2002. ISBN: 0-596-00178-9, L<http://oreilly.com/catalog/perllwp/>. The whole book is also available free online: L<http://lwp.interglacial.com>. =back =head1 COPYRIGHT Copyright 2002, Sean M. Burke. You can redistribute this document and/or modify it, but only under the same terms as Perl itself. =head1 AUTHOR Sean M. Burke C<sburke@cpan.org> =for comment ########################################################################## =cut # End of Pod ��������������������������������������������������������������������������������������������������������������������darwin-perl-lib/Mac/��������������������������������������������������������������������������������000755 �000765 �000024 �00000000000 13167163507 016464� 5����������������������������������������������������������������������������������������������������ustar�00ocsinventory��������������������staff���������������������������000000 �000000 ������������������������������������������������������������������������������������������������������������������������������������������������������������������������darwin-perl-lib/Mozilla/����������������������������������������������������������������������������000755 �000765 �000024 �00000000000 13167163507 017373� 5����������������������������������������������������������������������������������������������������ustar�00ocsinventory��������������������staff���������������������������000000 �000000 ������������������������������������������������������������������������������������������������������������������������������������������������������������������������darwin-perl-lib/Net/��������������������������������������������������������������������������������000755 �000765 �000024 �00000000000 13167163507 016512� 5����������������������������������������������������������������������������������������������������ustar�00ocsinventory��������������������staff���������������������������000000 �000000 ������������������������������������������������������������������������������������������������������������������������������������������������������������������������darwin-perl-lib/URI/��������������������������������������������������������������������������������000755 �000765 �000024 �00000000000 13167163507 016423� 5����������������������������������������������������������������������������������������������������ustar�00ocsinventory��������������������staff���������������������������000000 �000000 ������������������������������������������������������������������������������������������������������������������������������������������������������������������������darwin-perl-lib/URI.pm������������������������������������������������������������������������������000444 �000765 �000024 �00000103733 13167163507 016766� 0����������������������������������������������������������������������������������������������������ustar�00ocsinventory��������������������staff���������������������������000000 �000000 ������������������������������������������������������������������������������������������������������������������������������������������������������������������������package URI; use strict; use warnings; our $VERSION = '1.72'; $VERSION = eval $VERSION; our ($ABS_REMOTE_LEADING_DOTS, $ABS_ALLOW_RELATIVE_SCHEME, $DEFAULT_QUERY_FORM_DELIMITER); my %implements; # mapping from scheme to implementor class # Some "official" character classes our $reserved = q(;/?:@&=+$,[]); our $mark = q(-_.!~*'()); #'; emacs our $unreserved = "A-Za-z0-9\Q$mark\E"; our $uric = quotemeta($reserved) . $unreserved . "%"; our $scheme_re = '[a-zA-Z][a-zA-Z0-9.+\-]*'; use Carp (); use URI::Escape (); use overload ('""' => sub { ${$_[0]} }, '==' => sub { _obj_eq(@_) }, '!=' => sub { !_obj_eq(@_) }, fallback => 1, ); # Check if two objects are the same object sub _obj_eq { return overload::StrVal($_[0]) eq overload::StrVal($_[1]); } sub new { my($class, $uri, $scheme) = @_; $uri = defined ($uri) ? "$uri" : ""; # stringify # Get rid of potential wrapping $uri =~ s/^<(?:URL:)?(.*)>$/$1/; # $uri =~ s/^"(.*)"$/$1/; $uri =~ s/^\s+//; $uri =~ s/\s+$//; my $impclass; if ($uri =~ m/^($scheme_re):/so) { $scheme = $1; } else { if (($impclass = ref($scheme))) { $scheme = $scheme->scheme; } elsif ($scheme && $scheme =~ m/^($scheme_re)(?::|$)/o) { $scheme = $1; } } $impclass ||= implementor($scheme) || do { require URI::_foreign; $impclass = 'URI::_foreign'; }; return $impclass->_init($uri, $scheme); } sub new_abs { my($class, $uri, $base) = @_; $uri = $class->new($uri, $base); $uri->abs($base); } sub _init { my $class = shift; my($str, $scheme) = @_; # find all funny characters and encode the bytes. $str = $class->_uric_escape($str); $str = "$scheme:$str" unless $str =~ /^$scheme_re:/o || $class->_no_scheme_ok; my $self = bless \$str, $class; $self; } sub _uric_escape { my($class, $str) = @_; $str =~ s*([^$uric\#])* URI::Escape::escape_char($1) *ego; utf8::downgrade($str); return $str; } my %require_attempted; sub implementor { my($scheme, $impclass) = @_; if (!$scheme || $scheme !~ /\A$scheme_re\z/o) { require URI::_generic; return "URI::_generic"; } $scheme = lc($scheme); if ($impclass) { # Set the implementor class for a given scheme my $old = $implements{$scheme}; $impclass->_init_implementor($scheme); $implements{$scheme} = $impclass; return $old; } my $ic = $implements{$scheme}; return $ic if $ic; # scheme not yet known, look for internal or # preloaded (with 'use') implementation $ic = "URI::$scheme"; # default location # turn scheme into a valid perl identifier by a simple transformation... $ic =~ s/\+/_P/g; $ic =~ s/\./_O/g; $ic =~ s/\-/_/g; no strict 'refs'; # check we actually have one for the scheme: unless (@{"${ic}::ISA"}) { if (not exists $require_attempted{$ic}) { # Try to load it my $_old_error = $@; eval "require $ic"; die $@ if $@ && $@ !~ /Can\'t locate.*in \@INC/; $@ = $_old_error; } return undef unless @{"${ic}::ISA"}; } $ic->_init_implementor($scheme); $implements{$scheme} = $ic; $ic; } sub _init_implementor { my($class, $scheme) = @_; # Remember that one implementor class may actually # serve to implement several URI schemes. } sub clone { my $self = shift; my $other = $$self; bless \$other, ref $self; } sub TO_JSON { ${$_[0]} } sub _no_scheme_ok { 0 } sub _scheme { my $self = shift; unless (@_) { return undef unless $$self =~ /^($scheme_re):/o; return $1; } my $old; my $new = shift; if (defined($new) && length($new)) { Carp::croak("Bad scheme '$new'") unless $new =~ /^$scheme_re$/o; $old = $1 if $$self =~ s/^($scheme_re)://o; my $newself = URI->new("$new:$$self"); $$self = $$newself; bless $self, ref($newself); } else { if ($self->_no_scheme_ok) { $old = $1 if $$self =~ s/^($scheme_re)://o; Carp::carp("Oops, opaque part now look like scheme") if $^W && $$self =~ m/^$scheme_re:/o } else { $old = $1 if $$self =~ m/^($scheme_re):/o; } } return $old; } sub scheme { my $scheme = shift->_scheme(@_); return undef unless defined $scheme; lc($scheme); } sub has_recognized_scheme { my $self = shift; return ref($self) !~ /^URI::_(?:foreign|generic)\z/; } sub opaque { my $self = shift; unless (@_) { $$self =~ /^(?:$scheme_re:)?([^\#]*)/o or die; return $1; } $$self =~ /^($scheme_re:)? # optional scheme ([^\#]*) # opaque (\#.*)? # optional fragment $/sx or die; my $old_scheme = $1; my $old_opaque = $2; my $old_frag = $3; my $new_opaque = shift; $new_opaque = "" unless defined $new_opaque; $new_opaque =~ s/([^$uric])/ URI::Escape::escape_char($1)/ego; utf8::downgrade($new_opaque); $$self = defined($old_scheme) ? $old_scheme : ""; $$self .= $new_opaque; $$self .= $old_frag if defined $old_frag; $old_opaque; } sub path { goto &opaque } # alias sub fragment { my $self = shift; unless (@_) { return undef unless $$self =~ /\#(.*)/s; return $1; } my $old; $old = $1 if $$self =~ s/\#(.*)//s; my $new_frag = shift; if (defined $new_frag) { $new_frag =~ s/([^$uric])/ URI::Escape::escape_char($1) /ego; utf8::downgrade($new_frag); $$self .= "#$new_frag"; } $old; } sub as_string { my $self = shift; $$self; } sub as_iri { my $self = shift; my $str = $$self; if ($str =~ s/%([89a-fA-F][0-9a-fA-F])/chr(hex($1))/eg) { # All this crap because the more obvious: # # Encode::decode("UTF-8", $str, sub { sprintf "%%%02X", shift }) # # doesn't work before Encode 2.39. Wait for a standard release # to bundle that version. require Encode; my $enc = Encode::find_encoding("UTF-8"); my $u = ""; while (length $str) { $u .= $enc->decode($str, Encode::FB_QUIET()); if (length $str) { # escape next char $u .= URI::Escape::escape_char(substr($str, 0, 1, "")); } } $str = $u; } return $str; } sub canonical { # Make sure scheme is lowercased, that we don't escape unreserved chars, # and that we use upcase escape sequences. my $self = shift; my $scheme = $self->_scheme || ""; my $uc_scheme = $scheme =~ /[A-Z]/; my $esc = $$self =~ /%[a-fA-F0-9]{2}/; return $self unless $uc_scheme || $esc; my $other = $self->clone; if ($uc_scheme) { $other->_scheme(lc $scheme); } if ($esc) { $$other =~ s{%([0-9a-fA-F]{2})} { my $a = chr(hex($1)); $a =~ /^[$unreserved]\z/o ? $a : "%\U$1" }ge; } return $other; } # Compare two URIs, subclasses will provide a more correct implementation sub eq { my($self, $other) = @_; $self = URI->new($self, $other) unless ref $self; $other = URI->new($other, $self) unless ref $other; ref($self) eq ref($other) && # same class $self->canonical->as_string eq $other->canonical->as_string; } # generic-URI transformation methods sub abs { $_[0]; } sub rel { $_[0]; } sub secure { 0 } # help out Storable sub STORABLE_freeze { my($self, $cloning) = @_; return $$self; } sub STORABLE_thaw { my($self, $cloning, $str) = @_; $$self = $str; } 1; __END__ =head1 NAME URI - Uniform Resource Identifiers (absolute and relative) =head1 SYNOPSIS $u1 = URI->new("http://www.perl.com"); $u2 = URI->new("foo", "http"); $u3 = $u2->abs($u1); $u4 = $u3->clone; $u5 = URI->new("HTTP://WWW.perl.com:80")->canonical; $str = $u->as_string; $str = "$u"; $scheme = $u->scheme; $opaque = $u->opaque; $path = $u->path; $frag = $u->fragment; $u->scheme("ftp"); $u->host("ftp.perl.com"); $u->path("cpan/"); =head1 DESCRIPTION This module implements the C<URI> class. Objects of this class represent "Uniform Resource Identifier references" as specified in RFC 2396 (and updated by RFC 2732). A Uniform Resource Identifier is a compact string of characters that identifies an abstract or physical resource. A Uniform Resource Identifier can be further classified as either a Uniform Resource Locator (URL) or a Uniform Resource Name (URN). The distinction between URL and URN does not matter to the C<URI> class interface. A "URI-reference" is a URI that may have additional information attached in the form of a fragment identifier. An absolute URI reference consists of three parts: a I<scheme>, a I<scheme-specific part> and a I<fragment> identifier. A subset of URI references share a common syntax for hierarchical namespaces. For these, the scheme-specific part is further broken down into I<authority>, I<path> and I<query> components. These URIs can also take the form of relative URI references, where the scheme (and usually also the authority) component is missing, but implied by the context of the URI reference. The three forms of URI reference syntax are summarized as follows: <scheme>:<scheme-specific-part>#<fragment> <scheme>://<authority><path>?<query>#<fragment> <path>?<query>#<fragment> The components into which a URI reference can be divided depend on the I<scheme>. The C<URI> class provides methods to get and set the individual components. The methods available for a specific C<URI> object depend on the scheme. =head1 CONSTRUCTORS The following methods construct new C<URI> objects: =over 4 =item $uri = URI->new( $str ) =item $uri = URI->new( $str, $scheme ) Constructs a new URI object. The string representation of a URI is given as argument, together with an optional scheme specification. Common URI wrappers like "" and <>, as well as leading and trailing white space, are automatically removed from the $str argument before it is processed further. The constructor determines the scheme, maps this to an appropriate URI subclass, constructs a new object of that class and returns it. If the scheme isn't one of those that URI recognizes, you still get an URI object back that you can access the generic methods on. The C<< $uri->has_recognized_scheme >> method can be used to test for this. The $scheme argument is only used when $str is a relative URI. It can be either a simple string that denotes the scheme, a string containing an absolute URI reference, or an absolute C<URI> object. If no $scheme is specified for a relative URI $str, then $str is simply treated as a generic URI (no scheme-specific methods available). The set of characters available for building URI references is restricted (see L<URI::Escape>). Characters outside this set are automatically escaped by the URI constructor. =item $uri = URI->new_abs( $str, $base_uri ) Constructs a new absolute URI object. The $str argument can denote a relative or absolute URI. If relative, then it is absolutized using $base_uri as base. The $base_uri must be an absolute URI. =item $uri = URI::file->new( $filename ) =item $uri = URI::file->new( $filename, $os ) Constructs a new I<file> URI from a file name. See L<URI::file>. =item $uri = URI::file->new_abs( $filename ) =item $uri = URI::file->new_abs( $filename, $os ) Constructs a new absolute I<file> URI from a file name. See L<URI::file>. =item $uri = URI::file->cwd Returns the current working directory as a I<file> URI. See L<URI::file>. =item $uri->clone Returns a copy of the $uri. =back =head1 COMMON METHODS The methods described in this section are available for all C<URI> objects. Methods that give access to components of a URI always return the old value of the component. The value returned is C<undef> if the component was not present. There is generally a difference between a component that is empty (represented as C<"">) and a component that is missing (represented as C<undef>). If an accessor method is given an argument, it updates the corresponding component in addition to returning the old value of the component. Passing an undefined argument removes the component (if possible). The description of each accessor method indicates whether the component is passed as an escaped (percent-encoded) or an unescaped string. A component that can be further divided into sub-parts are usually passed escaped, as unescaping might change its semantics. The common methods available for all URI are: =over 4 =item $uri->scheme =item $uri->scheme( $new_scheme ) Sets and returns the scheme part of the $uri. If the $uri is relative, then $uri->scheme returns C<undef>. If called with an argument, it updates the scheme of $uri, possibly changing the class of $uri, and returns the old scheme value. The method croaks if the new scheme name is illegal; a scheme name must begin with a letter and must consist of only US-ASCII letters, numbers, and a few special marks: ".", "+", "-". This restriction effectively means that the scheme must be passed unescaped. Passing an undefined argument to the scheme method makes the URI relative (if possible). Letter case does not matter for scheme names. The string returned by $uri->scheme is always lowercase. If you want the scheme just as it was written in the URI in its original case, you can use the $uri->_scheme method instead. =item $uri->has_recognized_scheme Returns TRUE if the URI scheme is one that URI recognizes. It will also be TRUE for relative URLs where a recognized scheme was provided to the constructor, even if C<< $uri->scheme >> returns C<undef> for these. =item $uri->opaque =item $uri->opaque( $new_opaque ) Sets and returns the scheme-specific part of the $uri (everything between the scheme and the fragment) as an escaped string. =item $uri->path =item $uri->path( $new_path ) Sets and returns the same value as $uri->opaque unless the URI supports the generic syntax for hierarchical namespaces. In that case the generic method is overridden to set and return the part of the URI between the I<host name> and the I<fragment>. =item $uri->fragment =item $uri->fragment( $new_frag ) Returns the fragment identifier of a URI reference as an escaped string. =item $uri->as_string Returns a URI object to a plain ASCII string. URI objects are also converted to plain strings automatically by overloading. This means that $uri objects can be used as plain strings in most Perl constructs. =item $uri->as_iri Returns a Unicode string representing the URI. Escaped UTF-8 sequences representing non-ASCII characters are turned into their corresponding Unicode code point. =item $uri->canonical Returns a normalized version of the URI. The rules for normalization are scheme-dependent. They usually involve lowercasing the scheme and Internet host name components, removing the explicit port specification if it matches the default port, uppercasing all escape sequences, and unescaping octets that can be better represented as plain characters. For efficiency reasons, if the $uri is already in normalized form, then a reference to it is returned instead of a copy. =item $uri->eq( $other_uri ) =item URI::eq( $first_uri, $other_uri ) Tests whether two URI references are equal. URI references that normalize to the same string are considered equal. The method can also be used as a plain function which can also test two string arguments. If you need to test whether two C<URI> object references denote the same object, use the '==' operator. =item $uri->abs( $base_uri ) Returns an absolute URI reference. If $uri is already absolute, then a reference to it is simply returned. If the $uri is relative, then a new absolute URI is constructed by combining the $uri and the $base_uri, and returned. =item $uri->rel( $base_uri ) Returns a relative URI reference if it is possible to make one that denotes the same resource relative to $base_uri. If not, then $uri is simply returned. =item $uri->secure Returns a TRUE value if the URI is considered to point to a resource on a secure channel, such as an SSL or TLS encrypted one. =back =head1 GENERIC METHODS The following methods are available to schemes that use the common/generic syntax for hierarchical namespaces. The descriptions of schemes below indicate which these are. Unrecognized schemes are assumed to support the generic syntax, and therefore the following methods: =over 4 =item $uri->authority =item $uri->authority( $new_authority ) Sets and returns the escaped authority component of the $uri. =item $uri->path =item $uri->path( $new_path ) Sets and returns the escaped path component of the $uri (the part between the host name and the query or fragment). The path can never be undefined, but it can be the empty string. =item $uri->path_query =item $uri->path_query( $new_path_query ) Sets and returns the escaped path and query components as a single entity. The path and the query are separated by a "?" character, but the query can itself contain "?". =item $uri->path_segments =item $uri->path_segments( $segment, ... ) Sets and returns the path. In a scalar context, it returns the same value as $uri->path. In a list context, it returns the unescaped path segments that make up the path. Path segments that have parameters are returned as an anonymous array. The first element is the unescaped path segment proper; subsequent elements are escaped parameter strings. Such an anonymous array uses overloading so it can be treated as a string too, but this string does not include the parameters. Note that absolute paths have the empty string as their first I<path_segment>, i.e. the I<path> C</foo/bar> have 3 I<path_segments>; "", "foo" and "bar". =item $uri->query =item $uri->query( $new_query ) Sets and returns the escaped query component of the $uri. =item $uri->query_form =item $uri->query_form( $key1 => $val1, $key2 => $val2, ... ) =item $uri->query_form( $key1 => $val1, $key2 => $val2, ..., $delim ) =item $uri->query_form( \@key_value_pairs ) =item $uri->query_form( \@key_value_pairs, $delim ) =item $uri->query_form( \%hash ) =item $uri->query_form( \%hash, $delim ) Sets and returns query components that use the I<application/x-www-form-urlencoded> format. Key/value pairs are separated by "&", and the key is separated from the value by a "=" character. The form can be set either by passing separate key/value pairs, or via an array or hash reference. Passing an empty array or an empty hash removes the query component, whereas passing no arguments at all leaves the component unchanged. The order of keys is undefined if a hash reference is passed. The old value is always returned as a list of separate key/value pairs. Assigning this list to a hash is unwise as the keys returned might repeat. The values passed when setting the form can be plain strings or references to arrays of strings. Passing an array of values has the same effect as passing the key repeatedly with one value at a time. All the following statements have the same effect: $uri->query_form(foo => 1, foo => 2); $uri->query_form(foo => [1, 2]); $uri->query_form([ foo => 1, foo => 2 ]); $uri->query_form([ foo => [1, 2] ]); $uri->query_form({ foo => [1, 2] }); The $delim parameter can be passed as ";" to force the key/value pairs to be delimited by ";" instead of "&" in the query string. This practice is often recommended for URLs embedded in HTML or XML documents as this avoids the trouble of escaping the "&" character. You might also set the $URI::DEFAULT_QUERY_FORM_DELIMITER variable to ";" for the same global effect. The C<URI::QueryParam> module can be loaded to add further methods to manipulate the form of a URI. See L<URI::QueryParam> for details. =item $uri->query_keywords =item $uri->query_keywords( $keywords, ... ) =item $uri->query_keywords( \@keywords ) Sets and returns query components that use the keywords separated by "+" format. The keywords can be set either by passing separate keywords directly or by passing a reference to an array of keywords. Passing an empty array removes the query component, whereas passing no arguments at all leaves the component unchanged. The old value is always returned as a list of separate words. =back =head1 SERVER METHODS For schemes where the I<authority> component denotes an Internet host, the following methods are available in addition to the generic methods. =over 4 =item $uri->userinfo =item $uri->userinfo( $new_userinfo ) Sets and returns the escaped userinfo part of the authority component. For some schemes this is a user name and a password separated by a colon. This practice is not recommended. Embedding passwords in clear text (such as URI) has proven to be a security risk in almost every case where it has been used. =item $uri->host =item $uri->host( $new_host ) Sets and returns the unescaped hostname. If the $new_host string ends with a colon and a number, then this number also sets the port. For IPv6 addresses the brackets around the raw address is removed in the return value from $uri->host. When setting the host attribute to an IPv6 address you can use a raw address or one enclosed in brackets. The address needs to be enclosed in brackets if you want to pass in a new port value as well. =item $uri->ihost Returns the host in Unicode form. Any IDNA A-labels are turned into U-labels. =item $uri->port =item $uri->port( $new_port ) Sets and returns the port. The port is a simple integer that should be greater than 0. If a port is not specified explicitly in the URI, then the URI scheme's default port is returned. If you don't want the default port substituted, then you can use the $uri->_port method instead. =item $uri->host_port =item $uri->host_port( $new_host_port ) Sets and returns the host and port as a single unit. The returned value includes a port, even if it matches the default port. The host part and the port part are separated by a colon: ":". For IPv6 addresses the bracketing is preserved; thus URI->new("http://[::1]/")->host_port returns "[::1]:80". Contrast this with $uri->host which will remove the brackets. =item $uri->default_port Returns the default port of the URI scheme to which $uri belongs. For I<http> this is the number 80, for I<ftp> this is the number 21, etc. The default port for a scheme can not be changed. =back =head1 SCHEME-SPECIFIC SUPPORT Scheme-specific support is provided for the following URI schemes. For C<URI> objects that do not belong to one of these, you can only use the common and generic methods. =over 4 =item B<data>: The I<data> URI scheme is specified in RFC 2397. It allows inclusion of small data items as "immediate" data, as if it had been included externally. C<URI> objects belonging to the data scheme support the common methods and two new methods to access their scheme-specific components: $uri->media_type and $uri->data. See L<URI::data> for details. =item B<file>: An old specification of the I<file> URI scheme is found in RFC 1738. A new RFC 2396 based specification in not available yet, but file URI references are in common use. C<URI> objects belonging to the file scheme support the common and generic methods. In addition, they provide two methods for mapping file URIs back to local file names; $uri->file and $uri->dir. See L<URI::file> for details. =item B<ftp>: An old specification of the I<ftp> URI scheme is found in RFC 1738. A new RFC 2396 based specification in not available yet, but ftp URI references are in common use. C<URI> objects belonging to the ftp scheme support the common, generic and server methods. In addition, they provide two methods for accessing the userinfo sub-components: $uri->user and $uri->password. =item B<gopher>: The I<gopher> URI scheme is specified in <draft-murali-url-gopher-1996-12-04> and will hopefully be available as a RFC 2396 based specification. C<URI> objects belonging to the gopher scheme support the common, generic and server methods. In addition, they support some methods for accessing gopher-specific path components: $uri->gopher_type, $uri->selector, $uri->search, $uri->string. =item B<http>: The I<http> URI scheme is specified in RFC 2616. The scheme is used to reference resources hosted by HTTP servers. C<URI> objects belonging to the http scheme support the common, generic and server methods. =item B<https>: The I<https> URI scheme is a Netscape invention which is commonly implemented. The scheme is used to reference HTTP servers through SSL connections. Its syntax is the same as http, but the default port is different. =item B<ldap>: The I<ldap> URI scheme is specified in RFC 2255. LDAP is the Lightweight Directory Access Protocol. An ldap URI describes an LDAP search operation to perform to retrieve information from an LDAP directory. C<URI> objects belonging to the ldap scheme support the common, generic and server methods as well as ldap-specific methods: $uri->dn, $uri->attributes, $uri->scope, $uri->filter, $uri->extensions. See L<URI::ldap> for details. =item B<ldapi>: Like the I<ldap> URI scheme, but uses a UNIX domain socket. The server methods are not supported, and the local socket path is available as $uri->un_path. The I<ldapi> scheme is used by the OpenLDAP package. There is no real specification for it, but it is mentioned in various OpenLDAP manual pages. =item B<ldaps>: Like the I<ldap> URI scheme, but uses an SSL connection. This scheme is deprecated, as the preferred way is to use the I<start_tls> mechanism. =item B<mailto>: The I<mailto> URI scheme is specified in RFC 2368. The scheme was originally used to designate the Internet mailing address of an individual or service. It has (in RFC 2368) been extended to allow setting of other mail header fields and the message body. C<URI> objects belonging to the mailto scheme support the common methods and the generic query methods. In addition, they support the following mailto-specific methods: $uri->to, $uri->headers. Note that the "foo@example.com" part of a mailto is I<not> the C<userinfo> and C<host> but instead the C<path>. This allows a mailto URI to contain multiple comma separated email addresses. =item B<mms>: The I<mms> URL specification can be found at L<http://sdp.ppona.com/>. C<URI> objects belonging to the mms scheme support the common, generic, and server methods, with the exception of userinfo and query-related sub-components. =item B<news>: The I<news>, I<nntp> and I<snews> URI schemes are specified in <draft-gilman-news-url-01> and will hopefully be available as an RFC 2396 based specification soon. C<URI> objects belonging to the news scheme support the common, generic and server methods. In addition, they provide some methods to access the path: $uri->group and $uri->message. =item B<nntp>: See I<news> scheme. =item B<pop>: The I<pop> URI scheme is specified in RFC 2384. The scheme is used to reference a POP3 mailbox. C<URI> objects belonging to the pop scheme support the common, generic and server methods. In addition, they provide two methods to access the userinfo components: $uri->user and $uri->auth =item B<rlogin>: An old specification of the I<rlogin> URI scheme is found in RFC 1738. C<URI> objects belonging to the rlogin scheme support the common, generic and server methods. =item B<rtsp>: The I<rtsp> URL specification can be found in section 3.2 of RFC 2326. C<URI> objects belonging to the rtsp scheme support the common, generic, and server methods, with the exception of userinfo and query-related sub-components. =item B<rtspu>: The I<rtspu> URI scheme is used to talk to RTSP servers over UDP instead of TCP. The syntax is the same as rtsp. =item B<rsync>: Information about rsync is available from L<http://rsync.samba.org/>. C<URI> objects belonging to the rsync scheme support the common, generic and server methods. In addition, they provide methods to access the userinfo sub-components: $uri->user and $uri->password. =item B<sip>: The I<sip> URI specification is described in sections 19.1 and 25 of RFC 3261. C<URI> objects belonging to the sip scheme support the common, generic, and server methods with the exception of path related sub-components. In addition, they provide two methods to get and set I<sip> parameters: $uri->params_form and $uri->params. =item B<sips>: See I<sip> scheme. Its syntax is the same as sip, but the default port is different. =item B<snews>: See I<news> scheme. Its syntax is the same as news, but the default port is different. =item B<telnet>: An old specification of the I<telnet> URI scheme is found in RFC 1738. C<URI> objects belonging to the telnet scheme support the common, generic and server methods. =item B<tn3270>: These URIs are used like I<telnet> URIs but for connections to IBM mainframes. C<URI> objects belonging to the tn3270 scheme support the common, generic and server methods. =item B<ssh>: Information about ssh is available at L<http://www.openssh.com/>. C<URI> objects belonging to the ssh scheme support the common, generic and server methods. In addition, they provide methods to access the userinfo sub-components: $uri->user and $uri->password. =item B<sftp>: C<URI> objects belonging to the sftp scheme support the common, generic and server methods. In addition, they provide methods to access the userinfo sub-components: $uri->user and $uri->password. =item B<urn>: The syntax of Uniform Resource Names is specified in RFC 2141. C<URI> objects belonging to the urn scheme provide the common methods, and also the methods $uri->nid and $uri->nss, which return the Namespace Identifier and the Namespace-Specific String respectively. The Namespace Identifier basically works like the Scheme identifier of URIs, and further divides the URN namespace. Namespace Identifier assignments are maintained at L<http://www.iana.org/assignments/urn-namespaces>. Letter case is not significant for the Namespace Identifier. It is always returned in lower case by the $uri->nid method. The $uri->_nid method can be used if you want it in its original case. =item B<urn>:B<isbn>: The C<urn:isbn:> namespace contains International Standard Book Numbers (ISBNs) and is described in RFC 3187. A C<URI> object belonging to this namespace has the following extra methods (if the Business::ISBN module is available): $uri->isbn, $uri->isbn_publisher_code, $uri->isbn_group_code (formerly isbn_country_code, which is still supported by issues a deprecation warning), $uri->isbn_as_ean. =item B<urn>:B<oid>: The C<urn:oid:> namespace contains Object Identifiers (OIDs) and is described in RFC 3061. An object identifier consists of sequences of digits separated by dots. A C<URI> object belonging to this namespace has an additional method called $uri->oid that can be used to get/set the oid value. In a list context, oid numbers are returned as separate elements. =back =head1 CONFIGURATION VARIABLES The following configuration variables influence how the class and its methods behave: =over 4 =item $URI::ABS_ALLOW_RELATIVE_SCHEME Some older parsers used to allow the scheme name to be present in the relative URL if it was the same as the base URL scheme. RFC 2396 says that this should be avoided, but you can enable this old behaviour by setting the $URI::ABS_ALLOW_RELATIVE_SCHEME variable to a TRUE value. The difference is demonstrated by the following examples: URI->new("http:foo")->abs("http://host/a/b") ==> "http:foo" local $URI::ABS_ALLOW_RELATIVE_SCHEME = 1; URI->new("http:foo")->abs("http://host/a/b") ==> "http:/host/a/foo" =item $URI::ABS_REMOTE_LEADING_DOTS You can also have the abs() method ignore excess ".." segments in the relative URI by setting $URI::ABS_REMOTE_LEADING_DOTS to a TRUE value. The difference is demonstrated by the following examples: URI->new("../../../foo")->abs("http://host/a/b") ==> "http://host/../../foo" local $URI::ABS_REMOTE_LEADING_DOTS = 1; URI->new("../../../foo")->abs("http://host/a/b") ==> "http://host/foo" =item $URI::DEFAULT_QUERY_FORM_DELIMITER This value can be set to ";" to have the query form C<key=value> pairs delimited by ";" instead of "&" which is the default. =back =head1 BUGS There are some things that are not quite right: =over =item * Using regexp variables like $1 directly as arguments to the URI accessor methods does not work too well with current perl implementations. I would argue that this is actually a bug in perl. The workaround is to quote them. Example: /(...)/ || die; $u->query("$1"); =item * The escaping (percent encoding) of chars in the 128 .. 255 range passed to the URI constructor or when setting URI parts using the accessor methods depend on the state of the internal UTF8 flag (see utf8::is_utf8) of the string passed. If the UTF8 flag is set the UTF-8 encoded version of the character is percent encoded. If the UTF8 flag isn't set the Latin-1 version (byte) of the character is percent encoded. This basically exposes the internal encoding of Perl strings. =back =head1 PARSING URIs WITH REGEXP As an alternative to this module, the following (official) regular expression can be used to decode a URI: my($scheme, $authority, $path, $query, $fragment) = $uri =~ m|(?:([^:/?#]+):)?(?://([^/?#]*))?([^?#]*)(?:\?([^#]*))?(?:#(.*))?|; The C<URI::Split> module provides the function uri_split() as a readable alternative. =head1 SEE ALSO L<URI::file>, L<URI::WithBase>, L<URI::QueryParam>, L<URI::Escape>, L<URI::Split>, L<URI::Heuristic> RFC 2396: "Uniform Resource Identifiers (URI): Generic Syntax", Berners-Lee, Fielding, Masinter, August 1998. L<http://www.iana.org/assignments/uri-schemes> L<http://www.iana.org/assignments/urn-namespaces> L<http://www.w3.org/Addressing/> =head1 COPYRIGHT Copyright 1995-2009 Gisle Aas. Copyright 1995 Martijn Koster. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. =head1 AUTHORS / ACKNOWLEDGMENTS This module is based on the C<URI::URL> module, which in turn was (distantly) based on the C<wwwurl.pl> code in the libwww-perl for perl4 developed by Roy Fielding, as part of the Arcadia project at the University of California, Irvine, with contributions from Brooks Cutter. C<URI::URL> was developed by Gisle Aas, Tim Bunce, Roy Fielding and Martijn Koster with input from other people on the libwww-perl mailing list. C<URI> and related subclasses was developed by Gisle Aas. =cut �������������������������������������darwin-perl-lib/XML/��������������������������������������������������������������������������������000755 �000765 �000024 �00000000000 13167163507 016424� 5����������������������������������������������������������������������������������������������������ustar�00ocsinventory��������������������staff���������������������������000000 �000000 ������������������������������������������������������������������������������������������������������������������������������������������������������������������������darwin-perl-lib/XML/Entities/�����������������������������������������������������������������������000755 �000765 �000024 �00000000000 13167163507 020210� 5����������������������������������������������������������������������������������������������������ustar�00ocsinventory��������������������staff���������������������������000000 �000000 ������������������������������������������������������������������������������������������������������������������������������������������������������������������������darwin-perl-lib/XML/Entities.pm���������������������������������������������������������������������000444 �000765 �000024 �00000011505 13167163507 020546� 0����������������������������������������������������������������������������������������������������ustar�00ocsinventory��������������������staff���������������������������000000 �000000 ������������������������������������������������������������������������������������������������������������������������������������������������������������������������package XML::Entities; use strict; use 5.008; # Unicode all over use Carp; use XML::Entities::Data; our $VERSION = '1.0002'; eval { require HTML::Parser }; # for fast XS implemented _decode_entities if ( eval { HTML::Entities::UNICODE_SUPPORT() } ) { *_decode_entities = \&HTML::Entities::_decode_entities; } else { sub ord2chr { if (substr($_[0], 0, 1) eq 'x') { return chr(hex '0'.$_[0]) } else { return chr($_[0]) } } *_decode_entities = sub { my $hash = pop; $_[0] =~ s/ & (\#?) (\w+) \b (;?) / $1 ? ord2chr($2) : exists $hash->{$2} ? $hash->{$2} : exists $hash->{$2.';'} ? $hash->{$2.';'} : '&'.$1.$2.$3 /xeg; }; } sub decode { my $set = shift; my @set_names = XML::Entities::Data::names; my $entity2char; if (ref $set eq 'HASH') { $entity2char = $set; } else { croak "'$set' is not a valid entity set name. Choose one of: all @set_names" if not grep {$_ eq $set} 'all', @set_names; no strict 'refs'; $entity2char = "XML::Entities::Data::$set"->(); use strict; } if (defined wantarray) { @_ = @_ }; for (@_) { _decode_entities($_, $entity2char); } return @_[0 .. $#_] } sub numify { my $set = shift; my @set_names = XML::Entities::Data::names; my $entity2char; if (ref $set eq 'HASH') { $entity2char = $set; } else { croak "'$set' is not a valid entity set name. Choose one of: all @set_names" if not grep {$_ eq $set} 'all', @set_names; no strict 'refs'; $entity2char = "XML::Entities::Data::$set"->(); use strict; } if (defined wantarray) { @_ = @_; } my %set = %$entity2char; s/(?<= & ) ( [^\#] \w*? ) (?= ; )/ exists $set{$1} ? '#'.ord($set{$1}) : exists $set{$1.';'} ? '#'.ord($set{$1.';'}) : $1 /xeg for @_; return @_ if wantarray; return pop @_ if defined wantarray; } 1 __END__ =encoding utf8 =head1 NAME XML::Entities - Decode strings with XML entities =head1 SYNOPSIS use XML::Entities; $a = "Tom & Jerry © Warner Bros."; $b = XML::Entities::decode('all', $a); $c = XML::Entities::numify('all', $a); # now $b is "Tom & Jerry © Warner Bros. # and $c is "Tom & Jerry © Warner Bros." # void context modifies the arguments XML::Entities::numify('all', $a); XML::Entities::decode('all', $a, $c); # Now $a, $b and $c all contain the decoded string =head1 DESCRIPTION Based upon the HTML::Entities module by Gisle Aas This module deals with decoding of strings with XML character entities. The module provides two functions: =over 4 =item decode( $entity_set, $string, ... ) This routine replaces XML entities from $entity_set found in the $string with the corresponding Unicode character. Unrecognized entities are left alone. The $entity_set can either be a name of an entity set - the selection of which can be obtained by XML::Entities::Data::names(), or "all" for a union, or alternatively a hashref which maps entity names (without leading &'s) to the corresponding Unicode characters (or strings). If multiple strings are provided as argument they are each decoded separately and the same number of strings are returned. If called in void context the arguments are decoded in-place. Note: If your version of C<HTML::Parser> was built without Unicode support, then C<XML::Entities> uses a regular expression to do the decoding, which is slower. =item numify( $entity_set, $string, ... ) This functions converts named XML entities to numeric XML entities. It is less robust than the C<decode> function in the sense that it doesn't capture improperly terminated entities. It behaves like C<decode> in treating parameters and returning values. =back =head2 XML::Entities::Data The list of entities is defined in the XML::Entities::Data module. The list can be generated from the w3.org definition (or any other). Check C<perldoc XML::Entities::Data> for more details. =head2 Encoding entities The HTML::Entities module provides a function for encoding entities. You just have to assign the right mapping to the C<%HTML::Entities::char2entity> hash. So, to encode everything that XML::Entities knows about, you'd say: use XML::Entities; use HTML::Entities; %HTML::Entities::char2entity = %{ XML::Entities::Data::char2entity('all'); }; my $encoded = encode_entities('tom&jerry'); # now $encoded is 'tom&jerry' =head1 SEE ALSO HTML::Entities, XML::Entities::Data =head1 COPYRIGHT Copyright 2012 Jan Oldrich Kruza E<lt>sixtease@cpan.orgE<gt>. All rights reserved. This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. =cut �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������darwin-perl-lib/XML/NamespaceSupport.pm�������������������������������������������������������������000444 �000765 �000024 �00000046752 13167163507 022267� 0����������������������������������������������������������������������������������������������������ustar�00ocsinventory��������������������staff���������������������������000000 �000000 ������������������������������������������������������������������������������������������������������������������������������������������������������������������������package XML::NamespaceSupport; use strict; our $VERSION = '1.12'; # VERSION # ABSTRACT: A simple generic namespace processor use constant FATALS => 0; # root object use constant NSMAP => 1; use constant UNKNOWN_PREF => 2; use constant AUTO_PREFIX => 3; use constant XMLNS_11 => 4; use constant DEFAULT => 0; # maps use constant PREFIX_MAP => 1; use constant DECLARATIONS => 2; use vars qw($NS_XMLNS $NS_XML); $NS_XMLNS = 'http://www.w3.org/2000/xmlns/'; $NS_XML = 'http://www.w3.org/XML/1998/namespace'; # add the ns stuff that baud wants based on Java's xml-writer #-------------------------------------------------------------------# # constructor #-------------------------------------------------------------------# sub new { my $class = ref($_[0]) ? ref(shift) : shift; my $options = shift; my $self = [ 1, # FATALS [[ # NSMAP undef, # DEFAULT { xml => $NS_XML }, # PREFIX_MAP undef, # DECLARATIONS ]], 'aaa', # UNKNOWN_PREF 0, # AUTO_PREFIX 1, # XML_11 ]; $self->[NSMAP]->[0]->[PREFIX_MAP]->{xmlns} = $NS_XMLNS if $options->{xmlns}; $self->[FATALS] = $options->{fatal_errors} if defined $options->{fatal_errors}; $self->[AUTO_PREFIX] = $options->{auto_prefix} if defined $options->{auto_prefix}; $self->[XMLNS_11] = $options->{xmlns_11} if defined $options->{xmlns_11}; return bless $self, $class; } #-------------------------------------------------------------------# # reset() - return to the original state (for reuse) #-------------------------------------------------------------------# sub reset { my $self = shift; $#{$self->[NSMAP]} = 0; } #-------------------------------------------------------------------# # push_context() - add a new empty context to the stack #-------------------------------------------------------------------# sub push_context { my $self = shift; push @{$self->[NSMAP]}, [ $self->[NSMAP]->[-1]->[DEFAULT], { %{$self->[NSMAP]->[-1]->[PREFIX_MAP]} }, [], ]; } #-------------------------------------------------------------------# # pop_context() - remove the topmost context from the stack #-------------------------------------------------------------------# sub pop_context { my $self = shift; die 'Trying to pop context without push context' unless @{$self->[NSMAP]} > 1; pop @{$self->[NSMAP]}; } #-------------------------------------------------------------------# # declare_prefix() - declare a prefix in the current scope #-------------------------------------------------------------------# sub declare_prefix { my $self = shift; my $prefix = shift; my $value = shift; warn <<' EOWARN' unless defined $prefix or $self->[AUTO_PREFIX]; Prefix was undefined. If you wish to set the default namespace, use the empty string ''. If you wish to autogenerate prefixes, set the auto_prefix option to a true value. EOWARN no warnings 'uninitialized'; if ($prefix eq 'xml' and $value ne $NS_XML) { die "The xml prefix can only be bound to the $NS_XML namespace." } elsif ($value eq $NS_XML and $prefix ne 'xml') { die "the $NS_XML namespace can only be bound to the xml prefix."; } elsif ($value eq $NS_XML and $prefix eq 'xml') { return 1; } return 0 if index(lc($prefix), 'xml') == 0; use warnings 'uninitialized'; if (defined $prefix and $prefix eq '') { $self->[NSMAP]->[-1]->[DEFAULT] = $value; } else { die "Cannot declare prefix $prefix" if $value eq '' and not $self->[XMLNS_11]; if (not defined $prefix and $self->[AUTO_PREFIX]) { while (1) { $prefix = $self->[UNKNOWN_PREF]++; last if not exists $self->[NSMAP]->[-1]->[PREFIX_MAP]->{$prefix}; } } elsif (not defined $prefix and not $self->[AUTO_PREFIX]) { return 0; } $self->[NSMAP]->[-1]->[PREFIX_MAP]->{$prefix} = $value; } push @{$self->[NSMAP]->[-1]->[DECLARATIONS]}, $prefix; return 1; } #-------------------------------------------------------------------# # declare_prefixes() - declare several prefixes in the current scope #-------------------------------------------------------------------# sub declare_prefixes { my $self = shift; my %prefixes = @_; while (my ($k,$v) = each %prefixes) { $self->declare_prefix($k,$v); } } #-------------------------------------------------------------------# # undeclare_prefix #-------------------------------------------------------------------# sub undeclare_prefix { my $self = shift; my $prefix = shift; return if not defined($prefix); return unless exists $self->[NSMAP]->[-1]->[PREFIX_MAP]->{$prefix}; my ( $tfix ) = grep { $_ eq $prefix } @{$self->[NSMAP]->[-1]->[DECLARATIONS]}; if ( not defined $tfix ) { die "prefix $prefix not declared in this context\n"; } @{$self->[NSMAP]->[-1]->[DECLARATIONS]} = grep { $_ ne $prefix } @{$self->[NSMAP]->[-1]->[DECLARATIONS]}; delete $self->[NSMAP]->[-1]->[PREFIX_MAP]->{$prefix}; } #-------------------------------------------------------------------# # get_prefix() - get a (random) prefix for a given URI #-------------------------------------------------------------------# sub get_prefix { my $self = shift; my $uri = shift; # we have to iterate over the whole hash here because if we don't # the iterator isn't reset and the next pass will fail my $pref; while (my ($k, $v) = each %{$self->[NSMAP]->[-1]->[PREFIX_MAP]}) { $pref = $k if $v eq $uri; } return $pref; } #-------------------------------------------------------------------# # get_prefixes() - get all the prefixes for a given URI #-------------------------------------------------------------------# sub get_prefixes { my $self = shift; my $uri = shift; return keys %{$self->[NSMAP]->[-1]->[PREFIX_MAP]} unless defined $uri; return grep { $self->[NSMAP]->[-1]->[PREFIX_MAP]->{$_} eq $uri } keys %{$self->[NSMAP]->[-1]->[PREFIX_MAP]}; } #-------------------------------------------------------------------# # get_declared_prefixes() - get all prefixes declared in the last context #-------------------------------------------------------------------# sub get_declared_prefixes { my $declarations = $_[0]->[NSMAP]->[-1]->[DECLARATIONS]; die "At least one context must be pushed onto stack with push_context()\n", "before calling get_declared_prefixes()" if not defined $declarations; return @{$_[0]->[NSMAP]->[-1]->[DECLARATIONS]}; } #-------------------------------------------------------------------# # get_uri() - get a URI given a prefix #-------------------------------------------------------------------# sub get_uri { my $self = shift; my $prefix = shift; warn "Prefix must not be undef in get_uri(). The emtpy prefix must be ''" unless defined $prefix; return $self->[NSMAP]->[-1]->[DEFAULT] if $prefix eq ''; return $self->[NSMAP]->[-1]->[PREFIX_MAP]->{$prefix} if exists $self->[NSMAP]->[-1]->[PREFIX_MAP]->{$prefix}; return undef; } #-------------------------------------------------------------------# # process_name() - provide details on a name #-------------------------------------------------------------------# sub process_name { my $self = shift; my $qname = shift; my $aflag = shift; if ($self->[FATALS]) { return( ($self->_get_ns_details($qname, $aflag))[0,2], $qname ); } else { eval { return( ($self->_get_ns_details($qname, $aflag))[0,2], $qname ); } } } #-------------------------------------------------------------------# # process_element_name() - provide details on a element's name #-------------------------------------------------------------------# sub process_element_name { my $self = shift; my $qname = shift; if ($self->[FATALS]) { return $self->_get_ns_details($qname, 0); } else { eval { return $self->_get_ns_details($qname, 0); } } } #-------------------------------------------------------------------# # process_attribute_name() - provide details on a attribute's name #-------------------------------------------------------------------# sub process_attribute_name { my $self = shift; my $qname = shift; if ($self->[FATALS]) { return $self->_get_ns_details($qname, 1); } else { eval { return $self->_get_ns_details($qname, 1); } } } #-------------------------------------------------------------------# # ($ns, $prefix, $lname) = $self->_get_ns_details($qname, $f_attr) # returns ns, prefix, and lname for a given attribute name # >> the $f_attr flag, if set to one, will work for an attribute #-------------------------------------------------------------------# sub _get_ns_details { my $self = shift; my $qname = shift; my $aflag = shift; my ($ns, $prefix, $lname); (my ($tmp_prefix, $tmp_lname) = split /:/, $qname, 3) < 3 or die "Invalid QName: $qname"; # no prefix my $cur_map = $self->[NSMAP]->[-1]; if (not defined($tmp_lname)) { $prefix = undef; $lname = $qname; # attr don't have a default namespace $ns = ($aflag) ? undef : $cur_map->[DEFAULT]; } # prefix else { if (exists $cur_map->[PREFIX_MAP]->{$tmp_prefix}) { $prefix = $tmp_prefix; $lname = $tmp_lname; $ns = $cur_map->[PREFIX_MAP]->{$prefix} } else { # no ns -> lname == name, all rest undef die "Undeclared prefix: $tmp_prefix"; } } return ($ns, $prefix, $lname); } #-------------------------------------------------------------------# # parse_jclark_notation() - parse the Clarkian notation #-------------------------------------------------------------------# sub parse_jclark_notation { shift; my $jc = shift; $jc =~ m/^\{(.*)\}([^}]+)$/; return $1, $2; } #-------------------------------------------------------------------# # Java names mapping #-------------------------------------------------------------------# *XML::NamespaceSupport::pushContext = \&push_context; *XML::NamespaceSupport::popContext = \&pop_context; *XML::NamespaceSupport::declarePrefix = \&declare_prefix; *XML::NamespaceSupport::declarePrefixes = \&declare_prefixes; *XML::NamespaceSupport::getPrefix = \&get_prefix; *XML::NamespaceSupport::getPrefixes = \&get_prefixes; *XML::NamespaceSupport::getDeclaredPrefixes = \&get_declared_prefixes; *XML::NamespaceSupport::getURI = \&get_uri; *XML::NamespaceSupport::processName = \&process_name; *XML::NamespaceSupport::processElementName = \&process_element_name; *XML::NamespaceSupport::processAttributeName = \&process_attribute_name; *XML::NamespaceSupport::parseJClarkNotation = \&parse_jclark_notation; *XML::NamespaceSupport::undeclarePrefix = \&undeclare_prefix; 1; __END__ =pod =encoding UTF-8 =head1 NAME XML::NamespaceSupport - A simple generic namespace processor =head1 VERSION version 1.12 =head1 SYNOPSIS use XML::NamespaceSupport; my $nsup = XML::NamespaceSupport->new; # add a new empty context $nsup->push_context; # declare a few prefixes $nsup->declare_prefix($prefix1, $uri1); $nsup->declare_prefix($prefix2, $uri2); # the same shorter $nsup->declare_prefixes($prefix1 => $uri1, $prefix2 => $uri2); # get a single prefix for a URI (randomly) $prefix = $nsup->get_prefix($uri); # get all prefixes for a URI (probably better) @prefixes = $nsup->get_prefixes($uri); # get all prefixes in scope @prefixes = $nsup->get_prefixes(); # get all prefixes that were declared for the current scope @prefixes = $nsup->get_declared_prefixes; # get a URI for a given prefix $uri = $nsup->get_uri($prefix); # get info on a qname (java-ish way, it's a bit weird) ($ns_uri, $local_name, $qname) = $nsup->process_name($qname, $is_attr); # the same, more perlish ($ns_uri, $prefix, $local_name) = $nsup->process_element_name($qname); ($ns_uri, $prefix, $local_name) = $nsup->process_attribute_name($qname); # remove the current context $nsup->pop_context; # reset the object for reuse in another document $nsup->reset; # a simple helper to process Clarkian Notation my ($ns, $lname) = $nsup->parse_jclark_notation('{http://foo}bar'); # or (given that it doesn't care about the object my ($ns, $lname) = XML::NamespaceSupport->parse_jclark_notation('{http://foo}bar'); =head1 DESCRIPTION This module offers a simple to process namespaced XML names (unames) from within any application that may need them. It also helps maintain a prefix to namespace URI map, and provides a number of basic checks. The model for this module is SAX2's NamespaceSupport class, readable at http://www.saxproject.org/namespaces.html It adds a few perlisations where we thought it appropriate. =head1 NAME XML::NamespaceSupport - a simple generic namespace support class =head1 METHODS =over 4 =item * XML::NamespaceSupport->new(\%options) A simple constructor. The options are C<xmlns>, C<fatal_errors>, and C<auto_prefix> If C<xmlns> is turned on (it is off by default) the mapping from the xmlns prefix to the URI defined for it in DOM level 2 is added to the list of predefined mappings (which normally only contains the xml prefix mapping). If C<fatal_errors> is turned off (it is on by default) a number of validity errors will simply be flagged as failures, instead of die()ing. If C<auto_prefix> is turned on (it is off by default) when one provides a prefix of C<undef> to C<declare_prefix> it will generate a random prefix mapped to that namespace. Otherwise an undef prefix will trigger a warning (you should probably know what you're doing if you turn this option on). If C<xmlns_11> us turned off, it becomes illegal to undeclare namespace prefixes. It is on by default. This behaviour is compliant with Namespaces in XML 1.1, turning it off reverts you to version 1.0. =item * $nsup->push_context Adds a new empty context to the stack. You can then populate it with new prefixes defined at this level. =item * $nsup->pop_context Removes the topmost context in the stack and reverts to the previous one. It will die() if you try to pop more than you have pushed. =item * $nsup->declare_prefix($prefix, $uri) Declares a mapping of $prefix to $uri, at the current level. Note that with C<auto_prefix> turned on, if you declare a prefix mapping in which $prefix is undef(), you will get an automatic prefix selected for you. If it is off you will get a warning. This is useful when you deal with code that hasn't kept prefixes around and need to reserialize the nodes. It also means that if you want to set the default namespace (i.e. with an empty prefix) you must use the empty string instead of undef. This behaviour is consistent with the SAX 2.0 specification. =item * $nsup->declare_prefixes(%prefixes2uris) Declares a mapping of several prefixes to URIs, at the current level. =item * $nsup->get_prefix($uri) Returns a prefix given a URI. Note that as several prefixes may be mapped to the same URI, it returns an arbitrary one. It'll return undef on failure. =item * $nsup->get_prefixes($uri) Returns an array of prefixes given a URI. It'll return all the prefixes if the uri is undef. =item * $nsup->get_declared_prefixes Returns an array of all the prefixes that have been declared within this context, ie those that were declared on the last element, not those that were declared above and are simply in scope. Note that at least one context must be added to the stack via C<push_context> before this method can be called. =item * $nsup->get_uri($prefix) Returns a URI for a given prefix. Returns undef on failure. =item * $nsup->process_name($qname, $is_attr) Given a qualified name and a boolean indicating whether this is an attribute or another type of name (those are differently affected by default namespaces), it returns a namespace URI, local name, qualified name tuple. I know that that is a rather abnormal list to return, but it is so for compatibility with the Java spec. See below for more Perlish alternatives. If the prefix is not declared, or if the name is not valid, it'll either die or return undef depending on the current setting of C<fatal_errors>. =item * $nsup->undeclare_prefix($prefix); Removes a namespace prefix from the current context. This function may be used in SAX's end_prefix_mapping when there is fear that a namespace declaration might be available outside their scope (which shouldn't normally happen, but you never know ;) ). This may be needed in order to properly support Namespace 1.1. =item * $nsup->process_element_name($qname) Given a qualified name, it returns a namespace URI, prefix, and local name tuple. This method applies to element names. If the prefix is not declared, or if the name is not valid, it'll either die or return undef depending on the current setting of C<fatal_errors>. =item * $nsup->process_attribute_name($qname) Given a qualified name, it returns a namespace URI, prefix, and local name tuple. This method applies to attribute names. If the prefix is not declared, or if the name is not valid, it'll either die or return undef depending on the current setting of C<fatal_errors>. =item * $nsup->reset Resets the object so that it can be reused on another document. =back All methods of the interface have an alias that is the name used in the original Java specification. You can use either name interchangeably. Here is the mapping: Java name Perl name --------------------------------------------------- pushContext push_context popContext pop_context declarePrefix declare_prefix declarePrefixes declare_prefixes getPrefix get_prefix getPrefixes get_prefixes getDeclaredPrefixes get_declared_prefixes getURI get_uri processName process_name processElementName process_element_name processAttributeName process_attribute_name parseJClarkNotation parse_jclark_notation undeclarePrefix undeclare_prefix =head1 VARIABLES Two global variables are made available to you. They used to be constants but simple scalars are easier to use in a number of contexts. They are not exported but can easily be accessed from any package, or copied into it. =over 4 =item * C<$NS_XMLNS> The namespace for xmlns prefixes, http://www.w3.org/2000/xmlns/. =item * C<$NS_XML> The namespace for xml prefixes, http://www.w3.org/XML/1998/namespace. =back =head1 TODO - add more tests - optimise here and there =head1 SEE ALSO XML::Parser::PerlSAX =head1 AUTHORS =over 4 =item * Robin Berjon <robin@knowscape.com> =item * Chris Prather <chris@prather.org> =back =head1 COPYRIGHT AND LICENSE This software is copyright (c) 2015 by Robin Berjon. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. =head1 CONTRIBUTORS =for stopwords Chris Prather David Steinbrunner Paul Cochrane Paulo Custodio =over 4 =item * Chris Prather <cprather@hdpublishing.com> =item * David Steinbrunner <dsteinbrunner@pobox.com> =item * Paul Cochrane <paul@liekut.de> =item * Paulo Custodio <pauloscustodio@gmail.com> =back =cut ����������������������darwin-perl-lib/XML/SAX/����������������������������������������������������������������������������000755 �000765 �000024 �00000000000 13167163507 017057� 5����������������������������������������������������������������������������������������������������ustar�00ocsinventory��������������������staff���������������������������000000 �000000 ������������������������������������������������������������������������������������������������������������������������������������������������������������������������darwin-perl-lib/XML/SAX.pm��������������������������������������������������������������������������000444 �000765 �000024 �00000022065 13167163507 017420� 0����������������������������������������������������������������������������������������������������ustar�00ocsinventory��������������������staff���������������������������000000 �000000 ������������������������������������������������������������������������������������������������������������������������������������������������������������������������# $Id$ package XML::SAX; use strict; use vars qw($VERSION @ISA @EXPORT_OK); $VERSION = '0.99'; use Exporter (); @ISA = ('Exporter'); @EXPORT_OK = qw(Namespaces Validation); use File::Basename qw(dirname); use File::Spec (); use Symbol qw(gensym); use XML::SAX::ParserFactory (); # loaded for simplicity use constant PARSER_DETAILS => "ParserDetails.ini"; use constant Namespaces => "http://xml.org/sax/features/namespaces"; use constant Validation => "http://xml.org/sax/features/validation"; my $known_parsers = undef; # load_parsers takes the ParserDetails.ini file out of the same directory # that XML::SAX is in, and looks at it. Format in POD below =begin EXAMPLE [XML::SAX::PurePerl] http://xml.org/sax/features/namespaces = 1 http://xml.org/sax/features/validation = 0 # a comment # blank lines ignored [XML::SAX::AnotherParser] http://xml.org/sax/features/namespaces = 0 http://xml.org/sax/features/validation = 1 =end EXAMPLE =cut sub load_parsers { my $class = shift; my $dir = shift; # reset parsers $known_parsers = []; # get directory from wherever XML::SAX is installed if (!$dir) { $dir = $INC{'XML/SAX.pm'}; $dir = dirname($dir); } my $fh = gensym(); if (!open($fh, File::Spec->catfile($dir, "SAX", PARSER_DETAILS))) { XML::SAX->do_warn("could not find " . PARSER_DETAILS . " in $dir/SAX\n"); return $class; } $known_parsers = $class->_parse_ini_file($fh); return $class; } sub _parse_ini_file { my $class = shift; my ($fh) = @_; my @config; my $lineno = 0; while (defined(my $line = <$fh>)) { $lineno++; my $original = $line; # strip whitespace $line =~ s/\s*$//m; $line =~ s/^\s*//m; # strip comments $line =~ s/[#;].*$//m; # ignore blanks next if $line =~ /^$/m; # heading if ($line =~ /^\[\s*(.*)\s*\]$/m) { push @config, { Name => $1 }; next; } # instruction elsif ($line =~ /^(.*?)\s*?=\s*(.*)$/) { unless(@config) { push @config, { Name => '' }; } $config[-1]{Features}{$1} = $2; } # not whitespace, comment, or instruction else { die "Invalid line in ini: $lineno\n>>> $original\n"; } } return \@config; } sub parsers { my $class = shift; if (!$known_parsers) { $class->load_parsers(); } return $known_parsers; } sub remove_parser { my $class = shift; my ($parser_module) = @_; if (!$known_parsers) { $class->load_parsers(); } @$known_parsers = grep { $_->{Name} ne $parser_module } @$known_parsers; return $class; } sub add_parser { my $class = shift; my ($parser_module) = @_; if (!$known_parsers) { $class->load_parsers(); } # first load module, then query features, then push onto known_parsers, my $parser_file = $parser_module; $parser_file =~ s/::/\//g; $parser_file .= ".pm"; require $parser_file; my @features = $parser_module->supported_features(); my $new = { Name => $parser_module }; foreach my $feature (@features) { $new->{Features}{$feature} = 1; } # If exists in list already, move to end. my $done = 0; my $pos = undef; for (my $i = 0; $i < @$known_parsers; $i++) { my $p = $known_parsers->[$i]; if ($p->{Name} eq $parser_module) { $pos = $i; } } if (defined $pos) { splice(@$known_parsers, $pos, 1); push @$known_parsers, $new; $done++; } # Otherwise (not in list), add at end of list. if (!$done) { push @$known_parsers, $new; } return $class; } sub save_parsers { my $class = shift; # get directory from wherever XML::SAX is installed my $dir = $INC{'XML/SAX.pm'}; $dir = dirname($dir); my $file = File::Spec->catfile($dir, "SAX", PARSER_DETAILS); chmod 0644, $file; unlink($file); my $fh = gensym(); open($fh, ">$file") || die "Cannot write to $file: $!"; foreach my $p (@$known_parsers) { print $fh "[$p->{Name}]\n"; foreach my $key (keys %{$p->{Features}}) { print $fh "$key = $p->{Features}{$key}\n"; } print $fh "\n"; } print $fh "\n"; close $fh; return $class; } sub do_warn { my $class = shift; # Don't output warnings if running under Test::Harness warn(@_) unless $ENV{HARNESS_ACTIVE}; } 1; __END__ =head1 NAME XML::SAX - Simple API for XML =head1 SYNOPSIS use XML::SAX; # get a list of known parsers my $parsers = XML::SAX->parsers(); # add/update a parser XML::SAX->add_parser(q(XML::SAX::PurePerl)); # remove parser XML::SAX->remove_parser(q(XML::SAX::Foodelberry)); # save parsers XML::SAX->save_parsers(); =head1 DESCRIPTION XML::SAX is a SAX parser access API for Perl. It includes classes and APIs required for implementing SAX drivers, along with a factory class for returning any SAX parser installed on the user's system. =head1 USING A SAX2 PARSER The factory class is XML::SAX::ParserFactory. Please see the documentation of that module for how to instantiate a SAX parser: L<XML::SAX::ParserFactory>. However if you don't want to load up another manual page, here's a short synopsis: use XML::SAX::ParserFactory; use XML::SAX::XYZHandler; my $handler = XML::SAX::XYZHandler->new(); my $p = XML::SAX::ParserFactory->parser(Handler => $handler); $p->parse_uri("foo.xml"); # or $p->parse_string("<foo/>") or $p->parse_file($fh); This will automatically load a SAX2 parser (defaulting to XML::SAX::PurePerl if no others are found) and return it to you. In order to learn how to use SAX to parse XML, you will need to read L<XML::SAX::Intro> and for reference, L<XML::SAX::Specification>. =head1 WRITING A SAX2 PARSER The first thing to remember in writing a SAX2 parser is to subclass XML::SAX::Base. This will make your life infinitely easier, by providing a number of methods automagically for you. See L<XML::SAX::Base> for more details. When writing a SAX2 parser that is compatible with XML::SAX, you need to inform XML::SAX of the presence of that driver when you install it. In order to do that, XML::SAX contains methods for saving the fact that the parser exists on your system to a "INI" file, which is then loaded to determine which parsers are installed. The best way to do this is to follow these rules: =over 4 =item * Add XML::SAX as a prerequisite in Makefile.PL: WriteMakefile( ... PREREQ_PM => { 'XML::SAX' => 0 }, ... ); Alternatively you may wish to check for it in other ways that will cause more than just a warning. =item * Add the following code snippet to your Makefile.PL: sub MY::install { package MY; my $script = shift->SUPER::install(@_); if (ExtUtils::MakeMaker::prompt( "Do you want to modify ParserDetails.ini?", 'Y') =~ /^y/i) { $script =~ s/install :: (.*)$/install :: $1 install_sax_driver/m; $script .= <<"INSTALL"; install_sax_driver : \t\@\$(PERL) -MXML::SAX -e "XML::SAX->add_parser(q(\$(NAME)))->save_parsers()" INSTALL } return $script; } Note that you should check the output of this - \$(NAME) will use the name of your distribution, which may not be exactly what you want. For example XML::LibXML has a driver called XML::LibXML::SAX::Generator, which is used in place of \$(NAME) in the above. =item * Add an XML::SAX test: A test file should be added to your t/ directory containing something like the following: use Test; BEGIN { plan tests => 3 } use XML::SAX; use XML::SAX::PurePerl::DebugHandler; XML::SAX->add_parser(q(XML::SAX::MyDriver)); local $XML::SAX::ParserPackage = 'XML::SAX::MyDriver'; eval { my $handler = XML::SAX::PurePerl::DebugHandler->new(); ok($handler); my $parser = XML::SAX::ParserFactory->parser(Handler => $handler); ok($parser); ok($parser->isa('XML::SAX::MyDriver'); $parser->parse_string("<tag/>"); ok($handler->{seen}{start_element}); }; =back =head1 EXPORTS By default, XML::SAX exports nothing into the caller's namespace. However you can request the symbols C<Namespaces> and C<Validation> which are the URIs for those features, allowing an easier way to request those features via ParserFactory: use XML::SAX qw(Namespaces Validation); my $factory = XML::SAX::ParserFactory->new(); $factory->require_feature(Namespaces); $factory->require_feature(Validation); my $parser = $factory->parser(); =head1 AUTHOR Current maintainer: Grant McLean, grantm@cpan.org Originally written by: Matt Sergeant, matt@sergeant.org Kip Hampton, khampton@totalcinema.com Robin Berjon, robin@knowscape.com =head1 LICENSE This is free software, you may use it and distribute it under the same terms as Perl itself. =head1 SEE ALSO L<XML::SAX::Base> for writing SAX Filters and Parsers L<XML::SAX::PurePerl> for an XML parser written in 100% pure perl. L<XML::SAX::Exception> for details on exception handling =cut ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������darwin-perl-lib/XML/Simple/�������������������������������������������������������������������������000755 �000765 �000024 �00000000000 13167163507 017655� 5����������������������������������������������������������������������������������������������������ustar�00ocsinventory��������������������staff���������������������������000000 �000000 ������������������������������������������������������������������������������������������������������������������������������������������������������������������������darwin-perl-lib/XML/Simple.pm�����������������������������������������������������������������������000444 �000765 �000024 �00000304154 13167163507 020220� 0����������������������������������������������������������������������������������������������������ustar�00ocsinventory��������������������staff���������������������������000000 �000000 ������������������������������������������������������������������������������������������������������������������������������������������������������������������������package XML::Simple; $XML::Simple::VERSION = '2.24'; =head1 NAME XML::Simple - An API for simple XML files =head1 SYNOPSIS You really don't want to use this module in new code. If you ignore this warning and use it anyway, the C<qw(:strict)> mode will save you a little pain. use XML::Simple qw(:strict); my $ref = XMLin([<xml file or string>] [, <options>]); my $xml = XMLout($hashref [, <options>]); Or the object oriented way: require XML::Simple qw(:strict); my $xs = XML::Simple->new([<options>]); my $ref = $xs->XMLin([<xml file or string>] [, <options>]); my $xml = $xs->XMLout($hashref [, <options>]); (or see L<"SAX SUPPORT"> for 'the SAX way'). Note, in these examples, the square brackets are used to denote optional items not to imply items should be supplied in arrayrefs. =cut # See after __END__ for more POD documentation # Load essentials here, other modules loaded on demand later use strict; use warnings; use warnings::register; use Carp; use Scalar::Util qw(); require Exporter; ############################################################################## # Define some constants # use vars qw($VERSION @ISA @EXPORT @EXPORT_OK $PREFERRED_PARSER); @ISA = qw(Exporter); @EXPORT = qw(XMLin XMLout); @EXPORT_OK = qw(xml_in xml_out); my %StrictMode = (); my @KnownOptIn = qw(keyattr keeproot forcecontent contentkey noattr searchpath forcearray cache suppressempty parseropts grouptags nsexpand datahandler varattr variables normalisespace normalizespace valueattr strictmode); my @KnownOptOut = qw(keyattr keeproot contentkey noattr rootname xmldecl outputfile noescape suppressempty grouptags nsexpand handler noindent attrindent nosort valueattr numericescape strictmode); my @DefKeyAttr = qw(name key id); my $DefRootName = qq(opt); my $DefContentKey = qq(content); my $DefXmlDecl = qq(<?xml version='1.0' standalone='yes'?>); my $xmlns_ns = 'http://www.w3.org/2000/xmlns/'; my $bad_def_ns_jcn = '{' . $xmlns_ns . '}'; # LibXML::SAX workaround ############################################################################## # Globals for use by caching routines # my %MemShareCache = (); my %MemCopyCache = (); ############################################################################## # Wrapper for Exporter - handles ':strict' # sub import { # Handle the :strict tag my($calling_package) = caller(); _strict_mode_for_caller(1) if grep(/^:strict$/, @_); # Pass everything else to Exporter.pm @_ = grep(!/^:strict$/, @_); goto &Exporter::import; } ############################################################################## # Constructor for optional object interface. # sub new { my $class = shift; if(@_ % 2) { croak "Default options must be name=>value pairs (odd number supplied)"; } my %known_opt; @known_opt{@KnownOptIn, @KnownOptOut} = (); my %raw_opt = @_; $raw_opt{strictmode} = _strict_mode_for_caller() unless exists $raw_opt{strictmode}; my %def_opt; while(my($key, $val) = each %raw_opt) { my $lkey = lc($key); $lkey =~ s/_//g; croak "Unrecognised option: $key" unless(exists($known_opt{$lkey})); $def_opt{$lkey} = $val; } my $self = { def_opt => \%def_opt }; return(bless($self, $class)); } ############################################################################## # Sub: _strict_mode_for_caller() # # Gets or sets the XML::Simple :strict mode flag for the calling namespace. # Walks back through call stack to find the calling namespace and sets the # :strict mode flag for that namespace if an argument was supplied and returns # the flag value if not. # sub _strict_mode_for_caller { my $set_mode = @_; my $frame = 1; while(my($package) = caller($frame++)) { next if $package eq 'XML::Simple'; $StrictMode{$package} = 1 if $set_mode; return $StrictMode{$package}; } return(0); } ############################################################################## # Sub: _get_object() # # Helper routine called from XMLin() and XMLout() to create an object if none # was provided. Note, this routine does mess with the caller's @_ array. # sub _get_object { my $self; if($_[0] and UNIVERSAL::isa($_[0], 'XML::Simple')) { $self = shift; } else { $self = XML::Simple->new(); } return $self; } ############################################################################## # Sub/Method: XMLin() # # Exported routine for slurping XML into a hashref - see pod for info. # # May be called as object method or as a plain function. # # Expects one arg for the source XML, optionally followed by a number of # name => value option pairs. # sub XMLin { my $self = &_get_object; # note, @_ is passed implicitly my $target = shift; # Work out whether to parse a string, a file or a filehandle if(not defined $target) { return $self->parse_file(undef, @_); } elsif($target eq '-') { local($/) = undef; $target = <STDIN>; return $self->parse_string(\$target, @_); } elsif(my $type = ref($target)) { if($type eq 'SCALAR') { return $self->parse_string($target, @_); } else { return $self->parse_fh($target, @_); } } elsif($target =~ m{<.*?>}s) { return $self->parse_string(\$target, @_); } else { return $self->parse_file($target, @_); } } ############################################################################## # Sub/Method: parse_file() # # Same as XMLin, but only parses from a named file. # sub parse_file { my $self = &_get_object; # note, @_ is passed implicitly my $filename = shift; $self->handle_options('in', @_); $filename = $self->default_config_file if not defined $filename; $filename = $self->find_xml_file($filename, @{$self->{opt}->{searchpath}}); # Check cache for previous parse if($self->{opt}->{cache}) { foreach my $scheme (@{$self->{opt}->{cache}}) { my $method = 'cache_read_' . $scheme; my $opt = $self->$method($filename); return($opt) if($opt); } } my $ref = $self->build_simple_tree($filename, undef); if($self->{opt}->{cache}) { my $method = 'cache_write_' . $self->{opt}->{cache}->[0]; $self->$method($ref, $filename); } return $ref; } ############################################################################## # Sub/Method: parse_fh() # # Same as XMLin, but only parses from a filehandle. # sub parse_fh { my $self = &_get_object; # note, @_ is passed implicitly my $fh = shift; croak "Can't use " . (defined $fh ? qq{string ("$fh")} : 'undef') . " as a filehandle" unless ref $fh; $self->handle_options('in', @_); return $self->build_simple_tree(undef, $fh); } ############################################################################## # Sub/Method: parse_string() # # Same as XMLin, but only parses from a string or a reference to a string. # sub parse_string { my $self = &_get_object; # note, @_ is passed implicitly my $string = shift; $self->handle_options('in', @_); return $self->build_simple_tree(undef, ref $string ? $string : \$string); } ############################################################################## # Method: default_config_file() # # Returns the name of the XML file to parse if no filename (or XML string) # was provided. # sub default_config_file { my $self = shift; require File::Basename; my($basename, $script_dir, $ext) = File::Basename::fileparse($0, '\.[^\.]+'); # Add script directory to searchpath if($script_dir) { unshift(@{$self->{opt}->{searchpath}}, $script_dir); } return $basename . '.xml'; } ############################################################################## # Method: build_simple_tree() # # Builds a 'tree' data structure as provided by XML::Parser and then # 'simplifies' it as specified by the various options in effect. # sub build_simple_tree { my $self = shift; my $tree = eval { $self->build_tree(@_); }; Carp::croak("$@XML::Simple called") if $@; return $self->{opt}->{keeproot} ? $self->collapse({}, @$tree) : $self->collapse(@{$tree->[1]}); } ############################################################################## # Method: build_tree() # # This routine will be called if there is no suitable pre-parsed tree in a # cache. It parses the XML and returns an XML::Parser 'Tree' style data # structure (summarised in the comments for the collapse() routine below). # # XML::Simple requires the services of another module that knows how to parse # XML. If XML::SAX is installed, the default SAX parser will be used, # otherwise XML::Parser will be used. # # This routine expects to be passed a filename as argument 1 or a 'string' as # argument 2. The 'string' might be a string of XML (passed by reference to # save memory) or it might be a reference to an IO::Handle. (This # non-intuitive mess results in part from the way XML::Parser works but that's # really no excuse). # sub build_tree { my $self = shift; my $filename = shift; my $string = shift; my $preferred_parser = $PREFERRED_PARSER; unless(defined($preferred_parser)) { $preferred_parser = $ENV{XML_SIMPLE_PREFERRED_PARSER} || ''; } if($preferred_parser eq 'XML::Parser') { return($self->build_tree_xml_parser($filename, $string)); } eval { require XML::SAX; }; # We didn't need it until now if($@) { # No XML::SAX - fall back to XML::Parser if($preferred_parser) { # unless a SAX parser was expressly requested croak "XMLin() could not load XML::SAX"; } return($self->build_tree_xml_parser($filename, $string)); } $XML::SAX::ParserPackage = $preferred_parser if($preferred_parser); my $sp = XML::SAX::ParserFactory->parser(Handler => $self); $self->{nocollapse} = 1; my($tree); if($filename) { $tree = $sp->parse_uri($filename); } else { if(ref($string) && ref($string) ne 'SCALAR') { $tree = $sp->parse_file($string); } else { $tree = $sp->parse_string($$string); } } return($tree); } ############################################################################## # Method: build_tree_xml_parser() # # This routine will be called if XML::SAX is not installed, or if XML::Parser # was specifically requested. It takes the same arguments as build_tree() and # returns the same data structure (XML::Parser 'Tree' style). # sub build_tree_xml_parser { my $self = shift; my $filename = shift; my $string = shift; eval { local($^W) = 0; # Suppress warning from Expat.pm re File::Spec::load() require XML::Parser; # We didn't need it until now }; if($@) { croak "XMLin() requires either XML::SAX or XML::Parser"; } if($self->{opt}->{nsexpand}) { carp "'nsexpand' option requires XML::SAX"; } my $xp = XML::Parser->new(Style => 'Tree', @{$self->{opt}->{parseropts}}); my($tree); if($filename) { # $tree = $xp->parsefile($filename); # Changed due to prob w/mod_perl open(my $xfh, '<', $filename) || croak qq($filename - $!); $tree = $xp->parse($xfh); } else { $tree = $xp->parse($$string); } return($tree); } ############################################################################## # Method: cache_write_storable() # # Wrapper routine for invoking Storable::nstore() to cache a parsed data # structure. # sub cache_write_storable { my($self, $data, $filename) = @_; my $cachefile = $self->storable_filename($filename); require Storable; # We didn't need it until now if ('VMS' eq $^O) { Storable::nstore($data, $cachefile); } else { # If the following line fails for you, your Storable.pm is old - upgrade Storable::lock_nstore($data, $cachefile); } } ############################################################################## # Method: cache_read_storable() # # Wrapper routine for invoking Storable::retrieve() to read a cached parsed # data structure. Only returns cached data if the cache file exists and is # newer than the source XML file. # sub cache_read_storable { my($self, $filename) = @_; my $cachefile = $self->storable_filename($filename); return unless(-r $cachefile); return unless((stat($cachefile))[9] > (stat($filename))[9]); require Storable; # We didn't need it until now if ('VMS' eq $^O) { return(Storable::retrieve($cachefile)); } else { return(Storable::lock_retrieve($cachefile)); } } ############################################################################## # Method: storable_filename() # # Translates the supplied source XML filename into a filename for the storable # cached data. A '.stor' suffix is added after stripping an optional '.xml' # suffix. # sub storable_filename { my($self, $cachefile) = @_; $cachefile =~ s{(\.xml)?$}{.stor}; return $cachefile; } ############################################################################## # Method: cache_write_memshare() # # Takes the supplied data structure reference and stores it away in a global # hash structure. # sub cache_write_memshare { my($self, $data, $filename) = @_; $MemShareCache{$filename} = [time(), $data]; } ############################################################################## # Method: cache_read_memshare() # # Takes a filename and looks in a global hash for a cached parsed version. # sub cache_read_memshare { my($self, $filename) = @_; return unless($MemShareCache{$filename}); return unless($MemShareCache{$filename}->[0] > (stat($filename))[9]); return($MemShareCache{$filename}->[1]); } ############################################################################## # Method: cache_write_memcopy() # # Takes the supplied data structure and stores a copy of it in a global hash # structure. # sub cache_write_memcopy { my($self, $data, $filename) = @_; require Storable; # We didn't need it until now $MemCopyCache{$filename} = [time(), Storable::dclone($data)]; } ############################################################################## # Method: cache_read_memcopy() # # Takes a filename and looks in a global hash for a cached parsed version. # Returns a reference to a copy of that data structure. # sub cache_read_memcopy { my($self, $filename) = @_; return unless($MemCopyCache{$filename}); return unless($MemCopyCache{$filename}->[0] > (stat($filename))[9]); return(Storable::dclone($MemCopyCache{$filename}->[1])); } ############################################################################## # Sub/Method: XMLout() # # Exported routine for 'unslurping' a data structure out to XML. # # Expects a reference to a data structure and an optional list of option # name => value pairs. # sub XMLout { my $self = &_get_object; # note, @_ is passed implicitly croak "XMLout() requires at least one argument" unless(@_); my $ref = shift; $self->handle_options('out', @_); # If namespace expansion is set, XML::NamespaceSupport is required if($self->{opt}->{nsexpand}) { require XML::NamespaceSupport; $self->{nsup} = XML::NamespaceSupport->new(); $self->{ns_prefix} = 'aaa'; } # Wrap top level arrayref in a hash if(UNIVERSAL::isa($ref, 'ARRAY')) { $ref = { anon => $ref }; } # Extract rootname from top level hash if keeproot enabled if($self->{opt}->{keeproot}) { my(@keys) = keys(%$ref); if(@keys == 1) { $ref = $ref->{$keys[0]}; $self->{opt}->{rootname} = $keys[0]; } } # Ensure there are no top level attributes if we're not adding root elements elsif($self->{opt}->{rootname} eq '') { if(UNIVERSAL::isa($ref, 'HASH')) { my $refsave = $ref; $ref = {}; foreach (keys(%$refsave)) { if(ref($refsave->{$_})) { $ref->{$_} = $refsave->{$_}; } else { $ref->{$_} = [ $refsave->{$_} ]; } } } } # Encode the hashref and write to file if necessary $self->{_ancestors} = {}; my $xml = $self->value_to_xml($ref, $self->{opt}->{rootname}, ''); delete $self->{_ancestors}; if($self->{opt}->{xmldecl}) { $xml = $self->{opt}->{xmldecl} . "\n" . $xml; } if($self->{opt}->{outputfile}) { if(ref($self->{opt}->{outputfile})) { my $fh = $self->{opt}->{outputfile}; if(UNIVERSAL::isa($fh, 'GLOB') and !UNIVERSAL::can($fh, 'print')) { eval { require IO::Handle; }; croak $@ if $@; } return($fh->print($xml)); } else { open(my $out, '>', "$self->{opt}->{outputfile}") || croak "open($self->{opt}->{outputfile}): $!"; binmode($out, ':utf8') if($] >= 5.008); print $out $xml or croak "print: $!"; close $out or croak "close: $!"; } } elsif($self->{opt}->{handler}) { require XML::SAX; my $sp = XML::SAX::ParserFactory->parser( Handler => $self->{opt}->{handler} ); return($sp->parse_string($xml)); } else { return($xml); } } ############################################################################## # Method: handle_options() # # Helper routine for both XMLin() and XMLout(). Both routines handle their # first argument and assume all other args are options handled by this routine. # Saves a hash of options in $self->{opt}. # # If default options were passed to the constructor, they will be retrieved # here and merged with options supplied to the method call. # # First argument should be the string 'in' or the string 'out'. # # Remaining arguments should be name=>value pairs. Sets up default values # for options not supplied. Unrecognised options are a fatal error. # sub handle_options { my $self = shift; my $dirn = shift; # Determine valid options based on context my %known_opt; if($dirn eq 'in') { @known_opt{@KnownOptIn} = @KnownOptIn; } else { @known_opt{@KnownOptOut} = @KnownOptOut; } # Store supplied options in hashref and weed out invalid ones if(@_ % 2) { croak "Options must be name=>value pairs (odd number supplied)"; } my %raw_opt = @_; my $opt = {}; $self->{opt} = $opt; while(my($key, $val) = each %raw_opt) { my $lkey = lc($key); $lkey =~ s/_//g; croak "Unrecognised option: $key" unless($known_opt{$lkey}); $opt->{$lkey} = $val; } # Merge in options passed to constructor foreach (keys(%known_opt)) { unless(exists($opt->{$_})) { if(exists($self->{def_opt}->{$_})) { $opt->{$_} = $self->{def_opt}->{$_}; } } } # Set sensible defaults if not supplied if(exists($opt->{rootname})) { unless(defined($opt->{rootname})) { $opt->{rootname} = ''; } } else { $opt->{rootname} = $DefRootName; } if($opt->{xmldecl} and $opt->{xmldecl} eq '1') { $opt->{xmldecl} = $DefXmlDecl; } if(exists($opt->{contentkey})) { if($opt->{contentkey} =~ m{^-(.*)$}) { $opt->{contentkey} = $1; $opt->{collapseagain} = 1; } } else { $opt->{contentkey} = $DefContentKey; } unless(exists($opt->{normalisespace})) { $opt->{normalisespace} = $opt->{normalizespace}; } $opt->{normalisespace} = 0 unless(defined($opt->{normalisespace})); # Cleanups for values assumed to be arrays later if($opt->{searchpath}) { unless(ref($opt->{searchpath})) { $opt->{searchpath} = [ $opt->{searchpath} ]; } } else { $opt->{searchpath} = [ ]; } if($opt->{cache} and !ref($opt->{cache})) { $opt->{cache} = [ $opt->{cache} ]; } if($opt->{cache}) { $_ = lc($_) foreach (@{$opt->{cache}}); foreach my $scheme (@{$opt->{cache}}) { my $method = 'cache_read_' . $scheme; croak "Unsupported caching scheme: $scheme" unless($self->can($method)); } } if(exists($opt->{parseropts})) { if(warnings::enabled()) { carp "Warning: " . "'ParserOpts' is deprecated, contact the author if you need it"; } } else { $opt->{parseropts} = [ ]; } # Special cleanup for {forcearray} which could be regex, arrayref or boolean # or left to default to 0 if(exists($opt->{forcearray})) { if(ref($opt->{forcearray}) eq 'Regexp') { $opt->{forcearray} = [ $opt->{forcearray} ]; } if(ref($opt->{forcearray}) eq 'ARRAY') { my @force_list = @{$opt->{forcearray}}; if(@force_list) { $opt->{forcearray} = {}; foreach my $tag (@force_list) { if(ref($tag) eq 'Regexp') { push @{$opt->{forcearray}->{_regex}}, $tag; } else { $opt->{forcearray}->{$tag} = 1; } } } else { $opt->{forcearray} = 0; } } else { $opt->{forcearray} = ( $opt->{forcearray} ? 1 : 0 ); } } else { if($opt->{strictmode} and $dirn eq 'in') { croak "No value specified for 'ForceArray' option in call to XML$dirn()"; } $opt->{forcearray} = 0; } # Special cleanup for {keyattr} which could be arrayref or hashref or left # to default to arrayref if(exists($opt->{keyattr})) { if(ref($opt->{keyattr})) { if(ref($opt->{keyattr}) eq 'HASH') { # Make a copy so we can mess with it $opt->{keyattr} = { %{$opt->{keyattr}} }; # Convert keyattr => { elem => '+attr' } # to keyattr => { elem => [ 'attr', '+' ] } foreach my $el (keys(%{$opt->{keyattr}})) { if($opt->{keyattr}->{$el} =~ /^(\+|-)?(.*)$/) { $opt->{keyattr}->{$el} = [ $2, ($1 ? $1 : '') ]; if($opt->{strictmode} and $dirn eq 'in') { next if($opt->{forcearray} == 1); next if(ref($opt->{forcearray}) eq 'HASH' and $opt->{forcearray}->{$el}); croak "<$el> set in KeyAttr but not in ForceArray"; } } else { delete($opt->{keyattr}->{$el}); # Never reached (famous last words?) } } } else { if(@{$opt->{keyattr}} == 0) { delete($opt->{keyattr}); } } } else { $opt->{keyattr} = [ $opt->{keyattr} ]; } } else { if($opt->{strictmode}) { croak "No value specified for 'KeyAttr' option in call to XML$dirn()"; } $opt->{keyattr} = [ @DefKeyAttr ]; } # Special cleanup for {valueattr} which could be arrayref or hashref if(exists($opt->{valueattr})) { if(ref($opt->{valueattr}) eq 'ARRAY') { $opt->{valueattrlist} = {}; $opt->{valueattrlist}->{$_} = 1 foreach(@{ delete $opt->{valueattr} }); } } # make sure there's nothing weird in {grouptags} if($opt->{grouptags}) { croak "Illegal value for 'GroupTags' option - expected a hashref" unless UNIVERSAL::isa($opt->{grouptags}, 'HASH'); while(my($key, $val) = each %{$opt->{grouptags}}) { next if $key ne $val; croak "Bad value in GroupTags: '$key' => '$val'"; } } # Check the {variables} option is valid and initialise variables hash if($opt->{variables} and !UNIVERSAL::isa($opt->{variables}, 'HASH')) { croak "Illegal value for 'Variables' option - expected a hashref"; } if($opt->{variables}) { $self->{_var_values} = { %{$opt->{variables}} }; } elsif($opt->{varattr}) { $self->{_var_values} = {}; } } ############################################################################## # Method: find_xml_file() # # Helper routine for XMLin(). # Takes a filename, and a list of directories, attempts to locate the file in # the directories listed. # Returns a full pathname on success; croaks on failure. # sub find_xml_file { my $self = shift; my $file = shift; my @search_path = @_; require File::Basename; require File::Spec; my($filename, $filedir) = File::Basename::fileparse($file); if($filename ne $file) { # Ignore searchpath if dir component return($file) if(-e $file); } else { my($path); foreach $path (@search_path) { my $fullpath = File::Spec->catfile($path, $file); return($fullpath) if(-e $fullpath); } } # If user did not supply a search path, default to current directory if(!@search_path) { return($file) if(-e $file); croak "File does not exist: $file"; } croak "Could not find $file in ", join(':', @search_path); } ############################################################################## # Method: collapse() # # Helper routine for XMLin(). This routine really comprises the 'smarts' (or # value add) of this module. # # Takes the parse tree that XML::Parser produced from the supplied XML and # recurses through it 'collapsing' unnecessary levels of indirection (nested # arrays etc) to produce a data structure that is easier to work with. # # Elements in the original parser tree are represented as an element name # followed by an arrayref. The first element of the array is a hashref # containing the attributes. The rest of the array contains a list of any # nested elements as name+arrayref pairs: # # <element name>, [ { <attribute hashref> }, <element name>, [ ... ], ... ] # # The special element name '0' (zero) flags text content. # # This routine cuts down the noise by discarding any text content consisting of # only whitespace and then moves the nested elements into the attribute hash # using the name of the nested element as the hash key and the collapsed # version of the nested element as the value. Multiple nested elements with # the same name will initially be represented as an arrayref, but this may be # 'folded' into a hashref depending on the value of the keyattr option. # sub collapse { my $self = shift; # Start with the hash of attributes my $attr = shift; if($self->{opt}->{noattr}) { # Discard if 'noattr' set $attr = $self->new_hashref; } elsif($self->{opt}->{normalisespace} == 2) { while(my($key, $value) = each %$attr) { $attr->{$key} = $self->normalise_space($value) } } # Do variable substitutions if(my $var = $self->{_var_values}) { while(my($key, $val) = each(%$attr)) { $val =~ s^\$\{([\w.]+)\}^ $self->get_var($1) ^ge; $attr->{$key} = $val; } } # Roll up 'value' attributes (but only if no nested elements) if(!@_ and keys %$attr == 1) { my($k) = keys %$attr; if($self->{opt}->{valueattrlist} and $self->{opt}->{valueattrlist}->{$k}) { return $attr->{$k}; } } # Add any nested elements my($key, $val); while(@_) { $key = shift; $val = shift; $val = '' if not defined $val; if(ref($val)) { $val = $self->collapse(@$val); next if(!defined($val) and $self->{opt}->{suppressempty}); } elsif($key eq '0') { next if($val =~ m{^\s*$}s); # Skip all whitespace content $val = $self->normalise_space($val) if($self->{opt}->{normalisespace} == 2); # do variable substitutions if(my $var = $self->{_var_values}) { $val =~ s^\$\{(\w+)\}^ $self->get_var($1) ^ge; } # look for variable definitions if(my $var = $self->{opt}->{varattr}) { if(exists $attr->{$var}) { $self->set_var($attr->{$var}, $val); } } # Collapse text content in element with no attributes to a string if(!%$attr and !@_) { return($self->{opt}->{forcecontent} ? { $self->{opt}->{contentkey} => $val } : $val ); } $key = $self->{opt}->{contentkey}; } # Combine duplicate attributes into arrayref if required if(exists($attr->{$key})) { if(UNIVERSAL::isa($attr->{$key}, 'ARRAY')) { push(@{$attr->{$key}}, $val); } else { $attr->{$key} = [ $attr->{$key}, $val ]; } } elsif(defined($val) and UNIVERSAL::isa($val, 'ARRAY')) { $attr->{$key} = [ $val ]; } else { if( $key ne $self->{opt}->{contentkey} and ( ($self->{opt}->{forcearray} == 1) or ( (ref($self->{opt}->{forcearray}) eq 'HASH') and ( $self->{opt}->{forcearray}->{$key} or (grep $key =~ $_, @{$self->{opt}->{forcearray}->{_regex}}) ) ) ) ) { $attr->{$key} = [ $val ]; } else { $attr->{$key} = $val; } } } # Turn arrayrefs into hashrefs if key fields present if($self->{opt}->{keyattr}) { while(($key,$val) = each %$attr) { if(defined($val) and UNIVERSAL::isa($val, 'ARRAY')) { $attr->{$key} = $self->array_to_hash($key, $val); } } } # disintermediate grouped tags if($self->{opt}->{grouptags}) { while(my($key, $val) = each(%$attr)) { next unless(UNIVERSAL::isa($val, 'HASH') and (keys %$val == 1)); next unless(exists($self->{opt}->{grouptags}->{$key})); my($child_key, $child_val) = %$val; if($self->{opt}->{grouptags}->{$key} eq $child_key) { $attr->{$key}= $child_val; } } } # Fold hashes containing a single anonymous array up into just the array my $count = scalar keys %$attr; if($count == 1 and exists $attr->{anon} and UNIVERSAL::isa($attr->{anon}, 'ARRAY') ) { return($attr->{anon}); } # Do the right thing if hash is empty, otherwise just return it if(!%$attr and exists($self->{opt}->{suppressempty})) { if(defined($self->{opt}->{suppressempty}) and $self->{opt}->{suppressempty} eq '') { return(''); } return(undef); } # Roll up named elements with named nested 'value' attributes if($self->{opt}->{valueattr}) { while(my($key, $val) = each(%$attr)) { next unless($self->{opt}->{valueattr}->{$key}); next unless(UNIVERSAL::isa($val, 'HASH') and (keys %$val == 1)); my($k) = keys %$val; next unless($k eq $self->{opt}->{valueattr}->{$key}); $attr->{$key} = $val->{$k}; } } return($attr) } ############################################################################## # Method: set_var() # # Called when a variable definition is encountered in the XML. (A variable # definition looks like <element attrname="name">value</element> where attrname # matches the varattr setting). # sub set_var { my($self, $name, $value) = @_; $self->{_var_values}->{$name} = $value; } ############################################################################## # Method: get_var() # # Called during variable substitution to get the value for the named variable. # sub get_var { my($self, $name) = @_; my $value = $self->{_var_values}->{$name}; return $value if(defined($value)); return '${' . $name . '}'; } ############################################################################## # Method: normalise_space() # # Strips leading and trailing whitespace and collapses sequences of whitespace # characters to a single space. # sub normalise_space { my($self, $text) = @_; $text =~ s/^\s+//s; $text =~ s/\s+$//s; $text =~ s/\s\s+/ /sg; return $text; } ############################################################################## # Method: array_to_hash() # # Helper routine for collapse(). # Attempts to 'fold' an array of hashes into an hash of hashes. Returns a # reference to the hash on success or the original array if folding is # not possible. Behaviour is controlled by 'keyattr' option. # sub array_to_hash { my $self = shift; my $name = shift; my $arrayref = shift; my $hashref = $self->new_hashref; my($i, $key, $val, $flag); # Handle keyattr => { .... } if(ref($self->{opt}->{keyattr}) eq 'HASH') { return($arrayref) unless(exists($self->{opt}->{keyattr}->{$name})); ($key, $flag) = @{$self->{opt}->{keyattr}->{$name}}; for($i = 0; $i < @$arrayref; $i++) { if(UNIVERSAL::isa($arrayref->[$i], 'HASH') and exists($arrayref->[$i]->{$key}) ) { $val = $arrayref->[$i]->{$key}; if(ref($val)) { $self->die_or_warn("<$name> element has non-scalar '$key' key attribute"); return($arrayref); } $val = $self->normalise_space($val) if($self->{opt}->{normalisespace} == 1); $self->die_or_warn("<$name> element has non-unique value in '$key' key attribute: $val") if(exists($hashref->{$val})); $hashref->{$val} = $self->new_hashref( %{$arrayref->[$i]} ); $hashref->{$val}->{"-$key"} = $hashref->{$val}->{$key} if($flag eq '-'); delete $hashref->{$val}->{$key} unless($flag eq '+'); } else { $self->die_or_warn("<$name> element has no '$key' key attribute"); return($arrayref); } } } # Or assume keyattr => [ .... ] else { my $default_keys = join(',', @DefKeyAttr) eq join(',', @{$self->{opt}->{keyattr}}); ELEMENT: for($i = 0; $i < @$arrayref; $i++) { return($arrayref) unless(UNIVERSAL::isa($arrayref->[$i], 'HASH')); foreach $key (@{$self->{opt}->{keyattr}}) { if(defined($arrayref->[$i]->{$key})) { $val = $arrayref->[$i]->{$key}; if(ref($val)) { $self->die_or_warn("<$name> element has non-scalar '$key' key attribute") if not $default_keys; return($arrayref); } $val = $self->normalise_space($val) if($self->{opt}->{normalisespace} == 1); $self->die_or_warn("<$name> element has non-unique value in '$key' key attribute: $val") if(exists($hashref->{$val})); $hashref->{$val} = $self->new_hashref( %{$arrayref->[$i]} ); delete $hashref->{$val}->{$key}; next ELEMENT; } } return($arrayref); # No keyfield matched } } # collapse any hashes which now only have a 'content' key if($self->{opt}->{collapseagain}) { $hashref = $self->collapse_content($hashref); } return($hashref); } ############################################################################## # Method: die_or_warn() # # Takes a diagnostic message and does one of three things: # 1. dies if strict mode is enabled # 2. warns if warnings are enabled but strict mode is not # 3. ignores message and returns silently if neither strict mode nor warnings # are enabled # sub die_or_warn { my $self = shift; my $msg = shift; croak $msg if($self->{opt}->{strictmode}); if(warnings::enabled()) { carp "Warning: $msg"; } } ############################################################################## # Method: new_hashref() # # This is a hook routine for overriding in a sub-class. Some people believe # that using Tie::IxHash here will solve order-loss problems. # sub new_hashref { my $self = shift; return { @_ }; } ############################################################################## # Method: collapse_content() # # Helper routine for array_to_hash # # Arguments expected are: # - an XML::Simple object # - a hashref # the hashref is a former array, turned into a hash by array_to_hash because # of the presence of key attributes # at this point collapse_content avoids over-complicated structures like # dir => { libexecdir => { content => '$exec_prefix/libexec' }, # localstatedir => { content => '$prefix' }, # } # into # dir => { libexecdir => '$exec_prefix/libexec', # localstatedir => '$prefix', # } sub collapse_content { my $self = shift; my $hashref = shift; my $contentkey = $self->{opt}->{contentkey}; # first go through the values,checking that they are fit to collapse foreach my $val (values %$hashref) { return $hashref unless ( (ref($val) eq 'HASH') and (keys %$val == 1) and (exists $val->{$contentkey}) ); } # now collapse them foreach my $key (keys %$hashref) { $hashref->{$key}= $hashref->{$key}->{$contentkey}; } return $hashref; } ############################################################################## # Method: value_to_xml() # # Helper routine for XMLout() - recurses through a data structure building up # and returning an XML representation of that structure as a string. # # Arguments expected are: # - the data structure to be encoded (usually a reference) # - the XML tag name to use for this item # - a string of spaces for use as the current indent level # sub value_to_xml { my $self = shift;; # Grab the other arguments my($ref, $name, $indent) = @_; my $named = (defined($name) and $name ne '' ? 1 : 0); my $nl = "\n"; my $is_root = $indent eq '' ? 1 : 0; # Warning, dirty hack! if($self->{opt}->{noindent}) { $indent = ''; $nl = ''; } # Convert to XML my $refaddr = Scalar::Util::refaddr($ref); if($refaddr) { croak "circular data structures not supported" if $self->{_ancestors}->{$refaddr}; $self->{_ancestors}->{$refaddr} = $ref; # keep ref alive until we delete it } else { if($named) { return(join('', $indent, '<', $name, '>', ($self->{opt}->{noescape} ? $ref : $self->escape_value($ref)), '</', $name, ">", $nl )); } else { return("$ref$nl"); } } # Unfold hash to array if possible if(UNIVERSAL::isa($ref, 'HASH') # It is a hash and keys %$ref # and it's not empty and $self->{opt}->{keyattr} # and folding is enabled and !$is_root # and its not the root element ) { $ref = $self->hash_to_array($name, $ref); } my @result = (); my($key, $value); # Handle hashrefs if(UNIVERSAL::isa($ref, 'HASH')) { # Reintermediate grouped values if applicable if($self->{opt}->{grouptags}) { $ref = $self->copy_hash($ref); while(my($key, $val) = each %$ref) { if($self->{opt}->{grouptags}->{$key}) { $ref->{$key} = $self->new_hashref( $self->{opt}->{grouptags}->{$key} => $val ); } } } # Scan for namespace declaration attributes my $nsdecls = ''; my $default_ns_uri; if($self->{nsup}) { $ref = $self->copy_hash($ref); $self->{nsup}->push_context(); # Look for default namespace declaration first if(exists($ref->{xmlns})) { $self->{nsup}->declare_prefix('', $ref->{xmlns}); $nsdecls .= qq( xmlns="$ref->{xmlns}"); delete($ref->{xmlns}); } $default_ns_uri = $self->{nsup}->get_uri(''); # Then check all the other keys foreach my $qname (keys(%$ref)) { my($uri, $lname) = $self->{nsup}->parse_jclark_notation($qname); if($uri) { if($uri eq $xmlns_ns) { $self->{nsup}->declare_prefix($lname, $ref->{$qname}); $nsdecls .= qq( xmlns:$lname="$ref->{$qname}"); delete($ref->{$qname}); } } } # Translate any remaining Clarkian names foreach my $qname (keys(%$ref)) { my($uri, $lname) = $self->{nsup}->parse_jclark_notation($qname); if($uri) { if($default_ns_uri and $uri eq $default_ns_uri) { $ref->{$lname} = $ref->{$qname}; delete($ref->{$qname}); } else { my $prefix = $self->{nsup}->get_prefix($uri); unless($prefix) { # $self->{nsup}->declare_prefix(undef, $uri); # $prefix = $self->{nsup}->get_prefix($uri); $prefix = $self->{ns_prefix}++; $self->{nsup}->declare_prefix($prefix, $uri); $nsdecls .= qq( xmlns:$prefix="$uri"); } $ref->{"$prefix:$lname"} = $ref->{$qname}; delete($ref->{$qname}); } } } } my @nested = (); my $text_content = undef; if($named) { push @result, $indent, '<', $name, $nsdecls; } if(keys %$ref) { my $first_arg = 1; foreach my $key ($self->sorted_keys($name, $ref)) { my $value = $ref->{$key}; next if(substr($key, 0, 1) eq '-'); if(!defined($value)) { next if $self->{opt}->{suppressempty}; unless(exists($self->{opt}->{suppressempty}) and !defined($self->{opt}->{suppressempty}) ) { carp 'Use of uninitialized value' if warnings::enabled(); } if($key eq $self->{opt}->{contentkey}) { $text_content = ''; } else { $value = exists($self->{opt}->{suppressempty}) ? {} : ''; } } if(!ref($value) and $self->{opt}->{valueattr} and $self->{opt}->{valueattr}->{$key} ) { $value = $self->new_hashref( $self->{opt}->{valueattr}->{$key} => $value ); } if(ref($value) or $self->{opt}->{noattr}) { push @nested, $self->value_to_xml($value, $key, "$indent "); } else { if($key eq $self->{opt}->{contentkey}) { $value = $self->escape_value($value) unless($self->{opt}->{noescape}); $text_content = $value; } else { $value = $self->escape_attr($value) unless($self->{opt}->{noescape}); push @result, "\n$indent " . ' ' x length($name) if($self->{opt}->{attrindent} and !$first_arg); push @result, ' ', $key, '="', $value , '"'; $first_arg = 0; } } } } else { $text_content = ''; } if(@nested or defined($text_content)) { if($named) { push @result, ">"; if(defined($text_content)) { push @result, $text_content; $nested[0] =~ s/^\s+// if(@nested); } else { push @result, $nl; } if(@nested) { push @result, @nested, $indent; } push @result, '</', $name, ">", $nl; } else { push @result, @nested; # Special case if no root elements } } else { push @result, " />", $nl; } $self->{nsup}->pop_context() if($self->{nsup}); } # Handle arrayrefs elsif(UNIVERSAL::isa($ref, 'ARRAY')) { foreach $value (@$ref) { next if !defined($value) and $self->{opt}->{suppressempty}; if(!ref($value)) { push @result, $indent, '<', $name, '>', ($self->{opt}->{noescape} ? $value : $self->escape_value($value)), '</', $name, ">$nl"; } elsif(UNIVERSAL::isa($value, 'HASH')) { push @result, $self->value_to_xml($value, $name, $indent); } else { push @result, $indent, '<', $name, ">$nl", $self->value_to_xml($value, 'anon', "$indent "), $indent, '</', $name, ">$nl"; } } } else { croak "Can't encode a value of type: " . ref($ref); } delete $self->{_ancestors}->{$refaddr}; return(join('', @result)); } ############################################################################## # Method: sorted_keys() # # Returns the keys of the referenced hash sorted into alphabetical order, but # with the 'key' key (as in KeyAttr) first, if there is one. # sub sorted_keys { my($self, $name, $ref) = @_; return keys %$ref if $self->{opt}->{nosort}; my %hash = %$ref; my $keyattr = $self->{opt}->{keyattr}; my @key; if(ref $keyattr eq 'HASH') { if(exists $keyattr->{$name} and exists $hash{$keyattr->{$name}->[0]}) { push @key, $keyattr->{$name}->[0]; delete $hash{$keyattr->{$name}->[0]}; } } elsif(ref $keyattr eq 'ARRAY') { foreach (@{$keyattr}) { if(exists $hash{$_}) { push @key, $_; delete $hash{$_}; last; } } } return(@key, sort keys %hash); } ############################################################################## # Method: escape_value() # # Helper routine for automatically escaping values for XMLout(). # Expects a scalar data value. Returns escaped version. # sub escape_value { my($self, $data) = @_; return '' unless(defined($data)); $data =~ s/&/&/sg; $data =~ s/</</sg; $data =~ s/>/>/sg; $data =~ s/"/"/sg; my $level = $self->{opt}->{numericescape} or return $data; return $self->numeric_escape($data, $level); } sub numeric_escape { my($self, $data, $level) = @_; if($self->{opt}->{numericescape} eq '2') { $data =~ s/([^\x00-\x7F])/'&#' . ord($1) . ';'/gse; } else { $data =~ s/([^\x00-\xFF])/'&#' . ord($1) . ';'/gse; } return $data; } ############################################################################## # Method: escape_attr() # # Helper routine for escaping attribute values. Defaults to escape_value(), # but may be overridden by a subclass to customise behaviour. # sub escape_attr { my $self = shift; return $self->escape_value(@_); } ############################################################################## # Method: hash_to_array() # # Helper routine for value_to_xml(). # Attempts to 'unfold' a hash of hashes into an array of hashes. Returns a # reference to the array on success or the original hash if unfolding is # not possible. # sub hash_to_array { my $self = shift; my $parent = shift; my $hashref = shift; my $arrayref = []; my($key, $value); my @keys = $self->{opt}->{nosort} ? keys %$hashref : sort keys %$hashref; foreach $key (@keys) { $value = $hashref->{$key}; return($hashref) unless(UNIVERSAL::isa($value, 'HASH')); if(ref($self->{opt}->{keyattr}) eq 'HASH') { return($hashref) unless(defined($self->{opt}->{keyattr}->{$parent})); push @$arrayref, $self->copy_hash( $value, $self->{opt}->{keyattr}->{$parent}->[0] => $key ); } else { push(@$arrayref, { $self->{opt}->{keyattr}->[0] => $key, %$value }); } } return($arrayref); } ############################################################################## # Method: copy_hash() # # Helper routine for hash_to_array(). When unfolding a hash of hashes into # an array of hashes, we need to copy the key from the outer hash into the # inner hash. This routine makes a copy of the original hash so we don't # destroy the original data structure. You might wish to override this # method if you're using tied hashes and don't want them to get untied. # sub copy_hash { my($self, $orig, @extra) = @_; return { @extra, %$orig }; } ############################################################################## # Methods required for building trees from SAX events ############################################################################## sub start_document { my $self = shift; $self->handle_options('in') unless($self->{opt}); $self->{lists} = []; $self->{curlist} = $self->{tree} = []; } sub start_element { my $self = shift; my $element = shift; my $name = $element->{Name}; if($self->{opt}->{nsexpand}) { $name = $element->{LocalName} || ''; if($element->{NamespaceURI}) { $name = '{' . $element->{NamespaceURI} . '}' . $name; } } my $attributes = {}; if($element->{Attributes}) { # Might be undef foreach my $attr (values %{$element->{Attributes}}) { if($self->{opt}->{nsexpand}) { my $name = $attr->{LocalName} || ''; if($attr->{NamespaceURI}) { $name = '{' . $attr->{NamespaceURI} . '}' . $name } $name = 'xmlns' if($name eq $bad_def_ns_jcn); $attributes->{$name} = $attr->{Value}; } else { $attributes->{$attr->{Name}} = $attr->{Value}; } } } my $newlist = [ $attributes ]; push @{ $self->{lists} }, $self->{curlist}; push @{ $self->{curlist} }, $name => $newlist; $self->{curlist} = $newlist; } sub characters { my $self = shift; my $chars = shift; my $text = $chars->{Data}; my $clist = $self->{curlist}; my $pos = $#$clist; if ($pos > 0 and $clist->[$pos - 1] eq '0') { $clist->[$pos] .= $text; } else { push @$clist, 0 => $text; } } sub end_element { my $self = shift; $self->{curlist} = pop @{ $self->{lists} }; } sub end_document { my $self = shift; delete($self->{curlist}); delete($self->{lists}); my $tree = $self->{tree}; delete($self->{tree}); # Return tree as-is to XMLin() return($tree) if($self->{nocollapse}); # Or collapse it before returning it to SAX parser class if($self->{opt}->{keeproot}) { $tree = $self->collapse({}, @$tree); } else { $tree = $self->collapse(@{$tree->[1]}); } if($self->{opt}->{datahandler}) { return($self->{opt}->{datahandler}->($self, $tree)); } return($tree); } *xml_in = \&XMLin; *xml_out = \&XMLout; 1; __END__ =head1 STATUS OF THIS MODULE The use of this module in new code is discouraged. Other modules are available which provide more straightforward and consistent interfaces. In particular, L<XML::LibXML> is highly recommended and L<XML::Twig> is an excellent alternative. The major problems with this module are the large number of options (some of which have unfortunate defaults) and the arbitrary ways in which these options interact - often producing unexpected results. Patches with bug fixes and documentation fixes are welcome, but new features are unlikely to be added. =head1 QUICK START Say you have a script called B<foo> and a file of configuration options called B<foo.xml> containing the following: <config logdir="/var/log/foo/" debugfile="/tmp/foo.debug"> <server name="sahara" osname="solaris" osversion="2.6"> <address>10.0.0.101</address> <address>10.0.1.101</address> </server> <server name="gobi" osname="irix" osversion="6.5"> <address>10.0.0.102</address> </server> <server name="kalahari" osname="linux" osversion="2.0.34"> <address>10.0.0.103</address> <address>10.0.1.103</address> </server> </config> The following lines of code in B<foo>: use XML::Simple qw(:strict); my $config = XMLin(undef, KeyAttr => { server => 'name' }, ForceArray => [ 'server', 'address' ]); will 'slurp' the configuration options into the hashref $config (because no filename or XML string was passed as the first argument to C<XMLin()> the name and location of the XML file will be inferred from name and location of the script). You can dump out the contents of the hashref using Data::Dumper: use Data::Dumper; print Dumper($config); which will produce something like this (formatting has been adjusted for brevity): { 'logdir' => '/var/log/foo/', 'debugfile' => '/tmp/foo.debug', 'server' => { 'sahara' => { 'osversion' => '2.6', 'osname' => 'solaris', 'address' => [ '10.0.0.101', '10.0.1.101' ] }, 'gobi' => { 'osversion' => '6.5', 'osname' => 'irix', 'address' => [ '10.0.0.102' ] }, 'kalahari' => { 'osversion' => '2.0.34', 'osname' => 'linux', 'address' => [ '10.0.0.103', '10.0.1.103' ] } } } Your script could then access the name of the log directory like this: print $config->{logdir}; similarly, the second address on the server 'kalahari' could be referenced as: print $config->{server}->{kalahari}->{address}->[1]; Note: If the mapping between the output of Data::Dumper and the print statements above is not obvious to you, then please refer to the 'references' tutorial (AKA: "Mark's very short tutorial about references") at L<perlreftut>. In this example, the C<< ForceArray >> option was used to list elements that might occur multiple times and should therefore be represented as arrayrefs (even when only one element is present). The C<< KeyAttr >> option was used to indicate that each C<< <server> >> element has a unique identifier in the C<< name >> attribute. This allows you to index directly to a particular server record using the name as a hash key (as shown above). For simple requirements, that's really all there is to it. If you want to store your XML in a different directory or file, or pass it in as a string or even pass it in via some derivative of an IO::Handle, you'll need to check out L<"OPTIONS">. If you want to turn off or tweak the array folding feature (that neat little transformation that produced $config->{server}) you'll find options for that as well. If you want to generate XML (for example to write a modified version of $config back out as XML), check out C<XMLout()>. If your needs are not so simple, this may not be the module for you. In that case, you might want to read L<"WHERE TO FROM HERE?">. =head1 DESCRIPTION The XML::Simple module provides a simple API layer on top of an underlying XML parsing module (either XML::Parser or one of the SAX2 parser modules). Two functions are exported: C<XMLin()> and C<XMLout()>. Note: you can explicitly request the lower case versions of the function names: C<xml_in()> and C<xml_out()>. The simplest approach is to call these two functions directly, but an optional object oriented interface (see L<"OPTIONAL OO INTERFACE"> below) allows them to be called as methods of an B<XML::Simple> object. The object interface can also be used at either end of a SAX pipeline. =head2 XMLin() Parses XML formatted data and returns a reference to a data structure which contains the same information in a more readily accessible form. (Skip down to L<"EXAMPLES"> below, for more sample code). C<XMLin()> accepts an optional XML specifier followed by zero or more 'name => value' option pairs. The XML specifier can be one of the following: =over 4 =item A filename If the filename contains no directory components C<XMLin()> will look for the file in each directory in the SearchPath (see L<"OPTIONS"> below) or in the current directory if the SearchPath option is not defined. eg: $ref = XMLin('/etc/params.xml'); Note, the filename '-' can be used to parse from STDIN. =item undef If there is no XML specifier, C<XMLin()> will check the script directory and each of the SearchPath directories for a file with the same name as the script but with the extension '.xml'. Note: if you wish to specify options, you must specify the value 'undef'. eg: $ref = XMLin(undef, ForceArray => 1); =item A string of XML A string containing XML (recognised by the presence of '<' and '>' characters) will be parsed directly. eg: $ref = XMLin('<opt username="bob" password="flurp" />'); =item An IO::Handle object An IO::Handle object will be read to EOF and its contents parsed. eg: $fh = IO::File->new('/etc/params.xml'); $ref = XMLin($fh); =back =head2 XMLout() Takes a data structure (generally a hashref) and returns an XML encoding of that structure. If the resulting XML is parsed using C<XMLin()>, it should return a data structure equivalent to the original (see caveats below). The C<XMLout()> function can also be used to output the XML as SAX events see the C<Handler> option and L<"SAX SUPPORT"> for more details). When translating hashes to XML, hash keys which have a leading '-' will be silently skipped. This is the approved method for marking elements of a data structure which should be ignored by C<XMLout>. (Note: If these items were not skipped the key names would be emitted as element or attribute names with a leading '-' which would not be valid XML). =head2 Caveats Some care is required in creating data structures which will be passed to C<XMLout()>. Hash keys from the data structure will be encoded as either XML element names or attribute names. Therefore, you should use hash key names which conform to the relatively strict XML naming rules: Names in XML must begin with a letter. The remaining characters may be letters, digits, hyphens (-), underscores (_) or full stops (.). It is also allowable to include one colon (:) in an element name but this should only be used when working with namespaces (B<XML::Simple> can only usefully work with namespaces when teamed with a SAX Parser). You can use other punctuation characters in hash values (just not in hash keys) however B<XML::Simple> does not support dumping binary data. If you break these rules, the current implementation of C<XMLout()> will simply emit non-compliant XML which will be rejected if you try to read it back in. (A later version of B<XML::Simple> might take a more proactive approach). Note also that although you can nest hashes and arrays to arbitrary levels, circular data structures are not supported and will cause C<XMLout()> to die. If you wish to 'round-trip' arbitrary data structures from Perl to XML and back to Perl, then you should probably disable array folding (using the KeyAttr option) both with C<XMLout()> and with C<XMLin()>. If you still don't get the expected results, you may prefer to use L<XML::Dumper> which is designed for exactly that purpose. Refer to L<"WHERE TO FROM HERE?"> if C<XMLout()> is too simple for your needs. =head1 OPTIONS B<XML::Simple> supports a number of options (in fact as each release of B<XML::Simple> adds more options, the module's claim to the name 'Simple' becomes increasingly tenuous). If you find yourself repeatedly having to specify the same options, you might like to investigate L<"OPTIONAL OO INTERFACE"> below. If you can't be bothered reading the documentation, refer to L<"STRICT MODE"> to automatically catch common mistakes. Because there are so many options, it's hard for new users to know which ones are important, so here are the two you really need to know about: =over 4 =item * check out C<ForceArray> because you'll almost certainly want to turn it on =item * make sure you know what the C<KeyAttr> option does and what its default value is because it may surprise you otherwise (note in particular that 'KeyAttr' affects both C<XMLin> and C<XMLout>) =back The option name headings below have a trailing 'comment' - a hash followed by two pieces of metadata: =over 4 =item * Options are marked with 'I<in>' if they are recognised by C<XMLin()> and 'I<out>' if they are recognised by C<XMLout()>. =item * Each option is also flagged to indicate whether it is: 'important' - don't use the module until you understand this one 'handy' - you can skip this on the first time through 'advanced' - you can skip this on the second time through 'SAX only' - don't worry about this unless you're using SAX (or alternatively if you need this, you also need SAX) 'seldom used' - you'll probably never use this unless you were the person that requested the feature =back The options are listed alphabetically: Note: option names are no longer case sensitive so you can use the mixed case versions shown here; all lower case as required by versions 2.03 and earlier; or you can add underscores between the words (eg: key_attr). =head2 AttrIndent => 1 I<# out - handy> When you are using C<XMLout()>, enable this option to have attributes printed one-per-line with sensible indentation rather than all on one line. =head2 Cache => [ cache schemes ] I<# in - advanced> Because loading the B<XML::Parser> module and parsing an XML file can consume a significant number of CPU cycles, it is often desirable to cache the output of C<XMLin()> for later reuse. When parsing from a named file, B<XML::Simple> supports a number of caching schemes. The 'Cache' option may be used to specify one or more schemes (using an anonymous array). Each scheme will be tried in turn in the hope of finding a cached pre-parsed representation of the XML file. If no cached copy is found, the file will be parsed and the first cache scheme in the list will be used to save a copy of the results. The following cache schemes have been implemented: =over 4 =item storable Utilises B<Storable.pm> to read/write a cache file with the same name as the XML file but with the extension .stor =item memshare When a file is first parsed, a copy of the resulting data structure is retained in memory in the B<XML::Simple> module's namespace. Subsequent calls to parse the same file will return a reference to this structure. This cached version will persist only for the life of the Perl interpreter (which in the case of mod_perl for example, may be some significant time). Because each caller receives a reference to the same data structure, a change made by one caller will be visible to all. For this reason, the reference returned should be treated as read-only. =item memcopy This scheme works identically to 'memshare' (above) except that each caller receives a reference to a new data structure which is a copy of the cached version. Copying the data structure will add a little processing overhead, therefore this scheme should only be used where the caller intends to modify the data structure (or wishes to protect itself from others who might). This scheme uses B<Storable.pm> to perform the copy. =back Warning! The memory-based caching schemes compare the timestamp on the file to the time when it was last parsed. If the file is stored on an NFS filesystem (or other network share) and the clock on the file server is not exactly synchronised with the clock where your script is run, updates to the source XML file may appear to be ignored. =head2 ContentKey => 'keyname' I<# in+out - seldom used> When text content is parsed to a hash value, this option lets you specify a name for the hash key to override the default 'content'. So for example: XMLin('<opt one="1">Text</opt>', ContentKey => 'text') will parse to: { 'one' => 1, 'text' => 'Text' } instead of: { 'one' => 1, 'content' => 'Text' } C<XMLout()> will also honour the value of this option when converting a hashref to XML. You can also prefix your selected key name with a '-' character to have C<XMLin()> try a little harder to eliminate unnecessary 'content' keys after array folding. For example: XMLin( '<opt><item name="one">First</item><item name="two">Second</item></opt>', KeyAttr => {item => 'name'}, ForceArray => [ 'item' ], ContentKey => '-content' ) will parse to: { 'item' => { 'one' => 'First' 'two' => 'Second' } } rather than this (without the '-'): { 'item' => { 'one' => { 'content' => 'First' } 'two' => { 'content' => 'Second' } } } =head2 DataHandler => code_ref I<# in - SAX only> When you use an B<XML::Simple> object as a SAX handler, it will return a 'simple tree' data structure in the same format as C<XMLin()> would return. If this option is set (to a subroutine reference), then when the tree is built the subroutine will be called and passed two arguments: a reference to the B<XML::Simple> object and a reference to the data tree. The return value from the subroutine will be returned to the SAX driver. (See L<"SAX SUPPORT"> for more details). =head2 ForceArray => 1 I<# in - important> This option should be set to '1' to force nested elements to be represented as arrays even when there is only one. Eg, with ForceArray enabled, this XML: <opt> <name>value</name> </opt> would parse to this: { 'name' => [ 'value' ] } instead of this (the default): { 'name' => 'value' } This option is especially useful if the data structure is likely to be written back out as XML and the default behaviour of rolling single nested elements up into attributes is not desirable. If you are using the array folding feature, you should almost certainly enable this option. If you do not, single nested elements will not be parsed to arrays and therefore will not be candidates for folding to a hash. (Given that the default value of 'KeyAttr' enables array folding, the default value of this option should probably also have been enabled too - sorry). =head2 ForceArray => [ names ] I<# in - important> This alternative (and preferred) form of the 'ForceArray' option allows you to specify a list of element names which should always be forced into an array representation, rather than the 'all or nothing' approach above. It is also possible (since version 2.05) to include compiled regular expressions in the list - any element names which match the pattern will be forced to arrays. If the list contains only a single regex, then it is not necessary to enclose it in an arrayref. Eg: ForceArray => qr/_list$/ =head2 ForceContent => 1 I<# in - seldom used> When C<XMLin()> parses elements which have text content as well as attributes, the text content must be represented as a hash value rather than a simple scalar. This option allows you to force text content to always parse to a hash value even when there are no attributes. So for example: XMLin('<opt><x>text1</x><y a="2">text2</y></opt>', ForceContent => 1) will parse to: { 'x' => { 'content' => 'text1' }, 'y' => { 'a' => 2, 'content' => 'text2' } } instead of: { 'x' => 'text1', 'y' => { 'a' => 2, 'content' => 'text2' } } =head2 GroupTags => { grouping tag => grouped tag } I<# in+out - handy> You can use this option to eliminate extra levels of indirection in your Perl data structure. For example this XML: <opt> <searchpath> <dir>/usr/bin</dir> <dir>/usr/local/bin</dir> <dir>/usr/X11/bin</dir> </searchpath> </opt> Would normally be read into a structure like this: { searchpath => { dir => [ '/usr/bin', '/usr/local/bin', '/usr/X11/bin' ] } } But when read in with the appropriate value for 'GroupTags': my $opt = XMLin($xml, GroupTags => { searchpath => 'dir' }); It will return this simpler structure: { searchpath => [ '/usr/bin', '/usr/local/bin', '/usr/X11/bin' ] } The grouping element (C<< <searchpath> >> in the example) must not contain any attributes or elements other than the grouped element. You can specify multiple 'grouping element' to 'grouped element' mappings in the same hashref. If this option is combined with C<KeyAttr>, the array folding will occur first and then the grouped element names will be eliminated. C<XMLout> will also use the grouptag mappings to re-introduce the tags around the grouped elements. Beware though that this will occur in all places that the 'grouping tag' name occurs - you probably don't want to use the same name for elements as well as attributes. =head2 Handler => object_ref I<# out - SAX only> Use the 'Handler' option to have C<XMLout()> generate SAX events rather than returning a string of XML. For more details see L<"SAX SUPPORT"> below. Note: the current implementation of this option generates a string of XML and uses a SAX parser to translate it into SAX events. The normal encoding rules apply here - your data must be UTF8 encoded unless you specify an alternative encoding via the 'XMLDecl' option; and by the time the data reaches the handler object, it will be in UTF8 form regardless of the encoding you supply. A future implementation of this option may generate the events directly. =head2 KeepRoot => 1 I<# in+out - handy> In its attempt to return a data structure free of superfluous detail and unnecessary levels of indirection, C<XMLin()> normally discards the root element name. Setting the 'KeepRoot' option to '1' will cause the root element name to be retained. So after executing this code: $config = XMLin('<config tempdir="/tmp" />', KeepRoot => 1) You'll be able to reference the tempdir as C<$config-E<gt>{config}-E<gt>{tempdir}> instead of the default C<$config-E<gt>{tempdir}>. Similarly, setting the 'KeepRoot' option to '1' will tell C<XMLout()> that the data structure already contains a root element name and it is not necessary to add another. =head2 KeyAttr => [ list ] I<# in+out - important> This option controls the 'array folding' feature which translates nested elements from an array to a hash. It also controls the 'unfolding' of hashes to arrays. For example, this XML: <opt> <user login="grep" fullname="Gary R Epstein" /> <user login="stty" fullname="Simon T Tyson" /> </opt> would, by default, parse to this: { 'user' => [ { 'login' => 'grep', 'fullname' => 'Gary R Epstein' }, { 'login' => 'stty', 'fullname' => 'Simon T Tyson' } ] } If the option 'KeyAttr => "login"' were used to specify that the 'login' attribute is a key, the same XML would parse to: { 'user' => { 'stty' => { 'fullname' => 'Simon T Tyson' }, 'grep' => { 'fullname' => 'Gary R Epstein' } } } The key attribute names should be supplied in an arrayref if there is more than one. C<XMLin()> will attempt to match attribute names in the order supplied. C<XMLout()> will use the first attribute name supplied when 'unfolding' a hash into an array. Note 1: The default value for 'KeyAttr' is ['name', 'key', 'id']. If you do not want folding on input or unfolding on output you must set this option to an empty list to disable the feature. Note 2: If you wish to use this option, you should also enable the C<ForceArray> option. Without 'ForceArray', a single nested element will be rolled up into a scalar rather than an array and therefore will not be folded (since only arrays get folded). =head2 KeyAttr => { list } I<# in+out - important> This alternative (and preferred) method of specifying the key attributes allows more fine grained control over which elements are folded and on which attributes. For example the option 'KeyAttr => { package => 'id' } will cause any package elements to be folded on the 'id' attribute. No other elements which have an 'id' attribute will be folded at all. Note: C<XMLin()> will generate a warning (or a fatal error in L<"STRICT MODE">) if this syntax is used and an element which does not have the specified key attribute is encountered (eg: a 'package' element without an 'id' attribute, to use the example above). Warnings can be suppressed with the lexical C<no warnings;> pragma or C<no warnings 'XML::Simple';>. Two further variations are made possible by prefixing a '+' or a '-' character to the attribute name: The option 'KeyAttr => { user => "+login" }' will cause this XML: <opt> <user login="grep" fullname="Gary R Epstein" /> <user login="stty" fullname="Simon T Tyson" /> </opt> to parse to this data structure: { 'user' => { 'stty' => { 'fullname' => 'Simon T Tyson', 'login' => 'stty' }, 'grep' => { 'fullname' => 'Gary R Epstein', 'login' => 'grep' } } } The '+' indicates that the value of the key attribute should be copied rather than moved to the folded hash key. A '-' prefix would produce this result: { 'user' => { 'stty' => { 'fullname' => 'Simon T Tyson', '-login' => 'stty' }, 'grep' => { 'fullname' => 'Gary R Epstein', '-login' => 'grep' } } } As described earlier, C<XMLout> will ignore hash keys starting with a '-'. =head2 NoAttr => 1 I<# in+out - handy> When used with C<XMLout()>, the generated XML will contain no attributes. All hash key/values will be represented as nested elements instead. When used with C<XMLin()>, any attributes in the XML will be ignored. =head2 NoEscape => 1 I<# out - seldom used> By default, C<XMLout()> will translate the characters 'E<lt>', 'E<gt>', '&' and '"' to '<', '>', '&' and '"' respectively. Use this option to suppress escaping (presumably because you've already escaped the data in some more sophisticated manner). =head2 NoIndent => 1 I<# out - seldom used> Set this option to 1 to disable C<XMLout()>'s default 'pretty printing' mode. With this option enabled, the XML output will all be on one line (unless there are newlines in the data) - this may be easier for downstream processing. =head2 NoSort => 1 I<# out - seldom used> Newer versions of XML::Simple sort elements and attributes alphabetically (*), by default. Enable this option to suppress the sorting - possibly for backwards compatibility. * Actually, sorting is alphabetical but 'key' attribute or element names (as in 'KeyAttr') sort first. Also, when a hash of hashes is 'unfolded', the elements are sorted alphabetically by the value of the key field. =head2 NormaliseSpace => 0 | 1 | 2 I<# in - handy> This option controls how whitespace in text content is handled. Recognised values for the option are: =over 4 =item * 0 = (default) whitespace is passed through unaltered (except of course for the normalisation of whitespace in attribute values which is mandated by the XML recommendation) =item * 1 = whitespace is normalised in any value used as a hash key (normalising means removing leading and trailing whitespace and collapsing sequences of whitespace characters to a single space) =item * 2 = whitespace is normalised in all text content =back Note: you can spell this option with a 'z' if that is more natural for you. =head2 NSExpand => 1 I<# in+out handy - SAX only> This option controls namespace expansion - the translation of element and attribute names of the form 'prefix:name' to '{uri}name'. For example the element name 'xsl:template' might be expanded to: '{http://www.w3.org/1999/XSL/Transform}template'. By default, C<XMLin()> will return element names and attribute names exactly as they appear in the XML. Setting this option to 1 will cause all element and attribute names to be expanded to include their namespace prefix. I<Note: You must be using a SAX parser for this option to work (ie: it does not work with XML::Parser)>. This option also controls whether C<XMLout()> performs the reverse translation from '{uri}name' back to 'prefix:name'. The default is no translation. If your data contains expanded names, you should set this option to 1 otherwise C<XMLout> will emit XML which is not well formed. I<Note: You must have the XML::NamespaceSupport module installed if you want C<XMLout()> to translate URIs back to prefixes>. =head2 NumericEscape => 0 | 1 | 2 I<# out - handy> Use this option to have 'high' (non-ASCII) characters in your Perl data structure converted to numeric entities (eg: €) in the XML output. Three levels are possible: 0 - default: no numeric escaping (OK if you're writing out UTF8) 1 - only characters above 0xFF are escaped (ie: characters in the 0x80-FF range are not escaped), possibly useful with ISO8859-1 output 2 - all characters above 0x7F are escaped (good for plain ASCII output) =head2 OutputFile => <file specifier> I<# out - handy> The default behaviour of C<XMLout()> is to return the XML as a string. If you wish to write the XML to a file, simply supply the filename using the 'OutputFile' option. This option also accepts an IO handle object - especially useful in Perl 5.8.0 and later for output using an encoding other than UTF-8, eg: open my $fh, '>:encoding(iso-8859-1)', $path or die "open($path): $!"; XMLout($ref, OutputFile => $fh); Note, XML::Simple does not require that the object you pass in to the OutputFile option inherits from L<IO::Handle> - it simply assumes the object supports a C<print> method. =head2 ParserOpts => [ XML::Parser Options ] I<# in - don't use this> I<Note: This option is now officially deprecated. If you find it useful, email the author with an example of what you use it for. Do not use this option to set the ProtocolEncoding, that's just plain wrong - fix the XML>. This option allows you to pass parameters to the constructor of the underlying XML::Parser object (which of course assumes you're not using SAX). =head2 RootName => 'string' I<# out - handy> By default, when C<XMLout()> generates XML, the root element will be named 'opt'. This option allows you to specify an alternative name. Specifying either undef or the empty string for the RootName option will produce XML with no root elements. In most cases the resulting XML fragment will not be 'well formed' and therefore could not be read back in by C<XMLin()>. Nevertheless, the option has been found to be useful in certain circumstances. =head2 SearchPath => [ list ] I<# in - handy> If you pass C<XMLin()> a filename, but the filename include no directory component, you can use this option to specify which directories should be searched to locate the file. You might use this option to search first in the user's home directory, then in a global directory such as /etc. If a filename is provided to C<XMLin()> but SearchPath is not defined, the file is assumed to be in the current directory. If the first parameter to C<XMLin()> is undefined, the default SearchPath will contain only the directory in which the script itself is located. Otherwise the default SearchPath will be empty. =head2 StrictMode => 1 | 0 I<# in+out seldom used> This option allows you to turn L<STRICT MODE> on or off for a particular call, regardless of whether it was enabled at the time XML::Simple was loaded. =head2 SuppressEmpty => 1 | '' | undef I<# in+out - handy> This option controls what C<XMLin()> should do with empty elements (no attributes and no content). The default behaviour is to represent them as empty hashes. Setting this option to a true value (eg: 1) will cause empty elements to be skipped altogether. Setting the option to 'undef' or the empty string will cause empty elements to be represented as the undefined value or the empty string respectively. The latter two alternatives are a little easier to test for in your code than a hash with no keys. The option also controls what C<XMLout()> does with undefined values. Setting the option to undef causes undefined values to be output as empty elements (rather than empty attributes), it also suppresses the generation of warnings about undefined values. Setting the option to a true value (eg: 1) causes undefined values to be skipped altogether on output. =head2 ValueAttr => [ names ] I<# in - handy> Use this option to deal elements which always have a single attribute and no content. Eg: <opt> <colour value="red" /> <size value="XXL" /> </opt> Setting C<< ValueAttr => [ 'value' ] >> will cause the above XML to parse to: { colour => 'red', size => 'XXL' } instead of this (the default): { colour => { value => 'red' }, size => { value => 'XXL' } } Note: This form of the ValueAttr option is not compatible with C<XMLout()> - since the attribute name is discarded at parse time, the original XML cannot be reconstructed. =head2 ValueAttr => { element => attribute, ... } I<# in+out - handy> This (preferred) form of the ValueAttr option requires you to specify both the element and the attribute names. This is not only safer, it also allows the original XML to be reconstructed by C<XMLout()>. Note: You probably don't want to use this option and the NoAttr option at the same time. =head2 Variables => { name => value } I<# in - handy> This option allows variables in the XML to be expanded when the file is read. (there is no facility for putting the variable names back if you regenerate XML using C<XMLout>). A 'variable' is any text of the form C<${name}> which occurs in an attribute value or in the text content of an element. If 'name' matches a key in the supplied hashref, C<${name}> will be replaced with the corresponding value from the hashref. If no matching key is found, the variable will not be replaced. Names must match the regex: C<[\w.]+> (ie: only 'word' characters and dots are allowed). =head2 VarAttr => 'attr_name' I<# in - handy> In addition to the variables defined using C<Variables>, this option allows variables to be defined in the XML. A variable definition consists of an element with an attribute called 'attr_name' (the value of the C<VarAttr> option). The value of the attribute will be used as the variable name and the text content of the element will be used as the value. A variable defined in this way will override a variable defined using the C<Variables> option. For example: XMLin( '<opt> <dir name="prefix">/usr/local/apache</dir> <dir name="exec_prefix">${prefix}</dir> <dir name="bindir">${exec_prefix}/bin</dir> </opt>', VarAttr => 'name', ContentKey => '-content' ); produces the following data structure: { dir => { prefix => '/usr/local/apache', exec_prefix => '/usr/local/apache', bindir => '/usr/local/apache/bin', } } =head2 XMLDecl => 1 or XMLDecl => 'string' I<# out - handy> If you want the output from C<XMLout()> to start with the optional XML declaration, simply set the option to '1'. The default XML declaration is: <?xml version='1.0' standalone='yes'?> If you want some other string (for example to declare an encoding value), set the value of this option to the complete string you require. =head1 OPTIONAL OO INTERFACE The procedural interface is both simple and convenient however there are a couple of reasons why you might prefer to use the object oriented (OO) interface: =over 4 =item * to define a set of default values which should be used on all subsequent calls to C<XMLin()> or C<XMLout()> =item * to override methods in B<XML::Simple> to provide customised behaviour =back The default values for the options described above are unlikely to suit everyone. The OO interface allows you to effectively override B<XML::Simple>'s defaults with your preferred values. It works like this: First create an XML::Simple parser object with your preferred defaults: my $xs = XML::Simple->new(ForceArray => 1, KeepRoot => 1); then call C<XMLin()> or C<XMLout()> as a method of that object: my $ref = $xs->XMLin($xml); my $xml = $xs->XMLout($ref); You can also specify options when you make the method calls and these values will be merged with the values specified when the object was created. Values specified in a method call take precedence. Note: when called as methods, the C<XMLin()> and C<XMLout()> routines may be called as C<xml_in()> or C<xml_out()>. The method names are aliased so the only difference is the aesthetics. =head2 Parsing Methods You can explicitly call one of the following methods rather than rely on the C<xml_in()> method automatically determining whether the target to be parsed is a string, a file or a filehandle: =over 4 =item parse_string(text) Works exactly like the C<xml_in()> method but assumes the first argument is a string of XML (or a reference to a scalar containing a string of XML). =item parse_file(filename) Works exactly like the C<xml_in()> method but assumes the first argument is the name of a file containing XML. =item parse_fh(file_handle) Works exactly like the C<xml_in()> method but assumes the first argument is a filehandle which can be read to get XML. =back =head2 Hook Methods You can make your own class which inherits from XML::Simple and overrides certain behaviours. The following methods may provide useful 'hooks' upon which to hang your modified behaviour. You may find other undocumented methods by examining the source, but those may be subject to change in future releases. =over 4 =item handle_options(direction, name => value ...) This method will be called when one of the parsing methods or the C<XMLout()> method is called. The initial argument will be a string (either 'in' or 'out') and the remaining arguments will be name value pairs. =item default_config_file() Calculates and returns the name of the file which should be parsed if no filename is passed to C<XMLin()> (default: C<$0.xml>). =item build_simple_tree(filename, string) Called from C<XMLin()> or any of the parsing methods. Takes either a file name as the first argument or C<undef> followed by a 'string' as the second argument. Returns a simple tree data structure. You could override this method to apply your own transformations before the data structure is returned to the caller. =item new_hashref() When the 'simple tree' data structure is being built, this method will be called to create any required anonymous hashrefs. =item sorted_keys(name, hashref) Called when C<XMLout()> is translating a hashref to XML. This routine returns a list of hash keys in the order that the corresponding attributes/elements should appear in the output. =item escape_value(string) Called from C<XMLout()>, takes a string and returns a copy of the string with XML character escaping rules applied. =item escape_attr(string) Called from C<XMLout()>, to handle attribute values. By default, just calls C<escape_value()>, but you can override this method if you want attributes escaped differently than text content. =item numeric_escape(string) Called from C<escape_value()>, to handle non-ASCII characters (depending on the value of the NumericEscape option). =item copy_hash(hashref, extra_key => value, ...) Called from C<XMLout()>, when 'unfolding' a hash of hashes into an array of hashes. You might wish to override this method if you're using tied hashes and don't want them to get untied. =back =head2 Cache Methods XML::Simple implements three caching schemes ('storable', 'memshare' and 'memcopy'). You can implement a custom caching scheme by implementing two methods - one for reading from the cache and one for writing to it. For example, you might implement a new 'dbm' scheme that stores cached data structures using the L<MLDBM> module. First, you would add a C<cache_read_dbm()> method which accepted a filename for use as a lookup key and returned a data structure on success, or undef on failure. Then, you would implement a C<cache_read_dbm()> method which accepted a data structure and a filename. You would use this caching scheme by specifying the option: Cache => [ 'dbm' ] =head1 STRICT MODE If you import the B<XML::Simple> routines like this: use XML::Simple qw(:strict); the following common mistakes will be detected and treated as fatal errors =over 4 =item * Failing to explicitly set the C<KeyAttr> option - if you can't be bothered reading about this option, turn it off with: KeyAttr => [ ] =item * Failing to explicitly set the C<ForceArray> option - if you can't be bothered reading about this option, set it to the safest mode with: ForceArray => 1 =item * Setting ForceArray to an array, but failing to list all the elements from the KeyAttr hash. =item * Data error - KeyAttr is set to say { part => 'partnum' } but the XML contains one or more E<lt>partE<gt> elements without a 'partnum' attribute (or nested element). Note: if strict mode is not set but C<use warnings;> is in force, this condition triggers a warning. =item * Data error - as above, but non-unique values are present in the key attribute (eg: more than one E<lt>partE<gt> element with the same partnum). This will also trigger a warning if strict mode is not enabled. =item * Data error - as above, but value of key attribute (eg: partnum) is not a scalar string (due to nested elements etc). This will also trigger a warning if strict mode is not enabled. =back =head1 SAX SUPPORT From version 1.08_01, B<XML::Simple> includes support for SAX (the Simple API for XML) - specifically SAX2. In a typical SAX application, an XML parser (or SAX 'driver') module generates SAX events (start of element, character data, end of element, etc) as it parses an XML document and a 'handler' module processes the events to extract the required data. This simple model allows for some interesting and powerful possibilities: =over 4 =item * Applications written to the SAX API can extract data from huge XML documents without the memory overheads of a DOM or tree API. =item * The SAX API allows for plug and play interchange of parser modules without having to change your code to fit a new module's API. A number of SAX parsers are available with capabilities ranging from extreme portability to blazing performance. =item * A SAX 'filter' module can implement both a handler interface for receiving data and a generator interface for passing modified data on to a downstream handler. Filters can be chained together in 'pipelines'. =item * One filter module might split a data stream to direct data to two or more downstream handlers. =item * Generating SAX events is not the exclusive preserve of XML parsing modules. For example, a module might extract data from a relational database using DBI and pass it on to a SAX pipeline for filtering and formatting. =back B<XML::Simple> can operate at either end of a SAX pipeline. For example, you can take a data structure in the form of a hashref and pass it into a SAX pipeline using the 'Handler' option on C<XMLout()>: use XML::Simple; use Some::SAX::Filter; use XML::SAX::Writer; my $ref = { .... # your data here }; my $writer = XML::SAX::Writer->new(); my $filter = Some::SAX::Filter->new(Handler => $writer); my $simple = XML::Simple->new(Handler => $filter); $simple->XMLout($ref); You can also put B<XML::Simple> at the opposite end of the pipeline to take advantage of the simple 'tree' data structure once the relevant data has been isolated through filtering: use XML::SAX; use Some::SAX::Filter; use XML::Simple; my $simple = XML::Simple->new(ForceArray => 1, KeyAttr => ['partnum']); my $filter = Some::SAX::Filter->new(Handler => $simple); my $parser = XML::SAX::ParserFactory->parser(Handler => $filter); my $ref = $parser->parse_uri('some_huge_file.xml'); print $ref->{part}->{'555-1234'}; You can build a filter by using an XML::Simple object as a handler and setting its DataHandler option to point to a routine which takes the resulting tree, modifies it and sends it off as SAX events to a downstream handler: my $writer = XML::SAX::Writer->new(); my $filter = XML::Simple->new( DataHandler => sub { my $simple = shift; my $data = shift; # Modify $data here $simple->XMLout($data, Handler => $writer); } ); my $parser = XML::SAX::ParserFactory->parser(Handler => $filter); $parser->parse_uri($filename); I<Note: In this last example, the 'Handler' option was specified in the call to C<XMLout()> but it could also have been specified in the constructor>. =head1 ENVIRONMENT If you don't care which parser module B<XML::Simple> uses then skip this section entirely (it looks more complicated than it really is). B<XML::Simple> will default to using a B<SAX> parser if one is available or B<XML::Parser> if SAX is not available. You can dictate which parser module is used by setting either the environment variable 'XML_SIMPLE_PREFERRED_PARSER' or the package variable $XML::Simple::PREFERRED_PARSER to contain the module name. The following rules are used: =over 4 =item * The package variable takes precedence over the environment variable if both are defined. To force B<XML::Simple> to ignore the environment settings and use its default rules, you can set the package variable to an empty string. =item * If the 'preferred parser' is set to the string 'XML::Parser', then L<XML::Parser> will be used (or C<XMLin()> will die if L<XML::Parser> is not installed). =item * If the 'preferred parser' is set to some other value, then it is assumed to be the name of a SAX parser module and is passed to L<XML::SAX::ParserFactory>. If L<XML::SAX> is not installed, or the requested parser module is not installed, then C<XMLin()> will die. =item * If the 'preferred parser' is not defined at all (the normal default state), an attempt will be made to load L<XML::SAX>. If L<XML::SAX> is installed, then a parser module will be selected according to L<XML::SAX::ParserFactory>'s normal rules (which typically means the last SAX parser installed). =item * if the 'preferred parser' is not defined and B<XML::SAX> is not installed, then B<XML::Parser> will be used. C<XMLin()> will die if L<XML::Parser> is not installed. =back Note: The B<XML::SAX> distribution includes an XML parser written entirely in Perl. It is very portable but it is not very fast. You should consider installing L<XML::LibXML> or L<XML::SAX::Expat> if they are available for your platform. =head1 ERROR HANDLING The XML standard is very clear on the issue of non-compliant documents. An error in parsing any single element (for example a missing end tag) must cause the whole document to be rejected. B<XML::Simple> will die with an appropriate message if it encounters a parsing error. If dying is not appropriate for your application, you should arrange to call C<XMLin()> in an eval block and look for errors in $@. eg: my $config = eval { XMLin() }; PopUpMessage($@) if($@); Note, there is a common misconception that use of B<eval> will significantly slow down a script. While that may be true when the code being eval'd is in a string, it is not true of code like the sample above. =head1 EXAMPLES When C<XMLin()> reads the following very simple piece of XML: <opt username="testuser" password="frodo"></opt> it returns the following data structure: { 'username' => 'testuser', 'password' => 'frodo' } The identical result could have been produced with this alternative XML: <opt username="testuser" password="frodo" /> Or this (although see 'ForceArray' option for variations): <opt> <username>testuser</username> <password>frodo</password> </opt> Repeated nested elements are represented as anonymous arrays: <opt> <person firstname="Joe" lastname="Smith"> <email>joe@smith.com</email> <email>jsmith@yahoo.com</email> </person> <person firstname="Bob" lastname="Smith"> <email>bob@smith.com</email> </person> </opt> { 'person' => [ { 'email' => [ 'joe@smith.com', 'jsmith@yahoo.com' ], 'firstname' => 'Joe', 'lastname' => 'Smith' }, { 'email' => 'bob@smith.com', 'firstname' => 'Bob', 'lastname' => 'Smith' } ] } Nested elements with a recognised key attribute are transformed (folded) from an array into a hash keyed on the value of that attribute (see the C<KeyAttr> option): <opt> <person key="jsmith" firstname="Joe" lastname="Smith" /> <person key="tsmith" firstname="Tom" lastname="Smith" /> <person key="jbloggs" firstname="Joe" lastname="Bloggs" /> </opt> { 'person' => { 'jbloggs' => { 'firstname' => 'Joe', 'lastname' => 'Bloggs' }, 'tsmith' => { 'firstname' => 'Tom', 'lastname' => 'Smith' }, 'jsmith' => { 'firstname' => 'Joe', 'lastname' => 'Smith' } } } The <anon> tag can be used to form anonymous arrays: <opt> <head><anon>Col 1</anon><anon>Col 2</anon><anon>Col 3</anon></head> <data><anon>R1C1</anon><anon>R1C2</anon><anon>R1C3</anon></data> <data><anon>R2C1</anon><anon>R2C2</anon><anon>R2C3</anon></data> <data><anon>R3C1</anon><anon>R3C2</anon><anon>R3C3</anon></data> </opt> { 'head' => [ [ 'Col 1', 'Col 2', 'Col 3' ] ], 'data' => [ [ 'R1C1', 'R1C2', 'R1C3' ], [ 'R2C1', 'R2C2', 'R2C3' ], [ 'R3C1', 'R3C2', 'R3C3' ] ] } Anonymous arrays can be nested to arbitrary levels and as a special case, if the surrounding tags for an XML document contain only an anonymous array the arrayref will be returned directly rather than the usual hashref: <opt> <anon><anon>Col 1</anon><anon>Col 2</anon></anon> <anon><anon>R1C1</anon><anon>R1C2</anon></anon> <anon><anon>R2C1</anon><anon>R2C2</anon></anon> </opt> [ [ 'Col 1', 'Col 2' ], [ 'R1C1', 'R1C2' ], [ 'R2C1', 'R2C2' ] ] Elements which only contain text content will simply be represented as a scalar. Where an element has both attributes and text content, the element will be represented as a hashref with the text content in the 'content' key (see the C<ContentKey> option): <opt> <one>first</one> <two attr="value">second</two> </opt> { 'one' => 'first', 'two' => { 'attr' => 'value', 'content' => 'second' } } Mixed content (elements which contain both text content and nested elements) will be not be represented in a useful way - element order and significant whitespace will be lost. If you need to work with mixed content, then XML::Simple is not the right tool for your job - check out the next section. =head1 WHERE TO FROM HERE? B<XML::Simple> is able to present a simple API because it makes some assumptions on your behalf. These include: =over 4 =item * You're not interested in text content consisting only of whitespace =item * You don't mind that when things get slurped into a hash the order is lost =item * You don't want fine-grained control of the formatting of generated XML =item * You would never use a hash key that was not a legal XML element name =item * You don't need help converting between different encodings =back In a serious XML project, you'll probably outgrow these assumptions fairly quickly. This section of the document used to offer some advice on choosing a more powerful option. That advice has now grown into the 'Perl-XML FAQ' document which you can find at: L<http://perl-xml.sourceforge.net/faq/> The advice in the FAQ boils down to a quick explanation of tree versus event based parsers and then recommends: For event based parsing, use SAX (do not set out to write any new code for XML::Parser's handler API - it is obsolete). For tree-based parsing, you could choose between the 'Perlish' approach of L<XML::Twig> and more standards based DOM implementations - preferably one with XPath support such as L<XML::LibXML>. =head1 SEE ALSO B<XML::Simple> requires either L<XML::Parser> or L<XML::SAX>. To generate documents with namespaces, L<XML::NamespaceSupport> is required. The optional caching functions require L<Storable>. Answers to Frequently Asked Questions about XML::Simple are bundled with this distribution as: L<XML::Simple::FAQ> =head1 COPYRIGHT Copyright 1999-2004 Grant McLean E<lt>grantm@cpan.orgE<gt> This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. =cut ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������darwin-perl-lib/XML/Simple/FAQ.pod������������������������������������������������������������������000444 �000765 �000024 �00000047030 13167163507 020772� 0����������������������������������������������������������������������������������������������������ustar�00ocsinventory��������������������staff���������������������������000000 �000000 ������������������������������������������������������������������������������������������������������������������������������������������������������������������������ =head1 NAME XML::Simple::FAQ - Frequently Asked Questions about XML::Simple =head1 Basics =head2 What is XML::Simple designed to be used for? XML::Simple is a Perl module that was originally developed as a tool for reading and writing configuration data in XML format. You can use it for many other purposes that involve storing and retrieving structured data in XML. You might also find XML::Simple a good starting point for playing with XML from Perl. It doesn't have a steep learning curve and if you outgrow its capabilities there are plenty of other Perl/XML modules to 'step up' to. =head2 Why store configuration data in XML anyway? The many advantages of using XML format for configuration data include: =over 4 =item * Using existing XML parsing tools requires less development time, is easier and more robust than developing your own config file parsing code =item * XML can represent relationships between pieces of data, such as nesting of sections to arbitrary levels (not easily done with .INI files for example) =item * XML is basically just text, so you can easily edit a config file (easier than editing a Win32 registry) =item * XML provides standard solutions for handling character sets and encoding beyond basic ASCII (important for internationalization) =item * If it becomes necessary to change your configuration file format, there are many tools available for performing transformations on XML files =item * XML is an open standard (the world does not need more proprietary binary file formats) =item * Taking the extra step of developing a DTD allows the format of configuration files to be validated before your program reads them (not directly supported by XML::Simple) =item * Combining a DTD with a good XML editor can give you a GUI config editor for minimal coding effort =back =head2 What isn't XML::Simple good for? The main limitation of XML::Simple is that it does not work with 'mixed content' (see the next question). If you consider your XML files contain marked up text rather than structured data, you should probably use another module. If you are working with very large XML files, XML::Simple's approach of representing the whole file in memory as a 'tree' data structure may not be suitable. =head2 What is mixed content? Consider this example XML: <document> <para>This is <em>mixed</em> content.</para> </document> This is said to be mixed content, because the E<lt>paraE<gt> element contains both character data (text content) and nested elements. Here's some more XML: <person> <first_name>Joe</first_name> <last_name>Bloggs</last_name> <dob>25-April-1969</dob> </person> This second example is not generally considered to be mixed content. The E<lt>first_nameE<gt>, E<lt>last_nameE<gt> and E<lt>dobE<gt> elements contain only character data and the E<lt>personE<gt> element contains only nested elements. (Note: Strictly speaking, the whitespace between the nested elements is character data, but it is ignored by XML::Simple). =head2 Why doesn't XML::Simple handle mixed content? Because if it did, it would no longer be simple :-) Seriously though, there are plenty of excellent modules that allow you to work with mixed content in a variety of ways. Handling mixed content correctly is not easy and by ignoring these issues, XML::Simple is able to present an API without a steep learning curve. =head2 Which Perl modules do handle mixed content? Every one of them except XML::Simple :-) If you're looking for a recommendation, I'd suggest you look at the Perl-XML FAQ at: http://perl-xml.sourceforge.net/faq/ =head1 Installation =head2 How do I install XML::Simple? If you're running ActiveState Perl, you've probably already got XML::Simple (although you may want to upgrade to version 1.09 or better for SAX support). If you do need to install XML::Simple, you'll need to install an XML parser module first. Install either XML::Parser (which you may have already) or XML::SAX. If you install both, XML::SAX will be used by default. Once you have a parser installed ... On Unix systems, try: perl -MCPAN -e 'install XML::Simple' If that doesn't work, download the latest distribution from ftp://ftp.cpan.org/pub/CPAN/authors/id/G/GR/GRANTM , unpack it and run these commands: perl Makefile.PL make make test make install On Win32, if you have a recent build of ActiveState Perl (618 or better) try this command: ppm install XML::Simple If that doesn't work, you really only need the Simple.pm file, so extract it from the .tar.gz file (eg: using WinZIP) and save it in the \site\lib\XML directory under your Perl installation (typically C:\Perl). =head2 I'm trying to install XML::Simple and 'make test' fails Is the directory where you've unpacked XML::Simple mounted from a file server using NFS, SMB or some other network file sharing? If so, that may cause errors in the following test scripts: 3_Storable.t 4_MemShare.t 5_MemCopy.t The test suite is designed to exercise the boundary conditions of all XML::Simple's functionality and these three scripts exercise the caching functions. If XML::Simple is asked to parse a file for which it has a cached copy of a previous parse, then it compares the timestamp on the XML file with the timestamp on the cached copy. If the cached copy is *newer* then it will be used. If the cached copy is older or the same age then the file is re-parsed. The test scripts will get confused by networked filesystems if the workstation and server system clocks are not synchronised (to the second). If you get an error in one of these three test scripts but you don't plan to use the caching options (they're not enabled by default), then go right ahead and run 'make install'. If you do plan to use caching, then try unpacking the distribution on local disk and doing the build/test there. It's probably not a good idea to use the caching options with networked filesystems in production. If the file server's clock is ahead of the local clock, XML::Simple will re-parse files when it could have used the cached copy. However if the local clock is ahead of the file server clock and a file is changed immediately after it is cached, the old cached copy will be used. Is one of the three test scripts (above) failing but you're not running on a network filesystem? Are you running Win32? If so, you may be seeing a bug in Win32 where writes to a file do not affect its modification timestamp. If none of these scenarios match your situation, please confirm you're running the latest version of XML::Simple and then email the output of 'make test' to me at grantm@cpan.org =head2 Why is XML::Simple so slow? If you find that XML::Simple is very slow reading XML, the most likely reason is that you have XML::SAX installed but no additional SAX parser module. The XML::SAX distribution includes an XML parser written entirely in Perl. This is very portable but not very fast. For better performance install either XML::SAX::Expat or XML::LibXML. =head1 Usage =head2 How do I use XML::Simple? If you had an XML document called /etc/appconfig/foo.xml you could 'slurp' it into a simple data structure (typically a hashref) with these lines of code: use XML::Simple; my $config = XMLin('/etc/appconfig/foo.xml'); The XMLin() function accepts options after the filename. =head2 There are so many options, which ones do I really need to know about? Although you can get by without using any options, you shouldn't even consider using XML::Simple in production until you know what these two options do: =over 4 =item * forcearray =item * keyattr =back The reason you really need to read about them is because the default values for these options will trip you up if you don't. Although everyone agrees that these defaults are not ideal, there is not wide agreement on what they should be changed to. The answer therefore is to read about them (see below) and select values which are right for you. =head2 What is the forcearray option all about? Consider this XML in a file called ./person.xml: <person> <first_name>Joe</first_name> <last_name>Bloggs</last_name> <hobbie>bungy jumping</hobbie> <hobbie>sky diving</hobbie> <hobbie>knitting</hobbie> </person> You could read it in with this line: my $person = XMLin('./person.xml'); Which would give you a data structure like this: $person = { 'first_name' => 'Joe', 'last_name' => 'Bloggs', 'hobbie' => [ 'bungy jumping', 'sky diving', 'knitting' ] }; The E<lt>first_nameE<gt> and E<lt>last_nameE<gt> elements are represented as simple scalar values which you could refer to like this: print "$person->{first_name} $person->{last_name}\n"; The E<lt>hobbieE<gt> elements are represented as an array - since there is more than one. You could refer to the first one like this: print $person->{hobbie}->[0], "\n"; Or the whole lot like this: print join(', ', @{$person->{hobbie}} ), "\n"; The catch is, that these last two lines of code will only work for people who have more than one hobbie. If there is only one E<lt>hobbieE<gt> element, it will be represented as a simple scalar (just like E<lt>first_nameE<gt> and E<lt>last_nameE<gt>). Which might lead you to write code like this: if(ref($person->{hobbie})) { print join(', ', @{$person->{hobbie}} ), "\n"; } else { print $person->{hobbie}, "\n"; } Don't do that. One alternative approach is to set the forcearray option to a true value: my $person = XMLin('./person.xml', forcearray => 1); Which will give you a data structure like this: $person = { 'first_name' => [ 'Joe' ], 'last_name' => [ 'Bloggs' ], 'hobbie' => [ 'bungy jumping', 'sky diving', 'knitting' ] }; Then you can use this line to refer to all the list of hobbies even if there was only one: print join(', ', @{$person->{hobbie}} ), "\n"; The downside of this approach is that the E<lt>first_nameE<gt> and E<lt>last_nameE<gt> elements will also always be represented as arrays even though there will never be more than one: print "$person->{first_name}->[0] $person->{last_name}->[0]\n"; This might be OK if you change the XML to use attributes for things that will always be singular and nested elements for things that may be plural: <person first_name="Jane" last_name="Bloggs"> <hobbie>motorcycle maintenance</hobbie> </person> On the other hand, if you prefer not to use attributes, then you could specify that any E<lt>hobbieE<gt> elements should always be represented as arrays and all other nested elements should be simple scalar values unless there is more than one: my $person = XMLin('./person.xml', forcearray => [ 'hobbie' ]); The forcearray option accepts a list of element names which should always be forced to an array representation: forcearray => [ qw(hobbie qualification childs_name) ] See the XML::Simple manual page for more information. =head2 What is the keyattr option all about? Consider this sample XML: <catalog> <part partnum="1842334" desc="High pressure flange" price="24.50" /> <part partnum="9344675" desc="Threaded gasket" price="9.25" /> <part partnum="5634896" desc="Low voltage washer" price="12.00" /> </catalog> You could slurp it in with this code: my $catalog = XMLin('./catalog.xml'); Which would return a data structure like this: $catalog = { 'part' => [ { 'partnum' => '1842334', 'desc' => 'High pressure flange', 'price' => '24.50' }, { 'partnum' => '9344675', 'desc' => 'Threaded gasket', 'price' => '9.25' }, { 'partnum' => '5634896', 'desc' => 'Low voltage washer', 'price' => '12.00' } ] }; Then you could access the description of the first part in the catalog with this code: print $catalog->{part}->[0]->{desc}, "\n"; However, if you wanted to access the description of the part with the part number of "9344675" then you'd have to code a loop like this: foreach my $part (@{$catalog->{part}}) { if($part->{partnum} eq '9344675') { print $part->{desc}, "\n"; last; } } The knowledge that each E<lt>partE<gt> element has a unique partnum attribute allows you to eliminate this search. You can pass this knowledge on to XML::Simple like this: my $catalog = XMLin($xml, keyattr => ['partnum']); Which will return a data structure like this: $catalog = { 'part' => { '5634896' => { 'desc' => 'Low voltage washer', 'price' => '12.00' }, '1842334' => { 'desc' => 'High pressure flange', 'price' => '24.50' }, '9344675' => { 'desc' => 'Threaded gasket', 'price' => '9.25' } } }; XML::Simple has been able to transform $catalog->{part} from an arrayref to a hashref (keyed on partnum). This transformation is called 'array folding'. Through the use of array folding, you can now index directly to the description of the part you want: print $catalog->{part}->{9344675}->{desc}, "\n"; The 'keyattr' option also enables array folding when the unique key is in a nested element rather than an attribute. eg: <catalog> <part> <partnum>1842334</partnum> <desc>High pressure flange</desc> <price>24.50</price> </part> <part> <partnum>9344675</partnum> <desc>Threaded gasket</desc> <price>9.25</price> </part> <part> <partnum>5634896</partnum> <desc>Low voltage washer</desc> <price>12.00</price> </part> </catalog> See the XML::Simple manual page for more information. =head2 So what's the catch with 'keyattr'? One thing to watch out for is that you might get array folding even if you don't supply the keyattr option. The default value for this option is: [ 'name', 'key', 'id'] Which means if your XML elements have a 'name', 'key' or 'id' attribute (or nested element) then they may get folded on those values. This means that you can take advantage of array folding simply through careful choice of attribute names. On the hand, if you really don't want array folding at all, you'll need to set 'key attr to an empty list: my $ref = XMLin($xml, keyattr => []); A second 'gotcha' is that array folding only works on arrays. That might seem obvious, but if there's only one record in your XML and you didn't set the 'forcearray' option then it won't be represented as an array and consequently won't get folded into a hash. The moral is that if you're using array folding, you should always turn on the forcearray option. You probably want to be as specific as you can be too. For instance, the safest way to parse the E<lt>catalogE<gt> example above would be: my $catalog = XMLin($xml, keyattr => { part => 'partnum'}, forcearray => ['part']); By using the hashref for keyattr, you can specify that only E<lt>partE<gt> elements should be folded on the 'partnum' attribute (and that the E<lt>partE<gt> elements should not be folded on any other attribute). By supplying a list of element names for forcearray, you're ensuring that folding will work even if there's only one E<lt>partE<gt>. You're also ensuring that if the 'partnum' unique key is supplied in a nested element then that element won't get forced to an array too. =head2 How do I know what my data structure should look like? The rules are fairly straightforward: =over 4 =item * each element gets represented as a hash =item * unless it contains only text, in which case it'll be a simple scalar value =item * or unless there's more than one element with the same name, in which case they'll be represented as an array =item * unless you've got array folding enabled, in which case they'll be folded into a hash =item * empty elements (no text contents B<and> no attributes) will either be represented as an empty hash, an empty string or undef - depending on the value of the 'suppressempty' option. =back If you're in any doubt, use Data::Dumper, eg: use XML::Simple; use Data::Dumper; my $ref = XMLin($xml); print Dumper($ref); =head2 I'm getting 'Use of uninitialized value' warnings You're probably trying to index into a non-existant hash key - try Data::Dumper. =head2 I'm getting a 'Not an ARRAY reference' error Something that you expect to be an array is not. The two most likely causes are that you forgot to use 'forcearray' or that the array got folded into a hash - try Data::Dumper. =head2 I'm getting a 'No such array field' error Something that you expect to be a hash is actually an array. Perhaps array folding failed because one element was missing the key attribute - try Data::Dumper. =head2 I'm getting an 'Out of memory' error Something in the data structure is not as you expect and Perl may be trying unsuccessfully to autovivify things - try Data::Dumper. If you're already using Data::Dumper, try calling Dumper() immediately after XMLin() - ie: before you attempt to access anything in the data structure. =head2 My element order is getting jumbled up If you read an XML file with XMLin() and then write it back out with XMLout(), the order of the elements will likely be different. (However, if you read the file back in with XMLin() you'll get the same Perl data structure). The reordering happens because XML::Simple uses hashrefs to store your data and Perl hashes do not really have any order. It is possible that a future version of XML::Simple will use Tie::IxHash to store the data in hashrefs which do retain the order. However this will not fix all cases of element order being lost. If your application really is sensitive to element order, don't use XML::Simple (and don't put order-sensitive values in attributes). =head2 XML::Simple turns nested elements into attributes If you read an XML file with XMLin() and then write it back out with XMLout(), some data which was originally stored in nested elements may end up in attributes. (However, if you read the file back in with XMLin() you'll get the same Perl data structure). There are a number of ways you might handle this: =over 4 =item * use the 'forcearray' option with XMLin() =item * use the 'noattr' option with XMLout() =item * live with it =item * don't use XML::Simple =back =head2 Why does XMLout() insert E<lt>nameE<gt> elements (or attributes)? Try setting keyattr => []. When you call XMLin() to read XML, the 'keyattr' option controls whether arrays get 'folded' into hashes. Similarly, when you call XMLout(), the 'keyattr' option controls whether hashes get 'unfolded' into arrays. As described above, 'keyattr' is enabled by default. =head2 Why are empty elements represented as empty hashes? An element is always represented as a hash unless it contains only text, in which case it is represented as a scalar string. If you would prefer empty elements to be represented as empty strings or the undefined value, set the 'suppressempty' option to '' or undef respectively. =head2 Why is ParserOpts deprecated? The C<ParserOpts> option is a remnant of the time when XML::Simple only worked with the XML::Parser API. Its value is completely ignored if you're using a SAX parser, so writing code which relied on it would bar you from taking advantage of SAX. Even if you are using XML::Parser, it is seldom necessary to pass options to the parser object. A number of people have written to say they use this option to set XML::Parser's C<ProtocolEncoding> option. Don't do that, it's wrong, Wrong, WRONG! Fix the XML document so that it's well-formed and you won't have a problem. Having said all of that, as long as XML::Simple continues to support the XML::Parser API, this option will not be removed. There are currently no plans to remove support for the XML::Parser API. =cut ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������darwin-perl-lib/XML/SAX/DocumentLocator.pm����������������������������������������������������������000444 �000765 �000024 �00000005502 13167163507 022517� 0����������������������������������������������������������������������������������������������������ustar�00ocsinventory��������������������staff���������������������������000000 �000000 ������������������������������������������������������������������������������������������������������������������������������������������������������������������������# $Id$ package XML::SAX::DocumentLocator; use strict; sub new { my $class = shift; my %object; tie %object, $class, @_; return bless \%object, $class; } sub TIEHASH { my $class = shift; my ($pubmeth, $sysmeth, $linemeth, $colmeth, $encmeth, $xmlvmeth) = @_; return bless { pubmeth => $pubmeth, sysmeth => $sysmeth, linemeth => $linemeth, colmeth => $colmeth, encmeth => $encmeth, xmlvmeth => $xmlvmeth, }, $class; } sub FETCH { my ($self, $key) = @_; my $method; if ($key eq 'PublicId') { $method = $self->{pubmeth}; } elsif ($key eq 'SystemId') { $method = $self->{sysmeth}; } elsif ($key eq 'LineNumber') { $method = $self->{linemeth}; } elsif ($key eq 'ColumnNumber') { $method = $self->{colmeth}; } elsif ($key eq 'Encoding') { $method = $self->{encmeth}; } elsif ($key eq 'XMLVersion') { $method = $self->{xmlvmeth}; } if ($method) { my $value = $method->($key); return $value; } return undef; } sub EXISTS { my ($self, $key) = @_; if ($key =~ /^(PublicId|SystemId|LineNumber|ColumnNumber|Encoding|XMLVersion)$/) { return 1; } return 0; } sub STORE { my ($self, $key, $value) = @_; } sub DELETE { my ($self, $key) = @_; } sub CLEAR { my ($self) = @_; } sub FIRSTKEY { my ($self) = @_; # assignment resets. $self->{keys} = { PublicId => 1, SystemId => 1, LineNumber => 1, ColumnNumber => 1, Encoding => 1, XMLVersion => 1, }; return each %{$self->{keys}}; } sub NEXTKEY { my ($self, $lastkey) = @_; return each %{$self->{keys}}; } 1; __END__ =head1 NAME XML::SAX::DocumentLocator - Helper class for document locators =head1 SYNOPSIS my $locator = XML::SAX::DocumentLocator->new( sub { $object->get_public_id }, sub { $object->get_system_id }, sub { $reader->current_line }, sub { $reader->current_column }, sub { $reader->get_encoding }, sub { $reader->get_xml_version }, ); =head1 DESCRIPTION This module gives you a tied hash reference that calls the specified closures when asked for PublicId, SystemId, LineNumber and ColumnNumber. It is useful for writing SAX Parsers so that you don't have to constantly update the line numbers in a hash reference on the object you pass to set_document_locator(). See the source code for XML::SAX::PurePerl for a usage example. =head1 API There is only 1 method: C<new>. Simply pass it a list of closures that when called will return the PublicId, the SystemId, the LineNumber, the ColumnNumber, the Encoding and the XMLVersion respectively. The closures are passed a single parameter, the key being requested. But you're free to ignore that. =cut ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������darwin-perl-lib/XML/SAX/Intro.pod�������������������������������������������������������������������000444 �000765 �000024 �00000034741 13167163507 020665� 0����������������������������������������������������������������������������������������������������ustar�00ocsinventory��������������������staff���������������������������000000 �000000 ������������������������������������������������������������������������������������������������������������������������������������������������������������������������=head1 NAME XML::SAX::Intro - An Introduction to SAX Parsing with Perl =head1 Introduction XML::SAX is a new way to work with XML Parsers in Perl. In this article we'll discuss why you should be using SAX, why you should be using XML::SAX, and we'll see some of the finer implementation details. The text below assumes some familiarity with callback, or push based parsing, but if you are unfamiliar with these techniques then a good place to start is Kip Hampton's excellent series of articles on XML.com. =head1 Replacing XML::Parser The de-facto way of parsing XML under perl is to use Larry Wall and Clark Cooper's XML::Parser. This module is a Perl and XS wrapper around the expat XML parser library by James Clark. It has been a hugely successful project, but suffers from a couple of rather major flaws. Firstly it is a proprietary API, designed before the SAX API was conceived, which means that it is not easily replaceable by other streaming parsers. Secondly it's callbacks are subrefs. This doesn't sound like much of an issue, but unfortunately leads to code like: sub handle_start { my ($e, $el, %attrs) = @_; if ($el eq 'foo') { $e->{inside_foo}++; # BAD! $e is an XML::Parser::Expat object. } } As you can see, we're using the $e object to hold our state information, which is a bad idea because we don't own that object - we didn't create it. It's an internal object of XML::Parser, that happens to be a hashref. We could all too easily overwrite XML::Parser internal state variables by using this, or Clark could change it to an array ref (not that he would, because it would break so much code, but he could). The only way currently with XML::Parser to safely maintain state is to use a closure: my $state = MyState->new(); $parser->setHandlers(Start => sub { handle_start($state, @_) }); This closure traps the $state variable, which now gets passed as the first parameter to your callback. Unfortunately very few people use this technique, as it is not documented in the XML::Parser POD files. Another reason you might not want to use XML::Parser is because you need some feature that it doesn't provide (such as validation), or you might need to use a library that doesn't use expat, due to it not being installed on your system, or due to having a restrictive ISP. Using SAX allows you to work around these restrictions. =head1 Introducing SAX SAX stands for the Simple API for XML. And simple it really is. Constructing a SAX parser and passing events to handlers is done as simply as: use XML::SAX; use MySAXHandler; my $parser = XML::SAX::ParserFactory->parser( Handler => MySAXHandler->new ); $parser->parse_uri("foo.xml"); The important concept to grasp here is that SAX uses a factory class called XML::SAX::ParserFactory to create a new parser instance. The reason for this is so that you can support other underlying parser implementations for different feature sets. This is one thing that XML::Parser has always sorely lacked. In the code above we see the parse_uri method used, but we could have equally well called parse_file, parse_string, or parse(). Please see XML::SAX::Base for what these methods take as parameters, but don't be fooled into believing parse_file takes a filename. No, it takes a file handle, a glob, or a subclass of IO::Handle. Beware. SAX works very similarly to XML::Parser's default callback method, except it has one major difference: rather than setting individual callbacks, you create a new class in which to recieve the callbacks. Each callback is called as a method call on an instance of that handler class. An example will best demonstrate this: package MySAXHandler; use base qw(XML::SAX::Base); sub start_document { my ($self, $doc) = @_; # process document start event } sub start_element { my ($self, $el) = @_; # process element start event } Now, when we instantiate this as above, and parse some XML with this as the handler, the methods start_document and start_element will be called as method calls, so this would be the equivalent of directly calling: $object->start_element($el); Notice how this is different to XML::Parser's calling style, which calls: start_element($e, $name, %attribs); It's the difference between function calling and method calling which allows you to subclass SAX handlers which contributes to SAX being a powerful solution. As you can see, unlike XML::Parser, we have to define a new package in which to do our processing (there are hacks you can do to make this uneccessary, but I'll leave figuring those out to the experts). The biggest benefit of this is that you maintain your own state variable ($self in the above example) thus freeing you of the concerns listed above. It is also an improvement in maintainability - you can place the code in a separate file if you wish to, and your callback methods are always called the same thing, rather than having to choose a suitable name for them as you had to with XML::Parser. This is an obvious win. SAX parsers are also very flexible in how you pass a handler to them. You can use a constructor parameter as we saw above, or we can pass the handler directly in the call to one of the parse methods: $parser->parse(Handler => $handler, Source => { SystemId => "foo.xml" }); # or... $parser->parse_file($fh, Handler => $handler); This flexibility allows for one parser to be used in many different scenarios throughout your script (though one shouldn't feel pressure to use this method, as parser construction is generally not a time consuming process). =head1 Callback Parameters The only other thing you need to know to understand basic SAX is the structure of the parameters passed to each of the callbacks. In XML::Parser, all parameters are passed as multiple options to the callbacks, so for example the Start callback would be called as my_start($e, $name, %attributes), and the PI callback would be called as my_processing_instruction($e, $target, $data). In SAX, every callback is passed a hash reference, containing entries that define our "node". The key callbacks and the structures they receive are: =head2 start_element The start_element handler is called whenever a parser sees an opening tag. It is passed an element structure consisting of: =over 4 =item LocalName The name of the element minus any namespace prefix it may have come with in the document. =item NamespaceURI The URI of the namespace associated with this element, or the empty string for none. =item Attributes A set of attributes as described below. =item Name The name of the element as it was seen in the document (i.e. including any prefix associated with it) =item Prefix The prefix used to qualify this element's namespace, or the empty string if none. =back The B<Attributes> are a hash reference, keyed by what we have called "James Clark" notation. This means that the attribute name has been expanded to include any associated namespace URI, and put together as {ns}name, where "ns" is the expanded namespace URI of the attribute if and only if the attribute had a prefix, and "name" is the LocalName of the attribute. The value of each entry in the attributes hash is another hash structure consisting of: =over 4 =item LocalName The name of the attribute minus any namespace prefix it may have come with in the document. =item NamespaceURI The URI of the namespace associated with this attribute. If the attribute had no prefix, then this consists of just the empty string. =item Name The attribute's name as it appeared in the document, including any namespace prefix. =item Prefix The prefix used to qualify this attribute's namepace, or the empty string if none. =item Value The value of the attribute. =back So a full example, as output by Data::Dumper might be: .... =head2 end_element The end_element handler is called either when a parser sees a closing tag, or after start_element has been called for an empty element (do note however that a parser may if it is so inclined call characters with an empty string when it sees an empty element. There is no simple way in SAX to determine if the parser in fact saw an empty element, a start and end element with no content.. The end_element handler receives exactly the same structure as start_element, minus the Attributes entry. One must note though that it should not be a reference to the same data as start_element receives, so you may change the values in start_element but this will not affect the values later seen by end_element. =head2 characters The characters callback may be called in serveral circumstances. The most obvious one is when seeing ordinary character data in the markup. But it is also called for text in a CDATA section, and is also called in other situations. A SAX parser has to make no guarantees whatsoever about how many times it may call characters for a stretch of text in an XML document - it may call once, or it may call once for every character in the text. In order to work around this it is often important for the SAX developer to use a bundling technique, where text is gathered up and processed in one of the other callbacks. This is not always necessary, but it is a worthwhile technique to learn, which we will cover in XML::SAX::Advanced (when I get around to writing it). The characters handler is called with a very simple structure - a hash reference consisting of just one entry: =over 4 =item Data The text data that was received. =back =head2 comment The comment callback is called for comment text. Unlike with C<characters()>, the comment callback *must* be invoked just once for an entire comment string. It receives a single simple structure - a hash reference containing just one entry: =over 4 =item Data The text of the comment. =back =head2 processing_instruction The processing instruction handler is called for all processing instructions in the document. Note that these processing instructions may appear before the document root element, or after it, or anywhere where text and elements would normally appear within the document, according to the XML specification. The handler is passed a structure containing just two entries: =over 4 =item Target The target of the processing instrcution =item Data The text data in the processing instruction. Can be an empty string for a processing instruction that has no data element. For example E<lt>?wiggle?E<gt> is a perfectly valid processing instruction. =back =head1 Tip of the iceberg What we have discussed above is really the tip of the SAX iceberg. And so far it looks like there's not much of interest to SAX beyond what we have seen with XML::Parser. But it does go much further than that, I promise. People who hate Object Oriented code for the sake of it may be thinking here that creating a new package just to parse something is a waste when they've been parsing things just fine up to now using procedural code. But there's reason to all this madness. And that reason is SAX Filters. As you saw right at the very start, to let the parser know about our class, we pass it an instance of our class as the Handler to the parser. But now imagine what would happen if our class could also take a Handler option, and simply do some processing and pass on our data further down the line? That in a nutshell is how SAX filters work. It's Unix pipes for the 21st century! There are two downsides to this. Number 1 - writing SAX filters can be tricky. If you look into the future and read the advanced tutorial I'm writing, you'll see that Handler can come in several shapes and sizes. So making sure your filter does the right thing can be tricky. Secondly, constructing complex filter chains can be difficult, and simple thinking tells us that we only get one pass at our document, when often we'll need more than that. Luckily though, those downsides have been fixed by the release of two very cool modules. What's even better is that I didn't write either of them! The first module is XML::SAX::Base. This is a VITAL SAX module that acts as a base class for all SAX parsers and filters. It provides an abstraction away from calling the handler methods, that makes sure your filter or parser does the right thing, and it does it FAST. So, if you ever need to write a SAX filter, which if you're processing XML -> XML, or XML -> HTML, then you probably do, then you need to be writing it as a subclass of XML::SAX::Base. Really - this is advice not to ignore lightly. I will not go into the details of writing a SAX filter here. Kip Hampton, the author of XML::SAX::Base has covered this nicely in his article on XML.com here <URI>. To construct SAX pipelines, Barrie Slaymaker, a long time Perl hacker whose modules you will probably have heard of or used, wrote a very clever module called XML::SAX::Machines. This combines some really clever SAX filter-type modules, with a construction toolkit for filters that makes building pipelines easy. But before we see how it makes things easy, first lets see how tricky it looks to build complex SAX filter pipelines. use XML::SAX::ParserFactory; use XML::Filter::Filter1; use XML::Filter::Filter2; use XML::SAX::Writer; my $output_string; my $writer = XML::SAX::Writer->new(Output => \$output_string); my $filter2 = XML::SAX::Filter2->new(Handler => $writer); my $filter1 = XML::SAX::Filter1->new(Handler => $filter2); my $parser = XML::SAX::ParserFactory->parser(Handler => $filter1); $parser->parse_uri("foo.xml"); This is a lot easier with XML::SAX::Machines: use XML::SAX::Machines qw(Pipeline); my $output_string; my $parser = Pipeline( XML::SAX::Filter1 => XML::SAX::Filter2 => \$output_string ); $parser->parse_uri("foo.xml"); One of the main benefits of XML::SAX::Machines is that the pipelines are constructed in natural order, rather than the reverse order we saw with manual pipeline construction. XML::SAX::Machines takes care of all the internals of pipe construction, providing you at the end with just a parser you can use (and you can re-use the same parser as many times as you need to). Just a final tip. If you ever get stuck and are confused about what is being passed from one SAX filter or parser to the next, then Devel::TraceSAX will come to your rescue. This perl debugger plugin will allow you to dump the SAX stream of events as it goes by. Usage is really very simple just call your perl script that uses SAX as follows: $ perl -d:TraceSAX <scriptname> And preferably pipe the output to a pager of some sort, such as more or less. The output is extremely verbose, but should help clear some issues up. =head1 AUTHOR Matt Sergeant, matt@sergeant.org $Id$ =cut �������������������������������darwin-perl-lib/XML/SAX/ParserFactory.pm������������������������������������������������������������000444 �000765 �000024 �00000014607 13167163507 022207� 0����������������������������������������������������������������������������������������������������ustar�00ocsinventory��������������������staff���������������������������000000 �000000 ������������������������������������������������������������������������������������������������������������������������������������������������������������������������# $Id$ package XML::SAX::ParserFactory; use strict; use vars qw($VERSION); $VERSION = '1.01'; use Symbol qw(gensym); use XML::SAX; use XML::SAX::Exception; sub new { my $class = shift; my %params = @_; # TODO : Fix this in spec. my $self = bless \%params, $class; $self->{KnownParsers} = XML::SAX->parsers(); return $self; } sub parser { my $self = shift; my @parser_params = @_; if (!ref($self)) { $self = $self->new(); } my $parser_class = $self->_parser_class(); my $version = ''; if ($parser_class =~ s/\s*\(([\d\.]+)\)\s*$//) { $version = " $1"; } if (!$parser_class->can('new')) { eval "require $parser_class $version;"; die $@ if $@; } return $parser_class->new(@parser_params); } sub require_feature { my $self = shift; my ($feature) = @_; $self->{RequiredFeatures}{$feature}++; return $self; } sub _parser_class { my $self = shift; # First try ParserPackage if ($XML::SAX::ParserPackage) { return $XML::SAX::ParserPackage; } # Now check if required/preferred is there if ($self->{RequiredFeatures}) { my %required = %{$self->{RequiredFeatures}}; # note - we never go onto the next try (ParserDetails.ini), # because if we can't provide the requested feature # we need to throw an exception. PARSER: foreach my $parser (reverse @{$self->{KnownParsers}}) { foreach my $feature (keys %required) { if (!exists $parser->{Features}{$feature}) { next PARSER; } } # got here - all features must exist! return $parser->{Name}; } # TODO : should this be NotSupported() ? throw XML::SAX::Exception ( Message => "Unable to provide required features", ); } # Next try SAX.ini for my $dir (@INC) { my $fh = gensym(); if (open($fh, "$dir/SAX.ini")) { my $param_list = XML::SAX->_parse_ini_file($fh); my $params = $param_list->[0]->{Features}; if ($params->{ParserPackage}) { return $params->{ParserPackage}; } else { # we have required features (or nothing?) PARSER: foreach my $parser (reverse @{$self->{KnownParsers}}) { foreach my $feature (keys %$params) { if (!exists $parser->{Features}{$feature}) { next PARSER; } } return $parser->{Name}; } XML::SAX->do_warn("Unable to provide SAX.ini required features. Using fallback\n"); } last; # stop after first INI found } } if (@{$self->{KnownParsers}}) { return $self->{KnownParsers}[-1]{Name}; } else { return "XML::SAX::PurePerl"; # backup plan! } } 1; __END__ =head1 NAME XML::SAX::ParserFactory - Obtain a SAX parser =head1 SYNOPSIS use XML::SAX::ParserFactory; use XML::SAX::XYZHandler; my $handler = XML::SAX::XYZHandler->new(); my $p = XML::SAX::ParserFactory->parser(Handler => $handler); $p->parse_uri("foo.xml"); # or $p->parse_string("<foo/>") or $p->parse_file($fh); =head1 DESCRIPTION XML::SAX::ParserFactory is a factory class for providing an application with a Perl SAX2 XML parser. It is akin to DBI - a front end for other parser classes. Each new SAX2 parser installed will register itself with XML::SAX, and then it will become available to all applications that use XML::SAX::ParserFactory to obtain a SAX parser. Unlike DBI however, XML/SAX parsers almost all work alike (especially if they subclass XML::SAX::Base, as they should), so rather than specifying the parser you want in the call to C<parser()>, XML::SAX has several ways to automatically choose which parser to use: =over 4 =item * $XML::SAX::ParserPackage If this package variable is set, then this package is C<require()>d and an instance of this package is returned by calling the C<new()> class method in that package. If it cannot be loaded or there is an error, an exception will be thrown. The variable can also contain a version number: $XML::SAX::ParserPackage = "XML::SAX::Expat (0.72)"; And the number will be treated as a minimum version number. =item * Required features It is possible to require features from the parsers. For example, you may wish for a parser that supports validation via a DTD. To do that, use the following code: use XML::SAX::ParserFactory; my $factory = XML::SAX::ParserFactory->new(); $factory->require_feature('http://xml.org/sax/features/validation'); my $parser = $factory->parser(...); Alternatively, specify the required features in the call to the ParserFactory constructor: my $factory = XML::SAX::ParserFactory->new( RequiredFeatures => { 'http://xml.org/sax/features/validation' => 1, } ); If the features you have asked for are unavailable (for example the user might not have a validating parser installed), then an exception will be thrown. The list of known parsers is searched in reverse order, so it will always return the last installed parser that supports all of your requested features (Note: this is subject to change if someone comes up with a better way of making this work). =item * SAX.ini ParserFactory will search @INC for a file called SAX.ini, which is in a simple format: # a comment looks like this, ; or like this, and are stripped anywhere in the file key = value # SAX.in contains key/value pairs. All whitespace is non-significant. This file can contain either a line: ParserPackage = MyParserModule (1.02) Where MyParserModule is the module to load and use for the parser, and the number in brackets is a minimum version to load. Or you can list required features: http://xml.org/sax/features/validation = 1 And each feature with a true value will be required. =item * Fallback If none of the above works, the last parser installed on the user's system will be used. The XML::SAX package ships with a pure perl XML parser, XML::SAX::PurePerl, so that there will always be a fallback parser. =back =head1 AUTHOR Matt Sergeant, matt@sergeant.org =head1 LICENSE This is free software, you may use it and distribute it under the same terms as Perl itself. =cut �������������������������������������������������������������������������������������������������������������������������darwin-perl-lib/XML/SAX/PurePerl/�������������������������������������������������������������������000755 �000765 �000024 �00000000000 13167163507 020615� 5����������������������������������������������������������������������������������������������������ustar�00ocsinventory��������������������staff���������������������������000000 �000000 ������������������������������������������������������������������������������������������������������������������������������������������������������������������������darwin-perl-lib/XML/SAX/PurePerl.pm�����������������������������������������������������������������000444 �000765 �000024 �00000050153 13167163507 021155� 0����������������������������������������������������������������������������������������������������ustar�00ocsinventory��������������������staff���������������������������000000 �000000 ������������������������������������������������������������������������������������������������������������������������������������������������������������������������# $Id$ package XML::SAX::PurePerl; use strict; use vars qw/$VERSION/; $VERSION = '0.99'; use XML::SAX::PurePerl::Productions qw($NameChar $SingleChar); use XML::SAX::PurePerl::Reader; use XML::SAX::PurePerl::EncodingDetect (); use XML::SAX::Exception; use XML::SAX::PurePerl::DocType (); use XML::SAX::PurePerl::DTDDecls (); use XML::SAX::PurePerl::XMLDecl (); use XML::SAX::DocumentLocator (); use XML::SAX::Base (); use XML::SAX qw(Namespaces); use XML::NamespaceSupport (); use IO::File; if ($] < 5.006) { require XML::SAX::PurePerl::NoUnicodeExt; } else { require XML::SAX::PurePerl::UnicodeExt; } use vars qw(@ISA); @ISA = ('XML::SAX::Base'); my %int_ents = ( amp => '&', lt => '<', gt => '>', quot => '"', apos => "'", ); my $xmlns_ns = "http://www.w3.org/2000/xmlns/"; my $xml_ns = "http://www.w3.org/XML/1998/namespace"; use Carp; sub _parse_characterstream { my $self = shift; my ($fh) = @_; confess("CharacterStream is not yet correctly implemented"); my $reader = XML::SAX::PurePerl::Reader::Stream->new($fh); return $self->_parse($reader); } sub _parse_bytestream { my $self = shift; my ($fh) = @_; my $reader = XML::SAX::PurePerl::Reader::Stream->new($fh); return $self->_parse($reader); } sub _parse_string { my $self = shift; my ($str) = @_; my $reader = XML::SAX::PurePerl::Reader::String->new($str); return $self->_parse($reader); } sub _parse_systemid { my $self = shift; my ($uri) = @_; my $reader = XML::SAX::PurePerl::Reader::URI->new($uri); return $self->_parse($reader); } sub _parse { my ($self, $reader) = @_; $reader->public_id($self->{ParseOptions}{Source}{PublicId}); $reader->system_id($self->{ParseOptions}{Source}{SystemId}); $self->{NSHelper} = XML::NamespaceSupport->new({xmlns => 1}); $self->set_document_locator( XML::SAX::DocumentLocator->new( sub { $reader->public_id }, sub { $reader->system_id }, sub { $reader->line }, sub { $reader->column }, sub { $reader->get_encoding }, sub { $reader->get_xml_version }, ), ); $self->start_document({}); if (defined $self->{ParseOptions}{Source}{Encoding}) { $reader->set_encoding($self->{ParseOptions}{Source}{Encoding}); } else { $self->encoding_detect($reader); } # parse a document $self->document($reader); return $self->end_document({}); } sub parser_error { my $self = shift; my ($error, $reader) = @_; # warn("parser error: $error from ", $reader->line, " : ", $reader->column, "\n"); my $exception = XML::SAX::Exception::Parse->new( Message => $error, ColumnNumber => $reader->column, LineNumber => $reader->line, PublicId => $reader->public_id, SystemId => $reader->system_id, ); $self->fatal_error($exception); $exception->throw; } sub document { my ($self, $reader) = @_; # document ::= prolog element Misc* $self->prolog($reader); $self->element($reader) || $self->parser_error("Document requires an element", $reader); while(length($reader->data)) { $self->Misc($reader) || $self->parser_error("Only Comments, PIs and whitespace allowed at end of document", $reader); } } sub prolog { my ($self, $reader) = @_; $self->XMLDecl($reader); # consume all misc bits 1 while($self->Misc($reader)); if ($self->doctypedecl($reader)) { while (length($reader->data)) { $self->Misc($reader) || last; } } } sub element { my ($self, $reader) = @_; return 0 unless $reader->match('<'); my $name = $self->Name($reader) || $self->parser_error("Invalid element name", $reader); my %attribs; while( my ($k, $v) = $self->Attribute($reader) ) { $attribs{$k} = $v; } my $have_namespaces = $self->get_feature(Namespaces); # Namespace processing $self->{NSHelper}->push_context; my @new_ns; # my %attrs = @attribs; # while (my ($k,$v) = each %attrs) { if ($have_namespaces) { while ( my ($k, $v) = each %attribs ) { if ($k =~ m/^xmlns(:(.*))?$/) { my $prefix = $2 || ''; $self->{NSHelper}->declare_prefix($prefix, $v); my $ns = { Prefix => $prefix, NamespaceURI => $v, }; push @new_ns, $ns; $self->SUPER::start_prefix_mapping($ns); } } } # Create element object and fire event my %attrib_hash; while (my ($name, $value) = each %attribs ) { # TODO normalise value here my ($ns, $prefix, $lname); if ($have_namespaces) { ($ns, $prefix, $lname) = $self->{NSHelper}->process_attribute_name($name); } $ns ||= ''; $prefix ||= ''; $lname ||= ''; $attrib_hash{"{$ns}$lname"} = { Name => $name, LocalName => $lname, Prefix => $prefix, NamespaceURI => $ns, Value => $value, }; } %attribs = (); # lose the memory since we recurse deep my ($ns, $prefix, $lname); if ($self->get_feature(Namespaces)) { ($ns, $prefix, $lname) = $self->{NSHelper}->process_element_name($name); } else { $lname = $name; } $ns ||= ''; $prefix ||= ''; $lname ||= ''; # Process remainder of start_element $self->skip_whitespace($reader); my $have_content; my $data = $reader->data(2); if ($data =~ /^\/>/) { $reader->move_along(2); } else { $data =~ /^>/ or $self->parser_error("No close element tag", $reader); $reader->move_along(1); $have_content++; } my $el = { Name => $name, LocalName => $lname, Prefix => $prefix, NamespaceURI => $ns, Attributes => \%attrib_hash, }; $self->start_element($el); # warn("($name\n"); if ($have_content) { $self->content($reader); my $data = $reader->data(2); $data =~ /^<\// or $self->parser_error("No close tag marker", $reader); $reader->move_along(2); my $end_name = $self->Name($reader); $end_name eq $name || $self->parser_error("End tag mismatch ($end_name != $name)", $reader); $self->skip_whitespace($reader); $reader->match('>') or $self->parser_error("No close '>' on end tag", $reader); } my %end_el = %$el; delete $end_el{Attributes}; $self->end_element(\%end_el); for my $ns (@new_ns) { $self->end_prefix_mapping($ns); } $self->{NSHelper}->pop_context; return 1; } sub content { my ($self, $reader) = @_; while (1) { $self->CharData($reader); my $data = $reader->data(2); if ($data =~ /^<\//) { return 1; } elsif ($data =~ /^&/) { $self->Reference($reader) or $self->parser_error("bare & not allowed in content", $reader); next; } elsif ($data =~ /^<!/) { ($self->CDSect($reader) or $self->Comment($reader)) and next; } elsif ($data =~ /^<\?/) { $self->PI($reader) and next; } elsif ($data =~ /^</) { $self->element($reader) and next; } last; } return 1; } sub CDSect { my ($self, $reader) = @_; my $data = $reader->data(9); return 0 unless $data =~ /^<!\[CDATA\[/; $reader->move_along(9); $self->start_cdata({}); $data = $reader->data; while (1) { $self->parser_error("EOF looking for CDATA section end", $reader) unless length($data); if ($data =~ /^(.*?)\]\]>/s) { my $chars = $1; $reader->move_along(length($chars) + 3); $self->characters({Data => $chars}); last; } else { $self->characters({Data => $data}); $reader->move_along(length($data)); $data = $reader->data; } } $self->end_cdata({}); return 1; } sub CharData { my ($self, $reader) = @_; my $data = $reader->data; while (1) { return unless length($data); if ($data =~ /^([^<&]*)[<&]/s) { my $chars = $1; $self->parser_error("String ']]>' not allowed in character data", $reader) if $chars =~ /\]\]>/; $reader->move_along(length($chars)); $self->characters({Data => $chars}) if length($chars); last; } else { $self->characters({Data => $data}); $reader->move_along(length($data)); $data = $reader->data; } } } sub Misc { my ($self, $reader) = @_; if ($self->Comment($reader)) { return 1; } elsif ($self->PI($reader)) { return 1; } elsif ($self->skip_whitespace($reader)) { return 1; } return 0; } sub Reference { my ($self, $reader) = @_; return 0 unless $reader->match('&'); my $data = $reader->data; # Fetch more data if we have an incomplete numeric reference if ($data =~ /^(#\d*|#x[0-9a-fA-F]*)$/) { $data = $reader->data(length($data) + 6); } if ($data =~ /^#x([0-9a-fA-F]+);/) { my $ref = $1; $reader->move_along(length($ref) + 3); my $char = chr_ref(hex($ref)); $self->parser_error("Character reference &#$ref; refers to an illegal XML character ($char)", $reader) unless $char =~ /$SingleChar/o; $self->characters({ Data => $char }); return 1; } elsif ($data =~ /^#([0-9]+);/) { my $ref = $1; $reader->move_along(length($ref) + 2); my $char = chr_ref($ref); $self->parser_error("Character reference &#$ref; refers to an illegal XML character ($char)", $reader) unless $char =~ /$SingleChar/o; $self->characters({ Data => $char }); return 1; } else { # EntityRef my $name = $self->Name($reader) || $self->parser_error("Invalid name in entity", $reader); $reader->match(';') or $self->parser_error("No semi-colon found after entity name", $reader); # warn("got entity: \&$name;\n"); # expand it if ($self->_is_entity($name)) { if ($self->_is_external($name)) { my $value = $self->_get_entity($name); my $ent_reader = XML::SAX::PurePerl::Reader::URI->new($value); $self->encoding_detect($ent_reader); $self->extParsedEnt($ent_reader); } else { my $value = $self->_stringify_entity($name); my $ent_reader = XML::SAX::PurePerl::Reader::String->new($value); $self->content($ent_reader); } return 1; } elsif ($name =~ /^(?:amp|gt|lt|quot|apos)$/) { $self->characters({ Data => $int_ents{$name} }); return 1; } else { $self->parser_error("Undeclared entity", $reader); } } } sub AttReference { my ($self, $name, $reader) = @_; if ($name =~ /^#x([0-9a-fA-F]+)$/) { my $chr = chr_ref(hex($1)); $chr =~ /$SingleChar/o or $self->parser_error("Character reference '&$name;' refers to an illegal XML character", $reader); return $chr; } elsif ($name =~ /^#([0-9]+)$/) { my $chr = chr_ref($1); $chr =~ /$SingleChar/o or $self->parser_error("Character reference '&$name;' refers to an illegal XML character", $reader); return $chr; } else { if ($self->_is_entity($name)) { if ($self->_is_external($name)) { $self->parser_error("No external entity references allowed in attribute values", $reader); } else { my $value = $self->_stringify_entity($name); return $value; } } elsif ($name =~ /^(?:amp|lt|gt|quot|apos)$/) { return $int_ents{$name}; } else { $self->parser_error("Undeclared entity '$name'", $reader); } } } sub extParsedEnt { my ($self, $reader) = @_; $self->TextDecl($reader); $self->content($reader); } sub _is_external { my ($self, $name) = @_; # TODO: Fix this to use $reader to store the entities perhaps. if ($self->{ParseOptions}{external_entities}{$name}) { return 1; } return ; } sub _is_entity { my ($self, $name) = @_; # TODO: ditto above if (exists $self->{ParseOptions}{entities}{$name}) { return 1; } return 0; } sub _stringify_entity { my ($self, $name) = @_; # TODO: ditto above if (exists $self->{ParseOptions}{expanded_entity}{$name}) { return $self->{ParseOptions}{expanded_entity}{$name}; } # expand my $reader = XML::SAX::PurePerl::Reader::URI->new($self->{ParseOptions}{entities}{$name}); my $ent = ''; while(1) { my $data = $reader->data; $ent .= $data; $reader->move_along(length($data)) or last; } return $self->{ParseOptions}{expanded_entity}{$name} = $ent; } sub _get_entity { my ($self, $name) = @_; # TODO: ditto above return $self->{ParseOptions}{entities}{$name}; } sub skip_whitespace { my ($self, $reader) = @_; my $data = $reader->data; my $found = 0; while ($data =~ s/^([\x20\x0A\x0D\x09]*)//) { last unless length($1); $found++; $reader->move_along(length($1)); $data = $reader->data; } return $found; } sub Attribute { my ($self, $reader) = @_; $self->skip_whitespace($reader) || return; my $data = $reader->data(2); return if $data =~ /^\/?>/; if (my $name = $self->Name($reader)) { $self->skip_whitespace($reader); $reader->match('=') or $self->parser_error("No '=' in Attribute", $reader); $self->skip_whitespace($reader); my $value = $self->AttValue($reader); if (!$self->cdata_attrib($name)) { $value =~ s/^\x20*//; # discard leading spaces $value =~ s/\x20*$//; # discard trailing spaces $value =~ s/ {1,}/ /g; # all >1 space to single space } return $name, $value; } return; } sub cdata_attrib { # TODO implement this! return 1; } sub AttValue { my ($self, $reader) = @_; my $quote = $self->quote($reader); my $value = ''; while (1) { my $data = $reader->data; $self->parser_error("EOF found while looking for the end of attribute value", $reader) unless length($data); if ($data =~ /^([^$quote]*)$quote/) { $reader->move_along(length($1) + 1); $value .= $1; last; } else { $value .= $data; $reader->move_along(length($data)); } } if ($value =~ /</) { $self->parser_error("< character not allowed in attribute values", $reader); } $value =~ s/[\x09\x0A\x0D]/\x20/g; $value =~ s/&(#(x[0-9a-fA-F]+)|#([0-9]+)|\w+);/$self->AttReference($1, $reader)/geo; return $value; } sub Comment { my ($self, $reader) = @_; my $data = $reader->data(4); if ($data =~ /^<!--/) { $reader->move_along(4); my $comment_str = ''; while (1) { my $data = $reader->data; $self->parser_error("End of data seen while looking for close comment marker", $reader) unless length($data); if ($data =~ /^(.*?)-->/s) { $comment_str .= $1; $self->parser_error("Invalid comment (dash)", $reader) if $comment_str =~ /-$/; $reader->move_along(length($1) + 3); last; } else { $comment_str .= $data; $reader->move_along(length($data)); } } $self->comment({ Data => $comment_str }); return 1; } return 0; } sub PI { my ($self, $reader) = @_; my $data = $reader->data(2); if ($data =~ /^<\?/) { $reader->move_along(2); my ($target); $target = $self->Name($reader) || $self->parser_error("PI has no target", $reader); my $pi_data = ''; if ($self->skip_whitespace($reader)) { while (1) { my $data = $reader->data; $self->parser_error("End of data seen while looking for close PI marker", $reader) unless length($data); if ($data =~ /^(.*?)\?>/s) { $pi_data .= $1; $reader->move_along(length($1) + 2); last; } else { $pi_data .= $data; $reader->move_along(length($data)); } } } else { my $data = $reader->data(2); $data =~ /^\?>/ or $self->parser_error("PI closing sequence not found", $reader); $reader->move_along(2); } $self->processing_instruction({ Target => $target, Data => $pi_data }); return 1; } return 0; } sub Name { my ($self, $reader) = @_; my $name = ''; while(1) { my $data = $reader->data; return unless length($data); $data =~ /^([^\s>\/&\?;=<\)\(\[\],\%\#\!\*\|]*)/ or return; $name .= $1; my $len = length($1); $reader->move_along($len); last if ($len != length($data)); } return unless length($name); $name =~ /$NameChar/o or $self->parser_error("Name <$name> does not match NameChar production", $reader); return $name; } sub quote { my ($self, $reader) = @_; my $data = $reader->data; $data =~ /^(['"])/ or $self->parser_error("Invalid quote token", $reader); $reader->move_along(1); return $1; } 1; __END__ =head1 NAME XML::SAX::PurePerl - Pure Perl XML Parser with SAX2 interface =head1 SYNOPSIS use XML::Handler::Foo; use XML::SAX::PurePerl; my $handler = XML::Handler::Foo->new(); my $parser = XML::SAX::PurePerl->new(Handler => $handler); $parser->parse_uri("myfile.xml"); =head1 DESCRIPTION This module implements an XML parser in pure perl. It is written around the upcoming perl 5.8's unicode support and support for multiple document encodings (using the PerlIO layer), however it has been ported to work with ASCII/UTF8 documents under lower perl versions. The SAX2 API is described in detail at http://sourceforge.net/projects/perl-xml/, in the CVS archive, under libxml-perl/docs. Hopefully those documents will be in a better location soon. Please refer to the SAX2 documentation for how to use this module - it is merely a front end to SAX2, and implements nothing that is not in that spec (or at least tries not to - please email me if you find errors in this implementation). =head1 BUGS XML::SAX::PurePerl is B<slow>. Very slow. I suggest you use something else in fact. However it is great as a fallback parser for XML::SAX, where the user might not be able to install an XS based parser or C library. Currently lots, probably. At the moment the weakest area is parsing DOCTYPE declarations, though the code is in place to start doing this. Also parsing parameter entity references is causing me much confusion, since it's not exactly what I would call trivial, or well documented in the XML grammar. XML documents with internal subsets are likely to fail. I am however trying to work towards full conformance using the Oasis test suite. =head1 AUTHOR Matt Sergeant, matt@sergeant.org. Copyright 2001. Please report all bugs to the Perl-XML mailing list at perl-xml@listserv.activestate.com. =head1 LICENSE This is free software. You may use it or redistribute it under the same terms as Perl 5.7.2 itself. =cut ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������darwin-perl-lib/XML/SAX/PurePerl/DebugHandler.pm����������������������������������������������������000444 �000765 �000024 �00000003527 13167163507 023504� 0����������������������������������������������������������������������������������������������������ustar�00ocsinventory��������������������staff���������������������������000000 �000000 ������������������������������������������������������������������������������������������������������������������������������������������������������������������������# $Id$ package XML::SAX::PurePerl::DebugHandler; use strict; sub new { my $class = shift; my %opts = @_; return bless \%opts, $class; } # DocumentHandler sub set_document_locator { my $self = shift; print "set_document_locator\n" if $ENV{DEBUG_XML}; $self->{seen}{set_document_locator}++; } sub start_document { my $self = shift; print "start_document\n" if $ENV{DEBUG_XML}; $self->{seen}{start_document}++; } sub end_document { my $self = shift; print "end_document\n" if $ENV{DEBUG_XML}; $self->{seen}{end_document}++; } sub start_element { my $self = shift; print "start_element\n" if $ENV{DEBUG_XML}; $self->{seen}{start_element}++; } sub end_element { my $self = shift; print "end_element\n" if $ENV{DEBUG_XML}; $self->{seen}{end_element}++; } sub characters { my $self = shift; print "characters\n" if $ENV{DEBUG_XML}; # warn "Char: ", $_[0]->{Data}, "\n"; $self->{seen}{characters}++; } sub processing_instruction { my $self = shift; print "processing_instruction\n" if $ENV{DEBUG_XML}; $self->{seen}{processing_instruction}++; } sub ignorable_whitespace { my $self = shift; print "ignorable_whitespace\n" if $ENV{DEBUG_XML}; $self->{seen}{ignorable_whitespace}++; } # LexHandler sub comment { my $self = shift; print "comment\n" if $ENV{DEBUG_XML}; $self->{seen}{comment}++; } # DTDHandler sub notation_decl { my $self = shift; print "notation_decl\n" if $ENV{DEBUG_XML}; $self->{seen}{notation_decl}++; } sub unparsed_entity_decl { my $self = shift; print "unparsed_entity_decl\n" if $ENV{DEBUG_XML}; $self->{seen}{entity_decl}++; } # EntityResolver sub resolve_entity { my $self = shift; print "resolve_entity\n" if $ENV{DEBUG_XML}; $self->{seen}{resolve_entity}++; return ''; } 1; �������������������������������������������������������������������������������������������������������������������������������������������������������������������������darwin-perl-lib/XML/SAX/PurePerl/DocType.pm���������������������������������������������������������000444 �000765 �000024 �00000011061 13167163507 022517� 0����������������������������������������������������������������������������������������������������ustar�00ocsinventory��������������������staff���������������������������000000 �000000 ������������������������������������������������������������������������������������������������������������������������������������������������������������������������# $Id$ package XML::SAX::PurePerl; use strict; use XML::SAX::PurePerl::Productions qw($PubidChar); sub doctypedecl { my ($self, $reader) = @_; my $data = $reader->data(9); if ($data =~ /^<!DOCTYPE/) { $reader->move_along(9); $self->skip_whitespace($reader) || $self->parser_error("No whitespace after doctype declaration", $reader); my $root_name = $self->Name($reader) || $self->parser_error("Doctype declaration has no root element name", $reader); if ($self->skip_whitespace($reader)) { # might be externalid... my %dtd = $self->ExternalID($reader); # TODO: Call SAX event } $self->skip_whitespace($reader); $self->InternalSubset($reader); $reader->match('>') or $self->parser_error("Doctype not closed", $reader); return 1; } return 0; } sub ExternalID { my ($self, $reader) = @_; my $data = $reader->data(6); if ($data =~ /^SYSTEM/) { $reader->move_along(6); $self->skip_whitespace($reader) || $self->parser_error("No whitespace after SYSTEM identifier", $reader); return (SYSTEM => $self->SystemLiteral($reader)); } elsif ($data =~ /^PUBLIC/) { $reader->move_along(6); $self->skip_whitespace($reader) || $self->parser_error("No whitespace after PUBLIC identifier", $reader); my $quote = $self->quote($reader) || $self->parser_error("Not a quote character in PUBLIC identifier", $reader); my $data = $reader->data; my $pubid = ''; while(1) { $self->parser_error("EOF while looking for end of PUBLIC identifiier", $reader) unless length($data); if ($data =~ /^([^$quote]*)$quote/) { $pubid .= $1; $reader->move_along(length($1) + 1); last; } else { $pubid .= $data; $reader->move_along(length($data)); $data = $reader->data; } } if ($pubid !~ /^($PubidChar)+$/) { $self->parser_error("Invalid characters in PUBLIC identifier", $reader); } $self->skip_whitespace($reader) || $self->parser_error("Not whitespace after PUBLIC ID in DOCTYPE", $reader); return (PUBLIC => $pubid, SYSTEM => $self->SystemLiteral($reader)); } else { return; } return 1; } sub SystemLiteral { my ($self, $reader) = @_; my $quote = $self->quote($reader); my $data = $reader->data; my $systemid = ''; while (1) { $self->parser_error("EOF found while looking for end of Sytem Literal", $reader) unless length($data); if ($data =~ /^([^$quote]*)$quote/) { $systemid .= $1; $reader->move_along(length($1) + 1); return $systemid; } else { $systemid .= $data; $reader->move_along(length($data)); $data = $reader->data; } } } sub InternalSubset { my ($self, $reader) = @_; return 0 unless $reader->match('['); 1 while $self->IntSubsetDecl($reader); $reader->match(']') or $self->parser_error("No close bracket on internal subset (found: " . $reader->data, $reader); $self->skip_whitespace($reader); return 1; } sub IntSubsetDecl { my ($self, $reader) = @_; return $self->DeclSep($reader) || $self->markupdecl($reader); } sub DeclSep { my ($self, $reader) = @_; if ($self->skip_whitespace($reader)) { return 1; } if ($self->PEReference($reader)) { return 1; } # if ($self->ParsedExtSubset($reader)) { # return 1; # } return 0; } sub PEReference { my ($self, $reader) = @_; return 0 unless $reader->match('%'); my $peref = $self->Name($reader) || $self->parser_error("PEReference did not find a Name", $reader); # TODO - load/parse the peref $reader->match(';') or $self->parser_error("Invalid token in PEReference", $reader); return 1; } sub markupdecl { my ($self, $reader) = @_; if ($self->elementdecl($reader) || $self->AttlistDecl($reader) || $self->EntityDecl($reader) || $self->NotationDecl($reader) || $self->PI($reader) || $self->Comment($reader)) { return 1; } return 0; } 1; �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������darwin-perl-lib/XML/SAX/PurePerl/DTDDecls.pm��������������������������������������������������������000444 �000765 �000024 �00000041140 13167163507 022537� 0����������������������������������������������������������������������������������������������������ustar�00ocsinventory��������������������staff���������������������������000000 �000000 ������������������������������������������������������������������������������������������������������������������������������������������������������������������������# $Id$ package XML::SAX::PurePerl; use strict; use XML::SAX::PurePerl::Productions qw($SingleChar); sub elementdecl { my ($self, $reader) = @_; my $data = $reader->data(9); return 0 unless $data =~ /^<!ELEMENT/; $reader->move_along(9); $self->skip_whitespace($reader) || $self->parser_error("No whitespace after ELEMENT declaration", $reader); my $name = $self->Name($reader); $self->skip_whitespace($reader) || $self->parser_error("No whitespace after ELEMENT's name", $reader); $self->contentspec($reader, $name); $self->skip_whitespace($reader); $reader->match('>') or $self->parser_error("Closing angle bracket not found on ELEMENT declaration", $reader); return 1; } sub contentspec { my ($self, $reader, $name) = @_; my $data = $reader->data(5); my $model; if ($data =~ /^EMPTY/) { $reader->move_along(5); $model = 'EMPTY'; } elsif ($data =~ /^ANY/) { $reader->move_along(3); $model = 'ANY'; } else { $model = $self->Mixed_or_children($reader); } if ($model) { # call SAX callback now. $self->element_decl({Name => $name, Model => $model}); return 1; } $self->parser_error("contentspec not found in ELEMENT declaration", $reader); } sub Mixed_or_children { my ($self, $reader) = @_; my $data = $reader->data(8); $data =~ /^\(/ or return; # $self->parser_error("No opening bracket in Mixed or children", $reader); if ($data =~ /^\(\s*\#PCDATA/) { $reader->match('('); $self->skip_whitespace($reader); $reader->move_along(7); my $model = $self->Mixed($reader); return $model; } # not matched - must be Children return $self->children($reader); } # Mixed ::= ( '(' S* PCDATA ( S* '|' S* QName )* S* ')' '*' ) # | ( '(' S* PCDATA S* ')' ) sub Mixed { my ($self, $reader) = @_; # Mixed_or_children already matched '(' S* '#PCDATA' my $model = '(#PCDATA'; $self->skip_whitespace($reader); my %seen; while (1) { last unless $reader->match('|'); $self->skip_whitespace($reader); my $name = $self->Name($reader) || $self->parser_error("No 'Name' after Mixed content '|'", $reader); if ($seen{$name}) { $self->parser_error("Element '$name' has already appeared in this group", $reader); } $seen{$name}++; $model .= "|$name"; $self->skip_whitespace($reader); } $reader->match(')') || $self->parser_error("no closing bracket on mixed content", $reader); $model .= ")"; if ($reader->match('*')) { $model .= "*"; } return $model; } # [[47]] Children ::= ChoiceOrSeq Cardinality? # [[48]] Cp ::= ( QName | ChoiceOrSeq ) Cardinality? # ChoiceOrSeq ::= '(' S* Cp ( Choice | Seq )? S* ')' # [[49]] Choice ::= ( S* '|' S* Cp )+ # [[50]] Seq ::= ( S* ',' S* Cp )+ # // Children ::= (Choice | Seq) Cardinality? # // Cp ::= ( QName | Choice | Seq) Cardinality? # // Choice ::= '(' S* Cp ( S* '|' S* Cp )+ S* ')' # // Seq ::= '(' S* Cp ( S* ',' S* Cp )* S* ')' # [[51]] Mixed ::= ( '(' S* PCDATA ( S* '|' S* QName )* S* ')' MixedCardinality ) # | ( '(' S* PCDATA S* ')' ) # Cardinality ::= '?' | '+' | '*' # MixedCardinality ::= '*' sub children { my ($self, $reader) = @_; return $self->ChoiceOrSeq($reader) . $self->Cardinality($reader); } sub ChoiceOrSeq { my ($self, $reader) = @_; $reader->match('(') or $self->parser_error("choice/seq contains no opening bracket", $reader); my $model = '('; $self->skip_whitespace($reader); $model .= $self->Cp($reader); if (my $choice = $self->Choice($reader)) { $model .= $choice; } else { $model .= $self->Seq($reader); } $self->skip_whitespace($reader); $reader->match(')') or $self->parser_error("choice/seq contains no closing bracket", $reader); $model .= ')'; return $model; } sub Cardinality { my ($self, $reader) = @_; # cardinality is always optional my $data = $reader->data; if ($data =~ /^([\?\+\*])/) { $reader->move_along(1); return $1; } return ''; } sub Cp { my ($self, $reader) = @_; my $model; my $name = eval { if (my $name = $self->Name($reader)) { return $name . $self->Cardinality($reader); } }; return $name if defined $name; return $self->ChoiceOrSeq($reader) . $self->Cardinality($reader); } sub Choice { my ($self, $reader) = @_; my $model = ''; $self->skip_whitespace($reader); while ($reader->match('|')) { $self->skip_whitespace($reader); $model .= '|'; $model .= $self->Cp($reader); $self->skip_whitespace($reader); } return $model; } sub Seq { my ($self, $reader) = @_; my $model = ''; $self->skip_whitespace($reader); while ($reader->match(',')) { $self->skip_whitespace($reader); my $cp = $self->Cp($reader); if ($cp) { $model .= ','; $model .= $cp; } $self->skip_whitespace($reader); } return $model; } sub AttlistDecl { my ($self, $reader) = @_; my $data = $reader->data(9); if ($data =~ /^<!ATTLIST/) { # It's an attlist $reader->move_along(9); $self->skip_whitespace($reader) || $self->parser_error("No whitespace after ATTLIST declaration", $reader); my $name = $self->Name($reader); $self->AttDefList($reader, $name); $self->skip_whitespace($reader); $reader->match('>') or $self->parser_error("Closing angle bracket not found on ATTLIST declaration", $reader); return 1; } return 0; } sub AttDefList { my ($self, $reader, $name) = @_; 1 while $self->AttDef($reader, $name); } sub AttDef { my ($self, $reader, $el_name) = @_; $self->skip_whitespace($reader) || return 0; my $att_name = $self->Name($reader) || return 0; $self->skip_whitespace($reader) || $self->parser_error("No whitespace after Name in attribute definition", $reader); my $att_type = $self->AttType($reader); $self->skip_whitespace($reader) || $self->parser_error("No whitespace after AttType in attribute definition", $reader); my ($mode, $value) = $self->DefaultDecl($reader); # fire SAX event here! $self->attribute_decl({ eName => $el_name, aName => $att_name, Type => $att_type, Mode => $mode, Value => $value, }); return 1; } sub AttType { my ($self, $reader) = @_; return $self->StringType($reader) || $self->TokenizedType($reader) || $self->EnumeratedType($reader) || $self->parser_error("Can't match AttType", $reader); } sub StringType { my ($self, $reader) = @_; my $data = $reader->data(5); return unless $data =~ /^CDATA/; $reader->move_along(5); return 'CDATA'; } sub TokenizedType { my ($self, $reader) = @_; my $data = $reader->data(8); if ($data =~ /^(IDREFS?|ID|ENTITIES|ENTITY|NMTOKENS?)/) { $reader->move_along(length($1)); return $1; } return; } sub EnumeratedType { my ($self, $reader) = @_; return $self->NotationType($reader) || $self->Enumeration($reader); } sub NotationType { my ($self, $reader) = @_; my $data = $reader->data(8); return unless $data =~ /^NOTATION/; $reader->move_along(8); $self->skip_whitespace($reader) || $self->parser_error("No whitespace after NOTATION", $reader); $reader->match('(') or $self->parser_error("No opening bracket in notation section", $reader); $self->skip_whitespace($reader); my $model = 'NOTATION ('; my $name = $self->Name($reader) || $self->parser_error("No name in notation section", $reader); $model .= $name; $self->skip_whitespace($reader); $data = $reader->data; while ($data =~ /^\|/) { $reader->move_along(1); $model .= '|'; $self->skip_whitespace($reader); my $name = $self->Name($reader) || $self->parser_error("No name in notation section", $reader); $model .= $name; $self->skip_whitespace($reader); $data = $reader->data; } $data =~ /^\)/ or $self->parser_error("No closing bracket in notation section", $reader); $reader->move_along(1); $model .= ')'; return $model; } sub Enumeration { my ($self, $reader) = @_; return unless $reader->match('('); $self->skip_whitespace($reader); my $model = '('; my $nmtoken = $self->Nmtoken($reader) || $self->parser_error("No Nmtoken in enumerated declaration", $reader); $model .= $nmtoken; $self->skip_whitespace($reader); my $data = $reader->data; while ($data =~ /^\|/) { $model .= '|'; $reader->move_along(1); $self->skip_whitespace($reader); my $nmtoken = $self->Nmtoken($reader) || $self->parser_error("No Nmtoken in enumerated declaration", $reader); $model .= $nmtoken; $self->skip_whitespace($reader); $data = $reader->data; } $data =~ /^\)/ or $self->parser_error("No closing bracket in enumerated declaration", $reader); $reader->move_along(1); $model .= ')'; return $model; } sub Nmtoken { my ($self, $reader) = @_; return $self->Name($reader); } sub DefaultDecl { my ($self, $reader) = @_; my $data = $reader->data(9); if ($data =~ /^(\#REQUIRED|\#IMPLIED)/) { $reader->move_along(length($1)); return $1; } my $model = ''; if ($data =~ /^\#FIXED/) { $reader->move_along(6); $self->skip_whitespace($reader) || $self->parser_error( "no whitespace after FIXED specifier", $reader); my $value = $self->AttValue($reader); return "#FIXED", $value; } my $value = $self->AttValue($reader); return undef, $value; } sub EntityDecl { my ($self, $reader) = @_; my $data = $reader->data(8); return 0 unless $data =~ /^<!ENTITY/; $reader->move_along(8); $self->skip_whitespace($reader) || $self->parser_error( "No whitespace after ENTITY declaration", $reader); $self->PEDecl($reader) || $self->GEDecl($reader); $self->skip_whitespace($reader); $reader->match('>') or $self->parser_error("No closing '>' in entity definition", $reader); return 1; } sub GEDecl { my ($self, $reader) = @_; my $name = $self->Name($reader) || $self->parser_error("No entity name given", $reader); $self->skip_whitespace($reader) || $self->parser_error("No whitespace after entity name", $reader); # TODO: ExternalID calls lexhandler method. Wrong place for it. my $value; if ($value = $self->ExternalID($reader)) { $value .= $self->NDataDecl($reader); } else { $value = $self->EntityValue($reader); } if ($self->{ParseOptions}{entities}{$name}) { warn("entity $name already exists\n"); } else { $self->{ParseOptions}{entities}{$name} = 1; $self->{ParseOptions}{expanded_entity}{$name} = $value; # ??? } # do callback? return 1; } sub PEDecl { my ($self, $reader) = @_; return 0 unless $reader->match('%'); $self->skip_whitespace($reader) || $self->parser_error("No whitespace after parameter entity marker", $reader); my $name = $self->Name($reader) || $self->parser_error("No parameter entity name given", $reader); $self->skip_whitespace($reader) || $self->parser_error("No whitespace after parameter entity name", $reader); my $value = $self->ExternalID($reader) || $self->EntityValue($reader) || $self->parser_error("PE is not a value or an external resource", $reader); # do callback? return 1; } my $quotre = qr/[^%&\"]/; my $aposre = qr/[^%&\']/; sub EntityValue { my ($self, $reader) = @_; my $data = $reader->data; my $quote = '"'; my $re = $quotre; if ($data !~ /^"/) { $data =~ /^'/ or $self->parser_error("Not a quote character", $reader); $quote = "'"; $re = $aposre; } $reader->move_along(1); my $value = ''; while (1) { my $data = $reader->data; $self->parser_error("EOF found while reading entity value", $reader) unless length($data); if ($data =~ /^($re+)/) { my $match = $1; $value .= $match; $reader->move_along(length($match)); } elsif ($reader->match('&')) { # if it's a char ref, expand now: if ($reader->match('#')) { my $char; my $ref = ''; if ($reader->match('x')) { my $data = $reader->data; while (1) { $self->parser_error("EOF looking for reference end", $reader) unless length($data); if ($data !~ /^([0-9a-fA-F]*)/) { last; } $ref .= $1; $reader->move_along(length($1)); if (length($1) == length($data)) { $data = $reader->data; } else { last; } } $char = chr_ref(hex($ref)); $ref = "x$ref"; } else { my $data = $reader->data; while (1) { $self->parser_error("EOF looking for reference end", $reader) unless length($data); if ($data !~ /^([0-9]*)/) { last; } $ref .= $1; $reader->move_along(length($1)); if (length($1) == length($data)) { $data = $reader->data; } else { last; } } $char = chr($ref); } $reader->match(';') || $self->parser_error("No semi-colon found after character reference", $reader); if ($char !~ $SingleChar) { # match a single character $self->parser_error("Character reference '&#$ref;' refers to an illegal XML character ($char)", $reader); } $value .= $char; } else { # entity refs in entities get expanded later, so don't parse now. $value .= '&'; } } elsif ($reader->match('%')) { $value .= $self->PEReference($reader); } elsif ($reader->match($quote)) { # end of attrib last; } else { $self->parser_error("Invalid character in attribute value: " . substr($reader->data, 0, 1), $reader); } } return $value; } sub NDataDecl { my ($self, $reader) = @_; $self->skip_whitespace($reader) || return ''; my $data = $reader->data(5); return '' unless $data =~ /^NDATA/; $reader->move_along(5); $self->skip_whitespace($reader) || $self->parser_error("No whitespace after NDATA declaration", $reader); my $name = $self->Name($reader) || $self->parser_error("NDATA declaration lacks a proper Name", $reader); return " NDATA $name"; } sub NotationDecl { my ($self, $reader) = @_; my $data = $reader->data(10); return 0 unless $data =~ /^<!NOTATION/; $reader->move_along(10); $self->skip_whitespace($reader) || $self->parser_error("No whitespace after NOTATION declaration", $reader); $data = $reader->data; my $value = ''; while(1) { $self->parser_error("EOF found while looking for end of NotationDecl", $reader) unless length($data); if ($data =~ /^([^>]*)>/) { $value .= $1; $reader->move_along(length($1) + 1); $self->notation_decl({Name => "FIXME", SystemId => "FIXME", PublicId => "FIXME" }); last; } else { $value .= $data; $reader->move_along(length($data)); $data = $reader->data; } } return 1; } 1; ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������darwin-perl-lib/XML/SAX/PurePerl/EncodingDetect.pm��������������������������������������������������000444 �000765 �000024 �00000005104 13167163507 024030� 0����������������������������������������������������������������������������������������������������ustar�00ocsinventory��������������������staff���������������������������000000 �000000 ������������������������������������������������������������������������������������������������������������������������������������������������������������������������# $Id$ package XML::SAX::PurePerl; # NB, not ::EncodingDetect! use strict; sub encoding_detect { my ($parser, $reader) = @_; my $error = "Invalid byte sequence at start of file"; my $data = $reader->data; if ($data =~ /^\x00\x00\xFE\xFF/) { # BO-UCS4-be $reader->move_along(4); $reader->set_encoding('UCS-4BE'); return; } elsif ($data =~ /^\x00\x00\xFF\xFE/) { # BO-UCS-4-2143 $reader->move_along(4); $reader->set_encoding('UCS-4-2143'); return; } elsif ($data =~ /^\x00\x00\x00\x3C/) { $reader->set_encoding('UCS-4BE'); return; } elsif ($data =~ /^\x00\x00\x3C\x00/) { $reader->set_encoding('UCS-4-2143'); return; } elsif ($data =~ /^\x00\x3C\x00\x00/) { $reader->set_encoding('UCS-4-3412'); return; } elsif ($data =~ /^\x00\x3C\x00\x3F/) { $reader->set_encoding('UTF-16BE'); return; } elsif ($data =~ /^\xFF\xFE\x00\x00/) { # BO-UCS-4LE $reader->move_along(4); $reader->set_encoding('UCS-4LE'); return; } elsif ($data =~ /^\xFF\xFE/) { $reader->move_along(2); $reader->set_encoding('UTF-16LE'); return; } elsif ($data =~ /^\xFE\xFF\x00\x00/) { $reader->move_along(4); $reader->set_encoding('UCS-4-3412'); return; } elsif ($data =~ /^\xFE\xFF/) { $reader->move_along(2); $reader->set_encoding('UTF-16BE'); return; } elsif ($data =~ /^\xEF\xBB\xBF/) { # UTF-8 BOM $reader->move_along(3); $reader->set_encoding('UTF-8'); return; } elsif ($data =~ /^\x3C\x00\x00\x00/) { $reader->set_encoding('UCS-4LE'); return; } elsif ($data =~ /^\x3C\x00\x3F\x00/) { $reader->set_encoding('UTF-16LE'); return; } elsif ($data =~ /^\x3C\x3F\x78\x6D/) { # $reader->set_encoding('UTF-8'); return; } elsif ($data =~ /^\x3C\x3F\x78/) { # $reader->set_encoding('UTF-8'); return; } elsif ($data =~ /^\x3C\x3F/) { # $reader->set_encoding('UTF-8'); return; } elsif ($data =~ /^\x3C/) { # $reader->set_encoding('UTF-8'); return; } elsif ($data =~ /^[\x20\x09\x0A\x0D]+\x3C[^\x3F]/) { # $reader->set_encoding('UTF-8'); return; } elsif ($data =~ /^\x4C\x6F\xA7\x94/) { $reader->set_encoding('EBCDIC'); return; } warn("Unable to recognise encoding of this document"); return; } 1; ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������darwin-perl-lib/XML/SAX/PurePerl/Exception.pm�������������������������������������������������������000444 �000765 �000024 �00000003253 13167163507 023112� 0����������������������������������������������������������������������������������������������������ustar�00ocsinventory��������������������staff���������������������������000000 �000000 ������������������������������������������������������������������������������������������������������������������������������������������������������������������������# $Id$ package XML::SAX::PurePerl::Exception; use strict; use overload '""' => "stringify"; use vars qw/$StackTrace/; $StackTrace = $ENV{XML_DEBUG} || 0; sub throw { my $class = shift; die $class->new(@_); } sub new { my $class = shift; my %opts = @_; die "Invalid options" unless exists $opts{Message}; if ($opts{reader}) { return bless { Message => $opts{Message}, Exception => undef, # not sure what this is for!!! ColumnNumber => $opts{reader}->column, LineNumber => $opts{reader}->line, PublicId => $opts{reader}->public_id, SystemId => $opts{reader}->system_id, $StackTrace ? (StackTrace => stacktrace()) : (), }, $class; } return bless { Message => $opts{Message}, Exception => undef, # not sure what this is for!!! }, $class; } sub stringify { my $self = shift; local $^W; return $self->{Message} . " [Ln: " . $self->{LineNumber} . ", Col: " . $self->{ColumnNumber} . "]" . ($StackTrace ? stackstring($self->{StackTrace}) : "") . "\n"; } sub stacktrace { my $i = 2; my @fulltrace; while (my @trace = caller($i++)) { my %hash; @hash{qw(Package Filename Line)} = @trace[0..2]; push @fulltrace, \%hash; } return \@fulltrace; } sub stackstring { my $stacktrace = shift; my $string = "\nFrom:\n"; foreach my $current (@$stacktrace) { $string .= $current->{Filename} . " Line: " . $current->{Line} . "\n"; } return $string; } 1; �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������darwin-perl-lib/XML/SAX/PurePerl/NoUnicodeExt.pm����������������������������������������������������000444 �000765 �000024 �00000001164 13167163507 023517� 0����������������������������������������������������������������������������������������������������ustar�00ocsinventory��������������������staff���������������������������000000 �000000 ������������������������������������������������������������������������������������������������������������������������������������������������������������������������# $Id$ package XML::SAX::PurePerl; use strict; sub chr_ref { my $n = shift; if ($n < 0x80) { return chr ($n); } elsif ($n < 0x800) { return pack ("CC", (($n >> 6) | 0xc0), (($n & 0x3f) | 0x80)); } elsif ($n < 0x10000) { return pack ("CCC", (($n >> 12) | 0xe0), ((($n >> 6) & 0x3f) | 0x80), (($n & 0x3f) | 0x80)); } elsif ($n < 0x110000) { return pack ("CCCC", (($n >> 18) | 0xf0), ((($n >> 12) & 0x3f) | 0x80), ((($n >> 6) & 0x3f) | 0x80), (($n & 0x3f) | 0x80)); } else { return undef; } } 1; ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������darwin-perl-lib/XML/SAX/PurePerl/Productions.pm�����������������������������������������������������000444 �000765 �000024 �00000014737 13167163507 023476� 0����������������������������������������������������������������������������������������������������ustar�00ocsinventory��������������������staff���������������������������000000 �000000 ������������������������������������������������������������������������������������������������������������������������������������������������������������������������# $Id$ package XML::SAX::PurePerl::Productions; use Exporter; @ISA = ('Exporter'); @EXPORT_OK = qw($S $Char $VersionNum $BaseChar $Ideographic $Extender $Digit $CombiningChar $EncNameStart $EncNameEnd $NameChar $CharMinusDash $PubidChar $Any $SingleChar); ### WARNING!!! All productions here must *only* match a *single* character!!! ### BEGIN { $S = qr/[\x20\x09\x0D\x0A]/; $CharMinusDash = qr/[^-]/x; $Any = qr/ . /xms; $VersionNum = qr/ [a-zA-Z0-9_.:-]+ /x; $EncNameStart = qr/ [A-Za-z] /x; $EncNameEnd = qr/ [A-Za-z0-9\._-] /x; $PubidChar = qr/ [\x20\x0D\x0Aa-zA-Z0-9'()\+,.\/:=\?;!*\#@\$_\%-] /x; if ($] < 5.006) { eval <<' PERL'; $Char = qr/^ [\x09\x0A\x0D\x20-\x7F]|([\xC0-\xFD][\x80-\xBF]+) $/x; $SingleChar = qr/^$Char$/; $BaseChar = qr/ [\x41-\x5A\x61-\x7A]|([\xC0-\xFD][\x80-\xBF]+) /x; $Extender = qr/ \xB7 /x; $Digit = qr/ [\x30-\x39] /x; # can't do this one without unicode # $CombiningChar = qr/^$/msx; $NameChar = qr/^ (?: $BaseChar | $Digit | [._:-] | $Extender )+ $/x; PERL die $@ if $@; } else { eval <<' PERL'; use utf8; # for 5.6 $Char = qr/^ [\x09\x0A\x0D\x{0020}-\x{D7FF}\x{E000}-\x{FFFD}\x{10000}-\x{10FFFF}] $/x; $SingleChar = qr/^$Char$/; $BaseChar = qr/ [\x{0041}-\x{005A}\x{0061}-\x{007A}\x{00C0}-\x{00D6}\x{00D8}-\x{00F6}] | [\x{00F8}-\x{00FF}\x{0100}-\x{0131}\x{0134}-\x{013E}\x{0141}-\x{0148}] | [\x{014A}-\x{017E}\x{0180}-\x{01C3}\x{01CD}-\x{01F0}\x{01F4}-\x{01F5}] | [\x{01FA}-\x{0217}\x{0250}-\x{02A8}\x{02BB}-\x{02C1}\x{0386}\x{0388}-\x{038A}] | [\x{038C}\x{038E}-\x{03A1}\x{03A3}-\x{03CE}\x{03D0}-\x{03D6}\x{03DA}] | [\x{03DC}\x{03DE}\x{03E0}\x{03E2}-\x{03F3}\x{0401}-\x{040C}\x{040E}-\x{044F}] | [\x{0451}-\x{045C}\x{045E}-\x{0481}\x{0490}-\x{04C4}\x{04C7}-\x{04C8}] | [\x{04CB}-\x{04CC}\x{04D0}-\x{04EB}\x{04EE}-\x{04F5}\x{04F8}-\x{04F9}] | [\x{0531}-\x{0556}\x{0559}\x{0561}-\x{0586}\x{05D0}-\x{05EA}\x{05F0}-\x{05F2}] | [\x{0621}-\x{063A}\x{0641}-\x{064A}\x{0671}-\x{06B7}\x{06BA}-\x{06BE}] | [\x{06C0}-\x{06CE}\x{06D0}-\x{06D3}\x{06D5}\x{06E5}-\x{06E6}\x{0905}-\x{0939}] | [\x{093D}\x{0958}-\x{0961}\x{0985}-\x{098C}\x{098F}-\x{0990}] | [\x{0993}-\x{09A8}\x{09AA}-\x{09B0}\x{09B2}\x{09B6}-\x{09B9}\x{09DC}-\x{09DD}] | [\x{09DF}-\x{09E1}\x{09F0}-\x{09F1}\x{0A05}-\x{0A0A}\x{0A0F}-\x{0A10}] | [\x{0A13}-\x{0A28}\x{0A2A}-\x{0A30}\x{0A32}-\x{0A33}\x{0A35}-\x{0A36}] | [\x{0A38}-\x{0A39}\x{0A59}-\x{0A5C}\x{0A5E}\x{0A72}-\x{0A74}\x{0A85}-\x{0A8B}] | [\x{0A8D}\x{0A8F}-\x{0A91}\x{0A93}-\x{0AA8}\x{0AAA}-\x{0AB0}] | [\x{0AB2}-\x{0AB3}\x{0AB5}-\x{0AB9}\x{0ABD}\x{0AE0}\x{0B05}-\x{0B0C}] | [\x{0B0F}-\x{0B10}\x{0B13}-\x{0B28}\x{0B2A}-\x{0B30}\x{0B32}-\x{0B33}] | [\x{0B36}-\x{0B39}\x{0B3D}\x{0B5C}-\x{0B5D}\x{0B5F}-\x{0B61}\x{0B85}-\x{0B8A}] | [\x{0B8E}-\x{0B90}\x{0B92}-\x{0B95}\x{0B99}-\x{0B9A}\x{0B9C}] | [\x{0B9E}-\x{0B9F}\x{0BA3}-\x{0BA4}\x{0BA8}-\x{0BAA}\x{0BAE}-\x{0BB5}] | [\x{0BB7}-\x{0BB9}\x{0C05}-\x{0C0C}\x{0C0E}-\x{0C10}\x{0C12}-\x{0C28}] | [\x{0C2A}-\x{0C33}\x{0C35}-\x{0C39}\x{0C60}-\x{0C61}\x{0C85}-\x{0C8C}] | [\x{0C8E}-\x{0C90}\x{0C92}-\x{0CA8}\x{0CAA}-\x{0CB3}\x{0CB5}-\x{0CB9}\x{0CDE}] | [\x{0CE0}-\x{0CE1}\x{0D05}-\x{0D0C}\x{0D0E}-\x{0D10}\x{0D12}-\x{0D28}] | [\x{0D2A}-\x{0D39}\x{0D60}-\x{0D61}\x{0E01}-\x{0E2E}\x{0E30}\x{0E32}-\x{0E33}] | [\x{0E40}-\x{0E45}\x{0E81}-\x{0E82}\x{0E84}\x{0E87}-\x{0E88}\x{0E8A}] | [\x{0E8D}\x{0E94}-\x{0E97}\x{0E99}-\x{0E9F}\x{0EA1}-\x{0EA3}\x{0EA5}\x{0EA7}] | [\x{0EAA}-\x{0EAB}\x{0EAD}-\x{0EAE}\x{0EB0}\x{0EB2}-\x{0EB3}\x{0EBD}] | [\x{0EC0}-\x{0EC4}\x{0F40}-\x{0F47}\x{0F49}-\x{0F69}\x{10A0}-\x{10C5}] | [\x{10D0}-\x{10F6}\x{1100}\x{1102}-\x{1103}\x{1105}-\x{1107}\x{1109}] | [\x{110B}-\x{110C}\x{110E}-\x{1112}\x{113C}\x{113E}\x{1140}\x{114C}\x{114E}] | [\x{1150}\x{1154}-\x{1155}\x{1159}\x{115F}-\x{1161}\x{1163}\x{1165}] | [\x{1167}\x{1169}\x{116D}-\x{116E}\x{1172}-\x{1173}\x{1175}\x{119E}\x{11A8}] | [\x{11AB}\x{11AE}-\x{11AF}\x{11B7}-\x{11B8}\x{11BA}\x{11BC}-\x{11C2}] | [\x{11EB}\x{11F0}\x{11F9}\x{1E00}-\x{1E9B}\x{1EA0}-\x{1EF9}\x{1F00}-\x{1F15}] | [\x{1F18}-\x{1F1D}\x{1F20}-\x{1F45}\x{1F48}-\x{1F4D}\x{1F50}-\x{1F57}] | [\x{1F59}\x{1F5B}\x{1F5D}\x{1F5F}-\x{1F7D}\x{1F80}-\x{1FB4}\x{1FB6}-\x{1FBC}] | [\x{1FBE}\x{1FC2}-\x{1FC4}\x{1FC6}-\x{1FCC}\x{1FD0}-\x{1FD3}] | [\x{1FD6}-\x{1FDB}\x{1FE0}-\x{1FEC}\x{1FF2}-\x{1FF4}\x{1FF6}-\x{1FFC}] | [\x{2126}\x{212A}-\x{212B}\x{212E}\x{2180}-\x{2182}\x{3041}-\x{3094}] | [\x{30A1}-\x{30FA}\x{3105}-\x{312C}\x{AC00}-\x{D7A3}] /x; $Extender = qr/ [\x{00B7}\x{02D0}\x{02D1}\x{0387}\x{0640}\x{0E46}\x{0EC6}\x{3005}\x{3031}-\x{3035}\x{309D}-\x{309E}\x{30FC}-\x{30FE}] /x; $Digit = qr/ [\x{0030}-\x{0039}\x{0660}-\x{0669}\x{06F0}-\x{06F9}\x{0966}-\x{096F}] | [\x{09E6}-\x{09EF}\x{0A66}-\x{0A6F}\x{0AE6}-\x{0AEF}\x{0B66}-\x{0B6F}] | [\x{0BE7}-\x{0BEF}\x{0C66}-\x{0C6F}\x{0CE6}-\x{0CEF}\x{0D66}-\x{0D6F}] | [\x{0E50}-\x{0E59}\x{0ED0}-\x{0ED9}\x{0F20}-\x{0F29}] /x; $CombiningChar = qr/ [\x{0300}-\x{0345}\x{0360}-\x{0361}\x{0483}-\x{0486}\x{0591}-\x{05A1}] | [\x{05A3}-\x{05B9}\x{05BB}-\x{05BD}\x{05BF}\x{05C1}-\x{05C2}\x{05C4}] | [\x{064B}-\x{0652}\x{0670}\x{06D6}-\x{06DC}\x{06DD}-\x{06DF}\x{06E0}-\x{06E4}] | [\x{06E7}-\x{06E8}\x{06EA}-\x{06ED}\x{0901}-\x{0903}\x{093C}] | [\x{093E}-\x{094C}\x{094D}\x{0951}-\x{0954}\x{0962}-\x{0963}\x{0981}-\x{0983}] | [\x{09BC}\x{09BE}\x{09BF}\x{09C0}-\x{09C4}\x{09C7}-\x{09C8}] | [\x{09CB}-\x{09CD}\x{09D7}\x{09E2}-\x{09E3}\x{0A02}\x{0A3C}\x{0A3E}\x{0A3F}] | [\x{0A40}-\x{0A42}\x{0A47}-\x{0A48}\x{0A4B}-\x{0A4D}\x{0A70}-\x{0A71}] | [\x{0A81}-\x{0A83}\x{0ABC}\x{0ABE}-\x{0AC5}\x{0AC7}-\x{0AC9}\x{0ACB}-\x{0ACD}] | [\x{0B01}-\x{0B03}\x{0B3C}\x{0B3E}-\x{0B43}\x{0B47}-\x{0B48}] | [\x{0B4B}-\x{0B4D}\x{0B56}-\x{0B57}\x{0B82}-\x{0B83}\x{0BBE}-\x{0BC2}] | [\x{0BC6}-\x{0BC8}\x{0BCA}-\x{0BCD}\x{0BD7}\x{0C01}-\x{0C03}\x{0C3E}-\x{0C44}] | [\x{0C46}-\x{0C48}\x{0C4A}-\x{0C4D}\x{0C55}-\x{0C56}\x{0C82}-\x{0C83}] | [\x{0CBE}-\x{0CC4}\x{0CC6}-\x{0CC8}\x{0CCA}-\x{0CCD}\x{0CD5}-\x{0CD6}] | [\x{0D02}-\x{0D03}\x{0D3E}-\x{0D43}\x{0D46}-\x{0D48}\x{0D4A}-\x{0D4D}\x{0D57}] | [\x{0E31}\x{0E34}-\x{0E3A}\x{0E47}-\x{0E4E}\x{0EB1}\x{0EB4}-\x{0EB9}] | [\x{0EBB}-\x{0EBC}\x{0EC8}-\x{0ECD}\x{0F18}-\x{0F19}\x{0F35}\x{0F37}\x{0F39}] | [\x{0F3E}\x{0F3F}\x{0F71}-\x{0F84}\x{0F86}-\x{0F8B}\x{0F90}-\x{0F95}] | [\x{0F97}\x{0F99}-\x{0FAD}\x{0FB1}-\x{0FB7}\x{0FB9}\x{20D0}-\x{20DC}\x{20E1}] | [\x{302A}-\x{302F}\x{3099}\x{309A}] /x; $Ideographic = qr/ [\x{4E00}-\x{9FA5}\x{3007}\x{3021}-\x{3029}] /x; $NameChar = qr/^ (?: $BaseChar | $Ideographic | $Digit | [._:-] | $CombiningChar | $Extender )+ $/x; PERL die $@ if $@; } } 1; ���������������������������������darwin-perl-lib/XML/SAX/PurePerl/Reader/������������������������������������������������������������000755 �000765 �000024 �00000000000 13167163507 022017� 5����������������������������������������������������������������������������������������������������ustar�00ocsinventory��������������������staff���������������������������000000 �000000 ������������������������������������������������������������������������������������������������������������������������������������������������������������������������darwin-perl-lib/XML/SAX/PurePerl/Reader.pm����������������������������������������������������������000444 �000765 �000024 �00000004755 13167163507 022366� 0����������������������������������������������������������������������������������������������������ustar�00ocsinventory��������������������staff���������������������������000000 �000000 ������������������������������������������������������������������������������������������������������������������������������������������������������������������������# $Id$ package XML::SAX::PurePerl::Reader; use strict; use XML::SAX::PurePerl::Reader::URI; use Exporter (); use vars qw(@ISA @EXPORT_OK); @ISA = qw(Exporter); @EXPORT_OK = qw( EOF BUFFER LINE COLUMN ENCODING XML_VERSION ); use constant EOF => 0; use constant BUFFER => 1; use constant LINE => 2; use constant COLUMN => 3; use constant ENCODING => 4; use constant SYSTEM_ID => 5; use constant PUBLIC_ID => 6; use constant XML_VERSION => 7; require XML::SAX::PurePerl::Reader::Stream; require XML::SAX::PurePerl::Reader::String; if ($] >= 5.007002) { require XML::SAX::PurePerl::Reader::UnicodeExt; } else { require XML::SAX::PurePerl::Reader::NoUnicodeExt; } sub new { my $class = shift; my $thing = shift; # try to figure if this $thing is a handle of some sort if (ref($thing) && UNIVERSAL::isa($thing, 'IO::Handle')) { return XML::SAX::PurePerl::Reader::Stream->new($thing)->init; } my $ioref; if (tied($thing)) { my $class = ref($thing); no strict 'refs'; $ioref = $thing if defined &{"${class}::TIEHANDLE"}; } else { eval { $ioref = *{$thing}{IO}; }; undef $@; } if ($ioref) { return XML::SAX::PurePerl::Reader::Stream->new($thing)->init; } if ($thing =~ /</) { # assume it's a string return XML::SAX::PurePerl::Reader::String->new($thing)->init; } # assume it is a uri return XML::SAX::PurePerl::Reader::URI->new($thing)->init; } sub init { my $self = shift; $self->[LINE] = 1; $self->[COLUMN] = 1; $self->read_more; return $self; } sub data { my ($self, $min_length) = (@_, 1); if (length($self->[BUFFER]) < $min_length) { $self->read_more; } return $self->[BUFFER]; } sub match { my ($self, $char) = @_; my $data = $self->data; if (substr($data, 0, 1) eq $char) { $self->move_along(1); return 1; } return 0; } sub public_id { my $self = shift; @_ and $self->[PUBLIC_ID] = shift; $self->[PUBLIC_ID]; } sub system_id { my $self = shift; @_ and $self->[SYSTEM_ID] = shift; $self->[SYSTEM_ID]; } sub line { shift->[LINE]; } sub column { shift->[COLUMN]; } sub get_encoding { my $self = shift; return $self->[ENCODING]; } sub get_xml_version { my $self = shift; return $self->[XML_VERSION]; } 1; __END__ =head1 NAME XML::Parser::PurePerl::Reader - Abstract Reader factory class =cut �������������������darwin-perl-lib/XML/SAX/PurePerl/UnicodeExt.pm������������������������������������������������������000444 �000765 �000024 �00000000561 13167163507 023222� 0����������������������������������������������������������������������������������������������������ustar�00ocsinventory��������������������staff���������������������������000000 �000000 ������������������������������������������������������������������������������������������������������������������������������������������������������������������������# $Id$ package XML::SAX::PurePerl; use strict; no warnings 'utf8'; sub chr_ref { return chr(shift); } if ($] >= 5.007002) { require Encode; Encode::define_alias( "UTF-16" => "UCS-2" ); Encode::define_alias( "UTF-16BE" => "UCS-2" ); Encode::define_alias( "UTF-16LE" => "ucs-2le" ); Encode::define_alias( "UTF16LE" => "ucs-2le" ); } 1; �����������������������������������������������������������������������������������������������������������������������������������������������darwin-perl-lib/XML/SAX/PurePerl/XMLDecl.pm���������������������������������������������������������000444 �000765 �000024 �00000006475 13167163507 022415� 0����������������������������������������������������������������������������������������������������ustar�00ocsinventory��������������������staff���������������������������000000 �000000 ������������������������������������������������������������������������������������������������������������������������������������������������������������������������# $Id$ package XML::SAX::PurePerl; use strict; use XML::SAX::PurePerl::Productions qw($S $VersionNum $EncNameStart $EncNameEnd); sub XMLDecl { my ($self, $reader) = @_; my $data = $reader->data(5); # warn("Looking for xmldecl in: $data"); if ($data =~ /^<\?xml$S/o) { $reader->move_along(5); $self->skip_whitespace($reader); # get version attribute $self->VersionInfo($reader) || $self->parser_error("XML Declaration lacks required version attribute, or version attribute does not match XML specification", $reader); if (!$self->skip_whitespace($reader)) { my $data = $reader->data(2); $data =~ /^\?>/ or $self->parser_error("Syntax error", $reader); $reader->move_along(2); return; } if ($self->EncodingDecl($reader)) { if (!$self->skip_whitespace($reader)) { my $data = $reader->data(2); $data =~ /^\?>/ or $self->parser_error("Syntax error", $reader); $reader->move_along(2); return; } } $self->SDDecl($reader); $self->skip_whitespace($reader); my $data = $reader->data(2); $data =~ /^\?>/ or $self->parser_error("Syntax error", $reader); $reader->move_along(2); } else { # warn("first 5 bytes: ", join(',', unpack("CCCCC", $data)), "\n"); # no xml decl if (!$reader->get_encoding) { $reader->set_encoding("UTF-8"); } } } sub VersionInfo { my ($self, $reader) = @_; my $data = $reader->data(11); # warn("Looking for version in $data"); $data =~ /^(version$S*=$S*(["'])($VersionNum)\2)/o or return 0; $reader->move_along(length($1)); my $vernum = $3; if ($vernum ne "1.0") { $self->parser_error("Only XML version 1.0 supported. Saw: '$vernum'", $reader); } return 1; } sub SDDecl { my ($self, $reader) = @_; my $data = $reader->data(15); $data =~ /^(standalone$S*=$S*(["'])(yes|no)\2)/o or return 0; $reader->move_along(length($1)); my $yesno = $3; if ($yesno eq 'yes') { $self->{standalone} = 1; } else { $self->{standalone} = 0; } return 1; } sub EncodingDecl { my ($self, $reader) = @_; my $data = $reader->data(12); $data =~ /^(encoding$S*=$S*(["'])($EncNameStart$EncNameEnd*)\2)/o or return 0; $reader->move_along(length($1)); my $encoding = $3; $reader->set_encoding($encoding); return 1; } sub TextDecl { my ($self, $reader) = @_; my $data = $reader->data(6); $data =~ /^<\?xml$S+/ or return; $reader->move_along(5); $self->skip_whitespace($reader); if ($self->VersionInfo($reader)) { $self->skip_whitespace($reader) || $self->parser_error("Lack of whitespace after version attribute in text declaration", $reader); } $self->EncodingDecl($reader) || $self->parser_error("Encoding declaration missing from external entity text declaration", $reader); $self->skip_whitespace($reader); $data = $reader->data(2); $data =~ /^\?>/ or $self->parser_error("Syntax error", $reader); return 1; } 1; ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������darwin-perl-lib/XML/SAX/PurePerl/Reader/NoUnicodeExt.pm���������������������������������������������000444 �000765 �000024 �00000001113 13167163507 024713� 0����������������������������������������������������������������������������������������������������ustar�00ocsinventory��������������������staff���������������������������000000 �000000 ������������������������������������������������������������������������������������������������������������������������������������������������������������������������# $Id$ package XML::SAX::PurePerl::Reader; use strict; sub set_raw_stream { # no-op } sub switch_encoding_stream { my ($fh, $encoding) = @_; throw XML::SAX::Exception::Parse ( Message => "Only ASCII encoding allowed without perl 5.7.2 or higher. You tried: $encoding", ) if $encoding !~ /(ASCII|UTF\-?8)/i; } sub switch_encoding_string { my (undef, $encoding) = @_; throw XML::SAX::Exception::Parse ( Message => "Only ASCII encoding allowed without perl 5.7.2 or higher. You tried: $encoding", ) if $encoding !~ /(ASCII|UTF\-?8)/i; } 1; �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������darwin-perl-lib/XML/SAX/PurePerl/Reader/Stream.pm���������������������������������������������������000444 �000765 �000024 �00000003411 13167163507 023605� 0����������������������������������������������������������������������������������������������������ustar�00ocsinventory��������������������staff���������������������������000000 �000000 ������������������������������������������������������������������������������������������������������������������������������������������������������������������������# $Id$ package XML::SAX::PurePerl::Reader::Stream; use strict; use vars qw(@ISA); use XML::SAX::PurePerl::Reader qw( EOF BUFFER LINE COLUMN ENCODING XML_VERSION ); use XML::SAX::Exception; @ISA = ('XML::SAX::PurePerl::Reader'); # subclassed by adding 1 to last element use constant FH => 8; use constant BUFFER_SIZE => 4096; sub new { my $class = shift; my $ioref = shift; XML::SAX::PurePerl::Reader::set_raw_stream($ioref); my @parts; @parts[FH, LINE, COLUMN, BUFFER, EOF, XML_VERSION] = ($ioref, 1, 0, '', 0, '1.0'); return bless \@parts, $class; } sub read_more { my $self = shift; my $buf; my $bytesread = read($self->[FH], $buf, BUFFER_SIZE); if ($bytesread) { $self->[BUFFER] .= $buf; return 1; } elsif (defined($bytesread)) { $self->[EOF]++; return 0; } else { throw XML::SAX::Exception::Parse( Message => "Error reading from filehandle: $!", ); } } sub move_along { my $self = shift; my $discarded = substr($self->[BUFFER], 0, $_[0], ''); # Wish I could skip this lot - tells us where we are in the file my $lines = $discarded =~ tr/\n//; $self->[LINE] += $lines; if ($lines) { $discarded =~ /\n([^\n]*)$/; $self->[COLUMN] = length($1); } else { $self->[COLUMN] += $_[0]; } } sub set_encoding { my $self = shift; my ($encoding) = @_; # warn("set encoding to: $encoding\n"); XML::SAX::PurePerl::Reader::switch_encoding_stream($self->[FH], $encoding); XML::SAX::PurePerl::Reader::switch_encoding_string($self->[BUFFER], $encoding); $self->[ENCODING] = $encoding; } sub bytepos { my $self = shift; tell($self->[FH]); } 1; �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������darwin-perl-lib/XML/SAX/PurePerl/Reader/String.pm���������������������������������������������������000444 �000765 �000024 �00000003233 13167163507 023622� 0����������������������������������������������������������������������������������������������������ustar�00ocsinventory��������������������staff���������������������������000000 �000000 ������������������������������������������������������������������������������������������������������������������������������������������������������������������������# $Id$ package XML::SAX::PurePerl::Reader::String; use strict; use vars qw(@ISA); use XML::SAX::PurePerl::Reader qw( LINE COLUMN BUFFER ENCODING EOF ); @ISA = ('XML::SAX::PurePerl::Reader'); use constant DISCARDED => 8; use constant STRING => 9; use constant USED => 10; use constant CHUNK_SIZE => 2048; sub new { my $class = shift; my $string = shift; my @parts; @parts[BUFFER, EOF, LINE, COLUMN, DISCARDED, STRING, USED] = ('', 0, 1, 0, 0, $string, 0); return bless \@parts, $class; } sub read_more () { my $self = shift; if ($self->[USED] >= length($self->[STRING])) { $self->[EOF]++; return 0; } my $bytes = CHUNK_SIZE; if ($bytes > (length($self->[STRING]) - $self->[USED])) { $bytes = (length($self->[STRING]) - $self->[USED]); } $self->[BUFFER] .= substr($self->[STRING], $self->[USED], $bytes); $self->[USED] += $bytes; return 1; } sub move_along { my($self, $bytes) = @_; my $discarded = substr($self->[BUFFER], 0, $bytes, ''); $self->[DISCARDED] += length($discarded); # Wish I could skip this lot - tells us where we are in the file my $lines = $discarded =~ tr/\n//; $self->[LINE] += $lines; if ($lines) { $discarded =~ /\n([^\n]*)$/; $self->[COLUMN] = length($1); } else { $self->[COLUMN] += $_[0]; } } sub set_encoding { my $self = shift; my ($encoding) = @_; XML::SAX::PurePerl::Reader::switch_encoding_string($self->[BUFFER], $encoding, "utf-8"); $self->[ENCODING] = $encoding; } sub bytepos { my $self = shift; $self->[DISCARDED]; } 1; ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������darwin-perl-lib/XML/SAX/PurePerl/Reader/UnicodeExt.pm�����������������������������������������������000444 �000765 �000024 �00000000506 13167163507 024423� 0����������������������������������������������������������������������������������������������������ustar�00ocsinventory��������������������staff���������������������������000000 �000000 ������������������������������������������������������������������������������������������������������������������������������������������������������������������������# $Id$ package XML::SAX::PurePerl::Reader; use strict; use Encode (); sub set_raw_stream { my ($fh) = @_; binmode($fh, ":bytes"); } sub switch_encoding_stream { my ($fh, $encoding) = @_; binmode($fh, ":encoding($encoding)"); } sub switch_encoding_string { $_[0] = Encode::decode($_[1], $_[0]); } 1; ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������darwin-perl-lib/XML/SAX/PurePerl/Reader/URI.pm������������������������������������������������������000444 �000765 �000024 �00000002666 13167163507 023024� 0����������������������������������������������������������������������������������������������������ustar�00ocsinventory��������������������staff���������������������������000000 �000000 ������������������������������������������������������������������������������������������������������������������������������������������������������������������������# $Id$ package XML::SAX::PurePerl::Reader::URI; use strict; use XML::SAX::PurePerl::Reader; use File::Temp qw(tempfile); use Symbol; ## NOTE: This is *not* a subclass of Reader. It just returns Stream or String ## Reader objects depending on what it's capabilities are. sub new { my $class = shift; my $uri = shift; # request the URI if (-e $uri && -f _) { my $fh = gensym; open($fh, $uri) || die "Cannot open file $uri : $!"; return XML::SAX::PurePerl::Reader::Stream->new($fh); } elsif ($uri =~ /^file:(.*)$/ && -e $1 && -f _) { my $file = $1; my $fh = gensym; open($fh, $file) || die "Cannot open file $file : $!"; return XML::SAX::PurePerl::Reader::Stream->new($fh); } else { # request URI, return String reader require LWP::UserAgent; my $ua = LWP::UserAgent->new; $ua->agent("Perl/XML/SAX/PurePerl/1.0 " . $ua->agent); my $req = HTTP::Request->new(GET => $uri); my $fh = tempfile(); my $callback = sub { my ($data, $response, $protocol) = @_; print $fh $data; }; my $res = $ua->request($req, $callback, 4096); if ($res->is_success) { seek($fh, 0, 0); return XML::SAX::PurePerl::Reader::Stream->new($fh); } else { die "LWP Request Failed"; } } } 1; ��������������������������������������������������������������������������darwin-perl-lib/XML/Entities/Data.pm����������������������������������������������������������������000444 �000765 �000024 �00000151264 13167163507 021426� 0����������������������������������������������������������������������������������������������������ustar�00ocsinventory��������������������staff���������������������������000000 �000000 ������������������������������������������������������������������������������������������������������������������������������������������������������������������������package XML::Entities::Data; use strict; my @names; # ISOBOX push @names, 'isobox'; { my $rv; sub isobox { # Return cached value if there is one. if ($rv) { return $rv } return $rv = { 'boxDL' => chr(0x02557), 'boxDl' => chr(0x02556), 'boxdL' => chr(0x02555), 'boxdl' => chr(0x02510), 'boxDR' => chr(0x02554), 'boxDr' => chr(0x02553), 'boxdR' => chr(0x02552), 'boxdr' => chr(0x0250C), 'boxH' => chr(0x02550), 'boxh' => chr(0x02500), 'boxHD' => chr(0x02566), 'boxHd' => chr(0x02564), 'boxhD' => chr(0x02565), 'boxhd' => chr(0x0252C), 'boxHU' => chr(0x02569), 'boxHu' => chr(0x02567), 'boxhU' => chr(0x02568), 'boxhu' => chr(0x02534), 'boxUL' => chr(0x0255D), 'boxUl' => chr(0x0255C), 'boxuL' => chr(0x0255B), 'boxul' => chr(0x02518), 'boxUR' => chr(0x0255A), 'boxUr' => chr(0x02559), 'boxuR' => chr(0x02558), 'boxur' => chr(0x02514), 'boxV' => chr(0x02551), 'boxv' => chr(0x02502), 'boxVH' => chr(0x0256C), 'boxVh' => chr(0x0256B), 'boxvH' => chr(0x0256A), 'boxvh' => chr(0x0253C), 'boxVL' => chr(0x02563), 'boxVl' => chr(0x02562), 'boxvL' => chr(0x02561), 'boxvl' => chr(0x02524), 'boxVR' => chr(0x02560), 'boxVr' => chr(0x0255F), 'boxvR' => chr(0x0255E), 'boxvr' => chr(0x0251C), } }} # ISOCYR1 push @names, 'isocyr1'; { my $rv; sub isocyr1 { # Return cached value if there is one. if ($rv) { return $rv } return $rv = { 'Acy' => chr(0x00410), 'acy' => chr(0x00430), 'Bcy' => chr(0x00411), 'bcy' => chr(0x00431), 'CHcy' => chr(0x00427), 'chcy' => chr(0x00447), 'Dcy' => chr(0x00414), 'dcy' => chr(0x00434), 'Ecy' => chr(0x0042D), 'ecy' => chr(0x0044D), 'Fcy' => chr(0x00424), 'fcy' => chr(0x00444), 'Gcy' => chr(0x00413), 'gcy' => chr(0x00433), 'HARDcy' => chr(0x0042A), 'hardcy' => chr(0x0044A), 'Icy' => chr(0x00418), 'icy' => chr(0x00438), 'IEcy' => chr(0x00415), 'iecy' => chr(0x00435), 'IOcy' => chr(0x00401), 'iocy' => chr(0x00451), 'Jcy' => chr(0x00419), 'jcy' => chr(0x00439), 'Kcy' => chr(0x0041A), 'kcy' => chr(0x0043A), 'KHcy' => chr(0x00425), 'khcy' => chr(0x00445), 'Lcy' => chr(0x0041B), 'lcy' => chr(0x0043B), 'Mcy' => chr(0x0041C), 'mcy' => chr(0x0043C), 'Ncy' => chr(0x0041D), 'ncy' => chr(0x0043D), 'numero' => chr(0x02116), 'Ocy' => chr(0x0041E), 'ocy' => chr(0x0043E), 'Pcy' => chr(0x0041F), 'pcy' => chr(0x0043F), 'Rcy' => chr(0x00420), 'rcy' => chr(0x00440), 'Scy' => chr(0x00421), 'scy' => chr(0x00441), 'SHCHcy' => chr(0x00429), 'shchcy' => chr(0x00449), 'SHcy' => chr(0x00428), 'shcy' => chr(0x00448), 'SOFTcy' => chr(0x0042C), 'softcy' => chr(0x0044C), 'Tcy' => chr(0x00422), 'tcy' => chr(0x00442), 'TScy' => chr(0x00426), 'tscy' => chr(0x00446), 'Ucy' => chr(0x00423), 'ucy' => chr(0x00443), 'Vcy' => chr(0x00412), 'vcy' => chr(0x00432), 'YAcy' => chr(0x0042F), 'yacy' => chr(0x0044F), 'Ycy' => chr(0x0042B), 'ycy' => chr(0x0044B), 'YUcy' => chr(0x0042E), 'yucy' => chr(0x0044E), 'Zcy' => chr(0x00417), 'zcy' => chr(0x00437), 'ZHcy' => chr(0x00416), 'zhcy' => chr(0x00436), } }} # ISOCYR2 push @names, 'isocyr2'; { my $rv; sub isocyr2 { # Return cached value if there is one. if ($rv) { return $rv } return $rv = { 'DJcy' => chr(0x00402), 'djcy' => chr(0x00452), 'DScy' => chr(0x00405), 'dscy' => chr(0x00455), 'DZcy' => chr(0x0040F), 'dzcy' => chr(0x0045F), 'GJcy' => chr(0x00403), 'gjcy' => chr(0x00453), 'Iukcy' => chr(0x00406), 'iukcy' => chr(0x00456), 'Jsercy' => chr(0x00408), 'jsercy' => chr(0x00458), 'Jukcy' => chr(0x00404), 'jukcy' => chr(0x00454), 'KJcy' => chr(0x0040C), 'kjcy' => chr(0x0045C), 'LJcy' => chr(0x00409), 'ljcy' => chr(0x00459), 'NJcy' => chr(0x0040A), 'njcy' => chr(0x0045A), 'TSHcy' => chr(0x0040B), 'tshcy' => chr(0x0045B), 'Ubrcy' => chr(0x0040E), 'ubrcy' => chr(0x0045E), 'YIcy' => chr(0x00407), 'yicy' => chr(0x00457), } }} # ISODIA push @names, 'isodia'; { my $rv; sub isodia { # Return cached value if there is one. if ($rv) { return $rv } return $rv = { 'acute' => chr(0x000B4), 'breve' => chr(0x002D8), 'caron' => chr(0x002C7), 'cedil' => chr(0x000B8), 'circ' => chr(0x002C6), 'dblac' => chr(0x002DD), 'die' => chr(0x000A8), 'dot' => chr(0x002D9), 'grave' => chr(0x00060), 'macr' => chr(0x000AF), 'ogon' => chr(0x002DB), 'ring' => chr(0x002DA), 'tilde' => chr(0x002DC), 'uml' => chr(0x000A8), } }} # ISOLAT1 push @names, 'isolat1'; { my $rv; sub isolat1 { # Return cached value if there is one. if ($rv) { return $rv } return $rv = { 'Aacute' => chr(0x000C1), 'aacute' => chr(0x000E1), 'Acirc' => chr(0x000C2), 'acirc' => chr(0x000E2), 'AElig' => chr(0x000C6), 'aelig' => chr(0x000E6), 'Agrave' => chr(0x000C0), 'agrave' => chr(0x000E0), 'Aring' => chr(0x000C5), 'aring' => chr(0x000E5), 'Atilde' => chr(0x000C3), 'atilde' => chr(0x000E3), 'Auml' => chr(0x000C4), 'auml' => chr(0x000E4), 'Ccedil' => chr(0x000C7), 'ccedil' => chr(0x000E7), 'Eacute' => chr(0x000C9), 'eacute' => chr(0x000E9), 'Ecirc' => chr(0x000CA), 'ecirc' => chr(0x000EA), 'Egrave' => chr(0x000C8), 'egrave' => chr(0x000E8), 'ETH' => chr(0x000D0), 'eth' => chr(0x000F0), 'Euml' => chr(0x000CB), 'euml' => chr(0x000EB), 'Iacute' => chr(0x000CD), 'iacute' => chr(0x000ED), 'Icirc' => chr(0x000CE), 'icirc' => chr(0x000EE), 'Igrave' => chr(0x000CC), 'igrave' => chr(0x000EC), 'Iuml' => chr(0x000CF), 'iuml' => chr(0x000EF), 'Ntilde' => chr(0x000D1), 'ntilde' => chr(0x000F1), 'Oacute' => chr(0x000D3), 'oacute' => chr(0x000F3), 'Ocirc' => chr(0x000D4), 'ocirc' => chr(0x000F4), 'Ograve' => chr(0x000D2), 'ograve' => chr(0x000F2), 'Oslash' => chr(0x000D8), 'oslash' => chr(0x000F8), 'Otilde' => chr(0x000D5), 'otilde' => chr(0x000F5), 'Ouml' => chr(0x000D6), 'ouml' => chr(0x000F6), 'szlig' => chr(0x000DF), 'THORN' => chr(0x000DE), 'thorn' => chr(0x000FE), 'Uacute' => chr(0x000DA), 'uacute' => chr(0x000FA), 'Ucirc' => chr(0x000DB), 'ucirc' => chr(0x000FB), 'Ugrave' => chr(0x000D9), 'ugrave' => chr(0x000F9), 'Uuml' => chr(0x000DC), 'uuml' => chr(0x000FC), 'Yacute' => chr(0x000DD), 'yacute' => chr(0x000FD), 'yuml' => chr(0x000FF), } }} # ISOLAT2 push @names, 'isolat2'; { my $rv; sub isolat2 { # Return cached value if there is one. if ($rv) { return $rv } return $rv = { 'Abreve' => chr(0x00102), 'abreve' => chr(0x00103), 'Amacr' => chr(0x00100), 'amacr' => chr(0x00101), 'Aogon' => chr(0x00104), 'aogon' => chr(0x00105), 'Cacute' => chr(0x00106), 'cacute' => chr(0x00107), 'Ccaron' => chr(0x0010C), 'ccaron' => chr(0x0010D), 'Ccirc' => chr(0x00108), 'ccirc' => chr(0x00109), 'Cdot' => chr(0x0010A), 'cdot' => chr(0x0010B), 'Dcaron' => chr(0x0010E), 'dcaron' => chr(0x0010F), 'Dstrok' => chr(0x00110), 'dstrok' => chr(0x00111), 'Ecaron' => chr(0x0011A), 'ecaron' => chr(0x0011B), 'Edot' => chr(0x00116), 'edot' => chr(0x00117), 'Emacr' => chr(0x00112), 'emacr' => chr(0x00113), 'ENG' => chr(0x0014A), 'eng' => chr(0x0014B), 'Eogon' => chr(0x00118), 'eogon' => chr(0x00119), 'gacute' => chr(0x001F5), 'Gbreve' => chr(0x0011E), 'gbreve' => chr(0x0011F), 'Gcedil' => chr(0x00122), 'Gcirc' => chr(0x0011C), 'gcirc' => chr(0x0011D), 'Gdot' => chr(0x00120), 'gdot' => chr(0x00121), 'Hcirc' => chr(0x00124), 'hcirc' => chr(0x00125), 'Hstrok' => chr(0x00126), 'hstrok' => chr(0x00127), 'Idot' => chr(0x00130), 'IJlig' => chr(0x00132), 'ijlig' => chr(0x00133), 'Imacr' => chr(0x0012A), 'imacr' => chr(0x0012B), 'inodot' => chr(0x00131), 'Iogon' => chr(0x0012E), 'iogon' => chr(0x0012F), 'Itilde' => chr(0x00128), 'itilde' => chr(0x00129), 'Jcirc' => chr(0x00134), 'jcirc' => chr(0x00135), 'Kcedil' => chr(0x00136), 'kcedil' => chr(0x00137), 'kgreen' => chr(0x00138), 'Lacute' => chr(0x00139), 'lacute' => chr(0x0013A), 'Lcaron' => chr(0x0013D), 'lcaron' => chr(0x0013E), 'Lcedil' => chr(0x0013B), 'lcedil' => chr(0x0013C), 'Lmidot' => chr(0x0013F), 'lmidot' => chr(0x00140), 'Lstrok' => chr(0x00141), 'lstrok' => chr(0x00142), 'Nacute' => chr(0x00143), 'nacute' => chr(0x00144), 'napos' => chr(0x00149), 'Ncaron' => chr(0x00147), 'ncaron' => chr(0x00148), 'Ncedil' => chr(0x00145), 'ncedil' => chr(0x00146), 'Odblac' => chr(0x00150), 'odblac' => chr(0x00151), 'OElig' => chr(0x00152), 'oelig' => chr(0x00153), 'Omacr' => chr(0x0014C), 'omacr' => chr(0x0014D), 'Racute' => chr(0x00154), 'racute' => chr(0x00155), 'Rcaron' => chr(0x00158), 'rcaron' => chr(0x00159), 'Rcedil' => chr(0x00156), 'rcedil' => chr(0x00157), 'Sacute' => chr(0x0015A), 'sacute' => chr(0x0015B), 'Scaron' => chr(0x00160), 'scaron' => chr(0x00161), 'Scedil' => chr(0x0015E), 'scedil' => chr(0x0015F), 'Scirc' => chr(0x0015C), 'scirc' => chr(0x0015D), 'Tcaron' => chr(0x00164), 'tcaron' => chr(0x00165), 'Tcedil' => chr(0x00162), 'tcedil' => chr(0x00163), 'Tstrok' => chr(0x00166), 'tstrok' => chr(0x00167), 'Ubreve' => chr(0x0016C), 'ubreve' => chr(0x0016D), 'Udblac' => chr(0x00170), 'udblac' => chr(0x00171), 'Umacr' => chr(0x0016A), 'umacr' => chr(0x0016B), 'Uogon' => chr(0x00172), 'uogon' => chr(0x00173), 'Uring' => chr(0x0016E), 'uring' => chr(0x0016F), 'Utilde' => chr(0x00168), 'utilde' => chr(0x00169), 'Wcirc' => chr(0x00174), 'wcirc' => chr(0x00175), 'Ycirc' => chr(0x00176), 'ycirc' => chr(0x00177), 'Yuml' => chr(0x00178), 'Zacute' => chr(0x00179), 'zacute' => chr(0x0017A), 'Zcaron' => chr(0x0017D), 'zcaron' => chr(0x0017E), 'Zdot' => chr(0x0017B), 'zdot' => chr(0x0017C), } }} # ISONUM push @names, 'isonum'; { my $rv; sub isonum { # Return cached value if there is one. if ($rv) { return $rv } return $rv = { 'amp' => chr(38), 'apos' => chr(0x00027), 'ast' => chr(0x0002A), 'brvbar' => chr(0x000A6), 'bsol' => chr(0x0005C), 'cent' => chr(0x000A2), 'colon' => chr(0x0003A), 'comma' => chr(0x0002C), 'commat' => chr(0x00040), 'copy' => chr(0x000A9), 'curren' => chr(0x000A4), 'darr' => chr(0x02193), 'deg' => chr(0x000B0), 'divide' => chr(0x000F7), 'dollar' => chr(0x00024), 'equals' => chr(0x0003D), 'excl' => chr(0x00021), 'frac12' => chr(0x000BD), 'frac14' => chr(0x000BC), 'frac18' => chr(0x0215B), 'frac34' => chr(0x000BE), 'frac38' => chr(0x0215C), 'frac58' => chr(0x0215D), 'frac78' => chr(0x0215E), 'gt' => chr(0x0003E), 'half' => chr(0x000BD), 'horbar' => chr(0x02015), 'hyphen' => chr(0x02010), 'iexcl' => chr(0x000A1), 'iquest' => chr(0x000BF), 'laquo' => chr(0x000AB), 'larr' => chr(0x02190), 'lcub' => chr(0x0007B), 'ldquo' => chr(0x0201C), 'lowbar' => chr(0x0005F), 'lpar' => chr(0x00028), 'lsqb' => chr(0x0005B), 'lsquo' => chr(0x02018), 'lt' => chr(60), 'micro' => chr(0x000B5), 'middot' => chr(0x000B7), 'nbsp' => chr(0x000A0), 'not' => chr(0x000AC), 'num' => chr(0x00023), 'ohm' => chr(0x02126), 'ordf' => chr(0x000AA), 'ordm' => chr(0x000BA), 'para' => chr(0x000B6), 'percnt' => chr(0x00025), 'period' => chr(0x0002E), 'plus' => chr(0x0002B), 'plusmn' => chr(0x000B1), 'pound' => chr(0x000A3), 'quest' => chr(0x0003F), 'quot' => chr(0x00022), 'raquo' => chr(0x000BB), 'rarr' => chr(0x02192), 'rcub' => chr(0x0007D), 'rdquo' => chr(0x0201D), 'reg' => chr(0x000AE), 'rpar' => chr(0x00029), 'rsqb' => chr(0x0005D), 'rsquo' => chr(0x02019), 'sect' => chr(0x000A7), 'semi' => chr(0x0003B), 'shy' => chr(0x000AD), 'sol' => chr(0x0002F), 'sung' => chr(0x0266A), 'sup1' => chr(0x000B9), 'sup2' => chr(0x000B2), 'sup3' => chr(0x000B3), 'times' => chr(0x000D7), 'trade' => chr(0x02122), 'uarr' => chr(0x02191), 'verbar' => chr(0x0007C), 'yen' => chr(0x000A5), } }} # ISOPUB push @names, 'isopub'; { my $rv; sub isopub { # Return cached value if there is one. if ($rv) { return $rv } return $rv = { 'blank' => chr(0x02423), 'blk12' => chr(0x02592), 'blk14' => chr(0x02591), 'blk34' => chr(0x02593), 'block' => chr(0x02588), 'bull' => chr(0x02022), 'caret' => chr(0x02041), 'check' => chr(0x02713), 'cir' => chr(0x025CB), 'clubs' => chr(0x02663), 'copysr' => chr(0x02117), 'cross' => chr(0x02717), 'Dagger' => chr(0x02021), 'dagger' => chr(0x02020), 'dash' => chr(0x02010), 'diams' => chr(0x02666), 'dlcrop' => chr(0x0230D), 'drcrop' => chr(0x0230C), 'dtri' => chr(0x025BF), 'dtrif' => chr(0x025BE), 'emsp' => chr(0x02003), 'emsp13' => chr(0x02004), 'emsp14' => chr(0x02005), 'ensp' => chr(0x02002), 'female' => chr(0x02640), 'ffilig' => chr(0x0FB03), 'fflig' => chr(0x0FB00), 'ffllig' => chr(0x0FB04), 'filig' => chr(0x0FB01), 'flat' => chr(0x0266D), 'fllig' => chr(0x0FB02), 'frac13' => chr(0x02153), 'frac15' => chr(0x02155), 'frac16' => chr(0x02159), 'frac23' => chr(0x02154), 'frac25' => chr(0x02156), 'frac35' => chr(0x02157), 'frac45' => chr(0x02158), 'frac56' => chr(0x0215A), 'hairsp' => chr(0x0200A), 'hearts' => chr(0x02665), 'hellip' => chr(0x02026), 'hybull' => chr(0x02043), 'incare' => chr(0x02105), 'ldquor' => chr(0x0201E), 'lhblk' => chr(0x02584), 'loz' => chr(0x025CA), 'lozf' => chr(0x029EB), 'lsquor' => chr(0x0201A), 'ltri' => chr(0x025C3), 'ltrif' => chr(0x025C2), 'male' => chr(0x02642), 'malt' => chr(0x02720), 'marker' => chr(0x025AE), 'mdash' => chr(0x02014), 'mldr' => chr(0x02026), 'natur' => chr(0x0266E), 'ndash' => chr(0x02013), 'nldr' => chr(0x02025), 'numsp' => chr(0x02007), 'phone' => chr(0x0260E), 'puncsp' => chr(0x02008), 'rdquor' => chr(0x0201D), 'rect' => chr(0x025AD), 'rsquor' => chr(0x02019), 'rtri' => chr(0x025B9), 'rtrif' => chr(0x025B8), 'rx' => chr(0x0211E), 'sext' => chr(0x02736), 'sharp' => chr(0x0266F), 'spades' => chr(0x02660), 'squ' => chr(0x025A1), 'squf' => chr(0x025AA), 'star' => chr(0x02606), 'starf' => chr(0x02605), 'target' => chr(0x02316), 'telrec' => chr(0x02315), 'thinsp' => chr(0x02009), 'uhblk' => chr(0x02580), 'ulcrop' => chr(0x0230F), 'urcrop' => chr(0x0230E), 'utri' => chr(0x025B5), 'utrif' => chr(0x025B4), 'vellip' => chr(0x022EE), } }} # ISOAMSA push @names, 'isoamsa'; { my $rv; sub isoamsa { # Return cached value if there is one. if ($rv) { return $rv } return $rv = { 'angzarr' => chr(0x0237C), 'cirmid' => chr(0x02AEF), 'cudarrl' => chr(0x02938), 'cudarrr' => chr(0x02935), 'cularr' => chr(0x021B6), 'cularrp' => chr(0x0293D), 'curarr' => chr(0x021B7), 'curarrm' => chr(0x0293C), 'Darr' => chr(0x021A1), 'dArr' => chr(0x021D3), 'ddarr' => chr(0x021CA), 'DDotrahd' => chr(0x02911), 'dfisht' => chr(0x0297F), 'dHar' => chr(0x02965), 'dharl' => chr(0x021C3), 'dharr' => chr(0x021C2), 'duarr' => chr(0x021F5), 'duhar' => chr(0x0296F), 'dzigrarr' => chr(0x027FF), 'erarr' => chr(0x02971), 'hArr' => chr(0x021D4), 'harr' => chr(0x02194), 'harrcir' => chr(0x02948), 'harrw' => chr(0x021AD), 'hoarr' => chr(0x021FF), 'imof' => chr(0x022B7), 'lAarr' => chr(0x021DA), 'Larr' => chr(0x0219E), 'larrbfs' => chr(0x0291F), 'larrfs' => chr(0x0291D), 'larrhk' => chr(0x021A9), 'larrlp' => chr(0x021AB), 'larrpl' => chr(0x02939), 'larrsim' => chr(0x02973), 'larrtl' => chr(0x021A2), 'lAtail' => chr(0x0291B), 'latail' => chr(0x02919), 'lBarr' => chr(0x0290E), 'lbarr' => chr(0x0290C), 'ldca' => chr(0x02936), 'ldrdhar' => chr(0x02967), 'ldrushar' => chr(0x0294B), 'ldsh' => chr(0x021B2), 'lfisht' => chr(0x0297C), 'lHar' => chr(0x02962), 'lhard' => chr(0x021BD), 'lharu' => chr(0x021BC), 'lharul' => chr(0x0296A), 'llarr' => chr(0x021C7), 'llhard' => chr(0x0296B), 'loarr' => chr(0x021FD), 'lrarr' => chr(0x021C6), 'lrhar' => chr(0x021CB), 'lrhard' => chr(0x0296D), 'lsh' => chr(0x021B0), 'lurdshar' => chr(0x0294A), 'luruhar' => chr(0x02966), 'Map' => chr(0x02905), 'map' => chr(0x021A6), 'midcir' => chr(0x02AF0), 'mumap' => chr(0x022B8), 'nearhk' => chr(0x02924), 'neArr' => chr(0x021D7), 'nearr' => chr(0x02197), 'nesear' => chr(0x02928), 'nhArr' => chr(0x021CE), 'nharr' => chr(0x021AE), 'nlArr' => chr(0x021CD), 'nlarr' => chr(0x0219A), 'nrArr' => chr(0x021CF), 'nrarr' => chr(0x0219B), 'nrarrc' => chr(0x02933).chr(0x00338), 'nrarrw' => chr(0x0219D).chr(0x00338), 'nvHarr' => chr(0x02904), 'nvlArr' => chr(0x02902), 'nvrArr' => chr(0x02903), 'nwarhk' => chr(0x02923), 'nwArr' => chr(0x021D6), 'nwarr' => chr(0x02196), 'nwnear' => chr(0x02927), 'olarr' => chr(0x021BA), 'orarr' => chr(0x021BB), 'origof' => chr(0x022B6), 'rAarr' => chr(0x021DB), 'Rarr' => chr(0x021A0), 'rarrap' => chr(0x02975), 'rarrbfs' => chr(0x02920), 'rarrc' => chr(0x02933), 'rarrfs' => chr(0x0291E), 'rarrhk' => chr(0x021AA), 'rarrlp' => chr(0x021AC), 'rarrpl' => chr(0x02945), 'rarrsim' => chr(0x02974), 'Rarrtl' => chr(0x02916), 'rarrtl' => chr(0x021A3), 'rarrw' => chr(0x0219D), 'rAtail' => chr(0x0291C), 'ratail' => chr(0x0291A), 'RBarr' => chr(0x02910), 'rBarr' => chr(0x0290F), 'rbarr' => chr(0x0290D), 'rdca' => chr(0x02937), 'rdldhar' => chr(0x02969), 'rdsh' => chr(0x021B3), 'rfisht' => chr(0x0297D), 'rHar' => chr(0x02964), 'rhard' => chr(0x021C1), 'rharu' => chr(0x021C0), 'rharul' => chr(0x0296C), 'rlarr' => chr(0x021C4), 'rlhar' => chr(0x021CC), 'roarr' => chr(0x021FE), 'rrarr' => chr(0x021C9), 'rsh' => chr(0x021B1), 'ruluhar' => chr(0x02968), 'searhk' => chr(0x02925), 'seArr' => chr(0x021D8), 'searr' => chr(0x02198), 'seswar' => chr(0x02929), 'simrarr' => chr(0x02972), 'slarr' => chr(0x02190), 'srarr' => chr(0x02192), 'swarhk' => chr(0x02926), 'swArr' => chr(0x021D9), 'swarr' => chr(0x02199), 'swnwar' => chr(0x0292A), 'Uarr' => chr(0x0219F), 'uArr' => chr(0x021D1), 'Uarrocir' => chr(0x02949), 'udarr' => chr(0x021C5), 'udhar' => chr(0x0296E), 'ufisht' => chr(0x0297E), 'uHar' => chr(0x02963), 'uharl' => chr(0x021BF), 'uharr' => chr(0x021BE), 'uuarr' => chr(0x021C8), 'vArr' => chr(0x021D5), 'varr' => chr(0x02195), 'xhArr' => chr(0x027FA), 'xharr' => chr(0x027F7), 'xlArr' => chr(0x027F8), 'xlarr' => chr(0x027F5), 'xmap' => chr(0x027FC), 'xrArr' => chr(0x027F9), 'xrarr' => chr(0x027F6), 'zigrarr' => chr(0x021DD), } }} # ISOAMSB push @names, 'isoamsb'; { my $rv; sub isoamsb { # Return cached value if there is one. if ($rv) { return $rv } return $rv = { 'ac' => chr(0x0223E), 'acE' => chr(0x0223E).chr(0x00333), 'amalg' => chr(0x02A3F), 'barvee' => chr(0x022BD), 'Barwed' => chr(0x02306), 'barwed' => chr(0x02305), 'bsolb' => chr(0x029C5), 'Cap' => chr(0x022D2), 'capand' => chr(0x02A44), 'capbrcup' => chr(0x02A49), 'capcap' => chr(0x02A4B), 'capcup' => chr(0x02A47), 'capdot' => chr(0x02A40), 'caps' => chr(0x02229).chr(0x0FE00), 'ccaps' => chr(0x02A4D), 'ccups' => chr(0x02A4C), 'ccupssm' => chr(0x02A50), 'coprod' => chr(0x02210), 'Cup' => chr(0x022D3), 'cupbrcap' => chr(0x02A48), 'cupcap' => chr(0x02A46), 'cupcup' => chr(0x02A4A), 'cupdot' => chr(0x0228D), 'cupor' => chr(0x02A45), 'cups' => chr(0x0222A).chr(0x0FE00), 'cuvee' => chr(0x022CE), 'cuwed' => chr(0x022CF), 'Dagger' => chr(0x02021), 'dagger' => chr(0x02020), 'diam' => chr(0x022C4), 'divonx' => chr(0x022C7), 'eplus' => chr(0x02A71), 'hercon' => chr(0x022B9), 'intcal' => chr(0x022BA), 'iprod' => chr(0x02A3C), 'loplus' => chr(0x02A2D), 'lotimes' => chr(0x02A34), 'lthree' => chr(0x022CB), 'ltimes' => chr(0x022C9), 'midast' => chr(0x0002A), 'minusb' => chr(0x0229F), 'minusd' => chr(0x02238), 'minusdu' => chr(0x02A2A), 'ncap' => chr(0x02A43), 'ncup' => chr(0x02A42), 'oast' => chr(0x0229B), 'ocir' => chr(0x0229A), 'odash' => chr(0x0229D), 'odiv' => chr(0x02A38), 'odot' => chr(0x02299), 'odsold' => chr(0x029BC), 'ofcir' => chr(0x029BF), 'ogt' => chr(0x029C1), 'ohbar' => chr(0x029B5), 'olcir' => chr(0x029BE), 'olt' => chr(0x029C0), 'omid' => chr(0x029B6), 'ominus' => chr(0x02296), 'opar' => chr(0x029B7), 'operp' => chr(0x029B9), 'oplus' => chr(0x02295), 'osol' => chr(0x02298), 'Otimes' => chr(0x02A37), 'otimes' => chr(0x02297), 'otimesas' => chr(0x02A36), 'ovbar' => chr(0x0233D), 'plusacir' => chr(0x02A23), 'plusb' => chr(0x0229E), 'pluscir' => chr(0x02A22), 'plusdo' => chr(0x02214), 'plusdu' => chr(0x02A25), 'pluse' => chr(0x02A72), 'plussim' => chr(0x02A26), 'plustwo' => chr(0x02A27), 'prod' => chr(0x0220F), 'race' => chr(0x029DA), 'roplus' => chr(0x02A2E), 'rotimes' => chr(0x02A35), 'rthree' => chr(0x022CC), 'rtimes' => chr(0x022CA), 'sdot' => chr(0x022C5), 'sdotb' => chr(0x022A1), 'setmn' => chr(0x02216), 'simplus' => chr(0x02A24), 'smashp' => chr(0x02A33), 'solb' => chr(0x029C4), 'sqcap' => chr(0x02293), 'sqcaps' => chr(0x02293).chr(0x0FE00), 'sqcup' => chr(0x02294), 'sqcups' => chr(0x02294).chr(0x0FE00), 'ssetmn' => chr(0x02216), 'sstarf' => chr(0x022C6), 'subdot' => chr(0x02ABD), 'sum' => chr(0x02211), 'supdot' => chr(0x02ABE), 'timesb' => chr(0x022A0), 'timesbar' => chr(0x02A31), 'timesd' => chr(0x02A30), 'tridot' => chr(0x025EC), 'triminus' => chr(0x02A3A), 'triplus' => chr(0x02A39), 'trisb' => chr(0x029CD), 'tritime' => chr(0x02A3B), 'uplus' => chr(0x0228E), 'veebar' => chr(0x022BB), 'wedbar' => chr(0x02A5F), 'wreath' => chr(0x02240), 'xcap' => chr(0x022C2), 'xcirc' => chr(0x025EF), 'xcup' => chr(0x022C3), 'xdtri' => chr(0x025BD), 'xodot' => chr(0x02A00), 'xoplus' => chr(0x02A01), 'xotime' => chr(0x02A02), 'xsqcup' => chr(0x02A06), 'xuplus' => chr(0x02A04), 'xutri' => chr(0x025B3), 'xvee' => chr(0x022C1), 'xwedge' => chr(0x022C0), } }} # ISOAMSC push @names, 'isoamsc'; { my $rv; sub isoamsc { # Return cached value if there is one. if ($rv) { return $rv } return $rv = { 'dlcorn' => chr(0x0231E), 'drcorn' => chr(0x0231F), 'gtlPar' => chr(0x02995), 'langd' => chr(0x02991), 'lbrke' => chr(0x0298B), 'lbrksld' => chr(0x0298F), 'lbrkslu' => chr(0x0298D), 'lceil' => chr(0x02308), 'lfloor' => chr(0x0230A), 'lmoust' => chr(0x023B0), 'lparlt' => chr(0x02993), 'ltrPar' => chr(0x02996), 'rangd' => chr(0x02992), 'rbrke' => chr(0x0298C), 'rbrksld' => chr(0x0298E), 'rbrkslu' => chr(0x02990), 'rceil' => chr(0x02309), 'rfloor' => chr(0x0230B), 'rmoust' => chr(0x023B1), 'rpargt' => chr(0x02994), 'ulcorn' => chr(0x0231C), 'urcorn' => chr(0x0231D), } }} # ISOAMSN push @names, 'isoamsn'; { my $rv; sub isoamsn { # Return cached value if there is one. if ($rv) { return $rv } return $rv = { 'gnap' => chr(0x02A8A), 'gnE' => chr(0x02269), 'gne' => chr(0x02A88), 'gnsim' => chr(0x022E7), 'gvnE' => chr(0x02269).chr(0x0FE00), 'lnap' => chr(0x02A89), 'lnE' => chr(0x02268), 'lne' => chr(0x02A87), 'lnsim' => chr(0x022E6), 'lvnE' => chr(0x02268).chr(0x0FE00), 'nap' => chr(0x02249), 'napE' => chr(0x02A70).chr(0x00338), 'napid' => chr(0x0224B).chr(0x00338), 'ncong' => chr(0x02247), 'ncongdot' => chr(0x02A6D).chr(0x00338), 'nequiv' => chr(0x02262), 'ngE' => chr(0x02267).chr(0x00338), 'nge' => chr(0x02271), 'nges' => chr(0x02A7E).chr(0x00338), 'nGg' => chr(0x022D9).chr(0x00338), 'ngsim' => chr(0x02275), 'nGt' => chr(0x0226B).chr(0x020D2), 'ngt' => chr(0x0226F), 'nGtv' => chr(0x0226B).chr(0x00338), 'nlE' => chr(0x02266).chr(0x00338), 'nle' => chr(0x02270), 'nles' => chr(0x02A7D).chr(0x00338), 'nLl' => chr(0x022D8).chr(0x00338), 'nlsim' => chr(0x02274), 'nLt' => chr(0x0226A).chr(0x020D2), 'nlt' => chr(0x0226E), 'nltri' => chr(0x022EA), 'nltrie' => chr(0x022EC), 'nLtv' => chr(0x0226A).chr(0x00338), 'nmid' => chr(0x02224), 'npar' => chr(0x02226), 'npr' => chr(0x02280), 'nprcue' => chr(0x022E0), 'npre' => chr(0x02AAF).chr(0x00338), 'nrtri' => chr(0x022EB), 'nrtrie' => chr(0x022ED), 'nsc' => chr(0x02281), 'nsccue' => chr(0x022E1), 'nsce' => chr(0x02AB0).chr(0x00338), 'nsim' => chr(0x02241), 'nsime' => chr(0x02244), 'nsmid' => chr(0x02224), 'nspar' => chr(0x02226), 'nsqsube' => chr(0x022E2), 'nsqsupe' => chr(0x022E3), 'nsub' => chr(0x02284), 'nsubE' => chr(0x02AC5).chr(0x00338), 'nsube' => chr(0x02288), 'nsup' => chr(0x02285), 'nsupE' => chr(0x02AC6).chr(0x00338), 'nsupe' => chr(0x02289), 'ntgl' => chr(0x02279), 'ntlg' => chr(0x02278), 'nvap' => chr(0x0224D).chr(0x020D2), 'nVDash' => chr(0x022AF), 'nVdash' => chr(0x022AE), 'nvDash' => chr(0x022AD), 'nvdash' => chr(0x022AC), 'nvge' => chr(0x02265).chr(0x020D2), 'nvgt' => chr(0x0003E).chr(0x020D2), 'nvle' => chr(0x02264).chr(0x020D2), 'nvlt' => chr(0x0003C).chr(0x020D2), 'nvltrie' => chr(0x022B4).chr(0x020D2), 'nvrtrie' => chr(0x022B5).chr(0x020D2), 'nvsim' => chr(0x0223C).chr(0x020D2), 'parsim' => chr(0x02AF3), 'prnap' => chr(0x02AB9), 'prnE' => chr(0x02AB5), 'prnsim' => chr(0x022E8), 'rnmid' => chr(0x02AEE), 'scnap' => chr(0x02ABA), 'scnE' => chr(0x02AB6), 'scnsim' => chr(0x022E9), 'simne' => chr(0x02246), 'solbar' => chr(0x0233F), 'subnE' => chr(0x02ACB), 'subne' => chr(0x0228A), 'supnE' => chr(0x02ACC), 'supne' => chr(0x0228B), 'vnsub' => chr(0x02282).chr(0x020D2), 'vnsup' => chr(0x02283).chr(0x020D2), 'vsubnE' => chr(0x02ACB).chr(0x0FE00), 'vsubne' => chr(0x0228A).chr(0x0FE00), 'vsupnE' => chr(0x02ACC).chr(0x0FE00), 'vsupne' => chr(0x0228B).chr(0x0FE00), } }} # ISOAMSO push @names, 'isoamso'; { my $rv; sub isoamso { # Return cached value if there is one. if ($rv) { return $rv } return $rv = { 'ang' => chr(0x02220), 'ange' => chr(0x029A4), 'angmsd' => chr(0x02221), 'angmsdaa' => chr(0x029A8), 'angmsdab' => chr(0x029A9), 'angmsdac' => chr(0x029AA), 'angmsdad' => chr(0x029AB), 'angmsdae' => chr(0x029AC), 'angmsdaf' => chr(0x029AD), 'angmsdag' => chr(0x029AE), 'angmsdah' => chr(0x029AF), 'angrtvb' => chr(0x022BE), 'angrtvbd' => chr(0x0299D), 'bbrk' => chr(0x023B5), 'bbrktbrk' => chr(0x023B6), 'bemptyv' => chr(0x029B0), 'beth' => chr(0x02136), 'boxbox' => chr(0x029C9), 'bprime' => chr(0x02035), 'bsemi' => chr(0x0204F), 'cemptyv' => chr(0x029B2), 'cirE' => chr(0x029C3), 'cirscir' => chr(0x029C2), 'comp' => chr(0x02201), 'daleth' => chr(0x02138), 'demptyv' => chr(0x029B1), 'ell' => chr(0x02113), 'empty' => chr(0x02205), 'emptyv' => chr(0x02205), 'gimel' => chr(0x02137), 'iiota' => chr(0x02129), 'image' => chr(0x02111), 'imath' => chr(0x00131), 'jmath' => chr(0x0006A), 'laemptyv' => chr(0x029B4), 'lltri' => chr(0x025FA), 'lrtri' => chr(0x022BF), 'mho' => chr(0x02127), 'nang' => chr(0x02220).chr(0x020D2), 'nexist' => chr(0x02204), 'oS' => chr(0x024C8), 'planck' => chr(0x0210F), 'plankv' => chr(0x0210F), 'raemptyv' => chr(0x029B3), 'range' => chr(0x029A5), 'real' => chr(0x0211C), 'tbrk' => chr(0x023B4), 'trpezium' => chr(0x0FFFD), 'ultri' => chr(0x025F8), 'urtri' => chr(0x025F9), 'vzigzag' => chr(0x0299A), 'weierp' => chr(0x02118), } }} # ISOAMSR push @names, 'isoamsr'; { my $rv; sub isoamsr { # Return cached value if there is one. if ($rv) { return $rv } return $rv = { 'apE' => chr(0x02A70), 'ape' => chr(0x0224A), 'apid' => chr(0x0224B), 'asymp' => chr(0x02248), 'Barv' => chr(0x02AE7), 'bcong' => chr(0x0224C), 'bepsi' => chr(0x003F6), 'bowtie' => chr(0x022C8), 'bsim' => chr(0x0223D), 'bsime' => chr(0x022CD), 'bsolhsub' => chr(0x0005C).chr(0x02282), 'bump' => chr(0x0224E), 'bumpE' => chr(0x02AAE), 'bumpe' => chr(0x0224F), 'cire' => chr(0x02257), 'Colon' => chr(0x02237), 'Colone' => chr(0x02A74), 'colone' => chr(0x02254), 'congdot' => chr(0x02A6D), 'csub' => chr(0x02ACF), 'csube' => chr(0x02AD1), 'csup' => chr(0x02AD0), 'csupe' => chr(0x02AD2), 'cuepr' => chr(0x022DE), 'cuesc' => chr(0x022DF), 'Dashv' => chr(0x02AE4), 'dashv' => chr(0x022A3), 'easter' => chr(0x02A6E), 'ecir' => chr(0x02256), 'ecolon' => chr(0x02255), 'eDDot' => chr(0x02A77), 'eDot' => chr(0x02251), 'efDot' => chr(0x02252), 'eg' => chr(0x02A9A), 'egs' => chr(0x02A96), 'egsdot' => chr(0x02A98), 'el' => chr(0x02A99), 'els' => chr(0x02A95), 'elsdot' => chr(0x02A97), 'equest' => chr(0x0225F), 'equivDD' => chr(0x02A78), 'erDot' => chr(0x02253), 'esdot' => chr(0x02250), 'Esim' => chr(0x02A73), 'esim' => chr(0x02242), 'fork' => chr(0x022D4), 'forkv' => chr(0x02AD9), 'frown' => chr(0x02322), 'gap' => chr(0x02A86), 'gE' => chr(0x02267), 'gEl' => chr(0x02A8C), 'gel' => chr(0x022DB), 'ges' => chr(0x02A7E), 'gescc' => chr(0x02AA9), 'gesdot' => chr(0x02A80), 'gesdoto' => chr(0x02A82), 'gesdotol' => chr(0x02A84), 'gesl' => chr(0x022DB).chr(0x0FE00), 'gesles' => chr(0x02A94), 'Gg' => chr(0x022D9), 'gl' => chr(0x02277), 'gla' => chr(0x02AA5), 'glE' => chr(0x02A92), 'glj' => chr(0x02AA4), 'gsim' => chr(0x02273), 'gsime' => chr(0x02A8E), 'gsiml' => chr(0x02A90), 'Gt' => chr(0x0226B), 'gtcc' => chr(0x02AA7), 'gtcir' => chr(0x02A7A), 'gtdot' => chr(0x022D7), 'gtquest' => chr(0x02A7C), 'gtrarr' => chr(0x02978), 'homtht' => chr(0x0223B), 'lap' => chr(0x02A85), 'lat' => chr(0x02AAB), 'late' => chr(0x02AAD), 'lates' => chr(0x02AAD).chr(0x0FE00), 'lE' => chr(0x02266), 'lEg' => chr(0x02A8B), 'leg' => chr(0x022DA), 'les' => chr(0x02A7D), 'lescc' => chr(0x02AA8), 'lesdot' => chr(0x02A7F), 'lesdoto' => chr(0x02A81), 'lesdotor' => chr(0x02A83), 'lesg' => chr(0x022DA).chr(0x0FE00), 'lesges' => chr(0x02A93), 'lg' => chr(0x02276), 'lgE' => chr(0x02A91), 'Ll' => chr(0x022D8), 'lsim' => chr(0x02272), 'lsime' => chr(0x02A8D), 'lsimg' => chr(0x02A8F), 'Lt' => chr(0x0226A), 'ltcc' => chr(0x02AA6), 'ltcir' => chr(0x02A79), 'ltdot' => chr(0x022D6), 'ltlarr' => chr(0x02976), 'ltquest' => chr(0x02A7B), 'ltrie' => chr(0x022B4), 'mcomma' => chr(0x02A29), 'mDDot' => chr(0x0223A), 'mid' => chr(0x02223), 'mlcp' => chr(0x02ADB), 'models' => chr(0x022A7), 'mstpos' => chr(0x0223E), 'Pr' => chr(0x02ABB), 'pr' => chr(0x0227A), 'prap' => chr(0x02AB7), 'prcue' => chr(0x0227C), 'prE' => chr(0x02AB3), 'pre' => chr(0x02AAF), 'prsim' => chr(0x0227E), 'prurel' => chr(0x022B0), 'ratio' => chr(0x02236), 'rtrie' => chr(0x022B5), 'rtriltri' => chr(0x029CE), 'Sc' => chr(0x02ABC), 'sc' => chr(0x0227B), 'scap' => chr(0x02AB8), 'sccue' => chr(0x0227D), 'scE' => chr(0x02AB4), 'sce' => chr(0x02AB0), 'scsim' => chr(0x0227F), 'sdote' => chr(0x02A66), 'sfrown' => chr(0x02322), 'simg' => chr(0x02A9E), 'simgE' => chr(0x02AA0), 'siml' => chr(0x02A9D), 'simlE' => chr(0x02A9F), 'smid' => chr(0x02223), 'smile' => chr(0x02323), 'smt' => chr(0x02AAA), 'smte' => chr(0x02AAC), 'smtes' => chr(0x02AAC).chr(0x0FE00), 'spar' => chr(0x02225), 'sqsub' => chr(0x0228F), 'sqsube' => chr(0x02291), 'sqsup' => chr(0x02290), 'sqsupe' => chr(0x02292), 'ssmile' => chr(0x02323), 'Sub' => chr(0x022D0), 'subE' => chr(0x02AC5), 'subedot' => chr(0x02AC3), 'submult' => chr(0x02AC1), 'subplus' => chr(0x02ABF), 'subrarr' => chr(0x02979), 'subsim' => chr(0x02AC7), 'subsub' => chr(0x02AD5), 'subsup' => chr(0x02AD3), 'Sup' => chr(0x022D1), 'supdsub' => chr(0x02AD8), 'supE' => chr(0x02AC6), 'supedot' => chr(0x02AC4), 'suphsol' => chr(0x02283).chr(0x0002F), 'suphsub' => chr(0x02AD7), 'suplarr' => chr(0x0297B), 'supmult' => chr(0x02AC2), 'supplus' => chr(0x02AC0), 'supsim' => chr(0x02AC8), 'supsub' => chr(0x02AD4), 'supsup' => chr(0x02AD6), 'thkap' => chr(0x02248), 'thksim' => chr(0x0223C), 'topfork' => chr(0x02ADA), 'trie' => chr(0x0225C), 'twixt' => chr(0x0226C), 'Vbar' => chr(0x02AEB), 'vBar' => chr(0x02AE8), 'vBarv' => chr(0x02AE9), 'VDash' => chr(0x022AB), 'Vdash' => chr(0x022A9), 'vDash' => chr(0x022A8), 'vdash' => chr(0x022A2), 'Vdashl' => chr(0x02AE6), 'vltri' => chr(0x022B2), 'vprop' => chr(0x0221D), 'vrtri' => chr(0x022B3), 'Vvdash' => chr(0x022AA), } }} # ISOGRK1 push @names, 'isogrk1'; { my $rv; sub isogrk1 { # Return cached value if there is one. if ($rv) { return $rv } return $rv = { 'Agr' => chr(0x00391), 'agr' => chr(0x003B1), 'Bgr' => chr(0x00392), 'bgr' => chr(0x003B2), 'Dgr' => chr(0x00394), 'dgr' => chr(0x003B4), 'EEgr' => chr(0x00397), 'eegr' => chr(0x003B7), 'Egr' => chr(0x00395), 'egr' => chr(0x003B5), 'Ggr' => chr(0x00393), 'ggr' => chr(0x003B3), 'Igr' => chr(0x00399), 'igr' => chr(0x003B9), 'Kgr' => chr(0x0039A), 'kgr' => chr(0x003BA), 'KHgr' => chr(0x003A7), 'khgr' => chr(0x003C7), 'Lgr' => chr(0x0039B), 'lgr' => chr(0x003BB), 'Mgr' => chr(0x0039C), 'mgr' => chr(0x003BC), 'Ngr' => chr(0x0039D), 'ngr' => chr(0x003BD), 'Ogr' => chr(0x0039F), 'ogr' => chr(0x003BF), 'OHgr' => chr(0x003A9), 'ohgr' => chr(0x003C9), 'Pgr' => chr(0x003A0), 'pgr' => chr(0x003C0), 'PHgr' => chr(0x003A6), 'phgr' => chr(0x003C6), 'PSgr' => chr(0x003A8), 'psgr' => chr(0x003C8), 'Rgr' => chr(0x003A1), 'rgr' => chr(0x003C1), 'sfgr' => chr(0x003C2), 'Sgr' => chr(0x003A3), 'sgr' => chr(0x003C3), 'Tgr' => chr(0x003A4), 'tgr' => chr(0x003C4), 'THgr' => chr(0x00398), 'thgr' => chr(0x003B8), 'Ugr' => chr(0x003A5), 'ugr' => chr(0x003C5), 'Xgr' => chr(0x0039E), 'xgr' => chr(0x003BE), 'Zgr' => chr(0x00396), 'zgr' => chr(0x003B6), } }} # ISOGRK2 push @names, 'isogrk2'; { my $rv; sub isogrk2 { # Return cached value if there is one. if ($rv) { return $rv } return $rv = { 'Aacgr' => chr(0x00386), 'aacgr' => chr(0x003AC), 'Eacgr' => chr(0x00388), 'eacgr' => chr(0x003AD), 'EEacgr' => chr(0x00389), 'eeacgr' => chr(0x003AE), 'Iacgr' => chr(0x0038A), 'iacgr' => chr(0x003AF), 'idiagr' => chr(0x00390), 'Idigr' => chr(0x003AA), 'idigr' => chr(0x003CA), 'Oacgr' => chr(0x0038C), 'oacgr' => chr(0x003CC), 'OHacgr' => chr(0x0038F), 'ohacgr' => chr(0x003CE), 'Uacgr' => chr(0x0038E), 'uacgr' => chr(0x003CD), 'udiagr' => chr(0x003B0), 'Udigr' => chr(0x003AB), 'udigr' => chr(0x003CB), } }} # ISOGRK3 push @names, 'isogrk3'; { my $rv; sub isogrk3 { # Return cached value if there is one. if ($rv) { return $rv } return $rv = { 'alpha' => chr(0x003B1), 'beta' => chr(0x003B2), 'chi' => chr(0x003C7), 'Delta' => chr(0x00394), 'delta' => chr(0x003B4), 'epsi' => chr(0x003F5), 'epsiv' => chr(0x003B5), 'eta' => chr(0x003B7), 'Gamma' => chr(0x00393), 'gamma' => chr(0x003B3), 'Gammad' => chr(0x003DC), 'gammad' => chr(0x003DD), 'iota' => chr(0x003B9), 'kappa' => chr(0x003BA), 'kappav' => chr(0x003F0), 'Lambda' => chr(0x0039B), 'lambda' => chr(0x003BB), 'mu' => chr(0x003BC), 'nu' => chr(0x003BD), 'Omega' => chr(0x003A9), 'omega' => chr(0x003C9), 'Phi' => chr(0x003A6), 'phi' => chr(0x003D5), 'phiv' => chr(0x003C6), 'Pi' => chr(0x003A0), 'pi' => chr(0x003C0), 'piv' => chr(0x003D6), 'Psi' => chr(0x003A8), 'psi' => chr(0x003C8), 'rho' => chr(0x003C1), 'rhov' => chr(0x003F1), 'Sigma' => chr(0x003A3), 'sigma' => chr(0x003C3), 'sigmav' => chr(0x003C2), 'tau' => chr(0x003C4), 'Theta' => chr(0x00398), 'theta' => chr(0x003B8), 'thetav' => chr(0x003D1), 'Upsi' => chr(0x003D2), 'upsi' => chr(0x003C5), 'Xi' => chr(0x0039E), 'xi' => chr(0x003BE), 'zeta' => chr(0x003B6), } }} # ISOGRK4 push @names, 'isogrk4'; { my $rv; sub isogrk4 { # Return cached value if there is one. if ($rv) { return $rv } return $rv = { } }} # ISOMFRK push @names, 'isomfrk'; { my $rv; sub isomfrk { # Return cached value if there is one. if ($rv) { return $rv } return $rv = { 'Afr' => chr(0x1D504), 'afr' => chr(0x1D51E), 'Bfr' => chr(0x1D505), 'bfr' => chr(0x1D51F), 'Cfr' => chr(0x0212D), 'cfr' => chr(0x1D520), 'Dfr' => chr(0x1D507), 'dfr' => chr(0x1D521), 'Efr' => chr(0x1D508), 'efr' => chr(0x1D522), 'Ffr' => chr(0x1D509), 'ffr' => chr(0x1D523), 'Gfr' => chr(0x1D50A), 'gfr' => chr(0x1D524), 'Hfr' => chr(0x0210C), 'hfr' => chr(0x1D525), 'Ifr' => chr(0x02111), 'ifr' => chr(0x1D526), 'Jfr' => chr(0x1D50D), 'jfr' => chr(0x1D527), 'Kfr' => chr(0x1D50E), 'kfr' => chr(0x1D528), 'Lfr' => chr(0x1D50F), 'lfr' => chr(0x1D529), 'Mfr' => chr(0x1D510), 'mfr' => chr(0x1D52A), 'Nfr' => chr(0x1D511), 'nfr' => chr(0x1D52B), 'Ofr' => chr(0x1D512), 'ofr' => chr(0x1D52C), 'Pfr' => chr(0x1D513), 'pfr' => chr(0x1D52D), 'Qfr' => chr(0x1D514), 'qfr' => chr(0x1D52E), 'Rfr' => chr(0x0211C), 'rfr' => chr(0x1D52F), 'Sfr' => chr(0x1D516), 'sfr' => chr(0x1D530), 'Tfr' => chr(0x1D517), 'tfr' => chr(0x1D531), 'Ufr' => chr(0x1D518), 'ufr' => chr(0x1D532), 'Vfr' => chr(0x1D519), 'vfr' => chr(0x1D533), 'Wfr' => chr(0x1D51A), 'wfr' => chr(0x1D534), 'Xfr' => chr(0x1D51B), 'xfr' => chr(0x1D535), 'Yfr' => chr(0x1D51C), 'yfr' => chr(0x1D536), 'Zfr' => chr(0x02128), 'zfr' => chr(0x1D537), } }} # ISOMOPF push @names, 'isomopf'; { my $rv; sub isomopf { # Return cached value if there is one. if ($rv) { return $rv } return $rv = { 'Aopf' => chr(0x1D538), 'Bopf' => chr(0x1D539), 'Copf' => chr(0x02102), 'Dopf' => chr(0x1D53B), 'Eopf' => chr(0x1D53C), 'Fopf' => chr(0x1D53D), 'Gopf' => chr(0x1D53E), 'Hopf' => chr(0x0210D), 'Iopf' => chr(0x1D540), 'Jopf' => chr(0x1D541), 'Kopf' => chr(0x1D542), 'Lopf' => chr(0x1D543), 'Mopf' => chr(0x1D544), 'Nopf' => chr(0x02115), 'Oopf' => chr(0x1D546), 'Popf' => chr(0x02119), 'Qopf' => chr(0x0211A), 'Ropf' => chr(0x0211D), 'Sopf' => chr(0x1D54A), 'Topf' => chr(0x1D54B), 'Uopf' => chr(0x1D54C), 'Vopf' => chr(0x1D54D), 'Wopf' => chr(0x1D54E), 'Xopf' => chr(0x1D54F), 'Yopf' => chr(0x1D550), 'Zopf' => chr(0x02124), } }} # ISOMSCR push @names, 'isomscr'; { my $rv; sub isomscr { # Return cached value if there is one. if ($rv) { return $rv } return $rv = { 'Ascr' => chr(0x1D49C), 'ascr' => chr(0x1D4B6), 'Bscr' => chr(0x0212C), 'bscr' => chr(0x1D4B7), 'Cscr' => chr(0x1D49E), 'cscr' => chr(0x1D4B8), 'Dscr' => chr(0x1D49F), 'dscr' => chr(0x1D4B9), 'Escr' => chr(0x02130), 'escr' => chr(0x0212F), 'Fscr' => chr(0x02131), 'fscr' => chr(0x1D4BB), 'Gscr' => chr(0x1D4A2), 'gscr' => chr(0x0210A), 'Hscr' => chr(0x0210B), 'hscr' => chr(0x1D4BD), 'Iscr' => chr(0x02110), 'iscr' => chr(0x1D4BE), 'Jscr' => chr(0x1D4A5), 'jscr' => chr(0x1D4BF), 'Kscr' => chr(0x1D4A6), 'kscr' => chr(0x1D4C0), 'Lscr' => chr(0x02112), 'lscr' => chr(0x1D4C1), 'Mscr' => chr(0x02133), 'mscr' => chr(0x1D4C2), 'Nscr' => chr(0x1D4A9), 'nscr' => chr(0x1D4C3), 'Oscr' => chr(0x1D4AA), 'oscr' => chr(0x02134), 'Pscr' => chr(0x1D4AB), 'pscr' => chr(0x1D4C5), 'Qscr' => chr(0x1D4AC), 'qscr' => chr(0x1D4C6), 'Rscr' => chr(0x0211B), 'rscr' => chr(0x1D4C7), 'Sscr' => chr(0x1D4AE), 'sscr' => chr(0x1D4C8), 'Tscr' => chr(0x1D4AF), 'tscr' => chr(0x1D4C9), 'Uscr' => chr(0x1D4B0), 'uscr' => chr(0x1D4CA), 'Vscr' => chr(0x1D4B1), 'vscr' => chr(0x1D4CB), 'Wscr' => chr(0x1D4B2), 'wscr' => chr(0x1D4CC), 'Xscr' => chr(0x1D4B3), 'xscr' => chr(0x1D4CD), 'Yscr' => chr(0x1D4B4), 'yscr' => chr(0x1D4CE), 'Zscr' => chr(0x1D4B5), 'zscr' => chr(0x1D4CF), } }} # ISOTECH push @names, 'isotech'; { my $rv; sub isotech { # Return cached value if there is one. if ($rv) { return $rv } return $rv = { 'acd' => chr(0x0223F), 'aleph' => chr(0x02135), 'And' => chr(0x02A53), 'and' => chr(0x02227), 'andand' => chr(0x02A55), 'andd' => chr(0x02A5C), 'andslope' => chr(0x02A58), 'andv' => chr(0x02A5A), 'angrt' => chr(0x0221F), 'angsph' => chr(0x02222), 'angst' => chr(0x0212B), 'ap' => chr(0x02248), 'apacir' => chr(0x02A6F), 'awconint' => chr(0x02233), 'awint' => chr(0x02A11), 'becaus' => chr(0x02235), 'bernou' => chr(0x0212C), 'bne' => chr(0x0003D).chr(0x020E5), 'bnequiv' => chr(0x02261).chr(0x020E5), 'bNot' => chr(0x02AED), 'bnot' => chr(0x02310), 'bottom' => chr(0x022A5), 'cap' => chr(0x02229), 'Cconint' => chr(0x02230), 'cirfnint' => chr(0x02A10), 'compfn' => chr(0x02218), 'cong' => chr(0x02245), 'Conint' => chr(0x0222F), 'conint' => chr(0x0222E), 'ctdot' => chr(0x022EF), 'cup' => chr(0x0222A), 'cwconint' => chr(0x02232), 'cwint' => chr(0x02231), 'cylcty' => chr(0x0232D), 'disin' => chr(0x022F2), 'Dot' => chr(0x000A8), 'dsol' => chr(0x029F6), 'dtdot' => chr(0x022F1), 'dwangle' => chr(0x029A6), 'elinters' => chr(0x0FFFD), 'epar' => chr(0x022D5), 'eparsl' => chr(0x029E3), 'equiv' => chr(0x02261), 'eqvparsl' => chr(0x029E5), 'exist' => chr(0x02203), 'fltns' => chr(0x025B1), 'fnof' => chr(0x00192), 'forall' => chr(0x02200), 'fpartint' => chr(0x02A0D), 'ge' => chr(0x02265), 'hamilt' => chr(0x0210B), 'iff' => chr(0x021D4), 'iinfin' => chr(0x029DC), 'imped' => chr(0x001B5), 'infin' => chr(0x0221E), 'infintie' => chr(0x029DD), 'Int' => chr(0x0222C), 'int' => chr(0x0222B), 'intlarhk' => chr(0x02A17), 'isin' => chr(0x02208), 'isindot' => chr(0x022F5), 'isinE' => chr(0x022F9), 'isins' => chr(0x022F4), 'isinsv' => chr(0x022F3), 'isinv' => chr(0x02208), 'lagran' => chr(0x02112), 'Lang' => chr(0x0300A), 'lang' => chr(0x02329), 'lArr' => chr(0x021D0), 'lbbrk' => chr(0x03014), 'le' => chr(0x02264), 'loang' => chr(0x03018), 'lobrk' => chr(0x0301A), 'lopar' => chr(0x02985), 'lowast' => chr(0x02217), 'minus' => chr(0x02212), 'mnplus' => chr(0x02213), 'nabla' => chr(0x02207), 'ne' => chr(0x02260), 'nedot' => chr(0x02250).chr(0x00338), 'nhpar' => chr(0x02AF2), 'ni' => chr(0x0220B), 'nis' => chr(0x022FC), 'nisd' => chr(0x022FA), 'niv' => chr(0x0220B), 'Not' => chr(0x02AEC), 'notin' => chr(0x02209), 'notindot' => chr(0x022F5).chr(0x00338), 'notinE' => chr(0x022F9).chr(0x00338), 'notinva' => chr(0x02209), 'notinvb' => chr(0x022F7), 'notinvc' => chr(0x022F6), 'notni' => chr(0x0220C), 'notniva' => chr(0x0220C), 'notnivb' => chr(0x022FE), 'notnivc' => chr(0x022FD), 'nparsl' => chr(0x02AFD).chr(0x020E5), 'npart' => chr(0x02202).chr(0x00338), 'npolint' => chr(0x02A14), 'nvinfin' => chr(0x029DE), 'olcross' => chr(0x029BB), 'Or' => chr(0x02A54), 'or' => chr(0x02228), 'ord' => chr(0x02A5D), 'order' => chr(0x02134), 'oror' => chr(0x02A56), 'orslope' => chr(0x02A57), 'orv' => chr(0x02A5B), 'par' => chr(0x02225), 'parsl' => chr(0x02AFD), 'part' => chr(0x02202), 'permil' => chr(0x02030), 'perp' => chr(0x022A5), 'pertenk' => chr(0x02031), 'phmmat' => chr(0x02133), 'pointint' => chr(0x02A15), 'Prime' => chr(0x02033), 'prime' => chr(0x02032), 'profalar' => chr(0x0232E), 'profline' => chr(0x02312), 'profsurf' => chr(0x02313), 'prop' => chr(0x0221D), 'qint' => chr(0x02A0C), 'qprime' => chr(0x02057), 'quatint' => chr(0x02A16), 'radic' => chr(0x0221A), 'Rang' => chr(0x0300B), 'rang' => chr(0x0232A), 'rArr' => chr(0x021D2), 'rbbrk' => chr(0x03015), 'roang' => chr(0x03019), 'robrk' => chr(0x0301B), 'ropar' => chr(0x02986), 'rppolint' => chr(0x02A12), 'scpolint' => chr(0x02A13), 'sim' => chr(0x0223C), 'simdot' => chr(0x02A6A), 'sime' => chr(0x02243), 'smeparsl' => chr(0x029E4), 'square' => chr(0x025A1), 'squarf' => chr(0x025AA), 'strns' => chr(0x000AF), 'sub' => chr(0x02282), 'sube' => chr(0x02286), 'sup' => chr(0x02283), 'supe' => chr(0x02287), 'there4' => chr(0x02234), 'tint' => chr(0x0222D), 'top' => chr(0x022A4), 'topbot' => chr(0x02336), 'topcir' => chr(0x02AF1), 'tprime' => chr(0x02034), 'utdot' => chr(0x022F0), 'uwangle' => chr(0x029A7), 'vangrt' => chr(0x0299C), 'veeeq' => chr(0x0225A), 'Verbar' => chr(0x02016), 'wedgeq' => chr(0x02259), 'xnis' => chr(0x022FB), } }} sub all { no strict 'refs'; return {map %{$_->()}, @names} } sub names { return @names } sub char2entity { my ($subname) = @_; no strict 'refs'; my $ent2char = $subname->(); use strict; my %char2ent; local $/ = ';'; while (my($entity, $char) = each(%$ent2char)) { chomp $entity; # $/ eq ';' so this is just a faster version of s/;\z// $char2ent{$char} = "&$entity;"; } return \%char2ent; } 1 __END__ ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������darwin-perl-lib/XML/Entities/Data.pod���������������������������������������������������������������000444 �000765 �000024 �00000002225 13167163507 021564� 0����������������������������������������������������������������������������������������������������ustar�00ocsinventory��������������������staff���������������������������000000 �000000 ������������������������������������������������������������������������������������������������������������������������������������������������������������������������=head1 Name XML::Entities::Data - XML entity definitions =head1 Synopsis use XML::Entities::Data; $ISONUM_map = XML::Entities::Data::isonum; $all = XML::Entities::Data::all; @available_sets = XML::Entities::Data::names; $reverse_mapping = XML::Entities::Data::char2entity('isonum'); # regenerate the data perl download-entities.pl > XML/Entities/Data.pm perl download-entities.pl http://from.where.org/ > Data.pm =head1 Description This module is a bunch of hashes encapsulated by subroutines that map XML entity names to their unicode characters (or strings). It should be used from the XML::Entities module or the hashes it provides can be passed to HTML::Entities::_decode_entities. The data can be re-generated when definitions are changed or altered or when you want to use another set that is defined someplace online in an .ent file (of type DTD). See the download-entities.pl script. =head1 SEE ALSO HTML::Entities, XML::Entities =head1 COPYRIGHT Copyright 2010 Jan Oldrich Kruza E<lt>sixtease@cpan.orgE<gt>. All rights reserved. This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. =cut ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������darwin-perl-lib/URI/_foreign.pm���������������������������������������������������������������������000444 �000765 �000024 �00000000205 13167163507 020544� 0����������������������������������������������������������������������������������������������������ustar�00ocsinventory��������������������staff���������������������������000000 �000000 ������������������������������������������������������������������������������������������������������������������������������������������������������������������������package URI::_foreign; use strict; use warnings; use parent 'URI::_generic'; our $VERSION = '1.72'; $VERSION = eval $VERSION; 1; �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������darwin-perl-lib/URI/_generic.pm���������������������������������������������������������������������000444 �000765 �000024 �00000013330 13167163507 020532� 0����������������������������������������������������������������������������������������������������ustar�00ocsinventory��������������������staff���������������������������000000 �000000 ������������������������������������������������������������������������������������������������������������������������������������������������������������������������package URI::_generic; use strict; use warnings; use parent qw(URI URI::_query); use URI::Escape qw(uri_unescape); use Carp (); our $VERSION = '1.72'; $VERSION = eval $VERSION; my $ACHAR = $URI::uric; $ACHAR =~ s,\\[/?],,g; my $PCHAR = $URI::uric; $PCHAR =~ s,\\[?],,g; sub _no_scheme_ok { 1 } sub authority { my $self = shift; $$self =~ m,^((?:$URI::scheme_re:)?)(?://([^/?\#]*))?(.*)$,os or die; if (@_) { my $auth = shift; $$self = $1; my $rest = $3; if (defined $auth) { $auth =~ s/([^$ACHAR])/ URI::Escape::escape_char($1)/ego; utf8::downgrade($auth); $$self .= "//$auth"; } _check_path($rest, $$self); $$self .= $rest; } $2; } sub path { my $self = shift; $$self =~ m,^((?:[^:/?\#]+:)?(?://[^/?\#]*)?)([^?\#]*)(.*)$,s or die; if (@_) { $$self = $1; my $rest = $3; my $new_path = shift; $new_path = "" unless defined $new_path; $new_path =~ s/([^$PCHAR])/ URI::Escape::escape_char($1)/ego; utf8::downgrade($new_path); _check_path($new_path, $$self); $$self .= $new_path . $rest; } $2; } sub path_query { my $self = shift; $$self =~ m,^((?:[^:/?\#]+:)?(?://[^/?\#]*)?)([^\#]*)(.*)$,s or die; if (@_) { $$self = $1; my $rest = $3; my $new_path = shift; $new_path = "" unless defined $new_path; $new_path =~ s/([^$URI::uric])/ URI::Escape::escape_char($1)/ego; utf8::downgrade($new_path); _check_path($new_path, $$self); $$self .= $new_path . $rest; } $2; } sub _check_path { my($path, $pre) = @_; my $prefix; if ($pre =~ m,/,) { # authority present $prefix = "/" if length($path) && $path !~ m,^[/?\#],; } else { if ($path =~ m,^//,) { Carp::carp("Path starting with double slash is confusing") if $^W; } elsif (!length($pre) && $path =~ m,^[^:/?\#]+:,) { Carp::carp("Path might look like scheme, './' prepended") if $^W; $prefix = "./"; } } substr($_[0], 0, 0) = $prefix if defined $prefix; } sub path_segments { my $self = shift; my $path = $self->path; if (@_) { my @arg = @_; # make a copy for (@arg) { if (ref($_)) { my @seg = @$_; $seg[0] =~ s/%/%25/g; for (@seg) { s/;/%3B/g; } $_ = join(";", @seg); } else { s/%/%25/g; s/;/%3B/g; } s,/,%2F,g; } $self->path(join("/", @arg)); } return $path unless wantarray; map {/;/ ? $self->_split_segment($_) : uri_unescape($_) } split('/', $path, -1); } sub _split_segment { my $self = shift; require URI::_segment; URI::_segment->new(@_); } sub abs { my $self = shift; my $base = shift || Carp::croak("Missing base argument"); if (my $scheme = $self->scheme) { return $self unless $URI::ABS_ALLOW_RELATIVE_SCHEME; $base = URI->new($base) unless ref $base; return $self unless $scheme eq $base->scheme; } $base = URI->new($base) unless ref $base; my $abs = $self->clone; $abs->scheme($base->scheme); return $abs if $$self =~ m,^(?:$URI::scheme_re:)?//,o; $abs->authority($base->authority); my $path = $self->path; return $abs if $path =~ m,^/,; if (!length($path)) { my $abs = $base->clone; my $query = $self->query; $abs->query($query) if defined $query; my $fragment = $self->fragment; $abs->fragment($fragment) if defined $fragment; return $abs; } my $p = $base->path; $p =~ s,[^/]+$,,; $p .= $path; my @p = split('/', $p, -1); shift(@p) if @p && !length($p[0]); my $i = 1; while ($i < @p) { #print "$i ", join("/", @p), " ($p[$i])\n"; if ($p[$i-1] eq ".") { splice(@p, $i-1, 1); $i-- if $i > 1; } elsif ($p[$i] eq ".." && $p[$i-1] ne "..") { splice(@p, $i-1, 2); if ($i > 1) { $i--; push(@p, "") if $i == @p; } } else { $i++; } } $p[-1] = "" if @p && $p[-1] eq "."; # trailing "/." if ($URI::ABS_REMOTE_LEADING_DOTS) { shift @p while @p && $p[0] =~ /^\.\.?$/; } $abs->path("/" . join("/", @p)); $abs; } # The opposite of $url->abs. Return a URI which is as relative as possible sub rel { my $self = shift; my $base = shift || Carp::croak("Missing base argument"); my $rel = $self->clone; $base = URI->new($base) unless ref $base; #my($scheme, $auth, $path) = @{$rel}{qw(scheme authority path)}; my $scheme = $rel->scheme; my $auth = $rel->canonical->authority; my $path = $rel->path; if (!defined($scheme) && !defined($auth)) { # it is already relative return $rel; } #my($bscheme, $bauth, $bpath) = @{$base}{qw(scheme authority path)}; my $bscheme = $base->scheme; my $bauth = $base->canonical->authority; my $bpath = $base->path; for ($bscheme, $bauth, $auth) { $_ = '' unless defined } unless ($scheme eq $bscheme && $auth eq $bauth) { # different location, can't make it relative return $rel; } for ($path, $bpath) { $_ = "/$_" unless m,^/,; } # Make it relative by eliminating scheme and authority $rel->scheme(undef); $rel->authority(undef); # This loop is based on code from Nicolai Langfeldt <janl@ifi.uio.no>. # First we calculate common initial path components length ($li). my $li = 1; while (1) { my $i = index($path, '/', $li); last if $i < 0 || $i != index($bpath, '/', $li) || substr($path,$li,$i-$li) ne substr($bpath,$li,$i-$li); $li=$i+1; } # then we nuke it from both paths substr($path, 0,$li) = ''; substr($bpath,0,$li) = ''; if ($path eq $bpath && defined($rel->fragment) && !defined($rel->query)) { $rel->path(""); } else { # Add one "../" for each path component left in the base path $path = ('../' x $bpath =~ tr|/|/|) . $path; $path = "./" if $path eq ""; $rel->path($path); } $rel; } 1; ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������darwin-perl-lib/URI/_idna.pm������������������������������������������������������������������������000444 �000765 �000024 �00000004071 13167163507 020033� 0����������������������������������������������������������������������������������������������������ustar�00ocsinventory��������������������staff���������������������������000000 �000000 ������������������������������������������������������������������������������������������������������������������������������������������������������������������������package URI::_idna; # This module implements the RFCs 3490 (IDNA) and 3491 (Nameprep) # based on Python-2.6.4/Lib/encodings/idna.py use strict; use warnings; use URI::_punycode qw(encode_punycode decode_punycode); use Carp qw(croak); our $VERSION = '1.72'; $VERSION = eval $VERSION; BEGIN { *URI::_idna::_ENV_::JOIN_LEAKS_UTF8_FLAGS = "$]" < 5.008_003 ? sub () { 1 } : sub () { 0 } ; } my $ASCII = qr/^[\x00-\x7F]*\z/; sub encode { my $idomain = shift; my @labels = split(/\./, $idomain, -1); my @last_empty; push(@last_empty, pop @labels) if @labels > 1 && $labels[-1] eq ""; for (@labels) { $_ = ToASCII($_); } return eval 'join(".", @labels, @last_empty)' if URI::_idna::_ENV_::JOIN_LEAKS_UTF8_FLAGS; return join(".", @labels, @last_empty); } sub decode { my $domain = shift; return join(".", map ToUnicode($_), split(/\./, $domain, -1)) } sub nameprep { # XXX real implementation missing my $label = shift; $label = lc($label); return $label; } sub check_size { my $label = shift; croak "Label empty" if $label eq ""; croak "Label too long" if length($label) > 63; return $label; } sub ToASCII { my $label = shift; return check_size($label) if $label =~ $ASCII; # Step 2: nameprep $label = nameprep($label); # Step 3: UseSTD3ASCIIRules is false # Step 4: try ASCII again return check_size($label) if $label =~ $ASCII; # Step 5: Check ACE prefix if ($label =~ /^xn--/) { croak "Label starts with ACE prefix"; } # Step 6: Encode with PUNYCODE $label = encode_punycode($label); # Step 7: Prepend ACE prefix $label = "xn--$label"; # Step 8: Check size return check_size($label); } sub ToUnicode { my $label = shift; $label = nameprep($label) unless $label =~ $ASCII; return $label unless $label =~ /^xn--/; my $result = decode_punycode(substr($label, 4)); my $label2 = ToASCII($result); if (lc($label) ne $label2) { croak "IDNA does not round-trip: '\L$label\E' vs '$label2'"; } return $result; } 1; �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������darwin-perl-lib/URI/_ldap.pm������������������������������������������������������������������������000444 �000765 �000024 �00000006313 13167163507 020041� 0����������������������������������������������������������������������������������������������������ustar�00ocsinventory��������������������staff���������������������������000000 �000000 ������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Copyright (c) 1998 Graham Barr <gbarr@pobox.com>. All rights reserved. # This program is free software; you can redistribute it and/or # modify it under the same terms as Perl itself. package URI::_ldap; use strict; use warnings; our $VERSION = '1.72'; $VERSION = eval $VERSION; use URI::Escape qw(uri_unescape); sub _ldap_elem { my $self = shift; my $elem = shift; my $query = $self->query; my @bits = (split(/\?/,defined($query) ? $query : ""),("")x4); my $old = $bits[$elem]; if (@_) { my $new = shift; $new =~ s/\?/%3F/g; $bits[$elem] = $new; $query = join("?",@bits); $query =~ s/\?+$//; $query = undef unless length($query); $self->query($query); } $old; } sub dn { my $old = shift->path(@_); $old =~ s:^/::; uri_unescape($old); } sub attributes { my $self = shift; my $old = _ldap_elem($self,0, @_ ? join(",", map { my $tmp = $_; $tmp =~ s/,/%2C/g; $tmp } @_) : ()); return $old unless wantarray; map { uri_unescape($_) } split(/,/,$old); } sub _scope { my $self = shift; my $old = _ldap_elem($self,1, @_); return undef unless defined wantarray && defined $old; uri_unescape($old); } sub scope { my $old = &_scope; $old = "base" unless length $old; $old; } sub _filter { my $self = shift; my $old = _ldap_elem($self,2, @_); return undef unless defined wantarray && defined $old; uri_unescape($old); # || "(objectClass=*)"; } sub filter { my $old = &_filter; $old = "(objectClass=*)" unless length $old; $old; } sub extensions { my $self = shift; my @ext; while (@_) { my $key = shift; my $value = shift; push(@ext, join("=", map { $_="" unless defined; s/,/%2C/g; $_ } $key, $value)); } @ext = join(",", @ext) if @ext; my $old = _ldap_elem($self,3, @ext); return $old unless wantarray; map { uri_unescape($_) } map { /^([^=]+)=(.*)$/ } split(/,/,$old); } sub canonical { my $self = shift; my $other = $self->_nonldap_canonical; # The stuff below is not as efficient as one might hope... $other = $other->clone if $other == $self; $other->dn(_normalize_dn($other->dn)); # Should really know about mixed case "postalAddress", etc... $other->attributes(map lc, $other->attributes); # Lowercase scope, remove default my $old_scope = $other->scope; my $new_scope = lc($old_scope); $new_scope = "" if $new_scope eq "base"; $other->scope($new_scope) if $new_scope ne $old_scope; # Remove filter if default my $old_filter = $other->filter; $other->filter("") if lc($old_filter) eq "(objectclass=*)" || lc($old_filter) eq "objectclass=*"; # Lowercase extensions types and deal with known extension values my @ext = $other->extensions; for (my $i = 0; $i < @ext; $i += 2) { my $etype = $ext[$i] = lc($ext[$i]); if ($etype =~ /^!?bindname$/) { $ext[$i+1] = _normalize_dn($ext[$i+1]); } } $other->extensions(@ext) if @ext; $other; } sub _normalize_dn # RFC 2253 { my $dn = shift; return $dn; # The code below will fail if the "+" or "," is embedding in a quoted # string or simply escaped... my @dn = split(/([+,])/, $dn); for (@dn) { s/^([a-zA-Z]+=)/lc($1)/e; } join("", @dn); } 1; ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������darwin-perl-lib/URI/_login.pm�����������������������������������������������������������������������000444 �000765 �000024 �00000000401 13167163507 020221� 0����������������������������������������������������������������������������������������������������ustar�00ocsinventory��������������������staff���������������������������000000 �000000 ������������������������������������������������������������������������������������������������������������������������������������������������������������������������package URI::_login; use strict; use warnings; use parent qw(URI::_server URI::_userpass); our $VERSION = '1.72'; $VERSION = eval $VERSION; # Generic terminal logins. This is used as a base class for 'telnet', # 'tn3270', and 'rlogin' URL schemes. 1; ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������darwin-perl-lib/URI/_punycode.pm��������������������������������������������������������������������000444 �000765 �000024 �00000011050 13167163507 020741� 0����������������������������������������������������������������������������������������������������ustar�00ocsinventory��������������������staff���������������������������000000 �000000 ������������������������������������������������������������������������������������������������������������������������������������������������������������������������package URI::_punycode; use strict; use warnings; our $VERSION = '1.72'; $VERSION = eval $VERSION; use Exporter 'import'; our @EXPORT = qw(encode_punycode decode_punycode); use integer; our $DEBUG = 0; use constant BASE => 36; use constant TMIN => 1; use constant TMAX => 26; use constant SKEW => 38; use constant DAMP => 700; use constant INITIAL_BIAS => 72; use constant INITIAL_N => 128; my $Delimiter = chr 0x2D; my $BasicRE = qr/[\x00-\x7f]/; sub _croak { require Carp; Carp::croak(@_); } sub digit_value { my $code = shift; return ord($code) - ord("A") if $code =~ /[A-Z]/; return ord($code) - ord("a") if $code =~ /[a-z]/; return ord($code) - ord("0") + 26 if $code =~ /[0-9]/; return; } sub code_point { my $digit = shift; return $digit + ord('a') if 0 <= $digit && $digit <= 25; return $digit + ord('0') - 26 if 26 <= $digit && $digit <= 36; die 'NOT COME HERE'; } sub adapt { my($delta, $numpoints, $firsttime) = @_; $delta = $firsttime ? $delta / DAMP : $delta / 2; $delta += $delta / $numpoints; my $k = 0; while ($delta > ((BASE - TMIN) * TMAX) / 2) { $delta /= BASE - TMIN; $k += BASE; } return $k + (((BASE - TMIN + 1) * $delta) / ($delta + SKEW)); } sub decode_punycode { my $code = shift; my $n = INITIAL_N; my $i = 0; my $bias = INITIAL_BIAS; my @output; if ($code =~ s/(.*)$Delimiter//o) { push @output, map ord, split //, $1; return _croak('non-basic code point') unless $1 =~ /^$BasicRE*$/o; } while ($code) { my $oldi = $i; my $w = 1; LOOP: for (my $k = BASE; 1; $k += BASE) { my $cp = substr($code, 0, 1, ''); my $digit = digit_value($cp); defined $digit or return _croak("invalid punycode input"); $i += $digit * $w; my $t = ($k <= $bias) ? TMIN : ($k >= $bias + TMAX) ? TMAX : $k - $bias; last LOOP if $digit < $t; $w *= (BASE - $t); } $bias = adapt($i - $oldi, @output + 1, $oldi == 0); warn "bias becomes $bias" if $DEBUG; $n += $i / (@output + 1); $i = $i % (@output + 1); splice(@output, $i, 0, $n); warn join " ", map sprintf('%04x', $_), @output if $DEBUG; $i++; } return join '', map chr, @output; } sub encode_punycode { my $input = shift; my @input = split //, $input; my $n = INITIAL_N; my $delta = 0; my $bias = INITIAL_BIAS; my @output; my @basic = grep /$BasicRE/, @input; my $h = my $b = @basic; push @output, @basic; push @output, $Delimiter if $b && $h < @input; warn "basic codepoints: (@output)" if $DEBUG; while ($h < @input) { my $m = min(grep { $_ >= $n } map ord, @input); warn sprintf "next code point to insert is %04x", $m if $DEBUG; $delta += ($m - $n) * ($h + 1); $n = $m; for my $i (@input) { my $c = ord($i); $delta++ if $c < $n; if ($c == $n) { my $q = $delta; LOOP: for (my $k = BASE; 1; $k += BASE) { my $t = ($k <= $bias) ? TMIN : ($k >= $bias + TMAX) ? TMAX : $k - $bias; last LOOP if $q < $t; my $cp = code_point($t + (($q - $t) % (BASE - $t))); push @output, chr($cp); $q = ($q - $t) / (BASE - $t); } push @output, chr(code_point($q)); $bias = adapt($delta, $h + 1, $h == $b); warn "bias becomes $bias" if $DEBUG; $delta = 0; $h++; } } $delta++; $n++; } return join '', @output; } sub min { my $min = shift; for (@_) { $min = $_ if $_ <= $min } return $min; } 1; __END__ =head1 NAME URI::_punycode - encodes Unicode string in Punycode =head1 SYNOPSIS use URI::_punycode; $punycode = encode_punycode($unicode); $unicode = decode_punycode($punycode); =head1 DESCRIPTION URI::_punycode is a module to encode / decode Unicode strings into Punycode, an efficient encoding of Unicode for use with IDNA. This module requires Perl 5.6.0 or over to handle UTF8 flagged Unicode strings. =head1 FUNCTIONS This module exports following functions by default. =over 4 =item encode_punycode $punycode = encode_punycode($unicode); takes Unicode string (UTF8-flagged variable) and returns Punycode encoding for it. =item decode_punycode $unicode = decode_punycode($punycode) takes Punycode encoding and returns original Unicode string. =back These functions throw exceptions on failure. You can catch 'em via C<eval>. =head1 AUTHOR Tatsuhiko Miyagawa E<lt>miyagawa@bulknews.netE<gt> is the author of IDNA::Punycode v0.02 which was the basis for this module. This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. =head1 SEE ALSO L<IDNA::Punycode>, RFC 3492 =cut ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������darwin-perl-lib/URI/_query.pm�����������������������������������������������������������������������000444 �000765 �000024 �00000004775 13167163507 020300� 0����������������������������������������������������������������������������������������������������ustar�00ocsinventory��������������������staff���������������������������000000 �000000 ������������������������������������������������������������������������������������������������������������������������������������������������������������������������package URI::_query; use strict; use warnings; use URI (); use URI::Escape qw(uri_unescape); our $VERSION = '1.72'; $VERSION = eval $VERSION; sub query { my $self = shift; $$self =~ m,^([^?\#]*)(?:\?([^\#]*))?(.*)$,s or die; if (@_) { my $q = shift; $$self = $1; if (defined $q) { $q =~ s/([^$URI::uric])/ URI::Escape::escape_char($1)/ego; utf8::downgrade($q); $$self .= "?$q"; } $$self .= $3; } $2; } # Handle ...?foo=bar&bar=foo type of query sub query_form { my $self = shift; my $old = $self->query; if (@_) { # Try to set query string my $delim; my $r = $_[0]; if (ref($r) eq "ARRAY") { $delim = $_[1]; @_ = @$r; } elsif (ref($r) eq "HASH") { $delim = $_[1]; @_ = map { $_ => $r->{$_} } sort keys %$r; } $delim = pop if @_ % 2; my @query; while (my($key,$vals) = splice(@_, 0, 2)) { $key = '' unless defined $key; $key =~ s/([;\/?:@&=+,\$\[\]%])/ URI::Escape::escape_char($1)/eg; $key =~ s/ /+/g; $vals = [ref($vals) eq "ARRAY" ? @$vals : $vals]; for my $val (@$vals) { $val = '' unless defined $val; $val =~ s/([;\/?:@&=+,\$\[\]%])/ URI::Escape::escape_char($1)/eg; $val =~ s/ /+/g; push(@query, "$key=$val"); } } if (@query) { unless ($delim) { $delim = $1 if $old && $old =~ /([&;])/; $delim ||= $URI::DEFAULT_QUERY_FORM_DELIMITER || "&"; } $self->query(join($delim, @query)); } else { $self->query(undef); } } return if !defined($old) || !length($old) || !defined(wantarray); return unless $old =~ /=/; # not a form map { s/\+/ /g; uri_unescape($_) } map { /=/ ? split(/=/, $_, 2) : ($_ => '')} split(/[&;]/, $old); } # Handle ...?dog+bones type of query sub query_keywords { my $self = shift; my $old = $self->query; if (@_) { # Try to set query string my @copy = @_; @copy = @{$copy[0]} if @copy == 1 && ref($copy[0]) eq "ARRAY"; for (@copy) { s/([;\/?:@&=+,\$\[\]%])/ URI::Escape::escape_char($1)/eg; } $self->query(@copy ? join('+', @copy) : undef); } return if !defined($old) || !defined(wantarray); return if $old =~ /=/; # not keywords, but a form map { uri_unescape($_) } split(/\+/, $old, -1); } # Some URI::URL compatibility stuff sub equery { goto &query } 1; ���darwin-perl-lib/URI/_segment.pm���������������������������������������������������������������������000444 �000765 �000024 �00000000672 13167163507 020565� 0����������������������������������������������������������������������������������������������������ustar�00ocsinventory��������������������staff���������������������������000000 �000000 ������������������������������������������������������������������������������������������������������������������������������������������������������������������������package URI::_segment; # Represents a generic path_segment so that it can be treated as # a string too. use strict; use warnings; use URI::Escape qw(uri_unescape); use overload '""' => sub { $_[0]->[0] }, fallback => 1; our $VERSION = '1.72'; $VERSION = eval $VERSION; sub new { my $class = shift; my @segment = split(';', shift, -1); $segment[0] = uri_unescape($segment[0]); bless \@segment, $class; } 1; ����������������������������������������������������������������������darwin-perl-lib/URI/_server.pm����������������������������������������������������������������������000444 �000765 �000024 �00000007246 13167163507 020435� 0����������������������������������������������������������������������������������������������������ustar�00ocsinventory��������������������staff���������������������������000000 �000000 ������������������������������������������������������������������������������������������������������������������������������������������������������������������������package URI::_server; use strict; use warnings; use parent 'URI::_generic'; use URI::Escape qw(uri_unescape); our $VERSION = '1.72'; $VERSION = eval $VERSION; sub _uric_escape { my($class, $str) = @_; if ($str =~ m,^((?:$URI::scheme_re:)?)//([^/?\#]*)(.*)$,os) { my($scheme, $host, $rest) = ($1, $2, $3); my $ui = $host =~ s/(.*@)// ? $1 : ""; my $port = $host =~ s/(:\d+)\z// ? $1 : ""; if (_host_escape($host)) { $str = "$scheme//$ui$host$port$rest"; } } return $class->SUPER::_uric_escape($str); } sub _host_escape { return unless $_[0] =~ /[^$URI::uric]/; eval { require URI::_idna; $_[0] = URI::_idna::encode($_[0]); }; return 0 if $@; return 1; } sub as_iri { my $self = shift; my $str = $self->SUPER::as_iri; if ($str =~ /\bxn--/) { if ($str =~ m,^((?:$URI::scheme_re:)?)//([^/?\#]*)(.*)$,os) { my($scheme, $host, $rest) = ($1, $2, $3); my $ui = $host =~ s/(.*@)// ? $1 : ""; my $port = $host =~ s/(:\d+)\z// ? $1 : ""; require URI::_idna; $host = URI::_idna::decode($host); $str = "$scheme//$ui$host$port$rest"; } } return $str; } sub userinfo { my $self = shift; my $old = $self->authority; if (@_) { my $new = $old; $new = "" unless defined $new; $new =~ s/.*@//; # remove old stuff my $ui = shift; if (defined $ui) { $ui =~ s/@/%40/g; # protect @ $new = "$ui\@$new"; } $self->authority($new); } return undef if !defined($old) || $old !~ /(.*)@/; return $1; } sub host { my $self = shift; my $old = $self->authority; if (@_) { my $tmp = $old; $tmp = "" unless defined $tmp; my $ui = ($tmp =~ /(.*@)/) ? $1 : ""; my $port = ($tmp =~ /(:\d+)$/) ? $1 : ""; my $new = shift; $new = "" unless defined $new; if (length $new) { $new =~ s/[@]/%40/g; # protect @ if ($new =~ /^[^:]*:\d*\z/ || $new =~ /]:\d*\z/) { $new =~ s/(:\d*)\z// || die "Assert"; $port = $1; } $new = "[$new]" if $new =~ /:/ && $new !~ /^\[/; # IPv6 address _host_escape($new); } $self->authority("$ui$new$port"); } return undef unless defined $old; $old =~ s/.*@//; $old =~ s/:\d+$//; # remove the port $old =~ s{^\[(.*)\]$}{$1}; # remove brackets around IPv6 (RFC 3986 3.2.2) return uri_unescape($old); } sub ihost { my $self = shift; my $old = $self->host(@_); if ($old =~ /(^|\.)xn--/) { require URI::_idna; $old = URI::_idna::decode($old); } return $old; } sub _port { my $self = shift; my $old = $self->authority; if (@_) { my $new = $old; $new =~ s/:\d*$//; my $port = shift; $new .= ":$port" if defined $port; $self->authority($new); } return $1 if defined($old) && $old =~ /:(\d*)$/; return; } sub port { my $self = shift; my $port = $self->_port(@_); $port = $self->default_port if !defined($port) || $port eq ""; $port; } sub host_port { my $self = shift; my $old = $self->authority; $self->host(shift) if @_; return undef unless defined $old; $old =~ s/.*@//; # zap userinfo $old =~ s/:$//; # empty port should be treated the same a no port $old .= ":" . $self->port unless $old =~ /:\d+$/; $old; } sub default_port { undef } sub canonical { my $self = shift; my $other = $self->SUPER::canonical; my $host = $other->host || ""; my $port = $other->_port; my $uc_host = $host =~ /[A-Z]/; my $def_port = defined($port) && ($port eq "" || $port == $self->default_port); if ($uc_host || $def_port) { $other = $other->clone if $other == $self; $other->host(lc $host) if $uc_host; $other->port(undef) if $def_port; } $other; } 1; ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������darwin-perl-lib/URI/_userpass.pm��������������������������������������������������������������������000444 �000765 �000024 �00000002044 13167163507 020763� 0����������������������������������������������������������������������������������������������������ustar�00ocsinventory��������������������staff���������������������������000000 �000000 ������������������������������������������������������������������������������������������������������������������������������������������������������������������������package URI::_userpass; use strict; use warnings; use URI::Escape qw(uri_unescape); our $VERSION = '1.72'; $VERSION = eval $VERSION; sub user { my $self = shift; my $info = $self->userinfo; if (@_) { my $new = shift; my $pass = defined($info) ? $info : ""; $pass =~ s/^[^:]*//; if (!defined($new) && !length($pass)) { $self->userinfo(undef); } else { $new = "" unless defined($new); $new =~ s/%/%25/g; $new =~ s/:/%3A/g; $self->userinfo("$new$pass"); } } return undef unless defined $info; $info =~ s/:.*//; uri_unescape($info); } sub password { my $self = shift; my $info = $self->userinfo; if (@_) { my $new = shift; my $user = defined($info) ? $info : ""; $user =~ s/:.*//; if (!defined($new) && !length($user)) { $self->userinfo(undef); } else { $new = "" unless defined($new); $new =~ s/%/%25/g; $self->userinfo("$user:$new"); } } return undef unless defined $info; return undef unless $info =~ s/^[^:]*://; uri_unescape($info); } 1; ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������darwin-perl-lib/URI/data.pm�������������������������������������������������������������������������000444 �000765 �000024 �00000006531 13167163507 017675� 0����������������������������������������������������������������������������������������������������ustar�00ocsinventory��������������������staff���������������������������000000 �000000 ������������������������������������������������������������������������������������������������������������������������������������������������������������������������package URI::data; # RFC 2397 use strict; use warnings; use parent 'URI'; our $VERSION = '1.72'; $VERSION = eval $VERSION; use MIME::Base64 qw(encode_base64 decode_base64); use URI::Escape qw(uri_unescape); sub media_type { my $self = shift; my $opaque = $self->opaque; $opaque =~ /^([^,]*),?/ or die; my $old = $1; my $base64; $base64 = $1 if $old =~ s/(;base64)$//i; if (@_) { my $new = shift; $new = "" unless defined $new; $new =~ s/%/%25/g; $new =~ s/,/%2C/g; $base64 = "" unless defined $base64; $opaque =~ s/^[^,]*,?/$new$base64,/; $self->opaque($opaque); } return uri_unescape($old) if $old; # media_type can't really be "0" "text/plain;charset=US-ASCII"; # default type } sub data { my $self = shift; my($enc, $data) = split(",", $self->opaque, 2); unless (defined $data) { $data = ""; $enc = "" unless defined $enc; } my $base64 = ($enc =~ /;base64$/i); if (@_) { $enc =~ s/;base64$//i if $base64; my $new = shift; $new = "" unless defined $new; my $uric_count = _uric_count($new); my $urienc_len = $uric_count + (length($new) - $uric_count) * 3; my $base64_len = int((length($new)+2) / 3) * 4; $base64_len += 7; # because of ";base64" marker if ($base64_len < $urienc_len || $_[0]) { $enc .= ";base64"; $new = encode_base64($new, ""); } else { $new =~ s/%/%25/g; } $self->opaque("$enc,$new"); } return unless defined wantarray; $data = uri_unescape($data); return $base64 ? decode_base64($data) : $data; } # I could not find a better way to interpolate the tr/// chars from # a variable. my $ENC = $URI::uric; $ENC =~ s/%//; eval <<EOT; die $@ if $@; sub _uric_count { \$_[0] =~ tr/$ENC//; } EOT 1; __END__ =head1 NAME URI::data - URI that contains immediate data =head1 SYNOPSIS use URI; $u = URI->new("data:"); $u->media_type("image/gif"); $u->data(scalar(`cat camel.gif`)); print "$u\n"; open(XV, "|xv -") and print XV $u->data; =head1 DESCRIPTION The C<URI::data> class supports C<URI> objects belonging to the I<data> URI scheme. The I<data> URI scheme is specified in RFC 2397. It allows inclusion of small data items as "immediate" data, as if it had been included externally. Examples: data:,Perl%20is%20good data:image/gif;base64,R0lGODdhIAAgAIAAAAAAAPj8+CwAAAAAI AAgAAAClYyPqcu9AJyCjtIKc5w5xP14xgeO2tlY3nWcajmZZdeJcG Kxrmimms1KMTa1Wg8UROx4MNUq1HrycMjHT9b6xKxaFLM6VRKzI+p KS9XtXpcbdun6uWVxJXA8pNPkdkkxhxc21LZHFOgD2KMoQXa2KMWI JtnE2KizVUkYJVZZ1nczBxXlFopZBtoJ2diXGdNUymmJdFMAADs= C<URI> objects belonging to the data scheme support the common methods (described in L<URI>) and the following two scheme-specific methods: =over 4 =item $uri->media_type( [$new_media_type] ) Can be used to get or set the media type specified in the URI. If no media type is specified, then the default C<"text/plain;charset=US-ASCII"> is returned. =item $uri->data( [$new_data] ) Can be used to get or set the data contained in the URI. The data is passed unescaped (in binary form). The decision about whether to base64 encode the data in the URI is taken automatically, based on the encoding that produces the shorter URI string. =back =head1 SEE ALSO L<URI> =head1 COPYRIGHT Copyright 1995-1998 Gisle Aas. This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. =cut �����������������������������������������������������������������������������������������������������������������������������������������������������������������������darwin-perl-lib/URI/Escape.pm�����������������������������������������������������������������������000444 �000765 �000024 �00000015625 13167163507 020170� 0����������������������������������������������������������������������������������������������������ustar�00ocsinventory��������������������staff���������������������������000000 �000000 ������������������������������������������������������������������������������������������������������������������������������������������������������������������������package URI::Escape; use strict; use warnings; =head1 NAME URI::Escape - Percent-encode and percent-decode unsafe characters =head1 SYNOPSIS use URI::Escape; $safe = uri_escape("10% is enough\n"); $verysafe = uri_escape("foo", "\0-\377"); $str = uri_unescape($safe); =head1 DESCRIPTION This module provides functions to percent-encode and percent-decode URI strings as defined by RFC 3986. Percent-encoding URI's is informally called "URI escaping". This is the terminology used by this module, which predates the formalization of the terms by the RFC by several years. A URI consists of a restricted set of characters. The restricted set of characters consists of digits, letters, and a few graphic symbols chosen from those common to most of the character encodings and input facilities available to Internet users. They are made up of the "unreserved" and "reserved" character sets as defined in RFC 3986. unreserved = ALPHA / DIGIT / "-" / "." / "_" / "~" reserved = ":" / "/" / "?" / "#" / "[" / "]" / "@" "!" / "$" / "&" / "'" / "(" / ")" / "*" / "+" / "," / ";" / "=" In addition, any byte (octet) can be represented in a URI by an escape sequence: a triplet consisting of the character "%" followed by two hexadecimal digits. A byte can also be represented directly by a character, using the US-ASCII character for that octet. Some of the characters are I<reserved> for use as delimiters or as part of certain URI components. These must be escaped if they are to be treated as ordinary data. Read RFC 3986 for further details. The functions provided (and exported by default) from this module are: =over 4 =item uri_escape( $string ) =item uri_escape( $string, $unsafe ) Replaces each unsafe character in the $string with the corresponding escape sequence and returns the result. The $string argument should be a string of bytes. The uri_escape() function will croak if given a characters with code above 255. Use uri_escape_utf8() if you know you have such chars or/and want chars in the 128 .. 255 range treated as UTF-8. The uri_escape() function takes an optional second argument that overrides the set of characters that are to be escaped. The set is specified as a string that can be used in a regular expression character class (between [ ]). E.g.: "\x00-\x1f\x7f-\xff" # all control and hi-bit characters "a-z" # all lower case characters "^A-Za-z" # everything not a letter The default set of characters to be escaped is all those which are I<not> part of the C<unreserved> character class shown above as well as the reserved characters. I.e. the default is: "^A-Za-z0-9\-\._~" =item uri_escape_utf8( $string ) =item uri_escape_utf8( $string, $unsafe ) Works like uri_escape(), but will encode chars as UTF-8 before escaping them. This makes this function able to deal with characters with code above 255 in $string. Note that chars in the 128 .. 255 range will be escaped differently by this function compared to what uri_escape() would. For chars in the 0 .. 127 range there is no difference. Equivalent to: utf8::encode($string); my $uri = uri_escape($string); Note: JavaScript has a function called escape() that produces the sequence "%uXXXX" for chars in the 256 .. 65535 range. This function has really nothing to do with URI escaping but some folks got confused since it "does the right thing" in the 0 .. 255 range. Because of this you sometimes see "URIs" with these kind of escapes. The JavaScript encodeURIComponent() function is similar to uri_escape_utf8(). =item uri_unescape($string,...) Returns a string with each %XX sequence replaced with the actual byte (octet). This does the same as: $string =~ s/%([0-9A-Fa-f]{2})/chr(hex($1))/eg; but does not modify the string in-place as this RE would. Using the uri_unescape() function instead of the RE might make the code look cleaner and is a few characters less to type. In a simple benchmark test I did, calling the function (instead of the inline RE above) if a few chars were unescaped was something like 40% slower, and something like 700% slower if none were. If you are going to unescape a lot of times it might be a good idea to inline the RE. If the uri_unescape() function is passed multiple strings, then each one is returned unescaped. =back The module can also export the C<%escapes> hash, which contains the mapping from all 256 bytes to the corresponding escape codes. Lookup in this hash is faster than evaluating C<sprintf("%%%02X", ord($byte))> each time. =head1 SEE ALSO L<URI> =head1 COPYRIGHT Copyright 1995-2004 Gisle Aas. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. =cut use Exporter 5.57 'import'; our %escapes; our @EXPORT = qw(uri_escape uri_unescape uri_escape_utf8); our @EXPORT_OK = qw(%escapes); our $VERSION = "3.31"; use Carp (); # Build a char->hex map for (0..255) { $escapes{chr($_)} = sprintf("%%%02X", $_); } my %subst; # compiled patterns my %Unsafe = ( RFC2732 => qr/[^A-Za-z0-9\-_.!~*'()]/, RFC3986 => qr/[^A-Za-z0-9\-\._~]/, ); sub uri_escape { my($text, $patn) = @_; return undef unless defined $text; if (defined $patn){ unless (exists $subst{$patn}) { # Because we can't compile the regex we fake it with a cached sub (my $tmp = $patn) =~ s,/,\\/,g; eval "\$subst{\$patn} = sub {\$_[0] =~ s/([$tmp])/\$escapes{\$1} || _fail_hi(\$1)/ge; }"; Carp::croak("uri_escape: $@") if $@; } &{$subst{$patn}}($text); } else { $text =~ s/($Unsafe{RFC3986})/$escapes{$1} || _fail_hi($1)/ge; } $text; } sub _fail_hi { my $chr = shift; Carp::croak(sprintf "Can't escape \\x{%04X}, try uri_escape_utf8() instead", ord($chr)); } sub uri_escape_utf8 { my $text = shift; return undef unless defined $text; utf8::encode($text); return uri_escape($text, @_); } sub uri_unescape { # Note from RFC1630: "Sequences which start with a percent sign # but are not followed by two hexadecimal characters are reserved # for future extension" my $str = shift; if (@_ && wantarray) { # not executed for the common case of a single argument my @str = ($str, @_); # need to copy for (@str) { s/%([0-9A-Fa-f]{2})/chr(hex($1))/eg; } return @str; } $str =~ s/%([0-9A-Fa-f]{2})/chr(hex($1))/eg if defined $str; $str; } # XXX FIXME escape_char is buggy as it assigns meaning to the string's storage format. sub escape_char { # Old versions of utf8::is_utf8() didn't properly handle magical vars (e.g. $1). # The following forces a fetch to occur beforehand. my $dummy = substr($_[0], 0, 0); if (utf8::is_utf8($_[0])) { my $s = shift; utf8::encode($s); unshift(@_, $s); } return join '', @URI::Escape::escapes{split //, $_[0]}; } 1; �����������������������������������������������������������������������������������������������������������darwin-perl-lib/URI/file/���������������������������������������������������������������������������000755 �000765 �000024 �00000000000 13167163507 017342� 5����������������������������������������������������������������������������������������������������ustar�00ocsinventory��������������������staff���������������������������000000 �000000 ������������������������������������������������������������������������������������������������������������������������������������������������������������������������darwin-perl-lib/URI/file.pm�������������������������������������������������������������������������000444 �000765 �000024 �00000023041 13167163507 017676� 0����������������������������������������������������������������������������������������������������ustar�00ocsinventory��������������������staff���������������������������000000 �000000 ������������������������������������������������������������������������������������������������������������������������������������������������������������������������package URI::file; use strict; use warnings; use parent 'URI::_generic'; our $VERSION = "4.21"; use URI::Escape qw(uri_unescape); our $DEFAULT_AUTHORITY = ""; # Map from $^O values to implementation classes. The Unix # class is the default. our %OS_CLASS = ( os2 => "OS2", mac => "Mac", MacOS => "Mac", MSWin32 => "Win32", win32 => "Win32", msdos => "FAT", dos => "FAT", qnx => "QNX", ); sub os_class { my($OS) = shift || $^O; my $class = "URI::file::" . ($OS_CLASS{$OS} || "Unix"); no strict 'refs'; unless (%{"$class\::"}) { eval "require $class"; die $@ if $@; } $class; } sub host { uri_unescape(shift->authority(@_)) } sub new { my($class, $path, $os) = @_; os_class($os)->new($path); } sub new_abs { my $class = shift; my $file = $class->new(@_); return $file->abs($class->cwd) unless $$file =~ /^file:/; $file; } sub cwd { my $class = shift; require Cwd; my $cwd = Cwd::cwd(); $cwd = VMS::Filespec::unixpath($cwd) if $^O eq 'VMS'; $cwd = $class->new($cwd); $cwd .= "/" unless substr($cwd, -1, 1) eq "/"; $cwd; } sub canonical { my $self = shift; my $other = $self->SUPER::canonical; my $scheme = $other->scheme; my $auth = $other->authority; return $other if !defined($scheme) && !defined($auth); # relative if (!defined($auth) || $auth eq "" || lc($auth) eq "localhost" || (defined($DEFAULT_AUTHORITY) && lc($auth) eq lc($DEFAULT_AUTHORITY)) ) { # avoid cloning if $auth already match if ((defined($auth) || defined($DEFAULT_AUTHORITY)) && (!defined($auth) || !defined($DEFAULT_AUTHORITY) || $auth ne $DEFAULT_AUTHORITY) ) { $other = $other->clone if $self == $other; $other->authority($DEFAULT_AUTHORITY); } } $other; } sub file { my($self, $os) = @_; os_class($os)->file($self); } sub dir { my($self, $os) = @_; os_class($os)->dir($self); } 1; __END__ =head1 NAME URI::file - URI that maps to local file names =head1 SYNOPSIS use URI::file; $u1 = URI->new("file:/foo/bar"); $u2 = URI->new("foo/bar", "file"); $u3 = URI::file->new($path); $u4 = URI::file->new("c:\\windows\\", "win32"); $u1->file; $u1->file("mac"); =head1 DESCRIPTION The C<URI::file> class supports C<URI> objects belonging to the I<file> URI scheme. This scheme allows us to map the conventional file names found on various computer systems to the URI name space. An old specification of the I<file> URI scheme is found in RFC 1738. Some older background information is also in RFC 1630. There are no newer specifications as far as I know. If you simply want to construct I<file> URI objects from URI strings, use the normal C<URI> constructor. If you want to construct I<file> URI objects from the actual file names used by various systems, then use one of the following C<URI::file> constructors: =over 4 =item $u = URI::file->new( $filename, [$os] ) Maps a file name to the I<file:> URI name space, creates a URI object and returns it. The $filename is interpreted as belonging to the indicated operating system ($os), which defaults to the value of the $^O variable. The $filename can be either absolute or relative, and the corresponding type of URI object for $os is returned. =item $u = URI::file->new_abs( $filename, [$os] ) Same as URI::file->new, but makes sure that the URI returned represents an absolute file name. If the $filename argument is relative, then the name is resolved relative to the current directory, i.e. this constructor is really the same as: URI::file->new($filename)->abs(URI::file->cwd); =item $u = URI::file->cwd Returns a I<file> URI that represents the current working directory. See L<Cwd>. =back The following methods are supported for I<file> URI (in addition to the common and generic methods described in L<URI>): =over 4 =item $u->file( [$os] ) Returns a file name. It maps from the URI name space to the file name space of the indicated operating system. It might return C<undef> if the name can not be represented in the indicated file system. =item $u->dir( [$os] ) Some systems use a different form for names of directories than for plain files. Use this method if you know you want to use the name for a directory. =back The C<URI::file> module can be used to map generic file names to names suitable for the current system. As such, it can work as a nice replacement for the C<File::Spec> module. For instance, the following code translates the UNIX-style file name F<Foo/Bar.pm> to a name suitable for the local system: $file = URI::file->new("Foo/Bar.pm", "unix")->file; die "Can't map filename Foo/Bar.pm for $^O" unless defined $file; open(FILE, $file) || die "Can't open '$file': $!"; # do something with FILE =head1 MAPPING NOTES Most computer systems today have hierarchically organized file systems. Mapping the names used in these systems to the generic URI syntax allows us to work with relative file URIs that behave as they should when resolved using the generic algorithm for URIs (specified in RFC 2396). Mapping a file name to the generic URI syntax involves mapping the path separator character to "/" and encoding any reserved characters that appear in the path segments of the file name. If path segments consisting of the strings "." or ".." have a different meaning than what is specified for generic URIs, then these must be encoded as well. If the file system has device, volume or drive specifications as the root of the name space, then it makes sense to map them to the authority field of the generic URI syntax. This makes sure that relative URIs can not be resolved "above" them, i.e. generally how relative file names work in those systems. Another common use of the authority field is to encode the host on which this file name is valid. The host name "localhost" is special and generally has the same meaning as a missing or empty authority field. This use is in conflict with using it as a device specification, but can often be resolved for device specifications having characters not legal in plain host names. File name to URI mapping in normally not one-to-one. There are usually many URIs that map to any given file name. For instance, an authority of "localhost" maps the same as a URI with a missing or empty authority. Example 1: The Mac classic (Mac OS 9 and earlier) used ":" as path separator, but not in the same way as a generic URI. ":foo" was a relative name. "foo:bar" was an absolute name. Also, path segments could contain the "/" character as well as the literal "." or "..". So the mapping looks like this: Mac classic URI ---------- ------------------- :foo:bar <==> foo/bar : <==> ./ ::foo:bar <==> ../foo/bar ::: <==> ../../ foo:bar <==> file:/foo/bar foo:bar: <==> file:/foo/bar/ .. <==> %2E%2E <undef> <== / foo/ <== file:/foo%2F ./foo.txt <== file:/.%2Ffoo.txt Note that if you want a relative URL, you *must* begin the path with a :. Any path that begins with [^:] is treated as absolute. Example 2: The UNIX file system is easy to map, as it uses the same path separator as URIs, has a single root, and segments of "." and ".." have the same meaning. URIs that have the character "\0" or "/" as part of any path segment can not be turned into valid UNIX file names. UNIX URI ---------- ------------------ foo/bar <==> foo/bar /foo/bar <==> file:/foo/bar /foo/bar <== file://localhost/foo/bar file: ==> ./file: <undef> <== file:/fo%00/bar / <==> file:/ =cut RFC 1630 [...] There is clearly a danger of confusion that a link made to a local file should be followed by someone on a different system, with unexpected and possibly harmful results. Therefore, the convention is that even a "file" URL is provided with a host part. This allows a client on another system to know that it cannot access the file system, or perhaps to use some other local mechanism to access the file. The special value "localhost" is used in the host field to indicate that the filename should really be used on whatever host one is. This for example allows links to be made to files which are distributed on many machines, or to "your unix local password file" subject of course to consistency across the users of the data. A void host field is equivalent to "localhost". =head1 CONFIGURATION VARIABLES The following configuration variables influence how the class and its methods behave: =over =item %URI::file::OS_CLASS This hash maps OS identifiers to implementation classes. You might want to add or modify this if you want to plug in your own file handler class. Normally the keys should match the $^O values in use. If there is no mapping then the "Unix" implementation is used. =item $URI::file::DEFAULT_AUTHORITY This determine what "authority" string to include in absolute file URIs. It defaults to "". If you prefer verbose URIs you might set it to be "localhost". Setting this value to C<undef> force behaviour compatible to URI v1.31 and earlier. In this mode host names in UNC paths and drive letters are mapped to the authority component on Windows, while we produce authority-less URIs on Unix. =back =head1 SEE ALSO L<URI>, L<File::Spec>, L<perlport> =head1 COPYRIGHT Copyright 1995-1998,2004 Gisle Aas. This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. =cut �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������darwin-perl-lib/URI/ftp.pm��������������������������������������������������������������������������000444 �000765 �000024 �00000002072 13167163507 017551� 0����������������������������������������������������������������������������������������������������ustar�00ocsinventory��������������������staff���������������������������000000 �000000 ������������������������������������������������������������������������������������������������������������������������������������������������������������������������package URI::ftp; use strict; use warnings; our $VERSION = '1.72'; $VERSION = eval $VERSION; use parent qw(URI::_server URI::_userpass); sub default_port { 21 } sub path { shift->path_query(@_) } # XXX sub _user { shift->SUPER::user(@_); } sub _password { shift->SUPER::password(@_); } sub user { my $self = shift; my $user = $self->_user(@_); $user = "anonymous" unless defined $user; $user; } sub password { my $self = shift; my $pass = $self->_password(@_); unless (defined $pass) { my $user = $self->user; if ($user eq 'anonymous' || $user eq 'ftp') { # anonymous ftp login password # If there is no ftp anonymous password specified # then we'll just use 'anonymous@' # We don't try to send the read e-mail address because: # - We want to remain anonymous # - We want to stop SPAM # - We don't want to let ftp sites to discriminate by the user, # host, country or ftp client being used. $pass = 'anonymous@'; } } $pass; } 1; ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������darwin-perl-lib/URI/gopher.pm�����������������������������������������������������������������������000444 �000765 �000024 �00000004626 13167163507 020253� 0����������������������������������������������������������������������������������������������������ustar�00ocsinventory��������������������staff���������������������������000000 �000000 ������������������������������������������������������������������������������������������������������������������������������������������������������������������������package URI::gopher; # <draft-murali-url-gopher>, Dec 4, 1996 use strict; use warnings; our $VERSION = '1.72'; $VERSION = eval $VERSION; use parent 'URI::_server'; use URI::Escape qw(uri_unescape); # A Gopher URL follows the common internet scheme syntax as defined in # section 4.3 of [RFC-URL-SYNTAX]: # # gopher://<host>[:<port>]/<gopher-path> # # where # # <gopher-path> := <gopher-type><selector> | # <gopher-type><selector>%09<search> | # <gopher-type><selector>%09<search>%09<gopher+_string> # # <gopher-type> := '0' | '1' | '2' | '3' | '4' | '5' | '6' | '7' # '8' | '9' | '+' | 'I' | 'g' | 'T' # # <selector> := *pchar Refer to RFC 1808 [4] # <search> := *pchar # <gopher+_string> := *uchar Refer to RFC 1738 [3] # # If the optional port is omitted, the port defaults to 70. sub default_port { 70 } sub _gopher_type { my $self = shift; my $path = $self->path_query; $path =~ s,^/,,; my $gtype = $1 if $path =~ s/^(.)//s; if (@_) { my $new_type = shift; if (defined($new_type)) { Carp::croak("Bad gopher type '$new_type'") unless length($new_type) == 1; substr($path, 0, 0) = $new_type; $self->path_query($path); } else { Carp::croak("Can't delete gopher type when selector is present") if length($path); $self->path_query(undef); } } return $gtype; } sub gopher_type { my $self = shift; my $gtype = $self->_gopher_type(@_); $gtype = "1" unless defined $gtype; $gtype; } sub gtype { goto &gopher_type } # URI::URL compatibility sub selector { shift->_gfield(0, @_) } sub search { shift->_gfield(1, @_) } sub string { shift->_gfield(2, @_) } sub _gfield { my $self = shift; my $fno = shift; my $path = $self->path_query; # not according to spec., but many popular browsers accept # gopher URLs with a '?' before the search string. $path =~ s/\?/\t/; $path = uri_unescape($path); $path =~ s,^/,,; my $gtype = $1 if $path =~ s,^(.),,s; my @path = split(/\t/, $path, 3); if (@_) { # modify my $new = shift; $path[$fno] = $new; pop(@path) while @path && !defined($path[-1]); for (@path) { $_="" unless defined } $path = $gtype; $path = "1" unless defined $path; $path .= join("\t", @path); $self->path_query($path); } $path[$fno]; } 1; ����������������������������������������������������������������������������������������������������������darwin-perl-lib/URI/Heuristic.pm��������������������������������������������������������������������000444 �000765 �000024 �00000014574 13167163507 020731� 0����������������������������������������������������������������������������������������������������ustar�00ocsinventory��������������������staff���������������������������000000 �000000 ������������������������������������������������������������������������������������������������������������������������������������������������������������������������package URI::Heuristic; =head1 NAME URI::Heuristic - Expand URI using heuristics =head1 SYNOPSIS use URI::Heuristic qw(uf_uristr); $u = uf_uristr("perl"); # http://www.perl.com $u = uf_uristr("www.sol.no/sol"); # http://www.sol.no/sol $u = uf_uristr("aas"); # http://www.aas.no $u = uf_uristr("ftp.funet.fi"); # ftp://ftp.funet.fi $u = uf_uristr("/etc/passwd"); # file:/etc/passwd =head1 DESCRIPTION This module provides functions that expand strings into real absolute URIs using some built-in heuristics. Strings that already represent absolute URIs (i.e. that start with a C<scheme:> part) are never modified and are returned unchanged. The main use of these functions is to allow abbreviated URIs similar to what many web browsers allow for URIs typed in by the user. The following functions are provided: =over 4 =item uf_uristr($str) Tries to make the argument string into a proper absolute URI string. The "uf_" prefix stands for "User Friendly". Under MacOS, it assumes that any string with a common URL scheme (http, ftp, etc.) is a URL rather than a local path. So don't name your volumes after common URL schemes and expect uf_uristr() to construct valid file: URL's on those volumes for you, because it won't. =item uf_uri($str) Works the same way as uf_uristr() but returns a C<URI> object. =back =head1 ENVIRONMENT If the hostname portion of a URI does not contain any dots, then certain qualified guesses are made. These guesses are governed by the following environment variables: =over 10 =item COUNTRY The two-letter country code (ISO 3166) for your location. If the domain name of your host ends with two letters, then it is taken to be the default country. See also L<Locale::Country>. =item HTTP_ACCEPT_LANGUAGE, LC_ALL, LANG If COUNTRY is not set, these standard environment variables are examined and country (not language) information possibly found in them is used as the default country. =item URL_GUESS_PATTERN Contains a space-separated list of URL patterns to try. The string "ACME" is for some reason used as a placeholder for the host name in the URL provided. Example: URL_GUESS_PATTERN="www.ACME.no www.ACME.se www.ACME.com" export URL_GUESS_PATTERN Specifying URL_GUESS_PATTERN disables any guessing rules based on country. An empty URL_GUESS_PATTERN disables any guessing that involves host name lookups. =back =head1 COPYRIGHT Copyright 1997-1998, Gisle Aas This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. =cut use strict; use warnings; use Exporter 5.57 'import'; our @EXPORT_OK = qw(uf_uri uf_uristr uf_url uf_urlstr); our $VERSION = "4.20"; our ($MY_COUNTRY, $DEBUG); sub MY_COUNTRY() { for ($MY_COUNTRY) { return $_ if defined; # First try the environment. $_ = $ENV{COUNTRY}; return $_ if defined; # Try the country part of LC_ALL and LANG from environment my @srcs = ($ENV{LC_ALL}, $ENV{LANG}); # ...and HTTP_ACCEPT_LANGUAGE before those if present if (my $httplang = $ENV{HTTP_ACCEPT_LANGUAGE}) { # TODO: q-value processing/ordering for $httplang (split(/\s*,\s*/, $httplang)) { if ($httplang =~ /^\s*([a-zA-Z]+)[_-]([a-zA-Z]{2})\s*$/) { unshift(@srcs, "${1}_${2}"); last; } } } for (@srcs) { next unless defined; return lc($1) if /^[a-zA-Z]+_([a-zA-Z]{2})(?:[.@]|$)/; } # Last bit of domain name. This may access the network. require Net::Domain; my $fqdn = Net::Domain::hostfqdn(); $_ = lc($1) if $fqdn =~ /\.([a-zA-Z]{2})$/; return $_ if defined; # Give up. Defined but false. return ($_ = 0); } } our %LOCAL_GUESSING = ( 'us' => [qw(www.ACME.gov www.ACME.mil)], 'gb' => [qw(www.ACME.co.uk www.ACME.org.uk www.ACME.ac.uk)], 'au' => [qw(www.ACME.com.au www.ACME.org.au www.ACME.edu.au)], 'il' => [qw(www.ACME.co.il www.ACME.org.il www.ACME.net.il)], # send corrections and new entries to <gisle@aas.no> ); # Backwards compatibility; uk != United Kingdom in ISO 3166 $LOCAL_GUESSING{uk} = $LOCAL_GUESSING{gb}; sub uf_uristr ($) { local($_) = @_; print STDERR "uf_uristr: resolving $_\n" if $DEBUG; return unless defined; s/^\s+//; s/\s+$//; if (/^(www|web|home)[a-z0-9-]*(?:\.|$)/i) { $_ = "http://$_"; } elsif (/^(ftp|gopher|news|wais|https|http)[a-z0-9-]*(?:\.|$)/i) { $_ = lc($1) . "://$_"; } elsif ($^O ne "MacOS" && (m,^/, || # absolute file name m,^\.\.?/, || # relative file name m,^[a-zA-Z]:[/\\],) # dosish file name ) { $_ = "file:$_"; } elsif ($^O eq "MacOS" && m/:/) { # potential MacOS file name unless (m/^(ftp|gopher|news|wais|http|https|mailto):/) { require URI::file; my $a = URI::file->new($_)->as_string; $_ = ($a =~ m/^file:/) ? $a : "file:$a"; } } elsif (/^\w+([\.\-]\w+)*\@(\w+\.)+\w{2,3}$/) { $_ = "mailto:$_"; } elsif (!/^[a-zA-Z][a-zA-Z0-9.+\-]*:/) { # no scheme specified if (s/^([-\w]+(?:\.[-\w]+)*)([\/:\?\#]|$)/$2/) { my $host = $1; my $scheme = "http"; if (/^:(\d+)\b/) { # Some more or less well known ports if ($1 =~ /^[56789]?443$/) { $scheme = "https"; } elsif ($1 eq "21") { $scheme = "ftp"; } } if ($host !~ /\./ && $host ne "localhost") { my @guess; if (exists $ENV{URL_GUESS_PATTERN}) { @guess = map { s/\bACME\b/$host/; $_ } split(' ', $ENV{URL_GUESS_PATTERN}); } else { if (MY_COUNTRY()) { my $special = $LOCAL_GUESSING{MY_COUNTRY()}; if ($special) { my @special = @$special; push(@guess, map { s/\bACME\b/$host/; $_ } @special); } else { push(@guess, "www.$host." . MY_COUNTRY()); } } push(@guess, map "www.$host.$_", "com", "org", "net", "edu", "int"); } my $guess; for $guess (@guess) { print STDERR "uf_uristr: gethostbyname('$guess.')..." if $DEBUG; if (gethostbyname("$guess.")) { print STDERR "yes\n" if $DEBUG; $host = $guess; last; } print STDERR "no\n" if $DEBUG; } } $_ = "$scheme://$host$_"; } else { # pure junk, just return it unchanged... } } print STDERR "uf_uristr: ==> $_\n" if $DEBUG; $_; } sub uf_uri ($) { require URI; URI->new(uf_uristr($_[0])); } # legacy *uf_urlstr = \*uf_uristr; sub uf_url ($) { require URI::URL; URI::URL->new(uf_uristr($_[0])); } 1; ������������������������������������������������������������������������������������������������������������������������������������darwin-perl-lib/URI/http.pm�������������������������������������������������������������������������000444 �000765 �000024 �00000000703 13167163507 017736� 0����������������������������������������������������������������������������������������������������ustar�00ocsinventory��������������������staff���������������������������000000 �000000 ������������������������������������������������������������������������������������������������������������������������������������������������������������������������package URI::http; use strict; use warnings; our $VERSION = '1.72'; $VERSION = eval $VERSION; use parent 'URI::_server'; sub default_port { 80 } sub canonical { my $self = shift; my $other = $self->SUPER::canonical; my $slash_path = defined($other->authority) && !length($other->path) && !defined($other->query); if ($slash_path) { $other = $other->clone if $other == $self; $other->path("/"); } $other; } 1; �������������������������������������������������������������darwin-perl-lib/URI/https.pm������������������������������������������������������������������������000444 �000765 �000024 �00000000252 13167163507 020120� 0����������������������������������������������������������������������������������������������������ustar�00ocsinventory��������������������staff���������������������������000000 �000000 ������������������������������������������������������������������������������������������������������������������������������������������������������������������������package URI::https; use strict; use warnings; our $VERSION = '1.72'; $VERSION = eval $VERSION; use parent 'URI::http'; sub default_port { 443 } sub secure { 1 } 1; ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������darwin-perl-lib/URI/IRI.pm��������������������������������������������������������������������������000444 �000765 �000024 �00000001464 13167163507 017407� 0����������������������������������������������������������������������������������������������������ustar�00ocsinventory��������������������staff���������������������������000000 �000000 ������������������������������������������������������������������������������������������������������������������������������������������������������������������������package URI::IRI; # Experimental use strict; use warnings; use URI (); use overload '""' => sub { shift->as_string }; our $VERSION = '1.72'; $VERSION = eval $VERSION; sub new { my($class, $uri, $scheme) = @_; utf8::upgrade($uri); return bless { uri => URI->new($uri, $scheme), }, $class; } sub clone { my $self = shift; return bless { uri => $self->{uri}->clone, }, ref($self); } sub as_string { my $self = shift; return $self->{uri}->as_iri; } our $AUTOLOAD; sub AUTOLOAD { my $method = substr($AUTOLOAD, rindex($AUTOLOAD, '::')+2); # We create the function here so that it will not need to be # autoloaded the next time. no strict 'refs'; *$method = sub { shift->{uri}->$method(@_) }; goto &$method; } sub DESTROY {} # avoid AUTOLOADing it 1; ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������darwin-perl-lib/URI/ldap.pm�������������������������������������������������������������������������000444 �000765 �000024 �00000005606 13167163507 017706� 0����������������������������������������������������������������������������������������������������ustar�00ocsinventory��������������������staff���������������������������000000 �000000 ������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Copyright (c) 1998 Graham Barr <gbarr@pobox.com>. All rights reserved. # This program is free software; you can redistribute it and/or # modify it under the same terms as Perl itself. package URI::ldap; use strict; use warnings; our $VERSION = '1.72'; $VERSION = eval $VERSION; use parent qw(URI::_ldap URI::_server); sub default_port { 389 } sub _nonldap_canonical { my $self = shift; $self->URI::_server::canonical(@_); } 1; __END__ =head1 NAME URI::ldap - LDAP Uniform Resource Locators =head1 SYNOPSIS use URI; $uri = URI->new("ldap:$uri_string"); $dn = $uri->dn; $filter = $uri->filter; @attr = $uri->attributes; $scope = $uri->scope; %extn = $uri->extensions; $uri = URI->new("ldap:"); # start empty $uri->host("ldap.itd.umich.edu"); $uri->dn("o=University of Michigan,c=US"); $uri->attributes(qw(postalAddress)); $uri->scope('sub'); $uri->filter('(cn=Babs Jensen)'); print $uri->as_string,"\n"; =head1 DESCRIPTION C<URI::ldap> provides an interface to parse an LDAP URI into its constituent parts and also to build a URI as described in RFC 2255. =head1 METHODS C<URI::ldap> supports all the generic and server methods defined by L<URI>, plus the following. Each of the following methods can be used to set or get the value in the URI. The values are passed in unescaped form. None of these return undefined values, but elements without a default can be empty. If arguments are given, then a new value is set for the given part of the URI. =over 4 =item $uri->dn( [$new_dn] ) Sets or gets the I<Distinguished Name> part of the URI. The DN identifies the base object of the LDAP search. =item $uri->attributes( [@new_attrs] ) Sets or gets the list of attribute names which are returned by the search. =item $uri->scope( [$new_scope] ) Sets or gets the scope to be used by the search. The value can be one of C<"base">, C<"one"> or C<"sub">. If none is given in the URI then the return value defaults to C<"base">. =item $uri->_scope( [$new_scope] ) Same as scope(), but does not default to anything. =item $uri->filter( [$new_filter] ) Sets or gets the filter to be used by the search. If none is given in the URI then the return value defaults to C<"(objectClass=*)">. =item $uri->_filter( [$new_filter] ) Same as filter(), but does not default to anything. =item $uri->extensions( [$etype => $evalue,...] ) Sets or gets the extensions used for the search. The list passed should be in the form etype1 => evalue1, etype2 => evalue2,... This is also the form of list that is returned. =back =head1 SEE ALSO L<http://tools.ietf.org/html/rfc2255> =head1 AUTHOR Graham Barr E<lt>F<gbarr@pobox.com>E<gt> Slightly modified by Gisle Aas to fit into the URI distribution. =head1 COPYRIGHT Copyright (c) 1998 Graham Barr. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. =cut ��������������������������������������������������������������������������������������������������������������������������darwin-perl-lib/URI/ldapi.pm������������������������������������������������������������������������000444 �000765 �000024 �00000000723 13167163507 020052� 0����������������������������������������������������������������������������������������������������ustar�00ocsinventory��������������������staff���������������������������000000 �000000 ������������������������������������������������������������������������������������������������������������������������������������������������������������������������package URI::ldapi; use strict; use warnings; our $VERSION = '1.72'; $VERSION = eval $VERSION; use parent qw(URI::_ldap URI::_generic); require URI::Escape; sub un_path { my $self = shift; my $old = URI::Escape::uri_unescape($self->authority); if (@_) { my $p = shift; $p =~ s/:/%3A/g; $p =~ s/\@/%40/g; $self->authority($p); } return $old; } sub _nonldap_canonical { my $self = shift; $self->URI::_generic::canonical(@_); } 1; ���������������������������������������������darwin-perl-lib/URI/ldaps.pm������������������������������������������������������������������������000444 �000765 �000024 �00000000252 13167163507 020061� 0����������������������������������������������������������������������������������������������������ustar�00ocsinventory��������������������staff���������������������������000000 �000000 ������������������������������������������������������������������������������������������������������������������������������������������������������������������������package URI::ldaps; use strict; use warnings; our $VERSION = '1.72'; $VERSION = eval $VERSION; use parent 'URI::ldap'; sub default_port { 636 } sub secure { 1 } 1; ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������darwin-perl-lib/URI/mailto.pm�����������������������������������������������������������������������000444 �000765 �000024 �00000002426 13167163507 020250� 0����������������������������������������������������������������������������������������������������ustar�00ocsinventory��������������������staff���������������������������000000 �000000 ������������������������������������������������������������������������������������������������������������������������������������������������������������������������package URI::mailto; # RFC 2368 use strict; use warnings; our $VERSION = '1.72'; $VERSION = eval $VERSION; use parent qw(URI URI::_query); sub to { my $self = shift; my @old = $self->headers; if (@_) { my @new = @old; # get rid of any other to: fields for (my $i = 0; $i < @new; $i += 2) { if (lc($new[$i] || '') eq "to") { splice(@new, $i, 2); redo; } } my $to = shift; $to = "" unless defined $to; unshift(@new, "to" => $to); $self->headers(@new); } return unless defined wantarray; my @to; while (@old) { my $h = shift @old; my $v = shift @old; push(@to, $v) if lc($h) eq "to"; } join(",", @to); } sub headers { my $self = shift; # The trick is to just treat everything as the query string... my $opaque = "to=" . $self->opaque; $opaque =~ s/\?/&/; if (@_) { my @new = @_; # strip out any "to" fields my @to; for (my $i=0; $i < @new; $i += 2) { if (lc($new[$i] || '') eq "to") { push(@to, (splice(@new, $i, 2))[1]); # remove header redo; } } my $new = join(",",@to); $new =~ s/%/%25/g; $new =~ s/\?/%3F/g; $self->opaque($new); $self->query_form(@new) if @new; } return unless defined wantarray; # I am lazy today... URI->new("mailto:?$opaque")->query_form; } 1; ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������darwin-perl-lib/URI/mms.pm��������������������������������������������������������������������������000444 �000765 �000024 �00000000227 13167163507 017554� 0����������������������������������������������������������������������������������������������������ustar�00ocsinventory��������������������staff���������������������������000000 �000000 ������������������������������������������������������������������������������������������������������������������������������������������������������������������������package URI::mms; use strict; use warnings; our $VERSION = '1.72'; $VERSION = eval $VERSION; use parent 'URI::http'; sub default_port { 1755 } 1; �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������darwin-perl-lib/URI/news.pm�������������������������������������������������������������������������000444 �000765 �000024 �00000002710 13167163507 017733� 0����������������������������������������������������������������������������������������������������ustar�00ocsinventory��������������������staff���������������������������000000 �000000 ������������������������������������������������������������������������������������������������������������������������������������������������������������������������package URI::news; # draft-gilman-news-url-01 use strict; use warnings; our $VERSION = '1.72'; $VERSION = eval $VERSION; use parent 'URI::_server'; use URI::Escape qw(uri_unescape); use Carp (); sub default_port { 119 } # newsURL = scheme ":" [ news-server ] [ refbygroup | message ] # scheme = "news" | "snews" | "nntp" # news-server = "//" server "/" # refbygroup = group [ "/" messageno [ "-" messageno ] ] # message = local-part "@" domain sub _group { my $self = shift; my $old = $self->path; if (@_) { my($group,$from,$to) = @_; if ($group =~ /\@/) { $group =~ s/^<(.*)>$/$1/; # "<" and ">" should not be part of it } $group =~ s,%,%25,g; $group =~ s,/,%2F,g; my $path = $group; if (defined $from) { $path .= "/$from"; $path .= "-$to" if defined $to; } $self->path($path); } $old =~ s,^/,,; if ($old !~ /\@/ && $old =~ s,/(.*),, && wantarray) { my $extra = $1; return (uri_unescape($old), split(/-/, $extra)); } uri_unescape($old); } sub group { my $self = shift; if (@_) { Carp::croak("Group name can't contain '\@'") if $_[0] =~ /\@/; } my @old = $self->_group(@_); return if $old[0] =~ /\@/; wantarray ? @old : $old[0]; } sub message { my $self = shift; if (@_) { Carp::croak("Message must contain '\@'") unless $_[0] =~ /\@/; } my $old = $self->_group(@_); return undef unless $old =~ /\@/; return $old; } 1; ��������������������������������������������������������darwin-perl-lib/URI/nntp.pm�������������������������������������������������������������������������000444 �000765 �000024 �00000000231 13167163507 017732� 0����������������������������������������������������������������������������������������������������ustar�00ocsinventory��������������������staff���������������������������000000 �000000 ������������������������������������������������������������������������������������������������������������������������������������������������������������������������package URI::nntp; # draft-gilman-news-url-01 use strict; use warnings; our $VERSION = '1.72'; $VERSION = eval $VERSION; use parent 'URI::news'; 1; �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������darwin-perl-lib/URI/pop.pm��������������������������������������������������������������������������000444 �000765 �000024 �00000002321 13167163507 017553� 0����������������������������������������������������������������������������������������������������ustar�00ocsinventory��������������������staff���������������������������000000 �000000 ������������������������������������������������������������������������������������������������������������������������������������������������������������������������package URI::pop; # RFC 2384 use strict; use warnings; our $VERSION = '1.72'; $VERSION = eval $VERSION; use parent 'URI::_server'; use URI::Escape qw(uri_unescape); sub default_port { 110 } #pop://<user>;auth=<auth>@<host>:<port> sub user { my $self = shift; my $old = $self->userinfo; if (@_) { my $new_info = $old; $new_info = "" unless defined $new_info; $new_info =~ s/^[^;]*//; my $new = shift; if (!defined($new) && !length($new_info)) { $self->userinfo(undef); } else { $new = "" unless defined $new; $new =~ s/%/%25/g; $new =~ s/;/%3B/g; $self->userinfo("$new$new_info"); } } return undef unless defined $old; $old =~ s/;.*//; return uri_unescape($old); } sub auth { my $self = shift; my $old = $self->userinfo; if (@_) { my $new = $old; $new = "" unless defined $new; $new =~ s/(^[^;]*)//; my $user = $1; $new =~ s/;auth=[^;]*//i; my $auth = shift; if (defined $auth) { $auth =~ s/%/%25/g; $auth =~ s/;/%3B/g; $new = ";AUTH=$auth$new"; } $self->userinfo("$user$new"); } return undef unless defined $old; $old =~ s/^[^;]*//; return uri_unescape($1) if $old =~ /;auth=(.*)/i; return; } 1; ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������darwin-perl-lib/URI/QueryParam.pm�������������������������������������������������������������������000444 �000765 �000024 �00000011427 13167163507 021052� 0����������������������������������������������������������������������������������������������������ustar�00ocsinventory��������������������staff���������������������������000000 �000000 ������������������������������������������������������������������������������������������������������������������������������������������������������������������������package URI::QueryParam; use strict; use warnings; our $VERSION = '1.72'; $VERSION = eval $VERSION; sub URI::_query::query_param { my $self = shift; my @old = $self->query_form; if (@_ == 0) { # get keys my (%seen, $i); return grep !($i++ % 2 || $seen{$_}++), @old; } my $key = shift; my @i = grep $_ % 2 == 0 && $old[$_] eq $key, 0 .. $#old; if (@_) { my @new = @old; my @new_i = @i; my @vals = map { ref($_) eq 'ARRAY' ? @$_ : $_ } @_; while (@new_i > @vals) { splice @new, pop @new_i, 2; } if (@vals > @new_i) { my $i = @new_i ? $new_i[-1] + 2 : @new; my @splice = splice @vals, @new_i, @vals - @new_i; splice @new, $i, 0, map { $key => $_ } @splice; } if (@vals) { #print "SET $new_i[0]\n"; @new[ map $_ + 1, @new_i ] = @vals; } $self->query_form(\@new); } return wantarray ? @old[map $_+1, @i] : @i ? $old[$i[0]+1] : undef; } sub URI::_query::query_param_append { my $self = shift; my $key = shift; my @vals = map { ref $_ eq 'ARRAY' ? @$_ : $_ } @_; $self->query_form($self->query_form, $key => \@vals); # XXX return; } sub URI::_query::query_param_delete { my $self = shift; my $key = shift; my @old = $self->query_form; my @vals; for (my $i = @old - 2; $i >= 0; $i -= 2) { next if $old[$i] ne $key; push(@vals, (splice(@old, $i, 2))[1]); } $self->query_form(\@old) if @vals; return wantarray ? reverse @vals : $vals[-1]; } sub URI::_query::query_form_hash { my $self = shift; my @old = $self->query_form; if (@_) { $self->query_form(@_ == 1 ? %{shift(@_)} : @_); } my %hash; while (my($k, $v) = splice(@old, 0, 2)) { if (exists $hash{$k}) { for ($hash{$k}) { $_ = [$_] unless ref($_) eq "ARRAY"; push(@$_, $v); } } else { $hash{$k} = $v; } } return \%hash; } 1; __END__ =head1 NAME URI::QueryParam - Additional query methods for URIs =head1 SYNOPSIS use URI; use URI::QueryParam; $u = URI->new("", "http"); $u->query_param(foo => 1, 2, 3); print $u->query; # prints foo=1&foo=2&foo=3 for my $key ($u->query_param) { print "$key: ", join(", ", $u->query_param($key)), "\n"; } =head1 DESCRIPTION Loading the C<URI::QueryParam> module adds some extra methods to URIs that support query methods. These methods provide an alternative interface to the $u->query_form data. The query_param_* methods have deliberately been made identical to the interface of the corresponding C<CGI.pm> methods. The following additional methods are made available: =over =item @keys = $u->query_param =item @values = $u->query_param( $key ) =item $first_value = $u->query_param( $key ) =item $u->query_param( $key, $value,... ) If $u->query_param is called with no arguments, it returns all the distinct parameter keys of the URI. In a scalar context it returns the number of distinct keys. When a $key argument is given, the method returns the parameter values with the given key. In a scalar context, only the first parameter value is returned. If additional arguments are given, they are used to update successive parameters with the given key. If any of the values provided are array references, then the array is dereferenced to get the actual values. Please note that you can supply multiple values to this method, but you cannot supply multiple keys. Do this: $uri->query_param( widget_id => 1, 5, 9 ); Do NOT do this: $uri->query_param( widget_id => 1, frobnicator_id => 99 ); =item $u->query_param_append($key, $value,...) Adds new parameters with the given key without touching any old parameters with the same key. It can be explained as a more efficient version of: $u->query_param($key, $u->query_param($key), $value,...); One difference is that this expression would return the old values of $key, whereas the query_param_append() method does not. =item @values = $u->query_param_delete($key) =item $first_value = $u->query_param_delete($key) Deletes all key/value pairs with the given key. The old values are returned. In a scalar context, only the first value is returned. Using the query_param_delete() method is slightly more efficient than the equivalent: $u->query_param($key, []); =item $hashref = $u->query_form_hash =item $u->query_form_hash( \%new_form ) Returns a reference to a hash that represents the query form's key/value pairs. If a key occurs multiple times, then the hash value becomes an array reference. Note that sequence information is lost. This means that: $u->query_form_hash($u->query_form_hash); is not necessarily a no-op, as it may reorder the key/value pairs. The values returned by the query_param() method should stay the same though. =back =head1 SEE ALSO L<URI>, L<CGI> =head1 COPYRIGHT Copyright 2002 Gisle Aas. =cut �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������darwin-perl-lib/URI/rlogin.pm�����������������������������������������������������������������������000444 �000765 �000024 �00000000233 13167163507 020247� 0����������������������������������������������������������������������������������������������������ustar�00ocsinventory��������������������staff���������������������������000000 �000000 ������������������������������������������������������������������������������������������������������������������������������������������������������������������������package URI::rlogin; use strict; use warnings; our $VERSION = '1.72'; $VERSION = eval $VERSION; use parent 'URI::_login'; sub default_port { 513 } 1; ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������darwin-perl-lib/URI/rsync.pm������������������������������������������������������������������������000444 �000765 �000024 �00000000351 13167163507 020114� 0����������������������������������������������������������������������������������������������������ustar�00ocsinventory��������������������staff���������������������������000000 �000000 ������������������������������������������������������������������������������������������������������������������������������������������������������������������������package URI::rsync; # http://rsync.samba.org/ # rsync://[USER@]HOST[:PORT]/SRC use strict; use warnings; our $VERSION = '1.72'; $VERSION = eval $VERSION; use parent qw(URI::_server URI::_userpass); sub default_port { 873 } 1; ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������darwin-perl-lib/URI/rtsp.pm�������������������������������������������������������������������������000444 �000765 �000024 �00000000227 13167163507 017750� 0����������������������������������������������������������������������������������������������������ustar�00ocsinventory��������������������staff���������������������������000000 �000000 ������������������������������������������������������������������������������������������������������������������������������������������������������������������������package URI::rtsp; use strict; use warnings; our $VERSION = '1.72'; $VERSION = eval $VERSION; use parent 'URI::http'; sub default_port { 554 } 1; �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������darwin-perl-lib/URI/rtspu.pm������������������������������������������������������������������������000444 �000765 �000024 �00000000230 13167163507 020127� 0����������������������������������������������������������������������������������������������������ustar�00ocsinventory��������������������staff���������������������������000000 �000000 ������������������������������������������������������������������������������������������������������������������������������������������������������������������������package URI::rtspu; use strict; use warnings; our $VERSION = '1.72'; $VERSION = eval $VERSION; use parent 'URI::rtsp'; sub default_port { 554 } 1; ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������darwin-perl-lib/URI/sftp.pm�������������������������������������������������������������������������000444 �000765 �000024 �00000000174 13167163507 017735� 0����������������������������������������������������������������������������������������������������ustar�00ocsinventory��������������������staff���������������������������000000 �000000 ������������������������������������������������������������������������������������������������������������������������������������������������������������������������package URI::sftp; use strict; use warnings; use parent 'URI::ssh'; our $VERSION = '1.72'; $VERSION = eval $VERSION; 1; ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������darwin-perl-lib/URI/sip.pm��������������������������������������������������������������������������000444 �000765 �000024 �00000003307 13167163507 017555� 0����������������������������������������������������������������������������������������������������ustar�00ocsinventory��������������������staff���������������������������000000 �000000 ������������������������������������������������������������������������������������������������������������������������������������������������������������������������# # Written by Ryan Kereliuk <ryker@ryker.org>. This file may be # distributed under the same terms as Perl itself. # # The RFC 3261 sip URI is <scheme>:<authority>;<params>?<query>. # package URI::sip; use strict; use warnings; use parent qw(URI::_server URI::_userpass); use URI::Escape qw(uri_unescape); our $VERSION = '1.72'; $VERSION = eval $VERSION; sub default_port { 5060 } sub authority { my $self = shift; $$self =~ m,^($URI::scheme_re:)?([^;?]*)(.*)$,os or die; my $old = $2; if (@_) { my $auth = shift; $$self = defined($1) ? $1 : ""; my $rest = $3; if (defined $auth) { $auth =~ s/([^$URI::uric])/ URI::Escape::escape_char($1)/ego; $$self .= "$auth"; } $$self .= $rest; } $old; } sub params_form { my $self = shift; $$self =~ m,^((?:$URI::scheme_re:)?)(?:([^;?]*))?(;[^?]*)?(.*)$,os or die; my $paramstr = $3; if (@_) { my @args = @_; $$self = $1 . $2; my $rest = $4; my @new; for (my $i=0; $i < @args; $i += 2) { push(@new, "$args[$i]=$args[$i+1]"); } $paramstr = join(";", @new); $$self .= ";" . $paramstr . $rest; } $paramstr =~ s/^;//o; return split(/[;=]/, $paramstr); } sub params { my $self = shift; $$self =~ m,^((?:$URI::scheme_re:)?)(?:([^;?]*))?(;[^?]*)?(.*)$,os or die; my $paramstr = $3; if (@_) { my $new = shift; $$self = $1 . $2; my $rest = $4; $$self .= $paramstr . $rest; } $paramstr =~ s/^;//o; return $paramstr; } # Inherited methods that make no sense for a SIP URI. sub path {} sub path_query {} sub path_segments {} sub abs { shift } sub rel { shift } sub query_keywords {} 1; �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������darwin-perl-lib/URI/sips.pm�������������������������������������������������������������������������000444 �000765 �000024 �00000000251 13167163507 017733� 0����������������������������������������������������������������������������������������������������ustar�00ocsinventory��������������������staff���������������������������000000 �000000 ������������������������������������������������������������������������������������������������������������������������������������������������������������������������package URI::sips; use strict; use warnings; our $VERSION = '1.72'; $VERSION = eval $VERSION; use parent 'URI::sip'; sub default_port { 5061 } sub secure { 1 } 1; �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������darwin-perl-lib/URI/snews.pm������������������������������������������������������������������������000444 �000765 �000024 �00000000306 13167163507 020115� 0����������������������������������������������������������������������������������������������������ustar�00ocsinventory��������������������staff���������������������������000000 �000000 ������������������������������������������������������������������������������������������������������������������������������������������������������������������������package URI::snews; # draft-gilman-news-url-01 use strict; use warnings; our $VERSION = '1.72'; $VERSION = eval $VERSION; use parent 'URI::news'; sub default_port { 563 } sub secure { 1 } 1; ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������darwin-perl-lib/URI/Split.pm������������������������������������������������������������������������000444 �000765 �000024 �00000004513 13167163507 020055� 0����������������������������������������������������������������������������������������������������ustar�00ocsinventory��������������������staff���������������������������000000 �000000 ������������������������������������������������������������������������������������������������������������������������������������������������������������������������package URI::Split; use strict; use warnings; our $VERSION = '1.72'; $VERSION = eval $VERSION; use Exporter 5.57 'import'; our @EXPORT_OK = qw(uri_split uri_join); use URI::Escape (); sub uri_split { return $_[0] =~ m,(?:([^:/?#]+):)?(?://([^/?#]*))?([^?#]*)(?:\?([^#]*))?(?:#(.*))?,; } sub uri_join { my($scheme, $auth, $path, $query, $frag) = @_; my $uri = defined($scheme) ? "$scheme:" : ""; $path = "" unless defined $path; if (defined $auth) { $auth =~ s,([/?\#]), URI::Escape::escape_char($1),eg; $uri .= "//$auth"; $path = "/$path" if length($path) && $path !~ m,^/,; } elsif ($path =~ m,^//,) { $uri .= "//"; # XXX force empty auth } unless (length $uri) { $path =~ s,(:), URI::Escape::escape_char($1),e while $path =~ m,^[^:/?\#]+:,; } $path =~ s,([?\#]), URI::Escape::escape_char($1),eg; $uri .= $path; if (defined $query) { $query =~ s,(\#), URI::Escape::escape_char($1),eg; $uri .= "?$query"; } $uri .= "#$frag" if defined $frag; $uri; } 1; __END__ =head1 NAME URI::Split - Parse and compose URI strings =head1 SYNOPSIS use URI::Split qw(uri_split uri_join); ($scheme, $auth, $path, $query, $frag) = uri_split($uri); $uri = uri_join($scheme, $auth, $path, $query, $frag); =head1 DESCRIPTION Provides functions to parse and compose URI strings. The following functions are provided: =over =item ($scheme, $auth, $path, $query, $frag) = uri_split($uri) Breaks up a URI string into its component parts. An C<undef> value is returned for those parts that are not present. The $path part is always present (but can be the empty string) and is thus never returned as C<undef>. No sensible value is returned if this function is called in a scalar context. =item $uri = uri_join($scheme, $auth, $path, $query, $frag) Puts together a URI string from its parts. Missing parts are signaled by passing C<undef> for the corresponding argument. Minimal escaping is applied to parts that contain reserved chars that would confuse a parser. For instance, any occurrence of '?' or '#' in $path is always escaped, as it would otherwise be parsed back as a query or fragment. =back =head1 SEE ALSO L<URI>, L<URI::Escape> =head1 COPYRIGHT Copyright 2003, Gisle Aas This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. =cut �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������darwin-perl-lib/URI/ssh.pm��������������������������������������������������������������������������000444 �000765 �000024 �00000000311 13167163507 017547� 0����������������������������������������������������������������������������������������������������ustar�00ocsinventory��������������������staff���������������������������000000 �000000 ������������������������������������������������������������������������������������������������������������������������������������������������������������������������package URI::ssh; use strict; use warnings; our $VERSION = '1.72'; $VERSION = eval $VERSION; use parent 'URI::_login'; # ssh://[USER@]HOST[:PORT]/SRC sub default_port { 22 } sub secure { 1 } 1; �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������darwin-perl-lib/URI/telnet.pm�����������������������������������������������������������������������000444 �000765 �000024 �00000000232 13167163507 020247� 0����������������������������������������������������������������������������������������������������ustar�00ocsinventory��������������������staff���������������������������000000 �000000 ������������������������������������������������������������������������������������������������������������������������������������������������������������������������package URI::telnet; use strict; use warnings; our $VERSION = '1.72'; $VERSION = eval $VERSION; use parent 'URI::_login'; sub default_port { 23 } 1; ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������darwin-perl-lib/URI/tn3270.pm�����������������������������������������������������������������������000444 �000765 �000024 �00000000232 13167163507 017711� 0����������������������������������������������������������������������������������������������������ustar�00ocsinventory��������������������staff���������������������������000000 �000000 ������������������������������������������������������������������������������������������������������������������������������������������������������������������������package URI::tn3270; use strict; use warnings; our $VERSION = '1.72'; $VERSION = eval $VERSION; use parent 'URI::_login'; sub default_port { 23 } 1; ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������darwin-perl-lib/URI/URL.pm��������������������������������������������������������������������������000444 �000765 �000024 �00000012557 13167163507 017433� 0����������������������������������������������������������������������������������������������������ustar�00ocsinventory��������������������staff���������������������������000000 �000000 ������������������������������������������������������������������������������������������������������������������������������������������������������������������������package URI::URL; use strict; use warnings; use parent 'URI::WithBase'; our $VERSION = "5.04"; # Provide as much as possible of the old URI::URL interface for backwards # compatibility... use Exporter 5.57 'import'; our @EXPORT = qw(url); # Easy to use constructor sub url ($;$) { URI::URL->new(@_); } use URI::Escape qw(uri_unescape); sub new { my $class = shift; my $self = $class->SUPER::new(@_); $self->[0] = $self->[0]->canonical; $self; } sub newlocal { my $class = shift; require URI::file; bless [URI::file->new_abs(shift)], $class; } {package URI::_foreign; sub _init # hope it is not defined { my $class = shift; die "Unknown URI::URL scheme $_[1]:" if $URI::URL::STRICT; $class->SUPER::_init(@_); } } sub strict { my $old = $URI::URL::STRICT; $URI::URL::STRICT = shift if @_; $old; } sub print_on { my $self = shift; require Data::Dumper; print STDERR Data::Dumper::Dumper($self); } sub _try { my $self = shift; my $method = shift; scalar(eval { $self->$method(@_) }); } sub crack { # should be overridden by subclasses my $self = shift; (scalar($self->scheme), $self->_try("user"), $self->_try("password"), $self->_try("host"), $self->_try("port"), $self->_try("path"), $self->_try("params"), $self->_try("query"), scalar($self->fragment), ) } sub full_path { my $self = shift; my $path = $self->path_query; $path = "/" unless length $path; $path; } sub netloc { shift->authority(@_); } sub epath { my $path = shift->SUPER::path(@_); $path =~ s/;.*//; $path; } sub eparams { my $self = shift; my @p = $self->path_segments; return undef unless ref($p[-1]); @p = @{$p[-1]}; shift @p; join(";", @p); } sub params { shift->eparams(@_); } sub path { my $self = shift; my $old = $self->epath(@_); return unless defined wantarray; return '/' if !defined($old) || !length($old); Carp::croak("Path components contain '/' (you must call epath)") if $old =~ /%2[fF]/ and !@_; $old = "/$old" if $old !~ m|^/| && defined $self->netloc; return uri_unescape($old); } sub path_components { shift->path_segments(@_); } sub query { my $self = shift; my $old = $self->equery(@_); if (defined(wantarray) && defined($old)) { if ($old =~ /%(?:26|2[bB]|3[dD])/) { # contains escaped '=' '&' or '+' my $mess; for ($old) { $mess = "Query contains both '+' and '%2B'" if /\+/ && /%2[bB]/; $mess = "Form query contains escaped '=' or '&'" if /=/ && /%(?:3[dD]|26)/; } if ($mess) { Carp::croak("$mess (you must call equery)"); } } # Now it should be safe to unescape the string without losing # information return uri_unescape($old); } undef; } sub abs { my $self = shift; my $base = shift; my $allow_scheme = shift; $allow_scheme = $URI::URL::ABS_ALLOW_RELATIVE_SCHEME unless defined $allow_scheme; local $URI::ABS_ALLOW_RELATIVE_SCHEME = $allow_scheme; local $URI::ABS_REMOTE_LEADING_DOTS = $URI::URL::ABS_REMOTE_LEADING_DOTS; $self->SUPER::abs($base); } sub frag { shift->fragment(@_); } sub keywords { shift->query_keywords(@_); } # file: sub local_path { shift->file; } sub unix_path { shift->file("unix"); } sub dos_path { shift->file("dos"); } sub mac_path { shift->file("mac"); } sub vms_path { shift->file("vms"); } # mailto: sub address { shift->to(@_); } sub encoded822addr { shift->to(@_); } sub URI::mailto::authority { shift->to(@_); } # make 'netloc' method work # news: sub groupart { shift->_group(@_); } sub article { shift->message(@_); } 1; __END__ =head1 NAME URI::URL - Uniform Resource Locators =head1 SYNOPSIS $u1 = URI::URL->new($str, $base); $u2 = $u1->abs; =head1 DESCRIPTION This module is provided for backwards compatibility with modules that depend on the interface provided by the C<URI::URL> class that used to be distributed with the libwww-perl library. The following differences exist compared to the C<URI> class interface: =over 3 =item * The URI::URL module exports the url() function as an alternate constructor interface. =item * The constructor takes an optional $base argument. The C<URI::URL> class is a subclass of C<URI::WithBase>. =item * The URI::URL->newlocal class method is the same as URI::file->new_abs. =item * URI::URL::strict(1) =item * $url->print_on method =item * $url->crack method =item * $url->full_path: same as ($uri->abs_path || "/") =item * $url->netloc: same as $uri->authority =item * $url->epath, $url->equery: same as $uri->path, $uri->query =item * $url->path and $url->query pass unescaped strings. =item * $url->path_components: same as $uri->path_segments (if you don't consider path segment parameters) =item * $url->params and $url->eparams methods =item * $url->base method. See L<URI::WithBase>. =item * $url->abs and $url->rel have an optional $base argument. See L<URI::WithBase>. =item * $url->frag: same as $uri->fragment =item * $url->keywords: same as $uri->query_keywords =item * $url->localpath and friends map to $uri->file. =item * $url->address and $url->encoded822addr: same as $uri->to for mailto URI =item * $url->groupart method for news URI =item * $url->article: same as $uri->message =back =head1 SEE ALSO L<URI>, L<URI::WithBase> =head1 COPYRIGHT Copyright 1998-2000 Gisle Aas. =cut �������������������������������������������������������������������������������������������������������������������������������������������������darwin-perl-lib/URI/urn/����������������������������������������������������������������������������000755 �000765 �000024 �00000000000 13167163507 017227� 5����������������������������������������������������������������������������������������������������ustar�00ocsinventory��������������������staff���������������������������000000 �000000 ������������������������������������������������������������������������������������������������������������������������������������������������������������������������darwin-perl-lib/URI/urn.pm��������������������������������������������������������������������������000444 �000765 �000024 �00000004231 13167163507 017563� 0����������������������������������������������������������������������������������������������������ustar�00ocsinventory��������������������staff���������������������������000000 �000000 ������������������������������������������������������������������������������������������������������������������������������������������������������������������������package URI::urn; # RFC 2141 use strict; use warnings; our $VERSION = '1.72'; $VERSION = eval $VERSION; use parent 'URI'; use Carp qw(carp); my %implementor; my %require_attempted; sub _init { my $class = shift; my $self = $class->SUPER::_init(@_); my $nid = $self->nid; my $impclass = $implementor{$nid}; return $impclass->_urn_init($self, $nid) if $impclass; $impclass = "URI::urn"; if ($nid =~ /^[A-Za-z\d][A-Za-z\d\-]*\z/) { my $id = $nid; # make it a legal perl identifier $id =~ s/-/_/g; $id = "_$id" if $id =~ /^\d/; $impclass = "URI::urn::$id"; no strict 'refs'; unless (@{"${impclass}::ISA"}) { if (not exists $require_attempted{$impclass}) { # Try to load it my $_old_error = $@; eval "require $impclass"; die $@ if $@ && $@ !~ /Can\'t locate.*in \@INC/; $@ = $_old_error; } $impclass = "URI::urn" unless @{"${impclass}::ISA"}; } } else { carp("Illegal namespace identifier '$nid' for URN '$self'") if $^W; } $implementor{$nid} = $impclass; return $impclass->_urn_init($self, $nid); } sub _urn_init { my($class, $self, $nid) = @_; bless $self, $class; } sub _nid { my $self = shift; my $opaque = $self->opaque; if (@_) { my $v = $opaque; my $new = shift; $v =~ s/[^:]*/$new/; $self->opaque($v); # XXX possible rebless } $opaque =~ s/:.*//s; return $opaque; } sub nid { # namespace identifier my $self = shift; my $nid = $self->_nid(@_); $nid = lc($nid) if defined($nid); return $nid; } sub nss { # namespace specific string my $self = shift; my $opaque = $self->opaque; if (@_) { my $v = $opaque; my $new = shift; if (defined $new) { $v =~ s/(:|\z).*/:$new/; } else { $v =~ s/:.*//s; } $self->opaque($v); } return undef unless $opaque =~ s/^[^:]*://; return $opaque; } sub canonical { my $self = shift; my $nid = $self->_nid; my $new = $self->SUPER::canonical; return $new if $nid !~ /[A-Z]/ || $nid =~ /%/; $new = $new->clone if $new == $self; $new->nid(lc($nid)); return $new; } 1; �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������darwin-perl-lib/URI/WithBase.pm���������������������������������������������������������������������000444 �000765 �000024 �00000007421 13167163507 020471� 0����������������������������������������������������������������������������������������������������ustar�00ocsinventory��������������������staff���������������������������000000 �000000 ������������������������������������������������������������������������������������������������������������������������������������������������������������������������package URI::WithBase; use strict; use warnings; use URI; use Scalar::Util 'blessed'; our $VERSION = "2.20"; use overload '""' => "as_string", fallback => 1; sub as_string; # help overload find it sub new { my($class, $uri, $base) = @_; my $ibase = $base; if ($base && blessed($base) && $base->isa(__PACKAGE__)) { $base = $base->abs; $ibase = $base->[0]; } bless [URI->new($uri, $ibase), $base], $class; } sub new_abs { my $class = shift; my $self = $class->new(@_); $self->abs; } sub _init { my $class = shift; my($str, $scheme) = @_; bless [URI->new($str, $scheme), undef], $class; } sub eq { my($self, $other) = @_; $other = $other->[0] if blessed($other) and $other->isa(__PACKAGE__); $self->[0]->eq($other); } our $AUTOLOAD; sub AUTOLOAD { my $self = shift; my $method = substr($AUTOLOAD, rindex($AUTOLOAD, '::')+2); return if $method eq "DESTROY"; $self->[0]->$method(@_); } sub can { # override UNIVERSAL::can my $self = shift; $self->SUPER::can(@_) || ( ref($self) ? $self->[0]->can(@_) : undef ) } sub base { my $self = shift; my $base = $self->[1]; if (@_) { # set my $new_base = shift; # ensure absoluteness $new_base = $new_base->abs if ref($new_base) && $new_base->isa(__PACKAGE__); $self->[1] = $new_base; } return unless defined wantarray; # The base attribute supports 'lazy' conversion from URL strings # to URL objects. Strings may be stored but when a string is # fetched it will automatically be converted to a URL object. # The main benefit is to make it much cheaper to say: # URI::WithBase->new($random_url_string, 'http:') if (defined($base) && !ref($base)) { $base = ref($self)->new($base); $self->[1] = $base unless @_; } $base; } sub clone { my $self = shift; my $base = $self->[1]; $base = $base->clone if ref($base); bless [$self->[0]->clone, $base], ref($self); } sub abs { my $self = shift; my $base = shift || $self->base || return $self->clone; $base = $base->as_string if ref($base); bless [$self->[0]->abs($base, @_), $base], ref($self); } sub rel { my $self = shift; my $base = shift || $self->base || return $self->clone; $base = $base->as_string if ref($base); bless [$self->[0]->rel($base, @_), $base], ref($self); } 1; __END__ =head1 NAME URI::WithBase - URIs which remember their base =head1 SYNOPSIS $u1 = URI::WithBase->new($str, $base); $u2 = $u1->abs; $base = $u1->base; $u1->base( $new_base ) =head1 DESCRIPTION This module provides the C<URI::WithBase> class. Objects of this class are like C<URI> objects, but can keep their base too. The base represents the context where this URI was found and can be used to absolutize or relativize the URI. All the methods described in L<URI> are supported for C<URI::WithBase> objects. The methods provided in addition to or modified from those of C<URI> are: =over 4 =item $uri = URI::WithBase->new($str, [$base]) The constructor takes an optional base URI as the second argument. If provided, this argument initializes the base attribute. =item $uri->base( [$new_base] ) Can be used to get or set the value of the base attribute. The return value, which is the old value, is a URI object or C<undef>. =item $uri->abs( [$base_uri] ) The $base_uri argument is now made optional as the object carries its base with it. A new object is returned even if $uri is already absolute (while plain URI objects simply return themselves in that case). =item $uri->rel( [$base_uri] ) The $base_uri argument is now made optional as the object carries its base with it. A new object is always returned. =back =head1 SEE ALSO L<URI> =head1 COPYRIGHT Copyright 1998-2002 Gisle Aas. =cut �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������darwin-perl-lib/URI/urn/isbn.pm���������������������������������������������������������������������000444 �000765 �000024 �00000004755 13167163507 020531� 0����������������������������������������������������������������������������������������������������ustar�00ocsinventory��������������������staff���������������������������000000 �000000 ������������������������������������������������������������������������������������������������������������������������������������������������������������������������package URI::urn::isbn; # RFC 3187 use strict; use warnings; our $VERSION = '1.72'; use parent 'URI::urn'; use Carp qw(carp); BEGIN { require Business::ISBN; local $^W = 0; # don't warn about dev versions, perl5.004 style warn "Using Business::ISBN version " . Business::ISBN->VERSION . " which is deprecated.\nUpgrade to Business::ISBN version 2\n" if Business::ISBN->VERSION < 2; } sub _isbn { my $nss = shift; $nss = $nss->nss if ref($nss); my $isbn = Business::ISBN->new($nss); $isbn = undef if $isbn && !$isbn->is_valid; return $isbn; } sub _nss_isbn { my $self = shift; my $nss = $self->nss(@_); my $isbn = _isbn($nss); $isbn = $isbn->as_string if $isbn; return($nss, $isbn); } sub isbn { my $self = shift; my $isbn; (undef, $isbn) = $self->_nss_isbn(@_); return $isbn; } sub isbn_publisher_code { my $isbn = shift->_isbn || return undef; return $isbn->publisher_code; } BEGIN { my $group_method = do { local $^W = 0; # don't warn about dev versions, perl5.004 style Business::ISBN->VERSION >= 2 ? 'group_code' : 'country_code'; }; sub isbn_group_code { my $isbn = shift->_isbn || return undef; return $isbn->$group_method; } } sub isbn_country_code { my $name = (caller(0))[3]; $name =~ s/.*:://; carp "$name is DEPRECATED. Use isbn_group_code instead"; no strict 'refs'; &isbn_group_code; } BEGIN { my $isbn13_method = do { local $^W = 0; # don't warn about dev versions, perl5.004 style Business::ISBN->VERSION >= 2 ? 'as_isbn13' : 'as_ean'; }; sub isbn13 { my $isbn = shift->_isbn || return undef; # Business::ISBN 1.x didn't put hyphens in the EAN, and it was just a string # Business::ISBN 2.0 doesn't do EAN, but it does ISBN-13 objects # and it uses the hyphens, so call as_string with an empty anon array # or, adjust the test and features to say that it comes out with hyphens. my $thingy = $isbn->$isbn13_method; return eval { $thingy->can( 'as_string' ) } ? $thingy->as_string([]) : $thingy; } } sub isbn_as_ean { my $name = (caller(0))[3]; $name =~ s/.*:://; carp "$name is DEPRECATED. Use isbn13 instead"; no strict 'refs'; &isbn13; } sub canonical { my $self = shift; my($nss, $isbn) = $self->_nss_isbn; my $new = $self->SUPER::canonical; return $new unless $nss && $isbn && $nss ne $isbn; $new = $new->clone if $new == $self; $new->nss($isbn); return $new; } 1; �������������������darwin-perl-lib/URI/urn/oid.pm����������������������������������������������������������������������000444 �000765 �000024 �00000000465 13167163507 020343� 0����������������������������������������������������������������������������������������������������ustar�00ocsinventory��������������������staff���������������������������000000 �000000 ������������������������������������������������������������������������������������������������������������������������������������������������������������������������package URI::urn::oid; # RFC 2061 use strict; use warnings; our $VERSION = '1.72'; $VERSION = eval $VERSION; use parent 'URI::urn'; sub oid { my $self = shift; my $old = $self->nss; if (@_) { $self->nss(join(".", @_)); } return split(/\./, $old) if wantarray; return $old; } 1; �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������darwin-perl-lib/URI/file/Base.pm��������������������������������������������������������������������000444 �000765 �000024 �00000002735 13167163507 020557� 0����������������������������������������������������������������������������������������������������ustar�00ocsinventory��������������������staff���������������������������000000 �000000 ������������������������������������������������������������������������������������������������������������������������������������������������������������������������package URI::file::Base; use strict; use warnings; use URI::Escape qw(); our $VERSION = '1.72'; $VERSION = eval $VERSION; sub new { my $class = shift; my $path = shift; $path = "" unless defined $path; my($auth, $escaped_auth, $escaped_path); ($auth, $escaped_auth) = $class->_file_extract_authority($path); ($path, $escaped_path) = $class->_file_extract_path($path); if (defined $auth) { $auth =~ s,%,%25,g unless $escaped_auth; $auth =~ s,([/?\#]), URI::Escape::escape_char($1),eg; $auth = "//$auth"; if (defined $path) { $path = "/$path" unless substr($path, 0, 1) eq "/"; } else { $path = ""; } } else { return undef unless defined $path; $auth = ""; } $path =~ s,([%;?]), URI::Escape::escape_char($1),eg unless $escaped_path; $path =~ s/\#/%23/g; my $uri = $auth . $path; $uri = "file:$uri" if substr($uri, 0, 1) eq "/"; URI->new($uri, "file"); } sub _file_extract_authority { my($class, $path) = @_; return undef unless $class->_file_is_absolute($path); return $URI::file::DEFAULT_AUTHORITY; } sub _file_extract_path { return undef; } sub _file_is_absolute { return 0; } sub _file_is_localhost { shift; # class my $host = lc(shift); return 1 if $host eq "localhost"; eval { require Net::Domain; lc(Net::Domain::hostfqdn()) eq $host || lc(Net::Domain::hostname()) eq $host; }; } sub file { undef; } sub dir { my $self = shift; $self->file(@_); } 1; �����������������������������������darwin-perl-lib/URI/file/FAT.pm���������������������������������������������������������������������000444 �000765 �000024 �00000001013 13167163507 020303� 0����������������������������������������������������������������������������������������������������ustar�00ocsinventory��������������������staff���������������������������000000 �000000 ������������������������������������������������������������������������������������������������������������������������������������������������������������������������package URI::file::FAT; use strict; use warnings; use parent 'URI::file::Win32'; our $VERSION = '1.72'; $VERSION = eval $VERSION; sub fix_path { shift; # class for (@_) { # turn it into 8.3 names my @p = map uc, split(/\./, $_, -1); return if @p > 2; # more than 1 dot is not allowed @p = ("") unless @p; # split bug? (returns nothing when splitting "") $_ = substr($p[0], 0, 8); if (@p > 1) { my $ext = substr($p[1], 0, 3); $_ .= ".$ext" if length $ext; } } 1; # ok } 1; ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������darwin-perl-lib/URI/file/Mac.pm���������������������������������������������������������������������000444 �000765 �000024 �00000004717 13167163507 020407� 0����������������������������������������������������������������������������������������������������ustar�00ocsinventory��������������������staff���������������������������000000 �000000 ������������������������������������������������������������������������������������������������������������������������������������������������������������������������package URI::file::Mac; use strict; use warnings; use parent 'URI::file::Base'; use URI::Escape qw(uri_unescape); our $VERSION = '1.72'; $VERSION = eval $VERSION; sub _file_extract_path { my $class = shift; my $path = shift; my @pre; if ($path =~ s/^(:+)//) { if (length($1) == 1) { @pre = (".") unless length($path); } else { @pre = ("..") x (length($1) - 1); } } else { #absolute $pre[0] = ""; } my $isdir = ($path =~ s/:$//); $path =~ s,([%/;]), URI::Escape::escape_char($1),eg; my @path = split(/:/, $path, -1); for (@path) { if ($_ eq "." || $_ eq "..") { $_ = "%2E" x length($_); } $_ = ".." unless length($_); } push (@path,"") if $isdir; (join("/", @pre, @path), 1); } sub file { my $class = shift; my $uri = shift; my @path; my $auth = $uri->authority; if (defined $auth) { if (lc($auth) ne "localhost" && $auth ne "") { my $u_auth = uri_unescape($auth); if (!$class->_file_is_localhost($u_auth)) { # some other host (use it as volume name) @path = ("", $auth); # XXX or just return to make it illegal; } } } my @ps = split("/", $uri->path, -1); shift @ps if @path; push(@path, @ps); my $pre = ""; if (!@path) { return; # empty path; XXX return ":" instead? } elsif ($path[0] eq "") { # absolute shift(@path); if (@path == 1) { return if $path[0] eq ""; # not root directory push(@path, ""); # volume only, effectively append ":" } @ps = @path; @path = (); my $part; for (@ps) { #fix up "." and "..", including interior, in relatives next if $_ eq "."; $part = $_ eq ".." ? "" : $_; push(@path,$part); } if ($ps[-1] eq "..") { #if this happens, we need another : push(@path,""); } } else { $pre = ":"; @ps = @path; @path = (); my $part; for (@ps) { #fix up "." and "..", including interior, in relatives next if $_ eq "."; $part = $_ eq ".." ? "" : $_; push(@path,$part); } if ($ps[-1] eq "..") { #if this happens, we need another : push(@path,""); } } return unless $pre || @path; for (@path) { s/;.*//; # get rid of parameters #return unless length; # XXX $_ = uri_unescape($_); return if /\0/; return if /:/; # Should we? } $pre . join(":", @path); } sub dir { my $class = shift; my $path = $class->file(@_); return unless defined $path; $path .= ":" unless $path =~ /:$/; $path; } 1; �������������������������������������������������darwin-perl-lib/URI/file/OS2.pm���������������������������������������������������������������������000444 �000765 �000024 �00000001113 13167163507 020275� 0����������������������������������������������������������������������������������������������������ustar�00ocsinventory��������������������staff���������������������������000000 �000000 ������������������������������������������������������������������������������������������������������������������������������������������������������������������������package URI::file::OS2; use strict; use warnings; use parent 'URI::file::Win32'; our $VERSION = '1.72'; $VERSION = eval $VERSION; # The Win32 version translates k:/foo to file://k:/foo (?!) # We add an empty host sub _file_extract_authority { my $class = shift; return $1 if $_[0] =~ s,^\\\\([^\\]+),,; # UNC return $1 if $_[0] =~ s,^//([^/]+),,; # UNC too? if ($_[0] =~ m#^[a-zA-Z]{1,2}:#) { # allow for ab: drives return ""; } return; } sub file { my $p = &URI::file::Win32::file; return unless defined $p; $p =~ s,\\,/,g; $p; } 1; �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������darwin-perl-lib/URI/file/QNX.pm���������������������������������������������������������������������000444 �000765 �000024 �00000000553 13167163507 020347� 0����������������������������������������������������������������������������������������������������ustar�00ocsinventory��������������������staff���������������������������000000 �000000 ������������������������������������������������������������������������������������������������������������������������������������������������������������������������package URI::file::QNX; use strict; use warnings; use parent 'URI::file::Unix'; our $VERSION = '1.72'; $VERSION = eval $VERSION; sub _file_extract_path { my($class, $path) = @_; # tidy path $path =~ s,(.)//+,$1/,g; # ^// is correct $path =~ s,(/\.)+/,/,g; $path = "./$path" if $path =~ m,^[^:/]+:,,; # look like "scheme:" $path; } 1; �����������������������������������������������������������������������������������������������������������������������������������������������������darwin-perl-lib/URI/file/Unix.pm��������������������������������������������������������������������000444 �000765 �000024 �00000002030 13167163507 020614� 0����������������������������������������������������������������������������������������������������ustar�00ocsinventory��������������������staff���������������������������000000 �000000 ������������������������������������������������������������������������������������������������������������������������������������������������������������������������package URI::file::Unix; use strict; use warnings; use parent 'URI::file::Base'; use URI::Escape qw(uri_unescape); our $VERSION = '1.72'; $VERSION = eval $VERSION; sub _file_extract_path { my($class, $path) = @_; # tidy path $path =~ s,//+,/,g; $path =~ s,(/\.)+/,/,g; $path = "./$path" if $path =~ m,^[^:/]+:,,; # look like "scheme:" return $path; } sub _file_is_absolute { my($class, $path) = @_; return $path =~ m,^/,; } sub file { my $class = shift; my $uri = shift; my @path; my $auth = $uri->authority; if (defined($auth)) { if (lc($auth) ne "localhost" && $auth ne "") { $auth = uri_unescape($auth); unless ($class->_file_is_localhost($auth)) { push(@path, "", "", $auth); } } } my @ps = $uri->path_segments; shift @ps if @path; push(@path, @ps); for (@path) { # Unix file/directory names are not allowed to contain '\0' or '/' return undef if /\0/; return undef if /\//; # should we really? } return join("/", @path); } 1; ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������darwin-perl-lib/URI/file/Win32.pm�������������������������������������������������������������������000444 �000765 �000024 �00000003367 13167163507 020611� 0����������������������������������������������������������������������������������������������������ustar�00ocsinventory��������������������staff���������������������������000000 �000000 ������������������������������������������������������������������������������������������������������������������������������������������������������������������������package URI::file::Win32; use strict; use warnings; use parent 'URI::file::Base'; use URI::Escape qw(uri_unescape); our $VERSION = '1.72'; $VERSION = eval $VERSION; sub _file_extract_authority { my $class = shift; return $class->SUPER::_file_extract_authority($_[0]) if defined $URI::file::DEFAULT_AUTHORITY; return $1 if $_[0] =~ s,^\\\\([^\\]+),,; # UNC return $1 if $_[0] =~ s,^//([^/]+),,; # UNC too? if ($_[0] =~ s,^([a-zA-Z]:),,) { my $auth = $1; $auth .= "relative" if $_[0] !~ m,^[\\/],; return $auth; } return undef; } sub _file_extract_path { my($class, $path) = @_; $path =~ s,\\,/,g; #$path =~ s,//+,/,g; $path =~ s,(/\.)+/,/,g; if (defined $URI::file::DEFAULT_AUTHORITY) { $path =~ s,^([a-zA-Z]:),/$1,; } return $path; } sub _file_is_absolute { my($class, $path) = @_; return $path =~ m,^[a-zA-Z]:, || $path =~ m,^[/\\],; } sub file { my $class = shift; my $uri = shift; my $auth = $uri->authority; my $rel; # is filename relative to drive specified in authority if (defined $auth) { $auth = uri_unescape($auth); if ($auth =~ /^([a-zA-Z])[:|](relative)?/) { $auth = uc($1) . ":"; $rel++ if $2; } elsif (lc($auth) eq "localhost") { $auth = ""; } elsif (length $auth) { $auth = "\\\\" . $auth; # UNC } } else { $auth = ""; } my @path = $uri->path_segments; for (@path) { return undef if /\0/; return undef if /\//; #return undef if /\\/; # URLs with "\" is not uncommon } return undef unless $class->fix_path(@path); my $path = join("\\", @path); $path =~ s/^\\// if $rel; $path = $auth . $path; $path =~ s,^\\([a-zA-Z])[:|],\u$1:,; return $path; } sub fix_path { 1; } 1; �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������darwin-perl-lib/Net/HTTP/���������������������������������������������������������������������������000755 �000765 �000024 �00000000000 13167163507 017271� 5����������������������������������������������������������������������������������������������������ustar�00ocsinventory��������������������staff���������������������������000000 �000000 ������������������������������������������������������������������������������������������������������������������������������������������������������������������������darwin-perl-lib/Net/HTTP.pm�������������������������������������������������������������������������000444 �000765 �000024 �00000023645 13167163507 017637� 0����������������������������������������������������������������������������������������������������ustar�00ocsinventory��������������������staff���������������������������000000 �000000 ������������������������������������������������������������������������������������������������������������������������������������������������������������������������package Net::HTTP; $Net::HTTP::VERSION = '6.17'; use strict; use warnings; use vars qw($SOCKET_CLASS); unless ($SOCKET_CLASS) { # Try several, in order of capability and preference if (eval { require IO::Socket::IP }) { $SOCKET_CLASS = "IO::Socket::IP"; # IPv4+IPv6 } elsif (eval { require IO::Socket::INET6 }) { $SOCKET_CLASS = "IO::Socket::INET6"; # IPv4+IPv6 } elsif (eval { require IO::Socket::INET }) { $SOCKET_CLASS = "IO::Socket::INET"; # IPv4 only } else { require IO::Socket; $SOCKET_CLASS = "IO::Socket::INET"; } } require Net::HTTP::Methods; require Carp; our @ISA = ($SOCKET_CLASS, 'Net::HTTP::Methods'); sub new { my $class = shift; Carp::croak("No Host option provided") unless @_; $class->SUPER::new(@_); } sub configure { my($self, $cnf) = @_; $self->http_configure($cnf); } sub http_connect { my($self, $cnf) = @_; $self->SUPER::configure($cnf); } 1; =pod =encoding UTF-8 =head1 NAME Net::HTTP - Low-level HTTP connection (client) =head1 VERSION version 6.17 =head1 SYNOPSIS use Net::HTTP; my $s = Net::HTTP->new(Host => "www.perl.com") || die $@; $s->write_request(GET => "/", 'User-Agent' => "Mozilla/5.0"); my($code, $mess, %h) = $s->read_response_headers; while (1) { my $buf; my $n = $s->read_entity_body($buf, 1024); die "read failed: $!" unless defined $n; last unless $n; print $buf; } =head1 DESCRIPTION The C<Net::HTTP> class is a low-level HTTP client. An instance of the C<Net::HTTP> class represents a connection to an HTTP server. The HTTP protocol is described in RFC 2616. The C<Net::HTTP> class supports C<HTTP/1.0> and C<HTTP/1.1>. C<Net::HTTP> is a sub-class of one of C<IO::Socket::IP> (IPv6+IPv4), C<IO::Socket::INET6> (IPv6+IPv4), or C<IO::Socket::INET> (IPv4 only). You can mix the methods described below with reading and writing from the socket directly. This is not necessary a good idea, unless you know what you are doing. The following methods are provided (in addition to those of C<IO::Socket::INET>): =over =item $s = Net::HTTP->new( %options ) The C<Net::HTTP> constructor method takes the same options as C<IO::Socket::INET>'s as well as these: Host: Initial host attribute value KeepAlive: Initial keep_alive attribute value SendTE: Initial send_te attribute_value HTTPVersion: Initial http_version attribute value PeerHTTPVersion: Initial peer_http_version attribute value MaxLineLength: Initial max_line_length attribute value MaxHeaderLines: Initial max_header_lines attribute value The C<Host> option is also the default for C<IO::Socket::INET>'s C<PeerAddr>. The C<PeerPort> defaults to 80 if not provided. The C<PeerPort> specification can also be embedded in the C<PeerAddr> by preceding it with a ":", and closing the IPv6 address on brackets "[]" if necessary: "192.0.2.1:80","[2001:db8::1]:80","any.example.com:80". The C<Listen> option provided by C<IO::Socket::INET>'s constructor method is not allowed. If unable to connect to the given HTTP server then the constructor returns C<undef> and $@ contains the reason. After a successful connect, a C<Net:HTTP> object is returned. =item $s->host Get/set the default value of the C<Host> header to send. The $host must not be set to an empty string (or C<undef>) for HTTP/1.1. =item $s->keep_alive Get/set the I<keep-alive> value. If this value is TRUE then the request will be sent with headers indicating that the server should try to keep the connection open so that multiple requests can be sent. The actual headers set will depend on the value of the C<http_version> and C<peer_http_version> attributes. =item $s->send_te Get/set the a value indicating if the request will be sent with a "TE" header to indicate the transfer encodings that the server can choose to use. The list of encodings announced as accepted by this client depends on availability of the following modules: C<Compress::Raw::Zlib> for I<deflate>, and C<IO::Compress::Gunzip> for I<gzip>. =item $s->http_version Get/set the HTTP version number that this client should announce. This value can only be set to "1.0" or "1.1". The default is "1.1". =item $s->peer_http_version Get/set the protocol version number of our peer. This value will initially be "1.0", but will be updated by a successful read_response_headers() method call. =item $s->max_line_length Get/set a limit on the length of response line and response header lines. The default is 8192. A value of 0 means no limit. =item $s->max_header_length Get/set a limit on the number of header lines that a response can have. The default is 128. A value of 0 means no limit. =item $s->format_request($method, $uri, %headers, [$content]) Format a request message and return it as a string. If the headers do not include a C<Host> header, then a header is inserted with the value of the C<host> attribute. Headers like C<Connection> and C<Keep-Alive> might also be added depending on the status of the C<keep_alive> attribute. If $content is given (and it is non-empty), then a C<Content-Length> header is automatically added unless it was already present. =item $s->write_request($method, $uri, %headers, [$content]) Format and send a request message. Arguments are the same as for format_request(). Returns true if successful. =item $s->format_chunk( $data ) Returns the string to be written for the given chunk of data. =item $s->write_chunk($data) Will write a new chunk of request entity body data. This method should only be used if the C<Transfer-Encoding> header with a value of C<chunked> was sent in the request. Note, writing zero-length data is a no-op. Use the write_chunk_eof() method to signal end of entity body data. Returns true if successful. =item $s->format_chunk_eof( %trailers ) Returns the string to be written for signaling EOF when a C<Transfer-Encoding> of C<chunked> is used. =item $s->write_chunk_eof( %trailers ) Will write eof marker for chunked data and optional trailers. Note that trailers should not really be used unless is was signaled with a C<Trailer> header. Returns true if successful. =item ($code, $mess, %headers) = $s->read_response_headers( %opts ) Read response headers from server and return it. The $code is the 3 digit HTTP status code (see L<HTTP::Status>) and $mess is the textual message that came with it. Headers are then returned as key/value pairs. Since key letter casing is not normalized and the same key can even occur multiple times, assigning these values directly to a hash is not wise. Only the $code is returned if this method is called in scalar context. As a side effect this method updates the 'peer_http_version' attribute. Options might be passed in as key/value pairs. There are currently only two options supported; C<laxed> and C<junk_out>. The C<laxed> option will make read_response_headers() more forgiving towards servers that have not learned how to speak HTTP properly. The C<laxed> option is a boolean flag, and is enabled by passing in a TRUE value. The C<junk_out> option can be used to capture bad header lines when C<laxed> is enabled. The value should be an array reference. Bad header lines will be pushed onto the array. The C<laxed> option must be specified in order to communicate with pre-HTTP/1.0 servers that don't describe the response outcome or the data they send back with a header block. For these servers peer_http_version is set to "0.9" and this method returns (200, "Assumed OK"). The method will raise an exception (die) if the server does not speak proper HTTP or if the C<max_line_length> or C<max_header_length> limits are reached. If the C<laxed> option is turned on and C<max_line_length> and C<max_header_length> checks are turned off, then no exception will be raised and this method will always return a response code. =item $n = $s->read_entity_body($buf, $size); Reads chunks of the entity body content. Basically the same interface as for read() and sysread(), but the buffer offset argument is not supported yet. This method should only be called after a successful read_response_headers() call. The return value will be C<undef> on read errors, 0 on EOF, -1 if no data could be returned this time, otherwise the number of bytes assigned to $buf. The $buf is set to "" when the return value is -1. You normally want to retry this call if this function returns either -1 or C<undef> with C<$!> as EINTR or EAGAIN (see L<Errno>). EINTR can happen if the application catches signals and EAGAIN can happen if you made the socket non-blocking. This method will raise exceptions (die) if the server does not speak proper HTTP. This can only happen when reading chunked data. =item %headers = $s->get_trailers After read_entity_body() has returned 0 to indicate end of the entity body, you might call this method to pick up any trailers. =item $s->_rbuf Get/set the read buffer content. The read_response_headers() and read_entity_body() methods use an internal buffer which they will look for data before they actually sysread more from the socket itself. If they read too much, the remaining data will be left in this buffer. =item $s->_rbuf_length Returns the number of bytes in the read buffer. This should always be the same as: length($s->_rbuf) but might be more efficient. =back =head1 SUBCLASSING The read_response_headers() and read_entity_body() will invoke the sysread() method when they need more data. Subclasses might want to override this method to control how reading takes place. The object itself is a glob. Subclasses should avoid using hash key names prefixed with C<http_> and C<io_>. =head1 SEE ALSO L<LWP>, L<IO::Socket::INET>, L<Net::HTTP::NB> =head1 AUTHOR Gisle Aas <gisle@activestate.com> =head1 COPYRIGHT AND LICENSE This software is copyright (c) 2001-2017 by Gisle Aas. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. =cut __END__ # ABSTRACT: Low-level HTTP connection (client) �������������������������������������������������������������������������������������������darwin-perl-lib/Net/HTTPS.pm������������������������������������������������������������������������000444 �000765 �000024 �00000006737 13167163507 017765� 0����������������������������������������������������������������������������������������������������ustar�00ocsinventory��������������������staff���������������������������000000 �000000 ������������������������������������������������������������������������������������������������������������������������������������������������������������������������package Net::HTTPS; $Net::HTTPS::VERSION = '6.17'; use strict; use warnings; # Figure out which SSL implementation to use use vars qw($SSL_SOCKET_CLASS); if ($SSL_SOCKET_CLASS) { # somebody already set it } elsif ($SSL_SOCKET_CLASS = $ENV{PERL_NET_HTTPS_SSL_SOCKET_CLASS}) { unless ($SSL_SOCKET_CLASS =~ /^(IO::Socket::SSL|Net::SSL)\z/) { die "Bad socket class [$SSL_SOCKET_CLASS]"; } eval "require $SSL_SOCKET_CLASS"; die $@ if $@; } elsif ($IO::Socket::SSL::VERSION) { $SSL_SOCKET_CLASS = "IO::Socket::SSL"; # it was already loaded } elsif ($Net::SSL::VERSION) { $SSL_SOCKET_CLASS = "Net::SSL"; } else { eval { require IO::Socket::SSL; }; if ($@) { my $old_errsv = $@; eval { require Net::SSL; # from Crypt-SSLeay }; if ($@) { $old_errsv =~ s/\s\(\@INC contains:.*\)/)/g; die $old_errsv . $@; } $SSL_SOCKET_CLASS = "Net::SSL"; } else { $SSL_SOCKET_CLASS = "IO::Socket::SSL"; } } require Net::HTTP::Methods; our @ISA=($SSL_SOCKET_CLASS, 'Net::HTTP::Methods'); sub configure { my($self, $cnf) = @_; $self->http_configure($cnf); } sub http_connect { my($self, $cnf) = @_; if ($self->isa("Net::SSL")) { if ($cnf->{SSL_verify_mode}) { if (my $f = $cnf->{SSL_ca_file}) { $ENV{HTTPS_CA_FILE} = $f; } if (my $f = $cnf->{SSL_ca_path}) { $ENV{HTTPS_CA_DIR} = $f; } } if ($cnf->{SSL_verifycn_scheme}) { $@ = "Net::SSL from Crypt-SSLeay can't verify hostnames; either install IO::Socket::SSL or turn off verification by setting the PERL_LWP_SSL_VERIFY_HOSTNAME environment variable to 0"; return undef; } } $self->SUPER::configure($cnf); } sub http_default_port { 443; } if ($SSL_SOCKET_CLASS eq "Net::SSL") { # The underlying SSLeay classes fails to work if the socket is # placed in non-blocking mode. This override of the blocking # method makes sure it stays the way it was created. *blocking = sub { }; } 1; =pod =encoding UTF-8 =head1 NAME Net::HTTPS - Low-level HTTP over SSL/TLS connection (client) =head1 VERSION version 6.17 =head1 DESCRIPTION The C<Net::HTTPS> is a low-level HTTP over SSL/TLS client. The interface is the same as the interface for C<Net::HTTP>, but the constructor takes additional parameters as accepted by L<IO::Socket::SSL>. The C<Net::HTTPS> object is an C<IO::Socket::SSL> too, which makes it inherit additional methods from that base class. For historical reasons this module also supports using C<Net::SSL> (from the Crypt-SSLeay distribution) as its SSL driver and base class. This base is automatically selected if available and C<IO::Socket::SSL> isn't. You might also force which implementation to use by setting $Net::HTTPS::SSL_SOCKET_CLASS before loading this module. If not set this variable is initialized from the C<PERL_NET_HTTPS_SSL_SOCKET_CLASS> environment variable. =head1 ENVIRONMENT You might set the C<PERL_NET_HTTPS_SSL_SOCKET_CLASS> environment variable to the name of the base SSL implementation (and Net::HTTPS base class) to use. The default is C<IO::Socket::SSL>. Currently the only other supported value is C<Net::SSL>. =head1 SEE ALSO L<Net::HTTP>, L<IO::Socket::SSL> =head1 AUTHOR Gisle Aas <gisle@activestate.com> =head1 COPYRIGHT AND LICENSE This software is copyright (c) 2001-2017 by Gisle Aas. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. =cut __END__ #ABSTRACT: Low-level HTTP over SSL/TLS connection (client) ���������������������������������darwin-perl-lib/Net/IP.pm���������������������������������������������������������������������������000444 �000765 �000024 �00000220471 13167163507 017364� 0����������������������������������������������������������������������������������������������������ustar�00ocsinventory��������������������staff���������������������������000000 �000000 ������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Copyright (c) 1999 - 2002 RIPE NCC # # All Rights Reserved # # Permission to use, copy, modify, and distribute this software and its # documentation for any purpose and without fee is hereby granted, # provided that the above copyright notice appear in all copies and that # both that copyright notice and this permission notice appear in # supporting documentation, and that the name of the author not be # used in advertising or publicity pertaining to distribution of the # software without specific, written prior permission. # # THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING # ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS; IN NO EVENT SHALL # AUTHOR BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY # DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN # AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. #------------------------------------------------------------------------------ # Module Header # Filename : IP.pm # Purpose : Provide functions to manipulate IPv4/v6 addresses # Author : Manuel Valente <manuel.valente@gmail.com> # Date : 19991124 # Description : # Language Version : Perl 5 # OSs Tested : BSDI 3.1 - Linux # Command Line : ipcount # Input Files : # Output Files : # External Programs : Math::BigInt.pm # Problems : # To Do : # Comments : Based on ipv4pack.pm (Monica) and iplib.pm (Lee) # Math::BigInt is only loaded if int functions are used # $Id: IP.pm,v 1.23 2003/02/18 16:13:01 manuel Exp $ #------------------------------------------------------------------------------ package Net::IP; use strict; use Math::BigInt; # Global Variables definition use vars qw($VERSION @ISA @EXPORT @EXPORT_OK %EXPORT_TAGS $ERROR $ERRNO %IPv4ranges %IPv6ranges $useBigInt $IP_NO_OVERLAP $IP_PARTIAL_OVERLAP $IP_A_IN_B_OVERLAP $IP_B_IN_A_OVERLAP $IP_IDENTICAL); $VERSION = '1.26'; require Exporter; @ISA = qw(Exporter); # Functions and variables exported in all cases @EXPORT = qw(&Error &Errno $IP_NO_OVERLAP $IP_PARTIAL_OVERLAP $IP_A_IN_B_OVERLAP $IP_B_IN_A_OVERLAP $IP_IDENTICAL ); # Functions exported on demand (with :PROC) @EXPORT_OK = qw(&Error &Errno &ip_iptobin &ip_bintoip &ip_bintoint &ip_inttobin &ip_get_version &ip_is_ipv4 &ip_is_ipv6 &ip_expand_address &ip_get_mask &ip_last_address_bin &ip_splitprefix &ip_prefix_to_range &ip_is_valid_mask &ip_bincomp &ip_binadd &ip_get_prefix_length &ip_range_to_prefix &ip_compress_address &ip_is_overlap &ip_get_embedded_ipv4 &ip_aggregate &ip_iptype &ip_check_prefix &ip_reverse &ip_normalize &ip_normal_range &ip_iplengths $IP_NO_OVERLAP $IP_PARTIAL_OVERLAP $IP_A_IN_B_OVERLAP $IP_B_IN_A_OVERLAP $IP_IDENTICAL ); %EXPORT_TAGS = (PROC => [@EXPORT_OK],); # Definition of the Ranges for IPv4 IPs %IPv4ranges = ( '00000000' => 'PRIVATE', # 0/8 '00001010' => 'PRIVATE', # 10/8 '0110010001' => 'SHARED', # 100.64/10 '01111111' => 'LOOPBACK', # 127.0/8 '1010100111111110' => 'LINK-LOCAL', # 169.254/16 '101011000001' => 'PRIVATE', # 172.16/12 '110000000000000000000000' => 'RESERVED', # 192.0.0/24 '110000000000000000000010' => 'TEST-NET', # 192.0.2/24 '110000000101100001100011' => '6TO4-RELAY', # 192.88.99.0/24 '1100000010101000' => 'PRIVATE', # 192.168/16 '110001100001001' => 'RESERVED', # 198.18/15 '110001100011001101100100' => 'TEST-NET', # 198.51.100/24 '110010110000000001110001' => 'TEST-NET', # 203.0.113/24 '1110' => 'MULTICAST', # 224/4 '1111' => 'RESERVED', # 240/4 '11111111111111111111111111111111' => 'BROADCAST', # 255.255.255.255/32 ); # Definition of the Ranges for Ipv6 IPs %IPv6ranges = ( '00000000' => 'RESERVED', # ::/8 ('0' x 128) => 'UNSPECIFIED', # ::/128 ('0' x 127) . '1' => 'LOOPBACK', # ::1/128 ('0' x 80) . ('1' x 16) => 'IPV4MAP', # ::FFFF:0:0/96 '00000001' => 'RESERVED', # 0100::/8 '0000000100000000' . ('0' x 48) => 'DISCARD', # 0100::/64 '0000001' => 'RESERVED', # 0200::/7 '000001' => 'RESERVED', # 0400::/6 '00001' => 'RESERVED', # 0800::/5 '0001' => 'RESERVED', # 1000::/4 '001' => 'GLOBAL-UNICAST', # 2000::/3 '0010000000000001' . ('0' x 16) => 'TEREDO', # 2001::/32 '00100000000000010000000000000010' . ('0' x 16) => 'BMWG', # 2001:0002::/48 '00100000000000010000110110111000' => 'DOCUMENTATION', # 2001:DB8::/32 '0010000000000001000000000001' => 'ORCHID', # 2001:10::/28 '0010000000000010' => '6TO4', # 2002::/16 '010' => 'RESERVED', # 4000::/3 '011' => 'RESERVED', # 6000::/3 '100' => 'RESERVED', # 8000::/3 '101' => 'RESERVED', # A000::/3 '110' => 'RESERVED', # C000::/3 '1110' => 'RESERVED', # E000::/4 '11110' => 'RESERVED', # F000::/5 '111110' => 'RESERVED', # F800::/6 '1111110' => 'UNIQUE-LOCAL-UNICAST', # FC00::/7 '111111100' => 'RESERVED', # FE00::/9 '1111111010' => 'LINK-LOCAL-UNICAST', # FE80::/10 '1111111011' => 'RESERVED', # FEC0::/10 '11111111' => 'MULTICAST', # FF00::/8 ); # Overlap constants $IP_NO_OVERLAP = 0; $IP_PARTIAL_OVERLAP = 1; $IP_A_IN_B_OVERLAP = -1; $IP_B_IN_A_OVERLAP = -2; $IP_IDENTICAL = -3; # ---------------------------------------------------------- # OVERLOADING use overload ( '+' => 'ip_add_num', 'bool' => sub { @_ }, ); #------------------------------------------------------------------------------ # Subroutine ip_num_add # Purpose : Add an integer to an IP # Params : Number to add # Returns : New object or undef # Note : Used by overloading - returns undef when # the end of the range is reached sub ip_add_num { my $self = shift; my ($value) = @_; my $ip = $self->intip + $value; my $last = $self->last_int; # Reached the end of the range ? if ($ip > $self->last_int) { return; } my $newb = ip_inttobin($ip, $self->version); $newb = ip_bintoip($newb, $self->version); my $newe = ip_inttobin($last, $self->version); $newe = ip_bintoip($newe, $self->version); my $new = new Net::IP("$newb - $newe"); return ($new); } # ----------------------------------------------------------------------------- #------------------------------------------------------------------------------ # Subroutine new # Purpose : Create an instance of an IP object # Params : Class, IP prefix, IP version # Returns : Object reference or undef # Note : New just allocates a new object - set() does all the work sub new { my ($class, $data, $ipversion) = (@_); # Allocate new object my $self = {}; bless($self, $class); # Pass everything to set() unless ($self->set($data, $ipversion)) { return; } return $self; } #------------------------------------------------------------------------------ # Subroutine set # Purpose : Set the IP for an IP object # Params : Data, IP type # Returns : 1 (success) or undef (failure) sub set { my $self = shift; my ($data, $ipversion) = @_; # Normalize data as received - this should return 2 IPs my ($begin, $end) = ip_normalize($data, $ipversion) or do { $self->{error} = $ERROR; $self->{errno} = $ERRNO; return; }; # Those variables are set when the object methods are called # We need to reset everything for ( qw(ipversion errno prefixlen binmask reverse_ip last_ip iptype binip error ip intformat hexformat mask last_bin last_int prefix is_prefix) ) { delete($self->{$_}); } # Determine IP version for this object return unless ($self->{ipversion} = $ipversion || ip_get_version($begin)); # Set begin IP address $self->{ip} = $begin; # Set Binary IP address return unless ($self->{binip} = ip_iptobin($self->ip(), $self->version())); $self->{is_prefix} = 0; # Set end IP address # If single IP: begin and end IPs are identical $end ||= $begin; $self->{last_ip} = $end; # Try to determine the IP version my $ver = ip_get_version($end) || return; # Check if begin and end addresses have the same version if ($ver != $self->version()) { $ERRNO = 201; $ERROR = "Begin and End addresses have different IP versions - $begin - $end"; $self->{errno} = $ERRNO; $self->{error} = $ERROR; return; } # Get last binary address return unless ($self->{last_bin} = ip_iptobin($self->last_ip(), $self->version())); # Check that End IP >= Begin IP unless (ip_bincomp($self->binip(), 'le', $self->last_bin())) { $ERRNO = 202; $ERROR = "Begin address is greater than End address $begin - $end"; $self->{errno} = $ERRNO; $self->{error} = $ERROR; return; } # Find all prefixes (eg:/24) in the current range my @prefixes = $self->find_prefixes() or return; # If there is only one prefix: if (scalar(@prefixes) == 1) { # Get length of prefix return unless ((undef, $self->{prefixlen}) = ip_splitprefix($prefixes[0])); # Set prefix boolean var # This value is 1 if the IP range only contains a single /nn prefix $self->{is_prefix} = 1; } # If the range is a single prefix: if ($self->{is_prefix}) { # Set mask property $self->{binmask} = ip_get_mask($self->prefixlen(), $self->version()); # Check that the mask is valid unless ( ip_check_prefix( $self->binip(), $self->prefixlen(), $self->version() ) ) { $self->{error} = $ERROR; $self->{errno} = $ERRNO; return; } } return ($self); } sub print { my $self = shift; if ($self->{is_prefix}) { return ($self->short() . '/' . $self->prefixlen()); } else { return (sprintf("%s - %s", $self->ip(), $self->last_ip())); } } #------------------------------------------------------------------------------ # Subroutine error # Purpose : Return the current error message # Returns : Error string sub error { my $self = shift; return $self->{error}; } #------------------------------------------------------------------------------ # Subroutine errno # Purpose : Return the current error number # Returns : Error number sub errno { my $self = shift; return $self->{errno}; } #------------------------------------------------------------------------------ # Subroutine binip # Purpose : Return the IP as a binary string # Returns : binary string sub binip { my $self = shift; return $self->{binip}; } #------------------------------------------------------------------------------ # Subroutine prefixlen # Purpose : Get the IP prefix length # Returns : prefix length sub prefixlen { my $self = shift; return $self->{prefixlen}; } #------------------------------------------------------------------------------ # Subroutine version # Purpose : Return the IP version # Returns : IP version sub version { my $self = shift; return $self->{ipversion}; } #------------------------------------------------------------------------------ # Subroutine version # Purpose : Return the IP in quad format # Returns : IP string sub ip { my $self = shift; return $self->{ip}; } #------------------------------------------------------------------------------ # Subroutine is_prefix # Purpose : Check if range of IPs is a prefix # Returns : boolean sub is_prefix { my $self = shift; return $self->{is_prefix}; } #------------------------------------------------------------------------------ # Subroutine binmask # Purpose : Return the binary mask of an IP prefix # Returns : Binary mask (as string) sub binmask { my $self = shift; return $self->{binmask}; } #------------------------------------------------------------------------------ # Subroutine size # Purpose : Return the number of addresses contained in an IP object # Returns : Number of addresses sub size { my $self = shift; my $size = new Math::BigInt($self->last_int); $size->badd(1); $size->bsub($self->intip); } # All the following functions work the same way: the method is just a frontend # to the real function. When the real function is called, the output is cached # so that next time the same function is called,the frontend function directly # returns the result. #------------------------------------------------------------------------------ # Subroutine intip # Purpose : Return the IP in integer format # Returns : Integer sub intip { my $self = shift; return ($self->{intformat}) if defined($self->{intformat}); my $int = ip_bintoint($self->binip()); if (!$int) { $self->{error} = $ERROR; $self->{errno} = $ERRNO; return; } $self->{intformat} = $int; return ($int); } #------------------------------------------------------------------------------ # Subroutine hexip # Purpose : Return the IP in hex format # Returns : hex string sub hexip { my $self = shift; return $self->{'hexformat'} if(defined($self->{'hexformat'})); $self->{'hexformat'} = $self->intip->as_hex(); return $self->{'hexformat'}; } #------------------------------------------------------------------------------ # Subroutine hexmask # Purpose : Return the mask back in hex # Returns : hex string sub hexmask { my $self = shift; return $self->{hexmask} if(defined($self->{hexmask})); my $intmask = ip_bintoint($self->binmask); $self->{'hexmask'} = $intmask->as_hex(); return ($self->{'hexmask'}); } #------------------------------------------------------------------------------ # Subroutine prefix # Purpose : Return the Prefix (n.n.n.n/s) # Returns : IP Prefix sub prefix { my $self = shift; if (not $self->is_prefix()) { $self->{error} = "IP range $self->{ip} is not a Prefix."; $self->{errno} = 209; return; } return ($self->{prefix}) if defined($self->{prefix}); my $prefix = $self->ip() . '/' . $self->prefixlen(); if (!$prefix) { $self->{error} = $ERROR; $self->{errno} = $ERRNO; return; } $self->{prefix} = $prefix; return ($prefix); } #------------------------------------------------------------------------------ # Subroutine mask # Purpose : Return the IP mask in quad format # Returns : Mask (string) sub mask { my $self = shift; if (not $self->is_prefix()) { $self->{error} = "IP range $self->{ip} is not a Prefix."; $self->{errno} = 209; return; } return ($self->{mask}) if defined($self->{mask}); my $mask = ip_bintoip($self->binmask(), $self->version()); if (!$mask) { $self->{error} = $ERROR; $self->{errno} = $ERRNO; return; } $self->{mask} = $mask; return ($mask); } #------------------------------------------------------------------------------ # Subroutine short # Purpose : Get the short format of an IP address or a Prefix # Returns : short format IP or undef sub short { my $self = shift; my $r; if ($self->version == 6) { $r = ip_compress_address($self->ip(), $self->version()); } else { $r = ip_compress_v4_prefix($self->ip(), $self->prefixlen()); } if (!defined($r)) { $self->{error} = $ERROR; $self->{errno} = $ERRNO; return; } return ($r); } #------------------------------------------------------------------------------ # Subroutine iptype # Purpose : Return the type of an IP # Returns : Type or undef (failure) sub iptype { my ($self) = shift; return ($self->{iptype}) if defined($self->{iptype}); my $type = ip_iptype($self->binip(), $self->version()); if (!$type) { $self->{error} = $ERROR; $self->{errno} = $ERRNO; return; } $self->{iptype} = $type; return ($type); } #------------------------------------------------------------------------------ # Subroutine reverse_ip # Purpose : Return the Reverse IP # Returns : Reverse IP or undef(failure) sub reverse_ip { my ($self) = shift; if (not $self->is_prefix()) { $self->{error} = "IP range $self->{ip} is not a Prefix."; $self->{errno} = 209; return; } return ($self->{reverse_ip}) if defined($self->{reverse_ip}); my $rev = ip_reverse($self->ip(), $self->prefixlen(), $self->version()); if (!$rev) { $self->{error} = $ERROR; $self->{errno} = $ERRNO; return; } $self->{reverse_ip} = $rev; return ($rev); } #------------------------------------------------------------------------------ # Subroutine last_bin # Purpose : Get the last IP of a range in binary format # Returns : Last binary IP or undef (failure) sub last_bin { my ($self) = shift; return ($self->{last_bin}) if defined($self->{last_bin}); my $last; if ($self->is_prefix()) { $last = ip_last_address_bin($self->binip(), $self->prefixlen(), $self->version()); } else { $last = ip_iptobin($self->last_ip(), $self->version()); } if (!$last) { $self->{error} = $ERROR; $self->{errno} = $ERRNO; return; } $self->{last_bin} = $last; return ($last); } #------------------------------------------------------------------------------ # Subroutine last_int # Purpose : Get the last IP of a range in integer format # Returns : Last integer IP or undef (failure) sub last_int { my ($self) = shift; return ($self->{last_int}) if defined($self->{last_int}); my $last_bin = $self->last_bin() or return; my $last_int = ip_bintoint($last_bin, $self->version()) or return; $self->{last_int} = $last_int; return ($last_int); } #------------------------------------------------------------------------------ # Subroutine last_ip # Purpose : Get the last IP of a prefix in IP format # Returns : IP or undef (failure) sub last_ip { my ($self) = shift; return ($self->{last_ip}) if defined($self->{last_ip}); my $last = ip_bintoip($self->last_bin(), $self->version()); if (!$last) { $self->{error} = $ERROR; $self->{errno} = $ERRNO; return; } $self->{last_ip} = $last; return ($last); } #------------------------------------------------------------------------------ # Subroutine find_prefixes # Purpose : Get all prefixes in the range defined by two IPs # Params : IP # Returns : List of prefixes or undef (failure) sub find_prefixes { my ($self) = @_; my @list = ip_range_to_prefix($self->binip(), $self->last_bin(), $self->version()); if (!scalar(@list)) { $self->{error} = $ERROR; $self->{errno} = $ERRNO; return; } return (@list); } #------------------------------------------------------------------------------ # Subroutine bincomp # Purpose : Compare two IPs # Params : Operation, IP to compare # Returns : 1 (True), 0 (False) or undef (problem) # Comments : Operation can be lt, le, gt, ge sub bincomp { my ($self, $op, $other) = @_; my $a = ip_bincomp($self->binip(), $op, $other->binip()); unless (defined $a) { $self->{error} = $ERROR; $self->{errno} = $ERRNO; return; } return ($a); } #------------------------------------------------------------------------------ # Subroutine binadd # Purpose : Add two IPs # Params : IP to add # Returns : New IP object or undef (failure) sub binadd { my ($self, $other) = @_; my $ip = ip_binadd($self->binip(), $other->binip()); if (!$ip) { $self->{error} = $ERROR; $self->{errno} = $ERRNO; return; } my $new = new Net::IP(ip_bintoip($ip, $self->version())) or return; return ($new); } #------------------------------------------------------------------------------ # Subroutine aggregate # Purpose : Aggregate (append) two IPs # Params : IP to add # Returns : New IP object or undef (failure) sub aggregate { my ($self, $other) = @_; my $r = ip_aggregate( $self->binip(), $self->last_bin(), $other->binip(), $other->last_bin(), $self->version() ); if (!$r) { $self->{error} = $ERROR; $self->{errno} = $ERRNO; return; } return (new Net::IP($r)); } #------------------------------------------------------------------------------ # Subroutine overlaps # Purpose : Check if two prefixes overlap # Params : Prefix to compare # Returns : $NO_OVERLAP (no overlap) # $IP_PARTIAL_OVERLAP (overlap) # $IP_A_IN_B_OVERLAP (range1 is included in range2) # $IP_B_IN_A_OVERLAP (range2 is included in range1) # $IP_IDENTICAL (range1 == range2) # or undef (problem) sub overlaps { my ($self, $other) = @_; my $r = ip_is_overlap( $self->binip(), $self->last_bin(), $other->binip(), $other->last_bin() ); if (!defined($r)) { $self->{error} = $ERROR; $self->{errno} = $ERRNO; return; } return ($r); } #------------------------------------------------------------------------------ # Subroutine auth # Purpose : Return Authority information from IP::Authority # Params : IP object # Returns : Authority Source sub auth { my ($self) = shift; return ($self->{auth}) if defined($self->{auth}); my $auth = ip_auth($self->ip, $self->version); if (!$auth) { $self->{error} = $ERROR; $self->{errno} = $ERRNO; return; } $self->{auth} = $auth; return ($self->{auth}); } #------------------------------ PROCEDURAL INTERFACE -------------------------- #------------------------------------------------------------------------------ # Subroutine Error # Purpose : Return the ERROR string # Returns : string sub Error { return ($ERROR); } #------------------------------------------------------------------------------ # Subroutine Error # Purpose : Return the ERRNO value # Returns : number sub Errno { return ($ERRNO); } #------------------------------------------------------------------------------ # Subroutine ip_iplengths # Purpose : Get the length in bits of an IP from its version # Params : IP version # Returns : Number of bits sub ip_iplengths { my ($version) = @_; if ($version == 4) { return (32); } elsif ($version == 6) { return (128); } else { return; } } #------------------------------------------------------------------------------ # Subroutine ip_iptobin # Purpose : Transform an IP address into a bit string # Params : IP address, IP version # Returns : bit string on success, undef otherwise sub ip_iptobin { my ($ip, $ipversion) = @_; # v4 -> return 32-bit array if ($ipversion == 4) { return unpack('B32', pack('C4C4C4C4', split(/\./, $ip))); } # Strip ':' $ip =~ s/://g; # Check size unless (length($ip) == 32) { $ERROR = "Bad IP address $ip"; $ERRNO = 102; return; } # v6 -> return 128-bit array return unpack('B128', pack('H32', $ip)); } #------------------------------------------------------------------------------ # Subroutine ip_bintoip # Purpose : Transform a bit string into an IP address # Params : bit string, IP version # Returns : IP address on success, undef otherwise sub ip_bintoip { my ($binip, $ip_version) = @_; # Define normal size for address my $len = ip_iplengths($ip_version); if ($len < length($binip)) { $ERROR = "Invalid IP length for binary IP $binip\n"; $ERRNO = 189; return; } # Prepend 0s if address is less than normal size $binip = '0' x ($len - length($binip)) . $binip; # IPv4 if ($ip_version == 4) { return join '.', unpack('C4C4C4C4', pack('B32', $binip)); } # IPv6 return join(':', unpack('H4H4H4H4H4H4H4H4', pack('B128', $binip))); } #------------------------------------------------------------------------------ # Subroutine ip_bintoint # Purpose : Transform a bit string into an Integer # Params : bit string # Returns : BigInt sub ip_bintoint { my $binip = shift; # $n is the increment, $dec is the returned value my ($n, $dec) = (Math::BigInt->new(1), Math::BigInt->new(0)); # Reverse the bit string foreach (reverse(split '', $binip)) { # If the nth bit is 1, add 2**n to $dec $_ and $dec += $n; $n *= 2; } # Strip leading + sign $dec =~ s/^\+//; return $dec; } #------------------------------------------------------------------------------ # Subroutine ip_inttobin # Purpose : Transform a BigInt into a bit string # Comments : sets warnings (-w) off. # This is necessary because Math::BigInt is not compliant # Params : BigInt, IP version # Returns : bit string sub ip_inttobin { my $dec = Math::BigInt->new(shift); # Find IP version my $ip_version = shift; unless ($ip_version) { $ERROR = "Cannot determine IP version for $dec"; $ERRNO = 101; return; } my $binip = $dec->as_bin(); $binip =~ s/^0b//; # Define normal size for address my $len = ip_iplengths($ip_version); # Prepend 0s if result is less than normal size $binip = '0' x ($len - length($binip)) . $binip; return $binip; } #------------------------------------------------------------------------------ # Subroutine ip_get_version # Purpose : Get an IP version # Params : IP address # Returns : 4, 6, 0(don't know) sub ip_get_version { my $ip = shift; # If the address does not contain any ':', maybe it's IPv4 $ip !~ /:/ and ip_is_ipv4($ip) and return '4'; # Is it IPv6 ? ip_is_ipv6($ip) and return '6'; return; } #------------------------------------------------------------------------------ # Subroutine ip_is_ipv4 # Purpose : Check if an IP address is version 4 # Params : IP address # Returns : 1 (yes) or 0 (no) sub ip_is_ipv4 { my $ip = shift; # Check for invalid chars unless ($ip =~ m/^[\d\.]+$/) { $ERROR = "Invalid chars in IP $ip"; $ERRNO = 107; return 0; } if ($ip =~ m/^\./) { $ERROR = "Invalid IP $ip - starts with a dot"; $ERRNO = 103; return 0; } if ($ip =~ m/\.$/) { $ERROR = "Invalid IP $ip - ends with a dot"; $ERRNO = 104; return 0; } # Single Numbers are considered to be IPv4 if ($ip =~ m/^(\d+)$/ and $1 < 256) { return 1 } # Count quads my $n = ($ip =~ tr/\./\./); # IPv4 must have from 1 to 4 quads unless ($n >= 0 and $n < 4) { $ERROR = "Invalid IP address $ip"; $ERRNO = 105; return 0; } # Check for empty quads if ($ip =~ m/\.\./) { $ERROR = "Empty quad in IP address $ip"; $ERRNO = 106; return 0; } foreach (split /\./, $ip) { # Check for invalid quads unless ($_ >= 0 and $_ < 256) { $ERROR = "Invalid quad in IP address $ip - $_"; $ERRNO = 107; return 0; } } return 1; } #------------------------------------------------------------------------------ # Subroutine ip_is_ipv6 # Purpose : Check if an IP address is version 6 # Params : IP address # Returns : 1 (yes) or 0 (no) sub ip_is_ipv6 { my $ip = shift; # Count octets my $n = ($ip =~ tr/:/:/); return 0 unless ($n > 0 and $n < 8); # $k is a counter my $k; foreach (split /:/, $ip) { $k++; # Empty octet ? next if ($_ eq ''); # Normal v6 octet ? next if (/^[a-f\d]{1,4}$/i); # Last octet - is it IPv4 ? if ( ($k == $n + 1) && ip_is_ipv4($_) ) { $n++; # ipv4 is two octets next; } $ERROR = "Invalid IP address $ip"; $ERRNO = 108; return 0; } # Does the IP address start with : ? if ($ip =~ m/^:[^:]/) { $ERROR = "Invalid address $ip (starts with :)"; $ERRNO = 109; return 0; } # Does the IP address finish with : ? if ($ip =~ m/[^:]:$/) { $ERROR = "Invalid address $ip (ends with :)"; $ERRNO = 110; return 0; } # Does the IP address have more than one '::' pattern ? if ($ip =~ s/:(?=:)/:/g > 1) { $ERROR = "Invalid address $ip (More than one :: pattern)"; $ERRNO = 111; return 0; } # number of octets if ($n != 7 && $ip !~ /::/) { $ERROR = "Invalid number of octets $ip"; $ERRNO = 112; return 0; } # valid IPv6 address return 1; } #------------------------------------------------------------------------------ # Subroutine ip_expand_address # Purpose : Expand an address from compact notation # Params : IP address, IP version # Returns : expanded IP address or undef on failure sub ip_expand_address { my ($ip, $ip_version) = @_; unless ($ip_version) { $ERROR = "Cannot determine IP version for $ip"; $ERRNO = 101; return; } # v4 : add .0 for missing quads if ($ip_version == 4) { my @quads = split /\./, $ip; # check number of quads if (scalar(@quads) > 4) { $ERROR = "Not a valid IPv address $ip"; $ERRNO = 102; return; } my @clean_quads = (0, 0, 0, 0); foreach my $q (reverse @quads) { #check quad data if ($q !~ m/^\d{1,3}$/) { $ERROR = "Not a valid IPv4 address $ip"; $ERRNO = 102; return; } # build clean ipv4 unshift(@clean_quads, $q + 1 - 1); } return (join '.', @clean_quads[ 0 .. 3 ]); } # Keep track of :: my $num_of_double_colon = ($ip =~ s/::/:!:/g); if ($num_of_double_colon > 1) { $ERROR = "Too many :: in ip"; $ERRNO = 102; return; } # IP as an array my @ip = split /:/, $ip; # Number of octets my $num = scalar(@ip); foreach (0 .. (scalar(@ip) - 1)) { # Embedded IPv4 if ($ip[$_] =~ /\./) { # Expand Ipv4 address # Convert into binary # Convert into hex # Keep the last two octets $ip[$_] = substr( ip_bintoip( ip_iptobin( ip_expand_address($ip[$_], 4), 4), 6), -9); # Has an error occured here ? return unless (defined($ip[$_])); # $num++ because we now have one more octet: # IPv4 address becomes two octets $num++; next; } # Add missing trailing 0s $ip[$_] = ('0' x (4 - length($ip[$_]))) . $ip[$_]; } # Now deal with '::' ('000!') foreach (0 .. (scalar(@ip) - 1)) { # Find the pattern next unless ($ip[$_] eq '000!'); # @empty is the IP address 0 my @empty = map { $_ = '0' x 4 } (0 .. 7); # Replace :: with $num '0000' octets $ip[$_] = join ':', @empty[ 0 .. 8 - $num ]; last; } return (lc(join ':', @ip)); } #------------------------------------------------------------------------------ # Subroutine ip_get_mask # Purpose : Get IP mask from prefix length. # Params : Prefix length, IP version # Returns : Binary Mask sub ip_get_mask { my ($len, $ip_version) = @_; unless ($ip_version) { $ERROR = "Cannot determine IP version"; $ERRNO = 101; return; } my $size = ip_iplengths($ip_version); # mask is $len 1s plus the rest as 0s return (('1' x $len) . ('0' x ($size - $len))); } #------------------------------------------------------------------------------ # Subroutine ip_last_address_bin # Purpose : Return the last binary address of a range # Params : First binary IP, prefix length, IP version # Returns : Binary IP sub ip_last_address_bin { my ($binip, $len, $ip_version) = @_; unless ($ip_version) { $ERROR = "Cannot determine IP version"; $ERRNO = 101; return; } my $size = ip_iplengths($ip_version); # Find the part of the IP address which will not be modified $binip = substr($binip, 0, $len); # Fill with 1s the variable part return ($binip . ('1' x ($size - length($binip)))); } #------------------------------------------------------------------------------ # Subroutine ip_splitprefix # Purpose : Split a prefix into IP and prefix length # Comments : If it was passed a simple IP, it just returns it # Params : Prefix # Returns : IP, optionnaly length of prefix sub ip_splitprefix { my $prefix = shift; # Find the '/' return unless ($prefix =~ m!^([^/]+?)(/\d+)?$!); my ($ip, $len) = ($1, $2); defined($len) and $len =~ s!/!!; return ($ip, $len); } #------------------------------------------------------------------------------ # Subroutine ip_prefix_to_range # Purpose : Get a range from a prefix # Params : IP, Prefix length, IP version # Returns : First IP, last IP sub ip_prefix_to_range { my ($ip, $len, $ip_version) = @_; unless ($ip_version) { $ERROR = "Cannot determine IP version"; $ERRNO = 101; return; } # Expand the first IP address $ip = ip_expand_address($ip, $ip_version); # Turn into a binary # Get last address # Turn into an IP my $binip = ip_iptobin($ip, $ip_version) or return; return unless (ip_check_prefix($binip, $len, $ip_version)); my $lastip = ip_last_address_bin($binip, $len, $ip_version) or return; return unless ($lastip = ip_bintoip($lastip, $ip_version)); return ($ip, $lastip); } #------------------------------------------------------------------------------ # Subroutine ip_is_valid_mask # Purpose : Check the validity of an IP mask (11110000) # Params : Mask # Returns : 1 or undef (invalid) sub ip_is_valid_mask { my ($mask, $ip_version) = @_; unless ($ip_version) { $ERROR = "Cannot determine IP version for $mask"; $ERRNO = 101; return; } my $len = ip_iplengths($ip_version); if (length($mask) != $len) { $ERROR = "Invalid mask length for $mask"; $ERRNO = 150; return; } # The mask should be of the form 111110000000 unless ($mask =~ m/^1*0*$/) { $ERROR = "Invalid mask $mask"; $ERRNO = 151; return; } return 1; } #------------------------------------------------------------------------------ # Subroutine ip_bincomp # Purpose : Compare binary Ips with <, >, <=, >= # Comments : Operators are lt(<), le(<=), gt(>), and ge(>=) # Params : First binary IP, operator, Last binary Ip # Returns : 1 (yes), 0 (no), or undef (problem) sub ip_bincomp { my ($begin, $op, $end) = @_; my ($b, $e); if ($op =~ /^l[te]$/) # Operator is lt or le { ($b, $e) = ($end, $begin); } elsif ($op =~ /^g[te]$/) # Operator is gt or ge { ($b, $e) = ($begin, $end); } else { $ERROR = "Invalid Operator $op\n"; $ERRNO = 131; return; } # le or ge -> return 1 if IPs are identical return (1) if ($op =~ /e/ and ($begin eq $end)); # Check IP sizes unless (length($b) eq length($e)) { $ERROR = "IP addresses of different length\n"; $ERRNO = 130; return; } my $c; # Foreach bit for (0 .. length($b) - 1) { # substract the two bits $c = substr($b, $_, 1) - substr($e, $_, 1); # Check the result return (1) if ($c == 1); return (0) if ($c == -1); } # IPs are identical return 0; } #------------------------------------------------------------------------------ # Subroutine ip_binadd # Purpose : Add two binary IPs # Params : First binary IP, Last binary Ip # Returns : Binary sum or undef (problem) sub ip_binadd { my ($b, $e) = @_; # Check IP length unless (length($b) eq length($e)) { $ERROR = "IP addresses of different length\n"; $ERRNO = 130; return; } # Reverse the two IPs $b = scalar(reverse $b); $e = scalar(reverse $e); my ($carry, $result, $c) = (0); # Foreach bit (reversed) for (0 .. length($b) - 1) { # add the two bits plus the carry $c = substr($b, $_, 1) + substr($e, $_, 1) + $carry; $carry = 0; # sum = 0 => $c = 0, $carry = 0 # sum = 1 => $c = 1, $carry = 0 # sum = 2 => $c = 0, $carry = 1 # sum = 3 => $c = 1, $carry = 1 if ($c > 1) { $c -= 2; $carry = 1; } $result .= $c; } # Reverse result return scalar(reverse($result)); } #------------------------------------------------------------------------------ # Subroutine ip_get_prefix_length # Purpose : Get the prefix length for a given range of IPs # Params : First binary IP, Last binary IP # Returns : Length of prefix or undef (problem) sub ip_get_prefix_length { my ($bin1, $bin2) = @_; # Check length of IPs unless (length($bin1) eq length($bin2)) { $ERROR = "IP addresses of different length\n"; $ERRNO = 130; return; } # reverse IPs $bin1 = scalar(reverse $bin1); $bin2 = scalar(reverse $bin2); # foreach bit for (0 .. length($bin1) - 1) { # If bits are equal it means we have reached the longest prefix return ("$_") if (substr($bin1, $_, 1) eq substr($bin2, $_, 1)); } # Return 32 (IPv4) or 128 (IPv6) return length($bin1); } #------------------------------------------------------------------------------ # Subroutine ip_range_to_prefix # Purpose : Return all prefixes between two IPs # Params : First IP, Last IP, IP version # Returns : List of Prefixes or undef (problem) sub ip_range_to_prefix { my ($binip, $endbinip, $ip_version) = @_; unless ($ip_version) { $ERROR = "Cannot determine IP version"; $ERRNO = 101; return; } unless (length($binip) eq length($endbinip)) { $ERROR = "IP addresses of different length\n"; $ERRNO = 130; return; } my ($len, $nbits, $current, $add, @prefix); # 1 in binary my $one = ('0' x (ip_iplengths($ip_version) - 1)) . '1'; # While we have not reached the last IP while (ip_bincomp($binip, 'le', $endbinip) == 1) { # Find all 0s at the end if ($binip =~ m/(0+)$/) { # nbits = nb of 0 bits $nbits = length($1); } else { $nbits = 0; } do { $current = $binip; $add = '1' x $nbits; # Replace $nbits 0s with 1s $current =~ s/0{$nbits}$/$add/; $nbits--; # Decrease $nbits if $current >= $endbinip } while (ip_bincomp($current, 'le', $endbinip) != 1); # Find Prefix length $len = (ip_iplengths($ip_version)) - ip_get_prefix_length($binip, $current); # Push prefix in list push(@prefix, ip_bintoip($binip, $ip_version) . "/$len"); # Add 1 to current IP $binip = ip_binadd($current, $one); # Exit if IP is 32/128 1s last if ($current =~ m/^1+$/); } return (@prefix); } #------------------------------------------------------------------------------ # Subroutine ip_compress_v4_prefix # Purpose : Compress an IPv4 Prefix # Params : IP, Prefix length # Returns : Compressed IP - ie: 194.5 sub ip_compress_v4_prefix { my ($ip, $len) = @_; my @quads = split /\./, $ip; my $qlen = int(($len - 1) / 8); $qlen = 0 if ($qlen < 0); my $newip = join '.', @quads[ 0 .. $qlen ]; return ($newip); } #------------------------------------------------------------------------------ # Subroutine ip_compress_address # Purpose : Compress an IPv6 address # Params : IP, IP version # Returns : Compressed IP or undef (problem) sub ip_compress_address { my ($ip, $ip_version) = @_; unless ($ip_version) { $ERROR = "Cannot determine IP version for $ip"; $ERRNO = 101; return; } # Just return if IP is IPv4 return ($ip) if ($ip_version == 4); # already compressed addresses must be expanded first $ip = ip_expand_address( $ip, $ip_version); # Remove leading 0s: 0034 -> 34; 0000 -> 0 $ip =~ s/ (^|:) # Find beginning or ':' -> $1 0+ # 1 or several 0s (?= # Look-ahead [a-fA-F\d]+ # One or several Hexs (?::|$)) # ':' or end /$1/gx; my $reg = ''; # Find the longuest :0:0: sequence while ( $ip =~ m/ ((?:^|:) # Find beginning or ':' -> $1 0(?::0)+ # 0 followed by 1 or several ':0' (?::|$)) # ':' or end /gx ) { $reg = $1 if (length($reg) < length($1)); } # Replace sequence by '::' $ip =~ s/$reg/::/ if ($reg ne ''); return $ip; } #------------------------------------------------------------------------------ # Subroutine ip_is_overlap # Purpose : Check if two ranges overlap # Params : Four binary IPs (begin of range 1,end1,begin2,end2) # Returns : $NO_OVERLAP (no overlap) # $IP_PARTIAL_OVERLAP (overlap) # $IP_A_IN_B_OVERLAP (range1 is included in range2) # $IP_B_IN_A_OVERLAP (range2 is included in range1) # $IP_IDENTICAL (range1 == range2) # or undef (problem) sub ip_is_overlap { my ($b1, $e1, $b2, $e2) = (@_); my $swap; $swap = 0; unless ((length($b1) eq length($e1)) and (length($b2) eq length($e2)) and (length($b1) eq length($b2))) { $ERROR = "IP addresses of different length\n"; $ERRNO = 130; return; } # begin1 <= end1 ? unless (ip_bincomp($b1, 'le', $e1) == 1) { $ERROR = "Invalid range $b1 - $e1"; $ERRNO = 140; return; } # begin2 <= end2 ? unless (ip_bincomp($b2, 'le', $e2) == 1) { $ERROR = "Invalid range $b2 - $e2"; $ERRNO = 140; return; } # b1 == b2 ? if ($b1 eq $b2) { # e1 == e2 return ($IP_IDENTICAL) if ($e1 eq $e2); # e1 < e2 ? return ( ip_bincomp($e1, 'lt', $e2) ? $IP_A_IN_B_OVERLAP : $IP_B_IN_A_OVERLAP ); } # e1 == e2 ? if ($e1 eq $e2) { # b1 < b2 return ( ip_bincomp($b1, 'lt', $b2) ? $IP_B_IN_A_OVERLAP : $IP_A_IN_B_OVERLAP ); } # b1 < b2 if ((ip_bincomp($b1, 'lt', $b2) == 1)) { # e1 < b2 return ($IP_NO_OVERLAP) if (ip_bincomp($e1, 'lt', $b2) == 1); # e1 < e2 ? return ( ip_bincomp($e1, 'lt', $e2) ? $IP_PARTIAL_OVERLAP : $IP_B_IN_A_OVERLAP ); } else # b1 > b2 { # e2 < b1 return ($IP_NO_OVERLAP) if (ip_bincomp($e2, 'lt', $b1) == 1); # e2 < e1 ? return ( ip_bincomp($e2, 'lt', $e1) ? $IP_PARTIAL_OVERLAP : $IP_A_IN_B_OVERLAP ); } } #------------------------------------------------------------------------------ # Subroutine get_embedded_ipv4 # Purpose : Get an IPv4 embedded in an IPv6 address # Params : IPv6 # Returns : IPv4 or undef (not found) sub ip_get_embedded_ipv4 { my $ipv6 = shift; my @ip = split /:/, $ipv6; # Bugfix by Norbert Koch return unless (@ip); # last octet should be ipv4 return ($ip[-1]) if (ip_is_ipv4($ip[-1])); return; } #------------------------------------------------------------------------------ # Subroutine aggregate # Purpose : Aggregate 2 ranges # Params : 1st range (1st IP, Last IP), last range (1st IP, last IP), # IP version # Returns : prefix or undef (invalid) sub ip_aggregate { my ($binbip1, $bineip1, $binbip2, $bineip2, $ip_version) = @_; unless ($ip_version) { $ERROR = "Cannot determine IP version for $binbip1"; $ERRNO = 101; return; } # Bin 1 my $one = (('0' x (ip_iplengths($ip_version) - 1)) . '1'); # $eip1 + 1 = $bip2 ? unless (ip_binadd($bineip1, $one) eq $binbip2) { $ERROR = "Ranges not contiguous - $bineip1 - $binbip2"; $ERRNO = 160; return; } # Get ranges my @prefix = ip_range_to_prefix($binbip1, $bineip2, $ip_version); # There should be only one range return if scalar(@prefix) < 1; if (scalar(@prefix) > 1) { $ERROR = "$binbip1 - $bineip2 is not a single prefix"; $ERRNO = 161; return; } return ($prefix[0]); } #------------------------------------------------------------------------------ # Subroutine ip_iptype # Purpose : Return the type of an IP (Public, Private, Reserved) # Params : IP to test, IP version # Returns : type or undef (invalid) sub ip_iptype { my ($ip, $ip_version) = @_; # handle known ip versions return ip_iptypev4($ip) if $ip_version == 4; return ip_iptypev6($ip) if $ip_version == 6; # unsupported ip version $ERROR = "IP version $ip not supported"; $ERRNO = 180; return; } #------------------------------------------------------------------------------ # Subroutine ip_iptypev4 # Purpose : Return the type of an IP (Public, Private, Reserved) # Params : IP to test, IP version # Returns : type or undef (invalid) sub ip_iptypev4 { my ($ip) = @_; # check ip if ($ip !~ m/^[01]{1,32}$/) { $ERROR = "$ip is not a binary IPv4 address $ip"; $ERRNO = 180; return; } # see if IP is listed foreach (sort { length($b) <=> length($a) } keys %IPv4ranges) { return ($IPv4ranges{$_}) if ($ip =~ m/^$_/); } # not listed means IP is public return 'PUBLIC'; } #------------------------------------------------------------------------------ # Subroutine ip_iptypev6 # Purpose : Return the type of an IP (Public, Private, Reserved) # Params : IP to test, IP version # Returns : type or undef (invalid) sub ip_iptypev6 { my ($ip) = @_; # check ip if ($ip !~ m/^[01]{1,128}$/) { $ERROR = "$ip is not a binary IPv6 address"; $ERRNO = 180; return; } foreach (sort { length($b) <=> length($a) } keys %IPv6ranges) { return ($IPv6ranges{$_}) if ($ip =~ m/^$_/); } # How did we get here? All IPv6 addresses should match $ERROR = "Cannot determine type for $ip"; $ERRNO = 180; return; } #------------------------------------------------------------------------------ # Subroutine ip_check_prefix # Purpose : Check the validity of a prefix # Params : binary IP, length of prefix, IP version # Returns : 1 or undef (invalid) sub ip_check_prefix { my ($binip, $len, $ipversion) = (@_); # Check if len is longer than IP if ($len > length($binip)) { $ERROR = "Prefix length $len is longer than IP address (" . length($binip) . ")"; $ERRNO = 170; return; } my $rest = substr($binip, $len); # Check if last part of the IP (len part) has only 0s unless ($rest =~ /^0*$/) { $ERROR = "Invalid prefix $binip/$len"; $ERRNO = 171; return; } # Check if prefix length is correct unless (length($rest) + $len == ip_iplengths($ipversion)) { $ERROR = "Invalid prefix length /$len"; $ERRNO = 172; return; } return 1; } #------------------------------------------------------------------------------ # Subroutine ip_reverse # Purpose : Get a reverse name from a prefix # Comments : From Lee's iplib.pm # Params : IP, length of prefix, IP version # Returns : Reverse name or undef (error) sub ip_reverse { my ($ip, $len, $ip_version) = (@_); $ip_version ||= ip_get_version($ip); unless ($ip_version) { $ERROR = "Cannot determine IP version for $ip"; $ERRNO = 101; return; } if ($ip_version == 4) { my @quads = split /\./, $ip; my $no_quads = ($len / 8); my @reverse_quads = reverse @quads; while (@reverse_quads and $reverse_quads[0] == 0) { shift(@reverse_quads); } return join '.', @reverse_quads, 'in-addr', 'arpa.'; } elsif ($ip_version == 6) { my @rev_groups = reverse split /:/, ip_expand_address($ip, 6); my @result; foreach (@rev_groups) { my @revhex = reverse split //; push @result, @revhex; } # This takes the zone above if it's not exactly on a nibble my $first_nibble_index = $len ? 32 - (int($len / 4)) : 0; return join '.', @result[ $first_nibble_index .. $#result ], 'ip6', 'arpa.'; } } #------------------------------------------------------------------------------ # Subroutine ip_normalize # Purpose : Normalize data to a range of IP addresses # Params : IP or prefix or range # Returns : ip1, ip2 (if range) or undef (error) sub ip_normalize { my ($data) = shift; my $ipversion; my ($len, $ip, $ip2, $real_len, $first, $last, $curr_bin, $addcst, $clen); # Prefix if ($data =~ m!^(\S+?)(/\S+)$!) { ($ip, $len) = ($1, $2); return unless ($ipversion = ip_get_version($ip)); return unless ($ip = ip_expand_address($ip, $ipversion)); return unless ($curr_bin = ip_iptobin($ip, $ipversion)); my $one = '0' x (ip_iplengths($ipversion) - 1) . '1'; while ($len) { last unless ($len =~ s!^/(\d+)(\,|$)!!); $clen = $1; $addcst = length($2) > 0; return unless (ip_check_prefix($curr_bin, $clen, $ipversion)); return unless ($curr_bin = ip_last_address_bin($curr_bin, $clen, $ipversion)); if ($addcst) { return unless ($curr_bin = ip_binadd($curr_bin, $one)); } } return ($ip, ip_bintoip($curr_bin, $ipversion)); } # Range elsif ($data =~ /^(.+?)\s*\-\s*(.+)$/) { ($ip, $ip2) = ($1, $2); return unless ($ipversion = ip_get_version($ip)); return unless ($ip = ip_expand_address($ip, $ipversion)); return unless ($ip2 = ip_expand_address($ip2, $ipversion)); return ($ip, $ip2); } # IP + Number elsif ($data =~ /^(.+?)\s+\+\s+(.+)$/) { ($ip, $len) = ($1, $2); return unless ($ipversion = ip_get_version($ip)); return unless ($ip = ip_expand_address($ip, $ipversion)); my ($bin_ip); return unless ($bin_ip = ip_iptobin($ip, $ipversion)); return unless ($len = ip_inttobin($len, $ipversion)); return unless ($ip2 = ip_binadd($bin_ip, $len)); return unless ($ip2 = ip_bintoip($ip2, $ipversion)); return ($ip, $ip2); } # Single IP else { $ip = $data; return unless ($ipversion = ip_get_version($ip)); return unless ($ip = ip_expand_address($ip, $ipversion)); return $ip; } } #------------------------------------------------------------------------------ # Subroutine normal_range # Purpose : Return the normalized format of a range # Params : IP or prefix or range # Returns : "ip1 - ip2" or undef (error) sub ip_normal_range { my ($data) = shift; my ($ip1, $ip2) = ip_normalize($data); return unless ($ip1); $ip2 ||= $ip1; return ("$ip1 - $ip2"); } #------------------------------------------------------------------------------ # Subroutine ip_auth # Purpose : Get Authority information from IP::Authority Module # Comments : Requires IP::Authority # Params : IP, length of prefix # Returns : Reverse name or undef (error) sub ip_auth { my ($ip, $ip_version) = (@_); unless ($ip_version) { $ERROR = "Cannot determine IP version for $ip"; $ERRNO = 101; die; return; } if ($ip_version != 4) { $ERROR = "Cannot get auth information: Not an IPv4 address"; $ERRNO = 308; die; return; } require IP::Authority; my $reg = new IP::Authority; return ($reg->inet_atoauth($ip)); } 1; __END__ =encoding utf8 =head1 NAME Net::IP - Perl extension for manipulating IPv4/IPv6 addresses =head1 SYNOPSIS use Net::IP; my $ip = new Net::IP ('193.0.1/24') or die (Net::IP::Error()); print ("IP : ".$ip->ip()."\n"); print ("Sho : ".$ip->short()."\n"); print ("Bin : ".$ip->binip()."\n"); print ("Int : ".$ip->intip()."\n"); print ("Mask: ".$ip->mask()."\n"); print ("Last: ".$ip->last_ip()."\n"); print ("Len : ".$ip->prefixlen()."\n"); print ("Size: ".$ip->size()."\n"); print ("Type: ".$ip->iptype()."\n"); print ("Rev: ".$ip->reverse_ip()."\n"); =head1 DESCRIPTION This module provides functions to deal with B<IPv4/IPv6> addresses. The module can be used as a class, allowing the user to instantiate IP objects, which can be single IP addresses, prefixes, or ranges of addresses. There is also a procedural way of accessing most of the functions. Most subroutines can take either B<IPv4> or B<IPv6> addresses transparently. =head1 OBJECT-ORIENTED INTERFACE =head2 Object Creation A Net::IP object can be created from a single IP address: $ip = new Net::IP ('193.0.1.46') || die ... Or from a Classless Prefix (a /24 prefix is equivalent to a C class): $ip = new Net::IP ('195.114.80/24') || die ... Or from a range of addresses: $ip = new Net::IP ('20.34.101.207 - 201.3.9.99') || die ... Or from a address plus a number: $ip = new Net::IP ('20.34.10.0 + 255') || die ... The new() function accepts IPv4 and IPv6 addresses: $ip = new Net::IP ('dead:beef::/32') || die ... Optionnaly, the function can be passed the version of the IP. Otherwise, it tries to guess what the version is (see B<_is_ipv4()> and B<_is_ipv6()>). $ip = new Net::IP ('195/8',4); # Class A =head1 OBJECT METHODS Most of these methods are front-ends for the real functions, which use a procedural interface. Most functions return undef on failure, and a true value on success. A detailed description of the procedural interface is provided below. =head2 set Set an IP address in an existing IP object. This method has the same functionality as the new() method, except that it reuses an existing object to store the new IP. C<$ip-E<gt>set('130.23.1/24',4);> Like new(), set() takes two arguments - a string used to build an IP address, prefix, or range, and optionally, the IP version of the considered address. It returns an IP object on success, and undef on failure. =head2 error Return the current object error string. The error string is set whenever one of the methods produces an error. Also, a global, class-wide B<Error()> function is avaliable. C<warn ($ip-E<gt>error());> =head2 errno Return the current object error number. The error number is set whenever one of the methods produces an error. Also, a global B<$ERRNO> variable is set when an error is produced. C<warn ($ip-E<gt>errno());> =head2 ip Return the IP address (or first IP of the prefix or range) in quad format, as a string. C<print ($ip-E<gt>ip());> =head2 binip Return the IP address as a binary string of 0s and 1s. C<print ($ip-E<gt>binip());> =head2 prefixlen Return the length in bits of the current prefix. C<print ($ip-E<gt>prefixlen());> =head2 version Return the version of the current IP object (4 or 6). C<print ($ip-E<gt>version());> =head2 size Return the number of IP addresses in the current prefix or range. Use of this function requires Math::BigInt. C<print ($ip-E<gt>size());> =head2 binmask Return the binary mask of the current prefix, if applicable. C<print ($ip-E<gt>binmask());> =head2 mask Return the mask in quad format of the current prefix. C<print ($ip-E<gt>mask());> =head2 prefix Return the full prefix (ip+prefix length) in quad (standard) format. C<print ($ip-E<gt>prefix());> =head2 print Print the IP object (IP/Prefix or First - Last) C<print ($ip-E<gt>print());> =head2 intip Convert the IP in integer format and return it as a Math::BigInt object. C<print ($ip-E<gt>intip());> =head2 hexip Return the IP in hex format C<print ($ip-E<gt>hexip());> =head2 hexmask Return the mask in hex format C<print ($ip-E<gt>hexmask());> =head2 short Return the IP in short format: IPv4 addresses: 194.5/16 IPv6 addresses: ab32:f000:: C<print ($ip-E<gt>short());> =head2 iptype Return the IP Type - this describes the type of an IP (Public, Private, Reserved, etc.) See procedural interface ip_iptype for more details. C<print ($ip-E<gt>iptype());> =head2 reverse_ip Return the reverse IP for a given IP address (in.addr. format). C<print ($ip-E<gt>reserve_ip());> =head2 last_ip Return the last IP of a prefix/range in quad format. C<print ($ip-E<gt>last_ip());> =head2 last_bin Return the last IP of a prefix/range in binary format. C<print ($ip-E<gt>last_bin());> =head2 last_int Return the last IP of a prefix/range in integer format. C<print ($ip-E<gt>last_int());> =head2 find_prefixes This function finds all the prefixes that can be found between the two addresses of a range. The function returns a list of prefixes. C<@list = $ip-E<gt>find_prefixes($other_ip));> =head2 bincomp Binary comparaison of two IP objects. The function takes an operation and an IP object as arguments. It returns a boolean value. The operation can be one of: lt: less than (smaller than) le: smaller or equal to gt: greater than ge: greater or equal to C<if ($ip-E<gt>bincomp('lt',$ip2) {...}> =head2 binadd Binary addition of two IP objects. The value returned is an IP object. C<my $sum = $ip-E<gt>binadd($ip2);> =head2 aggregate Aggregate 2 IPs - Append one range/prefix of IPs to another. The last address of the first range must be the one immediately preceding the first address of the second range. A new IP object is returned. C<my $total = $ip-E<gt>aggregate($ip2);> =head2 overlaps Check if two IP ranges/prefixes overlap each other. The value returned by the function should be one of: $IP_PARTIAL_OVERLAP (ranges overlap) $IP_NO_OVERLAP (no overlap) $IP_A_IN_B_OVERLAP (range2 contains range1) $IP_B_IN_A_OVERLAP (range1 contains range2) $IP_IDENTICAL (ranges are identical) undef (problem) C<if ($ip-E<gt>overlaps($ip2)==$IP_A_IN_B_OVERLAP) {...};> =head2 looping The C<+> operator is overloaded in order to allow looping though a whole range of IP addresses: my $ip = new Net::IP ('195.45.6.7 - 195.45.6.19') || die; # Loop do { print $ip->ip(), "\n"; } while (++$ip); The ++ operator returns undef when the last address of the range is reached. =head2 auth Return IP authority information from the IP::Authority module C<$auth = ip->auth ();> Note: IPv4 only =head1 PROCEDURAL INTERFACE These functions do the real work in the module. Like the OO methods, most of these return undef on failure. In order to access error codes and strings, instead of using $ip-E<gt>error() and $ip-E<gt>errno(), use the global functions C<Error()> and C<Errno()>. The functions of the procedural interface are not exported by default. In order to import these functions, you need to modify the use statement for the module: C<use Net::IP qw(:PROC);> =head2 Error Returns the error string corresponding to the last error generated in the module. This is also useful for the OO interface, as if the new() function fails, we cannot call $ip-E<gt>error() and so we have to use Error(). warn Error(); =head2 Errno Returns a numeric error code corresponding to the error string returned by Error. =head2 ip_iptobin Transform an IP address into a bit string. Params : IP address, IP version Returns : binary IP string on success, undef otherwise C<$binip = ip_iptobin ($ip,6);> =head2 ip_bintoip Transform a bit string into an IP address Params : binary IP, IP version Returns : IP address on success, undef otherwise C<$ip = ip_bintoip ($binip,6);> =head2 ip_bintoint Transform a bit string into a BigInt. Params : binary IP Returns : BigInt C<$bigint = new Math::BigInt (ip_bintoint($binip));> =head2 ip_inttobin Transform a BigInt into a bit string. I<Warning>: sets warnings (C<-w>) off. This is necessary because Math::BigInt is not compliant. Params : BigInt, IP version Returns : binary IP C<$binip = ip_inttobin ($bigint);> =head2 ip_get_version Try to guess the IP version of an IP address. Params : IP address Returns : 4, 6, undef(unable to determine) C<$version = ip_get_version ($ip)> =head2 ip_is_ipv4 Check if an IP address is of type 4. Params : IP address Returns : 1 (yes) or 0 (no) C<ip_is_ipv4($ip) and print "$ip is IPv4";> =head2 ip_is_ipv6 Check if an IP address is of type 6. Params : IP address Returns : 1 (yes) or 0 (no) C<ip_is_ipv6($ip) and print "$ip is IPv6";> =head2 ip_expand_address Expand an IP address from compact notation. Params : IP address, IP version Returns : expanded IP address or undef on failure C<$ip = ip_expand_address ($ip,4);> =head2 ip_get_mask Get IP mask from prefix length. Params : Prefix length, IP version Returns : Binary Mask C<$mask = ip_get_mask ($len,6);> =head2 ip_last_address_bin Return the last binary address of a prefix. Params : First binary IP, prefix length, IP version Returns : Binary IP C<$lastbin = ip_last_address_bin ($ip,$len,6);> =head2 ip_splitprefix Split a prefix into IP and prefix length. If it was passed a simple IP, it just returns it. Params : Prefix Returns : IP, optionnaly length of prefix C<($ip,$len) = ip_splitprefix ($prefix)> =head2 ip_prefix_to_range Get a range of IPs from a prefix. Params : Prefix, IP version Returns : First IP, last IP C<($ip1,$ip2) = ip_prefix_to_range ($prefix,6);> =head2 ip_bincomp Compare binary Ips with <, >, <=, >=. Operators are lt(<), le(<=), gt(>), and ge(>=) Params : First binary IP, operator, Last binary IP Returns : 1 (yes), 0 (no), or undef (problem) C<ip_bincomp ($ip1,'lt',$ip2) == 1 or do {}> =head2 ip_binadd Add two binary IPs. Params : First binary IP, Last binary IP Returns : Binary sum or undef (problem) C<$binip = ip_binadd ($bin1,$bin2);> =head2 ip_get_prefix_length Get the prefix length for a given range of 2 IPs. Params : First binary IP, Last binary IP Returns : Length of prefix or undef (problem) C<$len = ip_get_prefix_length ($ip1,$ip2);> =head2 ip_range_to_prefix Return all prefixes between two IPs. Params : First IP (binary format), Last IP (binary format), IP version Returns : List of Prefixes or undef (problem) The prefixes returned have the form q.q.q.q/nn. C<@prefix = ip_range_to_prefix ($ip1,$ip2,6);> =head2 ip_compress_v4_prefix Compress an IPv4 Prefix. Params : IP, Prefix length Returns : Compressed Prefix C<$ip = ip_compress_v4_prefix ($ip, $len);> =head2 ip_compress_address Compress an IPv6 address. Just returns the IP if it is an IPv4. Params : IP, IP version Returns : Compressed IP or undef (problem) C<$ip = ip_compress_adress ($ip, $version);> =head2 ip_is_overlap Check if two ranges of IPs overlap. Params : Four binary IPs (begin of range 1,end1,begin2,end2), IP version $IP_PARTIAL_OVERLAP (ranges overlap) $IP_NO_OVERLAP (no overlap) $IP_A_IN_B_OVERLAP (range2 contains range1) $IP_B_IN_A_OVERLAP (range1 contains range2) $IP_IDENTICAL (ranges are identical) undef (problem) C<(ip_is_overlap($rb1,$re1,$rb2,$re2,4) eq $IP_A_IN_B_OVERLAP) and do {};> =head2 ip_get_embedded_ipv4 Get an IPv4 embedded in an IPv6 address Params : IPv6 Returns : IPv4 string or undef (not found) C<$ip4 = ip_get_embedded($ip6);> =head2 ip_check_mask Check the validity of a binary IP mask Params : Mask Returns : 1 or undef (invalid) C<ip_check_mask($binmask) or do {};> Checks if mask has only 1s followed by 0s. =head2 ip_aggregate Aggregate 2 ranges of binary IPs Params : 1st range (1st IP, Last IP), last range (1st IP, last IP), IP version Returns : prefix or undef (invalid) C<$prefix = ip_aggregate ($bip1,$eip1,$bip2,$eip2) || die ...> =head2 ip_iptypev4 Return the type of an IPv4 address. Params: binary IP Returns: type as of the following table or undef (invalid ip) See RFC 5735 and RFC 6598 S<Address Block Present Use Reference> S<-------------------------------------------------------------------> S<0.0.0.0/8 "This" Network RFC 1122 PRIVATE> S<10.0.0.0/8 Private-Use Networks RFC 1918 PRIVATE> S<100.64.0.0/10 CGN Shared Address Space RFC 6598 SHARED> S<127.0.0.0/8 Loopback RFC 1122 LOOPBACK> S<169.254.0.0/16 Link Local RFC 3927 LINK-LOCAL> S<172.16.0.0/12 Private-Use Networks RFC 1918 PRIVATE> S<192.0.0.0/24 IETF Protocol Assignments RFC 5736 RESERVED> S<192.0.2.0/24 TEST-NET-1 RFC 5737 TEST-NET> S<192.88.99.0/24 6to4 Relay Anycast RFC 3068 6TO4-RELAY> S<192.168.0.0/16 Private-Use Networks RFC 1918 PRIVATE> S<198.18.0.0/15 Network Interconnect> S< Device Benchmark Testing RFC 2544 RESERVED> S<198.51.100.0/24 TEST-NET-2 RFC 5737 TEST-NET> S<203.0.113.0/24 TEST-NET-3 RFC 5737 TEST-NET> S<224.0.0.0/4 Multicast RFC 3171 MULTICAST> S<240.0.0.0/4 Reserved for Future Use RFC 1112 RESERVED> S<255.255.255.255/32 Limited Broadcast RFC 919 BROADCAST> S< RFC 922> =head2 ip_iptypev6 Return the type of an IPv6 address. Params: binary ip Returns: type as of the following table or undef (invalid) See L<IANA Internet Protocol Version 6 Address Space|http://www.iana.org/assignments/ipv6-address-space/ipv6-address-space.txt> and L<IANA IPv6 Special Purpose Address Registry|http://www.iana.org/assignments/iana-ipv6-special-registry/iana-ipv6-special-registry.txt> S<Prefix Allocation Reference> S<-------------------------------------------------------------> S<0000::/8 Reserved by IETF [RFC4291] RESERVED> S<0100::/8 Reserved by IETF [RFC4291] RESERVED> S<0200::/7 Reserved by IETF [RFC4048] RESERVED> S<0400::/6 Reserved by IETF [RFC4291] RESERVED> S<0800::/5 Reserved by IETF [RFC4291] RESERVED> S<1000::/4 Reserved by IETF [RFC4291] RESERVED> S<2000::/3 Global Unicast [RFC4291] GLOBAL-UNICAST> S<4000::/3 Reserved by IETF [RFC4291] RESERVED> S<6000::/3 Reserved by IETF [RFC4291] RESERVED> S<8000::/3 Reserved by IETF [RFC4291] RESERVED> S<A000::/3 Reserved by IETF [RFC4291] RESERVED> S<C000::/3 Reserved by IETF [RFC4291] RESERVED> S<E000::/4 Reserved by IETF [RFC4291] RESERVED> S<F000::/5 Reserved by IETF [RFC4291] RESERVED> S<F800::/6 Reserved by IETF [RFC4291] RESERVED> S<FC00::/7 Unique Local Unicast [RFC4193] UNIQUE-LOCAL-UNICAST> S<FE00::/9 Reserved by IETF [RFC4291] RESERVED> S<FE80::/10 Link Local Unicast [RFC4291] LINK-LOCAL-UNICAST> S<FEC0::/10 Reserved by IETF [RFC3879] RESERVED> S<FF00::/8 Multicast [RFC4291] MULTICAST> S<Prefix Assignment Reference> S<---------------------------------------------------------------------> S<::1/128 Loopback Address [RFC4291] UNSPECIFIED> S<::/128 Unspecified Address [RFC4291] LOOPBACK> S<::FFFF:0:0/96 IPv4-mapped Address [RFC4291] IPV4MAP> S<0100::/64 Discard-Only Prefix [RFC6666] DISCARD> S<2001:0000::/32 TEREDO [RFC4380] TEREDO> S<2001:0002::/48 BMWG [RFC5180] BMWG> S<2001:db8::/32 Documentation Prefix [RFC3849] DOCUMENTATION> S<2001:10::/28 ORCHID [RFC4843] ORCHID> S<2002::/16 6to4 [RFC3056] 6TO4> S<FC00::/7 Unique-Local [RFC4193] UNIQUE-LOCAL-UNICAST> S<FE80::/10 Linked-Scoped Unicast [RFC4291] LINK-LOCAL-UNICAST> S<FF00::/8 Multicast [RFC4291] MULTICAST> =head2 ip_iptype Return the type of an IP (Public, Private, Reserved) Params : Binary IP to test, IP version (defaults to 6) Returns : type (see ip_iptypev4 and ip_iptypev6 for details) or undef (invalid) C<$type = ip_iptype ($ip);> =head2 ip_check_prefix Check the validity of a prefix Params : binary IP, length of prefix, IP version Returns : 1 or undef (invalid) Checks if the variant part of a prefix only has 0s, and the length is correct. C<ip_check_prefix ($ip,$len,$ipv) or do {};> =head2 ip_reverse Get a reverse name from a prefix Params : IP, length of prefix, IP version Returns : Reverse name or undef (error) C<$reverse = ip_reverse ($ip);> =head2 ip_normalize Normalize data to a range/prefix of IP addresses Params : Data String (Single IP, Range, Prefix) Returns : ip1, ip2 (if range/prefix) or undef (error) C<($ip1,$ip2) = ip_normalize ($data);> =head2 ip_auth Return IP authority information from the IP::Authority module Params : IP, version Returns : Auth info (RI for RIPE, AR for ARIN, etc) C<$auth = ip_auth ($ip,4);> Note: IPv4 only =head1 BUGS The Math::BigInt library is needed for functions that use integers. These are ip_inttobin, ip_bintoint, and the size method. In a next version, Math::BigInt will become optionnal. =head1 AUTHORS Manuel Valente <manuel.valente@gmail.com>. Original IPv4 code by Monica Cortes Sack <mcortes@ripe.net>. Original IPv6 code by Lee Wilmot <lee@ripe.net>. =head1 BASED ON ipv4pack.pm, iplib.pm, iplibncc.pm. =head1 SEE ALSO perl(1), IP::Authority =cut �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������darwin-perl-lib/Net/HTTP/Methods.pm�����������������������������������������������������������������000444 �000765 �000024 �00000041705 13167163507 021237� 0����������������������������������������������������������������������������������������������������ustar�00ocsinventory��������������������staff���������������������������000000 �000000 ������������������������������������������������������������������������������������������������������������������������������������������������������������������������package Net::HTTP::Methods; $Net::HTTP::Methods::VERSION = '6.17'; use strict; use warnings; use URI; my $CRLF = "\015\012"; # "\r\n" is not portable *_bytes = defined(&utf8::downgrade) ? sub { unless (utf8::downgrade($_[0], 1)) { require Carp; Carp::croak("Wide character in HTTP request (bytes required)"); } return $_[0]; } : sub { return $_[0]; }; sub new { my $class = shift; unshift(@_, "Host") if @_ == 1; my %cnf = @_; require Symbol; my $self = bless Symbol::gensym(), $class; return $self->http_configure(\%cnf); } sub http_configure { my($self, $cnf) = @_; die "Listen option not allowed" if $cnf->{Listen}; my $explicit_host = (exists $cnf->{Host}); my $host = delete $cnf->{Host}; my $peer = $cnf->{PeerAddr} || $cnf->{PeerHost}; if (!$peer) { die "No Host option provided" unless $host; $cnf->{PeerAddr} = $peer = $host; } # CONNECTIONS # PREFER: port number from PeerAddr, then PeerPort, then http_default_port my $peer_uri = URI->new("http://$peer"); $cnf->{"PeerPort"} = $peer_uri->_port || $cnf->{PeerPort} || $self->http_default_port; $cnf->{"PeerAddr"} = $peer_uri->host; # HOST header: # If specified but blank, ignore. # If specified with a value, add the port number # If not specified, set to PeerAddr and port number # ALWAYS: If IPv6 address, use [brackets] (thanks to the URI package) # ALWAYS: omit port number if http_default_port if (($host) || (! $explicit_host)) { my $uri = ($explicit_host) ? URI->new("http://$host") : $peer_uri->clone; if (!$uri->_port) { # Always use *our* $self->http_default_port instead of URI's (Covers HTTP, HTTPS) $uri->port( $cnf->{PeerPort} || $self->http_default_port); } my $host_port = $uri->host_port; # Returns host:port or [ipv6]:port my $remove = ":" . $self->http_default_port; # we want to remove the default port number if (substr($host_port,0-length($remove)) eq $remove) { substr($host_port,0-length($remove)) = ""; } $host = $host_port; } $cnf->{Proto} = 'tcp'; my $keep_alive = delete $cnf->{KeepAlive}; my $http_version = delete $cnf->{HTTPVersion}; $http_version = "1.1" unless defined $http_version; my $peer_http_version = delete $cnf->{PeerHTTPVersion}; $peer_http_version = "1.0" unless defined $peer_http_version; my $send_te = delete $cnf->{SendTE}; my $max_line_length = delete $cnf->{MaxLineLength}; $max_line_length = 8*1024 unless defined $max_line_length; my $max_header_lines = delete $cnf->{MaxHeaderLines}; $max_header_lines = 128 unless defined $max_header_lines; return undef unless $self->http_connect($cnf); $self->host($host); $self->keep_alive($keep_alive); $self->send_te($send_te); $self->http_version($http_version); $self->peer_http_version($peer_http_version); $self->max_line_length($max_line_length); $self->max_header_lines($max_header_lines); ${*$self}{'http_buf'} = ""; return $self; } sub http_default_port { 80; } # set up property accessors for my $method (qw(host keep_alive send_te max_line_length max_header_lines peer_http_version)) { my $prop_name = "http_" . $method; no strict 'refs'; *$method = sub { my $self = shift; my $old = ${*$self}{$prop_name}; ${*$self}{$prop_name} = shift if @_; return $old; }; } # we want this one to be a bit smarter sub http_version { my $self = shift; my $old = ${*$self}{'http_version'}; if (@_) { my $v = shift; $v = "1.0" if $v eq "1"; # float unless ($v eq "1.0" or $v eq "1.1") { require Carp; Carp::croak("Unsupported HTTP version '$v'"); } ${*$self}{'http_version'} = $v; } $old; } sub format_request { my $self = shift; my $method = shift; my $uri = shift; my $content = (@_ % 2) ? pop : ""; for ($method, $uri) { require Carp; Carp::croak("Bad method or uri") if /\s/ || !length; } push(@{${*$self}{'http_request_method'}}, $method); my $ver = ${*$self}{'http_version'}; my $peer_ver = ${*$self}{'http_peer_http_version'} || "1.0"; my @h; my @connection; my %given = (host => 0, "content-length" => 0, "te" => 0); while (@_) { my($k, $v) = splice(@_, 0, 2); my $lc_k = lc($k); if ($lc_k eq "connection") { $v =~ s/^\s+//; $v =~ s/\s+$//; push(@connection, split(/\s*,\s*/, $v)); next; } if (exists $given{$lc_k}) { $given{$lc_k}++; } push(@h, "$k: $v"); } if (length($content) && !$given{'content-length'}) { push(@h, "Content-Length: " . length($content)); } my @h2; if ($given{te}) { push(@connection, "TE") unless grep lc($_) eq "te", @connection; } elsif ($self->send_te && gunzip_ok()) { # gzip is less wanted since the IO::Uncompress::Gunzip interface for # it does not really allow chunked decoding to take place easily. push(@h2, "TE: deflate,gzip;q=0.3"); push(@connection, "TE"); } unless (grep lc($_) eq "close", @connection) { if ($self->keep_alive) { if ($peer_ver eq "1.0") { # from looking at Netscape's headers push(@h2, "Keep-Alive: 300"); unshift(@connection, "Keep-Alive"); } } else { push(@connection, "close") if $ver ge "1.1"; } } push(@h2, "Connection: " . join(", ", @connection)) if @connection; unless ($given{host}) { my $h = ${*$self}{'http_host'}; push(@h2, "Host: $h") if $h; } return _bytes(join($CRLF, "$method $uri HTTP/$ver", @h2, @h, "", $content)); } sub write_request { my $self = shift; $self->print($self->format_request(@_)); } sub format_chunk { my $self = shift; return $_[0] unless defined($_[0]) && length($_[0]); return _bytes(sprintf("%x", length($_[0])) . $CRLF . $_[0] . $CRLF); } sub write_chunk { my $self = shift; return 1 unless defined($_[0]) && length($_[0]); $self->print(_bytes(sprintf("%x", length($_[0])) . $CRLF . $_[0] . $CRLF)); } sub format_chunk_eof { my $self = shift; my @h; while (@_) { push(@h, sprintf "%s: %s$CRLF", splice(@_, 0, 2)); } return _bytes(join("", "0$CRLF", @h, $CRLF)); } sub write_chunk_eof { my $self = shift; $self->print($self->format_chunk_eof(@_)); } sub my_read { die if @_ > 3; my $self = shift; my $len = $_[1]; for (${*$self}{'http_buf'}) { if (length) { $_[0] = substr($_, 0, $len, ""); return length($_[0]); } else { die "read timeout" unless $self->can_read; return $self->sysread($_[0], $len); } } } sub my_readline { my $self = shift; my $what = shift; for (${*$self}{'http_buf'}) { my $max_line_length = ${*$self}{'http_max_line_length'}; my $pos; while (1) { # find line ending $pos = index($_, "\012"); last if $pos >= 0; die "$what line too long (limit is $max_line_length)" if $max_line_length && length($_) > $max_line_length; # need to read more data to find a line ending my $new_bytes = 0; READ: { # wait until bytes start arriving $self->can_read or die "read timeout"; # consume all incoming bytes my $bytes_read = $self->sysread($_, 1024, length); if(defined $bytes_read) { $new_bytes += $bytes_read; } elsif($!{EINTR} || $!{EAGAIN} || $!{EWOULDBLOCK}) { redo READ; } else { # if we have already accumulated some data let's at # least return that as a line length or die "$what read failed: $!"; } # no line-ending, no new bytes return length($_) ? substr($_, 0, length($_), "") : undef if $new_bytes==0; } } die "$what line too long ($pos; limit is $max_line_length)" if $max_line_length && $pos > $max_line_length; my $line = substr($_, 0, $pos+1, ""); $line =~ s/(\015?\012)\z// || die "Assert"; return wantarray ? ($line, $1) : $line; } } sub can_read { my $self = shift; return 1 unless defined(fileno($self)); return 1 if $self->isa('IO::Socket::SSL') && $self->pending; return 1 if $self->isa('Net::SSL') && $self->can('pending') && $self->pending; # With no timeout, wait forever. An explicit timeout of 0 can be # used to just check if the socket is readable without waiting. my $timeout = @_ ? shift : (${*$self}{io_socket_timeout} || undef); my $fbits = ''; vec($fbits, fileno($self), 1) = 1; SELECT: { my $before; $before = time if $timeout; my $nfound = select($fbits, undef, undef, $timeout); if ($nfound < 0) { if ($!{EINTR} || $!{EAGAIN} || $!{EWOULDBLOCK}) { # don't really think EAGAIN/EWOULDBLOCK can happen here if ($timeout) { $timeout -= time - $before; $timeout = 0 if $timeout < 0; } redo SELECT; } die "select failed: $!"; } return $nfound > 0; } } sub _rbuf { my $self = shift; if (@_) { for (${*$self}{'http_buf'}) { my $old; $old = $_ if defined wantarray; $_ = shift; return $old; } } else { return ${*$self}{'http_buf'}; } } sub _rbuf_length { my $self = shift; return length ${*$self}{'http_buf'}; } sub _read_header_lines { my $self = shift; my $junk_out = shift; my @headers; my $line_count = 0; my $max_header_lines = ${*$self}{'http_max_header_lines'}; while (my $line = my_readline($self, 'Header')) { if ($line =~ /^(\S+?)\s*:\s*(.*)/s) { push(@headers, $1, $2); } elsif (@headers && $line =~ s/^\s+//) { $headers[-1] .= " " . $line; } elsif ($junk_out) { push(@$junk_out, $line); } else { die "Bad header: '$line'\n"; } if ($max_header_lines) { $line_count++; if ($line_count >= $max_header_lines) { die "Too many header lines (limit is $max_header_lines)"; } } } return @headers; } sub read_response_headers { my($self, %opt) = @_; my $laxed = $opt{laxed}; my($status, $eol) = my_readline($self, 'Status'); unless (defined $status) { die "Server closed connection without sending any data back"; } my($peer_ver, $code, $message) = split(/\s+/, $status, 3); if (!$peer_ver || $peer_ver !~ s,^HTTP/,, || $code !~ /^[1-5]\d\d$/) { die "Bad response status line: '$status'" unless $laxed; # assume HTTP/0.9 ${*$self}{'http_peer_http_version'} = "0.9"; ${*$self}{'http_status'} = "200"; substr(${*$self}{'http_buf'}, 0, 0) = $status . ($eol || ""); return 200 unless wantarray; return (200, "Assumed OK"); }; ${*$self}{'http_peer_http_version'} = $peer_ver; ${*$self}{'http_status'} = $code; my $junk_out; if ($laxed) { $junk_out = $opt{junk_out} || []; } my @headers = $self->_read_header_lines($junk_out); # pick out headers that read_entity_body might need my @te; my $content_length; for (my $i = 0; $i < @headers; $i += 2) { my $h = lc($headers[$i]); if ($h eq 'transfer-encoding') { my $te = $headers[$i+1]; $te =~ s/^\s+//; $te =~ s/\s+$//; push(@te, $te) if length($te); } elsif ($h eq 'content-length') { # ignore bogus and overflow values if ($headers[$i+1] =~ /^\s*(\d{1,15})(?:\s|$)/) { $content_length = $1; } } } ${*$self}{'http_te'} = join(",", @te); ${*$self}{'http_content_length'} = $content_length; ${*$self}{'http_first_body'}++; delete ${*$self}{'http_trailers'}; return $code unless wantarray; return ($code, $message, @headers); } sub read_entity_body { my $self = shift; my $buf_ref = \$_[0]; my $size = $_[1]; die "Offset not supported yet" if $_[2]; my $chunked; my $bytes; if (${*$self}{'http_first_body'}) { ${*$self}{'http_first_body'} = 0; delete ${*$self}{'http_chunked'}; delete ${*$self}{'http_bytes'}; my $method = shift(@{${*$self}{'http_request_method'}}); my $status = ${*$self}{'http_status'}; if ($method eq "HEAD") { # this response is always empty regardless of other headers $bytes = 0; } elsif (my $te = ${*$self}{'http_te'}) { my @te = split(/\s*,\s*/, lc($te)); die "Chunked must be last Transfer-Encoding '$te'" unless pop(@te) eq "chunked"; pop(@te) while @te && $te[-1] eq "chunked"; # ignore repeated chunked spec for (@te) { if ($_ eq "deflate" && inflate_ok()) { #require Compress::Raw::Zlib; my ($i, $status) = Compress::Raw::Zlib::Inflate->new(); die "Can't make inflator: $status" unless $i; $_ = sub { my $out; $i->inflate($_[0], \$out); $out } } elsif ($_ eq "gzip" && gunzip_ok()) { #require IO::Uncompress::Gunzip; my @buf; $_ = sub { push(@buf, $_[0]); return "" unless $_[1]; my $input = join("", @buf); my $output; IO::Uncompress::Gunzip::gunzip(\$input, \$output, Transparent => 0) or die "Can't gunzip content: $IO::Uncompress::Gunzip::GunzipError"; return \$output; }; } elsif ($_ eq "identity") { $_ = sub { $_[0] }; } else { die "Can't handle transfer encoding '$te'"; } } @te = reverse(@te); ${*$self}{'http_te2'} = @te ? \@te : ""; $chunked = -1; } elsif (defined(my $content_length = ${*$self}{'http_content_length'})) { $bytes = $content_length; } elsif ($status =~ /^(?:1|[23]04)/) { # RFC 2616 says that these responses should always be empty # but that does not appear to be true in practice [RT#17907] $bytes = 0; } else { # XXX Multi-Part types are self delimiting, but RFC 2616 says we # only has to deal with 'multipart/byteranges' # Read until EOF } } else { $chunked = ${*$self}{'http_chunked'}; $bytes = ${*$self}{'http_bytes'}; } if (defined $chunked) { # The state encoded in $chunked is: # $chunked == 0: read CRLF after chunk, then chunk header # $chunked == -1: read chunk header # $chunked > 0: bytes left in current chunk to read if ($chunked <= 0) { my $line = my_readline($self, 'Entity body'); if ($chunked == 0) { die "Missing newline after chunk data: '$line'" if !defined($line) || $line ne ""; $line = my_readline($self, 'Entity body'); } die "EOF when chunk header expected" unless defined($line); my $chunk_len = $line; $chunk_len =~ s/;.*//; # ignore potential chunk parameters unless ($chunk_len =~ /^([\da-fA-F]+)\s*$/) { die "Bad chunk-size in HTTP response: $line"; } $chunked = hex($1); ${*$self}{'http_chunked'} = $chunked; if ($chunked == 0) { ${*$self}{'http_trailers'} = [$self->_read_header_lines]; $$buf_ref = ""; my $n = 0; if (my $transforms = delete ${*$self}{'http_te2'}) { for (@$transforms) { $$buf_ref = &$_($$buf_ref, 1); } $n = length($$buf_ref); } # in case somebody tries to read more, make sure we continue # to return EOF delete ${*$self}{'http_chunked'}; ${*$self}{'http_bytes'} = 0; return $n; } } my $n = $chunked; $n = $size if $size && $size < $n; $n = my_read($self, $$buf_ref, $n); return undef unless defined $n; ${*$self}{'http_chunked'} = $chunked - $n; if ($n > 0) { if (my $transforms = ${*$self}{'http_te2'}) { for (@$transforms) { $$buf_ref = &$_($$buf_ref, 0); } $n = length($$buf_ref); $n = -1 if $n == 0; } } return $n; } elsif (defined $bytes) { unless ($bytes) { $$buf_ref = ""; return 0; } my $n = $bytes; $n = $size if $size && $size < $n; $n = my_read($self, $$buf_ref, $n); ${*$self}{'http_bytes'} = defined $n ? $bytes - $n : $bytes; return $n; } else { # read until eof $size ||= 8*1024; return my_read($self, $$buf_ref, $size); } } sub get_trailers { my $self = shift; @{${*$self}{'http_trailers'} || []}; } BEGIN { my $gunzip_ok; my $inflate_ok; sub gunzip_ok { return $gunzip_ok if defined $gunzip_ok; # Try to load IO::Uncompress::Gunzip. local $@; local $SIG{__DIE__}; $gunzip_ok = 0; eval { require IO::Uncompress::Gunzip; $gunzip_ok++; }; return $gunzip_ok; } sub inflate_ok { return $inflate_ok if defined $inflate_ok; # Try to load Compress::Raw::Zlib. local $@; local $SIG{__DIE__}; $inflate_ok = 0; eval { require Compress::Raw::Zlib; $inflate_ok++; }; return $inflate_ok; } } # BEGIN 1; =pod =encoding UTF-8 =head1 NAME Net::HTTP::Methods - Methods shared by Net::HTTP and Net::HTTPS =head1 VERSION version 6.17 =head1 AUTHOR Gisle Aas <gisle@activestate.com> =head1 COPYRIGHT AND LICENSE This software is copyright (c) 2001-2017 by Gisle Aas. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. =cut __END__ # ABSTRACT: Methods shared by Net::HTTP and Net::HTTPS �����������������������������������������������������������darwin-perl-lib/Net/HTTP/NB.pm����������������������������������������������������������������������000444 �000765 �000024 �00000004744 13167163507 020135� 0����������������������������������������������������������������������������������������������������ustar�00ocsinventory��������������������staff���������������������������000000 �000000 ������������������������������������������������������������������������������������������������������������������������������������������������������������������������package Net::HTTP::NB; $Net::HTTP::NB::VERSION = '6.17'; use strict; use warnings; use base 'Net::HTTP'; sub can_read { return 1; } sub sysread { my $self = $_[0]; if (${*$self}{'httpnb_read_count'}++) { ${*$self}{'http_buf'} = ${*$self}{'httpnb_save'}; die "Multi-read\n"; } my $buf; my $offset = $_[3] || 0; my $n = sysread($self, $_[1], $_[2], $offset); ${*$self}{'httpnb_save'} .= substr($_[1], $offset); return $n; } sub read_response_headers { my $self = shift; ${*$self}{'httpnb_read_count'} = 0; ${*$self}{'httpnb_save'} = ${*$self}{'http_buf'}; my @h = eval { $self->SUPER::read_response_headers(@_) }; if ($@) { return if $@ eq "Multi-read\n"; die; } return @h; } sub read_entity_body { my $self = shift; ${*$self}{'httpnb_read_count'} = 0; ${*$self}{'httpnb_save'} = ${*$self}{'http_buf'}; # XXX I'm not so sure this does the correct thing in case of # transfer-encoding transforms my $n = eval { $self->SUPER::read_entity_body(@_); }; if ($@) { $_[0] = ""; return -1; } return $n; } 1; =pod =encoding UTF-8 =head1 NAME Net::HTTP::NB - Non-blocking HTTP client =head1 VERSION version 6.17 =head1 SYNOPSIS use Net::HTTP::NB; my $s = Net::HTTP::NB->new(Host => "www.perl.com") || die $@; $s->write_request(GET => "/"); use IO::Select; my $sel = IO::Select->new($s); READ_HEADER: { die "Header timeout" unless $sel->can_read(10); my($code, $mess, %h) = $s->read_response_headers; redo READ_HEADER unless $code; } while (1) { die "Body timeout" unless $sel->can_read(10); my $buf; my $n = $s->read_entity_body($buf, 1024); last unless $n; print $buf; } =head1 DESCRIPTION Same interface as C<Net::HTTP> but it will never try multiple reads when the read_response_headers() or read_entity_body() methods are invoked. This make it possible to multiplex multiple Net::HTTP::NB using select without risk blocking. If read_response_headers() did not see enough data to complete the headers an empty list is returned. If read_entity_body() did not see new entity data in its read the value -1 is returned. =head1 SEE ALSO L<Net::HTTP> =head1 AUTHOR Gisle Aas <gisle@activestate.com> =head1 COPYRIGHT AND LICENSE This software is copyright (c) 2001-2017 by Gisle Aas. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. =cut __END__ #ABSTRACT: Non-blocking HTTP client ����������������������������darwin-perl-lib/Mozilla/CA/�������������������������������������������������������������������������000755 �000765 �000024 �00000000000 13167163507 017656� 5����������������������������������������������������������������������������������������������������ustar�00ocsinventory��������������������staff���������������������������000000 �000000 ������������������������������������������������������������������������������������������������������������������������������������������������������������������������darwin-perl-lib/Mozilla/CA.pm�����������������������������������������������������������������������000444 �000765 �000024 �00000002764 13167163507 020223� 0����������������������������������������������������������������������������������������������������ustar�00ocsinventory��������������������staff���������������������������000000 �000000 ������������������������������������������������������������������������������������������������������������������������������������������������������������������������package Mozilla::CA; use strict; our $VERSION = '20160104'; use Cwd (); use File::Spec (); use File::Basename qw(dirname); sub SSL_ca_file { my $file = File::Spec->catfile(dirname(__FILE__), "CA", "cacert.pem"); if (!File::Spec->file_name_is_absolute($file)) { $file = File::Spec->catfile(Cwd::cwd(), $file); } return $file; } 1; __END__ =head1 NAME Mozilla::CA - Mozilla's CA cert bundle in PEM format =head1 SYNOPSIS use IO::Socket::SSL; use Mozilla::CA; my $host = "www.paypal.com"; my $client = IO::Socket::SSL->new( PeerHost => "$host:443", SSL_verify_mode => 0x02, SSL_ca_file => Mozilla::CA::SSL_ca_file(), ) || die "Can't connect: $@"; $client->verify_hostname($host, "http") || die "hostname verification failure"; =head1 DESCRIPTION Mozilla::CA provides a copy of Mozilla's bundle of Certificate Authority certificates in a form that can be consumed by modules and libraries based on OpenSSL. The module provide a single function: =over =item SSL_ca_file() Returns the absolute path to the Mozilla's CA cert bundle PEM file. =back =head1 SEE ALSO L<http://curl.haxx.se/docs/caextract.html> =head1 LICENSE For the bundled Mozilla CA PEM file the following applies: =over This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/. =back The Mozilla::CA distribution itself is available under the same license. ������������darwin-perl-lib/Mozilla/mk-ca-bundle.pl�������������������������������������������������������������000555 �000765 �000024 �00000042264 13167163507 022200� 0����������������������������������������������������������������������������������������������������ustar�00ocsinventory��������������������staff���������������������������000000 �000000 ������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!/usr/bin/env perl # *************************************************************************** # * _ _ ____ _ # * Project ___| | | | _ \| | # * / __| | | | |_) | | # * | (__| |_| | _ <| |___ # * \___|\___/|_| \_\_____| # * # * Copyright (C) 1998 - 2014, Daniel Stenberg, <daniel@haxx.se>, et al. # * # * This software is licensed as described in the file COPYING, which # * you should have received as part of this distribution. The terms # * are also available at http://curl.haxx.se/docs/copyright.html. # * # * You may opt to use, copy, modify, merge, publish, distribute and/or sell # * copies of the Software, and permit persons to whom the Software is # * furnished to do so, under the terms of the COPYING file. # * # * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY # * KIND, either express or implied. # * # *************************************************************************** # This Perl script creates a fresh ca-bundle.crt file for use with libcurl. # It downloads certdata.txt from Mozilla's source tree (see URL below), # then parses certdata.txt and extracts CA Root Certificates into PEM format. # These are then processed with the OpenSSL commandline tool to produce the # final ca-bundle.crt file. # The script is based on the parse-certs script written by Roland Krikava. # This Perl script works on almost any platform since its only external # dependency is the OpenSSL commandline tool for optional text listing. # Hacked by Guenter Knauf. # use warnings; use Getopt::Std; use MIME::Base64; use LWP::UserAgent; use strict; use vars qw($opt_b $opt_d $opt_f $opt_h $opt_i $opt_l $opt_n $opt_p $opt_q $opt_s $opt_t $opt_u $opt_v $opt_w); use List::Util; use Text::Wrap; my $MOD_SHA = "Digest::SHA"; eval "require $MOD_SHA"; if ($@) { $MOD_SHA = "Digest::SHA::PurePerl"; eval "require $MOD_SHA"; } my %urls = ( 'nss' => 'http://hg.mozilla.org/projects/nss/raw-file/tip/lib/ckfw/builtins/certdata.txt', 'central' => 'http://hg.mozilla.org/mozilla-central/raw-file/default/security/nss/lib/ckfw/builtins/certdata.txt', 'aurora' => 'http://hg.mozilla.org/releases/mozilla-aurora/raw-file/default/security/nss/lib/ckfw/builtins/certdata.txt', 'beta' => 'http://hg.mozilla.org/releases/mozilla-beta/raw-file/default/security/nss/lib/ckfw/builtins/certdata.txt', 'release' => 'http://hg.mozilla.org/releases/mozilla-release/raw-file/default/security/nss/lib/ckfw/builtins/certdata.txt', ); $opt_d = 'release'; # If the OpenSSL commandline is not in search path you can configure it here! my $openssl = 'openssl'; my $version = '1.25'; $opt_w = 76; # default base64 encoded lines length # default cert types to include in the output (default is to include CAs which may issue SSL server certs) my $default_mozilla_trust_purposes = "SERVER_AUTH"; my $default_mozilla_trust_levels = "TRUSTED_DELEGATOR"; $opt_p = $default_mozilla_trust_purposes . ":" . $default_mozilla_trust_levels; my @valid_mozilla_trust_purposes = ( "DIGITAL_SIGNATURE", "NON_REPUDIATION", "KEY_ENCIPHERMENT", "DATA_ENCIPHERMENT", "KEY_AGREEMENT", "KEY_CERT_SIGN", "CRL_SIGN", "SERVER_AUTH", "CLIENT_AUTH", "CODE_SIGNING", "EMAIL_PROTECTION", "IPSEC_END_SYSTEM", "IPSEC_TUNNEL", "IPSEC_USER", "TIME_STAMPING", "STEP_UP_APPROVED" ); my @valid_mozilla_trust_levels = ( "TRUSTED_DELEGATOR", # CAs "NOT_TRUSTED", # Don't trust these certs. "MUST_VERIFY_TRUST", # This explicitly tells us that it ISN'T a CA but is otherwise ok. In other words, this should tell the app to ignore any other sources that claim this is a CA. "TRUSTED" # This cert is trusted, but only for itself and not for delegates (i.e. it is not a CA). ); my $default_signature_algorithms = $opt_s = "MD5"; my @valid_signature_algorithms = ( "MD5", "SHA1", "SHA256", "SHA384", "SHA512" ); $0 =~ s@.*(/|\\)@@; $Getopt::Std::STANDARD_HELP_VERSION = 1; getopts('bd:fhilnp:qs:tuvw:'); if(!defined($opt_d)) { # to make plain "-d" use not cause warnings, and actually still work $opt_d = 'release'; } # Use predefined URL or else custom URL specified on command line. my $url = ( defined( $urls{$opt_d} ) ) ? $urls{$opt_d} : $opt_d; my $curl = `curl -V`; if ($opt_i) { print ("=" x 78 . "\n"); print "Script Version : $version\n"; print "Perl Version : $]\n"; print "Operating System Name : $^O\n"; print "Getopt::Std.pm Version : ${Getopt::Std::VERSION}\n"; print "MIME::Base64.pm Version : ${MIME::Base64::VERSION}\n"; print "LWP::UserAgent.pm Version : ${LWP::UserAgent::VERSION}\n"; print "LWP.pm Version : ${LWP::VERSION}\n"; print "Digest::SHA.pm Version : ${Digest::SHA::VERSION}\n" if ($Digest::SHA::VERSION); print "Digest::SHA::PurePerl.pm Version : ${Digest::SHA::PurePerl::VERSION}\n" if ($Digest::SHA::PurePerl::VERSION); print ("=" x 78 . "\n"); } sub warning_message() { if ( $opt_d =~ m/^risk$/i ) { # Long Form Warning and Exit print "Warning: Use of this script may pose some risk:\n"; print "\n"; print " 1) Using http is subject to man in the middle attack of certdata content\n"; print " 2) Default to 'release', but more recent updates may be found in other trees\n"; print " 3) certdata.txt file format may change, lag time to update this script\n"; print " 4) Generally unwise to blindly trust CAs without manual review & verification\n"; print " 5) Mozilla apps use additional security checks aren't represented in certdata\n"; print " 6) Use of this script will make a security engineer grind his teeth and\n"; print " swear at you. ;)\n"; exit; } else { # Short Form Warning print "Warning: Use of this script may pose some risk, -d risk for more details.\n"; } } sub HELP_MESSAGE() { print "Usage:\t${0} [-b] [-d<certdata>] [-f] [-i] [-l] [-n] [-p<purposes:levels>] [-q] [-s<algorithms>] [-t] [-u] [-v] [-w<l>] [<outputfile>]\n"; print "\t-b\tbackup an existing version of ca-bundle.crt\n"; print "\t-d\tspecify Mozilla tree to pull certdata.txt or custom URL\n"; print "\t\t Valid names are:\n"; print "\t\t ", join( ", ", map { ( $_ =~ m/$opt_d/ ) ? "$_ (default)" : "$_" } sort keys %urls ), "\n"; print "\t-f\tforce rebuild even if certdata.txt is current\n"; print "\t-i\tprint version info about used modules\n"; print "\t-l\tprint license info about certdata.txt\n"; print "\t-n\tno download of certdata.txt (to use existing)\n"; print wrap("\t","\t\t", "-p\tlist of Mozilla trust purposes and levels for certificates to include in output. Takes the form of a comma separated list of purposes, a colon, and a comma separated list of levels. (default: $default_mozilla_trust_purposes:$default_mozilla_trust_levels)"), "\n"; print "\t\t Valid purposes are:\n"; print wrap("\t\t ","\t\t ", join( ", ", "ALL", @valid_mozilla_trust_purposes ) ), "\n"; print "\t\t Valid levels are:\n"; print wrap("\t\t ","\t\t ", join( ", ", "ALL", @valid_mozilla_trust_levels ) ), "\n"; print "\t-q\tbe really quiet (no progress output at all)\n"; print wrap("\t","\t\t", "-s\tcomma separated list of certificate signatures/hashes to output in plain text mode. (default: $default_signature_algorithms)\n"); print "\t\t Valid signature algorithms are:\n"; print wrap("\t\t ","\t\t ", join( ", ", "ALL", @valid_signature_algorithms ) ), "\n"; print "\t-t\tinclude plain text listing of certificates\n"; print "\t-u\tunlink (remove) certdata.txt after processing\n"; print "\t-v\tbe verbose and print out processed CAs\n"; print "\t-w <l>\twrap base64 output lines after <l> chars (default: ${opt_w})\n"; exit; } sub VERSION_MESSAGE() { print "${0} version ${version} running Perl ${]} on ${^O}\n"; } warning_message() unless ($opt_q || $url =~ m/^(ht|f)tps:/i ); HELP_MESSAGE() if ($opt_h); sub report($@) { my $output = shift; print STDERR $output . "\n" unless $opt_q; } sub is_in_list($@) { my $target = shift; return defined(List::Util::first { $target eq $_ } @_); } # Parses $param_string as a case insensitive comma separated list with optional whitespace # validates that only allowed parameters are supplied sub parse_csv_param($$@) { my $description = shift; my $param_string = shift; my @valid_values = @_; my @values = map { s/^\s+//; # strip leading spaces s/\s+$//; # strip trailing spaces uc $_ # return the modified string as upper case } split( ',', $param_string ); # Find all values which are not in the list of valid values or "ALL" my @invalid = grep { !is_in_list($_,"ALL",@valid_values) } @values; if ( scalar(@invalid) > 0 ) { # Tell the user which parameters were invalid and print the standard help message which will exit print "Error: Invalid ", $description, scalar(@invalid) == 1 ? ": " : "s: ", join( ", ", map { "\"$_\"" } @invalid ), "\n"; HELP_MESSAGE(); } @values = @valid_values if ( is_in_list("ALL",@values) ); return @values; } sub sha1 { my $result; if ($Digest::SHA::VERSION || $Digest::SHA::PurePerl::VERSION) { open(FILE, $_[0]) or die "Can't open '$_[0]': $!"; binmode(FILE); $result = $MOD_SHA->new(1)->addfile(*FILE)->hexdigest; close(FILE); } else { # Use OpenSSL command if Perl Digest::SHA modules not available $result = (split(/ |\r|\n/,`$openssl dgst -sha1 $_[0]`))[1]; } return $result; } sub oldsha1 { my $sha1 = ""; open(C, "<$_[0]") || return 0; while(<C>) { chomp; if($_ =~ /^\#\# SHA1: (.*)/) { $sha1 = $1; last; } } close(C); return $sha1; } if ( $opt_p !~ m/:/ ) { print "Error: Mozilla trust identifier list must include both purposes and levels\n"; HELP_MESSAGE(); } (my $included_mozilla_trust_purposes_string, my $included_mozilla_trust_levels_string) = split( ':', $opt_p ); my @included_mozilla_trust_purposes = parse_csv_param( "trust purpose", $included_mozilla_trust_purposes_string, @valid_mozilla_trust_purposes ); my @included_mozilla_trust_levels = parse_csv_param( "trust level", $included_mozilla_trust_levels_string, @valid_mozilla_trust_levels ); my @included_signature_algorithms = parse_csv_param( "signature algorithm", $opt_s, @valid_signature_algorithms ); sub should_output_cert(%) { my %trust_purposes_by_level = @_; foreach my $level (@included_mozilla_trust_levels) { # for each level we want to output, see if any of our desired purposes are included return 1 if ( defined( List::Util::first { is_in_list( $_, @included_mozilla_trust_purposes ) } @{$trust_purposes_by_level{$level}} ) ); } return 0; } my $crt = $ARGV[0] || 'ca-bundle.crt'; (my $txt = $url) =~ s@(.*/|\?.*)@@g; my $stdout = $crt eq '-'; my $resp; my $fetched; my $oldsha1 = oldsha1($crt); report "SHA1 of old file: $oldsha1"; report "Downloading '$txt' ..."; if($curl && !$opt_n) { my $https = $url; $https =~ s/^http:/https:/; report "Get certdata over HTTPS with curl!"; my $quiet = $opt_q ? "-s" : ""; my @out = `curl -w %{response_code} $quiet -O $https`; if(@out && $out[0] == 200) { $fetched = 1; } else { report "Failed downloading HTTPS with curl, trying HTTP with LWP"; } } unless ($fetched || ($opt_n and -e $txt)) { my $ua = new LWP::UserAgent(agent => "$0/$version"); $ua->env_proxy(); $resp = $ua->mirror($url, $txt); if ($resp && $resp->code eq '304') { report "Not modified"; exit 0 if -e $crt && !$opt_f; } else { $fetched = 1; } if( !$resp || $resp->code !~ /^(?:200|304)$/ ) { report "Unable to download latest data: " . ($resp? $resp->code . ' - ' . $resp->message : "LWP failed"); exit 1 if -e $crt || ! -r $txt; } } my $filedate = $resp ? $resp->last_modified : (stat($txt))[9]; my $datesrc = "as of"; if(!$filedate) { # mxr.mozilla.org gave us a time, hg.mozilla.org does not! $filedate = time(); $datesrc="downloaded on"; } # get the hash from the download file my $newsha1= sha1($txt); if(!$opt_f && $oldsha1 eq $newsha1) { report "Downloaded file identical to previous run\'s source file. Exiting"; exit; } report "SHA1 of new file: $newsha1"; my $currentdate = scalar gmtime($filedate); my $format = $opt_t ? "plain text and " : ""; if( $stdout ) { open(CRT, '> -') or die "Couldn't open STDOUT: $!\n"; } else { open(CRT,">$crt.~") or die "Couldn't open $crt.~: $!\n"; } print CRT <<EOT; ## ## Bundle of CA Root Certificates ## ## Certificate data from Mozilla ${datesrc}: ${currentdate} ## ## This is a bundle of X.509 certificates of public Certificate Authorities ## (CA). These were automatically extracted from Mozilla's root certificates ## file (certdata.txt). This file can be found in the mozilla source tree: ## ${url} ## ## It contains the certificates in ${format}PEM format and therefore ## can be directly used with curl / libcurl / php_curl, or with ## an Apache+mod_ssl webserver for SSL client authentication. ## Just configure this file as the SSLCACertificateFile. ## ## Conversion done with mk-ca-bundle.pl version $version. ## SHA1: $newsha1 ## EOT report "Processing '$txt' ..."; my $caname; my $certnum = 0; my $skipnum = 0; my $start_of_cert = 0; open(TXT,"$txt") or die "Couldn't open $txt: $!\n"; while (<TXT>) { if (/\*\*\*\*\* BEGIN LICENSE BLOCK \*\*\*\*\*/) { print CRT; print if ($opt_l); while (<TXT>) { print CRT; print if ($opt_l); last if (/\*\*\*\*\* END LICENSE BLOCK \*\*\*\*\*/); } } next if /^#|^\s*$/; chomp; if (/^CVS_ID\s+\"(.*)\"/) { print CRT "# $1\n"; } # this is a match for the start of a certificate if (/^CKA_CLASS CK_OBJECT_CLASS CKO_CERTIFICATE/) { $start_of_cert = 1 } if ($start_of_cert && /^CKA_LABEL UTF8 \"(.*)\"/) { $caname = $1; } my %trust_purposes_by_level; if ($start_of_cert && /^CKA_VALUE MULTILINE_OCTAL/) { my $data; while (<TXT>) { last if (/^END/); chomp; my @octets = split(/\\/); shift @octets; for (@octets) { $data .= chr(oct); } } # scan forwards until the trust part while (<TXT>) { last if (/^CKA_CLASS CK_OBJECT_CLASS CKO_NSS_TRUST/); chomp; } # now scan the trust part to determine how we should trust this cert while (<TXT>) { last if (/^#/); if (/^CKA_TRUST_([A-Z_]+)\s+CK_TRUST\s+CKT_NSS_([A-Z_]+)\s*$/) { if ( !is_in_list($1,@valid_mozilla_trust_purposes) ) { report "Warning: Unrecognized trust purpose for cert: $caname. Trust purpose: $1. Trust Level: $2"; } elsif ( !is_in_list($2,@valid_mozilla_trust_levels) ) { report "Warning: Unrecognized trust level for cert: $caname. Trust purpose: $1. Trust Level: $2"; } else { push @{$trust_purposes_by_level{$2}}, $1; } } } if ( !should_output_cert(%trust_purposes_by_level) ) { $skipnum ++; } else { my $encoded = MIME::Base64::encode_base64($data, ''); $encoded =~ s/(.{1,${opt_w}})/$1\n/g; my $pem = "-----BEGIN CERTIFICATE-----\n" . $encoded . "-----END CERTIFICATE-----\n"; print CRT "\n$caname\n"; my $maxStringLength = length($caname); if ($opt_t) { foreach my $key (keys %trust_purposes_by_level) { my $string = $key . ": " . join(", ", @{$trust_purposes_by_level{$key}}); $maxStringLength = List::Util::max( length($string), $maxStringLength ); print CRT $string . "\n"; } } print CRT ("=" x $maxStringLength . "\n"); if (!$opt_t) { print CRT $pem; } else { my $pipe = ""; foreach my $hash (@included_signature_algorithms) { $pipe = "|$openssl x509 -" . $hash . " -fingerprint -noout -inform PEM"; if (!$stdout) { $pipe .= " >> $crt.~"; close(CRT) or die "Couldn't close $crt.~: $!"; } open(TMP, $pipe) or die "Couldn't open openssl pipe: $!"; print TMP $pem; close(TMP) or die "Couldn't close openssl pipe: $!"; if (!$stdout) { open(CRT, ">>$crt.~") or die "Couldn't open $crt.~: $!"; } } $pipe = "|$openssl x509 -text -inform PEM"; if (!$stdout) { $pipe .= " >> $crt.~"; close(CRT) or die "Couldn't close $crt.~: $!"; } open(TMP, $pipe) or die "Couldn't open openssl pipe: $!"; print TMP $pem; close(TMP) or die "Couldn't close openssl pipe: $!"; if (!$stdout) { open(CRT, ">>$crt.~") or die "Couldn't open $crt.~: $!"; } } report "Parsing: $caname" if ($opt_v); $certnum ++; $start_of_cert = 0; } } } close(TXT) or die "Couldn't close $txt: $!\n"; close(CRT) or die "Couldn't close $crt.~: $!\n"; unless( $stdout ) { if ($opt_b && -e $crt) { my $bk = 1; while (-e "$crt.~${bk}~") { $bk++; } rename $crt, "$crt.~${bk}~" or die "Failed to create backup $crt.~$bk}~: $!\n"; } elsif( -e $crt ) { unlink( $crt ) or die "Failed to remove $crt: $!\n"; } rename "$crt.~", $crt or die "Failed to rename $crt.~ to $crt: $!\n"; } unlink $txt if ($opt_u); report "Done ($certnum CA certs processed, $skipnum skipped)."; ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������darwin-perl-lib/Mozilla/CA/cacert.pem���������������������������������������������������������������000444 �000765 �000024 �00000764522 13167163507 021640� 0����������������������������������������������������������������������������������������������������ustar�00ocsinventory��������������������staff���������������������������000000 �000000 ������������������������������������������������������������������������������������������������������������������������������������������������������������������������## ## Bundle of CA Root Certificates ## ## Certificate data from Mozilla as of: Mon Jan 4 01:17:06 2016 ## ## This is a bundle of X.509 certificates of public Certificate Authorities ## (CA). These were automatically extracted from Mozilla's root certificates ## file (certdata.txt). This file can be found in the mozilla source tree: ## http://hg.mozilla.org/releases/mozilla-release/raw-file/default/security/nss/lib/ckfw/builtins/certdata.txt ## ## It contains the certificates in PEM format and therefore ## can be directly used with curl / libcurl / php_curl, or with ## an Apache+mod_ssl webserver for SSL client authentication. ## Just configure this file as the SSLCACertificateFile. ## ## Conversion done with mk-ca-bundle.pl version 1.25. ## SHA1: 6d7d2f0a4fae587e7431be191a081ac1257d300a ## Equifax Secure CA ================= -----BEGIN CERTIFICATE----- MIIDIDCCAomgAwIBAgIENd70zzANBgkqhkiG9w0BAQUFADBOMQswCQYDVQQGEwJVUzEQMA4GA1UE ChMHRXF1aWZheDEtMCsGA1UECxMkRXF1aWZheCBTZWN1cmUgQ2VydGlmaWNhdGUgQXV0aG9yaXR5 MB4XDTk4MDgyMjE2NDE1MVoXDTE4MDgyMjE2NDE1MVowTjELMAkGA1UEBhMCVVMxEDAOBgNVBAoT B0VxdWlmYXgxLTArBgNVBAsTJEVxdWlmYXggU2VjdXJlIENlcnRpZmljYXRlIEF1dGhvcml0eTCB nzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEAwV2xWGcIYu6gmi0fCG2RFGiYCh7+2gRvE4RiIcPR fM6fBeC4AfBONOziipUEZKzxa1NfBbPLZ4C/QgKO/t0BCezhABRP/PvwDN1Dulsr4R+AcJkVV5MW 8Q+XarfCaCMczE1ZMKxRHjuvK9buY0V7xdlfUNLjUA86iOe/FP3gx7kCAwEAAaOCAQkwggEFMHAG A1UdHwRpMGcwZaBjoGGkXzBdMQswCQYDVQQGEwJVUzEQMA4GA1UEChMHRXF1aWZheDEtMCsGA1UE CxMkRXF1aWZheCBTZWN1cmUgQ2VydGlmaWNhdGUgQXV0aG9yaXR5MQ0wCwYDVQQDEwRDUkwxMBoG A1UdEAQTMBGBDzIwMTgwODIyMTY0MTUxWjALBgNVHQ8EBAMCAQYwHwYDVR0jBBgwFoAUSOZo+SvS spXXR9gjIBBPM5iQn9QwHQYDVR0OBBYEFEjmaPkr0rKV10fYIyAQTzOYkJ/UMAwGA1UdEwQFMAMB Af8wGgYJKoZIhvZ9B0EABA0wCxsFVjMuMGMDAgbAMA0GCSqGSIb3DQEBBQUAA4GBAFjOKer89961 zgK5F7WF0bnj4JXMJTENAKaSbn+2kmOeUJXRmm/kEd5jhW6Y7qj/WsjTVbJmcVfewCHrPSqnI0kB BIZCe/zuf6IWUrVnZ9NA2zsmWLIodz2uFHdh1voqZiegDfqnc1zqcPGUIWVEX/r87yloqaKHee95 70+sB3c4 -----END CERTIFICATE----- GlobalSign Root CA ================== -----BEGIN CERTIFICATE----- MIIDdTCCAl2gAwIBAgILBAAAAAABFUtaw5QwDQYJKoZIhvcNAQEFBQAwVzELMAkGA1UEBhMCQkUx GTAXBgNVBAoTEEdsb2JhbFNpZ24gbnYtc2ExEDAOBgNVBAsTB1Jvb3QgQ0ExGzAZBgNVBAMTEkds b2JhbFNpZ24gUm9vdCBDQTAeFw05ODA5MDExMjAwMDBaFw0yODAxMjgxMjAwMDBaMFcxCzAJBgNV BAYTAkJFMRkwFwYDVQQKExBHbG9iYWxTaWduIG52LXNhMRAwDgYDVQQLEwdSb290IENBMRswGQYD VQQDExJHbG9iYWxTaWduIFJvb3QgQ0EwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDa DuaZjc6j40+Kfvvxi4Mla+pIH/EqsLmVEQS98GPR4mdmzxzdzxtIK+6NiY6arymAZavpxy0Sy6sc THAHoT0KMM0VjU/43dSMUBUc71DuxC73/OlS8pF94G3VNTCOXkNz8kHp1Wrjsok6Vjk4bwY8iGlb Kk3Fp1S4bInMm/k8yuX9ifUSPJJ4ltbcdG6TRGHRjcdGsnUOhugZitVtbNV4FpWi6cgKOOvyJBNP c1STE4U6G7weNLWLBYy5d4ux2x8gkasJU26Qzns3dLlwR5EiUWMWea6xrkEmCMgZK9FGqkjWZCrX gzT/LCrBbBlDSgeF59N89iFo7+ryUp9/k5DPAgMBAAGjQjBAMA4GA1UdDwEB/wQEAwIBBjAPBgNV HRMBAf8EBTADAQH/MB0GA1UdDgQWBBRge2YaRQ2XyolQL30EzTSo//z9SzANBgkqhkiG9w0BAQUF AAOCAQEA1nPnfE920I2/7LqivjTFKDK1fPxsnCwrvQmeU79rXqoRSLblCKOzyj1hTdNGCbM+w6Dj Y1Ub8rrvrTnhQ7k4o+YviiY776BQVvnGCv04zcQLcFGUl5gE38NflNUVyRRBnMRddWQVDf9VMOyG j/8N7yy5Y0b2qvzfvGn9LhJIZJrglfCm7ymPAbEVtQwdpf5pLGkkeB6zpxxxYu7KyJesF12KwvhH hm4qxFYxldBniYUr+WymXUadDKqC5JlR3XC321Y9YeRq4VzW9v493kHMB65jUr9TU/Qr6cf9tveC X4XSQRjbgbMEHMUfpIBvFSDJ3gyICh3WZlXi/EjJKSZp4A== -----END CERTIFICATE----- GlobalSign Root CA - R2 ======================= -----BEGIN CERTIFICATE----- MIIDujCCAqKgAwIBAgILBAAAAAABD4Ym5g0wDQYJKoZIhvcNAQEFBQAwTDEgMB4GA1UECxMXR2xv YmFsU2lnbiBSb290IENBIC0gUjIxEzARBgNVBAoTCkdsb2JhbFNpZ24xEzARBgNVBAMTCkdsb2Jh bFNpZ24wHhcNMDYxMjE1MDgwMDAwWhcNMjExMjE1MDgwMDAwWjBMMSAwHgYDVQQLExdHbG9iYWxT aWduIFJvb3QgQ0EgLSBSMjETMBEGA1UEChMKR2xvYmFsU2lnbjETMBEGA1UEAxMKR2xvYmFsU2ln bjCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAKbPJA6+Lm8omUVCxKs+IVSbC9N/hHD6 ErPLv4dfxn+G07IwXNb9rfF73OX4YJYJkhD10FPe+3t+c4isUoh7SqbKSaZeqKeMWhG8eoLrvozp s6yWJQeXSpkqBy+0Hne/ig+1AnwblrjFuTosvNYSuetZfeLQBoZfXklqtTleiDTsvHgMCJiEbKjN S7SgfQx5TfC4LcshytVsW33hoCmEofnTlEnLJGKRILzdC9XZzPnqJworc5HGnRusyMvo4KD0L5CL TfuwNhv2GXqF4G3yYROIXJ/gkwpRl4pazq+r1feqCapgvdzZX99yqWATXgAByUr6P6TqBwMhAo6C ygPCm48CAwEAAaOBnDCBmTAOBgNVHQ8BAf8EBAMCAQYwDwYDVR0TAQH/BAUwAwEB/zAdBgNVHQ4E FgQUm+IHV2ccHsBqBt5ZtJot39wZhi4wNgYDVR0fBC8wLTAroCmgJ4YlaHR0cDovL2NybC5nbG9i YWxzaWduLm5ldC9yb290LXIyLmNybDAfBgNVHSMEGDAWgBSb4gdXZxwewGoG3lm0mi3f3BmGLjAN BgkqhkiG9w0BAQUFAAOCAQEAmYFThxxol4aR7OBKuEQLq4GsJ0/WwbgcQ3izDJr86iw8bmEbTUsp 9Z8FHSbBuOmDAGJFtqkIk7mpM0sYmsL4h4hO291xNBrBVNpGP+DTKqttVCL1OmLNIG+6KYnX3ZHu 01yiPqFbQfXf5WRDLenVOavSot+3i9DAgBkcRcAtjOj4LaR0VknFBbVPFd5uRHg5h6h+u/N5GJG7 9G+dwfCMNYxdAfvDbbnvRG15RjF+Cv6pgsH/76tuIMRQyV+dTZsXjAzlAcmgQWpzU/qlULRuJQ/7 TBj0/VLZjmmx6BEP3ojY+x1J96relc8geMJgEtslQIxq/H5COEBkEveegeGTLg== -----END CERTIFICATE----- Verisign Class 3 Public Primary Certification Authority - G3 ============================================================ -----BEGIN CERTIFICATE----- MIIEGjCCAwICEQCbfgZJoz5iudXukEhxKe9XMA0GCSqGSIb3DQEBBQUAMIHKMQswCQYDVQQGEwJV UzEXMBUGA1UEChMOVmVyaVNpZ24sIEluYy4xHzAdBgNVBAsTFlZlcmlTaWduIFRydXN0IE5ldHdv cmsxOjA4BgNVBAsTMShjKSAxOTk5IFZlcmlTaWduLCBJbmMuIC0gRm9yIGF1dGhvcml6ZWQgdXNl IG9ubHkxRTBDBgNVBAMTPFZlcmlTaWduIENsYXNzIDMgUHVibGljIFByaW1hcnkgQ2VydGlmaWNh dGlvbiBBdXRob3JpdHkgLSBHMzAeFw05OTEwMDEwMDAwMDBaFw0zNjA3MTYyMzU5NTlaMIHKMQsw CQYDVQQGEwJVUzEXMBUGA1UEChMOVmVyaVNpZ24sIEluYy4xHzAdBgNVBAsTFlZlcmlTaWduIFRy dXN0IE5ldHdvcmsxOjA4BgNVBAsTMShjKSAxOTk5IFZlcmlTaWduLCBJbmMuIC0gRm9yIGF1dGhv cml6ZWQgdXNlIG9ubHkxRTBDBgNVBAMTPFZlcmlTaWduIENsYXNzIDMgUHVibGljIFByaW1hcnkg Q2VydGlmaWNhdGlvbiBBdXRob3JpdHkgLSBHMzCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoC ggEBAMu6nFL8eB8aHm8bN3O9+MlrlBIwT/A2R/XQkQr1F8ilYcEWQE37imGQ5XYgwREGfassbqb1 EUGO+i2tKmFZpGcmTNDovFJbcCAEWNF6yaRpvIMXZK0Fi7zQWM6NjPXr8EJJC52XJ2cybuGukxUc cLwgTS8Y3pKI6GyFVxEa6X7jJhFUokWWVYPKMIno3Nij7SqAP395ZVc+FSBmCC+Vk7+qRy+oRpfw EuL+wgorUeZ25rdGt+INpsyow0xZVYnm6FNcHOqd8GIWC6fJXwzw3sJ2zq/3avL6QaaiMxTJ5Xpj 055iN9WFZZ4O5lMkdBteHRJTW8cs54NJOxWuimi5V5cCAwEAATANBgkqhkiG9w0BAQUFAAOCAQEA ERSWwauSCPc/L8my/uRan2Te2yFPhpk0djZX3dAVL8WtfxUfN2JzPtTnX84XA9s1+ivbrmAJXx5f j267Cz3qWhMeDGBvtcC1IyIuBwvLqXTLR7sdwdela8wv0kL9Sd2nic9TutoAWii/gt/4uhMdUIaC /Y4wjylGsB49Ndo4YhYYSq3mtlFs3q9i6wHQHiT+eo8SGhJouPtmmRQURVyu565pF4ErWjfJXir0 xuKhXFSbplQAz/DxwceYMBo7Nhbbo27q/a2ywtrvAkcTisDxszGtTxzhT5yvDwyd93gN2PQ1VoDa t20Xj50egWTh/sVFuq1ruQp6Tk9LhO5L8X3dEQ== -----END CERTIFICATE----- Verisign Class 4 Public Primary Certification Authority - G3 ============================================================ -----BEGIN CERTIFICATE----- MIIEGjCCAwICEQDsoKeLbnVqAc/EfMwvlF7XMA0GCSqGSIb3DQEBBQUAMIHKMQswCQYDVQQGEwJV UzEXMBUGA1UEChMOVmVyaVNpZ24sIEluYy4xHzAdBgNVBAsTFlZlcmlTaWduIFRydXN0IE5ldHdv cmsxOjA4BgNVBAsTMShjKSAxOTk5IFZlcmlTaWduLCBJbmMuIC0gRm9yIGF1dGhvcml6ZWQgdXNl IG9ubHkxRTBDBgNVBAMTPFZlcmlTaWduIENsYXNzIDQgUHVibGljIFByaW1hcnkgQ2VydGlmaWNh dGlvbiBBdXRob3JpdHkgLSBHMzAeFw05OTEwMDEwMDAwMDBaFw0zNjA3MTYyMzU5NTlaMIHKMQsw CQYDVQQGEwJVUzEXMBUGA1UEChMOVmVyaVNpZ24sIEluYy4xHzAdBgNVBAsTFlZlcmlTaWduIFRy dXN0IE5ldHdvcmsxOjA4BgNVBAsTMShjKSAxOTk5IFZlcmlTaWduLCBJbmMuIC0gRm9yIGF1dGhv cml6ZWQgdXNlIG9ubHkxRTBDBgNVBAMTPFZlcmlTaWduIENsYXNzIDQgUHVibGljIFByaW1hcnkg Q2VydGlmaWNhdGlvbiBBdXRob3JpdHkgLSBHMzCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoC ggEBAK3LpRFpxlmr8Y+1GQ9Wzsy1HyDkniYlS+BzZYlZ3tCD5PUPtbut8XzoIfzk6AzufEUiGXaS tBO3IFsJ+mGuqPKljYXCKtbeZjbSmwL0qJJgfJxptI8kHtCGUvYynEFYHiK9zUVilQhu0GbdU6LM 8BDcVHOLBKFGMzNcF0C5nk3T875Vg+ixiY5afJqWIpA7iCXy0lOIAgwLePLmNxdLMEYH5IBtptiW Lugs+BGzOA1mppvqySNb247i8xOOGlktqgLw7KSHZtzBP/XYufTsgsbSPZUd5cBPhMnZo0QoBmrX Razwa2rvTl/4EYIeOGM0ZlDUPpNz+jDDZq3/ky2X7wMCAwEAATANBgkqhkiG9w0BAQUFAAOCAQEA j/ola09b5KROJ1WrIhVZPMq1CtRK26vdoV9TxaBXOcLORyu+OshWv8LZJxA6sQU8wHcxuzrTBXtt mhwwjIDLk5Mqg6sFUYICABFna/OIYUdfA5PVWw3g8dShMjWFsjrbsIKr0csKvE+MW8VLADsfKoKm fjaF3H48ZwC15DtS4KjrXRX5xm3wrR0OhbepmnMUWluPQSjA1egtTaRezarZ7c7c2NU8Qh0XwRJd RTjDOPP8hS6DRkiy1yBfkjaP53kPmF6Z6PDQpLv1U70qzlmwr25/bLvSHgCwIe34QWKCudiyxLtG UPMxxY8BqHTr9Xgn2uf3ZkPznoM+IKrDNWCRzg== -----END CERTIFICATE----- Entrust.net Premium 2048 Secure Server CA ========================================= -----BEGIN CERTIFICATE----- MIIEKjCCAxKgAwIBAgIEOGPe+DANBgkqhkiG9w0BAQUFADCBtDEUMBIGA1UEChMLRW50cnVzdC5u ZXQxQDA+BgNVBAsUN3d3dy5lbnRydXN0Lm5ldC9DUFNfMjA0OCBpbmNvcnAuIGJ5IHJlZi4gKGxp bWl0cyBsaWFiLikxJTAjBgNVBAsTHChjKSAxOTk5IEVudHJ1c3QubmV0IExpbWl0ZWQxMzAxBgNV BAMTKkVudHJ1c3QubmV0IENlcnRpZmljYXRpb24gQXV0aG9yaXR5ICgyMDQ4KTAeFw05OTEyMjQx NzUwNTFaFw0yOTA3MjQxNDE1MTJaMIG0MRQwEgYDVQQKEwtFbnRydXN0Lm5ldDFAMD4GA1UECxQ3 d3d3LmVudHJ1c3QubmV0L0NQU18yMDQ4IGluY29ycC4gYnkgcmVmLiAobGltaXRzIGxpYWIuKTEl MCMGA1UECxMcKGMpIDE5OTkgRW50cnVzdC5uZXQgTGltaXRlZDEzMDEGA1UEAxMqRW50cnVzdC5u ZXQgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkgKDIwNDgpMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8A MIIBCgKCAQEArU1LqRKGsuqjIAcVFmQqK0vRvwtKTY7tgHalZ7d4QMBzQshowNtTK91euHaYNZOL Gp18EzoOH1u3Hs/lJBQesYGpjX24zGtLA/ECDNyrpUAkAH90lKGdCCmziAv1h3edVc3kw37XamSr hRSGlVuXMlBvPci6Zgzj/L24ScF2iUkZ/cCovYmjZy/Gn7xxGWC4LeksyZB2ZnuU4q941mVTXTzW nLLPKQP5L6RQstRIzgUyVYr9smRMDuSYB3Xbf9+5CFVghTAp+XtIpGmG4zU/HoZdenoVve8AjhUi VBcAkCaTvA5JaJG/+EfTnZVCwQ5N328mz8MYIWJmQ3DW1cAH4QIDAQABo0IwQDAOBgNVHQ8BAf8E BAMCAQYwDwYDVR0TAQH/BAUwAwEB/zAdBgNVHQ4EFgQUVeSB0RGAvtiJuQijMfmhJAkWuXAwDQYJ KoZIhvcNAQEFBQADggEBADubj1abMOdTmXx6eadNl9cZlZD7Bh/KM3xGY4+WZiT6QBshJ8rmcnPy T/4xmf3IDExoU8aAghOY+rat2l098c5u9hURlIIM7j+VrxGrD9cv3h8Dj1csHsm7mhpElesYT6Yf zX1XEC+bBAlahLVu2B064dae0Wx5XnkcFMXj0EyTO2U87d89vqbllRrDtRnDvV5bu/8j72gZyxKT J1wDLW8w0B62GqzeWvfRqqgnpv55gcR5mTNXuhKwqeBCbJPKVt7+bYQLCIt+jerXmCHG8+c8eS9e nNFMFY3h7CI3zJpDC5fcgJCNs2ebb0gIFVbPv/ErfF6adulZkMV8gzURZVE= -----END CERTIFICATE----- Baltimore CyberTrust Root ========================= -----BEGIN CERTIFICATE----- MIIDdzCCAl+gAwIBAgIEAgAAuTANBgkqhkiG9w0BAQUFADBaMQswCQYDVQQGEwJJRTESMBAGA1UE ChMJQmFsdGltb3JlMRMwEQYDVQQLEwpDeWJlclRydXN0MSIwIAYDVQQDExlCYWx0aW1vcmUgQ3li ZXJUcnVzdCBSb290MB4XDTAwMDUxMjE4NDYwMFoXDTI1MDUxMjIzNTkwMFowWjELMAkGA1UEBhMC SUUxEjAQBgNVBAoTCUJhbHRpbW9yZTETMBEGA1UECxMKQ3liZXJUcnVzdDEiMCAGA1UEAxMZQmFs dGltb3JlIEN5YmVyVHJ1c3QgUm9vdDCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAKME uyKrmD1X6CZymrV51Cni4eiVgLGw41uOKymaZN+hXe2wCQVt2yguzmKiYv60iNoS6zjrIZ3AQSsB UnuId9Mcj8e6uYi1agnnc+gRQKfRzMpijS3ljwumUNKoUMMo6vWrJYeKmpYcqWe4PwzV9/lSEy/C G9VwcPCPwBLKBsua4dnKM3p31vjsufFoREJIE9LAwqSuXmD+tqYF/LTdB1kC1FkYmGP1pWPgkAx9 XbIGevOF6uvUA65ehD5f/xXtabz5OTZydc93Uk3zyZAsuT3lySNTPx8kmCFcB5kpvcY67Oduhjpr l3RjM71oGDHweI12v/yejl0qhqdNkNwnGjkCAwEAAaNFMEMwHQYDVR0OBBYEFOWdWTCCR1jMrPoI VDaGezq1BE3wMBIGA1UdEwEB/wQIMAYBAf8CAQMwDgYDVR0PAQH/BAQDAgEGMA0GCSqGSIb3DQEB BQUAA4IBAQCFDF2O5G9RaEIFoN27TyclhAO992T9Ldcw46QQF+vaKSm2eT929hkTI7gQCvlYpNRh cL0EYWoSihfVCr3FvDB81ukMJY2GQE/szKN+OMY3EU/t3WgxjkzSswF07r51XgdIGn9w/xZchMB5 hbgF/X++ZRGjD8ACtPhSNzkE1akxehi/oCr0Epn3o0WC4zxe9Z2etciefC7IpJ5OCBRLbf1wbWsa Y71k5h+3zvDyny67G7fyUIhzksLi4xaNmjICq44Y3ekQEe5+NauQrz4wlHrQMz2nZQ/1/I6eYs9H RCwBXbsdtTLSR9I4LtD+gdwyah617jzV/OeBHRnDJELqYzmp -----END CERTIFICATE----- AddTrust Low-Value Services Root ================================ -----BEGIN CERTIFICATE----- MIIEGDCCAwCgAwIBAgIBATANBgkqhkiG9w0BAQUFADBlMQswCQYDVQQGEwJTRTEUMBIGA1UEChML QWRkVHJ1c3QgQUIxHTAbBgNVBAsTFEFkZFRydXN0IFRUUCBOZXR3b3JrMSEwHwYDVQQDExhBZGRU cnVzdCBDbGFzcyAxIENBIFJvb3QwHhcNMDAwNTMwMTAzODMxWhcNMjAwNTMwMTAzODMxWjBlMQsw CQYDVQQGEwJTRTEUMBIGA1UEChMLQWRkVHJ1c3QgQUIxHTAbBgNVBAsTFEFkZFRydXN0IFRUUCBO ZXR3b3JrMSEwHwYDVQQDExhBZGRUcnVzdCBDbGFzcyAxIENBIFJvb3QwggEiMA0GCSqGSIb3DQEB AQUAA4IBDwAwggEKAoIBAQCWltQhSWDia+hBBwzexODcEyPNwTXH+9ZOEQpnXvUGW2ulCDtbKRY6 54eyNAbFvAWlA3yCyykQruGIgb3WntP+LVbBFc7jJp0VLhD7Bo8wBN6ntGO0/7Gcrjyvd7ZWxbWr oulpOj0OM3kyP3CCkplhbY0wCI9xP6ZIVxn4JdxLZlyldI+Yrsj5wAYi56xz36Uu+1LcsRVlIPo1 Zmne3yzxbrww2ywkEtvrNTVokMsAsJchPXQhI2U0K7t4WaPW4XY5mqRJjox0r26kmqPZm9I4XJui GMx1I4S+6+JNM3GOGvDC+Mcdoq0Dlyz4zyXG9rgkMbFjXZJ/Y/AlyVMuH79NAgMBAAGjgdIwgc8w HQYDVR0OBBYEFJWxtPCUtr3H2tERCSG+wa9J/RB7MAsGA1UdDwQEAwIBBjAPBgNVHRMBAf8EBTAD AQH/MIGPBgNVHSMEgYcwgYSAFJWxtPCUtr3H2tERCSG+wa9J/RB7oWmkZzBlMQswCQYDVQQGEwJT RTEUMBIGA1UEChMLQWRkVHJ1c3QgQUIxHTAbBgNVBAsTFEFkZFRydXN0IFRUUCBOZXR3b3JrMSEw HwYDVQQDExhBZGRUcnVzdCBDbGFzcyAxIENBIFJvb3SCAQEwDQYJKoZIhvcNAQEFBQADggEBACxt ZBsfzQ3duQH6lmM0MkhHma6X7f1yFqZzR1r0693p9db7RcwpiURdv0Y5PejuvE1Uhh4dbOMXJ0Ph iVYrqW9yTkkz43J8KiOavD7/KCrto/8cI7pDVwlnTUtiBi34/2ydYB7YHEt9tTEv2dB8Xfjea4MY eDdXL+gzB2ffHsdrKpV2ro9Xo/D0UrSpUwjP4E/TelOL/bscVjby/rK25Xa71SJlpz/+0WatC7xr mYbvP33zGDLKe8bjq2RGlfgmadlVg3sslgf/WSxEo8bl6ancoWOAWiFeIc9TVPC6b4nbqKqVz4vj ccweGyBECMB6tkD9xOQ14R0WHNC8K47Wcdk= -----END CERTIFICATE----- AddTrust External Root ====================== -----BEGIN CERTIFICATE----- MIIENjCCAx6gAwIBAgIBATANBgkqhkiG9w0BAQUFADBvMQswCQYDVQQGEwJTRTEUMBIGA1UEChML QWRkVHJ1c3QgQUIxJjAkBgNVBAsTHUFkZFRydXN0IEV4dGVybmFsIFRUUCBOZXR3b3JrMSIwIAYD VQQDExlBZGRUcnVzdCBFeHRlcm5hbCBDQSBSb290MB4XDTAwMDUzMDEwNDgzOFoXDTIwMDUzMDEw NDgzOFowbzELMAkGA1UEBhMCU0UxFDASBgNVBAoTC0FkZFRydXN0IEFCMSYwJAYDVQQLEx1BZGRU cnVzdCBFeHRlcm5hbCBUVFAgTmV0d29yazEiMCAGA1UEAxMZQWRkVHJ1c3QgRXh0ZXJuYWwgQ0Eg Um9vdDCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBALf3GjPm8gAELTngTlvtH7xsD821 +iO2zt6bETOXpClMfZOfvUq8k+0DGuOPz+VtUFrWlymUWoCwSXrbLpX9uMq/NzgtHj6RQa1wVsfw Tz/oMp50ysiQVOnGXw94nZpAPA6sYapeFI+eh6FqUNzXmk6vBbOmcZSccbNQYArHE504B4YCqOmo aSYYkKtMsE8jqzpPhNjfzp/haW+710LXa0Tkx63ubUFfclpxCDezeWWkWaCUN/cALw3CknLa0Dhy 2xSoRcRdKn23tNbE7qzNE0S3ySvdQwAl+mG5aWpYIxG3pzOPVnVZ9c0p10a3CitlttNCbxWyuHv7 7+ldU9U0WicCAwEAAaOB3DCB2TAdBgNVHQ4EFgQUrb2YejS0Jvf6xCZU7wO94CTLVBowCwYDVR0P BAQDAgEGMA8GA1UdEwEB/wQFMAMBAf8wgZkGA1UdIwSBkTCBjoAUrb2YejS0Jvf6xCZU7wO94CTL VBqhc6RxMG8xCzAJBgNVBAYTAlNFMRQwEgYDVQQKEwtBZGRUcnVzdCBBQjEmMCQGA1UECxMdQWRk VHJ1c3QgRXh0ZXJuYWwgVFRQIE5ldHdvcmsxIjAgBgNVBAMTGUFkZFRydXN0IEV4dGVybmFsIENB IFJvb3SCAQEwDQYJKoZIhvcNAQEFBQADggEBALCb4IUlwtYj4g+WBpKdQZic2YR5gdkeWxQHIzZl j7DYd7usQWxHYINRsPkyPef89iYTx4AWpb9a/IfPeHmJIZriTAcKhjW88t5RxNKWt9x+Tu5w/Rw5 6wwCURQtjr0W4MHfRnXnJK3s9EK0hZNwEGe6nQY1ShjTK3rMUUKhemPR5ruhxSvCNr4TDea9Y355 e6cJDUCrat2PisP29owaQgVR1EX1n6diIWgVIEM8med8vSTYqZEXc4g/VhsxOBi0cQ+azcgOno4u G+GMmIPLHzHxREzGBHNJdmAPx/i9F4BrLunMTA5amnkPIAou1Z5jJh5VkpTYghdae9C8x49OhgQ= -----END CERTIFICATE----- AddTrust Public Services Root ============================= -----BEGIN CERTIFICATE----- MIIEFTCCAv2gAwIBAgIBATANBgkqhkiG9w0BAQUFADBkMQswCQYDVQQGEwJTRTEUMBIGA1UEChML QWRkVHJ1c3QgQUIxHTAbBgNVBAsTFEFkZFRydXN0IFRUUCBOZXR3b3JrMSAwHgYDVQQDExdBZGRU cnVzdCBQdWJsaWMgQ0EgUm9vdDAeFw0wMDA1MzAxMDQxNTBaFw0yMDA1MzAxMDQxNTBaMGQxCzAJ BgNVBAYTAlNFMRQwEgYDVQQKEwtBZGRUcnVzdCBBQjEdMBsGA1UECxMUQWRkVHJ1c3QgVFRQIE5l dHdvcmsxIDAeBgNVBAMTF0FkZFRydXN0IFB1YmxpYyBDQSBSb290MIIBIjANBgkqhkiG9w0BAQEF AAOCAQ8AMIIBCgKCAQEA6Rowj4OIFMEg2Dybjxt+A3S72mnTRqX4jsIMEZBRpS9mVEBV6tsfSlbu nyNu9DnLoblv8n75XYcmYZ4c+OLspoH4IcUkzBEMP9smcnrHAZcHF/nXGCwwfQ56HmIexkvA/X1i d9NEHif2P0tEs7c42TkfYNVRknMDtABp4/MUTu7R3AnPdzRGULD4EfL+OHn3Bzn+UZKXC1sIXzSG Aa2Il+tmzV7R/9x98oTaunet3IAIx6eH1lWfl2royBFkuucZKT8Rs3iQhCBSWxHveNCD9tVIkNAw HM+A+WD+eeSI8t0A65RF62WUaUC6wNW0uLp9BBGo6zEFlpROWCGOn9Bg/QIDAQABo4HRMIHOMB0G A1UdDgQWBBSBPjfYkrAfd59ctKtzquf2NGAv+jALBgNVHQ8EBAMCAQYwDwYDVR0TAQH/BAUwAwEB /zCBjgYDVR0jBIGGMIGDgBSBPjfYkrAfd59ctKtzquf2NGAv+qFopGYwZDELMAkGA1UEBhMCU0Ux FDASBgNVBAoTC0FkZFRydXN0IEFCMR0wGwYDVQQLExRBZGRUcnVzdCBUVFAgTmV0d29yazEgMB4G A1UEAxMXQWRkVHJ1c3QgUHVibGljIENBIFJvb3SCAQEwDQYJKoZIhvcNAQEFBQADggEBAAP3FUr4 JNojVhaTdt02KLmuG7jD8WS6IBh4lSknVwW8fCr0uVFV2ocC3g8WFzH4qnkuCRO7r7IgGRLlk/lL +YPoRNWyQSW/iHVv/xD8SlTQX/D67zZzfRs2RcYhbbQVuE7PnFylPVoAjgbjPGsye/Kf8Lb93/Ao GEjwxrzQvzSAlsJKsW2Ox5BF3i9nrEUEo3rcVZLJR2bYGozH7ZxOmuASu7VqTITh4SINhwBk/ox9 Yjllpu9CtoAlEmEBqCQTcAARJl/6NVDFSMwGR+gn2HCNX2TmoUQmXiLsks3/QppEIW1cxeMiHV9H EufOX1362KqxMy3ZdvJOOjMMK7MtkAY= -----END CERTIFICATE----- AddTrust Qualified Certificates Root ==================================== -----BEGIN CERTIFICATE----- MIIEHjCCAwagAwIBAgIBATANBgkqhkiG9w0BAQUFADBnMQswCQYDVQQGEwJTRTEUMBIGA1UEChML QWRkVHJ1c3QgQUIxHTAbBgNVBAsTFEFkZFRydXN0IFRUUCBOZXR3b3JrMSMwIQYDVQQDExpBZGRU cnVzdCBRdWFsaWZpZWQgQ0EgUm9vdDAeFw0wMDA1MzAxMDQ0NTBaFw0yMDA1MzAxMDQ0NTBaMGcx CzAJBgNVBAYTAlNFMRQwEgYDVQQKEwtBZGRUcnVzdCBBQjEdMBsGA1UECxMUQWRkVHJ1c3QgVFRQ IE5ldHdvcmsxIzAhBgNVBAMTGkFkZFRydXN0IFF1YWxpZmllZCBDQSBSb290MIIBIjANBgkqhkiG 9w0BAQEFAAOCAQ8AMIIBCgKCAQEA5B6a/twJWoekn0e+EV+vhDTbYjx5eLfpMLXsDBwqxBb/4Oxx 64r1EW7tTw2R0hIYLUkVAcKkIhPHEWT/IhKauY5cLwjPcWqzZwFZ8V1G87B4pfYOQnrjfxvM0PC3 KP0q6p6zsLkEqv32x7SxuCqg+1jxGaBvcCV+PmlKfw8i2O+tCBGaKZnhqkRFmhJePp1tUvznoD1o L/BLcHwTOK28FSXx1s6rosAx1i+f4P8UWfyEk9mHfExUE+uf0S0R+Bg6Ot4l2ffTQO2kBhLEO+GR wVY18BTcZTYJbqukB8c10cIDMzZbdSZtQvESa0NvS3GU+jQd7RNuyoB/mC9suWXY6QIDAQABo4HU MIHRMB0GA1UdDgQWBBQ5lYtii1zJ1IC6WA+XPxUIQ8yYpzALBgNVHQ8EBAMCAQYwDwYDVR0TAQH/ BAUwAwEB/zCBkQYDVR0jBIGJMIGGgBQ5lYtii1zJ1IC6WA+XPxUIQ8yYp6FrpGkwZzELMAkGA1UE BhMCU0UxFDASBgNVBAoTC0FkZFRydXN0IEFCMR0wGwYDVQQLExRBZGRUcnVzdCBUVFAgTmV0d29y azEjMCEGA1UEAxMaQWRkVHJ1c3QgUXVhbGlmaWVkIENBIFJvb3SCAQEwDQYJKoZIhvcNAQEFBQAD ggEBABmrder4i2VhlRO6aQTvhsoToMeqT2QbPxj2qC0sVY8FtzDqQmodwCVRLae/DLPt7wh/bDxG GuoYQ992zPlmhpwsaPXpF/gxsxjE1kh9I0xowX67ARRvxdlu3rsEQmr49lx95dr6h+sNNVJn0J6X dgWTP5XHAeZpVTh/EGGZyeNfpso+gmNIquIISD6q8rKFYqa0p9m9N5xotS1WfbC3P6CxB9bpT9ze RXEwMn8bLgn5v1Kh7sKAPgZcLlVAwRv1cEWw3F369nJad9Jjzc9YiQBCYz95OdBEsIJuQRno3eDB iFrRHnGTHyQwdOUeqN48Jzd/g66ed8/wMLH/S5noxqE= -----END CERTIFICATE----- Entrust Root Certification Authority ==================================== -----BEGIN CERTIFICATE----- MIIEkTCCA3mgAwIBAgIERWtQVDANBgkqhkiG9w0BAQUFADCBsDELMAkGA1UEBhMCVVMxFjAUBgNV BAoTDUVudHJ1c3QsIEluYy4xOTA3BgNVBAsTMHd3dy5lbnRydXN0Lm5ldC9DUFMgaXMgaW5jb3Jw b3JhdGVkIGJ5IHJlZmVyZW5jZTEfMB0GA1UECxMWKGMpIDIwMDYgRW50cnVzdCwgSW5jLjEtMCsG A1UEAxMkRW50cnVzdCBSb290IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MB4XDTA2MTEyNzIwMjM0 MloXDTI2MTEyNzIwNTM0MlowgbAxCzAJBgNVBAYTAlVTMRYwFAYDVQQKEw1FbnRydXN0LCBJbmMu MTkwNwYDVQQLEzB3d3cuZW50cnVzdC5uZXQvQ1BTIGlzIGluY29ycG9yYXRlZCBieSByZWZlcmVu Y2UxHzAdBgNVBAsTFihjKSAyMDA2IEVudHJ1c3QsIEluYy4xLTArBgNVBAMTJEVudHJ1c3QgUm9v dCBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEB ALaVtkNC+sZtKm9I35RMOVcF7sN5EUFoNu3s/poBj6E4KPz3EEZmLk0eGrEaTsbRwJWIsMn/MYsz A9u3g3s+IIRe7bJWKKf44LlAcTfFy0cOlypowCKVYhXbR9n10Cv/gkvJrT7eTNuQgFA/CYqEAOww Cj0Yzfv9KlmaI5UXLEWeH25DeW0MXJj+SKfFI0dcXv1u5x609mhF0YaDW6KKjbHjKYD+JXGIrb68 j6xSlkuqUY3kEzEZ6E5Nn9uss2rVvDlUccp6en+Q3X0dgNmBu1kmwhH+5pPi94DkZfs0Nw4pgHBN rziGLp5/V6+eF67rHMsoIV+2HNjnogQi+dPa2MsCAwEAAaOBsDCBrTAOBgNVHQ8BAf8EBAMCAQYw DwYDVR0TAQH/BAUwAwEB/zArBgNVHRAEJDAigA8yMDA2MTEyNzIwMjM0MlqBDzIwMjYxMTI3MjA1 MzQyWjAfBgNVHSMEGDAWgBRokORnpKZTgMeGZqTx90tD+4S9bTAdBgNVHQ4EFgQUaJDkZ6SmU4DH hmak8fdLQ/uEvW0wHQYJKoZIhvZ9B0EABBAwDhsIVjcuMTo0LjADAgSQMA0GCSqGSIb3DQEBBQUA A4IBAQCT1DCw1wMgKtD5Y+iRDAUgqV8ZyntyTtSx29CW+1RaGSwMCPeyvIWonX9tO1KzKtvn1ISM Y/YPyyYBkVBs9F8U4pN0wBOeMDpQ47RgxRzwIkSNcUesyBrJ6ZuaAGAT/3B+XxFNSRuzFVJ7yVTa v52Vr2ua2J7p8eRDjeIRRDq/r72DQnNSi6q7pynP9WQcCk3RvKqsnyrQ/39/2n3qse0wJcGE2jTS W3iDVuycNsMm4hH2Z0kdkquM++v/eu6FSqdQgPCnXEqULl8FmTxSQeDNtGPPAUO6nIPcj2A781q0 tHuu2guQOHXvgR1m0vdXcDazv/wor3ElhVsT/h5/WrQ8 -----END CERTIFICATE----- RSA Security 2048 v3 ==================== -----BEGIN CERTIFICATE----- MIIDYTCCAkmgAwIBAgIQCgEBAQAAAnwAAAAKAAAAAjANBgkqhkiG9w0BAQUFADA6MRkwFwYDVQQK ExBSU0EgU2VjdXJpdHkgSW5jMR0wGwYDVQQLExRSU0EgU2VjdXJpdHkgMjA0OCBWMzAeFw0wMTAy MjIyMDM5MjNaFw0yNjAyMjIyMDM5MjNaMDoxGTAXBgNVBAoTEFJTQSBTZWN1cml0eSBJbmMxHTAb BgNVBAsTFFJTQSBTZWN1cml0eSAyMDQ4IFYzMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKC AQEAt49VcdKA3XtpeafwGFAyPGJn9gqVB93mG/Oe2dJBVGutn3y+Gc37RqtBaB4Y6lXIL5F4iSj7 Jylg/9+PjDvJSZu1pJTOAeo+tWN7fyb9Gd3AIb2E0S1PRsNO3Ng3OTsor8udGuorryGlwSMiuLgb WhOHV4PR8CDn6E8jQrAApX2J6elhc5SYcSa8LWrg903w8bYqODGBDSnhAMFRD0xS+ARaqn1y07iH KrtjEAMqs6FPDVpeRrc9DvV07Jmf+T0kgYim3WBU6JU2PcYJk5qjEoAAVZkZR73QpXzDuvsf9/UP +Ky5tfQ3mBMY3oVbtwyCO4dvlTlYMNpuAWgXIszACwIDAQABo2MwYTAPBgNVHRMBAf8EBTADAQH/ MA4GA1UdDwEB/wQEAwIBBjAfBgNVHSMEGDAWgBQHw1EwpKrpRa41JPr/JCwz0LGdjDAdBgNVHQ4E FgQUB8NRMKSq6UWuNST6/yQsM9CxnYwwDQYJKoZIhvcNAQEFBQADggEBAF8+hnZuuDU8TjYcHnmY v/3VEhF5Ug7uMYm83X/50cYVIeiKAVQNOvtUudZj1LGqlk2iQk3UUx+LEN5/Zb5gEydxiKRz44Rj 0aRV4VCT5hsOedBnvEbIvz8XDZXmxpBp3ue0L96VfdASPz0+f00/FGj1EVDVwfSQpQgdMWD/YIwj VAqv/qFuxdF6Kmh4zx6CCiC0H63lhbJqaHVOrSU3lIW+vaHU6rcMSzyd6BIA8F+sDeGscGNz9395 nzIlQnQFgCi/vcEkllgVsRch6YlL2weIZ/QVrXA+L02FO8K32/6YaCOJ4XQP3vTFhGMpG8zLB8kA pKnXwiJPZ9d37CAFYd4= -----END CERTIFICATE----- GeoTrust Global CA ================== -----BEGIN CERTIFICATE----- MIIDVDCCAjygAwIBAgIDAjRWMA0GCSqGSIb3DQEBBQUAMEIxCzAJBgNVBAYTAlVTMRYwFAYDVQQK Ew1HZW9UcnVzdCBJbmMuMRswGQYDVQQDExJHZW9UcnVzdCBHbG9iYWwgQ0EwHhcNMDIwNTIxMDQw MDAwWhcNMjIwNTIxMDQwMDAwWjBCMQswCQYDVQQGEwJVUzEWMBQGA1UEChMNR2VvVHJ1c3QgSW5j LjEbMBkGA1UEAxMSR2VvVHJ1c3QgR2xvYmFsIENBMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIB CgKCAQEA2swYYzD99BcjGlZ+W988bDjkcbd4kdS8odhM+KhDtgPpTSEHCIjaWC9mOSm9BXiLnTjo BbdqfnGk5sRgprDvgOSJKA+eJdbtg/OtppHHmMlCGDUUna2YRpIuT8rxh0PBFpVXLVDviS2Aelet 8u5fa9IAjbkU+BQVNdnARqN7csiRv8lVK83Qlz6cJmTM386DGXHKTubU1XupGc1V3sjs0l44U+Vc T4wt/lAjNvxm5suOpDkZALeVAjmRCw7+OC7RHQWa9k0+bw8HHa8sHo9gOeL6NlMTOdReJivbPagU vTLrGAMoUgRx5aszPeE4uwc2hGKceeoWMPRfwCvocWvk+QIDAQABo1MwUTAPBgNVHRMBAf8EBTAD AQH/MB0GA1UdDgQWBBTAephojYn7qwVkDBF9qn1luMrMTjAfBgNVHSMEGDAWgBTAephojYn7qwVk DBF9qn1luMrMTjANBgkqhkiG9w0BAQUFAAOCAQEANeMpauUvXVSOKVCUn5kaFOSPeCpilKInZ57Q zxpeR+nBsqTP3UEaBU6bS+5Kb1VSsyShNwrrZHYqLizz/Tt1kL/6cdjHPTfStQWVYrmm3ok9Nns4 d0iXrKYgjy6myQzCsplFAMfOEVEiIuCl6rYVSAlk6l5PdPcFPseKUgzbFbS9bZvlxrFUaKnjaZC2 mqUPuLk/IH2uSrW4nOQdtqvmlKXBx4Ot2/Unhw4EbNX/3aBd7YdStysVAq45pmp06drE57xNNB6p XE0zX5IJL4hmXXeXxx12E6nV5fEWCRE11azbJHFwLJhWC9kXtNHjUStedejV0NxPNO3CBWaAocvm Mw== -----END CERTIFICATE----- GeoTrust Global CA 2 ==================== -----BEGIN CERTIFICATE----- MIIDZjCCAk6gAwIBAgIBATANBgkqhkiG9w0BAQUFADBEMQswCQYDVQQGEwJVUzEWMBQGA1UEChMN R2VvVHJ1c3QgSW5jLjEdMBsGA1UEAxMUR2VvVHJ1c3QgR2xvYmFsIENBIDIwHhcNMDQwMzA0MDUw MDAwWhcNMTkwMzA0MDUwMDAwWjBEMQswCQYDVQQGEwJVUzEWMBQGA1UEChMNR2VvVHJ1c3QgSW5j LjEdMBsGA1UEAxMUR2VvVHJ1c3QgR2xvYmFsIENBIDIwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAw ggEKAoIBAQDvPE1APRDfO1MA4Wf+lGAVPoWI8YkNkMgoI5kF6CsgncbzYEbYwbLVjDHZ3CB5JIG/ NTL8Y2nbsSpr7iFY8gjpeMtvy/wWUsiRxP89c96xPqfCfWbB9X5SJBri1WeR0IIQ13hLTytCOb1k LUCgsBDTOEhGiKEMuzozKmKY+wCdE1l/bztyqu6mD4b5BWHqZ38MN5aL5mkWRxHCJ1kDs6ZgwiFA Vvqgx306E+PsV8ez1q6diYD3Aecs9pYrEw15LNnA5IZ7S4wMcoKK+xfNAGw6EzywhIdLFnopsk/b HdQL82Y3vdj2V7teJHq4PIu5+pIaGoSe2HSPqht/XvT+RSIhAgMBAAGjYzBhMA8GA1UdEwEB/wQF MAMBAf8wHQYDVR0OBBYEFHE4NvICMVNHK266ZUapEBVYIAUJMB8GA1UdIwQYMBaAFHE4NvICMVNH K266ZUapEBVYIAUJMA4GA1UdDwEB/wQEAwIBhjANBgkqhkiG9w0BAQUFAAOCAQEAA/e1K6tdEPx7 srJerJsOflN4WT5CBP51o62sgU7XAotexC3IUnbHLB/8gTKY0UvGkpMzNTEv/NgdRN3ggX+d6Yvh ZJFiCzkIjKx0nVnZellSlxG5FntvRdOW2TF9AjYPnDtuzywNA0ZF66D0f0hExghAzN4bcLUprbqL OzRldRtxIR0sFAqwlpW41uryZfspuk/qkZN0abby/+Ea0AzRdoXLiiW9l14sbxWZJue2Kf8i7MkC x1YAzUm5s2x7UwQa4qjJqhIFI8LO57sEAszAR6LkxCkvW0VXiVHuPOtSCP8HNR6fNWpHSlaY0VqF H4z1Ir+rzoPz4iIprn2DQKi6bA== -----END CERTIFICATE----- GeoTrust Universal CA ===================== -----BEGIN CERTIFICATE----- MIIFaDCCA1CgAwIBAgIBATANBgkqhkiG9w0BAQUFADBFMQswCQYDVQQGEwJVUzEWMBQGA1UEChMN R2VvVHJ1c3QgSW5jLjEeMBwGA1UEAxMVR2VvVHJ1c3QgVW5pdmVyc2FsIENBMB4XDTA0MDMwNDA1 MDAwMFoXDTI5MDMwNDA1MDAwMFowRTELMAkGA1UEBhMCVVMxFjAUBgNVBAoTDUdlb1RydXN0IElu Yy4xHjAcBgNVBAMTFUdlb1RydXN0IFVuaXZlcnNhbCBDQTCCAiIwDQYJKoZIhvcNAQEBBQADggIP ADCCAgoCggIBAKYVVaCjxuAfjJ0hUNfBvitbtaSeodlyWL0AG0y/YckUHUWCq8YdgNY96xCcOq9t JPi8cQGeBvV8Xx7BDlXKg5pZMK4ZyzBIle0iN430SppyZj6tlcDgFgDgEB8rMQ7XlFTTQjOgNB0e RXbdT8oYN+yFFXoZCPzVx5zw8qkuEKmS5j1YPakWaDwvdSEYfyh3peFhF7em6fgemdtzbvQKoiFs 7tqqhZJmr/Z6a4LauiIINQ/PQvE1+mrufislzDoR5G2vc7J2Ha3QsnhnGqQ5HFELZ1aD/ThdDc7d 8Lsrlh/eezJS/R27tQahsiFepdaVaH/wmZ7cRQg+59IJDTWU3YBOU5fXtQlEIGQWFwMCTFMNaN7V qnJNk22CDtucvc+081xdVHppCZbW2xHBjXWotM85yM48vCR85mLK4b19p71XZQvk/iXttmkQ3Cga Rr0BHdCXteGYO8A3ZNY9lO4L4fUorgtWv3GLIylBjobFS1J72HGrH4oVpjuDWtdYAVHGTEHZf9hB Z3KiKN9gg6meyHv8U3NyWfWTehd2Ds735VzZC1U0oqpbtWpU5xPKV+yXbfReBi9Fi1jUIxaS5BZu KGNZMN9QAZxjiRqf2xeUgnA3wySemkfWWspOqGmJch+RbNt+nhutxx9z3SxPGWX9f5NAEC7S8O08 ni4oPmkmM8V7AgMBAAGjYzBhMA8GA1UdEwEB/wQFMAMBAf8wHQYDVR0OBBYEFNq7LqqwDLiIJlF0 XG0D08DYj3rWMB8GA1UdIwQYMBaAFNq7LqqwDLiIJlF0XG0D08DYj3rWMA4GA1UdDwEB/wQEAwIB hjANBgkqhkiG9w0BAQUFAAOCAgEAMXjmx7XfuJRAyXHEqDXsRh3ChfMoWIawC/yOsjmPRFWrZIRc aanQmjg8+uUfNeVE44B5lGiku8SfPeE0zTBGi1QrlaXv9z+ZhP015s8xxtxqv6fXIwjhmF7DWgh2 qaavdy+3YL1ERmrvl/9zlcGO6JP7/TG37FcREUWbMPEaiDnBTzynANXH/KttgCJwpQzgXQQpAvvL oJHRfNbDflDVnVi+QTjruXU8FdmbyUqDWcDaU/0zuzYYm4UPFd3uLax2k7nZAY1IEKj79TiG8dsK xr2EoyNB3tZ3b4XUhRxQ4K5RirqNPnbiucon8l+f725ZDQbYKxek0nxru18UGkiPGkzns0ccjkxF KyDuSN/n3QmOGKjaQI2SJhFTYXNd673nxE0pN2HrrDktZy4W1vUAg4WhzH92xH3kt0tm7wNFYGm2 DFKWkoRepqO1pD4r2czYG0eq8kTaT/kD6PAUyz/zg97QwVTjt+gKN02LIFkDMBmhLMi9ER/frslK xfMnZmaGrGiR/9nmUxwPi1xpZQomyB40w11Re9epnAahNt3ViZS82eQtDF4JbAiXfKM9fJP/P6EU p8+1Xevb2xzEdt+Iub1FBZUbrvxGakyvSOPOrg/SfuvmbJxPgWp6ZKy7PtXny3YuxadIwVyQD8vI P/rmMuGNG2+k5o7Y+SlIis5z/iw= -----END CERTIFICATE----- GeoTrust Universal CA 2 ======================= -----BEGIN CERTIFICATE----- MIIFbDCCA1SgAwIBAgIBATANBgkqhkiG9w0BAQUFADBHMQswCQYDVQQGEwJVUzEWMBQGA1UEChMN R2VvVHJ1c3QgSW5jLjEgMB4GA1UEAxMXR2VvVHJ1c3QgVW5pdmVyc2FsIENBIDIwHhcNMDQwMzA0 MDUwMDAwWhcNMjkwMzA0MDUwMDAwWjBHMQswCQYDVQQGEwJVUzEWMBQGA1UEChMNR2VvVHJ1c3Qg SW5jLjEgMB4GA1UEAxMXR2VvVHJ1c3QgVW5pdmVyc2FsIENBIDIwggIiMA0GCSqGSIb3DQEBAQUA A4ICDwAwggIKAoICAQCzVFLByT7y2dyxUxpZKeexw0Uo5dfR7cXFS6GqdHtXr0om/Nj1XqduGdt0 DE81WzILAePb63p3NeqqWuDW6KFXlPCQo3RWlEQwAx5cTiuFJnSCegx2oG9NzkEtoBUGFF+3Qs17 j1hhNNwqCPkuwwGmIkQcTAeC5lvO0Ep8BNMZcyfwqph/Lq9O64ceJHdqXbboW0W63MOhBW9Wjo8Q JqVJwy7XQYci4E+GymC16qFjwAGXEHm9ADwSbSsVsaxLse4YuU6W3Nx2/zu+z18DwPw76L5GG//a QMJS9/7jOvdqdzXQ2o3rXhhqMcceujwbKNZrVMaqW9eiLBsZzKIC9ptZvTdrhrVtgrrY6slWvKk2 WP0+GfPtDCapkzj4T8FdIgbQl+rhrcZV4IErKIM6+vR7IVEAvlI4zs1meaj0gVbi0IMJR1FbUGrP 20gaXT73y/Zl92zxlfgCOzJWgjl6W70viRu/obTo/3+NjN8D8WBOWBFM66M/ECuDmgFz2ZRthAAn ZqzwcEAJQpKtT5MNYQlRJNiS1QuUYbKHsu3/mjX/hVTK7URDrBs8FmtISgocQIgfksILAAX/8sgC SqSqqcyZlpwvWOB94b67B9xfBHJcMTTD7F8t4D1kkCLm0ey4Lt1ZrtmhN79UNdxzMk+MBB4zsslG 8dhcyFVQyWi9qLo2CQIDAQABo2MwYTAPBgNVHRMBAf8EBTADAQH/MB0GA1UdDgQWBBR281Xh+qQ2 +/CfXGJx7Tz0RzgQKzAfBgNVHSMEGDAWgBR281Xh+qQ2+/CfXGJx7Tz0RzgQKzAOBgNVHQ8BAf8E BAMCAYYwDQYJKoZIhvcNAQEFBQADggIBAGbBxiPz2eAubl/oz66wsCVNK/g7WJtAJDday6sWSf+z dXkzoS9tcBc0kf5nfo/sm+VegqlVHy/c1FEHEv6sFj4sNcZj/NwQ6w2jqtB8zNHQL1EuxBRa3ugZ 4T7GzKQp5y6EqgYweHZUcyiYWTjgAA1i00J9IZ+uPTqM1fp3DRgrFg5fNuH8KrUwJM/gYwx7WBr+ mbpCErGR9Hxo4sjoryzqyX6uuyo9DRXcNJW2GHSoag/HtPQTxORb7QrSpJdMKu0vbBKJPfEncKpq A1Ihn0CoZ1Dy81of398j9tx4TuaYT1U6U+Pv8vSfx3zYWK8pIpe44L2RLrB27FcRz+8pRPPphXpg Y+RdM4kX2TGq2tbzGDVyz4crL2MjhF2EjD9XoIj8mZEoJmmZ1I+XRL6O1UixpCgp8RW04eWe3fiP pm8m1wk8OhwRDqZsN/etRIcsKMfYdIKz0G9KV7s1KSegi+ghp4dkNl3M2Basx7InQJJVOCiNUW7d FGdTbHFcJoRNdVq2fmBWqU2t+5sel/MN2dKXVHfaPRK34B7vCAas+YWH6aLcr34YEoP9VhdBLtUp gn2Z9DH2canPLAEnpQW5qrJITirvn5NSUZU8UnOOVkwXQMAJKOSLakhT2+zNVVXxxvjpoixMptEm X36vWkzaH6byHCx+rgIW0lbQL1dTR+iS -----END CERTIFICATE----- Visa eCommerce Root =================== -----BEGIN CERTIFICATE----- MIIDojCCAoqgAwIBAgIQE4Y1TR0/BvLB+WUF1ZAcYjANBgkqhkiG9w0BAQUFADBrMQswCQYDVQQG EwJVUzENMAsGA1UEChMEVklTQTEvMC0GA1UECxMmVmlzYSBJbnRlcm5hdGlvbmFsIFNlcnZpY2Ug QXNzb2NpYXRpb24xHDAaBgNVBAMTE1Zpc2EgZUNvbW1lcmNlIFJvb3QwHhcNMDIwNjI2MDIxODM2 WhcNMjIwNjI0MDAxNjEyWjBrMQswCQYDVQQGEwJVUzENMAsGA1UEChMEVklTQTEvMC0GA1UECxMm VmlzYSBJbnRlcm5hdGlvbmFsIFNlcnZpY2UgQXNzb2NpYXRpb24xHDAaBgNVBAMTE1Zpc2EgZUNv bW1lcmNlIFJvb3QwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCvV95WHm6h2mCxlCfL F9sHP4CFT8icttD0b0/Pmdjh28JIXDqsOTPHH2qLJj0rNfVIsZHBAk4ElpF7sDPwsRROEW+1QK8b RaVK7362rPKgH1g/EkZgPI2h4H3PVz4zHvtH8aoVlwdVZqW1LS7YgFmypw23RuwhY/81q6UCzyr0 TP579ZRdhE2o8mCP2w4lPJ9zcc+U30rq299yOIzzlr3xF7zSujtFWsan9sYXiwGd/BmoKoMWuDpI /k4+oKsGGelT84ATB+0tvz8KPFUgOSwsAGl0lUq8ILKpeeUYiZGo3BxN77t+Nwtd/jmliFKMAGzs GHxBvfaLdXe6YJ2E5/4tAgMBAAGjQjBAMA8GA1UdEwEB/wQFMAMBAf8wDgYDVR0PAQH/BAQDAgEG MB0GA1UdDgQWBBQVOIMPPyw/cDMezUb+B4wg4NfDtzANBgkqhkiG9w0BAQUFAAOCAQEAX/FBfXxc CLkr4NWSR/pnXKUTwwMhmytMiUbPWU3J/qVAtmPN3XEolWcRzCSs00Rsca4BIGsDoo8Ytyk6feUW YFN4PMCvFYP3j1IzJL1kk5fui/fbGKhtcbP3LBfQdCVp9/5rPJS+TUtBjE7ic9DjkCJzQ83z7+pz zkWKsKZJ/0x9nXGIxHYdkFsd7v3M9+79YKWxehZx0RbQfBI8bGmX265fOZpwLwU8GUYEmSA20GBu YQa7FkKMcPcw++DbZqMAAb3mLNqRX6BGi01qnD093QVG/na/oAo85ADmJ7f/hC3euiInlhBx6yLt 398znM/jra6O1I7mT1GvFpLgXPYHDw== -----END CERTIFICATE----- Certum Root CA ============== -----BEGIN CERTIFICATE----- MIIDDDCCAfSgAwIBAgIDAQAgMA0GCSqGSIb3DQEBBQUAMD4xCzAJBgNVBAYTAlBMMRswGQYDVQQK ExJVbml6ZXRvIFNwLiB6IG8uby4xEjAQBgNVBAMTCUNlcnR1bSBDQTAeFw0wMjA2MTExMDQ2Mzla Fw0yNzA2MTExMDQ2MzlaMD4xCzAJBgNVBAYTAlBMMRswGQYDVQQKExJVbml6ZXRvIFNwLiB6IG8u by4xEjAQBgNVBAMTCUNlcnR1bSBDQTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAM6x wS7TT3zNJc4YPk/EjG+AanPIW1H4m9LcuwBcsaD8dQPugfCI7iNS6eYVM42sLQnFdvkrOYCJ5JdL kKWoePhzQ3ukYbDYWMzhbGZ+nPMJXlVjhNWo7/OxLjBos8Q82KxujZlakE403Daaj4GIULdtlkIJ 89eVgw1BS7Bqa/j8D35in2fE7SZfECYPCE/wpFcozo+47UX2bu4lXapuOb7kky/ZR6By6/qmW6/K Uz/iDsaWVhFu9+lmqSbYf5VT7QqFiLpPKaVCjF62/IUgAKpoC6EahQGcxEZjgoi2IrHu/qpGWX7P NSzVttpd90gzFFS269lvzs2I1qsb2pY7HVkCAwEAAaMTMBEwDwYDVR0TAQH/BAUwAwEB/zANBgkq hkiG9w0BAQUFAAOCAQEAuI3O7+cUus/usESSbLQ5PqKEbq24IXfS1HeCh+YgQYHu4vgRt2PRFze+ GXYkHAQaTOs9qmdvLdTN/mUxcMUbpgIKumB7bVjCmkn+YzILa+M6wKyrO7Do0wlRjBCDxjTgxSvg GrZgFCdsMneMvLJymM/NzD+5yCRCFNZX/OYmQ6kd5YCQzgNUKD73P9P4Te1qCjqTE5s7FCMTY5w/ 0YcneeVMUeMBrYVdGjux1XMQpNPyvG5k9VpWkKjHDkx0Dy5xO/fIR/RpbxXyEV6DHpx8Uq79AtoS qFlnGNu8cN2bsWntgM6JQEhqDjXKKWYVIZQs6GAqm4VKQPNriiTsBhYscw== -----END CERTIFICATE----- Comodo AAA Services root ======================== -----BEGIN CERTIFICATE----- MIIEMjCCAxqgAwIBAgIBATANBgkqhkiG9w0BAQUFADB7MQswCQYDVQQGEwJHQjEbMBkGA1UECAwS R3JlYXRlciBNYW5jaGVzdGVyMRAwDgYDVQQHDAdTYWxmb3JkMRowGAYDVQQKDBFDb21vZG8gQ0Eg TGltaXRlZDEhMB8GA1UEAwwYQUFBIENlcnRpZmljYXRlIFNlcnZpY2VzMB4XDTA0MDEwMTAwMDAw MFoXDTI4MTIzMTIzNTk1OVowezELMAkGA1UEBhMCR0IxGzAZBgNVBAgMEkdyZWF0ZXIgTWFuY2hl c3RlcjEQMA4GA1UEBwwHU2FsZm9yZDEaMBgGA1UECgwRQ29tb2RvIENBIExpbWl0ZWQxITAfBgNV BAMMGEFBQSBDZXJ0aWZpY2F0ZSBTZXJ2aWNlczCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoC ggEBAL5AnfRu4ep2hxxNRUSOvkbIgwadwSr+GB+O5AL686tdUIoWMQuaBtDFcCLNSS1UY8y2bmhG C1Pqy0wkwLxyTurxFa70VJoSCsN6sjNg4tqJVfMiWPPe3M/vg4aijJRPn2jymJBGhCfHdr/jzDUs i14HZGWCwEiwqJH5YZ92IFCokcdmtet4YgNW8IoaE+oxox6gmf049vYnMlhvB/VruPsUK6+3qszW Y19zjNoFmag4qMsXeDZRrOme9Hg6jc8P2ULimAyrL58OAd7vn5lJ8S3frHRNG5i1R8XlKdH5kBjH Ypy+g8cmez6KJcfA3Z3mNWgQIJ2P2N7Sw4ScDV7oL8kCAwEAAaOBwDCBvTAdBgNVHQ4EFgQUoBEK Iz6W8Qfs4q8p74Klf9AwpLQwDgYDVR0PAQH/BAQDAgEGMA8GA1UdEwEB/wQFMAMBAf8wewYDVR0f BHQwcjA4oDagNIYyaHR0cDovL2NybC5jb21vZG9jYS5jb20vQUFBQ2VydGlmaWNhdGVTZXJ2aWNl cy5jcmwwNqA0oDKGMGh0dHA6Ly9jcmwuY29tb2RvLm5ldC9BQUFDZXJ0aWZpY2F0ZVNlcnZpY2Vz LmNybDANBgkqhkiG9w0BAQUFAAOCAQEACFb8AvCb6P+k+tZ7xkSAzk/ExfYAWMymtrwUSWgEdujm 7l3sAg9g1o1QGE8mTgHj5rCl7r+8dFRBv/38ErjHT1r0iWAFf2C3BUrz9vHCv8S5dIa2LX1rzNLz Rt0vxuBqw8M0Ayx9lt1awg6nCpnBBYurDC/zXDrPbDdVCYfeU0BsWO/8tqtlbgT2G9w84FoVxp7Z 8VlIMCFlA2zs6SFz7JsDoeA3raAVGI/6ugLOpyypEBMs1OUIJqsil2D4kF501KKaU73yqWjgom7C 12yxow+ev+to51byrvLjKzg6CYG1a4XXvi3tPxq3smPi9WIsgtRqAEFQ8TmDn5XpNpaYbg== -----END CERTIFICATE----- Comodo Secure Services root =========================== -----BEGIN CERTIFICATE----- MIIEPzCCAyegAwIBAgIBATANBgkqhkiG9w0BAQUFADB+MQswCQYDVQQGEwJHQjEbMBkGA1UECAwS R3JlYXRlciBNYW5jaGVzdGVyMRAwDgYDVQQHDAdTYWxmb3JkMRowGAYDVQQKDBFDb21vZG8gQ0Eg TGltaXRlZDEkMCIGA1UEAwwbU2VjdXJlIENlcnRpZmljYXRlIFNlcnZpY2VzMB4XDTA0MDEwMTAw MDAwMFoXDTI4MTIzMTIzNTk1OVowfjELMAkGA1UEBhMCR0IxGzAZBgNVBAgMEkdyZWF0ZXIgTWFu Y2hlc3RlcjEQMA4GA1UEBwwHU2FsZm9yZDEaMBgGA1UECgwRQ29tb2RvIENBIExpbWl0ZWQxJDAi BgNVBAMMG1NlY3VyZSBDZXJ0aWZpY2F0ZSBTZXJ2aWNlczCCASIwDQYJKoZIhvcNAQEBBQADggEP ADCCAQoCggEBAMBxM4KK0HDrc4eCQNUd5MvJDkKQ+d40uaG6EfQlhfPMcm3ye5drswfxdySRXyWP 9nQ95IDC+DwN879A6vfIUtFyb+/Iq0G4bi4XKpVpDM3SHpR7LZQdqnXXs5jLrLxkU0C8j6ysNstc rbvd4JQX7NFc0L/vpZXJkMWwrPsbQ996CF23uPJAGysnnlDOXmWCiIxe004MeuoIkbY2qitC++rC oznl2yY4rYsK7hljxxwk3wN42ubqwUcaCwtGCd0C/N7Lh1/XMGNooa7cMqG6vv5Eq2i2pRcV/b3V p6ea5EQz6YiO/O1R65NxTq0B50SOqy3LqP4BSUjwwN3HaNiS/j0CAwEAAaOBxzCBxDAdBgNVHQ4E FgQUPNiTiMLAggnMAZkGkyDpnnAJY08wDgYDVR0PAQH/BAQDAgEGMA8GA1UdEwEB/wQFMAMBAf8w gYEGA1UdHwR6MHgwO6A5oDeGNWh0dHA6Ly9jcmwuY29tb2RvY2EuY29tL1NlY3VyZUNlcnRpZmlj YXRlU2VydmljZXMuY3JsMDmgN6A1hjNodHRwOi8vY3JsLmNvbW9kby5uZXQvU2VjdXJlQ2VydGlm aWNhdGVTZXJ2aWNlcy5jcmwwDQYJKoZIhvcNAQEFBQADggEBAIcBbSMdflsXfcFhMs+P5/OKlFlm 4J4oqF7Tt/Q05qo5spcWxYJvMqTpjOev/e/C6LlLqqP05tqNZSH7uoDrJiiFGv45jN5bBAS0VPmj Z55B+glSzAVIqMk/IQQezkhr/IXownuvf7fM+F86/TXGDe+X3EyrEeFryzHRbPtIgKvcnDe4IRRL DXE97IMzbtFuMhbsmMcWi1mmNKsFVy2T96oTy9IT4rcuO81rUBcJaD61JlfutuC23bkpgHl9j6Pw pCikFcSF9CfUa7/lXORlAnZUtOM3ZiTTGWHIUhDlizeauan5Hb/qmZJhlv8BzaFfDbxxvA6sCx1H RR3B7Hzs/Sk= -----END CERTIFICATE----- Comodo Trusted Services root ============================ -----BEGIN CERTIFICATE----- MIIEQzCCAyugAwIBAgIBATANBgkqhkiG9w0BAQUFADB/MQswCQYDVQQGEwJHQjEbMBkGA1UECAwS R3JlYXRlciBNYW5jaGVzdGVyMRAwDgYDVQQHDAdTYWxmb3JkMRowGAYDVQQKDBFDb21vZG8gQ0Eg TGltaXRlZDElMCMGA1UEAwwcVHJ1c3RlZCBDZXJ0aWZpY2F0ZSBTZXJ2aWNlczAeFw0wNDAxMDEw MDAwMDBaFw0yODEyMzEyMzU5NTlaMH8xCzAJBgNVBAYTAkdCMRswGQYDVQQIDBJHcmVhdGVyIE1h bmNoZXN0ZXIxEDAOBgNVBAcMB1NhbGZvcmQxGjAYBgNVBAoMEUNvbW9kbyBDQSBMaW1pdGVkMSUw IwYDVQQDDBxUcnVzdGVkIENlcnRpZmljYXRlIFNlcnZpY2VzMIIBIjANBgkqhkiG9w0BAQEFAAOC AQ8AMIIBCgKCAQEA33FvNlhTWvI2VFeAxHQIIO0Yfyod5jWaHiWsnOWWfnJSoBVC21ndZHoa0Lh7 3TkVvFVIxO06AOoxEbrycXQaZ7jPM8yoMa+j49d/vzMtTGo87IvDktJTdyR0nAducPy9C1t2ul/y /9c3S0pgePfw+spwtOpZqqPOSC+pw7ILfhdyFgymBwwbOM/JYrc/oJOlh0Hyt3BAd9i+FHzjqMB6 juljatEPmsbS9Is6FARW1O24zG71++IsWL1/T2sr92AkWCTOJu80kTrV44HQsvAEAtdbtz6SrGsS ivnkBbA7kUlcsutT6vifR4buv5XAwAaf0lteERv0xwQ1KdJVXOTt6wIDAQABo4HJMIHGMB0GA1Ud DgQWBBTFe1i97doladL3WRaoszLAeydb9DAOBgNVHQ8BAf8EBAMCAQYwDwYDVR0TAQH/BAUwAwEB /zCBgwYDVR0fBHwwejA8oDqgOIY2aHR0cDovL2NybC5jb21vZG9jYS5jb20vVHJ1c3RlZENlcnRp ZmljYXRlU2VydmljZXMuY3JsMDqgOKA2hjRodHRwOi8vY3JsLmNvbW9kby5uZXQvVHJ1c3RlZENl cnRpZmljYXRlU2VydmljZXMuY3JsMA0GCSqGSIb3DQEBBQUAA4IBAQDIk4E7ibSvuIQSTI3S8Ntw uleGFTQQuS9/HrCoiWChisJ3DFBKmwCL2Iv0QeLQg4pKHBQGsKNoBXAxMKdTmw7pSqBYaWcOrp32 pSxBvzwGa+RZzG0Q8ZZvH9/0BAKkn0U+yNj6NkZEUD+Cl5EfKNsYEYwq5GWDVxISjBc/lDb+XbDA BHcTuPQV1T84zJQ6VdCsmPW6AF/ghhmBeC8owH7TzEIK9a5QoNE+xqFx7D+gIIxmOom0jtTYsU0l R+4viMi14QVFwL4Ucd56/Y57fU0IlqUSc/AtyjcndBInTMu2l+nZrghtWjlA3QVHdWpaIbOjGM9O 9y5Xt5hwXsjEeLBi -----END CERTIFICATE----- QuoVadis Root CA ================ -----BEGIN CERTIFICATE----- MIIF0DCCBLigAwIBAgIEOrZQizANBgkqhkiG9w0BAQUFADB/MQswCQYDVQQGEwJCTTEZMBcGA1UE ChMQUXVvVmFkaXMgTGltaXRlZDElMCMGA1UECxMcUm9vdCBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0 eTEuMCwGA1UEAxMlUXVvVmFkaXMgUm9vdCBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTAeFw0wMTAz MTkxODMzMzNaFw0yMTAzMTcxODMzMzNaMH8xCzAJBgNVBAYTAkJNMRkwFwYDVQQKExBRdW9WYWRp cyBMaW1pdGVkMSUwIwYDVQQLExxSb290IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MS4wLAYDVQQD EyVRdW9WYWRpcyBSb290IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MIIBIjANBgkqhkiG9w0BAQEF AAOCAQ8AMIIBCgKCAQEAv2G1lVO6V/z68mcLOhrfEYBklbTRvM16z/Ypli4kVEAkOPcahdxYTMuk J0KX0J+DisPkBgNbAKVRHnAEdOLB1Dqr1607BxgFjv2DrOpm2RgbaIr1VxqYuvXtdj182d6UajtL F8HVj71lODqV0D1VNk7feVcxKh7YWWVJWCCYfqtffp/p1k3sg3Spx2zY7ilKhSoGFPlU5tPaZQeL YzcS19Dsw3sgQUSj7cugF+FxZc4dZjH3dgEZyH0DWLaVSR2mEiboxgx24ONmy+pdpibu5cxfvWen AScOospUxbF6lR1xHkopigPcakXBpBlebzbNw6Kwt/5cOOJSvPhEQ+aQuwIDAQABo4ICUjCCAk4w PQYIKwYBBQUHAQEEMTAvMC0GCCsGAQUFBzABhiFodHRwczovL29jc3AucXVvdmFkaXNvZmZzaG9y ZS5jb20wDwYDVR0TAQH/BAUwAwEB/zCCARoGA1UdIASCAREwggENMIIBCQYJKwYBBAG+WAABMIH7 MIHUBggrBgEFBQcCAjCBxxqBxFJlbGlhbmNlIG9uIHRoZSBRdW9WYWRpcyBSb290IENlcnRpZmlj YXRlIGJ5IGFueSBwYXJ0eSBhc3N1bWVzIGFjY2VwdGFuY2Ugb2YgdGhlIHRoZW4gYXBwbGljYWJs ZSBzdGFuZGFyZCB0ZXJtcyBhbmQgY29uZGl0aW9ucyBvZiB1c2UsIGNlcnRpZmljYXRpb24gcHJh Y3RpY2VzLCBhbmQgdGhlIFF1b1ZhZGlzIENlcnRpZmljYXRlIFBvbGljeS4wIgYIKwYBBQUHAgEW Fmh0dHA6Ly93d3cucXVvdmFkaXMuYm0wHQYDVR0OBBYEFItLbe3TKbkGGew5Oanwl4Rqy+/fMIGu BgNVHSMEgaYwgaOAFItLbe3TKbkGGew5Oanwl4Rqy+/foYGEpIGBMH8xCzAJBgNVBAYTAkJNMRkw FwYDVQQKExBRdW9WYWRpcyBMaW1pdGVkMSUwIwYDVQQLExxSb290IENlcnRpZmljYXRpb24gQXV0 aG9yaXR5MS4wLAYDVQQDEyVRdW9WYWRpcyBSb290IENlcnRpZmljYXRpb24gQXV0aG9yaXR5ggQ6 tlCLMA4GA1UdDwEB/wQEAwIBBjANBgkqhkiG9w0BAQUFAAOCAQEAitQUtf70mpKnGdSkfnIYj9lo fFIk3WdvOXrEql494liwTXCYhGHoG+NpGA7O+0dQoE7/8CQfvbLO9Sf87C9TqnN7Az10buYWnuul LsS/VidQK2K6vkscPFVcQR0kvoIgR13VRH56FmjffU1RcHhXHTMe/QKZnAzNCgVPx7uOpHX6Sm2x gI4JVrmcGmD+XcHXetwReNDWXcG31a0ymQM6isxUJTkxgXsTIlG6Rmyhu576BGxJJnSP0nPrzDCi 5upZIof4l/UO/erMkqQWxFIY6iHOsfHmhIHluqmGKPJDWl0Snawe2ajlCmqnf6CHKc/yiU3U7MXi 5nrQNiOKSnQ2+Q== -----END CERTIFICATE----- QuoVadis Root CA 2 ================== -----BEGIN CERTIFICATE----- MIIFtzCCA5+gAwIBAgICBQkwDQYJKoZIhvcNAQEFBQAwRTELMAkGA1UEBhMCQk0xGTAXBgNVBAoT EFF1b1ZhZGlzIExpbWl0ZWQxGzAZBgNVBAMTElF1b1ZhZGlzIFJvb3QgQ0EgMjAeFw0wNjExMjQx ODI3MDBaFw0zMTExMjQxODIzMzNaMEUxCzAJBgNVBAYTAkJNMRkwFwYDVQQKExBRdW9WYWRpcyBM aW1pdGVkMRswGQYDVQQDExJRdW9WYWRpcyBSb290IENBIDIwggIiMA0GCSqGSIb3DQEBAQUAA4IC DwAwggIKAoICAQCaGMpLlA0ALa8DKYrwD4HIrkwZhR0In6spRIXzL4GtMh6QRr+jhiYaHv5+HBg6 XJxgFyo6dIMzMH1hVBHL7avg5tKifvVrbxi3Cgst/ek+7wrGsxDp3MJGF/hd/aTa/55JWpzmM+Yk lvc/ulsrHHo1wtZn/qtmUIttKGAr79dgw8eTvI02kfN/+NsRE8Scd3bBrrcCaoF6qUWD4gXmuVbB lDePSHFjIuwXZQeVikvfj8ZaCuWw419eaxGrDPmF60Tp+ARz8un+XJiM9XOva7R+zdRcAitMOeGy lZUtQofX1bOQQ7dsE/He3fbE+Ik/0XX1ksOR1YqI0JDs3G3eicJlcZaLDQP9nL9bFqyS2+r+eXyt 66/3FsvbzSUr5R/7mp/iUcw6UwxI5g69ybR2BlLmEROFcmMDBOAENisgGQLodKcftslWZvB1Jdxn wQ5hYIizPtGo/KPaHbDRsSNU30R2be1B2MGyIrZTHN81Hdyhdyox5C315eXbyOD/5YDXC2Og/zOh D7osFRXql7PSorW+8oyWHhqPHWykYTe5hnMz15eWniN9gqRMgeKh0bpnX5UHoycR7hYQe7xFSkyy BNKr79X9DFHOUGoIMfmR2gyPZFwDwzqLID9ujWc9Otb+fVuIyV77zGHcizN300QyNQliBJIWENie J0f7OyHj+OsdWwIDAQABo4GwMIGtMA8GA1UdEwEB/wQFMAMBAf8wCwYDVR0PBAQDAgEGMB0GA1Ud DgQWBBQahGK8SEwzJQTU7tD2A8QZRtGUazBuBgNVHSMEZzBlgBQahGK8SEwzJQTU7tD2A8QZRtGU a6FJpEcwRTELMAkGA1UEBhMCQk0xGTAXBgNVBAoTEFF1b1ZhZGlzIExpbWl0ZWQxGzAZBgNVBAMT ElF1b1ZhZGlzIFJvb3QgQ0EgMoICBQkwDQYJKoZIhvcNAQEFBQADggIBAD4KFk2fBluornFdLwUv Z+YTRYPENvbzwCYMDbVHZF34tHLJRqUDGCdViXh9duqWNIAXINzng/iN/Ae42l9NLmeyhP3ZRPx3 UIHmfLTJDQtyU/h2BwdBR5YM++CCJpNVjP4iH2BlfF/nJrP3MpCYUNQ3cVX2kiF495V5+vgtJodm VjB3pjd4M1IQWK4/YY7yarHvGH5KWWPKjaJW1acvvFYfzznB4vsKqBUsfU16Y8Zsl0Q80m/DShcK +JDSV6IZUaUtl0HaB0+pUNqQjZRG4T7wlP0QADj1O+hA4bRuVhogzG9Yje0uRY/W6ZM/57Es3zrW IozchLsib9D45MY56QSIPMO661V6bYCZJPVsAfv4l7CUW+v90m/xd2gNNWQjrLhVoQPRTUIZ3Ph1 WVaj+ahJefivDrkRoHy3au000LYmYjgahwz46P0u05B/B5EqHdZ+XIWDmbA4CD/pXvk1B+TJYm5X f6dQlfe6yJvmjqIBxdZmv3lh8zwc4bmCXF2gw+nYSL0ZohEUGW6yhhtoPkg3Goi3XZZenMfvJ2II 4pEZXNLxId26F0KCl3GBUzGpn/Z9Yr9y4aOTHcyKJloJONDO1w2AFrR4pTqHTI2KpdVGl/IsELm8 VCLAAVBpQ570su9t+Oza8eOx79+Rj1QqCyXBJhnEUhAFZdWCEOrCMc0u -----END CERTIFICATE----- QuoVadis Root CA 3 ================== -----BEGIN CERTIFICATE----- MIIGnTCCBIWgAwIBAgICBcYwDQYJKoZIhvcNAQEFBQAwRTELMAkGA1UEBhMCQk0xGTAXBgNVBAoT EFF1b1ZhZGlzIExpbWl0ZWQxGzAZBgNVBAMTElF1b1ZhZGlzIFJvb3QgQ0EgMzAeFw0wNjExMjQx OTExMjNaFw0zMTExMjQxOTA2NDRaMEUxCzAJBgNVBAYTAkJNMRkwFwYDVQQKExBRdW9WYWRpcyBM aW1pdGVkMRswGQYDVQQDExJRdW9WYWRpcyBSb290IENBIDMwggIiMA0GCSqGSIb3DQEBAQUAA4IC DwAwggIKAoICAQDMV0IWVJzmmNPTTe7+7cefQzlKZbPoFog02w1ZkXTPkrgEQK0CSzGrvI2RaNgg DhoB4hp7Thdd4oq3P5kazethq8Jlph+3t723j/z9cI8LoGe+AaJZz3HmDyl2/7FWeUUrH556VOij KTVopAFPD6QuN+8bv+OPEKhyq1hX51SGyMnzW9os2l2ObjyjPtr7guXd8lyyBTNvijbO0BNO/79K DDRMpsMhvVAEVeuxu537RR5kFd5VAYwCdrXLoT9CabwvvWhDFlaJKjdhkf2mrk7AyxRllDdLkgbv BNDInIjbC3uBr7E9KsRlOni27tyAsdLTmZw67mtaa7ONt9XOnMK+pUsvFrGeaDsGb659n/je7Mwp p5ijJUMv7/FfJuGITfhebtfZFG4ZM2mnO4SJk8RTVROhUXhA+LjJou57ulJCg54U7QVSWllWp5f8 nT8KKdjcT5EOE7zelaTfi5m+rJsziO+1ga8bxiJTyPbH7pcUsMV8eFLI8M5ud2CEpukqdiDtWAEX MJPpGovgc2PZapKUSU60rUqFxKMiMPwJ7Wgic6aIDFUhWMXhOp8q3crhkODZc6tsgLjoC2SToJyM Gf+z0gzskSaHirOi4XCPLArlzW1oUevaPwV/izLmE1xr/l9A4iLItLRkT9a6fUg+qGkM17uGcclz uD87nSVL2v9A6wIDAQABo4IBlTCCAZEwDwYDVR0TAQH/BAUwAwEB/zCB4QYDVR0gBIHZMIHWMIHT BgkrBgEEAb5YAAMwgcUwgZMGCCsGAQUFBwICMIGGGoGDQW55IHVzZSBvZiB0aGlzIENlcnRpZmlj YXRlIGNvbnN0aXR1dGVzIGFjY2VwdGFuY2Ugb2YgdGhlIFF1b1ZhZGlzIFJvb3QgQ0EgMyBDZXJ0 aWZpY2F0ZSBQb2xpY3kgLyBDZXJ0aWZpY2F0aW9uIFByYWN0aWNlIFN0YXRlbWVudC4wLQYIKwYB BQUHAgEWIWh0dHA6Ly93d3cucXVvdmFkaXNnbG9iYWwuY29tL2NwczALBgNVHQ8EBAMCAQYwHQYD VR0OBBYEFPLAE+CCQz777i9nMpY1XNu4ywLQMG4GA1UdIwRnMGWAFPLAE+CCQz777i9nMpY1XNu4 ywLQoUmkRzBFMQswCQYDVQQGEwJCTTEZMBcGA1UEChMQUXVvVmFkaXMgTGltaXRlZDEbMBkGA1UE AxMSUXVvVmFkaXMgUm9vdCBDQSAzggIFxjANBgkqhkiG9w0BAQUFAAOCAgEAT62gLEz6wPJv92ZV qyM07ucp2sNbtrCD2dDQ4iH782CnO11gUyeim/YIIirnv6By5ZwkajGxkHon24QRiSemd1o417+s hvzuXYO8BsbRd2sPbSQvS3pspweWyuOEn62Iix2rFo1bZhfZFvSLgNLd+LJ2w/w4E6oM3kJpK27z POuAJ9v1pkQNn1pVWQvVDVJIxa6f8i+AxeoyUDUSly7B4f/xI4hROJ/yZlZ25w9Rl6VSDE1JUZU2 Pb+iSwwQHYaZTKrzchGT5Or2m9qoXadNt54CrnMAyNojA+j56hl0YgCUyyIgvpSnWbWCar6ZeXqp 8kokUvd0/bpO5qgdAm6xDYBEwa7TIzdfu4V8K5Iu6H6li92Z4b8nby1dqnuH/grdS/yO9SbkbnBC bjPsMZ57k8HkyWkaPcBrTiJt7qtYTcbQQcEr6k8Sh17rRdhs9ZgC06DYVYoGmRmioHfRMJ6szHXu g/WwYjnPbFfiTNKRCw51KBuav/0aQ/HKd/s7j2G4aSgWQgRecCocIdiP4b0jWy10QJLZYxkNc91p vGJHvOB0K7Lrfb5BG7XARsWhIstfTsEokt4YutUqKLsRixeTmJlglFwjz1onl14LBQaTNx47aTbr qZ5hHY8y2o4M1nQ+ewkk2gF3R8Q7zTSMmfXK4SVhM7JZG+Ju1zdXtg2pEto= -----END CERTIFICATE----- Security Communication Root CA ============================== -----BEGIN CERTIFICATE----- MIIDWjCCAkKgAwIBAgIBADANBgkqhkiG9w0BAQUFADBQMQswCQYDVQQGEwJKUDEYMBYGA1UEChMP U0VDT00gVHJ1c3QubmV0MScwJQYDVQQLEx5TZWN1cml0eSBDb21tdW5pY2F0aW9uIFJvb3RDQTEw HhcNMDMwOTMwMDQyMDQ5WhcNMjMwOTMwMDQyMDQ5WjBQMQswCQYDVQQGEwJKUDEYMBYGA1UEChMP U0VDT00gVHJ1c3QubmV0MScwJQYDVQQLEx5TZWN1cml0eSBDb21tdW5pY2F0aW9uIFJvb3RDQTEw ggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCzs/5/022x7xZ8V6UMbXaKL0u/ZPtM7orw 8yl89f/uKuDp6bpbZCKamm8sOiZpUQWZJtzVHGpxxpp9Hp3dfGzGjGdnSj74cbAZJ6kJDKaVv0uM DPpVmDvY6CKhS3E4eayXkmmziX7qIWgGmBSWh9JhNrxtJ1aeV+7AwFb9Ms+k2Y7CI9eNqPPYJayX 5HA49LY6tJ07lyZDo6G8SVlyTCMwhwFY9k6+HGhWZq/NQV3Is00qVUarH9oe4kA92819uZKAnDfd DJZkndwi92SL32HeFZRSFaB9UslLqCHJxrHty8OVYNEP8Ktw+N/LTX7s1vqr2b1/VPKl6Xn62dZ2 JChzAgMBAAGjPzA9MB0GA1UdDgQWBBSgc0mZaNyFW2XjmygvV5+9M7wHSDALBgNVHQ8EBAMCAQYw DwYDVR0TAQH/BAUwAwEB/zANBgkqhkiG9w0BAQUFAAOCAQEAaECpqLvkT115swW1F7NgE+vGkl3g 0dNq/vu+m22/xwVtWSDEHPC32oRYAmP6SBbvT6UL90qY8j+eG61Ha2POCEfrUj94nK9NrvjVT8+a mCoQQTlSxN3Zmw7vkwGusi7KaEIkQmywszo+zenaSMQVy+n5Bw+SUEmK3TGXX8npN6o7WWWXlDLJ s58+OmJYxUmtYg5xpTKqL8aJdkNAExNnPaJUJRDL8Try2frbSVa7pv6nQTXD4IhhyYjH3zYQIphZ 6rBK+1YWc26sTfcioU+tHXotRSflMMFe8toTyyVCUZVHA4xsIcx0Qu1T/zOLjw9XARYvz6buyXAi FL39vmwLAw== -----END CERTIFICATE----- Sonera Class 2 Root CA ====================== -----BEGIN CERTIFICATE----- MIIDIDCCAgigAwIBAgIBHTANBgkqhkiG9w0BAQUFADA5MQswCQYDVQQGEwJGSTEPMA0GA1UEChMG U29uZXJhMRkwFwYDVQQDExBTb25lcmEgQ2xhc3MyIENBMB4XDTAxMDQwNjA3Mjk0MFoXDTIxMDQw NjA3Mjk0MFowOTELMAkGA1UEBhMCRkkxDzANBgNVBAoTBlNvbmVyYTEZMBcGA1UEAxMQU29uZXJh IENsYXNzMiBDQTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAJAXSjWdyvANlsdE+hY3 /Ei9vX+ALTU74W+oZ6m/AxxNjG8yR9VBaKQTBME1DJqEQ/xcHf+Js+gXGM2RX/uJ4+q/Tl18GybT dXnt5oTjV+WtKcT0OijnpXuENmmz/V52vaMtmdOQTiMofRhj8VQ7Jp12W5dCsv+u8E7s3TmVToMG f+dJQMjFAbJUWmYdPfz56TwKnoG4cPABi+QjVHzIrviQHgCWctRUz2EjvOr7nQKV0ba5cTppCD8P tOFCx4j1P5iop7oc4HFx71hXgVB6XGt0Rg6DA5jDjqhu8nYybieDwnPz3BjotJPqdURrBGAgcVeH nfO+oJAjPYok4doh28MCAwEAAaMzMDEwDwYDVR0TAQH/BAUwAwEB/zARBgNVHQ4ECgQISqCqWITT XjwwCwYDVR0PBAQDAgEGMA0GCSqGSIb3DQEBBQUAA4IBAQBazof5FnIVV0sd2ZvnoiYw7JNn39Yt 0jSv9zilzqsWuasvfDXLrNAPtEwr/IDva4yRXzZ299uzGxnq9LIR/WFxRL8oszodv7ND6J+/3DEI cbCdjdY0RzKQxmUk96BKfARzjzlvF4xytb1LyHr4e4PDKE6cCepnP7JnBBvDFNr450kkkdAdavph Oe9r5yF1BgfYErQhIHBCcYHaPJo2vqZbDWpsmh+Re/n570K6Tk6ezAyNlNzZRZxe7EJQY670XcSx EtzKO6gunRRaBXW37Ndj4ro1tgQIkejanZz2ZrUYrAqmVCY0M9IbwdR/GjqOC6oybtv8TyWf2TLH llpwrN9M -----END CERTIFICATE----- Staat der Nederlanden Root CA ============================= -----BEGIN CERTIFICATE----- MIIDujCCAqKgAwIBAgIEAJiWijANBgkqhkiG9w0BAQUFADBVMQswCQYDVQQGEwJOTDEeMBwGA1UE ChMVU3RhYXQgZGVyIE5lZGVybGFuZGVuMSYwJAYDVQQDEx1TdGFhdCBkZXIgTmVkZXJsYW5kZW4g Um9vdCBDQTAeFw0wMjEyMTcwOTIzNDlaFw0xNTEyMTYwOTE1MzhaMFUxCzAJBgNVBAYTAk5MMR4w HAYDVQQKExVTdGFhdCBkZXIgTmVkZXJsYW5kZW4xJjAkBgNVBAMTHVN0YWF0IGRlciBOZWRlcmxh bmRlbiBSb290IENBMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAmNK1URF6gaYUmHFt vsznExvWJw56s2oYHLZhWtVhCb/ekBPHZ+7d89rFDBKeNVU+LCeIQGv33N0iYfXCxw719tV2U02P jLwYdjeFnejKScfST5gTCaI+Ioicf9byEGW07l8Y1Rfj+MX94p2i71MOhXeiD+EwR+4A5zN9RGca C1Hoi6CeUJhoNFIfLm0B8mBF8jHrqTFoKbt6QZ7GGX+UtFE5A3+y3qcym7RHjm+0Sq7lr7HcsBth vJly3uSJt3omXdozSVtSnA71iq3DuD3oBmrC1SoLbHuEvVYFy4ZlkuxEK7COudxwC0barbxjiDn6 22r+I/q85Ej0ZytqERAhSQIDAQABo4GRMIGOMAwGA1UdEwQFMAMBAf8wTwYDVR0gBEgwRjBEBgRV HSAAMDwwOgYIKwYBBQUHAgEWLmh0dHA6Ly93d3cucGtpb3ZlcmhlaWQubmwvcG9saWNpZXMvcm9v dC1wb2xpY3kwDgYDVR0PAQH/BAQDAgEGMB0GA1UdDgQWBBSofeu8Y6R0E3QA7Jbg0zTBLL9s+DAN BgkqhkiG9w0BAQUFAAOCAQEABYSHVXQ2YcG70dTGFagTtJ+k/rvuFbQvBgwp8qiSpGEN/KtcCFtR EytNwiphyPgJWPwtArI5fZlmgb9uXJVFIGzmeafR2Bwp/MIgJ1HI8XxdNGdphREwxgDS1/PTfLbw MVcoEoJz6TMvplW0C5GUR5z6u3pCMuiufi3IvKwUv9kP2Vv8wfl6leF9fpb8cbDCTMjfRTTJzg3y nGQI0DvDKcWy7ZAEwbEpkcUwb8GpcjPM/l0WFywRaed+/sWDCN+83CI6LiBpIzlWYGeQiy52OfsR iJf2fL1LuCAWZwWN4jvBcj+UlTfHXbme2JOhF4//DGYVwSR8MnwDHTuhWEUykw== -----END CERTIFICATE----- UTN DATACorp SGC Root CA ======================== -----BEGIN CERTIFICATE----- MIIEXjCCA0agAwIBAgIQRL4Mi1AAIbQR0ypoBqmtaTANBgkqhkiG9w0BAQUFADCBkzELMAkGA1UE BhMCVVMxCzAJBgNVBAgTAlVUMRcwFQYDVQQHEw5TYWx0IExha2UgQ2l0eTEeMBwGA1UEChMVVGhl IFVTRVJUUlVTVCBOZXR3b3JrMSEwHwYDVQQLExhodHRwOi8vd3d3LnVzZXJ0cnVzdC5jb20xGzAZ BgNVBAMTElVUTiAtIERBVEFDb3JwIFNHQzAeFw05OTA2MjQxODU3MjFaFw0xOTA2MjQxOTA2MzBa MIGTMQswCQYDVQQGEwJVUzELMAkGA1UECBMCVVQxFzAVBgNVBAcTDlNhbHQgTGFrZSBDaXR5MR4w HAYDVQQKExVUaGUgVVNFUlRSVVNUIE5ldHdvcmsxITAfBgNVBAsTGGh0dHA6Ly93d3cudXNlcnRy dXN0LmNvbTEbMBkGA1UEAxMSVVROIC0gREFUQUNvcnAgU0dDMIIBIjANBgkqhkiG9w0BAQEFAAOC AQ8AMIIBCgKCAQEA3+5YEKIrblXEjr8uRgnn4AgPLit6E5Qbvfa2gI5lBZMAHryv4g+OGQ0SR+ys raP6LnD43m77VkIVni5c7yPeIbkFdicZD0/Ww5y0vpQZY/KmEQrrU0icvvIpOxboGqBMpsn0GFlo wHDyUwDAXlCCpVZvNvlK4ESGoE1O1kduSUrLZ9emxAW5jh70/P/N5zbgnAVssjMiFdC04MwXwLLA 9P4yPykqlXvY8qdOD1R8oQ2AswkDwf9c3V6aPryuvEeKaq5xyh+xKrhfQgUL7EYw0XILyulWbfXv 33i+Ybqypa4ETLyorGkVl73v67SMvzX41MPRKA5cOp9wGDMgd8SirwIDAQABo4GrMIGoMAsGA1Ud DwQEAwIBxjAPBgNVHRMBAf8EBTADAQH/MB0GA1UdDgQWBBRTMtGzz3/64PGgXYVOktKeRR20TzA9 BgNVHR8ENjA0MDKgMKAuhixodHRwOi8vY3JsLnVzZXJ0cnVzdC5jb20vVVROLURBVEFDb3JwU0dD LmNybDAqBgNVHSUEIzAhBggrBgEFBQcDAQYKKwYBBAGCNwoDAwYJYIZIAYb4QgQBMA0GCSqGSIb3 DQEBBQUAA4IBAQAnNZcAiosovcYzMB4p/OL31ZjUQLtgyr+rFywJNn9Q+kHcrpY6CiM+iVnJowft Gzet/Hy+UUla3joKVAgWRcKZsYfNjGjgaQPpxE6YsjuMFrMOoAyYUJuTqXAJyCyjj98C5OBxOvG0 I3KgqgHf35g+FFCgMSa9KOlaMCZ1+XtgHI3zzVAmbQQnmt/VDUVHKWss5nbZqSl9Mt3JNjy9rjXx EZ4du5A/EkdOjtd+D2JzHVImOBwYSf0wdJrE5SIv2MCN7ZF6TACPcn9d2t0bi0Vr591pl6jFVkwP DPafepE39peC4N1xaf92P2BNPM/3mfnGV/TJVTl4uix5yaaIK/QI -----END CERTIFICATE----- UTN USERFirst Hardware Root CA ============================== -----BEGIN CERTIFICATE----- MIIEdDCCA1ygAwIBAgIQRL4Mi1AAJLQR0zYq/mUK/TANBgkqhkiG9w0BAQUFADCBlzELMAkGA1UE BhMCVVMxCzAJBgNVBAgTAlVUMRcwFQYDVQQHEw5TYWx0IExha2UgQ2l0eTEeMBwGA1UEChMVVGhl IFVTRVJUUlVTVCBOZXR3b3JrMSEwHwYDVQQLExhodHRwOi8vd3d3LnVzZXJ0cnVzdC5jb20xHzAd BgNVBAMTFlVUTi1VU0VSRmlyc3QtSGFyZHdhcmUwHhcNOTkwNzA5MTgxMDQyWhcNMTkwNzA5MTgx OTIyWjCBlzELMAkGA1UEBhMCVVMxCzAJBgNVBAgTAlVUMRcwFQYDVQQHEw5TYWx0IExha2UgQ2l0 eTEeMBwGA1UEChMVVGhlIFVTRVJUUlVTVCBOZXR3b3JrMSEwHwYDVQQLExhodHRwOi8vd3d3LnVz ZXJ0cnVzdC5jb20xHzAdBgNVBAMTFlVUTi1VU0VSRmlyc3QtSGFyZHdhcmUwggEiMA0GCSqGSIb3 DQEBAQUAA4IBDwAwggEKAoIBAQCx98M4P7Sof885glFn0G2f0v9Y8+efK+wNiVSZuTiZFvfgIXlI wrthdBKWHTxqctU8EGc6Oe0rE81m65UJM6Rsl7HoxuzBdXmcRl6Nq9Bq/bkqVRcQVLMZ8Jr28bFd tqdt++BxF2uiiPsA3/4aMXcMmgF6sTLjKwEHOG7DpV4jvEWbe1DByTCP2+UretNb+zNAHqDVmBe8 i4fDidNdoI6yqqr2jmmIBsX6iSHzCJ1pLgkzmykNRg+MzEk0sGlRvfkGzWitZky8PqxhvQqIDsjf Pe58BEydCl5rkdbux+0ojatNh4lz0G6k0B4WixThdkQDf2Os5M1JnMWS9KsyoUhbAgMBAAGjgbkw gbYwCwYDVR0PBAQDAgHGMA8GA1UdEwEB/wQFMAMBAf8wHQYDVR0OBBYEFKFyXyYbKJhDlV0HN9WF lp1L0sNFMEQGA1UdHwQ9MDswOaA3oDWGM2h0dHA6Ly9jcmwudXNlcnRydXN0LmNvbS9VVE4tVVNF UkZpcnN0LUhhcmR3YXJlLmNybDAxBgNVHSUEKjAoBggrBgEFBQcDAQYIKwYBBQUHAwUGCCsGAQUF BwMGBggrBgEFBQcDBzANBgkqhkiG9w0BAQUFAAOCAQEARxkP3nTGmZev/K0oXnWO6y1n7k57K9cM //bey1WiCuFMVGWTYGufEpytXoMs61quwOQt9ABjHbjAbPLPSbtNk28GpgoiskliCE7/yMgUsogW XecB5BKV5UU0s4tpvc+0hY91UZ59Ojg6FEgSxvunOxqNDYJAB+gECJChicsZUN/KHAG8HQQZexB2 lzvukJDKxA4fFm517zP4029bHpbj4HR3dHuKom4t3XbWOTCC8KucUvIqx69JXn7HaOWCgchqJ/kn iCrVWFCVH/A7HFe7fRQ5YiuayZSSKqMiDP+JJn1fIytH1xUdqWqeUQ0qUZ6B+dQ7XnASfxAynB67 nfhmqA== -----END CERTIFICATE----- Camerfirma Chambers of Commerce Root ==================================== -----BEGIN CERTIFICATE----- MIIEvTCCA6WgAwIBAgIBADANBgkqhkiG9w0BAQUFADB/MQswCQYDVQQGEwJFVTEnMCUGA1UEChMe QUMgQ2FtZXJmaXJtYSBTQSBDSUYgQTgyNzQzMjg3MSMwIQYDVQQLExpodHRwOi8vd3d3LmNoYW1i ZXJzaWduLm9yZzEiMCAGA1UEAxMZQ2hhbWJlcnMgb2YgQ29tbWVyY2UgUm9vdDAeFw0wMzA5MzAx NjEzNDNaFw0zNzA5MzAxNjEzNDRaMH8xCzAJBgNVBAYTAkVVMScwJQYDVQQKEx5BQyBDYW1lcmZp cm1hIFNBIENJRiBBODI3NDMyODcxIzAhBgNVBAsTGmh0dHA6Ly93d3cuY2hhbWJlcnNpZ24ub3Jn MSIwIAYDVQQDExlDaGFtYmVycyBvZiBDb21tZXJjZSBSb290MIIBIDANBgkqhkiG9w0BAQEFAAOC AQ0AMIIBCAKCAQEAtzZV5aVdGDDg2olUkfzIx1L4L1DZ77F1c2VHfRtbunXF/KGIJPov7coISjlU xFF6tdpg6jg8gbLL8bvZkSM/SAFwdakFKq0fcfPJVD0dBmpAPrMMhe5cG3nCYsS4No41XQEMIwRH NaqbYE6gZj3LJgqcQKH0XZi/caulAGgq7YN6D6IUtdQis4CwPAxaUWktWBiP7Zme8a7ileb2R6jW DA+wWFjbw2Y3npuRVDM30pQcakjJyfKl2qUMI/cjDpwyVV5xnIQFUZot/eZOKjRa3spAN2cMVCFV d9oKDMyXroDclDZK9D7ONhMeU+SsTjoF7Nuucpw4i9A5O4kKPnf+dQIBA6OCAUQwggFAMBIGA1Ud EwEB/wQIMAYBAf8CAQwwPAYDVR0fBDUwMzAxoC+gLYYraHR0cDovL2NybC5jaGFtYmVyc2lnbi5v cmcvY2hhbWJlcnNyb290LmNybDAdBgNVHQ4EFgQU45T1sU3p26EpW1eLTXYGduHRooowDgYDVR0P AQH/BAQDAgEGMBEGCWCGSAGG+EIBAQQEAwIABzAnBgNVHREEIDAegRxjaGFtYmVyc3Jvb3RAY2hh bWJlcnNpZ24ub3JnMCcGA1UdEgQgMB6BHGNoYW1iZXJzcm9vdEBjaGFtYmVyc2lnbi5vcmcwWAYD VR0gBFEwTzBNBgsrBgEEAYGHLgoDATA+MDwGCCsGAQUFBwIBFjBodHRwOi8vY3BzLmNoYW1iZXJz aWduLm9yZy9jcHMvY2hhbWJlcnNyb290Lmh0bWwwDQYJKoZIhvcNAQEFBQADggEBAAxBl8IahsAi fJ/7kPMa0QOx7xP5IV8EnNrJpY0nbJaHkb5BkAFyk+cefV/2icZdp0AJPaxJRUXcLo0waLIJuvvD L8y6C98/d3tGfToSJI6WjzwFCm/SlCgdbQzALogi1djPHRPH8EjX1wWnz8dHnjs8NMiAT9QUu/wN UPf6s+xCX6ndbcj0dc97wXImsQEcXCz9ek60AcUFV7nnPKoF2YjpB0ZBzu9Bga5Y34OirsrXdx/n ADydb47kMgkdTXg0eDQ8lJsm7U9xxhl6vSAiSFr+S30Dt+dYvsYyTnQeaN2oaFuzPu5ifdmA6Ap1 erfutGWaIZDgqtCYvDi1czyL+Nw= -----END CERTIFICATE----- Camerfirma Global Chambersign Root ================================== -----BEGIN CERTIFICATE----- MIIExTCCA62gAwIBAgIBADANBgkqhkiG9w0BAQUFADB9MQswCQYDVQQGEwJFVTEnMCUGA1UEChMe QUMgQ2FtZXJmaXJtYSBTQSBDSUYgQTgyNzQzMjg3MSMwIQYDVQQLExpodHRwOi8vd3d3LmNoYW1i ZXJzaWduLm9yZzEgMB4GA1UEAxMXR2xvYmFsIENoYW1iZXJzaWduIFJvb3QwHhcNMDMwOTMwMTYx NDE4WhcNMzcwOTMwMTYxNDE4WjB9MQswCQYDVQQGEwJFVTEnMCUGA1UEChMeQUMgQ2FtZXJmaXJt YSBTQSBDSUYgQTgyNzQzMjg3MSMwIQYDVQQLExpodHRwOi8vd3d3LmNoYW1iZXJzaWduLm9yZzEg MB4GA1UEAxMXR2xvYmFsIENoYW1iZXJzaWduIFJvb3QwggEgMA0GCSqGSIb3DQEBAQUAA4IBDQAw ggEIAoIBAQCicKLQn0KuWxfH2H3PFIP8T8mhtxOviteePgQKkotgVvq0Mi+ITaFgCPS3CU6gSS9J 1tPfnZdan5QEcOw/Wdm3zGaLmFIoCQLfxS+EjXqXd7/sQJ0lcqu1PzKY+7e3/HKE5TWH+VX6ox8O by4o3Wmg2UIQxvi1RMLQQ3/bvOSiPGpVeAp3qdjqGTK3L/5cPxvusZjsyq16aUXjlg9V9ubtdepl 6DJWk0aJqCWKZQbua795B9Dxt6/tLE2Su8CoX6dnfQTyFQhwrJLWfQTSM/tMtgsL+xrJxI0DqX5c 8lCrEqWhz0hQpe/SyBoT+rB/sYIcd2oPX9wLlY/vQ37mRQklAgEDo4IBUDCCAUwwEgYDVR0TAQH/ BAgwBgEB/wIBDDA/BgNVHR8EODA2MDSgMqAwhi5odHRwOi8vY3JsLmNoYW1iZXJzaWduLm9yZy9j aGFtYmVyc2lnbnJvb3QuY3JsMB0GA1UdDgQWBBRDnDafsJ4wTcbOX60Qq+UDpfqpFDAOBgNVHQ8B Af8EBAMCAQYwEQYJYIZIAYb4QgEBBAQDAgAHMCoGA1UdEQQjMCGBH2NoYW1iZXJzaWducm9vdEBj aGFtYmVyc2lnbi5vcmcwKgYDVR0SBCMwIYEfY2hhbWJlcnNpZ25yb290QGNoYW1iZXJzaWduLm9y ZzBbBgNVHSAEVDBSMFAGCysGAQQBgYcuCgEBMEEwPwYIKwYBBQUHAgEWM2h0dHA6Ly9jcHMuY2hh bWJlcnNpZ24ub3JnL2Nwcy9jaGFtYmVyc2lnbnJvb3QuaHRtbDANBgkqhkiG9w0BAQUFAAOCAQEA PDtwkfkEVCeR4e3t/mh/YV3lQWVPMvEYBZRqHN4fcNs+ezICNLUMbKGKfKX0j//U2K0X1S0E0T9Y gOKBWYi+wONGkyT+kL0mojAt6JcmVzWJdJYY9hXiryQZVgICsroPFOrGimbBhkVVi76SvpykBMdJ PJ7oKXqJ1/6v/2j1pReQvayZzKWGVwlnRtvWFsJG8eSpUPWP0ZIV018+xgBJOm5YstHRJw0lyDL4 IBHNfTIzSJRUTN3cecQwn+uOuFW114hcxWokPbLTBQNRxgfvzBRydD1ucs4YKIxKoHflCStFREes t2d/AYoFWpO+ocH/+OcOZ6RHSXZddZAa9SaP8A== -----END CERTIFICATE----- NetLock Notary (Class A) Root ============================= -----BEGIN CERTIFICATE----- MIIGfTCCBWWgAwIBAgICAQMwDQYJKoZIhvcNAQEEBQAwga8xCzAJBgNVBAYTAkhVMRAwDgYDVQQI EwdIdW5nYXJ5MREwDwYDVQQHEwhCdWRhcGVzdDEnMCUGA1UEChMeTmV0TG9jayBIYWxvemF0Yml6 dG9uc2FnaSBLZnQuMRowGAYDVQQLExFUYW51c2l0dmFueWtpYWRvazE2MDQGA1UEAxMtTmV0TG9j ayBLb3pqZWd5em9pIChDbGFzcyBBKSBUYW51c2l0dmFueWtpYWRvMB4XDTk5MDIyNDIzMTQ0N1oX DTE5MDIxOTIzMTQ0N1owga8xCzAJBgNVBAYTAkhVMRAwDgYDVQQIEwdIdW5nYXJ5MREwDwYDVQQH EwhCdWRhcGVzdDEnMCUGA1UEChMeTmV0TG9jayBIYWxvemF0Yml6dG9uc2FnaSBLZnQuMRowGAYD VQQLExFUYW51c2l0dmFueWtpYWRvazE2MDQGA1UEAxMtTmV0TG9jayBLb3pqZWd5em9pIChDbGFz cyBBKSBUYW51c2l0dmFueWtpYWRvMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAvHSM D7tM9DceqQWC2ObhbHDqeLVu0ThEDaiDzl3S1tWBxdRL51uUcCbbO51qTGL3cfNk1mE7PetzozfZ z+qMkjvN9wfcZnSX9EUi3fRc4L9t875lM+QVOr/bmJBVOMTtplVjC7B4BPTjbsE/jvxReB+SnoPC /tmwqcm8WgD/qaiYdPv2LD4VOQ22BFWoDpggQrOxJa1+mm9dU7GrDPzr4PN6s6iz/0b2Y6LYOph7 tqyF/7AlT3Rj5xMHpQqPBffAZG9+pyeAlt7ULoZgx2srXnN7F+eRP2QM2EsiNCubMvJIH5+hCoR6 4sKtlz2O1cH5VqNQ6ca0+pii7pXmKgOM3wIDAQABo4ICnzCCApswDgYDVR0PAQH/BAQDAgAGMBIG A1UdEwEB/wQIMAYBAf8CAQQwEQYJYIZIAYb4QgEBBAQDAgAHMIICYAYJYIZIAYb4QgENBIICURaC Ak1GSUdZRUxFTSEgRXplbiB0YW51c2l0dmFueSBhIE5ldExvY2sgS2Z0LiBBbHRhbGFub3MgU3pv bGdhbHRhdGFzaSBGZWx0ZXRlbGVpYmVuIGxlaXJ0IGVsamFyYXNvayBhbGFwamFuIGtlc3p1bHQu IEEgaGl0ZWxlc2l0ZXMgZm9seWFtYXRhdCBhIE5ldExvY2sgS2Z0LiB0ZXJtZWtmZWxlbG9zc2Vn LWJpenRvc2l0YXNhIHZlZGkuIEEgZGlnaXRhbGlzIGFsYWlyYXMgZWxmb2dhZGFzYW5hayBmZWx0 ZXRlbGUgYXogZWxvaXJ0IGVsbGVub3J6ZXNpIGVsamFyYXMgbWVndGV0ZWxlLiBBeiBlbGphcmFz IGxlaXJhc2EgbWVndGFsYWxoYXRvIGEgTmV0TG9jayBLZnQuIEludGVybmV0IGhvbmxhcGphbiBh IGh0dHBzOi8vd3d3Lm5ldGxvY2submV0L2RvY3MgY2ltZW4gdmFneSBrZXJoZXRvIGF6IGVsbGVu b3J6ZXNAbmV0bG9jay5uZXQgZS1tYWlsIGNpbWVuLiBJTVBPUlRBTlQhIFRoZSBpc3N1YW5jZSBh bmQgdGhlIHVzZSBvZiB0aGlzIGNlcnRpZmljYXRlIGlzIHN1YmplY3QgdG8gdGhlIE5ldExvY2sg Q1BTIGF2YWlsYWJsZSBhdCBodHRwczovL3d3dy5uZXRsb2NrLm5ldC9kb2NzIG9yIGJ5IGUtbWFp bCBhdCBjcHNAbmV0bG9jay5uZXQuMA0GCSqGSIb3DQEBBAUAA4IBAQBIJEb3ulZv+sgoA0BO5TE5 ayZrU3/b39/zcT0mwBQOxmd7I6gMc90Bu8bKbjc5VdXHjFYgDigKDtIqpLBJUsY4B/6+CgmM0ZjP ytoUMaFP0jn8DxEsQ8Pdq5PHVT5HfBgaANzze9jyf1JsIPQLX2lS9O74silg6+NJMSEN1rUQQeJB CWziGppWS3cC9qCbmieH6FUpccKQn0V4GuEVZD3QDtigdp+uxdAu6tYPVuxkf1qbFFgBJ34TUMdr KuZoPL9coAob4Q566eKAw+np9v1sEZ7Q5SgnK1QyQhSCdeZK8CtmdWOMovsEPoMOmzbwGOQmIMOM 8CgHrTwXZoi1/baI -----END CERTIFICATE----- XRamp Global CA Root ==================== -----BEGIN CERTIFICATE----- MIIEMDCCAxigAwIBAgIQUJRs7Bjq1ZxN1ZfvdY+grTANBgkqhkiG9w0BAQUFADCBgjELMAkGA1UE BhMCVVMxHjAcBgNVBAsTFXd3dy54cmFtcHNlY3VyaXR5LmNvbTEkMCIGA1UEChMbWFJhbXAgU2Vj dXJpdHkgU2VydmljZXMgSW5jMS0wKwYDVQQDEyRYUmFtcCBHbG9iYWwgQ2VydGlmaWNhdGlvbiBB dXRob3JpdHkwHhcNMDQxMTAxMTcxNDA0WhcNMzUwMTAxMDUzNzE5WjCBgjELMAkGA1UEBhMCVVMx HjAcBgNVBAsTFXd3dy54cmFtcHNlY3VyaXR5LmNvbTEkMCIGA1UEChMbWFJhbXAgU2VjdXJpdHkg U2VydmljZXMgSW5jMS0wKwYDVQQDEyRYUmFtcCBHbG9iYWwgQ2VydGlmaWNhdGlvbiBBdXRob3Jp dHkwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCYJB69FbS638eMpSe2OAtp87ZOqCwu IR1cRN8hXX4jdP5efrRKt6atH67gBhbim1vZZ3RrXYCPKZ2GG9mcDZhtdhAoWORlsH9KmHmf4MMx foArtYzAQDsRhtDLooY2YKTVMIJt2W7QDxIEM5dfT2Fa8OT5kavnHTu86M/0ay00fOJIYRyO82FE zG+gSqmUsE3a56k0enI4qEHMPJQRfevIpoy3hsvKMzvZPTeL+3o+hiznc9cKV6xkmxnr9A8ECIqs AxcZZPRaJSKNNCyy9mgdEm3Tih4U2sSPpuIjhdV6Db1q4Ons7Be7QhtnqiXtRYMh/MHJfNViPvry xS3T/dRlAgMBAAGjgZ8wgZwwEwYJKwYBBAGCNxQCBAYeBABDAEEwCwYDVR0PBAQDAgGGMA8GA1Ud EwEB/wQFMAMBAf8wHQYDVR0OBBYEFMZPoj0GY4QJnM5i5ASsjVy16bYbMDYGA1UdHwQvMC0wK6Ap oCeGJWh0dHA6Ly9jcmwueHJhbXBzZWN1cml0eS5jb20vWEdDQS5jcmwwEAYJKwYBBAGCNxUBBAMC AQEwDQYJKoZIhvcNAQEFBQADggEBAJEVOQMBG2f7Shz5CmBbodpNl2L5JFMn14JkTpAuw0kbK5rc /Kh4ZzXxHfARvbdI4xD2Dd8/0sm2qlWkSLoC295ZLhVbO50WfUfXN+pfTXYSNrsf16GBBEYgoyxt qZ4Bfj8pzgCT3/3JknOJiWSe5yvkHJEs0rnOfc5vMZnT5r7SHpDwCRR5XCOrTdLaIR9NmXmd4c8n nxCbHIgNsIpkQTG4DmyQJKSbXHGPurt+HBvbaoAPIbzp26a3QPSyi6mx5O+aGtA9aZnuqCij4Tyz 8LIRnM98QObd50N9otg6tamN8jSZxNQQ4Qb9CYQQO+7ETPTsJ3xCwnR8gooJybQDJbw= -----END CERTIFICATE----- Go Daddy Class 2 CA =================== -----BEGIN CERTIFICATE----- MIIEADCCAuigAwIBAgIBADANBgkqhkiG9w0BAQUFADBjMQswCQYDVQQGEwJVUzEhMB8GA1UEChMY VGhlIEdvIERhZGR5IEdyb3VwLCBJbmMuMTEwLwYDVQQLEyhHbyBEYWRkeSBDbGFzcyAyIENlcnRp ZmljYXRpb24gQXV0aG9yaXR5MB4XDTA0MDYyOTE3MDYyMFoXDTM0MDYyOTE3MDYyMFowYzELMAkG A1UEBhMCVVMxITAfBgNVBAoTGFRoZSBHbyBEYWRkeSBHcm91cCwgSW5jLjExMC8GA1UECxMoR28g RGFkZHkgQ2xhc3MgMiBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTCCASAwDQYJKoZIhvcNAQEBBQAD ggENADCCAQgCggEBAN6d1+pXGEmhW+vXX0iG6r7d/+TvZxz0ZWizV3GgXne77ZtJ6XCAPVYYYwhv 2vLM0D9/AlQiVBDYsoHUwHU9S3/Hd8M+eKsaA7Ugay9qK7HFiH7Eux6wwdhFJ2+qN1j3hybX2C32 qRe3H3I2TqYXP2WYktsqbl2i/ojgC95/5Y0V4evLOtXiEqITLdiOr18SPaAIBQi2XKVlOARFmR6j YGB0xUGlcmIbYsUfb18aQr4CUWWoriMYavx4A6lNf4DD+qta/KFApMoZFv6yyO9ecw3ud72a9nmY vLEHZ6IVDd2gWMZEewo+YihfukEHU1jPEX44dMX4/7VpkI+EdOqXG68CAQOjgcAwgb0wHQYDVR0O BBYEFNLEsNKR1EwRcbNhyz2h/t2oatTjMIGNBgNVHSMEgYUwgYKAFNLEsNKR1EwRcbNhyz2h/t2o atTjoWekZTBjMQswCQYDVQQGEwJVUzEhMB8GA1UEChMYVGhlIEdvIERhZGR5IEdyb3VwLCBJbmMu MTEwLwYDVQQLEyhHbyBEYWRkeSBDbGFzcyAyIENlcnRpZmljYXRpb24gQXV0aG9yaXR5ggEAMAwG A1UdEwQFMAMBAf8wDQYJKoZIhvcNAQEFBQADggEBADJL87LKPpH8EsahB4yOd6AzBhRckB4Y9wim PQoZ+YeAEW5p5JYXMP80kWNyOO7MHAGjHZQopDH2esRU1/blMVgDoszOYtuURXO1v0XJJLXVggKt I3lpjbi2Tc7PTMozI+gciKqdi0FuFskg5YmezTvacPd+mSYgFFQlq25zheabIZ0KbIIOqPjCDPoQ HmyW74cNxA9hi63ugyuV+I6ShHI56yDqg+2DzZduCLzrTia2cyvk0/ZM/iZx4mERdEr/VxqHD3VI Ls9RaRegAhJhldXRQLIQTO7ErBBDpqWeCtWVYpoNz4iCxTIM5CufReYNnyicsbkqWletNw+vHX/b vZ8= -----END CERTIFICATE----- Starfield Class 2 CA ==================== -----BEGIN CERTIFICATE----- MIIEDzCCAvegAwIBAgIBADANBgkqhkiG9w0BAQUFADBoMQswCQYDVQQGEwJVUzElMCMGA1UEChMc U3RhcmZpZWxkIFRlY2hub2xvZ2llcywgSW5jLjEyMDAGA1UECxMpU3RhcmZpZWxkIENsYXNzIDIg Q2VydGlmaWNhdGlvbiBBdXRob3JpdHkwHhcNMDQwNjI5MTczOTE2WhcNMzQwNjI5MTczOTE2WjBo MQswCQYDVQQGEwJVUzElMCMGA1UEChMcU3RhcmZpZWxkIFRlY2hub2xvZ2llcywgSW5jLjEyMDAG A1UECxMpU3RhcmZpZWxkIENsYXNzIDIgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkwggEgMA0GCSqG SIb3DQEBAQUAA4IBDQAwggEIAoIBAQC3Msj+6XGmBIWtDBFk385N78gDGIc/oav7PKaf8MOh2tTY bitTkPskpD6E8J7oX+zlJ0T1KKY/e97gKvDIr1MvnsoFAZMej2YcOadN+lq2cwQlZut3f+dZxkqZ JRRU6ybH838Z1TBwj6+wRir/resp7defqgSHo9T5iaU0X9tDkYI22WY8sbi5gv2cOj4QyDvvBmVm epsZGD3/cVE8MC5fvj13c7JdBmzDI1aaK4UmkhynArPkPw2vCHmCuDY96pzTNbO8acr1zJ3o/WSN F4Azbl5KXZnJHoe0nRrA1W4TNSNe35tfPe/W93bC6j67eA0cQmdrBNj41tpvi/JEoAGrAgEDo4HF MIHCMB0GA1UdDgQWBBS/X7fRzt0fhvRbVazc1xDCDqmI5zCBkgYDVR0jBIGKMIGHgBS/X7fRzt0f hvRbVazc1xDCDqmI56FspGowaDELMAkGA1UEBhMCVVMxJTAjBgNVBAoTHFN0YXJmaWVsZCBUZWNo bm9sb2dpZXMsIEluYy4xMjAwBgNVBAsTKVN0YXJmaWVsZCBDbGFzcyAyIENlcnRpZmljYXRpb24g QXV0aG9yaXR5ggEAMAwGA1UdEwQFMAMBAf8wDQYJKoZIhvcNAQEFBQADggEBAAWdP4id0ckaVaGs afPzWdqbAYcaT1epoXkJKtv3L7IezMdeatiDh6GX70k1PncGQVhiv45YuApnP+yz3SFmH8lU+nLM PUxA2IGvd56Deruix/U0F47ZEUD0/CwqTRV/p2JdLiXTAAsgGh1o+Re49L2L7ShZ3U0WixeDyLJl xy16paq8U4Zt3VekyvggQQto8PT7dL5WXXp59fkdheMtlb71cZBDzI0fmgAKhynpVSJYACPq4xJD KVtHCN2MQWplBqjlIapBtJUhlbl90TSrE9atvNziPTnNvT51cKEYWQPJIrSPnNVeKtelttQKbfi3 QBFGmh95DmK/D5fs4C8fF5Q= -----END CERTIFICATE----- StartCom Certification Authority ================================ -----BEGIN CERTIFICATE----- MIIHyTCCBbGgAwIBAgIBATANBgkqhkiG9w0BAQUFADB9MQswCQYDVQQGEwJJTDEWMBQGA1UEChMN U3RhcnRDb20gTHRkLjErMCkGA1UECxMiU2VjdXJlIERpZ2l0YWwgQ2VydGlmaWNhdGUgU2lnbmlu ZzEpMCcGA1UEAxMgU3RhcnRDb20gQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkwHhcNMDYwOTE3MTk0 NjM2WhcNMzYwOTE3MTk0NjM2WjB9MQswCQYDVQQGEwJJTDEWMBQGA1UEChMNU3RhcnRDb20gTHRk LjErMCkGA1UECxMiU2VjdXJlIERpZ2l0YWwgQ2VydGlmaWNhdGUgU2lnbmluZzEpMCcGA1UEAxMg U3RhcnRDb20gQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAw ggIKAoICAQDBiNsJvGxGfHiflXu1M5DycmLWwTYgIiRezul38kMKogZkpMyONvg45iPwbm2xPN1y o4UcodM9tDMr0y+v/uqwQVlntsQGfQqedIXWeUyAN3rfOQVSWff0G0ZDpNKFhdLDcfN1YjS6LIp/ Ho/u7TTQEceWzVI9ujPW3U3eCztKS5/CJi/6tRYccjV3yjxd5srhJosaNnZcAdt0FCX+7bWgiA/d eMotHweXMAEtcnn6RtYTKqi5pquDSR3l8u/d5AGOGAqPY1MWhWKpDhk6zLVmpsJrdAfkK+F2PrRt 2PZE4XNiHzvEvqBTViVsUQn3qqvKv3b9bZvzndu/PWa8DFaqr5hIlTpL36dYUNk4dalb6kMMAv+Z 6+hsTXBbKWWc3apdzK8BMewM69KN6Oqce+Zu9ydmDBpI125C4z/eIT574Q1w+2OqqGwaVLRcJXrJ osmLFqa7LH4XXgVNWG4SHQHuEhANxjJ/GP/89PrNbpHoNkm+Gkhpi8KWTRoSsmkXwQqQ1vp5Iki/ untp+HDH+no32NgN0nZPV/+Qt+OR0t3vwmC3Zzrd/qqc8NSLf3Iizsafl7b4r4qgEKjZ+xjGtrVc UjyJthkqcwEKDwOzEmDyei+B26Nu/yYwl/WL3YlXtq09s68rxbd2AvCl1iuahhQqcvbjM4xdCUsT 37uMdBNSSwIDAQABo4ICUjCCAk4wDAYDVR0TBAUwAwEB/zALBgNVHQ8EBAMCAa4wHQYDVR0OBBYE FE4L7xqkQFulF2mHMMo0aEPQQa7yMGQGA1UdHwRdMFswLKAqoCiGJmh0dHA6Ly9jZXJ0LnN0YXJ0 Y29tLm9yZy9zZnNjYS1jcmwuY3JsMCugKaAnhiVodHRwOi8vY3JsLnN0YXJ0Y29tLm9yZy9zZnNj YS1jcmwuY3JsMIIBXQYDVR0gBIIBVDCCAVAwggFMBgsrBgEEAYG1NwEBATCCATswLwYIKwYBBQUH AgEWI2h0dHA6Ly9jZXJ0LnN0YXJ0Y29tLm9yZy9wb2xpY3kucGRmMDUGCCsGAQUFBwIBFilodHRw Oi8vY2VydC5zdGFydGNvbS5vcmcvaW50ZXJtZWRpYXRlLnBkZjCB0AYIKwYBBQUHAgIwgcMwJxYg U3RhcnQgQ29tbWVyY2lhbCAoU3RhcnRDb20pIEx0ZC4wAwIBARqBl0xpbWl0ZWQgTGlhYmlsaXR5 LCByZWFkIHRoZSBzZWN0aW9uICpMZWdhbCBMaW1pdGF0aW9ucyogb2YgdGhlIFN0YXJ0Q29tIENl cnRpZmljYXRpb24gQXV0aG9yaXR5IFBvbGljeSBhdmFpbGFibGUgYXQgaHR0cDovL2NlcnQuc3Rh cnRjb20ub3JnL3BvbGljeS5wZGYwEQYJYIZIAYb4QgEBBAQDAgAHMDgGCWCGSAGG+EIBDQQrFilT dGFydENvbSBGcmVlIFNTTCBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTANBgkqhkiG9w0BAQUFAAOC AgEAFmyZ9GYMNPXQhV59CuzaEE44HF7fpiUFS5Eyweg78T3dRAlbB0mKKctmArexmvclmAk8jhvh 3TaHK0u7aNM5Zj2gJsfyOZEdUauCe37Vzlrk4gNXcGmXCPleWKYK34wGmkUWFjgKXlf2Ysd6AgXm vB618p70qSmD+LIU424oh0TDkBreOKk8rENNZEXO3SipXPJzewT4F+irsfMuXGRuczE6Eri8sxHk fY+BUZo7jYn0TZNmezwD7dOaHZrzZVD1oNB1ny+v8OqCQ5j4aZyJecRDjkZy42Q2Eq/3JR44iZB3 fsNrarnDy0RLrHiQi+fHLB5LEUTINFInzQpdn4XBidUaePKVEFMy3YCEZnXZtWgo+2EuvoSoOMCZ EoalHmdkrQYuL6lwhceWD3yJZfWOQ1QOq92lgDmUYMA0yZZwLKMS9R9Ie70cfmu3nZD0Ijuu+Pwq yvqCUqDvr0tVk+vBtfAii6w0TiYiBKGHLHVKt+V9E9e4DGTANtLJL4YSjCMJwRuCO3NJo2pXh5Tl 1njFmUNj403gdy3hZZlyaQQaRwnmDwFWJPsfvw55qVguucQJAX6Vum0ABj6y6koQOdjQK/W/7HW/ lwLFCRsI3FU34oH7N4RDYiDK51ZLZer+bMEkkyShNOsF/5oirpt9P/FlUQqmMGqz9IgcgA38coro g14= -----END CERTIFICATE----- Taiwan GRCA =========== -----BEGIN CERTIFICATE----- MIIFcjCCA1qgAwIBAgIQH51ZWtcvwgZEpYAIaeNe9jANBgkqhkiG9w0BAQUFADA/MQswCQYDVQQG EwJUVzEwMC4GA1UECgwnR292ZXJubWVudCBSb290IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MB4X DTAyMTIwNTEzMjMzM1oXDTMyMTIwNTEzMjMzM1owPzELMAkGA1UEBhMCVFcxMDAuBgNVBAoMJ0dv dmVybm1lbnQgUm9vdCBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTCCAiIwDQYJKoZIhvcNAQEBBQAD ggIPADCCAgoCggIBAJoluOzMonWoe/fOW1mKydGGEghU7Jzy50b2iPN86aXfTEc2pBsBHH8eV4qN w8XRIePaJD9IK/ufLqGU5ywck9G/GwGHU5nOp/UKIXZ3/6m3xnOUT0b3EEk3+qhZSV1qgQdW8or5 BtD3cCJNtLdBuTK4sfCxw5w/cP1T3YGq2GN49thTbqGsaoQkclSGxtKyyhwOeYHWtXBiCAEuTk8O 1RGvqa/lmr/czIdtJuTJV6L7lvnM4T9TjGxMfptTCAtsF/tnyMKtsc2AtJfcdgEWFelq16TheEfO htX7MfP6Mb40qij7cEwdScevLJ1tZqa2jWR+tSBqnTuBto9AAGdLiYa4zGX+FVPpBMHWXx1E1wov J5pGfaENda1UhhXcSTvxls4Pm6Dso3pdvtUqdULle96ltqqvKKyskKw4t9VoNSZ63Pc78/1Fm9G7 Q3hub/FCVGqY8A2tl+lSXunVanLeavcbYBT0peS2cWeqH+riTcFCQP5nRhc4L0c/cZyu5SHKYS1t B6iEfC3uUSXxY5Ce/eFXiGvviiNtsea9P63RPZYLhY3Naye7twWb7LuRqQoHEgKXTiCQ8P8NHuJB O9NAOueNXdpm5AKwB1KYXA6OM5zCppX7VRluTI6uSw+9wThNXo+EHWbNxWCWtFJaBYmOlXqYwZE8 lSOyDvR5tMl8wUohAgMBAAGjajBoMB0GA1UdDgQWBBTMzO/MKWCkO7GStjz6MmKPrCUVOzAMBgNV HRMEBTADAQH/MDkGBGcqBwAEMTAvMC0CAQAwCQYFKw4DAhoFADAHBgVnKgMAAAQUA5vwIhP/lSg2 09yewDL7MTqKUWUwDQYJKoZIhvcNAQEFBQADggIBAECASvomyc5eMN1PhnR2WPWus4MzeKR6dBcZ TulStbngCnRiqmjKeKBMmo4sIy7VahIkv9Ro04rQ2JyftB8M3jh+Vzj8jeJPXgyfqzvS/3WXy6Tj Zwj/5cAWtUgBfen5Cv8b5Wppv3ghqMKnI6mGq3ZW6A4M9hPdKmaKZEk9GhiHkASfQlK3T8v+R0F2 Ne//AHY2RTKbxkaFXeIksB7jSJaYV0eUVXoPQbFEJPPB/hprv4j9wabak2BegUqZIJxIZhm1AHlU D7gsL0u8qV1bYH+Mh6XgUmMqvtg7hUAV/h62ZT/FS9p+tXo1KaMuephgIqP0fSdOLeq0dDzpD6Qz DxARvBMB1uUO07+1EqLhRSPAzAhuYbeJq4PjJB7mXQfnHyA+z2fI56wwbSdLaG5LKlwCCDTb+Hbk Z6MmnD+iMsJKxYEYMRBWqoTvLQr/uB930r+lWKBi5NdLkXWNiYCYfm3LU05er/ayl4WXudpVBrkk 7tfGOB5jGxI7leFYrPLfhNVfmS8NVVvmONsuP3LpSIXLuykTjx44VbnzssQwmSNOXfJIoRIM3BKQ CZBUkQM8R+XVyWXgt0t97EfTsws+rZ7QdAAO671RrcDeLMDDav7v3Aun+kbfYNucpllQdSNpc5Oy +fwC00fmcc4QAu4njIT/rEUNE1yDMuAlpYYsfPQS -----END CERTIFICATE----- Swisscom Root CA 1 ================== -----BEGIN CERTIFICATE----- MIIF2TCCA8GgAwIBAgIQXAuFXAvnWUHfV8w/f52oNjANBgkqhkiG9w0BAQUFADBkMQswCQYDVQQG EwJjaDERMA8GA1UEChMIU3dpc3Njb20xJTAjBgNVBAsTHERpZ2l0YWwgQ2VydGlmaWNhdGUgU2Vy dmljZXMxGzAZBgNVBAMTElN3aXNzY29tIFJvb3QgQ0EgMTAeFw0wNTA4MTgxMjA2MjBaFw0yNTA4 MTgyMjA2MjBaMGQxCzAJBgNVBAYTAmNoMREwDwYDVQQKEwhTd2lzc2NvbTElMCMGA1UECxMcRGln aXRhbCBDZXJ0aWZpY2F0ZSBTZXJ2aWNlczEbMBkGA1UEAxMSU3dpc3Njb20gUm9vdCBDQSAxMIIC IjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEA0LmwqAzZuz8h+BvVM5OAFmUgdbI9m2BtRsiM MW8Xw/qabFbtPMWRV8PNq5ZJkCoZSx6jbVfd8StiKHVFXqrWW/oLJdihFvkcxC7mlSpnzNApbjyF NDhhSbEAn9Y6cV9Nbc5fuankiX9qUvrKm/LcqfmdmUc/TilftKaNXXsLmREDA/7n29uj/x2lzZAe AR81sH8A25Bvxn570e56eqeqDFdvpG3FEzuwpdntMhy0XmeLVNxzh+XTF3xmUHJd1BpYwdnP2IkC b6dJtDZd0KTeByy2dbcokdaXvij1mB7qWybJvbCXc9qukSbraMH5ORXWZ0sKbU/Lz7DkQnGMU3nn 7uHbHaBuHYwadzVcFh4rUx80i9Fs/PJnB3r1re3WmquhsUvhzDdf/X/NTa64H5xD+SpYVUNFvJbN cA78yeNmuk6NO4HLFWR7uZToXTNShXEuT46iBhFRyePLoW4xCGQMwtI89Tbo19AOeCMgkckkKmUp WyL3Ic6DXqTz3kvTaI9GdVyDCW4pa8RwjPWd1yAv/0bSKzjCL3UcPX7ape8eYIVpQtPM+GP+HkM5 haa2Y0EQs3MevNP6yn0WR+Kn1dCjigoIlmJWbjTb2QK5MHXjBNLnj8KwEUAKrNVxAmKLMb7dxiNY MUJDLXT5xp6mig/p/r+D5kNXJLrvRjSq1xIBOO0CAwEAAaOBhjCBgzAOBgNVHQ8BAf8EBAMCAYYw HQYDVR0hBBYwFDASBgdghXQBUwABBgdghXQBUwABMBIGA1UdEwEB/wQIMAYBAf8CAQcwHwYDVR0j BBgwFoAUAyUv3m+CATpcLNwroWm1Z9SM0/0wHQYDVR0OBBYEFAMlL95vggE6XCzcK6FptWfUjNP9 MA0GCSqGSIb3DQEBBQUAA4ICAQA1EMvspgQNDQ/NwNurqPKIlwzfky9NfEBWMXrrpA9gzXrzvsMn jgM+pN0S734edAY8PzHyHHuRMSG08NBsl9Tpl7IkVh5WwzW9iAUPWxAaZOHHgjD5Mq2eUCzneAXQ MbFamIp1TpBcahQq4FJHgmDmHtqBsfsUC1rxn9KVuj7QG9YVHaO+htXbD8BJZLsuUBlL0iT43R4H VtA4oJVwIHaM190e3p9xxCPvgxNcoyQVTSlAPGrEqdi3pkSlDfTgnXceQHAm/NrZNuR55LU/vJtl vrsRls/bxig5OgjOR1tTWsWZ/l2p3e9M1MalrQLmjAcSHm8D0W+go/MpvRLHUKKwf4ipmXeascCl OS5cfGniLLDqN2qk4Vrh9VDlg++luyqI54zb/W1elxmofmZ1a3Hqv7HHb6D0jqTsNFFbjCYDcKF3 1QESVwA12yPeDooomf2xEG9L/zgtYE4snOtnta1J7ksfrK/7DZBaZmBwXarNeNQk7shBoJMBkpxq nvy5JMWzFYJ+vq6VK+uxwNrjAWALXmmshFZhvnEX/h0TD/7Gh0Xp/jKgGg0TpJRVcaUWi7rKibCy x/yP2FS1k2Kdzs9Z+z0YzirLNRWCXf9UIltxUvu3yf5gmwBBZPCqKuy2QkPOiWaByIufOVQDJdMW NY6E0F/6MBr1mmz0DlP5OlvRHA== -----END CERTIFICATE----- DigiCert Assured ID Root CA =========================== -----BEGIN CERTIFICATE----- MIIDtzCCAp+gAwIBAgIQDOfg5RfYRv6P5WD8G/AwOTANBgkqhkiG9w0BAQUFADBlMQswCQYDVQQG EwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3d3cuZGlnaWNlcnQuY29tMSQw IgYDVQQDExtEaWdpQ2VydCBBc3N1cmVkIElEIFJvb3QgQ0EwHhcNMDYxMTEwMDAwMDAwWhcNMzEx MTEwMDAwMDAwWjBlMQswCQYDVQQGEwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQL ExB3d3cuZGlnaWNlcnQuY29tMSQwIgYDVQQDExtEaWdpQ2VydCBBc3N1cmVkIElEIFJvb3QgQ0Ew ggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCtDhXO5EOAXLGH87dg+XESpa7cJpSIqvTO 9SA5KFhgDPiA2qkVlTJhPLWxKISKityfCgyDF3qPkKyK53lTXDGEKvYPmDI2dsze3Tyoou9q+yHy UmHfnyDXH+Kx2f4YZNISW1/5WBg1vEfNoTb5a3/UsDg+wRvDjDPZ2C8Y/igPs6eD1sNuRMBhNZYW /lmci3Zt1/GiSw0r/wty2p5g0I6QNcZ4VYcgoc/lbQrISXwxmDNsIumH0DJaoroTghHtORedmTpy oeb6pNnVFzF1roV9Iq4/AUaG9ih5yLHa5FcXxH4cDrC0kqZWs72yl+2qp/C3xag/lRbQ/6GW6whf GHdPAgMBAAGjYzBhMA4GA1UdDwEB/wQEAwIBhjAPBgNVHRMBAf8EBTADAQH/MB0GA1UdDgQWBBRF 66Kv9JLLgjEtUYunpyGd823IDzAfBgNVHSMEGDAWgBRF66Kv9JLLgjEtUYunpyGd823IDzANBgkq hkiG9w0BAQUFAAOCAQEAog683+Lt8ONyc3pklL/3cmbYMuRCdWKuh+vy1dneVrOfzM4UKLkNl2Bc EkxY5NM9g0lFWJc1aRqoR+pWxnmrEthngYTffwk8lOa4JiwgvT2zKIn3X/8i4peEH+ll74fg38Fn SbNd67IJKusm7Xi+fT8r87cmNW1fiQG2SVufAQWbqz0lwcy2f8Lxb4bG+mRo64EtlOtCt/qMHt1i 8b5QZ7dsvfPxH2sMNgcWfzd8qVttevESRmCD1ycEvkvOl77DZypoEd+A5wwzZr8TDRRu838fYxAe +o0bJW1sj6W3YQGx0qMmoRBxna3iw/nDmVG3KwcIzi7mULKn+gpFL6Lw8g== -----END CERTIFICATE----- DigiCert Global Root CA ======================= -----BEGIN CERTIFICATE----- MIIDrzCCApegAwIBAgIQCDvgVpBCRrGhdWrJWZHHSjANBgkqhkiG9w0BAQUFADBhMQswCQYDVQQG EwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3d3cuZGlnaWNlcnQuY29tMSAw HgYDVQQDExdEaWdpQ2VydCBHbG9iYWwgUm9vdCBDQTAeFw0wNjExMTAwMDAwMDBaFw0zMTExMTAw MDAwMDBaMGExCzAJBgNVBAYTAlVTMRUwEwYDVQQKEwxEaWdpQ2VydCBJbmMxGTAXBgNVBAsTEHd3 dy5kaWdpY2VydC5jb20xIDAeBgNVBAMTF0RpZ2lDZXJ0IEdsb2JhbCBSb290IENBMIIBIjANBgkq hkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA4jvhEXLeqKTTo1eqUKKPC3eQyaKl7hLOllsBCSDMAZOn TjC3U/dDxGkAV53ijSLdhwZAAIEJzs4bg7/fzTtxRuLWZscFs3YnFo97nh6Vfe63SKMI2tavegw5 BmV/Sl0fvBf4q77uKNd0f3p4mVmFaG5cIzJLv07A6Fpt43C/dxC//AH2hdmoRBBYMql1GNXRor5H 4idq9Joz+EkIYIvUX7Q6hL+hqkpMfT7PT19sdl6gSzeRntwi5m3OFBqOasv+zbMUZBfHWymeMr/y 7vrTC0LUq7dBMtoM1O/4gdW7jVg/tRvoSSiicNoxBN33shbyTApOB6jtSj1etX+jkMOvJwIDAQAB o2MwYTAOBgNVHQ8BAf8EBAMCAYYwDwYDVR0TAQH/BAUwAwEB/zAdBgNVHQ4EFgQUA95QNVbRTLtm 8KPiGxvDl7I90VUwHwYDVR0jBBgwFoAUA95QNVbRTLtm8KPiGxvDl7I90VUwDQYJKoZIhvcNAQEF BQADggEBAMucN6pIExIK+t1EnE9SsPTfrgT1eXkIoyQY/EsrhMAtudXH/vTBH1jLuG2cenTnmCmr EbXjcKChzUyImZOMkXDiqw8cvpOp/2PV5Adg06O/nVsJ8dWO41P0jmP6P6fbtGbfYmbW0W5BjfIt tep3Sp+dWOIrWcBAI+0tKIJFPnlUkiaY4IBIqDfv8NZ5YBberOgOzW6sRBc4L0na4UU+Krk2U886 UAb3LujEV0lsYSEY1QSteDwsOoBrp+uvFRTp2InBuThs4pFsiv9kuXclVzDAGySj4dzp30d8tbQk CAUw7C29C79Fv1C5qfPrmAESrciIxpg0X40KPMbp1ZWVbd4= -----END CERTIFICATE----- DigiCert High Assurance EV Root CA ================================== -----BEGIN CERTIFICATE----- MIIDxTCCAq2gAwIBAgIQAqxcJmoLQJuPC3nyrkYldzANBgkqhkiG9w0BAQUFADBsMQswCQYDVQQG EwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3d3cuZGlnaWNlcnQuY29tMSsw KQYDVQQDEyJEaWdpQ2VydCBIaWdoIEFzc3VyYW5jZSBFViBSb290IENBMB4XDTA2MTExMDAwMDAw MFoXDTMxMTExMDAwMDAwMFowbDELMAkGA1UEBhMCVVMxFTATBgNVBAoTDERpZ2lDZXJ0IEluYzEZ MBcGA1UECxMQd3d3LmRpZ2ljZXJ0LmNvbTErMCkGA1UEAxMiRGlnaUNlcnQgSGlnaCBBc3N1cmFu Y2UgRVYgUm9vdCBDQTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMbM5XPm+9S75S0t Mqbf5YE/yc0lSbZxKsPVlDRnogocsF9ppkCxxLeyj9CYpKlBWTrT3JTWPNt0OKRKzE0lgvdKpVMS OO7zSW1xkX5jtqumX8OkhPhPYlG++MXs2ziS4wblCJEMxChBVfvLWokVfnHoNb9Ncgk9vjo4UFt3 MRuNs8ckRZqnrG0AFFoEt7oT61EKmEFBIk5lYYeBQVCmeVyJ3hlKV9Uu5l0cUyx+mM0aBhakaHPQ NAQTXKFx01p8VdteZOE3hzBWBOURtCmAEvF5OYiiAhF8J2a3iLd48soKqDirCmTCv2ZdlYTBoSUe h10aUAsgEsxBu24LUTi4S8sCAwEAAaNjMGEwDgYDVR0PAQH/BAQDAgGGMA8GA1UdEwEB/wQFMAMB Af8wHQYDVR0OBBYEFLE+w2kD+L9HAdSYJhoIAu9jZCvDMB8GA1UdIwQYMBaAFLE+w2kD+L9HAdSY JhoIAu9jZCvDMA0GCSqGSIb3DQEBBQUAA4IBAQAcGgaX3NecnzyIZgYIVyHbIUf4KmeqvxgydkAQ V8GK83rZEWWONfqe/EW1ntlMMUu4kehDLI6zeM7b41N5cdblIZQB2lWHmiRk9opmzN6cN82oNLFp myPInngiK3BD41VHMWEZ71jFhS9OMPagMRYjyOfiZRYzy78aG6A9+MpeizGLYAiJLQwGXFK3xPkK mNEVX58Svnw2Yzi9RKR/5CYrCsSXaQ3pjOLAEFe4yHYSkVXySGnYvCoCWw9E1CAx2/S6cCZdkGCe vEsXCS+0yx5DaMkHJ8HSXPfqIbloEpw8nL+e/IBcm2PN7EeqJSdnoDfzAIJ9VNep+OkuE6N36B9K -----END CERTIFICATE----- Certplus Class 2 Primary CA =========================== -----BEGIN CERTIFICATE----- MIIDkjCCAnqgAwIBAgIRAIW9S/PY2uNp9pTXX8OlRCMwDQYJKoZIhvcNAQEFBQAwPTELMAkGA1UE BhMCRlIxETAPBgNVBAoTCENlcnRwbHVzMRswGQYDVQQDExJDbGFzcyAyIFByaW1hcnkgQ0EwHhcN OTkwNzA3MTcwNTAwWhcNMTkwNzA2MjM1OTU5WjA9MQswCQYDVQQGEwJGUjERMA8GA1UEChMIQ2Vy dHBsdXMxGzAZBgNVBAMTEkNsYXNzIDIgUHJpbWFyeSBDQTCCASIwDQYJKoZIhvcNAQEBBQADggEP ADCCAQoCggEBANxQltAS+DXSCHh6tlJw/W/uz7kRy1134ezpfgSN1sxvc0NXYKwzCkTsA18cgCSR 5aiRVhKC9+Ar9NuuYS6JEI1rbLqzAr3VNsVINyPi8Fo3UjMXEuLRYE2+L0ER4/YXJQyLkcAbmXuZ Vg2v7tK8R1fjeUl7NIknJITesezpWE7+Tt9avkGtrAjFGA7v0lPubNCdEgETjdyAYveVqUSISnFO YFWe2yMZeVYHDD9jC1yw4r5+FfyUM1hBOHTE4Y+L3yasH7WLO7dDWWuwJKZtkIvEcupdM5i3y95e e++U8Rs+yskhwcWYAqqi9lt3m/V+llU0HGdpwPFC40es/CgcZlUCAwEAAaOBjDCBiTAPBgNVHRME CDAGAQH/AgEKMAsGA1UdDwQEAwIBBjAdBgNVHQ4EFgQU43Mt38sOKAze3bOkynm4jrvoMIkwEQYJ YIZIAYb4QgEBBAQDAgEGMDcGA1UdHwQwMC4wLKAqoCiGJmh0dHA6Ly93d3cuY2VydHBsdXMuY29t L0NSTC9jbGFzczIuY3JsMA0GCSqGSIb3DQEBBQUAA4IBAQCnVM+IRBnL39R/AN9WM2K191EBkOvD P9GIROkkXe/nFL0gt5o8AP5tn9uQ3Nf0YtaLcF3n5QRIqWh8yfFC82x/xXp8HVGIutIKPidd3i1R TtMTZGnkLuPT55sJmabglZvOGtd/vjzOUrMRFcEPF80Du5wlFbqidon8BvEY0JNLDnyCt6X09l/+ 7UCmnYR0ObncHoUW2ikbhiMAybuJfm6AiB4vFLQDJKgybwOaRywwvlbGp0ICcBvqQNi6BQNwB6SW //1IMwrh3KWBkJtN3X3n57LNXMhqlfil9o3EXXgIvnsG1knPGTZQIy4I5p4FTUcY1Rbpsda2ENW7 l7+ijrRU -----END CERTIFICATE----- DST Root CA X3 ============== -----BEGIN CERTIFICATE----- MIIDSjCCAjKgAwIBAgIQRK+wgNajJ7qJMDmGLvhAazANBgkqhkiG9w0BAQUFADA/MSQwIgYDVQQK ExtEaWdpdGFsIFNpZ25hdHVyZSBUcnVzdCBDby4xFzAVBgNVBAMTDkRTVCBSb290IENBIFgzMB4X DTAwMDkzMDIxMTIxOVoXDTIxMDkzMDE0MDExNVowPzEkMCIGA1UEChMbRGlnaXRhbCBTaWduYXR1 cmUgVHJ1c3QgQ28uMRcwFQYDVQQDEw5EU1QgUm9vdCBDQSBYMzCCASIwDQYJKoZIhvcNAQEBBQAD ggEPADCCAQoCggEBAN+v6ZdQCINXtMxiZfaQguzH0yxrMMpb7NnDfcdAwRgUi+DoM3ZJKuM/IUmT rE4Orz5Iy2Xu/NMhD2XSKtkyj4zl93ewEnu1lcCJo6m67XMuegwGMoOifooUMM0RoOEqOLl5CjH9 UL2AZd+3UWODyOKIYepLYYHsUmu5ouJLGiifSKOeDNoJjj4XLh7dIN9bxiqKqy69cK3FCxolkHRy xXtqqzTWMIn/5WgTe1QLyNau7Fqckh49ZLOMxt+/yUFw7BZy1SbsOFU5Q9D8/RhcQPGX69Wam40d utolucbY38EVAjqr2m7xPi71XAicPNaDaeQQmxkqtilX4+U9m5/wAl0CAwEAAaNCMEAwDwYDVR0T AQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMCAQYwHQYDVR0OBBYEFMSnsaR7LHH62+FLkHX/xBVghYkQ MA0GCSqGSIb3DQEBBQUAA4IBAQCjGiybFwBcqR7uKGY3Or+Dxz9LwwmglSBd49lZRNI+DT69ikug dB/OEIKcdBodfpga3csTS7MgROSR6cz8faXbauX+5v3gTt23ADq1cEmv8uXrAvHRAosZy5Q6XkjE GB5YGV8eAlrwDPGxrancWYaLbumR9YbK+rlmM6pZW87ipxZzR8srzJmwN0jP41ZL9c8PDHIyh8bw RLtTcm1D9SZImlJnt1ir/md2cXjbDaJWFBM5JDGFoqgCWjBH4d1QB7wCCZAA62RjYJsWvIjJEubS fZGL+T0yjWW06XyxV3bqxbYoOb8VZRzI9neWagqNdwvYkQsEjgfbKbYK7p2CNTUQ -----END CERTIFICATE----- DST ACES CA X6 ============== -----BEGIN CERTIFICATE----- MIIECTCCAvGgAwIBAgIQDV6ZCtadt3js2AdWO4YV2TANBgkqhkiG9w0BAQUFADBbMQswCQYDVQQG EwJVUzEgMB4GA1UEChMXRGlnaXRhbCBTaWduYXR1cmUgVHJ1c3QxETAPBgNVBAsTCERTVCBBQ0VT MRcwFQYDVQQDEw5EU1QgQUNFUyBDQSBYNjAeFw0wMzExMjAyMTE5NThaFw0xNzExMjAyMTE5NTha MFsxCzAJBgNVBAYTAlVTMSAwHgYDVQQKExdEaWdpdGFsIFNpZ25hdHVyZSBUcnVzdDERMA8GA1UE CxMIRFNUIEFDRVMxFzAVBgNVBAMTDkRTVCBBQ0VTIENBIFg2MIIBIjANBgkqhkiG9w0BAQEFAAOC AQ8AMIIBCgKCAQEAuT31LMmU3HWKlV1j6IR3dma5WZFcRt2SPp/5DgO0PWGSvSMmtWPuktKe1jzI DZBfZIGxqAgNTNj50wUoUrQBJcWVHAx+PhCEdc/BGZFjz+iokYi5Q1K7gLFViYsx+tC3dr5BPTCa pCIlF3PoHuLTrCq9Wzgh1SpL11V94zpVvddtawJXa+ZHfAjIgrrep4c9oW24MFbCswKBXy314pow GCi4ZtPLAZZv6opFVdbgnf9nKxcCpk4aahELfrd755jWjHZvwTvbUJN+5dCOHze4vbrGn2zpfDPy MjwmR/onJALJfh1biEITajV8fTXpLmaRcpPVMibEdPVTo7NdmvYJywIDAQABo4HIMIHFMA8GA1Ud EwEB/wQFMAMBAf8wDgYDVR0PAQH/BAQDAgHGMB8GA1UdEQQYMBaBFHBraS1vcHNAdHJ1c3Rkc3Qu Y29tMGIGA1UdIARbMFkwVwYKYIZIAWUDAgEBATBJMEcGCCsGAQUFBwIBFjtodHRwOi8vd3d3LnRy dXN0ZHN0LmNvbS9jZXJ0aWZpY2F0ZXMvcG9saWN5L0FDRVMtaW5kZXguaHRtbDAdBgNVHQ4EFgQU CXIGThhDD+XWzMNqizF7eI+og7gwDQYJKoZIhvcNAQEFBQADggEBAKPYjtay284F5zLNAdMEA+V2 5FYrnJmQ6AgwbN99Pe7lv7UkQIRJ4dEorsTCOlMwiPH1d25Ryvr/ma8kXxug/fKshMrfqfBfBC6t Fr8hlxCBPeP/h40y3JTlR4peahPJlJU90u7INJXQgNStMgiAVDzgvVJT11J8smk/f3rPanTK+gQq nExaBqXpIK1FZg9p8d2/6eMyi/rgwYZNcjwu2JN4Cir42NInPRmJX1p7ijvMDNpRrscL9yuwNwXs vFcj4jjSm2jzVhKIT0J8uDHEtdvkyCE06UgRNe76x5JXxZ805Mf29w4LTJxoeHtxMcfrHuBnQfO3 oKfN5XozNmr6mis= -----END CERTIFICATE----- TURKTRUST Certificate Services Provider Root 2 ============================================== -----BEGIN CERTIFICATE----- MIIEPDCCAySgAwIBAgIBATANBgkqhkiG9w0BAQUFADCBvjE/MD0GA1UEAww2VMOcUktUUlVTVCBF bGVrdHJvbmlrIFNlcnRpZmlrYSBIaXptZXQgU2HEn2xhecSxY8Sxc8SxMQswCQYDVQQGEwJUUjEP MA0GA1UEBwwGQW5rYXJhMV0wWwYDVQQKDFRUw5xSS1RSVVNUIEJpbGdpIMSwbGV0acWfaW0gdmUg QmlsacWfaW0gR8O8dmVubGnEn2kgSGl6bWV0bGVyaSBBLsWeLiAoYykgS2FzxLFtIDIwMDUwHhcN MDUxMTA3MTAwNzU3WhcNMTUwOTE2MTAwNzU3WjCBvjE/MD0GA1UEAww2VMOcUktUUlVTVCBFbGVr dHJvbmlrIFNlcnRpZmlrYSBIaXptZXQgU2HEn2xhecSxY8Sxc8SxMQswCQYDVQQGEwJUUjEPMA0G A1UEBwwGQW5rYXJhMV0wWwYDVQQKDFRUw5xSS1RSVVNUIEJpbGdpIMSwbGV0acWfaW0gdmUgQmls acWfaW0gR8O8dmVubGnEn2kgSGl6bWV0bGVyaSBBLsWeLiAoYykgS2FzxLFtIDIwMDUwggEiMA0G CSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCpNn7DkUNMwxmYCMjHWHtPFoylzkkBH3MOrHUTpvqe LCDe2JAOCtFp0if7qnefJ1Il4std2NiDUBd9irWCPwSOtNXwSadktx4uXyCcUHVPr+G1QRT0mJKI x+XlZEdhR3n9wFHxwZnn3M5q+6+1ATDcRhzviuyV79z/rxAc653YsKpqhRgNF8k+v/Gb0AmJQv2g QrSdiVFVKc8bcLyEVK3BEx+Y9C52YItdP5qtygy/p1Zbj3e41Z55SZI/4PGXJHpsmxcPbe9TmJEr 5A++WXkHeLuXlfSfadRYhwqp48y2WBmfJiGxxFmNskF1wK1pzpwACPI2/z7woQ8arBT9pmAPAgMB AAGjQzBBMB0GA1UdDgQWBBTZN7NOBf3Zz58SFq62iS/rJTqIHDAPBgNVHQ8BAf8EBQMDBwYAMA8G A1UdEwEB/wQFMAMBAf8wDQYJKoZIhvcNAQEFBQADggEBAHJglrfJ3NgpXiOFX7KzLXb7iNcX/ntt Rbj2hWyfIvwqECLsqrkw9qtY1jkQMZkpAL2JZkH7dN6RwRgLn7Vhy506vvWolKMiVW4XSf/SKfE4 Jl3vpao6+XF75tpYHdN0wgH6PmlYX63LaL4ULptswLbcoCb6dxriJNoaN+BnrdFzgw2lGh1uEpJ+ hGIAF728JRhX8tepb1mIvDS3LoV4nZbcFMMsilKbloxSZj2GFotHuFEJjOp9zYhys2AzsfAKRO8P 9Qk3iCQOLGsgOqL6EfJANZxEaGM7rDNvY7wsu/LSy3Z9fYjYHcgFHW68lKlmjHdxx/qR+i9Rnuk5 UrbnBEI= -----END CERTIFICATE----- SwissSign Gold CA - G2 ====================== -----BEGIN CERTIFICATE----- MIIFujCCA6KgAwIBAgIJALtAHEP1Xk+wMA0GCSqGSIb3DQEBBQUAMEUxCzAJBgNVBAYTAkNIMRUw EwYDVQQKEwxTd2lzc1NpZ24gQUcxHzAdBgNVBAMTFlN3aXNzU2lnbiBHb2xkIENBIC0gRzIwHhcN MDYxMDI1MDgzMDM1WhcNMzYxMDI1MDgzMDM1WjBFMQswCQYDVQQGEwJDSDEVMBMGA1UEChMMU3dp c3NTaWduIEFHMR8wHQYDVQQDExZTd2lzc1NpZ24gR29sZCBDQSAtIEcyMIICIjANBgkqhkiG9w0B AQEFAAOCAg8AMIICCgKCAgEAr+TufoskDhJuqVAtFkQ7kpJcyrhdhJJCEyq8ZVeCQD5XJM1QiyUq t2/876LQwB8CJEoTlo8jE+YoWACjR8cGp4QjK7u9lit/VcyLwVcfDmJlD909Vopz2q5+bbqBHH5C jCA12UNNhPqE21Is8w4ndwtrvxEvcnifLtg+5hg3Wipy+dpikJKVyh+c6bM8K8vzARO/Ws/BtQpg vd21mWRTuKCWs2/iJneRjOBiEAKfNA+k1ZIzUd6+jbqEemA8atufK+ze3gE/bk3lUIbLtK/tREDF ylqM2tIrfKjuvqblCqoOpd8FUrdVxyJdMmqXl2MT28nbeTZ7hTpKxVKJ+STnnXepgv9VHKVxaSvR AiTysybUa9oEVeXBCsdtMDeQKuSeFDNeFhdVxVu1yzSJkvGdJo+hB9TGsnhQ2wwMC3wLjEHXuend jIj3o02yMszYF9rNt85mndT9Xv+9lz4pded+p2JYryU0pUHHPbwNUMoDAw8IWh+Vc3hiv69yFGkO peUDDniOJihC8AcLYiAQZzlG+qkDzAQ4embvIIO1jEpWjpEA/I5cgt6IoMPiaG59je883WX0XaxR 7ySArqpWl2/5rX3aYT+YdzylkbYcjCbaZaIJbcHiVOO5ykxMgI93e2CaHt+28kgeDrpOVG2Y4OGi GqJ3UM/EY5LsRxmd6+ZrzsECAwEAAaOBrDCBqTAOBgNVHQ8BAf8EBAMCAQYwDwYDVR0TAQH/BAUw AwEB/zAdBgNVHQ4EFgQUWyV7lqRlUX64OfPAeGZe6Drn8O4wHwYDVR0jBBgwFoAUWyV7lqRlUX64 OfPAeGZe6Drn8O4wRgYDVR0gBD8wPTA7BglghXQBWQECAQEwLjAsBggrBgEFBQcCARYgaHR0cDov L3JlcG9zaXRvcnkuc3dpc3NzaWduLmNvbS8wDQYJKoZIhvcNAQEFBQADggIBACe645R88a7A3hfm 5djV9VSwg/S7zV4Fe0+fdWavPOhWfvxyeDgD2StiGwC5+OlgzczOUYrHUDFu4Up+GC9pWbY9ZIEr 44OE5iKHjn3g7gKZYbge9LgriBIWhMIxkziWMaa5O1M/wySTVltpkuzFwbs4AOPsF6m43Md8AYOf Mke6UiI0HTJ6CVanfCU2qT1L2sCCbwq7EsiHSycR+R4tx5M/nttfJmtS2S6K8RTGRI0Vqbe/vd6m Gu6uLftIdxf+u+yvGPUqUfA5hJeVbG4bwyvEdGB5JbAKJ9/fXtI5z0V9QkvfsywexcZdylU6oJxp mo/a77KwPJ+HbBIrZXAVUjEaJM9vMSNQH4xPjyPDdEFjHFWoFN0+4FFQz/EbMFYOkrCChdiDyyJk vC24JdVUorgG6q2SpCSgwYa1ShNqR88uC1aVVMvOmttqtKay20EIhid392qgQmwLOM7XdVAyksLf KzAiSNDVQTglXaTpXZ/GlHXQRf0wl0OPkKsKx4ZzYEppLd6leNcG2mqeSz53OiATIgHQv2ieY2Br NU0LbbqhPcCT4H8js1WtciVORvnSFu+wZMEBnunKoGqYDs/YYPIvSbjkQuE4NRb0yG5P94FW6Lqj viOvrv1vA+ACOzB2+httQc8Bsem4yWb02ybzOqR08kkkW8mw0FfB+j564ZfJ -----END CERTIFICATE----- SwissSign Silver CA - G2 ======================== -----BEGIN CERTIFICATE----- MIIFvTCCA6WgAwIBAgIITxvUL1S7L0swDQYJKoZIhvcNAQEFBQAwRzELMAkGA1UEBhMCQ0gxFTAT BgNVBAoTDFN3aXNzU2lnbiBBRzEhMB8GA1UEAxMYU3dpc3NTaWduIFNpbHZlciBDQSAtIEcyMB4X DTA2MTAyNTA4MzI0NloXDTM2MTAyNTA4MzI0NlowRzELMAkGA1UEBhMCQ0gxFTATBgNVBAoTDFN3 aXNzU2lnbiBBRzEhMB8GA1UEAxMYU3dpc3NTaWduIFNpbHZlciBDQSAtIEcyMIICIjANBgkqhkiG 9w0BAQEFAAOCAg8AMIICCgKCAgEAxPGHf9N4Mfc4yfjDmUO8x/e8N+dOcbpLj6VzHVxumK4DV644 N0MvFz0fyM5oEMF4rhkDKxD6LHmD9ui5aLlV8gREpzn5/ASLHvGiTSf5YXu6t+WiE7brYT7QbNHm +/pe7R20nqA1W6GSy/BJkv6FCgU+5tkL4k+73JU3/JHpMjUi0R86TieFnbAVlDLaYQ1HTWBCrpJH 6INaUFjpiou5XaHc3ZlKHzZnu0jkg7Y360g6rw9njxcH6ATK72oxh9TAtvmUcXtnZLi2kUpCe2Uu MGoM9ZDulebyzYLs2aFK7PayS+VFheZteJMELpyCbTapxDFkH4aDCyr0NQp4yVXPQbBH6TCfmb5h qAaEuSh6XzjZG6k4sIN/c8HDO0gqgg8hm7jMqDXDhBuDsz6+pJVpATqJAHgE2cn0mRmrVn5bi4Y5 FZGkECwJMoBgs5PAKrYYC51+jUnyEEp/+dVGLxmSo5mnJqy7jDzmDrxHB9xzUfFwZC8I+bRHHTBs ROopN4WSaGa8gzj+ezku01DwH/teYLappvonQfGbGHLy9YR0SslnxFSuSGTfjNFusB3hB48IHpmc celM2KX3RxIfdNFRnobzwqIjQAtz20um53MGjMGg6cFZrEb65i/4z3GcRm25xBWNOHkDRUjvxF3X CO6HOSKGsg0PWEP3calILv3q1h8CAwEAAaOBrDCBqTAOBgNVHQ8BAf8EBAMCAQYwDwYDVR0TAQH/ BAUwAwEB/zAdBgNVHQ4EFgQUF6DNweRBtjpbO8tFnb0cwpj6hlgwHwYDVR0jBBgwFoAUF6DNweRB tjpbO8tFnb0cwpj6hlgwRgYDVR0gBD8wPTA7BglghXQBWQEDAQEwLjAsBggrBgEFBQcCARYgaHR0 cDovL3JlcG9zaXRvcnkuc3dpc3NzaWduLmNvbS8wDQYJKoZIhvcNAQEFBQADggIBAHPGgeAn0i0P 4JUw4ppBf1AsX19iYamGamkYDHRJ1l2E6kFSGG9YrVBWIGrGvShpWJHckRE1qTodvBqlYJ7YH39F kWnZfrt4csEGDyrOj4VwYaygzQu4OSlWhDJOhrs9xCrZ1x9y7v5RoSJBsXECYxqCsGKrXlcSH9/L 3XWgwF15kIwb4FDm3jH+mHtwX6WQ2K34ArZv02DdQEsixT2tOnqfGhpHkXkzuoLcMmkDlm4fS/Bx /uNncqCxv1yL5PqZIseEuRuNI5c/7SXgz2W79WEE790eslpBIlqhn10s6FvJbakMDHiqYMZWjwFa DGi8aRl5xB9+lwW/xekkUV7U1UtT7dkjWjYDZaPBA61BMPNGG4WQr2W11bHkFlt4dR2Xem1ZqSqP e97Dh4kQmUlzeMg9vVE1dCrV8X5pGyq7O70luJpaPXJhkGaH7gzWTdQRdAtq/gsD/KNVV4n+Ssuu WxcFyPKNIzFTONItaj+CuY0IavdeQXRuwxF+B6wpYJE/OMpXEA29MC/HpeZBoNquBYeaoKRlbEwJ DIm6uNO5wJOKMPqN5ZprFQFOZ6raYlY+hAhm0sQ2fac+EPyI4NSA5QC9qvNOBqN6avlicuMJT+ub DgEj8Z+7fNzcbBGXJbLytGMU0gYqZ4yD9c7qB9iaah7s5Aq7KkzrCWA5zspi2C5u -----END CERTIFICATE----- GeoTrust Primary Certification Authority ======================================== -----BEGIN CERTIFICATE----- MIIDfDCCAmSgAwIBAgIQGKy1av1pthU6Y2yv2vrEoTANBgkqhkiG9w0BAQUFADBYMQswCQYDVQQG EwJVUzEWMBQGA1UEChMNR2VvVHJ1c3QgSW5jLjExMC8GA1UEAxMoR2VvVHJ1c3QgUHJpbWFyeSBD ZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTAeFw0wNjExMjcwMDAwMDBaFw0zNjA3MTYyMzU5NTlaMFgx CzAJBgNVBAYTAlVTMRYwFAYDVQQKEw1HZW9UcnVzdCBJbmMuMTEwLwYDVQQDEyhHZW9UcnVzdCBQ cmltYXJ5IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIB CgKCAQEAvrgVe//UfH1nrYNke8hCUy3f9oQIIGHWAVlqnEQRr+92/ZV+zmEwu3qDXwK9AWbK7hWN b6EwnL2hhZ6UOvNWiAAxz9juapYC2e0DjPt1befquFUWBRaa9OBesYjAZIVcFU2Ix7e64HXprQU9 nceJSOC7KMgD4TCTZF5SwFlwIjVXiIrxlQqD17wxcwE07e9GceBrAqg1cmuXm2bgyxx5X9gaBGge RwLmnWDiNpcB3841kt++Z8dtd1k7j53WkBWUvEI0EME5+bEnPn7WinXFsq+W06Lem+SYvn3h6YGt tm/81w7a4DSwDRp35+MImO9Y+pyEtzavwt+s0vQQBnBxNQIDAQABo0IwQDAPBgNVHRMBAf8EBTAD AQH/MA4GA1UdDwEB/wQEAwIBBjAdBgNVHQ4EFgQULNVQQZcVi/CPNmFbSvtr2ZnJM5IwDQYJKoZI hvcNAQEFBQADggEBAFpwfyzdtzRP9YZRqSa+S7iq8XEN3GHHoOo0Hnp3DwQ16CePbJC/kRYkRj5K Ts4rFtULUh38H2eiAkUxT87z+gOneZ1TatnaYzr4gNfTmeGl4b7UVXGYNTq+k+qurUKykG/g/CFN NWMziUnWm07Kx+dOCQD32sfvmWKZd7aVIl6KoKv0uHiYyjgZmclynnjNS6yvGaBzEi38wkG6gZHa Floxt/m0cYASSJlyc1pZU8FjUjPtp8nSOQJw+uCxQmYpqptR7TBUIhRf2asdweSU8Pj1K/fqynhG 1riR/aYNKxoUAT6A8EKglQdebc3MS6RFjasS6LPeWuWgfOgPIh1a6Vk= -----END CERTIFICATE----- thawte Primary Root CA ====================== -----BEGIN CERTIFICATE----- MIIEIDCCAwigAwIBAgIQNE7VVyDV7exJ9C/ON9srbTANBgkqhkiG9w0BAQUFADCBqTELMAkGA1UE BhMCVVMxFTATBgNVBAoTDHRoYXd0ZSwgSW5jLjEoMCYGA1UECxMfQ2VydGlmaWNhdGlvbiBTZXJ2 aWNlcyBEaXZpc2lvbjE4MDYGA1UECxMvKGMpIDIwMDYgdGhhd3RlLCBJbmMuIC0gRm9yIGF1dGhv cml6ZWQgdXNlIG9ubHkxHzAdBgNVBAMTFnRoYXd0ZSBQcmltYXJ5IFJvb3QgQ0EwHhcNMDYxMTE3 MDAwMDAwWhcNMzYwNzE2MjM1OTU5WjCBqTELMAkGA1UEBhMCVVMxFTATBgNVBAoTDHRoYXd0ZSwg SW5jLjEoMCYGA1UECxMfQ2VydGlmaWNhdGlvbiBTZXJ2aWNlcyBEaXZpc2lvbjE4MDYGA1UECxMv KGMpIDIwMDYgdGhhd3RlLCBJbmMuIC0gRm9yIGF1dGhvcml6ZWQgdXNlIG9ubHkxHzAdBgNVBAMT FnRoYXd0ZSBQcmltYXJ5IFJvb3QgQ0EwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCs oPD7gFnUnMekz52hWXMJEEUMDSxuaPFsW0hoSVk3/AszGcJ3f8wQLZU0HObrTQmnHNK4yZc2AreJ 1CRfBsDMRJSUjQJib+ta3RGNKJpchJAQeg29dGYvajig4tVUROsdB58Hum/u6f1OCyn1PoSgAfGc q/gcfomk6KHYcWUNo1F77rzSImANuVud37r8UVsLr5iy6S7pBOhih94ryNdOwUxkHt3Ph1i6Sk/K aAcdHJ1KxtUvkcx8cXIcxcBn6zL9yZJclNqFwJu/U30rCfSMnZEfl2pSy94JNqR32HuHUETVPm4p afs5SSYeCaWAe0At6+gnhcn+Yf1+5nyXHdWdAgMBAAGjQjBAMA8GA1UdEwEB/wQFMAMBAf8wDgYD VR0PAQH/BAQDAgEGMB0GA1UdDgQWBBR7W0XPr87Lev0xkhpqtvNG61dIUDANBgkqhkiG9w0BAQUF AAOCAQEAeRHAS7ORtvzw6WfUDW5FvlXok9LOAz/t2iWwHVfLHjp2oEzsUHboZHIMpKnxuIvW1oeE uzLlQRHAd9mzYJ3rG9XRbkREqaYB7FViHXe4XI5ISXycO1cRrK1zN44veFyQaEfZYGDm/Ac9IiAX xPcW6cTYcvnIc3zfFi8VqT79aie2oetaupgf1eNNZAqdE8hhuvU5HIe6uL17In/2/qxAeeWsEG89 jxt5dovEN7MhGITlNgDrYyCZuen+MwS7QcjBAvlEYyCegc5C09Y/LHbTY5xZ3Y+m4Q6gLkH3LpVH z7z9M/P2C2F+fpErgUfCJzDupxBdN49cOSvkBPB7jVaMaA== -----END CERTIFICATE----- VeriSign Class 3 Public Primary Certification Authority - G5 ============================================================ -----BEGIN CERTIFICATE----- MIIE0zCCA7ugAwIBAgIQGNrRniZ96LtKIVjNzGs7SjANBgkqhkiG9w0BAQUFADCByjELMAkGA1UE BhMCVVMxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMR8wHQYDVQQLExZWZXJpU2lnbiBUcnVzdCBO ZXR3b3JrMTowOAYDVQQLEzEoYykgMjAwNiBWZXJpU2lnbiwgSW5jLiAtIEZvciBhdXRob3JpemVk IHVzZSBvbmx5MUUwQwYDVQQDEzxWZXJpU2lnbiBDbGFzcyAzIFB1YmxpYyBQcmltYXJ5IENlcnRp ZmljYXRpb24gQXV0aG9yaXR5IC0gRzUwHhcNMDYxMTA4MDAwMDAwWhcNMzYwNzE2MjM1OTU5WjCB yjELMAkGA1UEBhMCVVMxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMR8wHQYDVQQLExZWZXJpU2ln biBUcnVzdCBOZXR3b3JrMTowOAYDVQQLEzEoYykgMjAwNiBWZXJpU2lnbiwgSW5jLiAtIEZvciBh dXRob3JpemVkIHVzZSBvbmx5MUUwQwYDVQQDEzxWZXJpU2lnbiBDbGFzcyAzIFB1YmxpYyBQcmlt YXJ5IENlcnRpZmljYXRpb24gQXV0aG9yaXR5IC0gRzUwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAw ggEKAoIBAQCvJAgIKXo1nmAMqudLO07cfLw8RRy7K+D+KQL5VwijZIUVJ/XxrcgxiV0i6CqqpkKz j/i5Vbext0uz/o9+B1fs70PbZmIVYc9gDaTY3vjgw2IIPVQT60nKWVSFJuUrjxuf6/WhkcIzSdhD Y2pSS9KP6HBRTdGJaXvHcPaz3BJ023tdS1bTlr8Vd6Gw9KIl8q8ckmcY5fQGBO+QueQA5N06tRn/ Arr0PO7gi+s3i+z016zy9vA9r911kTMZHRxAy3QkGSGT2RT+rCpSx4/VBEnkjWNHiDxpg8v+R70r fk/Fla4OndTRQ8Bnc+MUCH7lP59zuDMKz10/NIeWiu5T6CUVAgMBAAGjgbIwga8wDwYDVR0TAQH/ BAUwAwEB/zAOBgNVHQ8BAf8EBAMCAQYwbQYIKwYBBQUHAQwEYTBfoV2gWzBZMFcwVRYJaW1hZ2Uv Z2lmMCEwHzAHBgUrDgMCGgQUj+XTGoasjY5rw8+AatRIGCx7GS4wJRYjaHR0cDovL2xvZ28udmVy aXNpZ24uY29tL3ZzbG9nby5naWYwHQYDVR0OBBYEFH/TZafC3ey78DAJ80M5+gKvMzEzMA0GCSqG SIb3DQEBBQUAA4IBAQCTJEowX2LP2BqYLz3q3JktvXf2pXkiOOzEp6B4Eq1iDkVwZMXnl2YtmAl+ X6/WzChl8gGqCBpH3vn5fJJaCGkgDdk+bW48DW7Y5gaRQBi5+MHt39tBquCWIMnNZBU4gcmU7qKE KQsTb47bDN0lAtukixlE0kF6BWlKWE9gyn6CagsCqiUXObXbf+eEZSqVir2G3l6BFoMtEMze/aiC Km0oHw0LxOXnGiYZ4fQRbxC1lfznQgUy286dUV4otp6F01vvpX1FQHKOtw5rDgb7MzVIcbidJ4vE ZV8NhnacRHr2lVz2XTIIM6RUthg/aFzyQkqFOFSDX9HoLPKsEdao7WNq -----END CERTIFICATE----- SecureTrust CA ============== -----BEGIN CERTIFICATE----- MIIDuDCCAqCgAwIBAgIQDPCOXAgWpa1Cf/DrJxhZ0DANBgkqhkiG9w0BAQUFADBIMQswCQYDVQQG EwJVUzEgMB4GA1UEChMXU2VjdXJlVHJ1c3QgQ29ycG9yYXRpb24xFzAVBgNVBAMTDlNlY3VyZVRy dXN0IENBMB4XDTA2MTEwNzE5MzExOFoXDTI5MTIzMTE5NDA1NVowSDELMAkGA1UEBhMCVVMxIDAe BgNVBAoTF1NlY3VyZVRydXN0IENvcnBvcmF0aW9uMRcwFQYDVQQDEw5TZWN1cmVUcnVzdCBDQTCC ASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAKukgeWVzfX2FI7CT8rU4niVWJxB4Q2ZQCQX OZEzZum+4YOvYlyJ0fwkW2Gz4BERQRwdbvC4u/jep4G6pkjGnx29vo6pQT64lO0pGtSO0gMdA+9t DWccV9cGrcrI9f4Or2YlSASWC12juhbDCE/RRvgUXPLIXgGZbf2IzIaowW8xQmxSPmjL8xk037uH GFaAJsTQ3MBv396gwpEWoGQRS0S8Hvbn+mPeZqx2pHGj7DaUaHp3pLHnDi+BeuK1cobvomuL8A/b 01k/unK8RCSc43Oz969XL0Imnal0ugBS8kvNU3xHCzaFDmapCJcWNFfBZveA4+1wVMeT4C4oFVmH ursCAwEAAaOBnTCBmjATBgkrBgEEAYI3FAIEBh4EAEMAQTALBgNVHQ8EBAMCAYYwDwYDVR0TAQH/ BAUwAwEB/zAdBgNVHQ4EFgQUQjK2FvoE/f5dS3rD/fdMQB1aQ68wNAYDVR0fBC0wKzApoCegJYYj aHR0cDovL2NybC5zZWN1cmV0cnVzdC5jb20vU1RDQS5jcmwwEAYJKwYBBAGCNxUBBAMCAQAwDQYJ KoZIhvcNAQEFBQADggEBADDtT0rhWDpSclu1pqNlGKa7UTt36Z3q059c4EVlew3KW+JwULKUBRSu SceNQQcSc5R+DCMh/bwQf2AQWnL1mA6s7Ll/3XpvXdMc9P+IBWlCqQVxyLesJugutIxq/3HcuLHf mbx8IVQr5Fiiu1cprp6poxkmD5kuCLDv/WnPmRoJjeOnnyvJNjR7JLN4TJUXpAYmHrZkUjZfYGfZ nMUFdAvnZyPSCPyI6a6Lf+Ew9Dd+/cYy2i2eRDAwbO4H3tI0/NL/QPZL9GZGBlSm8jIKYyYwa5vR 3ItHuuG51WLQoqD0ZwV4KWMabwTW+MZMo5qxN7SN5ShLHZ4swrhovO0C7jE= -----END CERTIFICATE----- Secure Global CA ================ -----BEGIN CERTIFICATE----- MIIDvDCCAqSgAwIBAgIQB1YipOjUiolN9BPI8PjqpTANBgkqhkiG9w0BAQUFADBKMQswCQYDVQQG EwJVUzEgMB4GA1UEChMXU2VjdXJlVHJ1c3QgQ29ycG9yYXRpb24xGTAXBgNVBAMTEFNlY3VyZSBH bG9iYWwgQ0EwHhcNMDYxMTA3MTk0MjI4WhcNMjkxMjMxMTk1MjA2WjBKMQswCQYDVQQGEwJVUzEg MB4GA1UEChMXU2VjdXJlVHJ1c3QgQ29ycG9yYXRpb24xGTAXBgNVBAMTEFNlY3VyZSBHbG9iYWwg Q0EwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCvNS7YrGxVaQZx5RNoJLNP2MwhR/jx YDiJiQPpvepeRlMJ3Fz1Wuj3RSoC6zFh1ykzTM7HfAo3fg+6MpjhHZevj8fcyTiW89sa/FHtaMbQ bqR8JNGuQsiWUGMu4P51/pinX0kuleM5M2SOHqRfkNJnPLLZ/kG5VacJjnIFHovdRIWCQtBJwB1g 8NEXLJXr9qXBkqPFwqcIYA1gBBCWeZ4WNOaptvolRTnIHmX5k/Wq8VLcmZg9pYYaDDUz+kulBAYV HDGA76oYa8J719rO+TMg1fW9ajMtgQT7sFzUnKPiXB3jqUJ1XnvUd+85VLrJChgbEplJL4hL/VBi 0XPnj3pDAgMBAAGjgZ0wgZowEwYJKwYBBAGCNxQCBAYeBABDAEEwCwYDVR0PBAQDAgGGMA8GA1Ud EwEB/wQFMAMBAf8wHQYDVR0OBBYEFK9EBMJBfkiD2045AuzshHrmzsmkMDQGA1UdHwQtMCswKaAn oCWGI2h0dHA6Ly9jcmwuc2VjdXJldHJ1c3QuY29tL1NHQ0EuY3JsMBAGCSsGAQQBgjcVAQQDAgEA MA0GCSqGSIb3DQEBBQUAA4IBAQBjGghAfaReUw132HquHw0LURYD7xh8yOOvaliTFGCRsoTciE6+ OYo68+aCiV0BN7OrJKQVDpI1WkpEXk5X+nXOH0jOZvQ8QCaSmGwb7iRGDBezUqXbpZGRzzfTb+cn CDpOGR86p1hcF895P4vkp9MmI50mD1hp/Ed+stCNi5O/KU9DaXR2Z0vPB4zmAve14bRDtUstFJ/5 3CYNv6ZHdAbYiNE6KTCEztI5gGIbqMdXSbxqVVFnFUq+NQfk1XWYN3kwFNspnWzFacxHVaIw98xc f8LDmBxrThaA63p4ZUWiABqvDA1VZDRIuJK58bRQKfJPIx/abKwfROHdI3hRW8cW -----END CERTIFICATE----- COMODO Certification Authority ============================== -----BEGIN CERTIFICATE----- MIIEHTCCAwWgAwIBAgIQToEtioJl4AsC7j41AkblPTANBgkqhkiG9w0BAQUFADCBgTELMAkGA1UE BhMCR0IxGzAZBgNVBAgTEkdyZWF0ZXIgTWFuY2hlc3RlcjEQMA4GA1UEBxMHU2FsZm9yZDEaMBgG A1UEChMRQ09NT0RPIENBIExpbWl0ZWQxJzAlBgNVBAMTHkNPTU9ETyBDZXJ0aWZpY2F0aW9uIEF1 dGhvcml0eTAeFw0wNjEyMDEwMDAwMDBaFw0yOTEyMzEyMzU5NTlaMIGBMQswCQYDVQQGEwJHQjEb MBkGA1UECBMSR3JlYXRlciBNYW5jaGVzdGVyMRAwDgYDVQQHEwdTYWxmb3JkMRowGAYDVQQKExFD T01PRE8gQ0EgTGltaXRlZDEnMCUGA1UEAxMeQ09NT0RPIENlcnRpZmljYXRpb24gQXV0aG9yaXR5 MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA0ECLi3LjkRv3UcEbVASY06m/weaKXTuH +7uIzg3jLz8GlvCiKVCZrts7oVewdFFxze1CkU1B/qnI2GqGd0S7WWaXUF601CxwRM/aN5VCaTww xHGzUvAhTaHYujl8HJ6jJJ3ygxaYqhZ8Q5sVW7euNJH+1GImGEaaP+vB+fGQV+useg2L23IwambV 4EajcNxo2f8ESIl33rXp+2dtQem8Ob0y2WIC8bGoPW43nOIv4tOiJovGuFVDiOEjPqXSJDlqR6sA 1KGzqSX+DT+nHbrTUcELpNqsOO9VUCQFZUaTNE8tja3G1CEZ0o7KBWFxB3NH5YoZEr0ETc5OnKVI rLsm9wIDAQABo4GOMIGLMB0GA1UdDgQWBBQLWOWLxkwVN6RAqTCpIb5HNlpW/zAOBgNVHQ8BAf8E BAMCAQYwDwYDVR0TAQH/BAUwAwEB/zBJBgNVHR8EQjBAMD6gPKA6hjhodHRwOi8vY3JsLmNvbW9k b2NhLmNvbS9DT01PRE9DZXJ0aWZpY2F0aW9uQXV0aG9yaXR5LmNybDANBgkqhkiG9w0BAQUFAAOC AQEAPpiem/Yb6dc5t3iuHXIYSdOH5EOC6z/JqvWote9VfCFSZfnVDeFs9D6Mk3ORLgLETgdxb8CP OGEIqB6BCsAvIC9Bi5HcSEW88cbeunZrM8gALTFGTO3nnc+IlP8zwFboJIYmuNg4ON8qa90SzMc/ RxdMosIGlgnW2/4/PEZB31jiVg88O8EckzXZOFKs7sjsLjBOlDW0JB9LeGna8gI4zJVSk/BwJVmc IGfE7vmLV2H0knZ9P4SNVbfo5azV8fUZVqZa+5Acr5Pr5RzUZ5ddBA6+C4OmF4O5MBKgxTMVBbkN +8cFduPYSo38NBejxiEovjBFMR7HeL5YYTisO+IBZQ== -----END CERTIFICATE----- Network Solutions Certificate Authority ======================================= -----BEGIN CERTIFICATE----- MIID5jCCAs6gAwIBAgIQV8szb8JcFuZHFhfjkDFo4DANBgkqhkiG9w0BAQUFADBiMQswCQYDVQQG EwJVUzEhMB8GA1UEChMYTmV0d29yayBTb2x1dGlvbnMgTC5MLkMuMTAwLgYDVQQDEydOZXR3b3Jr IFNvbHV0aW9ucyBDZXJ0aWZpY2F0ZSBBdXRob3JpdHkwHhcNMDYxMjAxMDAwMDAwWhcNMjkxMjMx MjM1OTU5WjBiMQswCQYDVQQGEwJVUzEhMB8GA1UEChMYTmV0d29yayBTb2x1dGlvbnMgTC5MLkMu MTAwLgYDVQQDEydOZXR3b3JrIFNvbHV0aW9ucyBDZXJ0aWZpY2F0ZSBBdXRob3JpdHkwggEiMA0G CSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDkvH6SMG3G2I4rC7xGzuAnlt7e+foS0zwzc7MEL7xx jOWftiJgPl9dzgn/ggwbmlFQGiaJ3dVhXRncEg8tCqJDXRfQNJIg6nPPOCwGJgl6cvf6UDL4wpPT aaIjzkGxzOTVHzbRijr4jGPiFFlp7Q3Tf2vouAPlT2rlmGNpSAW+Lv8ztumXWWn4Zxmuk2GWRBXT crA/vGp97Eh/jcOrqnErU2lBUzS1sLnFBgrEsEX1QV1uiUV7PTsmjHTC5dLRfbIR1PtYMiKagMnc /Qzpf14Dl847ABSHJ3A4qY5usyd2mFHgBeMhqxrVhSI8KbWaFsWAqPS7azCPL0YCorEMIuDTAgMB AAGjgZcwgZQwHQYDVR0OBBYEFCEwyfsA106Y2oeqKtCnLrFAMadMMA4GA1UdDwEB/wQEAwIBBjAP BgNVHRMBAf8EBTADAQH/MFIGA1UdHwRLMEkwR6BFoEOGQWh0dHA6Ly9jcmwubmV0c29sc3NsLmNv bS9OZXR3b3JrU29sdXRpb25zQ2VydGlmaWNhdGVBdXRob3JpdHkuY3JsMA0GCSqGSIb3DQEBBQUA A4IBAQC7rkvnt1frf6ott3NHhWrB5KUd5Oc86fRZZXe1eltajSU24HqXLjjAV2CDmAaDn7l2em5Q 4LqILPxFzBiwmZVRDuwduIj/h1AcgsLj4DKAv6ALR8jDMe+ZZzKATxcheQxpXN5eNK4CtSbqUN9/ GGUsyfJj4akH/nxxH2szJGoeBfcFaMBqEssuXmHLrijTfsK0ZpEmXzwuJF/LWA/rKOyvEZbz3Htv wKeI8lN3s2Berq4o2jUsbzRF0ybh3uxbTydrFny9RAQYgrOJeRcQcT16ohZO9QHNpGxlaKFJdlxD ydi8NmdspZS11My5vWo1ViHe2MPr+8ukYEywVaCge1ey -----END CERTIFICATE----- WellsSecure Public Root Certificate Authority ============================================= -----BEGIN CERTIFICATE----- MIIEvTCCA6WgAwIBAgIBATANBgkqhkiG9w0BAQUFADCBhTELMAkGA1UEBhMCVVMxIDAeBgNVBAoM F1dlbGxzIEZhcmdvIFdlbGxzU2VjdXJlMRwwGgYDVQQLDBNXZWxscyBGYXJnbyBCYW5rIE5BMTYw NAYDVQQDDC1XZWxsc1NlY3VyZSBQdWJsaWMgUm9vdCBDZXJ0aWZpY2F0ZSBBdXRob3JpdHkwHhcN MDcxMjEzMTcwNzU0WhcNMjIxMjE0MDAwNzU0WjCBhTELMAkGA1UEBhMCVVMxIDAeBgNVBAoMF1dl bGxzIEZhcmdvIFdlbGxzU2VjdXJlMRwwGgYDVQQLDBNXZWxscyBGYXJnbyBCYW5rIE5BMTYwNAYD VQQDDC1XZWxsc1NlY3VyZSBQdWJsaWMgUm9vdCBDZXJ0aWZpY2F0ZSBBdXRob3JpdHkwggEiMA0G CSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDub7S9eeKPCCGeOARBJe+rWxxTkqxtnt3CxC5FlAM1 iGd0V+PfjLindo8796jE2yljDpFoNoqXjopxaAkH5OjUDk/41itMpBb570OYj7OeUt9tkTmPOL13 i0Nj67eT/DBMHAGTthP796EfvyXhdDcsHqRePGj4S78NuR4uNuip5Kf4D8uCdXw1LSLWwr8L87T8 bJVhHlfXBIEyg1J55oNjz7fLY4sR4r1e6/aN7ZVyKLSsEmLpSjPmgzKuBXWVvYSV2ypcm44uDLiB K0HmOFafSZtsdvqKXfcBeYF8wYNABf5x/Qw/zE5gCQ5lRxAvAcAFP4/4s0HvWkJ+We/SlwxlAgMB AAGjggE0MIIBMDAPBgNVHRMBAf8EBTADAQH/MDkGA1UdHwQyMDAwLqAsoCqGKGh0dHA6Ly9jcmwu cGtpLndlbGxzZmFyZ28uY29tL3dzcHJjYS5jcmwwDgYDVR0PAQH/BAQDAgHGMB0GA1UdDgQWBBQm lRkQ2eihl5H/3BnZtQQ+0nMKajCBsgYDVR0jBIGqMIGngBQmlRkQ2eihl5H/3BnZtQQ+0nMKaqGB i6SBiDCBhTELMAkGA1UEBhMCVVMxIDAeBgNVBAoMF1dlbGxzIEZhcmdvIFdlbGxzU2VjdXJlMRww GgYDVQQLDBNXZWxscyBGYXJnbyBCYW5rIE5BMTYwNAYDVQQDDC1XZWxsc1NlY3VyZSBQdWJsaWMg Um9vdCBDZXJ0aWZpY2F0ZSBBdXRob3JpdHmCAQEwDQYJKoZIhvcNAQEFBQADggEBALkVsUSRzCPI K0134/iaeycNzXK7mQDKfGYZUMbVmO2rvwNa5U3lHshPcZeG1eMd/ZDJPHV3V3p9+N701NX3leZ0 bh08rnyd2wIDBSxxSyU+B+NemvVmFymIGjifz6pBA4SXa5M4esowRBskRDPQ5NHcKDj0E0M1NSlj qHyita04pO2t/caaH/+Xc/77szWnk4bGdpEA5qxRFsQnMlzbc9qlk1eOPm01JghZ1edE13YgY+es E2fDbbFwRnzVlhE9iW9dqKHrjQrawx0zbKPqZxmamX9LPYNRKh3KL4YMon4QLSvUFpULB6ouFJJJ tylv2G0xffX8oRAHh84vWdw+WNs= -----END CERTIFICATE----- COMODO ECC Certification Authority ================================== -----BEGIN CERTIFICATE----- MIICiTCCAg+gAwIBAgIQH0evqmIAcFBUTAGem2OZKjAKBggqhkjOPQQDAzCBhTELMAkGA1UEBhMC R0IxGzAZBgNVBAgTEkdyZWF0ZXIgTWFuY2hlc3RlcjEQMA4GA1UEBxMHU2FsZm9yZDEaMBgGA1UE ChMRQ09NT0RPIENBIExpbWl0ZWQxKzApBgNVBAMTIkNPTU9ETyBFQ0MgQ2VydGlmaWNhdGlvbiBB dXRob3JpdHkwHhcNMDgwMzA2MDAwMDAwWhcNMzgwMTE4MjM1OTU5WjCBhTELMAkGA1UEBhMCR0Ix GzAZBgNVBAgTEkdyZWF0ZXIgTWFuY2hlc3RlcjEQMA4GA1UEBxMHU2FsZm9yZDEaMBgGA1UEChMR Q09NT0RPIENBIExpbWl0ZWQxKzApBgNVBAMTIkNPTU9ETyBFQ0MgQ2VydGlmaWNhdGlvbiBBdXRo b3JpdHkwdjAQBgcqhkjOPQIBBgUrgQQAIgNiAAQDR3svdcmCFYX7deSRFtSrYpn1PlILBs5BAH+X 4QokPB0BBO490o0JlwzgdeT6+3eKKvUDYEs2ixYjFq0JcfRK9ChQtP6IHG4/bC8vCVlbpVsLM5ni wz2J+Wos77LTBumjQjBAMB0GA1UdDgQWBBR1cacZSBm8nZ3qQUfflMRId5nTeTAOBgNVHQ8BAf8E BAMCAQYwDwYDVR0TAQH/BAUwAwEB/zAKBggqhkjOPQQDAwNoADBlAjEA7wNbeqy3eApyt4jf/7VG FAkK+qDmfQjGGoe9GKhzvSbKYAydzpmfz1wPMOG+FDHqAjAU9JM8SaczepBGR7NjfRObTrdvGDeA U/7dIOA1mjbRxwG55tzd8/8dLDoWV9mSOdY= -----END CERTIFICATE----- IGC/A ===== -----BEGIN CERTIFICATE----- MIIEAjCCAuqgAwIBAgIFORFFEJQwDQYJKoZIhvcNAQEFBQAwgYUxCzAJBgNVBAYTAkZSMQ8wDQYD VQQIEwZGcmFuY2UxDjAMBgNVBAcTBVBhcmlzMRAwDgYDVQQKEwdQTS9TR0ROMQ4wDAYDVQQLEwVE Q1NTSTEOMAwGA1UEAxMFSUdDL0ExIzAhBgkqhkiG9w0BCQEWFGlnY2FAc2dkbi5wbS5nb3V2LmZy MB4XDTAyMTIxMzE0MjkyM1oXDTIwMTAxNzE0MjkyMlowgYUxCzAJBgNVBAYTAkZSMQ8wDQYDVQQI EwZGcmFuY2UxDjAMBgNVBAcTBVBhcmlzMRAwDgYDVQQKEwdQTS9TR0ROMQ4wDAYDVQQLEwVEQ1NT STEOMAwGA1UEAxMFSUdDL0ExIzAhBgkqhkiG9w0BCQEWFGlnY2FAc2dkbi5wbS5nb3V2LmZyMIIB IjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAsh/R0GLFMzvABIaIs9z4iPf930Pfeo2aSVz2 TqrMHLmh6yeJ8kbpO0px1R2OLc/mratjUMdUC24SyZA2xtgv2pGqaMVy/hcKshd+ebUyiHDKcMCW So7kVc0dJ5S/znIq7Fz5cyD+vfcuiWe4u0dzEvfRNWk68gq5rv9GQkaiv6GFGvm/5P9JhfejcIYy HF2fYPepraX/z9E0+X1bF8bc1g4oa8Ld8fUzaJ1O/Id8NhLWo4DoQw1VYZTqZDdH6nfK0LJYBcNd frGoRpAxVs5wKpayMLh35nnAvSk7/ZR3TL0gzUEl4C7HG7vupARB0l2tEmqKm0f7yd1GQOGdPDPQ tQIDAQABo3cwdTAPBgNVHRMBAf8EBTADAQH/MAsGA1UdDwQEAwIBRjAVBgNVHSAEDjAMMAoGCCqB egF5AQEBMB0GA1UdDgQWBBSjBS8YYFDCiQrdKyFP/45OqDAxNjAfBgNVHSMEGDAWgBSjBS8YYFDC iQrdKyFP/45OqDAxNjANBgkqhkiG9w0BAQUFAAOCAQEABdwm2Pp3FURo/C9mOnTgXeQp/wYHE4RK q89toB9RlPhJy3Q2FLwV3duJL92PoF189RLrn544pEfMs5bZvpwlqwN+Mw+VgQ39FuCIvjfwbF3Q MZsyK10XZZOYYLxuj7GoPB7ZHPOpJkL5ZB3C55L29B5aqhlSXa/oovdgoPaN8In1buAKBQGVyYsg Crpa/JosPL3Dt8ldeCUFP1YUmwza+zpI/pdpXsoQhvdOlgQITeywvl3cO45Pwf2aNjSaTFR+FwNI lQgRHAdvhQh+XU3Endv7rs6y0bO4g2wdsrN58dhwmX7wEwLOXt1R0982gaEbeC9xs/FZTEYYKKuF 0mBWWg== -----END CERTIFICATE----- Security Communication EV RootCA1 ================================= -----BEGIN CERTIFICATE----- MIIDfTCCAmWgAwIBAgIBADANBgkqhkiG9w0BAQUFADBgMQswCQYDVQQGEwJKUDElMCMGA1UEChMc U0VDT00gVHJ1c3QgU3lzdGVtcyBDTy4sTFRELjEqMCgGA1UECxMhU2VjdXJpdHkgQ29tbXVuaWNh dGlvbiBFViBSb290Q0ExMB4XDTA3MDYwNjAyMTIzMloXDTM3MDYwNjAyMTIzMlowYDELMAkGA1UE BhMCSlAxJTAjBgNVBAoTHFNFQ09NIFRydXN0IFN5c3RlbXMgQ08uLExURC4xKjAoBgNVBAsTIVNl Y3VyaXR5IENvbW11bmljYXRpb24gRVYgUm9vdENBMTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCC AQoCggEBALx/7FebJOD+nLpCeamIivqA4PUHKUPqjgo0No0c+qe1OXj/l3X3L+SqawSERMqm4miO /VVQYg+kcQ7OBzgtQoVQrTyWb4vVog7P3kmJPdZkLjjlHmy1V4qe70gOzXppFodEtZDkBp2uoQSX WHnvIEqCa4wiv+wfD+mEce3xDuS4GBPMVjZd0ZoeUWs5bmB2iDQL87PRsJ3KYeJkHcFGB7hj3R4z ZbOOCVVSPbW9/wfrrWFVGCypaZhKqkDFMxRldAD5kd6vA0jFQFTcD4SQaCDFkpbcLuUCRarAX1T4 bepJz11sS6/vmsJWXMY1VkJqMF/Cq/biPT+zyRGPMUzXn0kCAwEAAaNCMEAwHQYDVR0OBBYEFDVK 9U2vP9eCOKyrcWUXdYydVZPmMA4GA1UdDwEB/wQEAwIBBjAPBgNVHRMBAf8EBTADAQH/MA0GCSqG SIb3DQEBBQUAA4IBAQCoh+ns+EBnXcPBZsdAS5f8hxOQWsTvoMpfi7ent/HWtWS3irO4G8za+6xm iEHO6Pzk2x6Ipu0nUBsCMCRGef4Eh3CXQHPRwMFXGZpppSeZq51ihPZRwSzJIxXYKLerJRO1RuGG Av8mjMSIkh1W/hln8lXkgKNrnKt34VFxDSDbEJrbvXZ5B3eZKK2aXtqxT0QsNY6llsf9g/BYxnnW mHyojf6GPgcWkuF75x3sM3Z+Qi5KhfmRiWiEA4Glm5q+4zfFVKtWOxgtQaQM+ELbmaDgcm+7XeEW T1MKZPlO9L9OVL14bIjqv5wTJMJwaaJ/D8g8rQjJsJhAoyrniIPtd490 -----END CERTIFICATE----- OISTE WISeKey Global Root GA CA =============================== -----BEGIN CERTIFICATE----- MIID8TCCAtmgAwIBAgIQQT1yx/RrH4FDffHSKFTfmjANBgkqhkiG9w0BAQUFADCBijELMAkGA1UE BhMCQ0gxEDAOBgNVBAoTB1dJU2VLZXkxGzAZBgNVBAsTEkNvcHlyaWdodCAoYykgMjAwNTEiMCAG A1UECxMZT0lTVEUgRm91bmRhdGlvbiBFbmRvcnNlZDEoMCYGA1UEAxMfT0lTVEUgV0lTZUtleSBH bG9iYWwgUm9vdCBHQSBDQTAeFw0wNTEyMTExNjAzNDRaFw0zNzEyMTExNjA5NTFaMIGKMQswCQYD VQQGEwJDSDEQMA4GA1UEChMHV0lTZUtleTEbMBkGA1UECxMSQ29weXJpZ2h0IChjKSAyMDA1MSIw IAYDVQQLExlPSVNURSBGb3VuZGF0aW9uIEVuZG9yc2VkMSgwJgYDVQQDEx9PSVNURSBXSVNlS2V5 IEdsb2JhbCBSb290IEdBIENBMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAy0+zAJs9 Nt350UlqaxBJH+zYK7LG+DKBKUOVTJoZIyEVRd7jyBxRVVuuk+g3/ytr6dTqvirdqFEr12bDYVxg Asj1znJ7O7jyTmUIms2kahnBAbtzptf2w93NvKSLtZlhuAGio9RN1AU9ka34tAhxZK9w8RxrfvbD d50kc3vkDIzh2TbhmYsFmQvtRTEJysIA2/dyoJaqlYfQjse2YXMNdmaM3Bu0Y6Kff5MTMPGhJ9vZ /yxViJGg4E8HsChWjBgbl0SOid3gF27nKu+POQoxhILYQBRJLnpB5Kf+42TMwVlxSywhp1t94B3R LoGbw9ho972WG6xwsRYUC9tguSYBBQIDAQABo1EwTzALBgNVHQ8EBAMCAYYwDwYDVR0TAQH/BAUw AwEB/zAdBgNVHQ4EFgQUswN+rja8sHnR3JQmthG+IbJphpQwEAYJKwYBBAGCNxUBBAMCAQAwDQYJ KoZIhvcNAQEFBQADggEBAEuh/wuHbrP5wUOxSPMowB0uyQlB+pQAHKSkq0lPjz0e701vvbyk9vIm MMkQyh2I+3QZH4VFvbBsUfk2ftv1TDI6QU9bR8/oCy22xBmddMVHxjtqD6wU2zz0c5ypBd8A3HR4 +vg1YFkCExh8vPtNsCBtQ7tgMHpnM1zFmdH4LTlSc/uMqpclXHLZCB6rTjzjgTGfA6b7wP4piFXa hNVQA7bihKOmNqoROgHhGEvWRGizPflTdISzRpFGlgC3gCy24eMQ4tui5yiPAZZiFj4A4xylNoEY okxSdsARo27mHbrjWr42U8U+dY+GaSlYU7Wcu2+fXMUY7N0v4ZjJ/L7fCg0= -----END CERTIFICATE----- Microsec e-Szigno Root CA ========================= -----BEGIN CERTIFICATE----- MIIHqDCCBpCgAwIBAgIRAMy4579OKRr9otxmpRwsDxEwDQYJKoZIhvcNAQEFBQAwcjELMAkGA1UE BhMCSFUxETAPBgNVBAcTCEJ1ZGFwZXN0MRYwFAYDVQQKEw1NaWNyb3NlYyBMdGQuMRQwEgYDVQQL EwtlLVN6aWdubyBDQTEiMCAGA1UEAxMZTWljcm9zZWMgZS1Temlnbm8gUm9vdCBDQTAeFw0wNTA0 MDYxMjI4NDRaFw0xNzA0MDYxMjI4NDRaMHIxCzAJBgNVBAYTAkhVMREwDwYDVQQHEwhCdWRhcGVz dDEWMBQGA1UEChMNTWljcm9zZWMgTHRkLjEUMBIGA1UECxMLZS1Temlnbm8gQ0ExIjAgBgNVBAMT GU1pY3Jvc2VjIGUtU3ppZ25vIFJvb3QgQ0EwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIB AQDtyADVgXvNOABHzNuEwSFpLHSQDCHZU4ftPkNEU6+r+ICbPHiN1I2uuO/TEdyB5s87lozWbxXG d36hL+BfkrYn13aaHUM86tnsL+4582pnS4uCzyL4ZVX+LMsvfUh6PXX5qqAnu3jCBspRwn5mS6/N oqdNAoI/gqyFxuEPkEeZlApxcpMqyabAvjxWTHOSJ/FrtfX9/DAFYJLG65Z+AZHCabEeHXtTRbjc QR/Ji3HWVBTji1R4P770Yjtb9aPs1ZJ04nQw7wHb4dSrmZsqa/i9phyGI0Jf7Enemotb9HI6QMVJ PqW+jqpx62z69Rrkav17fVVA71hu5tnVvCSrwe+3AgMBAAGjggQ3MIIEMzBnBggrBgEFBQcBAQRb MFkwKAYIKwYBBQUHMAGGHGh0dHBzOi8vcmNhLmUtc3ppZ25vLmh1L29jc3AwLQYIKwYBBQUHMAKG IWh0dHA6Ly93d3cuZS1zemlnbm8uaHUvUm9vdENBLmNydDAPBgNVHRMBAf8EBTADAQH/MIIBcwYD VR0gBIIBajCCAWYwggFiBgwrBgEEAYGoGAIBAQEwggFQMCgGCCsGAQUFBwIBFhxodHRwOi8vd3d3 LmUtc3ppZ25vLmh1L1NaU1ovMIIBIgYIKwYBBQUHAgIwggEUHoIBEABBACAAdABhAG4A+gBzAO0A dAB2AOEAbgB5ACAA6QByAHQAZQBsAG0AZQB6AOkAcwDpAGgAZQB6ACAA6QBzACAAZQBsAGYAbwBn AGEAZADhAHMA4QBoAG8AegAgAGEAIABTAHoAbwBsAGcA4QBsAHQAYQB0APMAIABTAHoAbwBsAGcA 4QBsAHQAYQB0AOEAcwBpACAAUwB6AGEAYgDhAGwAeQB6AGEAdABhACAAcwB6AGUAcgBpAG4AdAAg AGsAZQBsAGwAIABlAGwAagDhAHIAbgBpADoAIABoAHQAdABwADoALwAvAHcAdwB3AC4AZQAtAHMA egBpAGcAbgBvAC4AaAB1AC8AUwBaAFMAWgAvMIHIBgNVHR8EgcAwgb0wgbqggbeggbSGIWh0dHA6 Ly93d3cuZS1zemlnbm8uaHUvUm9vdENBLmNybIaBjmxkYXA6Ly9sZGFwLmUtc3ppZ25vLmh1L0NO PU1pY3Jvc2VjJTIwZS1Temlnbm8lMjBSb290JTIwQ0EsT1U9ZS1Temlnbm8lMjBDQSxPPU1pY3Jv c2VjJTIwTHRkLixMPUJ1ZGFwZXN0LEM9SFU/Y2VydGlmaWNhdGVSZXZvY2F0aW9uTGlzdDtiaW5h cnkwDgYDVR0PAQH/BAQDAgEGMIGWBgNVHREEgY4wgYuBEGluZm9AZS1zemlnbm8uaHWkdzB1MSMw IQYDVQQDDBpNaWNyb3NlYyBlLVN6aWduw7MgUm9vdCBDQTEWMBQGA1UECwwNZS1TemlnbsOzIEhT WjEWMBQGA1UEChMNTWljcm9zZWMgS2Z0LjERMA8GA1UEBxMIQnVkYXBlc3QxCzAJBgNVBAYTAkhV MIGsBgNVHSMEgaQwgaGAFMegSXUWYYTbMUuE0vE3QJDvTtz3oXakdDByMQswCQYDVQQGEwJIVTER MA8GA1UEBxMIQnVkYXBlc3QxFjAUBgNVBAoTDU1pY3Jvc2VjIEx0ZC4xFDASBgNVBAsTC2UtU3pp Z25vIENBMSIwIAYDVQQDExlNaWNyb3NlYyBlLVN6aWdubyBSb290IENBghEAzLjnv04pGv2i3Gal HCwPETAdBgNVHQ4EFgQUx6BJdRZhhNsxS4TS8TdAkO9O3PcwDQYJKoZIhvcNAQEFBQADggEBANMT nGZjWS7KXHAM/IO8VbH0jgdsZifOwTsgqRy7RlRw7lrMoHfqaEQn6/Ip3Xep1fvj1KcExJW4C+FE aGAHQzAxQmHl7tnlJNUb3+FKG6qfx1/4ehHqE5MAyopYse7tDk2016g2JnzgOsHVV4Lxdbb9iV/a 86g4nzUGCM4ilb7N1fy+W955a9x6qWVmvrElWl/tftOsRm1M9DKHtCAE4Gx4sHfRhUZLphK3dehK yVZs15KrnfVJONJPU+NVkBHbmJbGSfI+9J8b4PeI3CVimUTYc78/MPMMNz7UwiiAc7EBt51alhQB S6kRnSlqLtBdgcDPsiBDxwPgN05dCtxZICU= -----END CERTIFICATE----- Certigna ======== -----BEGIN CERTIFICATE----- MIIDqDCCApCgAwIBAgIJAP7c4wEPyUj/MA0GCSqGSIb3DQEBBQUAMDQxCzAJBgNVBAYTAkZSMRIw EAYDVQQKDAlEaGlteW90aXMxETAPBgNVBAMMCENlcnRpZ25hMB4XDTA3MDYyOTE1MTMwNVoXDTI3 MDYyOTE1MTMwNVowNDELMAkGA1UEBhMCRlIxEjAQBgNVBAoMCURoaW15b3RpczERMA8GA1UEAwwI Q2VydGlnbmEwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDIaPHJ1tazNHUmgh7stL7q XOEm7RFHYeGifBZ4QCHkYJ5ayGPhxLGWkv8YbWkj4Sti993iNi+RB7lIzw7sebYs5zRLcAglozyH GxnygQcPOJAZ0xH+hrTy0V4eHpbNgGzOOzGTtvKg0KmVEn2lmsxryIRWijOp5yIVUxbwzBfsV1/p ogqYCd7jX5xv3EjjhQsVWqa6n6xI4wmy9/Qy3l40vhx4XUJbzg4ij02Q130yGLMLLGq/jj8UEYkg DncUtT2UCIf3JR7VsmAA7G8qKCVuKj4YYxclPz5EIBb2JsglrgVKtOdjLPOMFlN+XPsRGgjBRmKf Irjxwo1p3Po6WAbfAgMBAAGjgbwwgbkwDwYDVR0TAQH/BAUwAwEB/zAdBgNVHQ4EFgQUGu3+QTmQ tCRZvgHyUtVF9lo53BEwZAYDVR0jBF0wW4AUGu3+QTmQtCRZvgHyUtVF9lo53BGhOKQ2MDQxCzAJ BgNVBAYTAkZSMRIwEAYDVQQKDAlEaGlteW90aXMxETAPBgNVBAMMCENlcnRpZ25hggkA/tzjAQ/J SP8wDgYDVR0PAQH/BAQDAgEGMBEGCWCGSAGG+EIBAQQEAwIABzANBgkqhkiG9w0BAQUFAAOCAQEA hQMeknH2Qq/ho2Ge6/PAD/Kl1NqV5ta+aDY9fm4fTIrv0Q8hbV6lUmPOEvjvKtpv6zf+EwLHyzs+ ImvaYS5/1HI93TDhHkxAGYwP15zRgzB7mFncfca5DClMoTOi62c6ZYTTluLtdkVwj7Ur3vkj1klu PBS1xp81HlDQwY9qcEQCYsuuHWhBp6pX6FOqB9IG9tUUBguRA3UsbHK1YZWaDYu5Def131TN3ubY 1gkIl2PlwS6wt0QmwCbAr1UwnjvVNioZBPRcHv/PLLf/0P2HQBHVESO7SMAhqaQoLf0V+LBOK/Qw WyH8EZE0vkHve52Xdf+XlcCWWC/qu0bXu+TZLg== -----END CERTIFICATE----- Deutsche Telekom Root CA 2 ========================== -----BEGIN CERTIFICATE----- MIIDnzCCAoegAwIBAgIBJjANBgkqhkiG9w0BAQUFADBxMQswCQYDVQQGEwJERTEcMBoGA1UEChMT RGV1dHNjaGUgVGVsZWtvbSBBRzEfMB0GA1UECxMWVC1UZWxlU2VjIFRydXN0IENlbnRlcjEjMCEG A1UEAxMaRGV1dHNjaGUgVGVsZWtvbSBSb290IENBIDIwHhcNOTkwNzA5MTIxMTAwWhcNMTkwNzA5 MjM1OTAwWjBxMQswCQYDVQQGEwJERTEcMBoGA1UEChMTRGV1dHNjaGUgVGVsZWtvbSBBRzEfMB0G A1UECxMWVC1UZWxlU2VjIFRydXN0IENlbnRlcjEjMCEGA1UEAxMaRGV1dHNjaGUgVGVsZWtvbSBS b290IENBIDIwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCrC6M14IspFLEUha88EOQ5 bzVdSq7d6mGNlUn0b2SjGmBmpKlAIoTZ1KXleJMOaAGtuU1cOs7TuKhCQN/Po7qCWWqSG6wcmtoI KyUn+WkjR/Hg6yx6m/UTAtB+NHzCnjwAWav12gz1MjwrrFDa1sPeg5TKqAyZMg4ISFZbavva4VhY AUlfckE8FQYBjl2tqriTtM2e66foai1SNNs671x1Udrb8zH57nGYMsRUFUQM+ZtV7a3fGAigo4aK Se5TBY8ZTNXeWHmb0mocQqvF1afPaA+W5OFhmHZhyJF81j4A4pFQh+GdCuatl9Idxjp9y7zaAzTV jlsB9WoHtxa2bkp/AgMBAAGjQjBAMB0GA1UdDgQWBBQxw3kbuvVT1xfgiXotF2wKsyudMzAPBgNV HRMECDAGAQH/AgEFMA4GA1UdDwEB/wQEAwIBBjANBgkqhkiG9w0BAQUFAAOCAQEAlGRZrTlk5ynr E/5aw4sTV8gEJPB0d8Bg42f76Ymmg7+Wgnxu1MM9756AbrsptJh6sTtU6zkXR34ajgv8HzFZMQSy zhfzLMdiNlXiItiJVbSYSKpk+tYcNthEeFpaIzpXl/V6ME+un2pMSyuOoAPjPuCp1NJ70rOo4nI8 rZ7/gFnkm0W09juwzTkZmDLl6iFhkOQxIY40sfcvNUqFENrnijchvllj4PKFiDFT1FQUhXB59C4G dyd1Lx+4ivn+xbrYNuSD7Odlt79jWvNGr4GUN9RBjNYj1h7P9WgbRGOiWrqnNVmh5XAFmw4jV5mU Cm26OWMohpLzGITY+9HPBVZkVw== -----END CERTIFICATE----- Cybertrust Global Root ====================== -----BEGIN CERTIFICATE----- MIIDoTCCAomgAwIBAgILBAAAAAABD4WqLUgwDQYJKoZIhvcNAQEFBQAwOzEYMBYGA1UEChMPQ3li ZXJ0cnVzdCwgSW5jMR8wHQYDVQQDExZDeWJlcnRydXN0IEdsb2JhbCBSb290MB4XDTA2MTIxNTA4 MDAwMFoXDTIxMTIxNTA4MDAwMFowOzEYMBYGA1UEChMPQ3liZXJ0cnVzdCwgSW5jMR8wHQYDVQQD ExZDeWJlcnRydXN0IEdsb2JhbCBSb290MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA +Mi8vRRQZhP/8NN57CPytxrHjoXxEnOmGaoQ25yiZXRadz5RfVb23CO21O1fWLE3TdVJDm71aofW 0ozSJ8bi/zafmGWgE07GKmSb1ZASzxQG9Dvj1Ci+6A74q05IlG2OlTEQXO2iLb3VOm2yHLtgwEZL AfVJrn5GitB0jaEMAs7u/OePuGtm839EAL9mJRQr3RAwHQeWP032a7iPt3sMpTjr3kfb1V05/Iin 89cqdPHoWqI7n1C6poxFNcJQZZXcY4Lv3b93TZxiyWNzFtApD0mpSPCzqrdsxacwOUBdrsTiXSZT 8M4cIwhhqJQZugRiQOwfOHB3EgZxpzAYXSUnpQIDAQABo4GlMIGiMA4GA1UdDwEB/wQEAwIBBjAP BgNVHRMBAf8EBTADAQH/MB0GA1UdDgQWBBS2CHsNesysIEyGVjJez6tuhS1wVzA/BgNVHR8EODA2 MDSgMqAwhi5odHRwOi8vd3d3Mi5wdWJsaWMtdHJ1c3QuY29tL2NybC9jdC9jdHJvb3QuY3JsMB8G A1UdIwQYMBaAFLYIew16zKwgTIZWMl7Pq26FLXBXMA0GCSqGSIb3DQEBBQUAA4IBAQBW7wojoFRO lZfJ+InaRcHUowAl9B8Tq7ejhVhpwjCt2BWKLePJzYFa+HMjWqd8BfP9IjsO0QbE2zZMcwSO5bAi 5MXzLqXZI+O4Tkogp24CJJ8iYGd7ix1yCcUxXOl5n4BHPa2hCwcUPUf/A2kaDAtE52Mlp3+yybh2 hO0j9n0Hq0V+09+zv+mKts2oomcrUtW3ZfA5TGOgkXmTUg9U3YO7n9GPp1Nzw8v/MOx8BLjYRB+T X3EJIrduPuocA06dGiBh+4E37F78CkWr1+cXVdCg6mCbpvbjjFspwgZgFJ0tl0ypkxWdYcQBX0jW WL1WMRJOEcgh4LMRkWXbtKaIOM5V -----END CERTIFICATE----- ePKI Root Certification Authority ================================= -----BEGIN CERTIFICATE----- MIIFsDCCA5igAwIBAgIQFci9ZUdcr7iXAF7kBtK8nTANBgkqhkiG9w0BAQUFADBeMQswCQYDVQQG EwJUVzEjMCEGA1UECgwaQ2h1bmdod2EgVGVsZWNvbSBDby4sIEx0ZC4xKjAoBgNVBAsMIWVQS0kg Um9vdCBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTAeFw0wNDEyMjAwMjMxMjdaFw0zNDEyMjAwMjMx MjdaMF4xCzAJBgNVBAYTAlRXMSMwIQYDVQQKDBpDaHVuZ2h3YSBUZWxlY29tIENvLiwgTHRkLjEq MCgGA1UECwwhZVBLSSBSb290IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MIICIjANBgkqhkiG9w0B AQEFAAOCAg8AMIICCgKCAgEA4SUP7o3biDN1Z82tH306Tm2d0y8U82N0ywEhajfqhFAHSyZbCUNs IZ5qyNUD9WBpj8zwIuQf5/dqIjG3LBXy4P4AakP/h2XGtRrBp0xtInAhijHyl3SJCRImHJ7K2RKi lTza6We/CKBk49ZCt0Xvl/T29de1ShUCWH2YWEtgvM3XDZoTM1PRYfl61dd4s5oz9wCGzh1NlDiv qOx4UXCKXBCDUSH3ET00hl7lSM2XgYI1TBnsZfZrxQWh7kcT1rMhJ5QQCtkkO7q+RBNGMD+XPNjX 12ruOzjjK9SXDrkb5wdJfzcq+Xd4z1TtW0ado4AOkUPB1ltfFLqfpo0kR0BZv3I4sjZsN/+Z0V0O WQqraffAsgRFelQArr5T9rXn4fg8ozHSqf4hUmTFpmfwdQcGlBSBVcYn5AGPF8Fqcde+S/uUWH1+ ETOxQvdibBjWzwloPn9s9h6PYq2lY9sJpx8iQkEeb5mKPtf5P0B6ebClAZLSnT0IFaUQAS2zMnao lQ2zepr7BxB4EW/hj8e6DyUadCrlHJhBmd8hh+iVBmoKs2pHdmX2Os+PYhcZewoozRrSgx4hxyy/ vv9haLdnG7t4TY3OZ+XkwY63I2binZB1NJipNiuKmpS5nezMirH4JYlcWrYvjB9teSSnUmjDhDXi Zo1jDiVN1Rmy5nk3pyKdVDECAwEAAaNqMGgwHQYDVR0OBBYEFB4M97Zn8uGSJglFwFU5Lnc/Qkqi MAwGA1UdEwQFMAMBAf8wOQYEZyoHAAQxMC8wLQIBADAJBgUrDgMCGgUAMAcGBWcqAwAABBRFsMLH ClZ87lt4DJX5GFPBphzYEDANBgkqhkiG9w0BAQUFAAOCAgEACbODU1kBPpVJufGBuvl2ICO1J2B0 1GqZNF5sAFPZn/KmsSQHRGoqxqWOeBLoR9lYGxMqXnmbnwoqZ6YlPwZpVnPDimZI+ymBV3QGypzq KOg4ZyYr8dW1P2WT+DZdjo2NQCCHGervJ8A9tDkPJXtoUHRVnAxZfVo9QZQlUgjgRywVMRnVvwdV xrsStZf0X4OFunHB2WyBEXYKCrC/gpf36j36+uwtqSiUO1bd0lEursC9CBWMd1I0ltabrNMdjmEP NXubrjlpC2JgQCA2j6/7Nu4tCEoduL+bXPjqpRugc6bY+G7gMwRfaKonh+3ZwZCc7b3jajWvY9+r GNm65ulK6lCKD2GTHuItGeIwlDWSXQ62B68ZgI9HkFFLLk3dheLSClIKF5r8GrBQAuUBo2M3IUxE xJtRmREOc5wGj1QupyheRDmHVi03vYVElOEMSyycw5KFNGHLD7ibSkNS/jQ6fbjpKdx2qcgw+BRx gMYeNkh0IkFch4LoGHGLQYlE535YW6i4jRPpp2zDR+2zGp1iro2C6pSe3VkQw63d4k3jMdXH7Ojy sP6SHhYKGvzZ8/gntsm+HbRsZJB/9OTEW9c3rkIO3aQab3yIVMUWbuF6aC74Or8NpDyJO3inTmOD BCEIZ43ygknQW/2xzQ+DhNQ+IIX3Sj0rnP0qCglN6oH4EZw= -----END CERTIFICATE----- T\xc3\x9c\x42\xC4\xB0TAK UEKAE K\xC3\xB6k Sertifika Hizmet Sa\xC4\x9Flay\xc4\xb1\x63\xc4\xb1s\xc4\xb1 - S\xC3\xBCr\xC3\xBCm 3 ============================================================================================================================= -----BEGIN CERTIFICATE----- MIIFFzCCA/+gAwIBAgIBETANBgkqhkiG9w0BAQUFADCCASsxCzAJBgNVBAYTAlRSMRgwFgYDVQQH DA9HZWJ6ZSAtIEtvY2FlbGkxRzBFBgNVBAoMPlTDvHJraXllIEJpbGltc2VsIHZlIFRla25vbG9q aWsgQXJhxZ90xLFybWEgS3VydW11IC0gVMOcQsSwVEFLMUgwRgYDVQQLDD9VbHVzYWwgRWxla3Ry b25payB2ZSBLcmlwdG9sb2ppIEFyYcWfdMSxcm1hIEVuc3RpdMO8c8O8IC0gVUVLQUUxIzAhBgNV BAsMGkthbXUgU2VydGlmaWthc3lvbiBNZXJrZXppMUowSAYDVQQDDEFUw5xCxLBUQUsgVUVLQUUg S8O2ayBTZXJ0aWZpa2EgSGl6bWV0IFNhxJ9sYXnEsWPEsXPEsSAtIFPDvHLDvG0gMzAeFw0wNzA4 MjQxMTM3MDdaFw0xNzA4MjExMTM3MDdaMIIBKzELMAkGA1UEBhMCVFIxGDAWBgNVBAcMD0dlYnpl IC0gS29jYWVsaTFHMEUGA1UECgw+VMO8cmtpeWUgQmlsaW1zZWwgdmUgVGVrbm9sb2ppayBBcmHF n3TEsXJtYSBLdXJ1bXUgLSBUw5xCxLBUQUsxSDBGBgNVBAsMP1VsdXNhbCBFbGVrdHJvbmlrIHZl IEtyaXB0b2xvamkgQXJhxZ90xLFybWEgRW5zdGl0w7xzw7wgLSBVRUtBRTEjMCEGA1UECwwaS2Ft dSBTZXJ0aWZpa2FzeW9uIE1lcmtlemkxSjBIBgNVBAMMQVTDnELEsFRBSyBVRUtBRSBLw7ZrIFNl cnRpZmlrYSBIaXptZXQgU2HEn2xhecSxY8Sxc8SxIC0gU8O8csO8bSAzMIIBIjANBgkqhkiG9w0B AQEFAAOCAQ8AMIIBCgKCAQEAim1L/xCIOsP2fpTo6iBkcK4hgb46ezzb8R1Sf1n68yJMlaCQvEhO Eav7t7WNeoMojCZG2E6VQIdhn8WebYGHV2yKO7Rm6sxA/OOqbLLLAdsyv9Lrhc+hDVXDWzhXcLh1 xnnRFDDtG1hba+818qEhTsXOfJlfbLm4IpNQp81McGq+agV/E5wrHur+R84EpW+sky58K5+eeROR 6Oqeyjh1jmKwlZMq5d/pXpduIF9fhHpEORlAHLpVK/swsoHvhOPc7Jg4OQOFCKlUAwUp8MmPi+oL hmUZEdPpCSPeaJMDyTYcIW7OjGbxmTDY17PDHfiBLqi9ggtm/oLL4eAagsNAgQIDAQABo0IwQDAd BgNVHQ4EFgQUvYiHyY/2pAoLquvF/pEjnatKijIwDgYDVR0PAQH/BAQDAgEGMA8GA1UdEwEB/wQF MAMBAf8wDQYJKoZIhvcNAQEFBQADggEBAB18+kmPNOm3JpIWmgV050vQbTlswyb2zrgxvMTfvCr4 N5EY3ATIZJkrGG2AA1nJrvhY0D7twyOfaTyGOBye79oneNGEN3GKPEs5z35FBtYt2IpNeBLWrcLT y9LQQfMmNkqblWwM7uXRQydmwYj3erMgbOqwaSvHIOgMA8RBBZniP+Rr+KCGgceExh/VS4ESshYh LBOhgLJeDEoTniDYYkCrkOpkSi+sDQESeUWoL4cZaMjihccwsnX5OD+ywJO0a+IDRM5noN+J1q2M dqMTw5RhK2vZbMEHCiIHhWyFJEapvj+LeISCfiQMnf2BN+MlqO02TpUsyZyQ2uypQjyttgI= -----END CERTIFICATE----- Buypass Class 2 CA 1 ==================== -----BEGIN CERTIFICATE----- MIIDUzCCAjugAwIBAgIBATANBgkqhkiG9w0BAQUFADBLMQswCQYDVQQGEwJOTzEdMBsGA1UECgwU QnV5cGFzcyBBUy05ODMxNjMzMjcxHTAbBgNVBAMMFEJ1eXBhc3MgQ2xhc3MgMiBDQSAxMB4XDTA2 MTAxMzEwMjUwOVoXDTE2MTAxMzEwMjUwOVowSzELMAkGA1UEBhMCTk8xHTAbBgNVBAoMFEJ1eXBh c3MgQVMtOTgzMTYzMzI3MR0wGwYDVQQDDBRCdXlwYXNzIENsYXNzIDIgQ0EgMTCCASIwDQYJKoZI hvcNAQEBBQADggEPADCCAQoCggEBAIs8B0XY9t/mx8q6jUPFR42wWsE425KEHK8T1A9vNkYgxC7M cXA0ojTTNy7Y3Tp3L8DrKehc0rWpkTSHIln+zNvnma+WwajHQN2lFYxuyHyXA8vmIPLXl18xoS83 0r7uvqmtqEyeIWZDO6i88wmjONVZJMHCR3axiFyCO7srpgTXjAePzdVBHfCuuCkslFJgNJQ72uA4 0Z0zPhX0kzLFANq1KWYOOngPIVJfAuWSeyXTkh4vFZ2B5J2O6O+JzhRMVB0cgRJNcKi+EAUXfh/R uFdV7c27UsKwHnjCTTZoy1YmwVLBvXb3WNVyfh9EdrsAiR0WnVE1703CVu9r4Iw7DekCAwEAAaNC MEAwDwYDVR0TAQH/BAUwAwEB/zAdBgNVHQ4EFgQUP42aWYv8e3uco684sDntkHGA1sgwDgYDVR0P AQH/BAQDAgEGMA0GCSqGSIb3DQEBBQUAA4IBAQAVGn4TirnoB6NLJzKyQJHyIdFkhb5jatLPgcIV 1Xp+DCmsNx4cfHZSldq1fyOhKXdlyTKdqC5Wq2B2zha0jX94wNWZUYN/Xtm+DKhQ7SLHrQVMdvvt 7h5HZPb3J31cKA9FxVxiXqaakZG3Uxcu3K1gnZZkOb1naLKuBctN518fV4bVIJwo+28TOPX2EZL2 fZleHwzoq0QkKXJAPTZSr4xYkHPB7GEseaHsh7U/2k3ZIQAw3pDaDtMaSKk+hQsUi4y8QZ5q9w5w wDX3OaJdZtB7WZ+oRxKaJyOkLY4ng5IgodcVf/EuGO70SH8vf/GhGLWhC5SgYiAynB321O+/TIho -----END CERTIFICATE----- EBG Elektronik Sertifika Hizmet Sa\xC4\x9Flay\xc4\xb1\x63\xc4\xb1s\xc4\xb1 ========================================================================== -----BEGIN CERTIFICATE----- MIIF5zCCA8+gAwIBAgIITK9zQhyOdAIwDQYJKoZIhvcNAQEFBQAwgYAxODA2BgNVBAMML0VCRyBF bGVrdHJvbmlrIFNlcnRpZmlrYSBIaXptZXQgU2HEn2xhecSxY8Sxc8SxMTcwNQYDVQQKDC5FQkcg QmlsacWfaW0gVGVrbm9sb2ppbGVyaSB2ZSBIaXptZXRsZXJpIEEuxZ4uMQswCQYDVQQGEwJUUjAe Fw0wNjA4MTcwMDIxMDlaFw0xNjA4MTQwMDMxMDlaMIGAMTgwNgYDVQQDDC9FQkcgRWxla3Ryb25p ayBTZXJ0aWZpa2EgSGl6bWV0IFNhxJ9sYXnEsWPEsXPEsTE3MDUGA1UECgwuRUJHIEJpbGnFn2lt IFRla25vbG9qaWxlcmkgdmUgSGl6bWV0bGVyaSBBLsWeLjELMAkGA1UEBhMCVFIwggIiMA0GCSqG SIb3DQEBAQUAA4ICDwAwggIKAoICAQDuoIRh0DpqZhAy2DE4f6en5f2h4fuXd7hxlugTlkaDT7by X3JWbhNgpQGR4lvFzVcfd2NR/y8927k/qqk153nQ9dAktiHq6yOU/im/+4mRDGSaBUorzAzu8T2b gmmkTPiab+ci2hC6X5L8GCcKqKpE+i4stPtGmggDg3KriORqcsnlZR9uKg+ds+g75AxuetpX/dfr eYteIAbTdgtsApWjluTLdlHRKJ2hGvxEok3MenaoDT2/F08iiFD9rrbskFBKW5+VQarKD7JK/oCZ TqNGFav4c0JqwmZ2sQomFd2TkuzbqV9UIlKRcF0T6kjsbgNs2d1s/OsNA/+mgxKb8amTD8UmTDGy Y5lhcucqZJnSuOl14nypqZoaqsNW2xCaPINStnuWt6yHd6i58mcLlEOzrz5z+kI2sSXFCjEmN1Zn uqMLfdb3ic1nobc6HmZP9qBVFCVMLDMNpkGMvQQxahByCp0OLna9XvNRiYuoP1Vzv9s6xiQFlpJI qkuNKgPlV5EQ9GooFW5Hd4RcUXSfGenmHmMWOeMRFeNYGkS9y8RsZteEBt8w9DeiQyJ50hBs37vm ExH8nYQKE3vwO9D8owrXieqWfo1IhR5kX9tUoqzVegJ5a9KK8GfaZXINFHDk6Y54jzJ0fFfy1tb0 Nokb+Clsi7n2l9GkLqq+CxnCRelwXQIDAJ3Zo2MwYTAPBgNVHRMBAf8EBTADAQH/MA4GA1UdDwEB /wQEAwIBBjAdBgNVHQ4EFgQU587GT/wWZ5b6SqMHwQSny2re2kcwHwYDVR0jBBgwFoAU587GT/wW Z5b6SqMHwQSny2re2kcwDQYJKoZIhvcNAQEFBQADggIBAJuYml2+8ygjdsZs93/mQJ7ANtyVDR2t FcU22NU57/IeIl6zgrRdu0waypIN30ckHrMk2pGI6YNw3ZPX6bqz3xZaPt7gyPvT/Wwp+BVGoGgm zJNSroIBk5DKd8pNSe/iWtkqvTDOTLKBtjDOWU/aWR1qeqRFsIImgYZ29fUQALjuswnoT4cCB64k XPBfrAowzIpAoHMEwfuJJPaaHFy3PApnNgUIMbOv2AFoKuB4j3TeuFGkjGwgPaL7s9QJ/XvCgKqT bCmYIai7FvOpEl90tYeY8pUm3zTvilORiF0alKM/fCL414i6poyWqD1SNGKfAB5UVUJnxk1Gj7sU RT0KlhaOEKGXmdXTMIXM3rRyt7yKPBgpaP3ccQfuJDlq+u2lrDgv+R4QDgZxGhBM/nV+/x5XOULK 1+EVoVZVWRvRo68R2E7DpSvvkL/A7IITW43WciyTTo9qKd+FPNMN4KIYEsxVL0e3p5sC/kH2iExt 2qkBR4NkJ2IQgtYSe14DHzSpyZH+r11thie3I6p1GMog57AP14kOpmciY/SDQSsGS7tY1dHXt7kQ Y9iJSrSq3RZj9W6+YKH47ejWkE8axsWgKdOnIaj1Wjz3x0miIZpKlVIglnKaZsv30oZDfCK+lvm9 AahH3eU7QPl1K5srRmSGjR70j/sHd9DqSaIcjVIUpgqT -----END CERTIFICATE----- certSIGN ROOT CA ================ -----BEGIN CERTIFICATE----- MIIDODCCAiCgAwIBAgIGIAYFFnACMA0GCSqGSIb3DQEBBQUAMDsxCzAJBgNVBAYTAlJPMREwDwYD VQQKEwhjZXJ0U0lHTjEZMBcGA1UECxMQY2VydFNJR04gUk9PVCBDQTAeFw0wNjA3MDQxNzIwMDRa Fw0zMTA3MDQxNzIwMDRaMDsxCzAJBgNVBAYTAlJPMREwDwYDVQQKEwhjZXJ0U0lHTjEZMBcGA1UE CxMQY2VydFNJR04gUk9PVCBDQTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBALczuX7I JUqOtdu0KBuqV5Do0SLTZLrTk+jUrIZhQGpgV2hUhE28alQCBf/fm5oqrl0Hj0rDKH/v+yv6efHH rfAQUySQi2bJqIirr1qjAOm+ukbuW3N7LBeCgV5iLKECZbO9xSsAfsT8AzNXDe3i+s5dRdY4zTW2 ssHQnIFKquSyAVwdj1+ZxLGt24gh65AIgoDzMKND5pCCrlUoSe1b16kQOA7+j0xbm0bqQfWwCHTD 0IgztnzXdN/chNFDDnU5oSVAKOp4yw4sLjmdjItuFhwvJoIQ4uNllAoEwF73XVv4EOLQunpL+943 AAAaWyjj0pxzPjKHmKHJUS/X3qwzs08CAwEAAaNCMEAwDwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8B Af8EBAMCAcYwHQYDVR0OBBYEFOCMm9slSbPxfIbWskKHC9BroNnkMA0GCSqGSIb3DQEBBQUAA4IB AQA+0hyJLjX8+HXd5n9liPRyTMks1zJO890ZeUe9jjtbkw9QSSQTaxQGcu8J06Gh40CEyecYMnQ8 SG4Pn0vU9x7Tk4ZkVJdjclDVVc/6IJMCopvDI5NOFlV2oHB5bc0hH88vLbwZ44gx+FkagQnIl6Z0 x2DEW8xXjrJ1/RsCCdtZb3KTafcxQdaIOL+Hsr0Wefmq5L6IJd1hJyMctTEHBDa0GpC9oHRxUIlt vBTjD4au8as+x6AJzKNI0eDbZOeStc+vckNwi/nDhDwTqn6Sm1dTk/pwwpEOMfmbZ13pljheX7Nz TogVZ96edhBiIL5VaZVDADlN9u6wWk5JRFRYX0KD -----END CERTIFICATE----- CNNIC ROOT ========== -----BEGIN CERTIFICATE----- MIIDVTCCAj2gAwIBAgIESTMAATANBgkqhkiG9w0BAQUFADAyMQswCQYDVQQGEwJDTjEOMAwGA1UE ChMFQ05OSUMxEzARBgNVBAMTCkNOTklDIFJPT1QwHhcNMDcwNDE2MDcwOTE0WhcNMjcwNDE2MDcw OTE0WjAyMQswCQYDVQQGEwJDTjEOMAwGA1UEChMFQ05OSUMxEzARBgNVBAMTCkNOTklDIFJPT1Qw ggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDTNfc/c3et6FtzF8LRb+1VvG7q6KR5smzD o+/hn7E7SIX1mlwhIhAsxYLO2uOabjfhhyzcuQxauohV3/2q2x8x6gHx3zkBwRP9SFIhxFXf2tiz VHa6dLG3fdfA6PZZxU3Iva0fFNrfWEQlMhkqx35+jq44sDB7R3IJMfAw28Mbdim7aXZOV/kbZKKT VrdvmW7bCgScEeOAH8tjlBAKqeFkgjH5jCftppkA9nCTGPihNIaj3XrCGHn2emU1z5DrvTOTn1Or czvmmzQgLx3vqR1jGqCA2wMv+SYahtKNu6m+UjqHZ0gNv7Sg2Ca+I19zN38m5pIEo3/PIKe38zrK y5nLAgMBAAGjczBxMBEGCWCGSAGG+EIBAQQEAwIABzAfBgNVHSMEGDAWgBRl8jGtKvf33VKWCscC wQ7vptU7ETAPBgNVHRMBAf8EBTADAQH/MAsGA1UdDwQEAwIB/jAdBgNVHQ4EFgQUZfIxrSr3991S lgrHAsEO76bVOxEwDQYJKoZIhvcNAQEFBQADggEBAEs17szkrr/Dbq2flTtLP1se31cpolnKOOK5 Gv+e5m4y3R6u6jW39ZORTtpC4cMXYFDy0VwmuYK36m3knITnA3kXr5g9lNvHugDnuL8BV8F3RTIM O/G0HAiw/VGgod2aHRM2mm23xzy54cXZF/qD1T0VoDy7HgviyJA/qIYM/PmLXoXLT1tLYhFHxUV8 BS9BsZ4QaRuZluBVeftOhpm4lNqGOGqTo+fLbuXf6iFViZx9fX+Y9QCJ7uOEwFyWtcVG6kbghVW2 G8kS1sHNzYDzAgE8yGnLRUhj2JTQ7IUOO04RZfSCjKY9ri4ilAnIXOo8gV0WKgOXFlUJ24pBgp5m mxE= -----END CERTIFICATE----- ApplicationCA - Japanese Government =================================== -----BEGIN CERTIFICATE----- MIIDoDCCAoigAwIBAgIBMTANBgkqhkiG9w0BAQUFADBDMQswCQYDVQQGEwJKUDEcMBoGA1UEChMT SmFwYW5lc2UgR292ZXJubWVudDEWMBQGA1UECxMNQXBwbGljYXRpb25DQTAeFw0wNzEyMTIxNTAw MDBaFw0xNzEyMTIxNTAwMDBaMEMxCzAJBgNVBAYTAkpQMRwwGgYDVQQKExNKYXBhbmVzZSBHb3Zl cm5tZW50MRYwFAYDVQQLEw1BcHBsaWNhdGlvbkNBMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIB CgKCAQEAp23gdE6Hj6UG3mii24aZS2QNcfAKBZuOquHMLtJqO8F6tJdhjYq+xpqcBrSGUeQ3DnR4 fl+Kf5Sk10cI/VBaVuRorChzoHvpfxiSQE8tnfWuREhzNgaeZCw7NCPbXCbkcXmP1G55IrmTwcrN wVbtiGrXoDkhBFcsovW8R0FPXjQilbUfKW1eSvNNcr5BViCH/OlQR9cwFO5cjFW6WY2H/CPek9AE jP3vbb3QesmlOmpyM8ZKDQUXKi17safY1vC+9D/qDihtQWEjdnjDuGWk81quzMKq2edY3rZ+nYVu nyoKb58DKTCXKB28t89UKU5RMfkntigm/qJj5kEW8DOYRwIDAQABo4GeMIGbMB0GA1UdDgQWBBRU WssmP3HMlEYNllPqa0jQk/5CdTAOBgNVHQ8BAf8EBAMCAQYwWQYDVR0RBFIwUKROMEwxCzAJBgNV BAYTAkpQMRgwFgYDVQQKDA/ml6XmnKzlm73mlL/lupwxIzAhBgNVBAsMGuOCouODl+ODquOCseOD vOOCt+ODp+ODs0NBMA8GA1UdEwEB/wQFMAMBAf8wDQYJKoZIhvcNAQEFBQADggEBADlqRHZ3ODrs o2dGD/mLBqj7apAxzn7s2tGJfHrrLgy9mTLnsCTWw//1sogJhyzjVOGjprIIC8CFqMjSnHH2HZ9g /DgzE+Ge3Atf2hZQKXsvcJEPmbo0NI2VdMV+eKlmXb3KIXdCEKxmJj3ekav9FfBv7WxfEPjzFvYD io+nEhEMy/0/ecGc/WLuo89UDNErXxc+4z6/wCs+CZv+iKZ+tJIX/COUgb1up8WMwusRRdv4QcmW dupwX3kSa+SjB1oF7ydJzyGfikwJcGapJsErEU4z0g781mzSDjJkaP+tBXhfAx2o45CsJOAPQKdL rosot4LKGAfmt1t06SAZf7IbiVQ= -----END CERTIFICATE----- GeoTrust Primary Certification Authority - G3 ============================================= -----BEGIN CERTIFICATE----- MIID/jCCAuagAwIBAgIQFaxulBmyeUtB9iepwxgPHzANBgkqhkiG9w0BAQsFADCBmDELMAkGA1UE BhMCVVMxFjAUBgNVBAoTDUdlb1RydXN0IEluYy4xOTA3BgNVBAsTMChjKSAyMDA4IEdlb1RydXN0 IEluYy4gLSBGb3IgYXV0aG9yaXplZCB1c2Ugb25seTE2MDQGA1UEAxMtR2VvVHJ1c3QgUHJpbWFy eSBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eSAtIEczMB4XDTA4MDQwMjAwMDAwMFoXDTM3MTIwMTIz NTk1OVowgZgxCzAJBgNVBAYTAlVTMRYwFAYDVQQKEw1HZW9UcnVzdCBJbmMuMTkwNwYDVQQLEzAo YykgMjAwOCBHZW9UcnVzdCBJbmMuIC0gRm9yIGF1dGhvcml6ZWQgdXNlIG9ubHkxNjA0BgNVBAMT LUdlb1RydXN0IFByaW1hcnkgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkgLSBHMzCCASIwDQYJKoZI hvcNAQEBBQADggEPADCCAQoCggEBANziXmJYHTNXOTIz+uvLh4yn1ErdBojqZI4xmKU4kB6Yzy5j K/BGvESyiaHAKAxJcCGVn2TAppMSAmUmhsalifD614SgcK9PGpc/BkTVyetyEH3kMSj7HGHmKAdE c5IiaacDiGydY8hS2pgn5whMcD60yRLBxWeDXTPzAxHsatBT4tG6NmCUgLthY2xbF37fQJQeqw3C IShwiP/WJmxsYAQlTlV+fe+/lEjetx3dcI0FX4ilm/LC7urRQEFtYjgdVgbFA0dRIBn8exALDmKu dlW/X3e+PkkBUz2YJQN2JFodtNuJ6nnltrM7P7pMKEF/BqxqjsHQ9gUdfeZChuOl1UcCAwEAAaNC MEAwDwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMCAQYwHQYDVR0OBBYEFMR5yo6hTgMdHNxr 2zFblD4/MH8tMA0GCSqGSIb3DQEBCwUAA4IBAQAtxRPPVoB7eni9n64smefv2t+UXglpp+duaIy9 cr5HqQ6XErhK8WTTOd8lNNTBzU6B8A8ExCSzNJbGpqow32hhc9f5joWJ7w5elShKKiePEI4ufIbE Ap7aDHdlDkQNkv39sxY2+hENHYwOB4lqKVb3cvTdFZx3NWZXqxNT2I7BQMXXExZacse3aQHEerGD AWh9jUGhlBjBJVz88P6DAod8DQ3PLghcSkANPuyBYeYk28rgDi0Hsj5W3I31QYUHSJsMC8tJP33s t/3LjWeJGqvtux6jAAgIFyqCXDFdRootD4abdNlF+9RAsXqqaC2Gspki4cErx5z481+oghLrGREt -----END CERTIFICATE----- thawte Primary Root CA - G2 =========================== -----BEGIN CERTIFICATE----- MIICiDCCAg2gAwIBAgIQNfwmXNmET8k9Jj1Xm67XVjAKBggqhkjOPQQDAzCBhDELMAkGA1UEBhMC VVMxFTATBgNVBAoTDHRoYXd0ZSwgSW5jLjE4MDYGA1UECxMvKGMpIDIwMDcgdGhhd3RlLCBJbmMu IC0gRm9yIGF1dGhvcml6ZWQgdXNlIG9ubHkxJDAiBgNVBAMTG3RoYXd0ZSBQcmltYXJ5IFJvb3Qg Q0EgLSBHMjAeFw0wNzExMDUwMDAwMDBaFw0zODAxMTgyMzU5NTlaMIGEMQswCQYDVQQGEwJVUzEV MBMGA1UEChMMdGhhd3RlLCBJbmMuMTgwNgYDVQQLEy8oYykgMjAwNyB0aGF3dGUsIEluYy4gLSBG b3IgYXV0aG9yaXplZCB1c2Ugb25seTEkMCIGA1UEAxMbdGhhd3RlIFByaW1hcnkgUm9vdCBDQSAt IEcyMHYwEAYHKoZIzj0CAQYFK4EEACIDYgAEotWcgnuVnfFSeIf+iha/BebfowJPDQfGAFG6DAJS LSKkQjnE/o/qycG+1E3/n3qe4rF8mq2nhglzh9HnmuN6papu+7qzcMBniKI11KOasf2twu8x+qi5 8/sIxpHR+ymVo0IwQDAPBgNVHRMBAf8EBTADAQH/MA4GA1UdDwEB/wQEAwIBBjAdBgNVHQ4EFgQU mtgAMADna3+FGO6Lts6KDPgR4bswCgYIKoZIzj0EAwMDaQAwZgIxAN344FdHW6fmCsO99YCKlzUN G4k8VIZ3KMqh9HneteY4sPBlcIx/AlTCv//YoT7ZzwIxAMSNlPzcU9LcnXgWHxUzI1NS41oxXZ3K rr0TKUQNJ1uo52icEvdYPy5yAlejj6EULg== -----END CERTIFICATE----- thawte Primary Root CA - G3 =========================== -----BEGIN CERTIFICATE----- MIIEKjCCAxKgAwIBAgIQYAGXt0an6rS0mtZLL/eQ+zANBgkqhkiG9w0BAQsFADCBrjELMAkGA1UE BhMCVVMxFTATBgNVBAoTDHRoYXd0ZSwgSW5jLjEoMCYGA1UECxMfQ2VydGlmaWNhdGlvbiBTZXJ2 aWNlcyBEaXZpc2lvbjE4MDYGA1UECxMvKGMpIDIwMDggdGhhd3RlLCBJbmMuIC0gRm9yIGF1dGhv cml6ZWQgdXNlIG9ubHkxJDAiBgNVBAMTG3RoYXd0ZSBQcmltYXJ5IFJvb3QgQ0EgLSBHMzAeFw0w ODA0MDIwMDAwMDBaFw0zNzEyMDEyMzU5NTlaMIGuMQswCQYDVQQGEwJVUzEVMBMGA1UEChMMdGhh d3RlLCBJbmMuMSgwJgYDVQQLEx9DZXJ0aWZpY2F0aW9uIFNlcnZpY2VzIERpdmlzaW9uMTgwNgYD VQQLEy8oYykgMjAwOCB0aGF3dGUsIEluYy4gLSBGb3IgYXV0aG9yaXplZCB1c2Ugb25seTEkMCIG A1UEAxMbdGhhd3RlIFByaW1hcnkgUm9vdCBDQSAtIEczMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8A MIIBCgKCAQEAsr8nLPvb2FvdeHsbnndmgcs+vHyu86YnmjSjaDFxODNi5PNxZnmxqWWjpYvVj2At P0LMqmsywCPLLEHd5N/8YZzic7IilRFDGF/Eth9XbAoFWCLINkw6fKXRz4aviKdEAhN0cXMKQlkC +BsUa0Lfb1+6a4KinVvnSr0eAXLbS3ToO39/fR8EtCab4LRarEc9VbjXsCZSKAExQGbY2SS99irY 7CFJXJv2eul/VTV+lmuNk5Mny5K76qxAwJ/C+IDPXfRa3M50hqY+bAtTyr2SzhkGcuYMXDhpxwTW vGzOW/b3aJzcJRVIiKHpqfiYnODz1TEoYRFsZ5aNOZnLwkUkOQIDAQABo0IwQDAPBgNVHRMBAf8E BTADAQH/MA4GA1UdDwEB/wQEAwIBBjAdBgNVHQ4EFgQUrWyqlGCc7eT/+j4KdCtjA/e2Wb8wDQYJ KoZIhvcNAQELBQADggEBABpA2JVlrAmSicY59BDlqQ5mU1143vokkbvnRFHfxhY0Cu9qRFHqKweK A3rD6z8KLFIWoCtDuSWQP3CpMyVtRRooOyfPqsMpQhvfO0zAMzRbQYi/aytlryjvsvXDqmbOe1bu t8jLZ8HJnBoYuMTDSQPxYA5QzUbF83d597YV4Djbxy8ooAw/dyZ02SUS2jHaGh7cKUGRIjxpp7sC 8rZcJwOJ9Abqm+RyguOhCcHpABnTPtRwa7pxpqpYrvS76Wy274fMm7v/OeZWYdMKp8RcTGB7BXcm er/YB1IsYvdwY9k5vG8cwnncdimvzsUsZAReiDZuMdRAGmI0Nj81Aa6sY6A= -----END CERTIFICATE----- GeoTrust Primary Certification Authority - G2 ============================================= -----BEGIN CERTIFICATE----- MIICrjCCAjWgAwIBAgIQPLL0SAoA4v7rJDteYD7DazAKBggqhkjOPQQDAzCBmDELMAkGA1UEBhMC VVMxFjAUBgNVBAoTDUdlb1RydXN0IEluYy4xOTA3BgNVBAsTMChjKSAyMDA3IEdlb1RydXN0IElu Yy4gLSBGb3IgYXV0aG9yaXplZCB1c2Ugb25seTE2MDQGA1UEAxMtR2VvVHJ1c3QgUHJpbWFyeSBD ZXJ0aWZpY2F0aW9uIEF1dGhvcml0eSAtIEcyMB4XDTA3MTEwNTAwMDAwMFoXDTM4MDExODIzNTk1 OVowgZgxCzAJBgNVBAYTAlVTMRYwFAYDVQQKEw1HZW9UcnVzdCBJbmMuMTkwNwYDVQQLEzAoYykg MjAwNyBHZW9UcnVzdCBJbmMuIC0gRm9yIGF1dGhvcml6ZWQgdXNlIG9ubHkxNjA0BgNVBAMTLUdl b1RydXN0IFByaW1hcnkgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkgLSBHMjB2MBAGByqGSM49AgEG BSuBBAAiA2IABBWx6P0DFUPlrOuHNxFi79KDNlJ9RVcLSo17VDs6bl8VAsBQps8lL33KSLjHUGMc KiEIfJo22Av+0SbFWDEwKCXzXV2juLaltJLtbCyf691DiaI8S0iRHVDsJt/WYC69IaNCMEAwDwYD VR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMCAQYwHQYDVR0OBBYEFBVfNVdRVfslsq0DafwBo/q+ EVXVMAoGCCqGSM49BAMDA2cAMGQCMGSWWaboCd6LuvpaiIjwH5HTRqjySkwCY/tsXzjbLkGTqQ7m ndwxHLKgpxgceeHHNgIwOlavmnRs9vuD4DPTCF+hnMJbn0bWtsuRBmOiBuczrD6ogRLQy7rQkgu2 npaqBA+K -----END CERTIFICATE----- VeriSign Universal Root Certification Authority =============================================== -----BEGIN CERTIFICATE----- MIIEuTCCA6GgAwIBAgIQQBrEZCGzEyEDDrvkEhrFHTANBgkqhkiG9w0BAQsFADCBvTELMAkGA1UE BhMCVVMxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMR8wHQYDVQQLExZWZXJpU2lnbiBUcnVzdCBO ZXR3b3JrMTowOAYDVQQLEzEoYykgMjAwOCBWZXJpU2lnbiwgSW5jLiAtIEZvciBhdXRob3JpemVk IHVzZSBvbmx5MTgwNgYDVQQDEy9WZXJpU2lnbiBVbml2ZXJzYWwgUm9vdCBDZXJ0aWZpY2F0aW9u IEF1dGhvcml0eTAeFw0wODA0MDIwMDAwMDBaFw0zNzEyMDEyMzU5NTlaMIG9MQswCQYDVQQGEwJV UzEXMBUGA1UEChMOVmVyaVNpZ24sIEluYy4xHzAdBgNVBAsTFlZlcmlTaWduIFRydXN0IE5ldHdv cmsxOjA4BgNVBAsTMShjKSAyMDA4IFZlcmlTaWduLCBJbmMuIC0gRm9yIGF1dGhvcml6ZWQgdXNl IG9ubHkxODA2BgNVBAMTL1ZlcmlTaWduIFVuaXZlcnNhbCBSb290IENlcnRpZmljYXRpb24gQXV0 aG9yaXR5MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAx2E3XrEBNNti1xWb/1hajCMj 1mCOkdeQmIN65lgZOIzF9uVkhbSicfvtvbnazU0AtMgtc6XHaXGVHzk8skQHnOgO+k1KxCHfKWGP MiJhgsWHH26MfF8WIFFE0XBPV+rjHOPMee5Y2A7Cs0WTwCznmhcrewA3ekEzeOEz4vMQGn+HLL72 9fdC4uW/h2KJXwBL38Xd5HVEMkE6HnFuacsLdUYI0crSK5XQz/u5QGtkjFdN/BMReYTtXlT2NJ8I AfMQJQYXStrxHXpma5hgZqTZ79IugvHw7wnqRMkVauIDbjPTrJ9VAMf2CGqUuV/c4DPxhGD5WycR tPwW8rtWaoAljQIDAQABo4GyMIGvMA8GA1UdEwEB/wQFMAMBAf8wDgYDVR0PAQH/BAQDAgEGMG0G CCsGAQUFBwEMBGEwX6FdoFswWTBXMFUWCWltYWdlL2dpZjAhMB8wBwYFKw4DAhoEFI/l0xqGrI2O a8PPgGrUSBgsexkuMCUWI2h0dHA6Ly9sb2dvLnZlcmlzaWduLmNvbS92c2xvZ28uZ2lmMB0GA1Ud DgQWBBS2d/ppSEefUxLVwuoHMnYH0ZcHGTANBgkqhkiG9w0BAQsFAAOCAQEASvj4sAPmLGd75JR3 Y8xuTPl9Dg3cyLk1uXBPY/ok+myDjEedO2Pzmvl2MpWRsXe8rJq+seQxIcaBlVZaDrHC1LGmWazx Y8u4TB1ZkErvkBYoH1quEPuBUDgMbMzxPcP1Y+Oz4yHJJDnp/RVmRvQbEdBNc6N9Rvk97ahfYtTx P/jgdFcrGJ2BtMQo2pSXpXDrrB2+BxHw1dvd5Yzw1TKwg+ZX4o+/vqGqvz0dtdQ46tewXDpPaj+P wGZsY6rp2aQW9IHRlRQOfc2VNNnSj3BzgXucfr2YYdhFh5iQxeuGMMY1v/D/w1WIg0vvBZIGcfK4 mJO37M2CYfE45k+XmCpajQ== -----END CERTIFICATE----- VeriSign Class 3 Public Primary Certification Authority - G4 ============================================================ -----BEGIN CERTIFICATE----- MIIDhDCCAwqgAwIBAgIQL4D+I4wOIg9IZxIokYesszAKBggqhkjOPQQDAzCByjELMAkGA1UEBhMC VVMxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMR8wHQYDVQQLExZWZXJpU2lnbiBUcnVzdCBOZXR3 b3JrMTowOAYDVQQLEzEoYykgMjAwNyBWZXJpU2lnbiwgSW5jLiAtIEZvciBhdXRob3JpemVkIHVz ZSBvbmx5MUUwQwYDVQQDEzxWZXJpU2lnbiBDbGFzcyAzIFB1YmxpYyBQcmltYXJ5IENlcnRpZmlj YXRpb24gQXV0aG9yaXR5IC0gRzQwHhcNMDcxMTA1MDAwMDAwWhcNMzgwMTE4MjM1OTU5WjCByjEL MAkGA1UEBhMCVVMxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMR8wHQYDVQQLExZWZXJpU2lnbiBU cnVzdCBOZXR3b3JrMTowOAYDVQQLEzEoYykgMjAwNyBWZXJpU2lnbiwgSW5jLiAtIEZvciBhdXRo b3JpemVkIHVzZSBvbmx5MUUwQwYDVQQDEzxWZXJpU2lnbiBDbGFzcyAzIFB1YmxpYyBQcmltYXJ5 IENlcnRpZmljYXRpb24gQXV0aG9yaXR5IC0gRzQwdjAQBgcqhkjOPQIBBgUrgQQAIgNiAASnVnp8 Utpkmw4tXNherJI9/gHmGUo9FANL+mAnINmDiWn6VMaaGF5VKmTeBvaNSjutEDxlPZCIBIngMGGz rl0Bp3vefLK+ymVhAIau2o970ImtTR1ZmkGxvEeA3J5iw/mjgbIwga8wDwYDVR0TAQH/BAUwAwEB /zAOBgNVHQ8BAf8EBAMCAQYwbQYIKwYBBQUHAQwEYTBfoV2gWzBZMFcwVRYJaW1hZ2UvZ2lmMCEw HzAHBgUrDgMCGgQUj+XTGoasjY5rw8+AatRIGCx7GS4wJRYjaHR0cDovL2xvZ28udmVyaXNpZ24u Y29tL3ZzbG9nby5naWYwHQYDVR0OBBYEFLMWkf3upm7ktS5Jj4d4gYDs5bG1MAoGCCqGSM49BAMD A2gAMGUCMGYhDBgmYFo4e1ZC4Kf8NoRRkSAsdk1DPcQdhCPQrNZ8NQbOzWm9kA3bbEhCHQ6qQgIx AJw9SDkjOVgaFRJZap7v1VmyHVIsmXHNxynfGyphe3HR3vPA5Q06Sqotp9iGKt0uEA== -----END CERTIFICATE----- NetLock Arany (Class Gold) Főtanúsítvány ============================================ -----BEGIN CERTIFICATE----- MIIEFTCCAv2gAwIBAgIGSUEs5AAQMA0GCSqGSIb3DQEBCwUAMIGnMQswCQYDVQQGEwJIVTERMA8G A1UEBwwIQnVkYXBlc3QxFTATBgNVBAoMDE5ldExvY2sgS2Z0LjE3MDUGA1UECwwuVGFuw7pzw610 dsOhbnlraWFkw7NrIChDZXJ0aWZpY2F0aW9uIFNlcnZpY2VzKTE1MDMGA1UEAwwsTmV0TG9jayBB cmFueSAoQ2xhc3MgR29sZCkgRsWRdGFuw7pzw610dsOhbnkwHhcNMDgxMjExMTUwODIxWhcNMjgx MjA2MTUwODIxWjCBpzELMAkGA1UEBhMCSFUxETAPBgNVBAcMCEJ1ZGFwZXN0MRUwEwYDVQQKDAxO ZXRMb2NrIEtmdC4xNzA1BgNVBAsMLlRhbsO6c8OtdHbDoW55a2lhZMOzayAoQ2VydGlmaWNhdGlv biBTZXJ2aWNlcykxNTAzBgNVBAMMLE5ldExvY2sgQXJhbnkgKENsYXNzIEdvbGQpIEbFkXRhbsO6 c8OtdHbDoW55MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAxCRec75LbRTDofTjl5Bu 0jBFHjzuZ9lk4BqKf8owyoPjIMHj9DrTlF8afFttvzBPhCf2nx9JvMaZCpDyD/V/Q4Q3Y1GLeqVw /HpYzY6b7cNGbIRwXdrzAZAj/E4wqX7hJ2Pn7WQ8oLjJM2P+FpD/sLj916jAwJRDC7bVWaaeVtAk H3B5r9s5VA1lddkVQZQBr17s9o3x/61k/iCa11zr/qYfCGSji3ZVrR47KGAuhyXoqq8fxmRGILdw fzzeSNuWU7c5d+Qa4scWhHaXWy+7GRWF+GmF9ZmnqfI0p6m2pgP8b4Y9VHx2BJtr+UBdADTHLpl1 neWIA6pN+APSQnbAGwIDAKiLo0UwQzASBgNVHRMBAf8ECDAGAQH/AgEEMA4GA1UdDwEB/wQEAwIB BjAdBgNVHQ4EFgQUzPpnk/C2uNClwB7zU/2MU9+D15YwDQYJKoZIhvcNAQELBQADggEBAKt/7hwW qZw8UQCgwBEIBaeZ5m8BiFRhbvG5GK1Krf6BQCOUL/t1fC8oS2IkgYIL9WHxHG64YTjrgfpioTta YtOUZcTh5m2C+C8lcLIhJsFyUR+MLMOEkMNaj7rP9KdlpeuY0fsFskZ1FSNqb4VjMIDw1Z4fKRzC bLBQWV2QWzuoDTDPv31/zvGdg73JRm4gpvlhUbohL3u+pRVjodSVh/GeufOJ8z2FuLjbvrW5Kfna NwUASZQDhETnv0Mxz3WLJdH0pmT1kvarBes96aULNmLazAZfNou2XjG4Kvte9nHfRCaexOYNkbQu dZWAUWpLMKawYqGT8ZvYzsRjdT9ZR7E= -----END CERTIFICATE----- Staat der Nederlanden Root CA - G2 ================================== -----BEGIN CERTIFICATE----- MIIFyjCCA7KgAwIBAgIEAJiWjDANBgkqhkiG9w0BAQsFADBaMQswCQYDVQQGEwJOTDEeMBwGA1UE CgwVU3RhYXQgZGVyIE5lZGVybGFuZGVuMSswKQYDVQQDDCJTdGFhdCBkZXIgTmVkZXJsYW5kZW4g Um9vdCBDQSAtIEcyMB4XDTA4MDMyNjExMTgxN1oXDTIwMDMyNTExMDMxMFowWjELMAkGA1UEBhMC TkwxHjAcBgNVBAoMFVN0YWF0IGRlciBOZWRlcmxhbmRlbjErMCkGA1UEAwwiU3RhYXQgZGVyIE5l ZGVybGFuZGVuIFJvb3QgQ0EgLSBHMjCCAiIwDQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIBAMVZ 5291qj5LnLW4rJ4L5PnZyqtdj7U5EILXr1HgO+EASGrP2uEGQxGZqhQlEq0i6ABtQ8SpuOUfiUtn vWFI7/3S4GCI5bkYYCjDdyutsDeqN95kWSpGV+RLufg3fNU254DBtvPUZ5uW6M7XxgpT0GtJlvOj CwV3SPcl5XCsMBQgJeN/dVrlSPhOewMHBPqCYYdu8DvEpMfQ9XQ+pV0aCPKbJdL2rAQmPlU6Yiil e7Iwr/g3wtG61jj99O9JMDeZJiFIhQGp5Rbn3JBV3w/oOM2ZNyFPXfUib2rFEhZgF1XyZWampzCR OME4HYYEhLoaJXhena/MUGDWE4dS7WMfbWV9whUYdMrhfmQpjHLYFhN9C0lK8SgbIHRrxT3dsKpI CT0ugpTNGmXZK4iambwYfp/ufWZ8Pr2UuIHOzZgweMFvZ9C+X+Bo7d7iscksWXiSqt8rYGPy5V65 48r6f1CGPqI0GAwJaCgRHOThuVw+R7oyPxjMW4T182t0xHJ04eOLoEq9jWYv6q012iDTiIJh8BIi trzQ1aTsr1SIJSQ8p22xcik/Plemf1WvbibG/ufMQFxRRIEKeN5KzlW/HdXZt1bv8Hb/C3m1r737 qWmRRpdogBQ2HbN/uymYNqUg+oJgYjOk7Na6B6duxc8UpufWkjTYgfX8HV2qXB72o007uPc5AgMB AAGjgZcwgZQwDwYDVR0TAQH/BAUwAwEB/zBSBgNVHSAESzBJMEcGBFUdIAAwPzA9BggrBgEFBQcC ARYxaHR0cDovL3d3dy5wa2lvdmVyaGVpZC5ubC9wb2xpY2llcy9yb290LXBvbGljeS1HMjAOBgNV HQ8BAf8EBAMCAQYwHQYDVR0OBBYEFJFoMocVHYnitfGsNig0jQt8YojrMA0GCSqGSIb3DQEBCwUA A4ICAQCoQUpnKpKBglBu4dfYszk78wIVCVBR7y29JHuIhjv5tLySCZa59sCrI2AGeYwRTlHSeYAz +51IvuxBQ4EffkdAHOV6CMqqi3WtFMTC6GY8ggen5ieCWxjmD27ZUD6KQhgpxrRW/FYQoAUXvQwj f/ST7ZwaUb7dRUG/kSS0H4zpX897IZmflZ85OkYcbPnNe5yQzSipx6lVu6xiNGI1E0sUOlWDuYaN kqbG9AclVMwWVxJKgnjIFNkXgiYtXSAfea7+1HAWFpWD2DU5/1JddRwWxRNVz0fMdWVSSt7wsKfk CpYL+63C4iWEst3kvX5ZbJvw8NjnyvLplzh+ib7M+zkXYT9y2zqR2GUBGR2tUKRXCnxLvJxxcypF URmFzI79R6d0lR2o0a9OF7FpJsKqeFdbxU2n5Z4FF5TKsl+gSRiNNOkmbEgeqmiSBeGCc1qb3Adb CG19ndeNIdn8FCCqwkXfP+cAslHkwvgFuXkajDTznlvkN1trSt8sV4pAWja63XVECDdCcAz+3F4h oKOKwJCcaNpQ5kUQR3i2TtJlycM33+FCY7BXN0Ute4qcvwXqZVUz9zkQxSgqIXobisQk+T8VyJoV IPVVYpbtbZNQvOSqeK3Zywplh6ZmwcSBo3c6WB4L7oOLnR7SUqTMHW+wmG2UMbX4cQrcufx9MmDm 66+KAQ== -----END CERTIFICATE----- CA Disig ======== -----BEGIN CERTIFICATE----- MIIEDzCCAvegAwIBAgIBATANBgkqhkiG9w0BAQUFADBKMQswCQYDVQQGEwJTSzETMBEGA1UEBxMK QnJhdGlzbGF2YTETMBEGA1UEChMKRGlzaWcgYS5zLjERMA8GA1UEAxMIQ0EgRGlzaWcwHhcNMDYw MzIyMDEzOTM0WhcNMTYwMzIyMDEzOTM0WjBKMQswCQYDVQQGEwJTSzETMBEGA1UEBxMKQnJhdGlz bGF2YTETMBEGA1UEChMKRGlzaWcgYS5zLjERMA8GA1UEAxMIQ0EgRGlzaWcwggEiMA0GCSqGSIb3 DQEBAQUAA4IBDwAwggEKAoIBAQCS9jHBfYj9mQGp2HvycXXxMcbzdWb6UShGhJd4NLxs/LxFWYgm GErENx+hSkS943EE9UQX4j/8SFhvXJ56CbpRNyIjZkMhsDxkovhqFQ4/61HhVKndBpnXmjxUizkD Pw/Fzsbrg3ICqB9x8y34dQjbYkzo+s7552oftms1grrijxaSfQUMbEYDXcDtab86wYqg6I7ZuUUo hwjstMoVvoLdtUSLLa2GDGhibYVW8qwUYzrG0ZmsNHhWS8+2rT+MitcE5eN4TPWGqvWP+j1scaMt ymfraHtuM6kMgiioTGohQBUgDCZbg8KpFhXAJIJdKxatymP2dACw30PEEGBWZ2NFAgMBAAGjgf8w gfwwDwYDVR0TAQH/BAUwAwEB/zAdBgNVHQ4EFgQUjbJJaJ1yCCW5wCf1UJNWSEZx+Y8wDgYDVR0P AQH/BAQDAgEGMDYGA1UdEQQvMC2BE2Nhb3BlcmF0b3JAZGlzaWcuc2uGFmh0dHA6Ly93d3cuZGlz aWcuc2svY2EwZgYDVR0fBF8wXTAtoCugKYYnaHR0cDovL3d3dy5kaXNpZy5zay9jYS9jcmwvY2Ff ZGlzaWcuY3JsMCygKqAohiZodHRwOi8vY2EuZGlzaWcuc2svY2EvY3JsL2NhX2Rpc2lnLmNybDAa BgNVHSAEEzARMA8GDSuBHpGT5goAAAABAQEwDQYJKoZIhvcNAQEFBQADggEBAF00dGFMrzvY/59t WDYcPQuBDRIrRhCA/ec8J9B6yKm2fnQwM6M6int0wHl5QpNt/7EpFIKrIYwvF/k/Ji/1WcbvgAa3 mkkp7M5+cTxqEEHA9tOasnxakZzArFvITV734VP/Q3f8nktnbNfzg9Gg4H8l37iYC5oyOGwwoPP/ CBUz91BKez6jPiCp3C9WgArtQVCwyfTssuMmRAAOb54GvCKWU3BlxFAKRmukLyeBEicTXxChds6K ezfqwzlhA5WYOudsiCUI/HloDYd9Yvi0X/vF2Ey9WLw/Q1vUHgFNPGO+I++MzVpQuGhU+QqZMxEA 4Z7CRneC9VkGjCFMhwnN5ag= -----END CERTIFICATE----- Juur-SK ======= -----BEGIN CERTIFICATE----- MIIE5jCCA86gAwIBAgIEO45L/DANBgkqhkiG9w0BAQUFADBdMRgwFgYJKoZIhvcNAQkBFglwa2lA c2suZWUxCzAJBgNVBAYTAkVFMSIwIAYDVQQKExlBUyBTZXJ0aWZpdHNlZXJpbWlza2Vza3VzMRAw DgYDVQQDEwdKdXVyLVNLMB4XDTAxMDgzMDE0MjMwMVoXDTE2MDgyNjE0MjMwMVowXTEYMBYGCSqG SIb3DQEJARYJcGtpQHNrLmVlMQswCQYDVQQGEwJFRTEiMCAGA1UEChMZQVMgU2VydGlmaXRzZWVy aW1pc2tlc2t1czEQMA4GA1UEAxMHSnV1ci1TSzCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoC ggEBAIFxNj4zB9bjMI0TfncyRsvPGbJgMUaXhvSYRqTCZUXP00B841oiqBB4M8yIsdOBSvZiF3tf TQou0M+LI+5PAk676w7KvRhj6IAcjeEcjT3g/1tf6mTll+g/mX8MCgkzABpTpyHhOEvWgxutr2TC +Rx6jGZITWYfGAriPrsfB2WThbkasLnE+w0R9vXW+RvHLCu3GFH+4Hv2qEivbDtPL+/40UceJlfw UR0zlv/vWT3aTdEVNMfqPxZIe5EcgEMPPbgFPtGzlc3Yyg/CQ2fbt5PgIoIuvvVoKIO5wTtpeyDa Tpxt4brNj3pssAki14sL2xzVWiZbDcDq5WDQn/413z8CAwEAAaOCAawwggGoMA8GA1UdEwEB/wQF MAMBAf8wggEWBgNVHSAEggENMIIBCTCCAQUGCisGAQQBzh8BAQEwgfYwgdAGCCsGAQUFBwICMIHD HoHAAFMAZQBlACAAcwBlAHIAdABpAGYAaQBrAGEAYQB0ACAAbwBuACAAdgDkAGwAagBhAHMAdABh AHQAdQBkACAAQQBTAC0AaQBzACAAUwBlAHIAdABpAGYAaQB0AHMAZQBlAHIAaQBtAGkAcwBrAGUA cwBrAHUAcwAgAGEAbABhAG0ALQBTAEsAIABzAGUAcgB0AGkAZgBpAGsAYQBhAHQAaQBkAGUAIABr AGkAbgBuAGkAdABhAG0AaQBzAGUAawBzMCEGCCsGAQUFBwIBFhVodHRwOi8vd3d3LnNrLmVlL2Nw cy8wKwYDVR0fBCQwIjAgoB6gHIYaaHR0cDovL3d3dy5zay5lZS9qdXVyL2NybC8wHQYDVR0OBBYE FASqekej5ImvGs8KQKcYP2/v6X2+MB8GA1UdIwQYMBaAFASqekej5ImvGs8KQKcYP2/v6X2+MA4G A1UdDwEB/wQEAwIB5jANBgkqhkiG9w0BAQUFAAOCAQEAe8EYlFOiCfP+JmeaUOTDBS8rNXiRTHyo ERF5TElZrMj3hWVcRrs7EKACr81Ptcw2Kuxd/u+gkcm2k298gFTsxwhwDY77guwqYHhpNjbRxZyL abVAyJRld/JXIWY7zoVAtjNjGr95HvxcHdMdkxuLDF2FvZkwMhgJkVLpfKG6/2SSmuz+Ne6ML678 IIbsSt4beDI3poHSna9aEhbKmVv8b20OxaAehsmR0FyYgl9jDIpaq9iVpszLita/ZEuOyoqysOkh Mp6qqIWYNIE5ITuoOlIyPfZrN4YGWhWY3PARZv40ILcD9EEQfTmEeZZyY7aWAuVrua0ZTbvGRNs2 yyqcjg== -----END CERTIFICATE----- Hongkong Post Root CA 1 ======================= -----BEGIN CERTIFICATE----- MIIDMDCCAhigAwIBAgICA+gwDQYJKoZIhvcNAQEFBQAwRzELMAkGA1UEBhMCSEsxFjAUBgNVBAoT DUhvbmdrb25nIFBvc3QxIDAeBgNVBAMTF0hvbmdrb25nIFBvc3QgUm9vdCBDQSAxMB4XDTAzMDUx NTA1MTMxNFoXDTIzMDUxNTA0NTIyOVowRzELMAkGA1UEBhMCSEsxFjAUBgNVBAoTDUhvbmdrb25n IFBvc3QxIDAeBgNVBAMTF0hvbmdrb25nIFBvc3QgUm9vdCBDQSAxMIIBIjANBgkqhkiG9w0BAQEF AAOCAQ8AMIIBCgKCAQEArP84tulmAknjorThkPlAj3n54r15/gK97iSSHSL22oVyaf7XPwnU3ZG1 ApzQjVrhVcNQhrkpJsLj2aDxaQMoIIBFIi1WpztUlVYiWR8o3x8gPW2iNr4joLFutbEnPzlTCeqr auh0ssJlXI6/fMN4hM2eFvz1Lk8gKgifd/PFHsSaUmYeSF7jEAaPIpjhZY4bXSNmO7ilMlHIhqqh qZ5/dpTCpmy3QfDVyAY45tQM4vM7TG1QjMSDJ8EThFk9nnV0ttgCXjqQesBCNnLsak3c78QA3xMY V18meMjWCnl3v/evt3a5pQuEF10Q6m/hq5URX208o1xNg1vysxmKgIsLhwIDAQABoyYwJDASBgNV HRMBAf8ECDAGAQH/AgEDMA4GA1UdDwEB/wQEAwIBxjANBgkqhkiG9w0BAQUFAAOCAQEADkbVPK7i h9legYsCmEEIjEy82tvuJxuC52pF7BaLT4Wg87JwvVqWuspube5Gi27nKi6Wsxkz67SfqLI37pio l7Yutmcn1KZJ/RyTZXaeQi/cImyaT/JaFTmxcdcrUehtHJjA2Sr0oYJ71clBoiMBdDhViw+5Lmei IAQ32pwL0xch4I+XeTRvhEgCIDMb5jREn5Fw9IBehEPCKdJsEhTkYY2sEJCehFC78JZvRZ+K88ps T/oROhUVRsPNH4NbLUES7VBnQRM9IauUiqpOfMGx+6fWtScvl6tu4B3i0RwsH0Ti/L6RoZz71ilT c4afU9hDDl3WY4JxHYB0yvbiAmvZWg== -----END CERTIFICATE----- SecureSign RootCA11 =================== -----BEGIN CERTIFICATE----- MIIDbTCCAlWgAwIBAgIBATANBgkqhkiG9w0BAQUFADBYMQswCQYDVQQGEwJKUDErMCkGA1UEChMi SmFwYW4gQ2VydGlmaWNhdGlvbiBTZXJ2aWNlcywgSW5jLjEcMBoGA1UEAxMTU2VjdXJlU2lnbiBS b290Q0ExMTAeFw0wOTA0MDgwNDU2NDdaFw0yOTA0MDgwNDU2NDdaMFgxCzAJBgNVBAYTAkpQMSsw KQYDVQQKEyJKYXBhbiBDZXJ0aWZpY2F0aW9uIFNlcnZpY2VzLCBJbmMuMRwwGgYDVQQDExNTZWN1 cmVTaWduIFJvb3RDQTExMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA/XeqpRyQBTvL TJszi1oURaTnkBbR31fSIRCkF/3frNYfp+TbfPfs37gD2pRY/V1yfIw/XwFndBWW4wI8h9uuywGO wvNmxoVF9ALGOrVisq/6nL+k5tSAMJjzDbaTj6nU2DbysPyKyiyhFTOVMdrAG/LuYpmGYz+/3ZMq g6h2uRMft85OQoWPIucuGvKVCbIFtUROd6EgvanyTgp9UK31BQ1FT0Zx/Sg+U/sE2C3XZR1KG/rP O7AxmjVuyIsG0wCR8pQIZUyxNAYAeoni8McDWc/V1uinMrPmmECGxc0nEovMe863ETxiYAcjPitA bpSACW22s293bzUIUPsCh8U+iQIDAQABo0IwQDAdBgNVHQ4EFgQUW/hNT7KlhtQ60vFjmqC+CfZX t94wDgYDVR0PAQH/BAQDAgEGMA8GA1UdEwEB/wQFMAMBAf8wDQYJKoZIhvcNAQEFBQADggEBAKCh OBZmLqdWHyGcBvod7bkixTgm2E5P7KN/ed5GIaGHd48HCJqypMWvDzKYC3xmKbabfSVSSUOrTC4r bnpwrxYO4wJs+0LmGJ1F2FXI6Dvd5+H0LgscNFxsWEr7jIhQX5Ucv+2rIrVls4W6ng+4reV6G4pQ Oh29Dbx7VFALuUKvVaAYga1lme++5Jy/xIWrQbJUb9wlze144o4MjQlJ3WN7WmmWAiGovVJZ6X01 y8hSyn+B/tlr0/cR7SXf+Of5pPpyl4RTDaXQMhhRdlkUbA/r7F+AjHVDg8OFmP9Mni0N5HeDk061 lgeLKBObjBmNQSdJQO7e5iNEOdyhIta6A/I= -----END CERTIFICATE----- ACEDICOM Root ============= -----BEGIN CERTIFICATE----- MIIFtTCCA52gAwIBAgIIYY3HhjsBggUwDQYJKoZIhvcNAQEFBQAwRDEWMBQGA1UEAwwNQUNFRElD T00gUm9vdDEMMAoGA1UECwwDUEtJMQ8wDQYDVQQKDAZFRElDT00xCzAJBgNVBAYTAkVTMB4XDTA4 MDQxODE2MjQyMloXDTI4MDQxMzE2MjQyMlowRDEWMBQGA1UEAwwNQUNFRElDT00gUm9vdDEMMAoG A1UECwwDUEtJMQ8wDQYDVQQKDAZFRElDT00xCzAJBgNVBAYTAkVTMIICIjANBgkqhkiG9w0BAQEF AAOCAg8AMIICCgKCAgEA/5KV4WgGdrQsyFhIyv2AVClVYyT/kGWbEHV7w2rbYgIB8hiGtXxaOLHk WLn709gtn70yN78sFW2+tfQh0hOR2QetAQXW8713zl9CgQr5auODAKgrLlUTY4HKRxx7XBZXehuD YAQ6PmXDzQHe3qTWDLqO3tkE7hdWIpuPY/1NFgu3e3eM+SW10W2ZEi5PGrjm6gSSrj0RuVFCPYew MYWveVqc/udOXpJPQ/yrOq2lEiZmueIM15jO1FillUAKt0SdE3QrwqXrIhWYENiLxQSfHY9g5QYb m8+5eaA9oiM/Qj9r+hwDezCNzmzAv+YbX79nuIQZ1RXve8uQNjFiybwCq0Zfm/4aaJQ0PZCOrfbk HQl/Sog4P75n/TSW9R28MHTLOO7VbKvU/PQAtwBbhTIWdjPp2KOZnQUAqhbm84F9b32qhm2tFXTT xKJxqvQUfecyuB+81fFOvW8XAjnXDpVCOscAPukmYxHqC9FK/xidstd7LzrZlvvoHpKuE1XI2Sf2 3EgbsCTBheN3nZqk8wwRHQ3ItBTutYJXCb8gWH8vIiPYcMt5bMlL8qkqyPyHK9caUPgn6C9D4zq9 2Fdx/c6mUlv53U3t5fZvie27k5x2IXXwkkwp9y+cAS7+UEaeZAwUswdbxcJzbPEHXEUkFDWug/Fq TYl6+rPYLWbwNof1K1MCAwEAAaOBqjCBpzAPBgNVHRMBAf8EBTADAQH/MB8GA1UdIwQYMBaAFKaz 4SsrSbbXc6GqlPUB53NlTKxQMA4GA1UdDwEB/wQEAwIBhjAdBgNVHQ4EFgQUprPhKytJttdzoaqU 9QHnc2VMrFAwRAYDVR0gBD0wOzA5BgRVHSAAMDEwLwYIKwYBBQUHAgEWI2h0dHA6Ly9hY2VkaWNv bS5lZGljb21ncm91cC5jb20vZG9jMA0GCSqGSIb3DQEBBQUAA4ICAQDOLAtSUWImfQwng4/F9tqg aHtPkl7qpHMyEVNEskTLnewPeUKzEKbHDZ3Ltvo/Onzqv4hTGzz3gvoFNTPhNahXwOf9jU8/kzJP eGYDdwdY6ZXIfj7QeQCM8htRM5u8lOk6e25SLTKeI6RF+7YuE7CLGLHdztUdp0J/Vb77W7tH1Pwk zQSulgUV1qzOMPPKC8W64iLgpq0i5ALudBF/TP94HTXa5gI06xgSYXcGCRZj6hitoocf8seACQl1 ThCojz2GuHURwCRiipZ7SkXp7FnFvmuD5uHorLUwHv4FB4D54SMNUI8FmP8sX+g7tq3PgbUhh8oI KiMnMCArz+2UW6yyetLHKKGKC5tNSixthT8Jcjxn4tncB7rrZXtaAWPWkFtPF2Y9fwsZo5NjEFIq nxQWWOLcpfShFosOkYuByptZ+thrkQdlVV9SH686+5DdaaVbnG0OLLb6zqylfDJKZ0DcMDQj3dcE I2bw/FWAp/tmGYI1Z2JwOV5vx+qQQEQIHriy1tvuWacNGHk0vFQYXlPKNFHtRQrmjseCNj6nOGOp MCwXEGCSn1WHElkQwg9naRHMTh5+Spqtr0CodaxWkHS4oJyleW/c6RrIaQXpuvoDs3zk4E7Czp3o tkYNbn5XOmeUwssfnHdKZ05phkOTOPu220+DkdRgfks+KzgHVZhepA== -----END CERTIFICATE----- Microsec e-Szigno Root CA 2009 ============================== -----BEGIN CERTIFICATE----- MIIECjCCAvKgAwIBAgIJAMJ+QwRORz8ZMA0GCSqGSIb3DQEBCwUAMIGCMQswCQYDVQQGEwJIVTER MA8GA1UEBwwIQnVkYXBlc3QxFjAUBgNVBAoMDU1pY3Jvc2VjIEx0ZC4xJzAlBgNVBAMMHk1pY3Jv c2VjIGUtU3ppZ25vIFJvb3QgQ0EgMjAwOTEfMB0GCSqGSIb3DQEJARYQaW5mb0BlLXN6aWduby5o dTAeFw0wOTA2MTYxMTMwMThaFw0yOTEyMzAxMTMwMThaMIGCMQswCQYDVQQGEwJIVTERMA8GA1UE BwwIQnVkYXBlc3QxFjAUBgNVBAoMDU1pY3Jvc2VjIEx0ZC4xJzAlBgNVBAMMHk1pY3Jvc2VjIGUt U3ppZ25vIFJvb3QgQ0EgMjAwOTEfMB0GCSqGSIb3DQEJARYQaW5mb0BlLXN6aWduby5odTCCASIw DQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAOn4j/NjrdqG2KfgQvvPkd6mJviZpWNwrZuuyjNA fW2WbqEORO7hE52UQlKavXWFdCyoDh2Tthi3jCyoz/tccbna7P7ofo/kLx2yqHWH2Leh5TvPmUpG 0IMZfcChEhyVbUr02MelTTMuhTlAdX4UfIASmFDHQWe4oIBhVKZsTh/gnQ4H6cm6M+f+wFUoLAKA pxn1ntxVUwOXewdI/5n7N4okxFnMUBBjjqqpGrCEGob5X7uxUG6k0QrM1XF+H6cbfPVTbiJfyyvm 1HxdrtbCxkzlBQHZ7Vf8wSN5/PrIJIOV87VqUQHQd9bpEqH5GoP7ghu5sJf0dgYzQ0mg/wu1+rUC AwEAAaOBgDB+MA8GA1UdEwEB/wQFMAMBAf8wDgYDVR0PAQH/BAQDAgEGMB0GA1UdDgQWBBTLD8bf QkPMPcu1SCOhGnqmKrs0aDAfBgNVHSMEGDAWgBTLD8bfQkPMPcu1SCOhGnqmKrs0aDAbBgNVHREE FDASgRBpbmZvQGUtc3ppZ25vLmh1MA0GCSqGSIb3DQEBCwUAA4IBAQDJ0Q5eLtXMs3w+y/w9/w0o lZMEyL/azXm4Q5DwpL7v8u8hmLzU1F0G9u5C7DBsoKqpyvGvivo/C3NqPuouQH4frlRheesuCDfX I/OMn74dseGkddug4lQUsbocKaQY9hK6ohQU4zE1yED/t+AFdlfBHFny+L/k7SViXITwfn4fs775 tyERzAMBVnCnEJIeGzSBHq2cGsMEPO0CYdYeBvNfOofyK/FFh+U9rNHHV4S9a67c2Pm2G2JwCz02 yULyMtd6YebS2z3PyKnJm9zbWETXbzivf3jTo60adbocwTZ8jx5tHMN1Rq41Bab2XD0h7lbwyYIi LXpUq3DDfSJlgnCW -----END CERTIFICATE----- GlobalSign Root CA - R3 ======================= -----BEGIN CERTIFICATE----- MIIDXzCCAkegAwIBAgILBAAAAAABIVhTCKIwDQYJKoZIhvcNAQELBQAwTDEgMB4GA1UECxMXR2xv YmFsU2lnbiBSb290IENBIC0gUjMxEzARBgNVBAoTCkdsb2JhbFNpZ24xEzARBgNVBAMTCkdsb2Jh bFNpZ24wHhcNMDkwMzE4MTAwMDAwWhcNMjkwMzE4MTAwMDAwWjBMMSAwHgYDVQQLExdHbG9iYWxT aWduIFJvb3QgQ0EgLSBSMzETMBEGA1UEChMKR2xvYmFsU2lnbjETMBEGA1UEAxMKR2xvYmFsU2ln bjCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMwldpB5BngiFvXAg7aEyiie/QV2EcWt iHL8RgJDx7KKnQRfJMsuS+FggkbhUqsMgUdwbN1k0ev1LKMPgj0MK66X17YUhhB5uzsTgHeMCOFJ 0mpiLx9e+pZo34knlTifBtc+ycsmWQ1z3rDI6SYOgxXG71uL0gRgykmmKPZpO/bLyCiR5Z2KYVc3 rHQU3HTgOu5yLy6c+9C7v/U9AOEGM+iCK65TpjoWc4zdQQ4gOsC0p6Hpsk+QLjJg6VfLuQSSaGjl OCZgdbKfd/+RFO+uIEn8rUAVSNECMWEZXriX7613t2Saer9fwRPvm2L7DWzgVGkWqQPabumDk3F2 xmmFghcCAwEAAaNCMEAwDgYDVR0PAQH/BAQDAgEGMA8GA1UdEwEB/wQFMAMBAf8wHQYDVR0OBBYE FI/wS3+oLkUkrk1Q+mOai97i3Ru8MA0GCSqGSIb3DQEBCwUAA4IBAQBLQNvAUKr+yAzv95ZURUm7 lgAJQayzE4aGKAczymvmdLm6AC2upArT9fHxD4q/c2dKg8dEe3jgr25sbwMpjjM5RcOO5LlXbKr8 EpbsU8Yt5CRsuZRj+9xTaGdWPoO4zzUhw8lo/s7awlOqzJCK6fBdRoyV3XpYKBovHd7NADdBj+1E bddTKJd+82cEHhXXipa0095MJ6RMG3NzdvQXmcIfeg7jLQitChws/zyrVQ4PkX4268NXSb7hLi18 YIvDQVETI53O9zJrlAGomecsMx86OyXShkDOOyyGeMlhLxS67ttVb9+E7gUJTb0o2HLO02JQZR7r kpeDMdmztcpHWD9f -----END CERTIFICATE----- Autoridad de Certificacion Firmaprofesional CIF A62634068 ========================================================= -----BEGIN CERTIFICATE----- MIIGFDCCA/ygAwIBAgIIU+w77vuySF8wDQYJKoZIhvcNAQEFBQAwUTELMAkGA1UEBhMCRVMxQjBA BgNVBAMMOUF1dG9yaWRhZCBkZSBDZXJ0aWZpY2FjaW9uIEZpcm1hcHJvZmVzaW9uYWwgQ0lGIEE2 MjYzNDA2ODAeFw0wOTA1MjAwODM4MTVaFw0zMDEyMzEwODM4MTVaMFExCzAJBgNVBAYTAkVTMUIw QAYDVQQDDDlBdXRvcmlkYWQgZGUgQ2VydGlmaWNhY2lvbiBGaXJtYXByb2Zlc2lvbmFsIENJRiBB NjI2MzQwNjgwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQDKlmuO6vj78aI14H9M2uDD Utd9thDIAl6zQyrET2qyyhxdKJp4ERppWVevtSBC5IsP5t9bpgOSL/UR5GLXMnE42QQMcas9UX4P B99jBVzpv5RvwSmCwLTaUbDBPLutN0pcyvFLNg4kq7/DhHf9qFD0sefGL9ItWY16Ck6WaVICqjaY 7Pz6FIMMNx/Jkjd/14Et5cS54D40/mf0PmbR0/RAz15iNA9wBj4gGFrO93IbJWyTdBSTo3OxDqqH ECNZXyAFGUftaI6SEspd/NYrspI8IM/hX68gvqB2f3bl7BqGYTM+53u0P6APjqK5am+5hyZvQWyI plD9amML9ZMWGxmPsu2bm8mQ9QEM3xk9Dz44I8kvjwzRAv4bVdZO0I08r0+k8/6vKtMFnXkIoctX MbScyJCyZ/QYFpM6/EfY0XiWMR+6KwxfXZmtY4laJCB22N/9q06mIqqdXuYnin1oKaPnirjaEbsX LZmdEyRG98Xi2J+Of8ePdG1asuhy9azuJBCtLxTa/y2aRnFHvkLfuwHb9H/TKI8xWVvTyQKmtFLK bpf7Q8UIJm+K9Lv9nyiqDdVF8xM6HdjAeI9BZzwelGSuewvF6NkBiDkal4ZkQdU7hwxu+g/GvUgU vzlN1J5Bto+WHWOWk9mVBngxaJ43BjuAiUVhOSPHG0SjFeUc+JIwuwIDAQABo4HvMIHsMBIGA1Ud EwEB/wQIMAYBAf8CAQEwDgYDVR0PAQH/BAQDAgEGMB0GA1UdDgQWBBRlzeurNR4APn7VdMActHNH DhpkLzCBpgYDVR0gBIGeMIGbMIGYBgRVHSAAMIGPMC8GCCsGAQUFBwIBFiNodHRwOi8vd3d3LmZp cm1hcHJvZmVzaW9uYWwuY29tL2NwczBcBggrBgEFBQcCAjBQHk4AUABhAHMAZQBvACAAZABlACAA bABhACAAQgBvAG4AYQBuAG8AdgBhACAANAA3ACAAQgBhAHIAYwBlAGwAbwBuAGEAIAAwADgAMAAx ADcwDQYJKoZIhvcNAQEFBQADggIBABd9oPm03cXF661LJLWhAqvdpYhKsg9VSytXjDvlMd3+xDLx 51tkljYyGOylMnfX40S2wBEqgLk9am58m9Ot/MPWo+ZkKXzR4Tgegiv/J2Wv+xYVxC5xhOW1//qk R71kMrv2JYSiJ0L1ILDCExARzRAVukKQKtJE4ZYm6zFIEv0q2skGz3QeqUvVhyj5eTSSPi5E6PaP T481PyWzOdxjKpBrIF/EUhJOlywqrJ2X3kjyo2bbwtKDlaZmp54lD+kLM5FlClrD2VQS3a/DTg4f Jl4N3LON7NWBcN7STyQF82xO9UxJZo3R/9ILJUFI/lGExkKvgATP0H5kSeTy36LssUzAKh3ntLFl osS88Zj0qnAHY7S42jtM+kAiMFsRpvAFDsYCA0irhpuF3dvd6qJ2gHN99ZwExEWN57kci57q13XR crHedUTnQn3iV2t93Jm8PYMo6oCTjcVMZcFwgbg4/EMxsvYDNEeyrPsiBsse3RdHHF9mudMaotoR saS8I8nkvof/uZS2+F0gStRf571oe2XyFR7SOqkt6dhrJKyXWERHrVkY8SFlcN7ONGCoQPHzPKTD KCOM/iczQ0CgFzzr6juwcqajuUpLXhZI9LK8yIySxZ2frHI2vDSANGupi5LAuBft7HZT9SQBjLMi 6Et8Vcad+qMUu2WFbm5PEn4KPJ2V -----END CERTIFICATE----- Izenpe.com ========== -----BEGIN CERTIFICATE----- MIIF8TCCA9mgAwIBAgIQALC3WhZIX7/hy/WL1xnmfTANBgkqhkiG9w0BAQsFADA4MQswCQYDVQQG EwJFUzEUMBIGA1UECgwLSVpFTlBFIFMuQS4xEzARBgNVBAMMCkl6ZW5wZS5jb20wHhcNMDcxMjEz MTMwODI4WhcNMzcxMjEzMDgyNzI1WjA4MQswCQYDVQQGEwJFUzEUMBIGA1UECgwLSVpFTlBFIFMu QS4xEzARBgNVBAMMCkl6ZW5wZS5jb20wggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQDJ 03rKDx6sp4boFmVqscIbRTJxldn+EFvMr+eleQGPicPK8lVx93e+d5TzcqQsRNiekpsUOqHnJJAK ClaOxdgmlOHZSOEtPtoKct2jmRXagaKH9HtuJneJWK3W6wyyQXpzbm3benhB6QiIEn6HLmYRY2xU +zydcsC8Lv/Ct90NduM61/e0aL6i9eOBbsFGb12N4E3GVFWJGjMxCrFXuaOKmMPsOzTFlUFpfnXC PCDFYbpRR6AgkJOhkEvzTnyFRVSa0QUmQbC1TR0zvsQDyCV8wXDbO/QJLVQnSKwv4cSsPsjLkkxT OTcj7NMB+eAJRE1NZMDhDVqHIrytG6P+JrUV86f8hBnp7KGItERphIPzidF0BqnMC9bC3ieFUCbK F7jJeodWLBoBHmy+E60QrLUk9TiRodZL2vG70t5HtfG8gfZZa88ZU+mNFctKy6lvROUbQc/hhqfK 0GqfvEyNBjNaooXlkDWgYlwWTvDjovoDGrQscbNYLN57C9saD+veIR8GdwYDsMnvmfzAuU8Lhij+ 0rnq49qlw0dpEuDb8PYZi+17cNcC1u2HGCgsBCRMd+RIihrGO5rUD8r6ddIBQFqNeb+Lz0vPqhbB leStTIo+F5HUsWLlguWABKQDfo2/2n+iD5dPDNMN+9fR5XJ+HMh3/1uaD7euBUbl8agW7EekFwID AQABo4H2MIHzMIGwBgNVHREEgagwgaWBD2luZm9AaXplbnBlLmNvbaSBkTCBjjFHMEUGA1UECgw+ SVpFTlBFIFMuQS4gLSBDSUYgQTAxMzM3MjYwLVJNZXJjLlZpdG9yaWEtR2FzdGVpeiBUMTA1NSBG NjIgUzgxQzBBBgNVBAkMOkF2ZGEgZGVsIE1lZGl0ZXJyYW5lbyBFdG9yYmlkZWEgMTQgLSAwMTAx MCBWaXRvcmlhLUdhc3RlaXowDwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMCAQYwHQYDVR0O BBYEFB0cZQ6o8iV7tJHP5LGx5r1VdGwFMA0GCSqGSIb3DQEBCwUAA4ICAQB4pgwWSp9MiDrAyw6l Fn2fuUhfGI8NYjb2zRlrrKvV9pF9rnHzP7MOeIWblaQnIUdCSnxIOvVFfLMMjlF4rJUT3sb9fbga kEyrkgPH7UIBzg/YsfqikuFgba56awmqxinuaElnMIAkejEWOVt+8Rwu3WwJrfIxwYJOubv5vr8q hT/AQKM6WfxZSzwoJNu0FXWuDYi6LnPAvViH5ULy617uHjAimcs30cQhbIHsvm0m5hzkQiCeR7Cs g1lwLDXWrzY0tM07+DKo7+N4ifuNRSzanLh+QBxh5z6ikixL8s36mLYp//Pye6kfLqCTVyvehQP5 aTfLnnhqBbTFMXiJ7HqnheG5ezzevh55hM6fcA5ZwjUukCox2eRFekGkLhObNA5me0mrZJfQRsN5 nXJQY6aYWwa9SG3YOYNw6DXwBdGqvOPbyALqfP2C2sJbUjWumDqtujWTI6cfSN01RpiyEGjkpTHC ClguGYEQyVB1/OpaFs4R1+7vUIgtYf8/QnMFlEPVjjxOAToZpR9GTnfQXeWBIiGH/pR9hNiTrdZo Q0iy2+tzJOeRf1SktoA+naM8THLCV8Sg1Mw4J87VBp6iSNnpn86CcDaTmjvfliHjWbcM2pE38P1Z WrOZyGlsQyYBNWNgVYkDOnXYukrZVP/u3oDYLdE41V4tC5h9Pmzb/CaIxw== -----END CERTIFICATE----- Chambers of Commerce Root - 2008 ================================ -----BEGIN CERTIFICATE----- MIIHTzCCBTegAwIBAgIJAKPaQn6ksa7aMA0GCSqGSIb3DQEBBQUAMIGuMQswCQYDVQQGEwJFVTFD MEEGA1UEBxM6TWFkcmlkIChzZWUgY3VycmVudCBhZGRyZXNzIGF0IHd3dy5jYW1lcmZpcm1hLmNv bS9hZGRyZXNzKTESMBAGA1UEBRMJQTgyNzQzMjg3MRswGQYDVQQKExJBQyBDYW1lcmZpcm1hIFMu QS4xKTAnBgNVBAMTIENoYW1iZXJzIG9mIENvbW1lcmNlIFJvb3QgLSAyMDA4MB4XDTA4MDgwMTEy Mjk1MFoXDTM4MDczMTEyMjk1MFowga4xCzAJBgNVBAYTAkVVMUMwQQYDVQQHEzpNYWRyaWQgKHNl ZSBjdXJyZW50IGFkZHJlc3MgYXQgd3d3LmNhbWVyZmlybWEuY29tL2FkZHJlc3MpMRIwEAYDVQQF EwlBODI3NDMyODcxGzAZBgNVBAoTEkFDIENhbWVyZmlybWEgUy5BLjEpMCcGA1UEAxMgQ2hhbWJl cnMgb2YgQ29tbWVyY2UgUm9vdCAtIDIwMDgwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoIC AQCvAMtwNyuAWko6bHiUfaN/Gh/2NdW928sNRHI+JrKQUrpjOyhYb6WzbZSm891kDFX29ufyIiKA XuFixrYp4YFs8r/lfTJqVKAyGVn+H4vXPWCGhSRv4xGzdz4gljUha7MI2XAuZPeEklPWDrCQiorj h40G072QDuKZoRuGDtqaCrsLYVAGUvGef3bsyw/QHg3PmTA9HMRFEFis1tPo1+XqxQEHd9ZR5gN/ ikilTWh1uem8nk4ZcfUyS5xtYBkL+8ydddy/Js2Pk3g5eXNeJQ7KXOt3EgfLZEFHcpOrUMPrCXZk NNI5t3YRCQ12RcSprj1qr7V9ZS+UWBDsXHyvfuK2GNnQm05aSd+pZgvMPMZ4fKecHePOjlO+Bd5g D2vlGts/4+EhySnB8esHnFIbAURRPHsl18TlUlRdJQfKFiC4reRB7noI/plvg6aRArBsNlVq5331 lubKgdaX8ZSD6e2wsWsSaR6s+12pxZjptFtYer49okQ6Y1nUCyXeG0+95QGezdIp1Z8XGQpvvwyQ 0wlf2eOKNcx5Wk0ZN5K3xMGtr/R5JJqyAQuxr1yW84Ay+1w9mPGgP0revq+ULtlVmhduYJ1jbLhj ya6BXBg14JC7vjxPNyK5fuvPnnchpj04gftI2jE9K+OJ9dC1vX7gUMQSibMjmhAxhduub+84Mxh2 EQIDAQABo4IBbDCCAWgwEgYDVR0TAQH/BAgwBgEB/wIBDDAdBgNVHQ4EFgQU+SSsD7K1+HnA+mCI G8TZTQKeFxkwgeMGA1UdIwSB2zCB2IAU+SSsD7K1+HnA+mCIG8TZTQKeFxmhgbSkgbEwga4xCzAJ BgNVBAYTAkVVMUMwQQYDVQQHEzpNYWRyaWQgKHNlZSBjdXJyZW50IGFkZHJlc3MgYXQgd3d3LmNh bWVyZmlybWEuY29tL2FkZHJlc3MpMRIwEAYDVQQFEwlBODI3NDMyODcxGzAZBgNVBAoTEkFDIENh bWVyZmlybWEgUy5BLjEpMCcGA1UEAxMgQ2hhbWJlcnMgb2YgQ29tbWVyY2UgUm9vdCAtIDIwMDiC CQCj2kJ+pLGu2jAOBgNVHQ8BAf8EBAMCAQYwPQYDVR0gBDYwNDAyBgRVHSAAMCowKAYIKwYBBQUH AgEWHGh0dHA6Ly9wb2xpY3kuY2FtZXJmaXJtYS5jb20wDQYJKoZIhvcNAQEFBQADggIBAJASryI1 wqM58C7e6bXpeHxIvj99RZJe6dqxGfwWPJ+0W2aeaufDuV2I6A+tzyMP3iU6XsxPpcG1Lawk0lgH 3qLPaYRgM+gQDROpI9CF5Y57pp49chNyM/WqfcZjHwj0/gF/JM8rLFQJ3uIrbZLGOU8W6jx+ekbU RWpGqOt1glanq6B8aBMz9p0w8G8nOSQjKpD9kCk18pPfNKXG9/jvjA9iSnyu0/VU+I22mlaHFoI6 M6taIgj3grrqLuBHmrS1RaMFO9ncLkVAO+rcf+g769HsJtg1pDDFOqxXnrN2pSB7+R5KBWIBpih1 YJeSDW4+TTdDDZIVnBgizVGZoCkaPF+KMjNbMMeJL0eYD6MDxvbxrN8y8NmBGuScvfaAFPDRLLmF 9dijscilIeUcE5fuDr3fKanvNFNb0+RqE4QGtjICxFKuItLcsiFCGtpA8CnJ7AoMXOLQusxI0zcK zBIKinmwPQN/aUv0NCB9szTqjktk9T79syNnFQ0EuPAtwQlRPLJsFfClI9eDdOTlLsn+mCdCxqvG nrDQWzilm1DefhiYtUU79nm06PcaewaD+9CL2rvHvRirCG88gGtAPxkZumWK5r7VXNM21+9AUiRg OGcEMeyP84LG3rlV8zsxkVrctQgVrXYlCg17LofiDKYGvCYQbTed7N14jHyAxfDZd0jQ -----END CERTIFICATE----- Global Chambersign Root - 2008 ============================== -----BEGIN CERTIFICATE----- MIIHSTCCBTGgAwIBAgIJAMnN0+nVfSPOMA0GCSqGSIb3DQEBBQUAMIGsMQswCQYDVQQGEwJFVTFD MEEGA1UEBxM6TWFkcmlkIChzZWUgY3VycmVudCBhZGRyZXNzIGF0IHd3dy5jYW1lcmZpcm1hLmNv bS9hZGRyZXNzKTESMBAGA1UEBRMJQTgyNzQzMjg3MRswGQYDVQQKExJBQyBDYW1lcmZpcm1hIFMu QS4xJzAlBgNVBAMTHkdsb2JhbCBDaGFtYmVyc2lnbiBSb290IC0gMjAwODAeFw0wODA4MDExMjMx NDBaFw0zODA3MzExMjMxNDBaMIGsMQswCQYDVQQGEwJFVTFDMEEGA1UEBxM6TWFkcmlkIChzZWUg Y3VycmVudCBhZGRyZXNzIGF0IHd3dy5jYW1lcmZpcm1hLmNvbS9hZGRyZXNzKTESMBAGA1UEBRMJ QTgyNzQzMjg3MRswGQYDVQQKExJBQyBDYW1lcmZpcm1hIFMuQS4xJzAlBgNVBAMTHkdsb2JhbCBD aGFtYmVyc2lnbiBSb290IC0gMjAwODCCAiIwDQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIBAMDf VtPkOpt2RbQT2//BthmLN0EYlVJH6xedKYiONWwGMi5HYvNJBL99RDaxccy9Wglz1dmFRP+RVyXf XjaOcNFccUMd2drvXNL7G706tcuto8xEpw2uIRU/uXpbknXYpBI4iRmKt4DS4jJvVpyR1ogQC7N0 ZJJ0YPP2zxhPYLIj0Mc7zmFLmY/CDNBAspjcDahOo7kKrmCgrUVSY7pmvWjg+b4aqIG7HkF4ddPB /gBVsIdU6CeQNR1MM62X/JcumIS/LMmjv9GYERTtY/jKmIhYF5ntRQOXfjyGHoiMvvKRhI9lNNgA TH23MRdaKXoKGCQwoze1eqkBfSbW+Q6OWfH9GzO1KTsXO0G2Id3UwD2ln58fQ1DJu7xsepeY7s2M H/ucUa6LcL0nn3HAa6x9kGbo1106DbDVwo3VyJ2dwW3Q0L9R5OP4wzg2rtandeavhENdk5IMagfe Ox2YItaswTXbo6Al/3K1dh3ebeksZixShNBFks4c5eUzHdwHU1SjqoI7mjcv3N2gZOnm3b2u/GSF HTynyQbehP9r6GsaPMWis0L7iwk+XwhSx2LE1AVxv8Rk5Pihg+g+EpuoHtQ2TS9x9o0o9oOpE9Jh wZG7SMA0j0GMS0zbaRL/UJScIINZc+18ofLx/d33SdNDWKBWY8o9PeU1VlnpDsogzCtLkykPAgMB AAGjggFqMIIBZjASBgNVHRMBAf8ECDAGAQH/AgEMMB0GA1UdDgQWBBS5CcqcHtvTbDprru1U8VuT BjUuXjCB4QYDVR0jBIHZMIHWgBS5CcqcHtvTbDprru1U8VuTBjUuXqGBsqSBrzCBrDELMAkGA1UE BhMCRVUxQzBBBgNVBAcTOk1hZHJpZCAoc2VlIGN1cnJlbnQgYWRkcmVzcyBhdCB3d3cuY2FtZXJm aXJtYS5jb20vYWRkcmVzcykxEjAQBgNVBAUTCUE4Mjc0MzI4NzEbMBkGA1UEChMSQUMgQ2FtZXJm aXJtYSBTLkEuMScwJQYDVQQDEx5HbG9iYWwgQ2hhbWJlcnNpZ24gUm9vdCAtIDIwMDiCCQDJzdPp 1X0jzjAOBgNVHQ8BAf8EBAMCAQYwPQYDVR0gBDYwNDAyBgRVHSAAMCowKAYIKwYBBQUHAgEWHGh0 dHA6Ly9wb2xpY3kuY2FtZXJmaXJtYS5jb20wDQYJKoZIhvcNAQEFBQADggIBAICIf3DekijZBZRG /5BXqfEv3xoNa/p8DhxJJHkn2EaqbylZUohwEurdPfWbU1Rv4WCiqAm57OtZfMY18dwY6fFn5a+6 ReAJ3spED8IXDneRRXozX1+WLGiLwUePmJs9wOzL9dWCkoQ10b42OFZyMVtHLaoXpGNR6woBrX/s dZ7LoR/xfxKxueRkf2fWIyr0uDldmOghp+G9PUIadJpwr2hsUF1Jz//7Dl3mLEfXgTpZALVza2Mg 9jFFCDkO9HB+QHBaP9BrQql0PSgvAm11cpUJjUhjxsYjV5KTXjXBjfkK9yydYhz2rXzdpjEetrHH foUm+qRqtdpjMNHvkzeyZi99Bffnt0uYlDXA2TopwZ2yUDMdSqlapskD7+3056huirRXhOukP9Du qqqHW2Pok+JrqNS4cnhrG+055F3Lm6qH1U9OAP7Zap88MQ8oAgF9mOinsKJknnn4SPIVqczmyETr P3iZ8ntxPjzxmKfFGBI/5rsoM0LpRQp8bfKGeS/Fghl9CYl8slR2iK7ewfPM4W7bMdaTrpmg7yVq c5iJWzouE4gev8CSlDQb4ye3ix5vQv/n6TebUB0tovkC7stYWDpxvGjjqsGvHCgfotwjZT+B6q6Z 09gwzxMNTxXJhLynSC34MCN32EZLeW32jO06f2ARePTpm67VVMB0gNELQp/B -----END CERTIFICATE----- Go Daddy Root Certificate Authority - G2 ======================================== -----BEGIN CERTIFICATE----- MIIDxTCCAq2gAwIBAgIBADANBgkqhkiG9w0BAQsFADCBgzELMAkGA1UEBhMCVVMxEDAOBgNVBAgT B0FyaXpvbmExEzARBgNVBAcTClNjb3R0c2RhbGUxGjAYBgNVBAoTEUdvRGFkZHkuY29tLCBJbmMu MTEwLwYDVQQDEyhHbyBEYWRkeSBSb290IENlcnRpZmljYXRlIEF1dGhvcml0eSAtIEcyMB4XDTA5 MDkwMTAwMDAwMFoXDTM3MTIzMTIzNTk1OVowgYMxCzAJBgNVBAYTAlVTMRAwDgYDVQQIEwdBcml6 b25hMRMwEQYDVQQHEwpTY290dHNkYWxlMRowGAYDVQQKExFHb0RhZGR5LmNvbSwgSW5jLjExMC8G A1UEAxMoR28gRGFkZHkgUm9vdCBDZXJ0aWZpY2F0ZSBBdXRob3JpdHkgLSBHMjCCASIwDQYJKoZI hvcNAQEBBQADggEPADCCAQoCggEBAL9xYgjx+lk09xvJGKP3gElY6SKDE6bFIEMBO4Tx5oVJnyfq 9oQbTqC023CYxzIBsQU+B07u9PpPL1kwIuerGVZr4oAH/PMWdYA5UXvl+TW2dE6pjYIT5LY/qQOD +qK+ihVqf94Lw7YZFAXK6sOoBJQ7RnwyDfMAZiLIjWltNowRGLfTshxgtDj6AozO091GB94KPutd fMh8+7ArU6SSYmlRJQVhGkSBjCypQ5Yj36w6gZoOKcUcqeldHraenjAKOc7xiID7S13MMuyFYkMl NAJWJwGRtDtwKj9useiciAF9n9T521NtYJ2/LOdYq7hfRvzOxBsDPAnrSTFcaUaz4EcCAwEAAaNC MEAwDwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMCAQYwHQYDVR0OBBYEFDqahQcQZyi27/a9 BUFuIMGU2g/eMA0GCSqGSIb3DQEBCwUAA4IBAQCZ21151fmXWWcDYfF+OwYxdS2hII5PZYe096ac vNjpL9DbWu7PdIxztDhC2gV7+AJ1uP2lsdeu9tfeE8tTEH6KRtGX+rcuKxGrkLAngPnon1rpN5+r 5N9ss4UXnT3ZJE95kTXWXwTrgIOrmgIttRD02JDHBHNA7XIloKmf7J6raBKZV8aPEjoJpL1E/QYV N8Gb5DKj7Tjo2GTzLH4U/ALqn83/B2gX2yKQOC16jdFU8WnjXzPKej17CuPKf1855eJ1usV2GDPO LPAvTK33sefOT6jEm0pUBsV/fdUID+Ic/n4XuKxe9tQWskMJDE32p2u0mYRlynqI4uJEvlz36hz1 -----END CERTIFICATE----- Starfield Root Certificate Authority - G2 ========================================= -----BEGIN CERTIFICATE----- MIID3TCCAsWgAwIBAgIBADANBgkqhkiG9w0BAQsFADCBjzELMAkGA1UEBhMCVVMxEDAOBgNVBAgT B0FyaXpvbmExEzARBgNVBAcTClNjb3R0c2RhbGUxJTAjBgNVBAoTHFN0YXJmaWVsZCBUZWNobm9s b2dpZXMsIEluYy4xMjAwBgNVBAMTKVN0YXJmaWVsZCBSb290IENlcnRpZmljYXRlIEF1dGhvcml0 eSAtIEcyMB4XDTA5MDkwMTAwMDAwMFoXDTM3MTIzMTIzNTk1OVowgY8xCzAJBgNVBAYTAlVTMRAw DgYDVQQIEwdBcml6b25hMRMwEQYDVQQHEwpTY290dHNkYWxlMSUwIwYDVQQKExxTdGFyZmllbGQg VGVjaG5vbG9naWVzLCBJbmMuMTIwMAYDVQQDEylTdGFyZmllbGQgUm9vdCBDZXJ0aWZpY2F0ZSBB dXRob3JpdHkgLSBHMjCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAL3twQP89o/8ArFv W59I2Z154qK3A2FWGMNHttfKPTUuiUP3oWmb3ooa/RMgnLRJdzIpVv257IzdIvpy3Cdhl+72WoTs bhm5iSzchFvVdPtrX8WJpRBSiUZV9Lh1HOZ/5FSuS/hVclcCGfgXcVnrHigHdMWdSL5stPSksPNk N3mSwOxGXn/hbVNMYq/NHwtjuzqd+/x5AJhhdM8mgkBj87JyahkNmcrUDnXMN/uLicFZ8WJ/X7Nf ZTD4p7dNdloedl40wOiWVpmKs/B/pM293DIxfJHP4F8R+GuqSVzRmZTRouNjWwl2tVZi4Ut0HZbU JtQIBFnQmA4O5t78w+wfkPECAwEAAaNCMEAwDwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMC AQYwHQYDVR0OBBYEFHwMMh+n2TB/xH1oo2Kooc6rB1snMA0GCSqGSIb3DQEBCwUAA4IBAQARWfol TwNvlJk7mh+ChTnUdgWUXuEok21iXQnCoKjUsHU48TRqneSfioYmUeYs0cYtbpUgSpIB7LiKZ3sx 4mcujJUDJi5DnUox9g61DLu34jd/IroAow57UvtruzvE03lRTs2Q9GcHGcg8RnoNAX3FWOdt5oUw F5okxBDgBPfg8n/Uqgr/Qh037ZTlZFkSIHc40zI+OIF1lnP6aI+xy84fxez6nH7PfrHxBy22/L/K pL/QlwVKvOoYKAKQvVR4CSFx09F9HdkWsKlhPdAKACL8x3vLCWRFCztAgfd9fDL1mMpYjn0q7pBZ c2T5NnReJaH1ZgUufzkVqSr7UIuOhWn0 -----END CERTIFICATE----- Starfield Services Root Certificate Authority - G2 ================================================== -----BEGIN CERTIFICATE----- MIID7zCCAtegAwIBAgIBADANBgkqhkiG9w0BAQsFADCBmDELMAkGA1UEBhMCVVMxEDAOBgNVBAgT B0FyaXpvbmExEzARBgNVBAcTClNjb3R0c2RhbGUxJTAjBgNVBAoTHFN0YXJmaWVsZCBUZWNobm9s b2dpZXMsIEluYy4xOzA5BgNVBAMTMlN0YXJmaWVsZCBTZXJ2aWNlcyBSb290IENlcnRpZmljYXRl IEF1dGhvcml0eSAtIEcyMB4XDTA5MDkwMTAwMDAwMFoXDTM3MTIzMTIzNTk1OVowgZgxCzAJBgNV BAYTAlVTMRAwDgYDVQQIEwdBcml6b25hMRMwEQYDVQQHEwpTY290dHNkYWxlMSUwIwYDVQQKExxT dGFyZmllbGQgVGVjaG5vbG9naWVzLCBJbmMuMTswOQYDVQQDEzJTdGFyZmllbGQgU2VydmljZXMg Um9vdCBDZXJ0aWZpY2F0ZSBBdXRob3JpdHkgLSBHMjCCASIwDQYJKoZIhvcNAQEBBQADggEPADCC AQoCggEBANUMOsQq+U7i9b4Zl1+OiFOxHz/Lz58gE20pOsgPfTz3a3Y4Y9k2YKibXlwAgLIvWX/2 h/klQ4bnaRtSmpDhcePYLQ1Ob/bISdm28xpWriu2dBTrz/sm4xq6HZYuajtYlIlHVv8loJNwU4Pa hHQUw2eeBGg6345AWh1KTs9DkTvnVtYAcMtS7nt9rjrnvDH5RfbCYM8TWQIrgMw0R9+53pBlbQLP LJGmpufehRhJfGZOozptqbXuNC66DQO4M99H67FrjSXZm86B0UVGMpZwh94CDklDhbZsc7tk6mFB rMnUVN+HL8cisibMn1lUaJ/8viovxFUcdUBgF4UCVTmLfwUCAwEAAaNCMEAwDwYDVR0TAQH/BAUw AwEB/zAOBgNVHQ8BAf8EBAMCAQYwHQYDVR0OBBYEFJxfAN+qAdcwKziIorhtSpzyEZGDMA0GCSqG SIb3DQEBCwUAA4IBAQBLNqaEd2ndOxmfZyMIbw5hyf2E3F/YNoHN2BtBLZ9g3ccaaNnRbobhiCPP E95Dz+I0swSdHynVv/heyNXBve6SbzJ08pGCL72CQnqtKrcgfU28elUSwhXqvfdqlS5sdJ/PHLTy xQGjhdByPq1zqwubdQxtRbeOlKyWN7Wg0I8VRw7j6IPdj/3vQQF3zCepYoUz8jcI73HPdwbeyBkd iEDPfUYd/x7H4c7/I9vG+o1VTqkC50cRRj70/b17KSa7qWFiNyi2LSr2EIZkyXCn0q23KXB56jza YyWf/Wi3MOxw+3WKt21gZ7IeyLnp2KhvAotnDU0mV3HaIPzBSlCNsSi6 -----END CERTIFICATE----- AffirmTrust Commercial ====================== -----BEGIN CERTIFICATE----- MIIDTDCCAjSgAwIBAgIId3cGJyapsXwwDQYJKoZIhvcNAQELBQAwRDELMAkGA1UEBhMCVVMxFDAS BgNVBAoMC0FmZmlybVRydXN0MR8wHQYDVQQDDBZBZmZpcm1UcnVzdCBDb21tZXJjaWFsMB4XDTEw MDEyOTE0MDYwNloXDTMwMTIzMTE0MDYwNlowRDELMAkGA1UEBhMCVVMxFDASBgNVBAoMC0FmZmly bVRydXN0MR8wHQYDVQQDDBZBZmZpcm1UcnVzdCBDb21tZXJjaWFsMIIBIjANBgkqhkiG9w0BAQEF AAOCAQ8AMIIBCgKCAQEA9htPZwcroRX1BiLLHwGy43NFBkRJLLtJJRTWzsO3qyxPxkEylFf6Eqdb DuKPHx6GGaeqtS25Xw2Kwq+FNXkyLbscYjfysVtKPcrNcV/pQr6U6Mje+SJIZMblq8Yrba0F8PrV C8+a5fBQpIs7R6UjW3p6+DM/uO+Zl+MgwdYoic+U+7lF7eNAFxHUdPALMeIrJmqbTFeurCA+ukV6 BfO9m2kVrn1OIGPENXY6BwLJN/3HR+7o8XYdcxXyl6S1yHp52UKqK39c/s4mT6NmgTWvRLpUHhww MmWd5jyTXlBOeuM61G7MGvv50jeuJCqrVwMiKA1JdX+3KNp1v47j3A55MQIDAQABo0IwQDAdBgNV HQ4EFgQUnZPGU4teyq8/nx4P5ZmVvCT2lI8wDwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMC AQYwDQYJKoZIhvcNAQELBQADggEBAFis9AQOzcAN/wr91LoWXym9e2iZWEnStB03TX8nfUYGXUPG hi4+c7ImfU+TqbbEKpqrIZcUsd6M06uJFdhrJNTxFq7YpFzUf1GO7RgBsZNjvbz4YYCanrHOQnDi qX0GJX0nof5v7LMeJNrjS1UaADs1tDvZ110w/YETifLCBivtZ8SOyUOyXGsViQK8YvxO8rUzqrJv 0wqiUOP2O+guRMLbZjipM1ZI8W0bM40NjD9gN53Tym1+NH4Nn3J2ixufcv1SNUFFApYvHLKac0kh sUlHRUe072o0EclNmsxZt9YCnlpOZbWUrhvfKbAW8b8Angc6F2S1BLUjIZkKlTuXfO8= -----END CERTIFICATE----- AffirmTrust Networking ====================== -----BEGIN CERTIFICATE----- MIIDTDCCAjSgAwIBAgIIfE8EORzUmS0wDQYJKoZIhvcNAQEFBQAwRDELMAkGA1UEBhMCVVMxFDAS BgNVBAoMC0FmZmlybVRydXN0MR8wHQYDVQQDDBZBZmZpcm1UcnVzdCBOZXR3b3JraW5nMB4XDTEw MDEyOTE0MDgyNFoXDTMwMTIzMTE0MDgyNFowRDELMAkGA1UEBhMCVVMxFDASBgNVBAoMC0FmZmly bVRydXN0MR8wHQYDVQQDDBZBZmZpcm1UcnVzdCBOZXR3b3JraW5nMIIBIjANBgkqhkiG9w0BAQEF AAOCAQ8AMIIBCgKCAQEAtITMMxcua5Rsa2FSoOujz3mUTOWUgJnLVWREZY9nZOIG41w3SfYvm4SE Hi3yYJ0wTsyEheIszx6e/jarM3c1RNg1lho9Nuh6DtjVR6FqaYvZ/Ls6rnla1fTWcbuakCNrmreI dIcMHl+5ni36q1Mr3Lt2PpNMCAiMHqIjHNRqrSK6mQEubWXLviRmVSRLQESxG9fhwoXA3hA/Pe24 /PHxI1Pcv2WXb9n5QHGNfb2V1M6+oF4nI979ptAmDgAp6zxG8D1gvz9Q0twmQVGeFDdCBKNwV6gb h+0t+nvujArjqWaJGctB+d1ENmHP4ndGyH329JKBNv3bNPFyfvMMFr20FQIDAQABo0IwQDAdBgNV HQ4EFgQUBx/S55zawm6iQLSwelAQUHTEyL0wDwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMC AQYwDQYJKoZIhvcNAQEFBQADggEBAIlXshZ6qML91tmbmzTCnLQyFE2npN/svqe++EPbkTfOtDIu UFUaNU52Q3Eg75N3ThVwLofDwR1t3Mu1J9QsVtFSUzpE0nPIxBsFZVpikpzuQY0x2+c06lkh1QF6 12S4ZDnNye2v7UsDSKegmQGA3GWjNq5lWUhPgkvIZfFXHeVZLgo/bNjR9eUJtGxUAArgFU2HdW23 WJZa3W3SAKD0m0i+wzekujbgfIeFlxoVot4uolu9rxj5kFDNcFn4J2dHy8egBzp90SxdbBk6ZrV9 /ZFvgrG+CJPbFEfxojfHRZ48x3evZKiT3/Zpg4Jg8klCNO1aAFSFHBY2kgxc+qatv9s= -----END CERTIFICATE----- AffirmTrust Premium =================== -----BEGIN CERTIFICATE----- MIIFRjCCAy6gAwIBAgIIbYwURrGmCu4wDQYJKoZIhvcNAQEMBQAwQTELMAkGA1UEBhMCVVMxFDAS BgNVBAoMC0FmZmlybVRydXN0MRwwGgYDVQQDDBNBZmZpcm1UcnVzdCBQcmVtaXVtMB4XDTEwMDEy OTE0MTAzNloXDTQwMTIzMTE0MTAzNlowQTELMAkGA1UEBhMCVVMxFDASBgNVBAoMC0FmZmlybVRy dXN0MRwwGgYDVQQDDBNBZmZpcm1UcnVzdCBQcmVtaXVtMIICIjANBgkqhkiG9w0BAQEFAAOCAg8A MIICCgKCAgEAxBLfqV/+Qd3d9Z+K4/as4Tx4mrzY8H96oDMq3I0gW64tb+eT2TZwamjPjlGjhVtn BKAQJG9dKILBl1fYSCkTtuG+kU3fhQxTGJoeJKJPj/CihQvL9Cl/0qRY7iZNyaqoe5rZ+jjeRFcV 5fiMyNlI4g0WJx0eyIOFJbe6qlVBzAMiSy2RjYvmia9mx+n/K+k8rNrSs8PhaJyJ+HoAVt70VZVs +7pk3WKL3wt3MutizCaam7uqYoNMtAZ6MMgpv+0GTZe5HMQxK9VfvFMSF5yZVylmd2EhMQcuJUmd GPLu8ytxjLW6OQdJd/zvLpKQBY0tL3d770O/Nbua2Plzpyzy0FfuKE4mX4+QaAkvuPjcBukumj5R p9EixAqnOEhss/n/fauGV+O61oV4d7pD6kh/9ti+I20ev9E2bFhc8e6kGVQa9QPSdubhjL08s9NI S+LI+H+SqHZGnEJlPqQewQcDWkYtuJfzt9WyVSHvutxMAJf7FJUnM7/oQ0dG0giZFmA7mn7S5u04 6uwBHjxIVkkJx0w3AJ6IDsBz4W9m6XJHMD4Q5QsDyZpCAGzFlH5hxIrff4IaC1nEWTJ3s7xgaVY5 /bQGeyzWZDbZvUjthB9+pSKPKrhC9IK31FOQeE4tGv2Bb0TXOwF0lkLgAOIua+rF7nKsu7/+6qqo +Nz2snmKtmcCAwEAAaNCMEAwHQYDVR0OBBYEFJ3AZ6YMItkm9UWrpmVSESfYRaxjMA8GA1UdEwEB /wQFMAMBAf8wDgYDVR0PAQH/BAQDAgEGMA0GCSqGSIb3DQEBDAUAA4ICAQCzV00QYk465KzquByv MiPIs0laUZx2KI15qldGF9X1Uva3ROgIRL8YhNILgM3FEv0AVQVhh0HctSSePMTYyPtwni94loMg Nt58D2kTiKV1NpgIpsbfrM7jWNa3Pt668+s0QNiigfV4Py/VpfzZotReBA4Xrf5B8OWycvpEgjNC 6C1Y91aMYj+6QrCcDFx+LmUmXFNPALJ4fqENmS2NuB2OosSw/WDQMKSOyARiqcTtNd56l+0OOF6S L5Nwpamcb6d9Ex1+xghIsV5n61EIJenmJWtSKZGc0jlzCFfemQa0W50QBuHCAKi4HEoCChTQwUHK +4w1IX2COPKpVJEZNZOUbWo6xbLQu4mGk+ibyQ86p3q4ofB4Rvr8Ny/lioTz3/4E2aFooC8k4gmV BtWVyuEklut89pMFu+1z6S3RdTnX5yTb2E5fQ4+e0BQ5v1VwSJlXMbSc7kqYA5YwH2AG7hsj/oFg IxpHYoWlzBk0gG+zrBrjn/B7SK3VAdlntqlyk+otZrWyuOQ9PLLvTIzq6we/qzWaVYa8GKa1qF60 g2xraUDTn9zxw2lrueFtCfTxqlB2Cnp9ehehVZZCmTEJ3WARjQUwfuaORtGdFNrHF+QFlozEJLUb zxQHskD4o55BhrwE0GuWyCqANP2/7waj3VjFhT0+j/6eKeC2uAloGRwYQw== -----END CERTIFICATE----- AffirmTrust Premium ECC ======================= -----BEGIN CERTIFICATE----- MIIB/jCCAYWgAwIBAgIIdJclisc/elQwCgYIKoZIzj0EAwMwRTELMAkGA1UEBhMCVVMxFDASBgNV BAoMC0FmZmlybVRydXN0MSAwHgYDVQQDDBdBZmZpcm1UcnVzdCBQcmVtaXVtIEVDQzAeFw0xMDAx MjkxNDIwMjRaFw00MDEyMzExNDIwMjRaMEUxCzAJBgNVBAYTAlVTMRQwEgYDVQQKDAtBZmZpcm1U cnVzdDEgMB4GA1UEAwwXQWZmaXJtVHJ1c3QgUHJlbWl1bSBFQ0MwdjAQBgcqhkjOPQIBBgUrgQQA IgNiAAQNMF4bFZ0D0KF5Nbc6PJJ6yhUczWLznCZcBz3lVPqj1swS6vQUX+iOGasvLkjmrBhDeKzQ N8O9ss0s5kfiGuZjuD0uL3jET9v0D6RoTFVya5UdThhClXjMNzyR4ptlKymjQjBAMB0GA1UdDgQW BBSaryl6wBE1NSZRMADDav5A1a7WPDAPBgNVHRMBAf8EBTADAQH/MA4GA1UdDwEB/wQEAwIBBjAK BggqhkjOPQQDAwNnADBkAjAXCfOHiFBar8jAQr9HX/VsaobgxCd05DhT1wV/GzTjxi+zygk8N53X 57hG8f2h4nECMEJZh0PUUd+60wkyWs6Iflc9nF9Ca/UHLbXwgpP5WW+uZPpY5Yse42O+tYHNbwKM eQ== -----END CERTIFICATE----- Certum Trusted Network CA ========================= -----BEGIN CERTIFICATE----- MIIDuzCCAqOgAwIBAgIDBETAMA0GCSqGSIb3DQEBBQUAMH4xCzAJBgNVBAYTAlBMMSIwIAYDVQQK ExlVbml6ZXRvIFRlY2hub2xvZ2llcyBTLkEuMScwJQYDVQQLEx5DZXJ0dW0gQ2VydGlmaWNhdGlv biBBdXRob3JpdHkxIjAgBgNVBAMTGUNlcnR1bSBUcnVzdGVkIE5ldHdvcmsgQ0EwHhcNMDgxMDIy MTIwNzM3WhcNMjkxMjMxMTIwNzM3WjB+MQswCQYDVQQGEwJQTDEiMCAGA1UEChMZVW5pemV0byBU ZWNobm9sb2dpZXMgUy5BLjEnMCUGA1UECxMeQ2VydHVtIENlcnRpZmljYXRpb24gQXV0aG9yaXR5 MSIwIAYDVQQDExlDZXJ0dW0gVHJ1c3RlZCBOZXR3b3JrIENBMIIBIjANBgkqhkiG9w0BAQEFAAOC AQ8AMIIBCgKCAQEA4/t9o3K6wvDJFIf1awFO4W5AB7ptJ11/91sts1rHUV+rpDKmYYe2bg+G0jAC l/jXaVehGDldamR5xgFZrDwxSjh80gTSSyjoIF87B6LMTXPb865Px1bVWqeWifrzq2jUI4ZZJ88J J7ysbnKDHDBy3+Ci6dLhdHUZvSqeexVUBBvXQzmtVSjF4hq79MDkrjhJM8x2hZ85RdKknvISjFH4 fOQtf/WsX+sWn7Et0brMkUJ3TCXJkDhv2/DM+44el1k+1WBO5gUo7Ul5E0u6SNsv+XLTOcr+H9g0 cvW0QM8xAcPs3hEtF10fuFDRXhmnad4HMyjKUJX5p1TLVIZQRan5SQIDAQABo0IwQDAPBgNVHRMB Af8EBTADAQH/MB0GA1UdDgQWBBQIds3LB/8k9sXN7buQvOKEN0Z19zAOBgNVHQ8BAf8EBAMCAQYw DQYJKoZIhvcNAQEFBQADggEBAKaorSLOAT2mo/9i0Eidi15ysHhE49wcrwn9I0j6vSrEuVUEtRCj jSfeC4Jj0O7eDDd5QVsisrCaQVymcODU0HfLI9MA4GxWL+FpDQ3Zqr8hgVDZBqWo/5U30Kr+4rP1 mS1FhIrlQgnXdAIv94nYmem8J9RHjboNRhx3zxSkHLmkMcScKHQDNP8zGSal6Q10tz6XxnboJ5aj Zt3hrvJBW8qYVoNzcOSGGtIxQbovvi0TWnZvTuhOgQ4/WwMioBK+ZlgRSssDxLQqKi2WF+A5VLxI 03YnnZotBqbJ7DnSq9ufmgsnAjUpsUCV5/nonFWIGUbWtzT1fs45mtk48VH3Tyw= -----END CERTIFICATE----- Certinomis - Autorité Racine ============================= -----BEGIN CERTIFICATE----- MIIFnDCCA4SgAwIBAgIBATANBgkqhkiG9w0BAQUFADBjMQswCQYDVQQGEwJGUjETMBEGA1UEChMK Q2VydGlub21pczEXMBUGA1UECxMOMDAwMiA0MzM5OTg5MDMxJjAkBgNVBAMMHUNlcnRpbm9taXMg LSBBdXRvcml0w6kgUmFjaW5lMB4XDTA4MDkxNzA4Mjg1OVoXDTI4MDkxNzA4Mjg1OVowYzELMAkG A1UEBhMCRlIxEzARBgNVBAoTCkNlcnRpbm9taXMxFzAVBgNVBAsTDjAwMDIgNDMzOTk4OTAzMSYw JAYDVQQDDB1DZXJ0aW5vbWlzIC0gQXV0b3JpdMOpIFJhY2luZTCCAiIwDQYJKoZIhvcNAQEBBQAD ggIPADCCAgoCggIBAJ2Fn4bT46/HsmtuM+Cet0I0VZ35gb5j2CN2DpdUzZlMGvE5x4jYF1AMnmHa wE5V3udauHpOd4cN5bjr+p5eex7Ezyh0x5P1FMYiKAT5kcOrJ3NqDi5N8y4oH3DfVS9O7cdxbwly Lu3VMpfQ8Vh30WC8Tl7bmoT2R2FFK/ZQpn9qcSdIhDWerP5pqZ56XjUl+rSnSTV3lqc2W+HN3yNw 2F1MpQiD8aYkOBOo7C+ooWfHpi2GR+6K/OybDnT0K0kCe5B1jPyZOQE51kqJ5Z52qz6WKDgmi92N jMD2AR5vpTESOH2VwnHu7XSu5DaiQ3XV8QCb4uTXzEIDS3h65X27uK4uIJPT5GHfceF2Z5c/tt9q c1pkIuVC28+BA5PY9OMQ4HL2AHCs8MF6DwV/zzRpRbWT5BnbUhYjBYkOjUjkJW+zeL9i9Qf6lSTC lrLooyPCXQP8w9PlfMl1I9f09bze5N/NgL+RiH2nE7Q5uiy6vdFrzPOlKO1Enn1So2+WLhl+HPNb xxaOu2B9d2ZHVIIAEWBsMsGoOBvrbpgT1u449fCfDu/+MYHB0iSVL1N6aaLwD4ZFjliCK0wi1F6g 530mJ0jfJUaNSih8hp75mxpZuWW/Bd22Ql095gBIgl4g9xGC3srYn+Y3RyYe63j3YcNBZFgCQfna 4NH4+ej9Uji29YnfAgMBAAGjWzBZMA8GA1UdEwEB/wQFMAMBAf8wDgYDVR0PAQH/BAQDAgEGMB0G A1UdDgQWBBQNjLZh2kS40RR9w759XkjwzspqsDAXBgNVHSAEEDAOMAwGCiqBegFWAgIAAQEwDQYJ KoZIhvcNAQEFBQADggIBACQ+YAZ+He86PtvqrxyaLAEL9MW12Ukx9F1BjYkMTv9sov3/4gbIOZ/x WqndIlgVqIrTseYyCYIDbNc/CMf4uboAbbnW/FIyXaR/pDGUu7ZMOH8oMDX/nyNTt7buFHAAQCva R6s0fl6nVjBhK4tDrP22iCj1a7Y+YEq6QpA0Z43q619FVDsXrIvkxmUP7tCMXWY5zjKn2BCXwH40 nJ+U8/aGH88bc62UeYdocMMzpXDn2NU4lG9jeeu/Cg4I58UvD0KgKxRA/yHgBcUn4YQRE7rWhh1B CxMjidPJC+iKunqjo3M3NYB9Ergzd0A4wPpeMNLytqOx1qKVl4GbUu1pTP+A5FPbVFsDbVRfsbjv JL1vnxHDx2TCDyhihWZeGnuyt++uNckZM6i4J9szVb9o4XVIRFb7zdNIu0eJOqxp9YDG5ERQL1TE qkPFMTFYvZbF6nVsmnWxTfj3l/+WFvKXTej28xH5On2KOG4Ey+HTRRWqpdEdnV1j6CTmNhTih60b WfVEm/vXd3wfAXBioSAaosUaKPQhA+4u2cGA6rnZgtZbdsLLO7XSAPCjDuGtbkD326C00EauFddE wk01+dIL8hf2rGbVJLJP0RyZwG71fet0BLj5TXcJ17TPBzAJ8bgAVtkXFhYKK4bfjwEZGuW7gmP/ vgt2Fl43N+bYdJeimUV5 -----END CERTIFICATE----- Root CA Generalitat Valenciana ============================== -----BEGIN CERTIFICATE----- MIIGizCCBXOgAwIBAgIEO0XlaDANBgkqhkiG9w0BAQUFADBoMQswCQYDVQQGEwJFUzEfMB0GA1UE ChMWR2VuZXJhbGl0YXQgVmFsZW5jaWFuYTEPMA0GA1UECxMGUEtJR1ZBMScwJQYDVQQDEx5Sb290 IENBIEdlbmVyYWxpdGF0IFZhbGVuY2lhbmEwHhcNMDEwNzA2MTYyMjQ3WhcNMjEwNzAxMTUyMjQ3 WjBoMQswCQYDVQQGEwJFUzEfMB0GA1UEChMWR2VuZXJhbGl0YXQgVmFsZW5jaWFuYTEPMA0GA1UE CxMGUEtJR1ZBMScwJQYDVQQDEx5Sb290IENBIEdlbmVyYWxpdGF0IFZhbGVuY2lhbmEwggEiMA0G CSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDGKqtXETcvIorKA3Qdyu0togu8M1JAJke+WmmmO3I2 F0zo37i7L3bhQEZ0ZQKQUgi0/6iMweDHiVYQOTPvaLRfX9ptI6GJXiKjSgbwJ/BXufjpTjJ3Cj9B ZPPrZe52/lSqfR0grvPXdMIKX/UIKFIIzFVd0g/bmoGlu6GzwZTNVOAydTGRGmKy3nXiz0+J2ZGQ D0EbtFpKd71ng+CT516nDOeB0/RSrFOyA8dEJvt55cs0YFAQexvba9dHq198aMpunUEDEO5rmXte JajCq+TA81yc477OMUxkHl6AovWDfgzWyoxVjr7gvkkHD6MkQXpYHYTqWBLI4bft75PelAgxAgMB AAGjggM7MIIDNzAyBggrBgEFBQcBAQQmMCQwIgYIKwYBBQUHMAGGFmh0dHA6Ly9vY3NwLnBraS5n dmEuZXMwEgYDVR0TAQH/BAgwBgEB/wIBAjCCAjQGA1UdIASCAiswggInMIICIwYKKwYBBAG/VQIB ADCCAhMwggHoBggrBgEFBQcCAjCCAdoeggHWAEEAdQB0AG8AcgBpAGQAYQBkACAAZABlACAAQwBl AHIAdABpAGYAaQBjAGEAYwBpAPMAbgAgAFIAYQDtAHoAIABkAGUAIABsAGEAIABHAGUAbgBlAHIA YQBsAGkAdABhAHQAIABWAGEAbABlAG4AYwBpAGEAbgBhAC4ADQAKAEwAYQAgAEQAZQBjAGwAYQBy AGEAYwBpAPMAbgAgAGQAZQAgAFAAcgDhAGMAdABpAGMAYQBzACAAZABlACAAQwBlAHIAdABpAGYA aQBjAGEAYwBpAPMAbgAgAHEAdQBlACAAcgBpAGcAZQAgAGUAbAAgAGYAdQBuAGMAaQBvAG4AYQBt AGkAZQBuAHQAbwAgAGQAZQAgAGwAYQAgAHAAcgBlAHMAZQBuAHQAZQAgAEEAdQB0AG8AcgBpAGQA YQBkACAAZABlACAAQwBlAHIAdABpAGYAaQBjAGEAYwBpAPMAbgAgAHMAZQAgAGUAbgBjAHUAZQBu AHQAcgBhACAAZQBuACAAbABhACAAZABpAHIAZQBjAGMAaQDzAG4AIAB3AGUAYgAgAGgAdAB0AHAA OgAvAC8AdwB3AHcALgBwAGsAaQAuAGcAdgBhAC4AZQBzAC8AYwBwAHMwJQYIKwYBBQUHAgEWGWh0 dHA6Ly93d3cucGtpLmd2YS5lcy9jcHMwHQYDVR0OBBYEFHs100DSHHgZZu90ECjcPk+yeAT8MIGV BgNVHSMEgY0wgYqAFHs100DSHHgZZu90ECjcPk+yeAT8oWykajBoMQswCQYDVQQGEwJFUzEfMB0G A1UEChMWR2VuZXJhbGl0YXQgVmFsZW5jaWFuYTEPMA0GA1UECxMGUEtJR1ZBMScwJQYDVQQDEx5S b290IENBIEdlbmVyYWxpdGF0IFZhbGVuY2lhbmGCBDtF5WgwDQYJKoZIhvcNAQEFBQADggEBACRh TvW1yEICKrNcda3FbcrnlD+laJWIwVTAEGmiEi8YPyVQqHxK6sYJ2fR1xkDar1CdPaUWu20xxsdz Ckj+IHLtb8zog2EWRpABlUt9jppSCS/2bxzkoXHPjCpaF3ODR00PNvsETUlR4hTJZGH71BTg9J63 NI8KJr2XXPR5OkowGcytT6CYirQxlyric21+eLj4iIlPsSKRZEv1UN4D2+XFducTZnV+ZfsBn5OH iJ35Rld8TWCvmHMTI6QgkYH60GFmuH3Rr9ZvHmw96RH9qfmCIoaZM3Fa6hlXPZHNqcCjbgcTpsnt +GijnsNacgmHKNHEc8RzGF9QdRYxn7fofMM= -----END CERTIFICATE----- A-Trust-nQual-03 ================ -----BEGIN CERTIFICATE----- MIIDzzCCAregAwIBAgIDAWweMA0GCSqGSIb3DQEBBQUAMIGNMQswCQYDVQQGEwJBVDFIMEYGA1UE Cgw/QS1UcnVzdCBHZXMuIGYuIFNpY2hlcmhlaXRzc3lzdGVtZSBpbSBlbGVrdHIuIERhdGVudmVy a2VociBHbWJIMRkwFwYDVQQLDBBBLVRydXN0LW5RdWFsLTAzMRkwFwYDVQQDDBBBLVRydXN0LW5R dWFsLTAzMB4XDTA1MDgxNzIyMDAwMFoXDTE1MDgxNzIyMDAwMFowgY0xCzAJBgNVBAYTAkFUMUgw RgYDVQQKDD9BLVRydXN0IEdlcy4gZi4gU2ljaGVyaGVpdHNzeXN0ZW1lIGltIGVsZWt0ci4gRGF0 ZW52ZXJrZWhyIEdtYkgxGTAXBgNVBAsMEEEtVHJ1c3QtblF1YWwtMDMxGTAXBgNVBAMMEEEtVHJ1 c3QtblF1YWwtMDMwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCtPWFuA/OQO8BBC4SA zewqo51ru27CQoT3URThoKgtUaNR8t4j8DRE/5TrzAUjlUC5B3ilJfYKvUWG6Nm9wASOhURh73+n yfrBJcyFLGM/BWBzSQXgYHiVEEvc+RFZznF/QJuKqiTfC0Li21a8StKlDJu3Qz7dg9MmEALP6iPE SU7l0+m0iKsMrmKS1GWH2WrX9IWf5DMiJaXlyDO6w8dB3F/GaswADm0yqLaHNgBid5seHzTLkDx4 iHQF63n1k3Flyp3HaxgtPVxO59X4PzF9j4fsCiIvI+n+u33J4PTs63zEsMMtYrWacdaxaujs2e3V cuy+VwHOBVWf3tFgiBCzAgMBAAGjNjA0MA8GA1UdEwEB/wQFMAMBAf8wEQYDVR0OBAoECERqlWdV eRFPMA4GA1UdDwEB/wQEAwIBBjANBgkqhkiG9w0BAQUFAAOCAQEAVdRU0VlIXLOThaq/Yy/kgM40 ozRiPvbY7meIMQQDbwvUB/tOdQ/TLtPAF8fGKOwGDREkDg6lXb+MshOWcdzUzg4NCmgybLlBMRmr sQd7TZjTXLDR8KdCoLXEjq/+8T/0709GAHbrAvv5ndJAlseIOrifEXnzgGWovR/TeIGgUUw3tKZd JXDRZslo+S4RFGjxVJgIrCaSD96JntT6s3kr0qN51OyLrIdTaEJMUVF0HhsnLuP1Hyl0Te2v9+GS mYHovjrHF1D2t8b8m7CKa9aIA5GPBnc6hQLdmNVDeD/GMBWsm2vLV7eJUYs66MmEDNuxUCAKGkq6 ahq97BvIxYSazQ== -----END CERTIFICATE----- TWCA Root Certification Authority ================================= -----BEGIN CERTIFICATE----- MIIDezCCAmOgAwIBAgIBATANBgkqhkiG9w0BAQUFADBfMQswCQYDVQQGEwJUVzESMBAGA1UECgwJ VEFJV0FOLUNBMRAwDgYDVQQLDAdSb290IENBMSowKAYDVQQDDCFUV0NBIFJvb3QgQ2VydGlmaWNh dGlvbiBBdXRob3JpdHkwHhcNMDgwODI4MDcyNDMzWhcNMzAxMjMxMTU1OTU5WjBfMQswCQYDVQQG EwJUVzESMBAGA1UECgwJVEFJV0FOLUNBMRAwDgYDVQQLDAdSb290IENBMSowKAYDVQQDDCFUV0NB IFJvb3QgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEK AoIBAQCwfnK4pAOU5qfeCTiRShFAh6d8WWQUe7UREN3+v9XAu1bihSX0NXIP+FPQQeFEAcK0HMMx QhZHhTMidrIKbw/lJVBPhYa+v5guEGcevhEFhgWQxFnQfHgQsIBct+HHK3XLfJ+utdGdIzdjp9xC oi2SBBtQwXu4PhvJVgSLL1KbralW6cH/ralYhzC2gfeXRfwZVzsrb+RH9JlF/h3x+JejiB03HFyP 4HYlmlD4oFT/RJB2I9IyxsOrBr/8+7/zrX2SYgJbKdM1o5OaQ2RgXbL6Mv87BK9NQGr5x+PvI/1r y+UPizgN7gr8/g+YnzAx3WxSZfmLgb4i4RxYA7qRG4kHAgMBAAGjQjBAMA4GA1UdDwEB/wQEAwIB BjAPBgNVHRMBAf8EBTADAQH/MB0GA1UdDgQWBBRqOFsmjd6LWvJPelSDGRjjCDWmujANBgkqhkiG 9w0BAQUFAAOCAQEAPNV3PdrfibqHDAhUaiBQkr6wQT25JmSDCi/oQMCXKCeCMErJk/9q56YAf4lC mtYR5VPOL8zy2gXE/uJQxDqGfczafhAJO5I1KlOy/usrBdlsXebQ79NqZp4VKIV66IIArB6nCWlW QtNoURi+VJq/REG6Sb4gumlc7rh3zc5sH62Dlhh9DrUUOYTxKOkto557HnpyWoOzeW/vtPzQCqVY T0bf+215WfKEIlKuD8z7fDvnaspHYcN6+NOSBB+4IIThNlQWx0DeO4pz3N/GCUzf7Nr/1FNCocny Yh0igzyXxfkZYiesZSLX0zzG5Y6yU8xJzrww/nsOM5D77dIUkR8Hrw== -----END CERTIFICATE----- Security Communication RootCA2 ============================== -----BEGIN CERTIFICATE----- MIIDdzCCAl+gAwIBAgIBADANBgkqhkiG9w0BAQsFADBdMQswCQYDVQQGEwJKUDElMCMGA1UEChMc U0VDT00gVHJ1c3QgU3lzdGVtcyBDTy4sTFRELjEnMCUGA1UECxMeU2VjdXJpdHkgQ29tbXVuaWNh dGlvbiBSb290Q0EyMB4XDTA5MDUyOTA1MDAzOVoXDTI5MDUyOTA1MDAzOVowXTELMAkGA1UEBhMC SlAxJTAjBgNVBAoTHFNFQ09NIFRydXN0IFN5c3RlbXMgQ08uLExURC4xJzAlBgNVBAsTHlNlY3Vy aXR5IENvbW11bmljYXRpb24gUm9vdENBMjCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEB ANAVOVKxUrO6xVmCxF1SrjpDZYBLx/KWvNs2l9amZIyoXvDjChz335c9S672XewhtUGrzbl+dp++ +T42NKA7wfYxEUV0kz1XgMX5iZnK5atq1LXaQZAQwdbWQonCv/Q4EpVMVAX3NuRFg3sUZdbcDE3R 3n4MqzvEFb46VqZab3ZpUql6ucjrappdUtAtCms1FgkQhNBqyjoGADdH5H5XTz+L62e4iKrFvlNV spHEfbmwhRkGeC7bYRr6hfVKkaHnFtWOojnflLhwHyg/i/xAXmODPIMqGplrz95Zajv8bxbXH/1K EOtOghY6rCcMU/Gt1SSwawNQwS08Ft1ENCcadfsCAwEAAaNCMEAwHQYDVR0OBBYEFAqFqXdlBZh8 QIH4D5csOPEK7DzPMA4GA1UdDwEB/wQEAwIBBjAPBgNVHRMBAf8EBTADAQH/MA0GCSqGSIb3DQEB CwUAA4IBAQBMOqNErLlFsceTfsgLCkLfZOoc7llsCLqJX2rKSpWeeo8HxdpFcoJxDjrSzG+ntKEj u/Ykn8sX/oymzsLS28yN/HH8AynBbF0zX2S2ZTuJbxh2ePXcokgfGT+Ok+vx+hfuzU7jBBJV1uXk 3fs+BXziHV7Gp7yXT2g69ekuCkO2r1dcYmh8t/2jioSgrGK+KwmHNPBqAbubKVY8/gA3zyNs8U6q tnRGEmyR7jTV7JqR50S+kDFy1UkC9gLl9B/rfNmWVan/7Ir5mUf/NVoCqgTLiluHcSmRvaS0eg29 mvVXIwAHIRc/SjnRBUkLp7Y3gaVdjKozXoEofKd9J+sAro03 -----END CERTIFICATE----- EC-ACC ====== -----BEGIN CERTIFICATE----- MIIFVjCCBD6gAwIBAgIQ7is969Qh3hSoYqwE893EATANBgkqhkiG9w0BAQUFADCB8zELMAkGA1UE BhMCRVMxOzA5BgNVBAoTMkFnZW5jaWEgQ2F0YWxhbmEgZGUgQ2VydGlmaWNhY2lvIChOSUYgUS0w ODAxMTc2LUkpMSgwJgYDVQQLEx9TZXJ2ZWlzIFB1YmxpY3MgZGUgQ2VydGlmaWNhY2lvMTUwMwYD VQQLEyxWZWdldSBodHRwczovL3d3dy5jYXRjZXJ0Lm5ldC92ZXJhcnJlbCAoYykwMzE1MDMGA1UE CxMsSmVyYXJxdWlhIEVudGl0YXRzIGRlIENlcnRpZmljYWNpbyBDYXRhbGFuZXMxDzANBgNVBAMT BkVDLUFDQzAeFw0wMzAxMDcyMzAwMDBaFw0zMTAxMDcyMjU5NTlaMIHzMQswCQYDVQQGEwJFUzE7 MDkGA1UEChMyQWdlbmNpYSBDYXRhbGFuYSBkZSBDZXJ0aWZpY2FjaW8gKE5JRiBRLTA4MDExNzYt SSkxKDAmBgNVBAsTH1NlcnZlaXMgUHVibGljcyBkZSBDZXJ0aWZpY2FjaW8xNTAzBgNVBAsTLFZl Z2V1IGh0dHBzOi8vd3d3LmNhdGNlcnQubmV0L3ZlcmFycmVsIChjKTAzMTUwMwYDVQQLEyxKZXJh cnF1aWEgRW50aXRhdHMgZGUgQ2VydGlmaWNhY2lvIENhdGFsYW5lczEPMA0GA1UEAxMGRUMtQUND MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAsyLHT+KXQpWIR4NA9h0X84NzJB5R85iK w5K4/0CQBXCHYMkAqbWUZRkiFRfCQ2xmRJoNBD45b6VLeqpjt4pEndljkYRm4CgPukLjbo73FCeT ae6RDqNfDrHrZqJyTxIThmV6PttPB/SnCWDaOkKZx7J/sxaVHMf5NLWUhdWZXqBIoH7nF2W4onW4 HvPlQn2v7fOKSGRdghST2MDk/7NQcvJ29rNdQlB50JQ+awwAvthrDk4q7D7SzIKiGGUzE3eeml0a E9jD2z3Il3rucO2n5nzbcc8tlGLfbdb1OL4/pYUKGbio2Al1QnDE6u/LDsg0qBIimAy4E5S2S+zw 0JDnJwIDAQABo4HjMIHgMB0GA1UdEQQWMBSBEmVjX2FjY0BjYXRjZXJ0Lm5ldDAPBgNVHRMBAf8E BTADAQH/MA4GA1UdDwEB/wQEAwIBBjAdBgNVHQ4EFgQUoMOLRKo3pUW/l4Ba0fF4opvpXY0wfwYD VR0gBHgwdjB0BgsrBgEEAfV4AQMBCjBlMCwGCCsGAQUFBwIBFiBodHRwczovL3d3dy5jYXRjZXJ0 Lm5ldC92ZXJhcnJlbDA1BggrBgEFBQcCAjApGidWZWdldSBodHRwczovL3d3dy5jYXRjZXJ0Lm5l dC92ZXJhcnJlbCAwDQYJKoZIhvcNAQEFBQADggEBAKBIW4IB9k1IuDlVNZyAelOZ1Vr/sXE7zDkJ lF7W2u++AVtd0x7Y/X1PzaBB4DSTv8vihpw3kpBWHNzrKQXlxJ7HNd+KDM3FIUPpqojlNcAZQmNa Al6kSBg6hW/cnbw/nZzBh7h6YQjpdwt/cKt63dmXLGQehb+8dJahw3oS7AwaboMMPOhyRp/7SNVe l+axofjk70YllJyJ22k4vuxcDlbHZVHlUIiIv0LVKz3l+bqeLrPK9HOSAgu+TGbrIP65y7WZf+a2 E/rKS03Z7lNGBjvGTq2TWoF+bCpLagVFjPIhpDGQh2xlnJ2lYJU6Un/10asIbvPuW/mIPX64b24D 5EI= -----END CERTIFICATE----- Hellenic Academic and Research Institutions RootCA 2011 ======================================================= -----BEGIN CERTIFICATE----- MIIEMTCCAxmgAwIBAgIBADANBgkqhkiG9w0BAQUFADCBlTELMAkGA1UEBhMCR1IxRDBCBgNVBAoT O0hlbGxlbmljIEFjYWRlbWljIGFuZCBSZXNlYXJjaCBJbnN0aXR1dGlvbnMgQ2VydC4gQXV0aG9y aXR5MUAwPgYDVQQDEzdIZWxsZW5pYyBBY2FkZW1pYyBhbmQgUmVzZWFyY2ggSW5zdGl0dXRpb25z IFJvb3RDQSAyMDExMB4XDTExMTIwNjEzNDk1MloXDTMxMTIwMTEzNDk1MlowgZUxCzAJBgNVBAYT AkdSMUQwQgYDVQQKEztIZWxsZW5pYyBBY2FkZW1pYyBhbmQgUmVzZWFyY2ggSW5zdGl0dXRpb25z IENlcnQuIEF1dGhvcml0eTFAMD4GA1UEAxM3SGVsbGVuaWMgQWNhZGVtaWMgYW5kIFJlc2VhcmNo IEluc3RpdHV0aW9ucyBSb290Q0EgMjAxMTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEB AKlTAOMupvaO+mDYLZU++CwqVE7NuYRhlFhPjz2L5EPzdYmNUeTDN9KKiE15HrcS3UN4SoqS5tdI 1Q+kOilENbgH9mgdVc04UfCMJDGFr4PJfel3r+0ae50X+bOdOFAPplp5kYCvN66m0zH7tSYJnTxa 71HFK9+WXesyHgLacEnsbgzImjeN9/E2YEsmLIKe0HjzDQ9jpFEw4fkrJxIH2Oq9GGKYsFk3fb7u 8yBRQlqD75O6aRXxYp2fmTmCobd0LovUxQt7L/DICto9eQqakxylKHJzkUOap9FNhYS5qXSPFEDH 3N6sQWRstBmbAmNtJGSPRLIl6s5ddAxjMlyNh+UCAwEAAaOBiTCBhjAPBgNVHRMBAf8EBTADAQH/ MAsGA1UdDwQEAwIBBjAdBgNVHQ4EFgQUppFC/RNhSiOeCKQp5dgTBCPuQSUwRwYDVR0eBEAwPqA8 MAWCAy5ncjAFggMuZXUwBoIELmVkdTAGggQub3JnMAWBAy5ncjAFgQMuZXUwBoEELmVkdTAGgQQu b3JnMA0GCSqGSIb3DQEBBQUAA4IBAQAf73lB4XtuP7KMhjdCSk4cNx6NZrokgclPEg8hwAOXhiVt XdMiKahsog2p6z0GW5k6x8zDmjR/qw7IThzh+uTczQ2+vyT+bOdrwg3IBp5OjWEopmr95fZi6hg8 TqBTnbI6nOulnJEWtk2C4AwFSKls9cz4y51JtPACpf1wA+2KIaWuE4ZJwzNzvoc7dIsXRSZMFpGD /md9zU1jZ/rzAxKWeAaNsWftjj++n08C9bMJL/NMh98qy5V8AcysNnq/onN694/BtZqhFLKPM58N 7yLcZnuEvUUXBj08yrl3NI/K6s8/MT7jiOOASSXIl7WdmplNsDz4SgCbZN2fOUvRJ9e4 -----END CERTIFICATE----- Actalis Authentication Root CA ============================== -----BEGIN CERTIFICATE----- MIIFuzCCA6OgAwIBAgIIVwoRl0LE48wwDQYJKoZIhvcNAQELBQAwazELMAkGA1UEBhMCSVQxDjAM BgNVBAcMBU1pbGFuMSMwIQYDVQQKDBpBY3RhbGlzIFMucC5BLi8wMzM1ODUyMDk2NzEnMCUGA1UE AwweQWN0YWxpcyBBdXRoZW50aWNhdGlvbiBSb290IENBMB4XDTExMDkyMjExMjIwMloXDTMwMDky MjExMjIwMlowazELMAkGA1UEBhMCSVQxDjAMBgNVBAcMBU1pbGFuMSMwIQYDVQQKDBpBY3RhbGlz IFMucC5BLi8wMzM1ODUyMDk2NzEnMCUGA1UEAwweQWN0YWxpcyBBdXRoZW50aWNhdGlvbiBSb290 IENBMIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAp8bEpSmkLO/lGMWwUKNvUTufClrJ wkg4CsIcoBh/kbWHuUA/3R1oHwiD1S0eiKD4j1aPbZkCkpAW1V8IbInX4ay8IMKx4INRimlNAJZa by/ARH6jDuSRzVju3PvHHkVH3Se5CAGfpiEd9UEtL0z9KK3giq0itFZljoZUj5NDKd45RnijMCO6 zfB9E1fAXdKDa0hMxKufgFpbOr3JpyI/gCczWw63igxdBzcIy2zSekciRDXFzMwujt0q7bd9Zg1f YVEiVRvjRuPjPdA1YprbrxTIW6HMiRvhMCb8oJsfgadHHwTrozmSBp+Z07/T6k9QnBn+locePGX2 oxgkg4YQ51Q+qDp2JE+BIcXjDwL4k5RHILv+1A7TaLndxHqEguNTVHnd25zS8gebLra8Pu2Fbe8l EfKXGkJh90qX6IuxEAf6ZYGyojnP9zz/GPvG8VqLWeICrHuS0E4UT1lF9gxeKF+w6D9Fz8+vm2/7 hNN3WpVvrJSEnu68wEqPSpP4RCHiMUVhUE4Q2OM1fEwZtN4Fv6MGn8i1zeQf1xcGDXqVdFUNaBr8 EBtiZJ1t4JWgw5QHVw0U5r0F+7if5t+L4sbnfpb2U8WANFAoWPASUHEXMLrmeGO89LKtmyuy/uE5 jF66CyCU3nuDuP/jVo23Eek7jPKxwV2dpAtMK9myGPW1n0sCAwEAAaNjMGEwHQYDVR0OBBYEFFLY iDrIn3hm7YnzezhwlMkCAjbQMA8GA1UdEwEB/wQFMAMBAf8wHwYDVR0jBBgwFoAUUtiIOsifeGbt ifN7OHCUyQICNtAwDgYDVR0PAQH/BAQDAgEGMA0GCSqGSIb3DQEBCwUAA4ICAQALe3KHwGCmSUyI WOYdiPcUZEim2FgKDk8TNd81HdTtBjHIgT5q1d07GjLukD0R0i70jsNjLiNmsGe+b7bAEzlgqqI0 JZN1Ut6nna0Oh4lScWoWPBkdg/iaKWW+9D+a2fDzWochcYBNy+A4mz+7+uAwTc+G02UQGRjRlwKx K3JCaKygvU5a2hi/a5iB0P2avl4VSM0RFbnAKVy06Ij3Pjaut2L9HmLecHgQHEhb2rykOLpn7VU+ Xlff1ANATIGk0k9jpwlCCRT8AKnCgHNPLsBA2RF7SOp6AsDT6ygBJlh0wcBzIm2Tlf05fbsq4/aC 4yyXX04fkZT6/iyj2HYauE2yOE+b+h1IYHkm4vP9qdCa6HCPSXrW5b0KDtst842/6+OkfcvHlXHo 2qN8xcL4dJIEG4aspCJTQLas/kx2z/uUMsA1n3Y/buWQbqCmJqK4LL7RK4X9p2jIugErsWx0Hbhz lefut8cl8ABMALJ+tguLHPPAUJ4lueAI3jZm/zel0btUZCzJJ7VLkn5l/9Mt4blOvH+kQSGQQXem OR/qnuOf0GZvBeyqdn6/axag67XH/JJULysRJyU3eExRarDzzFhdFPFqSBX/wge2sY0PjlxQRrM9 vwGYT7JZVEc+NHt4bVaTLnPqZih4zR0Uv6CPLy64Lo7yFIrM6bV8+2ydDKXhlg== -----END CERTIFICATE----- Trustis FPS Root CA =================== -----BEGIN CERTIFICATE----- MIIDZzCCAk+gAwIBAgIQGx+ttiD5JNM2a/fH8YygWTANBgkqhkiG9w0BAQUFADBFMQswCQYDVQQG EwJHQjEYMBYGA1UEChMPVHJ1c3RpcyBMaW1pdGVkMRwwGgYDVQQLExNUcnVzdGlzIEZQUyBSb290 IENBMB4XDTAzMTIyMzEyMTQwNloXDTI0MDEyMTExMzY1NFowRTELMAkGA1UEBhMCR0IxGDAWBgNV BAoTD1RydXN0aXMgTGltaXRlZDEcMBoGA1UECxMTVHJ1c3RpcyBGUFMgUm9vdCBDQTCCASIwDQYJ KoZIhvcNAQEBBQADggEPADCCAQoCggEBAMVQe547NdDfxIzNjpvto8A2mfRC6qc+gIMPpqdZh8mQ RUN+AOqGeSoDvT03mYlmt+WKVoaTnGhLaASMk5MCPjDSNzoiYYkchU59j9WvezX2fihHiTHcDnlk H5nSW7r+f2C/revnPDgpai/lkQtV/+xvWNUtyd5MZnGPDNcE2gfmHhjjvSkCqPoc4Vu5g6hBSLwa cY3nYuUtsuvffM/bq1rKMfFMIvMFE/eC+XN5DL7XSxzA0RU8k0Fk0ea+IxciAIleH2ulrG6nS4zt o3Lmr2NNL4XSFDWaLk6M6jKYKIahkQlBOrTh4/L68MkKokHdqeMDx4gVOxzUGpTXn2RZEm0CAwEA AaNTMFEwDwYDVR0TAQH/BAUwAwEB/zAfBgNVHSMEGDAWgBS6+nEleYtXQSUhhgtx67JkDoshZzAd BgNVHQ4EFgQUuvpxJXmLV0ElIYYLceuyZA6LIWcwDQYJKoZIhvcNAQEFBQADggEBAH5Y//01GX2c GE+esCu8jowU/yyg2kdbw++BLa8F6nRIW/M+TgfHbcWzk88iNVy2P3UnXwmWzaD+vkAMXBJV+JOC yinpXj9WV4s4NvdFGkwozZ5BuO1WTISkQMi4sKUraXAEasP41BIy+Q7DsdwyhEQsb8tGD+pmQQ9P 8Vilpg0ND2HepZ5dfWWhPBfnqFVO76DH7cZEf1T1o+CP8HxVIo8ptoGj4W1OLBuAZ+ytIJ8MYmHV l/9D7S3B2l0pKoU/rGXuhg8FjZBf3+6f9L/uHfuY5H+QK4R4EA5sSVPvFVtlRkpdr7r7OnIdzfYl iB6XzCGcKQENZetX2fNXlrtIzYE= -----END CERTIFICATE----- StartCom Certification Authority ================================ -----BEGIN CERTIFICATE----- MIIHhzCCBW+gAwIBAgIBLTANBgkqhkiG9w0BAQsFADB9MQswCQYDVQQGEwJJTDEWMBQGA1UEChMN U3RhcnRDb20gTHRkLjErMCkGA1UECxMiU2VjdXJlIERpZ2l0YWwgQ2VydGlmaWNhdGUgU2lnbmlu ZzEpMCcGA1UEAxMgU3RhcnRDb20gQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkwHhcNMDYwOTE3MTk0 NjM3WhcNMzYwOTE3MTk0NjM2WjB9MQswCQYDVQQGEwJJTDEWMBQGA1UEChMNU3RhcnRDb20gTHRk LjErMCkGA1UECxMiU2VjdXJlIERpZ2l0YWwgQ2VydGlmaWNhdGUgU2lnbmluZzEpMCcGA1UEAxMg U3RhcnRDb20gQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAw ggIKAoICAQDBiNsJvGxGfHiflXu1M5DycmLWwTYgIiRezul38kMKogZkpMyONvg45iPwbm2xPN1y o4UcodM9tDMr0y+v/uqwQVlntsQGfQqedIXWeUyAN3rfOQVSWff0G0ZDpNKFhdLDcfN1YjS6LIp/ Ho/u7TTQEceWzVI9ujPW3U3eCztKS5/CJi/6tRYccjV3yjxd5srhJosaNnZcAdt0FCX+7bWgiA/d eMotHweXMAEtcnn6RtYTKqi5pquDSR3l8u/d5AGOGAqPY1MWhWKpDhk6zLVmpsJrdAfkK+F2PrRt 2PZE4XNiHzvEvqBTViVsUQn3qqvKv3b9bZvzndu/PWa8DFaqr5hIlTpL36dYUNk4dalb6kMMAv+Z 6+hsTXBbKWWc3apdzK8BMewM69KN6Oqce+Zu9ydmDBpI125C4z/eIT574Q1w+2OqqGwaVLRcJXrJ osmLFqa7LH4XXgVNWG4SHQHuEhANxjJ/GP/89PrNbpHoNkm+Gkhpi8KWTRoSsmkXwQqQ1vp5Iki/ untp+HDH+no32NgN0nZPV/+Qt+OR0t3vwmC3Zzrd/qqc8NSLf3Iizsafl7b4r4qgEKjZ+xjGtrVc UjyJthkqcwEKDwOzEmDyei+B26Nu/yYwl/WL3YlXtq09s68rxbd2AvCl1iuahhQqcvbjM4xdCUsT 37uMdBNSSwIDAQABo4ICEDCCAgwwDwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMCAQYwHQYD VR0OBBYEFE4L7xqkQFulF2mHMMo0aEPQQa7yMB8GA1UdIwQYMBaAFE4L7xqkQFulF2mHMMo0aEPQ Qa7yMIIBWgYDVR0gBIIBUTCCAU0wggFJBgsrBgEEAYG1NwEBATCCATgwLgYIKwYBBQUHAgEWImh0 dHA6Ly93d3cuc3RhcnRzc2wuY29tL3BvbGljeS5wZGYwNAYIKwYBBQUHAgEWKGh0dHA6Ly93d3cu c3RhcnRzc2wuY29tL2ludGVybWVkaWF0ZS5wZGYwgc8GCCsGAQUFBwICMIHCMCcWIFN0YXJ0IENv bW1lcmNpYWwgKFN0YXJ0Q29tKSBMdGQuMAMCAQEagZZMaW1pdGVkIExpYWJpbGl0eSwgcmVhZCB0 aGUgc2VjdGlvbiAqTGVnYWwgTGltaXRhdGlvbnMqIG9mIHRoZSBTdGFydENvbSBDZXJ0aWZpY2F0 aW9uIEF1dGhvcml0eSBQb2xpY3kgYXZhaWxhYmxlIGF0IGh0dHA6Ly93d3cuc3RhcnRzc2wuY29t L3BvbGljeS5wZGYwEQYJYIZIAYb4QgEBBAQDAgAHMDgGCWCGSAGG+EIBDQQrFilTdGFydENvbSBG cmVlIFNTTCBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTANBgkqhkiG9w0BAQsFAAOCAgEAjo/n3JR5 fPGFf59Jb2vKXfuM/gTFwWLRfUKKvFO3lANmMD+x5wqnUCBVJX92ehQN6wQOQOY+2IirByeDqXWm N3PH/UvSTa0XQMhGvjt/UfzDtgUx3M2FIk5xt/JxXrAaxrqTi3iSSoX4eA+D/i+tLPfkpLst0OcN Org+zvZ49q5HJMqjNTbOx8aHmNrs++myziebiMMEofYLWWivydsQD032ZGNcpRJvkrKTlMeIFw6T tn5ii5B/q06f/ON1FE8qMt9bDeD1e5MNq6HPh+GlBEXoPBKlCcWw0bdT82AUuoVpaiF8H3VhFyAX e2w7QSlc4axa0c2Mm+tgHRns9+Ww2vl5GKVFP0lDV9LdJNUso/2RjSe15esUBppMeyG7Oq0wBhjA 2MFrLH9ZXF2RsXAiV+uKa0hK1Q8p7MZAwC+ITGgBF3f0JBlPvfrhsiAhS90a2Cl9qrjeVOwhVYBs HvUwyKMQ5bLmKhQxw4UtjJixhlpPiVktucf3HMiKf8CdBUrmQk9io20ppB+Fq9vlgcitKj1MXVuE JnHEhV5xJMqlG2zYYdMa4FTbzrqpMrUi9nNBCV24F10OD5mQ1kfabwo6YigUZ4LZ8dCAWZvLMdib D4x3TrVoivJs9iQOLWxwxXPR3hTQcY+203sC9uO41Alua551hDnmfyWl8kgAwKQB2j8= -----END CERTIFICATE----- StartCom Certification Authority G2 =================================== -----BEGIN CERTIFICATE----- MIIFYzCCA0ugAwIBAgIBOzANBgkqhkiG9w0BAQsFADBTMQswCQYDVQQGEwJJTDEWMBQGA1UEChMN U3RhcnRDb20gTHRkLjEsMCoGA1UEAxMjU3RhcnRDb20gQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkg RzIwHhcNMTAwMTAxMDEwMDAxWhcNMzkxMjMxMjM1OTAxWjBTMQswCQYDVQQGEwJJTDEWMBQGA1UE ChMNU3RhcnRDb20gTHRkLjEsMCoGA1UEAxMjU3RhcnRDb20gQ2VydGlmaWNhdGlvbiBBdXRob3Jp dHkgRzIwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQC2iTZbB7cgNr2Cu+EWIAOVeq8O o1XJJZlKxdBWQYeQTSFgpBSHO839sj60ZwNq7eEPS8CRhXBF4EKe3ikj1AENoBB5uNsDvfOpL9HG 4A/LnooUCri99lZi8cVytjIl2bLzvWXFDSxu1ZJvGIsAQRSCb0AgJnooD/Uefyf3lLE3PbfHkffi Aez9lInhzG7TNtYKGXmu1zSCZf98Qru23QumNK9LYP5/Q0kGi4xDuFby2X8hQxfqp0iVAXV16iul Q5XqFYSdCI0mblWbq9zSOdIxHWDirMxWRST1HFSr7obdljKF+ExP6JV2tgXdNiNnvP8V4so75qbs O+wmETRIjfaAKxojAuuKHDp2KntWFhxyKrOq42ClAJ8Em+JvHhRYW6Vsi1g8w7pOOlz34ZYrPu8H vKTlXcxNnw3h3Kq74W4a7I/htkxNeXJdFzULHdfBR9qWJODQcqhaX2YtENwvKhOuJv4KHBnM0D4L nMgJLvlblnpHnOl68wVQdJVznjAJ85eCXuaPOQgeWeU1FEIT/wCc976qUM/iUUjXuG+v+E5+M5iS FGI6dWPPe/regjupuznixL0sAA7IF6wT700ljtizkC+p2il9Ha90OrInwMEePnWjFqmveiJdnxMa z6eg6+OGCtP95paV1yPIN93EfKo2rJgaErHgTuixO/XWb/Ew1wIDAQABo0IwQDAPBgNVHRMBAf8E BTADAQH/MA4GA1UdDwEB/wQEAwIBBjAdBgNVHQ4EFgQUS8W0QGutHLOlHGVuRjaJhwUMDrYwDQYJ KoZIhvcNAQELBQADggIBAHNXPyzVlTJ+N9uWkusZXn5T50HsEbZH77Xe7XRcxfGOSeD8bpkTzZ+K 2s06Ctg6Wgk/XzTQLwPSZh0avZyQN8gMjgdalEVGKua+etqhqaRpEpKwfTbURIfXUfEpY9Z1zRbk J4kd+MIySP3bmdCPX1R0zKxnNBFi2QwKN4fRoxdIjtIXHfbX/dtl6/2o1PXWT6RbdejF0mCy2wl+ JYt7ulKSnj7oxXehPOBKc2thz4bcQ///If4jXSRK9dNtD2IEBVeC2m6kMyV5Sy5UGYvMLD0w6dEG /+gyRr61M3Z3qAFdlsHB1b6uJcDJHgoJIIihDsnzb02CVAAgp9KP5DlUFy6NHrgbuxu9mk47EDTc nIhT76IxW1hPkWLIwpqazRVdOKnWvvgTtZ8SafJQYqz7Fzf07rh1Z2AQ+4NQ+US1dZxAF7L+/Xld blhYXzD8AK6vM8EOTmy6p6ahfzLbOOCxchcKK5HsamMm7YnUeMx0HgX4a/6ManY5Ka5lIxKVCCIc l85bBu4M4ru8H0ST9tg4RQUh7eStqxK2A6RCLi3ECToDZ2mEmuFZkIoohdVddLHRDiBYmxOlsGOm 7XtH/UVVMKTumtTm4ofvmMkyghEpIrwACjFeLQ/Ajulrso8uBtjRkcfGEvRM/TAXw8HaOFvjqerm obp573PYtlNXLfbQ4ddI -----END CERTIFICATE----- Buypass Class 2 Root CA ======================= -----BEGIN CERTIFICATE----- MIIFWTCCA0GgAwIBAgIBAjANBgkqhkiG9w0BAQsFADBOMQswCQYDVQQGEwJOTzEdMBsGA1UECgwU QnV5cGFzcyBBUy05ODMxNjMzMjcxIDAeBgNVBAMMF0J1eXBhc3MgQ2xhc3MgMiBSb290IENBMB4X DTEwMTAyNjA4MzgwM1oXDTQwMTAyNjA4MzgwM1owTjELMAkGA1UEBhMCTk8xHTAbBgNVBAoMFEJ1 eXBhc3MgQVMtOTgzMTYzMzI3MSAwHgYDVQQDDBdCdXlwYXNzIENsYXNzIDIgUm9vdCBDQTCCAiIw DQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIBANfHXvfBB9R3+0Mh9PT1aeTuMgHbo4Yf5FkNuud1 g1Lr6hxhFUi7HQfKjK6w3Jad6sNgkoaCKHOcVgb/S2TwDCo3SbXlzwx87vFKu3MwZfPVL4O2fuPn 9Z6rYPnT8Z2SdIrkHJasW4DptfQxh6NR/Md+oW+OU3fUl8FVM5I+GC911K2GScuVr1QGbNgGE41b /+EmGVnAJLqBcXmQRFBoJJRfuLMR8SlBYaNByyM21cHxMlAQTn/0hpPshNOOvEu/XAFOBz3cFIqU CqTqc/sLUegTBxj6DvEr0VQVfTzh97QZQmdiXnfgolXsttlpF9U6r0TtSsWe5HonfOV116rLJeff awrbD02TTqigzXsu8lkBarcNuAeBfos4GzjmCleZPe4h6KP1DBbdi+w0jpwqHAAVF41og9JwnxgI zRFo1clrUs3ERo/ctfPYV3Me6ZQ5BL/T3jjetFPsaRyifsSP5BtwrfKi+fv3FmRmaZ9JUaLiFRhn Bkp/1Wy1TbMz4GHrXb7pmA8y1x1LPC5aAVKRCfLf6o3YBkBjqhHk/sM3nhRSP/TizPJhk9H9Z2vX Uq6/aKtAQ6BXNVN48FP4YUIHZMbXb5tMOA1jrGKvNouicwoN9SG9dKpN6nIDSdvHXx1iY8f93ZHs M+71bbRuMGjeyNYmsHVee7QHIJihdjK4TWxPAgMBAAGjQjBAMA8GA1UdEwEB/wQFMAMBAf8wHQYD VR0OBBYEFMmAd+BikoL1RpzzuvdMw964o605MA4GA1UdDwEB/wQEAwIBBjANBgkqhkiG9w0BAQsF AAOCAgEAU18h9bqwOlI5LJKwbADJ784g7wbylp7ppHR/ehb8t/W2+xUbP6umwHJdELFx7rxP462s A20ucS6vxOOto70MEae0/0qyexAQH6dXQbLArvQsWdZHEIjzIVEpMMpghq9Gqx3tOluwlN5E40EI osHsHdb9T7bWR9AUC8rmyrV7d35BH16Dx7aMOZawP5aBQW9gkOLo+fsicdl9sz1Gv7SEr5AcD48S aq/v7h56rgJKihcrdv6sVIkkLE8/trKnToyokZf7KcZ7XC25y2a2t6hbElGFtQl+Ynhw/qlqYLYd DnkM/crqJIByw5c/8nerQyIKx+u2DISCLIBrQYoIwOula9+ZEsuK1V6ADJHgJgg2SMX6OBE1/yWD LfJ6v9r9jv6ly0UsH8SIU653DtmadsWOLB2jutXsMq7Aqqz30XpN69QH4kj3Io6wpJ9qzo6ysmD0 oyLQI+uUWnpp3Q+/QFesa1lQ2aOZ4W7+jQF5JyMV3pKdewlNWudLSDBaGOYKbeaP4NK75t98biGC wWg5TbSYWGZizEqQXsP6JwSxeRV0mcy+rSDeJmAc61ZRpqPq5KM/p/9h3PFaTWwyI0PurKju7koS CTxdccK+efrCh2gdC/1cacwG0Jp9VJkqyTkaGa9LKkPzY11aWOIv4x3kqdbQCtCev9eBCfHJxyYN rJgWVqA= -----END CERTIFICATE----- Buypass Class 3 Root CA ======================= -----BEGIN CERTIFICATE----- MIIFWTCCA0GgAwIBAgIBAjANBgkqhkiG9w0BAQsFADBOMQswCQYDVQQGEwJOTzEdMBsGA1UECgwU QnV5cGFzcyBBUy05ODMxNjMzMjcxIDAeBgNVBAMMF0J1eXBhc3MgQ2xhc3MgMyBSb290IENBMB4X DTEwMTAyNjA4Mjg1OFoXDTQwMTAyNjA4Mjg1OFowTjELMAkGA1UEBhMCTk8xHTAbBgNVBAoMFEJ1 eXBhc3MgQVMtOTgzMTYzMzI3MSAwHgYDVQQDDBdCdXlwYXNzIENsYXNzIDMgUm9vdCBDQTCCAiIw DQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIBAKXaCpUWUOOV8l6ddjEGMnqb8RB2uACatVI2zSRH sJ8YZLya9vrVediQYkwiL944PdbgqOkcLNt4EemOaFEVcsfzM4fkoF0LXOBXByow9c3EN3coTRiR 5r/VUv1xLXA+58bEiuPwKAv0dpihi4dVsjoT/Lc+JzeOIuOoTyrvYLs9tznDDgFHmV0ST9tD+leh 7fmdvhFHJlsTmKtdFoqwNxxXnUX/iJY2v7vKB3tvh2PX0DJq1l1sDPGzbjniazEuOQAnFN44wOwZ ZoYS6J1yFhNkUsepNxz9gjDthBgd9K5c/3ATAOux9TN6S9ZV+AWNS2mw9bMoNlwUxFFzTWsL8TQH 2xc519woe2v1n/MuwU8XKhDzzMro6/1rqy6any2CbgTUUgGTLT2G/H783+9CHaZr77kgxve9oKeV /afmiSTYzIw0bOIjL9kSGiG5VZFvC5F5GQytQIgLcOJ60g7YaEi7ghM5EFjp2CoHxhLbWNvSO1UQ RwUVZ2J+GGOmRj8JDlQyXr8NYnon74Do29lLBlo3WiXQCBJ31G8JUJc9yB3D34xFMFbG02SrZvPA Xpacw8Tvw3xrizp5f7NJzz3iiZ+gMEuFuZyUJHmPfWupRWgPK9Dx2hzLabjKSWJtyNBjYt1gD1iq j6G8BaVmos8bdrKEZLFMOVLAMLrwjEsCsLa3AgMBAAGjQjBAMA8GA1UdEwEB/wQFMAMBAf8wHQYD VR0OBBYEFEe4zf/lb+74suwvTg75JbCOPGvDMA4GA1UdDwEB/wQEAwIBBjANBgkqhkiG9w0BAQsF AAOCAgEAACAjQTUEkMJAYmDv4jVM1z+s4jSQuKFvdvoWFqRINyzpkMLyPPgKn9iB5btb2iUspKdV cSQy9sgL8rxq+JOssgfCX5/bzMiKqr5qb+FJEMwx14C7u8jYog5kV+qi9cKpMRXSIGrs/CIBKM+G uIAeqcwRpTzyFrNHnfzSgCHEy9BHcEGhyoMZCCxt8l13nIoUE9Q2HJLw5QY33KbmkJs4j1xrG0aG Q0JfPgEHU1RdZX33inOhmlRaHylDFCfChQ+1iHsaO5S3HWCntZznKWlXWpuTekMwGwPXYshApqr8 ZORK15FTAaggiG6cX0S5y2CBNOxv033aSF/rtJC8LakcC6wc1aJoIIAE1vyxjy+7SjENSoYc6+I2 KSb12tjE8nVhz36udmNKekBlk4f4HoCMhuWG1o8O/FMsYOgWYRqiPkN7zTlgVGr18okmAWiDSKIz 6MkEkbIRNBE+6tBDGR8Dk5AM/1E9V/RBbuHLoL7ryWPNbczk+DaqaJ3tvV2XcEQNtg413OEMXbug UZTLfhbrES+jkkXITHHZvMmZUldGL1DPvTVp9D0VzgalLA8+9oG6lLvDu79leNKGef9JOxqDDPDe eOzI8k1MGt6CKfjBWtrt7uYnXuhF0J0cUahoq0Tj0Itq4/g7u9xN12TyUb7mqqta6THuBrxzvxNi Cp/HuZc= -----END CERTIFICATE----- T-TeleSec GlobalRoot Class 3 ============================ -----BEGIN CERTIFICATE----- MIIDwzCCAqugAwIBAgIBATANBgkqhkiG9w0BAQsFADCBgjELMAkGA1UEBhMCREUxKzApBgNVBAoM IlQtU3lzdGVtcyBFbnRlcnByaXNlIFNlcnZpY2VzIEdtYkgxHzAdBgNVBAsMFlQtU3lzdGVtcyBU cnVzdCBDZW50ZXIxJTAjBgNVBAMMHFQtVGVsZVNlYyBHbG9iYWxSb290IENsYXNzIDMwHhcNMDgx MDAxMTAyOTU2WhcNMzMxMDAxMjM1OTU5WjCBgjELMAkGA1UEBhMCREUxKzApBgNVBAoMIlQtU3lz dGVtcyBFbnRlcnByaXNlIFNlcnZpY2VzIEdtYkgxHzAdBgNVBAsMFlQtU3lzdGVtcyBUcnVzdCBD ZW50ZXIxJTAjBgNVBAMMHFQtVGVsZVNlYyBHbG9iYWxSb290IENsYXNzIDMwggEiMA0GCSqGSIb3 DQEBAQUAA4IBDwAwggEKAoIBAQC9dZPwYiJvJK7genasfb3ZJNW4t/zN8ELg63iIVl6bmlQdTQyK 9tPPcPRStdiTBONGhnFBSivwKixVA9ZIw+A5OO3yXDw/RLyTPWGrTs0NvvAgJ1gORH8EGoel15YU NpDQSXuhdfsaa3Ox+M6pCSzyU9XDFES4hqX2iys52qMzVNn6chr3IhUciJFrf2blw2qAsCTz34ZF iP0Zf3WHHx+xGwpzJFu5ZeAsVMhg02YXP+HMVDNzkQI6pn97djmiH5a2OK61yJN0HZ65tOVgnS9W 0eDrXltMEnAMbEQgqxHY9Bn20pxSN+f6tsIxO0rUFJmtxxr1XV/6B7h8DR/Wgx6zAgMBAAGjQjBA MA8GA1UdEwEB/wQFMAMBAf8wDgYDVR0PAQH/BAQDAgEGMB0GA1UdDgQWBBS1A/d2O2GCahKqGFPr AyGUv/7OyjANBgkqhkiG9w0BAQsFAAOCAQEAVj3vlNW92nOyWL6ukK2YJ5f+AbGwUgC4TeQbIXQb fsDuXmkqJa9c1h3a0nnJ85cp4IaH3gRZD/FZ1GSFS5mvJQQeyUapl96Cshtwn5z2r3Ex3XsFpSzT ucpH9sry9uetuUg/vBa3wW306gmv7PO15wWeph6KU1HWk4HMdJP2udqmJQV0eVp+QD6CSyYRMG7h P0HHRwA11fXT91Q+gT3aSWqas+8QPebrb9HIIkfLzM8BMZLZGOMivgkeGj5asuRrDFR6fUNOuIml e9eiPZaGzPImNC1qkp2aGtAw4l1OBLBfiyB+d8E9lYLRRpo7PHi4b6HQDWSieB4pTpPDpFQUWw== -----END CERTIFICATE----- EE Certification Centre Root CA =============================== -----BEGIN CERTIFICATE----- MIIEAzCCAuugAwIBAgIQVID5oHPtPwBMyonY43HmSjANBgkqhkiG9w0BAQUFADB1MQswCQYDVQQG EwJFRTEiMCAGA1UECgwZQVMgU2VydGlmaXRzZWVyaW1pc2tlc2t1czEoMCYGA1UEAwwfRUUgQ2Vy dGlmaWNhdGlvbiBDZW50cmUgUm9vdCBDQTEYMBYGCSqGSIb3DQEJARYJcGtpQHNrLmVlMCIYDzIw MTAxMDMwMTAxMDMwWhgPMjAzMDEyMTcyMzU5NTlaMHUxCzAJBgNVBAYTAkVFMSIwIAYDVQQKDBlB UyBTZXJ0aWZpdHNlZXJpbWlza2Vza3VzMSgwJgYDVQQDDB9FRSBDZXJ0aWZpY2F0aW9uIENlbnRy ZSBSb290IENBMRgwFgYJKoZIhvcNAQkBFglwa2lAc2suZWUwggEiMA0GCSqGSIb3DQEBAQUAA4IB DwAwggEKAoIBAQDIIMDs4MVLqwd4lfNE7vsLDP90jmG7sWLqI9iroWUyeuuOF0+W2Ap7kaJjbMeM TC55v6kF/GlclY1i+blw7cNRfdCT5mzrMEvhvH2/UpvObntl8jixwKIy72KyaOBhU8E2lf/slLo2 rpwcpzIP5Xy0xm90/XsY6KxX7QYgSzIwWFv9zajmofxwvI6Sc9uXp3whrj3B9UiHbCe9nyV0gVWw 93X2PaRka9ZP585ArQ/dMtO8ihJTmMmJ+xAdTX7Nfh9WDSFwhfYggx/2uh8Ej+p3iDXE/+pOoYtN P2MbRMNE1CV2yreN1x5KZmTNXMWcg+HCCIia7E6j8T4cLNlsHaFLAgMBAAGjgYowgYcwDwYDVR0T AQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMCAQYwHQYDVR0OBBYEFBLyWj7qVhy/zQas8fElyalL1BSZ MEUGA1UdJQQ+MDwGCCsGAQUFBwMCBggrBgEFBQcDAQYIKwYBBQUHAwMGCCsGAQUFBwMEBggrBgEF BQcDCAYIKwYBBQUHAwkwDQYJKoZIhvcNAQEFBQADggEBAHv25MANqhlHt01Xo/6tu7Fq1Q+e2+Rj xY6hUFaTlrg4wCQiZrxTFGGVv9DHKpY5P30osxBAIWrEr7BSdxjhlthWXePdNl4dp1BUoMUq5KqM lIpPnTX/dqQGE5Gion0ARD9V04I8GtVbvFZMIi5GQ4okQC3zErg7cBqklrkar4dBGmoYDQZPxz5u uSlNDUmJEYcyW+ZLBMjkXOZ0c5RdFpgTlf7727FE5TpwrDdr5rMzcijJs1eg9gIWiAYLtqZLICjU 3j2LrTcFU3T+bsy8QxdxXvnFzBqpYe73dgzzcvRyrc9yAjYHR8/vGVCJYMzpJJUPwssd8m92kMfM dcGWxZ0= -----END CERTIFICATE----- TURKTRUST Certificate Services Provider Root 2007 ================================================= -----BEGIN CERTIFICATE----- MIIEPTCCAyWgAwIBAgIBATANBgkqhkiG9w0BAQUFADCBvzE/MD0GA1UEAww2VMOcUktUUlVTVCBF bGVrdHJvbmlrIFNlcnRpZmlrYSBIaXptZXQgU2HEn2xhecSxY8Sxc8SxMQswCQYDVQQGEwJUUjEP MA0GA1UEBwwGQW5rYXJhMV4wXAYDVQQKDFVUw5xSS1RSVVNUIEJpbGdpIMSwbGV0acWfaW0gdmUg QmlsacWfaW0gR8O8dmVubGnEn2kgSGl6bWV0bGVyaSBBLsWeLiAoYykgQXJhbMSxayAyMDA3MB4X DTA3MTIyNTE4MzcxOVoXDTE3MTIyMjE4MzcxOVowgb8xPzA9BgNVBAMMNlTDnFJLVFJVU1QgRWxl a3Ryb25payBTZXJ0aWZpa2EgSGl6bWV0IFNhxJ9sYXnEsWPEsXPEsTELMAkGA1UEBhMCVFIxDzAN BgNVBAcMBkFua2FyYTFeMFwGA1UECgxVVMOcUktUUlVTVCBCaWxnaSDEsGxldGnFn2ltIHZlIEJp bGnFn2ltIEfDvHZlbmxpxJ9pIEhpem1ldGxlcmkgQS7Fni4gKGMpIEFyYWzEsWsgMjAwNzCCASIw DQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAKu3PgqMyKVYFeaK7yc9SrToJdPNM8Ig3BnuiD9N YvDdE3ePYakqtdTyuTFYKTsvP2qcb3N2Je40IIDu6rfwxArNK4aUyeNgsURSsloptJGXg9i3phQv KUmi8wUG+7RP2qFsmmaf8EMJyupyj+sA1zU511YXRxcw9L6/P8JorzZAwan0qafoEGsIiveGHtya KhUG9qPw9ODHFNRRf8+0222vR5YXm3dx2KdxnSQM9pQ/hTEST7ruToK4uT6PIzdezKKqdfcYbwnT rqdUKDT74eA7YH2gvnmJhsifLfkKS8RQouf9eRbHegsYz85M733WB2+Y8a+xwXrXgTW4qhe04MsC AwEAAaNCMEAwHQYDVR0OBBYEFCnFkKslrxHkYb+j/4hhkeYO/pyBMA4GA1UdDwEB/wQEAwIBBjAP BgNVHRMBAf8EBTADAQH/MA0GCSqGSIb3DQEBBQUAA4IBAQAQDdr4Ouwo0RSVgrESLFF6QSU2TJ/s Px+EnWVUXKgWAkD6bho3hO9ynYYKVZ1WKKxmLNA6VpM0ByWtCLCPyA8JWcqdmBzlVPi5RX9ql2+I aE1KBiY3iAIOtsbWcpnOa3faYjGkVh+uX4132l32iPwa2Z61gfAyuOOI0JzzaqC5mxRZNTZPz/OO Xl0XrRWV2N2y1RVuAE6zS89mlOTgzbUF2mNXi+WzqtvALhyQRNsaXRik7r4EW5nVcV9VZWRi1aKb BFmGyGJ353yCRWo9F7/snXUMrqNvWtMvmDb08PUZqxFdyKbjKlhqQgnDvZImZjINXQhVdP+MmNAK poRq0Tl9 -----END CERTIFICATE----- D-TRUST Root Class 3 CA 2 2009 ============================== -----BEGIN CERTIFICATE----- MIIEMzCCAxugAwIBAgIDCYPzMA0GCSqGSIb3DQEBCwUAME0xCzAJBgNVBAYTAkRFMRUwEwYDVQQK DAxELVRydXN0IEdtYkgxJzAlBgNVBAMMHkQtVFJVU1QgUm9vdCBDbGFzcyAzIENBIDIgMjAwOTAe Fw0wOTExMDUwODM1NThaFw0yOTExMDUwODM1NThaME0xCzAJBgNVBAYTAkRFMRUwEwYDVQQKDAxE LVRydXN0IEdtYkgxJzAlBgNVBAMMHkQtVFJVU1QgUm9vdCBDbGFzcyAzIENBIDIgMjAwOTCCASIw DQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBANOySs96R+91myP6Oi/WUEWJNTrGa9v+2wBoqOAD ER03UAifTUpolDWzU9GUY6cgVq/eUXjsKj3zSEhQPgrfRlWLJ23DEE0NkVJD2IfgXU42tSHKXzlA BF9bfsyjxiupQB7ZNoTWSPOSHjRGICTBpFGOShrvUD9pXRl/RcPHAY9RySPocq60vFYJfxLLHLGv KZAKyVXMD9O0Gu1HNVpK7ZxzBCHQqr0ME7UAyiZsxGsMlFqVlNpQmvH/pStmMaTJOKDfHR+4CS7z p+hnUquVH+BGPtikw8paxTGA6Eian5Rp/hnd2HN8gcqW3o7tszIFZYQ05ub9VxC1X3a/L7AQDcUC AwEAAaOCARowggEWMA8GA1UdEwEB/wQFMAMBAf8wHQYDVR0OBBYEFP3aFMSfMN4hvR5COfyrYyNJ 4PGEMA4GA1UdDwEB/wQEAwIBBjCB0wYDVR0fBIHLMIHIMIGAoH6gfIZ6bGRhcDovL2RpcmVjdG9y eS5kLXRydXN0Lm5ldC9DTj1ELVRSVVNUJTIwUm9vdCUyMENsYXNzJTIwMyUyMENBJTIwMiUyMDIw MDksTz1ELVRydXN0JTIwR21iSCxDPURFP2NlcnRpZmljYXRlcmV2b2NhdGlvbmxpc3QwQ6BBoD+G PWh0dHA6Ly93d3cuZC10cnVzdC5uZXQvY3JsL2QtdHJ1c3Rfcm9vdF9jbGFzc18zX2NhXzJfMjAw OS5jcmwwDQYJKoZIhvcNAQELBQADggEBAH+X2zDI36ScfSF6gHDOFBJpiBSVYEQBrLLpME+bUMJm 2H6NMLVwMeniacfzcNsgFYbQDfC+rAF1hM5+n02/t2A7nPPKHeJeaNijnZflQGDSNiH+0LS4F9p0 o3/U37CYAqxva2ssJSRyoWXuJVrl5jLn8t+rSfrzkGkj2wTZ51xY/GXUl77M/C4KzCUqNQT4YJEV dT1B/yMfGchs64JTBKbkTCJNjYy6zltz7GRUUG3RnFX7acM2w4y8PIWmawomDeCTmGCufsYkl4ph X5GOZpIJhzbNi5stPvZR1FDUWSi9g/LMKHtThm3YJohw1+qRzT65ysCQblrGXnRl11z+o+I= -----END CERTIFICATE----- D-TRUST Root Class 3 CA 2 EV 2009 ================================= -----BEGIN CERTIFICATE----- MIIEQzCCAyugAwIBAgIDCYP0MA0GCSqGSIb3DQEBCwUAMFAxCzAJBgNVBAYTAkRFMRUwEwYDVQQK DAxELVRydXN0IEdtYkgxKjAoBgNVBAMMIUQtVFJVU1QgUm9vdCBDbGFzcyAzIENBIDIgRVYgMjAw OTAeFw0wOTExMDUwODUwNDZaFw0yOTExMDUwODUwNDZaMFAxCzAJBgNVBAYTAkRFMRUwEwYDVQQK DAxELVRydXN0IEdtYkgxKjAoBgNVBAMMIUQtVFJVU1QgUm9vdCBDbGFzcyAzIENBIDIgRVYgMjAw OTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAJnxhDRwui+3MKCOvXwEz75ivJn9gpfS egpnljgJ9hBOlSJzmY3aFS3nBfwZcyK3jpgAvDw9rKFs+9Z5JUut8Mxk2og+KbgPCdM03TP1YtHh zRnp7hhPTFiu4h7WDFsVWtg6uMQYZB7jM7K1iXdODL/ZlGsTl28So/6ZqQTMFexgaDbtCHu39b+T 7WYxg4zGcTSHThfqr4uRjRxWQa4iN1438h3Z0S0NL2lRp75mpoo6Kr3HGrHhFPC+Oh25z1uxav60 sUYgovseO3Dvk5h9jHOW8sXvhXCtKSb8HgQ+HKDYD8tSg2J87otTlZCpV6LqYQXY+U3EJ/pure35 11H3a6UCAwEAAaOCASQwggEgMA8GA1UdEwEB/wQFMAMBAf8wHQYDVR0OBBYEFNOUikxiEyoZLsyv cop9NteaHNxnMA4GA1UdDwEB/wQEAwIBBjCB3QYDVR0fBIHVMIHSMIGHoIGEoIGBhn9sZGFwOi8v ZGlyZWN0b3J5LmQtdHJ1c3QubmV0L0NOPUQtVFJVU1QlMjBSb290JTIwQ2xhc3MlMjAzJTIwQ0El MjAyJTIwRVYlMjAyMDA5LE89RC1UcnVzdCUyMEdtYkgsQz1ERT9jZXJ0aWZpY2F0ZXJldm9jYXRp b25saXN0MEagRKBChkBodHRwOi8vd3d3LmQtdHJ1c3QubmV0L2NybC9kLXRydXN0X3Jvb3RfY2xh c3NfM19jYV8yX2V2XzIwMDkuY3JsMA0GCSqGSIb3DQEBCwUAA4IBAQA07XtaPKSUiO8aEXUHL7P+ PPoeUSbrh/Yp3uDx1MYkCenBz1UbtDDZzhr+BlGmFaQt77JLvyAoJUnRpjZ3NOhk31KxEcdzes05 nsKtjHEh8lprr988TlWvsoRlFIm5d8sqMb7Po23Pb0iUMkZv53GMoKaEGTcH8gNFCSuGdXzfX2lX ANtu2KZyIktQ1HWYVt+3GP9DQ1CuekR78HlR10M9p9OB0/DJT7naxpeG0ILD5EJt/rDiZE4OJudA NCa1CInXCGNjOCd1HjPqbqjdn5lPdE2BiYBL3ZqXKVwvvoFBuYz/6n1gBp7N1z3TLqMVvKjmJuVv w9y4AyHqnxbxLFS1 -----END CERTIFICATE----- PSCProcert ========== -----BEGIN CERTIFICATE----- MIIJhjCCB26gAwIBAgIBCzANBgkqhkiG9w0BAQsFADCCAR4xPjA8BgNVBAMTNUF1dG9yaWRhZCBk ZSBDZXJ0aWZpY2FjaW9uIFJhaXogZGVsIEVzdGFkbyBWZW5lem9sYW5vMQswCQYDVQQGEwJWRTEQ MA4GA1UEBxMHQ2FyYWNhczEZMBcGA1UECBMQRGlzdHJpdG8gQ2FwaXRhbDE2MDQGA1UEChMtU2lz dGVtYSBOYWNpb25hbCBkZSBDZXJ0aWZpY2FjaW9uIEVsZWN0cm9uaWNhMUMwQQYDVQQLEzpTdXBl cmludGVuZGVuY2lhIGRlIFNlcnZpY2lvcyBkZSBDZXJ0aWZpY2FjaW9uIEVsZWN0cm9uaWNhMSUw IwYJKoZIhvcNAQkBFhZhY3JhaXpAc3VzY2VydGUuZ29iLnZlMB4XDTEwMTIyODE2NTEwMFoXDTIw MTIyNTIzNTk1OVowgdExJjAkBgkqhkiG9w0BCQEWF2NvbnRhY3RvQHByb2NlcnQubmV0LnZlMQ8w DQYDVQQHEwZDaGFjYW8xEDAOBgNVBAgTB01pcmFuZGExKjAoBgNVBAsTIVByb3ZlZWRvciBkZSBD ZXJ0aWZpY2Fkb3MgUFJPQ0VSVDE2MDQGA1UEChMtU2lzdGVtYSBOYWNpb25hbCBkZSBDZXJ0aWZp Y2FjaW9uIEVsZWN0cm9uaWNhMQswCQYDVQQGEwJWRTETMBEGA1UEAxMKUFNDUHJvY2VydDCCAiIw DQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIBANW39KOUM6FGqVVhSQ2oh3NekS1wwQYalNo97BVC wfWMrmoX8Yqt/ICV6oNEolt6Vc5Pp6XVurgfoCfAUFM+jbnADrgV3NZs+J74BCXfgI8Qhd19L3uA 3VcAZCP4bsm+lU/hdezgfl6VzbHvvnpC2Mks0+saGiKLt38GieU89RLAu9MLmV+QfI4tL3czkkoh RqipCKzx9hEC2ZUWno0vluYC3XXCFCpa1sl9JcLB/KpnheLsvtF8PPqv1W7/U0HU9TI4seJfxPmO EO8GqQKJ/+MMbpfg353bIdD0PghpbNjU5Db4g7ayNo+c7zo3Fn2/omnXO1ty0K+qP1xmk6wKImG2 0qCZyFSTXai20b1dCl53lKItwIKOvMoDKjSuc/HUtQy9vmebVOvh+qBa7Dh+PsHMosdEMXXqP+UH 0quhJZb25uSgXTcYOWEAM11G1ADEtMo88aKjPvM6/2kwLkDd9p+cJsmWN63nOaK/6mnbVSKVUyqU td+tFjiBdWbjxywbk5yqjKPK2Ww8F22c3HxT4CAnQzb5EuE8XL1mv6JpIzi4mWCZDlZTOpx+FIyw Bm/xhnaQr/2v/pDGj59/i5IjnOcVdo/Vi5QTcmn7K2FjiO/mpF7moxdqWEfLcU8UC17IAggmosvp r2uKGcfLFFb14dq12fy/czja+eevbqQ34gcnAgMBAAGjggMXMIIDEzASBgNVHRMBAf8ECDAGAQH/ AgEBMDcGA1UdEgQwMC6CD3N1c2NlcnRlLmdvYi52ZaAbBgVghl4CAqASDBBSSUYtRy0yMDAwNDAz Ni0wMB0GA1UdDgQWBBRBDxk4qpl/Qguk1yeYVKIXTC1RVDCCAVAGA1UdIwSCAUcwggFDgBStuyId xuDSAaj9dlBSk+2YwU2u06GCASakggEiMIIBHjE+MDwGA1UEAxM1QXV0b3JpZGFkIGRlIENlcnRp ZmljYWNpb24gUmFpeiBkZWwgRXN0YWRvIFZlbmV6b2xhbm8xCzAJBgNVBAYTAlZFMRAwDgYDVQQH EwdDYXJhY2FzMRkwFwYDVQQIExBEaXN0cml0byBDYXBpdGFsMTYwNAYDVQQKEy1TaXN0ZW1hIE5h Y2lvbmFsIGRlIENlcnRpZmljYWNpb24gRWxlY3Ryb25pY2ExQzBBBgNVBAsTOlN1cGVyaW50ZW5k ZW5jaWEgZGUgU2VydmljaW9zIGRlIENlcnRpZmljYWNpb24gRWxlY3Ryb25pY2ExJTAjBgkqhkiG 9w0BCQEWFmFjcmFpekBzdXNjZXJ0ZS5nb2IudmWCAQowDgYDVR0PAQH/BAQDAgEGME0GA1UdEQRG MESCDnByb2NlcnQubmV0LnZloBUGBWCGXgIBoAwMClBTQy0wMDAwMDKgGwYFYIZeAgKgEgwQUklG LUotMzE2MzUzNzMtNzB2BgNVHR8EbzBtMEagRKBChkBodHRwOi8vd3d3LnN1c2NlcnRlLmdvYi52 ZS9sY3IvQ0VSVElGSUNBRE8tUkFJWi1TSEEzODRDUkxERVIuY3JsMCOgIaAfhh1sZGFwOi8vYWNy YWl6LnN1c2NlcnRlLmdvYi52ZTA3BggrBgEFBQcBAQQrMCkwJwYIKwYBBQUHMAGGG2h0dHA6Ly9v Y3NwLnN1c2NlcnRlLmdvYi52ZTBBBgNVHSAEOjA4MDYGBmCGXgMBAjAsMCoGCCsGAQUFBwIBFh5o dHRwOi8vd3d3LnN1c2NlcnRlLmdvYi52ZS9kcGMwDQYJKoZIhvcNAQELBQADggIBACtZ6yKZu4Sq T96QxtGGcSOeSwORR3C7wJJg7ODU523G0+1ng3dS1fLld6c2suNUvtm7CpsR72H0xpkzmfWvADmN g7+mvTV+LFwxNG9s2/NkAZiqlCxB3RWGymspThbASfzXg0gTB1GEMVKIu4YXx2sviiCtxQuPcD4q uxtxj7mkoP3YldmvWb8lK5jpY5MvYB7Eqvh39YtsL+1+LrVPQA3uvFd359m21D+VJzog1eWuq2w1 n8GhHVnchIHuTQfiSLaeS5UtQbHh6N5+LwUeaO6/u5BlOsju6rEYNxxik6SgMexxbJHmpHmJWhSn FFAFTKQAVzAswbVhltw+HoSvOULP5dAssSS830DD7X9jSr3hTxJkhpXzsOfIt+FTvZLm8wyWuevo 5pLtp4EJFAv8lXrPj9Y0TzYS3F7RNHXGRoAvlQSMx4bEqCaJqD8Zm4G7UaRKhqsLEQ+xrmNTbSjq 3TNWOByyrYDT13K9mmyZY+gAu0F2BbdbmRiKw7gSXFbPVgx96OLP7bx0R/vu0xdOIk9W/1DzLuY5 poLWccret9W6aAjtmcz9opLLabid+Qqkpj5PkygqYWwHJgD/ll9ohri4zspV4KuxPX+Y1zMOWj3Y eMLEYC/HYvBhkdI4sPaeVdtAgAUSM84dkpvRabP/v/GSCmE1P93+hvS84Bpxs2Km -----END CERTIFICATE----- China Internet Network Information Center EV Certificates Root ============================================================== -----BEGIN CERTIFICATE----- MIID9zCCAt+gAwIBAgIESJ8AATANBgkqhkiG9w0BAQUFADCBijELMAkGA1UEBhMCQ04xMjAwBgNV BAoMKUNoaW5hIEludGVybmV0IE5ldHdvcmsgSW5mb3JtYXRpb24gQ2VudGVyMUcwRQYDVQQDDD5D aGluYSBJbnRlcm5ldCBOZXR3b3JrIEluZm9ybWF0aW9uIENlbnRlciBFViBDZXJ0aWZpY2F0ZXMg Um9vdDAeFw0xMDA4MzEwNzExMjVaFw0zMDA4MzEwNzExMjVaMIGKMQswCQYDVQQGEwJDTjEyMDAG A1UECgwpQ2hpbmEgSW50ZXJuZXQgTmV0d29yayBJbmZvcm1hdGlvbiBDZW50ZXIxRzBFBgNVBAMM PkNoaW5hIEludGVybmV0IE5ldHdvcmsgSW5mb3JtYXRpb24gQ2VudGVyIEVWIENlcnRpZmljYXRl cyBSb290MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAm35z7r07eKpkQ0H1UN+U8i6y jUqORlTSIRLIOTJCBumD1Z9S7eVnAztUwYyZmczpwA//DdmEEbK40ctb3B75aDFk4Zv6dOtouSCV 98YPjUesWgbdYavi7NifFy2cyjw1l1VxzUOFsUcW9SxTgHbP0wBkvUCZ3czY28Sf1hNfQYOL+Q2H klY0bBoQCxfVWhyXWIQ8hBouXJE0bhlffxdpxWXvayHG1VA6v2G5BY3vbzQ6sm8UY78WO5upKv23 KzhmBsUs4qpnHkWnjQRmQvaPK++IIGmPMowUc9orhpFjIpryp9vOiYurXccUwVswah+xt54ugQEC 7c+WXmPbqOY4twIDAQABo2MwYTAfBgNVHSMEGDAWgBR8cks5x8DbYqVPm6oYNJKiyoOCWTAPBgNV HRMBAf8EBTADAQH/MA4GA1UdDwEB/wQEAwIBBjAdBgNVHQ4EFgQUfHJLOcfA22KlT5uqGDSSosqD glkwDQYJKoZIhvcNAQEFBQADggEBACrDx0M3j92tpLIM7twUbY8opJhJywyA6vPtI2Z1fcXTIWd5 0XPFtQO3WKwMVC/GVhMPMdoG52U7HW8228gd+f2ABsqjPWYWqJ1MFn3AlUa1UeTiH9fqBk1jjZaM 7+czV0I664zBechNdn3e9rG3geCg+aF4RhcaVpjwTj2rHO3sOdwHSPdj/gauwqRcalsyiMXHM4Ws ZkJHwlgkmeHlPuV1LI5D1l08eB6olYIpUNHRFrrvwb562bTYzB5MRuF3sTGrvSrIzo9uoV1/A3U0 5K2JRVRevq4opbs/eHnrc7MKDf2+yfdWrPa37S+bISnHOLaVxATywy39FCqQmbkHzJ8= -----END CERTIFICATE----- Swisscom Root CA 2 ================== -----BEGIN CERTIFICATE----- MIIF2TCCA8GgAwIBAgIQHp4o6Ejy5e/DfEoeWhhntjANBgkqhkiG9w0BAQsFADBkMQswCQYDVQQG EwJjaDERMA8GA1UEChMIU3dpc3Njb20xJTAjBgNVBAsTHERpZ2l0YWwgQ2VydGlmaWNhdGUgU2Vy dmljZXMxGzAZBgNVBAMTElN3aXNzY29tIFJvb3QgQ0EgMjAeFw0xMTA2MjQwODM4MTRaFw0zMTA2 MjUwNzM4MTRaMGQxCzAJBgNVBAYTAmNoMREwDwYDVQQKEwhTd2lzc2NvbTElMCMGA1UECxMcRGln aXRhbCBDZXJ0aWZpY2F0ZSBTZXJ2aWNlczEbMBkGA1UEAxMSU3dpc3Njb20gUm9vdCBDQSAyMIIC IjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAlUJOhJ1R5tMJ6HJaI2nbeHCOFvErjw0DzpPM LgAIe6szjPTpQOYXTKueuEcUMncy3SgM3hhLX3af+Dk7/E6J2HzFZ++r0rk0X2s682Q2zsKwzxNo ysjL67XiPS4h3+os1OD5cJZM/2pYmLcX5BtS5X4HAB1f2uY+lQS3aYg5oUFgJWFLlTloYhyxCwWJ wDaCFCE/rtuh/bxvHGCGtlOUSbkrRsVPACu/obvLP+DHVxxX6NZp+MEkUp2IVd3Chy50I9AU/SpH Wrumnf2U5NGKpV+GY3aFy6//SSj8gO1MedK75MDvAe5QQQg1I3ArqRa0jG6F6bYRzzHdUyYb3y1a SgJA/MTAtukxGggo5WDDH8SQjhBiYEQN7Aq+VRhxLKX0srwVYv8c474d2h5Xszx+zYIdkeNL6yxS NLCK/RJOlrDrcH+eOfdmQrGrrFLadkBXeyq96G4DsguAhYidDMfCd7Camlf0uPoTXGiTOmekl9Ab mbeGMktg2M7v0Ax/lZ9vh0+Hio5fCHyqW/xavqGRn1V9TrALacywlKinh/LTSlDcX3KwFnUey7QY Ypqwpzmqm59m2I2mbJYV4+by+PGDYmy7Velhk6M99bFXi08jsJvllGov34zflVEpYKELKeRcVVi3 qPyZ7iVNTA6z00yPhOgpD/0QVAKFyPnlw4vP5w8CAwEAAaOBhjCBgzAOBgNVHQ8BAf8EBAMCAYYw HQYDVR0hBBYwFDASBgdghXQBUwIBBgdghXQBUwIBMBIGA1UdEwEB/wQIMAYBAf8CAQcwHQYDVR0O BBYEFE0mICKJS9PVpAqhb97iEoHF8TwuMB8GA1UdIwQYMBaAFE0mICKJS9PVpAqhb97iEoHF8Twu MA0GCSqGSIb3DQEBCwUAA4ICAQAyCrKkG8t9voJXiblqf/P0wS4RfbgZPnm3qKhyN2abGu2sEzsO v2LwnN+ee6FTSA5BesogpxcbtnjsQJHzQq0Qw1zv/2BZf82Fo4s9SBwlAjxnffUy6S8w5X2lejjQ 82YqZh6NM4OKb3xuqFp1mrjX2lhIREeoTPpMSQpKwhI3qEAMw8jh0FcNlzKVxzqfl9NX+Ave5XLz o9v/tdhZsnPdTSpxsrpJ9csc1fV5yJmz/MFMdOO0vSk3FQQoHt5FRnDsr7p4DooqzgB53MBfGWcs a0vvaGgLQ+OswWIJ76bdZWGgr4RVSJFSHMYlkSrQwSIjYVmvRRGFHQEkNI/Ps/8XciATwoCqISxx OQ7Qj1zB09GOInJGTB2Wrk9xseEFKZZZ9LuedT3PDTcNYtsmjGOpI99nBjx8Oto0QuFmtEYE3saW mA9LSHokMnWRn6z3aOkquVVlzl1h0ydw2Df+n7mvoC5Wt6NlUe07qxS/TFED6F+KBZvuim6c779o +sjaC+NCydAXFJy3SuCvkychVSa1ZC+N8f+mQAWFBVzKBxlcCxMoTFh/wqXvRdpg065lYZ1Tg3TC rvJcwhbtkj6EPnNgiLx29CzP0H1907he0ZESEOnN3col49XtmS++dYFLJPlFRpTJKSFTnCZFqhMX 5OfNeOI5wSsSnqaeG8XmDtkx2Q== -----END CERTIFICATE----- Swisscom Root EV CA 2 ===================== -----BEGIN CERTIFICATE----- MIIF4DCCA8igAwIBAgIRAPL6ZOJ0Y9ON/RAdBB92ylgwDQYJKoZIhvcNAQELBQAwZzELMAkGA1UE BhMCY2gxETAPBgNVBAoTCFN3aXNzY29tMSUwIwYDVQQLExxEaWdpdGFsIENlcnRpZmljYXRlIFNl cnZpY2VzMR4wHAYDVQQDExVTd2lzc2NvbSBSb290IEVWIENBIDIwHhcNMTEwNjI0MDk0NTA4WhcN MzEwNjI1MDg0NTA4WjBnMQswCQYDVQQGEwJjaDERMA8GA1UEChMIU3dpc3Njb20xJTAjBgNVBAsT HERpZ2l0YWwgQ2VydGlmaWNhdGUgU2VydmljZXMxHjAcBgNVBAMTFVN3aXNzY29tIFJvb3QgRVYg Q0EgMjCCAiIwDQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIBAMT3HS9X6lds93BdY7BxUglgRCgz o3pOCvrY6myLURYaVa5UJsTMRQdBTxB5f3HSek4/OE6zAMaVylvNwSqD1ycfMQ4jFrclyxy0uYAy Xhqdk/HoPGAsp15XGVhRXrwsVgu42O+LgrQ8uMIkqBPHoCE2G3pXKSinLr9xJZDzRINpUKTk4Rti GZQJo/PDvO/0vezbE53PnUgJUmfANykRHvvSEaeFGHR55E+FFOtSN+KxRdjMDUN/rhPSays/p8Li qG12W0OfvrSdsyaGOx9/5fLoZigWJdBLlzin5M8J0TbDC77aO0RYjb7xnglrPvMyxyuHxuxenPaH Za0zKcQvidm5y8kDnftslFGXEBuGCxobP/YCfnvUxVFkKJ3106yDgYjTdLRZncHrYTNaRdHLOdAG alNgHa/2+2m8atwBz735j9m9W8E6X47aD0upm50qKGsaCnw8qyIL5XctcfaCNYGu+HuB5ur+rPQa m3Rc6I8k9l2dRsQs0h4rIWqDJ2dVSqTjyDKXZpBy2uPUZC5f46Fq9mDU5zXNysRojddxyNMkM3Ox bPlq4SjbX8Y96L5V5jcb7STZDxmPX2MYWFCBUWVv8p9+agTnNCRxunZLWB4ZvRVgRaoMEkABnRDi xzgHcgplwLa7JSnaFp6LNYth7eVxV4O1PHGf40+/fh6Bn0GXAgMBAAGjgYYwgYMwDgYDVR0PAQH/ BAQDAgGGMB0GA1UdIQQWMBQwEgYHYIV0AVMCAgYHYIV0AVMCAjASBgNVHRMBAf8ECDAGAQH/AgED MB0GA1UdDgQWBBRF2aWBbj2ITY1x0kbBbkUe88SAnTAfBgNVHSMEGDAWgBRF2aWBbj2ITY1x0kbB bkUe88SAnTANBgkqhkiG9w0BAQsFAAOCAgEAlDpzBp9SSzBc1P6xXCX5145v9Ydkn+0UjrgEjihL j6p7jjm02Vj2e6E1CqGdivdj5eu9OYLU43otb98TPLr+flaYC/NUn81ETm484T4VvwYmneTwkLbU wp4wLh/vx3rEUMfqe9pQy3omywC0Wqu1kx+AiYQElY2NfwmTv9SoqORjbdlk5LgpWgi/UOGED1V7 XwgiG/W9mR4U9s70WBCCswo9GcG/W6uqmdjyMb3lOGbcWAXH7WMaLgqXfIeTK7KK4/HsGOV1timH 59yLGn602MnTihdsfSlEvoqq9X46Lmgxk7lq2prg2+kupYTNHAq4Sgj5nPFhJpiTt3tm7JFe3VE/ 23MPrQRYCd0EApUKPtN236YQHoA96M2kZNEzx5LH4k5E4wnJTsJdhw4Snr8PyQUQ3nqjsTzyP6Wq J3mtMX0f/fwZacXduT98zca0wjAefm6S139hdlqP65VNvBFuIXxZN5nQBrz5Bm0yFqXZaajh3DyA HmBR3NdUIR7KYndP+tiPsys6DXhyyWhBWkdKwqPrGtcKqzwyVcgKEZzfdNbwQBUdyLmPtTbFr/gi uMod89a2GQ+fYWVq6nTIfI/DT11lgh/ZDYnadXL77/FHZxOzyNEZiCcmmpl5fx7kLD977vHeTYuW l8PVP3wbI+2ksx0WckNLIOFZfsLorSa/ovc= -----END CERTIFICATE----- CA Disig Root R1 ================ -----BEGIN CERTIFICATE----- MIIFaTCCA1GgAwIBAgIJAMMDmu5QkG4oMA0GCSqGSIb3DQEBBQUAMFIxCzAJBgNVBAYTAlNLMRMw EQYDVQQHEwpCcmF0aXNsYXZhMRMwEQYDVQQKEwpEaXNpZyBhLnMuMRkwFwYDVQQDExBDQSBEaXNp ZyBSb290IFIxMB4XDTEyMDcxOTA5MDY1NloXDTQyMDcxOTA5MDY1NlowUjELMAkGA1UEBhMCU0sx EzARBgNVBAcTCkJyYXRpc2xhdmExEzARBgNVBAoTCkRpc2lnIGEucy4xGTAXBgNVBAMTEENBIERp c2lnIFJvb3QgUjEwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQCqw3j33Jijp1pedxiy 3QRkD2P9m5YJgNXoqqXinCaUOuiZc4yd39ffg/N4T0Dhf9Kn0uXKE5Pn7cZ3Xza1lK/oOI7bm+V8 u8yN63Vz4STN5qctGS7Y1oprFOsIYgrY3LMATcMjfF9DCCMyEtztDK3AfQ+lekLZWnDZv6fXARz2 m6uOt0qGeKAeVjGu74IKgEH3G8muqzIm1Cxr7X1r5OJeIgpFy4QxTaz+29FHuvlglzmxZcfe+5nk CiKxLU3lSCZpq+Kq8/v8kiky6bM+TR8noc2OuRf7JT7JbvN32g0S9l3HuzYQ1VTW8+DiR0jm3hTa YVKvJrT1cU/J19IG32PK/yHoWQbgCNWEFVP3Q+V8xaCJmGtzxmjOZd69fwX3se72V6FglcXM6pM6 vpmumwKjrckWtc7dXpl4fho5frLABaTAgqWjR56M6ly2vGfb5ipN0gTco65F97yLnByn1tUD3AjL LhbKXEAz6GfDLuemROoRRRw1ZS0eRWEkG4IupZ0zXWX4Qfkuy5Q/H6MMMSRE7cderVC6xkGbrPAX ZcD4XW9boAo0PO7X6oifmPmvTiT6l7Jkdtqr9O3jw2Dv1fkCyC2fg69naQanMVXVz0tv/wQFx1is XxYb5dKj6zHbHzMVTdDypVP1y+E9Tmgt2BLdqvLmTZtJ5cUoobqwWsagtQIDAQABo0IwQDAPBgNV HRMBAf8EBTADAQH/MA4GA1UdDwEB/wQEAwIBBjAdBgNVHQ4EFgQUiQq0OJMa5qvum5EY+fU8PjXQ 04IwDQYJKoZIhvcNAQEFBQADggIBADKL9p1Kyb4U5YysOMo6CdQbzoaz3evUuii+Eq5FLAR0rBNR xVgYZk2C2tXck8An4b58n1KeElb21Zyp9HWc+jcSjxyT7Ff+Bw+r1RL3D65hXlaASfX8MPWbTx9B LxyE04nH4toCdu0Jz2zBuByDHBb6lM19oMgY0sidbvW9adRtPTXoHqJPYNcHKfyyo6SdbhWSVhlM CrDpfNIZTUJG7L399ldb3Zh+pE3McgODWF3vkzpBemOqfDqo9ayk0d2iLbYq/J8BjuIQscTK5Gfb VSUZP/3oNn6z4eGBrxEWi1CXYBmCAMBrTXO40RMHPuq2MU/wQppt4hF05ZSsjYSVPCGvxdpHyN85 YmLLW1AL14FABZyb7bq2ix4Eb5YgOe2kfSnbSM6C3NQCjR0EMVrHS/BsYVLXtFHCgWzN4funodKS ds+xDzdYpPJScWc/DIh4gInByLUfkmO+p3qKViwaqKactV2zY9ATIKHrkWzQjX2v3wvkF7mGnjix lAxYjOBVqjtjbZqJYLhkKpLGN/R+Q0O3c+gB53+XD9fyexn9GtePyfqFa3qdnom2piiZk4hA9z7N UaPK6u95RyG1/jLix8NRb76AdPCkwzryT+lf3xkK8jsTQ6wxpLPn6/wY1gGp8yqPNg7rtLG8t0zJ a7+h89n07eLw4+1knj0vllJPgFOL -----END CERTIFICATE----- CA Disig Root R2 ================ -----BEGIN CERTIFICATE----- MIIFaTCCA1GgAwIBAgIJAJK4iNuwisFjMA0GCSqGSIb3DQEBCwUAMFIxCzAJBgNVBAYTAlNLMRMw EQYDVQQHEwpCcmF0aXNsYXZhMRMwEQYDVQQKEwpEaXNpZyBhLnMuMRkwFwYDVQQDExBDQSBEaXNp ZyBSb290IFIyMB4XDTEyMDcxOTA5MTUzMFoXDTQyMDcxOTA5MTUzMFowUjELMAkGA1UEBhMCU0sx EzARBgNVBAcTCkJyYXRpc2xhdmExEzARBgNVBAoTCkRpc2lnIGEucy4xGTAXBgNVBAMTEENBIERp c2lnIFJvb3QgUjIwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQCio8QACdaFXS1tFPbC w3OeNcJxVX6B+6tGUODBfEl45qt5WDza/3wcn9iXAng+a0EE6UG9vgMsRfYvZNSrXaNHPWSb6Wia xswbP7q+sos0Ai6YVRn8jG+qX9pMzk0DIaPY0jSTVpbLTAwAFjxfGs3Ix2ymrdMxp7zo5eFm1tL7 A7RBZckQrg4FY8aAamkw/dLukO8NJ9+flXP04SXabBbeQTg06ov80egEFGEtQX6sx3dOy1FU+16S GBsEWmjGycT6txOgmLcRK7fWV8x8nhfRyyX+hk4kLlYMeE2eARKmK6cBZW58Yh2EhN/qwGu1pSqV g8NTEQxzHQuyRpDRQjrOQG6Vrf/GlK1ul4SOfW+eioANSW1z4nuSHsPzwfPrLgVv2RvPN3YEyLRa 5Beny912H9AZdugsBbPWnDTYltxhh5EF5EQIM8HauQhl1K6yNg3ruji6DOWbnuuNZt2Zz9aJQfYE koopKW1rOhzndX0CcQ7zwOe9yxndnWCywmZgtrEE7snmhrmaZkCo5xHtgUUDi/ZnWejBBhG93c+A Ak9lQHhcR1DIm+YfgXvkRKhbhZri3lrVx/k6RGZL5DJUfORsnLMOPReisjQS1n6yqEm70XooQL6i Fh/f5DcfEXP7kAplQ6INfPgGAVUzfbANuPT1rqVCV3w2EYx7XsQDnYx5nQIDAQABo0IwQDAPBgNV HRMBAf8EBTADAQH/MA4GA1UdDwEB/wQEAwIBBjAdBgNVHQ4EFgQUtZn4r7CU9eMg1gqtzk5WpC5u Qu0wDQYJKoZIhvcNAQELBQADggIBACYGXnDnZTPIgm7ZnBc6G3pmsgH2eDtpXi/q/075KMOYKmFM tCQSin1tERT3nLXK5ryeJ45MGcipvXrA1zYObYVybqjGom32+nNjf7xueQgcnYqfGopTpti72TVV sRHFqQOzVju5hJMiXn7B9hJSi+osZ7z+Nkz1uM/Rs0mSO9MpDpkblvdhuDvEK7Z4bLQjb/D907Je dR+Zlais9trhxTF7+9FGs9K8Z7RiVLoJ92Owk6Ka+elSLotgEqv89WBW7xBci8QaQtyDW2QOy7W8 1k/BfDxujRNt+3vrMNDcTa/F1balTFtxyegxvug4BkihGuLq0t4SOVga/4AOgnXmt8kHbA7v/zjx mHHEt38OFdAlab0inSvtBfZGR6ztwPDUO+Ls7pZbkBNOHlY667DvlruWIxG68kOGdGSVyCh13x01 utI3gzhTODY7z2zp+WsO0PsE6E9312UBeIYMej4hYvF/Y3EMyZ9E26gnonW+boE+18DrG5gPcFw0 sorMwIUY6256s/daoQe/qUKS82Ail+QUoQebTnbAjn39pCXHR+3/H3OszMOl6W8KjptlwlCFtaOg UxLMVYdh84GuEEZhvUQhuMI9dM9+JDX6HAcOmz0iyu8xL4ysEr3vQCj8KWefshNPZiTEUxnpHikV 7+ZtsH8tZ/3zbBt1RqPlShfppNcL -----END CERTIFICATE----- ACCVRAIZ1 ========= -----BEGIN CERTIFICATE----- MIIH0zCCBbugAwIBAgIIXsO3pkN/pOAwDQYJKoZIhvcNAQEFBQAwQjESMBAGA1UEAwwJQUNDVlJB SVoxMRAwDgYDVQQLDAdQS0lBQ0NWMQ0wCwYDVQQKDARBQ0NWMQswCQYDVQQGEwJFUzAeFw0xMTA1 MDUwOTM3MzdaFw0zMDEyMzEwOTM3MzdaMEIxEjAQBgNVBAMMCUFDQ1ZSQUlaMTEQMA4GA1UECwwH UEtJQUNDVjENMAsGA1UECgwEQUNDVjELMAkGA1UEBhMCRVMwggIiMA0GCSqGSIb3DQEBAQUAA4IC DwAwggIKAoICAQCbqau/YUqXry+XZpp0X9DZlv3P4uRm7x8fRzPCRKPfmt4ftVTdFXxpNRFvu8gM jmoYHtiP2Ra8EEg2XPBjs5BaXCQ316PWywlxufEBcoSwfdtNgM3802/J+Nq2DoLSRYWoG2ioPej0 RGy9ocLLA76MPhMAhN9KSMDjIgro6TenGEyxCQ0jVn8ETdkXhBilyNpAlHPrzg5XPAOBOp0KoVdD aaxXbXmQeOW1tDvYvEyNKKGno6e6Ak4l0Squ7a4DIrhrIA8wKFSVf+DuzgpmndFALW4ir50awQUZ 0m/A8p/4e7MCQvtQqR0tkw8jq8bBD5L/0KIV9VMJcRz/RROE5iZe+OCIHAr8Fraocwa48GOEAqDG WuzndN9wrqODJerWx5eHk6fGioozl2A3ED6XPm4pFdahD9GILBKfb6qkxkLrQaLjlUPTAYVtjrs7 8yM2x/474KElB0iryYl0/wiPgL/AlmXz7uxLaL2diMMxs0Dx6M/2OLuc5NF/1OVYm3z61PMOm3WR 5LpSLhl+0fXNWhn8ugb2+1KoS5kE3fj5tItQo05iifCHJPqDQsGH+tUtKSpacXpkatcnYGMN285J 9Y0fkIkyF/hzQ7jSWpOGYdbhdQrqeWZ2iE9x6wQl1gpaepPluUsXQA+xtrn13k/c4LOsOxFwYIRK Q26ZIMApcQrAZQIDAQABo4ICyzCCAscwfQYIKwYBBQUHAQEEcTBvMEwGCCsGAQUFBzAChkBodHRw Oi8vd3d3LmFjY3YuZXMvZmlsZWFkbWluL0FyY2hpdm9zL2NlcnRpZmljYWRvcy9yYWl6YWNjdjEu Y3J0MB8GCCsGAQUFBzABhhNodHRwOi8vb2NzcC5hY2N2LmVzMB0GA1UdDgQWBBTSh7Tj3zcnk1X2 VuqB5TbMjB4/vTAPBgNVHRMBAf8EBTADAQH/MB8GA1UdIwQYMBaAFNKHtOPfNyeTVfZW6oHlNsyM Hj+9MIIBcwYDVR0gBIIBajCCAWYwggFiBgRVHSAAMIIBWDCCASIGCCsGAQUFBwICMIIBFB6CARAA QQB1AHQAbwByAGkAZABhAGQAIABkAGUAIABDAGUAcgB0AGkAZgBpAGMAYQBjAGkA8wBuACAAUgBh AO0AegAgAGQAZQAgAGwAYQAgAEEAQwBDAFYAIAAoAEEAZwBlAG4AYwBpAGEAIABkAGUAIABUAGUA YwBuAG8AbABvAGcA7QBhACAAeQAgAEMAZQByAHQAaQBmAGkAYwBhAGMAaQDzAG4AIABFAGwAZQBj AHQAcgDzAG4AaQBjAGEALAAgAEMASQBGACAAUQA0ADYAMAAxADEANQA2AEUAKQAuACAAQwBQAFMA IABlAG4AIABoAHQAdABwADoALwAvAHcAdwB3AC4AYQBjAGMAdgAuAGUAczAwBggrBgEFBQcCARYk aHR0cDovL3d3dy5hY2N2LmVzL2xlZ2lzbGFjaW9uX2MuaHRtMFUGA1UdHwROMEwwSqBIoEaGRGh0 dHA6Ly93d3cuYWNjdi5lcy9maWxlYWRtaW4vQXJjaGl2b3MvY2VydGlmaWNhZG9zL3JhaXphY2N2 MV9kZXIuY3JsMA4GA1UdDwEB/wQEAwIBBjAXBgNVHREEEDAOgQxhY2N2QGFjY3YuZXMwDQYJKoZI hvcNAQEFBQADggIBAJcxAp/n/UNnSEQU5CmH7UwoZtCPNdpNYbdKl02125DgBS4OxnnQ8pdpD70E R9m+27Up2pvZrqmZ1dM8MJP1jaGo/AaNRPTKFpV8M9xii6g3+CfYCS0b78gUJyCpZET/LtZ1qmxN YEAZSUNUY9rizLpm5U9EelvZaoErQNV/+QEnWCzI7UiRfD+mAM/EKXMRNt6GGT6d7hmKG9Ww7Y49 nCrADdg9ZuM8Db3VlFzi4qc1GwQA9j9ajepDvV+JHanBsMyZ4k0ACtrJJ1vnE5Bc5PUzolVt3OAJ TS+xJlsndQAJxGJ3KQhfnlmstn6tn1QwIgPBHnFk/vk4CpYY3QIUrCPLBhwepH2NDd4nQeit2hW3 sCPdK6jT2iWH7ehVRE2I9DZ+hJp4rPcOVkkO1jMl1oRQQmwgEh0q1b688nCBpHBgvgW1m54ERL5h I6zppSSMEYCUWqKiuUnSwdzRp+0xESyeGabu4VXhwOrPDYTkF7eifKXeVSUG7szAh1xA2syVP1Xg Nce4hL60Xc16gwFy7ofmXx2utYXGJt/mwZrpHgJHnyqobalbz+xFd3+YJ5oyXSrjhO7FmGYvliAd 3djDJ9ew+f7Zfc3Qn48LFFhRny+Lwzgt3uiP1o2HpPVWQxaZLPSkVrQ0uGE3ycJYgBugl6H8WY3p EfbRD0tVNEYqi4Y7 -----END CERTIFICATE----- TWCA Global Root CA =================== -----BEGIN CERTIFICATE----- MIIFQTCCAymgAwIBAgICDL4wDQYJKoZIhvcNAQELBQAwUTELMAkGA1UEBhMCVFcxEjAQBgNVBAoT CVRBSVdBTi1DQTEQMA4GA1UECxMHUm9vdCBDQTEcMBoGA1UEAxMTVFdDQSBHbG9iYWwgUm9vdCBD QTAeFw0xMjA2MjcwNjI4MzNaFw0zMDEyMzExNTU5NTlaMFExCzAJBgNVBAYTAlRXMRIwEAYDVQQK EwlUQUlXQU4tQ0ExEDAOBgNVBAsTB1Jvb3QgQ0ExHDAaBgNVBAMTE1RXQ0EgR2xvYmFsIFJvb3Qg Q0EwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQCwBdvI64zEbooh745NnHEKH1Jw7W2C nJfF10xORUnLQEK1EjRsGcJ0pDFfhQKX7EMzClPSnIyOt7h52yvVavKOZsTuKwEHktSz0ALfUPZV r2YOy+BHYC8rMjk1Ujoog/h7FsYYuGLWRyWRzvAZEk2tY/XTP3VfKfChMBwqoJimFb3u/Rk28OKR Q4/6ytYQJ0lM793B8YVwm8rqqFpD/G2Gb3PpN0Wp8DbHzIh1HrtsBv+baz4X7GGqcXzGHaL3SekV tTzWoWH1EfcFbx39Eb7QMAfCKbAJTibc46KokWofwpFFiFzlmLhxpRUZyXx1EcxwdE8tmx2RRP1W KKD+u4ZqyPpcC1jcxkt2yKsi2XMPpfRaAok/T54igu6idFMqPVMnaR1sjjIsZAAmY2E2TqNGtz99 sy2sbZCilaLOz9qC5wc0GZbpuCGqKX6mOL6OKUohZnkfs8O1CWfe1tQHRvMq2uYiN2DLgbYPoA/p yJV/v1WRBXrPPRXAb94JlAGD1zQbzECl8LibZ9WYkTunhHiVJqRaCPgrdLQABDzfuBSO6N+pjWxn kjMdwLfS7JLIvgm/LCkFbwJrnu+8vyq8W8BQj0FwcYeyTbcEqYSjMq+u7msXi7Kx/mzhkIyIqJdI zshNy/MGz19qCkKxHh53L46g5pIOBvwFItIm4TFRfTLcDwIDAQABoyMwITAOBgNVHQ8BAf8EBAMC AQYwDwYDVR0TAQH/BAUwAwEB/zANBgkqhkiG9w0BAQsFAAOCAgEAXzSBdu+WHdXltdkCY4QWwa6g cFGn90xHNcgL1yg9iXHZqjNB6hQbbCEAwGxCGX6faVsgQt+i0trEfJdLjbDorMjupWkEmQqSpqsn LhpNgb+E1HAerUf+/UqdM+DyucRFCCEK2mlpc3INvjT+lIutwx4116KD7+U4x6WFH6vPNOw/KP4M 8VeGTslV9xzU2KV9Bnpv1d8Q34FOIWWxtuEXeZVFBs5fzNxGiWNoRI2T9GRwoD2dKAXDOXC4Ynsg /eTb6QihuJ49CcdP+yz4k3ZB3lLg4VfSnQO8d57+nile98FRYB/e2guyLXW3Q0iT5/Z5xoRdgFlg lPx4mI88k1HtQJAH32RjJMtOcQWh15QaiDLxInQirqWm2BJpTGCjAu4r7NRjkgtevi92a6O2JryP A9gK8kxkRr05YuWW6zRjESjMlfGt7+/cgFhI6Uu46mWs6fyAtbXIRfmswZ/ZuepiiI7E8UuDEq3m i4TWnsLrgxifarsbJGAzcMzs9zLzXNl5fe+epP7JI8Mk7hWSsT2RTyaGvWZzJBPqpK5jwa19hAM8 EHiGG3njxPPyBJUgriOCxLM6AGK/5jYk4Ve6xx6QddVfP5VhK8E7zeWzaGHQRiapIVJpLesux+t3 zqY6tQMzT3bR51xUAV3LePTJDL/PEo4XLSNolOer/qmyKwbQBM0= -----END CERTIFICATE----- TeliaSonera Root CA v1 ====================== -----BEGIN CERTIFICATE----- MIIFODCCAyCgAwIBAgIRAJW+FqD3LkbxezmCcvqLzZYwDQYJKoZIhvcNAQEFBQAwNzEUMBIGA1UE CgwLVGVsaWFTb25lcmExHzAdBgNVBAMMFlRlbGlhU29uZXJhIFJvb3QgQ0EgdjEwHhcNMDcxMDE4 MTIwMDUwWhcNMzIxMDE4MTIwMDUwWjA3MRQwEgYDVQQKDAtUZWxpYVNvbmVyYTEfMB0GA1UEAwwW VGVsaWFTb25lcmEgUm9vdCBDQSB2MTCCAiIwDQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIBAMK+ 6yfwIaPzaSZVfp3FVRaRXP3vIb9TgHot0pGMYzHw7CTww6XScnwQbfQ3t+XmfHnqjLWCi65ItqwA 3GV17CpNX8GH9SBlK4GoRz6JI5UwFpB/6FcHSOcZrr9FZ7E3GwYq/t75rH2D+1665I+XZ75Ljo1k B1c4VWk0Nj0TSO9P4tNmHqTPGrdeNjPUtAa9GAH9d4RQAEX1jF3oI7x+/jXh7VB7qTCNGdMJjmhn Xb88lxhTuylixcpecsHHltTbLaC0H2kD7OriUPEMPPCs81Mt8Bz17Ww5OXOAFshSsCPN4D7c3TxH oLs1iuKYaIu+5b9y7tL6pe0S7fyYGKkmdtwoSxAgHNN/Fnct7W+A90m7UwW7XWjH1Mh1Fj+JWov3 F0fUTPHSiXk+TT2YqGHeOh7S+F4D4MHJHIzTjU3TlTazN19jY5szFPAtJmtTfImMMsJu7D0hADnJ oWjiUIMusDor8zagrC/kb2HCUQk5PotTubtn2txTuXZZNp1D5SDgPTJghSJRt8czu90VL6R4pgd7 gUY2BIbdeTXHlSw7sKMXNeVzH7RcWe/a6hBle3rQf5+ztCo3O3CLm1u5K7fsslESl1MpWtTwEhDc TwK7EpIvYtQ/aUN8Ddb8WHUBiJ1YFkveupD/RwGJBmr2X7KQarMCpgKIv7NHfirZ1fpoeDVNAgMB AAGjPzA9MA8GA1UdEwEB/wQFMAMBAf8wCwYDVR0PBAQDAgEGMB0GA1UdDgQWBBTwj1k4ALP1j5qW DNXr+nuqF+gTEjANBgkqhkiG9w0BAQUFAAOCAgEAvuRcYk4k9AwI//DTDGjkk0kiP0Qnb7tt3oNm zqjMDfz1mgbldxSR651Be5kqhOX//CHBXfDkH1e3damhXwIm/9fH907eT/j3HEbAek9ALCI18Bmx 0GtnLLCo4MBANzX2hFxc469CeP6nyQ1Q6g2EdvZR74NTxnr/DlZJLo961gzmJ1TjTQpgcmLNkQfW pb/ImWvtxBnmq0wROMVvMeJuScg/doAmAyYp4Db29iBT4xdwNBedY2gea+zDTYa4EzAvXUYNR0PV G6pZDrlcjQZIrXSHX8f8MVRBE+LHIQ6e4B4N4cB7Q4WQxYpYxmUKeFfyxiMPAdkgS94P+5KFdSpc c41teyWRyu5FrgZLAMzTsVlQ2jqIOylDRl6XK1TOU2+NSueW+r9xDkKLfP0ooNBIytrEgUy7onOT JsjrDNYmiLbAJM+7vVvrdX3pCI6GMyx5dwlppYn8s3CQh3aP0yK7Qs69cwsgJirQmz1wHiRszYd2 qReWt88NkvuOGKmYSdGe/mBEciG5Ge3C9THxOUiIkCR1VBatzvT4aRRkOfujuLpwQMcnHL/EVlP6 Y2XQ8xwOFvVrhlhNGNTkDY6lnVuR3HYkUD/GKvvZt5y11ubQ2egZixVxSK236thZiNSQvxaz2ems WWFUyBy6ysHK4bkgTI86k4mloMy/0/Z1pHWWbVY= -----END CERTIFICATE----- E-Tugra Certification Authority =============================== -----BEGIN CERTIFICATE----- MIIGSzCCBDOgAwIBAgIIamg+nFGby1MwDQYJKoZIhvcNAQELBQAwgbIxCzAJBgNVBAYTAlRSMQ8w DQYDVQQHDAZBbmthcmExQDA+BgNVBAoMN0UtVHXEn3JhIEVCRyBCaWxpxZ9pbSBUZWtub2xvamls ZXJpIHZlIEhpem1ldGxlcmkgQS7Fni4xJjAkBgNVBAsMHUUtVHVncmEgU2VydGlmaWthc3lvbiBN ZXJrZXppMSgwJgYDVQQDDB9FLVR1Z3JhIENlcnRpZmljYXRpb24gQXV0aG9yaXR5MB4XDTEzMDMw NTEyMDk0OFoXDTIzMDMwMzEyMDk0OFowgbIxCzAJBgNVBAYTAlRSMQ8wDQYDVQQHDAZBbmthcmEx QDA+BgNVBAoMN0UtVHXEn3JhIEVCRyBCaWxpxZ9pbSBUZWtub2xvamlsZXJpIHZlIEhpem1ldGxl cmkgQS7Fni4xJjAkBgNVBAsMHUUtVHVncmEgU2VydGlmaWthc3lvbiBNZXJrZXppMSgwJgYDVQQD DB9FLVR1Z3JhIENlcnRpZmljYXRpb24gQXV0aG9yaXR5MIICIjANBgkqhkiG9w0BAQEFAAOCAg8A MIICCgKCAgEA4vU/kwVRHoViVF56C/UYB4Oufq9899SKa6VjQzm5S/fDxmSJPZQuVIBSOTkHS0vd hQd2h8y/L5VMzH2nPbxHD5hw+IyFHnSOkm0bQNGZDbt1bsipa5rAhDGvykPL6ys06I+XawGb1Q5K CKpbknSFQ9OArqGIW66z6l7LFpp3RMih9lRozt6Plyu6W0ACDGQXwLWTzeHxE2bODHnv0ZEoq1+g ElIwcxmOj+GMB6LDu0rw6h8VqO4lzKRG+Bsi77MOQ7osJLjFLFzUHPhdZL3Dk14opz8n8Y4e0ypQ BaNV2cvnOVPAmJ6MVGKLJrD3fY185MaeZkJVgkfnsliNZvcHfC425lAcP9tDJMW/hkd5s3kc91r0 E+xs+D/iWR+V7kI+ua2oMoVJl0b+SzGPWsutdEcf6ZG33ygEIqDUD13ieU/qbIWGvaimzuT6w+Gz rt48Ue7LE3wBf4QOXVGUnhMMti6lTPk5cDZvlsouDERVxcr6XQKj39ZkjFqzAQqptQpHF//vkUAq jqFGOjGY5RH8zLtJVor8udBhmm9lbObDyz51Sf6Pp+KJxWfXnUYTTjF2OySznhFlhqt/7x3U+Lzn rFpct1pHXFXOVbQicVtbC/DP3KBhZOqp12gKY6fgDT+gr9Oq0n7vUaDmUStVkhUXU8u3Zg5mTPj5 dUyQ5xJwx0UCAwEAAaNjMGEwHQYDVR0OBBYEFC7j27JJ0JxUeVz6Jyr+zE7S6E5UMA8GA1UdEwEB /wQFMAMBAf8wHwYDVR0jBBgwFoAULuPbsknQnFR5XPonKv7MTtLoTlQwDgYDVR0PAQH/BAQDAgEG MA0GCSqGSIb3DQEBCwUAA4ICAQAFNzr0TbdF4kV1JI+2d1LoHNgQk2Xz8lkGpD4eKexd0dCrfOAK kEh47U6YA5n+KGCRHTAduGN8qOY1tfrTYXbm1gdLymmasoR6d5NFFxWfJNCYExL/u6Au/U5Mh/jO XKqYGwXgAEZKgoClM4so3O0409/lPun++1ndYYRP0lSWE2ETPo+Aab6TR7U1Q9Jauz1c77NCR807 VRMGsAnb/WP2OogKmW9+4c4bU2pEZiNRCHu8W1Ki/QY3OEBhj0qWuJA3+GbHeJAAFS6LrVE1Uweo a2iu+U48BybNCAVwzDk/dr2l02cmAYamU9JgO3xDf1WKvJUawSg5TB9D0pH0clmKuVb8P7Sd2nCc dlqMQ1DujjByTd//SffGqWfZbawCEeI6FiWnWAjLb1NBnEg4R2gz0dfHj9R0IdTDBZB6/86WiLEV KV0jq9BgoRJP3vQXzTLlyb/IQ639Lo7xr+L0mPoSHyDYwKcMhcWQ9DstliaxLL5Mq+ux0orJ23gT Dx4JnW2PAJ8C2sH6H3p6CcRK5ogql5+Ji/03X186zjhZhkuvcQu02PJwT58yE+Owp1fl2tpDy4Q0 8ijE6m30Ku/Ba3ba+367hTzSU8JNvnHhRdH9I2cNE3X7z2VnIp2usAnRCf8dNL/+I5c30jn6PQ0G C7TbO6Orb1wdtn7os4I07QZcJA== -----END CERTIFICATE----- T-TeleSec GlobalRoot Class 2 ============================ -----BEGIN CERTIFICATE----- MIIDwzCCAqugAwIBAgIBATANBgkqhkiG9w0BAQsFADCBgjELMAkGA1UEBhMCREUxKzApBgNVBAoM IlQtU3lzdGVtcyBFbnRlcnByaXNlIFNlcnZpY2VzIEdtYkgxHzAdBgNVBAsMFlQtU3lzdGVtcyBU cnVzdCBDZW50ZXIxJTAjBgNVBAMMHFQtVGVsZVNlYyBHbG9iYWxSb290IENsYXNzIDIwHhcNMDgx MDAxMTA0MDE0WhcNMzMxMDAxMjM1OTU5WjCBgjELMAkGA1UEBhMCREUxKzApBgNVBAoMIlQtU3lz dGVtcyBFbnRlcnByaXNlIFNlcnZpY2VzIEdtYkgxHzAdBgNVBAsMFlQtU3lzdGVtcyBUcnVzdCBD ZW50ZXIxJTAjBgNVBAMMHFQtVGVsZVNlYyBHbG9iYWxSb290IENsYXNzIDIwggEiMA0GCSqGSIb3 DQEBAQUAA4IBDwAwggEKAoIBAQCqX9obX+hzkeXaXPSi5kfl82hVYAUdAqSzm1nzHoqvNK38DcLZ SBnuaY/JIPwhqgcZ7bBcrGXHX+0CfHt8LRvWurmAwhiCFoT6ZrAIxlQjgeTNuUk/9k9uN0goOA/F vudocP05l03Sx5iRUKrERLMjfTlH6VJi1hKTXrcxlkIF+3anHqP1wvzpesVsqXFP6st4vGCvx970 2cu+fjOlbpSD8DT6IavqjnKgP6TeMFvvhk1qlVtDRKgQFRzlAVfFmPHmBiiRqiDFt1MmUUOyCxGV WOHAD3bZwI18gfNycJ5v/hqO2V81xrJvNHy+SE/iWjnX2J14np+GPgNeGYtEotXHAgMBAAGjQjBA MA8GA1UdEwEB/wQFMAMBAf8wDgYDVR0PAQH/BAQDAgEGMB0GA1UdDgQWBBS/WSA2AHmgoCJrjNXy YdK4LMuCSjANBgkqhkiG9w0BAQsFAAOCAQEAMQOiYQsfdOhyNsZt+U2e+iKo4YFWz827n+qrkRk4 r6p8FU3ztqONpfSO9kSpp+ghla0+AGIWiPACuvxhI+YzmzB6azZie60EI4RYZeLbK4rnJVM3YlNf vNoBYimipidx5joifsFvHZVwIEoHNN/q/xWA5brXethbdXwFeilHfkCoMRN3zUA7tFFHei4R40cR 3p1m0IvVVGb6g1XqfMIpiRvpb7PO4gWEyS8+eIVibslfwXhjdFjASBgMmTnrpMwatXlajRWc2BQN 9noHV8cigwUtPJslJj0Ys6lDfMjIq2SPDqO/nBudMNva0Bkuqjzx+zOAduTNrRlPBSeOE6Fuwg== -----END CERTIFICATE----- Atos TrustedRoot 2011 ===================== -----BEGIN CERTIFICATE----- MIIDdzCCAl+gAwIBAgIIXDPLYixfszIwDQYJKoZIhvcNAQELBQAwPDEeMBwGA1UEAwwVQXRvcyBU cnVzdGVkUm9vdCAyMDExMQ0wCwYDVQQKDARBdG9zMQswCQYDVQQGEwJERTAeFw0xMTA3MDcxNDU4 MzBaFw0zMDEyMzEyMzU5NTlaMDwxHjAcBgNVBAMMFUF0b3MgVHJ1c3RlZFJvb3QgMjAxMTENMAsG A1UECgwEQXRvczELMAkGA1UEBhMCREUwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCV hTuXbyo7LjvPpvMpNb7PGKw+qtn4TaA+Gke5vJrf8v7MPkfoepbCJI419KkM/IL9bcFyYie96mvr 54rMVD6QUM+A1JX76LWC1BTFtqlVJVfbsVD2sGBkWXppzwO3bw2+yj5vdHLqqjAqc2K+SZFhyBH+ DgMq92og3AIVDV4VavzjgsG1xZ1kCWyjWZgHJ8cblithdHFsQ/H3NYkQ4J7sVaE3IqKHBAUsR320 HLliKWYoyrfhk/WklAOZuXCFteZI6o1Q/NnezG8HDt0Lcp2AMBYHlT8oDv3FdU9T1nSatCQujgKR z3bFmx5VdJx4IbHwLfELn8LVlhgf8FQieowHAgMBAAGjfTB7MB0GA1UdDgQWBBSnpQaxLKYJYO7R l+lwrrw7GWzbITAPBgNVHRMBAf8EBTADAQH/MB8GA1UdIwQYMBaAFKelBrEspglg7tGX6XCuvDsZ bNshMBgGA1UdIAQRMA8wDQYLKwYBBAGwLQMEAQEwDgYDVR0PAQH/BAQDAgGGMA0GCSqGSIb3DQEB CwUAA4IBAQAmdzTblEiGKkGdLD4GkGDEjKwLVLgfuXvTBznk+j57sj1O7Z8jvZfza1zv7v1Apt+h k6EKhqzvINB5Ab149xnYJDE0BAGmuhWawyfc2E8PzBhj/5kPDpFrdRbhIfzYJsdHt6bPWHJxfrrh TZVHO8mvbaG0weyJ9rQPOLXiZNwlz6bb65pcmaHFCN795trV1lpFDMS3wrUU77QR/w4VtfX128a9 61qn8FYiqTxlVMYVqL2Gns2Dlmh6cYGJ4Qvh6hEbaAjMaZ7snkGeRDImeuKHCnE96+RapNLbxc3G 3mB/ufNPRJLvKrcYPqcZ2Qt9sTdBQrC6YB3y/gkRsPCHe6ed -----END CERTIFICATE----- QuoVadis Root CA 1 G3 ===================== -----BEGIN CERTIFICATE----- MIIFYDCCA0igAwIBAgIUeFhfLq0sGUvjNwc1NBMotZbUZZMwDQYJKoZIhvcNAQELBQAwSDELMAkG A1UEBhMCQk0xGTAXBgNVBAoTEFF1b1ZhZGlzIExpbWl0ZWQxHjAcBgNVBAMTFVF1b1ZhZGlzIFJv b3QgQ0EgMSBHMzAeFw0xMjAxMTIxNzI3NDRaFw00MjAxMTIxNzI3NDRaMEgxCzAJBgNVBAYTAkJN MRkwFwYDVQQKExBRdW9WYWRpcyBMaW1pdGVkMR4wHAYDVQQDExVRdW9WYWRpcyBSb290IENBIDEg RzMwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQCgvlAQjunybEC0BJyFuTHK3C3kEakE PBtVwedYMB0ktMPvhd6MLOHBPd+C5k+tR4ds7FtJwUrVu4/sh6x/gpqG7D0DmVIB0jWerNrwU8lm PNSsAgHaJNM7qAJGr6Qc4/hzWHa39g6QDbXwz8z6+cZM5cOGMAqNF34168Xfuw6cwI2H44g4hWf6 Pser4BOcBRiYz5P1sZK0/CPTz9XEJ0ngnjybCKOLXSoh4Pw5qlPafX7PGglTvF0FBM+hSo+LdoIN ofjSxxR3W5A2B4GbPgb6Ul5jxaYA/qXpUhtStZI5cgMJYr2wYBZupt0lwgNm3fME0UDiTouG9G/l g6AnhF4EwfWQvTA9xO+oabw4m6SkltFi2mnAAZauy8RRNOoMqv8hjlmPSlzkYZqn0ukqeI1RPToV 7qJZjqlc3sX5kCLliEVx3ZGZbHqfPT2YfF72vhZooF6uCyP8Wg+qInYtyaEQHeTTRCOQiJ/GKubX 9ZqzWB4vMIkIG1SitZgj7Ah3HJVdYdHLiZxfokqRmu8hqkkWCKi9YSgxyXSthfbZxbGL0eUQMk1f iyA6PEkfM4VZDdvLCXVDaXP7a3F98N/ETH3Goy7IlXnLc6KOTk0k+17kBL5yG6YnLUlamXrXXAkg t3+UuU/xDRxeiEIbEbfnkduebPRq34wGmAOtzCjvpUfzUwIDAQABo0IwQDAPBgNVHRMBAf8EBTAD AQH/MA4GA1UdDwEB/wQEAwIBBjAdBgNVHQ4EFgQUo5fW816iEOGrRZ88F2Q87gFwnMwwDQYJKoZI hvcNAQELBQADggIBABj6W3X8PnrHX3fHyt/PX8MSxEBd1DKquGrX1RUVRpgjpeaQWxiZTOOtQqOC MTaIzen7xASWSIsBx40Bz1szBpZGZnQdT+3Btrm0DWHMY37XLneMlhwqI2hrhVd2cDMT/uFPpiN3 GPoajOi9ZcnPP/TJF9zrx7zABC4tRi9pZsMbj/7sPtPKlL92CiUNqXsCHKnQO18LwIE6PWThv6ct Tr1NxNgpxiIY0MWscgKCP6o6ojoilzHdCGPDdRS5YCgtW2jgFqlmgiNR9etT2DGbe+m3nUvriBbP +V04ikkwj+3x6xn0dxoxGE1nVGwvb2X52z3sIexe9PSLymBlVNFxZPT5pqOBMzYzcfCkeF9OrYMh 3jRJjehZrJ3ydlo28hP0r+AJx2EqbPfgna67hkooby7utHnNkDPDs3b69fBsnQGQ+p6Q9pxyz0fa wx/kNSBT8lTR32GDpgLiJTjehTItXnOQUl1CxM49S+H5GYQd1aJQzEH7QRTDvdbJWqNjZgKAvQU6 O0ec7AAmTPWIUb+oI38YB7AL7YsmoWTTYUrrXJ/es69nA7Mf3W1daWhpq1467HxpvMc7hU6eFbm0 FU/DlXpY18ls6Wy58yljXrQs8C097Vpl4KlbQMJImYFtnh8GKjwStIsPm6Ik8KaN1nrgS7ZklmOV hMJKzRwuJIczYOXD -----END CERTIFICATE----- QuoVadis Root CA 2 G3 ===================== -----BEGIN CERTIFICATE----- MIIFYDCCA0igAwIBAgIURFc0JFuBiZs18s64KztbpybwdSgwDQYJKoZIhvcNAQELBQAwSDELMAkG A1UEBhMCQk0xGTAXBgNVBAoTEFF1b1ZhZGlzIExpbWl0ZWQxHjAcBgNVBAMTFVF1b1ZhZGlzIFJv b3QgQ0EgMiBHMzAeFw0xMjAxMTIxODU5MzJaFw00MjAxMTIxODU5MzJaMEgxCzAJBgNVBAYTAkJN MRkwFwYDVQQKExBRdW9WYWRpcyBMaW1pdGVkMR4wHAYDVQQDExVRdW9WYWRpcyBSb290IENBIDIg RzMwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQChriWyARjcV4g/Ruv5r+LrI3HimtFh ZiFfqq8nUeVuGxbULX1QsFN3vXg6YOJkApt8hpvWGo6t/x8Vf9WVHhLL5hSEBMHfNrMWn4rjyduY NM7YMxcoRvynyfDStNVNCXJJ+fKH46nafaF9a7I6JaltUkSs+L5u+9ymc5GQYaYDFCDy54ejiK2t oIz/pgslUiXnFgHVy7g1gQyjO/Dh4fxaXc6AcW34Sas+O7q414AB+6XrW7PFXmAqMaCvN+ggOp+o MiwMzAkd056OXbxMmO7FGmh77FOm6RQ1o9/NgJ8MSPsc9PG/Srj61YxxSscfrf5BmrODXfKEVu+l V0POKa2Mq1W/xPtbAd0jIaFYAI7D0GoT7RPjEiuA3GfmlbLNHiJuKvhB1PLKFAeNilUSxmn1uIZo L1NesNKqIcGY5jDjZ1XHm26sGahVpkUG0CM62+tlXSoREfA7T8pt9DTEceT/AFr2XK4jYIVz8eQQ sSWu1ZK7E8EM4DnatDlXtas1qnIhO4M15zHfeiFuuDIIfR0ykRVKYnLP43ehvNURG3YBZwjgQQvD 6xVu+KQZ2aKrr+InUlYrAoosFCT5v0ICvybIxo/gbjh9Uy3l7ZizlWNof/k19N+IxWA1ksB8aRxh lRbQ694Lrz4EEEVlWFA4r0jyWbYW8jwNkALGcC4BrTwV1wIDAQABo0IwQDAPBgNVHRMBAf8EBTAD AQH/MA4GA1UdDwEB/wQEAwIBBjAdBgNVHQ4EFgQU7edvdlq/YOxJW8ald7tyFnGbxD0wDQYJKoZI hvcNAQELBQADggIBAJHfgD9DCX5xwvfrs4iP4VGyvD11+ShdyLyZm3tdquXK4Qr36LLTn91nMX66 AarHakE7kNQIXLJgapDwyM4DYvmL7ftuKtwGTTwpD4kWilhMSA/ohGHqPHKmd+RCroijQ1h5fq7K pVMNqT1wvSAZYaRsOPxDMuHBR//47PERIjKWnML2W2mWeyAMQ0GaW/ZZGYjeVYg3UQt4XAoeo0L9 x52ID8DyeAIkVJOviYeIyUqAHerQbj5hLja7NQ4nlv1mNDthcnPxFlxHBlRJAHpYErAK74X9sbgz dWqTHBLmYF5vHX/JHyPLhGGfHoJE+V+tYlUkmlKY7VHnoX6XOuYvHxHaU4AshZ6rNRDbIl9qxV6X U/IyAgkwo1jwDQHVcsaxfGl7w/U2Rcxhbl5MlMVerugOXou/983g7aEOGzPuVBj+D77vfoRrQ+Nw mNtddbINWQeFFSM51vHfqSYP1kjHs6Yi9TM3WpVHn3u6GBVv/9YUZINJ0gpnIdsPNWNgKCLjsZWD zYWm3S8P52dSbrsvhXz1SnPnxT7AvSESBT/8twNJAlvIJebiVDj1eYeMHVOyToV7BjjHLPj4sHKN JeV3UvQDHEimUF+IIDBu8oJDqz2XhOdT+yHBTw8imoa4WSr2Rz0ZiC3oheGe7IUIarFsNMkd7Egr O3jtZsSOeWmD3n+M -----END CERTIFICATE----- QuoVadis Root CA 3 G3 ===================== -----BEGIN CERTIFICATE----- MIIFYDCCA0igAwIBAgIULvWbAiin23r/1aOp7r0DoM8Sah0wDQYJKoZIhvcNAQELBQAwSDELMAkG A1UEBhMCQk0xGTAXBgNVBAoTEFF1b1ZhZGlzIExpbWl0ZWQxHjAcBgNVBAMTFVF1b1ZhZGlzIFJv b3QgQ0EgMyBHMzAeFw0xMjAxMTIyMDI2MzJaFw00MjAxMTIyMDI2MzJaMEgxCzAJBgNVBAYTAkJN MRkwFwYDVQQKExBRdW9WYWRpcyBMaW1pdGVkMR4wHAYDVQQDExVRdW9WYWRpcyBSb290IENBIDMg RzMwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQCzyw4QZ47qFJenMioKVjZ/aEzHs286 IxSR/xl/pcqs7rN2nXrpixurazHb+gtTTK/FpRp5PIpM/6zfJd5O2YIyC0TeytuMrKNuFoM7pmRL Mon7FhY4futD4tN0SsJiCnMK3UmzV9KwCoWdcTzeo8vAMvMBOSBDGzXRU7Ox7sWTaYI+FrUoRqHe 6okJ7UO4BUaKhvVZR74bbwEhELn9qdIoyhA5CcoTNs+cra1AdHkrAj80//ogaX3T7mH1urPnMNA3 I4ZyYUUpSFlob3emLoG+B01vr87ERRORFHAGjx+f+IdpsQ7vw4kZ6+ocYfx6bIrc1gMLnia6Et3U VDmrJqMz6nWB2i3ND0/kA9HvFZcba5DFApCTZgIhsUfei5pKgLlVj7WiL8DWM2fafsSntARE60f7 5li59wzweyuxwHApw0BiLTtIadwjPEjrewl5qW3aqDCYz4ByA4imW0aucnl8CAMhZa634RylsSqi Md5mBPfAdOhx3v89WcyWJhKLhZVXGqtrdQtEPREoPHtht+KPZ0/l7DxMYIBpVzgeAVuNVejH38DM dyM0SXV89pgR6y3e7UEuFAUCf+D+IOs15xGsIs5XPd7JMG0QA4XN8f+MFrXBsj6IbGB/kE+V9/Yt rQE5BwT6dYB9v0lQ7e/JxHwc64B+27bQ3RP+ydOc17KXqQIDAQABo0IwQDAPBgNVHRMBAf8EBTAD AQH/MA4GA1UdDwEB/wQEAwIBBjAdBgNVHQ4EFgQUxhfQvKjqAkPyGwaZXSuQILnXnOQwDQYJKoZI hvcNAQELBQADggIBADRh2Va1EodVTd2jNTFGu6QHcrxfYWLopfsLN7E8trP6KZ1/AvWkyaiTt3px KGmPc+FSkNrVvjrlt3ZqVoAh313m6Tqe5T72omnHKgqwGEfcIHB9UqM+WXzBusnIFUBhynLWcKzS t/Ac5IYp8M7vaGPQtSCKFWGafoaYtMnCdvvMujAWzKNhxnQT5WvvoxXqA/4Ti2Tk08HS6IT7SdEQ TXlm66r99I0xHnAUrdzeZxNMgRVhvLfZkXdxGYFgu/BYpbWcC/ePIlUnwEsBbTuZDdQdm2NnL9Du DcpmvJRPpq3t/O5jrFc/ZSXPsoaP0Aj/uHYUbt7lJ+yreLVTubY/6CD50qi+YUbKh4yE8/nxoGib Ih6BJpsQBJFxwAYf3KDTuVan45gtf4Od34wrnDKOMpTwATwiKp9Dwi7DmDkHOHv8XgBCH/MyJnmD hPbl8MFREsALHgQjDFSlTC9JxUrRtm5gDWv8a4uFJGS3iQ6rJUdbPM9+Sb3H6QrG2vd+DhcI00iX 0HGS8A85PjRqHH3Y8iKuu2n0M7SmSFXRDw4m6Oy2Cy2nhTXN/VnIn9HNPlopNLk9hM6xZdRZkZFW dSHBd575euFgndOtBBj0fOtek49TSiIp+EgrPk2GrFt/ywaZWWDYWGWVjUTR939+J399roD1B0y2 PpxxVJkES/1Y+Zj0 -----END CERTIFICATE----- DigiCert Assured ID Root G2 =========================== -----BEGIN CERTIFICATE----- MIIDljCCAn6gAwIBAgIQC5McOtY5Z+pnI7/Dr5r0SzANBgkqhkiG9w0BAQsFADBlMQswCQYDVQQG EwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3d3cuZGlnaWNlcnQuY29tMSQw IgYDVQQDExtEaWdpQ2VydCBBc3N1cmVkIElEIFJvb3QgRzIwHhcNMTMwODAxMTIwMDAwWhcNMzgw MTE1MTIwMDAwWjBlMQswCQYDVQQGEwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQL ExB3d3cuZGlnaWNlcnQuY29tMSQwIgYDVQQDExtEaWdpQ2VydCBBc3N1cmVkIElEIFJvb3QgRzIw ggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDZ5ygvUj82ckmIkzTz+GoeMVSAn61UQbVH 35ao1K+ALbkKz3X9iaV9JPrjIgwrvJUXCzO/GU1BBpAAvQxNEP4HteccbiJVMWWXvdMX0h5i89vq bFCMP4QMls+3ywPgym2hFEwbid3tALBSfK+RbLE4E9HpEgjAALAcKxHad3A2m67OeYfcgnDmCXRw VWmvo2ifv922ebPynXApVfSr/5Vh88lAbx3RvpO704gqu52/clpWcTs/1PPRCv4o76Pu2ZmvA9OP YLfykqGxvYmJHzDNw6YuYjOuFgJ3RFrngQo8p0Quebg/BLxcoIfhG69Rjs3sLPr4/m3wOnyqi+Rn lTGNAgMBAAGjQjBAMA8GA1UdEwEB/wQFMAMBAf8wDgYDVR0PAQH/BAQDAgGGMB0GA1UdDgQWBBTO w0q5mVXyuNtgv6l+vVa1lzan1jANBgkqhkiG9w0BAQsFAAOCAQEAyqVVjOPIQW5pJ6d1Ee88hjZv 0p3GeDgdaZaikmkuOGybfQTUiaWxMTeKySHMq2zNixya1r9I0jJmwYrA8y8678Dj1JGG0VDjA9tz d29KOVPt3ibHtX2vK0LRdWLjSisCx1BL4GnilmwORGYQRI+tBev4eaymG+g3NJ1TyWGqolKvSnAW hsI6yLETcDbYz+70CjTVW0z9B5yiutkBclzzTcHdDrEcDcRjvq30FPuJ7KJBDkzMyFdA0G4Dqs0M jomZmWzwPDCvON9vvKO+KSAnq3T/EyJ43pdSVR6DtVQgA+6uwE9W3jfMw3+qBCe703e4YtsXfJwo IhNzbM8m9Yop5w== -----END CERTIFICATE----- DigiCert Assured ID Root G3 =========================== -----BEGIN CERTIFICATE----- MIICRjCCAc2gAwIBAgIQC6Fa+h3foLVJRK/NJKBs7DAKBggqhkjOPQQDAzBlMQswCQYDVQQGEwJV UzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3d3cuZGlnaWNlcnQuY29tMSQwIgYD VQQDExtEaWdpQ2VydCBBc3N1cmVkIElEIFJvb3QgRzMwHhcNMTMwODAxMTIwMDAwWhcNMzgwMTE1 MTIwMDAwWjBlMQswCQYDVQQGEwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3 d3cuZGlnaWNlcnQuY29tMSQwIgYDVQQDExtEaWdpQ2VydCBBc3N1cmVkIElEIFJvb3QgRzMwdjAQ BgcqhkjOPQIBBgUrgQQAIgNiAAQZ57ysRGXtzbg/WPuNsVepRC0FFfLvC/8QdJ+1YlJfZn4f5dwb RXkLzMZTCp2NXQLZqVneAlr2lSoOjThKiknGvMYDOAdfVdp+CW7if17QRSAPWXYQ1qAk8C3eNvJs KTmjQjBAMA8GA1UdEwEB/wQFMAMBAf8wDgYDVR0PAQH/BAQDAgGGMB0GA1UdDgQWBBTL0L2p4ZgF UaFNN6KDec6NHSrkhDAKBggqhkjOPQQDAwNnADBkAjAlpIFFAmsSS3V0T8gj43DydXLefInwz5Fy YZ5eEJJZVrmDxxDnOOlYJjZ91eQ0hjkCMHw2U/Aw5WJjOpnitqM7mzT6HtoQknFekROn3aRukswy 1vUhZscv6pZjamVFkpUBtA== -----END CERTIFICATE----- DigiCert Global Root G2 ======================= -----BEGIN CERTIFICATE----- MIIDjjCCAnagAwIBAgIQAzrx5qcRqaC7KGSxHQn65TANBgkqhkiG9w0BAQsFADBhMQswCQYDVQQG EwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3d3cuZGlnaWNlcnQuY29tMSAw HgYDVQQDExdEaWdpQ2VydCBHbG9iYWwgUm9vdCBHMjAeFw0xMzA4MDExMjAwMDBaFw0zODAxMTUx MjAwMDBaMGExCzAJBgNVBAYTAlVTMRUwEwYDVQQKEwxEaWdpQ2VydCBJbmMxGTAXBgNVBAsTEHd3 dy5kaWdpY2VydC5jb20xIDAeBgNVBAMTF0RpZ2lDZXJ0IEdsb2JhbCBSb290IEcyMIIBIjANBgkq hkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAuzfNNNx7a8myaJCtSnX/RrohCgiN9RlUyfuI2/Ou8jqJ kTx65qsGGmvPrC3oXgkkRLpimn7Wo6h+4FR1IAWsULecYxpsMNzaHxmx1x7e/dfgy5SDN67sH0NO 3Xss0r0upS/kqbitOtSZpLYl6ZtrAGCSYP9PIUkY92eQq2EGnI/yuum06ZIya7XzV+hdG82MHauV BJVJ8zUtluNJbd134/tJS7SsVQepj5WztCO7TG1F8PapspUwtP1MVYwnSlcUfIKdzXOS0xZKBgyM UNGPHgm+F6HmIcr9g+UQvIOlCsRnKPZzFBQ9RnbDhxSJITRNrw9FDKZJobq7nMWxM4MphQIDAQAB o0IwQDAPBgNVHRMBAf8EBTADAQH/MA4GA1UdDwEB/wQEAwIBhjAdBgNVHQ4EFgQUTiJUIBiV5uNu 5g/6+rkS7QYXjzkwDQYJKoZIhvcNAQELBQADggEBAGBnKJRvDkhj6zHd6mcY1Yl9PMWLSn/pvtsr F9+wX3N3KjITOYFnQoQj8kVnNeyIv/iPsGEMNKSuIEyExtv4NeF22d+mQrvHRAiGfzZ0JFrabA0U WTW98kndth/Jsw1HKj2ZL7tcu7XUIOGZX1NGFdtom/DzMNU+MeKNhJ7jitralj41E6Vf8PlwUHBH QRFXGU7Aj64GxJUTFy8bJZ918rGOmaFvE7FBcf6IKshPECBV1/MUReXgRPTqh5Uykw7+U0b6LJ3/ iyK5S9kJRaTepLiaWN0bfVKfjllDiIGknibVb63dDcY3fe0Dkhvld1927jyNxF1WW6LZZm6zNTfl MrY= -----END CERTIFICATE----- DigiCert Global Root G3 ======================= -----BEGIN CERTIFICATE----- MIICPzCCAcWgAwIBAgIQBVVWvPJepDU1w6QP1atFcjAKBggqhkjOPQQDAzBhMQswCQYDVQQGEwJV UzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3d3cuZGlnaWNlcnQuY29tMSAwHgYD VQQDExdEaWdpQ2VydCBHbG9iYWwgUm9vdCBHMzAeFw0xMzA4MDExMjAwMDBaFw0zODAxMTUxMjAw MDBaMGExCzAJBgNVBAYTAlVTMRUwEwYDVQQKEwxEaWdpQ2VydCBJbmMxGTAXBgNVBAsTEHd3dy5k aWdpY2VydC5jb20xIDAeBgNVBAMTF0RpZ2lDZXJ0IEdsb2JhbCBSb290IEczMHYwEAYHKoZIzj0C AQYFK4EEACIDYgAE3afZu4q4C/sLfyHS8L6+c/MzXRq8NOrexpu80JX28MzQC7phW1FGfp4tn+6O YwwX7Adw9c+ELkCDnOg/QW07rdOkFFk2eJ0DQ+4QE2xy3q6Ip6FrtUPOZ9wj/wMco+I+o0IwQDAP BgNVHRMBAf8EBTADAQH/MA4GA1UdDwEB/wQEAwIBhjAdBgNVHQ4EFgQUs9tIpPmhxdiuNkHMEWNp Yim8S8YwCgYIKoZIzj0EAwMDaAAwZQIxAK288mw/EkrRLTnDCgmXc/SINoyIJ7vmiI1Qhadj+Z4y 3maTD/HMsQmP3Wyr+mt/oAIwOWZbwmSNuJ5Q3KjVSaLtx9zRSX8XAbjIho9OjIgrqJqpisXRAL34 VOKa5Vt8sycX -----END CERTIFICATE----- DigiCert Trusted Root G4 ======================== -----BEGIN CERTIFICATE----- MIIFkDCCA3igAwIBAgIQBZsbV56OITLiOQe9p3d1XDANBgkqhkiG9w0BAQwFADBiMQswCQYDVQQG EwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3d3cuZGlnaWNlcnQuY29tMSEw HwYDVQQDExhEaWdpQ2VydCBUcnVzdGVkIFJvb3QgRzQwHhcNMTMwODAxMTIwMDAwWhcNMzgwMTE1 MTIwMDAwWjBiMQswCQYDVQQGEwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3 d3cuZGlnaWNlcnQuY29tMSEwHwYDVQQDExhEaWdpQ2VydCBUcnVzdGVkIFJvb3QgRzQwggIiMA0G CSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQC/5pBzaN675F1KPDAiMGkz7MKnJS7JIT3yithZwuEp pz1Yq3aaza57G4QNxDAf8xukOBbrVsaXbR2rsnnyyhHS5F/WBTxSD1Ifxp4VpX6+n6lXFllVcq9o k3DCsrp1mWpzMpTREEQQLt+C8weE5nQ7bXHiLQwb7iDVySAdYyktzuxeTsiT+CFhmzTrBcZe7Fsa vOvJz82sNEBfsXpm7nfISKhmV1efVFiODCu3T6cw2Vbuyntd463JT17lNecxy9qTXtyOj4DatpGY QJB5w3jHtrHEtWoYOAMQjdjUN6QuBX2I9YI+EJFwq1WCQTLX2wRzKm6RAXwhTNS8rhsDdV14Ztk6 MUSaM0C/CNdaSaTC5qmgZ92kJ7yhTzm1EVgX9yRcRo9k98FpiHaYdj1ZXUJ2h4mXaXpI8OCiEhtm mnTK3kse5w5jrubU75KSOp493ADkRSWJtppEGSt+wJS00mFt6zPZxd9LBADMfRyVw4/3IbKyEbe7 f/LVjHAsQWCqsWMYRJUadmJ+9oCw++hkpjPRiQfhvbfmQ6QYuKZ3AeEPlAwhHbJUKSWJbOUOUlFH dL4mrLZBdd56rF+NP8m800ERElvlEFDrMcXKchYiCd98THU/Y+whX8QgUWtvsauGi0/C1kVfnSD8 oR7FwI+isX4KJpn15GkvmB0t9dmpsh3lGwIDAQABo0IwQDAPBgNVHRMBAf8EBTADAQH/MA4GA1Ud DwEB/wQEAwIBhjAdBgNVHQ4EFgQU7NfjgtJxXWRM3y5nP+e6mK4cD08wDQYJKoZIhvcNAQEMBQAD ggIBALth2X2pbL4XxJEbw6GiAI3jZGgPVs93rnD5/ZpKmbnJeFwMDF/k5hQpVgs2SV1EY+CtnJYY ZhsjDT156W1r1lT40jzBQ0CuHVD1UvyQO7uYmWlrx8GnqGikJ9yd+SeuMIW59mdNOj6PWTkiU0Tr yF0Dyu1Qen1iIQqAyHNm0aAFYF/opbSnr6j3bTWcfFqK1qI4mfN4i/RN0iAL3gTujJtHgXINwBQy 7zBZLq7gcfJW5GqXb5JQbZaNaHqasjYUegbyJLkJEVDXCLG4iXqEI2FCKeWjzaIgQdfRnGTZ6iah ixTXTBmyUEFxPT9NcCOGDErcgdLMMpSEDQgJlxxPwO5rIHQw0uA5NBCFIRUBCOhVMt5xSdkoF1BN 5r5N0XWs0Mr7QbhDparTwwVETyw2m+L64kW4I1NsBm9nVX9GtUw/bihaeSbSpKhil9Ie4u1Ki7wb /UdKDd9nZn6yW0HQO+T0O/QEY+nvwlQAUaCKKsnOeMzV6ocEGLPOr0mIr/OSmbaz5mEP0oUA51Aa 5BuVnRmhuZyxm7EAHu/QD09CbMkKvO5D+jpxpchNJqU1/YldvIViHTLSoCtU7ZpXwdv6EM8Zt4tK G48BtieVU+i2iW1bvGjUI+iLUaJW+fCmgKDWHrO8Dw9TdSmq6hN35N6MgSGtBxBHEa2HPQfRdbzP 82Z+ -----END CERTIFICATE----- WoSign ====== -----BEGIN CERTIFICATE----- MIIFdjCCA16gAwIBAgIQXmjWEXGUY1BWAGjzPsnFkTANBgkqhkiG9w0BAQUFADBVMQswCQYDVQQG EwJDTjEaMBgGA1UEChMRV29TaWduIENBIExpbWl0ZWQxKjAoBgNVBAMTIUNlcnRpZmljYXRpb24g QXV0aG9yaXR5IG9mIFdvU2lnbjAeFw0wOTA4MDgwMTAwMDFaFw0zOTA4MDgwMTAwMDFaMFUxCzAJ BgNVBAYTAkNOMRowGAYDVQQKExFXb1NpZ24gQ0EgTGltaXRlZDEqMCgGA1UEAxMhQ2VydGlmaWNh dGlvbiBBdXRob3JpdHkgb2YgV29TaWduMIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEA vcqNrLiRFVaXe2tcesLea9mhsMMQI/qnobLMMfo+2aYpbxY94Gv4uEBf2zmoAHqLoE1UfcIiePyO CbiohdfMlZdLdNiefvAA5A6JrkkoRBoQmTIPJYhTpA2zDxIIFgsDcSccf+Hb0v1naMQFXQoOXXDX 2JegvFNBmpGN9J42Znp+VsGQX+axaCA2pIwkLCxHC1l2ZjC1vt7tj/id07sBMOby8w7gLJKA84X5 KIq0VC6a7fd2/BVoFutKbOsuEo/Uz/4Mx1wdC34FMr5esAkqQtXJTpCzWQ27en7N1QhatH/YHGkR +ScPewavVIMYe+HdVHpRaG53/Ma/UkpmRqGyZxq7o093oL5d//xWC0Nyd5DKnvnyOfUNqfTq1+ez EC8wQjchzDBwyYaYD8xYTYO7feUapTeNtqwylwA6Y3EkHp43xP901DfA4v6IRmAR3Qg/UDaruHqk lWJqbrDKaiFaafPz+x1wOZXzp26mgYmhiMU7ccqjUu6Du/2gd/Tkb+dC221KmYo0SLwX3OSACCK2 8jHAPwQ+658geda4BmRkAjHXqc1S+4RFaQkAKtxVi8QGRkvASh0JWzko/amrzgD5LkhLJuYwTKVY yrREgk/nkR4zw7CT/xH8gdLKH3Ep3XZPkiWvHYG3Dy+MwwbMLyejSuQOmbp8HkUff6oZRZb9/D0C AwEAAaNCMEAwDgYDVR0PAQH/BAQDAgEGMA8GA1UdEwEB/wQFMAMBAf8wHQYDVR0OBBYEFOFmzw7R 8bNLtwYgFP6HEtX2/vs+MA0GCSqGSIb3DQEBBQUAA4ICAQCoy3JAsnbBfnv8rWTjMnvMPLZdRtP1 LOJwXcgu2AZ9mNELIaCJWSQBnfmvCX0KI4I01fx8cpm5o9dU9OpScA7F9dY74ToJMuYhOZO9sxXq T2r09Ys/L3yNWC7F4TmgPsc9SnOeQHrAK2GpZ8nzJLmzbVUsWh2eJXLOC62qx1ViC777Y7NhRCOj y+EaDveaBk3e1CNOIZZbOVtXHS9dCF4Jef98l7VNg64N1uajeeAz0JmWAjCnPv/So0M/BVoG6kQC 2nz4SNAzqfkHx5Xh9T71XXG68pWpdIhhWeO/yloTunK0jF02h+mmxTwTv97QRCbut+wucPrXnbes 5cVAWubXbHssw1abR80LzvobtCHXt2a49CUwi1wNuepnsvRtrtWhnk/Yn+knArAdBtaP4/tIEp9/ EaEQPkxROpaw0RPxx9gmrjrKkcRpnd8BKWRRb2jaFOwIQZeQjdCygPLPwj2/kWjFgGcexGATVdVh mVd8upUPYUk6ynW8yQqTP2cOEvIo4jEbwFcW3wh8GcF+Dx+FHgo2fFt+J7x6v+Db9NpSvd4MVHAx kUOVyLzwPt0JfjBkUO1/AaQzZ01oT74V77D2AhGiGxMlOtzCWfHjXEa7ZywCRuoeSKbmW9m1vFGi kpbbqsY3Iqb+zCB0oy2pLmvLwIIRIbWTee5Ehr7XHuQe+w== -----END CERTIFICATE----- WoSign China ============ -----BEGIN CERTIFICATE----- MIIFWDCCA0CgAwIBAgIQUHBrzdgT/BtOOzNy0hFIjTANBgkqhkiG9w0BAQsFADBGMQswCQYDVQQG EwJDTjEaMBgGA1UEChMRV29TaWduIENBIExpbWl0ZWQxGzAZBgNVBAMMEkNBIOayg+mAmuagueiv geS5pjAeFw0wOTA4MDgwMTAwMDFaFw0zOTA4MDgwMTAwMDFaMEYxCzAJBgNVBAYTAkNOMRowGAYD VQQKExFXb1NpZ24gQ0EgTGltaXRlZDEbMBkGA1UEAwwSQ0Eg5rKD6YCa5qC56K+B5LmmMIICIjAN BgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEA0EkhHiX8h8EqwqzbdoYGTufQdDTc7WU1/FDWiD+k 8H/rD195L4mx/bxjWDeTmzj4t1up+thxx7S8gJeNbEvxUNUqKaqoGXqW5pWOdO2XCld19AXbbQs5 uQF/qvbW2mzmBeCkTVL829B0txGMe41P/4eDrv8FAxNXUDf+jJZSEExfv5RxadmWPgxDT74wwJ85 dE8GRV2j1lY5aAfMh09Qd5Nx2UQIsYo06Yms25tO4dnkUkWMLhQfkWsZHWgpLFbE4h4TV2TwYeO5 Ed+w4VegG63XX9Gv2ystP9Bojg/qnw+LNVgbExz03jWhCl3W6t8Sb8D7aQdGctyB9gQjF+BNdeFy b7Ao65vh4YOhn0pdr8yb+gIgthhid5E7o9Vlrdx8kHccREGkSovrlXLp9glk3Kgtn3R46MGiCWOc 76DbT52VqyBPt7D3h1ymoOQ3OMdc4zUPLK2jgKLsLl3Az+2LBcLmc272idX10kaO6m1jGx6KyX2m +Jzr5dVjhU1zZmkR/sgO9MHHZklTfuQZa/HpelmjbX7FF+Ynxu8b22/8DU0GAbQOXDBGVWCvOGU6 yke6rCzMRh+yRpY/8+0mBe53oWprfi1tWFxK1I5nuPHa1UaKJ/kR8slC/k7e3x9cxKSGhxYzoacX GKUN5AXlK8IrC6KVkLn9YDxOiT7nnO4fuwECAwEAAaNCMEAwDgYDVR0PAQH/BAQDAgEGMA8GA1Ud EwEB/wQFMAMBAf8wHQYDVR0OBBYEFOBNv9ybQV0T6GTwp+kVpOGBwboxMA0GCSqGSIb3DQEBCwUA A4ICAQBqinA4WbbaixjIvirTthnVZil6Xc1bL3McJk6jfW+rtylNpumlEYOnOXOvEESS5iVdT2H6 yAa+Tkvv/vMx/sZ8cApBWNromUuWyXi8mHwCKe0JgOYKOoICKuLJL8hWGSbueBwj/feTZU7n85iY r83d2Z5AiDEoOqsuC7CsDCT6eiaY8xJhEPRdF/d+4niXVOKM6Cm6jBAyvd0zaziGfjk9DgNyp115 j0WKWa5bIW4xRtVZjc8VX90xJc/bYNaBRHIpAlf2ltTW/+op2znFuCyKGo3Oy+dCMYYFaA6eFN0A kLppRQjbbpCBhqcqBT/mhDn4t/lXX0ykeVoQDF7Va/81XwVRHmyjdanPUIPTfPRm94KNPQx96N97 qA4bLJyuQHCH2u2nFoJavjVsIE4iYdm8UXrNemHcSxH5/mc0zy4EZmFcV5cjjPOGG0jfKq+nwf/Y jj4Du9gqsPoUJbJRa4ZDhS4HIxaAjUz7tGM7zMN07RujHv41D198HRaG9Q7DlfEvr10lO1Hm13ZB ONFLAzkopR6RctR9q5czxNM+4Gm2KHmgCY0c0f9BckgG/Jou5yD5m6Leie2uPAmvylezkolwQOQv T8Jwg0DXJCxr5wkf09XHwQj02w47HAcLQxGEIYbpgNR12KvxAmLBsX5VYc8T1yaw15zLKYs4SgsO kI26oQ== -----END CERTIFICATE----- COMODO RSA Certification Authority ================================== -----BEGIN CERTIFICATE----- MIIF2DCCA8CgAwIBAgIQTKr5yttjb+Af907YWwOGnTANBgkqhkiG9w0BAQwFADCBhTELMAkGA1UE BhMCR0IxGzAZBgNVBAgTEkdyZWF0ZXIgTWFuY2hlc3RlcjEQMA4GA1UEBxMHU2FsZm9yZDEaMBgG A1UEChMRQ09NT0RPIENBIExpbWl0ZWQxKzApBgNVBAMTIkNPTU9ETyBSU0EgQ2VydGlmaWNhdGlv biBBdXRob3JpdHkwHhcNMTAwMTE5MDAwMDAwWhcNMzgwMTE4MjM1OTU5WjCBhTELMAkGA1UEBhMC R0IxGzAZBgNVBAgTEkdyZWF0ZXIgTWFuY2hlc3RlcjEQMA4GA1UEBxMHU2FsZm9yZDEaMBgGA1UE ChMRQ09NT0RPIENBIExpbWl0ZWQxKzApBgNVBAMTIkNPTU9ETyBSU0EgQ2VydGlmaWNhdGlvbiBB dXRob3JpdHkwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQCR6FSS0gpWsawNJN3Fz0Rn dJkrN6N9I3AAcbxT38T6KhKPS38QVr2fcHK3YX/JSw8Xpz3jsARh7v8Rl8f0hj4K+j5c+ZPmNHrZ FGvnnLOFoIJ6dq9xkNfs/Q36nGz637CC9BR++b7Epi9Pf5l/tfxnQ3K9DADWietrLNPtj5gcFKt+ 5eNu/Nio5JIk2kNrYrhV/erBvGy2i/MOjZrkm2xpmfh4SDBF1a3hDTxFYPwyllEnvGfDyi62a+pG x8cgoLEfZd5ICLqkTqnyg0Y3hOvozIFIQ2dOciqbXL1MGyiKXCJ7tKuY2e7gUYPDCUZObT6Z+pUX 2nwzV0E8jVHtC7ZcryxjGt9XyD+86V3Em69FmeKjWiS0uqlWPc9vqv9JWL7wqP/0uK3pN/u6uPQL OvnoQ0IeidiEyxPx2bvhiWC4jChWrBQdnArncevPDt09qZahSL0896+1DSJMwBGB7FY79tOi4lu3 sgQiUpWAk2nojkxl8ZEDLXB0AuqLZxUpaVICu9ffUGpVRr+goyhhf3DQw6KqLCGqR84onAZFdr+C GCe01a60y1Dma/RMhnEw6abfFobg2P9A3fvQQoh/ozM6LlweQRGBY84YcWsr7KaKtzFcOmpH4MN5 WdYgGq/yapiqcrxXStJLnbsQ/LBMQeXtHT1eKJ2czL+zUdqnR+WEUwIDAQABo0IwQDAdBgNVHQ4E FgQUu69+Aj36pvE8hI6t7jiY7NkyMtQwDgYDVR0PAQH/BAQDAgEGMA8GA1UdEwEB/wQFMAMBAf8w DQYJKoZIhvcNAQEMBQADggIBAArx1UaEt65Ru2yyTUEUAJNMnMvlwFTPoCWOAvn9sKIN9SCYPBMt rFaisNZ+EZLpLrqeLppysb0ZRGxhNaKatBYSaVqM4dc+pBroLwP0rmEdEBsqpIt6xf4FpuHA1sj+ nq6PK7o9mfjYcwlYRm6mnPTXJ9OV2jeDchzTc+CiR5kDOF3VSXkAKRzH7JsgHAckaVd4sjn8OoSg tZx8jb8uk2IntznaFxiuvTwJaP+EmzzV1gsD41eeFPfR60/IvYcjt7ZJQ3mFXLrrkguhxuhoqEwW sRqZCuhTLJK7oQkYdQxlqHvLI7cawiiFwxv/0Cti76R7CZGYZ4wUAc1oBmpjIXUDgIiKboHGhfKp pC3n9KUkEEeDys30jXlYsQab5xoq2Z0B15R97QNKyvDb6KkBPvVWmckejkk9u+UJueBPSZI9FoJA zMxZxuY67RIuaTxslbH9qh17f4a+Hg4yRvv7E491f0yLS0Zj/gA0QHDBw7mh3aZw4gSzQbzpgJHq ZJx64SIDqZxubw5lT2yHh17zbqD5daWbQOhTsiedSrnAdyGN/4fy3ryM7xfft0kL0fJuMAsaDk52 7RH89elWsn2/x20Kk4yl0MC2Hb46TpSi125sC8KKfPog88Tk5c0NqMuRkrF8hey1FGlmDoLnzc7I LaZRfyHBNVOFBkpdn627G190 -----END CERTIFICATE----- USERTrust RSA Certification Authority ===================================== -----BEGIN CERTIFICATE----- MIIF3jCCA8agAwIBAgIQAf1tMPyjylGoG7xkDjUDLTANBgkqhkiG9w0BAQwFADCBiDELMAkGA1UE BhMCVVMxEzARBgNVBAgTCk5ldyBKZXJzZXkxFDASBgNVBAcTC0plcnNleSBDaXR5MR4wHAYDVQQK ExVUaGUgVVNFUlRSVVNUIE5ldHdvcmsxLjAsBgNVBAMTJVVTRVJUcnVzdCBSU0EgQ2VydGlmaWNh dGlvbiBBdXRob3JpdHkwHhcNMTAwMjAxMDAwMDAwWhcNMzgwMTE4MjM1OTU5WjCBiDELMAkGA1UE BhMCVVMxEzARBgNVBAgTCk5ldyBKZXJzZXkxFDASBgNVBAcTC0plcnNleSBDaXR5MR4wHAYDVQQK ExVUaGUgVVNFUlRSVVNUIE5ldHdvcmsxLjAsBgNVBAMTJVVTRVJUcnVzdCBSU0EgQ2VydGlmaWNh dGlvbiBBdXRob3JpdHkwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQCAEmUXNg7D2wiz 0KxXDXbtzSfTTK1Qg2HiqiBNCS1kCdzOiZ/MPans9s/B3PHTsdZ7NygRK0faOca8Ohm0X6a9fZ2j Y0K2dvKpOyuR+OJv0OwWIJAJPuLodMkYtJHUYmTbf6MG8YgYapAiPLz+E/CHFHv25B+O1ORRxhFn RghRy4YUVD+8M/5+bJz/Fp0YvVGONaanZshyZ9shZrHUm3gDwFA66Mzw3LyeTP6vBZY1H1dat//O +T23LLb2VN3I5xI6Ta5MirdcmrS3ID3KfyI0rn47aGYBROcBTkZTmzNg95S+UzeQc0PzMsNT79uq /nROacdrjGCT3sTHDN/hMq7MkztReJVni+49Vv4M0GkPGw/zJSZrM233bkf6c0Plfg6lZrEpfDKE Y1WJxA3Bk1QwGROs0303p+tdOmw1XNtB1xLaqUkL39iAigmTYo61Zs8liM2EuLE/pDkP2QKe6xJM lXzzawWpXhaDzLhn4ugTncxbgtNMs+1b/97lc6wjOy0AvzVVdAlJ2ElYGn+SNuZRkg7zJn0cTRe8 yexDJtC/QV9AqURE9JnnV4eeUB9XVKg+/XRjL7FQZQnmWEIuQxpMtPAlR1n6BB6T1CZGSlCBst6+ eLf8ZxXhyVeEHg9j1uliutZfVS7qXMYoCAQlObgOK6nyTJccBz8NUvXt7y+CDwIDAQABo0IwQDAd BgNVHQ4EFgQUU3m/WqorSs9UgOHYm8Cd8rIDZsswDgYDVR0PAQH/BAQDAgEGMA8GA1UdEwEB/wQF MAMBAf8wDQYJKoZIhvcNAQEMBQADggIBAFzUfA3P9wF9QZllDHPFUp/L+M+ZBn8b2kMVn54CVVeW FPFSPCeHlCjtHzoBN6J2/FNQwISbxmtOuowhT6KOVWKR82kV2LyI48SqC/3vqOlLVSoGIG1VeCkZ 7l8wXEskEVX/JJpuXior7gtNn3/3ATiUFJVDBwn7YKnuHKsSjKCaXqeYalltiz8I+8jRRa8YFWSQ Eg9zKC7F4iRO/Fjs8PRF/iKz6y+O0tlFYQXBl2+odnKPi4w2r78NBc5xjeambx9spnFixdjQg3IM 8WcRiQycE0xyNN+81XHfqnHd4blsjDwSXWXavVcStkNr/+XeTWYRUc+ZruwXtuhxkYzeSf7dNXGi FSeUHM9h4ya7b6NnJSFd5t0dCy5oGzuCr+yDZ4XUmFF0sbmZgIn/f3gZXHlKYC6SQK5MNyosycdi yA5d9zZbyuAlJQG03RoHnHcAP9Dc1ew91Pq7P8yF1m9/qS3fuQL39ZeatTXaw2ewh0qpKJ4jjv9c J2vhsE/zB+4ALtRZh8tSQZXq9EfX7mRBVXyNWQKV3WKdwrnuWih0hKWbt5DHDAff9Yk2dDLWKMGw sAvgnEzDHNb842m1R0aBL6KCq9NjRHDEjf8tM7qtj3u1cIiuPhnPQCjY/MiQu12ZIvVS5ljFH4gx Q+6IHdfGjjxDah2nGN59PRbxYvnKkKj9 -----END CERTIFICATE----- USERTrust ECC Certification Authority ===================================== -----BEGIN CERTIFICATE----- MIICjzCCAhWgAwIBAgIQXIuZxVqUxdJxVt7NiYDMJjAKBggqhkjOPQQDAzCBiDELMAkGA1UEBhMC VVMxEzARBgNVBAgTCk5ldyBKZXJzZXkxFDASBgNVBAcTC0plcnNleSBDaXR5MR4wHAYDVQQKExVU aGUgVVNFUlRSVVNUIE5ldHdvcmsxLjAsBgNVBAMTJVVTRVJUcnVzdCBFQ0MgQ2VydGlmaWNhdGlv biBBdXRob3JpdHkwHhcNMTAwMjAxMDAwMDAwWhcNMzgwMTE4MjM1OTU5WjCBiDELMAkGA1UEBhMC VVMxEzARBgNVBAgTCk5ldyBKZXJzZXkxFDASBgNVBAcTC0plcnNleSBDaXR5MR4wHAYDVQQKExVU aGUgVVNFUlRSVVNUIE5ldHdvcmsxLjAsBgNVBAMTJVVTRVJUcnVzdCBFQ0MgQ2VydGlmaWNhdGlv biBBdXRob3JpdHkwdjAQBgcqhkjOPQIBBgUrgQQAIgNiAAQarFRaqfloI+d61SRvU8Za2EurxtW2 0eZzca7dnNYMYf3boIkDuAUU7FfO7l0/4iGzzvfUinngo4N+LZfQYcTxmdwlkWOrfzCjtHDix6Ez nPO/LlxTsV+zfTJ/ijTjeXmjQjBAMB0GA1UdDgQWBBQ64QmG1M8ZwpZ2dEl23OA1xmNjmjAOBgNV HQ8BAf8EBAMCAQYwDwYDVR0TAQH/BAUwAwEB/zAKBggqhkjOPQQDAwNoADBlAjA2Z6EWCNzklwBB HU6+4WMBzzuqQhFkoJ2UOQIReVx7Hfpkue4WQrO/isIJxOzksU0CMQDpKmFHjFJKS04YcPbWRNZu 9YO6bVi9JNlWSOrvxKJGgYhqOkbRqZtNyWHa0V1Xahg= -----END CERTIFICATE----- GlobalSign ECC Root CA - R4 =========================== -----BEGIN CERTIFICATE----- MIIB4TCCAYegAwIBAgIRKjikHJYKBN5CsiilC+g0mAIwCgYIKoZIzj0EAwIwUDEkMCIGA1UECxMb R2xvYmFsU2lnbiBFQ0MgUm9vdCBDQSAtIFI0MRMwEQYDVQQKEwpHbG9iYWxTaWduMRMwEQYDVQQD EwpHbG9iYWxTaWduMB4XDTEyMTExMzAwMDAwMFoXDTM4MDExOTAzMTQwN1owUDEkMCIGA1UECxMb R2xvYmFsU2lnbiBFQ0MgUm9vdCBDQSAtIFI0MRMwEQYDVQQKEwpHbG9iYWxTaWduMRMwEQYDVQQD EwpHbG9iYWxTaWduMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEuMZ5049sJQ6fLjkZHAOkrprl OQcJFspjsbmG+IpXwVfOQvpzofdlQv8ewQCybnMO/8ch5RikqtlxP6jUuc6MHaNCMEAwDgYDVR0P AQH/BAQDAgEGMA8GA1UdEwEB/wQFMAMBAf8wHQYDVR0OBBYEFFSwe61FuOJAf/sKbvu+M8k8o4TV MAoGCCqGSM49BAMCA0gAMEUCIQDckqGgE6bPA7DmxCGXkPoUVy0D7O48027KqGx2vKLeuwIgJ6iF JzWbVsaj8kfSt24bAgAXqmemFZHe+pTsewv4n4Q= -----END CERTIFICATE----- GlobalSign ECC Root CA - R5 =========================== -----BEGIN CERTIFICATE----- MIICHjCCAaSgAwIBAgIRYFlJ4CYuu1X5CneKcflK2GwwCgYIKoZIzj0EAwMwUDEkMCIGA1UECxMb R2xvYmFsU2lnbiBFQ0MgUm9vdCBDQSAtIFI1MRMwEQYDVQQKEwpHbG9iYWxTaWduMRMwEQYDVQQD EwpHbG9iYWxTaWduMB4XDTEyMTExMzAwMDAwMFoXDTM4MDExOTAzMTQwN1owUDEkMCIGA1UECxMb R2xvYmFsU2lnbiBFQ0MgUm9vdCBDQSAtIFI1MRMwEQYDVQQKEwpHbG9iYWxTaWduMRMwEQYDVQQD EwpHbG9iYWxTaWduMHYwEAYHKoZIzj0CAQYFK4EEACIDYgAER0UOlvt9Xb/pOdEh+J8LttV7HpI6 SFkc8GIxLcB6KP4ap1yztsyX50XUWPrRd21DosCHZTQKH3rd6zwzocWdTaRvQZU4f8kehOvRnkmS h5SHDDqFSmafnVmTTZdhBoZKo0IwQDAOBgNVHQ8BAf8EBAMCAQYwDwYDVR0TAQH/BAUwAwEB/zAd BgNVHQ4EFgQUPeYpSJvqB8ohREom3m7e0oPQn1kwCgYIKoZIzj0EAwMDaAAwZQIxAOVpEslu28Yx uglB4Zf4+/2a4n0Sye18ZNPLBSWLVtmg515dTguDnFt2KaAJJiFqYgIwcdK1j1zqO+F4CYWodZI7 yFz9SO8NdCKoCOJuxUnOxwy8p2Fp8fc74SrL+SvzZpA3 -----END CERTIFICATE----- Staat der Nederlanden Root CA - G3 ================================== -----BEGIN CERTIFICATE----- MIIFdDCCA1ygAwIBAgIEAJiiOTANBgkqhkiG9w0BAQsFADBaMQswCQYDVQQGEwJOTDEeMBwGA1UE CgwVU3RhYXQgZGVyIE5lZGVybGFuZGVuMSswKQYDVQQDDCJTdGFhdCBkZXIgTmVkZXJsYW5kZW4g Um9vdCBDQSAtIEczMB4XDTEzMTExNDExMjg0MloXDTI4MTExMzIzMDAwMFowWjELMAkGA1UEBhMC TkwxHjAcBgNVBAoMFVN0YWF0IGRlciBOZWRlcmxhbmRlbjErMCkGA1UEAwwiU3RhYXQgZGVyIE5l ZGVybGFuZGVuIFJvb3QgQ0EgLSBHMzCCAiIwDQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIBAL4y olQPcPssXFnrbMSkUeiFKrPMSjTysF/zDsccPVMeiAho2G89rcKezIJnByeHaHE6n3WWIkYFsO2t x1ueKt6c/DrGlaf1F2cY5y9JCAxcz+bMNO14+1Cx3Gsy8KL+tjzk7FqXxz8ecAgwoNzFs21v0IJy EavSgWhZghe3eJJg+szeP4TrjTgzkApyI/o1zCZxMdFyKJLZWyNtZrVtB0LrpjPOktvA9mxjeM3K Tj215VKb8b475lRgsGYeCasH/lSJEULR9yS6YHgamPfJEf0WwTUaVHXvQ9Plrk7O53vDxk5hUUur mkVLoR9BvUhTFXFkC4az5S6+zqQbwSmEorXLCCN2QyIkHxcE1G6cxvx/K2Ya7Irl1s9N9WMJtxU5 1nus6+N86U78dULI7ViVDAZCopz35HCz33JvWjdAidiFpNfxC95DGdRKWCyMijmev4SH8RY7Ngzp 07TKbBlBUgmhHbBqv4LvcFEhMtwFdozL92TkA1CvjJFnq8Xy7ljY3r735zHPbMk7ccHViLVlvMDo FxcHErVc0qsgk7TmgoNwNsXNo42ti+yjwUOH5kPiNL6VizXtBznaqB16nzaeErAMZRKQFWDZJkBE 41ZgpRDUajz9QdwOWke275dhdU/Z/seyHdTtXUmzqWrLZoQT1Vyg3N9udwbRcXXIV2+vD3dbAgMB AAGjQjBAMA8GA1UdEwEB/wQFMAMBAf8wDgYDVR0PAQH/BAQDAgEGMB0GA1UdDgQWBBRUrfrHkleu yjWcLhL75LpdINyUVzANBgkqhkiG9w0BAQsFAAOCAgEAMJmdBTLIXg47mAE6iqTnB/d6+Oea31BD U5cqPco8R5gu4RV78ZLzYdqQJRZlwJ9UXQ4DO1t3ApyEtg2YXzTdO2PCwyiBwpwpLiniyMMB8jPq KqrMCQj3ZWfGzd/TtiunvczRDnBfuCPRy5FOCvTIeuXZYzbB1N/8Ipf3YF3qKS9Ysr1YvY2WTxB1 v0h7PVGHoTx0IsL8B3+A3MSs/mrBcDCw6Y5p4ixpgZQJut3+TcCDjJRYwEYgr5wfAvg1VUkvRtTA 8KCWAg8zxXHzniN9lLf9OtMJgwYh/WA9rjLA0u6NpvDntIJ8CsxwyXmA+P5M9zWEGYox+wrZ13+b 8KKaa8MFSu1BYBQw0aoRQm7TIwIEC8Zl3d1Sd9qBa7Ko+gE4uZbqKmxnl4mUnrzhVNXkanjvSr0r mj1AfsbAddJu+2gw7OyLnflJNZoaLNmzlTnVHpL3prllL+U9bTpITAjc5CgSKL59NVzq4BZ+Extq 1z7XnvwtdbLBFNUjA9tbbws+eC8N3jONFrdI54OagQ97wUNNVQQXOEpR1VmiiXTTn74eS9fGbbeI JG9gkaSChVtWQbzQRKtqE77RLFi3EjNYsjdj3BP1lB0/QFH1T/U67cjF68IeHRaVesd+QnGTbksV tzDfqu1XhUisHWrdOWnk4Xl4vs4Fv6EM94B7IWcnMFk= -----END CERTIFICATE----- Staat der Nederlanden EV Root CA ================================ -----BEGIN CERTIFICATE----- MIIFcDCCA1igAwIBAgIEAJiWjTANBgkqhkiG9w0BAQsFADBYMQswCQYDVQQGEwJOTDEeMBwGA1UE CgwVU3RhYXQgZGVyIE5lZGVybGFuZGVuMSkwJwYDVQQDDCBTdGFhdCBkZXIgTmVkZXJsYW5kZW4g RVYgUm9vdCBDQTAeFw0xMDEyMDgxMTE5MjlaFw0yMjEyMDgxMTEwMjhaMFgxCzAJBgNVBAYTAk5M MR4wHAYDVQQKDBVTdGFhdCBkZXIgTmVkZXJsYW5kZW4xKTAnBgNVBAMMIFN0YWF0IGRlciBOZWRl cmxhbmRlbiBFViBSb290IENBMIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEA48d+ifkk SzrSM4M1LGns3Amk41GoJSt5uAg94JG6hIXGhaTK5skuU6TJJB79VWZxXSzFYGgEt9nCUiY4iKTW O0Cmws0/zZiTs1QUWJZV1VD+hq2kY39ch/aO5ieSZxeSAgMs3NZmdO3dZ//BYY1jTw+bbRcwJu+r 0h8QoPnFfxZpgQNH7R5ojXKhTbImxrpsX23Wr9GxE46prfNeaXUmGD5BKyF/7otdBwadQ8QpCiv8 Kj6GyzyDOvnJDdrFmeK8eEEzduG/L13lpJhQDBXd4Pqcfzho0LKmeqfRMb1+ilgnQ7O6M5HTp5gV XJrm0w912fxBmJc+qiXbj5IusHsMX/FjqTf5m3VpTCgmJdrV8hJwRVXj33NeN/UhbJCONVrJ0yPr 08C+eKxCKFhmpUZtcALXEPlLVPxdhkqHz3/KRawRWrUgUY0viEeXOcDPusBCAUCZSCELa6fS/ZbV 0b5GnUngC6agIk440ME8MLxwjyx1zNDFjFE7PZQIZCZhfbnDZY8UnCHQqv0XcgOPvZuM5l5Tnrmd 74K74bzickFbIZTTRTeU0d8JOV3nI6qaHcptqAqGhYqCvkIH1vI4gnPah1vlPNOePqc7nvQDs/nx fRN0Av+7oeX6AHkcpmZBiFxgV6YuCcS6/ZrPpx9Aw7vMWgpVSzs4dlG4Y4uElBbmVvMCAwEAAaNC MEAwDwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMCAQYwHQYDVR0OBBYEFP6rAJCYniT8qcwa ivsnuL8wbqg7MA0GCSqGSIb3DQEBCwUAA4ICAQDPdyxuVr5Os7aEAJSrR8kN0nbHhp8dB9O2tLsI eK9p0gtJ3jPFrK3CiAJ9Brc1AsFgyb/E6JTe1NOpEyVa/m6irn0F3H3zbPB+po3u2dfOWBfoqSmu c0iH55vKbimhZF8ZE/euBhD/UcabTVUlT5OZEAFTdfETzsemQUHSv4ilf0X8rLiltTMMgsT7B/Zq 5SWEXwbKwYY5EdtYzXc7LMJMD16a4/CrPmEbUCTCwPTxGfARKbalGAKb12NMcIxHowNDXLldRqAN b/9Zjr7dn3LDWyvfjFvO5QxGbJKyCqNMVEIYFRIYvdr8unRu/8G2oGTYqV9Vrp9canaW2HNnh/tN f1zuacpzEPuKqf2evTY4SUmH9A4U8OmHuD+nT3pajnnUk+S7aFKErGzp85hwVXIy+TSrK0m1zSBi 5Dp6Z2Orltxtrpfs/J92VoguZs9btsmksNcFuuEnL5O7Jiqik7Ab846+HUCjuTaPPoIaGl6I6lD4 WeKDRikL40Rc4ZW2aZCaFG+XroHPaO+Zmr615+F/+PoTRxZMzG0IQOeLeG9QgkRQP2YGiqtDhFZK DyAthg710tvSeopLzaXoTvFeJiUBWSOgftL2fiFX1ye8FVdMpEbB4IMeDExNH08GGeL5qPQ6gqGy eUN51q1veieQA6TqJIc/2b3Z6fJfUEkc7uzXLg== -----END CERTIFICATE----- IdenTrust Commercial Root CA 1 ============================== -----BEGIN CERTIFICATE----- MIIFYDCCA0igAwIBAgIQCgFCgAAAAUUjyES1AAAAAjANBgkqhkiG9w0BAQsFADBKMQswCQYDVQQG EwJVUzESMBAGA1UEChMJSWRlblRydXN0MScwJQYDVQQDEx5JZGVuVHJ1c3QgQ29tbWVyY2lhbCBS b290IENBIDEwHhcNMTQwMTE2MTgxMjIzWhcNMzQwMTE2MTgxMjIzWjBKMQswCQYDVQQGEwJVUzES MBAGA1UEChMJSWRlblRydXN0MScwJQYDVQQDEx5JZGVuVHJ1c3QgQ29tbWVyY2lhbCBSb290IENB IDEwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQCnUBneP5k91DNG8W9RYYKyqU+PZ4ld hNlT3Qwo2dfw/66VQ3KZ+bVdfIrBQuExUHTRgQ18zZshq0PirK1ehm7zCYofWjK9ouuU+ehcCuz/ mNKvcbO0U59Oh++SvL3sTzIwiEsXXlfEU8L2ApeN2WIrvyQfYo3fw7gpS0l4PJNgiCL8mdo2yMKi 1CxUAGc1bnO/AljwpN3lsKImesrgNqUZFvX9t++uP0D1bVoE/c40yiTcdCMbXTMTEl3EASX2MN0C XZ/g1Ue9tOsbobtJSdifWwLziuQkkORiT0/Br4sOdBeo0XKIanoBScy0RnnGF7HamB4HWfp1IYVl 3ZBWzvurpWCdxJ35UrCLvYf5jysjCiN2O/cz4ckA82n5S6LgTrx+kzmEB/dEcH7+B1rlsazRGMzy NeVJSQjKVsk9+w8YfYs7wRPCTY/JTw436R+hDmrfYi7LNQZReSzIJTj0+kuniVyc0uMNOYZKdHzV WYfCP04MXFL0PfdSgvHqo6z9STQaKPNBiDoT7uje/5kdX7rL6B7yuVBgwDHTc+XvvqDtMwt0viAg xGds8AgDelWAf0ZOlqf0Hj7h9tgJ4TNkK2PXMl6f+cB7D3hvl7yTmvmcEpB4eoCHFddydJxVdHix uuFucAS6T6C6aMN7/zHwcz09lCqxC0EOoP5NiGVreTO01wIDAQABo0IwQDAOBgNVHQ8BAf8EBAMC AQYwDwYDVR0TAQH/BAUwAwEB/zAdBgNVHQ4EFgQU7UQZwNPwBovupHu+QucmVMiONnYwDQYJKoZI hvcNAQELBQADggIBAA2ukDL2pkt8RHYZYR4nKM1eVO8lvOMIkPkp165oCOGUAFjvLi5+U1KMtlwH 6oi6mYtQlNeCgN9hCQCTrQ0U5s7B8jeUeLBfnLOic7iPBZM4zY0+sLj7wM+x8uwtLRvM7Kqas6pg ghstO8OEPVeKlh6cdbjTMM1gCIOQ045U8U1mwF10A0Cj7oV+wh93nAbowacYXVKV7cndJZ5t+qnt ozo00Fl72u1Q8zW/7esUTTHHYPTa8Yec4kjixsU3+wYQ+nVZZjFHKdp2mhzpgq7vmrlR94gjmmmV YjzlVYA211QC//G5Xc7UI2/YRYRKW2XviQzdFKcgyxilJbQN+QHwotL0AMh0jqEqSI5l2xPE4iUX feu+h1sXIFRRk0pTAwvsXcoz7WL9RccvW9xYoIA55vrX/hMUpu09lEpCdNTDd1lzzY9GvlU47/ro kTLql1gEIt44w8y8bckzOmoKaT+gyOpyj4xjhiO9bTyWnpXgSUyqorkqG5w2gXjtw+hG4iZZRHUe 2XWJUc0QhJ1hYMtd+ZciTY6Y5uN/9lu7rs3KSoFrXgvzUeF0K+l+J6fZmUlO+KWA2yUPHGNiiskz Z2s8EIPGrd6ozRaOjfAHN3Gf8qv8QfXBi+wAN10J5U6A7/qxXDgGpRtK4dw4LTzcqx+QGtVKnO7R cGzM7vRX+Bi6hG6H -----END CERTIFICATE----- IdenTrust Public Sector Root CA 1 ================================= -----BEGIN CERTIFICATE----- MIIFZjCCA06gAwIBAgIQCgFCgAAAAUUjz0Z8AAAAAjANBgkqhkiG9w0BAQsFADBNMQswCQYDVQQG EwJVUzESMBAGA1UEChMJSWRlblRydXN0MSowKAYDVQQDEyFJZGVuVHJ1c3QgUHVibGljIFNlY3Rv ciBSb290IENBIDEwHhcNMTQwMTE2MTc1MzMyWhcNMzQwMTE2MTc1MzMyWjBNMQswCQYDVQQGEwJV UzESMBAGA1UEChMJSWRlblRydXN0MSowKAYDVQQDEyFJZGVuVHJ1c3QgUHVibGljIFNlY3RvciBS b290IENBIDEwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQC2IpT8pEiv6EdrCvsnduTy P4o7ekosMSqMjbCpwzFrqHd2hCa2rIFCDQjrVVi7evi8ZX3yoG2LqEfpYnYeEe4IFNGyRBb06tD6 Hi9e28tzQa68ALBKK0CyrOE7S8ItneShm+waOh7wCLPQ5CQ1B5+ctMlSbdsHyo+1W/CD80/HLaXI rcuVIKQxKFdYWuSNG5qrng0M8gozOSI5Cpcu81N3uURF/YTLNiCBWS2ab21ISGHKTN9T0a9SvESf qy9rg3LvdYDaBjMbXcjaY8ZNzaxmMc3R3j6HEDbhuaR672BQssvKplbgN6+rNBM5Jeg5ZuSYeqoS mJxZZoY+rfGwyj4GD3vwEUs3oERte8uojHH01bWRNszwFcYr3lEXsZdMUD2xlVl8BX0tIdUAvwFn ol57plzy9yLxkA2T26pEUWbMfXYD62qoKjgZl3YNa4ph+bz27nb9cCvdKTz4Ch5bQhyLVi9VGxyh LrXHFub4qjySjmm2AcG1hp2JDws4lFTo6tyePSW8Uybt1as5qsVATFSrsrTZ2fjXctscvG29ZV/v iDUqZi/u9rNl8DONfJhBaUYPQxxp+pu10GFqzcpL2UyQRqsVWaFHVCkugyhfHMKiq3IXAAaOReyL 4jM9f9oZRORicsPfIsbyVtTdX5Vy7W1f90gDW/3FKqD2cyOEEBsB5wIDAQABo0IwQDAOBgNVHQ8B Af8EBAMCAQYwDwYDVR0TAQH/BAUwAwEB/zAdBgNVHQ4EFgQU43HgntinQtnbcZFrlJPrw6PRFKMw DQYJKoZIhvcNAQELBQADggIBAEf63QqwEZE4rU1d9+UOl1QZgkiHVIyqZJnYWv6IAcVYpZmxI1Qj t2odIFflAWJBF9MJ23XLblSQdf4an4EKwt3X9wnQW3IV5B4Jaj0z8yGa5hV+rVHVDRDtfULAj+7A mgjVQdZcDiFpboBhDhXAuM/FSRJSzL46zNQuOAXeNf0fb7iAaJg9TaDKQGXSc3z1i9kKlT/YPyNt GtEqJBnZhbMX73huqVjRI9PHE+1yJX9dsXNw0H8GlwmEKYBhHfpe/3OsoOOJuBxxFcbeMX8S3OFt m6/n6J91eEyrRjuazr8FGF1NFTwWmhlQBJqymm9li1JfPFgEKCXAZmExfrngdbkaqIHWchezxQMx NRF4eKLg6TCMf4DfWN88uieW4oA0beOY02QnrEh+KHdcxiVhJfiFDGX6xDIvpZgF5PgLZxYWxoK4 Mhn5+bl53B/N66+rDt0b20XkeucC4pVd/GnwU2lhlXV5C15V5jgclKlZM57IcXR5f1GJtshquDDI ajjDbp7hNxbqBWJMWxJH7ae0s1hWx0nzfxJoCTFx8G34Tkf71oXuxVhAGaQdp/lLQzfcaFpPz+vC ZHTetBXZ9FRUGi8c15dxVJCO2SCdUyt/q4/i6jC8UDfv8Ue1fXwsBOxonbRJRBD0ckscZOf85muQ 3Wl9af0AVqW3rLatt8o+Ae+c -----END CERTIFICATE----- Entrust Root Certification Authority - G2 ========================================= -----BEGIN CERTIFICATE----- MIIEPjCCAyagAwIBAgIESlOMKDANBgkqhkiG9w0BAQsFADCBvjELMAkGA1UEBhMCVVMxFjAUBgNV BAoTDUVudHJ1c3QsIEluYy4xKDAmBgNVBAsTH1NlZSB3d3cuZW50cnVzdC5uZXQvbGVnYWwtdGVy bXMxOTA3BgNVBAsTMChjKSAyMDA5IEVudHJ1c3QsIEluYy4gLSBmb3IgYXV0aG9yaXplZCB1c2Ug b25seTEyMDAGA1UEAxMpRW50cnVzdCBSb290IENlcnRpZmljYXRpb24gQXV0aG9yaXR5IC0gRzIw HhcNMDkwNzA3MTcyNTU0WhcNMzAxMjA3MTc1NTU0WjCBvjELMAkGA1UEBhMCVVMxFjAUBgNVBAoT DUVudHJ1c3QsIEluYy4xKDAmBgNVBAsTH1NlZSB3d3cuZW50cnVzdC5uZXQvbGVnYWwtdGVybXMx OTA3BgNVBAsTMChjKSAyMDA5IEVudHJ1c3QsIEluYy4gLSBmb3IgYXV0aG9yaXplZCB1c2Ugb25s eTEyMDAGA1UEAxMpRW50cnVzdCBSb290IENlcnRpZmljYXRpb24gQXV0aG9yaXR5IC0gRzIwggEi MA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQC6hLZy254Ma+KZ6TABp3bqMriVQRrJ2mFOWHLP /vaCeb9zYQYKpSfYs1/TRU4cctZOMvJyig/3gxnQaoCAAEUesMfnmr8SVycco2gvCoe9amsOXmXz HHfV1IWNcCG0szLni6LVhjkCsbjSR87kyUnEO6fe+1R9V77w6G7CebI6C1XiUJgWMhNcL3hWwcKU s/Ja5CeanyTXxuzQmyWC48zCxEXFjJd6BmsqEZ+pCm5IO2/b1BEZQvePB7/1U1+cPvQXLOZprE4y TGJ36rfo5bs0vBmLrpxR57d+tVOxMyLlbc9wPBr64ptntoP0jaWvYkxN4FisZDQSA/i2jZRjJKRx AgMBAAGjQjBAMA4GA1UdDwEB/wQEAwIBBjAPBgNVHRMBAf8EBTADAQH/MB0GA1UdDgQWBBRqciZ6 0B7vfec7aVHUbI2fkBJmqzANBgkqhkiG9w0BAQsFAAOCAQEAeZ8dlsa2eT8ijYfThwMEYGprmi5Z iXMRrEPR9RP/jTkrwPK9T3CMqS/qF8QLVJ7UG5aYMzyorWKiAHarWWluBh1+xLlEjZivEtRh2woZ Rkfz6/djwUAFQKXSt/S1mja/qYh2iARVBCuch38aNzx+LaUa2NSJXsq9rD1s2G2v1fN2D807iDgi nWyTmsQ9v4IbZT+mD12q/OWyFcq1rca8PdCE6OoGcrBNOTJ4vz4RnAuknZoh8/CbCzB428Hch0P+ vGOaysXCHMnHjf87ElgI5rY97HosTvuDls4MPGmHVHOkc8KT/1EQrBVUAdj8BbGJoX90g5pJ19xO e4pIb4tF9g== -----END CERTIFICATE----- Entrust Root Certification Authority - EC1 ========================================== -----BEGIN CERTIFICATE----- MIIC+TCCAoCgAwIBAgINAKaLeSkAAAAAUNCR+TAKBggqhkjOPQQDAzCBvzELMAkGA1UEBhMCVVMx FjAUBgNVBAoTDUVudHJ1c3QsIEluYy4xKDAmBgNVBAsTH1NlZSB3d3cuZW50cnVzdC5uZXQvbGVn YWwtdGVybXMxOTA3BgNVBAsTMChjKSAyMDEyIEVudHJ1c3QsIEluYy4gLSBmb3IgYXV0aG9yaXpl ZCB1c2Ugb25seTEzMDEGA1UEAxMqRW50cnVzdCBSb290IENlcnRpZmljYXRpb24gQXV0aG9yaXR5 IC0gRUMxMB4XDTEyMTIxODE1MjUzNloXDTM3MTIxODE1NTUzNlowgb8xCzAJBgNVBAYTAlVTMRYw FAYDVQQKEw1FbnRydXN0LCBJbmMuMSgwJgYDVQQLEx9TZWUgd3d3LmVudHJ1c3QubmV0L2xlZ2Fs LXRlcm1zMTkwNwYDVQQLEzAoYykgMjAxMiBFbnRydXN0LCBJbmMuIC0gZm9yIGF1dGhvcml6ZWQg dXNlIG9ubHkxMzAxBgNVBAMTKkVudHJ1c3QgUm9vdCBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eSAt IEVDMTB2MBAGByqGSM49AgEGBSuBBAAiA2IABIQTydC6bUF74mzQ61VfZgIaJPRbiWlH47jCffHy AsWfoPZb1YsGGYZPUxBtByQnoaD41UcZYUx9ypMn6nQM72+WCf5j7HBdNq1nd67JnXxVRDqiY1Ef 9eNi1KlHBz7MIKNCMEAwDgYDVR0PAQH/BAQDAgEGMA8GA1UdEwEB/wQFMAMBAf8wHQYDVR0OBBYE FLdj5xrdjekIplWDpOBqUEFlEUJJMAoGCCqGSM49BAMDA2cAMGQCMGF52OVCR98crlOZF7ZvHH3h vxGU0QOIdeSNiaSKd0bebWHvAvX7td/M/k7//qnmpwIwW5nXhTcGtXsI/esni0qU+eH6p44mCOh8 kmhtc9hvJqwhAriZtyZBWyVgrtBIGu4G -----END CERTIFICATE----- CFCA EV ROOT ============ -----BEGIN CERTIFICATE----- MIIFjTCCA3WgAwIBAgIEGErM1jANBgkqhkiG9w0BAQsFADBWMQswCQYDVQQGEwJDTjEwMC4GA1UE CgwnQ2hpbmEgRmluYW5jaWFsIENlcnRpZmljYXRpb24gQXV0aG9yaXR5MRUwEwYDVQQDDAxDRkNB IEVWIFJPT1QwHhcNMTIwODA4MDMwNzAxWhcNMjkxMjMxMDMwNzAxWjBWMQswCQYDVQQGEwJDTjEw MC4GA1UECgwnQ2hpbmEgRmluYW5jaWFsIENlcnRpZmljYXRpb24gQXV0aG9yaXR5MRUwEwYDVQQD DAxDRkNBIEVWIFJPT1QwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQDXXWvNED8fBVnV BU03sQ7smCuOFR36k0sXgiFxEFLXUWRwFsJVaU2OFW2fvwwbwuCjZ9YMrM8irq93VCpLTIpTUnrD 7i7es3ElweldPe6hL6P3KjzJIx1qqx2hp/Hz7KDVRM8Vz3IvHWOX6Jn5/ZOkVIBMUtRSqy5J35DN uF++P96hyk0g1CXohClTt7GIH//62pCfCqktQT+x8Rgp7hZZLDRJGqgG16iI0gNyejLi6mhNbiyW ZXvKWfry4t3uMCz7zEasxGPrb382KzRzEpR/38wmnvFyXVBlWY9ps4deMm/DGIq1lY+wejfeWkU7 xzbh72fROdOXW3NiGUgthxwG+3SYIElz8AXSG7Ggo7cbcNOIabla1jj0Ytwli3i/+Oh+uFzJlU9f py25IGvPa931DfSCt/SyZi4QKPaXWnuWFo8BGS1sbn85WAZkgwGDg8NNkt0yxoekN+kWzqotaK8K gWU6cMGbrU1tVMoqLUuFG7OA5nBFDWteNfB/O7ic5ARwiRIlk9oKmSJgamNgTnYGmE69g60dWIol hdLHZR4tjsbftsbhf4oEIRUpdPA+nJCdDC7xij5aqgwJHsfVPKPtl8MeNPo4+QgO48BdK4PRVmrJ tqhUUy54Mmc9gn900PvhtgVguXDbjgv5E1hvcWAQUhC5wUEJ73IfZzF4/5YFjQIDAQABo2MwYTAf BgNVHSMEGDAWgBTj/i39KNALtbq2osS/BqoFjJP7LzAPBgNVHRMBAf8EBTADAQH/MA4GA1UdDwEB /wQEAwIBBjAdBgNVHQ4EFgQU4/4t/SjQC7W6tqLEvwaqBYyT+y8wDQYJKoZIhvcNAQELBQADggIB ACXGumvrh8vegjmWPfBEp2uEcwPenStPuiB/vHiyz5ewG5zz13ku9Ui20vsXiObTej/tUxPQ4i9q ecsAIyjmHjdXNYmEwnZPNDatZ8POQQaIxffu2Bq41gt/UP+TqhdLjOztUmCypAbqTuv0axn96/Ua 4CUqmtzHQTb3yHQFhDmVOdYLO6Qn+gjYXB74BGBSESgoA//vU2YApUo0FmZ8/Qmkrp5nGm9BC2sG E5uPhnEFtC+NiWYzKXZUmhH4J/qyP5Hgzg0b8zAarb8iXRvTvyUFTeGSGn+ZnzxEk8rUQElsgIfX BDrDMlI1Dlb4pd19xIsNER9Tyx6yF7Zod1rg1MvIB671Oi6ON7fQAUtDKXeMOZePglr4UeWJoBjn aH9dCi77o0cOPaYjesYBx4/IXr9tgFa+iiS6M+qf4TIRnvHST4D2G0CvOJ4RUHlzEhLN5mydLIhy PDCBBpEi6lmt2hkuIsKNuYyH4Ga8cyNfIWRjgEj1oDwYPZTISEEdQLpe/v5WOaHIz16eGWRGENoX kbcFgKyLmZJ956LYBws2J+dIeWCKw9cTXPhyQN9Ky8+ZAAoACxGV2lZFA4gKn2fQ1XmxqI1AbQ3C ekD6819kR5LLU7m7Wc5P/dAVUwHY3+vZ5nbv0CO7O6l5s9UCKc2Jo5YPSjXnTkLAdc0Hz+Ys63su -----END CERTIFICATE----- TÜRKTRUST Elektronik Sertifika Hizmet Sağlayıcısı H5 ========================================================= -----BEGIN CERTIFICATE----- MIIEJzCCAw+gAwIBAgIHAI4X/iQggTANBgkqhkiG9w0BAQsFADCBsTELMAkGA1UEBhMCVFIxDzAN BgNVBAcMBkFua2FyYTFNMEsGA1UECgxEVMOcUktUUlVTVCBCaWxnaSDEsGxldGnFn2ltIHZlIEJp bGnFn2ltIEfDvHZlbmxpxJ9pIEhpem1ldGxlcmkgQS7Fni4xQjBABgNVBAMMOVTDnFJLVFJVU1Qg RWxla3Ryb25payBTZXJ0aWZpa2EgSGl6bWV0IFNhxJ9sYXnEsWPEsXPEsSBINTAeFw0xMzA0MzAw ODA3MDFaFw0yMzA0MjgwODA3MDFaMIGxMQswCQYDVQQGEwJUUjEPMA0GA1UEBwwGQW5rYXJhMU0w SwYDVQQKDERUw5xSS1RSVVNUIEJpbGdpIMSwbGV0acWfaW0gdmUgQmlsacWfaW0gR8O8dmVubGnE n2kgSGl6bWV0bGVyaSBBLsWeLjFCMEAGA1UEAww5VMOcUktUUlVTVCBFbGVrdHJvbmlrIFNlcnRp ZmlrYSBIaXptZXQgU2HEn2xhecSxY8Sxc8SxIEg1MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIB CgKCAQEApCUZ4WWe60ghUEoI5RHwWrom/4NZzkQqL/7hzmAD/I0Dpe3/a6i6zDQGn1k19uwsu537 jVJp45wnEFPzpALFp/kRGml1bsMdi9GYjZOHp3GXDSHHmflS0yxjXVW86B8BSLlg/kJK9siArs1m ep5Fimh34khon6La8eHBEJ/rPCmBp+EyCNSgBbGM+42WAA4+Jd9ThiI7/PS98wl+d+yG6w8z5UNP 9FR1bSmZLmZaQ9/LXMrI5Tjxfjs1nQ/0xVqhzPMggCTTV+wVunUlm+hkS7M0hO8EuPbJbKoCPrZV 4jI3X/xml1/N1p7HIL9Nxqw/dV8c7TKcfGkAaZHjIxhT6QIDAQABo0IwQDAdBgNVHQ4EFgQUVpkH HtOsDGlktAxQR95DLL4gwPswDgYDVR0PAQH/BAQDAgEGMA8GA1UdEwEB/wQFMAMBAf8wDQYJKoZI hvcNAQELBQADggEBAJ5FdnsXSDLyOIspve6WSk6BGLFRRyDN0GSxDsnZAdkJzsiZ3GglE9Rc8qPo BP5yCccLqh0lVX6Wmle3usURehnmp349hQ71+S4pL+f5bFgWV1Al9j4uPqrtd3GqqpmWRgqujuwq URawXs3qZwQcWDD1YIq9pr1N5Za0/EKJAWv2cMhQOQwt1WbZyNKzMrcbGW3LM/nfpeYVhDfwwvJl lpKQd/Ct9JDpEXjXk4nAPQu6KfTomZ1yju2dL+6SfaHx/126M2CFYv4HAqGEVka+lgqaE9chTLd8 B59OTj+RdPsnnRHM3eaxynFNExc5JsUpISuTKWqW+qtB4Uu2NQvAmxU= -----END CERTIFICATE----- TÜRKTRUST Elektronik Sertifika Hizmet Sağlayıcısı H6 ========================================================= -----BEGIN CERTIFICATE----- MIIEJjCCAw6gAwIBAgIGfaHyZeyKMA0GCSqGSIb3DQEBCwUAMIGxMQswCQYDVQQGEwJUUjEPMA0G A1UEBwwGQW5rYXJhMU0wSwYDVQQKDERUw5xSS1RSVVNUIEJpbGdpIMSwbGV0acWfaW0gdmUgQmls acWfaW0gR8O8dmVubGnEn2kgSGl6bWV0bGVyaSBBLsWeLjFCMEAGA1UEAww5VMOcUktUUlVTVCBF bGVrdHJvbmlrIFNlcnRpZmlrYSBIaXptZXQgU2HEn2xhecSxY8Sxc8SxIEg2MB4XDTEzMTIxODA5 MDQxMFoXDTIzMTIxNjA5MDQxMFowgbExCzAJBgNVBAYTAlRSMQ8wDQYDVQQHDAZBbmthcmExTTBL BgNVBAoMRFTDnFJLVFJVU1QgQmlsZ2kgxLBsZXRpxZ9pbSB2ZSBCaWxpxZ9pbSBHw7x2ZW5sacSf aSBIaXptZXRsZXJpIEEuxZ4uMUIwQAYDVQQDDDlUw5xSS1RSVVNUIEVsZWt0cm9uaWsgU2VydGlm aWthIEhpem1ldCBTYcSfbGF5xLFjxLFzxLEgSDYwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEK AoIBAQCdsGjW6L0UlqMACprx9MfMkU1xeHe59yEmFXNRFpQJRwXiM/VomjX/3EsvMsew7eKC5W/a 2uqsxgbPJQ1BgfbBOCK9+bGlprMBvD9QFyv26WZV1DOzXPhDIHiTVRZwGTLmiddk671IUP320EED wnS3/faAz1vFq6TWlRKb55cTMgPp1KtDWxbtMyJkKbbSk60vbNg9tvYdDjTu0n2pVQ8g9P0pu5Fb HH3GQjhtQiht1AH7zYiXSX6484P4tZgvsycLSF5W506jM7NE1qXyGJTtHB6plVxiSvgNZ1GpryHV +DKdeboaX+UEVU0TRv/yz3THGmNtwx8XEsMeED5gCLMxAgMBAAGjQjBAMB0GA1UdDgQWBBTdVRcT 9qzoSCHK77Wv0QAy7Z6MtTAOBgNVHQ8BAf8EBAMCAQYwDwYDVR0TAQH/BAUwAwEB/zANBgkqhkiG 9w0BAQsFAAOCAQEAb1gNl0OqFlQ+v6nfkkU/hQu7VtMMUszIv3ZnXuaqs6fvuay0EBQNdH49ba3R fdCaqaXKGDsCQC4qnFAUi/5XfldcEQlLNkVS9z2sFP1E34uXI9TDwe7UU5X+LEr+DXCqu4svLcsy o4LyVN/Y8t3XSHLuSqMplsNEzm61kod2pLv0kmzOLBQJZo6NrRa1xxsJYTvjIKIDgI6tflEATseW hvtDmHd9KMeP2Cpu54Rvl0EpABZeTeIT6lnAY2c6RPuY/ATTMHKm9ocJV612ph1jmv3XZch4gyt1 O6VbuA1df74jrlZVlFjvH4GMKrLN5ptjnhi85WsGtAuYSyher4hYyw== -----END CERTIFICATE----- Certinomis - Root CA ==================== -----BEGIN CERTIFICATE----- MIIFkjCCA3qgAwIBAgIBATANBgkqhkiG9w0BAQsFADBaMQswCQYDVQQGEwJGUjETMBEGA1UEChMK Q2VydGlub21pczEXMBUGA1UECxMOMDAwMiA0MzM5OTg5MDMxHTAbBgNVBAMTFENlcnRpbm9taXMg LSBSb290IENBMB4XDTEzMTAyMTA5MTcxOFoXDTMzMTAyMTA5MTcxOFowWjELMAkGA1UEBhMCRlIx EzARBgNVBAoTCkNlcnRpbm9taXMxFzAVBgNVBAsTDjAwMDIgNDMzOTk4OTAzMR0wGwYDVQQDExRD ZXJ0aW5vbWlzIC0gUm9vdCBDQTCCAiIwDQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIBANTMCQos P5L2fxSeC5yaah1AMGT9qt8OHgZbn1CF6s2Nq0Nn3rD6foCWnoR4kkjW4znuzuRZWJflLieY6pOo d5tK8O90gC3rMB+12ceAnGInkYjwSond3IjmFPnVAy//ldu9n+ws+hQVWZUKxkd8aRi5pwP5ynap z8dvtF4F/u7BUrJ1Mofs7SlmO/NKFoL21prbcpjp3vDFTKWrteoB4owuZH9kb/2jJZOLyKIOSY00 8B/sWEUuNKqEUL3nskoTuLAPrjhdsKkb5nPJWqHZZkCqqU2mNAKthH6yI8H7KsZn9DS2sJVqM09x RLWtwHkziOC/7aOgFLScCbAK42C++PhmiM1b8XcF4LVzbsF9Ri6OSyemzTUK/eVNfaoqoynHWmgE 6OXWk6RiwsXm9E/G+Z8ajYJJGYrKWUM66A0ywfRMEwNvbqY/kXPLynNvEiCL7sCCeN5LLsJJwx3t FvYk9CcbXFcx3FXuqB5vbKziRcxXV4p1VxngtViZSTYxPDMBbRZKzbgqg4SGm/lg0h9tkQPTYKbV PZrdd5A9NaSfD171UkRpucC63M9933zZxKyGIjK8e2uR73r4F2iw4lNVYC2vPsKD2NkJK/DAZNuH i5HMkesE/Xa0lZrmFAYb1TQdvtj/dBxThZngWVJKYe2InmtJiUZ+IFrZ50rlau7SZRFDAgMBAAGj YzBhMA4GA1UdDwEB/wQEAwIBBjAPBgNVHRMBAf8EBTADAQH/MB0GA1UdDgQWBBTvkUz1pcMw6C8I 6tNxIqSSaHh02TAfBgNVHSMEGDAWgBTvkUz1pcMw6C8I6tNxIqSSaHh02TANBgkqhkiG9w0BAQsF AAOCAgEAfj1U2iJdGlg+O1QnurrMyOMaauo++RLrVl89UM7g6kgmJs95Vn6RHJk/0KGRHCwPT5iV WVO90CLYiF2cN/z7ZMF4jIuaYAnq1fohX9B0ZedQxb8uuQsLrbWwF6YSjNRieOpWauwK0kDDPAUw Pk2Ut59KA9N9J0u2/kTO+hkzGm2kQtHdzMjI1xZSg081lLMSVX3l4kLr5JyTCcBMWwerx20RoFAX lCOotQqSD7J6wWAsOMwaplv/8gzjqh8c3LigkyfeY+N/IZ865Z764BNqdeuWXGKRlI5nU7aJ+BIJ y29SWwNyhlCVCNSNh4YVH5Uk2KRvms6knZtt0rJ2BobGVgjF6wnaNsIbW0G+YSrjcOa4pvi2WsS9 Iff/ql+hbHY5ZtbqTFXhADObE5hjyW/QASAJN1LnDE8+zbz1X5YnpyACleAu6AdBBR8Vbtaw5Bng DwKTACdyxYvRVB9dSsNAl35VpnzBMwQUAR1JIGkLGZOdblgi90AMRgwjY/M50n92Uaf0yKHxDHYi I0ZSKS3io0EHVmmY0gUJvGnHWmHNj4FgFU2A3ZDifcRQ8ow7bkrHxuaAKzyBvBGAFhAn1/DNP3nM cyrDflOR1m749fPH0FFNjkulW+YZFzvWgQncItzujrnEj1PhZ7szuIgVRs/taTX/dQ1G885x4cVr hkIGuUE= -----END CERTIFICATE----- ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������darwin-perl-lib/Mac/PropertyList/�������������������������������������������������������������������000755 �000765 �000024 �00000000000 13167163507 021144� 5����������������������������������������������������������������������������������������������������ustar�00ocsinventory��������������������staff���������������������������000000 �000000 ������������������������������������������������������������������������������������������������������������������������������������������������������������������������darwin-perl-lib/Mac/PropertyList.pm�����������������������������������������������������������������000444 �000765 �000024 �00000047531 13167163507 021512� 0����������������������������������������������������������������������������������������������������ustar�00ocsinventory��������������������staff���������������������������000000 �000000 ������������������������������������������������������������������������������������������������������������������������������������������������������������������������package Mac::PropertyList; use strict; use warnings; no warnings; use vars qw($ERROR $XML_head $XML_foot $VERSION @EXPORT_OK %EXPORT_TAGS); use Carp qw(croak carp); use Data::Dumper; use XML::Entities; use parent qw(Exporter); @EXPORT_OK = qw( parse_plist parse_plist_fh parse_plist_file plist_as_string create_from_hash create_from_array ); %EXPORT_TAGS = ( 'all' => \@EXPORT_OK, ); $VERSION = '1.412'; =encoding utf8 =head1 NAME Mac::PropertyList - work with Mac plists at a low level =head1 SYNOPSIS use Mac::PropertyList qw(:all); my $data = parse_plist( $text ); my $perl = $data->as_perl; # == OR == my $data = parse_plist_file( $filename ); # == OR == open my( $fh ), $filename or die "..."; my $data = parse_plist_fh( $fh ); my $text = plist_as_string( $data ); my $plist = create_from_hash( \%hash ); my $plist = create_from_array( \@array ); my $plist = Mac::PropertyList::dict->new( \%hash ); my $perl = $plist->as_perl; =head1 DESCRIPTION This module is a low-level interface to the Mac OS X Property List (plist) format in either XML or binary. You probably shouldn't use this in applications–build interfaces on top of this so you don't have to put all the heinous multi-level object stuff where people have to look at it. You can parse a plist file and get back a data structure. You can take that data structure and get back the plist as XML. If you want to change the structure inbetween that's your business. :) You don't need to be on Mac OS X to use this. It simply parses and manipulates a text format that Mac OS X uses. If you need to work with the old ASCII or newer JSON formet, you can use the B<plutil> tool that comes with MacOS X: % plutil -convert xml1 -o ExampleBinary.xml.plist ExampleBinary.plist Or, you can extend this module to handle those formats (and send a pull request). =head2 The Property List format The MacOS X Property List format is simple XML. You can read the DTD to get the details. http://www.apple.com/DTDs/PropertyList-1.0.dtd One big problem exists—its dict type uses a flat structure to list keys and values so that values are only associated with their keys by their position in the file rather than by the structure of the DTD. This problem is the major design hinderance in this module. A smart XML format would have made things much easier. If the parse_plist encounters an empty key tag in a dict structure (i.e. C<< <key></key> >> ) the function croaks. =head2 The Mac::PropertyList classes A plist can have one or more of any of the plist objects, and we have to remember the type of thing so we can go back to the XML format. Perl treats numbers and strings the same, but the plist format doesn't. Therefore, everything C<Mac::PropertyList> creates is an object of some sort. Container objects like C<Mac::PropertyList::array> and C<Mac::PropertyList::dict> hold other objects. There are several types of objects: Mac::PropertyList::string Mac::PropertyList::data Mac::PropertyList::real Mac::PropertyList::integer Mac::PropertyList::date Mac::PropertyList::array Mac::PropertyList::dict Mac::PropertyList::true Mac::PropertyList::false Note that the Xcode property list editor abstracts the C<true> and C<false> objects as just C<Boolean>. They are separate tags in the plist format though. =over 4 =item new( VALUE ) Create the object. =item value Access the value of the object. At the moment you cannot change the value =item type Access the type of the object (string, data, etc) =item write Create a string version of the object, recursively if necessary. =item as_perl Turn the plist data structure, which is decorated with extra information, into a lean Perl data structure without the value type information or blessed objects. =back =cut my $Debug = $ENV{PLIST_DEBUG} || 0; $XML_head =<<"XML"; <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> XML $XML_foot =<<"XML"; </plist> XML my %Readers = ( "dict" => \&read_dict, "string" => \&read_string, "date" => \&read_date, "real" => \&read_real, "integer" => \&read_integer, "array" => \&read_array, "data" => \&read_data, "true" => \&read_true, "false" => \&read_false, ); my $Options = {ignore => ['<true/>', '<false/>']}; =head1 FUNCTIONS These functions are available for individual or group import. Nothing will be imported unless you ask for it. use Mac::PropertyList qw( parse_plist ); use Mac::PropertyList qw( :all ); =over 4 =item parse_plist( TEXT ) Parse the XML plist in TEXT and return the C<Mac::PropertyList> object. =cut # This will change to parse_plist_ref when we create the dispatcher sub parse_plist { my $text = shift; my $plist = do { if( $text =~ /\A<\?xml/ ) { # XML plists $text =~ s/<!--(?:[\d\D]*?)-->//g; # we can handle either 0.9 or 1.0 $text =~ s|^<\?xml.*?>\s*<!DOC.*>\s*<plist.*?>\s*||; $text =~ s|\s*</plist>\s*$||; my $text_source = Mac::PropertyList::TextSource->new( $text ); read_next( $text_source ); } elsif( $text =~ /\Abplist/ ) { # binary plist require Mac::PropertyList::ReadBinary; my $parser = Mac::PropertyList::ReadBinary->new( \$text ); $parser->plist; } else { croak( "This doesn't look like a valid plist format!" ); } }; } =item parse_plist_fh( FILEHANDLE ) Parse the XML plist from FILEHANDLE and return the C<Mac::PropertyList> data structure. Returns false if the arguments is not a reference. You can do this in a couple of ways. You can open the file with a lexical filehandle (since Perl 5.6). open my( $fh ), $file or die "..."; parse_plist_fh( $fh ); Or, you can use a bareword filehandle and pass a reference to its typeglob. I don't recommmend this unless you are using an older Perl. open FILE, $file or die "..."; parse_plist_fh( \*FILE ); =cut sub parse_plist_fh { my $fh = shift; my $text = do { local $/; <$fh> }; parse_plist( $text ); } =item parse_plist_file( FILE_PATH ) Parse the XML plist in FILE_PATH and return the C<Mac::PropertyList> data structure. Returns false if the file does not exist. Alternately, you can pass a filehandle reference, but that just calls C<parse_plist_fh> for you. =cut sub parse_plist_file { my $file = shift; if( ref $file ) { return parse_plist_fh( $file ) } unless( -e $file ) { croak( "parse_plist_file: file [$file] does not exist!" ); return; } my $text = do { local $/; open my($fh), $file; <$fh> }; parse_plist( $text ); } =item create_from_hash( HASH_REF ) Create a plist dictionary from the hash reference. The values of the hash can only be simple scalars–not references. Reference values are silently ignored. Returns a string representing the hash in the plist format. =cut sub create_from_hash { my $hash = shift; return unless UNIVERSAL::isa( $hash, 'HASH' ); my $string = "$XML_head" . Mac::PropertyList::dict->write_open . "\n"; foreach my $key ( keys %$hash ) { next if ref $hash->{$key}; my $bit = Mac::PropertyList::dict->write_key( $key ) . "\n"; my $value = Mac::PropertyList::string->new( $hash->{$key} ); $bit .= $value->write . "\n"; $bit =~ s/^/\t/gm; $string .= $bit; } $string .= Mac::PropertyList::dict->write_close . "\n$XML_foot"; return $string; } =item create_from_array( ARRAY_REF ) Create a plist array from the array reference. The values of the array can only be simple scalars–not references. Reference values are silently ignored. Returns a string representing the array in the plist format. =cut sub create_from_array { my $array = shift; return unless UNIVERSAL::isa( $array, 'ARRAY' ); my $string = "$XML_head" . Mac::PropertyList::array->write_open . "\n"; foreach my $element ( @$array ) { my $value = Mac::PropertyList::string->new( $element ); my $bit .= $value->write . "\n"; $bit =~ s/^/\t/gm; $string .= $bit; } $string .= Mac::PropertyList::array->write_close . "\n$XML_foot"; return $string; } =item read_string =item read_data =item read_integer =item read_date =item read_real =item read_true =item read_false Reads a certain sort of property list data =cut sub read_string { Mac::PropertyList::string ->new( XML::Entities::decode( 'all', $_[0] ) ) } sub read_integer { Mac::PropertyList::integer->new( $_[0] ) } sub read_date { Mac::PropertyList::date ->new( $_[0] ) } sub read_real { Mac::PropertyList::real ->new( $_[0] ) } sub read_true { Mac::PropertyList::true ->new } sub read_false { Mac::PropertyList::false ->new } =item read_next Read the next data item =cut sub read_next { my $source = shift; local $_ = ''; my $value; while( not defined $value ) { croak "Couldn't read anything!" if $source->eof; $_ .= $source->get_line; if( s[^\s* < (string|date|real|integer|data) > \s*(.*?)\s* </\1> ][]sx ) { $value = $Readers{$1}->( $2 ); } elsif( s[^\s* < (dict|array) > ][]x ) { # We need to put back the unprocessed text if # any because the <dict> and <array> readers # need to see it. $source->put_line( $_ ) if defined $_ && '' ne $_; $_ = ''; $value = $Readers{$1}->( $source ); } # these next two are some wierd cases i found in the iPhoto Prefs elsif( s[^\s* < dict / > ][]x ) { $value = Mac::PropertyList::dict->new(); } elsif( s[^\s* < array / > ][]x ) { $value = Mac::PropertyList::array->new(); } elsif( s[^\s* < (true|false) /> ][]x ) { $value = $Readers{$1}->(); } } $source->put_line($_); return $value; } =item read_dict Read a dictionary =cut sub read_dict { my $source = shift; my %hash; local $_ = $source->get_line; while( not s|^\s*</dict>|| ) { my $key; while (not defined $key) { if (s[^\s*<key>(.*?)</key>][]s) { $key = $1; # Bring this back if you want this behavior: # croak "Key is empty string!" if $key eq ''; } else { croak "Could not read key!" if $source->eof; $_ .= $source->get_line; } } $source->put_line( $_ ); $hash{ $key } = read_next( $source ); $_ = $source->get_line; } $source->put_line( $_ ); return Mac::PropertyList::dict->new( \%hash ); } =item read_array Read an array =cut sub read_array { my $source = shift; my @array = (); local $_ = $source->get_line; while( not s|^\s*</array>|| ) { $source->put_line( $_ ); push @array, read_next( $source ); $_ = $source->get_line; } $source->put_line( $_ ); return Mac::PropertyList::array->new( \@array ); } sub read_data { my $string = shift; require MIME::Base64; $string = MIME::Base64::decode_base64($string); return Mac::PropertyList::data->new( $string ); } =item plist_as_string Return the plist data structure as XML in the Mac Property List format. =cut sub plist_as_string { my $object = CORE::shift; my $string = $XML_head; $string .= $object->write . "\n"; $string .= $XML_foot; return $string; } =item plist_as_perl Return the plist data structure as an unblessed Perl data structure. There won't be any C<Mac::PropertyList> objects in the results. This is really just C<as_perl>. =cut sub plist_as_perl { $_[0]->as_perl } # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # package Mac::PropertyList::Source; sub new { my $self = bless { buffer => [], source => $_[1] }, $_[0]; return $self; } sub eof { (not @{$_[0]->{buffer}}) and $_[0]->source_eof } sub get_line { my $self = CORE::shift; # I'm not particularly happy with what I wrote here, but that's why # you shouldn't write your own buffering code! I might have left over # text in the buffer. This could be stuff a higher level looked at and # put back with put_line. If there's text there, grab that. # # But here's the tricky part. If that next part of the text looks like # a "blank" line, grab the next next thing and append that. # # And, if there's nothing in the buffer, ask for more text from # get_source_line. Follow the same rules. IF you get back something that # looks like a blank line, ask for another and append it. # # This means that a returned line might have come partially from the # buffer and partially from a fresh read. # # At some point you should have something that doesn't look like a # blank line and the while() will break out. Return what you do. # # Previously, I wasn't appending to $_ so newlines were disappearing # as each next read replaced the value in $_. Yuck. local $_ = ''; while (defined $_ && /^[\r\n\s]*$/) { if( @{$self->{buffer}} ) { $_ .= shift @{$self->{buffer}}; } else { $_ .= $self->get_source_line; } } return $_; } sub put_line { unshift @{$_[0]->{buffer}}, $_[1] } # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # package Mac::PropertyList::LineListSource; use base qw(Mac::PropertyList::Source); sub get_source_line { return shift @{$_->{source}} if @{$_->{source}} } sub source_eof { not @{$_[0]->{source}} } # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # package Mac::PropertyList::TextSource; use base qw(Mac::PropertyList::Source); sub get_source_line { my $self = CORE::shift; $self->{source} =~ s/(.*(\r|\n|$))//; $1; } sub source_eof { not $_[0]->{source} } # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # package Mac::PropertyList::Item; sub type_value { ( $_[0]->type, $_[0]->value ) } sub value { my $ref = $_[0]->type; do { if( $ref eq 'array' ) { wantarray ? @{ $_[0] } : $_[0] } elsif( $ref eq 'dict' ) { wantarray ? %{ $_[0] } : $_[0] } else { ${ $_[0] } } }; } sub type { my $r = ref $_[0] ? ref $_[0] : $_[0]; $r =~ s/.*:://; $r; } sub new { bless $_[1], $_[0] } sub write_open { $_[0]->write_either(); } sub write_close { $_[0]->write_either('/'); } sub write_either { my $slash = defined $_[1] ? '/' : ''; my $type = $_[0]->type; "<$slash$type>"; } sub write_empty { my $type = $_[0]->type; "<$type/>"; } # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # package Mac::PropertyList::Container; use base qw(Mac::PropertyList::Item); sub new { my $class = CORE::shift; my $item = CORE::shift; if( ref $item ) { return bless $item, $class; } my $empty = do { if( $class =~ m/array$/ ) { [] } elsif( $class =~ m/dict$/ ) { {} } }; $class->SUPER::new( $empty ); } # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # package Mac::PropertyList::array; use base qw(Mac::PropertyList::Container); sub shift { CORE::shift @{ $_[0]->value } } sub unshift { } sub pop { CORE::pop @{ $_[0]->value } } sub push { } sub splice { } sub count { return scalar @{ $_[0]->value } } sub _elements { @{ $_[0]->value } } # the raw, unprocessed elements sub values { my @v = map { $_->value } $_[0]->_elements; wantarray ? @v : \@v } sub as_basic_data { my $self = CORE::shift; return [ map { eval { $_->can('as_basic_data') } ? $_->as_basic_data : $_ } @$self ]; } sub write { my $self = CORE::shift; my $string = $self->write_open . "\n"; foreach my $element ( @$self ) { my $bit = $element->write; $bit =~ s/^/\t/gm; $string .= $bit . "\n"; } $string .= $self->write_close; return $string; } sub as_perl { my $self = CORE::shift; my @array = map { $_->as_perl } $self->_elements; return \@array; } # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # package Mac::PropertyList::dict; use base qw(Mac::PropertyList::Container); sub new { $_[0]->SUPER::new( $_[1] ); } sub delete { delete ${ $_[0]->value }{$_[1]} } sub exists { exists ${ $_[0]->value }{$_[1]} ? 1 : 0 } sub count { scalar CORE::keys %{ $_[0]->value } } sub value { my $self = shift; my $key = shift; do { if( defined $key ) { my $hash = $self->SUPER::value; if( exists $hash->{$key} ) { $hash->{$key}->value } else { return } } else { $self->SUPER::value } }; } sub keys { my @k = CORE::keys %{ $_[0]->value }; wantarray ? @k : \@k; } sub values { my @v = map { $_->value } CORE::values %{ $_[0]->value }; wantarray ? @v : \@v; } sub as_basic_data { my $self = shift; my %dict = map { my ($k, $v) = ($_, $self->{$_}); $k => eval { $v->can('as_basic_data') } ? $v->as_basic_data : $v } CORE::keys %$self; return \%dict; } sub write_key { "<key>$_[1]</key>" } sub write { my $self = shift; my $string = $self->write_open . "\n"; foreach my $key ( $self->keys ) { my $element = $self->{$key}; my $bit = __PACKAGE__->write_key( $key ) . "\n"; $bit .= $element->write . "\n"; $bit =~ s/^/\t/gm; $string .= $bit; } $string .= $self->write_close; return $string; } sub as_perl { my $self = CORE::shift; my %dict = map { my $v = $self->value($_); $v = $v->as_perl if eval { $v->can( 'as_perl' ) }; $_, $v } $self->keys; return \%dict; } # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # package Mac::PropertyList::Scalar; use base qw(Mac::PropertyList::Item); sub new { my $copy = $_[1]; $_[0]->SUPER::new( \$copy ) } sub as_basic_data { $_[0]->value } sub write { $_[0]->write_open . $_[0]->value . $_[0]->write_close } sub as_perl { $_[0]->value } # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # package Mac::PropertyList::date; use base qw(Mac::PropertyList::Scalar); # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # package Mac::PropertyList::real; use base qw(Mac::PropertyList::Scalar); # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # package Mac::PropertyList::integer; use base qw(Mac::PropertyList::Scalar); # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # package Mac::PropertyList::string; use base qw(Mac::PropertyList::Scalar); # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # package Mac::PropertyList::ustring; use base qw(Mac::PropertyList::Scalar); # XXX need to do some fancy unicode checking here # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # package Mac::PropertyList::data; use base qw(Mac::PropertyList::Scalar); sub write { my $self = shift; my $type = $self->type; my $value = $self->value; require MIME::Base64; my $string = MIME::Base64::encode_base64($value); $self->write_open . $string . $self->write_close; } # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # package Mac::PropertyList::Boolean; use base qw(Mac::PropertyList::Item); sub new { my $class = shift; my( $type ) = $class =~ m/.*::(.*)/g; $class->either( $type ); } sub either { my $copy = $_[1]; bless \$copy, $_[0] } sub write { $_[0]->write_empty } # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # package Mac::PropertyList::true; use base qw(Mac::PropertyList::Boolean); # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # package Mac::PropertyList::false; use base qw(Mac::PropertyList::Boolean); =back =head1 SOURCE AVAILABILITY This project is in Github: git://github.com/briandfoy/mac-propertylist.git =head1 CREDITS Thanks to Chris Nandor for general Mac kung fu and Chad Walker for help figuring out the recursion for nested structures. Mike Ciul provided some classes for the different input modes, and these allow us to optimize the parsing code for each of those. Ricardo Signes added the C<as_basic_types()> methods so you can dump all the plist junk and just play with the data. =head1 TO DO * change the value of an object * validate the values of objects (date, integer) * methods to add to containers (dict, array) * do this from a filehandle or a scalar reference instead of a scalar + generate closures to handle the work. =head1 AUTHOR brian d foy, C<< <bdfoy@cpan.org> >> =head1 COPYRIGHT AND LICENSE Copyright © 2004-2015, brian d foy <bdfoy@cpan.org>. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. =head1 SEE ALSO http://www.apple.com/DTDs/PropertyList-1.0.dtd =cut "See why 1984 won't be like 1984"; �����������������������������������������������������������������������������������������������������������������������������������������������������������������������darwin-perl-lib/Mac/SysProfile.pm�������������������������������������������������������������������000444 �000765 �000024 �00000016040 13167163507 021120� 0����������������������������������������������������������������������������������������������������ustar�00ocsinventory��������������������staff���������������������������000000 �000000 ������������������������������������������������������������������������������������������������������������������������������������������������������������������������package Mac::SysProfile; use strict; use warnings; use Mac::PropertyList (); use Scalar::Util (); our $VERSION = '0.05'; my %conf = ( 'bin' => 'system_profiler', 'lst' => '-listDataTypes', 'sfw' => 'SPSoftwareDataType', 'sfx' => 'os_overview', 'osx' => 'os_version', 'drw' => 'kernel_version', 'xml' => '-xml', ); my %types; sub new { bless {}, shift } sub types { my $pro = shift; for (`$conf{bin} $conf{lst}`) { next if m/:/; chomp; $pro->{$_} = undef unless exists $pro->{$_}; $types{$_} = 1; } return [ keys %types ]; } sub gettype { my ( $pro, $typ, $fre ) = @_; $pro->types() unless exists $types{$typ}; if ( !exists $types{$typ} ) { delete $pro->{$typ}; return; } return $pro->{$typ} if $pro->{$typ} && !$fre; my $data = Mac::PropertyList::parse_plist( $pro->xml($typ) ); my $items = $data->[0]{_items}; # Workaround for types that have multiples (e.g. SPMemoryDataType) if ( defined $items->[0] && exists $items->[0]{'_items'} ) { $items = $items->[0]{'_items'}; } my $hdr; foreach my $item ( @{$items} ) { my $res; my $name = ''; # not used to keep from making the already complex structure arbitrarily more complex # would also need done in _structify_val() # my $name = delete $item->{'_name'} || ''; # if ( ref($name) ) { # $name = $name->value(); # } while ( my ( $key, $value ) = each %{$item} ) { my $val = $value->value(); my $end_val; if ( ref($val) ) { $end_val = $val->value(); } else { $end_val = $val; } if ($name) { $res->{$name}{$key} = _structify_val($end_val); } else { $res->{$key} = _structify_val($end_val); } } push @{ $pro->{$typ} }, $res; } $pro->{$typ} ||= []; return $pro->{$typ}; } # recursive fixer upper: Storable::dclone() does not do it, Mac::PropertyList::plist_as_perl() does not seem to work-patches welcome! sub _structify_val { my ($val) = @_; my $ref = Scalar::Util::reftype($val); return $val if !$ref; if ( $ref eq 'ARRAY' ) { my @arr; for my $item ( @{$val} ) { push @arr, _structify_val($item); } return \@arr; } elsif ( $ref eq 'SCALAR' ) { return $val->value(); } elsif ( $ref eq 'HASH' ) { my %hsh; while ( my ( $k, $v ) = each %{$val} ) { $hsh{$k} = _structify_val($v); } return \%hsh; } else { die "Do not know $ref"; } } sub osx { my $pro = shift; my $fre = shift || ''; return $pro->{_osx_version} if $pro->{_osx} && !$fre; $pro->gettype( $conf{sfw}, $fre ); ( $pro->{_osx_version} ) = $pro->{ $conf{sfw} }->{ $conf{sfx} }->{ $conf{osx} } =~ m/\s(\d+(\.\d+)*)\D/; return $pro->{_osx_version}; } sub darwin { my $pro = shift; my $fre = shift || ''; return $pro->{_darwin_version} if $pro->{_darwin_version} && !$fre; $pro->gettype( $conf{sfw}, $fre ); ( $pro->{_darwin_version} ) = $pro->{ $conf{sfw} }->{ $conf{sfx} }->{ $conf{drw} } =~ m/\s(\d+(\.\d+)*)\D/; return $pro->{_darwin_version}; } sub state_hashref { my $pro = shift; my %x = %{$pro}; return \%x; } sub xml { my $pro = shift; my $key = shift; my $fh = shift || ''; my $raw = exists $types{$key} ? `$conf{'bin'} $conf{'xml'} $key` : undef; print $fh $raw if ref $fh eq 'GLOB' && defined $raw; if ( $fh && !ref $fh ) { open XML, ">$fh" or return; print XML $raw; close XML; } return $raw; } 1; __END__ =head1 NAME Mac::SysProfile - Perl extension for OS X system_profiler =head1 SYNOPSIS use Mac::SysProfile; my $pro = Mac::SysProfile->new(); print 'OS X Version ' . $pro->osx() . "\n"; print 'Darwin Version ' . $pro->darwin() . "\n"; =head1 DESCRIPTION OO interface to your Mac's system_profiler =head1 METHODS =head2 $pro->types() Returns an array ref of the datatypes available use for $pro->gettype() =head2 $pro->gettype() Returns a data structure of the given type's data. my $soft = $pro->gettype('SPSoftwareDataType'); Once you call it for a type it returns the cached data on the next call unless the second argument is true. my $soft = $pro->gettype('SPSoftwareDataType',1); The data structure is an array ref of hashes. These hashes can be arbitrarily complex. A hash at any point in that structure may or may not have a '_name' key. It is left in place to keep from making the already complex structure arbitrarily more complex. Use it or ignore it as appropriate to your needs. =head2 $pro->osx() Returns the system's OSX version. The first time it is called it finds it and stores it in the object for less overhead: if($pro->osx() eq '10.3.9') { # initially finds it print 'Do you want to upgrade from ' . $pro->osx() . "\n"; # already processed so it returns the cached value (IE Fast) } print 'Your current version is: ' . $por->osx() . "\n"; # already processed so it returns the cached value (IE Fast) You can make it reprocess and find it again fresh by giving it a true value: if($pro->osx() eq '10.3.9') { # initially finds it print 'Do you want to upgrade from ' . $pro->osx(1) . "\n"; # finds it again from scratch instead of the cached value (IE slower) } print 'Your current version is: ' . $por->osx(1) . "\n"; # finds it again from scratch instead of the cached value (IE slower) =head2 $pro->darwin() Same useage as $pro->osx() but returns the version of the system's Darwin. =head2 $pro->state_hashref() Returns a hashref of the entire object so far. Anything that has not been called it undef. =head2 $pro->xml() Returns an xml document of the type specified. An optional file handle or file to write the output to can be specified as the second argument. If you put it in a file that has a .spx extension then it will be an XML file which can be opened by System Profiler.app my $raw = $pro->xml('SPSoftwareDataType'); $pro->xml('SPSoftwareDataType','./software.spx') or die "Could not create xml file: $!"; $pro->xml('SPSoftwareDataType',\*FH); =head1 SAMPLE # create xml files for each type in ./10.3.9/ use Mac::SysProfile; my $pro = Mac::SysProfile->new(); mkdir $pro->osx() or die "Could not mkdir: $!" if !-d $pro->osx(); for(@{ $pro->types() }) { $pro->xml($_, $pro->osx() . "/$_.spx") or warn "$_.spx failed: $!"; } =head1 Pre v0.04 caveat The data structure format is changed in 0.04 since parsing the non-XML output reliably is impossible (but seems to work fine at first glance). =head1 MISC It doesn't currently use the "detailLevel" option. =head1 AUTHOR Daniel Muey, L<http://drmuey.com/cpan_contact.pl> =head1 COPYRIGHT AND LICENSE Copyright 2005 by Daniel Muey This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. =cut ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������darwin-perl-lib/Mac/PropertyList/ReadBinary.pm������������������������������������������������������000444 �000765 �000024 �00000020661 13167163507 023525� 0����������������������������������������������������������������������������������������������������ustar�00ocsinventory��������������������staff���������������������������000000 �000000 ������������������������������������������������������������������������������������������������������������������������������������������������������������������������package Mac::PropertyList::ReadBinary; use strict; use warnings; use vars qw( $VERSION ); use Carp; use Data::Dumper; use Encode qw(decode); use Mac::PropertyList; use Math::BigInt; use MIME::Base64 qw(decode_base64); use POSIX qw(SEEK_END SEEK_SET); use XML::Entities (); $VERSION = '1.411'; __PACKAGE__->_run( @ARGV ) unless caller; =encoding utf8 =head1 NAME Mac::PropertyList::ReadBinary - read binary property list files =head1 SYNOPSIS # use directly use Mac::PropertyList::ReadBinary; my $parser = Mac::PropertyList::ReadBinary->new( $file ); my $plist = $parser->plist; # use indirectly, automatically selects right reader use Mac::PropertyList; my $plist = parse_plist_file( $file ); =head1 DESCRIPTION This module is a low-level interface to the Mac OS X Property List (plist) format. You probably shouldn't use this in applications—build interfaces on top of this so you don't have to put all the heinous multi-level object stuff where people have to look at it. You can parse a plist file and get back a data structure. You can take that data structure and get back the plist as XML (but not binary yet). If you want to change the structure inbetween that's your business. :) See C<Mac::PropertyList> for more details. =head2 Methods =over 4 =item new( FILENAME | SCALAR_REF | FILEHANDLE ) Opens the data source, doing the right thing for filenames, scalar references, or a filehandle. =cut sub new { my( $class, $source ) = @_; my $self = bless { source => $source }, $class; $self->_read; $self; } sub _source { $_[0]->{source} } sub _fh { $_[0]->{fh} } sub _trailer { $_[0]->{trailer} } sub _offsets { $_[0]->{offsets} } sub _object_ref_size { $_[0]->_trailer->{ref_size} } =item plist Returns the C<Mac::PropertyList> data structure. =cut sub plist { $_[0]->{parsed} } sub _object_size { $_[0]->_trailer->{object_count} * $_[0]->_trailer->{offset_size} } sub _read { my( $self, $thingy ) = @_; $self->{fh} = $self->_get_filehandle; $self->_read_plist_trailer; $self->_get_offset_table; my $top = $self->_read_object_at_offset( $self->_trailer->{top_object} ); $self->{parsed} = $top; } sub _get_filehandle { my( $self, $thingy ) = @_; my $fh; if( ! ref $self->_source ) { # filename open $fh, "<", $self->_source or die "Could not open [@{[$self->_source]}]! $!"; } elsif( ref $self->_source eq ref \ '' ) { # scalar ref open $fh, "<", $self->_source or croak "Could not open file! $!"; } elsif( ref $self->_source ) { # filehandle $fh = $self->_source; } else { croak( 'No source to read from!' ); } $fh; } sub _read_plist_trailer { my $self = shift; seek $self->_fh, -32, SEEK_END; my $buffer; read $self->_fh, $buffer, 32; my %hash; @hash{ qw( offset_size ref_size object_count top_object table_offset ) } = unpack "x6 C C (x4 N)3", $buffer; $self->{trailer} = \%hash; } sub _get_offset_table { my $self = shift; seek $self->_fh, $self->_trailer->{table_offset}, SEEK_SET; my $try_to_read = $self->_object_size; my $raw_offset_table; my $read = read $self->_fh, $raw_offset_table, $try_to_read; croak "reading offset table failed!" unless $read == $try_to_read; my @offsets = unpack ["","C*","n*","(H6)*","N*"]->[$self->_trailer->{offset_size}], $raw_offset_table; $self->{offsets} = \@offsets; if( $self->_trailer->{offset_size} == 3 ) { @offsets = map { hex } @offsets; } } sub _read_object_at_offset { my( $self, $offset ) = @_; my @caller = caller(1); seek $self->_fh, ${ $self->_offsets }[$offset], SEEK_SET; $self->_read_object; } # # # # # # # # # # # # # # BEGIN { my %singletons = ( 0 => undef, 8 => Mac::PropertyList::false->new(), 9 => Mac::PropertyList::true->new(), # 15 is also defined (as "fill") in the comments to Apple's # implementation in CFBinaryPList.c but Apple's actual code has no # support for it at all, either reading or writing, so it's # probably not important to implement. ); my $type_readers = { 0 => sub { # the odd balls my( $self, $length ) = @_; return $singletons{ $length } if exists $singletons{ $length }; croak ( sprintf "Unknown type byte %02X\n", $length ); }, 1 => sub { # integers my( $self, $length ) = @_; croak "Integer > 8 bytes = $length" if $length > 3; my $byte_length = 1 << $length; my( $buffer, $value ); read $self->_fh, $buffer, $byte_length; my @formats = qw( C n N NN ); my @values = unpack $formats[$length], $buffer; if( $length == 3 ) { my( $high, $low ) = @values; my $b = Math::BigInt->new($high)->blsft(32)->bior($low); if( $b->bcmp(Math::BigInt->new(2)->bpow(63)) > 0) { $b -= Math::BigInt->new(2)->bpow(64); } @values = ( $b ); } return Mac::PropertyList::integer->new( $values[0] ); }, 2 => sub { # reals my( $self, $length ) = @_; croak "Real > 8 bytes" if $length > 3; croak "Bad length [$length]" if $length < 2; my $byte_length = 1 << $length; my( $buffer, $value ); read $self->_fh, $buffer, $byte_length; my @formats = qw( a a f> d> ); my @values = unpack $formats[$length], $buffer; return Mac::PropertyList::real->new( $values[0] ); }, 3 => sub { # date my( $self, $length ) = @_; croak "Date != 8 bytes" if $length != 3; my $byte_length = 1 << $length; my( $buffer, $value ); read $self->_fh, $buffer, $byte_length; my @values = unpack 'd>', $buffer; $self->{MLen} += 9; my $adjusted_time = POSIX::strftime( "%Y-%m-%dT%H:%M:%SZ", gmtime( 978307200 + $values[0]) ); return Mac::PropertyList::date->new( $adjusted_time ); }, 4 => sub { # binary data my( $self, $length ) = @_; my( $buffer, $value ); read $self->_fh, $buffer, $length; return Mac::PropertyList::data->new( $buffer ); }, 5 => sub { # utf8 string my( $self, $length ) = @_; my( $buffer, $value ); read $self->_fh, $buffer, $length; $buffer = Encode::decode( 'ascii', $buffer ); return Mac::PropertyList::string->new( $buffer ); }, 6 => sub { # unicode string my( $self, $length ) = @_; my( $buffer, $value ); read $self->_fh, $buffer, 2 * $length; $buffer = Encode::decode( "UTF-16BE", $buffer ); return Mac::PropertyList::ustring->new( $buffer ); }, a => sub { # array my( $self, $elements ) = @_; my @objects = do { my $buffer; read $self->_fh, $buffer, $elements * $self->_object_ref_size; unpack( ($self->_object_ref_size == 1 ? "C*" : "n*"), $buffer ); }; my @array = map { $self->_read_object_at_offset( $objects[$_] ) } 0 .. $elements - 1; return Mac::PropertyList::array->new( \@array ); }, d => sub { # dictionary my( $self, $length ) = @_; my @key_indices = do { my $buffer; my $s = $self->_object_ref_size; read $self->_fh, $buffer, $length * $self->_object_ref_size; unpack( ($self->_object_ref_size == 1 ? "C*" : "n*"), $buffer ); }; my @objects = do { my $buffer; read $self->_fh, $buffer, $length * $self->_object_ref_size; unpack( ($self->_object_ref_size == 1 ? "C*" : "n*"), $buffer ); }; my %dict = map { my $key = $self->_read_object_at_offset($key_indices[$_])->value; my $value = $self->_read_object_at_offset($objects[$_]); ( $key, $value ); } 0 .. $length - 1; return Mac::PropertyList::dict->new( \%dict ); }, }; sub _read_object { my $self = shift; my $buffer; croak "read() failed while trying to get type byte! $!" unless read( $self->_fh, $buffer, 1) == 1; my $length = unpack( "C*", $buffer ) & 0x0F; $buffer = unpack "H*", $buffer; my $type = substr $buffer, 0, 1; $length = $self->_read_object->value if $type ne "0" && $length == 15; my $sub = $type_readers->{ $type }; my $result = eval { $sub->( $self, $length ) }; croak "$@" if $@; return $result; } } =back =head1 SEE ALSO Some of the ideas are cribbed from CFBinaryPList.c http://opensource.apple.com/source/CF/CF-550/CFBinaryPList.c =head1 SOURCE AVAILABILITY This project is in Github: git://github.com/briandfoy/mac-propertylist.git =head1 CREDITS =head1 AUTHOR brian d foy, C<< <bdfoy@cpan.org> >> =head1 COPYRIGHT AND LICENSE Copyright © 2004-2015, brian d foy <bdfoy@cpan.org>. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. =cut "See why 1984 won't be like 1984"; �������������������������������������������������������������������������������darwin-perl-lib/Mac/PropertyList/WriteBinary.pm�����������������������������������������������������000444 �000765 �000024 �00000034154 13167163507 023746� 0����������������������������������������������������������������������������������������������������ustar�00ocsinventory��������������������staff���������������������������000000 �000000 ������������������������������������������������������������������������������������������������������������������������������������������������������������������������package Mac::PropertyList::WriteBinary; use strict; use warnings; use vars qw( $VERSION @EXPORT_OK ); use Encode (); use Mac::PropertyList (); use base qw(Exporter); =encoding utf8 =head1 NAME Mac::PropertyList::WriteBinary - pack data into a Mac "binary property list" =head1 SYNOPSIS use Mac::PropertyList::WriteBinary; my $data = new Mac::PropertyList::dict({ ... => ... }); my $buf = Mac::PropertyList::WriteBinary::as_string($data); =head1 DESCRIPTION The C<as_string> function converts a property list structure (composed of instances of C<Mac::PropertyList::dict>, C<Mac::PropertyList::integer>, etc.) into a binary format compatible with the Apple CoreFoundation binary property list functions. It takes a single argument, the top-level object to write, and returns a byte string. The property list can contain the following perl objects: =over 4 =item C<Mac::PropertyList> value objects These are written according to their class. =item Unblessed references to Perl lists and hashes These are written as arrays and dictionaries, respectively. =item Perl scalars All Perl scalars are written as strings; this is similar to the behavior of writing an oldstyle OpenStep property list, which does not distinguish between numbers and strings, and then reading it using CoreFoundation functions. =item C<undef> This is written as the null object. CoreFoundation will read this as C<kCFNull>, but appears to be unable to write it. =back Strings are uniqued (two equal strings will be written as references to the same object). If the same reference appears more than once in the structure, it will likewise only be represented once in the output. Although the bplist format can represent circular data structures, they cannot be written by this module (they will be detected and result in an error — they wouldn't be read correctly by CoreFoundation anyway, so you aren't missing much). =head1 BUGS C<Mac::PropertyList::date> objects are not handled yet. Objects other than strings (and null) are not uniqued by value, only by reference equality. This may change in a future version. Perl's dictionary keys can only be strings, but a bplist's can be any scalar object. There is no way to write the C<UID> objects used by the keyed archiver. Perls that do not use IEEE-754 format internally for floating point numbers will produce incorrect output. =cut use constant { header => 'bplist00', tagInteger => 0x10, tagFloat => 0x20, tagDate => 0x30, tagData => 0x40, tagASCII => 0x50, tagUTF16 => 0x60, tagUID => 0x80, tagArray => 0xA0, tagSet => 0xC0, tagDict => 0xD0, # If we can actually represent an integer close to 2^64 with full # precision and pack it with 'Q', then we can use that havePack64 => ( eval { pack('Q>', 1153202979583557643) eq "\x10\x01\0\0\0\0\0\x0B" } ? 1 : 0 ), }; $VERSION = '1.411'; @EXPORT_OK = qw( as_string ); sub as_string { my($value) = @_; my($ctxt) = _create_fragments($value); my(@offsets, $xref_offset, $offset_size); # The header (magic number and version, which is 00) my($buf) = header; # Write each fragment, making note of its offset in the file foreach my $objid (0 .. $ctxt->{nextid}-1) { $offsets[$objid] = length $buf; $buf .= $ctxt->{fragments}->{$objid}; } # ... and the offset of the beginning of the offsets table $xref_offset = length $buf; # Figure out how many bytes to use to represent file offsets, # and append the offset table if ($xref_offset < 256) { $buf .= pack('C*', @offsets); $offset_size = 1; } elsif ($xref_offset < 65536) { $buf .= pack('n*', @offsets); $offset_size = 2; } else { $buf .= pack('N*', @offsets); $offset_size = 4; } # Write the file trailer $buf .= pack('x5 CCC ' . ( havePack64? 'Q>' : 'x4N' ) x 3, 0, $offset_size, $ctxt->{objref_size}, $ctxt->{nextid}, $ctxt->{rootid}, $xref_offset); $buf; } # sub to_file { # To consider: # It might be useful to have a version of &as_string which writes # the fragments directly to a file handle without having to build a # single large buffer in RAM. This would be more efficient for # larger structures. On the other hand, if you're writing large # structures with this module, you're already suffering needlessly, # so perhaps it's not worth optimizing overmuch for that case. # } # _assign_id is the workhorse function which recursively # descends the data structure and assigns object ids to each node, # as well as creating fragments of the final file. sub _assign_id { my($context, $value) = @_; # The type of this value my($tp) = ref $value; # Unblessed scalars are either strings or undef. if ($tp eq '') { if (!defined $value) { $context->{nullid} = $context->{nextid} ++ unless defined $context->{nullid}; return $context->{nullid}; } else { $context->{strings}->{$value} = $context->{nextid} ++ unless exists $context->{strings}->{$value}; return $context->{strings}->{$value}; } } # If we reach here we know that $value is a ref. Keep a table of # stringified refs, so that we can re-use the id of an object # we've seen before. if(exists $context->{refs}{$value}) { my($thisid) = $context->{refs}->{$value}; die "Recursive data structure\n" unless defined $thisid; return $thisid; } $context->{refs}->{$value} = undef; # Serialize the object into $fragment if possible. Since we # don't yet know how many bytes we will use to represent object # ids in the final file, don't serialize those yet–keep them # as a list of integers for now. my($fragment, @objrefs); if($tp eq 'ARRAY') { $fragment = _counted_header(tagArray, scalar @$value); @objrefs = map { $context->_assign_id($_) } @$value; } elsif($tp eq 'HASH') { my(@ks) = sort (CORE::keys %$value); $fragment = _counted_header(tagDict, scalar @ks); @objrefs = ( ( map { $context->_assign_id($_) } @ks ), ( map { $context->_assign_id($value->{$_}) } @ks ) ); } elsif(UNIVERSAL::can($tp, '_as_bplist_fragment')) { ($fragment, @objrefs) = $value->_as_bplist_fragment($context); } else { die "Cannot serialize type '$tp'\n"; } # As a special case, a fragment of 'undef' indicates that # the object ID was already assigned. return $objrefs[0] if !defined $fragment; # Assign the next object ID to this object. my($thisid) = $context->{nextid} ++; $context->{refs}->{$value} = $thisid; # Store the fragment and unpacked object references (if any). $context->{fragments}->{$thisid} = $fragment; $context->{objrefs}->{$thisid} = \@objrefs if @objrefs; return $thisid; } sub _create_fragments { my ($value) = @_; # Set up the state needed by _assign_id my ($ctxt) = bless({ nextid => 0, # The next unallocated object ID nullid => undef, # The object id of 'null' strings => { }, # Maps string values to object IDs refs => { }, # Maps stringified refs to object IDs fragments => { }, # Maps object IDs to bplist fragments, except object lists objrefs => { }, # Maps object IDs to objref lists }); # Traverse the data structure, and remember the id of the root object $ctxt->{rootid} = $ctxt->_assign_id($value); # Figure out how many bytes to use to represent an object id. my ($objref_pack); if ($ctxt->{nextid} < 256) { $objref_pack = 'C*'; $ctxt->{objref_size} = 1; } elsif ($ctxt->{nextid} < 65536) { $objref_pack = 'n*'; $ctxt->{objref_size} = 2; } else { $objref_pack = 'N*'; $ctxt->{objref_size} = 4; } my($objid, $reflist, $stringval); # Append the unformatted object ids to their corresponding fragments, # now that we know how to pack them. while (($objid, $reflist) = each %{$ctxt->{objrefs}}) { $ctxt->{fragments}->{$objid} .= pack($objref_pack, @$reflist); } delete $ctxt->{objrefs}; # Create fragments for all the strings. # TODO: If &to_file is written, it would be worth # breaking this out so that the conversion can be done on the # fly without keeping all of the converted strings in memory. { my($ascii) = Encode::find_encoding('ascii'); my($utf16be) = Encode::find_encoding('UTF-16BE'); while (($stringval, $objid) = each %{$ctxt->{strings}}) { my($fragment); # Strings may be stored as ASCII (7 bits) or UTF-16-bigendian. if ($stringval =~ /\A[\x01-\x7E]*\z/s) { # The string is representable in ASCII. $fragment = $ascii->encode($stringval); $fragment = _counted_header(tagASCII, length $fragment) . $fragment; } else { $fragment = $utf16be->encode($stringval); $fragment = _counted_header(tagUTF16, (length $fragment)/2) . $fragment; } $ctxt->{fragments}->{$objid} = $fragment; } } # If there's a <null> in the file, create its fragment. $ctxt->{fragments}->{$ctxt->{nullid}} = "\x00" if defined $ctxt->{nullid}; $ctxt; } sub _counted_header { my ($typebyte, $count) = @_; # Datas, strings, and container objects have a count/size encoded # in the lower 4 bits of their type byte. If the count doesn't fit # in 4 bits, the bits are set to all-1s and the actual value # follows, encoded as an integer (including the integer's # own type byte). if ($count < 15) { return pack('C', $typebyte + $count); } else { return pack('C', $typebyte + 15) . &_pos_integer($count); } } sub _pos_integer { my($count) = @_; if ($count < 256) { return pack('CC', tagInteger + 0, $count); } elsif ($count < 65536) { return pack('CS>', tagInteger + 1, $count); } elsif (havePack64 && ($count > 4294967295)) { return pack('Cq>', tagInteger + 3, $count); } else { return pack('CN', tagInteger + 2, $count); } } package Mac::PropertyList::array; sub _as_bplist_fragment { my($context, @items) = ( $_[1], $_[0]->value ); @items = map { $context->_assign_id($_) } @items; return ( Mac::PropertyList::WriteBinary::_counted_header(Mac::PropertyList::WriteBinary::tagArray, scalar @items), @items ); } package Mac::PropertyList::dict; sub _as_bplist_fragment { my($self, $context) = @_; my($value) = scalar $self->value; # Returns a ref in scalar context my(@keys) = sort (CORE::keys %$value); return ( Mac::PropertyList::WriteBinary::_counted_header(Mac::PropertyList::WriteBinary::tagDict, scalar @keys), ( map { $context->_assign_id($_) } @keys ), ( map { $context->_assign_id($value->{$_}) } @keys )); } package Mac::PropertyList::date; use Scalar::Util ( 'looks_like_number' ); use Time::Local ( 'timegm' ); sub _as_bplist_fragment { my($value) = scalar $_[0]->value; my($posixval); if (looks_like_number($value)) { $posixval = $value; } elsif ($value =~ /\A(\d\d\d\d)-(\d\d)-(\d\d)T(\d\d)\:(\d\d)\:(\d\d(?:\.\d+)?)Z\z/) { $posixval = timegm($6, $5, $4, $3, $2 - 1, $1); } else { die "Invalid plist date '$value'\n"; } # Dates are simply stored as floating-point numbers (seconds since the # start of the CoreFoundation epoch) with a different tag value. # See the notes in Mac::PropertyList::real on float format. return pack('Cd>', Mac::PropertyList::WriteBinary::tagDate + 3, $posixval - 978307200); } package Mac::PropertyList::real; # Here we're assuming that the 'd' format for pack produces # an IEEE-754 double-precision (64-bit) floating point # representation, because ... it does on practically every # system. However, this will not be portable to systems which # don't natively use IEEE-754 format! sub _as_bplist_fragment { my($self) = shift; return pack('Cd>', Mac::PropertyList::WriteBinary::tagFloat + 3, $self->value); } package Mac::PropertyList::integer; use constant tagInteger => 0x10; sub _as_bplist_fragment { my($value) = $_[0]->value; # Per comments in CFBinaryPList.c, only 8-byte integers (and # 16-byte integers, if they're supported, which they're not) are # interpreted as signed. Shorter integers are always unsigned. # Therefore all negative numbers must be written as 8-byte # integers. if ($value < 0) { if (Mac::PropertyList::WriteBinary::havePack64) { return pack('Cq>', tagInteger + 3, $value); } else { return pack('CSSl>', tagInteger + 3, 65535, 65535, $value); } } else { return Mac::PropertyList::WriteBinary::_pos_integer($value); } } package Mac::PropertyList::string; sub _as_bplist_fragment { # Returning a fragment of 'undef' indicates we've already assigned # an object ID. return ( undef, $_[1]->_assign_id($_[0]->value) ); } package Mac::PropertyList::ustring; sub _as_bplist_fragment { # Returning a fragment of 'undef' indicates we've already assigned # an object ID. return ( undef, $_[1]->_assign_id($_[0]->value) ); } package Mac::PropertyList::data; sub _as_bplist_fragment { my($value) = $_[0]->value; return (&Mac::PropertyList::WriteBinary::_counted_header(Mac::PropertyList::WriteBinary::tagData, length $value) . $value); } package Mac::PropertyList::true; sub _as_bplist_fragment { return "\x09"; } package Mac::PropertyList::false; sub _as_bplist_fragment { return "\x08"; } =head1 AUTHOR Wim Lewis, C<< <wiml@cpan.org> >> Copyright © 2012-2014 Wim Lewis. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. =head1 SEE ALSO L<Mac::PropertyList::ReadBinary> for the inverse operation. Apple's partial published CoreFoundation source code: L<http://opensource.apple.com/source/CF/> =cut "One more thing"; ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������darwin-perl-lib/LWP/Authen/�������������������������������������������������������������������������000755 �000765 �000024 �00000000000 13167163507 017652� 5����������������������������������������������������������������������������������������������������ustar�00ocsinventory��������������������staff���������������������������000000 �000000 ������������������������������������������������������������������������������������������������������������������������������������������������������������������������darwin-perl-lib/LWP/ConnCache.pm��������������������������������������������������������������������000444 �000765 �000024 �00000021042 13167163507 020602� 0����������������������������������������������������������������������������������������������������ustar�00ocsinventory��������������������staff���������������������������000000 �000000 ������������������������������������������������������������������������������������������������������������������������������������������������������������������������package LWP::ConnCache; use strict; our $VERSION = '6.27'; our $DEBUG; sub new { my($class, %cnf) = @_; my $total_capacity = 1; if (exists $cnf{total_capacity}) { $total_capacity = delete $cnf{total_capacity}; } if (%cnf && $^W) { require Carp; Carp::carp("Unrecognised options: @{[sort keys %cnf]}") } my $self = bless { cc_conns => [] }, $class; $self->total_capacity($total_capacity); $self; } sub deposit { my($self, $type, $key, $conn) = @_; push(@{$self->{cc_conns}}, [$conn, $type, $key, time]); $self->enforce_limits($type); return; } sub withdraw { my($self, $type, $key) = @_; my $conns = $self->{cc_conns}; for my $i (0 .. @$conns - 1) { my $c = $conns->[$i]; next unless $c->[1] eq $type && $c->[2] eq $key; splice(@$conns, $i, 1); # remove it return $c->[0]; } return undef; } sub total_capacity { my $self = shift; my $old = $self->{cc_limit_total}; if (@_) { $self->{cc_limit_total} = shift; $self->enforce_limits; } $old; } sub capacity { my $self = shift; my $type = shift; my $old = $self->{cc_limit}{$type}; if (@_) { $self->{cc_limit}{$type} = shift; $self->enforce_limits($type); } $old; } sub enforce_limits { my($self, $type) = @_; my $conns = $self->{cc_conns}; my @types = $type ? ($type) : ($self->get_types); for $type (@types) { next unless $self->{cc_limit}; my $limit = $self->{cc_limit}{$type}; next unless defined $limit; for my $i (reverse 0 .. @$conns - 1) { next unless $conns->[$i][1] eq $type; if (--$limit < 0) { $self->dropping(splice(@$conns, $i, 1), "$type capacity exceeded"); } } } if (defined(my $total = $self->{cc_limit_total})) { while (@$conns > $total) { $self->dropping(shift(@$conns), "Total capacity exceeded"); } } } sub dropping { my($self, $c, $reason) = @_; print "DROPPING @$c [$reason]\n" if $DEBUG; } sub drop { my($self, $checker, $reason) = @_; if (ref($checker) ne "CODE") { # make it so if (!defined $checker) { $checker = sub { 1 }; # drop all of them } elsif (_looks_like_number($checker)) { my $age_limit = $checker; my $time_limit = time - $age_limit; $reason ||= "older than $age_limit"; $checker = sub { $_[3] < $time_limit }; } else { my $type = $checker; $reason ||= "drop $type"; $checker = sub { $_[1] eq $type }; # match on type } } $reason ||= "drop"; local $SIG{__DIE__}; # don't interfere with eval below local $@; my @c; for (@{$self->{cc_conns}}) { my $drop; eval { if (&$checker(@$_)) { $self->dropping($_, $reason); $drop++; } }; push(@c, $_) unless $drop; } @{$self->{cc_conns}} = @c; } sub prune { my $self = shift; $self->drop(sub { !shift->ping }, "ping"); } sub get_types { my $self = shift; my %t; $t{$_->[1]}++ for @{$self->{cc_conns}}; return keys %t; } sub get_connections { my($self, $type) = @_; my @c; for (@{$self->{cc_conns}}) { push(@c, $_->[0]) if !$type || ($type && $type eq $_->[1]); } @c; } sub _looks_like_number { $_[0] =~ /^([+-]?)(?=\d|\.\d)\d*(\.\d*)?([Ee]([+-]?\d+))?$/; } 1; __END__ =pod =head1 NAME LWP::ConnCache - Connection cache manager =head1 NOTE This module is experimental. Details of its interface is likely to change in the future. =head1 SYNOPSIS use LWP::ConnCache; my $cache = LWP::ConnCache->new; $cache->deposit($type, $key, $sock); $sock = $cache->withdraw($type, $key); =head1 DESCRIPTION The C<LWP::ConnCache> class is the standard connection cache manager for L<LWP::UserAgent>. =head1 METHODS The following basic methods are provided: =head2 new my $cache = LWP::ConnCache->new( %options ) This method constructs a new L<LWP::ConnCache> object. The only option currently accepted is C<total_capacity>. If specified it initialize the L<LWP::ConnCache/total_capacity> option. It defaults to C<1>. =head2 total_capacity my $cap = $cache->total_capacity; $cache->total_capacity(0); # drop all immediately $cache->total_capacity(undef); # no limit $cache->total_capacity($number); Get/sets the number of connection that will be cached. Connections will start to be dropped when this limit is reached. If set to C<0>, then all connections are immediately dropped. If set to C<undef>, then there is no limit. =head2 capacity my $http_capacity = $cache->capacity('http'); $cache->capacity('http', 2 ); Get/set a limit for the number of connections of the specified type that can be cached. The first parameter is a short string like "http" or "ftp". =head2 drop $cache->drop(); # Drop ALL connections # which is just a synonym for: $cache->drop(sub{1}); # Drop ALL connections # drop all connections older than 22 seconds and add a reason for it! $cache->drop(22, "Older than 22 secs dropped"); # which is just a synonym for: $cache->drop(sub { my ($conn, $type, $key, $deposit_time) = @_; if ($deposit_time < 22) { # true values drop the connection return 1; } # false values don't drop the connection return 0; }, "Older than 22 secs dropped" ); Drop connections by some criteria. The $checker argument is a subroutine that is called for each connection. If the routine returns a TRUE value then the connection is dropped. The routine is called with ($conn, $type, $key, $deposit_time) as arguments. Shortcuts: If the $checker argument is absent (or C<undef>) all cached connections are dropped. If the $checker is a number then all connections untouched that the given number of seconds or more are dropped. If $checker is a string then all connections of the given type are dropped. The C<reason> is passed on to the L<LWP::ConnCache/dropped> method. =head2 prune $cache->prune(); Calling this method will drop all connections that are dead. This is tested by calling the L<LWP::ConnCache/ping> method on the connections. If the L<LWP::ConnCache/ping> method exists and returns a false value, then the connection is dropped. =head2 get_types my @types = $cache->get_types(); This returns all the C<type> fields used for the currently cached connections. =head2 get_connections my @conns = $cache->get_connections(); # all connections my @conns = $cache->get_connections('http'); # connections for http This returns all connection objects of the specified type. If no type is specified then all connections are returned. In scalar context the number of cached connections of the specified type is returned. =head1 PROTOCOL METHODS The following methods are called by low-level protocol modules to try to save away connections and to get them back. =head2 deposit $cache->deposit($type, $key, $conn); This method adds a new connection to the cache. As a result, other already cached connections might be dropped. Multiple connections with the same type/key might be added. =head2 withdraw my $conn = $cache->withdraw($type, $key); This method tries to fetch back a connection that was previously deposited. If no cached connection with the specified $type/$key is found, then C<undef> is returned. There is not guarantee that a deposited connection can be withdrawn, as the cache manger is free to drop connections at any time. =head1 INTERNAL METHODS The following methods are called internally. Subclasses might want to override them. =head2 enforce_limits $conn->enforce_limits([$type]) This method is called with after a new connection is added (deposited) in the cache or capacity limits are adjusted. The default implementation drops connections until the specified capacity limits are not exceeded. =head2 dropping $conn->dropping($conn_record, $reason) This method is called when a connection is dropped. The record belonging to the dropped connection is passed as the first argument and a string describing the reason for the drop is passed as the second argument. The default implementation makes some noise if the C<$LWP::ConnCache::DEBUG> variable is set and nothing more. =head1 SUBCLASSING For specialized cache policy it makes sense to subclass C<LWP::ConnCache> and perhaps override the L<LWP::ConnCache/deposit>, L<LWP::ConnCache/enforce_limits>, and L<LWP::ConnCache/dropping> methods. The object itself is a hash. Keys prefixed with C<cc_> are reserved for the base class. =head1 SEE ALSO L<LWP::UserAgent> =head1 COPYRIGHT Copyright 2001 Gisle Aas. This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. =cut ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������darwin-perl-lib/LWP/Debug/��������������������������������������������������������������������������000755 �000765 �000024 �00000000000 13167163507 017454� 5����������������������������������������������������������������������������������������������������ustar�00ocsinventory��������������������staff���������������������������000000 �000000 ������������������������������������������������������������������������������������������������������������������������������������������������������������������������darwin-perl-lib/LWP/Debug.pm������������������������������������������������������������������������000444 �000765 �000024 �00000005320 13167163507 020010� 0����������������������������������������������������������������������������������������������������ustar�00ocsinventory��������������������staff���������������������������000000 �000000 ������������������������������������������������������������������������������������������������������������������������������������������������������������������������package LWP::Debug; # legacy $LWP::Debug::VERSION = '6.27'; require Exporter; our @ISA = qw(Exporter); our @EXPORT_OK = qw(level trace debug conns); use Carp (); my @levels = qw(trace debug conns); our %current_level = (); sub import { my $pack = shift; my $callpkg = caller(0); my @symbols = (); my @levels = (); for (@_) { if (/^[-+]/) { push(@levels, $_); } else { push(@symbols, $_); } } Exporter::export($pack, $callpkg, @symbols); level(@levels); } sub level { for (@_) { if ($_ eq '+') { # all on # switch on all levels %current_level = map { $_ => 1 } @levels; } elsif ($_ eq '-') { # all off %current_level = (); } elsif (/^([-+])(\w+)$/) { $current_level{$2} = $1 eq '+'; } else { Carp::croak("Illegal level format $_"); } } } sub trace { _log(@_) if $current_level{'trace'}; } sub debug { _log(@_) if $current_level{'debug'}; } sub conns { _log(@_) if $current_level{'conns'}; } sub _log { my $msg = shift; $msg .= "\n" unless $msg =~ /\n$/; # ensure trailing "\n" my ($package, $filename, $line, $sub) = caller(2); print STDERR "$sub: $msg"; } 1; __END__ =pod =head1 NAME LWP::Debug - deprecated =head1 DESCRIPTION LWP::Debug is used to provide tracing facilities, but these are not used by LWP any more. The code in this module is kept around (undocumented) so that 3rd party code that happens to use the old interfaces continue to run. One useful feature that LWP::Debug provided (in an imprecise and troublesome way) was network traffic monitoring. The following section provides some hints about recommended replacements. =head2 Network traffic monitoring The best way to monitor the network traffic that LWP generates is to use an external TCP monitoring program. The L<WireShark|http://www.wireshark.org/> program is highly recommended for this. Another approach it to use a debugging HTTP proxy server and make LWP direct all its traffic via this one. Call C<< $ua->proxy >> to set it up and then just use LWP as before. For less precise monitoring needs just setting up a few simple handlers might do. The following example sets up handlers to dump the request and response objects that pass through LWP: use LWP::UserAgent; $ua = LWP::UserAgent->new; $ua->default_header('Accept-Encoding' => scalar HTTP::Message::decodable()); $ua->add_handler("request_send", sub { shift->dump; return }); $ua->add_handler("response_done", sub { shift->dump; return }); $ua->get("http://www.example.com"); =head1 SEE ALSO L<LWP::UserAgent> =cut ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������darwin-perl-lib/LWP/DebugFile.pm��������������������������������������������������������������������000444 �000765 �000024 �00000000115 13167163507 020605� 0����������������������������������������������������������������������������������������������������ustar�00ocsinventory��������������������staff���������������������������000000 �000000 ������������������������������������������������������������������������������������������������������������������������������������������������������������������������package LWP::DebugFile; $LWP::DebugFile::VERSION = '6.27'; # legacy stub 1; ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������darwin-perl-lib/LWP/MemberMixin.pm������������������������������������������������������������������000444 �000765 �000024 �00000001567 13167163507 021207� 0����������������������������������������������������������������������������������������������������ustar�00ocsinventory��������������������staff���������������������������000000 �000000 ������������������������������������������������������������������������������������������������������������������������������������������������������������������������package LWP::MemberMixin; $LWP::MemberMixin::VERSION = '6.27'; sub _elem { my $self = shift; my $elem = shift; my $old = $self->{$elem}; $self->{$elem} = shift if @_; return $old; } 1; __END__ =pod =head1 NAME LWP::MemberMixin - Member access mixin class =head1 SYNOPSIS package Foo; use base qw(LWP::MemberMixin); =head1 DESCRIPTION A mixin class to get methods that provide easy access to member variables in the C<%$self>. Ideally there should be better Perl language support for this. =head1 METHODS There is only one method provided: =head2 _elem _elem($elem [, $val]) Internal method to get/set the value of member variable C<$elem>. If C<$val> is present it is used as the new value for the member variable. If it is not present the current value is not touched. In both cases the previous value of the member variable is returned. =cut �����������������������������������������������������������������������������������������������������������������������������������������darwin-perl-lib/LWP/Protocol/�����������������������������������������������������������������������000755 �000765 �000024 �00000000000 13167163507 020227� 5����������������������������������������������������������������������������������������������������ustar�00ocsinventory��������������������staff���������������������������000000 �000000 ������������������������������������������������������������������������������������������������������������������������������������������������������������������������darwin-perl-lib/LWP/Protocol.pm���������������������������������������������������������������������000444 �000765 �000024 �00000020271 13167163507 020565� 0����������������������������������������������������������������������������������������������������ustar�00ocsinventory��������������������staff���������������������������000000 �000000 ������������������������������������������������������������������������������������������������������������������������������������������������������������������������package LWP::Protocol; use base 'LWP::MemberMixin'; our $VERSION = '6.27'; use strict; use Carp (); use HTTP::Status (); use HTTP::Response (); use Try::Tiny qw(try catch); my %ImplementedBy = (); # scheme => classname sub new { my($class, $scheme, $ua) = @_; my $self = bless { scheme => $scheme, ua => $ua, # historical/redundant max_size => $ua->{max_size}, }, $class; $self; } sub create { my($scheme, $ua) = @_; my $impclass = LWP::Protocol::implementor($scheme) or Carp::croak("Protocol scheme '$scheme' is not supported"); # hand-off to scheme specific implementation sub-class my $protocol = $impclass->new($scheme, $ua); return $protocol; } sub implementor { my($scheme, $impclass) = @_; if ($impclass) { $ImplementedBy{$scheme} = $impclass; } my $ic = $ImplementedBy{$scheme}; return $ic if $ic; return '' unless $scheme =~ /^([.+\-\w]+)$/; # check valid URL schemes $scheme = $1; # untaint $scheme =~ s/[.+\-]/_/g; # make it a legal module name # scheme not yet known, look for a 'use'd implementation $ic = "LWP::Protocol::$scheme"; # default location $ic = "LWP::Protocol::nntp" if $scheme eq 'news'; #XXX ugly hack no strict 'refs'; # check we actually have one for the scheme: unless (@{"${ic}::ISA"}) { # try to autoload it try { (my $class = $ic) =~ s{::}{/}g; $class .= '.pm' unless $class =~ /\.pm$/; require $class; } catch { my $error = $_; if ($error =~ /Can't locate/) { $ic = ''; } else { die "$error\n"; } }; } $ImplementedBy{$scheme} = $ic if $ic; $ic; } sub request { my($self, $request, $proxy, $arg, $size, $timeout) = @_; Carp::croak('LWP::Protocol::request() needs to be overridden in subclasses'); } # legacy sub timeout { shift->_elem('timeout', @_); } sub max_size { shift->_elem('max_size', @_); } sub collect { my ($self, $arg, $response, $collector) = @_; my $content; my($ua, $max_size) = @{$self}{qw(ua max_size)}; try { local $\; # protect the print below from surprises if (!defined($arg) || !$response->is_success) { $response->{default_add_content} = 1; } elsif (!ref($arg) && length($arg)) { open(my $fh, ">", $arg) or die "Can't write to '$arg': $!"; binmode($fh); push(@{$response->{handlers}{response_data}}, { callback => sub { print $fh $_[3] or die "Can't write to '$arg': $!"; 1; }, }); push(@{$response->{handlers}{response_done}}, { callback => sub { close($fh) or die "Can't write to '$arg': $!"; undef($fh); }, }); } elsif (ref($arg) eq 'CODE') { push(@{$response->{handlers}{response_data}}, { callback => sub { &$arg($_[3], $_[0], $self); 1; }, }); } else { die "Unexpected collect argument '$arg'"; } $ua->run_handlers("response_header", $response); if (delete $response->{default_add_content}) { push(@{$response->{handlers}{response_data}}, { callback => sub { $_[0]->add_content($_[3]); 1; }, }); } my $content_size = 0; my $length = $response->content_length; my %skip_h; while ($content = &$collector, length $$content) { for my $h ($ua->handlers("response_data", $response)) { next if $skip_h{$h}; unless ($h->{callback}->($response, $ua, $h, $$content)) { # XXX remove from $response->{handlers}{response_data} if present $skip_h{$h}++; } } $content_size += length($$content); $ua->progress(($length ? ($content_size / $length) : "tick"), $response); if (defined($max_size) && $content_size > $max_size) { $response->push_header("Client-Aborted", "max_size"); last; } } } catch { my $error = $_; chomp($error); $response->push_header('X-Died' => $error); $response->push_header("Client-Aborted", "die"); }; delete $response->{handlers}{response_data}; delete $response->{handlers} unless %{$response->{handlers}}; return $response; } sub collect_once { my($self, $arg, $response) = @_; my $content = \ $_[3]; my $first = 1; $self->collect($arg, $response, sub { return $content if $first--; return \ ""; }); } 1; __END__ =pod =head1 NAME LWP::Protocol - Base class for LWP protocols =head1 SYNOPSIS package LWP::Protocol::foo; use base qw(LWP::Protocol); =head1 DESCRIPTION This class is used as the base class for all protocol implementations supported by the LWP library. When creating an instance of this class using C<LWP::Protocol::create($url)>, and you get an initialized subclass appropriate for that access method. In other words, the L<LWP::Protocol/create> function calls the constructor for one of its subclasses. All derived C<LWP::Protocol> classes need to override the request() method which is used to service a request. The overridden method can make use of the collect() function to collect together chunks of data as it is received. =head1 METHODS The following methods and functions are provided: =head2 new my $prot = LWP::Protocol->new(); The LWP::Protocol constructor is inherited by subclasses. As this is a virtual base class this method should B<not> be called directly. =head2 create my $prot = LWP::Protocol::create($scheme) Create an object of the class implementing the protocol to handle the given scheme. This is a function, not a method. It is more an object factory than a constructor. This is the function user agents should use to access protocols. =head2 implementor my $class = LWP::Protocol::implementor($scheme, [$class]) Get and/or set implementor class for a scheme. Returns C<''> if the specified scheme is not supported. =head2 request $response = $protocol->request($request, $proxy, undef); $response = $protocol->request($request, $proxy, '/tmp/sss'); $response = $protocol->request($request, $proxy, \&callback, 1024); Dispatches a request over the protocol, and returns a response object. This method needs to be overridden in subclasses. Refer to L<LWP::UserAgent> for description of the arguments. =head2 collect my $res = $prot->collect(undef, $response, $collector); # stored in $response my $res = $prot->collect($filename, $response, $collector); my $res = $prot->collect(sub { ... }, $response, $collector); Collect the content of a request, and process it appropriately into a scalar, file, or by calling a callback. If the first parameter is undefined, then the content is stored within the C<$response>. If it's a simple scalar, then it's interpreted as a file name and the content is written to this file. If it's a code reference, then content is passed to this routine. The collector is a routine that will be called and which is responsible for returning pieces (as ref to scalar) of the content to process. The C<$collector> signals C<EOF> by returning a reference to an empty string. The return value is the L<HTTP::Response> object reference. B<Note:> We will only use the callback or file argument if C<< $response->is_success() >>. This avoids sending content data for redirects and authentication responses to the callback which would be confusing. =head2 collect_once $prot->collect_once($arg, $response, $content) Can be called when the whole response content is available as content. This will invoke L<LWP::Protocol/collect> with a collector callback that returns a reference to C<$content> the first time and an empty string the next. =head1 SEE ALSO Inspect the F<LWP/Protocol/file.pm> and F<LWP/Protocol/http.pm> files for examples of usage. =head1 COPYRIGHT Copyright 1995-2001 Gisle Aas. This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. =cut ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������darwin-perl-lib/LWP/RobotUA.pm����������������������������������������������������������������������000444 �000765 �000024 �00000017325 13167163507 020305� 0����������������������������������������������������������������������������������������������������ustar�00ocsinventory��������������������staff���������������������������000000 �000000 ������������������������������������������������������������������������������������������������������������������������������������������������������������������������package LWP::RobotUA; use base qw(LWP::UserAgent); our $VERSION = '6.27'; require WWW::RobotRules; require HTTP::Request; require HTTP::Response; use Carp (); use HTTP::Status (); use HTTP::Date qw(time2str); use strict; # # Additional attributes in addition to those found in LWP::UserAgent: # # $self->{'delay'} Required delay between request to the same # server in minutes. # # $self->{'rules'} A WWW::RobotRules object # sub new { my $class = shift; my %cnf; if (@_ < 4) { # legacy args @cnf{qw(agent from rules)} = @_; } else { %cnf = @_; } Carp::croak('LWP::RobotUA agent required') unless $cnf{agent}; Carp::croak('LWP::RobotUA from address required') unless $cnf{from} && $cnf{from} =~ m/\@/; my $delay = delete $cnf{delay} || 1; my $use_sleep = delete $cnf{use_sleep}; $use_sleep = 1 unless defined($use_sleep); my $rules = delete $cnf{rules}; my $self = LWP::UserAgent->new(%cnf); $self = bless $self, $class; $self->{'delay'} = $delay; # minutes $self->{'use_sleep'} = $use_sleep; if ($rules) { $rules->agent($cnf{agent}); $self->{'rules'} = $rules; } else { $self->{'rules'} = WWW::RobotRules->new($cnf{agent}); } $self; } sub delay { shift->_elem('delay', @_); } sub use_sleep { shift->_elem('use_sleep', @_); } sub agent { my $self = shift; my $old = $self->SUPER::agent(@_); if (@_) { # Changing our name means to start fresh $self->{'rules'}->agent($self->{'agent'}); } $old; } sub rules { my $self = shift; my $old = $self->_elem('rules', @_); $self->{'rules'}->agent($self->{'agent'}) if @_; $old; } sub no_visits { my($self, $netloc) = @_; $self->{'rules'}->no_visits($netloc) || 0; } *host_count = \&no_visits; # backwards compatibility with LWP-5.02 sub host_wait { my($self, $netloc) = @_; return undef unless defined $netloc; my $last = $self->{'rules'}->last_visit($netloc); if ($last) { my $wait = int($self->{'delay'} * 60 - (time - $last)); $wait = 0 if $wait < 0; return $wait; } return 0; } sub simple_request { my($self, $request, $arg, $size) = @_; # Do we try to access a new server? my $allowed = $self->{'rules'}->allowed($request->uri); if ($allowed < 0) { # Host is not visited before, or robots.txt expired; fetch "robots.txt" my $robot_url = $request->uri->clone; $robot_url->path("robots.txt"); $robot_url->query(undef); # make access to robot.txt legal since this will be a recursive call $self->{'rules'}->parse($robot_url, ""); my $robot_req = HTTP::Request->new('GET', $robot_url); my $parse_head = $self->parse_head(0); my $robot_res = $self->request($robot_req); $self->parse_head($parse_head); my $fresh_until = $robot_res->fresh_until; my $content = ""; if ($robot_res->is_success && $robot_res->content_is_text) { $content = $robot_res->decoded_content; $content = "" unless $content && $content =~ /^\s*Disallow\s*:/mi; } $self->{'rules'}->parse($robot_url, $content, $fresh_until); # recalculate allowed... $allowed = $self->{'rules'}->allowed($request->uri); } # Check rules unless ($allowed) { my $res = HTTP::Response->new( HTTP::Status::RC_FORBIDDEN, 'Forbidden by robots.txt'); $res->request( $request ); # bind it to that request return $res; } my $netloc = eval { local $SIG{__DIE__}; $request->uri->host_port; }; my $wait = $self->host_wait($netloc); if ($wait) { if ($self->{'use_sleep'}) { sleep($wait) } else { my $res = HTTP::Response->new( HTTP::Status::RC_SERVICE_UNAVAILABLE, 'Please, slow down'); $res->header('Retry-After', time2str(time + $wait)); $res->request( $request ); # bind it to that request return $res; } } # Perform the request my $res = $self->SUPER::simple_request($request, $arg, $size); $self->{'rules'}->visit($netloc); $res; } sub as_string { my $self = shift; my @s; push(@s, "Robot: $self->{'agent'} operated by $self->{'from'} [$self]"); push(@s, " Minimum delay: " . int($self->{'delay'}*60) . "s"); push(@s, " Will sleep if too early") if $self->{'use_sleep'}; push(@s, " Rules = $self->{'rules'}"); join("\n", @s, ''); } 1; __END__ =pod =head1 NAME LWP::RobotUA - a class for well-behaved Web robots =head1 SYNOPSIS use LWP::RobotUA; my $ua = LWP::RobotUA->new('my-robot/0.1', 'me@foo.com'); $ua->delay(10); # be very nice -- max one hit every ten minutes! ... # Then just use it just like a normal LWP::UserAgent: my $response = $ua->get('http://whatever.int/...'); ... =head1 DESCRIPTION This class implements a user agent that is suitable for robot applications. Robots should be nice to the servers they visit. They should consult the F</robots.txt> file to ensure that they are welcomed and they should not make requests too frequently. But before you consider writing a robot, take a look at L<URL:http://www.robotstxt.org/>. When you use an I<LWP::RobotUA> object as your user agent, then you do not really have to think about these things yourself; C<robots.txt> files are automatically consulted and obeyed, the server isn't queried too rapidly, and so on. Just send requests as you do when you are using a normal I<LWP::UserAgent> object (using C<< $ua->get(...) >>, C<< $ua->head(...) >>, C<< $ua->request(...) >>, etc.), and this special agent will make sure you are nice. =head1 METHODS The LWP::RobotUA is a sub-class of L<LWP::UserAgent> and implements the same methods. In addition the following methods are provided: =head2 new my $ua = LWP::RobotUA->new( %options ) my $ua = LWP::RobotUA->new( $agent, $from ) my $ua = LWP::RobotUA->new( $agent, $from, $rules ) The LWP::UserAgent options C<agent> and C<from> are mandatory. The options C<delay>, C<use_sleep> and C<rules> initialize attributes private to the RobotUA. If C<rules> are not provided, then C<WWW::RobotRules> is instantiated providing an internal database of F<robots.txt>. It is also possible to just pass the value of C<agent>, C<from> and optionally C<rules> as plain positional arguments. =head2 delay my $delay = $ua->delay; $ua->delay( $minutes ); Get/set the minimum delay between requests to the same server, in I<minutes>. The default is C<1> minute. Note that this number doesn't have to be an integer; for example, this sets the delay to C<10> seconds: $ua->delay(10/60); =head2 use_sleep my $bool = $ua->use_sleep; $ua->use_sleep( $boolean ); Get/set a value indicating whether the UA should L<LWP::RobotUA/sleep> if requests arrive too fast, defined as C<< $ua->delay >> minutes not passed since last request to the given server. The default is true. If this value is false then an internal C<SERVICE_UNAVAILABLE> response will be generated. It will have a C<Retry-After> header that indicates when it is OK to send another request to this server. =head2 rules my $rules = $ua->rules; $ua->rules( $rules ); Set/get which I<WWW::RobotRules> object to use. =head2 no_visits my $num = $ua->no_visits( $netloc ) Returns the number of documents fetched from this server host. Yeah I know, this method should probably have been named C<num_visits> or something like that. :-( =head2 host_wait my $num = $ua->host_wait( $netloc ) Returns the number of I<seconds> (from now) you must wait before you can make a new request to this host. =head2 as_string my $string = $ua->as_string; Returns a string that describes the state of the UA. Mainly useful for debugging. =head1 SEE ALSO L<LWP::UserAgent>, L<WWW::RobotRules> =head1 COPYRIGHT Copyright 1996-2004 Gisle Aas. This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. =cut �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������darwin-perl-lib/LWP/Simple.pm�����������������������������������������������������������������������000444 �000765 �000024 �00000014626 13167163507 020224� 0����������������������������������������������������������������������������������������������������ustar�00ocsinventory��������������������staff���������������������������000000 �000000 ������������������������������������������������������������������������������������������������������������������������������������������������������������������������package LWP::Simple; use strict; our $VERSION = '6.27'; require Exporter; our @EXPORT = qw(get head getprint getstore mirror); our @EXPORT_OK = qw($ua); # I really hate this. It was a bad idea to do it in the first place. # Wonder how to get rid of it??? (It even makes LWP::Simple 7% slower # for trivial tests) use HTTP::Status; push(@EXPORT, @HTTP::Status::EXPORT); sub import { my $pkg = shift; my $callpkg = caller; Exporter::export($pkg, $callpkg, @_); } use LWP::UserAgent (); use HTTP::Date (); our $ua = LWP::UserAgent->new; # we create a global UserAgent object $ua->agent("LWP::Simple/$VERSION "); $ua->env_proxy; sub get ($) { my $response = $ua->get(shift); return $response->decoded_content if $response->is_success; return undef; } sub head ($) { my($url) = @_; my $request = HTTP::Request->new(HEAD => $url); my $response = $ua->request($request); if ($response->is_success) { return $response unless wantarray; return (scalar $response->header('Content-Type'), scalar $response->header('Content-Length'), HTTP::Date::str2time($response->header('Last-Modified')), HTTP::Date::str2time($response->header('Expires')), scalar $response->header('Server'), ); } return; } sub getprint ($) { my($url) = @_; my $request = HTTP::Request->new(GET => $url); local($\) = ""; # ensure standard $OUTPUT_RECORD_SEPARATOR my $callback = sub { print $_[0] }; if ($^O eq "MacOS") { $callback = sub { $_[0] =~ s/\015?\012/\n/g; print $_[0] } } my $response = $ua->request($request, $callback); unless ($response->is_success) { print STDERR $response->status_line, " <URL:$url>\n"; } $response->code; } sub getstore ($$) { my($url, $file) = @_; my $request = HTTP::Request->new(GET => $url); my $response = $ua->request($request, $file); $response->code; } sub mirror ($$) { my($url, $file) = @_; my $response = $ua->mirror($url, $file); $response->code; } 1; __END__ =pod =head1 NAME LWP::Simple - simple procedural interface to LWP =head1 SYNOPSIS perl -MLWP::Simple -e 'getprint "http://www.sn.no"' use LWP::Simple; $content = get("http://www.sn.no/"); die "Couldn't get it!" unless defined $content; if (mirror("http://www.sn.no/", "foo") == RC_NOT_MODIFIED) { ... } if (is_success(getprint("http://www.sn.no/"))) { ... } =head1 DESCRIPTION This module is meant for people who want a simplified view of the libwww-perl library. It should also be suitable for one-liners. If you need more control or access to the header fields in the requests sent and responses received, then you should use the full object-oriented interface provided by the L<LWP::UserAgent> module. The module will also export the L<LWP::UserAgent> object as C<$ua> if you ask for it explicitly. The user agent created by this module will identify itself as C<LWP::Simple/#.##> and will initialize its proxy defaults from the environment (by calling C<< $ua->env_proxy >>). =head1 FUNCTIONS The following functions are provided (and exported) by this module: =head2 get my $res = get($url); The get() function will fetch the document identified by the given URL and return it. It returns C<undef> if it fails. The C<$url> argument can be either a string or a reference to a L<URI> object. You will not be able to examine the response code or response headers (like C<Content-Type>) when you are accessing the web using this function. If you need that information you should use the full OO interface (see L<LWP::UserAgent>). =head2 head my $res = head($url); Get document headers. Returns the following 5 values if successful: ($content_type, $document_length, $modified_time, $expires, $server) Returns an empty list if it fails. In scalar context returns TRUE if successful. =head2 getprint my $code = getprint($url); Get and print a document identified by a URL. The document is printed to the selected default filehandle for output (normally STDOUT) as data is received from the network. If the request fails, then the status code and message are printed on STDERR. The return value is the HTTP response code. =head2 getstore my $code = getstore($url, $file) Gets a document identified by a URL and stores it in the file. The return value is the HTTP response code. =head2 mirror my $code = mirror($url, $file); Get and store a document identified by a URL, using I<If-modified-since>, and checking the I<Content-Length>. Returns the HTTP response code. =head1 STATUS CONSTANTS This module also exports the L<HTTP::Status> constants and procedures. You can use them when you check the response code from L<LWP::Simple/getprint>, L<LWP::Simple/getstore> or L<LWP::Simple/mirror>. The constants are: RC_CONTINUE RC_SWITCHING_PROTOCOLS RC_OK RC_CREATED RC_ACCEPTED RC_NON_AUTHORITATIVE_INFORMATION RC_NO_CONTENT RC_RESET_CONTENT RC_PARTIAL_CONTENT RC_MULTIPLE_CHOICES RC_MOVED_PERMANENTLY RC_MOVED_TEMPORARILY RC_SEE_OTHER RC_NOT_MODIFIED RC_USE_PROXY RC_BAD_REQUEST RC_UNAUTHORIZED RC_PAYMENT_REQUIRED RC_FORBIDDEN RC_NOT_FOUND RC_METHOD_NOT_ALLOWED RC_NOT_ACCEPTABLE RC_PROXY_AUTHENTICATION_REQUIRED RC_REQUEST_TIMEOUT RC_CONFLICT RC_GONE RC_LENGTH_REQUIRED RC_PRECONDITION_FAILED RC_REQUEST_ENTITY_TOO_LARGE RC_REQUEST_URI_TOO_LARGE RC_UNSUPPORTED_MEDIA_TYPE RC_INTERNAL_SERVER_ERROR RC_NOT_IMPLEMENTED RC_BAD_GATEWAY RC_SERVICE_UNAVAILABLE RC_GATEWAY_TIMEOUT RC_HTTP_VERSION_NOT_SUPPORTED =head1 CLASSIFICATION FUNCTIONS The L<HTTP::Status> classification functions are: =head2 is_success my $bool = is_success($rc); True if response code indicated a successful request. =head2 is_error my $bool = is_error($rc) True if response code indicated that an error occurred. =head1 CAVEAT Note that if you are using both LWP::Simple and the very popular L<CGI> module, you may be importing a C<head> function from each module, producing a warning like C<Prototype mismatch: sub main::head ($) vs none>. Get around this problem by just not importing LWP::Simple's C<head> function, like so: use LWP::Simple qw(!head); use CGI qw(:standard); # then only CGI.pm defines a head() Then if you do need LWP::Simple's C<head> function, you can just call it as C<LWP::Simple::head($url)>. =head1 SEE ALSO L<LWP>, L<lwpcook>, L<LWP::UserAgent>, L<HTTP::Status>, L<lwp-request>, L<lwp-mirror> =cut ����������������������������������������������������������������������������������������������������������darwin-perl-lib/LWP/UserAgent.pm��������������������������������������������������������������������000444 �000765 �000024 �00000202136 13167163507 020663� 0����������������������������������������������������������������������������������������������������ustar�00ocsinventory��������������������staff���������������������������000000 �000000 ������������������������������������������������������������������������������������������������������������������������������������������������������������������������package LWP::UserAgent; use strict; use base qw(LWP::MemberMixin); use Carp (); use HTTP::Request (); use HTTP::Response (); use HTTP::Date (); use LWP (); use LWP::Protocol (); use Scalar::Util qw(blessed); use Try::Tiny qw(try catch); our $VERSION = '6.27'; sub new { # Check for common user mistake Carp::croak("Options to LWP::UserAgent should be key/value pairs, not hash reference") if ref($_[1]) eq 'HASH'; my($class, %cnf) = @_; my $agent = delete $cnf{agent}; my $from = delete $cnf{from}; my $def_headers = delete $cnf{default_headers}; my $timeout = delete $cnf{timeout}; $timeout = 3*60 unless defined $timeout; my $local_address = delete $cnf{local_address}; my $ssl_opts = delete $cnf{ssl_opts} || {}; unless (exists $ssl_opts->{verify_hostname}) { # The processing of HTTPS_CA_* below is for compatibility with Crypt::SSLeay if (exists $ENV{PERL_LWP_SSL_VERIFY_HOSTNAME}) { $ssl_opts->{verify_hostname} = $ENV{PERL_LWP_SSL_VERIFY_HOSTNAME}; } elsif ($ENV{HTTPS_CA_FILE} || $ENV{HTTPS_CA_DIR}) { # Crypt-SSLeay compatibility (verify peer certificate; but not the hostname) $ssl_opts->{verify_hostname} = 0; $ssl_opts->{SSL_verify_mode} = 1; } else { $ssl_opts->{verify_hostname} = 1; } } unless (exists $ssl_opts->{SSL_ca_file}) { if (my $ca_file = $ENV{PERL_LWP_SSL_CA_FILE} || $ENV{HTTPS_CA_FILE}) { $ssl_opts->{SSL_ca_file} = $ca_file; } } unless (exists $ssl_opts->{SSL_ca_path}) { if (my $ca_path = $ENV{PERL_LWP_SSL_CA_PATH} || $ENV{HTTPS_CA_DIR}) { $ssl_opts->{SSL_ca_path} = $ca_path; } } my $use_eval = delete $cnf{use_eval}; $use_eval = 1 unless defined $use_eval; my $parse_head = delete $cnf{parse_head}; $parse_head = 1 unless defined $parse_head; my $show_progress = delete $cnf{show_progress}; my $max_size = delete $cnf{max_size}; my $max_redirect = delete $cnf{max_redirect}; $max_redirect = 7 unless defined $max_redirect; my $env_proxy = exists $cnf{env_proxy} ? delete $cnf{env_proxy} : $ENV{PERL_LWP_ENV_PROXY}; my $no_proxy = exists $cnf{no_proxy} ? delete $cnf{no_proxy} : []; Carp::croak(qq{no_proxy must be an arrayref, not $no_proxy!}) if ref $no_proxy ne 'ARRAY'; my $cookie_jar = delete $cnf{cookie_jar}; my $conn_cache = delete $cnf{conn_cache}; my $keep_alive = delete $cnf{keep_alive}; Carp::croak("Can't mix conn_cache and keep_alive") if $conn_cache && $keep_alive; my $protocols_allowed = delete $cnf{protocols_allowed}; my $protocols_forbidden = delete $cnf{protocols_forbidden}; my $requests_redirectable = delete $cnf{requests_redirectable}; $requests_redirectable = ['GET', 'HEAD'] unless defined $requests_redirectable; # Actually ""s are just as good as 0's, but for concision we'll just say: Carp::croak("protocols_allowed has to be an arrayref or 0, not \"$protocols_allowed\"!") if $protocols_allowed and ref($protocols_allowed) ne 'ARRAY'; Carp::croak("protocols_forbidden has to be an arrayref or 0, not \"$protocols_forbidden\"!") if $protocols_forbidden and ref($protocols_forbidden) ne 'ARRAY'; Carp::croak("requests_redirectable has to be an arrayref or 0, not \"$requests_redirectable\"!") if $requests_redirectable and ref($requests_redirectable) ne 'ARRAY'; if (%cnf && $^W) { Carp::carp("Unrecognized LWP::UserAgent options: @{[sort keys %cnf]}"); } my $self = bless { def_headers => $def_headers, timeout => $timeout, local_address => $local_address, ssl_opts => $ssl_opts, use_eval => $use_eval, show_progress => $show_progress, max_size => $max_size, max_redirect => $max_redirect, # We set proxy later as we do validation on the values proxy => {}, no_proxy => [ @{ $no_proxy } ], protocols_allowed => $protocols_allowed, protocols_forbidden => $protocols_forbidden, requests_redirectable => $requests_redirectable, }, $class; $self->agent(defined($agent) ? $agent : $class->_agent) if defined($agent) || !$def_headers || !$def_headers->header("User-Agent"); $self->from($from) if $from; $self->cookie_jar($cookie_jar) if $cookie_jar; $self->parse_head($parse_head); $self->env_proxy if $env_proxy; if (exists $cnf{proxy}) { Carp::croak(qq{proxy must be an arrayref, not $cnf{proxy}!}) if ref $cnf{proxy} ne 'ARRAY'; $self->proxy($cnf{proxy}); } $self->protocols_allowed( $protocols_allowed ) if $protocols_allowed; $self->protocols_forbidden($protocols_forbidden) if $protocols_forbidden; if ($keep_alive) { $conn_cache ||= { total_capacity => $keep_alive }; } $self->conn_cache($conn_cache) if $conn_cache; return $self; } sub send_request { my($self, $request, $arg, $size) = @_; my($method, $url) = ($request->method, $request->uri); my $scheme = $url->scheme; local($SIG{__DIE__}); # protect against user defined die handlers $self->progress("begin", $request); my $response = $self->run_handlers("request_send", $request); unless ($response) { my $protocol; { # Honor object-specific restrictions by forcing protocol objects # into class LWP::Protocol::nogo. my $x; if($x = $self->protocols_allowed) { if (grep lc($_) eq $scheme, @$x) { } else { require LWP::Protocol::nogo; $protocol = LWP::Protocol::nogo->new; } } elsif ($x = $self->protocols_forbidden) { if(grep lc($_) eq $scheme, @$x) { require LWP::Protocol::nogo; $protocol = LWP::Protocol::nogo->new; } } # else fall thru and create the protocol object normally } # Locate protocol to use my $proxy = $request->{proxy}; if ($proxy) { $scheme = $proxy->scheme; } unless ($protocol) { try { $protocol = LWP::Protocol::create($scheme, $self); } catch { my $error = $_; $error =~ s/ at .* line \d+.*//s; # remove file/line number $response = _new_response($request, HTTP::Status::RC_NOT_IMPLEMENTED, $error); if ($scheme eq "https") { $response->message($response->message . " (LWP::Protocol::https not installed)"); $response->content_type("text/plain"); $response->content(<<EOT); LWP will support https URLs if the LWP::Protocol::https module is installed. EOT } }; } if (!$response && $self->{use_eval}) { # we eval, and turn dies into responses below try { $response = $protocol->request($request, $proxy, $arg, $size, $self->{timeout}) || die "No response returned by $protocol"; } catch { my $error = $_; if (blessed($error) && $error->isa("HTTP::Response")) { $response = $error; $response->request($request); } else { my $full = $error; (my $status = $error) =~ s/\n.*//s; $status =~ s/ at .* line \d+.*//s; # remove file/line number my $code = ($status =~ s/^(\d\d\d)\s+//) ? $1 : HTTP::Status::RC_INTERNAL_SERVER_ERROR; $response = _new_response($request, $code, $status, $full); } }; } elsif (!$response) { $response = $protocol->request($request, $proxy, $arg, $size, $self->{timeout}); # XXX: Should we die unless $response->is_success ??? } } $response->request($request); # record request for reference $response->header("Client-Date" => HTTP::Date::time2str(time)); $self->run_handlers("response_done", $response); $self->progress("end", $response); return $response; } sub prepare_request { my($self, $request) = @_; die "Method missing" unless $request->method; my $url = $request->uri; die "URL missing" unless $url; die "URL must be absolute" unless $url->scheme; $self->run_handlers("request_preprepare", $request); if (my $def_headers = $self->{def_headers}) { for my $h ($def_headers->header_field_names) { $request->init_header($h => [$def_headers->header($h)]); } } $self->run_handlers("request_prepare", $request); return $request; } sub simple_request { my($self, $request, $arg, $size) = @_; # sanity check the request passed in if (defined $request) { if (ref $request) { Carp::croak("You need a request object, not a " . ref($request) . " object") if ref($request) eq 'ARRAY' or ref($request) eq 'HASH' or !$request->can('method') or !$request->can('uri'); } else { Carp::croak("You need a request object, not '$request'"); } } else { Carp::croak("No request object passed in"); } my $error; try { $request = $self->prepare_request($request); } catch { $error = $_; $error =~ s/ at .* line \d+.*//s; # remove file/line number }; if ($error) { return _new_response($request, HTTP::Status::RC_BAD_REQUEST, $error); } return $self->send_request($request, $arg, $size); } sub request { my ($self, $request, $arg, $size, $previous) = @_; my $response = $self->simple_request($request, $arg, $size); $response->previous($previous) if $previous; if ($response->redirects >= $self->{max_redirect}) { $response->header("Client-Warning" => "Redirect loop detected (max_redirect = $self->{max_redirect})" ); return $response; } if (my $req = $self->run_handlers("response_redirect", $response)) { return $self->request($req, $arg, $size, $response); } my $code = $response->code; if ( $code == HTTP::Status::RC_MOVED_PERMANENTLY or $code == HTTP::Status::RC_FOUND or $code == HTTP::Status::RC_SEE_OTHER or $code == HTTP::Status::RC_TEMPORARY_REDIRECT) { my $referral = $request->clone; # These headers should never be forwarded $referral->remove_header('Host', 'Cookie'); if ( $referral->header('Referer') && $request->uri->scheme eq 'https' && $referral->uri->scheme eq 'http') { # RFC 2616, section 15.1.3. # https -> http redirect, suppressing Referer $referral->remove_header('Referer'); } if ( $code == HTTP::Status::RC_SEE_OTHER || $code == HTTP::Status::RC_FOUND) { my $method = uc($referral->method); unless ($method eq "GET" || $method eq "HEAD") { $referral->method("GET"); $referral->content(""); $referral->remove_content_headers; } } # And then we update the URL based on the Location:-header. my $referral_uri = $response->header('Location'); { # Some servers erroneously return a relative URL for redirects, # so make it absolute if it not already is. local $URI::ABS_ALLOW_RELATIVE_SCHEME = 1; my $base = $response->base; $referral_uri = "" unless defined $referral_uri; $referral_uri = $HTTP::URI_CLASS->new($referral_uri, $base)->abs($base); } $referral->uri($referral_uri); return $response unless $self->redirect_ok($referral, $response); return $self->request($referral, $arg, $size, $response); } elsif ($code == HTTP::Status::RC_UNAUTHORIZED || $code == HTTP::Status::RC_PROXY_AUTHENTICATION_REQUIRED) { my $proxy = ($code == HTTP::Status::RC_PROXY_AUTHENTICATION_REQUIRED); my $ch_header = $proxy || $request->method eq 'CONNECT' ? "Proxy-Authenticate" : "WWW-Authenticate"; my @challenges = $response->header($ch_header); unless (@challenges) { $response->header( "Client-Warning" => "Missing Authenticate header"); return $response; } require HTTP::Headers::Util; CHALLENGE: for my $challenge (@challenges) { $challenge =~ tr/,/;/; # "," is used to separate auth-params!! ($challenge) = HTTP::Headers::Util::split_header_words($challenge); my $scheme = shift(@$challenge); shift(@$challenge); # no value $challenge = {@$challenge}; # make rest into a hash unless ($scheme =~ /^([a-z]+(?:-[a-z]+)*)$/) { $response->header( "Client-Warning" => "Bad authentication scheme '$scheme'"); return $response; } $scheme = $1; # untainted now my $class = "LWP::Authen::\u$scheme"; $class =~ s/-/_/g; no strict 'refs'; unless (%{"$class\::"}) { # try to load it my $error; try { (my $req = $class) =~ s{::}{/}g; $req .= '.pm' unless $req =~ /\.pm$/; require $req; } catch { $error = $_; }; if ($error) { if ($error =~ /^Can\'t locate/) { $response->header("Client-Warning" => "Unsupported authentication scheme '$scheme'"); } else { $response->header("Client-Warning" => $error); } next CHALLENGE; } } unless ($class->can("authenticate")) { $response->header("Client-Warning" => "Unsupported authentication scheme '$scheme'"); next CHALLENGE; } return $class->authenticate($self, $proxy, $challenge, $response, $request, $arg, $size); } return $response; } return $response; } # # Now the shortcuts... # sub get { require HTTP::Request::Common; my($self, @parameters) = @_; my @suff = $self->_process_colonic_headers(\@parameters,1); return $self->request( HTTP::Request::Common::GET( @parameters ), @suff ); } sub _has_raw_content { my $self = shift; shift; # drop url # taken from HTTP::Request::Common::request_type_with_data my $content; $content = shift if @_ and ref $_[0]; my($k, $v); while (($k,$v) = splice(@_, 0, 2)) { if (lc($k) eq 'content') { $content = $v; } } # We were given Content => 'string' ... if (defined $content && ! ref ($content)) { return 1; } return; } sub _maybe_copy_default_content_type { my ($self, $req, @parameters) = @_; # If we have a default Content-Type and someone passes in a POST/PUT # with Content => 'some-string-value', use that Content-Type instead # of x-www-form-urlencoded my $ct = $self->default_header('Content-Type'); return unless defined $ct && $self->_has_raw_content(@parameters); $req->header('Content-Type' => $ct); } sub post { require HTTP::Request::Common; my($self, @parameters) = @_; my @suff = $self->_process_colonic_headers(\@parameters, (ref($parameters[1]) ? 2 : 1)); my $req = HTTP::Request::Common::POST(@parameters); $self->_maybe_copy_default_content_type($req, @parameters); return $self->request($req, @suff); } sub head { require HTTP::Request::Common; my($self, @parameters) = @_; my @suff = $self->_process_colonic_headers(\@parameters,1); return $self->request( HTTP::Request::Common::HEAD( @parameters ), @suff ); } sub put { require HTTP::Request::Common; my($self, @parameters) = @_; my @suff = $self->_process_colonic_headers(\@parameters, (ref($parameters[1]) ? 2 : 1)); my $req = HTTP::Request::Common::PUT(@parameters); $self->_maybe_copy_default_content_type($req, @parameters); return $self->request($req, @suff); } sub delete { require HTTP::Request::Common; my($self, @parameters) = @_; my @suff = $self->_process_colonic_headers(\@parameters,1); return $self->request( HTTP::Request::Common::DELETE( @parameters ), @suff ); } sub _process_colonic_headers { # Process :content_cb / :content_file / :read_size_hint headers. my($self, $args, $start_index) = @_; my($arg, $size); for(my $i = $start_index; $i < @$args; $i += 2) { next unless defined $args->[$i]; #printf "Considering %s => %s\n", $args->[$i], $args->[$i + 1]; if($args->[$i] eq ':content_cb') { # Some sanity-checking... $arg = $args->[$i + 1]; Carp::croak("A :content_cb value can't be undef") unless defined $arg; Carp::croak("A :content_cb value must be a coderef") unless ref $arg and UNIVERSAL::isa($arg, 'CODE'); } elsif ($args->[$i] eq ':content_file') { $arg = $args->[$i + 1]; # Some sanity-checking... Carp::croak("A :content_file value can't be undef") unless defined $arg; Carp::croak("A :content_file value can't be a reference") if ref $arg; Carp::croak("A :content_file value can't be \"\"") unless length $arg; } elsif ($args->[$i] eq ':read_size_hint') { $size = $args->[$i + 1]; # Bother checking it? } else { next; } splice @$args, $i, 2; $i -= 2; } # And return a suitable suffix-list for request(REQ,...) return unless defined $arg; return $arg, $size if defined $size; return $arg; } sub is_online { my $self = shift; return 1 if $self->get("http://www.msftncsi.com/ncsi.txt")->content eq "Microsoft NCSI"; return 1 if $self->get("http://www.apple.com")->content =~ m,<title>Apple,; return 0; } my @ANI = qw(- \ | /); sub progress { my($self, $status, $m) = @_; return unless $self->{show_progress}; local($,, $\); if ($status eq "begin") { print STDERR "** ", $m->method, " ", $m->uri, " ==> "; $self->{progress_start} = time; $self->{progress_lastp} = ""; $self->{progress_ani} = 0; } elsif ($status eq "end") { delete $self->{progress_lastp}; delete $self->{progress_ani}; print STDERR $m->status_line; my $t = time - delete $self->{progress_start}; print STDERR " (${t}s)" if $t; print STDERR "\n"; } elsif ($status eq "tick") { print STDERR "$ANI[$self->{progress_ani}++]\b"; $self->{progress_ani} %= @ANI; } else { my $p = sprintf "%3.0f%%", $status * 100; return if $p eq $self->{progress_lastp}; print STDERR "$p\b\b\b\b"; $self->{progress_lastp} = $p; } STDERR->flush; } # # This whole allow/forbid thing is based on man 1 at's way of doing things. # sub is_protocol_supported { my($self, $scheme) = @_; if (ref $scheme) { # assume we got a reference to an URI object $scheme = $scheme->scheme; } else { Carp::croak("Illegal scheme '$scheme' passed to is_protocol_supported") if $scheme =~ /\W/; $scheme = lc $scheme; } my $x; if(ref($self) and $x = $self->protocols_allowed) { return 0 unless grep lc($_) eq $scheme, @$x; } elsif (ref($self) and $x = $self->protocols_forbidden) { return 0 if grep lc($_) eq $scheme, @$x; } local($SIG{__DIE__}); # protect against user defined die handlers $x = LWP::Protocol::implementor($scheme); return 1 if $x and $x ne 'LWP::Protocol::nogo'; return 0; } sub protocols_allowed { shift->_elem('protocols_allowed' , @_) } sub protocols_forbidden { shift->_elem('protocols_forbidden' , @_) } sub requests_redirectable { shift->_elem('requests_redirectable', @_) } sub redirect_ok { # RFC 2616, section 10.3.2 and 10.3.3 say: # If the 30[12] status code is received in response to a request other # than GET or HEAD, the user agent MUST NOT automatically redirect the # request unless it can be confirmed by the user, since this might # change the conditions under which the request was issued. # Note that this routine used to be just: # return 0 if $_[1]->method eq "POST"; return 1; my($self, $new_request, $response) = @_; my $method = $response->request->method; return 0 unless grep $_ eq $method, @{ $self->requests_redirectable || [] }; if ($new_request->uri->scheme eq 'file') { $response->header("Client-Warning" => "Can't redirect to a file:// URL!"); return 0; } # Otherwise it's apparently okay... return 1; } sub credentials { my $self = shift; my $netloc = lc(shift || ''); my $realm = shift || ""; my $old = $self->{basic_authentication}{$netloc}{$realm}; if (@_) { $self->{basic_authentication}{$netloc}{$realm} = [@_]; } return unless $old; return @$old if wantarray; return join(":", @$old); } sub get_basic_credentials { my($self, $realm, $uri, $proxy) = @_; return if $proxy; return $self->credentials($uri->host_port, $realm); } sub timeout { shift->_elem('timeout', @_); } sub local_address{ shift->_elem('local_address',@_); } sub max_size { shift->_elem('max_size', @_); } sub max_redirect { shift->_elem('max_redirect', @_); } sub show_progress{ shift->_elem('show_progress', @_); } sub ssl_opts { my $self = shift; if (@_ == 1) { my $k = shift; return $self->{ssl_opts}{$k}; } if (@_) { my $old; while (@_) { my($k, $v) = splice(@_, 0, 2); $old = $self->{ssl_opts}{$k} unless @_; if (defined $v) { $self->{ssl_opts}{$k} = $v; } else { delete $self->{ssl_opts}{$k}; } } %{$self->{ssl_opts}} = (%{$self->{ssl_opts}}, @_); return $old; } return keys %{$self->{ssl_opts}}; } sub parse_head { my $self = shift; if (@_) { my $flag = shift; my $parser; my $old = $self->set_my_handler("response_header", $flag ? sub { my($response, $ua) = @_; require HTML::HeadParser; $parser = HTML::HeadParser->new; $parser->xml_mode(1) if $response->content_is_xhtml; $parser->utf8_mode(1) if $] >= 5.008 && $HTML::Parser::VERSION >= 3.40; push(@{$response->{handlers}{response_data}}, { callback => sub { return unless $parser; unless ($parser->parse($_[3])) { my $h = $parser->header; my $r = $_[0]; for my $f ($h->header_field_names) { $r->init_header($f, [$h->header($f)]); } undef($parser); } }, }); } : undef, m_media_type => "html", ); return !!$old; } else { return !!$self->get_my_handler("response_header"); } } sub cookie_jar { my $self = shift; my $old = $self->{cookie_jar}; if (@_) { my $jar = shift; if (ref($jar) eq "HASH") { require HTTP::Cookies; $jar = HTTP::Cookies->new(%$jar); } $self->{cookie_jar} = $jar; $self->set_my_handler("request_prepare", $jar ? sub { $jar->add_cookie_header($_[0]); } : undef, ); $self->set_my_handler("response_done", $jar ? sub { $jar->extract_cookies($_[0]); } : undef, ); } $old; } sub default_headers { my $self = shift; my $old = $self->{def_headers} ||= HTTP::Headers->new; if (@_) { Carp::croak("default_headers not set to HTTP::Headers compatible object") unless @_ == 1 && $_[0]->can("header_field_names"); $self->{def_headers} = shift; } return $old; } sub default_header { my $self = shift; return $self->default_headers->header(@_); } sub _agent { "libwww-perl/$VERSION" } sub agent { my $self = shift; if (@_) { my $agent = shift; if ($agent) { $agent .= $self->_agent if $agent =~ /\s+$/; } else { undef($agent) } return $self->default_header("User-Agent", $agent); } return $self->default_header("User-Agent"); } sub from { # legacy my $self = shift; return $self->default_header("From", @_); } sub conn_cache { my $self = shift; my $old = $self->{conn_cache}; if (@_) { my $cache = shift; if (ref($cache) eq "HASH") { require LWP::ConnCache; $cache = LWP::ConnCache->new(%$cache); } $self->{conn_cache} = $cache; } $old; } sub add_handler { my($self, $phase, $cb, %spec) = @_; $spec{line} ||= join(":", (caller)[1,2]); my $conf = $self->{handlers}{$phase} ||= do { require HTTP::Config; HTTP::Config->new; }; $conf->add(%spec, callback => $cb); } sub set_my_handler { my($self, $phase, $cb, %spec) = @_; $spec{owner} = (caller(1))[3] unless exists $spec{owner}; $self->remove_handler($phase, %spec); $spec{line} ||= join(":", (caller)[1,2]); $self->add_handler($phase, $cb, %spec) if $cb; } sub get_my_handler { my $self = shift; my $phase = shift; my $init = pop if @_ % 2; my %spec = @_; my $conf = $self->{handlers}{$phase}; unless ($conf) { return unless $init; require HTTP::Config; $conf = $self->{handlers}{$phase} = HTTP::Config->new; } $spec{owner} = (caller(1))[3] unless exists $spec{owner}; my @h = $conf->find(%spec); if (!@h && $init) { if (ref($init) eq "CODE") { $init->(\%spec); } elsif (ref($init) eq "HASH") { while (my($k, $v) = each %$init) { $spec{$k} = $v; } } $spec{callback} ||= sub {}; $spec{line} ||= join(":", (caller)[1,2]); $conf->add(\%spec); return \%spec; } return wantarray ? @h : $h[0]; } sub remove_handler { my($self, $phase, %spec) = @_; if ($phase) { my $conf = $self->{handlers}{$phase} || return; my @h = $conf->remove(%spec); delete $self->{handlers}{$phase} if $conf->empty; return @h; } return unless $self->{handlers}; return map $self->remove_handler($_), sort keys %{$self->{handlers}}; } sub handlers { my($self, $phase, $o) = @_; my @h; if ($o->{handlers} && $o->{handlers}{$phase}) { push(@h, @{$o->{handlers}{$phase}}); } if (my $conf = $self->{handlers}{$phase}) { push(@h, $conf->matching($o)); } return @h; } sub run_handlers { my($self, $phase, $o) = @_; if (defined(wantarray)) { for my $h ($self->handlers($phase, $o)) { my $ret = $h->{callback}->($o, $self, $h); return $ret if $ret; } return undef; } for my $h ($self->handlers($phase, $o)) { $h->{callback}->($o, $self, $h); } } # deprecated sub use_eval { shift->_elem('use_eval', @_); } sub use_alarm { Carp::carp("LWP::UserAgent->use_alarm(BOOL) is a no-op") if @_ > 1 && $^W; ""; } sub clone { my $self = shift; my $copy = bless { %$self }, ref $self; # copy most fields delete $copy->{handlers}; delete $copy->{conn_cache}; # copy any plain arrays and hashes; known not to need recursive copy for my $k (qw(proxy no_proxy requests_redirectable ssl_opts)) { next unless $copy->{$k}; if (ref($copy->{$k}) eq "ARRAY") { $copy->{$k} = [ @{$copy->{$k}} ]; } elsif (ref($copy->{$k}) eq "HASH") { $copy->{$k} = { %{$copy->{$k}} }; } } if ($self->{def_headers}) { $copy->{def_headers} = $self->{def_headers}->clone; } # re-enable standard handlers $copy->parse_head($self->parse_head); # no easy way to clone the cookie jar; so let's just remove it for now $copy->cookie_jar(undef); $copy; } sub mirror { my($self, $url, $file) = @_; my $request = HTTP::Request->new('GET', $url); # If the file exists, add a cache-related header if ( -e $file ) { my ($mtime) = ( stat($file) )[9]; if ($mtime) { $request->header( 'If-Modified-Since' => HTTP::Date::time2str($mtime) ); } } my $tmpfile = "$file-$$"; my $response = $self->request($request, $tmpfile); if ( $response->header('X-Died') ) { die $response->header('X-Died'); } # Only fetching a fresh copy of the would be considered success. # If the file was not modified, "304" would returned, which # is considered by HTTP::Status to be a "redirect", /not/ "success" if ( $response->is_success ) { my @stat = stat($tmpfile) or die "Could not stat tmpfile '$tmpfile': $!"; my $file_length = $stat[7]; my ($content_length) = $response->header('Content-length'); if ( defined $content_length and $file_length < $content_length ) { unlink($tmpfile); die "Transfer truncated: " . "only $file_length out of $content_length bytes received\n"; } elsif ( defined $content_length and $file_length > $content_length ) { unlink($tmpfile); die "Content-length mismatch: " . "expected $content_length bytes, got $file_length\n"; } # The file was the expected length. else { # Replace the stale file with a fresh copy if ( -e $file ) { # Some DOSish systems fail to rename if the target exists chmod 0777, $file; unlink $file; } rename( $tmpfile, $file ) or die "Cannot rename '$tmpfile' to '$file': $!\n"; # make sure the file has the same last modification time if ( my $lm = $response->last_modified ) { utime $lm, $lm, $file; } } } # The local copy is fresh enough, so just delete the temp file else { unlink($tmpfile); } return $response; } sub _need_proxy { my($req, $ua) = @_; return if exists $req->{proxy}; my $proxy = $ua->{proxy}{$req->uri->scheme} || return; if ($ua->{no_proxy}) { if (my $host = eval { $req->uri->host }) { for my $domain (@{$ua->{no_proxy}}) { if ($host =~ /\Q$domain\E$/) { return; } } } } $req->{proxy} = $HTTP::URI_CLASS->new($proxy); } sub proxy { my $self = shift; my $key = shift; if (!@_ && ref $key eq 'ARRAY') { die 'odd number of items in proxy arrayref!' unless @{$key} % 2 == 0; # This map reads the elements of $key 2 at a time return map { $self->proxy($key->[2 * $_], $key->[2 * $_ + 1]) } (0 .. @{$key} / 2 - 1); } return map { $self->proxy($_, @_) } @$key if ref $key; Carp::croak("'$key' is not a valid URI scheme") unless $key =~ /^$URI::scheme_re\z/; my $old = $self->{'proxy'}{$key}; if (@_) { my $url = shift; if (defined($url) && length($url)) { Carp::croak("Proxy must be specified as absolute URI; '$url' is not") unless $url =~ /^$URI::scheme_re:/; Carp::croak("Bad http proxy specification '$url'") if $url =~ /^https?:/ && $url !~ m,^https?://\w,; } $self->{proxy}{$key} = $url; $self->set_my_handler("request_preprepare", \&_need_proxy) } return $old; } sub env_proxy { my ($self) = @_; require Encode; require Encode::Locale; my($k,$v); while(($k, $v) = each %ENV) { if ($ENV{REQUEST_METHOD}) { # Need to be careful when called in the CGI environment, as # the HTTP_PROXY variable is under control of that other guy. next if $k =~ /^HTTP_/; $k = "HTTP_PROXY" if $k eq "CGI_HTTP_PROXY"; } $k = lc($k); next unless $k =~ /^(.*)_proxy$/; $k = $1; if ($k eq 'no') { $self->no_proxy(split(/\s*,\s*/, $v)); } else { # Ignore random _proxy variables, allow only valid schemes next unless $k =~ /^$URI::scheme_re\z/; # Ignore xxx_proxy variables if xxx isn't a supported protocol next unless LWP::Protocol::implementor($k); $self->proxy($k, Encode::decode(locale => $v)); } } } sub no_proxy { my($self, @no) = @_; if (@no) { push(@{ $self->{'no_proxy'} }, @no); } else { $self->{'no_proxy'} = []; } } sub _new_response { my($request, $code, $message, $content) = @_; $message ||= HTTP::Status::status_message($code); my $response = HTTP::Response->new($code, $message); $response->request($request); $response->header("Client-Date" => HTTP::Date::time2str(time)); $response->header("Client-Warning" => "Internal response"); $response->header("Content-Type" => "text/plain"); $response->content($content || "$code $message\n"); return $response; } 1; __END__ =pod =head1 NAME LWP::UserAgent - Web user agent class =head1 SYNOPSIS use strict; use warnings; use LWP::UserAgent (); my $ua = LWP::UserAgent->new; $ua->timeout(10); $ua->env_proxy; my $response = $ua->get('http://search.cpan.org/'); if ($response->is_success) { print $response->decoded_content; # or whatever } else { die $response->status_line; } =head1 DESCRIPTION The L is a class implementing a web user agent. L objects can be used to dispatch web requests. In normal use the application creates an L object, and then configures it with values for timeouts, proxies, name, etc. It then creates an instance of L for the request that needs to be performed. This request is then passed to one of the request method the UserAgent, which dispatches it using the relevant protocol, and returns a L object. There are convenience methods for sending the most common request types: L, L, L, L and L. When using these methods, the creation of the request object is hidden as shown in the synopsis above. The basic approach of the library is to use HTTP-style communication for all protocol schemes. This means that you will construct L objects and receive L objects even for non-HTTP resources like I and I. In order to achieve even more similarity to HTTP-style communications, I menus and file directories are converted to HTML documents. =head1 CONSTRUCTOR METHODS The following constructor methods are available: =head2 clone my $ua2 = $ua->clone; Returns a copy of the L object. B: Please be aware that the clone method does not copy or clone your C attribute. Due to the limited restrictions on what can be used for your cookie jar, there is no way to clone the attribute. The C attribute will be C in the new object instance. =head2 new my $ua = LWP::UserAgent->new( %options ) This method constructs a new L object and returns it. Key/value pair arguments may be provided to set up the initial state. The following options correspond to attribute methods described below: KEY DEFAULT ----------- -------------------- agent "libwww-perl/#.###" from undef conn_cache undef cookie_jar undef default_headers HTTP::Headers->new local_address undef ssl_opts { verify_hostname => 1 } max_size undef max_redirect 7 parse_head 1 protocols_allowed undef protocols_forbidden undef requests_redirectable ['GET', 'HEAD'] timeout 180 proxy undef no_proxy [] The following additional options are also accepted: If the C option is passed in with a true value, then proxy settings are read from environment variables (see L). If C isn't provided, the C environment variable controls if L is called during initialization. If the C option is passed in, then a C is set up (see L). The C value is passed on as the C for the connection cache. C must be set as an arrayref of key/value pairs. C takes an arrayref of domains. =head1 ATTRIBUTES The settings of the configuration attributes modify the behaviour of the L when it dispatches requests. Most of these can also be initialized by options passed to the constructor method. The following attribute methods are provided. The attribute value is left unchanged if no argument is given. The return value from each method is the old attribute value. =head2 agent my $agent = $ua->agent; $ua->agent('Checkbot/0.4 '); # append the defaul to the end $ua->agent('Mozilla/5.0'); $ua->agent(""); # don't identify Get/set the product token that is used to identify the user agent on the network. The agent value is sent as the C header in the requests. The default is a string of the form C, where C<#.###> is substituted with the version number of this library. If the provided string ends with space, the default C string is appended to it. The user agent string should be one or more simple product identifiers with an optional version number separated by the C character. =head2 conn_cache my $cache_obj = $ua->conn_cache; $ua->conn_cache( $cache_obj ); Get/set the L object to use. See L for details. =head2 cookie_jar my $jar = $ua->cookie_jar; $ua->cookie_jar( $cookie_jar_obj ); Get/set the cookie jar object to use. The only requirement is that the cookie jar object must implement the C and C methods. These methods will then be invoked by the user agent as requests are sent and responses are received. Normally this will be a L object or some subclass. The default is to have no cookie jar, i.e. never automatically add C headers to the requests. Shortcut: If a reference to a plain hash is passed in, it is replaced with an instance of L that is initialized based on the hash. This form also automatically loads the L module. It means that: $ua->cookie_jar({ file => "$ENV{HOME}/.cookies.txt" }); is really just a shortcut for: require HTTP::Cookies; $ua->cookie_jar(HTTP::Cookies->new(file => "$ENV{HOME}/.cookies.txt")); =head2 credentials my $creds = $ua->credentials(); $ua->credentials( $netloc, $realm ); $ua->credentials( $netloc, $realm, $uname, $pass ); $ua->credentials("www.example.com:80", "Some Realm", "foo", "secret"); Get/set the user name and password to be used for a realm. The C<$netloc> is a string of the form C<< : >>. The username and password will only be passed to this server. =head2 default_header $ua->default_header( $field ); $ua->default_header( $field => $value ); $ua->default_header('Accept-Encoding' => scalar HTTP::Message::decodable()); $ua->default_header('Accept-Language' => "no, en"); This is just a shortcut for C<< $ua->default_headers->header( $field => $value ) >>. =head2 default_headers my $headers = $ua->default_headers; $ua->default_headers( $headers_obj ); Get/set the headers object that will provide default header values for any requests sent. By default this will be an empty L object. =head2 from my $from = $ua->from; $ua->from('foo@bar.com'); Get/set the email address for the human user who controls the requesting user agent. The address should be machine-usable, as defined in L. The C value is sent as the C header in the requests. The default is to not send a C header. See L for the more general interface that allow any header to be defaulted. =head2 local_address my $address = $ua->local_address; $ua->local_address( $address ); Get/set the local interface to bind to for network connections. The interface can be specified as a hostname or an IP address. This value is passed as the C argument to L. =head2 max_redirect my $max = $ua->max_redirect; $ua->max_redirect( $n ); This reads or sets the object's limit of how many times it will obey redirection responses in a given request cycle. By default, the value is C<7>. This means that if you call L and the response is a redirect elsewhere which is in turn a redirect, and so on seven times, then LWP gives up after that seventh request. =head2 max_size my $size = $ua->max_size; $ua->max_size( $bytes ); Get/set the size limit for response content. The default is C, which means that there is no limit. If the returned response content is only partial, because the size limit was exceeded, then a C header will be added to the response. The content might end up longer than C as we abort once appending a chunk of data makes the length exceed the limit. The C header, if present, will indicate the length of the full content and will normally not be the same as C<< length($res->content) >>. =head2 parse_head my $bool = $ua->parse_head; $ua->parse_head( $boolean ); Get/set a value indicating whether we should initialize response headers from the Ehead> section of HTML documents. The default is true. I unless you know what you are doing. =head2 protocols_allowed my $aref = $ua->protocols_allowed; # get allowed protocols $ua->protocols_allowed( \@protocols ); # allow ONLY these $ua->protocols_allowed(undef); # delete the list $ua->protocols_allowed(['http',]); # ONLY allow http By default, an object has neither a C list, nor a L list. This reads (or sets) this user agent's list of protocols that the request methods will exclusively allow. The protocol names are case insensitive. For example: C<< $ua->protocols_allowed( [ 'http', 'https'] ); >> means that this user agent will I those protocols, and attempts to use this user agent to access URLs with any other schemes (like C) will result in a 500 error. Note that having a C list causes any L list to be ignored. =head2 protocols_forbidden my $aref = $ua->protocols_forbidden; # get the forbidden list $ua->protocols_forbidden(\@protocols); # do not allow these $ua->protocols_forbidden(['http',]); # All http reqs get a 500 $ua->protocols_forbidden(undef); # delete the list This reads (or sets) this user agent's list of protocols that the request method will I allow. The protocol names are case insensitive. For example: C<< $ua->protocols_forbidden( [ 'file', 'mailto'] ); >> means that this user agent will I allow those protocols, and attempts to use this user agent to access URLs with those schemes will result in a 500 error. =head2 requests_redirectable my $aref = $ua->requests_redirectable; $ua->requests_redirectable( \@requests ); $ua->requests_redirectable(['GET', 'HEAD',]); # the default This reads or sets the object's list of request names that L will allow redirection for. By default, this is C<['GET', 'HEAD']>, as per L. To change to include C, consider: push @{ $ua->requests_redirectable }, 'POST'; =head2 show_progress my $bool = $ua->show_progress; $ua->show_progress( $boolean ); Get/set a value indicating whether a progress bar should be displayed on the terminal as requests are processed. The default is false. =head2 ssl_opts my @keys = $ua->ssl_opts; my $val = $ua->ssl_opts( $key ); $ua->ssl_opts( $key => $value ); Get/set the options for SSL connections. Without argument return the list of options keys currently set. With a single argument return the current value for the given option. With 2 arguments set the option value and return the old. Setting an option to the value C removes this option. The options that LWP relates to are: =over =item C => $bool When TRUE LWP will for secure protocol schemes ensure it connects to servers that have a valid certificate matching the expected hostname. If FALSE no checks are made and you can't be sure that you communicate with the expected peer. The no checks behaviour was the default for libwww-perl-5.837 and earlier releases. This option is initialized from the L environment variable. If this environment variable isn't set; then C defaults to 1. =item C => $path The path to a file containing Certificate Authority certificates. A default setting for this option is provided by checking the environment variables C and C in order. =item C => $path The path to a directory containing files containing Certificate Authority certificates. A default setting for this option is provided by checking the environment variables C and C in order. =back Other options can be set and are processed directly by the SSL Socket implementation in use. See L or L for details. The libwww-perl core no longer bundles protocol plugins for SSL. You will need to install L separately to enable support for processing https-URLs. =head2 timeout my $secs = $ua->timeout; $ua->timeout( $secs ); Get/set the timeout value in seconds. The default value is 180 seconds, i.e. 3 minutes. The requests is aborted if no activity on the connection to the server is observed for C seconds. This means that the time it takes for the complete transaction and the L method to actually return might be longer. =head1 PROXY ATTRIBUTES The following methods set up when requests should be passed via a proxy server. =head2 env_proxy $ua->env_proxy; Load proxy settings from C<*_proxy> environment variables. You might specify proxies like this (sh-syntax): gopher_proxy=http://proxy.my.place/ wais_proxy=http://proxy.my.place/ no_proxy="localhost,example.com" export gopher_proxy wais_proxy no_proxy csh or tcsh users should use the C command to define these environment variables. On systems with case insensitive environment variables there exists a name clash between the CGI environment variables and the C environment variable normally picked up by C. Because of this C is not honored for CGI scripts. The C environment variable can be used instead. =head2 no_proxy $ua->no_proxy( @domains ); $ua->no_proxy('localhost', 'example.com'); $ua->no_proxy(); # clear the list Do not proxy requests to the given domains. Calling C without any domains clears the list of domains. =head2 proxy $ua->proxy(\@schemes, $proxy_url) $ua->proxy(['http', 'ftp'], 'http://proxy.sn.no:8001/'); # For a single scheme: $ua->proxy($scheme, $proxy_url) $ua->proxy('gopher', 'http://proxy.sn.no:8001/'); # To set multiple proxies at once: $ua->proxy([ ftp => 'http://ftp.example.com:8001/', [ 'http', 'https' ] => 'http://http.example.com:8001/', ]); Set/retrieve proxy URL for a scheme. The first form specifies that the URL is to be used as a proxy for access methods listed in the list in the first method argument, i.e. C and C. The second form shows a shorthand form for specifying proxy URL for a single access scheme. The third form demonstrates setting multiple proxies at once. This is also the only form accepted by the constructor. =head1 HANDLERS Handlers are code that injected at various phases during the processing of requests. The following methods are provided to manage the active handlers: =head2 add_handler $ua->add_handler( $phase => \&cb, %matchspec ) Add handler to be invoked in the given processing phase. For how to specify C<%matchspec> see L. The possible values C<$phase> and the corresponding callback signatures are: =over =item response_data => sub { my($response, $ua, $h, $data) = @_; ... } This handler is called for each chunk of data received for the response. The handler might croak to abort the request. This handler needs to return a TRUE value to be called again for subsequent chunks for the same request. =item response_done => sub { my($response, $ua, $h) = @_; ... } The handler is called after the response has been fully received, but before any redirect handling is attempted. The handler can be used to extract information or modify the response. =item response_header => sub { my($response, $ua, $h) = @_; ... } This handler is called right after the response headers have been received, but before any content data. The handler might set up handlers for data and might croak to abort the request. The handler might set the $response->{default_add_content} value to control if any received data should be added to the response object directly. This will initially be false if the $ua->request() method was called with a $content_file or $content_cb argument; otherwise true. =item request_prepare => sub { my($request, $ua, $h) = @_; ... } The handler is called before the request is sent and can modify the request any way it see fit. This can for instance be used to add certain headers to specific requests. The method can assign a new request object to $_[0] to replace the request that is sent fully. The return value from the callback is ignored. If an exception is raised it will abort the request and make the request method return a "400 Bad request" response. =item request_preprepare => sub { my($request, $ua, $h) = @_; ... } The handler is called before the C and other standard initialization of the request. This can be used to set up headers and attributes that the C handler depends on. Proxy initialization should take place here; but in general don't register handlers for this phase. =item request_send => sub { my($request, $ua, $h) = @_; ... } This handler gets a chance of handling requests before they're sent to the protocol handlers. It should return an HTTP::Response object if it wishes to terminate the processing; otherwise it should return nothing. The C and C handlers will not be invoked for this response, but the C will be. =item response_redirect => sub { my($response, $ua, $h) = @_; ... } The handler is called in $ua->request after C. If the handler returns an HTTP::Request object we'll start over with processing this request instead. =back =head2 get_my_handler $ua->get_my_handler( $phase, %matchspec ); $ua->get_my_handler( $phase, %matchspec, $init ); Will retrieve the matching handler as hash ref. If C<$init> is passed as a true value, create and add the handler if it's not found. If C<$init> is a subroutine reference, then it's called with the created handler hash as argument. This sub might populate the hash with extra fields; especially the callback. If C<$init> is a hash reference, merge the hashes. =head2 handlers $ua->handlers( $phase, $request ) $ua->handlers( $phase, $response ) Returns the handlers that apply to the given request or response at the given processing phase. =head2 remove_handler $ua->remove_handler( undef, %matchspec ); $ua->remove_handler( $phase, %matchspec ); $ua->remove_handlers(); # REMOVE ALL HANDLERS IN ALL PHASES Remove handlers that match the given C<%matchspec>. If C<$phase> is not provided, remove handlers from all phases. Be careful as calling this function with C<%matchspec> that is not specific enough can remove handlers not owned by you. It's probably better to use the L method instead. The removed handlers are returned. =head2 set_my_handler $ua->set_my_handler( $phase, $cb, %matchspec ); $ua->set_my_handler($phase, undef); # remove handler for phase Set handlers private to the executing subroutine. Works by defaulting an C field to the C<%matchspec> that holds the name of the called subroutine. You might pass an explicit C to override this. If $cb is passed as C, remove the handler. =head1 REQUEST METHODS The methods described in this section are used to dispatch requests via the user agent. The following request methods are provided: =head2 delete my $res = $ua->delete( $url ); my $res = $ua->delete( $url, $field_name => $value, ... ); This method will dispatch a C request on the given URL. Additional headers and content options are the same as for the L method. This method will use the DELETE() function from L to build the request. See L for a details on how to pass form content and other advanced features. =head2 get my $res = $ua->get( $url ); my $res = $ua->get( $url , $field_name => $value, ... ); This method will dispatch a C request on the given URL. Further arguments can be given to initialize the headers of the request. These are given as separate name/value pairs. The return value is a response object. See L for a description of the interface it provides. There will still be a response object returned when LWP can't connect to the server specified in the URL or when other failures in protocol handlers occur. These internal responses use the standard HTTP status codes, so the responses can't be differentiated by testing the response status code alone. Error responses that LWP generates internally will have the "Client-Warning" header set to the value "Internal response". If you need to differentiate these internal responses from responses that a remote server actually generates, you need to test this header value. Fields names that start with ":" are special. These will not initialize headers of the request but will determine how the response content is treated. The following special field names are recognized: :content_file => $filename :content_cb => \&callback :read_size_hint => $bytes If a $filename is provided with the C<:content_file> option, then the response content will be saved here instead of in the response object. If a callback is provided with the C<:content_cb> option then this function will be called for each chunk of the response content as it is received from the server. If neither of these options are given, then the response content will accumulate in the response object itself. This might not be suitable for very large response bodies. Only one of C<:content_file> or C<:content_cb> can be specified. The content of unsuccessful responses will always accumulate in the response object itself, regardless of the C<:content_file> or C<:content_cb> options passed in. Note that errors writing to the content file (for example due to permission denied or the filesystem being full) will be reported via the C or C response headers, and not the C method. The C<:read_size_hint> option is passed to the protocol module which will try to read data from the server in chunks of this size. A smaller value for the C<:read_size_hint> will result in a higher number of callback invocations. The callback function is called with 3 arguments: a chunk of data, a reference to the response object, and a reference to the protocol object. The callback can abort the request by invoking die(). The exception message will show up as the "X-Died" header field in the response returned by the get() function. =head2 head my $res = $ua->head( $url ); my $res = $ua->head( $url , $field_name => $value, ... ); This method will dispatch a C request on the given URL. Otherwise it works like the L method described above. =head2 is_protocol_supported my $bool = $ua->is_protocol_supported( $scheme ); You can use this method to test whether this user agent object supports the specified C. (The C might be a string (like C or C) or it might be an L object reference.) Whether a scheme is supported is determined by the user agent's C or C lists (if any), and by the capabilities of LWP. I.e., this will return true only if LWP supports this protocol I it's permitted for this particular object. =head2 is_online my $bool = $ua->is_online; Tries to determine if you have access to the Internet. Returns C<1> (true) if the built-in heuristics determine that the user agent is able to access the Internet (over HTTP) or C<0> (false). See also L. =head2 mirror my $res = $ua->mirror( $url, $filename ); This method will get the document identified by URL and store it in file called C<$filename>. If the file already exists, then the request will contain an C header matching the modification time of the file. If the document on the server has not changed since this time, then nothing happens. If the document has been updated, it will be downloaded again. The modification time of the file will be forced to match that of the server. The return value is an L object. =head2 post my $res = $ua->post( $url, \%form ); my $res = $ua->post( $url, \@form ); my $res = $ua->post( $url, \%form, $field_name => $value, ... ); my $res = $ua->post( $url, $field_name => $value, Content => \%form ); my $res = $ua->post( $url, $field_name => $value, Content => \@form ); my $res = $ua->post( $url, $field_name => $value, Content => $content ); This method will dispatch a C request on the given URL, with C<%form> or C<@form> providing the key/value pairs for the fill-in form content. Additional headers and content options are the same as for the L method. This method will use the C function from L to build the request. See L for a details on how to pass form content and other advanced features. =head2 put # Any version of HTTP::Message works with this form: my $res = $ua->put( $url, $field_name => $value, Content => $content ); # Using hash or array references requires HTTP::Message >= 6.07 use HTTP::Request 6.07; my $res = $ua->put( $url, \%form ); my $res = $ua->put( $url, \@form ); my $res = $ua->put( $url, \%form, $field_name => $value, ... ); my $res = $ua->put( $url, $field_name => $value, Content => \%form ); my $res = $ua->put( $url, $field_name => $value, Content => \@form ); This method will dispatch a C request on the given URL, with C<%form> or C<@form> providing the key/value pairs for the fill-in form content. Additional headers and content options are the same as for the L method. CAVEAT: This method can only accept content that is in key-value pairs when using L prior to version C<6.07>. Any use of hash or array references will result in an error prior to version C<6.07>. This method will use the C function from L to build the request. See L for a details on how to pass form content and other advanced features. =head2 request my $res = $ua->request( $request ); my $res = $ua->request( $request, $content_file ); my $res = $ua->request( $request, $content_cb ); my $res = $ua->request( $request, $content_cb, $read_size_hint ); This method will dispatch the given C<$request> object. Normally this will be an instance of the L class, but any object with a similar interface will do. The return value is an L object. The C method will process redirects and authentication responses transparently. This means that it may actually send several simple requests via the L method described below. The request methods described above; L, L, L and L will all dispatch the request they build via this method. They are convenience methods that simply hide the creation of the request object for you. The C<$content_file>, C<$content_cb> and C<$read_size_hint> all correspond to options described with the L method above. Note that errors writing to the content file (for example due to permission denied or the filesystem being full) will be reported via the C or C response headers, and not the C method. You are allowed to use a CODE reference as C in the request object passed in. The C function should return the content when called. The content can be returned in chunks. The content function will be invoked repeatedly until it return an empty string to signal that there is no more content. =head2 simple_request my $request = HTTP::Request->new( ... ); my $res = $ua->simple_request( $request ); my $res = $ua->simple_request( $request, $content_file ); my $res = $ua->simple_request( $request, $content_cb ); my $res = $ua->simple_request( $request, $content_cb, $read_size_hint ); This method dispatches a single request and returns the response received. Arguments are the same as for the L described above. The difference from L is that C will not try to handle redirects or authentication responses. The L method will, in fact, invoke this method for each simple request it sends. =head1 CALLBACK METHODS The following methods will be invoked as requests are processed. These methods are documented here because subclasses of L might want to override their behaviour. =head2 get_basic_credentials # This checks wantarray and can either return an array: my ($user, $pass) = $ua->get_basic_credentials( $realm, $uri, $isproxy ); # or a string that looks like "user:pass" my $creds = $ua->get_basic_credentials($realm, $uri, $isproxy); This is called by L to retrieve credentials for documents protected by Basic or Digest Authentication. The arguments passed in is the C<$realm> provided by the server, the C<$uri> requested and a C to indicate if this is authentication against a proxy server. The method should return a username and password. It should return an empty list to abort the authentication resolution attempt. Subclasses can override this method to prompt the user for the information. An example of this can be found in C program distributed with this library. The base implementation simply checks a set of pre-stored member variables, set up with the L method. =head2 prepare_request $request = $ua->prepare_request( $request ); This method is invoked by L. Its task is to modify the given C<$request> object by setting up various headers based on the attributes of the user agent. The return value should normally be the C<$request> object passed in. If a different request object is returned it will be the one actually processed. The headers affected by the base implementation are; C, C, C and C. =head2 progress my $prog = $ua->progress( $status, $request_or_response ); This is called frequently as the response is received regardless of how the content is processed. The method is called with C<$status> "begin" at the start of processing the request and with C<$state> "end" before the request method returns. In between these C<$status> will be the fraction of the response currently received or the string "tick" if the fraction can't be calculated. When C<$status> is "begin" the second argument is the L object, otherwise it is the L object. =head2 redirect_ok my $bool = $ua->redirect_ok( $prospective_request, $response ); This method is called by L before it tries to follow a redirection to the request in C<$response>. This should return a true value if this redirection is permissible. The C<$prospective_request> will be the request to be sent if this method returns true. The base implementation will return false unless the method is in the object's C list, false if the proposed redirection is to a C URL, and true otherwise. =head1 SEE ALSO See L for a complete overview of libwww-perl5. See L and the scripts F and F for examples of usage. See L and L for a description of the message objects dispatched and received. See L and L for other ways to build request objects. See L and L for examples of more specialized user agents based on L. =head1 COPYRIGHT AND LICENSE Copyright 1995-2009 Gisle Aas. This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. =cut darwin-perl-lib/LWP/Protocol/cpan.pm000444 000765 000024 00000002540 13167163507 021505 0ustar00ocsinventorystaff000000 000000 package LWP::Protocol::cpan; $LWP::Protocol::cpan::VERSION = '6.27'; use strict; use base qw(LWP::Protocol); require URI; require HTTP::Status; require HTTP::Response; our $CPAN; unless ($CPAN) { # Try to find local CPAN mirror via $CPAN::Config eval { require CPAN::Config; if($CPAN::Config) { my $urls = $CPAN::Config->{urllist}; if (ref($urls) eq "ARRAY") { my $file; for (@$urls) { if (/^file:/) { $file = $_; last; } } if ($file) { $CPAN = $file; } else { $CPAN = $urls->[0]; } } } }; $CPAN ||= "http://cpan.org/"; # last resort } # ensure that we don't chop of last part $CPAN .= "/" unless $CPAN =~ m,/$,; sub request { my($self, $request, $proxy, $arg, $size) = @_; # check proxy if (defined $proxy) { return HTTP::Response->new(HTTP::Status::RC_BAD_REQUEST, 'You can not proxy with cpan'); } # check method my $method = $request->method; unless ($method eq 'GET' || $method eq 'HEAD') { return HTTP::Response->new(HTTP::Status::RC_BAD_REQUEST, 'Library does not allow method ' . "$method for 'cpan:' URLs"); } my $path = $request->uri->path; $path =~ s,^/,,; my $response = HTTP::Response->new(HTTP::Status::RC_FOUND); $response->header("Location" => URI->new_abs($path, $CPAN)); $response; } 1; darwin-perl-lib/LWP/Protocol/data.pm000444 000765 000024 00000002340 13167163507 021473 0ustar00ocsinventorystaff000000 000000 package LWP::Protocol::data; $LWP::Protocol::data::VERSION = '6.27'; # Implements access to data:-URLs as specified in RFC 2397 use strict; require HTTP::Response; require HTTP::Status; use base qw(LWP::Protocol); use HTTP::Date qw(time2str); require LWP; # needs version number sub request { my($self, $request, $proxy, $arg, $size) = @_; # check proxy if (defined $proxy) { return HTTP::Response->new( HTTP::Status::RC_BAD_REQUEST, 'You can not proxy with data'); } # check method my $method = $request->method; unless ($method eq 'GET' || $method eq 'HEAD') { return HTTP::Response->new( HTTP::Status::RC_BAD_REQUEST, 'Library does not allow method ' . "$method for 'data:' URLs"); } my $url = $request->uri; my $response = HTTP::Response->new( HTTP::Status::RC_OK, "Document follows"); my $media_type = $url->media_type; my $data = $url->data; $response->header('Content-Type' => $media_type, 'Content-Length' => length($data), 'Date' => time2str(time), 'Server' => "libwww-perl-internal/$LWP::VERSION" ); $data = "" if $method eq "HEAD"; return $self->collect_once($arg, $response, $data); } 1; darwin-perl-lib/LWP/Protocol/file.pm000444 000765 000024 00000007402 13167163507 021505 0ustar00ocsinventorystaff000000 000000 package LWP::Protocol::file; $LWP::Protocol::file::VERSION = '6.27'; use base qw(LWP::Protocol); use strict; require LWP::MediaTypes; require HTTP::Request; require HTTP::Response; require HTTP::Status; require HTTP::Date; sub request { my($self, $request, $proxy, $arg, $size) = @_; $size = 4096 unless defined $size and $size > 0; # check proxy if (defined $proxy) { return HTTP::Response->new( HTTP::Status::RC_BAD_REQUEST, 'You can not proxy through the filesystem'); } # check method my $method = $request->method; unless ($method eq 'GET' || $method eq 'HEAD') { return HTTP::Response->new( HTTP::Status::RC_BAD_REQUEST, 'Library does not allow method ' . "$method for 'file:' URLs"); } # check url my $url = $request->uri; my $scheme = $url->scheme; if ($scheme ne 'file') { return HTTP::Response->new( HTTP::Status::RC_INTERNAL_SERVER_ERROR, "LWP::Protocol::file::request called for '$scheme'"); } # URL OK, look at file my $path = $url->file; # test file exists and is readable unless (-e $path) { return HTTP::Response->new( HTTP::Status::RC_NOT_FOUND, "File `$path' does not exist"); } unless (-r _) { return HTTP::Response->new( HTTP::Status::RC_FORBIDDEN, 'User does not have read permission'); } # looks like file exists my($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$filesize, $atime,$mtime,$ctime,$blksize,$blocks) = stat(_); # XXX should check Accept headers? # check if-modified-since my $ims = $request->header('If-Modified-Since'); if (defined $ims) { my $time = HTTP::Date::str2time($ims); if (defined $time and $time >= $mtime) { return HTTP::Response->new( HTTP::Status::RC_NOT_MODIFIED, "$method $path"); } } # Ok, should be an OK response by now... my $response = HTTP::Response->new( HTTP::Status::RC_OK ); # fill in response headers $response->header('Last-Modified', HTTP::Date::time2str($mtime)); if (-d _) { # If the path is a directory, process it # generate the HTML for directory opendir(D, $path) or return HTTP::Response->new( HTTP::Status::RC_INTERNAL_SERVER_ERROR, "Cannot read directory '$path': $!"); my(@files) = sort readdir(D); closedir(D); # Make directory listing require URI::Escape; require HTML::Entities; my $pathe = $path . ( $^O eq 'MacOS' ? ':' : '/'); for (@files) { my $furl = URI::Escape::uri_escape($_); if ( -d "$pathe$_" ) { $furl .= '/'; $_ .= '/'; } my $desc = HTML::Entities::encode($_); $_ = qq{
  • $desc}; } # Ensure that the base URL is "/" terminated my $base = $url->clone; unless ($base->path =~ m|/$|) { $base->path($base->path . "/"); } my $html = join("\n", "\n", "Directory $path", "", "\n", "

    Directory listing of $path

    ", "
      ", @files, "
    ", "\n\n"); $response->header('Content-Type', 'text/html'); $response->header('Content-Length', length $html); $html = "" if $method eq "HEAD"; return $self->collect_once($arg, $response, $html); } # path is a regular file $response->header('Content-Length', $filesize); LWP::MediaTypes::guess_media_type($path, $response); # read the file if ($method ne "HEAD") { open(F, $path) or return new HTTP::Response(HTTP::Status::RC_INTERNAL_SERVER_ERROR, "Cannot read file '$path': $!"); binmode(F); $response = $self->collect($arg, $response, sub { my $content = ""; my $bytes = sysread(F, $content, $size); return \$content if $bytes > 0; return \ ""; }); close(F); } $response; } 1; darwin-perl-lib/LWP/Protocol/ftp.pm000444 000765 000024 00000045334 13167163507 021365 0ustar00ocsinventorystaff000000 000000 package LWP::Protocol::ftp; $LWP::Protocol::ftp::VERSION = '6.27'; # Implementation of the ftp protocol (RFC 959). We let the Net::FTP # package do all the dirty work. use base qw(LWP::Protocol); use strict; use Carp (); use HTTP::Status (); use HTTP::Negotiate (); use HTTP::Response (); use LWP::MediaTypes (); use File::Listing (); { package LWP::Protocol::MyFTP; $LWP::Protocol::MyFTP::VERSION = '6.27'; use strict; use base qw(Net::FTP); sub new { my $class = shift; my $self = $class->SUPER::new(@_) || return undef; my $mess = $self->message; # welcome message $mess =~ s|\n.*||s; # only first line left $mess =~ s|\s*ready\.?$||; # Make the version number more HTTP like $mess =~ s|\s*\(Version\s*|/| and $mess =~ s|\)$||; ${*$self}{myftp_server} = $mess; #$response->header("Server", $mess); $self; } sub http_server { my $self = shift; ${*$self}{myftp_server}; } sub home { my $self = shift; my $old = ${*$self}{myftp_home}; if (@_) { ${*$self}{myftp_home} = shift; } $old; } sub go_home { my $self = shift; $self->cwd(${*$self}{myftp_home}); } sub request_count { my $self = shift; ++${*$self}{myftp_reqcount}; } sub ping { my $self = shift; return $self->go_home; } } sub _connect { my ($self, $host, $port, $user, $account, $password, $timeout) = @_; my $key; my $conn_cache = $self->{ua}{conn_cache}; if ($conn_cache) { $key = "$host:$port:$user"; $key .= ":$account" if defined($account); if (my $ftp = $conn_cache->withdraw("ftp", $key)) { if ($ftp->ping) { # save it again $conn_cache->deposit("ftp", $key, $ftp); return $ftp; } } } # try to make a connection my $ftp = LWP::Protocol::MyFTP->new( $host, Port => $port, Timeout => $timeout, LocalAddr => $self->{ua}{local_address}, ); # XXX Should be some what to pass on 'Passive' (header??) unless ($ftp) { $@ =~ s/^Net::FTP: //; return HTTP::Response->new(HTTP::Status::RC_INTERNAL_SERVER_ERROR, $@); } unless ($ftp->login($user, $password, $account)) { # Unauthorized. Let's fake a RC_UNAUTHORIZED response my $mess = scalar($ftp->message); $mess =~ s/\n$//; my $res = HTTP::Response->new(HTTP::Status::RC_UNAUTHORIZED, $mess); $res->header("Server", $ftp->http_server); $res->header("WWW-Authenticate", qq(Basic Realm="FTP login")); return $res; } my $home = $ftp->pwd; $ftp->home($home); $conn_cache->deposit("ftp", $key, $ftp) if $conn_cache; return $ftp; } sub request { my ($self, $request, $proxy, $arg, $size, $timeout) = @_; $size = 4096 unless $size; # check proxy if (defined $proxy) { return HTTP::Response->new(HTTP::Status::RC_BAD_REQUEST, 'You can not proxy through the ftp'); } my $url = $request->uri; if ($url->scheme ne 'ftp') { my $scheme = $url->scheme; return HTTP::Response->new(HTTP::Status::RC_INTERNAL_SERVER_ERROR, "LWP::Protocol::ftp::request called for '$scheme'"); } # check method my $method = $request->method; unless ($method eq 'GET' || $method eq 'HEAD' || $method eq 'PUT') { return HTTP::Response->new(HTTP::Status::RC_BAD_REQUEST, 'Library does not allow method ' . "$method for 'ftp:' URLs"); } my $host = $url->host; my $port = $url->port; my $user = $url->user; my $password = $url->password; # If a basic authorization header is present than we prefer these over # the username/password specified in the URL. { my ($u, $p) = $request->authorization_basic; if (defined $u) { $user = $u; $password = $p; } } # We allow the account to be specified in the "Account" header my $account = $request->header('Account'); my $ftp = $self->_connect($host, $port, $user, $account, $password, $timeout); return $ftp if ref($ftp) eq "HTTP::Response"; # ugh! # Create an initial response object my $response = HTTP::Response->new(HTTP::Status::RC_OK, "OK"); $response->header(Server => $ftp->http_server); $response->header('Client-Request-Num' => $ftp->request_count); $response->request($request); # Get & fix the path my @path = grep {length} $url->path_segments; my $remote_file = pop(@path); $remote_file = '' unless defined $remote_file; my $type; if (ref $remote_file) { my @params; ($remote_file, @params) = @$remote_file; for (@params) { $type = $_ if s/^type=//; } } if ($type && $type eq 'a') { $ftp->ascii; } else { $ftp->binary; } for (@path) { unless ($ftp->cwd($_)) { return HTTP::Response->new(HTTP::Status::RC_NOT_FOUND, "Can't chdir to $_"); } } if ($method eq 'GET' || $method eq 'HEAD') { if (my $mod_time = $ftp->mdtm($remote_file)) { $response->last_modified($mod_time); if (my $ims = $request->if_modified_since) { if ($mod_time <= $ims) { $response->code(HTTP::Status::RC_NOT_MODIFIED); $response->message("Not modified"); return $response; } } } # We'll use this later to abort the transfer if necessary. # if $max_size is defined, we need to abort early. Otherwise, it's # a normal transfer my $max_size = undef; # Set resume location, if the client requested it if ($request->header('Range') && $ftp->supported('REST')) { my $range_info = $request->header('Range'); # Change bytes=2772992-6781209 to just 2772992 my ($start_byte, $end_byte) = $range_info =~ /.*=\s*(\d+)-(\d+)?/; if (defined $start_byte && !defined $end_byte) { # open range -- only the start is specified $ftp->restart($start_byte); # don't define $max_size, we don't want to abort early } elsif (defined $start_byte && defined $end_byte && $start_byte >= 0 && $end_byte >= $start_byte) { $ftp->restart($start_byte); $max_size = $end_byte - $start_byte; } else { return HTTP::Response->new(HTTP::Status::RC_BAD_REQUEST, 'Incorrect syntax for Range request'); } } elsif ($request->header('Range') && !$ftp->supported('REST')) { return HTTP::Response->new(HTTP::Status::RC_NOT_IMPLEMENTED, "Server does not support resume." ); } my $data; # the data handle if (length($remote_file) and $data = $ftp->retr($remote_file)) { my ($type, @enc) = LWP::MediaTypes::guess_media_type($remote_file); $response->header('Content-Type', $type) if $type; for (@enc) { $response->push_header('Content-Encoding', $_); } my $mess = $ftp->message; if ($mess =~ /\((\d+)\s+bytes\)/) { $response->header('Content-Length', "$1"); } if ($method ne 'HEAD') { # Read data from server $response = $self->collect( $arg, $response, sub { my $content = ''; my $result = $data->read($content, $size); # Stop early if we need to. if (defined $max_size) { # We need an interface to Net::FTP::dataconn for getting # the number of bytes already read my $bytes_received = $data->bytes_read(); # We were already over the limit. (Should only happen # once at the end.) if ($bytes_received - length($content) > $max_size) { $content = ''; } # We just went over the limit elsif ($bytes_received > $max_size) { # Trim content $content = substr($content, 0, $max_size - ($bytes_received - length($content))); } # We're under the limit else { } } return \$content; } ); } # abort is needed for HEAD, it's == close if the transfer has # already completed. unless ($data->abort) { # Something did not work too well. Note that we treat # responses to abort() with code 0 in case of HEAD as ok # (at least wu-ftpd 2.6.1(1) does that). if ($method ne 'HEAD' || $ftp->code != 0) { $response->code(HTTP::Status::RC_INTERNAL_SERVER_ERROR); $response->message("FTP close response: " . $ftp->code . " " . $ftp->message); } } } elsif (!length($remote_file) || ($ftp->code >= 400 && $ftp->code < 600)) { # not a plain file, try to list instead if (length($remote_file) && !$ftp->cwd($remote_file)) { return HTTP::Response->new(HTTP::Status::RC_NOT_FOUND, "File '$remote_file' not found" ); } # It should now be safe to try to list the directory my @lsl = $ftp->dir; # Try to figure out if the user want us to convert the # directory listing to HTML. my @variants = ( ['html', 0.60, 'text/html'], ['dir', 1.00, 'text/ftp-dir-listing'] ); #$HTTP::Negotiate::DEBUG=1; my $prefer = HTTP::Negotiate::choose(\@variants, $request); my $content = ''; if (!defined($prefer)) { return HTTP::Response->new(HTTP::Status::RC_NOT_ACCEPTABLE, "Neither HTML nor directory listing wanted"); } elsif ($prefer eq 'html') { $response->header('Content-Type' => 'text/html'); $content = "File Listing\n"; my $base = $request->uri->clone; my $path = $base->path; $base->path("$path/") unless $path =~ m|/$|; $content .= qq(\n\n); $content .= "\n
      \n"; for (File::Listing::parse_dir(\@lsl, 'GMT')) { my ($name, $type, $size, $mtime, $mode) = @$_; $content .= qq(
    • $name); $content .= " $size bytes" if $type eq 'f'; $content .= "\n"; } $content .= "
    \n"; } else { $response->header('Content-Type', 'text/ftp-dir-listing'); $content = join("\n", @lsl, ''); } $response->header('Content-Length', length($content)); if ($method ne 'HEAD') { $response = $self->collect_once($arg, $response, $content); } } else { my $res = HTTP::Response->new(HTTP::Status::RC_BAD_REQUEST, "FTP return code " . $ftp->code); $res->content_type("text/plain"); $res->content($ftp->message); return $res; } } elsif ($method eq 'PUT') { # method must be PUT unless (length($remote_file)) { return HTTP::Response->new(HTTP::Status::RC_BAD_REQUEST, "Must have a file name to PUT to" ); } my $data; if ($data = $ftp->stor($remote_file)) { my $content = $request->content; my $bytes = 0; if (defined $content) { if (ref($content) eq 'SCALAR') { $bytes = $data->write($$content, length($$content)); } elsif (ref($content) eq 'CODE') { my ($buf, $n); while (length($buf = &$content)) { $n = $data->write($buf, length($buf)); last unless $n; $bytes += $n; } } elsif (!ref($content)) { if (defined $content && length($content)) { $bytes = $data->write($content, length($content)); } } else { die "Bad content"; } } $data->close; $response->code(HTTP::Status::RC_CREATED); $response->header('Content-Type', 'text/plain'); $response->content("$bytes bytes stored as $remote_file on $host\n") } else { my $res = HTTP::Response->new(HTTP::Status::RC_BAD_REQUEST, "FTP return code " . $ftp->code); $res->content_type("text/plain"); $res->content($ftp->message); return $res; } } else { return HTTP::Response->new(HTTP::Status::RC_BAD_REQUEST, "Illegal method $method"); } $response; } 1; __END__ # This is what RFC 1738 has to say about FTP access: # -------------------------------------------------- # # 3.2. FTP # # The FTP URL scheme is used to designate files and directories on # Internet hosts accessible using the FTP protocol (RFC959). # # A FTP URL follow the syntax described in Section 3.1. If : is # omitted, the port defaults to 21. # # 3.2.1. FTP Name and Password # # A user name and password may be supplied; they are used in the ftp # "USER" and "PASS" commands after first making the connection to the # FTP server. If no user name or password is supplied and one is # requested by the FTP server, the conventions for "anonymous" FTP are # to be used, as follows: # # The user name "anonymous" is supplied. # # The password is supplied as the Internet e-mail address # of the end user accessing the resource. # # If the URL supplies a user name but no password, and the remote # server requests a password, the program interpreting the FTP URL # should request one from the user. # # 3.2.2. FTP url-path # # The url-path of a FTP URL has the following syntax: # # //...//;type= # # Where through and are (possibly encoded) strings # and is one of the characters "a", "i", or "d". The part # ";type=" may be omitted. The and parts may be # empty. The whole url-path may be omitted, including the "/" # delimiting it from the prefix containing user, password, host, and # port. # # The url-path is interpreted as a series of FTP commands as follows: # # Each of the elements is to be supplied, sequentially, as the # argument to a CWD (change working directory) command. # # If the typecode is "d", perform a NLST (name list) command with # as the argument, and interpret the results as a file # directory listing. # # Otherwise, perform a TYPE command with as the argument, # and then access the file whose name is (for example, using # the RETR command.) # # Within a name or CWD component, the characters "/" and ";" are # reserved and must be encoded. The components are decoded prior to # their use in the FTP protocol. In particular, if the appropriate FTP # sequence to access a particular file requires supplying a string # containing a "/" as an argument to a CWD or RETR command, it is # necessary to encode each "/". # # For example, the URL is # interpreted by FTP-ing to "host.dom", logging in as "myname" # (prompting for a password if it is asked for), and then executing # "CWD /etc" and then "RETR motd". This has a different meaning from # which would "CWD etc" and then # "RETR motd"; the initial "CWD" might be executed relative to the # default directory for "myname". On the other hand, # , would "CWD " with a null # argument, then "CWD etc", and then "RETR motd". # # FTP URLs may also be used for other operations; for example, it is # possible to update a file on a remote file server, or infer # information about it from the directory listings. The mechanism for # doing so is not spelled out here. # # 3.2.3. FTP Typecode is Optional # # The entire ;type= part of a FTP URL is optional. If it is # omitted, the client program interpreting the URL must guess the # appropriate mode to use. In general, the data content type of a file # can only be guessed from the name, e.g., from the suffix of the name; # the appropriate type code to be used for transfer of the file can # then be deduced from the data content of the file. # # 3.2.4 Hierarchy # # For some file systems, the "/" used to denote the hierarchical # structure of the URL corresponds to the delimiter used to construct a # file name hierarchy, and thus, the filename will look similar to the # URL path. This does NOT mean that the URL is a Unix filename. # # 3.2.5. Optimization # # Clients accessing resources via FTP may employ additional heuristics # to optimize the interaction. For some FTP servers, for example, it # may be reasonable to keep the control connection open while accessing # multiple URLs from the same server. However, there is no common # hierarchical model to the FTP protocol, so if a directory change # command has been given, it is impossible in general to deduce what # sequence should be given to navigate to another directory for a # second retrieval, if the paths are different. The only reliable # algorithm is to disconnect and reestablish the control connection. darwin-perl-lib/LWP/Protocol/GHTTP.pm000444 000765 000024 00000003346 13167163507 021457 0ustar00ocsinventorystaff000000 000000 package LWP::Protocol::GHTTP; # You can tell LWP to use this module for 'http' requests by running # code like this before you make requests: # # require LWP::Protocol::GHTTP; # LWP::Protocol::implementor('http', 'LWP::Protocol::GHTTP'); # use strict; use vars qw(@ISA); require LWP::Protocol; @ISA=qw(LWP::Protocol); require HTTP::Response; require HTTP::Status; use HTTP::GHTTP qw(METHOD_GET METHOD_HEAD METHOD_POST); my %METHOD = ( GET => METHOD_GET, HEAD => METHOD_HEAD, POST => METHOD_POST, ); sub request { my($self, $request, $proxy, $arg, $size, $timeout) = @_; my $method = $request->method; unless (exists $METHOD{$method}) { return HTTP::Response->new(&HTTP::Status::RC_BAD_REQUEST, "Bad method '$method'"); } my $r = HTTP::GHTTP->new($request->uri); # XXX what headers for repeated headers here? $request->headers->scan(sub { $r->set_header(@_)}); $r->set_type($METHOD{$method}); # XXX should also deal with subroutine content. my $cref = $request->content_ref; $r->set_body($$cref) if length($$cref); # XXX is this right $r->set_proxy($proxy->as_string) if $proxy; $r->process_request; my $response = HTTP::Response->new($r->get_status); # XXX How can get the headers out of $r?? This way is too stupid. my @headers; eval { # Wrapped in eval because this method is not always available @headers = $r->get_headers; }; @headers = qw(Date Connection Server Content-type Accept-Ranges Server Content-Length Last-Modified ETag) if $@; for (@headers) { my $v = $r->get_header($_); $response->header($_ => $v) if defined $v; } return $self->collect_once($arg, $response, $r->get_body); } 1; darwin-perl-lib/LWP/Protocol/gopher.pm000444 000765 000024 00000013160 13167163507 022050 0ustar00ocsinventorystaff000000 000000 package LWP::Protocol::gopher; $LWP::Protocol::gopher::VERSION = '6.27'; # Implementation of the gopher protocol (RFC 1436) # # This code is based on 'wwwgopher.pl,v 0.10 1994/10/17 18:12:34 shelden' # which in turn is a vastly modified version of Oscar's http'get() # dated 28/3/94 in # including contributions from Marc van Heyningen and Martijn Koster. use strict; require HTTP::Response; require HTTP::Status; require IO::Socket; require IO::Select; use base qw(LWP::Protocol); my %gopher2mimetype = ( '0' => 'text/plain', # 0 file '1' => 'text/html', # 1 menu # 2 CSO phone-book server # 3 Error '4' => 'application/mac-binhex40', # 4 BinHexed Macintosh file '5' => 'application/zip', # 5 DOS binary archive of some sort '6' => 'application/octet-stream', # 6 UNIX uuencoded file. '7' => 'text/html', # 7 Index-Search server # 8 telnet session '9' => 'application/octet-stream', # 9 binary file 'h' => 'text/html', # html 'g' => 'image/gif', # gif 'I' => 'image/*', # some kind of image ); my %gopher2encoding = ( '6' => 'x_uuencode', # 6 UNIX uuencoded file. ); sub request { my($self, $request, $proxy, $arg, $size, $timeout) = @_; $size = 4096 unless $size; # check proxy if (defined $proxy) { return HTTP::Response->new(HTTP::Status::RC_BAD_REQUEST, 'You can not proxy through the gopher'); } my $url = $request->uri; die "bad scheme" if $url->scheme ne 'gopher'; my $method = $request->method; unless ($method eq 'GET' || $method eq 'HEAD') { return HTTP::Response->new(HTTP::Status::RC_BAD_REQUEST, 'Library does not allow method ' . "$method for 'gopher:' URLs"); } my $gophertype = $url->gopher_type; unless (exists $gopher2mimetype{$gophertype}) { return HTTP::Response->new(HTTP::Status::RC_NOT_IMPLEMENTED, 'Library does not support gophertype ' . $gophertype); } my $response = HTTP::Response->new(HTTP::Status::RC_OK, "OK"); $response->header('Content-type' => $gopher2mimetype{$gophertype} || 'text/plain'); $response->header('Content-Encoding' => $gopher2encoding{$gophertype}) if exists $gopher2encoding{$gophertype}; if ($method eq 'HEAD') { # XXX: don't even try it so we set this header $response->header('Client-Warning' => 'Client answer only'); return $response; } if ($gophertype eq '7' && ! $url->search) { # the url is the prompt for a gopher search; supply boiler-plate return $self->collect_once($arg, $response, <<"EOT"); Gopher Index

    $url
    Gopher Search

    This is a searchable Gopher index. Use the search function of your browser to enter search terms. EOT } my $host = $url->host; my $port = $url->port; my $requestLine = ""; my $selector = $url->selector; if (defined $selector) { $requestLine .= $selector; my $search = $url->search; if (defined $search) { $requestLine .= "\t$search"; my $string = $url->string; if (defined $string) { $requestLine .= "\t$string"; } } } $requestLine .= "\015\012"; # potential request headers are just ignored # Ok, lets make the request my $socket = IO::Socket::INET->new(PeerAddr => $host, PeerPort => $port, LocalAddr => $self->{ua}{local_address}, Proto => 'tcp', Timeout => $timeout); die "Can't connect to $host:$port" unless $socket; my $sel = IO::Select->new($socket); { die "write timeout" if $timeout && !$sel->can_write($timeout); my $n = syswrite($socket, $requestLine, length($requestLine)); die $! unless defined($n); die "short write" if $n != length($requestLine); } my $user_arg = $arg; # must handle menus in a special way since they are to be # converted to HTML. Undefing $arg ensures that the user does # not see the data before we get a change to convert it. $arg = undef if $gophertype eq '1' || $gophertype eq '7'; # collect response my $buf = ''; $response = $self->collect($arg, $response, sub { die "read timeout" if $timeout && !$sel->can_read($timeout); my $n = sysread($socket, $buf, $size); die $! unless defined($n); return \$buf; } ); # Convert menu to HTML and return data to user. if ($gophertype eq '1' || $gophertype eq '7') { my $content = menu2html($response->content); if (defined $user_arg) { $response = $self->collect_once($user_arg, $response, $content); } else { $response->content($content); } } $response; } sub gopher2url { my($gophertype, $path, $host, $port) = @_; my $url; if ($gophertype eq '8' || $gophertype eq 'T') { # telnet session $url = $HTTP::URI_CLASS->new($gophertype eq '8' ? 'telnet:':'tn3270:'); $url->user($path) if defined $path; } else { $path = URI::Escape::uri_escape($path); $url = $HTTP::URI_CLASS->new("gopher:/$gophertype$path"); } $url->host($host); $url->port($port); $url; } sub menu2html { my($menu) = @_; $menu =~ s/\015//g; # remove carriage return my $tmp = <<"EOT"; Gopher menu

    Gopher menu

    EOT for (split("\n", $menu)) { last if /^\./; my($pretty, $path, $host, $port) = split("\t"); $pretty =~ s/^(.)//; my $type = $1; my $url = gopher2url($type, $path, $host, $port)->as_string; $tmp .= qq{$pretty
    \n}; } $tmp .= "\n\n"; $tmp; } 1; darwin-perl-lib/LWP/Protocol/http.pm000444 000765 000024 00000035314 13167163507 021550 0ustar00ocsinventorystaff000000 000000 package LWP::Protocol::http; $LWP::Protocol::http::VERSION = '6.27'; use strict; require HTTP::Response; require HTTP::Status; require Net::HTTP; use base qw(LWP::Protocol); our @EXTRA_SOCK_OPTS; my $CRLF = "\015\012"; sub _new_socket { my($self, $host, $port, $timeout) = @_; # IPv6 literal IP address should be [bracketed] to remove # ambiguity between ip address and port number. if ( ($host =~ /:/) && ($host !~ /^\[/) ) { $host = "[$host]"; } local($^W) = 0; # IO::Socket::INET can be noisy my $sock = $self->socket_class->new(PeerAddr => $host, PeerPort => $port, LocalAddr => $self->{ua}{local_address}, Proto => 'tcp', Timeout => $timeout, KeepAlive => !!$self->{ua}{conn_cache}, SendTE => 1, $self->_extra_sock_opts($host, $port), ); unless ($sock) { # IO::Socket::INET leaves additional error messages in $@ my $status = "Can't connect to $host:$port"; if ($@ =~ /\bconnect: (.*)/ || $@ =~ /\b(Bad hostname)\b/ || $@ =~ /\b(nodename nor servname provided, or not known)\b/ || $@ =~ /\b(certificate verify failed)\b/ || $@ =~ /\b(Crypt-SSLeay can't verify hostnames)\b/ ) { $status .= " ($1)"; } die "$status\n\n$@"; } # perl 5.005's IO::Socket does not have the blocking method. eval { $sock->blocking(0); }; $sock; } sub socket_type { return "http"; } sub socket_class { my $self = shift; (ref($self) || $self) . "::Socket"; } sub _extra_sock_opts # to be overridden by subclass { return @EXTRA_SOCK_OPTS; } sub _check_sock { #my($self, $req, $sock) = @_; } sub _get_sock_info { my($self, $res, $sock) = @_; if (defined(my $peerhost = $sock->peerhost)) { $res->header("Client-Peer" => "$peerhost:" . $sock->peerport); } } sub _fixup_header { my($self, $h, $url, $proxy) = @_; # Extract 'Host' header my $hhost = $url->authority; if ($hhost =~ s/^([^\@]*)\@//) { # get rid of potential "user:pass@" # add authorization header if we need them. HTTP URLs do # not really support specification of user and password, but # we allow it. if (defined($1) && not $h->header('Authorization')) { require URI::Escape; $h->authorization_basic(map URI::Escape::uri_unescape($_), split(":", $1, 2)); } } $h->init_header('Host' => $hhost); if ($proxy && $url->scheme ne 'https') { # Check the proxy URI's userinfo() for proxy credentials # export http_proxy="http://proxyuser:proxypass@proxyhost:port". # For https only the initial CONNECT requests needs authorization. my $p_auth = $proxy->userinfo(); if(defined $p_auth) { require URI::Escape; $h->proxy_authorization_basic(map URI::Escape::uri_unescape($_), split(":", $p_auth, 2)) } } } sub hlist_remove { my($hlist, $k) = @_; $k = lc $k; for (my $i = @$hlist - 2; $i >= 0; $i -= 2) { next unless lc($hlist->[$i]) eq $k; splice(@$hlist, $i, 2); } } sub request { my($self, $request, $proxy, $arg, $size, $timeout) = @_; $size ||= 4096; # check method my $method = $request->method; unless ($method =~ /^[A-Za-z0-9_!\#\$%&\'*+\-.^\`|~]+$/) { # HTTP token return HTTP::Response->new( HTTP::Status::RC_BAD_REQUEST, 'Library does not allow method ' . "$method for 'http:' URLs"); } my $url = $request->uri; # Proxying SSL with a http proxy needs issues a CONNECT request to build a # tunnel and then upgrades the tunnel to SSL. But when doing keep-alive the # https request does not need to be the first request in the connection, so # we need to distinguish between # - not yet connected (create socket and ssl upgrade) # - connected but not inside ssl tunnel (ssl upgrade) # - inside ssl tunnel to the target - once we are in the tunnel to the # target we cannot only reuse the tunnel for more https requests with the # same target my $ssl_tunnel = $proxy && $url->scheme eq 'https' && $url->host.":".$url->port; my ($host,$port) = $proxy ? ($proxy->host,$proxy->port) : ($url->host,$url->port); my $fullpath = $method eq 'CONNECT' ? $url->host . ":" . $url->port : $proxy && ! $ssl_tunnel ? $url->as_string : do { my $path = $url->path_query; $path = "/$path" if $path !~m{^/}; $path }; my $socket; my $conn_cache = $self->{ua}{conn_cache}; my $cache_key; if ( $conn_cache ) { $cache_key = "$host:$port"; # For https we reuse the socket immediately only if it has an established # tunnel to the target. Otherwise a CONNECT request followed by an SSL # upgrade need to be done first. The request itself might reuse an # existing non-ssl connection to the proxy $cache_key .= "!".$ssl_tunnel if $ssl_tunnel; if ( $socket = $conn_cache->withdraw($self->socket_type,$cache_key)) { if ($socket->can_read(0)) { # if the socket is readable, then either the peer has closed the # connection or there are some garbage bytes on it. In either # case we abandon it. $socket->close; $socket = undef; } # else use $socket else { $socket->timeout($timeout); } } } if ( ! $socket && $ssl_tunnel ) { my $proto_https = LWP::Protocol::create('https',$self->{ua}) or die "no support for scheme https found"; # only if ssl socket class is IO::Socket::SSL we can upgrade # a plain socket to SSL. In case of Net::SSL we fall back to # the old version if ( my $upgrade_sub = $proto_https->can('_upgrade_sock')) { my $response = $self->request( HTTP::Request->new('CONNECT',"http://$ssl_tunnel"), $proxy, undef,$size,$timeout ); $response->is_success or die "establishing SSL tunnel failed: ".$response->status_line; $socket = $upgrade_sub->($proto_https, $response->{client_socket},$url) or die "SSL upgrade failed: $@"; } else { $socket = $proto_https->_new_socket($url->host,$url->port,$timeout); } } if ( ! $socket ) { # connect to remote site w/o reusing established socket $socket = $self->_new_socket($host, $port, $timeout ); } my $http_version = ""; if (my $proto = $request->protocol) { if ($proto =~ /^(?:HTTP\/)?(1.\d+)$/) { $http_version = $1; $socket->http_version($http_version); $socket->send_te(0) if $http_version eq "1.0"; } } $self->_check_sock($request, $socket); my @h; my $request_headers = $request->headers->clone; $self->_fixup_header($request_headers, $url, $proxy); $request_headers->scan(sub { my($k, $v) = @_; $k =~ s/^://; $v =~ s/\n/ /g; push(@h, $k, $v); }); my $content_ref = $request->content_ref; $content_ref = $$content_ref if ref($$content_ref); my $chunked; my $has_content; if (ref($content_ref) eq 'CODE') { my $clen = $request_headers->header('Content-Length'); $has_content++ if $clen; unless (defined $clen) { push(@h, "Transfer-Encoding" => "chunked"); $has_content++; $chunked++; } } else { # Set (or override) Content-Length header my $clen = $request_headers->header('Content-Length'); if (defined($$content_ref) && length($$content_ref)) { $has_content = length($$content_ref); if (!defined($clen) || $clen ne $has_content) { if (defined $clen) { warn "Content-Length header value was wrong, fixed"; hlist_remove(\@h, 'Content-Length'); } push(@h, 'Content-Length' => $has_content); } } elsif ($clen) { warn "Content-Length set when there is no content, fixed"; hlist_remove(\@h, 'Content-Length'); } } my $write_wait = 0; $write_wait = 2 if ($request_headers->header("Expect") || "") =~ /100-continue/; my $req_buf = $socket->format_request($method, $fullpath, @h); #print "------\n$req_buf\n------\n"; if (!$has_content || $write_wait || $has_content > 8*1024) { WRITE: { # Since this just writes out the header block it should almost # always succeed to send the whole buffer in a single write call. my $n = $socket->syswrite($req_buf, length($req_buf)); unless (defined $n) { redo WRITE if $!{EINTR}; if ($!{EWOULDBLOCK} || $!{EAGAIN}) { select(undef, undef, undef, 0.1); redo WRITE; } die "write failed: $!"; } if ($n) { substr($req_buf, 0, $n, ""); } else { select(undef, undef, undef, 0.5); } redo WRITE if length $req_buf; } } my($code, $mess, @junk); my $drop_connection; if ($has_content) { my $eof; my $wbuf; my $woffset = 0; INITIAL_READ: if ($write_wait) { # skip filling $wbuf when waiting for 100-continue # because if the response is a redirect or auth required # the request will be cloned and there is no way # to reset the input stream # return here via the label after the 100-continue is read } elsif (ref($content_ref) eq 'CODE') { my $buf = &$content_ref(); $buf = "" unless defined($buf); $buf = sprintf "%x%s%s%s", length($buf), $CRLF, $buf, $CRLF if $chunked; substr($buf, 0, 0) = $req_buf if $req_buf; $wbuf = \$buf; } else { if ($req_buf) { my $buf = $req_buf . $$content_ref; $wbuf = \$buf; } else { $wbuf = $content_ref; } $eof = 1; } my $fbits = ''; vec($fbits, fileno($socket), 1) = 1; WRITE: while ($write_wait || $woffset < length($$wbuf)) { my $sel_timeout = $timeout; if ($write_wait) { $sel_timeout = $write_wait if $write_wait < $sel_timeout; } my $time_before; $time_before = time if $sel_timeout; my $rbits = $fbits; my $wbits = $write_wait ? undef : $fbits; my $sel_timeout_before = $sel_timeout; SELECT: { my $nfound = select($rbits, $wbits, undef, $sel_timeout); if ($nfound < 0) { if ($!{EINTR} || $!{EWOULDBLOCK} || $!{EAGAIN}) { if ($time_before) { $sel_timeout = $sel_timeout_before - (time - $time_before); $sel_timeout = 0 if $sel_timeout < 0; } redo SELECT; } die "select failed: $!"; } } if ($write_wait) { $write_wait -= time - $time_before; $write_wait = 0 if $write_wait < 0; } if (defined($rbits) && $rbits =~ /[^\0]/) { # readable my $buf = $socket->_rbuf; my $n = $socket->sysread($buf, 1024, length($buf)); unless (defined $n) { die "read failed: $!" unless $!{EINTR} || $!{EWOULDBLOCK} || $!{EAGAIN}; # if we get here the rest of the block will do nothing # and we will retry the read on the next round } elsif ($n == 0) { # the server closed the connection before we finished # writing all the request content. No need to write any more. $drop_connection++; last WRITE; } $socket->_rbuf($buf); if (!$code && $buf =~ /\015?\012\015?\012/) { # a whole response header is present, so we can read it without blocking ($code, $mess, @h) = $socket->read_response_headers(laxed => 1, junk_out => \@junk, ); if ($code eq "100") { $write_wait = 0; undef($code); goto INITIAL_READ; } else { $drop_connection++; last WRITE; # XXX should perhaps try to abort write in a nice way too } } } if (defined($wbits) && $wbits =~ /[^\0]/) { my $n = $socket->syswrite($$wbuf, length($$wbuf), $woffset); unless (defined $n) { die "write failed: $!" unless $!{EINTR} || $!{EWOULDBLOCK} || $!{EAGAIN}; $n = 0; # will retry write on the next round } elsif ($n == 0) { die "write failed: no bytes written"; } $woffset += $n; if (!$eof && $woffset >= length($$wbuf)) { # need to refill buffer from $content_ref code my $buf = &$content_ref(); $buf = "" unless defined($buf); $eof++ unless length($buf); $buf = sprintf "%x%s%s%s", length($buf), $CRLF, $buf, $CRLF if $chunked; $wbuf = \$buf; $woffset = 0; } } } # WRITE } ($code, $mess, @h) = $socket->read_response_headers(laxed => 1, junk_out => \@junk) unless $code; ($code, $mess, @h) = $socket->read_response_headers(laxed => 1, junk_out => \@junk) if $code eq "100"; my $response = HTTP::Response->new($code, $mess); my $peer_http_version = $socket->peer_http_version; $response->protocol("HTTP/$peer_http_version"); { local $HTTP::Headers::TRANSLATE_UNDERSCORE; $response->push_header(@h); } $response->push_header("Client-Junk" => \@junk) if @junk; $response->request($request); $self->_get_sock_info($response, $socket); if ($method eq "CONNECT") { $response->{client_socket} = $socket; # so it can be picked up return $response; } if (my @te = $response->remove_header('Transfer-Encoding')) { $response->push_header('Client-Transfer-Encoding', \@te); } $response->push_header('Client-Response-Num', scalar $socket->increment_response_count); my $complete; $response = $self->collect($arg, $response, sub { my $buf = ""; #prevent use of uninitialized value in SSLeay.xs my $n; READ: { $n = $socket->read_entity_body($buf, $size); unless (defined $n) { redo READ if $!{EINTR} || $!{EWOULDBLOCK} || $!{EAGAIN} || $!{ENOTTY}; die "read failed: $!"; } redo READ if $n == -1; } $complete++ if !$n; return \$buf; } ); $drop_connection++ unless $complete; @h = $socket->get_trailers; if (@h) { local $HTTP::Headers::TRANSLATE_UNDERSCORE; $response->push_header(@h); } # keep-alive support unless ($drop_connection) { if ($cache_key) { my %connection = map { (lc($_) => 1) } split(/\s*,\s*/, ($response->header("Connection") || "")); if (($peer_http_version eq "1.1" && !$connection{close}) || $connection{"keep-alive"}) { $conn_cache->deposit($self->socket_type, $cache_key, $socket); } } } $response; } #----------------------------------------------------------- package # hide from PAUSE LWP::Protocol::http::SocketMethods; sub ping { my $self = shift; !$self->can_read(0); } sub increment_response_count { my $self = shift; return ++${*$self}{'myhttp_response_count'}; } #----------------------------------------------------------- package # hide from PAUSE LWP::Protocol::http::Socket; use base qw(LWP::Protocol::http::SocketMethods Net::HTTP); 1; darwin-perl-lib/LWP/Protocol/https.pm000444 000765 000024 00000015116 13167163507 021731 0ustar00ocsinventorystaff000000 000000 package LWP::Protocol::https; use strict; our $VERSION = "6.07"; require LWP::Protocol::http; our @ISA = qw(LWP::Protocol::http); require Net::HTTPS; sub socket_type { return "https"; } sub _extra_sock_opts { my $self = shift; my %ssl_opts = %{$self->{ua}{ssl_opts} || {}}; if (delete $ssl_opts{verify_hostname}) { $ssl_opts{SSL_verify_mode} ||= 1; $ssl_opts{SSL_verifycn_scheme} = 'www'; } else { $ssl_opts{SSL_verify_mode} = 0; } if ($ssl_opts{SSL_verify_mode}) { unless (exists $ssl_opts{SSL_ca_file} || exists $ssl_opts{SSL_ca_path}) { eval { require Mozilla::CA; }; if ($@) { if ($@ =~ /^Can't locate Mozilla\/CA\.pm/) { $@ = <<'EOT'; Can't verify SSL peers without knowing which Certificate Authorities to trust This problem can be fixed by either setting the PERL_LWP_SSL_CA_FILE environment variable or by installing the Mozilla::CA module. To disable verification of SSL peers set the PERL_LWP_SSL_VERIFY_HOSTNAME environment variable to 0. If you do this you can't be sure that you communicate with the expected peer. EOT } die $@; } $ssl_opts{SSL_ca_file} = Mozilla::CA::SSL_ca_file(); } } $self->{ssl_opts} = \%ssl_opts; return (%ssl_opts, $self->SUPER::_extra_sock_opts); } #------------------------------------------------------------ # _cn_match($common_name, $san_name) # common_name: an IA5String # san_name: subjectAltName # initially we were only concerned with the dNSName # and the 'left-most' only wildcard as noted in # https://tools.ietf.org/html/rfc6125#section-6.4.3 # this method does not match any wildcarding in the # domain name as listed in section-6.4.3.3 # sub _cn_match { my( $me, $common_name, $san_name ) = @_; # /CN has a '*.' prefix # MUST be an FQDN -- fishing? return 0 if( $common_name =~ /^\*\./ ); my $re = q{}; # empty string # turn a leading "*." into a regex if( $san_name =~ /^\*\./ ) { $san_name =~ s/\*//; $re = "[^.]+"; } # quotemeta the rest and match anchored if( $common_name =~ /^$re\Q$san_name\E$/ ) { return 1; } return 0; } #------------------------------------------------------- # _in_san( cn, cert ) # 'cn' of the form /CN=host_to_check ( "Common Name" form ) # 'cert' any object that implements a peer_certificate('subjectAltNames') method # which will return an array of ( type-id, value ) pairings per # http://tools.ietf.org/html/rfc5280#section-4.2.1.6 # if there is no subjectAltNames there is nothing more to do. # currently we have a _cn_match() that will allow for simple compare. sub _in_san { my($me, $cn, $cert) = @_; # we can return early if there are no SAN options. my @sans = $cert->peer_certificate('subjectAltNames'); return unless scalar @sans; (my $common_name = $cn) =~ s/.*=//; # strip off the prefix. # get the ( type-id, value ) pairwise # currently only the basic CN to san_name check while( my ( $type_id, $value ) = splice( @sans, 0, 2 ) ) { return 'ok' if $me->_cn_match($common_name,$value); } return; } sub _check_sock { my($self, $req, $sock) = @_; my $check = $req->header("If-SSL-Cert-Subject"); if (defined $check) { my $cert = $sock->get_peer_certificate || die "Missing SSL certificate"; my $subject = $cert->subject_name; unless ( $subject =~ /$check/ ) { my $ok = $self->_in_san( $check, $cert); die "Bad SSL certificate subject: '$subject' !~ /$check/" unless $ok; } $req->remove_header("If-SSL-Cert-Subject"); # don't pass it on } } sub _get_sock_info { my $self = shift; $self->SUPER::_get_sock_info(@_); my($res, $sock) = @_; $res->header("Client-SSL-Cipher" => $sock->get_cipher); my $cert = $sock->get_peer_certificate; if ($cert) { $res->header("Client-SSL-Cert-Subject" => $cert->subject_name); $res->header("Client-SSL-Cert-Issuer" => $cert->issuer_name); } if (!$self->{ssl_opts}{SSL_verify_mode}) { $res->push_header("Client-SSL-Warning" => "Peer certificate not verified"); } elsif (!$self->{ssl_opts}{SSL_verifycn_scheme}) { $res->push_header("Client-SSL-Warning" => "Peer hostname match with certificate not verified"); } $res->header("Client-SSL-Socket-Class" => $Net::HTTPS::SSL_SOCKET_CLASS); } # upgrade plain socket to SSL, used for CONNECT tunnel when proxying https # will only work if the underlying socket class of Net::HTTPS is # IO::Socket::SSL, but code will only be called in this case if ( $Net::HTTPS::SSL_SOCKET_CLASS->can('start_SSL')) { *_upgrade_sock = sub { my ($self,$sock,$url) = @_; $sock = LWP::Protocol::https::Socket->start_SSL( $sock, SSL_verifycn_name => $url->host, SSL_hostname => $url->host, $self->_extra_sock_opts, ); $@ = LWP::Protocol::https::Socket->errstr if ! $sock; return $sock; } } #----------------------------------------------------------- package LWP::Protocol::https::Socket; our @ISA = qw(Net::HTTPS LWP::Protocol::http::SocketMethods); 1; __END__ =head1 NAME LWP::Protocol::https - Provide https support for LWP::UserAgent =head1 SYNOPSIS use LWP::UserAgent; $ua = LWP::UserAgent->new(ssl_opts => { verify_hostname => 1 }); $res = $ua->get("https://www.example.com"); # specify a CA path $ua = LWP::UserAgent->new( ssl_opts => { SSL_ca_path => '/etc/ssl/certs', verify_hostname => 1, } ); =head1 DESCRIPTION The LWP::Protocol::https module provides support for using https schemed URLs with LWP. This module is a plug-in to the LWP protocol handling, so you don't use it directly. Once the module is installed LWP is able to access sites using HTTP over SSL/TLS. If hostname verification is requested by LWP::UserAgent's C, and neither C nor C is set, then C is implied to be the one provided by Mozilla::CA. If the Mozilla::CA module isn't available SSL requests will fail. Either install this module, set up an alternative C or disable hostname verification. This module used to be bundled with the libwww-perl, but it was unbundled in v6.02 in order to be able to declare its dependencies properly for the CPAN tool-chain. Applications that need https support can just declare their dependency on LWP::Protocol::https and will no longer need to know what underlying modules to install. =head1 SEE ALSO L, L, L =head1 COPYRIGHT Copyright 1997-2011 Gisle Aas. This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. darwin-perl-lib/LWP/Protocol/loopback.pm000444 000765 000024 00000001134 13167163507 022354 0ustar00ocsinventorystaff000000 000000 package LWP::Protocol::loopback; $LWP::Protocol::loopback::VERSION = '6.27'; use strict; require HTTP::Response; use base qw(LWP::Protocol); sub request { my($self, $request, $proxy, $arg, $size, $timeout) = @_; my $response = HTTP::Response->new(200, "OK"); $response->content_type("message/http; msgtype=request"); $response->header("Via", "loopback/1.0 $proxy") if $proxy; $response->header("X-Arg", $arg); $response->header("X-Read-Size", $size); $response->header("X-Timeout", $timeout); return $self->collect_once($arg, $response, $request->as_string); } 1; darwin-perl-lib/LWP/Protocol/mailto.pm000444 000765 000024 00000010507 13167163507 022053 0ustar00ocsinventorystaff000000 000000 package LWP::Protocol::mailto; $LWP::Protocol::mailto::VERSION = '6.27'; # This module implements the mailto protocol. It is just a simple # frontend to the Unix sendmail program except on MacOS, where it uses # Mail::Internet. require HTTP::Request; require HTTP::Response; require HTTP::Status; use Carp; use strict; use base qw(LWP::Protocol); our $SENDMAIL; unless ($SENDMAIL = $ENV{SENDMAIL}) { for my $sm (qw(/usr/sbin/sendmail /usr/lib/sendmail /usr/ucblib/sendmail )) { if (-x $sm) { $SENDMAIL = $sm; last; } } die "Can't find the 'sendmail' program" unless $SENDMAIL; } sub request { my($self, $request, $proxy, $arg, $size) = @_; my ($mail, $addr) if $^O eq "MacOS"; my @text = () if $^O eq "MacOS"; # check proxy if (defined $proxy) { return HTTP::Response->new(HTTP::Status::RC_BAD_REQUEST, 'You can not proxy with mail'); } # check method my $method = $request->method; if ($method ne 'POST') { return HTTP::Response->new( HTTP::Status::RC_BAD_REQUEST, 'Library does not allow method ' . "$method for 'mailto:' URLs"); } # check url my $url = $request->uri; my $scheme = $url->scheme; if ($scheme ne 'mailto') { return HTTP::Response->new( HTTP::Status::RC_INTERNAL_SERVER_ERROR, "LWP::Protocol::mailto::request called for '$scheme'"); } if ($^O eq "MacOS") { eval { require Mail::Internet; }; if($@) { return HTTP::Response->new( HTTP::Status::RC_INTERNAL_SERVER_ERROR, "You don't have MailTools installed"); } unless ($ENV{SMTPHOSTS}) { return HTTP::Response->new( HTTP::Status::RC_INTERNAL_SERVER_ERROR, "You don't have SMTPHOSTS defined"); } } else { unless (-x $SENDMAIL) { return HTTP::Response->new( HTTP::Status::RC_INTERNAL_SERVER_ERROR, "You don't have $SENDMAIL"); } } if ($^O eq "MacOS") { $mail = Mail::Internet->new or return HTTP::Response->new( HTTP::Status::RC_INTERNAL_SERVER_ERROR, "Can't get a Mail::Internet object"); } else { open(SENDMAIL, "| $SENDMAIL -oi -t") or return HTTP::Response->new( HTTP::Status::RC_INTERNAL_SERVER_ERROR, "Can't run $SENDMAIL: $!"); } if ($^O eq "MacOS") { $addr = $url->encoded822addr; } else { $request = $request->clone; # we modify a copy my @h = $url->headers; # URL headers override those in the request while (@h) { my $k = shift @h; my $v = shift @h; next unless defined $v; if (lc($k) eq "body") { $request->content($v); } else { $request->push_header($k => $v); } } } if ($^O eq "MacOS") { $mail->add(To => $addr); $mail->add(split(/[:\n]/,$request->headers_as_string)); } else { print SENDMAIL $request->headers_as_string; print SENDMAIL "\n"; } my $content = $request->content; if (defined $content) { my $contRef = ref($content) ? $content : \$content; if (ref($contRef) eq 'SCALAR') { if ($^O eq "MacOS") { @text = split("\n",$$contRef); foreach (@text) { $_ .= "\n"; } } else { print SENDMAIL $$contRef; } } elsif (ref($contRef) eq 'CODE') { # Callback provides data my $d; if ($^O eq "MacOS") { my $stuff = ""; while (length($d = &$contRef)) { $stuff .= $d; } @text = split("\n",$stuff); foreach (@text) { $_ .= "\n"; } } else { print SENDMAIL $d; } } } if ($^O eq "MacOS") { $mail->body(\@text); unless ($mail->smtpsend) { return HTTP::Response->new(HTTP::Status::RC_INTERNAL_SERVER_ERROR, "Mail::Internet->smtpsend unable to send message to <$addr>"); } } else { unless (close(SENDMAIL)) { my $err = $! ? "$!" : "Exit status $?"; return HTTP::Response->new(HTTP::Status::RC_INTERNAL_SERVER_ERROR, "$SENDMAIL: $err"); } } my $response = HTTP::Response->new(HTTP::Status::RC_ACCEPTED, "Mail accepted"); $response->header('Content-Type', 'text/plain'); if ($^O eq "MacOS") { $response->header('Server' => "Mail::Internet $Mail::Internet::VERSION"); $response->content("Message sent to <$addr>\n"); } else { $response->header('Server' => $SENDMAIL); my $to = $request->header("To"); $response->content("Message sent to <$to>\n"); } return $response; } 1; darwin-perl-lib/LWP/Protocol/nntp.pm000444 000765 000024 00000010163 13167163507 021543 0ustar00ocsinventorystaff000000 000000 package LWP::Protocol::nntp; $LWP::Protocol::nntp::VERSION = '6.27'; # Implementation of the Network News Transfer Protocol (RFC 977) use base qw(LWP::Protocol); require HTTP::Response; require HTTP::Status; require Net::NNTP; use strict; sub request { my ($self, $request, $proxy, $arg, $size, $timeout) = @_; $size = 4096 unless $size; # Check for proxy if (defined $proxy) { return HTTP::Response->new(HTTP::Status::RC_BAD_REQUEST, 'You can not proxy through NNTP'); } # Check that the scheme is as expected my $url = $request->uri; my $scheme = $url->scheme; unless ($scheme eq 'news' || $scheme eq 'nntp') { return HTTP::Response->new(HTTP::Status::RC_INTERNAL_SERVER_ERROR, "LWP::Protocol::nntp::request called for '$scheme'"); } # check for a valid method my $method = $request->method; unless ($method eq 'GET' || $method eq 'HEAD' || $method eq 'POST') { return HTTP::Response->new(HTTP::Status::RC_BAD_REQUEST, 'Library does not allow method ' . "$method for '$scheme:' URLs"); } # extract the identifier and check against posting to an article my $groupart = $url->_group; my $is_art = $groupart =~ /@/; if ($is_art && $method eq 'POST') { return HTTP::Response->new(HTTP::Status::RC_BAD_REQUEST, "Can't post to an article <$groupart>"); } my $nntp = Net::NNTP->new( $url->host, #Port => 18574, Timeout => $timeout, #Debug => 1, ); die "Can't connect to nntp server" unless $nntp; # Check the initial welcome message from the NNTP server if ($nntp->status != 2) { return HTTP::Response->new(HTTP::Status::RC_SERVICE_UNAVAILABLE, $nntp->message); } my $response = HTTP::Response->new(HTTP::Status::RC_OK, "OK"); my $mess = $nntp->message; # Try to extract server name from greeting message. # Don't know if this works well for a large class of servers, but # this works for our server. $mess =~ s/\s+ready\b.*//; $mess =~ s/^\S+\s+//; $response->header(Server => $mess); # First we handle posting of articles if ($method eq 'POST') { $nntp->quit; $nntp = undef; $response->code(HTTP::Status::RC_NOT_IMPLEMENTED); $response->message("POST not implemented yet"); return $response; } # The method must be "GET" or "HEAD" by now if (!$is_art) { if (!$nntp->group($groupart)) { $response->code(HTTP::Status::RC_NOT_FOUND); $response->message($nntp->message); } $nntp->quit; $nntp = undef; # HEAD: just check if the group exists if ($method eq 'GET' && $response->is_success) { $response->code(HTTP::Status::RC_NOT_IMPLEMENTED); $response->message("GET newsgroup not implemented yet"); } return $response; } # Send command to server to retrieve an article (or just the headers) my $get = $method eq 'HEAD' ? "head" : "article"; my $art = $nntp->$get("<$groupart>"); unless ($art) { $nntp->quit; $response->code(HTTP::Status::RC_NOT_FOUND); $response->message($nntp->message); $nntp = undef; return $response; } # Parse headers my ($key, $val); local $_; while ($_ = shift @$art) { if (/^\s+$/) { last; # end of headers } elsif (/^(\S+):\s*(.*)/) { $response->push_header($key, $val) if $key; ($key, $val) = ($1, $2); } elsif (/^\s+(.*)/) { next unless $key; $val .= $1; } else { unshift(@$art, $_); last; } } $response->push_header($key, $val) if $key; # Ensure that there is a Content-Type header $response->header("Content-Type", "text/plain") unless $response->header("Content-Type"); # Collect the body $response = $self->collect_once($arg, $response, join("", @$art)) if @$art; # Say goodbye to the server $nntp->quit; $nntp = undef; $response; } 1; darwin-perl-lib/LWP/Protocol/nogo.pm000444 000765 000024 00000001161 13167163507 021524 0ustar00ocsinventorystaff000000 000000 package LWP::Protocol::nogo; # If you want to disable access to a particular scheme, use this # class and then call # LWP::Protocol::implementor(that_scheme, 'LWP::Protocol::nogo'); # For then on, attempts to access URLs with that scheme will generate # a 500 error. $LWP::Protocol::nogo::VERSION = '6.27'; use strict; require HTTP::Response; require HTTP::Status; use base qw(LWP::Protocol); sub request { my($self, $request) = @_; my $scheme = $request->uri->scheme; return HTTP::Response->new( HTTP::Status::RC_INTERNAL_SERVER_ERROR, "Access to \'$scheme\' URIs has been disabled" ); } 1; darwin-perl-lib/LWP/Debug/TraceHTTP.pm000444 000765 000024 00000001150 13167163507 021543 0ustar00ocsinventorystaff000000 000000 package LWP::Debug::TraceHTTP; $LWP::Debug::TraceHTTP::VERSION = '6.27'; # Just call: # # require LWP::Debug::TraceHTTP; # LWP::Protocol::implementor('http', 'LWP::Debug::TraceHTTP'); # # to use this module to trace all calls to the HTTP socket object in # programs that use LWP. use strict; use base 'LWP::Protocol::http'; package # hide from PAUSE LWP::Debug::TraceHTTP::Socket; use Data::Dump 1.13; use Data::Dump::Trace qw(autowrap mcall); autowrap("LWP::Protocol::http::Socket" => "sock"); sub new { my $class = shift; return mcall("LWP::Protocol::http::Socket" => "new", undef, @_); } 1; darwin-perl-lib/LWP/Authen/Basic.pm000444 000765 000024 00000004054 13167163507 021232 0ustar00ocsinventorystaff000000 000000 package LWP::Authen::Basic; $LWP::Authen::Basic::VERSION = '6.27'; use strict; require MIME::Base64; sub auth_header { my($class, $user, $pass) = @_; return "Basic " . MIME::Base64::encode("$user:$pass", ""); } sub authenticate { my($class, $ua, $proxy, $auth_param, $response, $request, $arg, $size) = @_; my $realm = $auth_param->{realm} || ""; my $url = $proxy ? $request->{proxy} : $request->uri_canonical; return $response unless $url; my $host_port = $url->host_port; my $auth_header = $proxy ? "Proxy-Authorization" : "Authorization"; my @m = $proxy ? (m_proxy => $url) : (m_host_port => $host_port); push(@m, realm => $realm); my $h = $ua->get_my_handler("request_prepare", @m, sub { $_[0]{callback} = sub { my($req, $ua, $h) = @_; my($user, $pass) = $ua->credentials($host_port, $h->{realm}); if (defined $user) { my $auth_value = $class->auth_header($user, $pass, $req, $ua, $h); $req->header($auth_header => $auth_value); } }; }); $h->{auth_param} = $auth_param; if (!$proxy && !$request->header($auth_header) && $ua->credentials($host_port, $realm)) { # we can make sure this handler applies and retry add_path($h, $url->path); return $ua->request($request->clone, $arg, $size, $response); } my($user, $pass) = $ua->get_basic_credentials($realm, $url, $proxy); unless (defined $user and defined $pass) { $ua->set_my_handler("request_prepare", undef, @m); # delete handler return $response; } # check that the password has changed my ($olduser, $oldpass) = $ua->credentials($host_port, $realm); return $response if (defined $olduser and defined $oldpass and $user eq $olduser and $pass eq $oldpass); $ua->credentials($host_port, $realm, $user, $pass); add_path($h, $url->path) unless $proxy; return $ua->request($request->clone, $arg, $size, $response); } sub add_path { my($h, $path) = @_; $path =~ s,[^/]+\z,,; push(@{$h->{m_path_prefix}}, $path); } 1; darwin-perl-lib/LWP/Authen/Digest.pm000444 000765 000024 00000003712 13167163507 021430 0ustar00ocsinventorystaff000000 000000 package LWP::Authen::Digest; $LWP::Authen::Digest::VERSION = '6.27'; use strict; use base 'LWP::Authen::Basic'; require Digest::MD5; sub auth_header { my($class, $user, $pass, $request, $ua, $h) = @_; my $auth_param = $h->{auth_param}; my $nc = sprintf "%08X", ++$ua->{authen_md5_nonce_count}{$auth_param->{nonce}}; my $cnonce = sprintf "%8x", time; my $uri = $request->uri->path_query; $uri = "/" unless length $uri; my $md5 = Digest::MD5->new; my(@digest); $md5->add(join(":", $user, $auth_param->{realm}, $pass)); push(@digest, $md5->hexdigest); $md5->reset; push(@digest, $auth_param->{nonce}); if ($auth_param->{qop}) { push(@digest, $nc, $cnonce, ($auth_param->{qop} =~ m|^auth[,;]auth-int$|) ? 'auth' : $auth_param->{qop}); } $md5->add(join(":", $request->method, $uri)); push(@digest, $md5->hexdigest); $md5->reset; $md5->add(join(":", @digest)); my($digest) = $md5->hexdigest; $md5->reset; my %resp = map { $_ => $auth_param->{$_} } qw(realm nonce opaque); @resp{qw(username uri response algorithm)} = ($user, $uri, $digest, "MD5"); if (($auth_param->{qop} || "") =~ m|^auth([,;]auth-int)?$|) { @resp{qw(qop cnonce nc)} = ("auth", $cnonce, $nc); } my(@order) = qw(username realm qop algorithm uri nonce nc cnonce response); if($request->method =~ /^(?:POST|PUT)$/) { $md5->add($request->content); my $content = $md5->hexdigest; $md5->reset; $md5->add(join(":", @digest[0..1], $content)); $md5->reset; $resp{"message-digest"} = $md5->hexdigest; push(@order, "message-digest"); } push(@order, "opaque"); my @pairs; for (@order) { next unless defined $resp{$_}; # RFC2617 says that qop-value and nc-value should be unquoted. if ( $_ eq 'qop' || $_ eq 'nc' ) { push(@pairs, "$_=" . $resp{$_}); } else { push(@pairs, "$_=" . qq("$resp{$_}")); } } my $auth_value = "Digest " . join(", ", @pairs); return $auth_value; } 1; darwin-perl-lib/LWP/Authen/Ntlm.pm000444 000765 000024 00000012367 13167163507 021131 0ustar00ocsinventorystaff000000 000000 package LWP::Authen::Ntlm; use strict; our $VERSION = '6.27'; use Authen::NTLM "1.02"; use MIME::Base64 "2.12"; sub authenticate { my($class, $ua, $proxy, $auth_param, $response, $request, $arg, $size) = @_; my($user, $pass) = $ua->get_basic_credentials($auth_param->{realm}, $request->uri, $proxy); unless(defined $user and defined $pass) { return $response; } if (!$ua->conn_cache()) { warn "The keep_alive option must be enabled for NTLM authentication to work. NTLM authentication aborted.\n"; return $response; } my($domain, $username) = split(/\\/, $user); ntlm_domain($domain); ntlm_user($username); ntlm_password($pass); my $auth_header = $proxy ? "Proxy-Authorization" : "Authorization"; # my ($challenge) = $response->header('WWW-Authenticate'); my $challenge; foreach ($response->header('WWW-Authenticate')) { last if /^NTLM/ && ($challenge=$_); } if ($challenge eq 'NTLM') { # First phase, send handshake my $auth_value = "NTLM " . ntlm(); ntlm_reset(); # Need to check this isn't a repeated fail! my $r = $response; my $retry_count = 0; while ($r) { my $auth = $r->request->header($auth_header); ++$retry_count if ($auth && $auth eq $auth_value); if ($retry_count > 2) { # here we know this failed before $response->header("Client-Warning" => "Credentials for '$user' failed before"); return $response; } $r = $r->previous; } my $referral = $request->clone; $referral->header($auth_header => $auth_value); return $ua->request($referral, $arg, $size, $response); } else { # Second phase, use the response challenge (unless non-401 code # was returned, in which case, we just send back the response # object, as is my $auth_value; if ($response->code ne '401') { return $response; } else { my $challenge; foreach ($response->header('WWW-Authenticate')) { last if /^NTLM/ && ($challenge=$_); } $challenge =~ s/^NTLM //; ntlm(); $auth_value = "NTLM " . ntlm($challenge); ntlm_reset(); } my $referral = $request->clone; $referral->header($auth_header => $auth_value); my $response2 = $ua->request($referral, $arg, $size, $response); return $response2; } } 1; __END__ =pod =head1 NAME LWP::Authen::Ntlm - Library for enabling NTLM authentication (Microsoft) in LWP =head1 SYNOPSIS use LWP::UserAgent; use HTTP::Request::Common; my $url = 'http://www.company.com/protected_page.html'; # Set up the ntlm client and then the base64 encoded ntlm handshake message my $ua = LWP::UserAgent->new(keep_alive=>1); $ua->credentials('www.company.com:80', '', "MyDomain\\MyUserCode", 'MyPassword'); $request = GET $url; print "--Performing request now...-----------\n"; $response = $ua->request($request); print "--Done with request-------------------\n"; if ($response->is_success) {print "It worked!->" . $response->code . "\n"} else {print "It didn't work!->" . $response->code . "\n"} =head1 DESCRIPTION L allows LWP to authenticate against servers that are using the NTLM authentication scheme popularized by Microsoft. This type of authentication is common on intranets of Microsoft-centric organizations. The module takes advantage of the Authen::NTLM module by Mark Bush. Since there is also another Authen::NTLM module available from CPAN by Yee Man Chan with an entirely different interface, it is necessary to ensure that you have the correct NTLM module. In addition, there have been problems with incompatibilities between different versions of Mime::Base64, which Bush's Authen::NTLM makes use of. Therefore, it is necessary to ensure that your Mime::Base64 module supports exporting of the encode_base64 and decode_base64 functions. =head1 USAGE The module is used indirectly through LWP, rather than including it directly in your code. The LWP system will invoke the NTLM authentication when it encounters the authentication scheme while attempting to retrieve a URL from a server. In order for the NTLM authentication to work, you must have a few things set up in your code prior to attempting to retrieve the URL: =over 4 =item * Enable persistent HTTP connections To do this, pass the "keep_alive=>1" option to the LWP::UserAgent when creating it, like this: my $ua = LWP::UserAgent->new(keep_alive=>1); =item * Set the credentials on the UserAgent object The credentials must be set like this: $ua->credentials('www.company.com:80', '', "MyDomain\\MyUserCode", 'MyPassword'); Note that you cannot use the HTTP::Request object's authorization_basic() method to set the credentials. Note, too, that the 'www.company.com:80' portion only sets credentials on the specified port AND it is case-sensitive (this is due to the way LWP is coded, and has nothing to do with LWP::Authen::Ntlm) =back =head1 AVAILABILITY General queries regarding LWP should be made to the LWP Mailing List. Questions specific to LWP::Authen::Ntlm can be forwarded to jtillman@bigfoot.com =head1 COPYRIGHT Copyright (c) 2002 James Tillman. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. =head1 SEE ALSO L, L, L. =cut darwin-perl-lib/IO/Compress/000755 000765 000024 00000000000 13167163507 020066 5ustar00ocsinventorystaff000000 000000 darwin-perl-lib/IO/Uncompress/000755 000765 000024 00000000000 13167163507 020431 5ustar00ocsinventorystaff000000 000000 darwin-perl-lib/IO/Zlib.pm000444 000765 000024 00000035247 13167163507 017542 0ustar00ocsinventorystaff000000 000000 # IO::Zlib.pm # # Copyright (c) 1998-2004 Tom Hughes . # All rights reserved. This program is free software; you can redistribute # it and/or modify it under the same terms as Perl itself. package IO::Zlib; $VERSION = "1.10"; =head1 NAME IO::Zlib - IO:: style interface to L =head1 SYNOPSIS With any version of Perl 5 you can use the basic OO interface: use IO::Zlib; $fh = new IO::Zlib; if ($fh->open("file.gz", "rb")) { print <$fh>; $fh->close; } $fh = IO::Zlib->new("file.gz", "wb9"); if (defined $fh) { print $fh "bar\n"; $fh->close; } $fh = IO::Zlib->new("file.gz", "rb"); if (defined $fh) { print <$fh>; undef $fh; # automatically closes the file } With Perl 5.004 you can also use the TIEHANDLE interface to access compressed files just like ordinary files: use IO::Zlib; tie *FILE, 'IO::Zlib', "file.gz", "wb"; print FILE "line 1\nline2\n"; tie *FILE, 'IO::Zlib', "file.gz", "rb"; while () { print "LINE: ", $_ }; =head1 DESCRIPTION C provides an IO:: style interface to L and hence to gzip/zlib compressed files. It provides many of the same methods as the L interface. Starting from IO::Zlib version 1.02, IO::Zlib can also use an external F command. The default behaviour is to try to use an external F if no C can be loaded, unless explicitly disabled by use IO::Zlib qw(:gzip_external 0); If explicitly enabled by use IO::Zlib qw(:gzip_external 1); then the external F is used B of C. =head1 CONSTRUCTOR =over 4 =item new ( [ARGS] ) Creates an C object. If it receives any parameters, they are passed to the method C; if the open fails, the object is destroyed. Otherwise, it is returned to the caller. =back =head1 OBJECT METHODS =over 4 =item open ( FILENAME, MODE ) C takes two arguments. The first is the name of the file to open and the second is the open mode. The mode can be anything acceptable to L and by extension anything acceptable to I (that basically means POSIX fopen() style mode strings plus an optional number to indicate the compression level). =item opened Returns true if the object currently refers to a opened file. =item close Close the file associated with the object and disassociate the file from the handle. Done automatically on destroy. =item getc Return the next character from the file, or undef if none remain. =item getline Return the next line from the file, or undef on end of string. Can safely be called in an array context. Currently ignores $/ ($INPUT_RECORD_SEPARATOR or $RS when L is in use) and treats lines as delimited by "\n". =item getlines Get all remaining lines from the file. It will croak() if accidentally called in a scalar context. =item print ( ARGS... ) Print ARGS to the file. =item read ( BUF, NBYTES, [OFFSET] ) Read some bytes from the file. Returns the number of bytes actually read, 0 on end-of-file, undef on error. =item eof Returns true if the handle is currently positioned at end of file? =item seek ( OFFSET, WHENCE ) Seek to a given position in the stream. Not yet supported. =item tell Return the current position in the stream, as a numeric offset. Not yet supported. =item setpos ( POS ) Set the current position, using the opaque value returned by C. Not yet supported. =item getpos ( POS ) Return the current position in the string, as an opaque object. Not yet supported. =back =head1 USING THE EXTERNAL GZIP If the external F is used, the following Cs are used: open(FH, "gzip -dc $filename |") # for read opens open(FH, " | gzip > $filename") # for write opens You can modify the 'commands' for example to hardwire an absolute path by e.g. use IO::Zlib ':gzip_read_open' => '/some/where/gunzip -c %s |'; use IO::Zlib ':gzip_write_open' => '| /some/where/gzip.exe > %s'; The C<%s> is expanded to be the filename (C is used, so be careful to escape any other C<%> signs). The 'commands' are checked for sanity - they must contain the C<%s>, and the read open must end with the pipe sign, and the write open must begin with the pipe sign. =head1 CLASS METHODS =over 4 =item has_Compress_Zlib Returns true if C is available. Note that this does not mean that C is being used: see L and L. =item gzip_external Undef if an external F B be used if C is not available (see L), true if an external F is explicitly used, false if an external F must not be used. See L. =item gzip_used True if an external F is being used, false if not. =item gzip_read_open Return the 'command' being used for opening a file for reading using an external F. =item gzip_write_open Return the 'command' being used for opening a file for writing using an external F. =back =head1 DIAGNOSTICS =over 4 =item IO::Zlib::getlines: must be called in list context If you want read lines, you must read in list context. =item IO::Zlib::gzopen_external: mode '...' is illegal Use only modes 'rb' or 'wb' or /wb[1-9]/. =item IO::Zlib::import: '...' is illegal The known import symbols are the C<:gzip_external>, C<:gzip_read_open>, and C<:gzip_write_open>. Anything else is not recognized. =item IO::Zlib::import: ':gzip_external' requires an argument The C<:gzip_external> requires one boolean argument. =item IO::Zlib::import: 'gzip_read_open' requires an argument The C<:gzip_external> requires one string argument. =item IO::Zlib::import: 'gzip_read' '...' is illegal The C<:gzip_read_open> argument must end with the pipe sign (|) and have the C<%s> for the filename. See L. =item IO::Zlib::import: 'gzip_write_open' requires an argument The C<:gzip_external> requires one string argument. =item IO::Zlib::import: 'gzip_write_open' '...' is illegal The C<:gzip_write_open> argument must begin with the pipe sign (|) and have the C<%s> for the filename. An output redirect (>) is also often a good idea, depending on your operating system shell syntax. See L. =item IO::Zlib::import: no Compress::Zlib and no external gzip Given that we failed to load C and that the use of an external F was disabled, IO::Zlib has not much chance of working. =item IO::Zlib::open: needs a filename No filename, no open. =item IO::Zlib::READ: NBYTES must be specified We must know how much to read. =item IO::Zlib::WRITE: too long LENGTH The LENGTH must be less than or equal to the buffer size. =back =head1 SEE ALSO L, L, L, L =head1 HISTORY Created by Tom Hughes EFE. Support for external gzip added by Jarkko Hietaniemi EFE. =head1 COPYRIGHT Copyright (c) 1998-2004 Tom Hughes EFE. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. =cut require 5.006; use strict; use vars qw($VERSION $AUTOLOAD @ISA); use Carp; use Fcntl qw(SEEK_SET); my $has_Compress_Zlib; my $aliased; sub has_Compress_Zlib { $has_Compress_Zlib; } BEGIN { eval { require Compress::Zlib }; $has_Compress_Zlib = $@ || $Compress::Zlib::VERSION < 2.000 ? 0 : 1; } use Symbol; use Tie::Handle; # These might use some $^O logic. my $gzip_read_open = "gzip -dc %s |"; my $gzip_write_open = "| gzip > %s"; my $gzip_external; my $gzip_used; sub gzip_read_open { $gzip_read_open; } sub gzip_write_open { $gzip_write_open; } sub gzip_external { $gzip_external; } sub gzip_used { $gzip_used; } sub can_gunzip { $has_Compress_Zlib || $gzip_external; } sub _import { my $import = shift; while (@_) { if ($_[0] eq ':gzip_external') { shift; if (@_) { $gzip_external = shift; } else { croak "$import: ':gzip_external' requires an argument"; } } elsif ($_[0] eq ':gzip_read_open') { shift; if (@_) { $gzip_read_open = shift; croak "$import: ':gzip_read_open' '$gzip_read_open' is illegal" unless $gzip_read_open =~ /^.+%s.+\|\s*$/; } else { croak "$import: ':gzip_read_open' requires an argument"; } } elsif ($_[0] eq ':gzip_write_open') { shift; if (@_) { $gzip_write_open = shift; croak "$import: ':gzip_write_open' '$gzip_read_open' is illegal" unless $gzip_write_open =~ /^\s*\|.+%s.*$/; } else { croak "$import: ':gzip_write_open' requires an argument"; } } else { last; } } return @_; } sub _alias { my $import = shift; if ((!$has_Compress_Zlib && !defined $gzip_external) || $gzip_external) { # The undef *gzopen is really needed only during # testing where we eval several 'use IO::Zlib's. undef *gzopen; *gzopen = \&gzopen_external; *IO::Handle::gzread = \&gzread_external; *IO::Handle::gzwrite = \&gzwrite_external; *IO::Handle::gzreadline = \&gzreadline_external; *IO::Handle::gzeof = \&gzeof_external; *IO::Handle::gzclose = \&gzclose_external; $gzip_used = 1; } else { croak "$import: no Compress::Zlib and no external gzip" unless $has_Compress_Zlib; *gzopen = \&Compress::Zlib::gzopen; *gzread = \&Compress::Zlib::gzread; *gzwrite = \&Compress::Zlib::gzwrite; *gzreadline = \&Compress::Zlib::gzreadline; *gzeof = \&Compress::Zlib::gzeof; } $aliased = 1; } sub import { shift; my $import = "IO::Zlib::import"; if (@_) { if (_import($import, @_)) { croak "$import: '@_' is illegal"; } } _alias($import); } @ISA = qw(Tie::Handle); sub TIEHANDLE { my $class = shift; my @args = @_; my $self = bless {}, $class; return @args ? $self->OPEN(@args) : $self; } sub DESTROY { } sub OPEN { my $self = shift; my $filename = shift; my $mode = shift; croak "IO::Zlib::open: needs a filename" unless defined($filename); $self->{'file'} = gzopen($filename,$mode); return defined($self->{'file'}) ? $self : undef; } sub CLOSE { my $self = shift; return undef unless defined($self->{'file'}); my $status = $self->{'file'}->gzclose(); delete $self->{'file'}; return ($status == 0) ? 1 : undef; } sub READ { my $self = shift; my $bufref = \$_[0]; my $nbytes = $_[1]; my $offset = $_[2] || 0; croak "IO::Zlib::READ: NBYTES must be specified" unless defined($nbytes); $$bufref = "" unless defined($$bufref); my $bytesread = $self->{'file'}->gzread(substr($$bufref,$offset),$nbytes); return undef if $bytesread < 0; return $bytesread; } sub READLINE { my $self = shift; my $line; return () if $self->{'file'}->gzreadline($line) <= 0; return $line unless wantarray; my @lines = $line; while ($self->{'file'}->gzreadline($line) > 0) { push @lines, $line; } return @lines; } sub WRITE { my $self = shift; my $buf = shift; my $length = shift; my $offset = shift; croak "IO::Zlib::WRITE: too long LENGTH" unless $offset + $length <= length($buf); return $self->{'file'}->gzwrite(substr($buf,$offset,$length)); } sub EOF { my $self = shift; return $self->{'file'}->gzeof(); } sub FILENO { return undef; } sub new { my $class = shift; my @args = @_; _alias("new", @_) unless $aliased; # Some call new IO::Zlib directly... my $self = gensym(); tie *{$self}, $class, @args; return tied(${$self}) ? bless $self, $class : undef; } sub getline { my $self = shift; return scalar tied(*{$self})->READLINE(); } sub getlines { my $self = shift; croak "IO::Zlib::getlines: must be called in list context" unless wantarray; return tied(*{$self})->READLINE(); } sub opened { my $self = shift; return defined tied(*{$self})->{'file'}; } sub AUTOLOAD { my $self = shift; $AUTOLOAD =~ s/.*:://; $AUTOLOAD =~ tr/a-z/A-Z/; return tied(*{$self})->$AUTOLOAD(@_); } sub gzopen_external { my ($filename, $mode) = @_; require IO::Handle; my $fh = IO::Handle->new(); if ($mode =~ /r/) { # Because someone will try to read ungzipped files # with this we peek and verify the signature. Yes, # this means that we open the file twice (if it is # gzipped). # Plenty of race conditions exist in this code, but # the alternative would be to capture the stderr of # gzip and parse it, which would be a portability nightmare. if (-e $filename && open($fh, $filename)) { binmode $fh; my $sig; my $rdb = read($fh, $sig, 2); if ($rdb == 2 && $sig eq "\x1F\x8B") { my $ropen = sprintf $gzip_read_open, $filename; if (open($fh, $ropen)) { binmode $fh; return $fh; } else { return undef; } } seek($fh, 0, SEEK_SET) or die "IO::Zlib: open('$filename', 'r'): seek: $!"; return $fh; } else { return undef; } } elsif ($mode =~ /w/) { my $level = ''; $level = "-$1" if $mode =~ /([1-9])/; # To maximize portability we would need to open # two filehandles here, one for "| gzip $level" # and another for "> $filename", and then when # writing copy bytes from the first to the second. # We are using IO::Handle objects for now, however, # and they can only contain one stream at a time. my $wopen = sprintf $gzip_write_open, $filename; if (open($fh, $wopen)) { $fh->autoflush(1); binmode $fh; return $fh; } else { return undef; } } else { croak "IO::Zlib::gzopen_external: mode '$mode' is illegal"; } return undef; } sub gzread_external { # Use read() instead of syswrite() because people may # mix reads and readlines, and we don't want to mess # the stdio buffering. See also gzreadline_external() # and gzwrite_external(). my $nread = read($_[0], $_[1], @_ == 3 ? $_[2] : 4096); defined $nread ? $nread : -1; } sub gzwrite_external { # Using syswrite() is okay (cf. gzread_external()) # since the bytes leave this process and buffering # is therefore not an issue. my $nwrote = syswrite($_[0], $_[1]); defined $nwrote ? $nwrote : -1; } sub gzreadline_external { # See the comment in gzread_external(). $_[1] = readline($_[0]); return defined $_[1] ? length($_[1]) : -1; } sub gzeof_external { return eof($_[0]); } sub gzclose_external { close($_[0]); # I am not entirely certain why this is needed but it seems # the above close() always fails (as if the stream would have # been already closed - something to do with using external # processes via pipes?) return 0; } 1; darwin-perl-lib/IO/Uncompress/Adapter/000755 000765 000024 00000000000 13167163507 022011 5ustar00ocsinventorystaff000000 000000 darwin-perl-lib/IO/Uncompress/AnyInflate.pm000444 000765 000024 00000066426 13167163507 023035 0ustar00ocsinventorystaff000000 000000 package IO::Uncompress::AnyInflate ; # for RFC1950, RFC1951 or RFC1952 use strict; use warnings; use bytes; use IO::Compress::Base::Common 2.074 (); use IO::Uncompress::Adapter::Inflate 2.074 (); use IO::Uncompress::Base 2.074 ; use IO::Uncompress::Gunzip 2.074 ; use IO::Uncompress::Inflate 2.074 ; use IO::Uncompress::RawInflate 2.074 ; use IO::Uncompress::Unzip 2.074 ; require Exporter ; our ($VERSION, @ISA, @EXPORT_OK, %EXPORT_TAGS, $AnyInflateError); $VERSION = '2.074'; $AnyInflateError = ''; @ISA = qw(IO::Uncompress::Base Exporter); @EXPORT_OK = qw( $AnyInflateError anyinflate ) ; %EXPORT_TAGS = %IO::Uncompress::Base::DEFLATE_CONSTANTS ; push @{ $EXPORT_TAGS{all} }, @EXPORT_OK ; Exporter::export_ok_tags('all'); # TODO - allow the user to pick a set of the three formats to allow # or just assume want to auto-detect any of the three formats. sub new { my $class = shift ; my $obj = IO::Compress::Base::Common::createSelfTiedObject($class, \$AnyInflateError); $obj->_create(undef, 0, @_); } sub anyinflate { my $obj = IO::Compress::Base::Common::createSelfTiedObject(undef, \$AnyInflateError); return $obj->_inf(@_) ; } sub getExtraParams { use IO::Compress::Base::Common 2.074 qw(:Parse); return ( 'rawinflate' => [Parse_boolean, 0] ) ; } sub ckParams { my $self = shift ; my $got = shift ; # any always needs both crc32 and adler32 $got->setValue('crc32' => 1); $got->setValue('adler32' => 1); return 1; } sub mkUncomp { my $self = shift ; my $got = shift ; my ($obj, $errstr, $errno) = IO::Uncompress::Adapter::Inflate::mkUncompObject(); return $self->saveErrorString(undef, $errstr, $errno) if ! defined $obj; *$self->{Uncomp} = $obj; my @possible = qw( Inflate Gunzip Unzip ); unshift @possible, 'RawInflate' if 1 || $got->getValue('rawinflate'); my $magic = $self->ckMagic( @possible ); if ($magic) { *$self->{Info} = $self->readHeader($magic) or return undef ; return 1; } return 0 ; } sub ckMagic { my $self = shift; my @names = @_ ; my $keep = ref $self ; for my $class ( map { "IO::Uncompress::$_" } @names) { bless $self => $class; my $magic = $self->ckMagic(); if ($magic) { #bless $self => $class; return $magic ; } $self->pushBack(*$self->{HeaderPending}) ; *$self->{HeaderPending} = '' ; } bless $self => $keep; return undef; } 1 ; __END__ =head1 NAME IO::Uncompress::AnyInflate - Uncompress zlib-based (zip, gzip) file/buffer =head1 SYNOPSIS use IO::Uncompress::AnyInflate qw(anyinflate $AnyInflateError) ; my $status = anyinflate $input => $output [,OPTS] or die "anyinflate failed: $AnyInflateError\n"; my $z = new IO::Uncompress::AnyInflate $input [OPTS] or die "anyinflate failed: $AnyInflateError\n"; $status = $z->read($buffer) $status = $z->read($buffer, $length) $status = $z->read($buffer, $length, $offset) $line = $z->getline() $char = $z->getc() $char = $z->ungetc() $char = $z->opened() $status = $z->inflateSync() $data = $z->trailingData() $status = $z->nextStream() $data = $z->getHeaderInfo() $z->tell() $z->seek($position, $whence) $z->binmode() $z->fileno() $z->eof() $z->close() $AnyInflateError ; # IO::File mode <$z> read($z, $buffer); read($z, $buffer, $length); read($z, $buffer, $length, $offset); tell($z) seek($z, $position, $whence) binmode($z) fileno($z) eof($z) close($z) =head1 DESCRIPTION This module provides a Perl interface that allows the reading of files/buffers that have been compressed in a number of formats that use the zlib compression library. The formats supported are =over 5 =item RFC 1950 =item RFC 1951 (optionally) =item gzip (RFC 1952) =item zip =back The module will auto-detect which, if any, of the supported compression formats is being used. =head1 Functional Interface A top-level function, C, is provided to carry out "one-shot" uncompression between buffers and/or files. For finer control over the uncompression process, see the L section. use IO::Uncompress::AnyInflate qw(anyinflate $AnyInflateError) ; anyinflate $input_filename_or_reference => $output_filename_or_reference [,OPTS] or die "anyinflate failed: $AnyInflateError\n"; The functional interface needs Perl5.005 or better. =head2 anyinflate $input_filename_or_reference => $output_filename_or_reference [, OPTS] C expects at least two parameters, C<$input_filename_or_reference> and C<$output_filename_or_reference>. =head3 The C<$input_filename_or_reference> parameter The parameter, C<$input_filename_or_reference>, is used to define the source of the compressed data. It can take one of the following forms: =over 5 =item A filename If the <$input_filename_or_reference> parameter is a simple scalar, it is assumed to be a filename. This file will be opened for reading and the input data will be read from it. =item A filehandle If the C<$input_filename_or_reference> parameter is a filehandle, the input data will be read from it. The string '-' can be used as an alias for standard input. =item A scalar reference If C<$input_filename_or_reference> is a scalar reference, the input data will be read from C<$$input_filename_or_reference>. =item An array reference If C<$input_filename_or_reference> is an array reference, each element in the array must be a filename. The input data will be read from each file in turn. The complete array will be walked to ensure that it only contains valid filenames before any data is uncompressed. =item An Input FileGlob string If C<$input_filename_or_reference> is a string that is delimited by the characters "<" and ">" C will assume that it is an I. The input is the list of files that match the fileglob. See L for more details. =back If the C<$input_filename_or_reference> parameter is any other type, C will be returned. =head3 The C<$output_filename_or_reference> parameter The parameter C<$output_filename_or_reference> is used to control the destination of the uncompressed data. This parameter can take one of these forms. =over 5 =item A filename If the C<$output_filename_or_reference> parameter is a simple scalar, it is assumed to be a filename. This file will be opened for writing and the uncompressed data will be written to it. =item A filehandle If the C<$output_filename_or_reference> parameter is a filehandle, the uncompressed data will be written to it. The string '-' can be used as an alias for standard output. =item A scalar reference If C<$output_filename_or_reference> is a scalar reference, the uncompressed data will be stored in C<$$output_filename_or_reference>. =item An Array Reference If C<$output_filename_or_reference> is an array reference, the uncompressed data will be pushed onto the array. =item An Output FileGlob If C<$output_filename_or_reference> is a string that is delimited by the characters "<" and ">" C will assume that it is an I. The output is the list of files that match the fileglob. When C<$output_filename_or_reference> is an fileglob string, C<$input_filename_or_reference> must also be a fileglob string. Anything else is an error. See L for more details. =back If the C<$output_filename_or_reference> parameter is any other type, C will be returned. =head2 Notes When C<$input_filename_or_reference> maps to multiple compressed files/buffers and C<$output_filename_or_reference> is a single file/buffer, after uncompression C<$output_filename_or_reference> will contain a concatenation of all the uncompressed data from each of the input files/buffers. =head2 Optional Parameters Unless specified below, the optional parameters for C, C, are the same as those used with the OO interface defined in the L section below. =over 5 =item C<< AutoClose => 0|1 >> This option applies to any input or output data streams to C that are filehandles. If C is specified, and the value is true, it will result in all input and/or output filehandles being closed once C has completed. This parameter defaults to 0. =item C<< BinModeOut => 0|1 >> When writing to a file or filehandle, set C before writing to the file. Defaults to 0. =item C<< Append => 0|1 >> The behaviour of this option is dependent on the type of output data stream. =over 5 =item * A Buffer If C is enabled, all uncompressed data will be append to the end of the output buffer. Otherwise the output buffer will be cleared before any uncompressed data is written to it. =item * A Filename If C is enabled, the file will be opened in append mode. Otherwise the contents of the file, if any, will be truncated before any uncompressed data is written to it. =item * A Filehandle If C is enabled, the filehandle will be positioned to the end of the file via a call to C before any uncompressed data is written to it. Otherwise the file pointer will not be moved. =back When C is specified, and set to true, it will I all uncompressed data to the output data stream. So when the output is a filehandle it will carry out a seek to the eof before writing any uncompressed data. If the output is a filename, it will be opened for appending. If the output is a buffer, all uncompressed data will be appended to the existing buffer. Conversely when C is not specified, or it is present and is set to false, it will operate as follows. When the output is a filename, it will truncate the contents of the file before writing any uncompressed data. If the output is a filehandle its position will not be changed. If the output is a buffer, it will be wiped before any uncompressed data is output. Defaults to 0. =item C<< MultiStream => 0|1 >> If the input file/buffer contains multiple compressed data streams, this option will uncompress the whole lot as a single data stream. Defaults to 0. =item C<< TrailingData => $scalar >> Returns the data, if any, that is present immediately after the compressed data stream once uncompression is complete. This option can be used when there is useful information immediately following the compressed data stream, and you don't know the length of the compressed data stream. If the input is a buffer, C will return everything from the end of the compressed data stream to the end of the buffer. If the input is a filehandle, C will return the data that is left in the filehandle input buffer once the end of the compressed data stream has been reached. You can then use the filehandle to read the rest of the input file. Don't bother using C if the input is a filename. If you know the length of the compressed data stream before you start uncompressing, you can avoid having to use C by setting the C option. =back =head2 Examples To read the contents of the file C and write the uncompressed data to the file C. use strict ; use warnings ; use IO::Uncompress::AnyInflate qw(anyinflate $AnyInflateError) ; my $input = "file1.txt.Compressed"; my $output = "file1.txt"; anyinflate $input => $output or die "anyinflate failed: $AnyInflateError\n"; To read from an existing Perl filehandle, C<$input>, and write the uncompressed data to a buffer, C<$buffer>. use strict ; use warnings ; use IO::Uncompress::AnyInflate qw(anyinflate $AnyInflateError) ; use IO::File ; my $input = new IO::File " \$buffer or die "anyinflate failed: $AnyInflateError\n"; To uncompress all files in the directory "/my/home" that match "*.txt.Compressed" and store the compressed data in the same directory use strict ; use warnings ; use IO::Uncompress::AnyInflate qw(anyinflate $AnyInflateError) ; anyinflate '' => '' or die "anyinflate failed: $AnyInflateError\n"; and if you want to compress each file one at a time, this will do the trick use strict ; use warnings ; use IO::Uncompress::AnyInflate qw(anyinflate $AnyInflateError) ; for my $input ( glob "/my/home/*.txt.Compressed" ) { my $output = $input; $output =~ s/.Compressed// ; anyinflate $input => $output or die "Error compressing '$input': $AnyInflateError\n"; } =head1 OO Interface =head2 Constructor The format of the constructor for IO::Uncompress::AnyInflate is shown below my $z = new IO::Uncompress::AnyInflate $input [OPTS] or die "IO::Uncompress::AnyInflate failed: $AnyInflateError\n"; Returns an C object on success and undef on failure. The variable C<$AnyInflateError> will contain an error message on failure. If you are running Perl 5.005 or better the object, C<$z>, returned from IO::Uncompress::AnyInflate can be used exactly like an L filehandle. This means that all normal input file operations can be carried out with C<$z>. For example, to read a line from a compressed file/buffer you can use either of these forms $line = $z->getline(); $line = <$z>; The mandatory parameter C<$input> is used to determine the source of the compressed data. This parameter can take one of three forms. =over 5 =item A filename If the C<$input> parameter is a scalar, it is assumed to be a filename. This file will be opened for reading and the compressed data will be read from it. =item A filehandle If the C<$input> parameter is a filehandle, the compressed data will be read from it. The string '-' can be used as an alias for standard input. =item A scalar reference If C<$input> is a scalar reference, the compressed data will be read from C<$$input>. =back =head2 Constructor Options The option names defined below are case insensitive and can be optionally prefixed by a '-'. So all of the following are valid -AutoClose -autoclose AUTOCLOSE autoclose OPTS is a combination of the following options: =over 5 =item C<< AutoClose => 0|1 >> This option is only valid when the C<$input> parameter is a filehandle. If specified, and the value is true, it will result in the file being closed once either the C method is called or the IO::Uncompress::AnyInflate object is destroyed. This parameter defaults to 0. =item C<< MultiStream => 0|1 >> Allows multiple concatenated compressed streams to be treated as a single compressed stream. Decompression will stop once either the end of the file/buffer is reached, an error is encountered (premature eof, corrupt compressed data) or the end of a stream is not immediately followed by the start of another stream. This parameter defaults to 0. =item C<< Prime => $string >> This option will uncompress the contents of C<$string> before processing the input file/buffer. This option can be useful when the compressed data is embedded in another file/data structure and it is not possible to work out where the compressed data begins without having to read the first few bytes. If this is the case, the uncompression can be I with these bytes using this option. =item C<< Transparent => 0|1 >> If this option is set and the input file/buffer is not compressed data, the module will allow reading of it anyway. In addition, if the input file/buffer does contain compressed data and there is non-compressed data immediately following it, setting this option will make this module treat the whole file/buffer as a single data stream. This option defaults to 1. =item C<< BlockSize => $num >> When reading the compressed input data, IO::Uncompress::AnyInflate will read it in blocks of C<$num> bytes. This option defaults to 4096. =item C<< InputLength => $size >> When present this option will limit the number of compressed bytes read from the input file/buffer to C<$size>. This option can be used in the situation where there is useful data directly after the compressed data stream and you know beforehand the exact length of the compressed data stream. This option is mostly used when reading from a filehandle, in which case the file pointer will be left pointing to the first byte directly after the compressed data stream. This option defaults to off. =item C<< Append => 0|1 >> This option controls what the C method does with uncompressed data. If set to 1, all uncompressed data will be appended to the output parameter of the C method. If set to 0, the contents of the output parameter of the C method will be overwritten by the uncompressed data. Defaults to 0. =item C<< Strict => 0|1 >> This option controls whether the extra checks defined below are used when carrying out the decompression. When Strict is on, the extra tests are carried out, when Strict is off they are not. The default for this option is off. If the input is an RFC 1950 data stream, the following will be checked: =over 5 =item 1 The ADLER32 checksum field must be present. =item 2 The value of the ADLER32 field read must match the adler32 value of the uncompressed data actually contained in the file. =back If the input is a gzip (RFC 1952) data stream, the following will be checked: =over 5 =item 1 If the FHCRC bit is set in the gzip FLG header byte, the CRC16 bytes in the header must match the crc16 value of the gzip header actually read. =item 2 If the gzip header contains a name field (FNAME) it consists solely of ISO 8859-1 characters. =item 3 If the gzip header contains a comment field (FCOMMENT) it consists solely of ISO 8859-1 characters plus line-feed. =item 4 If the gzip FEXTRA header field is present it must conform to the sub-field structure as defined in RFC 1952. =item 5 The CRC32 and ISIZE trailer fields must be present. =item 6 The value of the CRC32 field read must match the crc32 value of the uncompressed data actually contained in the gzip file. =item 7 The value of the ISIZE fields read must match the length of the uncompressed data actually read from the file. =back =item C<< RawInflate => 0|1 >> When auto-detecting the compressed format, try to test for raw-deflate (RFC 1951) content using the C module. The reason this is not default behaviour is because RFC 1951 content can only be detected by attempting to uncompress it. This process is error prone and can result is false positives. Defaults to 0. =item C<< ParseExtra => 0|1 >> If the gzip FEXTRA header field is present and this option is set, it will force the module to check that it conforms to the sub-field structure as defined in RFC 1952. If the C is on it will automatically enable this option. Defaults to 0. =back =head2 Examples TODO =head1 Methods =head2 read Usage is $status = $z->read($buffer) Reads a block of compressed data (the size of the compressed block is determined by the C option in the constructor), uncompresses it and writes any uncompressed data into C<$buffer>. If the C parameter is set in the constructor, the uncompressed data will be appended to the C<$buffer> parameter. Otherwise C<$buffer> will be overwritten. Returns the number of uncompressed bytes written to C<$buffer>, zero if eof or a negative number on error. =head2 read Usage is $status = $z->read($buffer, $length) $status = $z->read($buffer, $length, $offset) $status = read($z, $buffer, $length) $status = read($z, $buffer, $length, $offset) Attempt to read C<$length> bytes of uncompressed data into C<$buffer>. The main difference between this form of the C method and the previous one, is that this one will attempt to return I C<$length> bytes. The only circumstances that this function will not is if end-of-file or an IO error is encountered. Returns the number of uncompressed bytes written to C<$buffer>, zero if eof or a negative number on error. =head2 getline Usage is $line = $z->getline() $line = <$z> Reads a single line. This method fully supports the use of the variable C<$/> (or C<$INPUT_RECORD_SEPARATOR> or C<$RS> when C is in use) to determine what constitutes an end of line. Paragraph mode, record mode and file slurp mode are all supported. =head2 getc Usage is $char = $z->getc() Read a single character. =head2 ungetc Usage is $char = $z->ungetc($string) =head2 inflateSync Usage is $status = $z->inflateSync() TODO =head2 getHeaderInfo Usage is $hdr = $z->getHeaderInfo(); @hdrs = $z->getHeaderInfo(); This method returns either a hash reference (in scalar context) or a list or hash references (in array context) that contains information about each of the header fields in the compressed data stream(s). =head2 tell Usage is $z->tell() tell $z Returns the uncompressed file offset. =head2 eof Usage is $z->eof(); eof($z); Returns true if the end of the compressed input stream has been reached. =head2 seek $z->seek($position, $whence); seek($z, $position, $whence); Provides a sub-set of the C functionality, with the restriction that it is only legal to seek forward in the input file/buffer. It is a fatal error to attempt to seek backward. Note that the implementation of C in this module does not provide true random access to a compressed file/buffer. It works by uncompressing data from the current offset in the file/buffer until it reaches the uncompressed offset specified in the parameters to C. For very small files this may be acceptable behaviour. For large files it may cause an unacceptable delay. The C<$whence> parameter takes one the usual values, namely SEEK_SET, SEEK_CUR or SEEK_END. Returns 1 on success, 0 on failure. =head2 binmode Usage is $z->binmode binmode $z ; This is a noop provided for completeness. =head2 opened $z->opened() Returns true if the object currently refers to a opened file/buffer. =head2 autoflush my $prev = $z->autoflush() my $prev = $z->autoflush(EXPR) If the C<$z> object is associated with a file or a filehandle, this method returns the current autoflush setting for the underlying filehandle. If C is present, and is non-zero, it will enable flushing after every write/print operation. If C<$z> is associated with a buffer, this method has no effect and always returns C. B that the special variable C<$|> B be used to set or retrieve the autoflush setting. =head2 input_line_number $z->input_line_number() $z->input_line_number(EXPR) Returns the current uncompressed line number. If C is present it has the effect of setting the line number. Note that setting the line number does not change the current position within the file/buffer being read. The contents of C<$/> are used to determine what constitutes a line terminator. =head2 fileno $z->fileno() fileno($z) If the C<$z> object is associated with a file or a filehandle, C will return the underlying file descriptor. Once the C method is called C will return C. If the C<$z> object is associated with a buffer, this method will return C. =head2 close $z->close() ; close $z ; Closes the output file/buffer. For most versions of Perl this method will be automatically invoked if the IO::Uncompress::AnyInflate object is destroyed (either explicitly or by the variable with the reference to the object going out of scope). The exceptions are Perl versions 5.005 through 5.00504 and 5.8.0. In these cases, the C method will be called automatically, but not until global destruction of all live objects when the program is terminating. Therefore, if you want your scripts to be able to run on all versions of Perl, you should call C explicitly and not rely on automatic closing. Returns true on success, otherwise 0. If the C option has been enabled when the IO::Uncompress::AnyInflate object was created, and the object is associated with a file, the underlying file will also be closed. =head2 nextStream Usage is my $status = $z->nextStream(); Skips to the next compressed data stream in the input file/buffer. If a new compressed data stream is found, the eof marker will be cleared and C<$.> will be reset to 0. Returns 1 if a new stream was found, 0 if none was found, and -1 if an error was encountered. =head2 trailingData Usage is my $data = $z->trailingData(); Returns the data, if any, that is present immediately after the compressed data stream once uncompression is complete. It only makes sense to call this method once the end of the compressed data stream has been encountered. This option can be used when there is useful information immediately following the compressed data stream, and you don't know the length of the compressed data stream. If the input is a buffer, C will return everything from the end of the compressed data stream to the end of the buffer. If the input is a filehandle, C will return the data that is left in the filehandle input buffer once the end of the compressed data stream has been reached. You can then use the filehandle to read the rest of the input file. Don't bother using C if the input is a filename. If you know the length of the compressed data stream before you start uncompressing, you can avoid having to use C by setting the C option in the constructor. =head1 Importing No symbolic constants are required by this IO::Uncompress::AnyInflate at present. =over 5 =item :all Imports C and C<$AnyInflateError>. Same as doing this use IO::Uncompress::AnyInflate qw(anyinflate $AnyInflateError) ; =back =head1 EXAMPLES =head2 Working with Net::FTP See L =head1 SEE ALSO L, L, L, L, L, L, L, L, L, L, L, L, L, L, L, L, L, L L L, L, L, L For RFC 1950, 1951 and 1952 see L, L and L The I compression library was written by Jean-loup Gailly C and Mark Adler C. The primary site for the I compression library is L. The primary site for gzip is L. =head1 AUTHOR This module was written by Paul Marquess, C. =head1 MODIFICATION HISTORY See the Changes file. =head1 COPYRIGHT AND LICENSE Copyright (c) 2005-2017 Paul Marquess. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. darwin-perl-lib/IO/Uncompress/AnyUncompress.pm000444 000765 000024 00000071451 13167163507 023603 0ustar00ocsinventorystaff000000 000000 package IO::Uncompress::AnyUncompress ; use strict; use warnings; use bytes; use IO::Compress::Base::Common 2.074 (); use IO::Uncompress::Base 2.074 ; require Exporter ; our ($VERSION, @ISA, @EXPORT_OK, %EXPORT_TAGS, $AnyUncompressError); $VERSION = '2.074'; $AnyUncompressError = ''; @ISA = qw(IO::Uncompress::Base Exporter); @EXPORT_OK = qw( $AnyUncompressError anyuncompress ) ; %EXPORT_TAGS = %IO::Uncompress::Base::DEFLATE_CONSTANTS ; push @{ $EXPORT_TAGS{all} }, @EXPORT_OK ; Exporter::export_ok_tags('all'); # TODO - allow the user to pick a set of the three formats to allow # or just assume want to auto-detect any of the three formats. BEGIN { local @INC = @INC; pop @INC if $INC[-1] eq '.'; eval ' use IO::Uncompress::Adapter::Inflate 2.074 ;'; eval ' use IO::Uncompress::Adapter::Bunzip2 2.074 ;'; eval ' use IO::Uncompress::Adapter::LZO 2.074 ;'; eval ' use IO::Uncompress::Adapter::Lzf 2.074 ;'; eval ' use IO::Uncompress::Adapter::UnLzma 2.074 ;'; eval ' use IO::Uncompress::Adapter::UnXz 2.074 ;'; eval ' use IO::Uncompress::Bunzip2 2.074 ;'; eval ' use IO::Uncompress::UnLzop 2.074 ;'; eval ' use IO::Uncompress::Gunzip 2.074 ;'; eval ' use IO::Uncompress::Inflate 2.074 ;'; eval ' use IO::Uncompress::RawInflate 2.074 ;'; eval ' use IO::Uncompress::Unzip 2.074 ;'; eval ' use IO::Uncompress::UnLzf 2.074 ;'; eval ' use IO::Uncompress::UnLzma 2.074 ;'; eval ' use IO::Uncompress::UnXz 2.074 ;'; } sub new { my $class = shift ; my $obj = IO::Compress::Base::Common::createSelfTiedObject($class, \$AnyUncompressError); $obj->_create(undef, 0, @_); } sub anyuncompress { my $obj = IO::Compress::Base::Common::createSelfTiedObject(undef, \$AnyUncompressError); return $obj->_inf(@_) ; } sub getExtraParams { return ( 'rawinflate' => [IO::Compress::Base::Common::Parse_boolean, 0] , 'unlzma' => [IO::Compress::Base::Common::Parse_boolean, 0] ) ; } sub ckParams { my $self = shift ; my $got = shift ; # any always needs both crc32 and adler32 $got->setValue('crc32' => 1); $got->setValue('adler32' => 1); return 1; } sub mkUncomp { my $self = shift ; my $got = shift ; my $magic ; # try zlib first if (defined $IO::Uncompress::RawInflate::VERSION ) { my ($obj, $errstr, $errno) = IO::Uncompress::Adapter::Inflate::mkUncompObject(); return $self->saveErrorString(undef, $errstr, $errno) if ! defined $obj; *$self->{Uncomp} = $obj; my @possible = qw( Inflate Gunzip Unzip ); unshift @possible, 'RawInflate' if $got->getValue('rawinflate'); $magic = $self->ckMagic( @possible ); if ($magic) { *$self->{Info} = $self->readHeader($magic) or return undef ; return 1; } } if (defined $IO::Uncompress::UnLzma::VERSION && $got->getValue('unlzma')) { my ($obj, $errstr, $errno) = IO::Uncompress::Adapter::UnLzma::mkUncompObject(); return $self->saveErrorString(undef, $errstr, $errno) if ! defined $obj; *$self->{Uncomp} = $obj; my @possible = qw( UnLzma ); #unshift @possible, 'RawInflate' # if $got->getValue('rawinflate'); if ( *$self->{Info} = $self->ckMagic( @possible )) { return 1; } } if (defined $IO::Uncompress::UnXz::VERSION and $magic = $self->ckMagic('UnXz')) { *$self->{Info} = $self->readHeader($magic) or return undef ; my ($obj, $errstr, $errno) = IO::Uncompress::Adapter::UnXz::mkUncompObject(); return $self->saveErrorString(undef, $errstr, $errno) if ! defined $obj; *$self->{Uncomp} = $obj; return 1; } if (defined $IO::Uncompress::Bunzip2::VERSION and $magic = $self->ckMagic('Bunzip2')) { *$self->{Info} = $self->readHeader($magic) or return undef ; my ($obj, $errstr, $errno) = IO::Uncompress::Adapter::Bunzip2::mkUncompObject(); return $self->saveErrorString(undef, $errstr, $errno) if ! defined $obj; *$self->{Uncomp} = $obj; return 1; } if (defined $IO::Uncompress::UnLzop::VERSION and $magic = $self->ckMagic('UnLzop')) { *$self->{Info} = $self->readHeader($magic) or return undef ; my ($obj, $errstr, $errno) = IO::Uncompress::Adapter::LZO::mkUncompObject(); return $self->saveErrorString(undef, $errstr, $errno) if ! defined $obj; *$self->{Uncomp} = $obj; return 1; } if (defined $IO::Uncompress::UnLzf::VERSION and $magic = $self->ckMagic('UnLzf')) { *$self->{Info} = $self->readHeader($magic) or return undef ; my ($obj, $errstr, $errno) = IO::Uncompress::Adapter::Lzf::mkUncompObject(); return $self->saveErrorString(undef, $errstr, $errno) if ! defined $obj; *$self->{Uncomp} = $obj; return 1; } return 0 ; } sub ckMagic { my $self = shift; my @names = @_ ; my $keep = ref $self ; for my $class ( map { "IO::Uncompress::$_" } @names) { bless $self => $class; my $magic = $self->ckMagic(); if ($magic) { #bless $self => $class; return $magic ; } $self->pushBack(*$self->{HeaderPending}) ; *$self->{HeaderPending} = '' ; } bless $self => $keep; return undef; } 1 ; __END__ =head1 NAME IO::Uncompress::AnyUncompress - Uncompress gzip, zip, bzip2 or lzop file/buffer =head1 SYNOPSIS use IO::Uncompress::AnyUncompress qw(anyuncompress $AnyUncompressError) ; my $status = anyuncompress $input => $output [,OPTS] or die "anyuncompress failed: $AnyUncompressError\n"; my $z = new IO::Uncompress::AnyUncompress $input [OPTS] or die "anyuncompress failed: $AnyUncompressError\n"; $status = $z->read($buffer) $status = $z->read($buffer, $length) $status = $z->read($buffer, $length, $offset) $line = $z->getline() $char = $z->getc() $char = $z->ungetc() $char = $z->opened() $data = $z->trailingData() $status = $z->nextStream() $data = $z->getHeaderInfo() $z->tell() $z->seek($position, $whence) $z->binmode() $z->fileno() $z->eof() $z->close() $AnyUncompressError ; # IO::File mode <$z> read($z, $buffer); read($z, $buffer, $length); read($z, $buffer, $length, $offset); tell($z) seek($z, $position, $whence) binmode($z) fileno($z) eof($z) close($z) =head1 DESCRIPTION This module provides a Perl interface that allows the reading of files/buffers that have been compressed with a variety of compression libraries. The formats supported are: =over 5 =item RFC 1950 =item RFC 1951 (optionally) =item gzip (RFC 1952) =item zip =item bzip2 =item lzop =item lzf =item lzma =item xz =back The module will auto-detect which, if any, of the supported compression formats is being used. =head1 Functional Interface A top-level function, C, is provided to carry out "one-shot" uncompression between buffers and/or files. For finer control over the uncompression process, see the L section. use IO::Uncompress::AnyUncompress qw(anyuncompress $AnyUncompressError) ; anyuncompress $input_filename_or_reference => $output_filename_or_reference [,OPTS] or die "anyuncompress failed: $AnyUncompressError\n"; The functional interface needs Perl5.005 or better. =head2 anyuncompress $input_filename_or_reference => $output_filename_or_reference [, OPTS] C expects at least two parameters, C<$input_filename_or_reference> and C<$output_filename_or_reference>. =head3 The C<$input_filename_or_reference> parameter The parameter, C<$input_filename_or_reference>, is used to define the source of the compressed data. It can take one of the following forms: =over 5 =item A filename If the <$input_filename_or_reference> parameter is a simple scalar, it is assumed to be a filename. This file will be opened for reading and the input data will be read from it. =item A filehandle If the C<$input_filename_or_reference> parameter is a filehandle, the input data will be read from it. The string '-' can be used as an alias for standard input. =item A scalar reference If C<$input_filename_or_reference> is a scalar reference, the input data will be read from C<$$input_filename_or_reference>. =item An array reference If C<$input_filename_or_reference> is an array reference, each element in the array must be a filename. The input data will be read from each file in turn. The complete array will be walked to ensure that it only contains valid filenames before any data is uncompressed. =item An Input FileGlob string If C<$input_filename_or_reference> is a string that is delimited by the characters "<" and ">" C will assume that it is an I. The input is the list of files that match the fileglob. See L for more details. =back If the C<$input_filename_or_reference> parameter is any other type, C will be returned. =head3 The C<$output_filename_or_reference> parameter The parameter C<$output_filename_or_reference> is used to control the destination of the uncompressed data. This parameter can take one of these forms. =over 5 =item A filename If the C<$output_filename_or_reference> parameter is a simple scalar, it is assumed to be a filename. This file will be opened for writing and the uncompressed data will be written to it. =item A filehandle If the C<$output_filename_or_reference> parameter is a filehandle, the uncompressed data will be written to it. The string '-' can be used as an alias for standard output. =item A scalar reference If C<$output_filename_or_reference> is a scalar reference, the uncompressed data will be stored in C<$$output_filename_or_reference>. =item An Array Reference If C<$output_filename_or_reference> is an array reference, the uncompressed data will be pushed onto the array. =item An Output FileGlob If C<$output_filename_or_reference> is a string that is delimited by the characters "<" and ">" C will assume that it is an I. The output is the list of files that match the fileglob. When C<$output_filename_or_reference> is an fileglob string, C<$input_filename_or_reference> must also be a fileglob string. Anything else is an error. See L for more details. =back If the C<$output_filename_or_reference> parameter is any other type, C will be returned. =head2 Notes When C<$input_filename_or_reference> maps to multiple compressed files/buffers and C<$output_filename_or_reference> is a single file/buffer, after uncompression C<$output_filename_or_reference> will contain a concatenation of all the uncompressed data from each of the input files/buffers. =head2 Optional Parameters Unless specified below, the optional parameters for C, C, are the same as those used with the OO interface defined in the L section below. =over 5 =item C<< AutoClose => 0|1 >> This option applies to any input or output data streams to C that are filehandles. If C is specified, and the value is true, it will result in all input and/or output filehandles being closed once C has completed. This parameter defaults to 0. =item C<< BinModeOut => 0|1 >> When writing to a file or filehandle, set C before writing to the file. Defaults to 0. =item C<< Append => 0|1 >> The behaviour of this option is dependent on the type of output data stream. =over 5 =item * A Buffer If C is enabled, all uncompressed data will be append to the end of the output buffer. Otherwise the output buffer will be cleared before any uncompressed data is written to it. =item * A Filename If C is enabled, the file will be opened in append mode. Otherwise the contents of the file, if any, will be truncated before any uncompressed data is written to it. =item * A Filehandle If C is enabled, the filehandle will be positioned to the end of the file via a call to C before any uncompressed data is written to it. Otherwise the file pointer will not be moved. =back When C is specified, and set to true, it will I all uncompressed data to the output data stream. So when the output is a filehandle it will carry out a seek to the eof before writing any uncompressed data. If the output is a filename, it will be opened for appending. If the output is a buffer, all uncompressed data will be appended to the existing buffer. Conversely when C is not specified, or it is present and is set to false, it will operate as follows. When the output is a filename, it will truncate the contents of the file before writing any uncompressed data. If the output is a filehandle its position will not be changed. If the output is a buffer, it will be wiped before any uncompressed data is output. Defaults to 0. =item C<< MultiStream => 0|1 >> If the input file/buffer contains multiple compressed data streams, this option will uncompress the whole lot as a single data stream. Defaults to 0. =item C<< TrailingData => $scalar >> Returns the data, if any, that is present immediately after the compressed data stream once uncompression is complete. This option can be used when there is useful information immediately following the compressed data stream, and you don't know the length of the compressed data stream. If the input is a buffer, C will return everything from the end of the compressed data stream to the end of the buffer. If the input is a filehandle, C will return the data that is left in the filehandle input buffer once the end of the compressed data stream has been reached. You can then use the filehandle to read the rest of the input file. Don't bother using C if the input is a filename. If you know the length of the compressed data stream before you start uncompressing, you can avoid having to use C by setting the C option. =back =head2 Examples To read the contents of the file C and write the uncompressed data to the file C. use strict ; use warnings ; use IO::Uncompress::AnyUncompress qw(anyuncompress $AnyUncompressError) ; my $input = "file1.txt.Compressed"; my $output = "file1.txt"; anyuncompress $input => $output or die "anyuncompress failed: $AnyUncompressError\n"; To read from an existing Perl filehandle, C<$input>, and write the uncompressed data to a buffer, C<$buffer>. use strict ; use warnings ; use IO::Uncompress::AnyUncompress qw(anyuncompress $AnyUncompressError) ; use IO::File ; my $input = new IO::File " \$buffer or die "anyuncompress failed: $AnyUncompressError\n"; To uncompress all files in the directory "/my/home" that match "*.txt.Compressed" and store the compressed data in the same directory use strict ; use warnings ; use IO::Uncompress::AnyUncompress qw(anyuncompress $AnyUncompressError) ; anyuncompress '' => '' or die "anyuncompress failed: $AnyUncompressError\n"; and if you want to compress each file one at a time, this will do the trick use strict ; use warnings ; use IO::Uncompress::AnyUncompress qw(anyuncompress $AnyUncompressError) ; for my $input ( glob "/my/home/*.txt.Compressed" ) { my $output = $input; $output =~ s/.Compressed// ; anyuncompress $input => $output or die "Error compressing '$input': $AnyUncompressError\n"; } =head1 OO Interface =head2 Constructor The format of the constructor for IO::Uncompress::AnyUncompress is shown below my $z = new IO::Uncompress::AnyUncompress $input [OPTS] or die "IO::Uncompress::AnyUncompress failed: $AnyUncompressError\n"; Returns an C object on success and undef on failure. The variable C<$AnyUncompressError> will contain an error message on failure. If you are running Perl 5.005 or better the object, C<$z>, returned from IO::Uncompress::AnyUncompress can be used exactly like an L filehandle. This means that all normal input file operations can be carried out with C<$z>. For example, to read a line from a compressed file/buffer you can use either of these forms $line = $z->getline(); $line = <$z>; The mandatory parameter C<$input> is used to determine the source of the compressed data. This parameter can take one of three forms. =over 5 =item A filename If the C<$input> parameter is a scalar, it is assumed to be a filename. This file will be opened for reading and the compressed data will be read from it. =item A filehandle If the C<$input> parameter is a filehandle, the compressed data will be read from it. The string '-' can be used as an alias for standard input. =item A scalar reference If C<$input> is a scalar reference, the compressed data will be read from C<$$input>. =back =head2 Constructor Options The option names defined below are case insensitive and can be optionally prefixed by a '-'. So all of the following are valid -AutoClose -autoclose AUTOCLOSE autoclose OPTS is a combination of the following options: =over 5 =item C<< AutoClose => 0|1 >> This option is only valid when the C<$input> parameter is a filehandle. If specified, and the value is true, it will result in the file being closed once either the C method is called or the IO::Uncompress::AnyUncompress object is destroyed. This parameter defaults to 0. =item C<< MultiStream => 0|1 >> Allows multiple concatenated compressed streams to be treated as a single compressed stream. Decompression will stop once either the end of the file/buffer is reached, an error is encountered (premature eof, corrupt compressed data) or the end of a stream is not immediately followed by the start of another stream. This parameter defaults to 0. =item C<< Prime => $string >> This option will uncompress the contents of C<$string> before processing the input file/buffer. This option can be useful when the compressed data is embedded in another file/data structure and it is not possible to work out where the compressed data begins without having to read the first few bytes. If this is the case, the uncompression can be I with these bytes using this option. =item C<< Transparent => 0|1 >> If this option is set and the input file/buffer is not compressed data, the module will allow reading of it anyway. In addition, if the input file/buffer does contain compressed data and there is non-compressed data immediately following it, setting this option will make this module treat the whole file/buffer as a single data stream. This option defaults to 1. =item C<< BlockSize => $num >> When reading the compressed input data, IO::Uncompress::AnyUncompress will read it in blocks of C<$num> bytes. This option defaults to 4096. =item C<< InputLength => $size >> When present this option will limit the number of compressed bytes read from the input file/buffer to C<$size>. This option can be used in the situation where there is useful data directly after the compressed data stream and you know beforehand the exact length of the compressed data stream. This option is mostly used when reading from a filehandle, in which case the file pointer will be left pointing to the first byte directly after the compressed data stream. This option defaults to off. =item C<< Append => 0|1 >> This option controls what the C method does with uncompressed data. If set to 1, all uncompressed data will be appended to the output parameter of the C method. If set to 0, the contents of the output parameter of the C method will be overwritten by the uncompressed data. Defaults to 0. =item C<< Strict => 0|1 >> This option controls whether the extra checks defined below are used when carrying out the decompression. When Strict is on, the extra tests are carried out, when Strict is off they are not. The default for this option is off. =item C<< RawInflate => 0|1 >> When auto-detecting the compressed format, try to test for raw-deflate (RFC 1951) content using the C module. The reason this is not default behaviour is because RFC 1951 content can only be detected by attempting to uncompress it. This process is error prone and can result is false positives. Defaults to 0. =item C<< UnLzma => 0|1 >> When auto-detecting the compressed format, try to test for lzma_alone content using the C module. The reason this is not default behaviour is because lzma_alone content can only be detected by attempting to uncompress it. This process is error prone and can result is false positives. Defaults to 0. =back =head2 Examples TODO =head1 Methods =head2 read Usage is $status = $z->read($buffer) Reads a block of compressed data (the size of the compressed block is determined by the C option in the constructor), uncompresses it and writes any uncompressed data into C<$buffer>. If the C parameter is set in the constructor, the uncompressed data will be appended to the C<$buffer> parameter. Otherwise C<$buffer> will be overwritten. Returns the number of uncompressed bytes written to C<$buffer>, zero if eof or a negative number on error. =head2 read Usage is $status = $z->read($buffer, $length) $status = $z->read($buffer, $length, $offset) $status = read($z, $buffer, $length) $status = read($z, $buffer, $length, $offset) Attempt to read C<$length> bytes of uncompressed data into C<$buffer>. The main difference between this form of the C method and the previous one, is that this one will attempt to return I C<$length> bytes. The only circumstances that this function will not is if end-of-file or an IO error is encountered. Returns the number of uncompressed bytes written to C<$buffer>, zero if eof or a negative number on error. =head2 getline Usage is $line = $z->getline() $line = <$z> Reads a single line. This method fully supports the use of the variable C<$/> (or C<$INPUT_RECORD_SEPARATOR> or C<$RS> when C is in use) to determine what constitutes an end of line. Paragraph mode, record mode and file slurp mode are all supported. =head2 getc Usage is $char = $z->getc() Read a single character. =head2 ungetc Usage is $char = $z->ungetc($string) =head2 getHeaderInfo Usage is $hdr = $z->getHeaderInfo(); @hdrs = $z->getHeaderInfo(); This method returns either a hash reference (in scalar context) or a list or hash references (in array context) that contains information about each of the header fields in the compressed data stream(s). =head2 tell Usage is $z->tell() tell $z Returns the uncompressed file offset. =head2 eof Usage is $z->eof(); eof($z); Returns true if the end of the compressed input stream has been reached. =head2 seek $z->seek($position, $whence); seek($z, $position, $whence); Provides a sub-set of the C functionality, with the restriction that it is only legal to seek forward in the input file/buffer. It is a fatal error to attempt to seek backward. Note that the implementation of C in this module does not provide true random access to a compressed file/buffer. It works by uncompressing data from the current offset in the file/buffer until it reaches the uncompressed offset specified in the parameters to C. For very small files this may be acceptable behaviour. For large files it may cause an unacceptable delay. The C<$whence> parameter takes one the usual values, namely SEEK_SET, SEEK_CUR or SEEK_END. Returns 1 on success, 0 on failure. =head2 binmode Usage is $z->binmode binmode $z ; This is a noop provided for completeness. =head2 opened $z->opened() Returns true if the object currently refers to a opened file/buffer. =head2 autoflush my $prev = $z->autoflush() my $prev = $z->autoflush(EXPR) If the C<$z> object is associated with a file or a filehandle, this method returns the current autoflush setting for the underlying filehandle. If C is present, and is non-zero, it will enable flushing after every write/print operation. If C<$z> is associated with a buffer, this method has no effect and always returns C. B that the special variable C<$|> B be used to set or retrieve the autoflush setting. =head2 input_line_number $z->input_line_number() $z->input_line_number(EXPR) Returns the current uncompressed line number. If C is present it has the effect of setting the line number. Note that setting the line number does not change the current position within the file/buffer being read. The contents of C<$/> are used to determine what constitutes a line terminator. =head2 fileno $z->fileno() fileno($z) If the C<$z> object is associated with a file or a filehandle, C will return the underlying file descriptor. Once the C method is called C will return C. If the C<$z> object is associated with a buffer, this method will return C. =head2 close $z->close() ; close $z ; Closes the output file/buffer. For most versions of Perl this method will be automatically invoked if the IO::Uncompress::AnyUncompress object is destroyed (either explicitly or by the variable with the reference to the object going out of scope). The exceptions are Perl versions 5.005 through 5.00504 and 5.8.0. In these cases, the C method will be called automatically, but not until global destruction of all live objects when the program is terminating. Therefore, if you want your scripts to be able to run on all versions of Perl, you should call C explicitly and not rely on automatic closing. Returns true on success, otherwise 0. If the C option has been enabled when the IO::Uncompress::AnyUncompress object was created, and the object is associated with a file, the underlying file will also be closed. =head2 nextStream Usage is my $status = $z->nextStream(); Skips to the next compressed data stream in the input file/buffer. If a new compressed data stream is found, the eof marker will be cleared and C<$.> will be reset to 0. Returns 1 if a new stream was found, 0 if none was found, and -1 if an error was encountered. =head2 trailingData Usage is my $data = $z->trailingData(); Returns the data, if any, that is present immediately after the compressed data stream once uncompression is complete. It only makes sense to call this method once the end of the compressed data stream has been encountered. This option can be used when there is useful information immediately following the compressed data stream, and you don't know the length of the compressed data stream. If the input is a buffer, C will return everything from the end of the compressed data stream to the end of the buffer. If the input is a filehandle, C will return the data that is left in the filehandle input buffer once the end of the compressed data stream has been reached. You can then use the filehandle to read the rest of the input file. Don't bother using C if the input is a filename. If you know the length of the compressed data stream before you start uncompressing, you can avoid having to use C by setting the C option in the constructor. =head1 Importing No symbolic constants are required by this IO::Uncompress::AnyUncompress at present. =over 5 =item :all Imports C and C<$AnyUncompressError>. Same as doing this use IO::Uncompress::AnyUncompress qw(anyuncompress $AnyUncompressError) ; =back =head1 EXAMPLES =head1 SEE ALSO L, L, L, L, L, L, L, L, L, L, L, L, L, L, L, L, L, L L L, L, L, L =head1 AUTHOR This module was written by Paul Marquess, C. =head1 MODIFICATION HISTORY See the Changes file. =head1 COPYRIGHT AND LICENSE Copyright (c) 2005-2017 Paul Marquess. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. darwin-perl-lib/IO/Uncompress/Base.pm000444 000765 000024 00000112313 13167163507 021640 0ustar00ocsinventorystaff000000 000000 package IO::Uncompress::Base ; use strict ; use warnings; use bytes; our (@ISA, $VERSION, @EXPORT_OK, %EXPORT_TAGS); @ISA = qw(IO::File Exporter); $VERSION = '2.074'; use constant G_EOF => 0 ; use constant G_ERR => -1 ; use IO::Compress::Base::Common 2.074 ; use IO::File ; use Symbol; use Scalar::Util (); use List::Util (); use Carp ; %EXPORT_TAGS = ( ); push @{ $EXPORT_TAGS{all} }, @EXPORT_OK ; sub smartRead { my $self = $_[0]; my $out = $_[1]; my $size = $_[2]; $$out = "" ; my $offset = 0 ; my $status = 1; if (defined *$self->{InputLength}) { return 0 if *$self->{InputLengthRemaining} <= 0 ; $size = List::Util::min($size, *$self->{InputLengthRemaining}); } if ( length *$self->{Prime} ) { $$out = substr(*$self->{Prime}, 0, $size) ; substr(*$self->{Prime}, 0, $size) = '' ; if (length $$out == $size) { *$self->{InputLengthRemaining} -= length $$out if defined *$self->{InputLength}; return length $$out ; } $offset = length $$out ; } my $get_size = $size - $offset ; if (defined *$self->{FH}) { if ($offset) { # Not using this # # *$self->{FH}->read($$out, $get_size, $offset); # # because the filehandle may not support the offset parameter # An example is Net::FTP my $tmp = ''; $status = *$self->{FH}->read($tmp, $get_size) ; substr($$out, $offset) = $tmp if defined $status && $status > 0 ; } else { $status = *$self->{FH}->read($$out, $get_size) } } elsif (defined *$self->{InputEvent}) { my $got = 1 ; while (length $$out < $size) { last if ($got = *$self->{InputEvent}->($$out, $get_size)) <= 0; } if (length $$out > $size ) { *$self->{Prime} = substr($$out, $size, length($$out)); substr($$out, $size, length($$out)) = ''; } *$self->{EventEof} = 1 if $got <= 0 ; } else { no warnings 'uninitialized'; my $buf = *$self->{Buffer} ; $$buf = '' unless defined $$buf ; substr($$out, $offset) = substr($$buf, *$self->{BufferOffset}, $get_size); if (*$self->{ConsumeInput}) { substr($$buf, 0, $get_size) = '' } else { *$self->{BufferOffset} += length($$out) - $offset } } *$self->{InputLengthRemaining} -= length($$out) #- $offset if defined *$self->{InputLength}; if (! defined $status) { $self->saveStatus($!) ; return STATUS_ERROR; } $self->saveStatus(length $$out < 0 ? STATUS_ERROR : STATUS_OK) ; return length $$out; } sub pushBack { my $self = shift ; return if ! defined $_[0] || length $_[0] == 0 ; if (defined *$self->{FH} || defined *$self->{InputEvent} ) { *$self->{Prime} = $_[0] . *$self->{Prime} ; *$self->{InputLengthRemaining} += length($_[0]); } else { my $len = length $_[0]; if($len > *$self->{BufferOffset}) { *$self->{Prime} = substr($_[0], 0, $len - *$self->{BufferOffset}) . *$self->{Prime} ; *$self->{InputLengthRemaining} = *$self->{InputLength}; *$self->{BufferOffset} = 0 } else { *$self->{InputLengthRemaining} += length($_[0]); *$self->{BufferOffset} -= length($_[0]) ; } } } sub smartSeek { my $self = shift ; my $offset = shift ; my $truncate = shift; my $position = shift || SEEK_SET; # TODO -- need to take prime into account if (defined *$self->{FH}) { *$self->{FH}->seek($offset, $position) } else { if ($position == SEEK_END) { *$self->{BufferOffset} = length ${ *$self->{Buffer} } + $offset ; } elsif ($position == SEEK_CUR) { *$self->{BufferOffset} += $offset ; } else { *$self->{BufferOffset} = $offset ; } substr(${ *$self->{Buffer} }, *$self->{BufferOffset}) = '' if $truncate; return 1; } } sub smartTell { my $self = shift ; if (defined *$self->{FH}) { return *$self->{FH}->tell() } else { return *$self->{BufferOffset} } } sub smartWrite { my $self = shift ; my $out_data = shift ; if (defined *$self->{FH}) { # flush needed for 5.8.0 defined *$self->{FH}->write($out_data, length $out_data) && defined *$self->{FH}->flush() ; } else { my $buf = *$self->{Buffer} ; substr($$buf, *$self->{BufferOffset}, length $out_data) = $out_data ; *$self->{BufferOffset} += length($out_data) ; return 1; } } sub smartReadExact { return $_[0]->smartRead($_[1], $_[2]) == $_[2]; } sub smartEof { my ($self) = $_[0]; local $.; return 0 if length *$self->{Prime} || *$self->{PushMode}; if (defined *$self->{FH}) { # Could use # # *$self->{FH}->eof() # # here, but this can cause trouble if # the filehandle is itself a tied handle, but it uses sysread. # Then we get into mixing buffered & non-buffered IO, # which will cause trouble my $info = $self->getErrInfo(); my $buffer = ''; my $status = $self->smartRead(\$buffer, 1); $self->pushBack($buffer) if length $buffer; $self->setErrInfo($info); return $status == 0 ; } elsif (defined *$self->{InputEvent}) { *$self->{EventEof} } else { *$self->{BufferOffset} >= length(${ *$self->{Buffer} }) } } sub clearError { my $self = shift ; *$self->{ErrorNo} = 0 ; ${ *$self->{Error} } = '' ; } sub getErrInfo { my $self = shift ; return [ *$self->{ErrorNo}, ${ *$self->{Error} } ] ; } sub setErrInfo { my $self = shift ; my $ref = shift; *$self->{ErrorNo} = $ref->[0] ; ${ *$self->{Error} } = $ref->[1] ; } sub saveStatus { my $self = shift ; my $errno = shift() + 0 ; *$self->{ErrorNo} = $errno; ${ *$self->{Error} } = '' ; return *$self->{ErrorNo} ; } sub saveErrorString { my $self = shift ; my $retval = shift ; ${ *$self->{Error} } = shift ; *$self->{ErrorNo} = @_ ? shift() + 0 : STATUS_ERROR ; return $retval; } sub croakError { my $self = shift ; $self->saveErrorString(0, $_[0]); croak $_[0]; } sub closeError { my $self = shift ; my $retval = shift ; my $errno = *$self->{ErrorNo}; my $error = ${ *$self->{Error} }; $self->close(); *$self->{ErrorNo} = $errno ; ${ *$self->{Error} } = $error ; return $retval; } sub error { my $self = shift ; return ${ *$self->{Error} } ; } sub errorNo { my $self = shift ; return *$self->{ErrorNo}; } sub HeaderError { my ($self) = shift; return $self->saveErrorString(undef, "Header Error: $_[0]", STATUS_ERROR); } sub TrailerError { my ($self) = shift; return $self->saveErrorString(G_ERR, "Trailer Error: $_[0]", STATUS_ERROR); } sub TruncatedHeader { my ($self) = shift; return $self->HeaderError("Truncated in $_[0] Section"); } sub TruncatedTrailer { my ($self) = shift; return $self->TrailerError("Truncated in $_[0] Section"); } sub postCheckParams { return 1; } sub checkParams { my $self = shift ; my $class = shift ; my $got = shift || IO::Compress::Base::Parameters::new(); my $Valid = { 'blocksize' => [IO::Compress::Base::Common::Parse_unsigned, 16 * 1024], 'autoclose' => [IO::Compress::Base::Common::Parse_boolean, 0], 'strict' => [IO::Compress::Base::Common::Parse_boolean, 0], 'append' => [IO::Compress::Base::Common::Parse_boolean, 0], 'prime' => [IO::Compress::Base::Common::Parse_any, undef], 'multistream' => [IO::Compress::Base::Common::Parse_boolean, 0], 'transparent' => [IO::Compress::Base::Common::Parse_any, 1], 'scan' => [IO::Compress::Base::Common::Parse_boolean, 0], 'inputlength' => [IO::Compress::Base::Common::Parse_unsigned, undef], 'binmodeout' => [IO::Compress::Base::Common::Parse_boolean, 0], #'decode' => [IO::Compress::Base::Common::Parse_any, undef], #'consumeinput' => [IO::Compress::Base::Common::Parse_boolean, 0], $self->getExtraParams(), #'Todo - Revert to ordinary file on end Z_STREAM_END'=> 0, # ContinueAfterEof } ; $Valid->{trailingdata} = [IO::Compress::Base::Common::Parse_writable_scalar, undef] if *$self->{OneShot} ; $got->parse($Valid, @_ ) or $self->croakError("${class}: " . $got->getError()) ; $self->postCheckParams($got) or $self->croakError("${class}: " . $self->error()) ; return $got; } sub _create { my $obj = shift; my $got = shift; my $append_mode = shift ; my $class = ref $obj; $obj->croakError("$class: Missing Input parameter") if ! @_ && ! $got ; my $inValue = shift ; *$obj->{OneShot} = 0 ; if (! $got) { $got = $obj->checkParams($class, undef, @_) or return undef ; } my $inType = whatIsInput($inValue, 1); $obj->ckInputParam($class, $inValue, 1) or return undef ; *$obj->{InNew} = 1; $obj->ckParams($got) or $obj->croakError("${class}: " . *$obj->{Error}); if ($inType eq 'buffer' || $inType eq 'code') { *$obj->{Buffer} = $inValue ; *$obj->{InputEvent} = $inValue if $inType eq 'code' ; } else { if ($inType eq 'handle') { *$obj->{FH} = $inValue ; *$obj->{Handle} = 1 ; # Need to rewind for Scan *$obj->{FH}->seek(0, SEEK_SET) if $got->getValue('scan'); } else { no warnings ; my $mode = '<'; $mode = '+<' if $got->getValue('scan'); *$obj->{StdIO} = ($inValue eq '-'); *$obj->{FH} = new IO::File "$mode $inValue" or return $obj->saveErrorString(undef, "cannot open file '$inValue': $!", $!) ; } *$obj->{LineNo} = $. = 0; setBinModeInput(*$obj->{FH}) ; my $buff = "" ; *$obj->{Buffer} = \$buff ; } # if ($got->getValue('decode')) { # my $want_encoding = $got->getValue('decode'); # *$obj->{Encoding} = IO::Compress::Base::Common::getEncoding($obj, $class, $want_encoding); # } # else { # *$obj->{Encoding} = undef; # } *$obj->{InputLength} = $got->parsed('inputlength') ? $got->getValue('inputlength') : undef ; *$obj->{InputLengthRemaining} = $got->getValue('inputlength'); *$obj->{BufferOffset} = 0 ; *$obj->{AutoClose} = $got->getValue('autoclose'); *$obj->{Strict} = $got->getValue('strict'); *$obj->{BlockSize} = $got->getValue('blocksize'); *$obj->{Append} = $got->getValue('append'); *$obj->{AppendOutput} = $append_mode || $got->getValue('append'); *$obj->{ConsumeInput} = $got->getValue('consumeinput'); *$obj->{Transparent} = $got->getValue('transparent'); *$obj->{MultiStream} = $got->getValue('multistream'); # TODO - move these two into RawDeflate *$obj->{Scan} = $got->getValue('scan'); *$obj->{ParseExtra} = $got->getValue('parseextra') || $got->getValue('strict') ; *$obj->{Type} = ''; *$obj->{Prime} = $got->getValue('prime') || '' ; *$obj->{Pending} = ''; *$obj->{Plain} = 0; *$obj->{PlainBytesRead} = 0; *$obj->{InflatedBytesRead} = 0; *$obj->{UnCompSize} = new U64; *$obj->{CompSize} = new U64; *$obj->{TotalInflatedBytesRead} = 0; *$obj->{NewStream} = 0 ; *$obj->{EventEof} = 0 ; *$obj->{ClassName} = $class ; *$obj->{Params} = $got ; if (*$obj->{ConsumeInput}) { *$obj->{InNew} = 0; *$obj->{Closed} = 0; return $obj } my $status = $obj->mkUncomp($got); return undef unless defined $status; *$obj->{InNew} = 0; *$obj->{Closed} = 0; if ($status) { # Need to try uncompressing to catch the case # where the compressed file uncompresses to an # empty string - so eof is set immediately. my $out_buffer = ''; $status = $obj->read(\$out_buffer); if ($status < 0) { *$obj->{ReadStatus} = [ $status, $obj->error(), $obj->errorNo() ]; } $obj->ungetc($out_buffer) if length $out_buffer; } else { return undef unless *$obj->{Transparent}; $obj->clearError(); *$obj->{Type} = 'plain'; *$obj->{Plain} = 1; $obj->pushBack(*$obj->{HeaderPending}) ; } push @{ *$obj->{InfoList} }, *$obj->{Info} ; $obj->saveStatus(STATUS_OK) ; *$obj->{InNew} = 0; *$obj->{Closed} = 0; return $obj; } sub ckInputParam { my $self = shift ; my $from = shift ; my $inType = whatIsInput($_[0], $_[1]); $self->croakError("$from: input parameter not a filename, filehandle, array ref or scalar ref") if ! $inType ; # if ($inType eq 'filename' ) # { # return $self->saveErrorString(1, "$from: input filename is undef or null string", STATUS_ERROR) # if ! defined $_[0] || $_[0] eq '' ; # # if ($_[0] ne '-' && ! -e $_[0] ) # { # return $self->saveErrorString(1, # "input file '$_[0]' does not exist", STATUS_ERROR); # } # } return 1; } sub _inf { my $obj = shift ; my $class = (caller)[0] ; my $name = (caller(1))[3] ; $obj->croakError("$name: expected at least 1 parameters\n") unless @_ >= 1 ; my $input = shift ; my $haveOut = @_ ; my $output = shift ; my $x = new IO::Compress::Base::Validator($class, *$obj->{Error}, $name, $input, $output) or return undef ; push @_, $output if $haveOut && $x->{Hash}; *$obj->{OneShot} = 1 ; my $got = $obj->checkParams($name, undef, @_) or return undef ; if ($got->parsed('trailingdata')) { # my $value = $got->valueRef('TrailingData'); # warn "TD $value "; # #$value = $$value; ## warn "TD $value $$value "; # # return retErr($obj, "Parameter 'TrailingData' not writable") # if readonly $$value ; # # if (ref $$value) # { # return retErr($obj,"Parameter 'TrailingData' not a scalar reference") # if ref $$value ne 'SCALAR' ; # # *$obj->{TrailingData} = $$value ; # } # else # { # return retErr($obj,"Parameter 'TrailingData' not a scalar") # if ref $value ne 'SCALAR' ; # # *$obj->{TrailingData} = $value ; # } *$obj->{TrailingData} = $got->getValue('trailingdata'); } *$obj->{MultiStream} = $got->getValue('multistream'); $got->setValue('multistream', 0); $x->{Got} = $got ; # if ($x->{Hash}) # { # while (my($k, $v) = each %$input) # { # $v = \$input->{$k} # unless defined $v ; # # $obj->_singleTarget($x, $k, $v, @_) # or return undef ; # } # # return keys %$input ; # } if ($x->{GlobMap}) { $x->{oneInput} = 1 ; foreach my $pair (@{ $x->{Pairs} }) { my ($from, $to) = @$pair ; $obj->_singleTarget($x, $from, $to, @_) or return undef ; } return scalar @{ $x->{Pairs} } ; } if (! $x->{oneOutput} ) { my $inFile = ($x->{inType} eq 'filenames' || $x->{inType} eq 'filename'); $x->{inType} = $inFile ? 'filename' : 'buffer'; foreach my $in ($x->{oneInput} ? $input : @$input) { my $out ; $x->{oneInput} = 1 ; $obj->_singleTarget($x, $in, $output, @_) or return undef ; } return 1 ; } # finally the 1 to 1 and n to 1 return $obj->_singleTarget($x, $input, $output, @_); croak "should not be here" ; } sub retErr { my $x = shift ; my $string = shift ; ${ $x->{Error} } = $string ; return undef ; } sub _singleTarget { my $self = shift ; my $x = shift ; my $input = shift; my $output = shift; my $buff = ''; $x->{buff} = \$buff ; my $fh ; if ($x->{outType} eq 'filename') { my $mode = '>' ; $mode = '>>' if $x->{Got}->getValue('append') ; $x->{fh} = new IO::File "$mode $output" or return retErr($x, "cannot open file '$output': $!") ; binmode $x->{fh} if $x->{Got}->valueOrDefault('binmodeout'); } elsif ($x->{outType} eq 'handle') { $x->{fh} = $output; binmode $x->{fh} if $x->{Got}->valueOrDefault('binmodeout'); if ($x->{Got}->getValue('append')) { seek($x->{fh}, 0, SEEK_END) or return retErr($x, "Cannot seek to end of output filehandle: $!") ; } } elsif ($x->{outType} eq 'buffer' ) { $$output = '' unless $x->{Got}->getValue('append'); $x->{buff} = $output ; } if ($x->{oneInput}) { defined $self->_rd2($x, $input, $output) or return undef; } else { for my $element ( ($x->{inType} eq 'hash') ? keys %$input : @$input) { defined $self->_rd2($x, $element, $output) or return undef ; } } if ( ($x->{outType} eq 'filename' && $output ne '-') || ($x->{outType} eq 'handle' && $x->{Got}->getValue('autoclose'))) { $x->{fh}->close() or return retErr($x, $!); delete $x->{fh}; } return 1 ; } sub _rd2 { my $self = shift ; my $x = shift ; my $input = shift; my $output = shift; my $z = IO::Compress::Base::Common::createSelfTiedObject($x->{Class}, *$self->{Error}); $z->_create($x->{Got}, 1, $input, @_) or return undef ; my $status ; my $fh = $x->{fh}; while (1) { while (($status = $z->read($x->{buff})) > 0) { if ($fh) { local $\; print $fh ${ $x->{buff} } or return $z->saveErrorString(undef, "Error writing to output file: $!", $!); ${ $x->{buff} } = '' ; } } if (! $x->{oneOutput} ) { my $ot = $x->{outType} ; if ($ot eq 'array') { push @$output, $x->{buff} } elsif ($ot eq 'hash') { $output->{$input} = $x->{buff} } my $buff = ''; $x->{buff} = \$buff; } last if $status < 0 || $z->smartEof(); last unless *$self->{MultiStream}; $status = $z->nextStream(); last unless $status == 1 ; } return $z->closeError(undef) if $status < 0 ; ${ *$self->{TrailingData} } = $z->trailingData() if defined *$self->{TrailingData} ; $z->close() or return undef ; return 1 ; } sub TIEHANDLE { return $_[0] if ref($_[0]); die "OOPS\n" ; } sub UNTIE { my $self = shift ; } sub getHeaderInfo { my $self = shift ; wantarray ? @{ *$self->{InfoList} } : *$self->{Info}; } sub readBlock { my $self = shift ; my $buff = shift ; my $size = shift ; if (defined *$self->{CompressedInputLength}) { if (*$self->{CompressedInputLengthRemaining} == 0) { delete *$self->{CompressedInputLength}; *$self->{CompressedInputLengthDone} = 1; return STATUS_OK ; } $size = List::Util::min($size, *$self->{CompressedInputLengthRemaining} ); *$self->{CompressedInputLengthRemaining} -= $size ; } my $status = $self->smartRead($buff, $size) ; return $self->saveErrorString(STATUS_ERROR, "Error Reading Data: $!", $!) if $status == STATUS_ERROR ; if ($status == 0 ) { *$self->{Closed} = 1 ; *$self->{EndStream} = 1 ; return $self->saveErrorString(STATUS_ERROR, "unexpected end of file", STATUS_ERROR); } return STATUS_OK; } sub postBlockChk { return STATUS_OK; } sub _raw_read { # return codes # >0 - ok, number of bytes read # =0 - ok, eof # <0 - not ok my $self = shift ; return G_EOF if *$self->{Closed} ; return G_EOF if *$self->{EndStream} ; my $buffer = shift ; my $scan_mode = shift ; if (*$self->{Plain}) { my $tmp_buff ; my $len = $self->smartRead(\$tmp_buff, *$self->{BlockSize}) ; return $self->saveErrorString(G_ERR, "Error reading data: $!", $!) if $len == STATUS_ERROR ; if ($len == 0 ) { *$self->{EndStream} = 1 ; } else { *$self->{PlainBytesRead} += $len ; $$buffer .= $tmp_buff; } return $len ; } if (*$self->{NewStream}) { $self->gotoNextStream() > 0 or return G_ERR; # For the headers that actually uncompressed data, put the # uncompressed data into the output buffer. $$buffer .= *$self->{Pending} ; my $len = length *$self->{Pending} ; *$self->{Pending} = ''; return $len; } my $temp_buf = ''; my $outSize = 0; my $status = $self->readBlock(\$temp_buf, *$self->{BlockSize}, $outSize) ; return G_ERR if $status == STATUS_ERROR ; my $buf_len = 0; if ($status == STATUS_OK) { my $beforeC_len = length $temp_buf; my $before_len = defined $$buffer ? length $$buffer : 0 ; $status = *$self->{Uncomp}->uncompr(\$temp_buf, $buffer, defined *$self->{CompressedInputLengthDone} || $self->smartEof(), $outSize); # Remember the input buffer if it wasn't consumed completely $self->pushBack($temp_buf) if *$self->{Uncomp}{ConsumesInput}; return $self->saveErrorString(G_ERR, *$self->{Uncomp}{Error}, *$self->{Uncomp}{ErrorNo}) if $self->saveStatus($status) == STATUS_ERROR; $self->postBlockChk($buffer, $before_len) == STATUS_OK or return G_ERR; $buf_len = defined $$buffer ? length($$buffer) - $before_len : 0; *$self->{CompSize}->add($beforeC_len - length $temp_buf) ; *$self->{InflatedBytesRead} += $buf_len ; *$self->{TotalInflatedBytesRead} += $buf_len ; *$self->{UnCompSize}->add($buf_len) ; $self->filterUncompressed($buffer, $before_len); # if (*$self->{Encoding}) { # use Encode ; # *$self->{PendingDecode} .= substr($$buffer, $before_len) ; # my $got = *$self->{Encoding}->decode(*$self->{PendingDecode}, Encode::FB_QUIET) ; # substr($$buffer, $before_len) = $got; # } } if ($status == STATUS_ENDSTREAM) { *$self->{EndStream} = 1 ; my $trailer; my $trailer_size = *$self->{Info}{TrailerLength} ; my $got = 0; if (*$self->{Info}{TrailerLength}) { $got = $self->smartRead(\$trailer, $trailer_size) ; } if ($got == $trailer_size) { $self->chkTrailer($trailer) == STATUS_OK or return G_ERR; } else { return $self->TrailerError("trailer truncated. Expected " . "$trailer_size bytes, got $got") if *$self->{Strict}; $self->pushBack($trailer) ; } # TODO - if want file pointer, do it here if (! $self->smartEof()) { *$self->{NewStream} = 1 ; if (*$self->{MultiStream}) { *$self->{EndStream} = 0 ; return $buf_len ; } } } # return the number of uncompressed bytes read return $buf_len ; } sub reset { my $self = shift ; return *$self->{Uncomp}->reset(); } sub filterUncompressed { } #sub isEndStream #{ # my $self = shift ; # return *$self->{NewStream} || # *$self->{EndStream} ; #} sub nextStream { my $self = shift ; my $status = $self->gotoNextStream(); $status == 1 or return $status ; *$self->{TotalInflatedBytesRead} = 0 ; *$self->{LineNo} = $. = 0; return 1; } sub gotoNextStream { my $self = shift ; if (! *$self->{NewStream}) { my $status = 1; my $buffer ; # TODO - make this more efficient if know the offset for the end of # the stream and seekable $status = $self->read($buffer) while $status > 0 ; return $status if $status < 0; } *$self->{NewStream} = 0 ; *$self->{EndStream} = 0 ; *$self->{CompressedInputLengthDone} = undef ; *$self->{CompressedInputLength} = undef ; $self->reset(); *$self->{UnCompSize}->reset(); *$self->{CompSize}->reset(); my $magic = $self->ckMagic(); if ( ! defined $magic) { if (! *$self->{Transparent} || $self->eof()) { *$self->{EndStream} = 1 ; return 0; } $self->clearError(); *$self->{Type} = 'plain'; *$self->{Plain} = 1; $self->pushBack(*$self->{HeaderPending}) ; } else { *$self->{Info} = $self->readHeader($magic); if ( ! defined *$self->{Info} ) { *$self->{EndStream} = 1 ; return -1; } } push @{ *$self->{InfoList} }, *$self->{Info} ; return 1; } sub streamCount { my $self = shift ; return 1 if ! defined *$self->{InfoList}; return scalar @{ *$self->{InfoList} } ; } #sub read #{ # my $status = myRead(@_); # return undef if $status < 0; # return $status; #} sub read { # return codes # >0 - ok, number of bytes read # =0 - ok, eof # <0 - not ok my $self = shift ; if (defined *$self->{ReadStatus} ) { my $status = *$self->{ReadStatus}[0]; $self->saveErrorString( @{ *$self->{ReadStatus} } ); delete *$self->{ReadStatus} ; return $status ; } return G_EOF if *$self->{Closed} ; my $buffer ; if (ref $_[0] ) { $self->croakError(*$self->{ClassName} . "::read: buffer parameter is read-only") if Scalar::Util::readonly(${ $_[0] }); $self->croakError(*$self->{ClassName} . "::read: not a scalar reference $_[0]" ) unless ref $_[0] eq 'SCALAR' ; $buffer = $_[0] ; } else { $self->croakError(*$self->{ClassName} . "::read: buffer parameter is read-only") if Scalar::Util::readonly($_[0]); $buffer = \$_[0] ; } my $length = $_[1] ; my $offset = $_[2] || 0; if (! *$self->{AppendOutput}) { if (! $offset) { $$buffer = '' ; } else { if ($offset > length($$buffer)) { $$buffer .= "\x00" x ($offset - length($$buffer)); } else { substr($$buffer, $offset) = ''; } } } elsif (! defined $$buffer) { $$buffer = '' ; } return G_EOF if !length *$self->{Pending} && *$self->{EndStream} ; # the core read will return 0 if asked for 0 bytes return 0 if defined $length && $length == 0 ; $length = $length || 0; $self->croakError(*$self->{ClassName} . "::read: length parameter is negative") if $length < 0 ; # Short-circuit if this is a simple read, with no length # or offset specified. unless ( $length || $offset) { if (length *$self->{Pending}) { $$buffer .= *$self->{Pending} ; my $len = length *$self->{Pending}; *$self->{Pending} = '' ; return $len ; } else { my $len = 0; $len = $self->_raw_read($buffer) while ! *$self->{EndStream} && $len == 0 ; return $len ; } } # Need to jump through more hoops - either length or offset # or both are specified. my $out_buffer = *$self->{Pending} ; *$self->{Pending} = ''; while (! *$self->{EndStream} && length($out_buffer) < $length) { my $buf_len = $self->_raw_read(\$out_buffer); return $buf_len if $buf_len < 0 ; } $length = length $out_buffer if length($out_buffer) < $length ; return 0 if $length == 0 ; $$buffer = '' if ! defined $$buffer; $offset = length $$buffer if *$self->{AppendOutput} ; *$self->{Pending} = $out_buffer; $out_buffer = \*$self->{Pending} ; substr($$buffer, $offset) = substr($$out_buffer, 0, $length) ; substr($$out_buffer, 0, $length) = '' ; return $length ; } sub _getline { my $self = shift ; my $status = 0 ; # Slurp Mode if ( ! defined $/ ) { my $data ; 1 while ($status = $self->read($data)) > 0 ; return ($status, \$data); } # Record Mode if ( ref $/ eq 'SCALAR' && ${$/} =~ /^\d+$/ && ${$/} > 0) { my $reclen = ${$/} ; my $data ; $status = $self->read($data, $reclen) ; return ($status, \$data); } # Paragraph Mode if ( ! length $/ ) { my $paragraph ; while (($status = $self->read($paragraph)) > 0 ) { if ($paragraph =~ s/^(.*?\n\n+)//s) { *$self->{Pending} = $paragraph ; my $par = $1 ; return (1, \$par); } } return ($status, \$paragraph); } # $/ isn't empty, or a reference, so it's Line Mode. { my $line ; my $p = \*$self->{Pending} ; while (($status = $self->read($line)) > 0 ) { my $offset = index($line, $/); if ($offset >= 0) { my $l = substr($line, 0, $offset + length $/ ); substr($line, 0, $offset + length $/) = ''; $$p = $line; return (1, \$l); } } return ($status, \$line); } } sub getline { my $self = shift; if (defined *$self->{ReadStatus} ) { $self->saveErrorString( @{ *$self->{ReadStatus} } ); delete *$self->{ReadStatus} ; return undef; } return undef if *$self->{Closed} || (!length *$self->{Pending} && *$self->{EndStream}) ; my $current_append = *$self->{AppendOutput} ; *$self->{AppendOutput} = 1; my ($status, $lineref) = $self->_getline(); *$self->{AppendOutput} = $current_append; return undef if $status < 0 || length $$lineref == 0 ; $. = ++ *$self->{LineNo} ; return $$lineref ; } sub getlines { my $self = shift; $self->croakError(*$self->{ClassName} . "::getlines: called in scalar context\n") unless wantarray; my($line, @lines); push(@lines, $line) while defined($line = $self->getline); return @lines; } sub READLINE { goto &getlines if wantarray; goto &getline; } sub getc { my $self = shift; my $buf; return $buf if $self->read($buf, 1); return undef; } sub ungetc { my $self = shift; *$self->{Pending} = "" unless defined *$self->{Pending} ; *$self->{Pending} = $_[0] . *$self->{Pending} ; } sub trailingData { my $self = shift ; if (defined *$self->{FH} || defined *$self->{InputEvent} ) { return *$self->{Prime} ; } else { my $buf = *$self->{Buffer} ; my $offset = *$self->{BufferOffset} ; return substr($$buf, $offset) ; } } sub eof { my $self = shift ; return (*$self->{Closed} || (!length *$self->{Pending} && ( $self->smartEof() || *$self->{EndStream}))) ; } sub tell { my $self = shift ; my $in ; if (*$self->{Plain}) { $in = *$self->{PlainBytesRead} ; } else { $in = *$self->{TotalInflatedBytesRead} ; } my $pending = length *$self->{Pending} ; return 0 if $pending > $in ; return $in - $pending ; } sub close { # todo - what to do if close is called before the end of the gzip file # do we remember any trailing data? my $self = shift ; return 1 if *$self->{Closed} ; untie *$self if $] >= 5.008 ; my $status = 1 ; if (defined *$self->{FH}) { if ((! *$self->{Handle} || *$self->{AutoClose}) && ! *$self->{StdIO}) { local $.; $! = 0 ; $status = *$self->{FH}->close(); return $self->saveErrorString(0, $!, $!) if !*$self->{InNew} && $self->saveStatus($!) != 0 ; } delete *$self->{FH} ; $! = 0 ; } *$self->{Closed} = 1 ; return 1; } sub DESTROY { my $self = shift ; local ($., $@, $!, $^E, $?); $self->close() ; } sub seek { my $self = shift ; my $position = shift; my $whence = shift ; my $here = $self->tell() ; my $target = 0 ; if ($whence == SEEK_SET) { $target = $position ; } elsif ($whence == SEEK_CUR) { $target = $here + $position ; } elsif ($whence == SEEK_END) { $target = $position ; $self->croakError(*$self->{ClassName} . "::seek: SEEK_END not allowed") ; } else { $self->croakError(*$self->{ClassName} ."::seek: unknown value, $whence, for whence parameter"); } # short circuit if seeking to current offset if ($target == $here) { # On ordinary filehandles, seeking to the current # position also clears the EOF condition, so we # emulate this behavior locally while simultaneously # cascading it to the underlying filehandle if (*$self->{Plain}) { *$self->{EndStream} = 0; seek(*$self->{FH},0,1) if *$self->{FH}; } return 1; } # Outlaw any attempt to seek backwards $self->croakError( *$self->{ClassName} ."::seek: cannot seek backwards") if $target < $here ; # Walk the file to the new offset my $offset = $target - $here ; my $got; while (($got = $self->read(my $buffer, List::Util::min($offset, *$self->{BlockSize})) ) > 0) { $offset -= $got; last if $offset == 0 ; } $here = $self->tell() ; return $offset == 0 ? 1 : 0 ; } sub fileno { my $self = shift ; return defined *$self->{FH} ? fileno *$self->{FH} : undef ; } sub binmode { 1; # my $self = shift ; # return defined *$self->{FH} # ? binmode *$self->{FH} # : 1 ; } sub opened { my $self = shift ; return ! *$self->{Closed} ; } sub autoflush { my $self = shift ; return defined *$self->{FH} ? *$self->{FH}->autoflush(@_) : undef ; } sub input_line_number { my $self = shift ; my $last = *$self->{LineNo}; $. = *$self->{LineNo} = $_[1] if @_ ; return $last; } *BINMODE = \&binmode; *SEEK = \&seek; *READ = \&read; *sysread = \&read; *TELL = \&tell; *EOF = \&eof; *FILENO = \&fileno; *CLOSE = \&close; sub _notAvailable { my $name = shift ; return sub { croak "$name Not Available: File opened only for intput" ; } ; } *print = _notAvailable('print'); *PRINT = _notAvailable('print'); *printf = _notAvailable('printf'); *PRINTF = _notAvailable('printf'); *write = _notAvailable('write'); *WRITE = _notAvailable('write'); #*sysread = \&read; #*syswrite = \&_notAvailable; package IO::Uncompress::Base ; 1 ; __END__ =head1 NAME IO::Uncompress::Base - Base Class for IO::Uncompress modules =head1 SYNOPSIS use IO::Uncompress::Base ; =head1 DESCRIPTION This module is not intended for direct use in application code. Its sole purpose is to be sub-classed by IO::Uncompress modules. =head1 SEE ALSO L, L, L, L, L, L, L, L, L, L, L, L, L, L, L, L, L, L, L L L, L, L, L =head1 AUTHOR This module was written by Paul Marquess, C. =head1 MODIFICATION HISTORY See the Changes file. =head1 COPYRIGHT AND LICENSE Copyright (c) 2005-2017 Paul Marquess. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. darwin-perl-lib/IO/Uncompress/Bunzip2.pm000444 000765 000024 00000061211 13167163507 022317 0ustar00ocsinventorystaff000000 000000 package IO::Uncompress::Bunzip2 ; use strict ; use warnings; use bytes; use IO::Compress::Base::Common 2.074 qw(:Status ); use IO::Uncompress::Base 2.074 ; use IO::Uncompress::Adapter::Bunzip2 2.074 ; require Exporter ; our ($VERSION, @ISA, @EXPORT_OK, %EXPORT_TAGS, $Bunzip2Error); $VERSION = '2.074'; $Bunzip2Error = ''; @ISA = qw(IO::Uncompress::Base Exporter); @EXPORT_OK = qw( $Bunzip2Error bunzip2 ) ; #%EXPORT_TAGS = %IO::Uncompress::Base::EXPORT_TAGS ; push @{ $EXPORT_TAGS{all} }, @EXPORT_OK ; #Exporter::export_ok_tags('all'); sub new { my $class = shift ; my $obj = IO::Compress::Base::Common::createSelfTiedObject($class, \$Bunzip2Error); $obj->_create(undef, 0, @_); } sub bunzip2 { my $obj = IO::Compress::Base::Common::createSelfTiedObject(undef, \$Bunzip2Error); return $obj->_inf(@_); } sub getExtraParams { return ( 'verbosity' => [IO::Compress::Base::Common::Parse_boolean, 0], 'small' => [IO::Compress::Base::Common::Parse_boolean, 0], ); } sub ckParams { my $self = shift ; my $got = shift ; return 1; } sub mkUncomp { my $self = shift ; my $got = shift ; my $magic = $self->ckMagic() or return 0; *$self->{Info} = $self->readHeader($magic) or return undef ; my $Small = $got->getValue('small'); my $Verbosity = $got->getValue('verbosity'); my ($obj, $errstr, $errno) = IO::Uncompress::Adapter::Bunzip2::mkUncompObject( $Small, $Verbosity); return $self->saveErrorString(undef, $errstr, $errno) if ! defined $obj; *$self->{Uncomp} = $obj; return 1; } sub ckMagic { my $self = shift; my $magic ; $self->smartReadExact(\$magic, 4); *$self->{HeaderPending} = $magic ; return $self->HeaderError("Header size is " . 4 . " bytes") if length $magic != 4; return $self->HeaderError("Bad Magic.") if ! isBzip2Magic($magic) ; *$self->{Type} = 'bzip2'; return $magic; } sub readHeader { my $self = shift; my $magic = shift ; $self->pushBack($magic); *$self->{HeaderPending} = ''; return { 'Type' => 'bzip2', 'FingerprintLength' => 4, 'HeaderLength' => 4, 'TrailerLength' => 0, 'Header' => '$magic' }; } sub chkTrailer { return STATUS_OK; } sub isBzip2Magic { my $buffer = shift ; return $buffer =~ /^BZh\d$/; } 1 ; __END__ =head1 NAME IO::Uncompress::Bunzip2 - Read bzip2 files/buffers =head1 SYNOPSIS use IO::Uncompress::Bunzip2 qw(bunzip2 $Bunzip2Error) ; my $status = bunzip2 $input => $output [,OPTS] or die "bunzip2 failed: $Bunzip2Error\n"; my $z = new IO::Uncompress::Bunzip2 $input [OPTS] or die "bunzip2 failed: $Bunzip2Error\n"; $status = $z->read($buffer) $status = $z->read($buffer, $length) $status = $z->read($buffer, $length, $offset) $line = $z->getline() $char = $z->getc() $char = $z->ungetc() $char = $z->opened() $data = $z->trailingData() $status = $z->nextStream() $data = $z->getHeaderInfo() $z->tell() $z->seek($position, $whence) $z->binmode() $z->fileno() $z->eof() $z->close() $Bunzip2Error ; # IO::File mode <$z> read($z, $buffer); read($z, $buffer, $length); read($z, $buffer, $length, $offset); tell($z) seek($z, $position, $whence) binmode($z) fileno($z) eof($z) close($z) =head1 DESCRIPTION This module provides a Perl interface that allows the reading of bzip2 files/buffers. For writing bzip2 files/buffers, see the companion module IO::Compress::Bzip2. =head1 Functional Interface A top-level function, C, is provided to carry out "one-shot" uncompression between buffers and/or files. For finer control over the uncompression process, see the L section. use IO::Uncompress::Bunzip2 qw(bunzip2 $Bunzip2Error) ; bunzip2 $input_filename_or_reference => $output_filename_or_reference [,OPTS] or die "bunzip2 failed: $Bunzip2Error\n"; The functional interface needs Perl5.005 or better. =head2 bunzip2 $input_filename_or_reference => $output_filename_or_reference [, OPTS] C expects at least two parameters, C<$input_filename_or_reference> and C<$output_filename_or_reference>. =head3 The C<$input_filename_or_reference> parameter The parameter, C<$input_filename_or_reference>, is used to define the source of the compressed data. It can take one of the following forms: =over 5 =item A filename If the <$input_filename_or_reference> parameter is a simple scalar, it is assumed to be a filename. This file will be opened for reading and the input data will be read from it. =item A filehandle If the C<$input_filename_or_reference> parameter is a filehandle, the input data will be read from it. The string '-' can be used as an alias for standard input. =item A scalar reference If C<$input_filename_or_reference> is a scalar reference, the input data will be read from C<$$input_filename_or_reference>. =item An array reference If C<$input_filename_or_reference> is an array reference, each element in the array must be a filename. The input data will be read from each file in turn. The complete array will be walked to ensure that it only contains valid filenames before any data is uncompressed. =item An Input FileGlob string If C<$input_filename_or_reference> is a string that is delimited by the characters "<" and ">" C will assume that it is an I. The input is the list of files that match the fileglob. See L for more details. =back If the C<$input_filename_or_reference> parameter is any other type, C will be returned. =head3 The C<$output_filename_or_reference> parameter The parameter C<$output_filename_or_reference> is used to control the destination of the uncompressed data. This parameter can take one of these forms. =over 5 =item A filename If the C<$output_filename_or_reference> parameter is a simple scalar, it is assumed to be a filename. This file will be opened for writing and the uncompressed data will be written to it. =item A filehandle If the C<$output_filename_or_reference> parameter is a filehandle, the uncompressed data will be written to it. The string '-' can be used as an alias for standard output. =item A scalar reference If C<$output_filename_or_reference> is a scalar reference, the uncompressed data will be stored in C<$$output_filename_or_reference>. =item An Array Reference If C<$output_filename_or_reference> is an array reference, the uncompressed data will be pushed onto the array. =item An Output FileGlob If C<$output_filename_or_reference> is a string that is delimited by the characters "<" and ">" C will assume that it is an I. The output is the list of files that match the fileglob. When C<$output_filename_or_reference> is an fileglob string, C<$input_filename_or_reference> must also be a fileglob string. Anything else is an error. See L for more details. =back If the C<$output_filename_or_reference> parameter is any other type, C will be returned. =head2 Notes When C<$input_filename_or_reference> maps to multiple compressed files/buffers and C<$output_filename_or_reference> is a single file/buffer, after uncompression C<$output_filename_or_reference> will contain a concatenation of all the uncompressed data from each of the input files/buffers. =head2 Optional Parameters Unless specified below, the optional parameters for C, C, are the same as those used with the OO interface defined in the L section below. =over 5 =item C<< AutoClose => 0|1 >> This option applies to any input or output data streams to C that are filehandles. If C is specified, and the value is true, it will result in all input and/or output filehandles being closed once C has completed. This parameter defaults to 0. =item C<< BinModeOut => 0|1 >> When writing to a file or filehandle, set C before writing to the file. Defaults to 0. =item C<< Append => 0|1 >> The behaviour of this option is dependent on the type of output data stream. =over 5 =item * A Buffer If C is enabled, all uncompressed data will be append to the end of the output buffer. Otherwise the output buffer will be cleared before any uncompressed data is written to it. =item * A Filename If C is enabled, the file will be opened in append mode. Otherwise the contents of the file, if any, will be truncated before any uncompressed data is written to it. =item * A Filehandle If C is enabled, the filehandle will be positioned to the end of the file via a call to C before any uncompressed data is written to it. Otherwise the file pointer will not be moved. =back When C is specified, and set to true, it will I all uncompressed data to the output data stream. So when the output is a filehandle it will carry out a seek to the eof before writing any uncompressed data. If the output is a filename, it will be opened for appending. If the output is a buffer, all uncompressed data will be appended to the existing buffer. Conversely when C is not specified, or it is present and is set to false, it will operate as follows. When the output is a filename, it will truncate the contents of the file before writing any uncompressed data. If the output is a filehandle its position will not be changed. If the output is a buffer, it will be wiped before any uncompressed data is output. Defaults to 0. =item C<< MultiStream => 0|1 >> If the input file/buffer contains multiple compressed data streams, this option will uncompress the whole lot as a single data stream. Defaults to 0. =item C<< TrailingData => $scalar >> Returns the data, if any, that is present immediately after the compressed data stream once uncompression is complete. This option can be used when there is useful information immediately following the compressed data stream, and you don't know the length of the compressed data stream. If the input is a buffer, C will return everything from the end of the compressed data stream to the end of the buffer. If the input is a filehandle, C will return the data that is left in the filehandle input buffer once the end of the compressed data stream has been reached. You can then use the filehandle to read the rest of the input file. Don't bother using C if the input is a filename. If you know the length of the compressed data stream before you start uncompressing, you can avoid having to use C by setting the C option. =back =head2 Examples To read the contents of the file C and write the uncompressed data to the file C. use strict ; use warnings ; use IO::Uncompress::Bunzip2 qw(bunzip2 $Bunzip2Error) ; my $input = "file1.txt.bz2"; my $output = "file1.txt"; bunzip2 $input => $output or die "bunzip2 failed: $Bunzip2Error\n"; To read from an existing Perl filehandle, C<$input>, and write the uncompressed data to a buffer, C<$buffer>. use strict ; use warnings ; use IO::Uncompress::Bunzip2 qw(bunzip2 $Bunzip2Error) ; use IO::File ; my $input = new IO::File " \$buffer or die "bunzip2 failed: $Bunzip2Error\n"; To uncompress all files in the directory "/my/home" that match "*.txt.bz2" and store the compressed data in the same directory use strict ; use warnings ; use IO::Uncompress::Bunzip2 qw(bunzip2 $Bunzip2Error) ; bunzip2 '' => '' or die "bunzip2 failed: $Bunzip2Error\n"; and if you want to compress each file one at a time, this will do the trick use strict ; use warnings ; use IO::Uncompress::Bunzip2 qw(bunzip2 $Bunzip2Error) ; for my $input ( glob "/my/home/*.txt.bz2" ) { my $output = $input; $output =~ s/.bz2// ; bunzip2 $input => $output or die "Error compressing '$input': $Bunzip2Error\n"; } =head1 OO Interface =head2 Constructor The format of the constructor for IO::Uncompress::Bunzip2 is shown below my $z = new IO::Uncompress::Bunzip2 $input [OPTS] or die "IO::Uncompress::Bunzip2 failed: $Bunzip2Error\n"; Returns an C object on success and undef on failure. The variable C<$Bunzip2Error> will contain an error message on failure. If you are running Perl 5.005 or better the object, C<$z>, returned from IO::Uncompress::Bunzip2 can be used exactly like an L filehandle. This means that all normal input file operations can be carried out with C<$z>. For example, to read a line from a compressed file/buffer you can use either of these forms $line = $z->getline(); $line = <$z>; The mandatory parameter C<$input> is used to determine the source of the compressed data. This parameter can take one of three forms. =over 5 =item A filename If the C<$input> parameter is a scalar, it is assumed to be a filename. This file will be opened for reading and the compressed data will be read from it. =item A filehandle If the C<$input> parameter is a filehandle, the compressed data will be read from it. The string '-' can be used as an alias for standard input. =item A scalar reference If C<$input> is a scalar reference, the compressed data will be read from C<$$input>. =back =head2 Constructor Options The option names defined below are case insensitive and can be optionally prefixed by a '-'. So all of the following are valid -AutoClose -autoclose AUTOCLOSE autoclose OPTS is a combination of the following options: =over 5 =item C<< AutoClose => 0|1 >> This option is only valid when the C<$input> parameter is a filehandle. If specified, and the value is true, it will result in the file being closed once either the C method is called or the IO::Uncompress::Bunzip2 object is destroyed. This parameter defaults to 0. =item C<< MultiStream => 0|1 >> Allows multiple concatenated compressed streams to be treated as a single compressed stream. Decompression will stop once either the end of the file/buffer is reached, an error is encountered (premature eof, corrupt compressed data) or the end of a stream is not immediately followed by the start of another stream. This parameter defaults to 0. =item C<< Prime => $string >> This option will uncompress the contents of C<$string> before processing the input file/buffer. This option can be useful when the compressed data is embedded in another file/data structure and it is not possible to work out where the compressed data begins without having to read the first few bytes. If this is the case, the uncompression can be I with these bytes using this option. =item C<< Transparent => 0|1 >> If this option is set and the input file/buffer is not compressed data, the module will allow reading of it anyway. In addition, if the input file/buffer does contain compressed data and there is non-compressed data immediately following it, setting this option will make this module treat the whole file/buffer as a single data stream. This option defaults to 1. =item C<< BlockSize => $num >> When reading the compressed input data, IO::Uncompress::Bunzip2 will read it in blocks of C<$num> bytes. This option defaults to 4096. =item C<< InputLength => $size >> When present this option will limit the number of compressed bytes read from the input file/buffer to C<$size>. This option can be used in the situation where there is useful data directly after the compressed data stream and you know beforehand the exact length of the compressed data stream. This option is mostly used when reading from a filehandle, in which case the file pointer will be left pointing to the first byte directly after the compressed data stream. This option defaults to off. =item C<< Append => 0|1 >> This option controls what the C method does with uncompressed data. If set to 1, all uncompressed data will be appended to the output parameter of the C method. If set to 0, the contents of the output parameter of the C method will be overwritten by the uncompressed data. Defaults to 0. =item C<< Strict => 0|1 >> This option is a no-op. =item C<< Small => 0|1 >> When non-zero this options will make bzip2 use a decompression algorithm that uses less memory at the expense of increasing the amount of time taken for decompression. Default is 0. =back =head2 Examples TODO =head1 Methods =head2 read Usage is $status = $z->read($buffer) Reads a block of compressed data (the size of the compressed block is determined by the C option in the constructor), uncompresses it and writes any uncompressed data into C<$buffer>. If the C parameter is set in the constructor, the uncompressed data will be appended to the C<$buffer> parameter. Otherwise C<$buffer> will be overwritten. Returns the number of uncompressed bytes written to C<$buffer>, zero if eof or a negative number on error. =head2 read Usage is $status = $z->read($buffer, $length) $status = $z->read($buffer, $length, $offset) $status = read($z, $buffer, $length) $status = read($z, $buffer, $length, $offset) Attempt to read C<$length> bytes of uncompressed data into C<$buffer>. The main difference between this form of the C method and the previous one, is that this one will attempt to return I C<$length> bytes. The only circumstances that this function will not is if end-of-file or an IO error is encountered. Returns the number of uncompressed bytes written to C<$buffer>, zero if eof or a negative number on error. =head2 getline Usage is $line = $z->getline() $line = <$z> Reads a single line. This method fully supports the use of the variable C<$/> (or C<$INPUT_RECORD_SEPARATOR> or C<$RS> when C is in use) to determine what constitutes an end of line. Paragraph mode, record mode and file slurp mode are all supported. =head2 getc Usage is $char = $z->getc() Read a single character. =head2 ungetc Usage is $char = $z->ungetc($string) =head2 getHeaderInfo Usage is $hdr = $z->getHeaderInfo(); @hdrs = $z->getHeaderInfo(); This method returns either a hash reference (in scalar context) or a list or hash references (in array context) that contains information about each of the header fields in the compressed data stream(s). =head2 tell Usage is $z->tell() tell $z Returns the uncompressed file offset. =head2 eof Usage is $z->eof(); eof($z); Returns true if the end of the compressed input stream has been reached. =head2 seek $z->seek($position, $whence); seek($z, $position, $whence); Provides a sub-set of the C functionality, with the restriction that it is only legal to seek forward in the input file/buffer. It is a fatal error to attempt to seek backward. Note that the implementation of C in this module does not provide true random access to a compressed file/buffer. It works by uncompressing data from the current offset in the file/buffer until it reaches the uncompressed offset specified in the parameters to C. For very small files this may be acceptable behaviour. For large files it may cause an unacceptable delay. The C<$whence> parameter takes one the usual values, namely SEEK_SET, SEEK_CUR or SEEK_END. Returns 1 on success, 0 on failure. =head2 binmode Usage is $z->binmode binmode $z ; This is a noop provided for completeness. =head2 opened $z->opened() Returns true if the object currently refers to a opened file/buffer. =head2 autoflush my $prev = $z->autoflush() my $prev = $z->autoflush(EXPR) If the C<$z> object is associated with a file or a filehandle, this method returns the current autoflush setting for the underlying filehandle. If C is present, and is non-zero, it will enable flushing after every write/print operation. If C<$z> is associated with a buffer, this method has no effect and always returns C. B that the special variable C<$|> B be used to set or retrieve the autoflush setting. =head2 input_line_number $z->input_line_number() $z->input_line_number(EXPR) Returns the current uncompressed line number. If C is present it has the effect of setting the line number. Note that setting the line number does not change the current position within the file/buffer being read. The contents of C<$/> are used to determine what constitutes a line terminator. =head2 fileno $z->fileno() fileno($z) If the C<$z> object is associated with a file or a filehandle, C will return the underlying file descriptor. Once the C method is called C will return C. If the C<$z> object is associated with a buffer, this method will return C. =head2 close $z->close() ; close $z ; Closes the output file/buffer. For most versions of Perl this method will be automatically invoked if the IO::Uncompress::Bunzip2 object is destroyed (either explicitly or by the variable with the reference to the object going out of scope). The exceptions are Perl versions 5.005 through 5.00504 and 5.8.0. In these cases, the C method will be called automatically, but not until global destruction of all live objects when the program is terminating. Therefore, if you want your scripts to be able to run on all versions of Perl, you should call C explicitly and not rely on automatic closing. Returns true on success, otherwise 0. If the C option has been enabled when the IO::Uncompress::Bunzip2 object was created, and the object is associated with a file, the underlying file will also be closed. =head2 nextStream Usage is my $status = $z->nextStream(); Skips to the next compressed data stream in the input file/buffer. If a new compressed data stream is found, the eof marker will be cleared and C<$.> will be reset to 0. Returns 1 if a new stream was found, 0 if none was found, and -1 if an error was encountered. =head2 trailingData Usage is my $data = $z->trailingData(); Returns the data, if any, that is present immediately after the compressed data stream once uncompression is complete. It only makes sense to call this method once the end of the compressed data stream has been encountered. This option can be used when there is useful information immediately following the compressed data stream, and you don't know the length of the compressed data stream. If the input is a buffer, C will return everything from the end of the compressed data stream to the end of the buffer. If the input is a filehandle, C will return the data that is left in the filehandle input buffer once the end of the compressed data stream has been reached. You can then use the filehandle to read the rest of the input file. Don't bother using C if the input is a filename. If you know the length of the compressed data stream before you start uncompressing, you can avoid having to use C by setting the C option in the constructor. =head1 Importing No symbolic constants are required by this IO::Uncompress::Bunzip2 at present. =over 5 =item :all Imports C and C<$Bunzip2Error>. Same as doing this use IO::Uncompress::Bunzip2 qw(bunzip2 $Bunzip2Error) ; =back =head1 EXAMPLES =head2 Working with Net::FTP See L =head1 SEE ALSO L, L, L, L, L, L, L, L, L, L, L, L, L, L, L, L, L, L L L, L, L, L The primary site for the bzip2 program is L. See the module L =head1 AUTHOR This module was written by Paul Marquess, C. =head1 MODIFICATION HISTORY See the Changes file. =head1 COPYRIGHT AND LICENSE Copyright (c) 2005-2017 Paul Marquess. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. darwin-perl-lib/IO/Uncompress/Gunzip.pm000444 000765 000024 00000076234 13167163507 022255 0ustar00ocsinventorystaff000000 000000 package IO::Uncompress::Gunzip ; require 5.006 ; # for RFC1952 use strict ; use warnings; use bytes; use IO::Uncompress::RawInflate 2.074 ; use Compress::Raw::Zlib 2.074 () ; use IO::Compress::Base::Common 2.074 qw(:Status ); use IO::Compress::Gzip::Constants 2.074 ; use IO::Compress::Zlib::Extra 2.074 ; require Exporter ; our ($VERSION, @ISA, @EXPORT_OK, %EXPORT_TAGS, $GunzipError); @ISA = qw(IO::Uncompress::RawInflate Exporter); @EXPORT_OK = qw( $GunzipError gunzip ); %EXPORT_TAGS = %IO::Uncompress::RawInflate::DEFLATE_CONSTANTS ; push @{ $EXPORT_TAGS{all} }, @EXPORT_OK ; Exporter::export_ok_tags('all'); $GunzipError = ''; $VERSION = '2.074'; sub new { my $class = shift ; $GunzipError = ''; my $obj = IO::Compress::Base::Common::createSelfTiedObject($class, \$GunzipError); $obj->_create(undef, 0, @_); } sub gunzip { my $obj = IO::Compress::Base::Common::createSelfTiedObject(undef, \$GunzipError); return $obj->_inf(@_) ; } sub getExtraParams { return ( 'parseextra' => [IO::Compress::Base::Common::Parse_boolean, 0] ) ; } sub ckParams { my $self = shift ; my $got = shift ; # gunzip always needs crc32 $got->setValue('crc32' => 1); return 1; } sub ckMagic { my $self = shift; my $magic ; $self->smartReadExact(\$magic, GZIP_ID_SIZE); *$self->{HeaderPending} = $magic ; return $self->HeaderError("Minimum header size is " . GZIP_MIN_HEADER_SIZE . " bytes") if length $magic != GZIP_ID_SIZE ; return $self->HeaderError("Bad Magic") if ! isGzipMagic($magic) ; *$self->{Type} = 'rfc1952'; return $magic ; } sub readHeader { my $self = shift; my $magic = shift; return $self->_readGzipHeader($magic); } sub chkTrailer { my $self = shift; my $trailer = shift; # Check CRC & ISIZE my ($CRC32, $ISIZE) = unpack("V V", $trailer) ; *$self->{Info}{CRC32} = $CRC32; *$self->{Info}{ISIZE} = $ISIZE; if (*$self->{Strict}) { return $self->TrailerError("CRC mismatch") if $CRC32 != *$self->{Uncomp}->crc32() ; my $exp_isize = *$self->{UnCompSize}->get32bit(); return $self->TrailerError("ISIZE mismatch. Got $ISIZE" . ", expected $exp_isize") if $ISIZE != $exp_isize ; } return STATUS_OK; } sub isGzipMagic { my $buffer = shift ; return 0 if length $buffer < GZIP_ID_SIZE ; my ($id1, $id2) = unpack("C C", $buffer) ; return $id1 == GZIP_ID1 && $id2 == GZIP_ID2 ; } sub _readFullGzipHeader($) { my ($self) = @_ ; my $magic = '' ; $self->smartReadExact(\$magic, GZIP_ID_SIZE); *$self->{HeaderPending} = $magic ; return $self->HeaderError("Minimum header size is " . GZIP_MIN_HEADER_SIZE . " bytes") if length $magic != GZIP_ID_SIZE ; return $self->HeaderError("Bad Magic") if ! isGzipMagic($magic) ; my $status = $self->_readGzipHeader($magic); delete *$self->{Transparent} if ! defined $status ; return $status ; } sub _readGzipHeader($) { my ($self, $magic) = @_ ; my ($HeaderCRC) ; my ($buffer) = '' ; $self->smartReadExact(\$buffer, GZIP_MIN_HEADER_SIZE - GZIP_ID_SIZE) or return $self->HeaderError("Minimum header size is " . GZIP_MIN_HEADER_SIZE . " bytes") ; my $keep = $magic . $buffer ; *$self->{HeaderPending} = $keep ; # now split out the various parts my ($cm, $flag, $mtime, $xfl, $os) = unpack("C C V C C", $buffer) ; $cm == GZIP_CM_DEFLATED or return $self->HeaderError("Not Deflate (CM is $cm)") ; # check for use of reserved bits return $self->HeaderError("Use of Reserved Bits in FLG field.") if $flag & GZIP_FLG_RESERVED ; my $EXTRA ; my @EXTRA = () ; if ($flag & GZIP_FLG_FEXTRA) { $EXTRA = "" ; $self->smartReadExact(\$buffer, GZIP_FEXTRA_HEADER_SIZE) or return $self->TruncatedHeader("FEXTRA Length") ; my ($XLEN) = unpack("v", $buffer) ; $self->smartReadExact(\$EXTRA, $XLEN) or return $self->TruncatedHeader("FEXTRA Body"); $keep .= $buffer . $EXTRA ; if ($XLEN && *$self->{'ParseExtra'}) { my $bad = IO::Compress::Zlib::Extra::parseRawExtra($EXTRA, \@EXTRA, 1, 1); return $self->HeaderError($bad) if defined $bad; } } my $origname ; if ($flag & GZIP_FLG_FNAME) { $origname = "" ; while (1) { $self->smartReadExact(\$buffer, 1) or return $self->TruncatedHeader("FNAME"); last if $buffer eq GZIP_NULL_BYTE ; $origname .= $buffer } $keep .= $origname . GZIP_NULL_BYTE ; return $self->HeaderError("Non ISO 8859-1 Character found in Name") if *$self->{Strict} && $origname =~ /$GZIP_FNAME_INVALID_CHAR_RE/o ; } my $comment ; if ($flag & GZIP_FLG_FCOMMENT) { $comment = ""; while (1) { $self->smartReadExact(\$buffer, 1) or return $self->TruncatedHeader("FCOMMENT"); last if $buffer eq GZIP_NULL_BYTE ; $comment .= $buffer } $keep .= $comment . GZIP_NULL_BYTE ; return $self->HeaderError("Non ISO 8859-1 Character found in Comment") if *$self->{Strict} && $comment =~ /$GZIP_FCOMMENT_INVALID_CHAR_RE/o ; } if ($flag & GZIP_FLG_FHCRC) { $self->smartReadExact(\$buffer, GZIP_FHCRC_SIZE) or return $self->TruncatedHeader("FHCRC"); $HeaderCRC = unpack("v", $buffer) ; my $crc16 = Compress::Raw::Zlib::crc32($keep) & 0xFF ; return $self->HeaderError("CRC16 mismatch.") if *$self->{Strict} && $crc16 != $HeaderCRC; $keep .= $buffer ; } # Assume compression method is deflated for xfl tests #if ($xfl) { #} *$self->{Type} = 'rfc1952'; return { 'Type' => 'rfc1952', 'FingerprintLength' => 2, 'HeaderLength' => length $keep, 'TrailerLength' => GZIP_TRAILER_SIZE, 'Header' => $keep, 'isMinimalHeader' => $keep eq GZIP_MINIMUM_HEADER ? 1 : 0, 'MethodID' => $cm, 'MethodName' => $cm == GZIP_CM_DEFLATED ? "Deflated" : "Unknown" , 'TextFlag' => $flag & GZIP_FLG_FTEXT ? 1 : 0, 'HeaderCRCFlag' => $flag & GZIP_FLG_FHCRC ? 1 : 0, 'NameFlag' => $flag & GZIP_FLG_FNAME ? 1 : 0, 'CommentFlag' => $flag & GZIP_FLG_FCOMMENT ? 1 : 0, 'ExtraFlag' => $flag & GZIP_FLG_FEXTRA ? 1 : 0, 'Name' => $origname, 'Comment' => $comment, 'Time' => $mtime, 'OsID' => $os, 'OsName' => defined $GZIP_OS_Names{$os} ? $GZIP_OS_Names{$os} : "Unknown", 'HeaderCRC' => $HeaderCRC, 'Flags' => $flag, 'ExtraFlags' => $xfl, 'ExtraFieldRaw' => $EXTRA, 'ExtraField' => [ @EXTRA ], #'CompSize'=> $compsize, #'CRC32'=> $CRC32, #'OrigSize'=> $ISIZE, } } 1; __END__ =head1 NAME IO::Uncompress::Gunzip - Read RFC 1952 files/buffers =head1 SYNOPSIS use IO::Uncompress::Gunzip qw(gunzip $GunzipError) ; my $status = gunzip $input => $output [,OPTS] or die "gunzip failed: $GunzipError\n"; my $z = new IO::Uncompress::Gunzip $input [OPTS] or die "gunzip failed: $GunzipError\n"; $status = $z->read($buffer) $status = $z->read($buffer, $length) $status = $z->read($buffer, $length, $offset) $line = $z->getline() $char = $z->getc() $char = $z->ungetc() $char = $z->opened() $status = $z->inflateSync() $data = $z->trailingData() $status = $z->nextStream() $data = $z->getHeaderInfo() $z->tell() $z->seek($position, $whence) $z->binmode() $z->fileno() $z->eof() $z->close() $GunzipError ; # IO::File mode <$z> read($z, $buffer); read($z, $buffer, $length); read($z, $buffer, $length, $offset); tell($z) seek($z, $position, $whence) binmode($z) fileno($z) eof($z) close($z) =head1 DESCRIPTION This module provides a Perl interface that allows the reading of files/buffers that conform to RFC 1952. For writing RFC 1952 files/buffers, see the companion module IO::Compress::Gzip. =head1 Functional Interface A top-level function, C, is provided to carry out "one-shot" uncompression between buffers and/or files. For finer control over the uncompression process, see the L section. use IO::Uncompress::Gunzip qw(gunzip $GunzipError) ; gunzip $input_filename_or_reference => $output_filename_or_reference [,OPTS] or die "gunzip failed: $GunzipError\n"; The functional interface needs Perl5.005 or better. =head2 gunzip $input_filename_or_reference => $output_filename_or_reference [, OPTS] C expects at least two parameters, C<$input_filename_or_reference> and C<$output_filename_or_reference>. =head3 The C<$input_filename_or_reference> parameter The parameter, C<$input_filename_or_reference>, is used to define the source of the compressed data. It can take one of the following forms: =over 5 =item A filename If the <$input_filename_or_reference> parameter is a simple scalar, it is assumed to be a filename. This file will be opened for reading and the input data will be read from it. =item A filehandle If the C<$input_filename_or_reference> parameter is a filehandle, the input data will be read from it. The string '-' can be used as an alias for standard input. =item A scalar reference If C<$input_filename_or_reference> is a scalar reference, the input data will be read from C<$$input_filename_or_reference>. =item An array reference If C<$input_filename_or_reference> is an array reference, each element in the array must be a filename. The input data will be read from each file in turn. The complete array will be walked to ensure that it only contains valid filenames before any data is uncompressed. =item An Input FileGlob string If C<$input_filename_or_reference> is a string that is delimited by the characters "<" and ">" C will assume that it is an I. The input is the list of files that match the fileglob. See L for more details. =back If the C<$input_filename_or_reference> parameter is any other type, C will be returned. =head3 The C<$output_filename_or_reference> parameter The parameter C<$output_filename_or_reference> is used to control the destination of the uncompressed data. This parameter can take one of these forms. =over 5 =item A filename If the C<$output_filename_or_reference> parameter is a simple scalar, it is assumed to be a filename. This file will be opened for writing and the uncompressed data will be written to it. =item A filehandle If the C<$output_filename_or_reference> parameter is a filehandle, the uncompressed data will be written to it. The string '-' can be used as an alias for standard output. =item A scalar reference If C<$output_filename_or_reference> is a scalar reference, the uncompressed data will be stored in C<$$output_filename_or_reference>. =item An Array Reference If C<$output_filename_or_reference> is an array reference, the uncompressed data will be pushed onto the array. =item An Output FileGlob If C<$output_filename_or_reference> is a string that is delimited by the characters "<" and ">" C will assume that it is an I. The output is the list of files that match the fileglob. When C<$output_filename_or_reference> is an fileglob string, C<$input_filename_or_reference> must also be a fileglob string. Anything else is an error. See L for more details. =back If the C<$output_filename_or_reference> parameter is any other type, C will be returned. =head2 Notes When C<$input_filename_or_reference> maps to multiple compressed files/buffers and C<$output_filename_or_reference> is a single file/buffer, after uncompression C<$output_filename_or_reference> will contain a concatenation of all the uncompressed data from each of the input files/buffers. =head2 Optional Parameters Unless specified below, the optional parameters for C, C, are the same as those used with the OO interface defined in the L section below. =over 5 =item C<< AutoClose => 0|1 >> This option applies to any input or output data streams to C that are filehandles. If C is specified, and the value is true, it will result in all input and/or output filehandles being closed once C has completed. This parameter defaults to 0. =item C<< BinModeOut => 0|1 >> When writing to a file or filehandle, set C before writing to the file. Defaults to 0. =item C<< Append => 0|1 >> The behaviour of this option is dependent on the type of output data stream. =over 5 =item * A Buffer If C is enabled, all uncompressed data will be append to the end of the output buffer. Otherwise the output buffer will be cleared before any uncompressed data is written to it. =item * A Filename If C is enabled, the file will be opened in append mode. Otherwise the contents of the file, if any, will be truncated before any uncompressed data is written to it. =item * A Filehandle If C is enabled, the filehandle will be positioned to the end of the file via a call to C before any uncompressed data is written to it. Otherwise the file pointer will not be moved. =back When C is specified, and set to true, it will I all uncompressed data to the output data stream. So when the output is a filehandle it will carry out a seek to the eof before writing any uncompressed data. If the output is a filename, it will be opened for appending. If the output is a buffer, all uncompressed data will be appended to the existing buffer. Conversely when C is not specified, or it is present and is set to false, it will operate as follows. When the output is a filename, it will truncate the contents of the file before writing any uncompressed data. If the output is a filehandle its position will not be changed. If the output is a buffer, it will be wiped before any uncompressed data is output. Defaults to 0. =item C<< MultiStream => 0|1 >> If the input file/buffer contains multiple compressed data streams, this option will uncompress the whole lot as a single data stream. Defaults to 0. =item C<< TrailingData => $scalar >> Returns the data, if any, that is present immediately after the compressed data stream once uncompression is complete. This option can be used when there is useful information immediately following the compressed data stream, and you don't know the length of the compressed data stream. If the input is a buffer, C will return everything from the end of the compressed data stream to the end of the buffer. If the input is a filehandle, C will return the data that is left in the filehandle input buffer once the end of the compressed data stream has been reached. You can then use the filehandle to read the rest of the input file. Don't bother using C if the input is a filename. If you know the length of the compressed data stream before you start uncompressing, you can avoid having to use C by setting the C option. =back =head2 Examples To read the contents of the file C and write the uncompressed data to the file C. use strict ; use warnings ; use IO::Uncompress::Gunzip qw(gunzip $GunzipError) ; my $input = "file1.txt.gz"; my $output = "file1.txt"; gunzip $input => $output or die "gunzip failed: $GunzipError\n"; To read from an existing Perl filehandle, C<$input>, and write the uncompressed data to a buffer, C<$buffer>. use strict ; use warnings ; use IO::Uncompress::Gunzip qw(gunzip $GunzipError) ; use IO::File ; my $input = new IO::File " \$buffer or die "gunzip failed: $GunzipError\n"; To uncompress all files in the directory "/my/home" that match "*.txt.gz" and store the compressed data in the same directory use strict ; use warnings ; use IO::Uncompress::Gunzip qw(gunzip $GunzipError) ; gunzip '' => '' or die "gunzip failed: $GunzipError\n"; and if you want to compress each file one at a time, this will do the trick use strict ; use warnings ; use IO::Uncompress::Gunzip qw(gunzip $GunzipError) ; for my $input ( glob "/my/home/*.txt.gz" ) { my $output = $input; $output =~ s/.gz// ; gunzip $input => $output or die "Error compressing '$input': $GunzipError\n"; } =head1 OO Interface =head2 Constructor The format of the constructor for IO::Uncompress::Gunzip is shown below my $z = new IO::Uncompress::Gunzip $input [OPTS] or die "IO::Uncompress::Gunzip failed: $GunzipError\n"; Returns an C object on success and undef on failure. The variable C<$GunzipError> will contain an error message on failure. If you are running Perl 5.005 or better the object, C<$z>, returned from IO::Uncompress::Gunzip can be used exactly like an L filehandle. This means that all normal input file operations can be carried out with C<$z>. For example, to read a line from a compressed file/buffer you can use either of these forms $line = $z->getline(); $line = <$z>; The mandatory parameter C<$input> is used to determine the source of the compressed data. This parameter can take one of three forms. =over 5 =item A filename If the C<$input> parameter is a scalar, it is assumed to be a filename. This file will be opened for reading and the compressed data will be read from it. =item A filehandle If the C<$input> parameter is a filehandle, the compressed data will be read from it. The string '-' can be used as an alias for standard input. =item A scalar reference If C<$input> is a scalar reference, the compressed data will be read from C<$$input>. =back =head2 Constructor Options The option names defined below are case insensitive and can be optionally prefixed by a '-'. So all of the following are valid -AutoClose -autoclose AUTOCLOSE autoclose OPTS is a combination of the following options: =over 5 =item C<< AutoClose => 0|1 >> This option is only valid when the C<$input> parameter is a filehandle. If specified, and the value is true, it will result in the file being closed once either the C method is called or the IO::Uncompress::Gunzip object is destroyed. This parameter defaults to 0. =item C<< MultiStream => 0|1 >> Allows multiple concatenated compressed streams to be treated as a single compressed stream. Decompression will stop once either the end of the file/buffer is reached, an error is encountered (premature eof, corrupt compressed data) or the end of a stream is not immediately followed by the start of another stream. This parameter defaults to 0. =item C<< Prime => $string >> This option will uncompress the contents of C<$string> before processing the input file/buffer. This option can be useful when the compressed data is embedded in another file/data structure and it is not possible to work out where the compressed data begins without having to read the first few bytes. If this is the case, the uncompression can be I with these bytes using this option. =item C<< Transparent => 0|1 >> If this option is set and the input file/buffer is not compressed data, the module will allow reading of it anyway. In addition, if the input file/buffer does contain compressed data and there is non-compressed data immediately following it, setting this option will make this module treat the whole file/buffer as a single data stream. This option defaults to 1. =item C<< BlockSize => $num >> When reading the compressed input data, IO::Uncompress::Gunzip will read it in blocks of C<$num> bytes. This option defaults to 4096. =item C<< InputLength => $size >> When present this option will limit the number of compressed bytes read from the input file/buffer to C<$size>. This option can be used in the situation where there is useful data directly after the compressed data stream and you know beforehand the exact length of the compressed data stream. This option is mostly used when reading from a filehandle, in which case the file pointer will be left pointing to the first byte directly after the compressed data stream. This option defaults to off. =item C<< Append => 0|1 >> This option controls what the C method does with uncompressed data. If set to 1, all uncompressed data will be appended to the output parameter of the C method. If set to 0, the contents of the output parameter of the C method will be overwritten by the uncompressed data. Defaults to 0. =item C<< Strict => 0|1 >> This option controls whether the extra checks defined below are used when carrying out the decompression. When Strict is on, the extra tests are carried out, when Strict is off they are not. The default for this option is off. =over 5 =item 1 If the FHCRC bit is set in the gzip FLG header byte, the CRC16 bytes in the header must match the crc16 value of the gzip header actually read. =item 2 If the gzip header contains a name field (FNAME) it consists solely of ISO 8859-1 characters. =item 3 If the gzip header contains a comment field (FCOMMENT) it consists solely of ISO 8859-1 characters plus line-feed. =item 4 If the gzip FEXTRA header field is present it must conform to the sub-field structure as defined in RFC 1952. =item 5 The CRC32 and ISIZE trailer fields must be present. =item 6 The value of the CRC32 field read must match the crc32 value of the uncompressed data actually contained in the gzip file. =item 7 The value of the ISIZE fields read must match the length of the uncompressed data actually read from the file. =back =item C<< ParseExtra => 0|1 >> If the gzip FEXTRA header field is present and this option is set, it will force the module to check that it conforms to the sub-field structure as defined in RFC 1952. If the C is on it will automatically enable this option. Defaults to 0. =back =head2 Examples TODO =head1 Methods =head2 read Usage is $status = $z->read($buffer) Reads a block of compressed data (the size of the compressed block is determined by the C option in the constructor), uncompresses it and writes any uncompressed data into C<$buffer>. If the C parameter is set in the constructor, the uncompressed data will be appended to the C<$buffer> parameter. Otherwise C<$buffer> will be overwritten. Returns the number of uncompressed bytes written to C<$buffer>, zero if eof or a negative number on error. =head2 read Usage is $status = $z->read($buffer, $length) $status = $z->read($buffer, $length, $offset) $status = read($z, $buffer, $length) $status = read($z, $buffer, $length, $offset) Attempt to read C<$length> bytes of uncompressed data into C<$buffer>. The main difference between this form of the C method and the previous one, is that this one will attempt to return I C<$length> bytes. The only circumstances that this function will not is if end-of-file or an IO error is encountered. Returns the number of uncompressed bytes written to C<$buffer>, zero if eof or a negative number on error. =head2 getline Usage is $line = $z->getline() $line = <$z> Reads a single line. This method fully supports the use of the variable C<$/> (or C<$INPUT_RECORD_SEPARATOR> or C<$RS> when C is in use) to determine what constitutes an end of line. Paragraph mode, record mode and file slurp mode are all supported. =head2 getc Usage is $char = $z->getc() Read a single character. =head2 ungetc Usage is $char = $z->ungetc($string) =head2 inflateSync Usage is $status = $z->inflateSync() TODO =head2 getHeaderInfo Usage is $hdr = $z->getHeaderInfo(); @hdrs = $z->getHeaderInfo(); This method returns either a hash reference (in scalar context) or a list or hash references (in array context) that contains information about each of the header fields in the compressed data stream(s). =over 5 =item Name The contents of the Name header field, if present. If no name is present, the value will be undef. Note this is different from a zero length name, which will return an empty string. =item Comment The contents of the Comment header field, if present. If no comment is present, the value will be undef. Note this is different from a zero length comment, which will return an empty string. =back =head2 tell Usage is $z->tell() tell $z Returns the uncompressed file offset. =head2 eof Usage is $z->eof(); eof($z); Returns true if the end of the compressed input stream has been reached. =head2 seek $z->seek($position, $whence); seek($z, $position, $whence); Provides a sub-set of the C functionality, with the restriction that it is only legal to seek forward in the input file/buffer. It is a fatal error to attempt to seek backward. Note that the implementation of C in this module does not provide true random access to a compressed file/buffer. It works by uncompressing data from the current offset in the file/buffer until it reaches the uncompressed offset specified in the parameters to C. For very small files this may be acceptable behaviour. For large files it may cause an unacceptable delay. The C<$whence> parameter takes one the usual values, namely SEEK_SET, SEEK_CUR or SEEK_END. Returns 1 on success, 0 on failure. =head2 binmode Usage is $z->binmode binmode $z ; This is a noop provided for completeness. =head2 opened $z->opened() Returns true if the object currently refers to a opened file/buffer. =head2 autoflush my $prev = $z->autoflush() my $prev = $z->autoflush(EXPR) If the C<$z> object is associated with a file or a filehandle, this method returns the current autoflush setting for the underlying filehandle. If C is present, and is non-zero, it will enable flushing after every write/print operation. If C<$z> is associated with a buffer, this method has no effect and always returns C. B that the special variable C<$|> B be used to set or retrieve the autoflush setting. =head2 input_line_number $z->input_line_number() $z->input_line_number(EXPR) Returns the current uncompressed line number. If C is present it has the effect of setting the line number. Note that setting the line number does not change the current position within the file/buffer being read. The contents of C<$/> are used to determine what constitutes a line terminator. =head2 fileno $z->fileno() fileno($z) If the C<$z> object is associated with a file or a filehandle, C will return the underlying file descriptor. Once the C method is called C will return C. If the C<$z> object is associated with a buffer, this method will return C. =head2 close $z->close() ; close $z ; Closes the output file/buffer. For most versions of Perl this method will be automatically invoked if the IO::Uncompress::Gunzip object is destroyed (either explicitly or by the variable with the reference to the object going out of scope). The exceptions are Perl versions 5.005 through 5.00504 and 5.8.0. In these cases, the C method will be called automatically, but not until global destruction of all live objects when the program is terminating. Therefore, if you want your scripts to be able to run on all versions of Perl, you should call C explicitly and not rely on automatic closing. Returns true on success, otherwise 0. If the C option has been enabled when the IO::Uncompress::Gunzip object was created, and the object is associated with a file, the underlying file will also be closed. =head2 nextStream Usage is my $status = $z->nextStream(); Skips to the next compressed data stream in the input file/buffer. If a new compressed data stream is found, the eof marker will be cleared and C<$.> will be reset to 0. Returns 1 if a new stream was found, 0 if none was found, and -1 if an error was encountered. =head2 trailingData Usage is my $data = $z->trailingData(); Returns the data, if any, that is present immediately after the compressed data stream once uncompression is complete. It only makes sense to call this method once the end of the compressed data stream has been encountered. This option can be used when there is useful information immediately following the compressed data stream, and you don't know the length of the compressed data stream. If the input is a buffer, C will return everything from the end of the compressed data stream to the end of the buffer. If the input is a filehandle, C will return the data that is left in the filehandle input buffer once the end of the compressed data stream has been reached. You can then use the filehandle to read the rest of the input file. Don't bother using C if the input is a filename. If you know the length of the compressed data stream before you start uncompressing, you can avoid having to use C by setting the C option in the constructor. =head1 Importing No symbolic constants are required by this IO::Uncompress::Gunzip at present. =over 5 =item :all Imports C and C<$GunzipError>. Same as doing this use IO::Uncompress::Gunzip qw(gunzip $GunzipError) ; =back =head1 EXAMPLES =head2 Working with Net::FTP See L =head1 SEE ALSO L, L, L, L, L, L, L, L, L, L, L, L, L, L, L, L, L, L L L, L, L, L For RFC 1950, 1951 and 1952 see L, L and L The I compression library was written by Jean-loup Gailly C and Mark Adler C. The primary site for the I compression library is L. The primary site for gzip is L. =head1 AUTHOR This module was written by Paul Marquess, C. =head1 MODIFICATION HISTORY See the Changes file. =head1 COPYRIGHT AND LICENSE Copyright (c) 2005-2017 Paul Marquess. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. darwin-perl-lib/IO/Uncompress/Inflate.pm000444 000765 000024 00000066632 13167163507 022364 0ustar00ocsinventorystaff000000 000000 package IO::Uncompress::Inflate ; # for RFC1950 use strict ; use warnings; use bytes; use IO::Compress::Base::Common 2.074 qw(:Status ); use IO::Compress::Zlib::Constants 2.074 ; use IO::Uncompress::RawInflate 2.074 ; require Exporter ; our ($VERSION, @ISA, @EXPORT_OK, %EXPORT_TAGS, $InflateError); $VERSION = '2.074'; $InflateError = ''; @ISA = qw(IO::Uncompress::RawInflate Exporter); @EXPORT_OK = qw( $InflateError inflate ) ; %EXPORT_TAGS = %IO::Uncompress::RawInflate::DEFLATE_CONSTANTS ; push @{ $EXPORT_TAGS{all} }, @EXPORT_OK ; Exporter::export_ok_tags('all'); sub new { my $class = shift ; my $obj = IO::Compress::Base::Common::createSelfTiedObject($class, \$InflateError); $obj->_create(undef, 0, @_); } sub inflate { my $obj = IO::Compress::Base::Common::createSelfTiedObject(undef, \$InflateError); return $obj->_inf(@_); } sub getExtraParams { return (); } sub ckParams { my $self = shift ; my $got = shift ; # gunzip always needs adler32 $got->setValue('adler32' => 1); return 1; } sub ckMagic { my $self = shift; my $magic ; $self->smartReadExact(\$magic, ZLIB_HEADER_SIZE); *$self->{HeaderPending} = $magic ; return $self->HeaderError("Header size is " . ZLIB_HEADER_SIZE . " bytes") if length $magic != ZLIB_HEADER_SIZE; #return $self->HeaderError("CRC mismatch.") return undef if ! $self->isZlibMagic($magic) ; *$self->{Type} = 'rfc1950'; return $magic; } sub readHeader { my $self = shift; my $magic = shift ; return $self->_readDeflateHeader($magic) ; } sub chkTrailer { my $self = shift; my $trailer = shift; my $ADLER32 = unpack("N", $trailer) ; *$self->{Info}{ADLER32} = $ADLER32; return $self->TrailerError("CRC mismatch") if *$self->{Strict} && $ADLER32 != *$self->{Uncomp}->adler32() ; return STATUS_OK; } sub isZlibMagic { my $self = shift; my $buffer = shift ; return 0 if length $buffer < ZLIB_HEADER_SIZE ; my $hdr = unpack("n", $buffer) ; #return 0 if $hdr % 31 != 0 ; return $self->HeaderError("CRC mismatch.") if $hdr % 31 != 0 ; my ($CMF, $FLG) = unpack "C C", $buffer; my $cm = bits($CMF, ZLIB_CMF_CM_OFFSET, ZLIB_CMF_CM_BITS) ; # Only Deflate supported return $self->HeaderError("Not Deflate (CM is $cm)") if $cm != ZLIB_CMF_CM_DEFLATED ; # Max window value is 7 for Deflate. my $cinfo = bits($CMF, ZLIB_CMF_CINFO_OFFSET, ZLIB_CMF_CINFO_BITS) ; return $self->HeaderError("CINFO > " . ZLIB_CMF_CINFO_MAX . " (CINFO is $cinfo)") if $cinfo > ZLIB_CMF_CINFO_MAX ; return 1; } sub bits { my $data = shift ; my $offset = shift ; my $mask = shift ; ($data >> $offset ) & $mask & 0xFF ; } sub _readDeflateHeader { my ($self, $buffer) = @_ ; # if (! $buffer) { # $self->smartReadExact(\$buffer, ZLIB_HEADER_SIZE); # # *$self->{HeaderPending} = $buffer ; # # return $self->HeaderError("Header size is " . # ZLIB_HEADER_SIZE . " bytes") # if length $buffer != ZLIB_HEADER_SIZE; # # return $self->HeaderError("CRC mismatch.") # if ! isZlibMagic($buffer) ; # } my ($CMF, $FLG) = unpack "C C", $buffer; my $FDICT = bits($FLG, ZLIB_FLG_FDICT_OFFSET, ZLIB_FLG_FDICT_BITS ), my $cm = bits($CMF, ZLIB_CMF_CM_OFFSET, ZLIB_CMF_CM_BITS) ; $cm == ZLIB_CMF_CM_DEFLATED or return $self->HeaderError("Not Deflate (CM is $cm)") ; my $DICTID; if ($FDICT) { $self->smartReadExact(\$buffer, ZLIB_FDICT_SIZE) or return $self->TruncatedHeader("FDICT"); $DICTID = unpack("N", $buffer) ; } *$self->{Type} = 'rfc1950'; return { 'Type' => 'rfc1950', 'FingerprintLength' => ZLIB_HEADER_SIZE, 'HeaderLength' => ZLIB_HEADER_SIZE, 'TrailerLength' => ZLIB_TRAILER_SIZE, 'Header' => $buffer, CMF => $CMF , CM => bits($CMF, ZLIB_CMF_CM_OFFSET, ZLIB_CMF_CM_BITS ), CINFO => bits($CMF, ZLIB_CMF_CINFO_OFFSET, ZLIB_CMF_CINFO_BITS ), FLG => $FLG , FCHECK => bits($FLG, ZLIB_FLG_FCHECK_OFFSET, ZLIB_FLG_FCHECK_BITS), FDICT => bits($FLG, ZLIB_FLG_FDICT_OFFSET, ZLIB_FLG_FDICT_BITS ), FLEVEL => bits($FLG, ZLIB_FLG_LEVEL_OFFSET, ZLIB_FLG_LEVEL_BITS ), DICTID => $DICTID , }; } 1 ; __END__ =head1 NAME IO::Uncompress::Inflate - Read RFC 1950 files/buffers =head1 SYNOPSIS use IO::Uncompress::Inflate qw(inflate $InflateError) ; my $status = inflate $input => $output [,OPTS] or die "inflate failed: $InflateError\n"; my $z = new IO::Uncompress::Inflate $input [OPTS] or die "inflate failed: $InflateError\n"; $status = $z->read($buffer) $status = $z->read($buffer, $length) $status = $z->read($buffer, $length, $offset) $line = $z->getline() $char = $z->getc() $char = $z->ungetc() $char = $z->opened() $status = $z->inflateSync() $data = $z->trailingData() $status = $z->nextStream() $data = $z->getHeaderInfo() $z->tell() $z->seek($position, $whence) $z->binmode() $z->fileno() $z->eof() $z->close() $InflateError ; # IO::File mode <$z> read($z, $buffer); read($z, $buffer, $length); read($z, $buffer, $length, $offset); tell($z) seek($z, $position, $whence) binmode($z) fileno($z) eof($z) close($z) =head1 DESCRIPTION This module provides a Perl interface that allows the reading of files/buffers that conform to RFC 1950. For writing RFC 1950 files/buffers, see the companion module IO::Compress::Deflate. =head1 Functional Interface A top-level function, C, is provided to carry out "one-shot" uncompression between buffers and/or files. For finer control over the uncompression process, see the L section. use IO::Uncompress::Inflate qw(inflate $InflateError) ; inflate $input_filename_or_reference => $output_filename_or_reference [,OPTS] or die "inflate failed: $InflateError\n"; The functional interface needs Perl5.005 or better. =head2 inflate $input_filename_or_reference => $output_filename_or_reference [, OPTS] C expects at least two parameters, C<$input_filename_or_reference> and C<$output_filename_or_reference>. =head3 The C<$input_filename_or_reference> parameter The parameter, C<$input_filename_or_reference>, is used to define the source of the compressed data. It can take one of the following forms: =over 5 =item A filename If the <$input_filename_or_reference> parameter is a simple scalar, it is assumed to be a filename. This file will be opened for reading and the input data will be read from it. =item A filehandle If the C<$input_filename_or_reference> parameter is a filehandle, the input data will be read from it. The string '-' can be used as an alias for standard input. =item A scalar reference If C<$input_filename_or_reference> is a scalar reference, the input data will be read from C<$$input_filename_or_reference>. =item An array reference If C<$input_filename_or_reference> is an array reference, each element in the array must be a filename. The input data will be read from each file in turn. The complete array will be walked to ensure that it only contains valid filenames before any data is uncompressed. =item An Input FileGlob string If C<$input_filename_or_reference> is a string that is delimited by the characters "<" and ">" C will assume that it is an I. The input is the list of files that match the fileglob. See L for more details. =back If the C<$input_filename_or_reference> parameter is any other type, C will be returned. =head3 The C<$output_filename_or_reference> parameter The parameter C<$output_filename_or_reference> is used to control the destination of the uncompressed data. This parameter can take one of these forms. =over 5 =item A filename If the C<$output_filename_or_reference> parameter is a simple scalar, it is assumed to be a filename. This file will be opened for writing and the uncompressed data will be written to it. =item A filehandle If the C<$output_filename_or_reference> parameter is a filehandle, the uncompressed data will be written to it. The string '-' can be used as an alias for standard output. =item A scalar reference If C<$output_filename_or_reference> is a scalar reference, the uncompressed data will be stored in C<$$output_filename_or_reference>. =item An Array Reference If C<$output_filename_or_reference> is an array reference, the uncompressed data will be pushed onto the array. =item An Output FileGlob If C<$output_filename_or_reference> is a string that is delimited by the characters "<" and ">" C will assume that it is an I. The output is the list of files that match the fileglob. When C<$output_filename_or_reference> is an fileglob string, C<$input_filename_or_reference> must also be a fileglob string. Anything else is an error. See L for more details. =back If the C<$output_filename_or_reference> parameter is any other type, C will be returned. =head2 Notes When C<$input_filename_or_reference> maps to multiple compressed files/buffers and C<$output_filename_or_reference> is a single file/buffer, after uncompression C<$output_filename_or_reference> will contain a concatenation of all the uncompressed data from each of the input files/buffers. =head2 Optional Parameters Unless specified below, the optional parameters for C, C, are the same as those used with the OO interface defined in the L section below. =over 5 =item C<< AutoClose => 0|1 >> This option applies to any input or output data streams to C that are filehandles. If C is specified, and the value is true, it will result in all input and/or output filehandles being closed once C has completed. This parameter defaults to 0. =item C<< BinModeOut => 0|1 >> When writing to a file or filehandle, set C before writing to the file. Defaults to 0. =item C<< Append => 0|1 >> The behaviour of this option is dependent on the type of output data stream. =over 5 =item * A Buffer If C is enabled, all uncompressed data will be append to the end of the output buffer. Otherwise the output buffer will be cleared before any uncompressed data is written to it. =item * A Filename If C is enabled, the file will be opened in append mode. Otherwise the contents of the file, if any, will be truncated before any uncompressed data is written to it. =item * A Filehandle If C is enabled, the filehandle will be positioned to the end of the file via a call to C before any uncompressed data is written to it. Otherwise the file pointer will not be moved. =back When C is specified, and set to true, it will I all uncompressed data to the output data stream. So when the output is a filehandle it will carry out a seek to the eof before writing any uncompressed data. If the output is a filename, it will be opened for appending. If the output is a buffer, all uncompressed data will be appended to the existing buffer. Conversely when C is not specified, or it is present and is set to false, it will operate as follows. When the output is a filename, it will truncate the contents of the file before writing any uncompressed data. If the output is a filehandle its position will not be changed. If the output is a buffer, it will be wiped before any uncompressed data is output. Defaults to 0. =item C<< MultiStream => 0|1 >> If the input file/buffer contains multiple compressed data streams, this option will uncompress the whole lot as a single data stream. Defaults to 0. =item C<< TrailingData => $scalar >> Returns the data, if any, that is present immediately after the compressed data stream once uncompression is complete. This option can be used when there is useful information immediately following the compressed data stream, and you don't know the length of the compressed data stream. If the input is a buffer, C will return everything from the end of the compressed data stream to the end of the buffer. If the input is a filehandle, C will return the data that is left in the filehandle input buffer once the end of the compressed data stream has been reached. You can then use the filehandle to read the rest of the input file. Don't bother using C if the input is a filename. If you know the length of the compressed data stream before you start uncompressing, you can avoid having to use C by setting the C option. =back =head2 Examples To read the contents of the file C and write the uncompressed data to the file C. use strict ; use warnings ; use IO::Uncompress::Inflate qw(inflate $InflateError) ; my $input = "file1.txt.1950"; my $output = "file1.txt"; inflate $input => $output or die "inflate failed: $InflateError\n"; To read from an existing Perl filehandle, C<$input>, and write the uncompressed data to a buffer, C<$buffer>. use strict ; use warnings ; use IO::Uncompress::Inflate qw(inflate $InflateError) ; use IO::File ; my $input = new IO::File " \$buffer or die "inflate failed: $InflateError\n"; To uncompress all files in the directory "/my/home" that match "*.txt.1950" and store the compressed data in the same directory use strict ; use warnings ; use IO::Uncompress::Inflate qw(inflate $InflateError) ; inflate '' => '' or die "inflate failed: $InflateError\n"; and if you want to compress each file one at a time, this will do the trick use strict ; use warnings ; use IO::Uncompress::Inflate qw(inflate $InflateError) ; for my $input ( glob "/my/home/*.txt.1950" ) { my $output = $input; $output =~ s/.1950// ; inflate $input => $output or die "Error compressing '$input': $InflateError\n"; } =head1 OO Interface =head2 Constructor The format of the constructor for IO::Uncompress::Inflate is shown below my $z = new IO::Uncompress::Inflate $input [OPTS] or die "IO::Uncompress::Inflate failed: $InflateError\n"; Returns an C object on success and undef on failure. The variable C<$InflateError> will contain an error message on failure. If you are running Perl 5.005 or better the object, C<$z>, returned from IO::Uncompress::Inflate can be used exactly like an L filehandle. This means that all normal input file operations can be carried out with C<$z>. For example, to read a line from a compressed file/buffer you can use either of these forms $line = $z->getline(); $line = <$z>; The mandatory parameter C<$input> is used to determine the source of the compressed data. This parameter can take one of three forms. =over 5 =item A filename If the C<$input> parameter is a scalar, it is assumed to be a filename. This file will be opened for reading and the compressed data will be read from it. =item A filehandle If the C<$input> parameter is a filehandle, the compressed data will be read from it. The string '-' can be used as an alias for standard input. =item A scalar reference If C<$input> is a scalar reference, the compressed data will be read from C<$$input>. =back =head2 Constructor Options The option names defined below are case insensitive and can be optionally prefixed by a '-'. So all of the following are valid -AutoClose -autoclose AUTOCLOSE autoclose OPTS is a combination of the following options: =over 5 =item C<< AutoClose => 0|1 >> This option is only valid when the C<$input> parameter is a filehandle. If specified, and the value is true, it will result in the file being closed once either the C method is called or the IO::Uncompress::Inflate object is destroyed. This parameter defaults to 0. =item C<< MultiStream => 0|1 >> Allows multiple concatenated compressed streams to be treated as a single compressed stream. Decompression will stop once either the end of the file/buffer is reached, an error is encountered (premature eof, corrupt compressed data) or the end of a stream is not immediately followed by the start of another stream. This parameter defaults to 0. =item C<< Prime => $string >> This option will uncompress the contents of C<$string> before processing the input file/buffer. This option can be useful when the compressed data is embedded in another file/data structure and it is not possible to work out where the compressed data begins without having to read the first few bytes. If this is the case, the uncompression can be I with these bytes using this option. =item C<< Transparent => 0|1 >> If this option is set and the input file/buffer is not compressed data, the module will allow reading of it anyway. In addition, if the input file/buffer does contain compressed data and there is non-compressed data immediately following it, setting this option will make this module treat the whole file/buffer as a single data stream. This option defaults to 1. =item C<< BlockSize => $num >> When reading the compressed input data, IO::Uncompress::Inflate will read it in blocks of C<$num> bytes. This option defaults to 4096. =item C<< InputLength => $size >> When present this option will limit the number of compressed bytes read from the input file/buffer to C<$size>. This option can be used in the situation where there is useful data directly after the compressed data stream and you know beforehand the exact length of the compressed data stream. This option is mostly used when reading from a filehandle, in which case the file pointer will be left pointing to the first byte directly after the compressed data stream. This option defaults to off. =item C<< Append => 0|1 >> This option controls what the C method does with uncompressed data. If set to 1, all uncompressed data will be appended to the output parameter of the C method. If set to 0, the contents of the output parameter of the C method will be overwritten by the uncompressed data. Defaults to 0. =item C<< Strict => 0|1 >> This option controls whether the extra checks defined below are used when carrying out the decompression. When Strict is on, the extra tests are carried out, when Strict is off they are not. The default for this option is off. =over 5 =item 1 The ADLER32 checksum field must be present. =item 2 The value of the ADLER32 field read must match the adler32 value of the uncompressed data actually contained in the file. =back =back =head2 Examples TODO =head1 Methods =head2 read Usage is $status = $z->read($buffer) Reads a block of compressed data (the size of the compressed block is determined by the C option in the constructor), uncompresses it and writes any uncompressed data into C<$buffer>. If the C parameter is set in the constructor, the uncompressed data will be appended to the C<$buffer> parameter. Otherwise C<$buffer> will be overwritten. Returns the number of uncompressed bytes written to C<$buffer>, zero if eof or a negative number on error. =head2 read Usage is $status = $z->read($buffer, $length) $status = $z->read($buffer, $length, $offset) $status = read($z, $buffer, $length) $status = read($z, $buffer, $length, $offset) Attempt to read C<$length> bytes of uncompressed data into C<$buffer>. The main difference between this form of the C method and the previous one, is that this one will attempt to return I C<$length> bytes. The only circumstances that this function will not is if end-of-file or an IO error is encountered. Returns the number of uncompressed bytes written to C<$buffer>, zero if eof or a negative number on error. =head2 getline Usage is $line = $z->getline() $line = <$z> Reads a single line. This method fully supports the use of the variable C<$/> (or C<$INPUT_RECORD_SEPARATOR> or C<$RS> when C is in use) to determine what constitutes an end of line. Paragraph mode, record mode and file slurp mode are all supported. =head2 getc Usage is $char = $z->getc() Read a single character. =head2 ungetc Usage is $char = $z->ungetc($string) =head2 inflateSync Usage is $status = $z->inflateSync() TODO =head2 getHeaderInfo Usage is $hdr = $z->getHeaderInfo(); @hdrs = $z->getHeaderInfo(); This method returns either a hash reference (in scalar context) or a list or hash references (in array context) that contains information about each of the header fields in the compressed data stream(s). =head2 tell Usage is $z->tell() tell $z Returns the uncompressed file offset. =head2 eof Usage is $z->eof(); eof($z); Returns true if the end of the compressed input stream has been reached. =head2 seek $z->seek($position, $whence); seek($z, $position, $whence); Provides a sub-set of the C functionality, with the restriction that it is only legal to seek forward in the input file/buffer. It is a fatal error to attempt to seek backward. Note that the implementation of C in this module does not provide true random access to a compressed file/buffer. It works by uncompressing data from the current offset in the file/buffer until it reaches the uncompressed offset specified in the parameters to C. For very small files this may be acceptable behaviour. For large files it may cause an unacceptable delay. The C<$whence> parameter takes one the usual values, namely SEEK_SET, SEEK_CUR or SEEK_END. Returns 1 on success, 0 on failure. =head2 binmode Usage is $z->binmode binmode $z ; This is a noop provided for completeness. =head2 opened $z->opened() Returns true if the object currently refers to a opened file/buffer. =head2 autoflush my $prev = $z->autoflush() my $prev = $z->autoflush(EXPR) If the C<$z> object is associated with a file or a filehandle, this method returns the current autoflush setting for the underlying filehandle. If C is present, and is non-zero, it will enable flushing after every write/print operation. If C<$z> is associated with a buffer, this method has no effect and always returns C. B that the special variable C<$|> B be used to set or retrieve the autoflush setting. =head2 input_line_number $z->input_line_number() $z->input_line_number(EXPR) Returns the current uncompressed line number. If C is present it has the effect of setting the line number. Note that setting the line number does not change the current position within the file/buffer being read. The contents of C<$/> are used to determine what constitutes a line terminator. =head2 fileno $z->fileno() fileno($z) If the C<$z> object is associated with a file or a filehandle, C will return the underlying file descriptor. Once the C method is called C will return C. If the C<$z> object is associated with a buffer, this method will return C. =head2 close $z->close() ; close $z ; Closes the output file/buffer. For most versions of Perl this method will be automatically invoked if the IO::Uncompress::Inflate object is destroyed (either explicitly or by the variable with the reference to the object going out of scope). The exceptions are Perl versions 5.005 through 5.00504 and 5.8.0. In these cases, the C method will be called automatically, but not until global destruction of all live objects when the program is terminating. Therefore, if you want your scripts to be able to run on all versions of Perl, you should call C explicitly and not rely on automatic closing. Returns true on success, otherwise 0. If the C option has been enabled when the IO::Uncompress::Inflate object was created, and the object is associated with a file, the underlying file will also be closed. =head2 nextStream Usage is my $status = $z->nextStream(); Skips to the next compressed data stream in the input file/buffer. If a new compressed data stream is found, the eof marker will be cleared and C<$.> will be reset to 0. Returns 1 if a new stream was found, 0 if none was found, and -1 if an error was encountered. =head2 trailingData Usage is my $data = $z->trailingData(); Returns the data, if any, that is present immediately after the compressed data stream once uncompression is complete. It only makes sense to call this method once the end of the compressed data stream has been encountered. This option can be used when there is useful information immediately following the compressed data stream, and you don't know the length of the compressed data stream. If the input is a buffer, C will return everything from the end of the compressed data stream to the end of the buffer. If the input is a filehandle, C will return the data that is left in the filehandle input buffer once the end of the compressed data stream has been reached. You can then use the filehandle to read the rest of the input file. Don't bother using C if the input is a filename. If you know the length of the compressed data stream before you start uncompressing, you can avoid having to use C by setting the C option in the constructor. =head1 Importing No symbolic constants are required by this IO::Uncompress::Inflate at present. =over 5 =item :all Imports C and C<$InflateError>. Same as doing this use IO::Uncompress::Inflate qw(inflate $InflateError) ; =back =head1 EXAMPLES =head2 Working with Net::FTP See L =head1 SEE ALSO L, L, L, L, L, L, L, L, L, L, L, L, L, L, L, L, L, L L L, L, L, L For RFC 1950, 1951 and 1952 see L, L and L The I compression library was written by Jean-loup Gailly C and Mark Adler C. The primary site for the I compression library is L. The primary site for gzip is L. =head1 AUTHOR This module was written by Paul Marquess, C. =head1 MODIFICATION HISTORY See the Changes file. =head1 COPYRIGHT AND LICENSE Copyright (c) 2005-2017 Paul Marquess. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. darwin-perl-lib/IO/Uncompress/RawInflate.pm000555 000765 000024 00000075561 13167163507 023042 0ustar00ocsinventorystaff000000 000000 package IO::Uncompress::RawInflate ; # for RFC1951 use strict ; use warnings; use bytes; use Compress::Raw::Zlib 2.074 ; use IO::Compress::Base::Common 2.074 qw(:Status ); use IO::Uncompress::Base 2.074 ; use IO::Uncompress::Adapter::Inflate 2.074 ; require Exporter ; our ($VERSION, @ISA, @EXPORT_OK, %EXPORT_TAGS, %DEFLATE_CONSTANTS, $RawInflateError); $VERSION = '2.074'; $RawInflateError = ''; @ISA = qw(IO::Uncompress::Base Exporter); @EXPORT_OK = qw( $RawInflateError rawinflate ) ; %DEFLATE_CONSTANTS = (); %EXPORT_TAGS = %IO::Uncompress::Base::EXPORT_TAGS ; push @{ $EXPORT_TAGS{all} }, @EXPORT_OK ; Exporter::export_ok_tags('all'); #{ # # Execute at runtime # my %bad; # for my $module (qw(Compress::Raw::Zlib IO::Compress::Base::Common IO::Uncompress::Base IO::Uncompress::Adapter::Inflate)) # { # my $ver = ${ $module . "::VERSION"} ; # # $bad{$module} = $ver # if $ver ne $VERSION; # } # # if (keys %bad) # { # my $string = join "\n", map { "$_ $bad{$_}" } keys %bad; # die caller(0)[0] . "needs version $VERSION mismatch\n$string\n"; # } #} sub new { my $class = shift ; my $obj = IO::Compress::Base::Common::createSelfTiedObject($class, \$RawInflateError); $obj->_create(undef, 0, @_); } sub rawinflate { my $obj = IO::Compress::Base::Common::createSelfTiedObject(undef, \$RawInflateError); return $obj->_inf(@_); } sub getExtraParams { return (); } sub ckParams { my $self = shift ; my $got = shift ; return 1; } sub mkUncomp { my $self = shift ; my $got = shift ; my ($obj, $errstr, $errno) = IO::Uncompress::Adapter::Inflate::mkUncompObject( $got->getValue('crc32'), $got->getValue('adler32'), $got->getValue('scan'), ); return $self->saveErrorString(undef, $errstr, $errno) if ! defined $obj; *$self->{Uncomp} = $obj; my $magic = $self->ckMagic() or return 0; *$self->{Info} = $self->readHeader($magic) or return undef ; return 1; } sub ckMagic { my $self = shift; return $self->_isRaw() ; } sub readHeader { my $self = shift; my $magic = shift ; return { 'Type' => 'rfc1951', 'FingerprintLength' => 0, 'HeaderLength' => 0, 'TrailerLength' => 0, 'Header' => '' }; } sub chkTrailer { return STATUS_OK ; } sub _isRaw { my $self = shift ; my $got = $self->_isRawx(@_); if ($got) { *$self->{Pending} = *$self->{HeaderPending} ; } else { $self->pushBack(*$self->{HeaderPending}); *$self->{Uncomp}->reset(); } *$self->{HeaderPending} = ''; return $got ; } sub _isRawx { my $self = shift ; my $magic = shift ; $magic = '' unless defined $magic ; my $buffer = ''; $self->smartRead(\$buffer, *$self->{BlockSize}) >= 0 or return $self->saveErrorString(undef, "No data to read"); my $temp_buf = $magic . $buffer ; *$self->{HeaderPending} = $temp_buf ; $buffer = ''; my $status = *$self->{Uncomp}->uncompr(\$temp_buf, \$buffer, $self->smartEof()) ; return $self->saveErrorString(undef, *$self->{Uncomp}{Error}, STATUS_ERROR) if $status == STATUS_ERROR; $self->pushBack($temp_buf) ; return $self->saveErrorString(undef, "unexpected end of file", STATUS_ERROR) if $self->smartEof() && $status != STATUS_ENDSTREAM; #my $buf_len = *$self->{Uncomp}->uncompressedBytes(); my $buf_len = length $buffer; if ($status == STATUS_ENDSTREAM) { if (*$self->{MultiStream} && (length $temp_buf || ! $self->smartEof())){ *$self->{NewStream} = 1 ; *$self->{EndStream} = 0 ; } else { *$self->{EndStream} = 1 ; } } *$self->{HeaderPending} = $buffer ; *$self->{InflatedBytesRead} = $buf_len ; *$self->{TotalInflatedBytesRead} += $buf_len ; *$self->{Type} = 'rfc1951'; $self->saveStatus(STATUS_OK); return { 'Type' => 'rfc1951', 'HeaderLength' => 0, 'TrailerLength' => 0, 'Header' => '' }; } sub inflateSync { my $self = shift ; # inflateSync is a no-op in Plain mode return 1 if *$self->{Plain} ; return 0 if *$self->{Closed} ; #return G_EOF if !length *$self->{Pending} && *$self->{EndStream} ; return 0 if ! length *$self->{Pending} && *$self->{EndStream} ; # Disable CRC check *$self->{Strict} = 0 ; my $status ; while (1) { my $temp_buf ; if (length *$self->{Pending} ) { $temp_buf = *$self->{Pending} ; *$self->{Pending} = ''; } else { $status = $self->smartRead(\$temp_buf, *$self->{BlockSize}) ; return $self->saveErrorString(0, "Error Reading Data") if $status < 0 ; if ($status == 0 ) { *$self->{EndStream} = 1 ; return $self->saveErrorString(0, "unexpected end of file", STATUS_ERROR); } } $status = *$self->{Uncomp}->sync($temp_buf) ; if ($status == STATUS_OK) { *$self->{Pending} .= $temp_buf ; return 1 ; } last unless $status == STATUS_ERROR ; } return 0; } #sub performScan #{ # my $self = shift ; # # my $status ; # my $end_offset = 0; # # $status = $self->scan() # #or return $self->saveErrorString(undef, "Error Scanning: $$error_ref", $self->errorNo) ; # or return $self->saveErrorString(G_ERR, "Error Scanning: $status") # # $status = $self->zap($end_offset) # or return $self->saveErrorString(G_ERR, "Error Zapping: $status"); # #or return $self->saveErrorString(undef, "Error Zapping: $$error_ref", $self->errorNo) ; # # #(*$obj->{Deflate}, $status) = $inf->createDeflate(); # ## *$obj->{Header} = *$inf->{Info}{Header}; ## *$obj->{UnCompSize_32bit} = ## *$obj->{BytesWritten} = *$inf->{UnCompSize_32bit} ; ## *$obj->{CompSize_32bit} = *$inf->{CompSize_32bit} ; # # ## if ( $outType eq 'buffer') ## { substr( ${ *$self->{Buffer} }, $end_offset) = '' } ## elsif ($outType eq 'handle' || $outType eq 'filename') { ## *$self->{FH} = *$inf->{FH} ; ## delete *$inf->{FH}; ## *$obj->{FH}->flush() ; ## *$obj->{Handle} = 1 if $outType eq 'handle'; ## ## #seek(*$obj->{FH}, $end_offset, SEEK_SET) ## *$obj->{FH}->seek($end_offset, SEEK_SET) ## or return $obj->saveErrorString(undef, $!, $!) ; ## } # #} sub scan { my $self = shift ; return 1 if *$self->{Closed} ; return 1 if !length *$self->{Pending} && *$self->{EndStream} ; my $buffer = '' ; my $len = 0; $len = $self->_raw_read(\$buffer, 1) while ! *$self->{EndStream} && $len >= 0 ; #return $len if $len < 0 ? $len : 0 ; return $len < 0 ? 0 : 1 ; } sub zap { my $self = shift ; my $headerLength = *$self->{Info}{HeaderLength}; my $block_offset = $headerLength + *$self->{Uncomp}->getLastBlockOffset(); $_[0] = $headerLength + *$self->{Uncomp}->getEndOffset(); #printf "# End $_[0], headerlen $headerLength \n";; #printf "# block_offset $block_offset %x\n", $block_offset; my $byte ; ( $self->smartSeek($block_offset) && $self->smartRead(\$byte, 1) ) or return $self->saveErrorString(0, $!, $!); #printf "#byte is %x\n", unpack('C*',$byte); *$self->{Uncomp}->resetLastBlockByte($byte); #printf "#to byte is %x\n", unpack('C*',$byte); ( $self->smartSeek($block_offset) && $self->smartWrite($byte) ) or return $self->saveErrorString(0, $!, $!); #$self->smartSeek($end_offset, 1); return 1 ; } sub createDeflate { my $self = shift ; my ($def, $status) = *$self->{Uncomp}->createDeflateStream( -AppendOutput => 1, -WindowBits => - MAX_WBITS, -CRC32 => *$self->{Params}->getValue('crc32'), -ADLER32 => *$self->{Params}->getValue('adler32'), ); return wantarray ? ($status, $def) : $def ; } 1; __END__ =head1 NAME IO::Uncompress::RawInflate - Read RFC 1951 files/buffers =head1 SYNOPSIS use IO::Uncompress::RawInflate qw(rawinflate $RawInflateError) ; my $status = rawinflate $input => $output [,OPTS] or die "rawinflate failed: $RawInflateError\n"; my $z = new IO::Uncompress::RawInflate $input [OPTS] or die "rawinflate failed: $RawInflateError\n"; $status = $z->read($buffer) $status = $z->read($buffer, $length) $status = $z->read($buffer, $length, $offset) $line = $z->getline() $char = $z->getc() $char = $z->ungetc() $char = $z->opened() $status = $z->inflateSync() $data = $z->trailingData() $status = $z->nextStream() $data = $z->getHeaderInfo() $z->tell() $z->seek($position, $whence) $z->binmode() $z->fileno() $z->eof() $z->close() $RawInflateError ; # IO::File mode <$z> read($z, $buffer); read($z, $buffer, $length); read($z, $buffer, $length, $offset); tell($z) seek($z, $position, $whence) binmode($z) fileno($z) eof($z) close($z) =head1 DESCRIPTION This module provides a Perl interface that allows the reading of files/buffers that conform to RFC 1951. For writing RFC 1951 files/buffers, see the companion module IO::Compress::RawDeflate. =head1 Functional Interface A top-level function, C, is provided to carry out "one-shot" uncompression between buffers and/or files. For finer control over the uncompression process, see the L section. use IO::Uncompress::RawInflate qw(rawinflate $RawInflateError) ; rawinflate $input_filename_or_reference => $output_filename_or_reference [,OPTS] or die "rawinflate failed: $RawInflateError\n"; The functional interface needs Perl5.005 or better. =head2 rawinflate $input_filename_or_reference => $output_filename_or_reference [, OPTS] C expects at least two parameters, C<$input_filename_or_reference> and C<$output_filename_or_reference>. =head3 The C<$input_filename_or_reference> parameter The parameter, C<$input_filename_or_reference>, is used to define the source of the compressed data. It can take one of the following forms: =over 5 =item A filename If the <$input_filename_or_reference> parameter is a simple scalar, it is assumed to be a filename. This file will be opened for reading and the input data will be read from it. =item A filehandle If the C<$input_filename_or_reference> parameter is a filehandle, the input data will be read from it. The string '-' can be used as an alias for standard input. =item A scalar reference If C<$input_filename_or_reference> is a scalar reference, the input data will be read from C<$$input_filename_or_reference>. =item An array reference If C<$input_filename_or_reference> is an array reference, each element in the array must be a filename. The input data will be read from each file in turn. The complete array will be walked to ensure that it only contains valid filenames before any data is uncompressed. =item An Input FileGlob string If C<$input_filename_or_reference> is a string that is delimited by the characters "<" and ">" C will assume that it is an I. The input is the list of files that match the fileglob. See L for more details. =back If the C<$input_filename_or_reference> parameter is any other type, C will be returned. =head3 The C<$output_filename_or_reference> parameter The parameter C<$output_filename_or_reference> is used to control the destination of the uncompressed data. This parameter can take one of these forms. =over 5 =item A filename If the C<$output_filename_or_reference> parameter is a simple scalar, it is assumed to be a filename. This file will be opened for writing and the uncompressed data will be written to it. =item A filehandle If the C<$output_filename_or_reference> parameter is a filehandle, the uncompressed data will be written to it. The string '-' can be used as an alias for standard output. =item A scalar reference If C<$output_filename_or_reference> is a scalar reference, the uncompressed data will be stored in C<$$output_filename_or_reference>. =item An Array Reference If C<$output_filename_or_reference> is an array reference, the uncompressed data will be pushed onto the array. =item An Output FileGlob If C<$output_filename_or_reference> is a string that is delimited by the characters "<" and ">" C will assume that it is an I. The output is the list of files that match the fileglob. When C<$output_filename_or_reference> is an fileglob string, C<$input_filename_or_reference> must also be a fileglob string. Anything else is an error. See L for more details. =back If the C<$output_filename_or_reference> parameter is any other type, C will be returned. =head2 Notes When C<$input_filename_or_reference> maps to multiple compressed files/buffers and C<$output_filename_or_reference> is a single file/buffer, after uncompression C<$output_filename_or_reference> will contain a concatenation of all the uncompressed data from each of the input files/buffers. =head2 Optional Parameters Unless specified below, the optional parameters for C, C, are the same as those used with the OO interface defined in the L section below. =over 5 =item C<< AutoClose => 0|1 >> This option applies to any input or output data streams to C that are filehandles. If C is specified, and the value is true, it will result in all input and/or output filehandles being closed once C has completed. This parameter defaults to 0. =item C<< BinModeOut => 0|1 >> When writing to a file or filehandle, set C before writing to the file. Defaults to 0. =item C<< Append => 0|1 >> The behaviour of this option is dependent on the type of output data stream. =over 5 =item * A Buffer If C is enabled, all uncompressed data will be append to the end of the output buffer. Otherwise the output buffer will be cleared before any uncompressed data is written to it. =item * A Filename If C is enabled, the file will be opened in append mode. Otherwise the contents of the file, if any, will be truncated before any uncompressed data is written to it. =item * A Filehandle If C is enabled, the filehandle will be positioned to the end of the file via a call to C before any uncompressed data is written to it. Otherwise the file pointer will not be moved. =back When C is specified, and set to true, it will I all uncompressed data to the output data stream. So when the output is a filehandle it will carry out a seek to the eof before writing any uncompressed data. If the output is a filename, it will be opened for appending. If the output is a buffer, all uncompressed data will be appended to the existing buffer. Conversely when C is not specified, or it is present and is set to false, it will operate as follows. When the output is a filename, it will truncate the contents of the file before writing any uncompressed data. If the output is a filehandle its position will not be changed. If the output is a buffer, it will be wiped before any uncompressed data is output. Defaults to 0. =item C<< MultiStream => 0|1 >> This option is a no-op. =item C<< TrailingData => $scalar >> Returns the data, if any, that is present immediately after the compressed data stream once uncompression is complete. This option can be used when there is useful information immediately following the compressed data stream, and you don't know the length of the compressed data stream. If the input is a buffer, C will return everything from the end of the compressed data stream to the end of the buffer. If the input is a filehandle, C will return the data that is left in the filehandle input buffer once the end of the compressed data stream has been reached. You can then use the filehandle to read the rest of the input file. Don't bother using C if the input is a filename. If you know the length of the compressed data stream before you start uncompressing, you can avoid having to use C by setting the C option. =back =head2 Examples To read the contents of the file C and write the uncompressed data to the file C. use strict ; use warnings ; use IO::Uncompress::RawInflate qw(rawinflate $RawInflateError) ; my $input = "file1.txt.1951"; my $output = "file1.txt"; rawinflate $input => $output or die "rawinflate failed: $RawInflateError\n"; To read from an existing Perl filehandle, C<$input>, and write the uncompressed data to a buffer, C<$buffer>. use strict ; use warnings ; use IO::Uncompress::RawInflate qw(rawinflate $RawInflateError) ; use IO::File ; my $input = new IO::File " \$buffer or die "rawinflate failed: $RawInflateError\n"; To uncompress all files in the directory "/my/home" that match "*.txt.1951" and store the compressed data in the same directory use strict ; use warnings ; use IO::Uncompress::RawInflate qw(rawinflate $RawInflateError) ; rawinflate '' => '' or die "rawinflate failed: $RawInflateError\n"; and if you want to compress each file one at a time, this will do the trick use strict ; use warnings ; use IO::Uncompress::RawInflate qw(rawinflate $RawInflateError) ; for my $input ( glob "/my/home/*.txt.1951" ) { my $output = $input; $output =~ s/.1951// ; rawinflate $input => $output or die "Error compressing '$input': $RawInflateError\n"; } =head1 OO Interface =head2 Constructor The format of the constructor for IO::Uncompress::RawInflate is shown below my $z = new IO::Uncompress::RawInflate $input [OPTS] or die "IO::Uncompress::RawInflate failed: $RawInflateError\n"; Returns an C object on success and undef on failure. The variable C<$RawInflateError> will contain an error message on failure. If you are running Perl 5.005 or better the object, C<$z>, returned from IO::Uncompress::RawInflate can be used exactly like an L filehandle. This means that all normal input file operations can be carried out with C<$z>. For example, to read a line from a compressed file/buffer you can use either of these forms $line = $z->getline(); $line = <$z>; The mandatory parameter C<$input> is used to determine the source of the compressed data. This parameter can take one of three forms. =over 5 =item A filename If the C<$input> parameter is a scalar, it is assumed to be a filename. This file will be opened for reading and the compressed data will be read from it. =item A filehandle If the C<$input> parameter is a filehandle, the compressed data will be read from it. The string '-' can be used as an alias for standard input. =item A scalar reference If C<$input> is a scalar reference, the compressed data will be read from C<$$input>. =back =head2 Constructor Options The option names defined below are case insensitive and can be optionally prefixed by a '-'. So all of the following are valid -AutoClose -autoclose AUTOCLOSE autoclose OPTS is a combination of the following options: =over 5 =item C<< AutoClose => 0|1 >> This option is only valid when the C<$input> parameter is a filehandle. If specified, and the value is true, it will result in the file being closed once either the C method is called or the IO::Uncompress::RawInflate object is destroyed. This parameter defaults to 0. =item C<< MultiStream => 0|1 >> Allows multiple concatenated compressed streams to be treated as a single compressed stream. Decompression will stop once either the end of the file/buffer is reached, an error is encountered (premature eof, corrupt compressed data) or the end of a stream is not immediately followed by the start of another stream. This parameter defaults to 0. =item C<< Prime => $string >> This option will uncompress the contents of C<$string> before processing the input file/buffer. This option can be useful when the compressed data is embedded in another file/data structure and it is not possible to work out where the compressed data begins without having to read the first few bytes. If this is the case, the uncompression can be I with these bytes using this option. =item C<< Transparent => 0|1 >> If this option is set and the input file/buffer is not compressed data, the module will allow reading of it anyway. In addition, if the input file/buffer does contain compressed data and there is non-compressed data immediately following it, setting this option will make this module treat the whole file/buffer as a single data stream. This option defaults to 1. =item C<< BlockSize => $num >> When reading the compressed input data, IO::Uncompress::RawInflate will read it in blocks of C<$num> bytes. This option defaults to 4096. =item C<< InputLength => $size >> When present this option will limit the number of compressed bytes read from the input file/buffer to C<$size>. This option can be used in the situation where there is useful data directly after the compressed data stream and you know beforehand the exact length of the compressed data stream. This option is mostly used when reading from a filehandle, in which case the file pointer will be left pointing to the first byte directly after the compressed data stream. This option defaults to off. =item C<< Append => 0|1 >> This option controls what the C method does with uncompressed data. If set to 1, all uncompressed data will be appended to the output parameter of the C method. If set to 0, the contents of the output parameter of the C method will be overwritten by the uncompressed data. Defaults to 0. =item C<< Strict => 0|1 >> This option is a no-op. =back =head2 Examples TODO =head1 Methods =head2 read Usage is $status = $z->read($buffer) Reads a block of compressed data (the size of the compressed block is determined by the C option in the constructor), uncompresses it and writes any uncompressed data into C<$buffer>. If the C parameter is set in the constructor, the uncompressed data will be appended to the C<$buffer> parameter. Otherwise C<$buffer> will be overwritten. Returns the number of uncompressed bytes written to C<$buffer>, zero if eof or a negative number on error. =head2 read Usage is $status = $z->read($buffer, $length) $status = $z->read($buffer, $length, $offset) $status = read($z, $buffer, $length) $status = read($z, $buffer, $length, $offset) Attempt to read C<$length> bytes of uncompressed data into C<$buffer>. The main difference between this form of the C method and the previous one, is that this one will attempt to return I C<$length> bytes. The only circumstances that this function will not is if end-of-file or an IO error is encountered. Returns the number of uncompressed bytes written to C<$buffer>, zero if eof or a negative number on error. =head2 getline Usage is $line = $z->getline() $line = <$z> Reads a single line. This method fully supports the use of the variable C<$/> (or C<$INPUT_RECORD_SEPARATOR> or C<$RS> when C is in use) to determine what constitutes an end of line. Paragraph mode, record mode and file slurp mode are all supported. =head2 getc Usage is $char = $z->getc() Read a single character. =head2 ungetc Usage is $char = $z->ungetc($string) =head2 inflateSync Usage is $status = $z->inflateSync() TODO =head2 getHeaderInfo Usage is $hdr = $z->getHeaderInfo(); @hdrs = $z->getHeaderInfo(); This method returns either a hash reference (in scalar context) or a list or hash references (in array context) that contains information about each of the header fields in the compressed data stream(s). =head2 tell Usage is $z->tell() tell $z Returns the uncompressed file offset. =head2 eof Usage is $z->eof(); eof($z); Returns true if the end of the compressed input stream has been reached. =head2 seek $z->seek($position, $whence); seek($z, $position, $whence); Provides a sub-set of the C functionality, with the restriction that it is only legal to seek forward in the input file/buffer. It is a fatal error to attempt to seek backward. Note that the implementation of C in this module does not provide true random access to a compressed file/buffer. It works by uncompressing data from the current offset in the file/buffer until it reaches the uncompressed offset specified in the parameters to C. For very small files this may be acceptable behaviour. For large files it may cause an unacceptable delay. The C<$whence> parameter takes one the usual values, namely SEEK_SET, SEEK_CUR or SEEK_END. Returns 1 on success, 0 on failure. =head2 binmode Usage is $z->binmode binmode $z ; This is a noop provided for completeness. =head2 opened $z->opened() Returns true if the object currently refers to a opened file/buffer. =head2 autoflush my $prev = $z->autoflush() my $prev = $z->autoflush(EXPR) If the C<$z> object is associated with a file or a filehandle, this method returns the current autoflush setting for the underlying filehandle. If C is present, and is non-zero, it will enable flushing after every write/print operation. If C<$z> is associated with a buffer, this method has no effect and always returns C. B that the special variable C<$|> B be used to set or retrieve the autoflush setting. =head2 input_line_number $z->input_line_number() $z->input_line_number(EXPR) Returns the current uncompressed line number. If C is present it has the effect of setting the line number. Note that setting the line number does not change the current position within the file/buffer being read. The contents of C<$/> are used to determine what constitutes a line terminator. =head2 fileno $z->fileno() fileno($z) If the C<$z> object is associated with a file or a filehandle, C will return the underlying file descriptor. Once the C method is called C will return C. If the C<$z> object is associated with a buffer, this method will return C. =head2 close $z->close() ; close $z ; Closes the output file/buffer. For most versions of Perl this method will be automatically invoked if the IO::Uncompress::RawInflate object is destroyed (either explicitly or by the variable with the reference to the object going out of scope). The exceptions are Perl versions 5.005 through 5.00504 and 5.8.0. In these cases, the C method will be called automatically, but not until global destruction of all live objects when the program is terminating. Therefore, if you want your scripts to be able to run on all versions of Perl, you should call C explicitly and not rely on automatic closing. Returns true on success, otherwise 0. If the C option has been enabled when the IO::Uncompress::RawInflate object was created, and the object is associated with a file, the underlying file will also be closed. =head2 nextStream Usage is my $status = $z->nextStream(); Skips to the next compressed data stream in the input file/buffer. If a new compressed data stream is found, the eof marker will be cleared and C<$.> will be reset to 0. Returns 1 if a new stream was found, 0 if none was found, and -1 if an error was encountered. =head2 trailingData Usage is my $data = $z->trailingData(); Returns the data, if any, that is present immediately after the compressed data stream once uncompression is complete. It only makes sense to call this method once the end of the compressed data stream has been encountered. This option can be used when there is useful information immediately following the compressed data stream, and you don't know the length of the compressed data stream. If the input is a buffer, C will return everything from the end of the compressed data stream to the end of the buffer. If the input is a filehandle, C will return the data that is left in the filehandle input buffer once the end of the compressed data stream has been reached. You can then use the filehandle to read the rest of the input file. Don't bother using C if the input is a filename. If you know the length of the compressed data stream before you start uncompressing, you can avoid having to use C by setting the C option in the constructor. =head1 Importing No symbolic constants are required by this IO::Uncompress::RawInflate at present. =over 5 =item :all Imports C and C<$RawInflateError>. Same as doing this use IO::Uncompress::RawInflate qw(rawinflate $RawInflateError) ; =back =head1 EXAMPLES =head2 Working with Net::FTP See L =head1 SEE ALSO L, L, L, L, L, L, L, L, L, L, L, L, L, L, L, L, L, L L L, L, L, L For RFC 1950, 1951 and 1952 see L, L and L The I compression library was written by Jean-loup Gailly C and Mark Adler C. The primary site for the I compression library is L. The primary site for gzip is L. =head1 AUTHOR This module was written by Paul Marquess, C. =head1 MODIFICATION HISTORY See the Changes file. =head1 COPYRIGHT AND LICENSE Copyright (c) 2005-2017 Paul Marquess. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. darwin-perl-lib/IO/Uncompress/Unzip.pm000444 000765 000024 00000150252 13167163507 022077 0ustar00ocsinventorystaff000000 000000 package IO::Uncompress::Unzip; require 5.006 ; # for RFC1952 use strict ; use warnings; use bytes; use IO::File; use IO::Uncompress::RawInflate 2.074 ; use IO::Compress::Base::Common 2.074 qw(:Status ); use IO::Uncompress::Adapter::Inflate 2.074 ; use IO::Uncompress::Adapter::Identity 2.074 ; use IO::Compress::Zlib::Extra 2.074 ; use IO::Compress::Zip::Constants 2.074 ; use Compress::Raw::Zlib 2.074 () ; BEGIN { eval{ require IO::Uncompress::Adapter::Bunzip2 ; import IO::Uncompress::Adapter::Bunzip2 } ; eval{ require IO::Uncompress::Adapter::UnLzma ; import IO::Uncompress::Adapter::UnLzma } ; } require Exporter ; our ($VERSION, @ISA, @EXPORT_OK, %EXPORT_TAGS, $UnzipError, %headerLookup); $VERSION = '2.074'; $UnzipError = ''; @ISA = qw(IO::Uncompress::RawInflate Exporter); @EXPORT_OK = qw( $UnzipError unzip ); %EXPORT_TAGS = %IO::Uncompress::RawInflate::EXPORT_TAGS ; push @{ $EXPORT_TAGS{all} }, @EXPORT_OK ; Exporter::export_ok_tags('all'); %headerLookup = ( ZIP_CENTRAL_HDR_SIG, \&skipCentralDirectory, ZIP_END_CENTRAL_HDR_SIG, \&skipEndCentralDirectory, ZIP64_END_CENTRAL_REC_HDR_SIG, \&skipCentralDirectory64Rec, ZIP64_END_CENTRAL_LOC_HDR_SIG, \&skipCentralDirectory64Loc, ZIP64_ARCHIVE_EXTRA_SIG, \&skipArchiveExtra, ZIP64_DIGITAL_SIGNATURE_SIG, \&skipDigitalSignature, ); sub new { my $class = shift ; my $obj = IO::Compress::Base::Common::createSelfTiedObject($class, \$UnzipError); $obj->_create(undef, 0, @_); } sub unzip { my $obj = IO::Compress::Base::Common::createSelfTiedObject(undef, \$UnzipError); return $obj->_inf(@_) ; } sub getExtraParams { return ( # # Zip header fields 'name' => [IO::Compress::Base::Common::Parse_any, undef], 'stream' => [IO::Compress::Base::Common::Parse_boolean, 0], # TODO - This means reading the central directory to get # 1. the local header offsets # 2. The compressed data length ); } sub ckParams { my $self = shift ; my $got = shift ; # unzip always needs crc32 $got->setValue('crc32' => 1); *$self->{UnzipData}{Name} = $got->getValue('name'); return 1; } sub mkUncomp { my $self = shift ; my $got = shift ; my $magic = $self->ckMagic() or return 0; *$self->{Info} = $self->readHeader($magic) or return undef ; return 1; } sub ckMagic { my $self = shift; my $magic ; $self->smartReadExact(\$magic, 4); *$self->{HeaderPending} = $magic ; return $self->HeaderError("Minimum header size is " . 4 . " bytes") if length $magic != 4 ; return $self->HeaderError("Bad Magic") if ! _isZipMagic($magic) ; *$self->{Type} = 'zip'; return $magic ; } sub fastForward { my $self = shift; my $offset = shift; # TODO - if Stream isn't enabled & reading from file, use seek my $buffer = ''; my $c = 1024 * 16; while ($offset > 0) { $c = length $offset if length $offset < $c ; $offset -= $c; $self->smartReadExact(\$buffer, $c) or return 0; } return 1; } sub readHeader { my $self = shift; my $magic = shift ; my $name = *$self->{UnzipData}{Name} ; my $hdr = $self->_readZipHeader($magic) ; while (defined $hdr) { if (! defined $name || $hdr->{Name} eq $name) { return $hdr ; } # skip the data # TODO - when Stream is off, use seek my $buffer; if (*$self->{ZipData}{Streaming}) { while (1) { my $b; my $status = $self->smartRead(\$b, 1024 * 16); return undef if $status <= 0 ; my $temp_buf; my $out; $status = *$self->{Uncomp}->uncompr(\$b, \$temp_buf, 0, $out); return $self->saveErrorString(undef, *$self->{Uncomp}{Error}, *$self->{Uncomp}{ErrorNo}) if $self->saveStatus($status) == STATUS_ERROR; if ($status == STATUS_ENDSTREAM) { *$self->{Uncomp}->reset(); $self->pushBack($b) ; last; } } # skip the trailer $self->smartReadExact(\$buffer, $hdr->{TrailerLength}) or return $self->saveErrorString(undef, "Truncated file"); } else { my $c = $hdr->{CompressedLength}->get64bit(); $self->fastForward($c) or return $self->saveErrorString(undef, "Truncated file"); $buffer = ''; } $self->chkTrailer($buffer) == STATUS_OK or return $self->saveErrorString(undef, "Truncated file"); $hdr = $self->_readFullZipHeader(); return $self->saveErrorString(undef, "Cannot find '$name'") if $self->smartEof(); } return undef; } sub chkTrailer { my $self = shift; my $trailer = shift; my ($sig, $CRC32, $cSize, $uSize) ; my ($cSizeHi, $uSizeHi) = (0, 0); if (*$self->{ZipData}{Streaming}) { $sig = unpack ("V", substr($trailer, 0, 4)); $CRC32 = unpack ("V", substr($trailer, 4, 4)); if (*$self->{ZipData}{Zip64} ) { $cSize = U64::newUnpack_V64 substr($trailer, 8, 8); $uSize = U64::newUnpack_V64 substr($trailer, 16, 8); } else { $cSize = U64::newUnpack_V32 substr($trailer, 8, 4); $uSize = U64::newUnpack_V32 substr($trailer, 12, 4); } return $self->TrailerError("Data Descriptor signature, got $sig") if $sig != ZIP_DATA_HDR_SIG; } else { ($CRC32, $cSize, $uSize) = (*$self->{ZipData}{Crc32}, *$self->{ZipData}{CompressedLen}, *$self->{ZipData}{UnCompressedLen}); } *$self->{Info}{CRC32} = *$self->{ZipData}{CRC32} ; *$self->{Info}{CompressedLength} = $cSize->get64bit(); *$self->{Info}{UncompressedLength} = $uSize->get64bit(); if (*$self->{Strict}) { return $self->TrailerError("CRC mismatch") if $CRC32 != *$self->{ZipData}{CRC32} ; return $self->TrailerError("CSIZE mismatch.") if ! $cSize->equal(*$self->{CompSize}); return $self->TrailerError("USIZE mismatch.") if ! $uSize->equal(*$self->{UnCompSize}); } my $reachedEnd = STATUS_ERROR ; # check for central directory or end of central directory while (1) { my $magic ; my $got = $self->smartRead(\$magic, 4); return $self->saveErrorString(STATUS_ERROR, "Truncated file") if $got != 4 && *$self->{Strict}; if ($got == 0) { return STATUS_EOF ; } elsif ($got < 0) { return STATUS_ERROR ; } elsif ($got < 4) { $self->pushBack($magic) ; return STATUS_OK ; } my $sig = unpack("V", $magic) ; my $hdr; if ($hdr = $headerLookup{$sig}) { if (&$hdr($self, $magic) != STATUS_OK ) { if (*$self->{Strict}) { return STATUS_ERROR ; } else { $self->clearError(); return STATUS_OK ; } } if ($sig == ZIP_END_CENTRAL_HDR_SIG) { return STATUS_OK ; last; } } elsif ($sig == ZIP_LOCAL_HDR_SIG) { $self->pushBack($magic) ; return STATUS_OK ; } else { # put the data back $self->pushBack($magic) ; last; } } return $reachedEnd ; } sub skipCentralDirectory { my $self = shift; my $magic = shift ; my $buffer; $self->smartReadExact(\$buffer, 46 - 4) or return $self->TrailerError("Minimum header size is " . 46 . " bytes") ; my $keep = $magic . $buffer ; *$self->{HeaderPending} = $keep ; #my $versionMadeBy = unpack ("v", substr($buffer, 4-4, 2)); #my $extractVersion = unpack ("v", substr($buffer, 6-4, 2)); #my $gpFlag = unpack ("v", substr($buffer, 8-4, 2)); #my $compressedMethod = unpack ("v", substr($buffer, 10-4, 2)); #my $lastModTime = unpack ("V", substr($buffer, 12-4, 4)); #my $crc32 = unpack ("V", substr($buffer, 16-4, 4)); my $compressedLength = unpack ("V", substr($buffer, 20-4, 4)); my $uncompressedLength = unpack ("V", substr($buffer, 24-4, 4)); my $filename_length = unpack ("v", substr($buffer, 28-4, 2)); my $extra_length = unpack ("v", substr($buffer, 30-4, 2)); my $comment_length = unpack ("v", substr($buffer, 32-4, 2)); #my $disk_start = unpack ("v", substr($buffer, 34-4, 2)); #my $int_file_attrib = unpack ("v", substr($buffer, 36-4, 2)); #my $ext_file_attrib = unpack ("V", substr($buffer, 38-4, 2)); #my $lcl_hdr_offset = unpack ("V", substr($buffer, 42-4, 2)); my $filename; my $extraField; my $comment ; if ($filename_length) { $self->smartReadExact(\$filename, $filename_length) or return $self->TruncatedTrailer("filename"); $keep .= $filename ; } if ($extra_length) { $self->smartReadExact(\$extraField, $extra_length) or return $self->TruncatedTrailer("extra"); $keep .= $extraField ; } if ($comment_length) { $self->smartReadExact(\$comment, $comment_length) or return $self->TruncatedTrailer("comment"); $keep .= $comment ; } return STATUS_OK ; } sub skipArchiveExtra { my $self = shift; my $magic = shift ; my $buffer; $self->smartReadExact(\$buffer, 4) or return $self->TrailerError("Minimum header size is " . 4 . " bytes") ; my $keep = $magic . $buffer ; my $size = unpack ("V", $buffer); $self->smartReadExact(\$buffer, $size) or return $self->TrailerError("Minimum header size is " . $size . " bytes") ; $keep .= $buffer ; *$self->{HeaderPending} = $keep ; return STATUS_OK ; } sub skipCentralDirectory64Rec { my $self = shift; my $magic = shift ; my $buffer; $self->smartReadExact(\$buffer, 8) or return $self->TrailerError("Minimum header size is " . 8 . " bytes") ; my $keep = $magic . $buffer ; my ($sizeLo, $sizeHi) = unpack ("V V", $buffer); my $size = $sizeHi * U64::MAX32 + $sizeLo; $self->fastForward($size) or return $self->TrailerError("Minimum header size is " . $size . " bytes") ; #$keep .= $buffer ; #*$self->{HeaderPending} = $keep ; #my $versionMadeBy = unpack ("v", substr($buffer, 0, 2)); #my $extractVersion = unpack ("v", substr($buffer, 2, 2)); #my $diskNumber = unpack ("V", substr($buffer, 4, 4)); #my $cntrlDirDiskNo = unpack ("V", substr($buffer, 8, 4)); #my $entriesInThisCD = unpack ("V V", substr($buffer, 12, 8)); #my $entriesInCD = unpack ("V V", substr($buffer, 20, 8)); #my $sizeOfCD = unpack ("V V", substr($buffer, 28, 8)); #my $offsetToCD = unpack ("V V", substr($buffer, 36, 8)); return STATUS_OK ; } sub skipCentralDirectory64Loc { my $self = shift; my $magic = shift ; my $buffer; $self->smartReadExact(\$buffer, 20 - 4) or return $self->TrailerError("Minimum header size is " . 20 . " bytes") ; my $keep = $magic . $buffer ; *$self->{HeaderPending} = $keep ; #my $startCdDisk = unpack ("V", substr($buffer, 4-4, 4)); #my $offsetToCD = unpack ("V V", substr($buffer, 8-4, 8)); #my $diskCount = unpack ("V", substr($buffer, 16-4, 4)); return STATUS_OK ; } sub skipEndCentralDirectory { my $self = shift; my $magic = shift ; my $buffer; $self->smartReadExact(\$buffer, 22 - 4) or return $self->TrailerError("Minimum header size is " . 22 . " bytes") ; my $keep = $magic . $buffer ; *$self->{HeaderPending} = $keep ; #my $diskNumber = unpack ("v", substr($buffer, 4-4, 2)); #my $cntrlDirDiskNo = unpack ("v", substr($buffer, 6-4, 2)); #my $entriesInThisCD = unpack ("v", substr($buffer, 8-4, 2)); #my $entriesInCD = unpack ("v", substr($buffer, 10-4, 2)); #my $sizeOfCD = unpack ("V", substr($buffer, 12-4, 4)); #my $offsetToCD = unpack ("V", substr($buffer, 16-4, 4)); my $comment_length = unpack ("v", substr($buffer, 20-4, 2)); my $comment ; if ($comment_length) { $self->smartReadExact(\$comment, $comment_length) or return $self->TruncatedTrailer("comment"); $keep .= $comment ; } return STATUS_OK ; } sub _isZipMagic { my $buffer = shift ; return 0 if length $buffer < 4 ; my $sig = unpack("V", $buffer) ; return $sig == ZIP_LOCAL_HDR_SIG ; } sub _readFullZipHeader($) { my ($self) = @_ ; my $magic = '' ; $self->smartReadExact(\$magic, 4); *$self->{HeaderPending} = $magic ; return $self->HeaderError("Minimum header size is " . 30 . " bytes") if length $magic != 4 ; return $self->HeaderError("Bad Magic") if ! _isZipMagic($magic) ; my $status = $self->_readZipHeader($magic); delete *$self->{Transparent} if ! defined $status ; return $status ; } sub _readZipHeader($) { my ($self, $magic) = @_ ; my ($HeaderCRC) ; my ($buffer) = '' ; $self->smartReadExact(\$buffer, 30 - 4) or return $self->HeaderError("Minimum header size is " . 30 . " bytes") ; my $keep = $magic . $buffer ; *$self->{HeaderPending} = $keep ; my $extractVersion = unpack ("v", substr($buffer, 4-4, 2)); my $gpFlag = unpack ("v", substr($buffer, 6-4, 2)); my $compressedMethod = unpack ("v", substr($buffer, 8-4, 2)); my $lastModTime = unpack ("V", substr($buffer, 10-4, 4)); my $crc32 = unpack ("V", substr($buffer, 14-4, 4)); my $compressedLength = U64::newUnpack_V32 substr($buffer, 18-4, 4); my $uncompressedLength = U64::newUnpack_V32 substr($buffer, 22-4, 4); my $filename_length = unpack ("v", substr($buffer, 26-4, 2)); my $extra_length = unpack ("v", substr($buffer, 28-4, 2)); my $filename; my $extraField; my @EXTRA = (); my $streamingMode = ($gpFlag & ZIP_GP_FLAG_STREAMING_MASK) ? 1 : 0 ; return $self->HeaderError("Encrypted content not supported") if $gpFlag & (ZIP_GP_FLAG_ENCRYPTED_MASK|ZIP_GP_FLAG_STRONG_ENCRYPTED_MASK); return $self->HeaderError("Patch content not supported") if $gpFlag & ZIP_GP_FLAG_PATCHED_MASK; *$self->{ZipData}{Streaming} = $streamingMode; if ($filename_length) { $self->smartReadExact(\$filename, $filename_length) or return $self->TruncatedHeader("Filename"); $keep .= $filename ; } my $zip64 = 0 ; if ($extra_length) { $self->smartReadExact(\$extraField, $extra_length) or return $self->TruncatedHeader("Extra Field"); my $bad = IO::Compress::Zlib::Extra::parseRawExtra($extraField, \@EXTRA, 1, 0); return $self->HeaderError($bad) if defined $bad; $keep .= $extraField ; my %Extra ; for (@EXTRA) { $Extra{$_->[0]} = \$_->[1]; } if (defined $Extra{ZIP_EXTRA_ID_ZIP64()}) { $zip64 = 1 ; my $buff = ${ $Extra{ZIP_EXTRA_ID_ZIP64()} }; # This code assumes that all the fields in the Zip64 # extra field aren't necessarily present. The spec says that # they only exist if the equivalent local headers are -1. if (! $streamingMode) { my $offset = 0 ; if (U64::full32 $uncompressedLength->get32bit() ) { $uncompressedLength = U64::newUnpack_V64 substr($buff, 0, 8); $offset += 8 ; } if (U64::full32 $compressedLength->get32bit() ) { $compressedLength = U64::newUnpack_V64 substr($buff, $offset, 8); $offset += 8 ; } } } } *$self->{ZipData}{Zip64} = $zip64; if (! $streamingMode) { *$self->{ZipData}{Streaming} = 0; *$self->{ZipData}{Crc32} = $crc32; *$self->{ZipData}{CompressedLen} = $compressedLength; *$self->{ZipData}{UnCompressedLen} = $uncompressedLength; *$self->{CompressedInputLengthRemaining} = *$self->{CompressedInputLength} = $compressedLength->get64bit(); } *$self->{ZipData}{CRC32} = Compress::Raw::Zlib::crc32(undef); *$self->{ZipData}{Method} = $compressedMethod; if ($compressedMethod == ZIP_CM_DEFLATE) { *$self->{Type} = 'zip-deflate'; my $obj = IO::Uncompress::Adapter::Inflate::mkUncompObject(1,0,0); *$self->{Uncomp} = $obj; } elsif ($compressedMethod == ZIP_CM_BZIP2) { return $self->HeaderError("Unsupported Compression format $compressedMethod") if ! defined $IO::Uncompress::Adapter::Bunzip2::VERSION ; *$self->{Type} = 'zip-bzip2'; my $obj = IO::Uncompress::Adapter::Bunzip2::mkUncompObject(); *$self->{Uncomp} = $obj; } elsif ($compressedMethod == ZIP_CM_LZMA) { return $self->HeaderError("Unsupported Compression format $compressedMethod") if ! defined $IO::Uncompress::Adapter::UnLzma::VERSION ; *$self->{Type} = 'zip-lzma'; my $LzmaHeader; $self->smartReadExact(\$LzmaHeader, 4) or return $self->saveErrorString(undef, "Truncated file"); my ($verHi, $verLo) = unpack ("CC", substr($LzmaHeader, 0, 2)); my $LzmaPropertiesSize = unpack ("v", substr($LzmaHeader, 2, 2)); my $LzmaPropertyData; $self->smartReadExact(\$LzmaPropertyData, $LzmaPropertiesSize) or return $self->saveErrorString(undef, "Truncated file"); if (! $streamingMode) { *$self->{ZipData}{CompressedLen}->subtract(4 + $LzmaPropertiesSize) ; *$self->{CompressedInputLengthRemaining} = *$self->{CompressedInputLength} = *$self->{ZipData}{CompressedLen}->get64bit(); } my $obj = IO::Uncompress::Adapter::UnLzma::mkUncompZipObject($LzmaPropertyData); *$self->{Uncomp} = $obj; } elsif ($compressedMethod == ZIP_CM_STORE) { *$self->{Type} = 'zip-stored'; my $obj = IO::Uncompress::Adapter::Identity::mkUncompObject($streamingMode, $zip64); *$self->{Uncomp} = $obj; } else { return $self->HeaderError("Unsupported Compression format $compressedMethod"); } return { 'Type' => 'zip', 'FingerprintLength' => 4, #'HeaderLength' => $compressedMethod == 8 ? length $keep : 0, 'HeaderLength' => length $keep, 'Zip64' => $zip64, 'TrailerLength' => ! $streamingMode ? 0 : $zip64 ? 24 : 16, 'Header' => $keep, 'CompressedLength' => $compressedLength , 'UncompressedLength' => $uncompressedLength , 'CRC32' => $crc32 , 'Name' => $filename, 'Time' => _dosToUnixTime($lastModTime), 'Stream' => $streamingMode, 'MethodID' => $compressedMethod, 'MethodName' => $compressedMethod == ZIP_CM_DEFLATE ? "Deflated" : $compressedMethod == ZIP_CM_BZIP2 ? "Bzip2" : $compressedMethod == ZIP_CM_LZMA ? "Lzma" : $compressedMethod == ZIP_CM_STORE ? "Stored" : "Unknown" , # 'TextFlag' => $flag & GZIP_FLG_FTEXT ? 1 : 0, # 'HeaderCRCFlag' => $flag & GZIP_FLG_FHCRC ? 1 : 0, # 'NameFlag' => $flag & GZIP_FLG_FNAME ? 1 : 0, # 'CommentFlag' => $flag & GZIP_FLG_FCOMMENT ? 1 : 0, # 'ExtraFlag' => $flag & GZIP_FLG_FEXTRA ? 1 : 0, # 'Comment' => $comment, # 'OsID' => $os, # 'OsName' => defined $GZIP_OS_Names{$os} # ? $GZIP_OS_Names{$os} : "Unknown", # 'HeaderCRC' => $HeaderCRC, # 'Flags' => $flag, # 'ExtraFlags' => $xfl, 'ExtraFieldRaw' => $extraField, 'ExtraField' => [ @EXTRA ], } } sub filterUncompressed { my $self = shift ; if (*$self->{ZipData}{Method} == ZIP_CM_DEFLATE) { *$self->{ZipData}{CRC32} = *$self->{Uncomp}->crc32() ; } else { *$self->{ZipData}{CRC32} = Compress::Raw::Zlib::crc32(${$_[0]}, *$self->{ZipData}{CRC32}, $_[1]); } } # from Archive::Zip & info-zip sub _dosToUnixTime { my $dt = shift; my $year = ( ( $dt >> 25 ) & 0x7f ) + 80; my $mon = ( ( $dt >> 21 ) & 0x0f ) - 1; my $mday = ( ( $dt >> 16 ) & 0x1f ); my $hour = ( ( $dt >> 11 ) & 0x1f ); my $min = ( ( $dt >> 5 ) & 0x3f ); my $sec = ( ( $dt << 1 ) & 0x3e ); use POSIX 'mktime'; my $time_t = mktime( $sec, $min, $hour, $mday, $mon, $year, 0, 0, -1 ); return 0 if ! defined $time_t; return $time_t; } #sub scanCentralDirectory #{ # # Use cases # # 1 32-bit CD # # 2 64-bit CD # # my $self = shift ; # # my @CD = (); # my $offset = $self->findCentralDirectoryOffset(); # # return 0 # if ! defined $offset; # # $self->smarkSeek($offset, 0, SEEK_SET) ; # # # Now walk the Central Directory Records # my $buffer ; # while ($self->smartReadExact(\$buffer, 46) && # unpack("V", $buffer) == ZIP_CENTRAL_HDR_SIG) { # # my $compressedLength = unpack ("V", substr($buffer, 20, 4)); # my $filename_length = unpack ("v", substr($buffer, 28, 2)); # my $extra_length = unpack ("v", substr($buffer, 30, 2)); # my $comment_length = unpack ("v", substr($buffer, 32, 2)); # # $self->smarkSeek($filename_length + $extra_length + $comment_length, 0, SEEK_CUR) # if $extra_length || $comment_length || $filename_length; # push @CD, $compressedLength ; # } # #} # #sub findCentralDirectoryOffset #{ # my $self = shift ; # # # Most common use-case is where there is no comment, so # # know exactly where the end of central directory record # # should be. # # $self->smarkSeek(-22, 0, SEEK_END) ; # # my $buffer; # $self->smartReadExact(\$buffer, 22) ; # # my $zip64 = 0; # my $centralDirOffset ; # if ( unpack("V", $buffer) == ZIP_END_CENTRAL_HDR_SIG ) { # $centralDirOffset = unpack ("V", substr($buffer, 16, 2)); # } # else { # die "xxxx"; # } # # return $centralDirOffset ; #} # #sub is84BitCD #{ # # TODO # my $self = shift ; #} sub skip { my $self = shift; my $size = shift; use Fcntl qw(SEEK_CUR); if (ref $size eq 'U64') { $self->smartSeek($size->get64bit(), SEEK_CUR); } else { $self->smartSeek($size, SEEK_CUR); } } sub scanCentralDirectory { my $self = shift; my $here = $self->tell(); # Use cases # 1 32-bit CD # 2 64-bit CD my @CD = (); my $offset = $self->findCentralDirectoryOffset(); return () if ! defined $offset; $self->smarkSeek($offset, 0, SEEK_SET) ; # Now walk the Central Directory Records my $buffer ; while ($self->smartReadExact(\$buffer, 46) && unpack("V", $buffer) == ZIP_CENTRAL_HDR_SIG) { my $compressedLength = unpack("V", substr($buffer, 20, 4)); my $uncompressedLength = unpack("V", substr($buffer, 24, 4)); my $filename_length = unpack("v", substr($buffer, 28, 2)); my $extra_length = unpack("v", substr($buffer, 30, 2)); my $comment_length = unpack("v", substr($buffer, 32, 2)); $self->skip($filename_length ) ; my $v64 = new U64 $compressedLength ; if (U64::full32 $compressedLength ) { $self->smartReadExact(\$buffer, $extra_length) ; die "xxx $offset $comment_length $filename_length $extra_length" . length($buffer) if length($buffer) != $extra_length; my $got = $self->get64Extra($buffer, U64::full32 $uncompressedLength); # If not Zip64 extra field, assume size is 0xFFFFFFFF $v64 = $got if defined $got; } else { $self->skip($extra_length) ; } $self->skip($comment_length ) ; push @CD, $v64 ; } $self->smartSeek($here, 0, SEEK_SET) ; return @CD; } sub get64Extra { my $self = shift ; my $buffer = shift; my $is_uncomp = shift ; my $extra = IO::Compress::Zlib::Extra::findID(0x0001, $buffer); if (! defined $extra) { return undef; } else { my $u64 = U64::newUnpack_V64(substr($extra, $is_uncomp ? 8 : 0)) ; return $u64; } } sub offsetFromZip64 { my $self = shift ; my $here = shift; $self->smartSeek($here - 20, 0, SEEK_SET) or die "xx $!" ; my $buffer; my $got = 0; $self->smartReadExact(\$buffer, 20) or die "xxx $here $got $!" ; if ( unpack("V", $buffer) == ZIP64_END_CENTRAL_LOC_HDR_SIG ) { my $cd64 = U64::Value_VV64 substr($buffer, 8, 8); $self->smartSeek($cd64, 0, SEEK_SET) ; $self->smartReadExact(\$buffer, 4) or die "xxx" ; if ( unpack("V", $buffer) == ZIP64_END_CENTRAL_REC_HDR_SIG ) { $self->smartReadExact(\$buffer, 8) or die "xxx" ; my $size = U64::Value_VV64($buffer); $self->smartReadExact(\$buffer, $size) or die "xxx" ; my $cd64 = U64::Value_VV64 substr($buffer, 36, 8); return $cd64 ; } die "zzz"; } die "zzz"; } use constant Pack_ZIP_END_CENTRAL_HDR_SIG => pack("V", ZIP_END_CENTRAL_HDR_SIG); sub findCentralDirectoryOffset { my $self = shift ; # Most common use-case is where there is no comment, so # know exactly where the end of central directory record # should be. $self->smartSeek(-22, 0, SEEK_END) ; my $here = $self->tell(); my $buffer; $self->smartReadExact(\$buffer, 22) or die "xxx" ; my $zip64 = 0; my $centralDirOffset ; if ( unpack("V", $buffer) == ZIP_END_CENTRAL_HDR_SIG ) { $centralDirOffset = unpack("V", substr($buffer, 16, 4)); } else { $self->smartSeek(0, 0, SEEK_END) ; my $fileLen = $self->tell(); my $want = 0 ; while(1) { $want += 1024; my $seekTo = $fileLen - $want; if ($seekTo < 0 ) { $seekTo = 0; $want = $fileLen ; } $self->smartSeek( $seekTo, 0, SEEK_SET) or die "xxx $!" ; my $got; $self->smartReadExact($buffer, $want) or die "xxx " ; my $pos = rindex( $buffer, Pack_ZIP_END_CENTRAL_HDR_SIG); if ($pos >= 0) { #$here = $self->tell(); $here = $seekTo + $pos ; $centralDirOffset = unpack("V", substr($buffer, $pos + 16, 4)); last ; } return undef if $want == $fileLen; } } $centralDirOffset = $self->offsetFromZip64($here) if U64::full32 $centralDirOffset ; return $centralDirOffset ; } 1; __END__ =head1 NAME IO::Uncompress::Unzip - Read zip files/buffers =head1 SYNOPSIS use IO::Uncompress::Unzip qw(unzip $UnzipError) ; my $status = unzip $input => $output [,OPTS] or die "unzip failed: $UnzipError\n"; my $z = new IO::Uncompress::Unzip $input [OPTS] or die "unzip failed: $UnzipError\n"; $status = $z->read($buffer) $status = $z->read($buffer, $length) $status = $z->read($buffer, $length, $offset) $line = $z->getline() $char = $z->getc() $char = $z->ungetc() $char = $z->opened() $status = $z->inflateSync() $data = $z->trailingData() $status = $z->nextStream() $data = $z->getHeaderInfo() $z->tell() $z->seek($position, $whence) $z->binmode() $z->fileno() $z->eof() $z->close() $UnzipError ; # IO::File mode <$z> read($z, $buffer); read($z, $buffer, $length); read($z, $buffer, $length, $offset); tell($z) seek($z, $position, $whence) binmode($z) fileno($z) eof($z) close($z) =head1 DESCRIPTION This module provides a Perl interface that allows the reading of zlib files/buffers. For writing zip files/buffers, see the companion module IO::Compress::Zip. =head1 Functional Interface A top-level function, C, is provided to carry out "one-shot" uncompression between buffers and/or files. For finer control over the uncompression process, see the L section. use IO::Uncompress::Unzip qw(unzip $UnzipError) ; unzip $input_filename_or_reference => $output_filename_or_reference [,OPTS] or die "unzip failed: $UnzipError\n"; The functional interface needs Perl5.005 or better. =head2 unzip $input_filename_or_reference => $output_filename_or_reference [, OPTS] C expects at least two parameters, C<$input_filename_or_reference> and C<$output_filename_or_reference>. =head3 The C<$input_filename_or_reference> parameter The parameter, C<$input_filename_or_reference>, is used to define the source of the compressed data. It can take one of the following forms: =over 5 =item A filename If the <$input_filename_or_reference> parameter is a simple scalar, it is assumed to be a filename. This file will be opened for reading and the input data will be read from it. =item A filehandle If the C<$input_filename_or_reference> parameter is a filehandle, the input data will be read from it. The string '-' can be used as an alias for standard input. =item A scalar reference If C<$input_filename_or_reference> is a scalar reference, the input data will be read from C<$$input_filename_or_reference>. =item An array reference If C<$input_filename_or_reference> is an array reference, each element in the array must be a filename. The input data will be read from each file in turn. The complete array will be walked to ensure that it only contains valid filenames before any data is uncompressed. =item An Input FileGlob string If C<$input_filename_or_reference> is a string that is delimited by the characters "<" and ">" C will assume that it is an I. The input is the list of files that match the fileglob. See L for more details. =back If the C<$input_filename_or_reference> parameter is any other type, C will be returned. =head3 The C<$output_filename_or_reference> parameter The parameter C<$output_filename_or_reference> is used to control the destination of the uncompressed data. This parameter can take one of these forms. =over 5 =item A filename If the C<$output_filename_or_reference> parameter is a simple scalar, it is assumed to be a filename. This file will be opened for writing and the uncompressed data will be written to it. =item A filehandle If the C<$output_filename_or_reference> parameter is a filehandle, the uncompressed data will be written to it. The string '-' can be used as an alias for standard output. =item A scalar reference If C<$output_filename_or_reference> is a scalar reference, the uncompressed data will be stored in C<$$output_filename_or_reference>. =item An Array Reference If C<$output_filename_or_reference> is an array reference, the uncompressed data will be pushed onto the array. =item An Output FileGlob If C<$output_filename_or_reference> is a string that is delimited by the characters "<" and ">" C will assume that it is an I. The output is the list of files that match the fileglob. When C<$output_filename_or_reference> is an fileglob string, C<$input_filename_or_reference> must also be a fileglob string. Anything else is an error. See L for more details. =back If the C<$output_filename_or_reference> parameter is any other type, C will be returned. =head2 Notes When C<$input_filename_or_reference> maps to multiple compressed files/buffers and C<$output_filename_or_reference> is a single file/buffer, after uncompression C<$output_filename_or_reference> will contain a concatenation of all the uncompressed data from each of the input files/buffers. =head2 Optional Parameters Unless specified below, the optional parameters for C, C, are the same as those used with the OO interface defined in the L section below. =over 5 =item C<< AutoClose => 0|1 >> This option applies to any input or output data streams to C that are filehandles. If C is specified, and the value is true, it will result in all input and/or output filehandles being closed once C has completed. This parameter defaults to 0. =item C<< BinModeOut => 0|1 >> When writing to a file or filehandle, set C before writing to the file. Defaults to 0. =item C<< Append => 0|1 >> The behaviour of this option is dependent on the type of output data stream. =over 5 =item * A Buffer If C is enabled, all uncompressed data will be append to the end of the output buffer. Otherwise the output buffer will be cleared before any uncompressed data is written to it. =item * A Filename If C is enabled, the file will be opened in append mode. Otherwise the contents of the file, if any, will be truncated before any uncompressed data is written to it. =item * A Filehandle If C is enabled, the filehandle will be positioned to the end of the file via a call to C before any uncompressed data is written to it. Otherwise the file pointer will not be moved. =back When C is specified, and set to true, it will I all uncompressed data to the output data stream. So when the output is a filehandle it will carry out a seek to the eof before writing any uncompressed data. If the output is a filename, it will be opened for appending. If the output is a buffer, all uncompressed data will be appended to the existing buffer. Conversely when C is not specified, or it is present and is set to false, it will operate as follows. When the output is a filename, it will truncate the contents of the file before writing any uncompressed data. If the output is a filehandle its position will not be changed. If the output is a buffer, it will be wiped before any uncompressed data is output. Defaults to 0. =item C<< MultiStream => 0|1 >> If the input file/buffer contains multiple compressed data streams, this option will uncompress the whole lot as a single data stream. Defaults to 0. =item C<< TrailingData => $scalar >> Returns the data, if any, that is present immediately after the compressed data stream once uncompression is complete. This option can be used when there is useful information immediately following the compressed data stream, and you don't know the length of the compressed data stream. If the input is a buffer, C will return everything from the end of the compressed data stream to the end of the buffer. If the input is a filehandle, C will return the data that is left in the filehandle input buffer once the end of the compressed data stream has been reached. You can then use the filehandle to read the rest of the input file. Don't bother using C if the input is a filename. If you know the length of the compressed data stream before you start uncompressing, you can avoid having to use C by setting the C option. =back =head2 Examples Say you have a zip file, C, that only contains a single member, you can read it and write the uncompressed data to the file C like this. use strict ; use warnings ; use IO::Uncompress::Unzip qw(unzip $UnzipError) ; my $input = "file1.zip"; my $output = "file1.txt"; unzip $input => $output or die "unzip failed: $UnzipError\n"; If you have a zip file that contains multiple members and want to read a specific member from the file, say C<"data1">, use the C option use strict ; use warnings ; use IO::Uncompress::Unzip qw(unzip $UnzipError) ; my $input = "file1.zip"; my $output = "file1.txt"; unzip $input => $output, Name => "data1" or die "unzip failed: $UnzipError\n"; Alternatively, if you want to read the C<"data1"> member into memory, use a scalar reference for the C parameter. use strict ; use warnings ; use IO::Uncompress::Unzip qw(unzip $UnzipError) ; my $input = "file1.zip"; my $output ; unzip $input => \$output, Name => "data1" or die "unzip failed: $UnzipError\n"; # $output now contains the uncompressed data To read from an existing Perl filehandle, C<$input>, and write the uncompressed data to a buffer, C<$buffer>. use strict ; use warnings ; use IO::Uncompress::Unzip qw(unzip $UnzipError) ; use IO::File ; my $input = new IO::File " \$buffer or die "unzip failed: $UnzipError\n"; =head1 OO Interface =head2 Constructor The format of the constructor for IO::Uncompress::Unzip is shown below my $z = new IO::Uncompress::Unzip $input [OPTS] or die "IO::Uncompress::Unzip failed: $UnzipError\n"; Returns an C object on success and undef on failure. The variable C<$UnzipError> will contain an error message on failure. If you are running Perl 5.005 or better the object, C<$z>, returned from IO::Uncompress::Unzip can be used exactly like an L filehandle. This means that all normal input file operations can be carried out with C<$z>. For example, to read a line from a compressed file/buffer you can use either of these forms $line = $z->getline(); $line = <$z>; The mandatory parameter C<$input> is used to determine the source of the compressed data. This parameter can take one of three forms. =over 5 =item A filename If the C<$input> parameter is a scalar, it is assumed to be a filename. This file will be opened for reading and the compressed data will be read from it. =item A filehandle If the C<$input> parameter is a filehandle, the compressed data will be read from it. The string '-' can be used as an alias for standard input. =item A scalar reference If C<$input> is a scalar reference, the compressed data will be read from C<$$input>. =back =head2 Constructor Options The option names defined below are case insensitive and can be optionally prefixed by a '-'. So all of the following are valid -AutoClose -autoclose AUTOCLOSE autoclose OPTS is a combination of the following options: =over 5 =item C<< Name => "membername" >> Open "membername" from the zip file for reading. =item C<< AutoClose => 0|1 >> This option is only valid when the C<$input> parameter is a filehandle. If specified, and the value is true, it will result in the file being closed once either the C method is called or the IO::Uncompress::Unzip object is destroyed. This parameter defaults to 0. =item C<< MultiStream => 0|1 >> Treats the complete zip file/buffer as a single compressed data stream. When reading in multi-stream mode each member of the zip file/buffer will be uncompressed in turn until the end of the file/buffer is encountered. This parameter defaults to 0. =item C<< Prime => $string >> This option will uncompress the contents of C<$string> before processing the input file/buffer. This option can be useful when the compressed data is embedded in another file/data structure and it is not possible to work out where the compressed data begins without having to read the first few bytes. If this is the case, the uncompression can be I with these bytes using this option. =item C<< Transparent => 0|1 >> If this option is set and the input file/buffer is not compressed data, the module will allow reading of it anyway. In addition, if the input file/buffer does contain compressed data and there is non-compressed data immediately following it, setting this option will make this module treat the whole file/buffer as a single data stream. This option defaults to 1. =item C<< BlockSize => $num >> When reading the compressed input data, IO::Uncompress::Unzip will read it in blocks of C<$num> bytes. This option defaults to 4096. =item C<< InputLength => $size >> When present this option will limit the number of compressed bytes read from the input file/buffer to C<$size>. This option can be used in the situation where there is useful data directly after the compressed data stream and you know beforehand the exact length of the compressed data stream. This option is mostly used when reading from a filehandle, in which case the file pointer will be left pointing to the first byte directly after the compressed data stream. This option defaults to off. =item C<< Append => 0|1 >> This option controls what the C method does with uncompressed data. If set to 1, all uncompressed data will be appended to the output parameter of the C method. If set to 0, the contents of the output parameter of the C method will be overwritten by the uncompressed data. Defaults to 0. =item C<< Strict => 0|1 >> This option controls whether the extra checks defined below are used when carrying out the decompression. When Strict is on, the extra tests are carried out, when Strict is off they are not. The default for this option is off. =back =head2 Examples TODO =head1 Methods =head2 read Usage is $status = $z->read($buffer) Reads a block of compressed data (the size of the compressed block is determined by the C option in the constructor), uncompresses it and writes any uncompressed data into C<$buffer>. If the C parameter is set in the constructor, the uncompressed data will be appended to the C<$buffer> parameter. Otherwise C<$buffer> will be overwritten. Returns the number of uncompressed bytes written to C<$buffer>, zero if eof or a negative number on error. =head2 read Usage is $status = $z->read($buffer, $length) $status = $z->read($buffer, $length, $offset) $status = read($z, $buffer, $length) $status = read($z, $buffer, $length, $offset) Attempt to read C<$length> bytes of uncompressed data into C<$buffer>. The main difference between this form of the C method and the previous one, is that this one will attempt to return I C<$length> bytes. The only circumstances that this function will not is if end-of-file or an IO error is encountered. Returns the number of uncompressed bytes written to C<$buffer>, zero if eof or a negative number on error. =head2 getline Usage is $line = $z->getline() $line = <$z> Reads a single line. This method fully supports the use of the variable C<$/> (or C<$INPUT_RECORD_SEPARATOR> or C<$RS> when C is in use) to determine what constitutes an end of line. Paragraph mode, record mode and file slurp mode are all supported. =head2 getc Usage is $char = $z->getc() Read a single character. =head2 ungetc Usage is $char = $z->ungetc($string) =head2 inflateSync Usage is $status = $z->inflateSync() TODO =head2 getHeaderInfo Usage is $hdr = $z->getHeaderInfo(); @hdrs = $z->getHeaderInfo(); This method returns either a hash reference (in scalar context) or a list or hash references (in array context) that contains information about each of the header fields in the compressed data stream(s). =head2 tell Usage is $z->tell() tell $z Returns the uncompressed file offset. =head2 eof Usage is $z->eof(); eof($z); Returns true if the end of the compressed input stream has been reached. =head2 seek $z->seek($position, $whence); seek($z, $position, $whence); Provides a sub-set of the C functionality, with the restriction that it is only legal to seek forward in the input file/buffer. It is a fatal error to attempt to seek backward. Note that the implementation of C in this module does not provide true random access to a compressed file/buffer. It works by uncompressing data from the current offset in the file/buffer until it reaches the uncompressed offset specified in the parameters to C. For very small files this may be acceptable behaviour. For large files it may cause an unacceptable delay. The C<$whence> parameter takes one the usual values, namely SEEK_SET, SEEK_CUR or SEEK_END. Returns 1 on success, 0 on failure. =head2 binmode Usage is $z->binmode binmode $z ; This is a noop provided for completeness. =head2 opened $z->opened() Returns true if the object currently refers to a opened file/buffer. =head2 autoflush my $prev = $z->autoflush() my $prev = $z->autoflush(EXPR) If the C<$z> object is associated with a file or a filehandle, this method returns the current autoflush setting for the underlying filehandle. If C is present, and is non-zero, it will enable flushing after every write/print operation. If C<$z> is associated with a buffer, this method has no effect and always returns C. B that the special variable C<$|> B be used to set or retrieve the autoflush setting. =head2 input_line_number $z->input_line_number() $z->input_line_number(EXPR) Returns the current uncompressed line number. If C is present it has the effect of setting the line number. Note that setting the line number does not change the current position within the file/buffer being read. The contents of C<$/> are used to determine what constitutes a line terminator. =head2 fileno $z->fileno() fileno($z) If the C<$z> object is associated with a file or a filehandle, C will return the underlying file descriptor. Once the C method is called C will return C. If the C<$z> object is associated with a buffer, this method will return C. =head2 close $z->close() ; close $z ; Closes the output file/buffer. For most versions of Perl this method will be automatically invoked if the IO::Uncompress::Unzip object is destroyed (either explicitly or by the variable with the reference to the object going out of scope). The exceptions are Perl versions 5.005 through 5.00504 and 5.8.0. In these cases, the C method will be called automatically, but not until global destruction of all live objects when the program is terminating. Therefore, if you want your scripts to be able to run on all versions of Perl, you should call C explicitly and not rely on automatic closing. Returns true on success, otherwise 0. If the C option has been enabled when the IO::Uncompress::Unzip object was created, and the object is associated with a file, the underlying file will also be closed. =head2 nextStream Usage is my $status = $z->nextStream(); Skips to the next compressed data stream in the input file/buffer. If a new compressed data stream is found, the eof marker will be cleared and C<$.> will be reset to 0. Returns 1 if a new stream was found, 0 if none was found, and -1 if an error was encountered. =head2 trailingData Usage is my $data = $z->trailingData(); Returns the data, if any, that is present immediately after the compressed data stream once uncompression is complete. It only makes sense to call this method once the end of the compressed data stream has been encountered. This option can be used when there is useful information immediately following the compressed data stream, and you don't know the length of the compressed data stream. If the input is a buffer, C will return everything from the end of the compressed data stream to the end of the buffer. If the input is a filehandle, C will return the data that is left in the filehandle input buffer once the end of the compressed data stream has been reached. You can then use the filehandle to read the rest of the input file. Don't bother using C if the input is a filename. If you know the length of the compressed data stream before you start uncompressing, you can avoid having to use C by setting the C option in the constructor. =head1 Importing No symbolic constants are required by this IO::Uncompress::Unzip at present. =over 5 =item :all Imports C and C<$UnzipError>. Same as doing this use IO::Uncompress::Unzip qw(unzip $UnzipError) ; =back =head1 EXAMPLES =head2 Working with Net::FTP See L =head2 Walking through a zip file The code below can be used to traverse a zip file, one compressed data stream at a time. use IO::Uncompress::Unzip qw($UnzipError); my $zipfile = "somefile.zip"; my $u = new IO::Uncompress::Unzip $zipfile or die "Cannot open $zipfile: $UnzipError"; my $status; for ($status = 1; $status > 0; $status = $u->nextStream()) { my $name = $u->getHeaderInfo()->{Name}; warn "Processing member $name\n" ; my $buff; while (($status = $u->read($buff)) > 0) { # Do something here } last if $status < 0; } die "Error processing $zipfile: $!\n" if $status < 0 ; Each individual compressed data stream is read until the logical end-of-file is reached. Then C is called. This will skip to the start of the next compressed data stream and clear the end-of-file flag. It is also worth noting that C can be called at any time -- you don't have to wait until you have exhausted a compressed data stream before skipping to the next one. =head2 Unzipping a complete zip file to disk Daniel S. Sterling has written a script that uses C to read a zip file and unzip its contents to disk. The script is available from L =head1 SEE ALSO L, L, L, L, L, L, L, L, L, L, L, L, L, L, L, L, L, L, L L L, L, L, L For RFC 1950, 1951 and 1952 see L, L and L The I compression library was written by Jean-loup Gailly C and Mark Adler C. The primary site for the I compression library is L. The primary site for gzip is L. =head1 AUTHOR This module was written by Paul Marquess, C. =head1 MODIFICATION HISTORY See the Changes file. =head1 COPYRIGHT AND LICENSE Copyright (c) 2005-2017 Paul Marquess. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. darwin-perl-lib/IO/Uncompress/Adapter/Bunzip2.pm000444 000765 000024 00000003772 13167163507 023707 0ustar00ocsinventorystaff000000 000000 package IO::Uncompress::Adapter::Bunzip2; use strict; use warnings; use bytes; use IO::Compress::Base::Common 2.074 qw(:Status); use Compress::Raw::Bzip2 2.074 ; our ($VERSION, @ISA); $VERSION = '2.074'; sub mkUncompObject { my $small = shift || 0; my $verbosity = shift || 0; my ($inflate, $status) = new Compress::Raw::Bunzip2(1, 1, $small, $verbosity, 1); return (undef, "Could not create Inflation object: $status", $status) if $status != BZ_OK ; return bless {'Inf' => $inflate, 'CompSize' => 0, 'UnCompSize' => 0, 'Error' => '', 'ConsumesInput' => 1, } ; } sub uncompr { my $self = shift ; my $from = shift ; my $to = shift ; my $eof = shift ; my $inf = $self->{Inf}; my $status = $inf->bzinflate($from, $to); $self->{ErrorNo} = $status; if ($status != BZ_OK && $status != BZ_STREAM_END ) { $self->{Error} = "Inflation Error: $status"; return STATUS_ERROR; } return STATUS_OK if $status == BZ_OK ; return STATUS_ENDSTREAM if $status == BZ_STREAM_END ; return STATUS_ERROR ; } sub reset { my $self = shift ; my ($inf, $status) = new Compress::Raw::Bunzip2(); $self->{ErrorNo} = ($status == BZ_OK) ? 0 : $status ; if ($status != BZ_OK) { $self->{Error} = "Cannot create Inflate object: $status"; return STATUS_ERROR; } $self->{Inf} = $inf; return STATUS_OK ; } sub compressedBytes { my $self = shift ; $self->{Inf}->compressedBytes(); } sub uncompressedBytes { my $self = shift ; $self->{Inf}->uncompressedBytes(); } sub crc32 { my $self = shift ; #$self->{Inf}->crc32(); } sub adler32 { my $self = shift ; #$self->{Inf}->adler32(); } sub sync { my $self = shift ; #( $self->{Inf}->inflateSync(@_) == BZ_OK) # ? STATUS_OK # : STATUS_ERROR ; } 1; __END__ darwin-perl-lib/IO/Uncompress/Adapter/Identity.pm000555 000765 000024 00000010747 13167163507 024152 0ustar00ocsinventorystaff000000 000000 package IO::Uncompress::Adapter::Identity; use warnings; use strict; use bytes; use IO::Compress::Base::Common 2.074 qw(:Status); use IO::Compress::Zip::Constants ; our ($VERSION); $VERSION = '2.074'; use Compress::Raw::Zlib 2.074 (); sub mkUncompObject { my $streaming = shift; my $zip64 = shift; my $crc32 = 1; #shift ; my $adler32 = shift; bless { 'CompSize' => new U64 , # 0, 'UnCompSize' => 0, 'wantCRC32' => $crc32, 'CRC32' => Compress::Raw::Zlib::crc32(''), 'wantADLER32'=> $adler32, 'ADLER32' => Compress::Raw::Zlib::adler32(''), 'ConsumesInput' => 1, 'Streaming' => $streaming, 'Zip64' => $zip64, 'DataHdrSize' => $zip64 ? 24 : 16, 'Pending' => '', } ; } sub uncompr { my $self = shift; my $in = $_[0]; my $eof = $_[2]; my $len = length $$in; my $remainder = ''; if (defined $$in && $len) { if ($self->{Streaming}) { if (length $self->{Pending}) { $$in = $self->{Pending} . $$in ; $len = length $$in; $self->{Pending} = ''; } my $ind = index($$in, "\x50\x4b\x07\x08"); if ($ind < 0) { $len = length $$in; if ($len >= 3 && substr($$in, -3) eq "\x50\x4b\x07") { $ind = $len - 3 ; } elsif ($len >= 2 && substr($$in, -2) eq "\x50\x4b") { $ind = $len - 2 ; } elsif ($len >= 1 && substr($$in, -1) eq "\x50") { $ind = $len - 1 ; } } if ($ind >= 0) { $remainder = substr($$in, $ind) ; substr($$in, $ind) = '' ; } } if (length $remainder && length $remainder < $self->{DataHdrSize}) { $self->{Pending} = $remainder ; $remainder = ''; } elsif (length $remainder >= $self->{DataHdrSize}) { my $crc = unpack "V", substr($remainder, 4); if ($crc == Compress::Raw::Zlib::crc32($$in, $self->{CRC32})) { my ($l1, $l2) ; if ($self->{Zip64}) { $l1 = U64::newUnpack_V64(substr($remainder, 8)); $l2 = U64::newUnpack_V64(substr($remainder, 16)); } else { $l1 = U64::newUnpack_V32(substr($remainder, 8)); $l2 = U64::newUnpack_V32(substr($remainder, 12)); } my $newLen = $self->{CompSize}->clone(); $newLen->add(length $$in); if ($l1->equal($l2) && $l1->equal($newLen) ) { $eof = 1; } else { $$in .= substr($remainder, 0, 4) ; $remainder = substr($remainder, 4); #$self->{Pending} = substr($remainder, 4); #$remainder = ''; $eof = 0; } } else { $$in .= substr($remainder, 0, 4) ; $remainder = substr($remainder, 4); #$self->{Pending} = substr($remainder, 4); #$remainder = ''; $eof = 0; } } if (length $$in) { $self->{CompSize}->add(length $$in) ; $self->{CRC32} = Compress::Raw::Zlib::crc32($$in, $self->{CRC32}) if $self->{wantCRC32}; $self->{ADLER32} = Compress::Zlib::adler32($$in, $self->{ADLER32}) if $self->{wantADLER32}; } ${ $_[1] } .= $$in; $$in = $remainder; } return STATUS_ENDSTREAM if $eof; return STATUS_OK ; } sub reset { my $self = shift; $self->{CompSize} = 0; $self->{UnCompSize} = 0; $self->{CRC32} = Compress::Raw::Zlib::crc32(''); $self->{ADLER32} = Compress::Raw::Zlib::adler32(''); return STATUS_OK ; } #sub count #{ # my $self = shift ; # return $self->{UnCompSize} ; #} sub compressedBytes { my $self = shift ; return $self->{CompSize} ; } sub uncompressedBytes { my $self = shift ; return $self->{CompSize} ; } sub sync { return STATUS_OK ; } sub crc32 { my $self = shift ; return $self->{CRC32}; } sub adler32 { my $self = shift ; return $self->{ADLER32}; } 1; __END__ darwin-perl-lib/IO/Uncompress/Adapter/Inflate.pm000444 000765 000024 00000006317 13167163507 023736 0ustar00ocsinventorystaff000000 000000 package IO::Uncompress::Adapter::Inflate; use strict; use warnings; use bytes; use IO::Compress::Base::Common 2.074 qw(:Status); use Compress::Raw::Zlib 2.074 qw(Z_OK Z_BUF_ERROR Z_STREAM_END Z_FINISH MAX_WBITS); our ($VERSION); $VERSION = '2.074'; sub mkUncompObject { my $crc32 = shift || 1; my $adler32 = shift || 1; my $scan = shift || 0; my $inflate ; my $status ; if ($scan) { ($inflate, $status) = new Compress::Raw::Zlib::InflateScan #LimitOutput => 1, CRC32 => $crc32, ADLER32 => $adler32, WindowBits => - MAX_WBITS ; } else { ($inflate, $status) = new Compress::Raw::Zlib::Inflate AppendOutput => 1, LimitOutput => 1, CRC32 => $crc32, ADLER32 => $adler32, WindowBits => - MAX_WBITS ; } return (undef, "Could not create Inflation object: $status", $status) if $status != Z_OK ; return bless {'Inf' => $inflate, 'CompSize' => 0, 'UnCompSize' => 0, 'Error' => '', 'ConsumesInput' => 1, } ; } sub uncompr { my $self = shift ; my $from = shift ; my $to = shift ; my $eof = shift ; my $inf = $self->{Inf}; my $status = $inf->inflate($from, $to, $eof); $self->{ErrorNo} = $status; if ($status != Z_OK && $status != Z_STREAM_END && $status != Z_BUF_ERROR) { $self->{Error} = "Inflation Error: $status"; return STATUS_ERROR; } return STATUS_OK if $status == Z_BUF_ERROR ; # ??? return STATUS_OK if $status == Z_OK ; return STATUS_ENDSTREAM if $status == Z_STREAM_END ; return STATUS_ERROR ; } sub reset { my $self = shift ; $self->{Inf}->inflateReset(); return STATUS_OK ; } #sub count #{ # my $self = shift ; # $self->{Inf}->inflateCount(); #} sub crc32 { my $self = shift ; $self->{Inf}->crc32(); } sub compressedBytes { my $self = shift ; $self->{Inf}->compressedBytes(); } sub uncompressedBytes { my $self = shift ; $self->{Inf}->uncompressedBytes(); } sub adler32 { my $self = shift ; $self->{Inf}->adler32(); } sub sync { my $self = shift ; ( $self->{Inf}->inflateSync(@_) == Z_OK) ? STATUS_OK : STATUS_ERROR ; } sub getLastBlockOffset { my $self = shift ; $self->{Inf}->getLastBlockOffset(); } sub getEndOffset { my $self = shift ; $self->{Inf}->getEndOffset(); } sub resetLastBlockByte { my $self = shift ; $self->{Inf}->resetLastBlockByte(@_); } sub createDeflateStream { my $self = shift ; my $deflate = $self->{Inf}->createDeflateStream(@_); return bless {'Def' => $deflate, 'CompSize' => 0, 'UnCompSize' => 0, 'Error' => '', }, 'IO::Compress::Adapter::Deflate'; } 1; __END__ darwin-perl-lib/IO/Compress/Adapter/000755 000765 000024 00000000000 13167163507 021446 5ustar00ocsinventorystaff000000 000000 darwin-perl-lib/IO/Compress/Base/000755 000765 000024 00000000000 13167163507 020740 5ustar00ocsinventorystaff000000 000000 darwin-perl-lib/IO/Compress/Base.pm000444 000765 000024 00000056420 13167163507 021303 0ustar00ocsinventorystaff000000 000000 package IO::Compress::Base ; require 5.006 ; use strict ; use warnings; use IO::Compress::Base::Common 2.074 ; use IO::File (); ; use Scalar::Util (); #use File::Glob; #require Exporter ; use Carp() ; use Symbol(); #use bytes; our (@ISA, $VERSION); @ISA = qw(IO::File Exporter); $VERSION = '2.074'; #Can't locate object method "SWASHNEW" via package "utf8" (perhaps you forgot to load "utf8"?) at .../ext/Compress-Zlib/Gzip/blib/lib/Compress/Zlib/Common.pm line 16. sub saveStatus { my $self = shift ; ${ *$self->{ErrorNo} } = shift() + 0 ; ${ *$self->{Error} } = '' ; return ${ *$self->{ErrorNo} } ; } sub saveErrorString { my $self = shift ; my $retval = shift ; ${ *$self->{Error} } = shift ; ${ *$self->{ErrorNo} } = shift() + 0 if @_ ; return $retval; } sub croakError { my $self = shift ; $self->saveErrorString(0, $_[0]); Carp::croak $_[0]; } sub closeError { my $self = shift ; my $retval = shift ; my $errno = *$self->{ErrorNo}; my $error = ${ *$self->{Error} }; $self->close(); *$self->{ErrorNo} = $errno ; ${ *$self->{Error} } = $error ; return $retval; } sub error { my $self = shift ; return ${ *$self->{Error} } ; } sub errorNo { my $self = shift ; return ${ *$self->{ErrorNo} } ; } sub writeAt { my $self = shift ; my $offset = shift; my $data = shift; if (defined *$self->{FH}) { my $here = tell(*$self->{FH}); return $self->saveErrorString(undef, "Cannot seek to end of output filehandle: $!", $!) if $here < 0 ; seek(*$self->{FH}, $offset, IO::Handle::SEEK_SET) or return $self->saveErrorString(undef, "Cannot seek to end of output filehandle: $!", $!) ; defined *$self->{FH}->write($data, length $data) or return $self->saveErrorString(undef, $!, $!) ; seek(*$self->{FH}, $here, IO::Handle::SEEK_SET) or return $self->saveErrorString(undef, "Cannot seek to end of output filehandle: $!", $!) ; } else { substr(${ *$self->{Buffer} }, $offset, length($data)) = $data ; } return 1; } sub outputPayload { my $self = shift ; return $self->output(@_); } sub output { my $self = shift ; my $data = shift ; my $last = shift ; return 1 if length $data == 0 && ! $last ; if ( *$self->{FilterContainer} ) { *_ = \$data; &{ *$self->{FilterContainer} }(); } if (length $data) { if ( defined *$self->{FH} ) { defined *$self->{FH}->write( $data, length $data ) or return $self->saveErrorString(0, $!, $!); } else { ${ *$self->{Buffer} } .= $data ; } } return 1; } sub getOneShotParams { return ( 'multistream' => [IO::Compress::Base::Common::Parse_boolean, 1], ); } our %PARAMS = ( # Generic Parameters 'autoclose' => [IO::Compress::Base::Common::Parse_boolean, 0], 'encode' => [IO::Compress::Base::Common::Parse_any, undef], 'strict' => [IO::Compress::Base::Common::Parse_boolean, 1], 'append' => [IO::Compress::Base::Common::Parse_boolean, 0], 'binmodein' => [IO::Compress::Base::Common::Parse_boolean, 0], 'filtercontainer' => [IO::Compress::Base::Common::Parse_code, undef], ); sub checkParams { my $self = shift ; my $class = shift ; my $got = shift || IO::Compress::Base::Parameters::new(); $got->parse( { %PARAMS, $self->getExtraParams(), *$self->{OneShot} ? $self->getOneShotParams() : (), }, @_) or $self->croakError("${class}: " . $got->getError()) ; return $got ; } sub _create { my $obj = shift; my $got = shift; *$obj->{Closed} = 1 ; my $class = ref $obj; $obj->croakError("$class: Missing Output parameter") if ! @_ && ! $got ; my $outValue = shift ; my $oneShot = 1 ; if (! $got) { $oneShot = 0 ; $got = $obj->checkParams($class, undef, @_) or return undef ; } my $lax = ! $got->getValue('strict') ; my $outType = IO::Compress::Base::Common::whatIsOutput($outValue); $obj->ckOutputParam($class, $outValue) or return undef ; if ($outType eq 'buffer') { *$obj->{Buffer} = $outValue; } else { my $buff = "" ; *$obj->{Buffer} = \$buff ; } # Merge implies Append my $merge = $got->getValue('merge') ; my $appendOutput = $got->getValue('append') || $merge ; *$obj->{Append} = $appendOutput; *$obj->{FilterContainer} = $got->getValue('filtercontainer') ; if ($merge) { # Switch off Merge mode if output file/buffer is empty/doesn't exist if (($outType eq 'buffer' && length $$outValue == 0 ) || ($outType ne 'buffer' && (! -e $outValue || (-w _ && -z _))) ) { $merge = 0 } } # If output is a file, check that it is writable #no warnings; #if ($outType eq 'filename' && -e $outValue && ! -w _) # { return $obj->saveErrorString(undef, "Output file '$outValue' is not writable" ) } $obj->ckParams($got) or $obj->croakError("${class}: " . $obj->error()); if ($got->getValue('encode')) { my $want_encoding = $got->getValue('encode'); *$obj->{Encoding} = IO::Compress::Base::Common::getEncoding($obj, $class, $want_encoding); my $x = *$obj->{Encoding}; } else { *$obj->{Encoding} = undef; } $obj->saveStatus(STATUS_OK) ; my $status ; if (! $merge) { *$obj->{Compress} = $obj->mkComp($got) or return undef; *$obj->{UnCompSize} = new U64 ; *$obj->{CompSize} = new U64 ; if ( $outType eq 'buffer') { ${ *$obj->{Buffer} } = '' unless $appendOutput ; } else { if ($outType eq 'handle') { *$obj->{FH} = $outValue ; setBinModeOutput(*$obj->{FH}) ; #$outValue->flush() ; *$obj->{Handle} = 1 ; if ($appendOutput) { seek(*$obj->{FH}, 0, IO::Handle::SEEK_END) or return $obj->saveErrorString(undef, "Cannot seek to end of output filehandle: $!", $!) ; } } elsif ($outType eq 'filename') { no warnings; my $mode = '>' ; $mode = '>>' if $appendOutput; *$obj->{FH} = new IO::File "$mode $outValue" or return $obj->saveErrorString(undef, "cannot open file '$outValue': $!", $!) ; *$obj->{StdIO} = ($outValue eq '-'); setBinModeOutput(*$obj->{FH}) ; } } *$obj->{Header} = $obj->mkHeader($got) ; $obj->output( *$obj->{Header} ) or return undef; $obj->beforePayload(); } else { *$obj->{Compress} = $obj->createMerge($outValue, $outType) or return undef; } *$obj->{Closed} = 0 ; *$obj->{AutoClose} = $got->getValue('autoclose') ; *$obj->{Output} = $outValue; *$obj->{ClassName} = $class; *$obj->{Got} = $got; *$obj->{OneShot} = 0 ; return $obj ; } sub ckOutputParam { my $self = shift ; my $from = shift ; my $outType = IO::Compress::Base::Common::whatIsOutput($_[0]); $self->croakError("$from: output parameter not a filename, filehandle or scalar ref") if ! $outType ; #$self->croakError("$from: output filename is undef or null string") #if $outType eq 'filename' && (! defined $_[0] || $_[0] eq '') ; $self->croakError("$from: output buffer is read-only") if $outType eq 'buffer' && Scalar::Util::readonly(${ $_[0] }); return 1; } sub _def { my $obj = shift ; my $class= (caller)[0] ; my $name = (caller(1))[3] ; $obj->croakError("$name: expected at least 1 parameters\n") unless @_ >= 1 ; my $input = shift ; my $haveOut = @_ ; my $output = shift ; my $x = new IO::Compress::Base::Validator($class, *$obj->{Error}, $name, $input, $output) or return undef ; push @_, $output if $haveOut && $x->{Hash}; *$obj->{OneShot} = 1 ; my $got = $obj->checkParams($name, undef, @_) or return undef ; $x->{Got} = $got ; # if ($x->{Hash}) # { # while (my($k, $v) = each %$input) # { # $v = \$input->{$k} # unless defined $v ; # # $obj->_singleTarget($x, 1, $k, $v, @_) # or return undef ; # } # # return keys %$input ; # } if ($x->{GlobMap}) { $x->{oneInput} = 1 ; foreach my $pair (@{ $x->{Pairs} }) { my ($from, $to) = @$pair ; $obj->_singleTarget($x, 1, $from, $to, @_) or return undef ; } return scalar @{ $x->{Pairs} } ; } if (! $x->{oneOutput} ) { my $inFile = ($x->{inType} eq 'filenames' || $x->{inType} eq 'filename'); $x->{inType} = $inFile ? 'filename' : 'buffer'; foreach my $in ($x->{oneInput} ? $input : @$input) { my $out ; $x->{oneInput} = 1 ; $obj->_singleTarget($x, $inFile, $in, \$out, @_) or return undef ; push @$output, \$out ; #if ($x->{outType} eq 'array') # { push @$output, \$out } #else # { $output->{$in} = \$out } } return 1 ; } # finally the 1 to 1 and n to 1 return $obj->_singleTarget($x, 1, $input, $output, @_); Carp::croak "should not be here" ; } sub _singleTarget { my $obj = shift ; my $x = shift ; my $inputIsFilename = shift; my $input = shift; if ($x->{oneInput}) { $obj->getFileInfo($x->{Got}, $input) if isaScalar($input) || (isaFilename($input) and $inputIsFilename) ; my $z = $obj->_create($x->{Got}, @_) or return undef ; defined $z->_wr2($input, $inputIsFilename) or return $z->closeError(undef) ; return $z->close() ; } else { my $afterFirst = 0 ; my $inputIsFilename = ($x->{inType} ne 'array'); my $keep = $x->{Got}->clone(); #for my $element ( ($x->{inType} eq 'hash') ? keys %$input : @$input) for my $element ( @$input) { my $isFilename = isaFilename($element); if ( $afterFirst ++ ) { defined addInterStream($obj, $element, $isFilename) or return $obj->closeError(undef) ; } else { $obj->getFileInfo($x->{Got}, $element) if isaScalar($element) || $isFilename; $obj->_create($x->{Got}, @_) or return undef ; } defined $obj->_wr2($element, $isFilename) or return $obj->closeError(undef) ; *$obj->{Got} = $keep->clone(); } return $obj->close() ; } } sub _wr2 { my $self = shift ; my $source = shift ; my $inputIsFilename = shift; my $input = $source ; if (! $inputIsFilename) { $input = \$source if ! ref $source; } if ( ref $input && ref $input eq 'SCALAR' ) { return $self->syswrite($input, @_) ; } if ( ! ref $input || isaFilehandle($input)) { my $isFilehandle = isaFilehandle($input) ; my $fh = $input ; if ( ! $isFilehandle ) { $fh = new IO::File "<$input" or return $self->saveErrorString(undef, "cannot open file '$input': $!", $!) ; } binmode $fh if *$self->{Got}->valueOrDefault('binmodein') ; my $status ; my $buff ; my $count = 0 ; while ($status = read($fh, $buff, 16 * 1024)) { $count += length $buff; defined $self->syswrite($buff, @_) or return undef ; } return $self->saveErrorString(undef, $!, $!) if ! defined $status ; if ( (!$isFilehandle || *$self->{AutoClose}) && $input ne '-') { $fh->close() or return undef ; } return $count ; } Carp::croak "Should not be here"; return undef; } sub addInterStream { my $self = shift ; my $input = shift ; my $inputIsFilename = shift ; if (*$self->{Got}->getValue('multistream')) { $self->getFileInfo(*$self->{Got}, $input) #if isaFilename($input) and $inputIsFilename ; if isaScalar($input) || isaFilename($input) ; # TODO -- newStream needs to allow gzip/zip header to be modified return $self->newStream(); } elsif (*$self->{Got}->getValue('autoflush')) { #return $self->flush(Z_FULL_FLUSH); } return 1 ; } sub getFileInfo { } sub TIEHANDLE { return $_[0] if ref($_[0]); die "OOPS\n" ; } sub UNTIE { my $self = shift ; } sub DESTROY { my $self = shift ; local ($., $@, $!, $^E, $?); $self->close() ; # TODO - memory leak with 5.8.0 - this isn't called until # global destruction # %{ *$self } = () ; undef $self ; } sub filterUncompressed { } sub syswrite { my $self = shift ; my $buffer ; if (ref $_[0] ) { $self->croakError( *$self->{ClassName} . "::write: not a scalar reference" ) unless ref $_[0] eq 'SCALAR' ; $buffer = $_[0] ; } else { $buffer = \$_[0] ; } if (@_ > 1) { my $slen = defined $$buffer ? length($$buffer) : 0; my $len = $slen; my $offset = 0; $len = $_[1] if $_[1] < $len; if (@_ > 2) { $offset = $_[2] || 0; $self->croakError(*$self->{ClassName} . "::write: offset outside string") if $offset > $slen; if ($offset < 0) { $offset += $slen; $self->croakError( *$self->{ClassName} . "::write: offset outside string") if $offset < 0; } my $rem = $slen - $offset; $len = $rem if $rem < $len; } $buffer = \substr($$buffer, $offset, $len) ; } return 0 if (! defined $$buffer || length $$buffer == 0) && ! *$self->{FlushPending}; # *$self->{Pending} .= $$buffer ; # # return length $$buffer # if (length *$self->{Pending} < 1024 * 16 && ! *$self->{FlushPending}) ; # # $$buffer = *$self->{Pending} ; # *$self->{Pending} = ''; if (*$self->{Encoding}) { $$buffer = *$self->{Encoding}->encode($$buffer); } else { $] >= 5.008 and ( utf8::downgrade($$buffer, 1) or Carp::croak "Wide character in " . *$self->{ClassName} . "::write:"); } $self->filterUncompressed($buffer); my $buffer_length = defined $$buffer ? length($$buffer) : 0 ; *$self->{UnCompSize}->add($buffer_length) ; my $outBuffer=''; my $status = *$self->{Compress}->compr($buffer, $outBuffer) ; return $self->saveErrorString(undef, *$self->{Compress}{Error}, *$self->{Compress}{ErrorNo}) if $status == STATUS_ERROR; *$self->{CompSize}->add(length $outBuffer) ; $self->outputPayload($outBuffer) or return undef; return $buffer_length; } sub print { my $self = shift; #if (ref $self) { # $self = *$self{GLOB} ; #} if (defined $\) { if (defined $,) { defined $self->syswrite(join($,, @_) . $\); } else { defined $self->syswrite(join("", @_) . $\); } } else { if (defined $,) { defined $self->syswrite(join($,, @_)); } else { defined $self->syswrite(join("", @_)); } } } sub printf { my $self = shift; my $fmt = shift; defined $self->syswrite(sprintf($fmt, @_)); } sub _flushCompressed { my $self = shift ; my $outBuffer=''; my $status = *$self->{Compress}->flush($outBuffer, @_) ; return $self->saveErrorString(0, *$self->{Compress}{Error}, *$self->{Compress}{ErrorNo}) if $status == STATUS_ERROR; if ( defined *$self->{FH} ) { *$self->{FH}->clearerr(); } *$self->{CompSize}->add(length $outBuffer) ; $self->outputPayload($outBuffer) or return 0; return 1; } sub flush { my $self = shift ; $self->_flushCompressed(@_) or return 0; if ( defined *$self->{FH} ) { defined *$self->{FH}->flush() or return $self->saveErrorString(0, $!, $!); } return 1; } sub beforePayload { } sub _newStream { my $self = shift ; my $got = shift; my $class = ref $self; $self->_writeTrailer() or return 0 ; $self->ckParams($got) or $self->croakError("newStream: $self->{Error}"); if ($got->getValue('encode')) { my $want_encoding = $got->getValue('encode'); *$self->{Encoding} = IO::Compress::Base::Common::getEncoding($self, $class, $want_encoding); } else { *$self->{Encoding} = undef; } *$self->{Compress} = $self->mkComp($got) or return 0; *$self->{Header} = $self->mkHeader($got) ; $self->output(*$self->{Header} ) or return 0; *$self->{UnCompSize}->reset(); *$self->{CompSize}->reset(); $self->beforePayload(); return 1 ; } sub newStream { my $self = shift ; my $got = $self->checkParams('newStream', *$self->{Got}, @_) or return 0 ; $self->_newStream($got); # *$self->{Compress} = $self->mkComp($got) # or return 0; # # *$self->{Header} = $self->mkHeader($got) ; # $self->output(*$self->{Header} ) # or return 0; # # *$self->{UnCompSize}->reset(); # *$self->{CompSize}->reset(); # # $self->beforePayload(); # # return 1 ; } sub reset { my $self = shift ; return *$self->{Compress}->reset() ; } sub _writeTrailer { my $self = shift ; my $trailer = ''; my $status = *$self->{Compress}->close($trailer) ; return $self->saveErrorString(0, *$self->{Compress}{Error}, *$self->{Compress}{ErrorNo}) if $status == STATUS_ERROR; *$self->{CompSize}->add(length $trailer) ; $trailer .= $self->mkTrailer(); defined $trailer or return 0; return $self->output($trailer); } sub _writeFinalTrailer { my $self = shift ; return $self->output($self->mkFinalTrailer()); } sub close { my $self = shift ; return 1 if *$self->{Closed} || ! *$self->{Compress} ; *$self->{Closed} = 1 ; untie *$self if $] >= 5.008 ; *$self->{FlushPending} = 1 ; $self->_writeTrailer() or return 0 ; $self->_writeFinalTrailer() or return 0 ; $self->output( "", 1 ) or return 0; if (defined *$self->{FH}) { if ((! *$self->{Handle} || *$self->{AutoClose}) && ! *$self->{StdIO}) { $! = 0 ; *$self->{FH}->close() or return $self->saveErrorString(0, $!, $!); } delete *$self->{FH} ; # This delete can set $! in older Perls, so reset the errno $! = 0 ; } return 1; } #sub total_in #sub total_out #sub msg # #sub crc #{ # my $self = shift ; # return *$self->{Compress}->crc32() ; #} # #sub msg #{ # my $self = shift ; # return *$self->{Compress}->msg() ; #} # #sub dict_adler #{ # my $self = shift ; # return *$self->{Compress}->dict_adler() ; #} # #sub get_Level #{ # my $self = shift ; # return *$self->{Compress}->get_Level() ; #} # #sub get_Strategy #{ # my $self = shift ; # return *$self->{Compress}->get_Strategy() ; #} sub tell { my $self = shift ; return *$self->{UnCompSize}->get32bit() ; } sub eof { my $self = shift ; return *$self->{Closed} ; } sub seek { my $self = shift ; my $position = shift; my $whence = shift ; my $here = $self->tell() ; my $target = 0 ; #use IO::Handle qw(SEEK_SET SEEK_CUR SEEK_END); use IO::Handle ; if ($whence == IO::Handle::SEEK_SET) { $target = $position ; } elsif ($whence == IO::Handle::SEEK_CUR || $whence == IO::Handle::SEEK_END) { $target = $here + $position ; } else { $self->croakError(*$self->{ClassName} . "::seek: unknown value, $whence, for whence parameter"); } # short circuit if seeking to current offset return 1 if $target == $here ; # Outlaw any attempt to seek backwards $self->croakError(*$self->{ClassName} . "::seek: cannot seek backwards") if $target < $here ; # Walk the file to the new offset my $offset = $target - $here ; my $buffer ; defined $self->syswrite("\x00" x $offset) or return 0; return 1 ; } sub binmode { 1; # my $self = shift ; # return defined *$self->{FH} # ? binmode *$self->{FH} # : 1 ; } sub fileno { my $self = shift ; return defined *$self->{FH} ? *$self->{FH}->fileno() : undef ; } sub opened { my $self = shift ; return ! *$self->{Closed} ; } sub autoflush { my $self = shift ; return defined *$self->{FH} ? *$self->{FH}->autoflush(@_) : undef ; } sub input_line_number { return undef ; } sub _notAvailable { my $name = shift ; return sub { Carp::croak "$name Not Available: File opened only for output" ; } ; } *read = _notAvailable('read'); *READ = _notAvailable('read'); *readline = _notAvailable('readline'); *READLINE = _notAvailable('readline'); *getc = _notAvailable('getc'); *GETC = _notAvailable('getc'); *FILENO = \&fileno; *PRINT = \&print; *PRINTF = \&printf; *WRITE = \&syswrite; *write = \&syswrite; *SEEK = \&seek; *TELL = \&tell; *EOF = \&eof; *CLOSE = \&close; *BINMODE = \&binmode; #*sysread = \&_notAvailable; #*syswrite = \&_write; 1; __END__ =head1 NAME IO::Compress::Base - Base Class for IO::Compress modules =head1 SYNOPSIS use IO::Compress::Base ; =head1 DESCRIPTION This module is not intended for direct use in application code. Its sole purpose is to be sub-classed by IO::Compress modules. =head1 SEE ALSO L, L, L, L, L, L, L, L, L, L, L, L, L, L, L, L, L, L, L L L, L, L, L =head1 AUTHOR This module was written by Paul Marquess, C. =head1 MODIFICATION HISTORY See the Changes file. =head1 COPYRIGHT AND LICENSE Copyright (c) 2005-2017 Paul Marquess. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. darwin-perl-lib/IO/Compress/Bzip2.pm000444 000765 000024 00000047412 13167163507 021420 0ustar00ocsinventorystaff000000 000000 package IO::Compress::Bzip2 ; use strict ; use warnings; use bytes; require Exporter ; use IO::Compress::Base 2.074 ; use IO::Compress::Base::Common 2.074 qw(); use IO::Compress::Adapter::Bzip2 2.074 ; our ($VERSION, @ISA, @EXPORT_OK, %EXPORT_TAGS, $Bzip2Error); $VERSION = '2.074'; $Bzip2Error = ''; @ISA = qw(IO::Compress::Base Exporter); @EXPORT_OK = qw( $Bzip2Error bzip2 ) ; %EXPORT_TAGS = %IO::Compress::Base::EXPORT_TAGS ; push @{ $EXPORT_TAGS{all} }, @EXPORT_OK ; Exporter::export_ok_tags('all'); sub new { my $class = shift ; my $obj = IO::Compress::Base::Common::createSelfTiedObject($class, \$Bzip2Error); return $obj->_create(undef, @_); } sub bzip2 { my $obj = IO::Compress::Base::Common::createSelfTiedObject(undef, \$Bzip2Error); $obj->_def(@_); } sub mkHeader { my $self = shift ; return ''; } sub getExtraParams { my $self = shift ; use IO::Compress::Base::Common 2.074 qw(:Parse); return ( 'blocksize100k' => [IO::Compress::Base::Common::Parse_unsigned, 1], 'workfactor' => [IO::Compress::Base::Common::Parse_unsigned, 0], 'verbosity' => [IO::Compress::Base::Common::Parse_boolean, 0], ); } sub ckParams { my $self = shift ; my $got = shift; # check that BlockSize100K is a number between 1 & 9 if ($got->parsed('blocksize100k')) { my $value = $got->getValue('blocksize100k'); return $self->saveErrorString(undef, "Parameter 'BlockSize100K' not between 1 and 9, got $value") unless defined $value && $value >= 1 && $value <= 9; } # check that WorkFactor between 0 & 250 if ($got->parsed('workfactor')) { my $value = $got->getValue('workfactor'); return $self->saveErrorString(undef, "Parameter 'WorkFactor' not between 0 and 250, got $value") unless $value >= 0 && $value <= 250; } return 1 ; } sub mkComp { my $self = shift ; my $got = shift ; my $BlockSize100K = $got->getValue('blocksize100k'); my $WorkFactor = $got->getValue('workfactor'); my $Verbosity = $got->getValue('verbosity'); my ($obj, $errstr, $errno) = IO::Compress::Adapter::Bzip2::mkCompObject( $BlockSize100K, $WorkFactor, $Verbosity); return $self->saveErrorString(undef, $errstr, $errno) if ! defined $obj; return $obj; } sub mkTrailer { my $self = shift ; return ''; } sub mkFinalTrailer { return ''; } #sub newHeader #{ # my $self = shift ; # return ''; #} sub getInverseClass { return ('IO::Uncompress::Bunzip2'); } sub getFileInfo { my $self = shift ; my $params = shift; my $file = shift ; } 1; __END__ =head1 NAME IO::Compress::Bzip2 - Write bzip2 files/buffers =head1 SYNOPSIS use IO::Compress::Bzip2 qw(bzip2 $Bzip2Error) ; my $status = bzip2 $input => $output [,OPTS] or die "bzip2 failed: $Bzip2Error\n"; my $z = new IO::Compress::Bzip2 $output [,OPTS] or die "bzip2 failed: $Bzip2Error\n"; $z->print($string); $z->printf($format, $string); $z->write($string); $z->syswrite($string [, $length, $offset]); $z->flush(); $z->tell(); $z->eof(); $z->seek($position, $whence); $z->binmode(); $z->fileno(); $z->opened(); $z->autoflush(); $z->input_line_number(); $z->newStream( [OPTS] ); $z->close() ; $Bzip2Error ; # IO::File mode print $z $string; printf $z $format, $string; tell $z eof $z seek $z, $position, $whence binmode $z fileno $z close $z ; =head1 DESCRIPTION This module provides a Perl interface that allows writing bzip2 compressed data to files or buffer. For reading bzip2 files/buffers, see the companion module L. =head1 Functional Interface A top-level function, C, is provided to carry out "one-shot" compression between buffers and/or files. For finer control over the compression process, see the L section. use IO::Compress::Bzip2 qw(bzip2 $Bzip2Error) ; bzip2 $input_filename_or_reference => $output_filename_or_reference [,OPTS] or die "bzip2 failed: $Bzip2Error\n"; The functional interface needs Perl5.005 or better. =head2 bzip2 $input_filename_or_reference => $output_filename_or_reference [, OPTS] C expects at least two parameters, C<$input_filename_or_reference> and C<$output_filename_or_reference>. =head3 The C<$input_filename_or_reference> parameter The parameter, C<$input_filename_or_reference>, is used to define the source of the uncompressed data. It can take one of the following forms: =over 5 =item A filename If the <$input_filename_or_reference> parameter is a simple scalar, it is assumed to be a filename. This file will be opened for reading and the input data will be read from it. =item A filehandle If the C<$input_filename_or_reference> parameter is a filehandle, the input data will be read from it. The string '-' can be used as an alias for standard input. =item A scalar reference If C<$input_filename_or_reference> is a scalar reference, the input data will be read from C<$$input_filename_or_reference>. =item An array reference If C<$input_filename_or_reference> is an array reference, each element in the array must be a filename. The input data will be read from each file in turn. The complete array will be walked to ensure that it only contains valid filenames before any data is compressed. =item An Input FileGlob string If C<$input_filename_or_reference> is a string that is delimited by the characters "<" and ">" C will assume that it is an I. The input is the list of files that match the fileglob. See L for more details. =back If the C<$input_filename_or_reference> parameter is any other type, C will be returned. =head3 The C<$output_filename_or_reference> parameter The parameter C<$output_filename_or_reference> is used to control the destination of the compressed data. This parameter can take one of these forms. =over 5 =item A filename If the C<$output_filename_or_reference> parameter is a simple scalar, it is assumed to be a filename. This file will be opened for writing and the compressed data will be written to it. =item A filehandle If the C<$output_filename_or_reference> parameter is a filehandle, the compressed data will be written to it. The string '-' can be used as an alias for standard output. =item A scalar reference If C<$output_filename_or_reference> is a scalar reference, the compressed data will be stored in C<$$output_filename_or_reference>. =item An Array Reference If C<$output_filename_or_reference> is an array reference, the compressed data will be pushed onto the array. =item An Output FileGlob If C<$output_filename_or_reference> is a string that is delimited by the characters "<" and ">" C will assume that it is an I. The output is the list of files that match the fileglob. When C<$output_filename_or_reference> is an fileglob string, C<$input_filename_or_reference> must also be a fileglob string. Anything else is an error. See L for more details. =back If the C<$output_filename_or_reference> parameter is any other type, C will be returned. =head2 Notes When C<$input_filename_or_reference> maps to multiple files/buffers and C<$output_filename_or_reference> is a single file/buffer the input files/buffers will be stored in C<$output_filename_or_reference> as a concatenated series of compressed data streams. =head2 Optional Parameters Unless specified below, the optional parameters for C, C, are the same as those used with the OO interface defined in the L section below. =over 5 =item C<< AutoClose => 0|1 >> This option applies to any input or output data streams to C that are filehandles. If C is specified, and the value is true, it will result in all input and/or output filehandles being closed once C has completed. This parameter defaults to 0. =item C<< BinModeIn => 0|1 >> When reading from a file or filehandle, set C before reading. Defaults to 0. =item C<< Append => 0|1 >> The behaviour of this option is dependent on the type of output data stream. =over 5 =item * A Buffer If C is enabled, all compressed data will be append to the end of the output buffer. Otherwise the output buffer will be cleared before any compressed data is written to it. =item * A Filename If C is enabled, the file will be opened in append mode. Otherwise the contents of the file, if any, will be truncated before any compressed data is written to it. =item * A Filehandle If C is enabled, the filehandle will be positioned to the end of the file via a call to C before any compressed data is written to it. Otherwise the file pointer will not be moved. =back When C is specified, and set to true, it will I all compressed data to the output data stream. So when the output is a filehandle it will carry out a seek to the eof before writing any compressed data. If the output is a filename, it will be opened for appending. If the output is a buffer, all compressed data will be appended to the existing buffer. Conversely when C is not specified, or it is present and is set to false, it will operate as follows. When the output is a filename, it will truncate the contents of the file before writing any compressed data. If the output is a filehandle its position will not be changed. If the output is a buffer, it will be wiped before any compressed data is output. Defaults to 0. =back =head2 Examples To read the contents of the file C and write the compressed data to the file C. use strict ; use warnings ; use IO::Compress::Bzip2 qw(bzip2 $Bzip2Error) ; my $input = "file1.txt"; bzip2 $input => "$input.bz2" or die "bzip2 failed: $Bzip2Error\n"; To read from an existing Perl filehandle, C<$input>, and write the compressed data to a buffer, C<$buffer>. use strict ; use warnings ; use IO::Compress::Bzip2 qw(bzip2 $Bzip2Error) ; use IO::File ; my $input = new IO::File " \$buffer or die "bzip2 failed: $Bzip2Error\n"; To compress all files in the directory "/my/home" that match "*.txt" and store the compressed data in the same directory use strict ; use warnings ; use IO::Compress::Bzip2 qw(bzip2 $Bzip2Error) ; bzip2 '' => '<*.bz2>' or die "bzip2 failed: $Bzip2Error\n"; and if you want to compress each file one at a time, this will do the trick use strict ; use warnings ; use IO::Compress::Bzip2 qw(bzip2 $Bzip2Error) ; for my $input ( glob "/my/home/*.txt" ) { my $output = "$input.bz2" ; bzip2 $input => $output or die "Error compressing '$input': $Bzip2Error\n"; } =head1 OO Interface =head2 Constructor The format of the constructor for C is shown below my $z = new IO::Compress::Bzip2 $output [,OPTS] or die "IO::Compress::Bzip2 failed: $Bzip2Error\n"; It returns an C object on success and undef on failure. The variable C<$Bzip2Error> will contain an error message on failure. If you are running Perl 5.005 or better the object, C<$z>, returned from IO::Compress::Bzip2 can be used exactly like an L filehandle. This means that all normal output file operations can be carried out with C<$z>. For example, to write to a compressed file/buffer you can use either of these forms $z->print("hello world\n"); print $z "hello world\n"; The mandatory parameter C<$output> is used to control the destination of the compressed data. This parameter can take one of these forms. =over 5 =item A filename If the C<$output> parameter is a simple scalar, it is assumed to be a filename. This file will be opened for writing and the compressed data will be written to it. =item A filehandle If the C<$output> parameter is a filehandle, the compressed data will be written to it. The string '-' can be used as an alias for standard output. =item A scalar reference If C<$output> is a scalar reference, the compressed data will be stored in C<$$output>. =back If the C<$output> parameter is any other type, C::new will return undef. =head2 Constructor Options C is any combination of the following options: =over 5 =item C<< AutoClose => 0|1 >> This option is only valid when the C<$output> parameter is a filehandle. If specified, and the value is true, it will result in the C<$output> being closed once either the C method is called or the C object is destroyed. This parameter defaults to 0. =item C<< Append => 0|1 >> Opens C<$output> in append mode. The behaviour of this option is dependent on the type of C<$output>. =over 5 =item * A Buffer If C<$output> is a buffer and C is enabled, all compressed data will be append to the end of C<$output>. Otherwise C<$output> will be cleared before any data is written to it. =item * A Filename If C<$output> is a filename and C is enabled, the file will be opened in append mode. Otherwise the contents of the file, if any, will be truncated before any compressed data is written to it. =item * A Filehandle If C<$output> is a filehandle, the file pointer will be positioned to the end of the file via a call to C before any compressed data is written to it. Otherwise the file pointer will not be moved. =back This parameter defaults to 0. =item C<< BlockSize100K => number >> Specify the number of 100K blocks bzip2 uses during compression. Valid values are from 1 to 9, where 9 is best compression. The default is 1. =item C<< WorkFactor => number >> Specifies how much effort bzip2 should take before resorting to a slower fallback compression algorithm. Valid values range from 0 to 250, where 0 means use the default value 30. The default is 0. =item C<< Strict => 0|1 >> This is a placeholder option. =back =head2 Examples TODO =head1 Methods =head2 print Usage is $z->print($data) print $z $data Compresses and outputs the contents of the C<$data> parameter. This has the same behaviour as the C built-in. Returns true if successful. =head2 printf Usage is $z->printf($format, $data) printf $z $format, $data Compresses and outputs the contents of the C<$data> parameter. Returns true if successful. =head2 syswrite Usage is $z->syswrite $data $z->syswrite $data, $length $z->syswrite $data, $length, $offset Compresses and outputs the contents of the C<$data> parameter. Returns the number of uncompressed bytes written, or C if unsuccessful. =head2 write Usage is $z->write $data $z->write $data, $length $z->write $data, $length, $offset Compresses and outputs the contents of the C<$data> parameter. Returns the number of uncompressed bytes written, or C if unsuccessful. =head2 flush Usage is $z->flush; Flushes any pending compressed data to the output file/buffer. TODO Returns true on success. =head2 tell Usage is $z->tell() tell $z Returns the uncompressed file offset. =head2 eof Usage is $z->eof(); eof($z); Returns true if the C method has been called. =head2 seek $z->seek($position, $whence); seek($z, $position, $whence); Provides a sub-set of the C functionality, with the restriction that it is only legal to seek forward in the output file/buffer. It is a fatal error to attempt to seek backward. Empty parts of the file/buffer will have NULL (0x00) bytes written to them. The C<$whence> parameter takes one the usual values, namely SEEK_SET, SEEK_CUR or SEEK_END. Returns 1 on success, 0 on failure. =head2 binmode Usage is $z->binmode binmode $z ; This is a noop provided for completeness. =head2 opened $z->opened() Returns true if the object currently refers to a opened file/buffer. =head2 autoflush my $prev = $z->autoflush() my $prev = $z->autoflush(EXPR) If the C<$z> object is associated with a file or a filehandle, this method returns the current autoflush setting for the underlying filehandle. If C is present, and is non-zero, it will enable flushing after every write/print operation. If C<$z> is associated with a buffer, this method has no effect and always returns C. B that the special variable C<$|> B be used to set or retrieve the autoflush setting. =head2 input_line_number $z->input_line_number() $z->input_line_number(EXPR) This method always returns C when compressing. =head2 fileno $z->fileno() fileno($z) If the C<$z> object is associated with a file or a filehandle, C will return the underlying file descriptor. Once the C method is called C will return C. If the C<$z> object is associated with a buffer, this method will return C. =head2 close $z->close() ; close $z ; Flushes any pending compressed data and then closes the output file/buffer. For most versions of Perl this method will be automatically invoked if the IO::Compress::Bzip2 object is destroyed (either explicitly or by the variable with the reference to the object going out of scope). The exceptions are Perl versions 5.005 through 5.00504 and 5.8.0. In these cases, the C method will be called automatically, but not until global destruction of all live objects when the program is terminating. Therefore, if you want your scripts to be able to run on all versions of Perl, you should call C explicitly and not rely on automatic closing. Returns true on success, otherwise 0. If the C option has been enabled when the IO::Compress::Bzip2 object was created, and the object is associated with a file, the underlying file will also be closed. =head2 newStream([OPTS]) Usage is $z->newStream( [OPTS] ) Closes the current compressed data stream and starts a new one. OPTS consists of any of the options that are available when creating the C<$z> object. See the L section for more details. =head1 Importing No symbolic constants are required by this IO::Compress::Bzip2 at present. =over 5 =item :all Imports C and C<$Bzip2Error>. Same as doing this use IO::Compress::Bzip2 qw(bzip2 $Bzip2Error) ; =back =head1 EXAMPLES =head2 Apache::GZip Revisited See L =head2 Working with Net::FTP See L =head1 SEE ALSO L, L, L, L, L, L, L, L, L, L, L, L, L, L, L, L, L, L L L, L, L, L The primary site for the bzip2 program is L. See the module L =head1 AUTHOR This module was written by Paul Marquess, C. =head1 MODIFICATION HISTORY See the Changes file. =head1 COPYRIGHT AND LICENSE Copyright (c) 2005-2017 Paul Marquess. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. darwin-perl-lib/IO/Compress/Deflate.pm000444 000765 000024 00000056130 13167163507 021773 0ustar00ocsinventorystaff000000 000000 package IO::Compress::Deflate ; require 5.006 ; use strict ; use warnings; use bytes; require Exporter ; use IO::Compress::RawDeflate 2.074 (); use IO::Compress::Adapter::Deflate 2.074 ; use IO::Compress::Zlib::Constants 2.074 ; use IO::Compress::Base::Common 2.074 qw(); our ($VERSION, @ISA, @EXPORT_OK, %EXPORT_TAGS, %DEFLATE_CONSTANTS, $DeflateError); $VERSION = '2.074'; $DeflateError = ''; @ISA = qw(IO::Compress::RawDeflate Exporter); @EXPORT_OK = qw( $DeflateError deflate ) ; %EXPORT_TAGS = %IO::Compress::RawDeflate::DEFLATE_CONSTANTS ; push @{ $EXPORT_TAGS{all} }, @EXPORT_OK ; Exporter::export_ok_tags('all'); sub new { my $class = shift ; my $obj = IO::Compress::Base::Common::createSelfTiedObject($class, \$DeflateError); return $obj->_create(undef, @_); } sub deflate { my $obj = IO::Compress::Base::Common::createSelfTiedObject(undef, \$DeflateError); return $obj->_def(@_); } sub bitmask($$$$) { my $into = shift ; my $value = shift ; my $offset = shift ; my $mask = shift ; return $into | (($value & $mask) << $offset ) ; } sub mkDeflateHdr($$$;$) { my $method = shift ; my $cinfo = shift; my $level = shift; my $fdict_adler = shift ; my $cmf = 0; my $flg = 0; my $fdict = 0; $fdict = 1 if defined $fdict_adler; $cmf = bitmask($cmf, $method, ZLIB_CMF_CM_OFFSET, ZLIB_CMF_CM_BITS); $cmf = bitmask($cmf, $cinfo, ZLIB_CMF_CINFO_OFFSET, ZLIB_CMF_CINFO_BITS); $flg = bitmask($flg, $fdict, ZLIB_FLG_FDICT_OFFSET, ZLIB_FLG_FDICT_BITS); $flg = bitmask($flg, $level, ZLIB_FLG_LEVEL_OFFSET, ZLIB_FLG_LEVEL_BITS); my $fcheck = 31 - ($cmf * 256 + $flg) % 31 ; $flg = bitmask($flg, $fcheck, ZLIB_FLG_FCHECK_OFFSET, ZLIB_FLG_FCHECK_BITS); my $hdr = pack("CC", $cmf, $flg) ; $hdr .= pack("N", $fdict_adler) if $fdict ; return $hdr; } sub mkHeader { my $self = shift ; my $param = shift ; my $level = $param->getValue('level'); my $strategy = $param->getValue('strategy'); my $lflag ; $level = 6 if $level == Z_DEFAULT_COMPRESSION ; if (ZLIB_VERNUM >= 0x1210) { if ($strategy >= Z_HUFFMAN_ONLY || $level < 2) { $lflag = ZLIB_FLG_LEVEL_FASTEST } elsif ($level < 6) { $lflag = ZLIB_FLG_LEVEL_FAST } elsif ($level == 6) { $lflag = ZLIB_FLG_LEVEL_DEFAULT } else { $lflag = ZLIB_FLG_LEVEL_SLOWEST } } else { $lflag = ($level - 1) >> 1 ; $lflag = 3 if $lflag > 3 ; } #my $wbits = (MAX_WBITS - 8) << 4 ; my $wbits = 7; mkDeflateHdr(ZLIB_CMF_CM_DEFLATED, $wbits, $lflag); } sub ckParams { my $self = shift ; my $got = shift; $got->setValue('adler32' => 1); return 1 ; } sub mkTrailer { my $self = shift ; return pack("N", *$self->{Compress}->adler32()) ; } sub mkFinalTrailer { return ''; } #sub newHeader #{ # my $self = shift ; # return *$self->{Header}; #} sub getExtraParams { my $self = shift ; return $self->getZlibParams(), } sub getInverseClass { return ('IO::Uncompress::Inflate', \$IO::Uncompress::Inflate::InflateError); } sub getFileInfo { my $self = shift ; my $params = shift; my $file = shift ; } 1; __END__ =head1 NAME IO::Compress::Deflate - Write RFC 1950 files/buffers =head1 SYNOPSIS use IO::Compress::Deflate qw(deflate $DeflateError) ; my $status = deflate $input => $output [,OPTS] or die "deflate failed: $DeflateError\n"; my $z = new IO::Compress::Deflate $output [,OPTS] or die "deflate failed: $DeflateError\n"; $z->print($string); $z->printf($format, $string); $z->write($string); $z->syswrite($string [, $length, $offset]); $z->flush(); $z->tell(); $z->eof(); $z->seek($position, $whence); $z->binmode(); $z->fileno(); $z->opened(); $z->autoflush(); $z->input_line_number(); $z->newStream( [OPTS] ); $z->deflateParams(); $z->close() ; $DeflateError ; # IO::File mode print $z $string; printf $z $format, $string; tell $z eof $z seek $z, $position, $whence binmode $z fileno $z close $z ; =head1 DESCRIPTION This module provides a Perl interface that allows writing compressed data to files or buffer as defined in RFC 1950. For reading RFC 1950 files/buffers, see the companion module L. =head1 Functional Interface A top-level function, C, is provided to carry out "one-shot" compression between buffers and/or files. For finer control over the compression process, see the L section. use IO::Compress::Deflate qw(deflate $DeflateError) ; deflate $input_filename_or_reference => $output_filename_or_reference [,OPTS] or die "deflate failed: $DeflateError\n"; The functional interface needs Perl5.005 or better. =head2 deflate $input_filename_or_reference => $output_filename_or_reference [, OPTS] C expects at least two parameters, C<$input_filename_or_reference> and C<$output_filename_or_reference>. =head3 The C<$input_filename_or_reference> parameter The parameter, C<$input_filename_or_reference>, is used to define the source of the uncompressed data. It can take one of the following forms: =over 5 =item A filename If the <$input_filename_or_reference> parameter is a simple scalar, it is assumed to be a filename. This file will be opened for reading and the input data will be read from it. =item A filehandle If the C<$input_filename_or_reference> parameter is a filehandle, the input data will be read from it. The string '-' can be used as an alias for standard input. =item A scalar reference If C<$input_filename_or_reference> is a scalar reference, the input data will be read from C<$$input_filename_or_reference>. =item An array reference If C<$input_filename_or_reference> is an array reference, each element in the array must be a filename. The input data will be read from each file in turn. The complete array will be walked to ensure that it only contains valid filenames before any data is compressed. =item An Input FileGlob string If C<$input_filename_or_reference> is a string that is delimited by the characters "<" and ">" C will assume that it is an I. The input is the list of files that match the fileglob. See L for more details. =back If the C<$input_filename_or_reference> parameter is any other type, C will be returned. =head3 The C<$output_filename_or_reference> parameter The parameter C<$output_filename_or_reference> is used to control the destination of the compressed data. This parameter can take one of these forms. =over 5 =item A filename If the C<$output_filename_or_reference> parameter is a simple scalar, it is assumed to be a filename. This file will be opened for writing and the compressed data will be written to it. =item A filehandle If the C<$output_filename_or_reference> parameter is a filehandle, the compressed data will be written to it. The string '-' can be used as an alias for standard output. =item A scalar reference If C<$output_filename_or_reference> is a scalar reference, the compressed data will be stored in C<$$output_filename_or_reference>. =item An Array Reference If C<$output_filename_or_reference> is an array reference, the compressed data will be pushed onto the array. =item An Output FileGlob If C<$output_filename_or_reference> is a string that is delimited by the characters "<" and ">" C will assume that it is an I. The output is the list of files that match the fileglob. When C<$output_filename_or_reference> is an fileglob string, C<$input_filename_or_reference> must also be a fileglob string. Anything else is an error. See L for more details. =back If the C<$output_filename_or_reference> parameter is any other type, C will be returned. =head2 Notes When C<$input_filename_or_reference> maps to multiple files/buffers and C<$output_filename_or_reference> is a single file/buffer the input files/buffers will be stored in C<$output_filename_or_reference> as a concatenated series of compressed data streams. =head2 Optional Parameters Unless specified below, the optional parameters for C, C, are the same as those used with the OO interface defined in the L section below. =over 5 =item C<< AutoClose => 0|1 >> This option applies to any input or output data streams to C that are filehandles. If C is specified, and the value is true, it will result in all input and/or output filehandles being closed once C has completed. This parameter defaults to 0. =item C<< BinModeIn => 0|1 >> When reading from a file or filehandle, set C before reading. Defaults to 0. =item C<< Append => 0|1 >> The behaviour of this option is dependent on the type of output data stream. =over 5 =item * A Buffer If C is enabled, all compressed data will be append to the end of the output buffer. Otherwise the output buffer will be cleared before any compressed data is written to it. =item * A Filename If C is enabled, the file will be opened in append mode. Otherwise the contents of the file, if any, will be truncated before any compressed data is written to it. =item * A Filehandle If C is enabled, the filehandle will be positioned to the end of the file via a call to C before any compressed data is written to it. Otherwise the file pointer will not be moved. =back When C is specified, and set to true, it will I all compressed data to the output data stream. So when the output is a filehandle it will carry out a seek to the eof before writing any compressed data. If the output is a filename, it will be opened for appending. If the output is a buffer, all compressed data will be appended to the existing buffer. Conversely when C is not specified, or it is present and is set to false, it will operate as follows. When the output is a filename, it will truncate the contents of the file before writing any compressed data. If the output is a filehandle its position will not be changed. If the output is a buffer, it will be wiped before any compressed data is output. Defaults to 0. =back =head2 Examples To read the contents of the file C and write the compressed data to the file C. use strict ; use warnings ; use IO::Compress::Deflate qw(deflate $DeflateError) ; my $input = "file1.txt"; deflate $input => "$input.1950" or die "deflate failed: $DeflateError\n"; To read from an existing Perl filehandle, C<$input>, and write the compressed data to a buffer, C<$buffer>. use strict ; use warnings ; use IO::Compress::Deflate qw(deflate $DeflateError) ; use IO::File ; my $input = new IO::File " \$buffer or die "deflate failed: $DeflateError\n"; To compress all files in the directory "/my/home" that match "*.txt" and store the compressed data in the same directory use strict ; use warnings ; use IO::Compress::Deflate qw(deflate $DeflateError) ; deflate '' => '<*.1950>' or die "deflate failed: $DeflateError\n"; and if you want to compress each file one at a time, this will do the trick use strict ; use warnings ; use IO::Compress::Deflate qw(deflate $DeflateError) ; for my $input ( glob "/my/home/*.txt" ) { my $output = "$input.1950" ; deflate $input => $output or die "Error compressing '$input': $DeflateError\n"; } =head1 OO Interface =head2 Constructor The format of the constructor for C is shown below my $z = new IO::Compress::Deflate $output [,OPTS] or die "IO::Compress::Deflate failed: $DeflateError\n"; It returns an C object on success and undef on failure. The variable C<$DeflateError> will contain an error message on failure. If you are running Perl 5.005 or better the object, C<$z>, returned from IO::Compress::Deflate can be used exactly like an L filehandle. This means that all normal output file operations can be carried out with C<$z>. For example, to write to a compressed file/buffer you can use either of these forms $z->print("hello world\n"); print $z "hello world\n"; The mandatory parameter C<$output> is used to control the destination of the compressed data. This parameter can take one of these forms. =over 5 =item A filename If the C<$output> parameter is a simple scalar, it is assumed to be a filename. This file will be opened for writing and the compressed data will be written to it. =item A filehandle If the C<$output> parameter is a filehandle, the compressed data will be written to it. The string '-' can be used as an alias for standard output. =item A scalar reference If C<$output> is a scalar reference, the compressed data will be stored in C<$$output>. =back If the C<$output> parameter is any other type, C::new will return undef. =head2 Constructor Options C is any combination of the following options: =over 5 =item C<< AutoClose => 0|1 >> This option is only valid when the C<$output> parameter is a filehandle. If specified, and the value is true, it will result in the C<$output> being closed once either the C method is called or the C object is destroyed. This parameter defaults to 0. =item C<< Append => 0|1 >> Opens C<$output> in append mode. The behaviour of this option is dependent on the type of C<$output>. =over 5 =item * A Buffer If C<$output> is a buffer and C is enabled, all compressed data will be append to the end of C<$output>. Otherwise C<$output> will be cleared before any data is written to it. =item * A Filename If C<$output> is a filename and C is enabled, the file will be opened in append mode. Otherwise the contents of the file, if any, will be truncated before any compressed data is written to it. =item * A Filehandle If C<$output> is a filehandle, the file pointer will be positioned to the end of the file via a call to C before any compressed data is written to it. Otherwise the file pointer will not be moved. =back This parameter defaults to 0. =item C<< Merge => 0|1 >> This option is used to compress input data and append it to an existing compressed data stream in C<$output>. The end result is a single compressed data stream stored in C<$output>. It is a fatal error to attempt to use this option when C<$output> is not an RFC 1950 data stream. There are a number of other limitations with the C option: =over 5 =item 1 This module needs to have been built with zlib 1.2.1 or better to work. A fatal error will be thrown if C is used with an older version of zlib. =item 2 If C<$output> is a file or a filehandle, it must be seekable. =back This parameter defaults to 0. =item -Level Defines the compression level used by zlib. The value should either be a number between 0 and 9 (0 means no compression and 9 is maximum compression), or one of the symbolic constants defined below. Z_NO_COMPRESSION Z_BEST_SPEED Z_BEST_COMPRESSION Z_DEFAULT_COMPRESSION The default is Z_DEFAULT_COMPRESSION. Note, these constants are not imported by C by default. use IO::Compress::Deflate qw(:strategy); use IO::Compress::Deflate qw(:constants); use IO::Compress::Deflate qw(:all); =item -Strategy Defines the strategy used to tune the compression. Use one of the symbolic constants defined below. Z_FILTERED Z_HUFFMAN_ONLY Z_RLE Z_FIXED Z_DEFAULT_STRATEGY The default is Z_DEFAULT_STRATEGY. =item C<< Strict => 0|1 >> This is a placeholder option. =back =head2 Examples TODO =head1 Methods =head2 print Usage is $z->print($data) print $z $data Compresses and outputs the contents of the C<$data> parameter. This has the same behaviour as the C built-in. Returns true if successful. =head2 printf Usage is $z->printf($format, $data) printf $z $format, $data Compresses and outputs the contents of the C<$data> parameter. Returns true if successful. =head2 syswrite Usage is $z->syswrite $data $z->syswrite $data, $length $z->syswrite $data, $length, $offset Compresses and outputs the contents of the C<$data> parameter. Returns the number of uncompressed bytes written, or C if unsuccessful. =head2 write Usage is $z->write $data $z->write $data, $length $z->write $data, $length, $offset Compresses and outputs the contents of the C<$data> parameter. Returns the number of uncompressed bytes written, or C if unsuccessful. =head2 flush Usage is $z->flush; $z->flush($flush_type); Flushes any pending compressed data to the output file/buffer. This method takes an optional parameter, C<$flush_type>, that controls how the flushing will be carried out. By default the C<$flush_type> used is C. Other valid values for C<$flush_type> are C, C, C and C. It is strongly recommended that you only set the C parameter if you fully understand the implications of what it does - overuse of C can seriously degrade the level of compression achieved. See the C documentation for details. Returns true on success. =head2 tell Usage is $z->tell() tell $z Returns the uncompressed file offset. =head2 eof Usage is $z->eof(); eof($z); Returns true if the C method has been called. =head2 seek $z->seek($position, $whence); seek($z, $position, $whence); Provides a sub-set of the C functionality, with the restriction that it is only legal to seek forward in the output file/buffer. It is a fatal error to attempt to seek backward. Empty parts of the file/buffer will have NULL (0x00) bytes written to them. The C<$whence> parameter takes one the usual values, namely SEEK_SET, SEEK_CUR or SEEK_END. Returns 1 on success, 0 on failure. =head2 binmode Usage is $z->binmode binmode $z ; This is a noop provided for completeness. =head2 opened $z->opened() Returns true if the object currently refers to a opened file/buffer. =head2 autoflush my $prev = $z->autoflush() my $prev = $z->autoflush(EXPR) If the C<$z> object is associated with a file or a filehandle, this method returns the current autoflush setting for the underlying filehandle. If C is present, and is non-zero, it will enable flushing after every write/print operation. If C<$z> is associated with a buffer, this method has no effect and always returns C. B that the special variable C<$|> B be used to set or retrieve the autoflush setting. =head2 input_line_number $z->input_line_number() $z->input_line_number(EXPR) This method always returns C when compressing. =head2 fileno $z->fileno() fileno($z) If the C<$z> object is associated with a file or a filehandle, C will return the underlying file descriptor. Once the C method is called C will return C. If the C<$z> object is associated with a buffer, this method will return C. =head2 close $z->close() ; close $z ; Flushes any pending compressed data and then closes the output file/buffer. For most versions of Perl this method will be automatically invoked if the IO::Compress::Deflate object is destroyed (either explicitly or by the variable with the reference to the object going out of scope). The exceptions are Perl versions 5.005 through 5.00504 and 5.8.0. In these cases, the C method will be called automatically, but not until global destruction of all live objects when the program is terminating. Therefore, if you want your scripts to be able to run on all versions of Perl, you should call C explicitly and not rely on automatic closing. Returns true on success, otherwise 0. If the C option has been enabled when the IO::Compress::Deflate object was created, and the object is associated with a file, the underlying file will also be closed. =head2 newStream([OPTS]) Usage is $z->newStream( [OPTS] ) Closes the current compressed data stream and starts a new one. OPTS consists of any of the options that are available when creating the C<$z> object. See the L section for more details. =head2 deflateParams Usage is $z->deflateParams TODO =head1 Importing A number of symbolic constants are required by some methods in C. None are imported by default. =over 5 =item :all Imports C, C<$DeflateError> and all symbolic constants that can be used by C. Same as doing this use IO::Compress::Deflate qw(deflate $DeflateError :constants) ; =item :constants Import all symbolic constants. Same as doing this use IO::Compress::Deflate qw(:flush :level :strategy) ; =item :flush These symbolic constants are used by the C method. Z_NO_FLUSH Z_PARTIAL_FLUSH Z_SYNC_FLUSH Z_FULL_FLUSH Z_FINISH Z_BLOCK =item :level These symbolic constants are used by the C option in the constructor. Z_NO_COMPRESSION Z_BEST_SPEED Z_BEST_COMPRESSION Z_DEFAULT_COMPRESSION =item :strategy These symbolic constants are used by the C option in the constructor. Z_FILTERED Z_HUFFMAN_ONLY Z_RLE Z_FIXED Z_DEFAULT_STRATEGY =back =head1 EXAMPLES =head2 Apache::GZip Revisited See L =head2 Working with Net::FTP See L =head1 SEE ALSO L, L, L, L, L, L, L, L, L, L, L, L, L, L, L, L, L, L L L, L, L, L For RFC 1950, 1951 and 1952 see L, L and L The I compression library was written by Jean-loup Gailly C and Mark Adler C. The primary site for the I compression library is L. The primary site for gzip is L. =head1 AUTHOR This module was written by Paul Marquess, C. =head1 MODIFICATION HISTORY See the Changes file. =head1 COPYRIGHT AND LICENSE Copyright (c) 2005-2017 Paul Marquess. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. darwin-perl-lib/IO/Compress/FAQ.pod000444 000765 000024 00000050426 13167163507 021206 0ustar00ocsinventorystaff000000 000000 =head1 NAME IO::Compress::FAQ -- Frequently Asked Questions about IO::Compress =head1 DESCRIPTION Common questions answered. =head1 GENERAL =head2 Compatibility with Unix compress/uncompress. Although C has a pair of functions called C and C, they are I related to the Unix programs of the same name. The C module is not compatible with Unix C. If you have the C program available, you can use this to read compressed files open F, "uncompress -c $filename |"; while () { ... Alternatively, if you have the C program available, you can use this to read compressed files open F, "gunzip -c $filename |"; while () { ... and this to write compress files, if you have the C program available open F, "| compress -c $filename "; print F "data"; ... close F ; =head2 Accessing .tar.Z files The C module can optionally use C (via the C module) to access tar files that have been compressed with C. Unfortunately tar files compressed with the Unix C utility cannot be read by C and so cannot be directly accessed by C. If the C or C programs are available, you can use one of these workarounds to read C<.tar.Z> files from C Firstly with C use strict; use warnings; use Archive::Tar; open F, "uncompress -c $filename |"; my $tar = Archive::Tar->new(*F); ... and this with C use strict; use warnings; use Archive::Tar; open F, "gunzip -c $filename |"; my $tar = Archive::Tar->new(*F); ... Similarly, if the C program is available, you can use this to write a C<.tar.Z> file use strict; use warnings; use Archive::Tar; use IO::File; my $fh = new IO::File "| compress -c >$filename"; my $tar = Archive::Tar->new(); ... $tar->write($fh); $fh->close ; =head2 How do I recompress using a different compression? This is easier that you might expect if you realise that all the C objects are derived from C and that all the C modules can read from an C filehandle. So, for example, say you have a file compressed with gzip that you want to recompress with bzip2. Here is all that is needed to carry out the recompression. use IO::Uncompress::Gunzip ':all'; use IO::Compress::Bzip2 ':all'; my $gzipFile = "somefile.gz"; my $bzipFile = "somefile.bz2"; my $gunzip = new IO::Uncompress::Gunzip $gzipFile or die "Cannot gunzip $gzipFile: $GunzipError\n" ; bzip2 $gunzip => $bzipFile or die "Cannot bzip2 to $bzipFile: $Bzip2Error\n" ; Note, there is a limitation of this technique. Some compression file formats store extra information along with the compressed data payload. For example, gzip can optionally store the original filename and Zip stores a lot of information about the original file. If the original compressed file contains any of this extra information, it will not be transferred to the new compressed file using the technique above. =head1 ZIP =head2 What Compression Types do IO::Compress::Zip & IO::Uncompress::Unzip support? The following compression formats are supported by C and C =over 5 =item * Store (method 0) No compression at all. =item * Deflate (method 8) This is the default compression used when creating a zip file with C. =item * Bzip2 (method 12) Only supported if the C module is installed. =item * Lzma (method 14) Only supported if the C module is installed. =back =head2 Can I Read/Write Zip files larger the 4 Gig? Yes, both the C and C modules support the zip feature called I. That allows them to read/write files/buffers larger than 4Gig. If you are creating a Zip file using the one-shot interface, and any of the input files is greater than 4Gig, a zip64 complaint zip file will be created. zip "really-large-file" => "my.zip"; Similarly with the one-shot interface, if the input is a buffer larger than 4 Gig, a zip64 complaint zip file will be created. zip \$really_large_buffer => "my.zip"; The one-shot interface allows you to force the creation of a zip64 zip file by including the C option. zip $filehandle => "my.zip", Zip64 => 1; If you want to create a zip64 zip file with the OO interface you must specify the C option. my $zip = new IO::Compress::Zip "whatever", Zip64 => 1; When uncompressing with C, it will automatically detect if the zip file is zip64. If you intend to manipulate the Zip64 zip files created with C using an external zip/unzip, make sure that it supports Zip64. In particular, if you are using Info-Zip you need to have zip version 3.x or better to update a Zip64 archive and unzip version 6.x to read a zip64 archive. =head2 Can I write more that 64K entries is a Zip files? Yes. Zip64 allows this. See previous question. =head2 Zip Resources The primary reference for zip files is the "appnote" document available at L An alternatively is the Info-Zip appnote. This is available from L =head1 GZIP =head2 Gzip Resources The primary reference for gzip files is RFC 1952 L The primary site for gzip is L. =head2 Dealing with concatenated gzip files If the gunzip program encounters a file containing multiple gzip files concatenated together it will automatically uncompress them all. The example below illustrates this behaviour $ echo abc | gzip -c >x.gz $ echo def | gzip -c >>x.gz $ gunzip -c x.gz abc def By default C will I behave like the gunzip program. It will only uncompress the first gzip data stream in the file, as shown below $ perl -MIO::Uncompress::Gunzip=:all -e 'gunzip "x.gz" => \*STDOUT' abc To force C to uncompress all the gzip data streams, include the C option, as shown below $ perl -MIO::Uncompress::Gunzip=:all -e 'gunzip "x.gz" => \*STDOUT, MultiStream => 1' abc def =head2 Reading bgzip files with IO::Uncompress::Gunzip A C file consists of a series of valid gzip-compliant data streams concatenated together. To read a file created by C with C use the C option as shown in the previous section. See the section titled "The BGZF compression format" in L for a definition of C. =head1 ZLIB =head2 Zlib Resources The primary site for the I compression library is L. =head1 Bzip2 =head2 Bzip2 Resources The primary site for bzip2 is L. =head2 Dealing with Concatenated bzip2 files If the bunzip2 program encounters a file containing multiple bzip2 files concatenated together it will automatically uncompress them all. The example below illustrates this behaviour $ echo abc | bzip2 -c >x.bz2 $ echo def | bzip2 -c >>x.bz2 $ bunzip2 -c x.bz2 abc def By default C will I behave like the bunzip2 program. It will only uncompress the first bunzip2 data stream in the file, as shown below $ perl -MIO::Uncompress::Bunzip2=:all -e 'bunzip2 "x.bz2" => \*STDOUT' abc To force C to uncompress all the bzip2 data streams, include the C option, as shown below $ perl -MIO::Uncompress::Bunzip2=:all -e 'bunzip2 "x.bz2" => \*STDOUT, MultiStream => 1' abc def =head2 Interoperating with Pbzip2 Pbzip2 (L) is a parallel implementation of bzip2. The output from pbzip2 consists of a series of concatenated bzip2 data streams. By default C will only uncompress the first bzip2 data stream in a pbzip2 file. To uncompress the complete pbzip2 file you must include the C option, like this. bunzip2 $input => \$output, MultiStream => 1 or die "bunzip2 failed: $Bunzip2Error\n"; =head1 HTTP & NETWORK =head2 Apache::GZip Revisited Below is a mod_perl Apache compression module, called C, taken from L package Apache::GZip; #File: Apache::GZip.pm use strict vars; use Apache::Constants ':common'; use Compress::Zlib; use IO::File; use constant GZIP_MAGIC => 0x1f8b; use constant OS_MAGIC => 0x03; sub handler { my $r = shift; my ($fh,$gz); my $file = $r->filename; return DECLINED unless $fh=IO::File->new($file); $r->header_out('Content-Encoding'=>'gzip'); $r->send_http_header; return OK if $r->header_only; tie *STDOUT,'Apache::GZip',$r; print($_) while <$fh>; untie *STDOUT; return OK; } sub TIEHANDLE { my($class,$r) = @_; # initialize a deflation stream my $d = deflateInit(-WindowBits=>-MAX_WBITS()) || return undef; # gzip header -- don't ask how I found out $r->print(pack("nccVcc",GZIP_MAGIC,Z_DEFLATED,0,time(),0,OS_MAGIC)); return bless { r => $r, crc => crc32(undef), d => $d, l => 0 },$class; } sub PRINT { my $self = shift; foreach (@_) { # deflate the data my $data = $self->{d}->deflate($_); $self->{r}->print($data); # keep track of its length and crc $self->{l} += length($_); $self->{crc} = crc32($_,$self->{crc}); } } sub DESTROY { my $self = shift; # flush the output buffers my $data = $self->{d}->flush; $self->{r}->print($data); # print the CRC and the total length (uncompressed) $self->{r}->print(pack("LL",@{$self}{qw/crc l/})); } 1; Here's the Apache configuration entry you'll need to make use of it. Once set it will result in everything in the /compressed directory will be compressed automagically. SetHandler perl-script PerlHandler Apache::GZip Although at first sight there seems to be quite a lot going on in C, you could sum up what the code was doing as follows -- read the contents of the file in C<< $r->filename >>, compress it and write the compressed data to standard output. That's all. This code has to jump through a few hoops to achieve this because =over =item 1. The gzip support in C version 1.x can only work with a real filesystem filehandle. The filehandles used by Apache modules are not associated with the filesystem. =item 2. That means all the gzip support has to be done by hand - in this case by creating a tied filehandle to deal with creating the gzip header and trailer. =back C doesn't have that filehandle limitation (this was one of the reasons for writing it in the first place). So if C is used instead of C the whole tied filehandle code can be removed. Here is the rewritten code. package Apache::GZip; use strict vars; use Apache::Constants ':common'; use IO::Compress::Gzip; use IO::File; sub handler { my $r = shift; my ($fh,$gz); my $file = $r->filename; return DECLINED unless $fh=IO::File->new($file); $r->header_out('Content-Encoding'=>'gzip'); $r->send_http_header; return OK if $r->header_only; my $gz = new IO::Compress::Gzip '-', Minimal => 1 or return DECLINED ; print $gz $_ while <$fh>; return OK; } or even more succinctly, like this, using a one-shot gzip package Apache::GZip; use strict vars; use Apache::Constants ':common'; use IO::Compress::Gzip qw(gzip); sub handler { my $r = shift; $r->header_out('Content-Encoding'=>'gzip'); $r->send_http_header; return OK if $r->header_only; gzip $r->filename => '-', Minimal => 1 or return DECLINED ; return OK; } 1; The use of one-shot C above just reads from C<< $r->filename >> and writes the compressed data to standard output. Note the use of the C option in the code above. When using gzip for Content-Encoding you should I use this option. In the example above it will prevent the filename being included in the gzip header and make the size of the gzip data stream a slight bit smaller. =head2 Compressed files and Net::FTP The C module provides two low-level methods called C and C that both return filehandles. These filehandles can used with the C modules to compress or uncompress files read from or written to an FTP Server on the fly, without having to create a temporary file. Firstly, here is code that uses C to uncompressed a file as it is read from the FTP Server. use Net::FTP; use IO::Uncompress::Gunzip qw(:all); my $ftp = new Net::FTP ... my $retr_fh = $ftp->retr($compressed_filename); gunzip $retr_fh => $outFilename, AutoClose => 1 or die "Cannot uncompress '$compressed_file': $GunzipError\n"; and this to compress a file as it is written to the FTP Server use Net::FTP; use IO::Compress::Gzip qw(:all); my $stor_fh = $ftp->stor($filename); gzip "filename" => $stor_fh, AutoClose => 1 or die "Cannot compress '$filename': $GzipError\n"; =head1 MISC =head2 Using C to uncompress data embedded in a larger file/buffer. A fairly common use-case is where compressed data is embedded in a larger file/buffer and you want to read both. As an example consider the structure of a zip file. This is a well-defined file format that mixes both compressed and uncompressed sections of data in a single file. For the purposes of this discussion you can think of a zip file as sequence of compressed data streams, each of which is prefixed by an uncompressed local header. The local header contains information about the compressed data stream, including the name of the compressed file and, in particular, the length of the compressed data stream. To illustrate how to use C here is a script that walks a zip file and prints out how many lines are in each compressed file (if you intend write code to walking through a zip file for real see L ). Also, although this example uses the zlib-based compression, the technique can be used by the other C modules. use strict; use warnings; use IO::File; use IO::Uncompress::RawInflate qw(:all); use constant ZIP_LOCAL_HDR_SIG => 0x04034b50; use constant ZIP_LOCAL_HDR_LENGTH => 30; my $file = $ARGV[0] ; my $fh = new IO::File "<$file" or die "Cannot open '$file': $!\n"; while (1) { my $sig; my $buffer; my $x ; ($x = $fh->read($buffer, ZIP_LOCAL_HDR_LENGTH)) == ZIP_LOCAL_HDR_LENGTH or die "Truncated file: $!\n"; my $signature = unpack ("V", substr($buffer, 0, 4)); last unless $signature == ZIP_LOCAL_HDR_SIG; # Read Local Header my $gpFlag = unpack ("v", substr($buffer, 6, 2)); my $compressedMethod = unpack ("v", substr($buffer, 8, 2)); my $compressedLength = unpack ("V", substr($buffer, 18, 4)); my $uncompressedLength = unpack ("V", substr($buffer, 22, 4)); my $filename_length = unpack ("v", substr($buffer, 26, 2)); my $extra_length = unpack ("v", substr($buffer, 28, 2)); my $filename ; $fh->read($filename, $filename_length) == $filename_length or die "Truncated file\n"; $fh->read($buffer, $extra_length) == $extra_length or die "Truncated file\n"; if ($compressedMethod != 8 && $compressedMethod != 0) { warn "Skipping file '$filename' - not deflated $compressedMethod\n"; $fh->read($buffer, $compressedLength) == $compressedLength or die "Truncated file\n"; next; } if ($compressedMethod == 0 && $gpFlag & 8 == 8) { die "Streamed Stored not supported for '$filename'\n"; } next if $compressedLength == 0; # Done reading the Local Header my $inf = new IO::Uncompress::RawInflate $fh, Transparent => 1, InputLength => $compressedLength or die "Cannot uncompress $file [$filename]: $RawInflateError\n" ; my $line_count = 0; while (<$inf>) { ++ $line_count; } print "$filename: $line_count\n"; } The majority of the code above is concerned with reading the zip local header data. The code that I want to focus on is at the bottom. while (1) { # read local zip header data # get $filename # get $compressedLength my $inf = new IO::Uncompress::RawInflate $fh, Transparent => 1, InputLength => $compressedLength or die "Cannot uncompress $file [$filename]: $RawInflateError\n" ; my $line_count = 0; while (<$inf>) { ++ $line_count; } print "$filename: $line_count\n"; } The call to C creates a new filehandle C<$inf> that can be used to read from the parent filehandle C<$fh>, uncompressing it as it goes. The use of the C option will guarantee that I C<$compressedLength> bytes of compressed data will be read from the C<$fh> filehandle (The only exception is for an error case like a truncated file or a corrupt data stream). This means that once RawInflate is finished C<$fh> will be left at the byte directly after the compressed data stream. Now consider what the code looks like without C while (1) { # read local zip header data # get $filename # get $compressedLength # read all the compressed data into $data read($fh, $data, $compressedLength); my $inf = new IO::Uncompress::RawInflate \$data, Transparent => 1, or die "Cannot uncompress $file [$filename]: $RawInflateError\n" ; my $line_count = 0; while (<$inf>) { ++ $line_count; } print "$filename: $line_count\n"; } The difference here is the addition of the temporary variable C<$data>. This is used to store a copy of the compressed data while it is being uncompressed. If you know that C<$compressedLength> isn't that big then using temporary storage won't be a problem. But if C<$compressedLength> is very large or you are writing an application that other people will use, and so have no idea how big C<$compressedLength> will be, it could be an issue. Using C avoids the use of temporary storage and means the application can cope with large compressed data streams. One final point -- obviously C can only be used whenever you know the length of the compressed data beforehand, like here with a zip file. =head1 SEE ALSO L, L, L, L, L, L, L, L, L, L, L, L, L, L, L, L, L, L, L L L, L, L, L =head1 AUTHOR This module was written by Paul Marquess, C. =head1 MODIFICATION HISTORY See the Changes file. =head1 COPYRIGHT AND LICENSE Copyright (c) 2005-2017 Paul Marquess. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. darwin-perl-lib/IO/Compress/Gzip/000755 000765 000024 00000000000 13167163507 020777 5ustar00ocsinventorystaff000000 000000 darwin-perl-lib/IO/Compress/Gzip.pm000444 000765 000024 00000102541 13167163507 021336 0ustar00ocsinventorystaff000000 000000 package IO::Compress::Gzip ; require 5.006 ; use strict ; use warnings; use bytes; require Exporter ; use IO::Compress::RawDeflate 2.074 () ; use IO::Compress::Adapter::Deflate 2.074 ; use IO::Compress::Base::Common 2.074 qw(:Status ); use IO::Compress::Gzip::Constants 2.074 ; use IO::Compress::Zlib::Extra 2.074 ; BEGIN { if (defined &utf8::downgrade ) { *noUTF8 = \&utf8::downgrade } else { *noUTF8 = sub {} } } our ($VERSION, @ISA, @EXPORT_OK, %EXPORT_TAGS, %DEFLATE_CONSTANTS, $GzipError); $VERSION = '2.074'; $GzipError = '' ; @ISA = qw(IO::Compress::RawDeflate Exporter); @EXPORT_OK = qw( $GzipError gzip ) ; %EXPORT_TAGS = %IO::Compress::RawDeflate::DEFLATE_CONSTANTS ; push @{ $EXPORT_TAGS{all} }, @EXPORT_OK ; Exporter::export_ok_tags('all'); sub new { my $class = shift ; my $obj = IO::Compress::Base::Common::createSelfTiedObject($class, \$GzipError); $obj->_create(undef, @_); } sub gzip { my $obj = IO::Compress::Base::Common::createSelfTiedObject(undef, \$GzipError); return $obj->_def(@_); } #sub newHeader #{ # my $self = shift ; # #return GZIP_MINIMUM_HEADER ; # return $self->mkHeader(*$self->{Got}); #} sub getExtraParams { my $self = shift ; return ( # zlib behaviour $self->getZlibParams(), # Gzip header fields 'minimal' => [IO::Compress::Base::Common::Parse_boolean, 0], 'comment' => [IO::Compress::Base::Common::Parse_any, undef], 'name' => [IO::Compress::Base::Common::Parse_any, undef], 'time' => [IO::Compress::Base::Common::Parse_any, undef], 'textflag' => [IO::Compress::Base::Common::Parse_boolean, 0], 'headercrc' => [IO::Compress::Base::Common::Parse_boolean, 0], 'os_code' => [IO::Compress::Base::Common::Parse_unsigned, $Compress::Raw::Zlib::gzip_os_code], 'extrafield'=> [IO::Compress::Base::Common::Parse_any, undef], 'extraflags'=> [IO::Compress::Base::Common::Parse_any, undef], ); } sub ckParams { my $self = shift ; my $got = shift ; # gzip always needs crc32 $got->setValue('crc32' => 1); return 1 if $got->getValue('merge') ; my $strict = $got->getValue('strict') ; { if (! $got->parsed('time') ) { # Modification time defaults to now. $got->setValue(time => time) ; } # Check that the Name & Comment don't have embedded NULLs # Also check that they only contain ISO 8859-1 chars. if ($got->parsed('name') && defined $got->getValue('name')) { my $name = $got->getValue('name'); return $self->saveErrorString(undef, "Null Character found in Name", Z_DATA_ERROR) if $strict && $name =~ /\x00/ ; return $self->saveErrorString(undef, "Non ISO 8859-1 Character found in Name", Z_DATA_ERROR) if $strict && $name =~ /$GZIP_FNAME_INVALID_CHAR_RE/o ; } if ($got->parsed('comment') && defined $got->getValue('comment')) { my $comment = $got->getValue('comment'); return $self->saveErrorString(undef, "Null Character found in Comment", Z_DATA_ERROR) if $strict && $comment =~ /\x00/ ; return $self->saveErrorString(undef, "Non ISO 8859-1 Character found in Comment", Z_DATA_ERROR) if $strict && $comment =~ /$GZIP_FCOMMENT_INVALID_CHAR_RE/o; } if ($got->parsed('os_code') ) { my $value = $got->getValue('os_code'); return $self->saveErrorString(undef, "OS_Code must be between 0 and 255, got '$value'") if $value < 0 || $value > 255 ; } # gzip only supports Deflate at present $got->setValue('method' => Z_DEFLATED) ; if ( ! $got->parsed('extraflags')) { $got->setValue('extraflags' => 2) if $got->getValue('level') == Z_BEST_COMPRESSION ; $got->setValue('extraflags' => 4) if $got->getValue('level') == Z_BEST_SPEED ; } my $data = $got->getValue('extrafield') ; if (defined $data) { my $bad = IO::Compress::Zlib::Extra::parseExtraField($data, $strict, 1) ; return $self->saveErrorString(undef, "Error with ExtraField Parameter: $bad", Z_DATA_ERROR) if $bad ; $got->setValue('extrafield' => $data) ; } } return 1; } sub mkTrailer { my $self = shift ; return pack("V V", *$self->{Compress}->crc32(), *$self->{UnCompSize}->get32bit()); } sub getInverseClass { return ('IO::Uncompress::Gunzip', \$IO::Uncompress::Gunzip::GunzipError); } sub getFileInfo { my $self = shift ; my $params = shift; my $filename = shift ; return if IO::Compress::Base::Common::isaScalar($filename); my $defaultTime = (stat($filename))[9] ; $params->setValue('name' => $filename) if ! $params->parsed('name') ; $params->setValue('time' => $defaultTime) if ! $params->parsed('time') ; } sub mkHeader { my $self = shift ; my $param = shift ; # short-circuit if a minimal header is requested. return GZIP_MINIMUM_HEADER if $param->getValue('minimal') ; # METHOD my $method = $param->valueOrDefault('method', GZIP_CM_DEFLATED) ; # FLAGS my $flags = GZIP_FLG_DEFAULT ; $flags |= GZIP_FLG_FTEXT if $param->getValue('textflag') ; $flags |= GZIP_FLG_FHCRC if $param->getValue('headercrc') ; $flags |= GZIP_FLG_FEXTRA if $param->wantValue('extrafield') ; $flags |= GZIP_FLG_FNAME if $param->wantValue('name') ; $flags |= GZIP_FLG_FCOMMENT if $param->wantValue('comment') ; # MTIME my $time = $param->valueOrDefault('time', GZIP_MTIME_DEFAULT) ; # EXTRA FLAGS my $extra_flags = $param->valueOrDefault('extraflags', GZIP_XFL_DEFAULT); # OS CODE my $os_code = $param->valueOrDefault('os_code', GZIP_OS_DEFAULT) ; my $out = pack("C4 V C C", GZIP_ID1, # ID1 GZIP_ID2, # ID2 $method, # Compression Method $flags, # Flags $time, # Modification Time $extra_flags, # Extra Flags $os_code, # Operating System Code ) ; # EXTRA if ($flags & GZIP_FLG_FEXTRA) { my $extra = $param->getValue('extrafield') ; $out .= pack("v", length $extra) . $extra ; } # NAME if ($flags & GZIP_FLG_FNAME) { my $name .= $param->getValue('name') ; $name =~ s/\x00.*$//; $out .= $name ; # Terminate the filename with NULL unless it already is $out .= GZIP_NULL_BYTE if !length $name or substr($name, 1, -1) ne GZIP_NULL_BYTE ; } # COMMENT if ($flags & GZIP_FLG_FCOMMENT) { my $comment .= $param->getValue('comment') ; $comment =~ s/\x00.*$//; $out .= $comment ; # Terminate the comment with NULL unless it already is $out .= GZIP_NULL_BYTE if ! length $comment or substr($comment, 1, -1) ne GZIP_NULL_BYTE; } # HEADER CRC $out .= pack("v", Compress::Raw::Zlib::crc32($out) & 0x00FF ) if $param->getValue('headercrc') ; noUTF8($out); return $out ; } sub mkFinalTrailer { return ''; } 1; __END__ =head1 NAME IO::Compress::Gzip - Write RFC 1952 files/buffers =head1 SYNOPSIS use IO::Compress::Gzip qw(gzip $GzipError) ; my $status = gzip $input => $output [,OPTS] or die "gzip failed: $GzipError\n"; my $z = new IO::Compress::Gzip $output [,OPTS] or die "gzip failed: $GzipError\n"; $z->print($string); $z->printf($format, $string); $z->write($string); $z->syswrite($string [, $length, $offset]); $z->flush(); $z->tell(); $z->eof(); $z->seek($position, $whence); $z->binmode(); $z->fileno(); $z->opened(); $z->autoflush(); $z->input_line_number(); $z->newStream( [OPTS] ); $z->deflateParams(); $z->close() ; $GzipError ; # IO::File mode print $z $string; printf $z $format, $string; tell $z eof $z seek $z, $position, $whence binmode $z fileno $z close $z ; =head1 DESCRIPTION This module provides a Perl interface that allows writing compressed data to files or buffer as defined in RFC 1952. All the gzip headers defined in RFC 1952 can be created using this module. For reading RFC 1952 files/buffers, see the companion module L. =head1 Functional Interface A top-level function, C, is provided to carry out "one-shot" compression between buffers and/or files. For finer control over the compression process, see the L section. use IO::Compress::Gzip qw(gzip $GzipError) ; gzip $input_filename_or_reference => $output_filename_or_reference [,OPTS] or die "gzip failed: $GzipError\n"; The functional interface needs Perl5.005 or better. =head2 gzip $input_filename_or_reference => $output_filename_or_reference [, OPTS] C expects at least two parameters, C<$input_filename_or_reference> and C<$output_filename_or_reference>. =head3 The C<$input_filename_or_reference> parameter The parameter, C<$input_filename_or_reference>, is used to define the source of the uncompressed data. It can take one of the following forms: =over 5 =item A filename If the <$input_filename_or_reference> parameter is a simple scalar, it is assumed to be a filename. This file will be opened for reading and the input data will be read from it. =item A filehandle If the C<$input_filename_or_reference> parameter is a filehandle, the input data will be read from it. The string '-' can be used as an alias for standard input. =item A scalar reference If C<$input_filename_or_reference> is a scalar reference, the input data will be read from C<$$input_filename_or_reference>. =item An array reference If C<$input_filename_or_reference> is an array reference, each element in the array must be a filename. The input data will be read from each file in turn. The complete array will be walked to ensure that it only contains valid filenames before any data is compressed. =item An Input FileGlob string If C<$input_filename_or_reference> is a string that is delimited by the characters "<" and ">" C will assume that it is an I. The input is the list of files that match the fileglob. See L for more details. =back If the C<$input_filename_or_reference> parameter is any other type, C will be returned. In addition, if C<$input_filename_or_reference> is a simple filename, the default values for the C and C