Exchange interactions in R2M17 (M=Fe, Co, Ni) heavy rare-earth compounds