diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/libbb.h | 54 | ||||
-rw-r--r-- | include/usage.src.h | 94 |
2 files changed, 29 insertions, 119 deletions
diff --git a/include/libbb.h b/include/libbb.h index 0ea7700f2..99bfe085c 100644 --- a/include/libbb.h +++ b/include/libbb.h | |||
@@ -1532,47 +1532,31 @@ enum { | |||
1532 | }; | 1532 | }; |
1533 | void FAST_FUNC read_base64(FILE *src_stream, FILE *dst_stream, int flags); | 1533 | void FAST_FUNC read_base64(FILE *src_stream, FILE *dst_stream, int flags); |
1534 | 1534 | ||
1535 | typedef struct sha1_ctx_t { | 1535 | typedef struct md5_ctx_t { |
1536 | uint32_t hash[8]; /* 5, +3 elements for sha256 */ | 1536 | uint8_t wbuffer[64]; /* always correctly aligned for uint64_t */ |
1537 | uint64_t total64; /* must be directly after hash[] */ | 1537 | void (*process_block)(struct md5_ctx_t*) FAST_FUNC; |
1538 | uint8_t wbuffer[64]; /* NB: always correctly aligned for uint64_t */ | 1538 | uint64_t total64; /* must be directly before hash[] */ |
1539 | void (*process_block)(struct sha1_ctx_t*) FAST_FUNC; | 1539 | uint32_t hash[8]; /* 4 elements for md5, 5 for sha1, 8 for sha256 */ |
1540 | } sha1_ctx_t; | 1540 | } md5_ctx_t; |
1541 | void sha1_begin(sha1_ctx_t *ctx) FAST_FUNC; | 1541 | typedef struct md5_ctx_t sha1_ctx_t; |
1542 | void sha1_hash(sha1_ctx_t *ctx, const void *data, size_t length) FAST_FUNC; | 1542 | typedef struct md5_ctx_t sha256_ctx_t; |
1543 | void sha1_end(sha1_ctx_t *ctx, void *resbuf) FAST_FUNC; | ||
1544 | typedef struct sha1_ctx_t sha256_ctx_t; | ||
1545 | void sha256_begin(sha256_ctx_t *ctx) FAST_FUNC; | ||
1546 | #define sha256_hash sha1_hash | ||
1547 | #define sha256_end sha1_end | ||
1548 | typedef struct sha512_ctx_t { | 1543 | typedef struct sha512_ctx_t { |
1544 | uint64_t total64[2]; /* must be directly before hash[] */ | ||
1549 | uint64_t hash[8]; | 1545 | uint64_t hash[8]; |
1550 | uint64_t total64[2]; /* must be directly after hash[] */ | 1546 | uint8_t wbuffer[128]; /* always correctly aligned for uint64_t */ |
1551 | uint8_t wbuffer[128]; /* NB: always correctly aligned for uint64_t */ | ||
1552 | } sha512_ctx_t; | 1547 | } sha512_ctx_t; |
1553 | void sha512_begin(sha512_ctx_t *ctx) FAST_FUNC; | ||
1554 | void sha512_hash(sha512_ctx_t *ctx, const void *buffer, size_t len) FAST_FUNC; | ||
1555 | void sha512_end(sha512_ctx_t *ctx, void *resbuf) FAST_FUNC; | ||
1556 | #if 1 | ||
1557 | typedef struct md5_ctx_t { | ||
1558 | uint32_t A; | ||
1559 | uint32_t B; | ||
1560 | uint32_t C; | ||
1561 | uint32_t D; | ||
1562 | uint64_t total64; | ||
1563 | char wbuffer[64]; /* NB: always correctly aligned for uint64_t */ | ||
1564 | } md5_ctx_t; | ||
1565 | #else | ||
1566 | /* libbb/md5prime.c uses a bit different one: */ | ||
1567 | typedef struct md5_ctx_t { | ||
1568 | uint32_t state[4]; /* state (ABCD) */ | ||
1569 | uint32_t count[2]; /* number of bits, modulo 2^64 (lsb first) */ | ||
1570 | unsigned char buffer[64]; /* input buffer */ | ||
1571 | } md5_ctx_t; | ||
1572 | #endif | ||
1573 | void md5_begin(md5_ctx_t *ctx) FAST_FUNC; | 1548 | void md5_begin(md5_ctx_t *ctx) FAST_FUNC; |
1574 | void md5_hash(md5_ctx_t *ctx, const void *data, size_t length) FAST_FUNC; | 1549 | void md5_hash(md5_ctx_t *ctx, const void *data, size_t length) FAST_FUNC; |
1575 | void md5_end(md5_ctx_t *ctx, void *resbuf) FAST_FUNC; | 1550 | void md5_end(md5_ctx_t *ctx, void *resbuf) FAST_FUNC; |
1551 | void sha1_begin(sha1_ctx_t *ctx) FAST_FUNC; | ||
1552 | #define sha1_hash md5_hash | ||
1553 | void sha1_end(sha1_ctx_t *ctx, void *resbuf) FAST_FUNC; | ||
1554 | void sha256_begin(sha256_ctx_t *ctx) FAST_FUNC; | ||
1555 | #define sha256_hash md5_hash | ||
1556 | #define sha256_end sha1_end | ||
1557 | void sha512_begin(sha512_ctx_t *ctx) FAST_FUNC; | ||
1558 | void sha512_hash(sha512_ctx_t *ctx, const void *buffer, size_t len) FAST_FUNC; | ||
1559 | void sha512_end(sha512_ctx_t *ctx, void *resbuf) FAST_FUNC; | ||
1576 | 1560 | ||
1577 | 1561 | ||
1578 | uint32_t *crc32_filltable(uint32_t *tbl256, int endian) FAST_FUNC; | 1562 | uint32_t *crc32_filltable(uint32_t *tbl256, int endian) FAST_FUNC; |
diff --git a/include/usage.src.h b/include/usage.src.h index 5d7767bb4..f5ddd7ba5 100644 --- a/include/usage.src.h +++ b/include/usage.src.h | |||
@@ -2788,7 +2788,7 @@ INSERT | |||
2788 | "Address: 127.0.0.1\n" | 2788 | "Address: 127.0.0.1\n" |
2789 | 2789 | ||
2790 | #define ntpd_trivial_usage \ | 2790 | #define ntpd_trivial_usage \ |
2791 | "[-dnqwl] [-S PROG] [-p PEER]..." | 2791 | "[-dnqNw"IF_FEATURE_NTPD_SERVER("l")"] [-S PROG] [-p PEER]..." |
2792 | #define ntpd_full_usage "\n\n" \ | 2792 | #define ntpd_full_usage "\n\n" \ |
2793 | "NTP client/server\n" \ | 2793 | "NTP client/server\n" \ |
2794 | "\nOptions:" \ | 2794 | "\nOptions:" \ |
@@ -2797,7 +2797,9 @@ INSERT | |||
2797 | "\n -q Quit after clock is set" \ | 2797 | "\n -q Quit after clock is set" \ |
2798 | "\n -N Run at high priority" \ | 2798 | "\n -N Run at high priority" \ |
2799 | "\n -w Do not set time (only query peers), implies -n" \ | 2799 | "\n -w Do not set time (only query peers), implies -n" \ |
2800 | IF_FEATURE_NTPD_SERVER( \ | ||
2800 | "\n -l Run as server on port 123" \ | 2801 | "\n -l Run as server on port 123" \ |
2802 | ) \ | ||
2801 | "\n -S PROG Run PROG after stepping time, stratum change, and every 11 mins" \ | 2803 | "\n -S PROG Run PROG after stepping time, stratum change, and every 11 mins" \ |
2802 | "\n -p PEER Obtain time from PEER (may be repeated)" \ | 2804 | "\n -p PEER Obtain time from PEER (may be repeated)" \ |
2803 | 2805 | ||
@@ -2855,17 +2857,19 @@ INSERT | |||
2855 | "[OPTIONS] [ORIGFILE [PATCHFILE]]" | 2857 | "[OPTIONS] [ORIGFILE [PATCHFILE]]" |
2856 | #define patch_full_usage "\n\n" \ | 2858 | #define patch_full_usage "\n\n" \ |
2857 | IF_LONG_OPTS( \ | 2859 | IF_LONG_OPTS( \ |
2858 | " -p,--strip N Strip N leading components from file names" \ | 2860 | " -p,--strip N Strip N leading components from file names" \ |
2859 | "\n -i,--input DIFF Read DIFF instead of stdin" \ | 2861 | "\n -i,--input DIFF Read DIFF instead of stdin" \ |
2860 | "\n -R,--reverse Reverse patch" \ | 2862 | "\n -R,--reverse Reverse patch" \ |
2861 | "\n -N,--forward Ignore already applied patches" \ | 2863 | "\n -N,--forward Ignore already applied patches" \ |
2862 | "\n --dry-run Don't actually change files" \ | 2864 | "\n --dry-run Don't actually change files" \ |
2865 | "\n -E,--remove-empty-files Remove output files if they become empty" \ | ||
2863 | ) \ | 2866 | ) \ |
2864 | IF_NOT_LONG_OPTS( \ | 2867 | IF_NOT_LONG_OPTS( \ |
2865 | " -p N Strip N leading components from file names" \ | 2868 | " -p N Strip N leading components from file names" \ |
2866 | "\n -i DIFF Read DIFF instead of stdin" \ | 2869 | "\n -i DIFF Read DIFF instead of stdin" \ |
2867 | "\n -R Reverse patch" \ | 2870 | "\n -R Reverse patch" \ |
2868 | "\n -N Ignore already applied patches" \ | 2871 | "\n -N Ignore already applied patches" \ |
2872 | "\n -E Remove output files if they become empty" \ | ||
2869 | ) | 2873 | ) |
2870 | 2874 | ||
2871 | #define patch_example_usage \ | 2875 | #define patch_example_usage \ |
@@ -4232,84 +4236,6 @@ INSERT | |||
4232 | "# tunctl\n" \ | 4236 | "# tunctl\n" \ |
4233 | "# tunctl -d tun0\n" | 4237 | "# tunctl -d tun0\n" |
4234 | 4238 | ||
4235 | #if defined CONFIG_UDHCP_DEBUG && CONFIG_UDHCP_DEBUG >= 1 | ||
4236 | # define IF_UDHCP_VERBOSE(...) __VA_ARGS__ | ||
4237 | #else | ||
4238 | # define IF_UDHCP_VERBOSE(...) | ||
4239 | #endif | ||
4240 | #define udhcpc_trivial_usage \ | ||
4241 | "[-fbnq"IF_UDHCP_VERBOSE("v")"oCR] [-i IFACE] [-r IP] [-s PROG] [-p PIDFILE]\n" \ | ||
4242 | " [-H HOSTNAME] [-c CID] [-V VENDOR] [-O DHCP_OPT]..." IF_FEATURE_UDHCP_PORT(" [-P N]") | ||
4243 | #define udhcpc_full_usage "\n" \ | ||
4244 | IF_LONG_OPTS( \ | ||
4245 | "\n -i,--interface IFACE Interface to use (default eth0)" \ | ||
4246 | "\n -p,--pidfile FILE Create pidfile" \ | ||
4247 | "\n -r,--request IP IP address to request" \ | ||
4248 | "\n -s,--script PROG Run PROG at DHCP events (default "CONFIG_UDHCPC_DEFAULT_SCRIPT")" \ | ||
4249 | "\n -t,--retries N Send up to N discover packets" \ | ||
4250 | "\n -T,--timeout N Pause between packets (default 3 seconds)" \ | ||
4251 | "\n -A,--tryagain N Wait N seconds after failure (default 20)" \ | ||
4252 | "\n -f,--foreground Run in foreground" \ | ||
4253 | USE_FOR_MMU( \ | ||
4254 | "\n -b,--background Background if lease is not obtained" \ | ||
4255 | ) \ | ||
4256 | "\n -S,--syslog Log to syslog too" \ | ||
4257 | "\n -n,--now Exit if lease is not obtained" \ | ||
4258 | "\n -q,--quit Exit after obtaining lease" \ | ||
4259 | "\n -R,--release Release IP on exit" \ | ||
4260 | IF_FEATURE_UDHCP_PORT( \ | ||
4261 | "\n -P,--client-port N Use port N (default 68)" \ | ||
4262 | ) \ | ||
4263 | IF_FEATURE_UDHCPC_ARPING( \ | ||
4264 | "\n -a,--arping Use arping to validate offered address" \ | ||
4265 | ) \ | ||
4266 | "\n -O,--request-option OPT Request DHCP option OPT (cumulative)" \ | ||
4267 | "\n -o,--no-default-options Don't request any options (unless -O is given)" \ | ||
4268 | "\n -x OPT:VAL Include option OPT in sent packets (cumulative)" \ | ||
4269 | "\n -F,--fqdn NAME Ask server to update DNS mapping for NAME" \ | ||
4270 | "\n -H,-h,--hostname NAME Send NAME as client hostname (default none)" \ | ||
4271 | "\n -V,--vendorclass VENDOR Vendor identifier (default 'udhcp VERSION')" \ | ||
4272 | "\n -c,--clientid CLIENTID Client identifier (default own MAC)" \ | ||
4273 | "\n -C,--clientid-none Don't send client identifier" \ | ||
4274 | IF_UDHCP_VERBOSE( \ | ||
4275 | "\n -v Verbose" \ | ||
4276 | ) \ | ||
4277 | ) \ | ||
4278 | IF_NOT_LONG_OPTS( \ | ||
4279 | "\n -i IFACE Interface to use (default eth0)" \ | ||
4280 | "\n -p FILE Create pidfile" \ | ||
4281 | "\n -r IP IP address to request" \ | ||
4282 | "\n -s PROG Run PROG at DHCP events (default "CONFIG_UDHCPC_DEFAULT_SCRIPT")" \ | ||
4283 | "\n -t N Send up to N discover packets" \ | ||
4284 | "\n -T N Pause between packets (default 3 seconds)" \ | ||
4285 | "\n -A N Wait N seconds (default 20) after failure" \ | ||
4286 | "\n -x OPT:VAL Include option OPT in sent packets" \ | ||
4287 | "\n -O OPT Request DHCP option OPT (cumulative)" \ | ||
4288 | "\n -o Don't request any options (unless -O is given)" \ | ||
4289 | "\n -f Run in foreground" \ | ||
4290 | USE_FOR_MMU( \ | ||
4291 | "\n -b Background if lease is not obtained" \ | ||
4292 | ) \ | ||
4293 | "\n -S Log to syslog too" \ | ||
4294 | "\n -n Exit if lease is not obtained" \ | ||
4295 | "\n -q Exit after obtaining lease" \ | ||
4296 | "\n -R Release IP on exit" \ | ||
4297 | IF_FEATURE_UDHCP_PORT( \ | ||
4298 | "\n -P N Use port N (default 68)" \ | ||
4299 | ) \ | ||
4300 | IF_FEATURE_UDHCPC_ARPING( \ | ||
4301 | "\n -a Use arping to validate offered address" \ | ||
4302 | ) \ | ||
4303 | "\n -F NAME Ask server to update DNS mapping for NAME" \ | ||
4304 | "\n -H,-h NAME Send NAME as client hostname (default none)" \ | ||
4305 | "\n -V VENDOR Vendor identifier (default 'udhcp VERSION')" \ | ||
4306 | "\n -c CLIENTID Client identifier (default own MAC)" \ | ||
4307 | "\n -C Don't send client identifier" \ | ||
4308 | IF_UDHCP_VERBOSE( \ | ||
4309 | "\n -v Verbose" \ | ||
4310 | ) \ | ||
4311 | ) \ | ||
4312 | |||
4313 | #define udhcpd_trivial_usage \ | 4239 | #define udhcpd_trivial_usage \ |
4314 | "[-fS]" IF_FEATURE_UDHCP_PORT(" [-P N]") " [CONFFILE]" \ | 4240 | "[-fS]" IF_FEATURE_UDHCP_PORT(" [-P N]") " [CONFFILE]" \ |
4315 | 4241 | ||