def get_dependencies(primary_type, types):
    """
    Perform DFS to get all the dependencies of the primary_type
    """
    deps = set()
    struct_names_yet_to_be_expanded = [primary_type]
    while len(struct_names_yet_to_be_expanded) > 0:
        struct_name = struct_names_yet_to_be_expanded.pop()
        deps.add(struct_name)
        fields = types[struct_name]
        for field in fields:
            if field['type'] not in types:
                continue
            elif field['type'] in deps:
                continue
            else:
                struct_names_yet_to_be_expanded.append(field['type'])
    deps.remove(primary_type)
    return tuple(deps)
