We consider jamming in wireless networks with transmission cost for both transmitter and jammer. We use the framework of non-zerosum games. In particular, we prove the existence and uniqueness of Nash equilibrium. It turns out that it is possible to provide analytical expressions for the equilibrium strategies. These expressions is a generalization of the standard water-filling. In fact, since we take into account the cost of transmission, we obtain even a generalization of the water-filling in the case of one player game. The present framework allows us to study both water-filling in time and water-filling in frequency. By means of numerical examples we study an important particular case of jamming of the OFDM system when the jammer is situated close to the base station.