Efficient and flexible geocasting for opportunistic networks