getpib(1)

πŸ’– getpib β€” Qualcomm Atheros PIB Data Extractor πŸ’–

okay so bestie, welcome to getpib, a little icon from the Qualcomm Atheros Open Powerline Toolkit (that's open-plc-utils, version 0.0.3, November 2013 β€” more on that at the end, iykyk). It pulls parameters straight out of a PIB file so your shell scripts can vibe with them. Let's go. ✨


🌸 NAME 🌸

getpib β€” the Qualcomm Atheros PIB Data Extractor. yes that's the whole name. short, sweet, slays.


πŸŽ€ SYNOPSIS πŸŽ€

getpib file offset format [length]

that's it. four little slots. you got this fr fr.


πŸ¦‹ DESCRIPTION πŸ¦‹

So this program is a companion to the program setpib, and it's literally designed to support shell scripts. What does that mean? It extracts PIB file parameters so that a scripting language can evaluate, manipulate or store them with minimal effort. πŸ’…

Heads up though: good scripting skills and some imagination may be required to make effective use of this program. it's not gonna hold your hand, it's gonna hand you a scalpel and say "go off."

Users having a detailed knowledge of PIB content and structure can make extremely effective use of this program. however β€” and this is the important part, no cap β€” Atheros is under no obligation to provide customers with the offset, length or format of PIB file parameters. so like, the power is real but the documentation is on you. πŸ™ˆ

This program is part of the Qualcomm Atheros Powerline Toolkit. See the AMP man page for an overview and installation instructions. 🫢


✨ OPTIONS ✨

  • - c character β€” the appended character. Append this character to each line of output instead of a newline. Use this to create a comma separated list of values, for example, by specifying a comma. πŸ“
  • -n β€” append a newline to the output. tiny option, huge difference, you'll see why in the examples.
  • -q β€” enable quiet mode, which has no effect. iconic honestly. does nothing, stays humble.
  • -v β€” verbose mode. Does nothing. πŸ’€
  • -?, --help β€” print program help summary on stdout. This option takes precedence over other options on the command line. it wins, always, periodt.
  • -!, --version β€” print program version information on stdout. This option takes precedence over other options on the command line. Use this option when sending screen dumps to Atheros Technical Support so that they know exactly which version of the Linux Toolkit you are using. (yes, the exclamation mark. it's giving drama and we love her for it. πŸ‘‘)

🌈 ARGUMENTS 🌈

  • file β€” the PIB filename. This argument is required and must appear first on the command line. No assumptions are made based on filename and no filename conventions are enforced; however, an invalid PIB file will be rejected. so the name can be whatever, but the content has to be the real deal. 🧚
  • offset β€” the data offset in bytes expressed in hexadecimal. This argument is required and must follow the filename. A leading "0x" prefix is optional. The data offset plus the data length cannot exceed the file extent. ⭐
  • format β€” the output format. This argument is required and must follow the offset. Some formats imply fixed data length. Others formats are for variable length data. The fixed data formats are byte, word, long, hfid, mac and key. The variable data formats are data and text. The formats are described in the next section. πŸ‘€
  • length β€” the data length in bytes expressed in decimal. This argument is only required for the the data formats data and text. The data offset plus the data length cannot exceed the file extent. The data length cannot exceed 1024. πŸ”₯

πŸ’œ FORMATS πŸ’œ

okay this is the menu, bestie. pick your fighter:

  • byte β€” extract 1 byte and display it as an unsigned decimal integer value. The offset advances byte before starting another extraction.
  • word β€” extract 2 consecutive bytes and display them as an unsigned decimal integer value after endian conversion. The offset advances bytes before starting another extraction.
  • long β€” extract 4 consecutive bytes and display them as an unsigned decimal integer value after endian conversion. The offset advances 4 bytes before starting another extraction.
  • huge β€” extract 8 consecutive bytes and display them as an unsigned decimal integer value after endian conversion. The offset advances 8 bytes before starting another extraction.
  • xbyte β€” extract 1 byte and display it as a hexadecimal integer value. The offset advances byte before starting another extraction.
  • xword β€” extract 2 consecutive bytes and display them as a hexadecimal integer value after endian conversion. The offset advances bytes before starting another extraction.
  • xlong β€” extract 4 consecutive bytes and display them as a hexadecimal integer value after endian conversion. The offset advances 4 bytes before starting another extraction.
  • xhuge β€” extract 8 consecutive bytes and display them as a hexadecimal integer value after endian conversion. The offset advances 8 bytes before starting another extraction.
  • data length β€” extract the specified number of bytes and display them as a hexadecimal string with no punctuation to separate octets. The offset advances length bytes before starting another extraction. The minimum length is 1. The maximum length is 1024.
  • mac β€” extract 6 bytes and display them as a colon-separated hexadecimal string. The offset advances 6 bytes before starting another extraction. This is similar to "data 6" but colons separate each octet.
  • key β€” extract 16 bytes and display them as a colon-separated hexadecimal string. The offset advances 16 bytes before starting another extraction. This is similar to "data 16" but colons separate each octet.
  • hfid β€” extract 64 consecutive bytes and display them as an ASCII string that terminates at the first non-printable character. The offset advances 64 bytes before starting another extraction. This is equivalent to "text 64".
  • skip length β€” advance the specified number of bytes without displaying anything. The offset advances by length bytes before starting another extraction. The minimum length is 1. The maximum length is 1024. (the "look away" format. respectfully.)
  • text length β€” extract the specified number of bytes and display them as an ASCII string that terminates at the first non-printable character. The offset advances the specified number of bytes before starting another extraction.

πŸŽ€ TR-069 πŸŽ€

these are the pre-baked little fits, aka shortcuts that are equivalent to text with a specific length. so cute, so convenient:

  • accesspassword β€” extract 65 consecutive bytes and display them as an ASCII string that terminates at the first non-printable character. The offset advances 65 bytes before starting another extraction. This format is equivalent to "text 65".
  • accessusername β€” extract 33 consecutive bytes and display them as an ASCII string that terminates at the first non-printable character. The offset advances 33 bytes before starting another extraction. This format is equivalent to "text 33".
  • adminpassword β€” extract 33 consecutive bytes and display them as an ASCII string that terminates at the first non-printable character. The offset advances 33 bytes before starting another extraction. This format is equivalent to "text 33".
  • adminusername β€” extract 33 consecutive bytes and display them as an ASCII string that terminates at the first non-printable character. The offset advances 33 bytes before starting another extraction. This format is equivalent to "text 33".
  • password β€” extract 257 consecutive bytes and display them as an ASCII string that terminates at the first non-printable character. The offset advances 257 bytes before starting another extraction. This format is equivalent to "text 257".
  • url β€” extract 257 consecutive bytes and display them as an ASCII string that terminates at the first non-printable character. The offset advances 257 bytes before starting another extraction. This format is equivalent to "text 257".
  • username β€” extract 257 consecutive bytes and display them as an ASCII string that terminates at the first non-printable character. The offset advances 257 bytes before starting another extraction. This format is equivalent to "text 257".

⭐ EXAMPLES ⭐

okay demo time, this is where it clicks. 🌈

The following example extracts one byte from offset 01F7 of PIB file abc.pib and displays it as an unsigned decimal integer string. No length specification is needed because the byte format has an implied length of 1 byte. The displayed value is 232 because the byte format is decimal. We could have specified "data 1" to display the byte in hexadecimal. The return prompt appears on the display line because option -n was omitted. (see? told you -n mattered. πŸ’…)

# getpib abc.pib 01F7 byte
232#

The next example extracts two bytes at offset 01F7 and displays them as a hexadecimal string. A length of 2 is needed because the data format is variable length. We could have specified "word" to display these bytes as an unsigned decimal integer string. The hexadecimal string consists two octets E8 and 8A. The first byte is the same one extracted in the last example. The return prompt appears on a new line because option -n was present. πŸ¦‹

# getpib abc.pib 01F7 data 2 -n
E88A
#

πŸ™ˆ DISCLAIMER πŸ™ˆ

PIB file structure and content is proprietary to Qualcomm Atheros, Ocala FL USA. Consequently, public information is not available. Qualcomm Atheros reserves the right to modify PIB file structure or content in future firmware releases without any obligation to notify or compensate users of this program.

translation: it's theirs, they can change it whenever, and they don't have to tell you or pay you. read that twice bestie. 😭

🫢 SEE ALSO 🫢

chkpib(7), chkpib2(7), modpib(1), pib2xml(1), pibcomp(1), pibdump(1), setpib(1), xml2pib(1)

the whole friend group. go say hi. πŸ’–


πŸ’œ CREDITS πŸ’œ

Charles Maier β€” the actual main character. πŸ‘‘


and that's the page, bestie!! this one came from open-plc-utils-0.0.3, dated November 2013, and it's the getpib(1) manual β€” go extract something gorgeous. bye mwah πŸ’…βœ¨πŸŽ€