Contributes to the lung's defense against inhaled microorganisms, organic antigens and toxins. Interacts with compounds such as bacterial lipopolysaccharides, oligosaccharides and fatty acids and modulates leukocyte action in immune response. May participate in the extracellular reorganization or turnover of pulmonary surfactant. Binds strongly maltose residues and to a lesser extent other alpha- glucosyl moieties. . This is the function of SFTPD (surfactant protein D, ENSG00000133661).