This function returns one of the following values:
0 if successful.
-1 if the filter is not one of the types listed above.