#!/bin/bash
usage()
{
	cat <<EOF
Usage: $0 [options]

Options:
    -s       Show package name and version number.
    -n       Show numerical version number only.
    -l       List installed packages details (Default option).
EOF
}
if [ "X$1" == "X-s" ]; then echo OFED-internal-26.01-1.0.0:; exit 0; fi
if [ "X$1" == "X-n" ]; then echo 26.01-1.0.0; exit 0; fi
if [ "X$1" != "X-l" ] && [ "X$1" != "X" ]; then usage; exit 1; fi

cat << EOF
OFED-internal-26.01-1.0.0:

clusterkit:
mlnx_ofed_clusterkit/clusterkit-1.15.475-1.20260211.db5c406.src.rpm

dpcp:
https://doca-repo-prod.nvidia.com/public-nsb/repo/doca/prime/generic-rpm/x86_64/dpcp/1.1.59-1/dpcp-1.1.59-1.src.rpm
ibarr:
https://doca-repo-prod.nvidia.com/public-nsb/repo/doca/prime/generic-rpm/x86_64/ibarr/2601.0.0-1/ibarr-2601.0.0-1.src.rpm
ibdump:
https://doca-repo-prod.nvidia.com/public-nsb/repo/doca/prime/generic-rpm/x86_64/ibdump/6.0.0-2/ibdump-6.0.0-2.src.rpm
ibsim:
https://doca-repo-prod.nvidia.com/public-nsb/repo/doca/prime/generic-rpm/x86_64/ibsim/0.12.1-4/ibsim-0.12.1-4.src.rpm
ibutils2:
https://doca-repo-prod.nvidia.com/public-nsb/repo/doca/prime/generic-rpm/x86_64/ibutils2/2.1.1-0.22400.MLNX202601152019.ge04c0b67f/ibutils2-2.1.1-0.22400.MLNX202601152019.ge04c0b67f.src.rpm
iser:
https://git-nbu.nvidia.com/r/a/mlnx_ofed/mlnx-ofa_kernel-4.0.git mlnx_ofed_26_01
commit 3735cf8688bf9d9bd5a425b0780a10c506abd04e

isert:
https://git-nbu.nvidia.com/r/a/mlnx_ofed/mlnx-ofa_kernel-4.0.git mlnx_ofed_26_01
commit 3735cf8688bf9d9bd5a425b0780a10c506abd04e

kernel-mft:
mlnx_ofed_mft/kernel-mft-4.35.0-159.src.rpm

libvma:
https://doca-repo-prod.nvidia.com/public-nsb/repo/doca/prime/generic-rpm/x86_64/libvma/9.8.84-1/libvma-9.8.84-1.src.rpm
libxlio:
/sw/release/sw_acceleration/xlio/libxlio-3.61.2-1.src.rpm

mlnx-ethtool:
https://doca-repo-prod.nvidia.com/public-nsb/repo/doca/prime/generic-rpm/x86_64/mlnx-ethtool/2601.0.2-1/mlnx-ethtool-2601.0.2-1.src.rpm
mlnx-iproute2:
https://doca-repo-prod.nvidia.com/public-nsb/repo/doca/prime/generic-rpm/x86_64/mlnx-iproute2/2601.0.6-1/mlnx-iproute2-2601.0.6-1.src.rpm
mlnx-nfsrdma:
https://git-nbu.nvidia.com/r/a/mlnx_ofed/mlnx-ofa_kernel-4.0.git mlnx_ofed_26_01
commit 3735cf8688bf9d9bd5a425b0780a10c506abd04e

mlnx-nvme:
https://git-nbu.nvidia.com/r/a/mlnx_ofed/mlnx-ofa_kernel-4.0.git mlnx_ofed_26_01
commit 3735cf8688bf9d9bd5a425b0780a10c506abd04e

mlnx-ofa_kernel:
https://git-nbu.nvidia.com/r/a/mlnx_ofed/mlnx-ofa_kernel-4.0.git mlnx_ofed_26_01
commit 3735cf8688bf9d9bd5a425b0780a10c506abd04e

mlnx-tools:
https://doca-repo-prod.nvidia.com/public-nsb/repo/doca/prime/generic-rpm/x86_64/mlnx-tools/2601.0.2-1/mlnx-tools-2601.0.2-1.src.rpm
mlx-steering-dump:
https://doca-repo-prod.nvidia.com/public-nsb/repo/doca/prime/generic-rpm/x86_64/mlx-steering-dump/1.0.0-1/mlx-steering-dump-1.0.0-1.src.rpm
multiperf:
https://git-nbu.nvidia.com/r/a/Performance/multiperf rdma-core-support
commit d3fad92dc6984e43cc5377ba0a3126808432ce2d

ofed-docs:
https://git-nbu.nvidia.com/r/a/mlnx_ofed/ofed-docs.git mlnx_ofed-4.0
commit 3d1b0afb7bc190ae5f362223043f76b2b45971cc

openmpi:
mlnx_ofed_ompi_1.8/openmpi-4.1.9a1-1.20260211.81d402c97a.src.rpm

opensm:
mlnx_ofed_opensm/opensm-5.26.1-202601271032.8c07ef43.tar.gz

openvswitch:
https://git-nbu.nvidia.com/r/a/sdn/ovs.git 3.3_head
commit 7b1c64c2d4109b7c98635cb7d92a57da5f143588

perftest:
https://doca-repo-prod.nvidia.com/public-nsb/repo/doca/prime/generic-rpm/x86_64/perftest/26.01.5-1/perftest-26.01.5-1.src.rpm
rdma-core:
https://doca-repo-prod.nvidia.com/public-nsb/repo/doca/prime/generic-rpm/x86_64/rdma-core/2601.0.7-1/rdma-core-2601.0.7-1.src.rpm
rshim:
/sw_mc_soc_release/packages//rshim-2.6.6-0.g0ff6d20.src.rpm

sockperf:
https://doca-repo-prod.nvidia.com/public-nsb/repo/doca/prime/generic-rpm/x86_64/sockperf/3.1-1/sockperf-3.1-1.src.rpm
srp:
https://git-nbu.nvidia.com/r/a/mlnx_ofed/mlnx-ofa_kernel-4.0.git mlnx_ofed_26_01
commit 3735cf8688bf9d9bd5a425b0780a10c506abd04e

ucx:
mlnx_ofed_ucx/ucx-1.20.0-1.20260211.d9a4f352d.src.rpm

virtiofs:
https://git-nbu.nvidia.com/r/a/mlnx_ofed/mlnx-ofa_kernel-4.0.git mlnx_ofed_26_01
commit 3735cf8688bf9d9bd5a425b0780a10c506abd04e

xpmem:
https://doca-repo-prod.nvidia.com/public-nsb/repo/doca/prime/generic-rpm/x86_64/xpmem/2601.0.9-1/dkms/xpmem-2601.0.9-1.src.rpm
EOF

echo
echo Installed Packages:
echo -------------------

pkglist1=
pkglist2=

if [ -x /usr/bin/dpkg ]; then
    pkglist1=$(dpkg --list | grep -E "clusterkit|doca-openvswitch-common|doca-openvswitch-ipsec|doca-openvswitch-pki|doca-openvswitch-source|doca-openvswitch-switch|doca-openvswitch-test|doca-openvswitch-testcontroller|doca-openvswitch-vtep|python3-doca-openvswitch|doca-openvswitch-dev|dpcp|ibarr|ibdump|ibsim|ibsim-doc|ibutils2|iser-dkms|isert-dkms|kernel-mft-dkms|libvma|libvma-dev|libvma-dbg|libvma-utils|libxlio|libxlio-dev|libxlio-dbg|libxlio-utils|mlnx-ethtool|mlnx-iproute2|mlnx-nfsrdma-dkms|mlnx-nvme-dkms|mlnx-ofed-kernel-utils|mlnx-ofed-kernel-dkms|mlnx-tools|mlx-steering-dump|openmpi|opensm|opensm-doc|libopensm|libopensm-devel|perftest|rdma-core|ibacm|ibverbs-providers|ibverbs-utils|libibverbs-dev|libibverbs1|libibumad-dev|libibumad3|librdmacm-dev|librdmacm1|rdmacm-utils|srptools|python3-pyverbs|infiniband-diags|libibmad5|libibmad-dev|libibnetdisc5|libibnetdisc-dev|rshim|__APP_NAME__|srp-dkms|ucx-dev|ucx|ucx-xpmem|ucx-cuda|ucx-gdrcopy|ucx-ib-mlx5-gda|virtiofs-dkms|xpmem|libxpmem-dev|libxpmem0|xpmem-dkms|xpmem-modules")
fi

if (which rpm >/dev/null 2>&1); then
    pkglist2=$(rpm -qa --queryformat "[%{NAME}]
" | grep -E "kernel-ib|clusterkit|dpcp|ibarr|ibdump|ibsim|ibutils2|^iser|kmod-iser|iser.*kmp|^isert|kmod-isert|isert.*kmp|kernel-mft|libvma|libxlio|mlnx-ethtool|mlnx-iproute2|mlnx-nfsrdma|mlnx-nvme|mlnx-ofa_kernel|mlnx-tools|mlx-steering-dump|multiperf|ofed-docs|openmpi|opensm|openvswitch|perftest|rdma-core|ibacm|libibcm|libibumad|libibverbs|librdmacm|srp_daemon|infiniband-diags|python3-pyverbs|rshim|sockperf|^srp$|kmod-srp|srp.*kmp|ucx|^virtiofs$|kmod-virtiofs|virtiofs.*kmp|xpmem|neohost-backend|neohost-sdk")
fi

echo -e "$pkglist1"
echo -e "$pkglist2"
