wireshark/tools/make-pci-ids.py

250 lines
6.4 KiB
Python
Raw Normal View History

NCSI: Squash commits of NCSI and PCI-IDS NCSI: Extends NCSI dissection based on DSP0222 Version: 1.2.0_2b Add pci-ids.c and pci-ids.h for mapping PCI IDs(VID,DID,SID,SVID) to string. Extends NCSI dissection to support DSP0222 Version: 1.2.0_2b. Extends NCSI dissection to support Mellanox OEM commands. NCSI: Use TFS for boolean mapped string and added AEN dissectors 1. Use the tfs defined in tfs.c 2. Refine the boolean mapped strings to be TFS style 3. Added dissectors for AEN NSCI: Fixed erros with gcc 7.5.0 1. Fix compiling errors with gcc 7.5.0 under Ubuntu 18.04 2. Sloved complaints of git pre-commit hook NCSI: Add "0x" prefix for displaying HEX values There are codes display HEX values without prefix, added "0x" to fix that. PCI-IDS: Added PCI ID file and python script to convert it to C codes 1. Added the PCI ID file pci.ids from https://pci-ids.ucw.cz/ 2. Added pci-ids-convert.py to convert to epan/dissectors/pci-ids.c PCI-IDS: Updated the PCI ID list to be Version 2021.01.11 NCSI: Remove trailing spaces and unused href entries PCI-IDS: Use a fresh copy of pci.ids to generate pci-ids.c 1. Renamed pci-ids-convert.py to make-pci-ids.py 2. make-pci-ids.py uses a fresh copy of pic.ids to generate pci-ids.c PCI-IDS: Move internal structure to C file 1. Move pci_id_t and pci_vid_index_t from header file to C file. 2. Refined the comments of pci-ids.c 3. Renamed local variable index (shadow variable) to idx PCI-IDS: Refined binary search codes PCI-IDS: Moved pci-ids.[ch] to epan/ Moved pci-ids.[ch] to epan/ as they ought to be
2021-02-17 07:10:31 +00:00
#!/usr/bin/env python3
#
# make-pci-ids - Creates a file containing PCI IDs.
# It use the databases from
# https://github.com/pciutils/pciids/raw/master/pci.ids
# to create our file epan/dissectors/pci-ids.c
#
# Wireshark - Network traffic analyzer
#
# By Caleb Chiu <caleb.chiu@macnica.com>
# Copyright 2021
#
# SPDX-License-Identifier: GPL-2.0-or-later
#
import string
import sys
import urllib.request, urllib.error, urllib.parse
OUTPUT_FILE = "epan/pci-ids.c"
MIN_VENDOR_COUNT = 2250 # 2261 on 2021-11-01
MIN_DEVICE_COUNT = 33000 # 33724 on 2021-11-01
CODE_PREFIX = """\
*
NCSI: Squash commits of NCSI and PCI-IDS NCSI: Extends NCSI dissection based on DSP0222 Version: 1.2.0_2b Add pci-ids.c and pci-ids.h for mapping PCI IDs(VID,DID,SID,SVID) to string. Extends NCSI dissection to support DSP0222 Version: 1.2.0_2b. Extends NCSI dissection to support Mellanox OEM commands. NCSI: Use TFS for boolean mapped string and added AEN dissectors 1. Use the tfs defined in tfs.c 2. Refine the boolean mapped strings to be TFS style 3. Added dissectors for AEN NSCI: Fixed erros with gcc 7.5.0 1. Fix compiling errors with gcc 7.5.0 under Ubuntu 18.04 2. Sloved complaints of git pre-commit hook NCSI: Add "0x" prefix for displaying HEX values There are codes display HEX values without prefix, added "0x" to fix that. PCI-IDS: Added PCI ID file and python script to convert it to C codes 1. Added the PCI ID file pci.ids from https://pci-ids.ucw.cz/ 2. Added pci-ids-convert.py to convert to epan/dissectors/pci-ids.c PCI-IDS: Updated the PCI ID list to be Version 2021.01.11 NCSI: Remove trailing spaces and unused href entries PCI-IDS: Use a fresh copy of pci.ids to generate pci-ids.c 1. Renamed pci-ids-convert.py to make-pci-ids.py 2. make-pci-ids.py uses a fresh copy of pic.ids to generate pci-ids.c PCI-IDS: Move internal structure to C file 1. Move pci_id_t and pci_vid_index_t from header file to C file. 2. Refined the comments of pci-ids.c 3. Renamed local variable index (shadow variable) to idx PCI-IDS: Refined binary search codes PCI-IDS: Moved pci-ids.[ch] to epan/ Moved pci-ids.[ch] to epan/ as they ought to be
2021-02-17 07:10:31 +00:00
* Generated by tools/make-pci-ids.py
* By Caleb Chiu <caleb.chiu@macnica.com>
* Copyright 2021
*
*
* SPDX-License-Identifier: GPL-2.0-or-later
*/
#include <config.h>
#include \"pci-ids.h\"
typedef struct
{
guint16 vid;
guint16 did;
guint16 svid;
guint16 ssid;
gchar *name;
} pci_id_t;
typedef struct
{
guint16 vid;
guint16 count;
pci_id_t *ids_ptr;
} pci_vid_index_t;
"""
CODE_POSTFIX = """
NCSI: Squash commits of NCSI and PCI-IDS NCSI: Extends NCSI dissection based on DSP0222 Version: 1.2.0_2b Add pci-ids.c and pci-ids.h for mapping PCI IDs(VID,DID,SID,SVID) to string. Extends NCSI dissection to support DSP0222 Version: 1.2.0_2b. Extends NCSI dissection to support Mellanox OEM commands. NCSI: Use TFS for boolean mapped string and added AEN dissectors 1. Use the tfs defined in tfs.c 2. Refine the boolean mapped strings to be TFS style 3. Added dissectors for AEN NSCI: Fixed erros with gcc 7.5.0 1. Fix compiling errors with gcc 7.5.0 under Ubuntu 18.04 2. Sloved complaints of git pre-commit hook NCSI: Add "0x" prefix for displaying HEX values There are codes display HEX values without prefix, added "0x" to fix that. PCI-IDS: Added PCI ID file and python script to convert it to C codes 1. Added the PCI ID file pci.ids from https://pci-ids.ucw.cz/ 2. Added pci-ids-convert.py to convert to epan/dissectors/pci-ids.c PCI-IDS: Updated the PCI ID list to be Version 2021.01.11 NCSI: Remove trailing spaces and unused href entries PCI-IDS: Use a fresh copy of pci.ids to generate pci-ids.c 1. Renamed pci-ids-convert.py to make-pci-ids.py 2. make-pci-ids.py uses a fresh copy of pic.ids to generate pci-ids.c PCI-IDS: Move internal structure to C file 1. Move pci_id_t and pci_vid_index_t from header file to C file. 2. Refined the comments of pci-ids.c 3. Renamed local variable index (shadow variable) to idx PCI-IDS: Refined binary search codes PCI-IDS: Moved pci-ids.[ch] to epan/ Moved pci-ids.[ch] to epan/ as they ought to be
2021-02-17 07:10:31 +00:00
static pci_vid_index_t *get_vid_index(guint16 vid)
{
guint32 start_index = 0;
guint32 end_index = 0;
guint32 idx = 0;
end_index = sizeof(pci_vid_index)/sizeof(pci_vid_index[0]);
while(start_index != end_index)
{
if(end_index - start_index == 1)
{
if(pci_vid_index[start_index].vid == vid)
return &pci_vid_index[start_index];
break;
}
idx = (start_index + end_index)/2;
if(pci_vid_index[idx].vid < vid)
start_index = idx;
else
if(pci_vid_index[idx].vid > vid)
end_index = idx;
else
return &pci_vid_index[idx];
}
return NULL;
}
const char *pci_id_str(guint16 vid, guint16 did, guint16 svid, guint16 ssid)
{
unsigned int i;
static char *not_found = \"Not found\";
pci_vid_index_t *index_ptr;
pci_id_t *ids_ptr;
index_ptr = get_vid_index(vid);
if(index_ptr == NULL)
return not_found;
ids_ptr = index_ptr->ids_ptr;
for(i = 0; i < index_ptr->count; ids_ptr++, i++)
if(vid == ids_ptr->vid &&
did == ids_ptr->did &&
svid == ids_ptr->svid &&
ssid == ids_ptr->ssid)
return ids_ptr->name;
return not_found;
}
"""
NCSI: Squash commits of NCSI and PCI-IDS NCSI: Extends NCSI dissection based on DSP0222 Version: 1.2.0_2b Add pci-ids.c and pci-ids.h for mapping PCI IDs(VID,DID,SID,SVID) to string. Extends NCSI dissection to support DSP0222 Version: 1.2.0_2b. Extends NCSI dissection to support Mellanox OEM commands. NCSI: Use TFS for boolean mapped string and added AEN dissectors 1. Use the tfs defined in tfs.c 2. Refine the boolean mapped strings to be TFS style 3. Added dissectors for AEN NSCI: Fixed erros with gcc 7.5.0 1. Fix compiling errors with gcc 7.5.0 under Ubuntu 18.04 2. Sloved complaints of git pre-commit hook NCSI: Add "0x" prefix for displaying HEX values There are codes display HEX values without prefix, added "0x" to fix that. PCI-IDS: Added PCI ID file and python script to convert it to C codes 1. Added the PCI ID file pci.ids from https://pci-ids.ucw.cz/ 2. Added pci-ids-convert.py to convert to epan/dissectors/pci-ids.c PCI-IDS: Updated the PCI ID list to be Version 2021.01.11 NCSI: Remove trailing spaces and unused href entries PCI-IDS: Use a fresh copy of pci.ids to generate pci-ids.c 1. Renamed pci-ids-convert.py to make-pci-ids.py 2. make-pci-ids.py uses a fresh copy of pic.ids to generate pci-ids.c PCI-IDS: Move internal structure to C file 1. Move pci_id_t and pci_vid_index_t from header file to C file. 2. Refined the comments of pci-ids.c 3. Renamed local variable index (shadow variable) to idx PCI-IDS: Refined binary search codes PCI-IDS: Moved pci-ids.[ch] to epan/ Moved pci-ids.[ch] to epan/ as they ought to be
2021-02-17 07:10:31 +00:00
id_list=[]
count_list=[]
def exit_msg(msg=None, status=1):
if msg is not None:
sys.stderr.write(msg + '\n')
sys.exit(status)
NCSI: Squash commits of NCSI and PCI-IDS NCSI: Extends NCSI dissection based on DSP0222 Version: 1.2.0_2b Add pci-ids.c and pci-ids.h for mapping PCI IDs(VID,DID,SID,SVID) to string. Extends NCSI dissection to support DSP0222 Version: 1.2.0_2b. Extends NCSI dissection to support Mellanox OEM commands. NCSI: Use TFS for boolean mapped string and added AEN dissectors 1. Use the tfs defined in tfs.c 2. Refine the boolean mapped strings to be TFS style 3. Added dissectors for AEN NSCI: Fixed erros with gcc 7.5.0 1. Fix compiling errors with gcc 7.5.0 under Ubuntu 18.04 2. Sloved complaints of git pre-commit hook NCSI: Add "0x" prefix for displaying HEX values There are codes display HEX values without prefix, added "0x" to fix that. PCI-IDS: Added PCI ID file and python script to convert it to C codes 1. Added the PCI ID file pci.ids from https://pci-ids.ucw.cz/ 2. Added pci-ids-convert.py to convert to epan/dissectors/pci-ids.c PCI-IDS: Updated the PCI ID list to be Version 2021.01.11 NCSI: Remove trailing spaces and unused href entries PCI-IDS: Use a fresh copy of pci.ids to generate pci-ids.c 1. Renamed pci-ids-convert.py to make-pci-ids.py 2. make-pci-ids.py uses a fresh copy of pic.ids to generate pci-ids.c PCI-IDS: Move internal structure to C file 1. Move pci_id_t and pci_vid_index_t from header file to C file. 2. Refined the comments of pci-ids.c 3. Renamed local variable index (shadow variable) to idx PCI-IDS: Refined binary search codes PCI-IDS: Moved pci-ids.[ch] to epan/ Moved pci-ids.[ch] to epan/ as they ought to be
2021-02-17 07:10:31 +00:00
def main():
req_headers = { 'User-Agent': 'Wireshark make-pci-ids' }
req = urllib.request.Request('https://github.com/pciutils/pciids/raw/master/pci.ids', headers=req_headers)
response = urllib.request.urlopen(req)
lines = response.read().decode('UTF-8', 'replace').splitlines()
out_lines = '''\
/* pci-ids.c
*
* pci-ids.c is based on the pci.ids of The PCI ID Repository at
* https://pci-ids.ucw.cz/, fetched indirectly via
* https://github.com/pciutils/pciids
'''
NCSI: Squash commits of NCSI and PCI-IDS NCSI: Extends NCSI dissection based on DSP0222 Version: 1.2.0_2b Add pci-ids.c and pci-ids.h for mapping PCI IDs(VID,DID,SID,SVID) to string. Extends NCSI dissection to support DSP0222 Version: 1.2.0_2b. Extends NCSI dissection to support Mellanox OEM commands. NCSI: Use TFS for boolean mapped string and added AEN dissectors 1. Use the tfs defined in tfs.c 2. Refine the boolean mapped strings to be TFS style 3. Added dissectors for AEN NSCI: Fixed erros with gcc 7.5.0 1. Fix compiling errors with gcc 7.5.0 under Ubuntu 18.04 2. Sloved complaints of git pre-commit hook NCSI: Add "0x" prefix for displaying HEX values There are codes display HEX values without prefix, added "0x" to fix that. PCI-IDS: Added PCI ID file and python script to convert it to C codes 1. Added the PCI ID file pci.ids from https://pci-ids.ucw.cz/ 2. Added pci-ids-convert.py to convert to epan/dissectors/pci-ids.c PCI-IDS: Updated the PCI ID list to be Version 2021.01.11 NCSI: Remove trailing spaces and unused href entries PCI-IDS: Use a fresh copy of pci.ids to generate pci-ids.c 1. Renamed pci-ids-convert.py to make-pci-ids.py 2. make-pci-ids.py uses a fresh copy of pic.ids to generate pci-ids.c PCI-IDS: Move internal structure to C file 1. Move pci_id_t and pci_vid_index_t from header file to C file. 2. Refined the comments of pci-ids.c 3. Renamed local variable index (shadow variable) to idx PCI-IDS: Refined binary search codes PCI-IDS: Moved pci-ids.[ch] to epan/ Moved pci-ids.[ch] to epan/ as they ought to be
2021-02-17 07:10:31 +00:00
vid = -1
did = -1
svid = -1
entries = 0
line_num = 0
NCSI: Squash commits of NCSI and PCI-IDS NCSI: Extends NCSI dissection based on DSP0222 Version: 1.2.0_2b Add pci-ids.c and pci-ids.h for mapping PCI IDs(VID,DID,SID,SVID) to string. Extends NCSI dissection to support DSP0222 Version: 1.2.0_2b. Extends NCSI dissection to support Mellanox OEM commands. NCSI: Use TFS for boolean mapped string and added AEN dissectors 1. Use the tfs defined in tfs.c 2. Refine the boolean mapped strings to be TFS style 3. Added dissectors for AEN NSCI: Fixed erros with gcc 7.5.0 1. Fix compiling errors with gcc 7.5.0 under Ubuntu 18.04 2. Sloved complaints of git pre-commit hook NCSI: Add "0x" prefix for displaying HEX values There are codes display HEX values without prefix, added "0x" to fix that. PCI-IDS: Added PCI ID file and python script to convert it to C codes 1. Added the PCI ID file pci.ids from https://pci-ids.ucw.cz/ 2. Added pci-ids-convert.py to convert to epan/dissectors/pci-ids.c PCI-IDS: Updated the PCI ID list to be Version 2021.01.11 NCSI: Remove trailing spaces and unused href entries PCI-IDS: Use a fresh copy of pci.ids to generate pci-ids.c 1. Renamed pci-ids-convert.py to make-pci-ids.py 2. make-pci-ids.py uses a fresh copy of pic.ids to generate pci-ids.c PCI-IDS: Move internal structure to C file 1. Move pci_id_t and pci_vid_index_t from header file to C file. 2. Refined the comments of pci-ids.c 3. Renamed local variable index (shadow variable) to idx PCI-IDS: Refined binary search codes PCI-IDS: Moved pci-ids.[ch] to epan/ Moved pci-ids.[ch] to epan/ as they ought to be
2021-02-17 07:10:31 +00:00
for line in lines:
line = line.strip('\n')
line_num += 1
if line_num <= 15:
line = line.replace('#', ' ', 1)
line = line.lstrip()
line = line.replace("GNU General Public License", "GPL")
if line:
line = ' * ' + line
else:
line = ' *' + line
out_lines += line + '\n'
NCSI: Squash commits of NCSI and PCI-IDS NCSI: Extends NCSI dissection based on DSP0222 Version: 1.2.0_2b Add pci-ids.c and pci-ids.h for mapping PCI IDs(VID,DID,SID,SVID) to string. Extends NCSI dissection to support DSP0222 Version: 1.2.0_2b. Extends NCSI dissection to support Mellanox OEM commands. NCSI: Use TFS for boolean mapped string and added AEN dissectors 1. Use the tfs defined in tfs.c 2. Refine the boolean mapped strings to be TFS style 3. Added dissectors for AEN NSCI: Fixed erros with gcc 7.5.0 1. Fix compiling errors with gcc 7.5.0 under Ubuntu 18.04 2. Sloved complaints of git pre-commit hook NCSI: Add "0x" prefix for displaying HEX values There are codes display HEX values without prefix, added "0x" to fix that. PCI-IDS: Added PCI ID file and python script to convert it to C codes 1. Added the PCI ID file pci.ids from https://pci-ids.ucw.cz/ 2. Added pci-ids-convert.py to convert to epan/dissectors/pci-ids.c PCI-IDS: Updated the PCI ID list to be Version 2021.01.11 NCSI: Remove trailing spaces and unused href entries PCI-IDS: Use a fresh copy of pci.ids to generate pci-ids.c 1. Renamed pci-ids-convert.py to make-pci-ids.py 2. make-pci-ids.py uses a fresh copy of pic.ids to generate pci-ids.c PCI-IDS: Move internal structure to C file 1. Move pci_id_t and pci_vid_index_t from header file to C file. 2. Refined the comments of pci-ids.c 3. Renamed local variable index (shadow variable) to idx PCI-IDS: Refined binary search codes PCI-IDS: Moved pci-ids.[ch] to epan/ Moved pci-ids.[ch] to epan/ as they ought to be
2021-02-17 07:10:31 +00:00
if line_num == 15:
out_lines += CODE_PREFIX
NCSI: Squash commits of NCSI and PCI-IDS NCSI: Extends NCSI dissection based on DSP0222 Version: 1.2.0_2b Add pci-ids.c and pci-ids.h for mapping PCI IDs(VID,DID,SID,SVID) to string. Extends NCSI dissection to support DSP0222 Version: 1.2.0_2b. Extends NCSI dissection to support Mellanox OEM commands. NCSI: Use TFS for boolean mapped string and added AEN dissectors 1. Use the tfs defined in tfs.c 2. Refine the boolean mapped strings to be TFS style 3. Added dissectors for AEN NSCI: Fixed erros with gcc 7.5.0 1. Fix compiling errors with gcc 7.5.0 under Ubuntu 18.04 2. Sloved complaints of git pre-commit hook NCSI: Add "0x" prefix for displaying HEX values There are codes display HEX values without prefix, added "0x" to fix that. PCI-IDS: Added PCI ID file and python script to convert it to C codes 1. Added the PCI ID file pci.ids from https://pci-ids.ucw.cz/ 2. Added pci-ids-convert.py to convert to epan/dissectors/pci-ids.c PCI-IDS: Updated the PCI ID list to be Version 2021.01.11 NCSI: Remove trailing spaces and unused href entries PCI-IDS: Use a fresh copy of pci.ids to generate pci-ids.c 1. Renamed pci-ids-convert.py to make-pci-ids.py 2. make-pci-ids.py uses a fresh copy of pic.ids to generate pci-ids.c PCI-IDS: Move internal structure to C file 1. Move pci_id_t and pci_vid_index_t from header file to C file. 2. Refined the comments of pci-ids.c 3. Renamed local variable index (shadow variable) to idx PCI-IDS: Refined binary search codes PCI-IDS: Moved pci-ids.[ch] to epan/ Moved pci-ids.[ch] to epan/ as they ought to be
2021-02-17 07:10:31 +00:00
line = line.replace("\\","\\\\")
NCSI: Squash commits of NCSI and PCI-IDS NCSI: Extends NCSI dissection based on DSP0222 Version: 1.2.0_2b Add pci-ids.c and pci-ids.h for mapping PCI IDs(VID,DID,SID,SVID) to string. Extends NCSI dissection to support DSP0222 Version: 1.2.0_2b. Extends NCSI dissection to support Mellanox OEM commands. NCSI: Use TFS for boolean mapped string and added AEN dissectors 1. Use the tfs defined in tfs.c 2. Refine the boolean mapped strings to be TFS style 3. Added dissectors for AEN NSCI: Fixed erros with gcc 7.5.0 1. Fix compiling errors with gcc 7.5.0 under Ubuntu 18.04 2. Sloved complaints of git pre-commit hook NCSI: Add "0x" prefix for displaying HEX values There are codes display HEX values without prefix, added "0x" to fix that. PCI-IDS: Added PCI ID file and python script to convert it to C codes 1. Added the PCI ID file pci.ids from https://pci-ids.ucw.cz/ 2. Added pci-ids-convert.py to convert to epan/dissectors/pci-ids.c PCI-IDS: Updated the PCI ID list to be Version 2021.01.11 NCSI: Remove trailing spaces and unused href entries PCI-IDS: Use a fresh copy of pci.ids to generate pci-ids.c 1. Renamed pci-ids-convert.py to make-pci-ids.py 2. make-pci-ids.py uses a fresh copy of pic.ids to generate pci-ids.c PCI-IDS: Move internal structure to C file 1. Move pci_id_t and pci_vid_index_t from header file to C file. 2. Refined the comments of pci-ids.c 3. Renamed local variable index (shadow variable) to idx PCI-IDS: Refined binary search codes PCI-IDS: Moved pci-ids.[ch] to epan/ Moved pci-ids.[ch] to epan/ as they ought to be
2021-02-17 07:10:31 +00:00
line = line.replace("\"","\\\"")
line = line.replace("?","?-")
NCSI: Squash commits of NCSI and PCI-IDS NCSI: Extends NCSI dissection based on DSP0222 Version: 1.2.0_2b Add pci-ids.c and pci-ids.h for mapping PCI IDs(VID,DID,SID,SVID) to string. Extends NCSI dissection to support DSP0222 Version: 1.2.0_2b. Extends NCSI dissection to support Mellanox OEM commands. NCSI: Use TFS for boolean mapped string and added AEN dissectors 1. Use the tfs defined in tfs.c 2. Refine the boolean mapped strings to be TFS style 3. Added dissectors for AEN NSCI: Fixed erros with gcc 7.5.0 1. Fix compiling errors with gcc 7.5.0 under Ubuntu 18.04 2. Sloved complaints of git pre-commit hook NCSI: Add "0x" prefix for displaying HEX values There are codes display HEX values without prefix, added "0x" to fix that. PCI-IDS: Added PCI ID file and python script to convert it to C codes 1. Added the PCI ID file pci.ids from https://pci-ids.ucw.cz/ 2. Added pci-ids-convert.py to convert to epan/dissectors/pci-ids.c PCI-IDS: Updated the PCI ID list to be Version 2021.01.11 NCSI: Remove trailing spaces and unused href entries PCI-IDS: Use a fresh copy of pci.ids to generate pci-ids.c 1. Renamed pci-ids-convert.py to make-pci-ids.py 2. make-pci-ids.py uses a fresh copy of pic.ids to generate pci-ids.c PCI-IDS: Move internal structure to C file 1. Move pci_id_t and pci_vid_index_t from header file to C file. 2. Refined the comments of pci-ids.c 3. Renamed local variable index (shadow variable) to idx PCI-IDS: Refined binary search codes PCI-IDS: Moved pci-ids.[ch] to epan/ Moved pci-ids.[ch] to epan/ as they ought to be
2021-02-17 07:10:31 +00:00
tabs = len(line) - len(line.lstrip('\t'))
if tabs == 0:
#print line
words = line.split(" ", 1)
if len(words) < 2:
NCSI: Squash commits of NCSI and PCI-IDS NCSI: Extends NCSI dissection based on DSP0222 Version: 1.2.0_2b Add pci-ids.c and pci-ids.h for mapping PCI IDs(VID,DID,SID,SVID) to string. Extends NCSI dissection to support DSP0222 Version: 1.2.0_2b. Extends NCSI dissection to support Mellanox OEM commands. NCSI: Use TFS for boolean mapped string and added AEN dissectors 1. Use the tfs defined in tfs.c 2. Refine the boolean mapped strings to be TFS style 3. Added dissectors for AEN NSCI: Fixed erros with gcc 7.5.0 1. Fix compiling errors with gcc 7.5.0 under Ubuntu 18.04 2. Sloved complaints of git pre-commit hook NCSI: Add "0x" prefix for displaying HEX values There are codes display HEX values without prefix, added "0x" to fix that. PCI-IDS: Added PCI ID file and python script to convert it to C codes 1. Added the PCI ID file pci.ids from https://pci-ids.ucw.cz/ 2. Added pci-ids-convert.py to convert to epan/dissectors/pci-ids.c PCI-IDS: Updated the PCI ID list to be Version 2021.01.11 NCSI: Remove trailing spaces and unused href entries PCI-IDS: Use a fresh copy of pci.ids to generate pci-ids.c 1. Renamed pci-ids-convert.py to make-pci-ids.py 2. make-pci-ids.py uses a fresh copy of pic.ids to generate pci-ids.c PCI-IDS: Move internal structure to C file 1. Move pci_id_t and pci_vid_index_t from header file to C file. 2. Refined the comments of pci-ids.c 3. Renamed local variable index (shadow variable) to idx PCI-IDS: Refined binary search codes PCI-IDS: Moved pci-ids.[ch] to epan/ Moved pci-ids.[ch] to epan/ as they ought to be
2021-02-17 07:10:31 +00:00
continue
if len(words[0]) != 4:
NCSI: Squash commits of NCSI and PCI-IDS NCSI: Extends NCSI dissection based on DSP0222 Version: 1.2.0_2b Add pci-ids.c and pci-ids.h for mapping PCI IDs(VID,DID,SID,SVID) to string. Extends NCSI dissection to support DSP0222 Version: 1.2.0_2b. Extends NCSI dissection to support Mellanox OEM commands. NCSI: Use TFS for boolean mapped string and added AEN dissectors 1. Use the tfs defined in tfs.c 2. Refine the boolean mapped strings to be TFS style 3. Added dissectors for AEN NSCI: Fixed erros with gcc 7.5.0 1. Fix compiling errors with gcc 7.5.0 under Ubuntu 18.04 2. Sloved complaints of git pre-commit hook NCSI: Add "0x" prefix for displaying HEX values There are codes display HEX values without prefix, added "0x" to fix that. PCI-IDS: Added PCI ID file and python script to convert it to C codes 1. Added the PCI ID file pci.ids from https://pci-ids.ucw.cz/ 2. Added pci-ids-convert.py to convert to epan/dissectors/pci-ids.c PCI-IDS: Updated the PCI ID list to be Version 2021.01.11 NCSI: Remove trailing spaces and unused href entries PCI-IDS: Use a fresh copy of pci.ids to generate pci-ids.c 1. Renamed pci-ids-convert.py to make-pci-ids.py 2. make-pci-ids.py uses a fresh copy of pic.ids to generate pci-ids.c PCI-IDS: Move internal structure to C file 1. Move pci_id_t and pci_vid_index_t from header file to C file. 2. Refined the comments of pci-ids.c 3. Renamed local variable index (shadow variable) to idx PCI-IDS: Refined binary search codes PCI-IDS: Moved pci-ids.[ch] to epan/ Moved pci-ids.[ch] to epan/ as they ought to be
2021-02-17 07:10:31 +00:00
continue
if all(c in string.hexdigits for c in words[0]):
NCSI: Squash commits of NCSI and PCI-IDS NCSI: Extends NCSI dissection based on DSP0222 Version: 1.2.0_2b Add pci-ids.c and pci-ids.h for mapping PCI IDs(VID,DID,SID,SVID) to string. Extends NCSI dissection to support DSP0222 Version: 1.2.0_2b. Extends NCSI dissection to support Mellanox OEM commands. NCSI: Use TFS for boolean mapped string and added AEN dissectors 1. Use the tfs defined in tfs.c 2. Refine the boolean mapped strings to be TFS style 3. Added dissectors for AEN NSCI: Fixed erros with gcc 7.5.0 1. Fix compiling errors with gcc 7.5.0 under Ubuntu 18.04 2. Sloved complaints of git pre-commit hook NCSI: Add "0x" prefix for displaying HEX values There are codes display HEX values without prefix, added "0x" to fix that. PCI-IDS: Added PCI ID file and python script to convert it to C codes 1. Added the PCI ID file pci.ids from https://pci-ids.ucw.cz/ 2. Added pci-ids-convert.py to convert to epan/dissectors/pci-ids.c PCI-IDS: Updated the PCI ID list to be Version 2021.01.11 NCSI: Remove trailing spaces and unused href entries PCI-IDS: Use a fresh copy of pci.ids to generate pci-ids.c 1. Renamed pci-ids-convert.py to make-pci-ids.py 2. make-pci-ids.py uses a fresh copy of pic.ids to generate pci-ids.c PCI-IDS: Move internal structure to C file 1. Move pci_id_t and pci_vid_index_t from header file to C file. 2. Refined the comments of pci-ids.c 3. Renamed local variable index (shadow variable) to idx PCI-IDS: Refined binary search codes PCI-IDS: Moved pci-ids.[ch] to epan/ Moved pci-ids.[ch] to epan/ as they ought to be
2021-02-17 07:10:31 +00:00
hex_int = int(words[0], 16)
if vid != -1:
out_lines += "}; /* pci_vid_%04X[] */\n\n" % (vid)
NCSI: Squash commits of NCSI and PCI-IDS NCSI: Extends NCSI dissection based on DSP0222 Version: 1.2.0_2b Add pci-ids.c and pci-ids.h for mapping PCI IDs(VID,DID,SID,SVID) to string. Extends NCSI dissection to support DSP0222 Version: 1.2.0_2b. Extends NCSI dissection to support Mellanox OEM commands. NCSI: Use TFS for boolean mapped string and added AEN dissectors 1. Use the tfs defined in tfs.c 2. Refine the boolean mapped strings to be TFS style 3. Added dissectors for AEN NSCI: Fixed erros with gcc 7.5.0 1. Fix compiling errors with gcc 7.5.0 under Ubuntu 18.04 2. Sloved complaints of git pre-commit hook NCSI: Add "0x" prefix for displaying HEX values There are codes display HEX values without prefix, added "0x" to fix that. PCI-IDS: Added PCI ID file and python script to convert it to C codes 1. Added the PCI ID file pci.ids from https://pci-ids.ucw.cz/ 2. Added pci-ids-convert.py to convert to epan/dissectors/pci-ids.c PCI-IDS: Updated the PCI ID list to be Version 2021.01.11 NCSI: Remove trailing spaces and unused href entries PCI-IDS: Use a fresh copy of pci.ids to generate pci-ids.c 1. Renamed pci-ids-convert.py to make-pci-ids.py 2. make-pci-ids.py uses a fresh copy of pic.ids to generate pci-ids.c PCI-IDS: Move internal structure to C file 1. Move pci_id_t and pci_vid_index_t from header file to C file. 2. Refined the comments of pci-ids.c 3. Renamed local variable index (shadow variable) to idx PCI-IDS: Refined binary search codes PCI-IDS: Moved pci-ids.[ch] to epan/ Moved pci-ids.[ch] to epan/ as they ought to be
2021-02-17 07:10:31 +00:00
count_list.append(entries)
vid = hex_int
entries = 1
NCSI: Squash commits of NCSI and PCI-IDS NCSI: Extends NCSI dissection based on DSP0222 Version: 1.2.0_2b Add pci-ids.c and pci-ids.h for mapping PCI IDs(VID,DID,SID,SVID) to string. Extends NCSI dissection to support DSP0222 Version: 1.2.0_2b. Extends NCSI dissection to support Mellanox OEM commands. NCSI: Use TFS for boolean mapped string and added AEN dissectors 1. Use the tfs defined in tfs.c 2. Refine the boolean mapped strings to be TFS style 3. Added dissectors for AEN NSCI: Fixed erros with gcc 7.5.0 1. Fix compiling errors with gcc 7.5.0 under Ubuntu 18.04 2. Sloved complaints of git pre-commit hook NCSI: Add "0x" prefix for displaying HEX values There are codes display HEX values without prefix, added "0x" to fix that. PCI-IDS: Added PCI ID file and python script to convert it to C codes 1. Added the PCI ID file pci.ids from https://pci-ids.ucw.cz/ 2. Added pci-ids-convert.py to convert to epan/dissectors/pci-ids.c PCI-IDS: Updated the PCI ID list to be Version 2021.01.11 NCSI: Remove trailing spaces and unused href entries PCI-IDS: Use a fresh copy of pci.ids to generate pci-ids.c 1. Renamed pci-ids-convert.py to make-pci-ids.py 2. make-pci-ids.py uses a fresh copy of pic.ids to generate pci-ids.c PCI-IDS: Move internal structure to C file 1. Move pci_id_t and pci_vid_index_t from header file to C file. 2. Refined the comments of pci-ids.c 3. Renamed local variable index (shadow variable) to idx PCI-IDS: Refined binary search codes PCI-IDS: Moved pci-ids.[ch] to epan/ Moved pci-ids.[ch] to epan/ as they ought to be
2021-02-17 07:10:31 +00:00
did = -1
svid = -1
ssid = -1
out_lines += "pci_id_t pci_vid_%04X[] = {\n" % (vid)
out_lines += "{0x%04X, 0xFFFF, 0xFFFF, 0xFFFF, \"%s(0x%04X)\"},\n" % (vid, words[1].strip(), vid)
id_list.append(vid)
continue
NCSI: Squash commits of NCSI and PCI-IDS NCSI: Extends NCSI dissection based on DSP0222 Version: 1.2.0_2b Add pci-ids.c and pci-ids.h for mapping PCI IDs(VID,DID,SID,SVID) to string. Extends NCSI dissection to support DSP0222 Version: 1.2.0_2b. Extends NCSI dissection to support Mellanox OEM commands. NCSI: Use TFS for boolean mapped string and added AEN dissectors 1. Use the tfs defined in tfs.c 2. Refine the boolean mapped strings to be TFS style 3. Added dissectors for AEN NSCI: Fixed erros with gcc 7.5.0 1. Fix compiling errors with gcc 7.5.0 under Ubuntu 18.04 2. Sloved complaints of git pre-commit hook NCSI: Add "0x" prefix for displaying HEX values There are codes display HEX values without prefix, added "0x" to fix that. PCI-IDS: Added PCI ID file and python script to convert it to C codes 1. Added the PCI ID file pci.ids from https://pci-ids.ucw.cz/ 2. Added pci-ids-convert.py to convert to epan/dissectors/pci-ids.c PCI-IDS: Updated the PCI ID list to be Version 2021.01.11 NCSI: Remove trailing spaces and unused href entries PCI-IDS: Use a fresh copy of pci.ids to generate pci-ids.c 1. Renamed pci-ids-convert.py to make-pci-ids.py 2. make-pci-ids.py uses a fresh copy of pic.ids to generate pci-ids.c PCI-IDS: Move internal structure to C file 1. Move pci_id_t and pci_vid_index_t from header file to C file. 2. Refined the comments of pci-ids.c 3. Renamed local variable index (shadow variable) to idx PCI-IDS: Refined binary search codes PCI-IDS: Moved pci-ids.[ch] to epan/ Moved pci-ids.[ch] to epan/ as they ought to be
2021-02-17 07:10:31 +00:00
if tabs == 1:
line = line.strip('\t')
words = line.split(" ", 1)
if len(words) < 2:
NCSI: Squash commits of NCSI and PCI-IDS NCSI: Extends NCSI dissection based on DSP0222 Version: 1.2.0_2b Add pci-ids.c and pci-ids.h for mapping PCI IDs(VID,DID,SID,SVID) to string. Extends NCSI dissection to support DSP0222 Version: 1.2.0_2b. Extends NCSI dissection to support Mellanox OEM commands. NCSI: Use TFS for boolean mapped string and added AEN dissectors 1. Use the tfs defined in tfs.c 2. Refine the boolean mapped strings to be TFS style 3. Added dissectors for AEN NSCI: Fixed erros with gcc 7.5.0 1. Fix compiling errors with gcc 7.5.0 under Ubuntu 18.04 2. Sloved complaints of git pre-commit hook NCSI: Add "0x" prefix for displaying HEX values There are codes display HEX values without prefix, added "0x" to fix that. PCI-IDS: Added PCI ID file and python script to convert it to C codes 1. Added the PCI ID file pci.ids from https://pci-ids.ucw.cz/ 2. Added pci-ids-convert.py to convert to epan/dissectors/pci-ids.c PCI-IDS: Updated the PCI ID list to be Version 2021.01.11 NCSI: Remove trailing spaces and unused href entries PCI-IDS: Use a fresh copy of pci.ids to generate pci-ids.c 1. Renamed pci-ids-convert.py to make-pci-ids.py 2. make-pci-ids.py uses a fresh copy of pic.ids to generate pci-ids.c PCI-IDS: Move internal structure to C file 1. Move pci_id_t and pci_vid_index_t from header file to C file. 2. Refined the comments of pci-ids.c 3. Renamed local variable index (shadow variable) to idx PCI-IDS: Refined binary search codes PCI-IDS: Moved pci-ids.[ch] to epan/ Moved pci-ids.[ch] to epan/ as they ought to be
2021-02-17 07:10:31 +00:00
continue
if len(words[0]) != 4:
NCSI: Squash commits of NCSI and PCI-IDS NCSI: Extends NCSI dissection based on DSP0222 Version: 1.2.0_2b Add pci-ids.c and pci-ids.h for mapping PCI IDs(VID,DID,SID,SVID) to string. Extends NCSI dissection to support DSP0222 Version: 1.2.0_2b. Extends NCSI dissection to support Mellanox OEM commands. NCSI: Use TFS for boolean mapped string and added AEN dissectors 1. Use the tfs defined in tfs.c 2. Refine the boolean mapped strings to be TFS style 3. Added dissectors for AEN NSCI: Fixed erros with gcc 7.5.0 1. Fix compiling errors with gcc 7.5.0 under Ubuntu 18.04 2. Sloved complaints of git pre-commit hook NCSI: Add "0x" prefix for displaying HEX values There are codes display HEX values without prefix, added "0x" to fix that. PCI-IDS: Added PCI ID file and python script to convert it to C codes 1. Added the PCI ID file pci.ids from https://pci-ids.ucw.cz/ 2. Added pci-ids-convert.py to convert to epan/dissectors/pci-ids.c PCI-IDS: Updated the PCI ID list to be Version 2021.01.11 NCSI: Remove trailing spaces and unused href entries PCI-IDS: Use a fresh copy of pci.ids to generate pci-ids.c 1. Renamed pci-ids-convert.py to make-pci-ids.py 2. make-pci-ids.py uses a fresh copy of pic.ids to generate pci-ids.c PCI-IDS: Move internal structure to C file 1. Move pci_id_t and pci_vid_index_t from header file to C file. 2. Refined the comments of pci-ids.c 3. Renamed local variable index (shadow variable) to idx PCI-IDS: Refined binary search codes PCI-IDS: Moved pci-ids.[ch] to epan/ Moved pci-ids.[ch] to epan/ as they ought to be
2021-02-17 07:10:31 +00:00
continue
if all(c in string.hexdigits for c in words[0]):
NCSI: Squash commits of NCSI and PCI-IDS NCSI: Extends NCSI dissection based on DSP0222 Version: 1.2.0_2b Add pci-ids.c and pci-ids.h for mapping PCI IDs(VID,DID,SID,SVID) to string. Extends NCSI dissection to support DSP0222 Version: 1.2.0_2b. Extends NCSI dissection to support Mellanox OEM commands. NCSI: Use TFS for boolean mapped string and added AEN dissectors 1. Use the tfs defined in tfs.c 2. Refine the boolean mapped strings to be TFS style 3. Added dissectors for AEN NSCI: Fixed erros with gcc 7.5.0 1. Fix compiling errors with gcc 7.5.0 under Ubuntu 18.04 2. Sloved complaints of git pre-commit hook NCSI: Add "0x" prefix for displaying HEX values There are codes display HEX values without prefix, added "0x" to fix that. PCI-IDS: Added PCI ID file and python script to convert it to C codes 1. Added the PCI ID file pci.ids from https://pci-ids.ucw.cz/ 2. Added pci-ids-convert.py to convert to epan/dissectors/pci-ids.c PCI-IDS: Updated the PCI ID list to be Version 2021.01.11 NCSI: Remove trailing spaces and unused href entries PCI-IDS: Use a fresh copy of pci.ids to generate pci-ids.c 1. Renamed pci-ids-convert.py to make-pci-ids.py 2. make-pci-ids.py uses a fresh copy of pic.ids to generate pci-ids.c PCI-IDS: Move internal structure to C file 1. Move pci_id_t and pci_vid_index_t from header file to C file. 2. Refined the comments of pci-ids.c 3. Renamed local variable index (shadow variable) to idx PCI-IDS: Refined binary search codes PCI-IDS: Moved pci-ids.[ch] to epan/ Moved pci-ids.[ch] to epan/ as they ought to be
2021-02-17 07:10:31 +00:00
hex_int = int(words[0], 16)
did = hex_int
svid = -1
ssid = -1
out_lines += "{0x%04X, 0x%04X, 0xFFFF, 0xFFFF, \"%s(0x%04X)\"},\n" % (vid, did, words[1].strip(), did)
entries += 1
continue
NCSI: Squash commits of NCSI and PCI-IDS NCSI: Extends NCSI dissection based on DSP0222 Version: 1.2.0_2b Add pci-ids.c and pci-ids.h for mapping PCI IDs(VID,DID,SID,SVID) to string. Extends NCSI dissection to support DSP0222 Version: 1.2.0_2b. Extends NCSI dissection to support Mellanox OEM commands. NCSI: Use TFS for boolean mapped string and added AEN dissectors 1. Use the tfs defined in tfs.c 2. Refine the boolean mapped strings to be TFS style 3. Added dissectors for AEN NSCI: Fixed erros with gcc 7.5.0 1. Fix compiling errors with gcc 7.5.0 under Ubuntu 18.04 2. Sloved complaints of git pre-commit hook NCSI: Add "0x" prefix for displaying HEX values There are codes display HEX values without prefix, added "0x" to fix that. PCI-IDS: Added PCI ID file and python script to convert it to C codes 1. Added the PCI ID file pci.ids from https://pci-ids.ucw.cz/ 2. Added pci-ids-convert.py to convert to epan/dissectors/pci-ids.c PCI-IDS: Updated the PCI ID list to be Version 2021.01.11 NCSI: Remove trailing spaces and unused href entries PCI-IDS: Use a fresh copy of pci.ids to generate pci-ids.c 1. Renamed pci-ids-convert.py to make-pci-ids.py 2. make-pci-ids.py uses a fresh copy of pic.ids to generate pci-ids.c PCI-IDS: Move internal structure to C file 1. Move pci_id_t and pci_vid_index_t from header file to C file. 2. Refined the comments of pci-ids.c 3. Renamed local variable index (shadow variable) to idx PCI-IDS: Refined binary search codes PCI-IDS: Moved pci-ids.[ch] to epan/ Moved pci-ids.[ch] to epan/ as they ought to be
2021-02-17 07:10:31 +00:00
if tabs == 2:
line = line.strip('\t')
words = line.split(" ", 2)
if len(words[0]) != 4:
NCSI: Squash commits of NCSI and PCI-IDS NCSI: Extends NCSI dissection based on DSP0222 Version: 1.2.0_2b Add pci-ids.c and pci-ids.h for mapping PCI IDs(VID,DID,SID,SVID) to string. Extends NCSI dissection to support DSP0222 Version: 1.2.0_2b. Extends NCSI dissection to support Mellanox OEM commands. NCSI: Use TFS for boolean mapped string and added AEN dissectors 1. Use the tfs defined in tfs.c 2. Refine the boolean mapped strings to be TFS style 3. Added dissectors for AEN NSCI: Fixed erros with gcc 7.5.0 1. Fix compiling errors with gcc 7.5.0 under Ubuntu 18.04 2. Sloved complaints of git pre-commit hook NCSI: Add "0x" prefix for displaying HEX values There are codes display HEX values without prefix, added "0x" to fix that. PCI-IDS: Added PCI ID file and python script to convert it to C codes 1. Added the PCI ID file pci.ids from https://pci-ids.ucw.cz/ 2. Added pci-ids-convert.py to convert to epan/dissectors/pci-ids.c PCI-IDS: Updated the PCI ID list to be Version 2021.01.11 NCSI: Remove trailing spaces and unused href entries PCI-IDS: Use a fresh copy of pci.ids to generate pci-ids.c 1. Renamed pci-ids-convert.py to make-pci-ids.py 2. make-pci-ids.py uses a fresh copy of pic.ids to generate pci-ids.c PCI-IDS: Move internal structure to C file 1. Move pci_id_t and pci_vid_index_t from header file to C file. 2. Refined the comments of pci-ids.c 3. Renamed local variable index (shadow variable) to idx PCI-IDS: Refined binary search codes PCI-IDS: Moved pci-ids.[ch] to epan/ Moved pci-ids.[ch] to epan/ as they ought to be
2021-02-17 07:10:31 +00:00
continue
if all(c in string.hexdigits for c in words[0]):
NCSI: Squash commits of NCSI and PCI-IDS NCSI: Extends NCSI dissection based on DSP0222 Version: 1.2.0_2b Add pci-ids.c and pci-ids.h for mapping PCI IDs(VID,DID,SID,SVID) to string. Extends NCSI dissection to support DSP0222 Version: 1.2.0_2b. Extends NCSI dissection to support Mellanox OEM commands. NCSI: Use TFS for boolean mapped string and added AEN dissectors 1. Use the tfs defined in tfs.c 2. Refine the boolean mapped strings to be TFS style 3. Added dissectors for AEN NSCI: Fixed erros with gcc 7.5.0 1. Fix compiling errors with gcc 7.5.0 under Ubuntu 18.04 2. Sloved complaints of git pre-commit hook NCSI: Add "0x" prefix for displaying HEX values There are codes display HEX values without prefix, added "0x" to fix that. PCI-IDS: Added PCI ID file and python script to convert it to C codes 1. Added the PCI ID file pci.ids from https://pci-ids.ucw.cz/ 2. Added pci-ids-convert.py to convert to epan/dissectors/pci-ids.c PCI-IDS: Updated the PCI ID list to be Version 2021.01.11 NCSI: Remove trailing spaces and unused href entries PCI-IDS: Use a fresh copy of pci.ids to generate pci-ids.c 1. Renamed pci-ids-convert.py to make-pci-ids.py 2. make-pci-ids.py uses a fresh copy of pic.ids to generate pci-ids.c PCI-IDS: Move internal structure to C file 1. Move pci_id_t and pci_vid_index_t from header file to C file. 2. Refined the comments of pci-ids.c 3. Renamed local variable index (shadow variable) to idx PCI-IDS: Refined binary search codes PCI-IDS: Moved pci-ids.[ch] to epan/ Moved pci-ids.[ch] to epan/ as they ought to be
2021-02-17 07:10:31 +00:00
hex_int = int(words[0], 16)
svid = hex_int
if all(c in string.hexdigits for c in words[1]):
NCSI: Squash commits of NCSI and PCI-IDS NCSI: Extends NCSI dissection based on DSP0222 Version: 1.2.0_2b Add pci-ids.c and pci-ids.h for mapping PCI IDs(VID,DID,SID,SVID) to string. Extends NCSI dissection to support DSP0222 Version: 1.2.0_2b. Extends NCSI dissection to support Mellanox OEM commands. NCSI: Use TFS for boolean mapped string and added AEN dissectors 1. Use the tfs defined in tfs.c 2. Refine the boolean mapped strings to be TFS style 3. Added dissectors for AEN NSCI: Fixed erros with gcc 7.5.0 1. Fix compiling errors with gcc 7.5.0 under Ubuntu 18.04 2. Sloved complaints of git pre-commit hook NCSI: Add "0x" prefix for displaying HEX values There are codes display HEX values without prefix, added "0x" to fix that. PCI-IDS: Added PCI ID file and python script to convert it to C codes 1. Added the PCI ID file pci.ids from https://pci-ids.ucw.cz/ 2. Added pci-ids-convert.py to convert to epan/dissectors/pci-ids.c PCI-IDS: Updated the PCI ID list to be Version 2021.01.11 NCSI: Remove trailing spaces and unused href entries PCI-IDS: Use a fresh copy of pci.ids to generate pci-ids.c 1. Renamed pci-ids-convert.py to make-pci-ids.py 2. make-pci-ids.py uses a fresh copy of pic.ids to generate pci-ids.c PCI-IDS: Move internal structure to C file 1. Move pci_id_t and pci_vid_index_t from header file to C file. 2. Refined the comments of pci-ids.c 3. Renamed local variable index (shadow variable) to idx PCI-IDS: Refined binary search codes PCI-IDS: Moved pci-ids.[ch] to epan/ Moved pci-ids.[ch] to epan/ as they ought to be
2021-02-17 07:10:31 +00:00
hex_int = int(words[1], 16)
ssid = hex_int
out_lines += "{0x%04X, 0x%04X, 0x%04X, 0x%04X, \"%s(0x%04X-0x%04X)\"},\n" % (vid, did, svid, ssid, words[2].strip(), svid, ssid)
entries += 1
svid = -1
ssid = -1
continue
out_lines += "}; /* pci_vid_%04X[] */\n" % (vid)
NCSI: Squash commits of NCSI and PCI-IDS NCSI: Extends NCSI dissection based on DSP0222 Version: 1.2.0_2b Add pci-ids.c and pci-ids.h for mapping PCI IDs(VID,DID,SID,SVID) to string. Extends NCSI dissection to support DSP0222 Version: 1.2.0_2b. Extends NCSI dissection to support Mellanox OEM commands. NCSI: Use TFS for boolean mapped string and added AEN dissectors 1. Use the tfs defined in tfs.c 2. Refine the boolean mapped strings to be TFS style 3. Added dissectors for AEN NSCI: Fixed erros with gcc 7.5.0 1. Fix compiling errors with gcc 7.5.0 under Ubuntu 18.04 2. Sloved complaints of git pre-commit hook NCSI: Add "0x" prefix for displaying HEX values There are codes display HEX values without prefix, added "0x" to fix that. PCI-IDS: Added PCI ID file and python script to convert it to C codes 1. Added the PCI ID file pci.ids from https://pci-ids.ucw.cz/ 2. Added pci-ids-convert.py to convert to epan/dissectors/pci-ids.c PCI-IDS: Updated the PCI ID list to be Version 2021.01.11 NCSI: Remove trailing spaces and unused href entries PCI-IDS: Use a fresh copy of pci.ids to generate pci-ids.c 1. Renamed pci-ids-convert.py to make-pci-ids.py 2. make-pci-ids.py uses a fresh copy of pic.ids to generate pci-ids.c PCI-IDS: Move internal structure to C file 1. Move pci_id_t and pci_vid_index_t from header file to C file. 2. Refined the comments of pci-ids.c 3. Renamed local variable index (shadow variable) to idx PCI-IDS: Refined binary search codes PCI-IDS: Moved pci-ids.[ch] to epan/ Moved pci-ids.[ch] to epan/ as they ought to be
2021-02-17 07:10:31 +00:00
count_list.append(entries)
out_lines += "\npci_vid_index_t pci_vid_index[] = {\n"
vendor_count = len(id_list)
device_count = 0
for i in range(vendor_count):
out_lines += "{0x%04X, %d, pci_vid_%04X },\n" % (id_list[i], count_list[i], id_list[i])
device_count += count_list[i]
out_lines += "}; /* We have %d VIDs */\n" % (vendor_count)
out_lines += CODE_POSTFIX
NCSI: Squash commits of NCSI and PCI-IDS NCSI: Extends NCSI dissection based on DSP0222 Version: 1.2.0_2b Add pci-ids.c and pci-ids.h for mapping PCI IDs(VID,DID,SID,SVID) to string. Extends NCSI dissection to support DSP0222 Version: 1.2.0_2b. Extends NCSI dissection to support Mellanox OEM commands. NCSI: Use TFS for boolean mapped string and added AEN dissectors 1. Use the tfs defined in tfs.c 2. Refine the boolean mapped strings to be TFS style 3. Added dissectors for AEN NSCI: Fixed erros with gcc 7.5.0 1. Fix compiling errors with gcc 7.5.0 under Ubuntu 18.04 2. Sloved complaints of git pre-commit hook NCSI: Add "0x" prefix for displaying HEX values There are codes display HEX values without prefix, added "0x" to fix that. PCI-IDS: Added PCI ID file and python script to convert it to C codes 1. Added the PCI ID file pci.ids from https://pci-ids.ucw.cz/ 2. Added pci-ids-convert.py to convert to epan/dissectors/pci-ids.c PCI-IDS: Updated the PCI ID list to be Version 2021.01.11 NCSI: Remove trailing spaces and unused href entries PCI-IDS: Use a fresh copy of pci.ids to generate pci-ids.c 1. Renamed pci-ids-convert.py to make-pci-ids.py 2. make-pci-ids.py uses a fresh copy of pic.ids to generate pci-ids.c PCI-IDS: Move internal structure to C file 1. Move pci_id_t and pci_vid_index_t from header file to C file. 2. Refined the comments of pci-ids.c 3. Renamed local variable index (shadow variable) to idx PCI-IDS: Refined binary search codes PCI-IDS: Moved pci-ids.[ch] to epan/ Moved pci-ids.[ch] to epan/ as they ought to be
2021-02-17 07:10:31 +00:00
if vendor_count < MIN_VENDOR_COUNT:
exit_msg(f'Too view vendors. Wanted {MIN_VENDOR_COUNT}, got {vendor_count}.')
NCSI: Squash commits of NCSI and PCI-IDS NCSI: Extends NCSI dissection based on DSP0222 Version: 1.2.0_2b Add pci-ids.c and pci-ids.h for mapping PCI IDs(VID,DID,SID,SVID) to string. Extends NCSI dissection to support DSP0222 Version: 1.2.0_2b. Extends NCSI dissection to support Mellanox OEM commands. NCSI: Use TFS for boolean mapped string and added AEN dissectors 1. Use the tfs defined in tfs.c 2. Refine the boolean mapped strings to be TFS style 3. Added dissectors for AEN NSCI: Fixed erros with gcc 7.5.0 1. Fix compiling errors with gcc 7.5.0 under Ubuntu 18.04 2. Sloved complaints of git pre-commit hook NCSI: Add "0x" prefix for displaying HEX values There are codes display HEX values without prefix, added "0x" to fix that. PCI-IDS: Added PCI ID file and python script to convert it to C codes 1. Added the PCI ID file pci.ids from https://pci-ids.ucw.cz/ 2. Added pci-ids-convert.py to convert to epan/dissectors/pci-ids.c PCI-IDS: Updated the PCI ID list to be Version 2021.01.11 NCSI: Remove trailing spaces and unused href entries PCI-IDS: Use a fresh copy of pci.ids to generate pci-ids.c 1. Renamed pci-ids-convert.py to make-pci-ids.py 2. make-pci-ids.py uses a fresh copy of pic.ids to generate pci-ids.c PCI-IDS: Move internal structure to C file 1. Move pci_id_t and pci_vid_index_t from header file to C file. 2. Refined the comments of pci-ids.c 3. Renamed local variable index (shadow variable) to idx PCI-IDS: Refined binary search codes PCI-IDS: Moved pci-ids.[ch] to epan/ Moved pci-ids.[ch] to epan/ as they ought to be
2021-02-17 07:10:31 +00:00
if device_count < MIN_DEVICE_COUNT:
exit_msg(f'Too view devices. Wanted {MIN_DEVICE_COUNT}, got {device_count}.')
NCSI: Squash commits of NCSI and PCI-IDS NCSI: Extends NCSI dissection based on DSP0222 Version: 1.2.0_2b Add pci-ids.c and pci-ids.h for mapping PCI IDs(VID,DID,SID,SVID) to string. Extends NCSI dissection to support DSP0222 Version: 1.2.0_2b. Extends NCSI dissection to support Mellanox OEM commands. NCSI: Use TFS for boolean mapped string and added AEN dissectors 1. Use the tfs defined in tfs.c 2. Refine the boolean mapped strings to be TFS style 3. Added dissectors for AEN NSCI: Fixed erros with gcc 7.5.0 1. Fix compiling errors with gcc 7.5.0 under Ubuntu 18.04 2. Sloved complaints of git pre-commit hook NCSI: Add "0x" prefix for displaying HEX values There are codes display HEX values without prefix, added "0x" to fix that. PCI-IDS: Added PCI ID file and python script to convert it to C codes 1. Added the PCI ID file pci.ids from https://pci-ids.ucw.cz/ 2. Added pci-ids-convert.py to convert to epan/dissectors/pci-ids.c PCI-IDS: Updated the PCI ID list to be Version 2021.01.11 NCSI: Remove trailing spaces and unused href entries PCI-IDS: Use a fresh copy of pci.ids to generate pci-ids.c 1. Renamed pci-ids-convert.py to make-pci-ids.py 2. make-pci-ids.py uses a fresh copy of pic.ids to generate pci-ids.c PCI-IDS: Move internal structure to C file 1. Move pci_id_t and pci_vid_index_t from header file to C file. 2. Refined the comments of pci-ids.c 3. Renamed local variable index (shadow variable) to idx PCI-IDS: Refined binary search codes PCI-IDS: Moved pci-ids.[ch] to epan/ Moved pci-ids.[ch] to epan/ as they ought to be
2021-02-17 07:10:31 +00:00
with open(OUTPUT_FILE, "w", encoding="utf-8") as pci_ids_f:
pci_ids_f.write(out_lines)
NCSI: Squash commits of NCSI and PCI-IDS NCSI: Extends NCSI dissection based on DSP0222 Version: 1.2.0_2b Add pci-ids.c and pci-ids.h for mapping PCI IDs(VID,DID,SID,SVID) to string. Extends NCSI dissection to support DSP0222 Version: 1.2.0_2b. Extends NCSI dissection to support Mellanox OEM commands. NCSI: Use TFS for boolean mapped string and added AEN dissectors 1. Use the tfs defined in tfs.c 2. Refine the boolean mapped strings to be TFS style 3. Added dissectors for AEN NSCI: Fixed erros with gcc 7.5.0 1. Fix compiling errors with gcc 7.5.0 under Ubuntu 18.04 2. Sloved complaints of git pre-commit hook NCSI: Add "0x" prefix for displaying HEX values There are codes display HEX values without prefix, added "0x" to fix that. PCI-IDS: Added PCI ID file and python script to convert it to C codes 1. Added the PCI ID file pci.ids from https://pci-ids.ucw.cz/ 2. Added pci-ids-convert.py to convert to epan/dissectors/pci-ids.c PCI-IDS: Updated the PCI ID list to be Version 2021.01.11 NCSI: Remove trailing spaces and unused href entries PCI-IDS: Use a fresh copy of pci.ids to generate pci-ids.c 1. Renamed pci-ids-convert.py to make-pci-ids.py 2. make-pci-ids.py uses a fresh copy of pic.ids to generate pci-ids.c PCI-IDS: Move internal structure to C file 1. Move pci_id_t and pci_vid_index_t from header file to C file. 2. Refined the comments of pci-ids.c 3. Renamed local variable index (shadow variable) to idx PCI-IDS: Refined binary search codes PCI-IDS: Moved pci-ids.[ch] to epan/ Moved pci-ids.[ch] to epan/ as they ought to be
2021-02-17 07:10:31 +00:00
if __name__ == '__main__':
main()