How to implement direct and indirect sales?

How to implement direct and indirect sales?

Our sales comprises both direct sales ( i.e. selling direct to end-customer) and indirect sales where a reseller sells the services to the end-customer. In both cases we want the opportunity listed on the end-customer but we need to know when and which reseller is involved.How to implement such a sales channel structure?