How can we generate an itp file for dihedral restraint?

GROMACS version: 2021.4
GROMACS modification: Yes/No NO


I would like to generate an dihedral restraints file (with the directive function, angle and force constants) for a long list a 4 atoms. it is possible to do this with a GROMACS tool or a script.

Thanks in advance