For the discrete logarithm The possible values of include all prime numbers < p that result in being cyclic. You can find all g values on this site: https://asecuritysite.com/elgamal/pickg Commonly, Diffie Hellman exchanges use the smallest possible g value.