Implement feature #417

This code implement the feature #417.
See: https://redmine.openinfosecfoundation.org/issues/417
for more details.