>>12808271mass has different definitions, but the most common is rest mass (measured at a given energy scale). formally you could identify it with a term in the lagrangian—if a field X has a term that looks like m*X^2 then m is the rest mass of the quanta of that field. photons have no such term
>>12808295yes, the rest mass of quarks contributes only a tiny fraction of proton and neutron test masses. the bulk of their mass comes from their zipping around, and this kinetic energy is supported by the exchange of gluons and virtual hadrons inside the nucleons