I expected my son to play with his little manhood more than he does. Sometimes when I am changing his diaper, he will pull on it and announce that he is doing it, with great glee. But he is always willing to take his hand off it when I put the diaper on. Thankfully, some things are less physically enticing at age 3 than they might be at age 15.
My suggestion is to discuss the concepts of what one can do in public and what one must do only in private, preferably about something else first (such as nudity after the bath). Be sure they know that some things that are OK in private are not OK in public. Once the kids understand the notion of private and public, you can let them know, as specialmom says, that those things are private.
My little cousin (female) used to rub her diapered clitoral region on the arm of the sofa, apparently masturbating or doing something close to it. Her mom handled it by telling her she had to do such activity alone in her bedroom. She wanted to be with the family more than she wanted to do it, so she stopped.
What I take from the fact that my son readily stops handling himself when we move on with the diaper change, and that my cousin stopped because she would rather be with the family, is that when a child is just a toddler, they really don't care all *that* much about touching themselves. Because of that, you handling it calmly is better than adding a boatload of shame-shame-shames to the discussion.
I think it is pretty normal for little boys to do this. I've got two little guys myself. Honestly, I just tell them we don't play with ourselves. They don't really care. They just stop. If they do it in their room then so be it. But I'm not inclined to allow it at the dinner table if you know what I mean. I don't go all crazy about it or lecture them or anything. I just put a stop on it when it is in public or even in the bathtub and I'm there. In your room by yourself-------- okay. With others around, not okay. And it is not something my kids do much. It is not something I make that big of a deal about. So, I don't think life long issues will come from it. Anyway, that is just how I handle it. good luck