An Efficient Distributed Trust Model for Wireless Sensor Networks