blob: 8109d35c1f6b0445100138fcb836e777efe1860d [file] [log] [blame]
Patrick Williamscb882f82022-12-07 17:53:19 -06001#!/usr/bin/env python3
Patrick Williamsa523cec2022-09-12 16:15:25 -05002
Patrick Williamsa523cec2022-09-12 16:15:25 -05003from typing import List
4
Patrick Williamscb882f82022-12-07 17:53:19 -06005from sh import curl # type: ignore
6
Patrick Williamsa523cec2022-09-12 16:15:25 -05007ENTERPRISES = {
8 0: "Reserved",
9 2: "IBM",
10 343: "Intel Corporation",
11 674: "Dell Inc.",
12 1694: "HCL Technologies Limited",
13 2487: "Phoenix Technologies Ltd.",
14 4128: "ARM Ltd.",
15 6569: "INVENTEC CORPORATION",
16 7244: "Quanta Computer Inc.",
17 8554: "Departement Elektrotechnik, ETH Zuerich",
18 11129: "Google, Inc.",
19 11183: "Mitac International Corp.",
20 19046: "Lenovo Enterprise Business Group",
21 20974: "American Megatrends, Inc",
22 33049: "Mellanox Technologies LTD",
23 40092: "Wiwynn Corporation",
24 40981: "Facebook, Inc.",
25 42817: "IBM Platform Firmware Division",
26 45065: "Insyde",
27 48482: "Linaro Ltd",
28 48512: "Inspur Group Co.,Ltd.",
29 49150: "Vertiv Co",
Patrick Williams7bbf5a92023-01-24 17:31:19 -060030 49622: "ASRock Rack Incorporation",
Patrick Williamsa523cec2022-09-12 16:15:25 -050031 49769: "YADRO",
32 51974: "Raptor Computing Systems, LLC",
33 52538: "Ampere Computing",
George Liuc328a092022-09-11 14:27:13 +080034 52893: "Inspur Power Systems Co.,Ltd.",
Patrick Williamsa523cec2022-09-12 16:15:25 -050035}
36
Patrick Williamscb882f82022-12-07 17:53:19 -060037HEADER = """\
Patrick Williamsa523cec2022-09-12 16:15:25 -050038This file has been reduced to entities signing CLAs with OpenBMC
39https://drive.google.com/drive/folders/1Ooi0RdTcaOWF1DWFJUAJDdN7tRKde7Nl\
Patrick Williamscb882f82022-12-07 17:53:19 -060040"""
Patrick Williamsa523cec2022-09-12 16:15:25 -050041
42found_first: bool = False
43org: List[str] = []
44
Patrick Williamscb882f82022-12-07 17:53:19 -060045for ln in curl(
Patrick Williams7bbf5a92023-01-24 17:31:19 -060046 "-L", "https://www.iana.org/assignments/enterprise-numbers.txt"
Patrick Williamsa523cec2022-09-12 16:15:25 -050047).splitlines():
Patrick Williamscb882f82022-12-07 17:53:19 -060048 line = ln.rstrip()
Patrick Williamsa523cec2022-09-12 16:15:25 -050049
50 # Look for Reserved/EN-0 as the start of the data.
51 if "0" == line:
52 found_first = True
53
54 # Haven't found EN-0, emit as is.
55 if not found_first:
56 print(line)
57 # Look for magic string.
58 if line.startswith("This file is "):
59 print(HEADER)
60 continue
61
62 # Add line into 'org' set.
63 org.append(line)
64
65 # Every 4 lines (EN, Org, Contact, Email) make an org.
66 if len(org) == 4:
67 if int(org[0]) in ENTERPRISES:
68 for g in org:
69 print(g)
70
71 org = []