forked from bitcoin/bitcoin
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
33 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
file(WRITE "${GENERATED_FILE}" "#ifndef BITCOIN_INIT_IP_ASN_H\n") | ||
file(APPEND "${GENERATED_FILE}" "#define BITCOIN_INIT_IP_ASN_H\n") | ||
file(APPEND "${GENERATED_FILE}" "/**\n") | ||
file(APPEND "${GENERATED_FILE}" " * ASMap data, mapping IP prefixes to ASNs,\n") | ||
file(APPEND "${GENERATED_FILE}" " * AUTOGENERATED by contrib/asmap/asmap-tool.py\n") | ||
file(APPEND "${GENERATED_FILE}" " */\n") | ||
|
||
execute_process( | ||
COMMAND xxd -i "${RAW_FILE}" | ||
COMMAND sed "s/unsigned char .*/static const unsigned char ip_asn[] = {/" | ||
COMMAND sed "s/^unsigned int .*_len/static const unsigned int ip_asn_len/" | ||
OUTPUT_VARIABLE HEX_DUMP | ||
) | ||
file(APPEND "${GENERATED_FILE}" "${HEX_DUMP}") | ||
|
||
file(APPEND "${GENERATED_FILE}" "#endif // BITCOIN_INIT_IP_ASN_H\n") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters