Modafinil is classed as a Schedule 4 narcotic. It's definitely not an OTC medication. Examples of other Schedule 4 medications: Xanax and Valium.
Actually modafinil is a schedule 4 stimulant (which matters in some states). And Pharm.D.s can get into an agreement with Physicians to dispense medication on their behalf as they see fit, it's called Collaborative drug therapy management.