Inv message structure
As you can see in the protocol documentation the inv-object contains a field inventory (Inventory Vector). 

Inv-Object:



Inventory Vector:



You need to check the type field to know what the other node is sending. You will always receive a hash value, which is the identifier of a block or transaction.